YOLOv10:实时端到端目标检测
YOLOv10 于 2024 年 5 月发布,由清华大学的研究人员基于 Ultralytics Python 包构建,为实时目标检测引入了一种新方法,解决了早期 YOLO 版本在后处理和模型架构方面的不足。通过移除非极大值抑制(NMS)并优化多个模型组件,YOLOv10 在发布时以显著降低的计算开销实现了强劲性能。其无 NMS 端到端设计开创了一种方法,并在 YOLO26 中得到进一步发展。

观看: 如何使用 Ultralytics 在 SKU-110k 数据集上训练 YOLOv10 | 零售数据集
概述#
实时目标检测旨在以较低延迟准确预测图像中目标的类别和位置。YOLO 系列凭借性能与效率之间的平衡,一直处于这项研究的前沿。然而,对 NMS 的依赖和架构效率低下阻碍了性能优化。YOLOv10 通过引入用于无 NMS 训练的一致双重分配策略,以及以效率和精度为导向的整体模型设计策略,解决了这些问题。
架构#
YOLOv10 的架构在发挥以往 YOLO 模型优势的基础上,引入了多项关键创新。模型架构由以下组件构成:
- 主干网络:负责特征提取;YOLOv10 的主干网络采用增强版 CSPNet(跨阶段局部网络),以改善梯度流并减少计算冗余。
- 颈部网络:颈部网络旨在聚合不同尺度的特征,并将其传递给检测头。它包含 PAN(路径聚合网络)层,用于有效融合多尺度特征。
- 一对多检测头:在训练过程中为每个物体生成多个预测结果,以提供丰富的监督信号并提高学习精度。
- 一对一检测头:在推理期间为每个目标生成一个最佳预测,无需使用 NMS,从而降低延迟并提高效率。
主要功能#
- 无 NMS 训练:使用一致的双重分配策略,无需使用 NMS,从而降低推理延迟。
- 整体模型设计:从效率和准确率两个角度全面优化各个组件,包括轻量级分类头、空间与通道解耦下采样,以及秩引导的模块设计。
- 增强模型能力:采用大核卷积和部分自注意力模块,在不显著增加计算开销的情况下提升性能。
模型变体#
YOLOv10 提供多种模型规模,以满足不同应用需求:
- YOLOv10n:Nano 版本,适用于资源极其受限的环境。
- YOLOv10s:Small 版本,兼顾速度与准确率。
- YOLOv10m:Medium 版本,适用于通用场景。
- YOLOv10b:加宽的平衡版本,可实现更高准确率。
- YOLOv10l:Large 版本,以增加计算资源为代价实现更高准确率。
- YOLOv10x:Extra-large 版本,提供最高准确率和性能。
性能#
发布时,YOLOv10 在精度和效率方面优于先前的 YOLO 版本及其他先进模型。例如,在 COCO 数据集上,YOLOv10s 的速度比 RT-DETR-R18 快 1.8 倍,AP 相近;YOLOv10b 的延迟比 YOLOv9-C 低 46%,参数量少 25%,且性能相同。
延迟是在 T4 GPU 上使用 TensorRT FP16 测得的。
| 模型 | 输入尺寸 | AP验证50-95 | FLOPs (G) | 延迟 (ms) |
|---|---|---|---|---|
| [YOLOv10n][1] | 640 | 38.5 | 6.7 | 1.84 |
| [YOLOv10s][2] | 640 | 46.3 | 21.6 | 2.49 |
| [YOLOv10m][3] | 640 | 51.1 | 59.1 | 4.74 |
| [YOLOv10b][4] | 640 | 52.5 | 92.0 | 5.74 |
| [YOLOv10l][5] | 640 | 53.2 | 120.3 | 7.28 |
| [YOLOv10x][6] | 640 | 54.4 | 160.4 | 10.70 |
方法#
用于无 NMS 训练的一致双重分配策略#
YOLOv10 采用双重标签分配,在训练期间结合一对多和一对一策略,以确保充分监督并支持高效的端到端部署。Ultralytics 的预测和验证默认使用带有 NMS 的一对多检测头;设置 nms=False 可选择无 NMS 检测头。一致的匹配指标使两种策略的监督保持一致,从而提高推理时预测结果的质量。
以效率和精度为核心的整体模型设计#
效率提升#
- 轻量级分类头:通过使用深度可分离卷积,降低分类头的计算开销。
- 空间与通道解耦下采样:将空间缩减与通道调制解耦,以尽量减少信息损失和计算成本。
- 秩引导的模块设计:根据各阶段的内在冗余程度调整模块设计,确保参数得到最佳利用。
准确率提升#
- 大核卷积:扩大感受野,增强特征提取能力。
- 部分自注意力 (PSA):引入自注意力模块,以极低的额外开销提升全局表征学习能力。
实验与结果#
YOLOv10 在 COCO 等标准基准上进行了评估。发布时,所有变体与之前的 YOLO 版本及同期检测器相比,都改善了延迟与精度之间的权衡。
比较#

