嵌入式增量混合ML驾驶员行为监测:在线学习与轻量推理的车载部署

论文信息

项目 内容
标题 Driver behavior monitoring: an embedded and incremental hybrid machine learning approach
作者 Hosseini, S.M., Kiani, V. & Sadoghi-Yazdi, H.
期刊 Computing, 108, 138 (Springer)
发表 2026年8月26日
DOI 10.1007/s00607-026-01730-0
关键词 embedded, incremental learning, hybrid ML, driver monitoring, online learning

核心创新

提出嵌入式+增量+混合的驾驶员行为监测框架,解决三个关键问题:

  1. 嵌入式约束:模型必须在有限算力MCU上运行
  2. 增量学习:新驾驶员数据持续学习,不需重新训练
  3. 混合架构:传统ML+深度学习混合,平衡精度和效率

方法

1. 混合架构

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
import torch
import numpy as np
from sklearn.ensemble import IsolationForest
from sklearn.svm import SVC

class EmbeddedIncrementalDMS:
"""
嵌入式增量混合ML驾驶员行为监测

三层架构:
1. 轻量特征提取(嵌入式友好)
2. 混合分类器(SVM+异常检测)
3. 增量更新(在线学习)
"""

def __init__(self):
# 轻量特征提取器(可在MCU上运行)
self.feature_extractor = LightweightFeatures()

# 混合分类器
self.normal_classifier = SVC(kernel='rbf') # 正常行为分类
self.anomaly_detector = IsolationForest( # 异常行为检测
n_estimators=50, contamination=0.05
)

# 增量学习缓冲区
self.update_buffer = []
self.update_threshold = 100 # 累积100样本更新

def process_frame(self, frame):
"""
实时处理(嵌入式部署)

延迟目标: <50ms (MCU)
"""
# 1. 轻量特征提取
features = self.feature_extractor.extract(frame)

# 2. 异常检测(先判断是否异常)
is_anomaly = self.anomaly_detector.predict([features])[0] == -1

if is_anomaly:
# 3a. 异常→详细分类
behavior = self.normal_classifier.predict([features])[0]
return behavior, True
else:
# 3b. 正常→无需详细分类
return "normal_driving", False

def incremental_update(self, new_data, labels=None):
"""
增量学习

无标签数据→更新异常检测器
有标签数据→更新分类器
"""
self.update_buffer.extend(new_data)

if len(self.update_buffer) >= self.update_threshold:
buffer = np.array(self.update_buffer)

if labels is not None:
# 有监督增量更新
self.normal_classifier.fit(
buffer, labels[:len(buffer)]
)
else:
# 无监督增量更新(异常检测)
self.anomaly_detector.fit(buffer)

self.update_buffer = []
return True
return False


class LightweightFeatures:
"""
轻量级特征提取(MCU友好)

不使用CNN,使用传统CV特征
"""

def extract(self, frame):
features = []

# 1. 图像统计特征(极低计算量)
features.extend([
np.mean(frame), np.std(frame),
np.mean(frame[:,:,0]), # R通道均值
np.mean(frame[:,:,1]), # G通道均值
np.mean(frame[:,:,2]), # B通道均值
])

# 2. 水平/垂直投影
gray = np.mean(frame, axis=2)
h_proj = np.sum(gray, axis=0) / gray.shape[0] # 水平投影
v_proj = np.sum(gray, axis=1) / gray.shape[1] # 垂直投影

# 降采样投影
features.extend(h_proj[:16]) # 16个水平投影值
features.extend(v_proj[:16]) # 16个垂直投影值

# 3. 简化LBP(局部二值模式)
lbp_hist = self._simplified_lbp(gray)
features.extend(lbp_hist)

return np.array(features) # ~50维

def _simplified_lbp(self, gray, cell_size=16):
"""简化LBP直方图"""
h, w = gray.shape
hist = []

for i in range(0, h - cell_size, cell_size):
for j in range(0, w - cell_size, cell_size):
cell = gray[i:i+cell_size, j:j+cell_size]
center = np.mean(cell)
lbp = (cell > center).astype(int).flatten()
hist.append(np.mean(lbp))

return hist[:20] # 20个LBP统计值

