Abstract
Modern object detection frameworks typically combine a pretrained backbone with a randomly initialized detection head. This discrepancy often leads to "noisy gradients" during early training phases, which can degrade the high-quality features in the backbone. We introduce LabelEnc, a novel training framework that addresses this by providing "ideal" intermediate supervision. LabelEnc employs an AutoEncoder to map ground-truth labels into an optimized latent embedding space. This space acts as a clean teacher signal for the backbone, leading to significant performance gains—approximately 2% mAP on the COCO dataset—across various detector architectures without any additional inference cost.
Introduction
The standard architecture for object detectors consists of a feature-extracting backbone and a task-specific detection head. While backbones benefit from pretraining on large datasets like ImageNet, detection heads are typically initialized from scratch. During the initial stages of training, the chaotic gradients produced by these random heads can negatively impact the pretrained backbone features.
Common strategies to mitigate this, such as freezing backbone layers or employing Knowledge Distillation (KD), have drawbacks. Freezing layers limits the model's ability to adapt to the detection task, while KD requires a pre-existing, high-performing "teacher" model, which may not always be available or significantly better than the student.
Methodology
LabelEnc proposes a two-step pipeline to provide stable, high-quality supervision to the backbone.
Step 1: AutoEncoder Training
The first phase involves learning a label encoding function $h(y)$ that maps ground-truth labels $y$ into a latent feature space. The detection head is treated as a "decoder" in an AutoEncoder setup. By training this system such that the input is the ground truth and the output is the detection result, the model identifies the "ideal" intermediate features required for a perfect head to recover the ground truth. A joint optimization scheme, including a temporary backbone, ensures that this latent space is realistic and reachable for a neural network processing image data.
Step 2: Detector Training
Once the label encoding function $h(y)$ is optimized and fixed, it serves as a teacher. During the training of the actual detector, an auxiliary loss is introduced to encourage the backbone's feature maps to align with the "ideal" features generated by $h(y)$. After training is complete, the label encoder and auxiliary loss are discarded, leaving a standard detector architecture that has benefited from cleaner supervision.
Experimental Results
The LabelEnc method was rigorously evaluated on the MS COCO dataset using the standard trainval35k for training and minival for evaluation. The framework demonstrated consistent improvements across various detector types:
- One-Stage Detectors: RetinaNet (ResNet-50) saw an increase from 36.1% to 38.4% mAP (+2.3%).
- Anchor-Free Detectors: FCOS (ResNet-50) improved from 36.7% to 38.9% mAP (+2.2%).
- Two-Stage Detectors: FPN (ResNet-50) rose from 36.8% to 38.8% mAP (+2.0%).
- Instance Segmentation: Mask R-CNN showed mask mAP improvements of ~1.2-1.4% across ResNet-50 and ResNet-101 backbones.
Crucially, LabelEnc consistently outperformed traditional Knowledge Distillation, especially when the performance gap between the teacher and student models was small.
Discussion and Key Insights
The core philosophy of LabelEnc is that the optimal intermediate feature is essentially the "mathematical inverse" of an ideal detection head. Since this inverse is difficult to compute directly, the AutoEncoder provides a robust approximation.
Key advantages of this approach include:
- Backbone Agnosticism: The label encoder $h(y)$ is relatively insensitive to the specific backbone used during its training, allowing an encoder trained with one architecture to supervise another.
- Inference Efficiency: Because the auxiliary components are only used during training, the final model maintains its original inference speed.
- Superior Supervision: By using ground truth to generate the teacher signal, LabelEnc avoids the performance ceilings inherent in traditional KD.
Limitations
Despite its benefits, LabelEnc increases training complexity, effectively doubling the required iterations. Additionally, the current method relies on a manual heuristic to convert ground-truth boxes into a specific tensor format, which may require task-specific tuning. Future work could explore extending this framework to other structured output tasks beyond detection and segmentation.
Summary updated