はじめる

YOLOv10:リアルタイムのエンドツーエンド物体検出

2024年5月にリリースされたYOLOv10は、清華大学の研究者がUltralyticsのPythonパッケージを基盤に開発したモデルで、リアルタイム物体検出に新たなアプローチを導入しました。従来のYOLOバージョンにあった後処理とモデルアーキテクチャの問題に対処しています。非極大値抑制(NMS)を排除し、さまざまなモデルコンポーネントを最適化することで、リリース時点で計算オーバーヘッドを大幅に抑えながら高い性能を実現しました。NMSフリーのエンドツーエンド設計で先駆的なアプローチを確立し、このアプローチはYOLO26でさらに発展しています。

NMSフリートレーニングに向けたYOLOv10の一貫性のあるデュアルアサインメント



視聴: Ultralytics を使って SKU-110k データセットで YOLOv10 をトレーニングする方法 | 小売データセット

概要#

リアルタイム物体検出では、低レイテンシーで画像内の物体カテゴリと位置を正確に予測することを目指します。YOLOシリーズは、性能と効率のバランスにより、この研究分野をリードしてきました。しかし、NMSへの依存とアーキテクチャの非効率性が、最適な性能の妨げとなっていました。YOLOv10は、NMSフリートレーニングを実現するための一貫性のあるデュアルアサインメントと、効率と精度を総合的に考慮したモデル設計戦略を導入して、これらの課題に対処します。

アーキテクチャ#

YOLOv10のアーキテクチャは、従来のYOLOモデルの強みを基盤としながら、いくつかの重要なイノベーションを導入しています。モデルアーキテクチャは、次のコンポーネントで構成されています。

  1. バックボーン: 特徴抽出を担うYOLOv10のバックボーンでは、CSPNet(クロスステージ部分ネットワーク)の拡張版を使用し、勾配の流れを改善して計算の冗長性を削減しています。
  2. ネック: ネックは、異なるスケールの特徴を集約してヘッドに渡すよう設計されています。効果的なマルチスケール特徴融合のために、PAN(経路集約ネットワーク)レイヤーを含みます。
  3. One-to-Manyヘッド: トレーニング中に各物体について複数の予測を生成し、豊富な教師信号を提供して学習精度を向上させます。
  4. One-to-One Head:推論時に各オブジェクトに対して最適な予測を1つだけ生成し、NMSを不要にすることで、レイテンシを短縮し効率を高めます。

主な機能#

  1. NMS-Free Training:一貫性のあるデュアル割り当てを利用してNMSを不要にし、推論レイテンシを短縮します。
  2. Holistic Model Design:軽量な分類ヘッド、空間とチャネルを分離したダウンサンプリング、ランクに基づくブロック設計など、効率と精度の両面からさまざまなコンポーネントを包括的に最適化します。
  3. モデル機能の強化: 大規模カーネルの畳み込みと部分的な自己Attentionモジュールを取り入れ、計算コストを大幅に増やさずに性能を向上させます。

モデルのバリエーション#

YOLOv10には、さまざまな用途のニーズに応える複数のモデルスケールがあります。

  • YOLOv10n:リソースが極めて限られた環境向けのNanoバージョンです。
  • YOLOv10s:速度と精度のバランスを取ったSmallバージョンです。
  • YOLOv10m:汎用用途向けのMediumバージョンです。
  • YOLOv10b:幅を広げて精度を高めた、バランス型のバージョンです。
  • YOLOv10l:計算リソースの増加と引き換えに、より高い精度を実現するLargeバージョンです。
  • YOLOv10x:最大限の精度と性能を実現するExtra-largeバージョンです。

性能#

リリース時点で、YOLOv10は精度と効率の両面で従来のYOLOバージョンや他の最先端モデルを上回りました。たとえば、YOLOv10sはCOCOデータセットで同等のAPを維持しながら、RT-DETR-R18より1.8倍高速です。また、YOLOv10bはYOLOv9-Cと同等の性能で、レイテンシーが46%低く、パラメーター数が25%少なくなっています。

性能

レイテンシは、T4 GPU上でTensorRT FP16を使用して測定しています。

