YOLOv8与RT-DETR边缘部署能效评测——DMS实时检测的精度-功耗权衡

论文信息

核心问题

DMS/OMS 实时检测需要在边缘设备上运行目标检测模型,但 精度、吞吐量和功耗之间存在三方权衡。本文系统评测了 YOLOv8l 和 RT-DETR-l 在异构边缘平台上的表现。

测试平台

平台 处理器 算力 内存 功耗范围
NVIDIA Jetson Orin NX Ampere GPU 100 TOPS 16GB 10-25W
NVIDIA Jetson Nano Maxwell GPU 0.5 TFLOPS 4GB 5-10W
Raspberry Pi 5 Cortex-A76 ~5 TOPS 8GB 3-8W
Intel NUC 11 i7-1165G7 ~8 TOPS 16GB 15-28W
Orange Pi 5 RK3588S 6 TOPS 8GB 3-5W

性能基准测试

YOLOv8l 测试结果

平台 mAP@50 mAP@50-95 FPS 延迟(ms) 功耗(W) 能效(mAP/W)
Jetson Orin NX (FP16) 52.6 37.2 45 22.2 22.5 2.34
Jetson Orin NX (INT8) 51.1 35.8 78 12.8 18.2 2.81
Jetson Nano (FP16) 50.8 34.5 8 125 9.8 5.18
Raspberry Pi 5 (INT8) 48.3 32.1 3 333 6.5 7.43
Intel NUC 11 (INT8) 51.5 36.0 25 40 28.0 1.84

RT-DETR-l 测试结果

平台 mAP@50 mAP@50-95 FPS 延迟(ms) 功耗(W) 能效(mAP/W)
Jetson Orin NX (FP16) 53.2 38.5 32 31.3 24.0 2.22
Jetson Orin NX (INT8) 52.0 37.1 55 18.2 19.5 2.67
Jetson Nano (FP16) 51.5 36.2 5 200 10.2 5.05
Raspberry Pi 5 (INT8) 49.0 33.5 2 500 6.8 7.21
Intel NUC 11 (INT8) 52.1 37.3 18 55.6 29.0 1.80

DMS/OMS 部署方案推荐

推荐方案矩阵

场景 模型 平台 FPS mAP 功耗 推荐理由
DMS单功能 YOLOv8s INT8 Jetson Orin NX 120 45 12W 高帧率+低延迟
DMS+OMS YOLOv8l INT8 Jetson Orin NX 78 51 18W 高精度+实时
低成本DMS YOLOv8s INT8 RK3588S 30 43 5W 低功耗低成本
多目OMS RT-DETR-l INT8 Jetson Orin NX 55 52 20W Transformer精度高
后排CPD YOLOv8n INT8 RP 5 10 38 6W 超低功耗

YOLOv8 vs RT-DETR 选择决策

能效分析代码

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
import numpy as np
import matplotlib
matplotlib.use('Agg')

class EnergyEfficiencyAnalyzer:
"""
边缘部署能效分析器

核心指标:
1. mAP/W - 单位功耗的精度
2. FPS/W - 单位功耗的帧率
3. mAP·FPS/W - 综合能效
"""

PLATFORMS = {
'Jetson Orin NX': {'tops': 100, 'tdp_range': (10, 25)},
'Jetson Nano': {'tops': 0.5, 'tdp_range': (5, 10)},
'Raspberry Pi 5': {'tops': 5, 'tdp_range': (3, 8)},
'Intel NUC 11': {'tops': 8, 'tdp_range': (15, 28)},
'Orange Pi 5': {'tops': 6, 'tdp_range': (3, 5)},
}

MODELS = {
'YOLOv8n': {'params': 3.2, 'flops': 8.7, 'mAP': 37.3},
'YOLOv8s': {'params': 11.2, 'flops': 28.6, 'mAP': 44.9},
'YOLOv8m': {'params': 25.9, 'flops': 78.9, 'mAP': 50.2},
'YOLOv8l': {'params': 43.7, 'flops': 165.2, 'mAP': 52.6},
'RT-DETR-l': {'params': 32.0, 'flops': 108.0, 'mAP': 53.2},
}

def estimate_fps(self, model: str, platform: str, quantization: str = 'int8') -> float:
"""估算FPS"""
model_info = self.MODELS[model]
platform_info = self.PLATFORMS[platform]

# 有效算力 (考虑量化加速)
effective_tops = platform_info['tops']
if quantization == 'int8':
effective_tops *= 2 # INT8约2倍加速
elif quantization == 'fp16':
effective_tops *= 1.0

# 利用率 (边缘设备通常30-60%)
utilization = 0.4
effective_flops = effective_tops * 1e12 * utilization

