We introduce DEIM, an innovative and efficient training framework designed to accelerate convergence in real-time object detection with Transformer-based architectures (DETR). To mitigate the sparse supervision inherent in one-to-one (O2O) matching in DETR models, DEIM employs a Dense O2O matching strategy. This approach increases the number of positive samples per image by incorporating additional targets, using standard data augmentation techniques. While Dense O2O matching speeds up convergence, it also introduces numerous low-quality matches that could affect performance. To address this, we propose the Matchability-Aware Loss (MAL), a novel loss function that optimizes matches across various quality levels, enhancing the effectiveness of Dense O2O. Extensive experiments on the COCO dataset validate the efficacy of DEIM. When integrated with RT-DETR and D-FINE, it consistently boosts performance while reducing training time by 50%. Notably, paired with RT-DETRv2, DEIM achieves 53.2% AP in a single day of training on an NVIDIA 4090 GPU. Additionally, DEIM-trained real-time models outperform leading real-time object detectors, with DEIM-D-FINE-L and DEIM-D-FINE-X achieving 54.7% and 56.5% AP at 124 and 78 FPS on an NVIDIA T4 GPU, respectively, without the need for additional data. We believe DEIM sets a new baseline for advancements in real-time object detection. Our code and pre-trained models are available at https://github.com/ShihuaHuang95/DEIM.
Synth
Problem:: DETR의 One-to-One 매칭 방식의 희소한 Supervision과 Low-quality Match로 인해한 느린 수렴 속도와 성능 저하
Novelty:: 표준 데이터 증강 기법을 활용해 타겟 수를 늘리는 단순하고 효과적인 접근법/매칭 품질에 따라 손실값을 조정하는 새로운 손실 함수 설계
Note:: 추가 디코더나 구조 변경 없이 훈련 시간을 50% 단축하면서도 성능은 향상시키는 효율적인 방법
Summary
Motivation
One-To-One Matching (O2O)의 주요 한계
Sparse Supervision: 타겟탕 하나의 Positive Sample을 매칭 → Positive Sample의 수를 제한 → Supervision이 적어 학습이 느림
O2O에서는 할당 된 Positive Sample의 수가 적은 이미지가 많고(파란 선), 그 격차가 최대 9배까지 나는 경우도 존재함 (초록 선)
Low-quality Match: DETR들의 Query 개수(100/300(는 One-To-Many (O2M) 방식의 YOLO (>8000)보다 현저히 적음 → Vari Focal Loss (VFL)의 특성 때문에 Low-quality Match가 많아짐
DETR에서 Vari Focal Loss의 문제: : 예측 확률, : IoU, : Ground Truth 레이블, , : 하이퍼 파라미터
Low-Quality Matches:
낮은 IoU를 가진 박스의 경우 손실값이 매우 적음 → 저품질 박스의 예측 개선 X
Negative Samples 처리:
겹침이 전혀 없는 박스()는 무조건 Negative Sample → Negative Sample 수 증가 → Query수 자체가 적음 → Positive Sample 수 감소
Method
Dense O2O
O2M과 비교해서 O2O의 주요 한계점은 Positive Sample 수가 부족 한 것 → O2O의 장점은 유지하면서 O2M처럼 Positive Sample 수를 늘릴 수 없나? → DataAugmentation으로 한 이미지 내의 Target을 늘려서 Positive Sample 수도 늘리자 (Mosaic/MixUp 등의 Data Augmentation으로 수행)
Matchability Aware Loss
VFL Loss는 IoU가 낮으면 Score가 아무리 높아도 Loss 값이 다 낮음 → Low-quality Match가 학습에 관여를 안함 → 가중치 조정해서 관여 시키자 → 를 로 변경
VFL Loss는 일 때를 전부 Negative로 처리해서 Positive가 적음 → IoU 기준 말고 GT 기준으로 수정 → 대신 로 Foreground 판별
Positive랑 Negative를 비슷하게 반영해볼까? → 하이퍼파라미터 제거
수식
-p^\gamma \log(1-p) & \text{if } y = 0
\end{cases}$$
: 예측 확률, : IoU, : Ground Truth 레이블, : 하이퍼 파라미터
좀 더 직접적인 시각화
Method 검증
훈련 비용 50% 감소하면서도 성능 향상 → Dense O2O와 MAL 조합이 훈련 효율성 크게 개선
DEIM-D-FINE-L은 54.7% AP, DEIM-D-FINE-X는 56.5% AP 달성 → 적은 계산 비용으로도 SOTA 성능 가능
RT-DETRv2에 적용 시 단 하루 훈련으로 53.2% AP 달성 → 실용적인 개발 주기 단축 가능
주요 Insight
작은 객체 탐지 성능 특히 향상(최대 4.2% 개선) → Dense O2O가 희소 supervision 문제를 효과적으로 해결
Low-quality Match에 대한 MAL의 효과 입증 → 품질이 낮은 매칭도 적절한 손실 함수로 최적화하면 전체 성능 향상
데이터 증강(Mosaic/Mixup)과 손실 함수(MAL) 조합의 시너지 효과 → 단순한 기법들로 복잡한 모델 구조 변경 없이 성능 개선
CrowdHuman 데이터셋에서도 일관된 성능 향상 → 다양한 환경에서의 일반화 능력 입증