Back Home

GitHub Repo

Transformers Community Revisits RT-DETR Training Loss Mismatch; Legacy Denoising Queries May Crowd Out Positives

A report to the Transformers community on October 21 said RT-DETR models trained with version 5.14.1 may mix denoising queries into the main loss, weakening positive supervision for regular queries. A related fix was merged to the main branch in September, but the reported experiment has not been independently reproduced; users should check their installed version.

Unknown authorUnknown author · Public domain · Image source
zh-Hant

Hugging Face Transformers received a report on October 21 of an RT-DETR/RT-DETRv2 training anomaly: with denoising training enabled in version 5.14.1, the main loss may include both denoising and regular object queries, leaving the regular queries used at inference without positive supervision. Another participant noted that a related fix was already on the main branch. The report concerns results from older training runs and checking the installed version; it does not establish a new regression in the latest version. Community report

RT-DETR is a real-time object detection Transformer. The official documentation lists 300 object queries by default and uses num_denoising to control contrastive denoising training, with a default value of 100. Noise is added to labels and bounding boxes to provide an additional training signal. This means the training query set contains two groups with different purposes, which the loss function must distinguish correctly. Official documentation

The merged fix’s description confirms that the old logic separated denoising queries only in paths such as the auxiliary loss, while the main loss still performed Hungarian matching across all queries. Because positive denoising queries are close to the ground-truth annotations, they can match easily, leaving regular queries without positive examples. The fix first separates the queries using denoising metadata, then calculates the main loss, and adds a regression test. The change was merged on September 11 and also covers D-FINE. Fix details

The new report includes an experiment with a single-class RT-DETRv2 R50: in an overfitting test on crops from 20 images, mAP changed from 0.04 to 0.987 after the queries were separated. This was a specific experiment by the reporter, not a general performance improvement, and it has not been independently reproduced. Experiment details

For engineers fine-tuning models, a check based on the mechanism described above is to hold the data and random seed constant, then compare the regular-query main loss and matching indices between the installed version and a version containing the fix. Follow-up checks should establish whether the reporter can reproduce the result on the latest main branch and whether RT-DETRv2 tests cover both settings for auxiliary loss. The available information does not yet establish the first official release version to include the fix.

Sources

  1. RT-DETR / RT-DETRv2: main loss is computed on the denoising queries too
  2. Fix D-FINE / RT-DETR main loss being computed over the denoising queries
  3. RT-DETR — Transformers documentation