# FPS = 有效算力 / 模型FLOPs
fps = effective_flops / (model_info['flops'] * 1e9)

# 内存带宽限制
if 'Nano' in platform and model in ['YOLOv8l', 'RT-DETR-l']:
fps *= 0.5 # 内存受限

return round(fps, 1)

def estimate_power(self, model: str, platform: str) -> float:
"""估算功耗"""
platform_info = self.PLATFORMS[platform]
model_info = self.MODELS[model]

# 功耗与算力利用率成正比
utilization = min(1.0, model_info['flops'] / 100)
min_power, max_power = platform_info['tdp_range']

estimated_power = min_power + (max_power - min_power) * utilization
return round(estimated_power, 1)

def compute_efficiency(self, model: str, platform: str, quant: str = 'int8') -> dict:
"""计算综合能效"""
fps = self.estimate_fps(model, platform, quant)
power = self.estimate_power(model, platform)
mAP = self.MODELS[model]['mAP']

return {
'model': model,
'platform': platform,
'quantization': quant,
'mAP': mAP,
'fps': fps,
'power_w': power,
'map_per_watt': round(mAP / power, 2),
'fps_per_watt': round(fps / power, 2),
'combined_efficiency': round(mAP * fps / power, 2),
'meets_30fps': fps >= 30,
'meets_15fps': fps >= 15,
}


# 测试
if __name__ == "__main__":
analyzer = EnergyEfficiencyAnalyzer()

print("=== YOLOv8l INT8 能效对比 ===")
for platform in analyzer.PLATFORMS:
result = analyzer.compute_efficiency('YOLOv8l', platform, 'int8')
print(f"\n{platform}:")
print(f" FPS: {result['fps']}, 功耗: {result['power_w']}W")
print(f" mAP/W: {result['map_per_watt']}, FPS/W: {result['fps_per_watt']}")
print(f" 30fps达标: {'✅' if result['meets_30fps'] else '❌'}")

print("\n=== RT-DETR-l INT8 能效对比 ===")
for platform in analyzer.PLATFORMS:
result = analyzer.compute_efficiency('RT-DETR-l', platform, 'int8')
print(f"\n{platform}:")
print(f" FPS: {result['fps']}, 功耗: {result['power_w']}W")
print(f" 综合能效: {result['combined_efficiency']}")

DMS实测场景性能

典型DMS检测任务

检测任务 输入分辨率 YOLOv8s FPS YOLOv8l FPS RT-DETR-l FPS 推荐模型
人脸检测 640×640 120 78 55 YOLOv8s
眼睛状态 320×320 250 150 100 YOLOv8s
手机使用 640×640 95 60 40 YOLOv8s
乘员分类 1280×1280 25 15 8 YOLOv8l
OOP姿态 640×640 100 65 45 YOLOv8l

Jetson Orin NX 实测配置

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
class JetsonOrinNXDeployment:
"""
Jetson Orin NX DMS部署配置

硬件规格:
- GPU: Ampere (1024 CUDA cores)
- NPU: 64 Tensor cores
- 内存: 16GB LPDDR5 102.4GB/s
- 功耗模式: 15W / 25W (MAXN)
"""

CONFIG = {
'power_mode': '25W MAXN', # 最大性能模式
'gpu_clock': 765, # MHz
'memory_clock': 1600, # MHz
'jetson_clocks': True, # 锁定最大频率
}

# INT8量化配置
QUANTIZATION_CONFIG = {
'calibration_method': 'MinMax',
'calibration_batches': 200,
'per_channel': True,
'weight_bits': 8,
'activation_bits': 8,
}

# TensorRT优化配置
TENSORRT_CONFIG = {
'workspace_size': 4, # GB
'precision': 'INT8',
'max_batch_size': 1,
'dynamic_shapes': False, # 固定shape优化
'layer_fusion': True,
'kernel_auto_tuning': True,
'fp16_fallback': True, # INT8不支持的层用FP16
}

IMS开发启示

  1. YOLOv8s INT8 是DMS的最佳选择:120fps + 45mAP + 12W
  2. RT-DETR-l 适合OMS多目场景:Transformer精度更高,但帧率较低
  3. Jetson Orin NX 是边缘DMS的优选平台:78fps(YOLOv8l) + 18W
  4. RK3588S 适合低成本DMS:5W功耗 + 30fps(YOLOv8s)
  5. INT8量化是边缘部署标配:2倍加速 + 4倍内存压缩

来源:Nature Scientific Reports (2026) | 关键词:YOLOv8, RT-DETR, edge deployment, energy efficiency, DMS, real-time detection