モデル入力サイズAPval50-95FLOPs (G)レイテンシ (ms)
[YOLOv10n][1]64038.56.71.84
[YOLOv10s][2]64046.321.62.49
[YOLOv10m][3]64051.159.14.74
[YOLOv10b][4]64052.592.05.74
[YOLOv10l][5]64053.2120.37.28
[YOLOv10x][6]64054.4160.410.70

方法論#

NMSフリートレーニングのための一貫性のあるデュアル割り当て#

YOLOv10では、トレーニング中にOne-to-ManyとOne-to-Oneの戦略を組み合わせるデュアルラベル割り当てを採用し、豊富な教師信号と効率的なエンドツーエンドデプロイを実現します。Ultralyticsの予測と検証では、デフォルトでNMSを使用するOne-to-Manyヘッドが使われます。NMSフリーヘッドを選択するには、nms=Falseを設定します。一貫したマッチング指標によって両方の戦略間で教師信号を整合させ、推論時の予測品質を高めます。

効率と精度を総合的に考慮したモデル設計#

効率の向上#

  1. 軽量な分類ヘッド:深さ方向分離可能な畳み込みを使用して、分類ヘッドの計算オーバーヘッドを削減します。
  2. 空間とチャネルを分離したダウンサンプリング:空間の縮小とチャネルの調整を分離し、情報損失と計算コストを最小限に抑えます。
  3. ランクに基づくブロック設計:ステージ固有の冗長性に応じてブロック設計を調整し、パラメーターを最適に活用します。

精度の向上#

  1. 大規模カーネルの畳み込み:受容野を拡大し、特徴抽出能力を高めます。
  2. 部分的なセルフアテンション(PSA):最小限のオーバーヘッドでグローバル表現の学習を向上させるため、セルフアテンションモジュールを導入します。

実験と結果#

YOLOv10は、COCOなどの標準ベンチマークで評価されました。リリース時点で、すべてのバリエーションが従来のYOLOバージョンや同時期の他の検出器より、レイテンシーと精度のトレードオフを改善しました。

比較#

YOLOv10と最先端の物体検出器との比較

他の最先端の検出器と比較すると、次のとおりです。

  • YOLOv10s / xは、同等の精度でRT-DETR-R18 / R101より1.8倍 / 1.3倍高速です
  • YOLOv10bは、同等の精度でYOLOv9-Cよりパラメーター数が25%少なく、レイテンシが46%低くなっています
  • YOLOv10l / xは、YOLOv8l / xを0.3 AP / 0.5 AP上回り、パラメーター数は1.8倍 / 2.3倍少なくなっています
性能

以下の数値はYOLOv10の論文で報告されたもので、独自のプロトコルで測定されています。そのため、Ultralyticsのモデルページに掲載されている数値とは直接比較できません。

モデルパラメーター
(M)
FLOPs
(G)
mAPval50-95レイテンシ
(ms)
レイテンシ(フォワード)
(ms)
YOLOv6-3.0-N4.711.437.02.691.76
Gold-YOLO-N5.612.139.62.921.82
YOLOv8n3.28.737.36.161.77
YOLOv10n2.36.738.51.841.79
YOLOv6-3.0-S18.545.344.33.422.35
Gold-YOLO-S21.546.045.43.822.73
YOLOv8s11.228.644.97.072.33
YOLOv10s7.221.646.32.492.39
RT-DETR-R1820.060.046.54.584.49
YOLOv6-3.0-M34.985.849.15.634.56
Gold-YOLO-M41.387.549.86.385.45
YOLOv8m25.978.950.69.505.09
YOLOv10m15.459.151.14.744.63
YOLOv6-3.0-L59.6150.751.89.027.90
Gold-YOLO-L75.1151.751.810.659.78
YOLOv8l43.7165.252.912.398.06
RT-DETR-R5042.0136.053.19.209.07
YOLOv10l24.4120.353.27.287.21
YOLOv8x68.2257.853.916.8612.83
RT-DETR-R10176.0259.054.313.7113.58
YOLOv10x29.5160.454.410.7010.60

