EMMI:边缘多模态智能——32×通信压缩实现车载多模态大模型实时推理

论文信息

项目 内容
标题 EMMI: Edge Multi-Modal Intelligence for Communication-Efficient MLLM Inference via Fused Representation Compression
arXiv 2609.11058
提交 2026-09-10
作者 Motahare Mounesan, Irfan Khan
领域 cs.LG, cs.DC
核心 32×通信压缩 + 3.4×延迟降低

核心创新

边缘-云协同新范式

1
2
3
4
5
传统方案: 边缘设备 → 原始数据 → 云端MLLM → 推理结果
↑ 大量数据传输, 高延迟, 隐私风险

EMMI方案: 边缘设备 → [编码+融合+压缩] → 紧凑latent → 云端MLLM → 结果
↑ 仅传输固定大小向量, 32×压缩, 隐私保护
方案 通信量 延迟 隐私 精度
原始数据传输 100% 100% ❌ 100%
模型分割 50% 80% ⚠️ 98%
EMMI 3.1% 29.4% ✅ 97%

方法详解

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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
import torch
import torch.nn as nn
import torch.nn.functional as F

class ModalityEncoder(nn.Module):
"""
模态特定编码器

每种传感器数据用独立编码器提取特征
"""

def __init__(self, modality: str, embed_dim: int = 256):
super().__init__()
self.modality = modality

if modality == 'vision':
self.encoder = nn.Sequential(
nn.Conv2d(3, 32, 3, stride=2, padding=1), nn.ReLU(),
nn.Conv2d(32, 64, 3, stride=2, padding=1), nn.ReLU(),
nn.Conv2d(64, 128, 3, stride=2, padding=1), nn.ReLU(),
nn.AdaptiveAvgPool2d(1), nn.Flatten(),
nn.Linear(128, embed_dim)
)
elif modality == 'radar':
self.encoder = nn.Sequential(
nn.Conv2d(1, 16, 3, padding=1), nn.ReLU(),
nn.Conv2d(16, 32, 3, stride=2, padding=1), nn.ReLU(),
nn.AdaptiveAvgPool2d(1), nn.Flatten(),
nn.Linear(32, embed_dim)
)
elif modality == 'telemetry':
self.encoder = nn.Sequential(
nn.Linear(10, 64), nn.ReLU(),
nn.Linear(64, 128), nn.ReLU(),
nn.Linear(128, embed_dim)
)

def forward(self, x: torch.Tensor) -> torch.Tensor:
return self.encoder(x)


class CrossModalFusion(nn.Module):
"""
跨模态表示融合

将多模态特征融合为统一的紧凑表示
"""

def __init__(self, embed_dim: int = 256, num_modalities: int = 3):
super().__init__()
self.num_modalities = num_modalities

# 交叉注意力
self.cross_attn = nn.MultiheadAttention(
embed_dim, num_heads=8, batch_first=True
)

# 融合层
self.fusion = nn.Sequential(
nn.Linear(embed_dim * num_modalities, embed_dim * 2),
nn.GELU(),
nn.Linear(embed_dim * 2, embed_dim)
)

def forward(self, modality_feats: list) -> torch.Tensor:
"""
Args:
modality_feats: list of (B, embed_dim) tensors

Returns:
fused: (B, embed_dim) 融合表示
"""
# Stack as sequence
seq = torch.stack(modality_feats, dim=1) # (B, M, D)

# Cross-attention
attn_out, _ = self.cross_attn(seq, seq, seq)

# Concatenate and fuse
concat = attn_out.flatten(1) # (B, M*D)
fused = self.fusion(concat)

return fused


class LearnedCompression(nn.Module):
"""
学习型压缩模块

将融合表示压缩为固定大小的紧凑向量
用于边缘→云端传输

目标: 最小化传输数据量, 最大化下游任务精度
"""

def __init__(self, embed_dim: int = 256, compressed_dim: int = 64):
super().__init__()
self.compressor = nn.Sequential(
nn.Linear(embed_dim, 128),
nn.GELU(),
nn.Linear(128, compressed_dim)
)

# 解压器(云端侧)
self.decompressor = nn.Sequential(
nn.Linear(compressed_dim, 128),
nn.GELU(),
nn.Linear(128, embed_dim)
)

def compress(self, x: torch.Tensor) -> torch.Tensor:
"""边缘侧: 压缩"""
return self.compressor(x)

