红外热成像+YOLO+随机森林:非接触驾驶员热舒适感知与HVAC自动调节

论文信息

  • 标题: Towards personalized HVAC: A non-contact human thermal sensation monitoring and regulation system
  • 期刊: Building and Environment, 2025
  • 链接: https://doi.org/10.1016/j.buildenv.2025.111999
  • 相关研究: AI-HVAC with radiant panels (2026)、Occupant-centric thermal imaging (2024)

核心创新

首次将红外热成像+YOLO面部检测+随机森林TSV预测+模糊逻辑HVAC控制集成到完整非接触式热舒适调节系统。系统通过红外摄像头识别面部热敏感区域(额头/鼻尖/脸颊),提取温度特征预测驾驶员热感觉投票(TSV),自动调节空调。

关键发现:

  • ✅ 面部温度预测TSV准确率>85%(RF模型)
  • ✅ 面部遮挡时自动切换到PMV物理模型
  • ✅ 模糊逻辑控制器比传统PID更平滑
  • ✅ 能耗降低12-18%(避免过度制冷/制热)

方法详解

1. 系统架构

2. 面部热敏感区域

区域 温度范围(°C) 热敏感度 权重
额头 32-36 高 0.35
鼻尖 28-34 最高 0.25
脸颊 30-35 中 0.20
太阳穴 33-37 中高 0.15
下巴 31-35 低 0.05

3. 核心代码复现

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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
import numpy as np
from sklearn.ensemble import RandomForestRegressor
from typing import Tuple, Dict
import cv2

class ThermalComfortSystem:
"""
非接触驾驶员热舒适感知系统

论文: Building and Environment, 2025
核心: 红外热成像 → YOLO面部检测 → RF TSV → 模糊HVAC

TSV: -3(冷) -2(凉) -1(微凉) 0(适中) 1(微暖) 2(暖) 3(热)
"""

# 面部热敏感区域权重
ROI_WEIGHTS = {
'forehead': 0.35,
'nose_tip': 0.25,
'cheek': 0.20,
'temple': 0.15,
'chin': 0.05
}

# TSV标尺
TSV_SCALE = {
-3: 'cold', -2: 'cool', -1: 'slightly_cool',
0: 'neutral',
1: 'slightly_warm', 2: 'warm', 3: 'hot'
}

def __init__(self):
# 面部检测(可替换为YOLO)
self.face_cascade = cv2.CascadeClassifier(
cv2.data.haarcascades + 'haarcascade_frontalface_default.xml'
)

# TSV预测模型
self.tsv_model = RandomForestRegressor(
n_estimators=100, max_depth=10, random_state=42
)

# PMV模型参数
self.pmv_params = {
'met': 1.0, # 代谢率(坐着驾驶)
'clo': 0.5, # 衣服热阻(夏季)
'air_vel': 0.2, # 空气流速
}

def extract_facial_temperatures(self, thermal_image: np.ndarray) -> dict:
"""
从红外热像提取面部各区域温度

Args:
thermal_image: 红外图像(温度矩阵, °C)

Returns:
dict: 各区域平均温度
"""
# 转换为伪彩用于面部检测
normalized = ((thermal_image - 20) / (40 - 20) * 255).astype(np.uint8)
colored = cv2.applyColorMap(normalized, cv2.COLORMAP_JET)
gray = cv2.cvtColor(colored, cv2.COLOR_BGR2GRAY)

faces = self.face_cascade.detectMultiScale(gray, 1.3, 5)

if len(faces) == 0:
return {'error': 'no_face_detected'}

x, y, w, h = faces[0]

