ابدأ

RTDETRv2 مقابل YOLOX

يمكن للمطوّرين الذين يبنون أنظمة للكشف الآني عن الأجسام الاختيار من بين العديد من البنى. ومن أبرزها RTDETRv2 القائم على المحوّلات والشبكة العصبية الالتفافية (CNN) YOLOX. وقد أسهم كلا النموذجين في تطوير الكشف الآني، لكنهما يتبعان نهجين مختلفين جوهريًا للتعرّف البصري.

يتناول هذا الدليل بنية النموذجين ومقاييس الأداء وسيناريوهات النشر المثالية لكل منهما، ويوضح كيف يبني Ultralytics YOLO26 على هذه الأسس لتحقيق دقة وكفاءة وسهولة استخدام أكبر.

RTDETRv2: محولات الاكتشاف في الوقت الفعلي#

طُرح RTDETRv2 بوصفه خلفًا لنموذج RT-DETR الأصلي، ويستخدم بنية المحوّلات للكشف الآني عن الأجسام. ومن خلال الاستغناء عن الحاجة إلى القمع غير الأقصى (NMS)، يبسّط مسار الاستدلال.

البنية والتصميم#

يعتمد RTDETRv2 على آليات الانتباه الذاتي في المحوّلات لالتقاط السياق العام في الصورة بأكملها، ما يتيح له التنبؤ مباشرةً بالصناديق المحيطة واحتمالات الفئات. وتساعده ميزاته متعددة المقاييس على التعرّف على الأجسام الصغيرة في البيئات المزدحمة.

اختناقات Transformer

مع أن نماذج Transformer بارعة في التقاط السياق الشامل، فإن آليات الانتباه الذاتي فيها تتزايد تربيعيًا مع طول التسلسل، ما يؤدي غالبًا إلى استهلاك ذاكرة CUDA أعلى بكثير أثناء التدريب مقارنةً بنماذج CNN التقليدية.

نقاط القوة والضعف#

تكمن أبرز نقاط قوة RTDETRv2 في تصميمه الأصلي الشامل من البداية إلى النهاية. وباستغنائه عن NMS، يتجنب طفرات زمن الاستجابة المرتبطة بالتنبؤات الكثيفة والمتداخلة. لكن كتل المحوّلات لديه تتطلب قدرًا كبيرًا من العمليات الحسابية وموارد GPU كبيرة للتدريب والنشر على حد سواء، ما يجعله أقل ملاءمة للأجهزة الطرفية محدودة الموارد أو الأجهزة المحمولة القديمة.

تعرّف على المزيد حول RTDETRv2

YOLOX: تطوير نماذج CNN الخالية من المراسي#

طُوّرت YOLOX لسد الفجوة بين الأبحاث الأكاديمية والتطبيق الصناعي، وقدمت رأسًا مفككًا وتصميمًا خاليًا من المراسي إلى عائلة نماذج YOLO الشائعة.

البنية والتصميم#

يخالف YOLOX كواشف الأجسام التقليدية المعتمدة على المراسي، إذ يتنبأ بمواقع الأجسام مباشرةً من دون مربعات مراسي محددة مسبقًا. وهذا يبسّط تصميم الشبكة ويقلل عدد معلمات الضبط الاستدلالية اللازمة لتحقيق الأداء الأمثل. كما يستخدم YOLOX رأسًا مفصولًا يفصل بين مهمتي التصنيف والانحدار، ما يحسّن سرعة التقارب أثناء التدريب.

نقاط القوة والضعف#

يجعل التصميم الخالي من المراسي YOLOX قابلًا للتكيّف مع مهام الرؤية الحاسوبية المختلفة وأسهل تدريبًا على مجموعات البيانات المخصصة. وتناسب إصداراته الأخف، مثل YOLOX-Nano، الأجهزة المحمولة وأجهزة إنترنت الأشياء منخفضة الطاقة. لكن YOLOX سبق ظهور الكواشف الخالية من NMS، ولا يزال يعتمد على المعالجة اللاحقة باستخدام NMS، ما يزيد تعقيد النشر وزمن الاستجابة في المشاهد الكثيفة.

تعرّف على مزيد من المعلومات عن YOLOX

مقارنة الأداء والمقاييس#

يقارن الجدول أدناه السرعة والدقة (mAP) وكفاءة المعلمات بين أحجام النماذج على مجموعة بيانات COCO.

