On-the-fly Object Detection using StyleGAN with CLIP Guidance

Yuzhe Lu, Shusen Liu, Jayaraman J. Thiagarajan, Wesam Sakla, Rushil AnirudharXiv 2022

Abstract: We present a fully automated framework for building object detectors on satellite imagery without requiring any human annotation or intervention. We achieve this by leveraging the combined power of modern generative models (e.g., StyleGAN) and recent advances in multi-modal learning (e.g., CLIP). While deep generative models effectively encode the key semantics pertinent to a data distribution, this information is not immediately accessible for downstream tasks, such as object detection. In this work, we exploit CLIP's ability to associate image features with text descriptions to identify neurons in the generator network, which are subsequently used to build detectors on-the-fly.

Introduction

In the field of remote sensing, high-resolution satellite imagery is produced at a rate that far outpaces human capacity for annotation. Traditional supervised learning for object detection requires massive, manually labeled datasets, which are expensive to produce and often involve sensitive data. While zero-shot learning offers a potential alternative, many existing methods still rely on some form of human-provided "seed" examples. This paper introduces a method for completely automated object detection, where a system learns to identify new objects based solely on a text description, bypassing the need for human-labeled training images.

Methodology

The proposed pipeline operates in three distinct stages, bridging the gap between generative modeling and semantic understanding.

1. Neuron Discovery

The first stage involves training a StyleGAN on unlabeled satellite imagery. The core insight is that generative models internally organize neurons to represent semantic concepts. To identify these "object-centric" neurons, the system generates images and monitors neuron activation. High-activation regions are masked and passed to CLIP, which scores the snippets against a text prompt (e.g., "an aerial photograph of airplanes"). Neurons that consistently produce regions with high CLIP scores for a specific prompt are flagged as detectors for that concept.

Visualizing discovered neurons for planes (a) and parking lots (b) within the StyleGAN generator.

2. Dataset Synthesis

Once target neurons are identified, StyleGAN is used to generate thousands of synthetic images. Because the system has mapped specific neurons to semantic concepts, it can automatically generate corresponding segmentation masks (pseudo-labels) for these synthetic images. This creates a large-scale, automatically labeled dataset for training.

3. Detector Training

A standard U-Net architecture is trained for image segmentation using this synthetic dataset. To mitigate the noise inherent in GAN-generated labels, the researchers employ Label Smoothing and a CLIP-based consistency check. The latter filters out low-quality synthetic samples where the generated image does not align well with the text prompt according to CLIP.

Experimental Setup and Results

The framework was evaluated using the Rareplanes dataset. An "Oracle" model, trained on 5,233 real-world human-annotated images, served as the performance ceiling. The proposed zero-shot method was trained on a synthetic dataset of the same size.

  • Zero-Shot Performance: The best automated configuration, utilizing CLIP consistency checks, achieved an F1 score of 0.42.
  • Oracle Comparison: The fully supervised Oracle achieved an F1 score of 0.82.

While a performance gap remains, the 0.42 F1 score represents a significant achievement for a system utilizing zero human labels. Notably, the inclusion of CLIP-based consistency checks improved the F1 score by 0.11 over raw neuron activations, highlighting the importance of filtering synthetic data.

Discussion and Limitations

Several challenges persist in this fully automated approach:

  • Domain Gap: There is a performance drop when moving from synthetic training data to real-world test imagery, suggesting that StyleGAN does not perfectly capture all nuances of the real-world distribution.
  • CLIP Bias: CLIP was primarily trained on natural, ground-level images. Its performance on top-down satellite views can be inconsistent, leading to potential blind spots.
  • Contextual Errors: The model occasionally confuses target objects with similar-looking structures, such as mistaking airport terminals for large aircraft or struggling with high-contrast backgrounds like snow.

Conclusion

This work demonstrates that generative models can act as implicit annotators when guided by multi-modal models like CLIP. By "distilling" the knowledge embedded in a GAN into a dedicated detector, we can build functional object detection systems on-the-fly for unlabeled domains. Future research will focus on narrowing the domain gap and improving the resolution of the generative process.

Summary updated

BibTeX
@misc{lu2022fly,
  author = {Yuzhe Lu and Shusen Liu and Jayaraman J. Thiagarajan and Wesam Sakla and Rushil Anirudh},
  title = {{On-the-fly Object Detection using StyleGAN with CLIP Guidance}},
  year = {2022},
  eprint = {2210.16742},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2210.16742},
}
Figure