def decompress(self, x: torch.Tensor) -> torch.Tensor:
"""云端侧: 解压"""
return self.decompressor(x)

def forward(self, x: torch.Tensor) -> torch.Tensor:
"""端到端: 压缩+解压"""
return self.decompress(self.compress(x))


class EMMIEdgeSystem(nn.Module):
"""
EMMI: 完整的边缘多模态系统

边缘侧: 多模态编码 → 融合 → 压缩 → 传输
云端侧: 解压 → MLLM推理 → 结果

论文Section 3: System Architecture
"""

def __init__(self, modalities: list = ['vision', 'radar', 'telemetry'],
embed_dim: int = 256, compressed_dim: int = 64):
super().__init__()
self.modalities = modalities

# 模态编码器
self.encoders = nn.ModuleDict({
m: ModalityEncoder(m, embed_dim) for m in modalities
})

# 跨模态融合
self.fusion = CrossModalFusion(embed_dim, len(modalities))

# 压缩模块
self.compression = LearnedCompression(embed_dim, compressed_dim)

# 下游任务头(模拟MLLM推理)
self.task_head = nn.Sequential(
nn.Linear(embed_dim, 128),
nn.GELU(),
nn.Linear(128, 5) # 5类: normal/fatigue/distraction/phone/danger
)

def edge_forward(self, inputs: dict) -> torch.Tensor:
"""
边缘侧前向传播(输出压缩表示)
"""
# 多模态编码
feats = []
for mod in self.modalities:
if mod in inputs:
feats.append(self.encoders[mod](inputs[mod]))

# 跨模态融合
fused = self.fusion(feats)

# 压缩
compressed = self.compression.compress(fused)

return compressed

def cloud_forward(self, compressed: torch.Tensor) -> torch.Tensor:
"""
云端侧前向传播(接收压缩表示,执行推理)
"""
# 解压
decompressed = self.compression.decompress(compressed)

# MLLM推理(用任务头模拟)
logits = self.task_head(decompressed)

return logits

def forward(self, inputs: dict) -> dict:
"""端到端"""
compressed = self.edge_forward(inputs)
logits = self.cloud_forward(compressed)

# 计算压缩比
original_size = sum(
inputs[m].numel() for m in self.modalities if m in inputs
)
compressed_size = compressed.numel()
compression_ratio = original_size / compressed_size

return {
'logits': logits,
'compressed': compressed,
'compression_ratio': compression_ratio
}


# ============ 完整测试代码 ============
if __name__ == "__main__":
import numpy as np
import time
from sklearn.metrics import accuracy_score

BATCH_SIZE = 16
MODALITIES = ['vision', 'radar', 'telemetry']

# 初始化
model = EMMIEdgeSystem(
modalities=MODALITIES,
embed_dim=256,
compressed_dim=64
)

total_params = sum(p.numel() for p in model.parameters())
print(f"EMMI参数量: {total_params:,}")

# 模拟多模态车载数据
np.random.seed(42)

def generate_multimodal_input(state: str, batch=1):
"""生成多模态输入"""
if state == 'normal':
vision = torch.rand(batch, 3, 224, 224) * 0.5 + 0.3
radar = torch.rand(batch, 1, 64, 64) * 0.3
telemetry = torch.rand(batch, 10) * 0.5
elif state == 'fatigue':
vision = torch.rand(batch, 3, 224, 224) * 0.3 + 0.2
radar = torch.rand(batch, 1, 64, 64) * 0.2
telemetry = torch.rand(batch, 10) * 0.3 + torch.tensor([
0.8, 0.2, 0.1, 0.5, 0.3, 0.7, 0.4, 0.2, 0.6, 0.3
])
elif state == 'phone':
vision = torch.rand(batch, 3, 224, 224) * 0.7 + 0.3
radar = torch.rand(batch, 1, 64, 64) * 0.5
telemetry = torch.rand(batch, 10) * 0.8 + torch.tensor([
0.5, 0.9, 0.3, 0.2, 0.5, 0.8, 0.1, 0.3, 0.4, 0.2
])

return {'vision': vision, 'radar': radar, 'telemetry': telemetry}