النموذجالحجم
(بكسل)
‏mAPval50-95السرعة
CPU ONNX
(مللي ثانية)
السرعة
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 قيمة mAP تبلغ 54.3 مقابل 51.1 لـ YOLOXx، كما أنه أسرع على GPU من طراز T4 (15.03 ms مقابل 16.1 ms) ويستخدم عددًا أقل من المعلمات (76M مقابل 99.1M). وتبرز أفضلية YOLOX في الأحجام الصغيرة: يعمل YOLOXs في 2.56 ms باستخدام 9.0M معلمة (40.5 mAP)، ويوفر YOLOX-Nano وYOLOX-Tiny خيارات بأقل من 6M معلمة لا تتوفر في RTDETRv2.

ميزة Ultralytics: ظهور YOLO26#

تحتاج مشاريع كثيرة إلى نموذج واحد يجمع بين الدقة العالية والاستدلال السريع ومنظومة أدوات سهلة الوصول. وقد صُمم Ultralytics YOLO26 لهذا الغرض، وأُطلق في يناير 2026.

الابتكارات الرئيسية في YOLO26#

  • تصميم شامل خالٍ من NMS: استنادًا إلى التدريب الخالي من NMS الذي أدخله YOLOv10 إلى نماذج YOLO، يوفّر YOLO26 رأسًا اختياريًا خاليًا من NMS (nms=False). وهو يتيح الاستدلال الشامل في RTDETRv2 من دون متطلبات الذاكرة المرتفعة لـ Transformer.
  • مُحسِّن MuSGD: استلهامًا من تدريب النماذج اللغوية الكبيرة (LLM)، يحقق مُحسِّن MuSGD الهجين (الذي يجمع بين SGD وMuon) استقرار التدريب وتسريع التقارب.
  • استدلال على CPU أسرع بنسبة تصل إلى 43%: يؤدي حذف وحدة خسارة البؤرة التوزيعية (DFL) إلى تبسيط الرأس لأغراض الحوسبة الطرفية والأجهزة منخفضة الطاقة، ما يجعل YOLO26n أسرع بنسبة تصل إلى 43% على CPU (ONNX) مقارنةً بـ YOLO11n.
  • ProgLoss + STAL: تحسّن الخسارة التدريجية وإسناد التسميات الواعي بالأهداف الصغيرة (STAL) التعرّف على الأجسام الصغيرة، وهي مشكلة شائعة في الصور الجوية وتطبيقات الروبوتات.

تعدد الاستخدامات والنظام البيئي#

إلى جانب الأداء الخام، تغطي منصة Ultralytics المسار الكامل من البيانات إلى الإنتاج. وعلى خلاف المستودعات الأكاديمية الثابتة، تحظى نماذج Ultralytics بصيانة مستمرة وتدعم مهامًا متعددة عبر API واحدة. سواء أكنت تنفذ تجزئة المثيلات أو تقدير الوضعيات أو الكشف عن الصناديق المحيطة الموجّهة (OBB)، فسيظل سير العمل كما هو.

تتطلب نماذج Ultralytics YOLO أيضًا ذاكرة قليلة أثناء التدريب والاستدلال، لذا يستطيع الباحثون تشغيل أحجام دفعات أكبر على أجهزة استهلاكية مقارنةً بما تسمح به البنى القائمة على المحوّلات والمستهلكة للذاكرة.

مثال على شيفرة التدريب#

لا يتطلب تدريب نموذج 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 شرطًا صارمًا، فيظل YOLOX-Nano خفيف الوزن (0.91M معلمة، و1.08B FLOPs) خيارًا احتياطيًا عمليًا بفضل بنية CNN البسيطة.

المعيار الحديث: الذكاء الاصطناعي وإنترنت الأشياء والروبوتات#

في معظم حالات الاستخدام الحديثة، بما فيها بنية المدن الذكية التحتية وتحليلات البيع بالتجزئة والملاحة الذاتية، يُوصى باستخدام Ultralytics YOLO26. إذ يلائم استدلال YOLO26n على CPU، الأسرع بنسبة تصل إلى 43% مقارنةً بـ YOLO11n، الحوسبة الطرفية، كما يتيح رأسه الاختياري الخالي من NMS زمن استجابة منخفضًا ومتسقًا. وبالاستعانة بوثائق Ultralytics ومجتمعها النشط، تستطيع الفرق الانتقال سريعًا من توصيف مجموعة البيانات إلى النشر.

بسّط سير عملك

استخدم منصة Ultralytics لإدارة مجموعات البيانات، وتدريب النماذج في السحابة، ونشرها على نطاق واسع.

من نماذج 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.