Improving Object Detection via Local-global Contrastive Learning

Danai Triantafyllidou, Sarah Parisot, Ales Leonardis, Steven McDonagh

Abstract

Deep learning-based object detectors frequently encounter performance drops due to domain shifts, such as changes in weather or transitions from synthetic to real-world data. While Image-to-Image (I2I) translation can mitigate this by mapping target images to the source domain, existing methods often struggle with preserving small object details or require costly target-domain annotations. This paper introduces an attention-guided I2I framework that leverages a local-global contrastive learning objective to implicitly disentangle foreground objects from backgrounds. By focusing translation on these discovered regions, the model maintains critical object features for detection. Experimental results across multiple benchmarks, including Foggy Cityscapes and Sim10K, demonstrate that the proposed method achieves state-of-the-art performance without requiring any target-domain labels.

Introduction

Object detection is a cornerstone of autonomous systems, yet its reliability is often compromised by "domain shift." A model trained on clear, sunny data may fail in foggy or rainy conditions. Image-to-Image (I2I) translation is a popular strategy to address this, aiming to "normalize" target images into the source domain. However, traditional global I2I methods often introduce artifacts or blur small, distant objects. While instance-aware methods can preserve these details, they typically necessitate manual object annotations in the target domain, which is expensive and time-consuming.

Methodology: Local-Global Contrastive Learning

The proposed framework addresses these challenges through an attention-guided architecture that learns to distinguish objects from backgrounds in an unsupervised manner. The system comprises three core components:

  1. Shared Encoder ($E_B$): Extracts high-level features from the input.
  2. Content Generator ($G_C$): Generates potential content maps for the translated image.
  3. Attention Generator ($G_A$): Produces spatial masks to determine foreground and background regions.
Qualitative results showing the translation from foggy to clear domains and the resulting high-confidence object detections.

The key innovation is the Local-global Contrastive Learning objective. By encouraging local image patches to align with the global representation of the same image in latent space—while contrasting them against patches from other images—the model develops an inductive prior that naturally delineates salient objects. This allows the generator to focus its capacity on foreground regions, preserving the sharp details necessary for a frozen, pre-trained detector to operate effectively.

Experimental Evaluation

The method was evaluated on three major cross-domain benchmarks:

  • Foggy Cityscapes → Cityscapes: Adapting from synthetic fog to clear weather.
  • KITTI → Cityscapes: Real-to-real adaptation between different sensor setups.
  • Sim10K → Cityscapes: Synthetic-to-real adaptation using data from the GTA-V engine.

Results and Discussion

The proposed method consistently outperformed existing unsupervised I2I-based detection methods. On the Foggy Cityscapes benchmark, it achieved 45.3% mAP, surpassing other contrastive methods like CUT and FeSeSim. In the KITTI → Cityscapes task, it reached 64.1% mAP, a significant result for a method that does not utilize target domain labels. For Sim10K → Cityscapes, the model achieved 52.1% AP for the car class, nearing the performance of "Oracle" models trained directly on target data.

Detailed view of object detection performance in a dense urban scene.

Qualitative analysis confirms that the learned attention masks accurately identify pedestrians and vehicles even in low-visibility conditions. Furthermore, because the method works with a frozen detector, it avoids the risk of catastrophic forgetting often associated with fine-tuning on new domains.

Conclusion and Future Work

This research demonstrates that implicit object awareness can be achieved through self-supervised contrastive learning, eliminating the need for expensive target-domain annotations in cross-domain object detection. While the method's performance is tied to the quality of the source detector, its modularity and state-of-the-art results mark a significant step forward. Future work may involve scaling the approach with higher-capacity backbones to further close the gap with supervised domain adaptation techniques.

Summary updated

BibTeX
@inproceedings{triantafyllidou2024improving,
  author = {Danai Triantafyllidou and Sarah Parisot and Ales Leonardis and Steven McDonagh},
  title = {{Improving Object Detection via Local-global Contrastive Learning}},
  booktitle = {BMVC},
  year = {2024},
}
Figure