# 生成数据
print("\n--- 生成多模态数据 ---")
states = ['normal', 'fatigue', 'phone', 'normal', 'fatigue']
all_inputs = []
all_labels = []
for i, state in enumerate(states):
inputs = generate_multimodal_input(state, batch=4)
all_inputs.append(inputs)
all_labels.extend([i] * 4)

# 合并batch
batch_inputs = {
mod: torch.cat([inp[mod] for inp in all_inputs])
for mod in MODALITIES
}
labels = torch.tensor(all_labels)

print(f" Vision: {batch_inputs['vision'].shape}")
print(f" Radar: {batch_inputs['radar'].shape}")
print(f" Telemetry: {batch_inputs['telemetry'].shape}")

# 前向传播
print("\n--- EMMI前向传播 ---")
model.eval()
with torch.no_grad():
out = model(batch_inputs)

print(f" Logits: {out['logits'].shape}")
print(f" Compressed: {out['compressed'].shape}")
print(f" 压缩比: {out['compression_ratio']:.1f}×")
print(f" 原始数据: {sum(batch_inputs[m].numel() for m in MODALITIES):,} bytes")
print(f" 压缩后: {out['compressed'].numel():,} bytes")

# 训练
print("\n--- 训练流程 ---")
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.AdamW(model.parameters(), lr=1e-4)

model.train()
for epoch in range(5):
optimizer.zero_grad()
out = model(batch_inputs)
loss = criterion(out['logits'], labels)
loss.backward()
optimizer.step()

acc = accuracy_score(labels.numpy(),
torch.argmax(out['logits'], dim=1).detach().numpy())
print(f"Epoch {epoch+1}: Loss={loss.item():.4f}, Acc={acc:.2%}, "
f"Compression={out['compression_ratio']:.1f}×")

# 通信效率分析
print("\n--- 通信效率分析 ---")
original_bytes = sum(batch_inputs[m].numel() * 4 for m in MODALITIES) # float32
compressed_bytes = out['compressed'].numel() * 4
print(f" 原始传输: {original_bytes/1024:.1f} KB/sample")
print(f" EMMI传输: {compressed_bytes/1024:.1f} KB/sample")
print(f" 节省: {(1-compressed_bytes/original_bytes)*100:.1f}%")

# 延迟估算
bandwidth_mbps = 10 # 10 Mbps车载网络
original_latency = (original_bytes * 8) / (bandwidth_mbps * 1e6) * 1000
emmi_latency = (compressed_bytes * 8) / (bandwidth_mbps * 1e6) * 1000
print(f"\n 原始传输延迟: {original_latency:.1f}ms (@{bandwidth_mbps}Mbps)")
print(f" EMMI传输延迟: {emmi_latency:.1f}ms")
print(f" 延迟降低: {(1-emmi_latency/original_latency)*100:.1f}%")

实验结果

通信压缩

指标 原始 EMMI 改善
传输量 100% 3.1% 32×压缩
推理延迟 100% 29.4% 3.4×加速
下游精度 100% 97% -3%
隐私保护 ❌ ✅ 本地数据不出域

车载场景适配

DMS/OMS应用 模态组合 EMMI压缩比 延迟
疲劳检测 摄像头+方向盘 28× 8ms
分心检测 摄像头+雷达 35× 10ms
CPD儿童检测 雷达+温度 40× 5ms
OOP姿态 摄像头+压力 25× 12ms

IMS应用启示

1. 车载边缘-云架构

1
2
3
4
5
6
7
8
9
10
车内边缘节点 (QCS8255):
多传感器采集 → EMMI编码+压缩 → 5G/C-V2X传输 → 云端MLLM

云端推理中心:
接收紧凑表示 → MLLM推理 → 结果回传

优势:
- 带宽需求降低32×(10Mbps足够)
- 隐私保护(原始数据不出车)
- 统一接口(不同传感器模态)

2. Euro NCAP DSM场景

场景 边缘处理 云端推理 总延迟
疲劳检测 10ms编码 20ms推理 30ms+传输
分心检测 10ms编码 15ms推理 25ms+传输
酒驾损伤 15ms编码 30ms推理 45ms+传输

3. 部署建议

组件 部署位置 硬件 功耗
模态编码器 车内 QCS8255 <2W
融合+压缩 车内 QCS8255 NPU <1W
MLLM推理 路侧/云端 H100 -
通信 5G/C-V2X 调制解调器 <1W

arXiv: https://arxiv.org/abs/2609.11058