はじめる

RTDETRv2とYOLOX

リアルタイム物体検出システムを構築する開発者は、多くのアーキテクチャから選択できます。注目すべきものとして、TransformerベースのRTDETRv2と、畳み込みニューラルネットワーク(CNN)であるYOLOXがあります。どちらもリアルタイム検出を大きく進歩させましたが、画像認識へのアプローチは根本的に異なります。

このガイドでは、両モデルのアーキテクチャ、性能指標、最適なデプロイシナリオを解説し、Ultralytics YOLO26がこれらの基盤を活用して、精度、効率、使いやすさをさらに高める方法を紹介します。

RTDETRv2:リアルタイム検出Transformer#

元のRT-DETRの後継として登場したRTDETRv2は、リアルタイム物体検出にTransformerアーキテクチャを採用しています。Non-Maximum Suppression (NMS)を不要にすることで、推論パイプラインを簡素化します。

アーキテクチャと設計#

RTDETRv2はTransformerのセルフアテンション機構を利用して画像全体のグローバルなコンテキストを捉え、バウンディングボックスとクラス確率を直接予測します。マルチスケール特徴により、雑然とした環境にある小さな物体も認識できます。

Transformerのボトルネック

Transformerはグローバルなコンテキストの把握に優れていますが、セルフアテンション機構の計算量はシーケンス長に対して二次的に増加します。そのため、従来型CNNと比べて、トレーニング時のCUDAメモリー消費量が大幅に増えることがよくあります。

強みと弱み#

RTDETRv2の最大の強みは、ネイティブなエンドツーエンド設計です。NMSを省略することで、密集した重複予測に伴うレイテンシの急増を回避します。ただし、Transformerブロックは計算負荷が大きく、トレーニングとデプロイの両方で多くのGPUリソースを必要とするため、リソースが限られたエッジデバイスや旧世代のモバイルハードウェアには適しにくいモデルです。

RTDETRv2の詳細を見る

YOLOX:アンカーフリーCNNの進化#

学術研究と産業応用の隔たりを埋めるために開発されたYOLOXは、人気のあるYOLOモデルファミリーに、デカップルドヘッドとアンカーフリー設計を導入しました。

アーキテクチャと設計#

YOLOXは、従来のアンカーベース検出器とは異なり、事前定義されたアンカーボックスを使わずに物体の位置を直接予測します。これによりネットワーク設計が簡素化され、最適な性能を得るために必要なヒューリスティックな調整パラメーターも減少します。さらに、YOLOXは分類タスクと回帰タスクを分離するデカップルドヘッドを採用し、トレーニング時の収束速度を高めています。

強みと弱み#

YOLOXはアンカーフリー設計のため、さまざまなコンピュータービジョンタスクに適応でき、カスタムデータセットでのトレーニングも簡単です。YOLOX-Nanoなどの最小モデルは、モバイル機器や低消費電力のIoTデバイスに適しています。ただし、YOLOXはNMS不要の検出器より前に登場したモデルであり、後処理に依然としてNMSを使用するため、密集したシーンではデプロイが複雑になり、レイテンシも増加します。

YOLOXの詳細はこちら

パフォーマンスと指標の比較#

以下の表では、COCOデータセットにおけるモデルサイズごとの速度、精度(mAP)、パラメーター効率を比較します。

モデルサイズ
(ピクセル)
mAPval50-95速度
CPU ONNX
(ms)
速度
T4 TensorRT10
(ms)
パラメーター
(M)
FLOPs
(B)
RTDETRv2-s64048.1-5.032060
RTDETRv2-m64051.9-7.5136100
RTDETRv2-l64053.4-9.7642136
RTDETRv2-x64054.3-15.0376259
YOLOXnano41625.8--0.911.08
YOLOXtiny41632.8--5.066.45
YOLOXs64040.5-2.569.026.8
YOLOXm64046.9-5.4325.373.8
YOLOXl64049.7-9.0454.2155.6
YOLOXx64051.1-16.199.1281.9

同程度のサイズでは、RTDETRv2の方がすべてのモデルサイズで高精度です。RTDETRv2-xはYOLOXxの51.1 mAPに対して54.3 mAPを達成し、T4 GPUでもより高速(15.03 ms対16.1 ms)で、パラメーター数も少なくなっています(76M対99.1M)。一方、YOLOXは小型モデルで優位です。YOLOXsは9.0Mパラメーターで2.56 ms(40.5 mAP)で動作し、YOLOX-NanoとYOLOX-Tinyは、RTDETRv2にはない6M未満のパラメーター数の選択肢を提供します。

Ultralyticsの強み:YOLO26の登場#

多くのプロジェクトでは、高精度、高速な推論、利用しやすいエコシステムを兼ね備えた単一のモデルが求められます。2026年1月にリリースされたUltralytics YOLO26は、これを実現するために設計されています。

