Learning to Annotate Part Segmentation with Gradient Matching

Yu Yang, Xiaotian Cheng, Hakan Bilen, Xiangyang Ji

TL;DR

This paper introduces a novel way to train "automatic annotators" for part segmentation by leveraging pre-trained Generative Adversarial Networks (GANs). By using a technique called gradient matching, the authors enable an annotator to learn how to label synthetic images using only a tiny amount of real-world labeled data. This approach significantly outperforms existing semi-supervised methods when human labels are extremely scarce.

The Cost of Pixel-Perfect Labels

Deep learning thrives on massive datasets, but pixel-perfect labels for tasks like semantic part segmentation (e.g., identifying the "nose" on a face or the "wing" of an airplane) are incredibly expensive and slow to produce.

Recent breakthroughs like DatasetGAN demonstrated that we could use the internal features of a GAN to generate infinite labeled data. However, these methods suffer from a "human-in-the-loop" bottleneck: a person still has to manually label a set of synthetic images generated by the GAN. This is tedious, and if you update your GAN model, you often have to start the labeling process all over again.

The authors sought a way to train an annotator that doesn't require labeling synthetic images directly. Instead, their method allows the annotator to learn from any available labeled source—be it real photos, 3D renders, or older datasets.

Methodology: A Meta-Learning Approach

The authors frame the problem as a learning-to-learn (meta-learning) task. The architecture relies on three main components:

Overview of the Gradient Matching framework for training the automatic annotator.
  1. A Pre-trained GAN ($G$): Provides high-quality synthetic images and their underlying feature maps.
  2. An Annotator ($A_\omega$): A shallow network that learns to turn GAN features into segmentation masks.
  3. A Segmentor ($S_\theta$): A standard segmentation model (like DeepLabV3) that trains on the masks produced by the annotator.

The core innovation is the Gradient Matching objective. Instead of a standard supervised loss, the authors optimize the annotator so that the gradients produced when training the segmentor on synthetic data "match" the gradients produced on a small set of real labeled data.

Mathematically, they minimize the cosine distance between these two gradient vectors. This bypasses the need for expensive "unrolling" of the optimization path (common in meta-learning algorithms like MAML) and allows the annotator to be trained efficiently. Essentially, the annotator learns to produce labels that "point" the segmentor in the same direction that real human labels would.

Key Insights and Innovations

  • Gradient as a Signal: The most striking idea is that gradients carry enough information to supervise a model. The annotator never "sees" a ground-truth label for a synthetic image; it only knows if the label it guessed helped the segmentor move toward the "correct" weights defined by the small real-world dataset.
  • Domain Agnosticism: Because the method matches gradients rather than pixels, it is surprisingly robust. The authors showed they could use labels from "ugly" 3D CAD renders to train an annotator that works perfectly on photorealistic GAN-generated cars.
  • Efficiency via FPN: To make the process practical, they used a Feature Pyramid Network (FPN) structure for the annotator. This allowed them to process full images in batches, a significant memory improvement over previous pixel-wise MLP approaches.
  • The "Aha" Moment: The authors found that matching gradients for the entire segmentor isn't always necessary. Matching just the "head" (the final layers) of the segmentation network often yields the best results, as early layers are usually pre-trained and don't need much adjustment.

Key Results

The method was evaluated on six part segmentation datasets, including CelebA (faces), Pascal-Horse, Pascal-Aeroplane, Car-20, Cat-16, and CGPart (3D CAD models). The GAN components were powered by the StyleGAN and StyleGAN2 families.

Performance comparison across datasets showing superiority in the few-label regime.
  • Superiority in the "Few-Label" Regime: When only 2 to 30 labeled images are available, this method significantly outperforms standard semi-supervised techniques like Mean Teacher (MT) or SemanticGAN. For example, on CelebA with very few labels, it maintains a high Mean Intersection over Union (mIoU) while other methods' performance collapses.
  • Comparable to DatasetGAN: It achieves performance levels similar to DatasetGAN but with much more flexibility, as it entirely removes the requirement to manually label synthetic GAN images.
  • Cross-Domain Success: The model successfully learned to annotate realistic cars using only synthetic 3D CAD data as a reference, a feat that is nearly impossible for previous state-of-the-art methods.

Limitations and Future Work

While powerful, the method has a few constraints:

  • The GAN Bottleneck: The method is only as good as the underlying GAN. If the GAN cannot generate a certain part or object accurately, the annotator cannot learn to label it.
  • Complexity of Scenes: Currently, the method focuses on single-object classes (faces, cars, cats). It struggles with complex, multi-object scenes where GANs still find it difficult to generate realistic, disentangled features.
  • Large-Scale Saturation: As the number of available real labels increases (into the thousands), the performance of this method starts to saturate and can eventually be overtaken by standard supervised learning. Improving GAN quality is likely the key to pushing this upper bound further.

Summary updated

BibTeX
@inproceedings{yang2022learning,
  author = {Yu Yang and Xiaotian Cheng and Hakan Bilen and Xiangyang Ji},
  title = {{Learning to Annotate Part Segmentation with Gradient Matching}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=zNR43c03lRy},
}
Figure