LARGE: Latent-Based Regression through GAN Semantics

Yotam Nitzan, Rinon Gal, Ofir Brenner, Daniel Cohen-Or

Abstract

LARGE (Latent-Based Regression through GAN Semantics) is a novel framework that leverages the structured latent space of pre-trained Generative Adversarial Networks (GANs) to perform high-accuracy regression with minimal labeled data. By discovering that distances from semantic hyperplanes in a GAN's latent space are linearly correlated with the intensity of image attributes, the authors achieve state-of-the-art results in few-shot tasks such as age and pose estimation using as few as two labeled samples.

Introduction

Regression tasks—predicting continuous values like age, head pose, or disease severity—typically require massive, high-quality labeled datasets. Collecting these labels is often prohibitively expensive or technically difficult. While GANs are renowned for generating realistic images, previous attempts to utilize them for downstream tasks often focused on data augmentation, which is frequently hampered by the "domain gap" between synthetic and real images. LARGE addresses this by extracting the rich semantic knowledge already embedded within the GAN’s latent space to perform regression directly on real images.

Methods

The core of the LARGE method relies on the well-behaved latent space of architectures like StyleGAN. The process follows four main steps:

  1. Inversion: A real image is mapped into the GAN’s latent space ($W+$) using an encoder (e.g., e4e) to obtain a representative latent code.
  2. Direction Discovery: A linear "steering direction" (vector) is identified in the latent space corresponding to a specific attribute (e.g., "age"). This can be found via weak supervision or unsupervised methods.
  3. Layer Weighting: Since StyleGAN is hierarchical, the authors introduce an unsupervised optimization scheme to learn importance scores for each layer, creating a weighted distance metric focused on layers relevant to the target attribute.
  4. Calibration: Based on the observation that latent distance is linearly correlated with attribute intensity, a simple linear regressor ($y = ad + b$) is trained using a handful of labeled examples to map abstract distances to real-world units.
The LARGE pipeline: mapping images to latent space and regressing attributes based on distance to a semantic hyperplane.

Key Insights: The Linearity of Intensity

A breakthrough insight of this work is that the magnitude of attribute change is roughly linear relative to the distance traveled along a latent direction. This observation transforms complex computer vision problems into simple geometric ones. Furthermore, LARGE enables "weak to strong" supervision: a semantic direction found using binary labels (e.g., "smiling" vs. "not smiling") can be used to provide precise continuous predictions (e.g., the degree of a smile).

Visualizing latent directions for various attributes (a) and the empirical linear correlation between latent distance and attribute intensity (b).

Key Results

LARGE consistently outperforms traditional baselines in low-data regimes across diverse domains including human faces (FFHQ, CelebA-HQ), animals (AFHQ), and plants (Plant-Village):

  • Age Estimation: A LARGE model calibrated with only 20 samples achieved a Mean Absolute Error (MAE) of 7.46 years, comparable to a state-of-the-art fully supervised model (CORAL) requiring 20,000 samples (7.59 MAE).
  • Pose Estimation: On CelebA-HQ, LARGE outperformed both self-supervised and fully supervised methods when training data was limited to fewer than 1,000 samples.
  • Unsupervised Sorting: Even without calibration data, raw latent distances allow for highly accurate sorting of image collections by attribute intensity, a result validated by user studies.

Limitations and Future Work

The method's efficacy depends on the GAN's training distribution; inversion may fail for images the GAN has not "seen." Additionally, while linear correlations were found across all tested attributes, this may not be a universal property for every semantic feature. Future research may explore applying LARGE to more complex generative models or improving disentanglement to ensure that regressing one attribute (e.g., age) is not inadvertently affected by another (e.g., glasses).

Summary updated

BibTeX
@inproceedings{nitzan2021large,
  author = {Yotam Nitzan and Rinon Gal and Ofir Brenner and Daniel Cohen-Or},
  title = {{LARGE: Latent-Based Regression through GAN Semantics}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr52688.2022.01864},
}
Figure