YOLO26の主な革新点#

  • エンドツーエンドのNMSフリーデザイン: YOLOv10がYOLOモデルに導入したNMSフリー学習を基盤として、YOLO26ではオプションのNMSフリーヘッド(nms=False)を利用できます。Transformerに必要な大容量メモリなしで、RTDETRv2のエンドツーエンド推論を実現できます。
  • MuSGDオプティマイザー: 大規模言語モデル(LLM)のトレーニングに着想を得たハイブリッド型MuSGDオプティマイザー(SGDとMuonを組み合わせたもの)は、トレーニングを安定させ、収束を高速化します。
  • CPU推論が最大43%高速: Distribution Focal Loss(DFL)モジュールを取り除いてヘッドを簡素化することで、エッジコンピューティングや低消費電力デバイスに適した設計となっています。YOLO26nは、YOLO11nよりもCPU(ONNX)で最大43%高速に動作します。
  • ProgLoss + STAL: Progressive Lossと小さな物体を考慮したラベル割り当て(STAL)により、小さな物体の認識性能が向上します。これは、航空画像やロボティクスのアプリケーションでよく見られる課題です。

汎用性とエコシステム#

生の性能だけでなく、Ultralytics Platformはデータから本番環境までの全工程をカバーします。静的な学術リポジトリとは異なり、Ultralyticsモデルは継続的にメンテナンスされ、単一のAPIで複数のタスクをサポートします。インスタンスセグメンテーション、姿勢推定、回転バウンディングボックス(OBB)検出のいずれを実行する場合も、ワークフローは変わりません。

Ultralytics YOLOモデルは、トレーニング時と推論時のメモリ要件も低いため、メモリ消費の大きいTransformerベースのアーキテクチャよりも、一般向けハードウェアで大きなバッチサイズを使用できます。

トレーニングコードの例#

YOLO26モデルのトレーニングは数行のコードで実行でき、Ultralyticsパッケージがデータの読み込みとデフォルトのハイパーパラメーター設定を処理します。

from ultralytics import YOLO

# Initialize the YOLO26 Nano model
model = YOLO("yolo26n.pt")

# Train the model on the standard COCO8 dataset
results = model.train(data="coco8.yaml", epochs=100, imgsz=640, batch=16)

# Validate the model's performance
metrics = model.val()
print(f"Validation mAP: {metrics.box.map}")

# Export to ONNX or TensorRT for rapid deployment
model.export(format="engine", device=0)

実環境での用途と適したユースケース#

適切なアーキテクチャは、デプロイ上の制約と利用可能なハードウェアによって異なります。

高精度なクラウド処理#

高性能サーバーGPUでアプリケーションを実行し、最大限の精度を優先する場合、たとえば混雑した群衆のシーンを分析したり、高解像度の医療画像を処理したりする場合は、RTDETRv2のアテンション機構が効果的です。

従来型のエッジデバイスへのデプロイ#

最小限のFLOPsが厳格に求められる旧世代の携帯電話や、リソースが大きく制限された組み込みハードウェアでは、シンプルなCNNアーキテクチャを持つ軽量なYOLOX-Nano(0.91Mパラメーター、1.08B FLOPs)が、引き続き有効な代替モデルです。

現代の標準:AIoTとロボティクス#

スマートシティインフラ、小売分析、自律ナビゲーションなど、現代の多くのユースケースでは、Ultralytics YOLO26を推奨します。YOLO26nはYOLO11nよりもCPU推論が最大43%高速なためエッジコンピューティングに適しており、オプションのNMS不要ヘッドによってレイテンシを低く安定させます。Ultralyticsのドキュメントと活発なコミュニティも活用することで、チームはデータセットのアノテーションからデプロイまでを迅速に進められます。

ワークフローを効率化

Ultralytics Platformを使用すると、データセットの管理、クラウドでのモデルのトレーニング、大規模なデプロイができます。

検討対象となるその他のUltralyticsモデルには、幅広いコミュニティ連携を持つYOLOv8や、レガシーパイプラインで安定して利用できるYOLOv5があります。新しいプロジェクトでは、YOLO26を出発点として推奨します。

コントリビューター