2. 增量学习策略

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
class IncrementalStrategies:
"""
四种增量学习策略对比
"""

strategies = {
"partial_fit": {
"description": "SGD分类器的partial_fit",
"memory": "O(n_features)",
"latency": "<1ms",
"accuracy": "85%",
"适合": "流式数据"
},
"buffer_replay": {
"description": "固定缓冲区+定期重训练",
"memory": "O(buffer_size)",
"latency": "推理<1ms, 更新100ms",
"accuracy": "89%",
"适合": "周期性更新"
},
"elastic_weight": {
"description": "Elastic Weight Consolidation",
"memory": "O(model_size)",
"latency": "<1ms",
"accuracy": "91%",
"适合": "防止遗忘"
},
"prototype_based": {
"description": "类原型+最近邻",
"memory": "O(n_classes × n_features)",
"latency": "<1ms",
"accuracy": "87%",
"适合": "新类别快速适应"
}
}

实验结果

准确率对比

方法 准确率 模型大小 推理延迟 增量更新 平台
CNN(ResNet-18) 92.1% 45MB 15ms ❌ GPU/SoC
SVM+特征工程 87.3% 2MB 3ms ✅ 嵌入式
IsolationForest+SVM 89.1% 5MB 5ms ✅ MCU
混合+增量(本文) 90.5% 3MB 8ms ✅ MCU

增量学习效果

驾驶小时数 非增量准确率 增量准确率 提升
1h 82.3% 82.3% 0%
5h 82.3% 86.1% +3.8%
10h 82.3% 89.2% +6.9%
50h 82.3% 92.5% +10.2%
100h 82.3% 93.8% +11.5%

核心发现:增量学习在50小时后准确率提升10%+,非增量模型无法适应个体差异。

MCU平台性能

平台 RAM Flash 推理延迟 更新延迟 功耗
STM32H743 1MB 2MB 8ms 120ms 280mW
ESP32-S3 512KB 8MB 15ms 200ms 100mW
RP2040 264KB 2MB 25ms 500ms 60mW

IMS开发启示

1. 个性化DMS的必要性

1
2
3
4
5
6
7
8
9
10
11
personalization_value = {
"问题": "通用DMS模型对个体差异适应性差",
"数据": {
"通用模型准确率": "82.3%(固定不变)",
"50小时增量": "92.5%(+10.2%)",
"100小时增量": "93.8%(+11.5%)"
},
"关键洞察": "驾驶员行为模式高度个体化",
"实现方式": "增量学习持续适应个体特征",
"隐私优势": "数据留在车内不上传"
}

2. 异常+分类混合策略

优势:大部分时间驾驶员状态正常,异常检测可跳过详细分类,大幅降低平均计算量。

3. 落地路线

阶段 时间 方案 目标
当前 已有 CNN黑盒DMS 92%准确率
短期 6个月 增量SVM叠加 个性化+89%
中期 12个月 混合+增量 93%+个性化
长期 18个月 全在线学习 持续进化

4. 隐私优先架构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class PrivacyFirstDMS:
"""
隐私优先的增量DMS

所有数据在车内处理,不上传云端
模型在车内持续进化
"""

def __init__(self):
self.local_model = EmbeddedIncrementalDMS()
self.data_store = LocalBuffer(max_size=10000)

def process(self, frame):
"""本地处理"""
result = self.local_model.process_frame(frame)
return result

def update(self, feedback=None):
"""本地增量更新"""
data = self.data_store.sample(100)
self.local_model.incremental_update(data, feedback)
# 数据不出车

总结

嵌入式增量混合ML驾驶员行为监测框架解决三个关键痛点:

  1. 嵌入式约束:3MB模型+8ms推理可在MCU运行
  2. 个性化适应:增量学习100小时后准确率提升11.5%
  3. 隐私保护:数据不出车,模型在本地进化

对IMS的启示:DMS不应该是一个静态模型。通过增量学习,DMS可以持续适应驾驶员的个体特征——开得越久,越了解你。这不仅在准确率上有10%+的提升,更重要的是为隐私合规提供了完全本地方案。结合可解释面部关键点(上一篇),可构建透明+个性化+隐私安全的下一代DMS。