TransGaze-Object:Transformer直接预测驾驶员注视物体类别

论文信息

项目 内容
标题 TransGaze-Object: Transformer Based Driver Gaze Object Prediction Framework in Real Driving
发表 2026(arXiv:2609.10139)
链接 https://pith.science/paper/2609.10139
核心发现 直接gaze-object预测比point-of-gaze关联高8.5个百分点

核心创新

传统管线:视线估计→投射到场景→关联最近物体。TransGaze-Object 跳过中间步骤,直接从面部图像预测注视物体类别。

1. 方法对比

1.1 传统管线 vs 直接预测

方法 步骤 问题
传统(两步) 视线估计→投射→最近物体 误差累积
TransGaze(直接) 面部→物体类别 端到端

1.2 性能

指标 传统PoG关联 TransGaze-Object 提升
准确率 76.5% 85.0% +8.5pp
推理速度 慢(多步) 快(单步) 显著

2. 架构

2.1 Transformer物体预测

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
import torch
import torch.nn as nn

class TransGazeObject(nn.Module):
"""
TransGaze-Object: 直接预测注视物体类别

输入: 驾驶员面部 + 场景图像
输出: 注视物体类别 + 置信度

物体类别: 道路/后视镜/仪表盘/中控屏/手机/乘客/窗外/其他
"""

GAZE_OBJECTS = [
'road', 'left_mirror', 'right_mirror',
'instrument_cluster', 'center_display',
'phone', 'passenger_seat', 'window', 'other'
]

def __init__(self, n_classes: int = 9, d_model: int = 256):
super().__init__()

# 面部编码器(Vision Transformer)
self.face_patch = nn.Conv2d(3, d_model, 16, stride=16)
self.face_pos = nn.Parameter(torch.randn(1, 64, d_model))
self.face_encoder = nn.TransformerEncoder(
nn.TransformerEncoderLayer(d_model, nhead=8, batch_first=True),
num_layers=4
)

# 场景编码器
self.scene_patch = nn.Conv2d(3, d_model, 16, stride=16)
self.scene_pos = nn.Parameter(torch.randn(1, 256, d_model))
self.scene_encoder = nn.TransformerEncoder(
nn.TransformerEncoderLayer(d_model, nhead=8, batch_first=True),
num_layers=4
)

# 跨模态注意力
self.cross_attn = nn.MultiheadAttention(
d_model, num_heads=8, batch_first=True
)

# 物体分类头
self.classifier = nn.Sequential(
nn.Linear(d_model, 128), nn.ReLU(),
nn.Linear(128, n_classes)
)

def forward(self, face: torch.Tensor, scene: torch.Tensor) -> dict:
"""
Args:
face: (B, 3, 128, 128)
scene: (B, 3, 256, 256)
"""
# 面部tokens
face_tokens = self.face_patch(face).flatten(2).permute(0, 2, 1)
face_tokens = face_tokens + self.face_pos[:, :face_tokens.size(1)]
face_tokens = self.face_encoder(face_tokens)

# 场景tokens
scene_tokens = self.scene_patch(scene).flatten(2).permute(0, 2, 1)
scene_tokens = scene_tokens + self.scene_pos[:, :scene_tokens.size(1)]
scene_tokens = self.scene_encoder(scene_tokens)

# 跨模态:面部查询场景
gaze_features, _ = self.cross_attn(
face_tokens, scene_tokens, scene_tokens
)

# 物体分类
pooled = gaze_features.mean(dim=1)
logits = self.classifier(pooled)

return {
'gaze_object': logits,
'attention': _,
'predicted_object': TransGazeObject.GAZE_OBJECTS
}


if __name__ == "__main__":
model = TransGazeObject(n_classes=9)
face = torch.randn(4, 3, 128, 128)
scene = torch.randn(4, 3, 256, 256)

out = model(face, scene)
print(f"注视物体: {out['gaze_object'].shape}")
print(f"类别: {out['predicted_object']}")

3. IMS应用

3.1 分心检测直接映射

预测物体 Euro NCAP场景 风险等级
road 正常驾驶 安全
left/right_mirror 后视镜检查 安全
instrument_cluster 仪表检查 安全(短暂)
center_display 导航查看 注意
phone D-02/D-03手机使用 🔴 危险
passenger_seat 社交分心 中等
window 隧道凝视 走神

3.2 简化DMS管线

传统DMS: 检测面部→估计视线→投射→区域判定→分心决策
TransGaze: 检测面部→直接预测物体→分心决策

减少3个步骤,降低累积误差。

4. 总结

对IMS团队:

  • 评估 端到端物体预测vs传统管线
  • 定义 驾驶场景物体类别
  • 优势 +8.5pp准确率,更少步骤
  • 挑战 需要物体级标注数据

论文: https://pith.science/paper/2609.10139