Abstract
This paper introduces LayerMatch, a novel unsupervised pretraining framework that leverages the internal representations of a Generative Adversarial Network (GAN) to develop domain-specific features for a backbone model. By training an encoder to predict the multi-layer activations of a pretrained GAN generator, the model captures high-resolution spatial information crucial for downstream tasks. The authors demonstrate that this approach significantly improves performance in semi-supervised semantic segmentation, particularly in niche domains and for small object categories, outperforming standard ImageNet-based pretraining and state-of-the-art semi-supervised methods.
Introduction
In computer vision, the standard paradigm involves pretraining models on massive, general-purpose datasets like ImageNet before fine-tuning them for specific tasks. However, these universal representations are often suboptimal for niche domains, such as high-resolution facial analysis or specific industrial categories.
Generative Adversarial Networks (GANs) excel at producing realistic images within specific domains, suggesting their internal layers inherently "understand" semantic structures (e.g., the location of eyes on a face or wheels on a car). This research explores whether this domain-specific knowledge can be extracted from a GAN generator to improve downstream tasks like semantic segmentation, especially in scenarios where labeled data is scarce.
Methods
The authors propose two primary technical contributions to bridge the gap between generative modeling and discriminative tasks:
1. Semantic Projection
The researchers demonstrate that a lightweight decoder—possessing 16x fewer parameters than a standard DeepLabV3+ decoder—can be integrated with a pretrained GAN generator. This decoder maps the GAN's internal features directly to semantic masks. Remarkably, this projection can be learned using as few as 1 to 10 manually annotated synthetic images, highlighting the rich semantic information already present in the generator.
2. LayerMatch Pretraining
LayerMatch is an unsupervised pretraining scheme designed to "specialize" a backbone encoder for a specific domain. Instead of predicting a single latent vector, the encoder is trained to predict the entire set of internal activations of a GAN generator for a given image.
The training objective combines two primary losses:
- Matching Loss ($L_{match}$): Minimizes the L2 distance between the encoder's output and the GAN's actual activations.
- Reconstruction Loss ($L_{rec}$): Ensures the predicted activations maintain sufficient quality to reconstruct the original image through the generator.
Experiments and Datasets
The approach was evaluated across several high-resolution datasets, including FFHQ and CelebA-HQ for face segmentation (19 classes), LSUN-cars for initial semantic projection tests, and LSUN-church for architectural domain testing (10 classes). Standard ImageNet pretraining served as the primary baseline for comparison.
Key Results
LayerMatch consistently outperformed standard ImageNet pretraining, particularly in low-data regimes. On the CelebA-HQ dataset with only 1/512 of the data labeled, LayerMatch achieved an mIoU of 0.67, significantly higher than the 0.62 achieved by both ImageNet pretraining and specialized methods like AdvSemiSeg.
One of the most significant improvements was observed in small, difficult categories. For instance, the IoU for "eyeglasses" increased from 0.01 (ImageNet) to 0.68 (LayerMatch). Furthermore, t-SNE visualizations indicated that LayerMatch features form tighter, more semantically meaningful clusters compared to general-purpose backbones.
Discussion and Limitations
The success of LayerMatch is intrinsically tied to the quality of the underlying GAN. In domains like LSUN-church, where the generative model was less precise than the face generators, performance gains were less pronounced as labeled data volume increased. While LayerMatch itself is unsupervised, the initial Semantic Projection still requires minimal manual effort to define classes. Future work may explore extending this domain-specific pretraining to other high-resolution tasks such as object detection or keypoint estimation.
Summary updated