コメント6

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

  1. UltralyticsAssistantGitHubUltralytics

    👋 Hello, thank you for opening a discussion and engaging with Ultralytics 🚀! For new users, we recommend visiting the Docs where you'll find detailed Python and CLI usage examples, as well as answers to many common questions.

    If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us investigate further.

    If your question is about custom training or model comparison ❓, please share as much detail as possible—such as dataset samples, training logs, or what specific performance metrics you're interested in. Don't forget to check out our Tips for Best Training Results for optimal guidance.

    Join the Ultralytics community where you feel most comfortable:

    • For real-time chat, head to Discord 🎧
    • For in-depth discussions, visit Discourse
    • Or explore threads on our Subreddit to share and learn with others

    Upgrade

    Please ensure you're using the latest ultralytics package and all requirements in a Python>=3.8 environment with PyTorch>=1.8:

    pip install -U ultralytics

    Environments

    YOLO models can be run in any of the following up-to-date verified environments (with all dependencies, including CUDA/CUDNN, Python and PyTorch preinstalled):

    Status

    Ultralytics CI

    If this badge is green, all Ultralytics CI tests are currently passing! CI tests verify correct operation of all YOLO Modes and Tasks across macOS, Windows, and Ubuntu every 24 hours and on every commit.

    This is an automated response and an Ultralytics engineer will assist you soon 😊

    1. Glenn JocherUltralytics(編集済み)

      This page offers a valuable comparison between RTDETRv2 and YOLOX, highlighting their different strengths. If you have specific questions about these models, feel free to ask here. RTDETRv2 excels in accuracy (reaching 54.3% mAP) but demands more computational resources, while YOLOX stands out for efficiency and speed, making it ideal for edge devices. For those seeking alternatives with a balance of performance and usability, you might also consider Ultralytics YOLO26, which offers excellent performance across various computer vision tasks. What specific aspect of these models are you most interested in learning more about?

  2. UltralyticsAssistantGitHubUltralytics

    👋 Hello, thank you for starting this comparison discussion about RTDETRv2 and YOLOX! 🚀 For detailed guidance, we recommend checking out our Docs, which contain in-depth information, benchmarks, and usage examples that may help answer many of your questions.

    If this is a 🐛 Bug Report, please provide a minimum reproducible example so we can assist you efficiently.

    For model training or evaluation ❓ Questions, please share as many details as possible, such as dataset samples, training logs, or specific requirements, and review our Tips for Best Training Results.

    Join the Ultralytics community in your preferred space! For real-time chat, visit our Discord 🎧. For topic-based discussions, check out Discourse, or connect with others on our Subreddit.

    Upgrade

    Make sure your ultralytics package and all requirements are up to date in a Python>=3.8 environment with PyTorch>=1.8:

    pip install -U ultralytics

    Environments

    YOLO models can be run in these verified environments:

    Status

    Ultralytics CI

    A green badge means all Ultralytics CI tests are passing. CI covers all YOLO Modes and Tasks across macOS, Windows, and Ubuntu.

    This is an automated response 🤖. An Ultralytics engineer will review your discussion and provide further assistance soon!

    1. Glenn JocherUltralytics(編集済み)

      Welcome to the RTDETRv2 vs YOLOX comparison discussion! This page highlights two powerful object detection approaches with different strengths: RTDETRv2 leverages transformer architecture for higher accuracy in complex scenes (54.3% mAP for RTDETRv2-x), while YOLOX offers exceptional efficiency with faster inference speed (2.56ms for YOLOX-s on T4 TensorRT).

      Your use case should guide your choice - RTDETRv2 excels when maximum accuracy is critical and GPU resources are available, while YOLOX is ideal for edge devices and real-time applications with limited resources.

      If you're looking for models within a comprehensive ecosystem, you might also consider Ultralytics YOLO26 which balances performance with ease of use.

      Feel free to post any questions about these models or their implementation in your specific applications. The Ultralytics team is here to help!

  3. UltralyticsAssistantGitHubUltralytics

    👋 Hello, thank you for starting this discussion and sharing your interest in comparing object detection models like RTDETRv2 and YOLOX 🚀! For a detailed overview, the Ultralytics Docs offer a wealth of information, including the comparison page you linked, which highlights model strengths, performance, and use cases.

    If you have specific questions or encounter any issues related to these models, please provide as much detail as possible.

    • If this is a 🐛 Bug Report, please include a minimum reproducible example to help us assist you.
    • For custom training ❓ questions, adding dataset samples and training logs can be very helpful. Make sure to review our Training Tips for best results.

    Connect with the Ultralytics community in your preferred way! For real-time help, join our Discord 🎧. In-depth posts and discussions are found on Discourse, and our Subreddit is great for sharing experiences and solutions.

    Upgrade

    To ensure the best experience and access to the latest features and fixes, please upgrade the ultralytics package and all requirements in a Python>=3.8 environment with PyTorch>=1.8:

    pip install -U ultralytics

    Environments

    YOLO models can be run in any of these verified environments with all dependencies preinstalled:

    Status

    Ultralytics CI

    A green badge means all Ultralytics CI tests are passing, ensuring YOLO Modes and Tasks work across macOS, Windows, and Ubuntu.

    This is an automated response 🤖—an Ultralytics engineer will review your discussion and assist you soon!

    1. Glenn JocherUltralytics(編集済み)

      Welcome to the discussion about RTDETRv2 and YOLOX object detection models! Both offer different strengths - RTDETRv2 provides higher accuracy through its transformer architecture, while YOLOX excels in speed and efficiency on resource-constrained devices.

      If you have specific questions about implementing either model, performance tuning, or need help choosing between them for your particular use case, please share your questions here. Our team monitors these discussions to provide technical guidance and support.

      For hands-on users interested in similar models with Ultralytics integration, YOLO26 offers an excellent balance of speed and accuracy with full support in our ecosystem.