可穿戴生理情感识别:Transformer达99%精度,4Hz采样足够,BilLSTM在EmoWear领先

论文信息

  • 标题: From Stress to Affect: Multimodal Deep Learning for Physiological Emotion Recognition Across Wearable Sensor Modalities
  • arXiv: 2609.20991 (2026年9月17日)
  • 作者: Desta Haileselassie Hagos 等
  • 状态: Under review
  • 数据集: WESAD, EmoWear

核心发现

  1. Transformer在WESAD达99.02%±0.51%精度(多模态,LOSO-CV)
  2. BilLSTM在EmoWear领先(arousal 91.80%, valence 89.96%)
  3. 4Hz采样足够,性能与高频相当但训练成本大降
  4. 多模态始终优于单模态(手腕/胸部)

传感器配置对比

配置 WESAD最佳模型 精度 EmoWear最佳模型 Arousal Valence
手腕only Transformer ~85% LSTM ~85% ~82%
胸部only Transformer ~90% LSTM ~88% ~85%
多模态 Transformer 99.02% LSTM 91.80% 89.96%

采样频率分析

1
2
3
4
5
6
7
8
9
10
11
# 采样频率对性能影响
sampling_analysis = {
"1 Hz": {"性能": "显著下降", "成本": "最低"},
"4 Hz": {"性能": "接近高频", "成本": "低 — 实用操作点"},
"10 Hz": {"性能": "最优", "成本": "中"},
"50+ Hz": {"性能": "与10Hz相当", "成本": "高 — 无必要"},
}

print("=== 采样频率建议 ===")
print("✅ 4Hz是实用操作点: 性能接近高频但训练成本大降")
print("✅ 座舱可穿戴设备可用低采样节省功耗")

模型实现

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
"""
论文:From Stress to Affect: Multimodal Deep Learning for Physiological Emotion Recognition
arXiv: 2609.20991

核心方法:BiLSTM / TCN / Transformer 对比评估
"""

import torch
import torch.nn as nn

class PhysiologicalTransformer(nn.Module):
"""Transformer用于生理情感识别"""

def __init__(self,
num_sensors: int = 6, # ECG, EDA, EMG, TEMP, RESP, BVP
seq_len: int = 60, # 60秒 @ 4Hz = 240帧
d_model: int = 128,
num_heads: int = 4,
num_layers: int = 4,
num_classes: int = 3): # 高/中/低
super().__init__()

# 传感器嵌入
self.sensor_embed = nn.Linear(num_sensors, d_model)
self.pos_embed = nn.Parameter(torch.randn(1, seq_len, d_model))

# Transformer编码器
encoder_layer = nn.TransformerEncoderLayer(
d_model=d_model,
nhead=num_heads,
dim_feedforward=d_model*4,
dropout=0.1,
batch_first=True
)
self.encoder = nn.TransformerEncoder(encoder_layer, num_layers)

# 分类头
self.classifier = nn.Sequential(
nn.LayerNorm(d_model),
nn.Linear(d_model, num_classes)
)

def forward(self, x):
"""x: (B, seq_len, num_sensors)"""
x = self.sensor_embed(x) + self.pos_embed[:, :x.size(1)]
x = self.encoder(x)
x = x.mean(dim=1) # 全局池化
return self.classifier(x)


class BilLSTM(nn.Module):
"""双向LSTM (EmoWear最佳模型)"""

def __init__(self, num_sensors=6, hidden=128, num_layers=2, num_classes=3):
super().__init__()
self.lstm = nn.LSTM(num_sensors, hidden, num_layers,
batch_first=True, bidirectional=True, dropout=0.3)
self.classifier = nn.Sequential(
nn.Linear(hidden*2, 64),
nn.ReLU(),
nn.Dropout(0.3),
nn.Linear(64, num_classes)
)

def forward(self, x):
out, _ = self.lstm(x)
last = out[:, -1, :]
return self.classifier(last)


class TCN(nn.Module):
"""时序卷积网络"""

def __init__(self, num_sensors=6, hidden=64, num_classes=3):
super().__init__()
self.tcn = nn.Sequential(
nn.Conv1d(num_sensors, hidden, 3, padding=1),
nn.BatchNorm1d(hidden),
nn.ReLU(),
nn.Conv1d(hidden, hidden*2, 3, dilation=2, padding=2),
nn.BatchNorm1d(hidden*2),
nn.ReLU(),
nn.Conv1d(hidden*2, hidden*4, 3, dilation=4, padding=4),
nn.BatchNorm1d(hidden*4),
nn.ReLU(),
nn.AdaptiveAvgPool1d(1)
)
self.classifier = nn.Linear(hidden*4, num_classes)

def forward(self, x):
x = x.transpose(1, 2) # (B, C, T)
x = self.tcn(x).squeeze(-1)
return self.classifier(x)


if __name__ == "__main__":
models = {
"Transformer": PhysiologicalTransformer(),
"BiLSTM": BilLSTM(),
"TCN": TCN()
}

x = torch.randn(8, 240, 6) # 60秒 @ 4Hz, 6传感器

print("=== 生理情感识别模型对比 ===")
for name, model in models.items():
out = model(x)
params = sum(p.numel() for p in model.parameters())
print(f"{name}: output={out.shape}, params={params:,}")

print(f"\n=== 论文结果 ===")
print("WESAD: Transformer 99.02% ± 0.51% (多模态)")
print("EmoWare Arousal: LSTM 91.80% ± 1.06%")
print("EmoWare Valence: LSTM 89.96% ± 0.36%")
print("采样频率: 4Hz即可")

IMS开发启示

座舱可穿戴生理监测

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 座舱生理传感器配置建议
cabin_physio_config = {
"传感器": {
"ECG/PPG": {"位置": "方向盘/座椅", "采样": "4Hz", "功能": "心率/HRV"},
"EDA": {"位置": "方向盘", "采样": "4Hz", "功能": "皮肤电导/压力"},
"TEMP": {"位置": "座椅", "采样": "1Hz", "功能": "体温"},
"EMG": {"位置": "座椅靠背", "采样": "4Hz", "功能": "肌肉紧张度"}
},
"模型选择": {
"高精度需求": "Transformer (WESAD 99%)",
"低功耗需求": "BiLSTM (EmoWear 91%)",
"实时性需求": "TCN (最快推理)"
},
"采样频率": "4Hz实用操作点",
"功耗": "4Hz @ 6传感器 ≈ 10mW (可电池供电)"
}

参考


发布时间: 2026-09-25 00:00
分类: 生理监测 | 可穿戴 | 情感识别 | Transformer | 论文解读