与其他先进检测器相比:
- YOLOv10s / x 的速度分别比 RT-DETR-R18 / R101 快 1.8× / 1.3×,准确率相近
- 在准确率相同的情况下,YOLOv10b 的参数量比 YOLOv9-C 少 25%,延迟低 46%
- YOLOv10l / x 的表现优于 YOLOv8l / x,AP 分别高出 0.3 / 0.5,参数量则分别少 1.8× / 2.3×
下图数据摘自 YOLOv10 论文,是在该论文自身的评测协议下测得,因此不能直接与 Ultralytics 模型页面上的数值比较:
| 模型 | 参数 (M) | FLOPs (G) | mAPval50-95 | 延迟 (ms) | 前向延迟 (ms) |
|---|---|---|---|---|---|
| YOLOv6-3.0-N | 4.7 | 11.4 | 37.0 | 2.69 | 1.76 |
| Gold-YOLO-N | 5.6 | 12.1 | 39.6 | 2.92 | 1.82 |
| YOLOv8n | 3.2 | 8.7 | 37.3 | 6.16 | 1.77 |
| YOLOv10n | 2.3 | 6.7 | 38.5 | 1.84 | 1.79 |
| YOLOv6-3.0-S | 18.5 | 45.3 | 44.3 | 3.42 | 2.35 |
| Gold-YOLO-S | 21.5 | 46.0 | 45.4 | 3.82 | 2.73 |
| YOLOv8s | 11.2 | 28.6 | 44.9 | 7.07 | 2.33 |
| YOLOv10s | 7.2 | 21.6 | 46.3 | 2.49 | 2.39 |
| RT-DETR-R18 | 20.0 | 60.0 | 46.5 | 4.58 | 4.49 |
| YOLOv6-3.0-M | 34.9 | 85.8 | 49.1 | 5.63 | 4.56 |
| Gold-YOLO-M | 41.3 | 87.5 | 49.8 | 6.38 | 5.45 |
| YOLOv8m | 25.9 | 78.9 | 50.6 | 9.50 | 5.09 |
| YOLOv10m | 15.4 | 59.1 | 51.1 | 4.74 | 4.63 |
| YOLOv6-3.0-L | 59.6 | 150.7 | 51.8 | 9.02 | 7.90 |
| Gold-YOLO-L | 75.1 | 151.7 | 51.8 | 10.65 | 9.78 |
| YOLOv8l | 43.7 | 165.2 | 52.9 | 12.39 | 8.06 |
| RT-DETR-R50 | 42.0 | 136.0 | 53.1 | 9.20 | 9.07 |
| YOLOv10l | 24.4 | 120.3 | 53.2 | 7.28 | 7.21 |
| YOLOv8x | 68.2 | 257.8 | 53.9 | 16.86 | 12.83 |
| RT-DETR-R101 | 76.0 | 259.0 | 54.3 | 13.71 | 13.58 |
| YOLOv10x | 29.5 | 160.4 | 54.4 | 10.70 | 10.60 |
参数量和 FLOPs 数值针对执行 model.fuse() 后的融合模型;此操作会合并 Conv 和 BatchNorm 层,并移除辅助的一对多检测头。预训练检查点保留完整的训练架构,因此显示的数值可能更高。
使用示例#
你也可以通过 Ultralytics Platform 使用云端 GPU 训练模型。使用 YOLOv10 对新图像进行预测:
from ultralytics import YOLO
# 加载预训练的 YOLOv10n 模型
model = YOLO("yolov10n.pt")
# 对图像执行目标检测
results = model("image.jpg")
# 显示结果
results[0].show()在自定义数据集上训练 YOLOv10:
from ultralytics import YOLO
# 从头开始加载 YOLOv10n 模型
model = YOLO("yolov10n.yaml")
# 训练模型
model.train(data="coco8.yaml", epochs=100, imgsz=640)支持的任务和模式#
YOLOv10 系列提供多种模型,每种模型都针对目标检测进行了优化。这些变体适用于不同的计算预算和精度要求。
| 模型 | 文件名 | 任务 | 训练 | 验证 | 推理 | 导出 |
|---|---|---|---|---|---|---|
| YOLOv10 | yolov10n.pt yolov10s.pt yolov10m.pt yolov10b.pt yolov10l.pt yolov10x.pt | 目标检测 | ✅ | ✅ | ✅ | ✅ |
导出 YOLOv10#
由于 YOLOv10 引入了新的运算操作,Ultralytics 提供的导出格式目前并非全部受支持。下表列出了 Ultralytics 已成功转换为 YOLOv10 的格式。欢迎提交拉取请求,为更多格式添加导出支持。
| 导出格式 | 导出支持 | 导出模型推理 | 备注 |
|---|---|---|---|
| TorchScript | ✅ | ✅ | 标准的 PyTorch 模型格式。 |
| ONNX | ✅ | ✅ | 广泛支持部署。 |
| OpenVINO | ✅ | ✅ | 针对 Intel 硬件进行了优化。 |
| TensorRT | ✅ | ✅ | 针对 NVIDIA GPU 进行了优化。 |
| CoreML | ✅ | ✅ | 仅适用于 Apple 设备。 |
| TF SavedModel | ✅ | ✅ | TensorFlow 的标准模型格式。 |
| TF GraphDef | ✅ | ✅ | 旧版 TensorFlow 格式。 |
| TF Edge TPU | ✅ | ✅ | 专用于 Google Edge TPU 设备。 |
| LiteRT | ✅ | ✅ | 针对移动设备、嵌入式设备和浏览器 (LiteRT.js) 进行了优化。 |
| PaddlePaddle | ✅ | ✅ | 在中国广受欢迎;全球支持较少。 |
| NCNN | ✅ | ✅ | 针对移动设备和嵌入式设备进行了优化。 |
结论#
YOLOv10 发布时通过移除 NMS 后处理并重新设计模型组件,在效率和精度方面推动了实时目标检测的发展。其无 NMS 方法开创了 YOLO 系列的端到端目标检测。YOLO26 是最新的 Ultralytics 模型,在此基础上进一步提升了性能,并支持无 NMS 推理。
引用与致谢#
我们谨此感谢来自清华大学的 YOLOv10 作者,他们进行了广泛研究,并为 Ultralytics 框架作出了重要贡献:
@inproceedings{wang2024yolov10,
title={YOLOv10: Real-Time End-to-End Object Detection},
author={Wang, Ao and Chen, Hui and Liu, Lihao and Chen, Kai and Lin, Zijia and Han, Jungong and Ding, Guiguang},
booktitle={Advances in Neural Information Processing Systems},
doi = {10.52202/079017-3429},
url = {https://proceedings.neurips.cc/paper_files/paper/2024/file/c34ddd05eb089991f06f3c5dc36836e0-Paper-Conference.pdf},
volume={37},
pages={107984--108011},
year={2024}
}如需了解详细实现、架构创新和实验结果,请参阅清华大学团队撰写的 YOLOv10 研究论文和 GitHub 代码库。
常见问题#
使用 Ultralytics Python API 或命令行界面(CLI)运行推理。以下是使用 YOLOv10 对新图像进行预测的示例:
示例from ultralytics import YOLO # 加载预训练的 YOLOv10n 模型 model = YOLO("yolov10n.pt") results = model("image.jpg") results[0].show()如需查看更多用法示例,请访问用法示例部分。
YOLOv10 提供多种模型变体,以适应不同的使用场景:
- YOLOv10n:适用于资源极其受限的环境
- YOLOv10s:兼顾速度与精度
- YOLOv10m:适用于通用场景
- YOLOv10b:通过增加网络宽度来提升精度
- YOLOv10l:以增加计算资源消耗为代价,实现高精度
- YOLOv10x:精度和性能最高
每种变体都针对不同的计算需求和精度要求进行设计,因此适用于多种应用场景。请参阅模型变体部分,了解更多信息。
YOLOv10 采用一致的双重分配方式进行训练,使其一对一检测头能够为每个目标生成唯一的最佳预测结果,因此推理时无需进行非极大值抑制(NMS)。Ultralytics 的预测和验证默认使用带有 NMS 的一对多检测头;设置
nms=False即可选择免 NMS 检测头并跳过 NMS 步骤。如需详细说明,请参阅用于免 NMS 训练的一致双重分配部分。YOLOv10 支持多种导出格式,包括 TorchScript、ONNX、OpenVINO 和 TensorRT。不过,由于 YOLOv10 使用了新的操作,目前 Ultralytics 提供的导出格式并非全部都受支持。如需了解支持的格式和导出说明,请访问导出 YOLOv10部分。
发布时,YOLOv10 在精度和效率方面都优于先前的 YOLO 版本及其他先进模型。例如,在 COCO 数据集上,YOLOv10s 的速度比 RT-DETR-R18 快 1.8 倍,且 AP 相近。YOLOv10b 的延迟比 YOLOv9-C 低 46%,参数量少 25%,且性能相同。详细基准测试结果请参阅对比部分。
评论188
提出问题、分享结果,或帮助其他人。
Glenn JocherUltralytics(已编辑)I'm super excited about the groundbreaking work on YOLOv10 by the researchers at Tsinghua University. Just a week ago, @pderrenger and I had the privilege of presenting YOLO to ML graduate students at Tsinghua University in Shenzhen, and I was thoroughly impressed by their enthusiasm and expertise.
Now, seeing the remarkable advancements in real-time object detection with YOLOv10, I'm thrilled to collaborate with the Tsinghua team to officially bring YOLOv10 support to the Ultralytics Python package soon. The innovative approach to NMS-free training and holistic model design optimizations demonstrates their commitment to pushing the boundaries of what's possible.
Stay tuned for the official release of YOLOv10 support in the Ultralytics package, and get ready to experience the incredible capabilities of this revolutionary real-time object detector!
38jameslahm
Thank you so much for your great support for YOLOv10! We are truly grateful for your efforts to bring YOLOv10 to the Ultralytics package. ❤️
2
heynewyeah
您好。如果我想在训练结束后,以last.pt的模型权重继续训练(因为还未收敛),有什么办法能获取last epoch的优化器状态吗,用于继续训练。或者有什么其他方法能够完成继续训练吗?
alephpi(已编辑)
from ultralytics import YOLO # Load a model model = YOLO("path/to/last.pt") # load a partially trained model # Resume training results = model.train(resume=True)
Anser1
Hello, I'm sorry to disturb you. I want to conduct the training for the segmentation task based on YOLOv10, but I found that there seems to be no YAML structure file for the segmentation model. What should I do?
zlj127
Does YOLOv10 have the pose function? Currently, I have only found a pre-trained model for gestures under the GitHub of the Hagrid dataset, but it is still used for detection.
Glenn JocherUltralytics(已编辑)@zlj127 YOLOv10 currently focuses on object detection tasks and does not include built-in pose estimation functionality. For pose/keypoint estimation, we recommend using YOLO26 which offers integrated support for pose estimation along with detection, segmentation, and classification. See the YOLO26 Pose documentation for implementation details and code examples.
zlj127
ok,thank you
Glenn JocherUltralytics(已编辑)@zlj127 you're welcome! For pose estimation tasks, we recommend using YOLO26 which offers integrated support. Let us know if you need help getting started with the Pose documentation.
gniqeh
It is important to configure the correct threshold of dual label assignments in the paper. But how can we change the threshold in yolov10 of ultralytics module?
Es importante configurar el umbral correcto de asignaciones de etiquetas duales en el documento. pero ¿cómo podemos cambiar el umbral en yolov10 del módulo ultralytics?
Glenn JocherUltralytics(已编辑)@gniqeh the dual label assignment settings are not exposed in the model YAML or as training arguments. They are set in the loss code (
E2EDetectLossinultralytics/utils/loss.py), where the one-to-many branch usestal_topk=10and the one-to-one branch usestal_topk=1. To change them, edit those values in a local copy of the package. For details, see the YOLOv10 Ultralytics documentation. Let us know if you need further clarification!gniqeh
Thx for your reply my friend, I have checked the documentation and API ref. of yolov10 but there is only the basical introductiong about it. And i am pleasure if u can provide further implementation explaining. Thanks again!
Glenn JocherUltralyticsThank you for your feedback! For a deeper understanding of YOLOv10 implementation, you can explore the specifics of its architecture and features in the YOLOv10 documentation. If you have particular aspects or technical details you'd like clarified, feel free to let us know!
Ly2003ykjy
Are YOLOV10 and 11 really superior to v7 and v8 in small target detection?
Glenn JocherUltralyticsYOLOv10 and YOLO11 introduce innovations like NMS-free training, which can enhance small target detection performance compared to YOLOv7 and YOLOv8, but results may vary based on specific use cases and datasets.
abaldanz
Hello, do you plan to provide weights for the pre-trained model on 1280p size images?
Glenn JocherUltralytics@abaldanz thank you for your interest. Currently, we don't have plans to provide pre-trained weights specifically for 1280p images. For updates, please keep an eye on our repository and documentation.
Yuwenliula
请问一下,yolov10是否内置了IOU计算的功能,在val结果中未见到IOU的输出,如果没有的话,能方便提供代码进行IOU计算吗?
Glenn JocherUltralytics@Yuwenliula yOLOv10 does not directly output IoU in validation results. You can calculate IoU using the bounding box coordinates from the model's predictions. If you need further assistance, please refer to the Ultralytics documentation for guidance.
qruiwu
what is the each parameter mean in results.csv after training a model?
Glenn JocherUltralytics@wuqrcn the
results.csvfile contains metrics such as precision, recall, mAP, and loss values for each epoch during training. These metrics help evaluate the model's performance and convergence. For more details, please refer to the documentation.
alifazeli00
Why do the weights uploaded here: https://github.com/THU-MIG/yolov10?tab=readme-ov-file#performance not give the same results on the dataset as the weights uploaded on Ultralytics? I checked their architectures, and they seem to be identical.
Glenn JocherUltralytics@alifazeli00 the difference in results might be due to variations in training data, hyperparameters, or preprocessing steps. Ensure both models are evaluated under identical conditions for accurate comparison.
alifazeli00
They are all the same except for the val_period parameter, which is only present in the THU-MIG model. However, the Ultralytics model performs better. I tested x and noticed differences in the weights. Are you saying that these two models should produce identical results?
Glenn JocherUltralyticsThe differences in results could be due to variations in training data, hyperparameters, or preprocessing steps. Ensure both models are evaluated under identical conditions for accurate comparison.
-1