BFA-HARF:RGB-热红外双向特征对齐融合跟踪——全天候座舱感知新框架

发布时间: 2026-09-17
标签: RGB-T, 热红外, 双向特征对齐, 混合注意力, 目标跟踪, 座舱感知, 夜间DMS


论文信息

项目 详情
标题 BFA-HARF: Robust RGB-T tracking via bidirectional feature adapter and hybrid attention with receptive fields
作者 Xu C, Xia W, Fan L, Zhang Y (2026)
来源 BioEngineer
领域 计算机视觉, 多模态融合

核心创新

BFA-HARF提出了一种RGB-热红外(RGB-T)双向特征对齐框架,通过混合注意力融合实现全天候目标跟踪:

  1. 双向特征适配器(BFA) — RGB和热红外特征双向对齐
  2. 混合注意力+感受野(HARF) — 多感受野注意力增强融合
  3. 全天候鲁棒性 — 可见光不足时热红外补偿

RGB-T融合对座舱感知的价值

场景 仅RGB 仅热红外 RGB-T融合
白天DMS ✅ 好 ⚠️ 细节差 ✅ 最佳
夜间DMS ❌ 差 ✅ 好 ✅ 最佳
隧道出入口 ⚠️ 过曝/欠曝 ✅ 稳定 ✅ 最佳
强逆光 ❌ 面部暗 ✅ 稳定 ✅ 最佳
戴口罩 ⚠️ 部分遮挡 ✅ 热特征 ✅ 补偿
墨镜 ❌ 眼睛不可见 ⚠️ 玻璃遮挡红外 ⚠️ 均受限

技术详解

1. 双向特征适配器(BFA)

graph LR
    A[RGB特征] --> B[BFA-RGB→T<br/>可见光特征适配到热红外空间]
    C[热红外特征] --> D[BFA-T→RGB<br/>热红外特征适配到可见光空间]
    B --> E[对齐的RGB特征]
    D --> F[对齐的T特征]
    E --> G[混合注意力融合]
    F --> G
    G --> H[融合特征]
    H --> I[目标跟踪]
    
    style B fill:#4a9
    style D fill:#4a9
    style G fill:#fa0

2. 混合注意力+感受野(HARF)

组件 功能 说明
多感受野分支 不同膨胀率的卷积 捕获不同尺度特征
通道注意力 SE/CBAM 选择重要通道
空间注意力 空间权重图 聚焦重要区域
融合策略 加性+乘性 双重融合

3. 座舱RGB-T融合架构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import torch
import torch.nn as nn

class CabinRGBTFusion(nn.Module):
"""
座舱RGB-热红外融合DMS框架

基于BFA-HARF: bidirectional feature adapter + hybrid attention
"""

def __init__(self, hidden_dim: int = 256):
super().__init__()

# RGB编码器 (轻量级)
self.rgb_encoder = self._build_encoder(3, hidden_dim)

# 热红外编码器
self.thermal_encoder = self._build_encoder(1, hidden_dim)

# 双向特征适配器
self.bfa_rgb_to_t = BidirectionalFeatureAdapter(hidden_dim)
self.bfa_t_to_rgb = BidirectionalFeatureAdapter(hidden_dim)

# 混合注意力融合
self.harf_fusion = HybridAttentionRF(hidden_dim)

# DMS任务头
self.fatigue_head = nn.Linear(hidden_dim, 2) # 疲劳/正常
self.distraction_head = nn.Linear(hidden_dim, 5) # 5类分心
self.gaze_head = nn.Linear(hidden_dim, 9) # 9区域视线

def _build_encoder(self, in_channels, dim):
return nn.Sequential(
nn.Conv2d(in_channels, 64, 7, 2, 3),
nn.BatchNorm2d(64), nn.SiLU(),
self._res_block(64, 128, 2),
self._res_block(128, 256, 2),
self._res_block(256, dim, 1),
)

def _res_block(self, in_c, out_c, stride):
return nn.Sequential(
nn.Conv2d(in_c, out_c, 3, stride, 1),
nn.BatchNorm2d(out_c), nn.SiLU(),
nn.Conv2d(out_c, out_c, 3, 1, 1),
nn.BatchNorm2d(out_c),
nn.SiLU(),
)

def forward(self, rgb, thermal):
"""
Args:
rgb: [B, 3, H, W] 可见光图像
thermal: [B, 1, H, W] 热红外图像

Returns:
fatigue, distraction, gaze 预测
"""
# 编码
rgb_feat = self.rgb_encoder(rgb)
t_feat = self.thermal_encoder(thermal)

# 双向特征对齐
rgb_aligned = self.bfa_rgb_to_t(rgb_feat, t_feat)
t_aligned = self.bfa_t_to_rgb(t_feat, rgb_feat)

# 混合注意力融合
fused = self.harf_fusion(rgb_aligned, t_aligned)

# 全局池化
pooled = torch.mean(fused, dim=[2, 3])

# 多任务输出
fatigue = self.fatigue_head(pooled)
distraction = self.distraction_head(pooled)
gaze = self.gaze_head(pooled)

return {
'fatigue': fatigue,
'distraction': distraction,
'gaze': gaze
}


class BidirectionalFeatureAdapter(nn.Module):
"""双向特征适配器"""

