Skip to main content
QUICK REVIEW

[Paper Review] YOLOv12: Attention-Centric Real-Time Object Detectors

Yunjie Tian, Qixiang Ye|ArXiv.org|Feb 18, 2025
CCD and CMOS Imaging SensorsEngineering193 citations
TL;DR

YOLOv12 introduces area attention and residual-efficient layer aggregation to create an attention-centric real-time detector that matches CNN speed while achieving state-of-the-art accuracy on COCO, outperforming YOLOv10/YOLOv11 and RT-DETR variants.

ABSTRACT

Enhancing the network architecture of the YOLO framework has been crucial for a long time, but has focused on CNN-based improvements despite the proven superiority of attention mechanisms in modeling capabilities. This is because attention-based models cannot match the speed of CNN-based models. This paper proposes an attention-centric YOLO framework, namely YOLOv12, that matches the speed of previous CNN-based ones while harnessing the performance benefits of attention mechanisms. YOLOv12 surpasses all popular real-time object detectors in accuracy with competitive speed. For example, YOLOv12-N achieves 40.6% mAP with an inference latency of 1.64 ms on a T4 GPU, outperforming advanced YOLOv10-N / YOLOv11-N by 2.1%/1.2% mAP with a comparable speed. This advantage extends to other model scales. YOLOv12 also surpasses end-to-end real-time detectors that improve DETR, such as RT-DETR / RT-DETRv2: YOLOv12-S beats RT-DETR-R18 / RT-DETRv2-R18 while running 42% faster, using only 36% of the computation and 45% of the parameters. More comparisons are shown in Figure 1.

Motivation & Objective

  • Motivate bringing attention mechanisms into real-time YOLO detectors without sacrificing speed.
  • Propose an efficient area attention module (A2) to maintain a large receptive field with reduced computation.
  • Introduce residual efficient layer aggregation networks (R-ELAN) to improve optimization for attention-based backbones.
  • Apply architectural adjustments to fit YOLO workflows, including FlashAttention usage and removing positional encoding.
  • Demonstrate state-of-the-art latency-accuracy trade-offs across multiple model scales on COCO.

Proposed method

  • Propose area attention (A2) that partitions feature maps into l regions to reduce attention cost from O(n^2) to approximately half while preserving a large receptive field.
  • Adopt FlashAttention to address memory access bottlenecks in attention computations.
  • Develop residual efficient layer aggregation networks (R-ELAN) with a residual input-to-output path and a bottleneck-like feature aggregation to stabilize training of larger models.
  • Refine architectural choices for YOLO, such as lowering MLP ratio to 1.2, using conv+BN over linear+LN, removing positional encoding, and incorporating a large 7x7 position perceiver.
  • Retain hierarchical backbone design from prior YOLO versions, simplify block stacking, and integrate attention modules within the YOLO framework at five scales (N, S, M, L, X).
  • Train and evaluate on MSCOCO-2017 for 600 epochs with SGD, linear lr decay, and TensorRT FP16 latency measurements on a T4 GPU.

Experimental results

Research questions

  • RQ1Can an attention-centric YOLO (YOLOv12) achieve real-time speeds comparable to CNN-based detectors without sacrificing accuracy?
  • RQ2Do area attention and R-ELAN enable stable optimization and superior performance for real-time object detectors at multiple model scales?
  • RQ3How does YOLOv12 compare to state-of-the-art real-time detectors (YOLOv10/YOLOv11, RT-DETR) in terms of mAP, FLOPs, parameters, and latency on standard benchmarks?
  • RQ4What architectural and methodological tweaks are essential to balance computation between attention and feed-forward components in a real-time detector?

Key findings

  • YOLOv12-N achieves 40.6% mAP with 1.64 ms latency on a T4 GPU, outperforming YOLOv10-N by 2.1% and YOLOv11-N by 1.2% mAP.
  • YOLOv12-S achieves 48.0% mAP with 2.61 ms latency, showcasing competitive performance with lower FLOPs (~21.4G) and parameters (~9.3M).
  • YOLOv12-L and YOLOv12-X attain higher mAP (53.7% and 55.2% respectively) with scalable FLOPs and parameters, while maintaining fast inference relative to RT-DETR variants.
  • Area attention yields substantial speedups across CUDA and CPU benchmarks, reducing inference time without significant loss in accuracy.
  • Ablation studies show R-ELAN stability benefits for larger models and that removing positional embeddings can improve speed without harming accuracy.
  • Heatmap visualizations indicate clearer object perception in YOLOv12 compared with YOLOv10/YOLOv11, attributed to area attention’s larger receptive field.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.