# 提取各区域
forehead = thermal_image[y:y+h//4, x+w//4:x+3*w//4]
nose = thermal_image[y+h//4:y+3*h//8, x+3*w//8:x+5*w//8]
cheek_l = thermal_image[y+h//4:y+h//2, x:x+w//4]
cheek_r = thermal_image[y+h//4:y+h//2, x+3*w//4:x+w]
cheek = np.concatenate([cheek_l.ravel(), cheek_r.ravel()])
temple = thermal_image[y:y+h//3, x+w-10:x+w]
chin = thermal_image[y+3*h//4:y+h, x+w//4:x+3*w//4]

return {
'forehead': np.mean(forehead),
'nose_tip': np.mean(nose),
'cheek': np.mean(cheek),
'temple': np.mean(temple),
'chin': np.mean(chin)
}

def predict_tsv(self, facial_temps: dict,
ambient_temp: float = 24,
humidity: float = 50) -> float:
"""
预测热感觉投票(TSV)

Args:
facial_temps: 面部各区域温度
ambient_temp: 环境温度
humidity: 湿度

Returns:
tsv: -3 to +3
"""
if 'error' in facial_temps:
# 面部检测失败→使用PMV模型
return self._compute_pmv(ambient_temp, humidity)

# 特征向量
features = np.array([
facial_temps['forehead'],
facial_temps['nose_tip'],
facial_temps['cheek'],
facial_temps['temple'],
facial_temps['chin'],
ambient_temp,
humidity,
# 鼻尖-额头温差(热舒适敏感指标)
facial_temps['forehead'] - facial_temps['nose_tip'],
]).reshape(1, -1)

tsv = self.tsv_model.predict(features)[0]
return np.clip(tsv, -3, 3)

def _compute_pmv(self, air_temp: float, humidity: float) -> float:
"""
PMV (Predicted Mean Vote) 物理模型
用于面部检测失败时的降级方案
"""
# 简化PMV计算
# 完整版本需考虑辐射温度、衣服热阻、代谢率、空气流速
tr = air_temp # 假设辐射温度=空气温度
pa = humidity / 100 * 2.338 # 水蒸气分压

# 简化热负荷
L = 0.303 * np.exp(-0.036 * 58.2) - 0.028 # 代谢率58.2 W/m²
pmv = (0.303 * L) * (
58.2 - 0.35 * (air_temp - 30) -
0.42 * (58.2 - 58.15) -
0.0023 * (58.2) * (44 - pa) -
0.0014 * 58.2 * (34 - air_temp) -
1.7 * 0.1 * (1 - 0.01 * humidity)
)
return np.clip(pmv, -3, 3)

def compute_hvac_control(self, tsv: float, current_hvac: dict) -> dict:
"""
模糊逻辑HVAC控制

Args:
tsv: 当前TSV
current_hvac: 当前HVAC状态

Returns:
dict: 新HVAC设置
"""
# 模糊规则
if tsv <= -2: # 冷
return {
'target_temp': min(current_hvac.get('target_temp', 22) + 2, 28),
'fan_speed': min(current_hvac.get('fan_speed', 3) + 2, 8),
'mode': 'heating',
'air_direction': 'feet'
}
elif tsv <= -1: # 凉
return {
'target_temp': current_hvac.get('target_temp', 22) + 1,
'fan_speed': current_hvac.get('fan_speed', 3) + 1,
'mode': 'heating',
'air_direction': 'feet'
}
elif tsv <= 1: # 适中
return current_hvac # 不变
elif tsv <= 2: # 暖
return {
'target_temp': max(current_hvac.get('target_temp', 22) - 1, 18),
'fan_speed': current_hvac.get('fan_speed', 3) + 1,
'mode': 'cooling',
'air_direction': 'face'
}
else: # 热
return {
'target_temp': max(current_hvac.get('target_temp', 22) - 2, 16),
'fan_speed': min(current_hvac.get('fan_speed', 3) + 2, 8),
'mode': 'cooling',
'air_direction': 'face'
}


# 实际测试
if __name__ == "__main__":
system = ThermalComfortSystem()

# 模拟红外热像
np.random.seed(42)
thermal = np.random.normal(33, 2, (120, 160))

# 提取面部温度
temps = {
'forehead': 34.5,
'nose_tip': 31.2, # 鼻尖偏冷→可能冷
'cheek': 33.0,
'temple': 34.8,
'chin': 33.5
}

# 预测TSV
tsv = system.predict_tsv(temps, ambient_temp=20, humidity=50)

print("=== 驾驶员热舒适感知 ===")
print(f"面部温度: {temps}")
print(f"环境温度: 20°C, 湿度: 50%")
print(f"预测TSV: {tsv:.1f} ({system.TSV_SCALE.get(int(tsv), 'unknown')})")

# HVAC控制
current_hvac = {'target_temp': 22, 'fan_speed': 3, 'mode': 'auto'}
new_hvac = system.compute_hvac_control(tsv, current_hvac)

print(f"\n当前HVAC: {current_hvac}")
print(f"建议HVAC: {new_hvac}")

print(f"\n=== 论文性能 ===")
print(f" RF TSV准确率: >85%")
print(f" 能耗节省: 12-18%")
print(f" 响应延迟: <2秒")
print(f" 遮挡降级: 自动切换PMV模型")

4. 热舒适→疲劳的关联

TSV 体感 警觉性影响 疲劳影响
-3/-2 冷 ↑↑ 警觉提高 ↓ 降低疲劳
-1/0 适中 → 正常 → 无影响
1/2 暖 ↓ 警觉降低 ↑ 增加疲劳
3 热 ↓↓ 严重降低 ↑↑ 严重疲劳

IMS开发启示

1. 热舒适对DMS的影响

热状态 DMS检测影响 IMS建议
偏热 PERCLOS↑(疲劳加重) 降低HVAC温度
偏冷 眨眼↑(反射性流泪) 排除PERCLOS误报
适中 DMS正常 维持

2. 热舒适+疲劳多模态方案

优先级 功能 技术方案 周期
P0 面部温度提取 红外摄像头+YOLO 3个月
P0 TSV预测 RF模型 2个月
P0 HVAC自动调节 模糊逻辑 2个月
P1 热舒适+PERCLOS融合 多模态疲劳模型 6个月
P1 个体热偏好学习 30天基线 6个月
P2 预测性HVAC GPS+天气+历史 12个月

3. 硬件参考

组件 型号 参数 成本
红外摄像头 FLIR Lepton 3.5 160×120, ±5°C ~$200
红外摄像头(车规) Seek Thermal 206×156, ±3°C ~$300
温度传感器 NTC热敏电阻 ±0.5°C ~$2
湿度传感器 SHT3x ±2%RH ~$3
处理器 现有NPU YOLO推理 现有

4. DMS摄像头复用方案

维度 现有DMS(RGB-IR) 增加热成像 复用价值
摄像头 RGB-IR双模 +热成像 独立传感器
视线检测 ✅ - 不受影响
疲劳检测 ✅ PERCLOS +热舒适 互补
部署成本 ~$50 +$200 中等增加

总结

非接触热舒适感知让IMS从”监控驾驶员状态”扩展到”改善驾驶员状态”——不只是检测疲劳,还主动调节环境来延缓疲劳。

对IMS的5条可执行建议:

  1. 热舒适直接影响疲劳——偏热→疲劳加重,HVAC自动调节可延缓
  2. 红外热成像可复用DMS摄像头——RGB-IR已具备红外能力
  3. RF TSV模型准确率>85%——比简单阈值法更精准
  4. PMV模型是降级方案——面部遮挡时自动切换
  5. 能耗节省12-18%是额外收益——避免过度制冷/制热

论文链接: https://doi.org/10.1016/j.buildenv.2025.111999