パラメーター数とFLOPsの値は、model.fuse()後の融合モデルを対象としています。この処理ではConv層とBatchNorm層が統合され、補助的なOne-to-Many検出ヘッドが削除されます。事前学習済みチェックポイントはトレーニング時の完全なアーキテクチャを保持しているため、より大きな値が示されることがあります。

使用例#

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モデルシリーズには、物体検出に最適化されたさまざまなモデルがあります。各バリエーションは、異なる計算予算と精度要件に対応します。

モデルファイル名タスクトレーニング検証推論エクスポート
YOLOv10yolov10n.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ファミリーにおけるエンドツーエンド物体検出の先駆けとなりました。最新のUltralyticsモデルであるYOLO26は、性能を向上させ、NMSフリー推論に対応することで、この取り組みを発展させています。

引用と謝辞#

広範な研究とUltralyticsフレームワークへの多大な貢献を称え、清華大学のYOLOv10著者の皆様に感謝いたします。

引用
@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リポジトリをご覧ください。

よくある質問#

  • 清華大学の研究者が開発したYOLOv10は、リアルタイム物体検出にいくつかの重要なイノベーションをもたらします。トレーニング時に一貫性のあるデュアル割り当てを採用して、非極大抑制(NMS)を不要にし、計算オーバーヘッドを削減するためにモデルのコンポーネントを最適化しています。

  • 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は一貫性のあるデュアル割り当てで学習し、1対1ヘッドがオブジェクトごとに最適な予測を1つ生成するため、推論時の非最大値抑制(NMS)が不要になります。Ultralyticsの予測と検証では、デフォルトでNMSを使用する1対多ヘッドが選択されます。NMSフリーヘッドを選択してNMS処理を省略するには、nms=Falseを設定します。詳細な説明については、NMSフリー学習のための一貫性のあるデュアル割り当てのセクションをご覧ください。

  • YOLOv10は、TorchScript、ONNX、OpenVINO、TensorRTなど、複数のエクスポート形式に対応しています。ただし、新しい演算が使用されているため、Ultralyticsが提供するすべてのエクスポート形式に現時点で対応しているわけではありません。対応形式とエクスポート手順の詳細については、YOLOv10のエクスポートのセクションをご覧ください。

  • リリース時点で、YOLOv10は精度と効率の両面で従来のYOLOバージョンや他の最先端モデルを上回りました。たとえば、YOLOv10sはCOCOデータセットで同程度のAPを達成しながら、RT-DETR-R18より1.8倍高速です。YOLOv10bはYOLOv9-Cと同等の性能で、レイテンシーが46%低く、パラメーター数が25%少なくなっています。詳細なベンチマークは、比較のセクションをご覧ください。

コメント188

質問したり、結果を共有したり、ほかの人をサポートしたりできます。

  1. 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.

    1716582575743

    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!

    38
    1. jameslahmGitHub

      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
  2. heynewyeahGitHub

    您好。如果我想在训练结束后,以last.pt的模型权重继续训练(因为还未收敛),有什么办法能获取last epoch的优化器状态吗,用于继续训练。或者有什么其他方法能够完成继续训练吗?

    1. alephpiGitHub(編集済み)
      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)
  3. Anser1GitHub

    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?

  4. zlj127GitHub

    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.

    1. 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.

    2. 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.

  5. gniqehGitHub

    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?

    1. 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 (E2EDetectLoss in ultralytics/utils/loss.py), where the one-to-many branch uses tal_topk=10 and the one-to-one branch uses tal_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!

    2. gniqehGitHub

      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!

    3. Glenn JocherUltralytics

      Thank 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!

    1. Glenn JocherUltralytics

      YOLOv10 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.

    1. 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.

  6. YuwenliulaGitHub

    请问一下,yolov10是否内置了IOU计算的功能,在val结果中未见到IOU的输出,如果没有的话,能方便提供代码进行IOU计算吗?

    1. 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.

    1. Glenn JocherUltralytics

      @wuqrcn the results.csv file 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.

    1. 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.

    2. alifazeli00GitHub

      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?

    3. Glenn JocherUltralytics

      The 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