def __init__(self, dim):
super().__init__()
self.adapter = nn.Sequential(
nn.Conv2d(dim * 2, dim, 1),
nn.BatchNorm2d(dim),
nn.SiLU(),
nn.Conv2d(dim, dim, 3, 1, 1),
nn.BatchNorm2d(dim),
nn.Sigmoid(), # 生成权重
)

def forward(self, src_feat, ref_feat):
# 拼接后生成适配权重
weight = self.adapter(torch.cat([src_feat, ref_feat], dim=1))
return src_feat * weight + ref_feat * (1 - weight)


class HybridAttentionRF(nn.Module):
"""混合注意力+感受野"""

def __init__(self, dim):
super().__init__()
# 多感受野分支
self.branches = nn.ModuleList([
nn.Conv2d(dim, dim//3, 3, 1, d, dilation=d)
for d in [1, 2, 4] # 不同膨胀率
])
# 通道注意力
self.channel_att = nn.Sequential(
nn.AdaptiveAvgPool2d(1),
nn.Flatten(),
nn.Linear(dim, dim//8),
nn.SiLU(),
nn.Linear(dim//8, dim),
nn.Sigmoid(),
)
# 空间注意力
self.spatial_att = nn.Sequential(
nn.Conv2d(2, 1, 7, 1, 3),
nn.Sigmoid(),
)

def forward(self, rgb_feat, t_feat):
# 融合
x = rgb_feat + t_feat

# 多感受野
branches = [branch(x) for branch in self.branches]
x = torch.cat(branches, dim=1)

# 通道注意力
ca = self.channel_att(x).unsqueeze(-1).unsqueeze(-1)
x = x * ca

# 空间注意力
sa_input = torch.cat([
torch.mean(x, dim=1, keepdim=True),
torch.max(x, dim=1, keepdim=True)[0]
], dim=1)
sa = self.spatial_att(sa_input)
x = x * sa

return x


# 测试
if __name__ == "__main__":
model = CabinRGBTFusion(hidden_dim=256)

# 模拟输入
rgb = torch.randn(1, 3, 224, 224)
thermal = torch.randn(1, 1, 224, 224)

out = model(rgb, thermal)

print("=== 座舱RGB-T融合DMS ===")
print(f"疲劳检测: {out['fatigue'].shape}")
print(f"分心检测: {out['distraction'].shape}")
print(f"视线估计: {out['gaze'].shape}")
print(f"\n模型参数: {sum(p.numel() for p in model.parameters())/1e6:.2f}M")

座舱RGB-T融合应用

1. 全天候DMS

场景 RGB 热红外 融合方案 BFA-HARF优势
白天 PERCLOS+视线 辅助 RGB为主+T为辅 精度最佳
夜间 严重退化 PERCLOS+面部 T为主+RGB为辅 保持精度
隧道 HDR困难 稳定 自适应权重 无过渡抖动
逆光 面部暗 稳定 T补偿 不会漏检

2. OMS乘员检测

应用 RGB优势 热红外优势 融合价值
乘员检测 衣物颜色 体温特征 确认”活人”
儿童分类 体型 体型(热轮廓) 双重验证
宠物检测 毛色 体温差异 区分宠物/物品
安全带检测 可见 热对比 金属扣温度差

硬件方案

RGB-T双模传感器配置

配置 RGB传感器 热红外传感器 成本 说明
高端 OV2311 2MP FLIR Lepton 3.5 $80-120 独立热红外
中端 ST VD56GA 1.1MP Melexis MLX90640 $20-40 热红外阵列
经济 ST VD56GA 1.1MP 单像素热电堆 $5-10 仅温度检测
RGB-IR ST VD56GA (双模) 同一传感器 $8-12 分时IR/visible

推荐配置

车型 推荐方案 理由
高端车 独立RGB+热红外 全天候最优
中端车 RGB-IR双模 兼顾成本和性能
经济车 RGB + 单像素温度 低成本温度补偿

IMS开发启示

1. BFA-HARF的座舱迁移价值

BFA-HARF组件 座舱DMS迁移 价值
双向特征适配 RGB↔IR自适应对齐 夜间无缝切换
混合注意力 聚焦面部重要区域 提升PERCLOS精度
多感受野 适配不同驾驶员距离 距离鲁棒性

2. 部署建议

优先级 方案 时间线
🔴 P0 RGB-IR单传感器双模 2027 Q1
🟡 P1 RGB+热红外阵列(中端) 2027 Q3
🟢 P2 RGB+FLIR独立热红外 2028+

结论

BFA-HARF的RGB-T双向特征对齐为全天候座舱感知提供了理论框架。核心价值在于夜间和极端光照条件下保持DMS精度不退化

对IMS的核心启示: RGB-T融合是解决夜间DMS性能下降的最优路径。但考虑到成本,建议优先评估RGB-IR双模单传感器方案(如ST VD56GA),在无额外热红外传感器成本的情况下实现近似RGB-T的融合效果。


BFA-HARF:RGB-热红外双向特征对齐融合跟踪——全天候座舱感知新框架
https://dapalm.com/2026/09/17/2026-09-17-bfa-harf-rgb-thermal-fusion-cabin-dms-ims/
作者
Mars
发布于
2026年9月17日
许可协议