Spectral Distribution Aware Image Generation

Steffen Jung, Margret Keuper

TL;DR

While modern GANs produce images that look perfect to the human eye, they often leave behind tell-tale "spectral fingerprints" in the frequency domain. This paper introduces a lightweight spectral discriminator that forces generators to match the true frequency distribution of real data, making generated images significantly harder for automated systems to detect as fakes without sacrificing visual quality.

What Problem Does This Paper Address?

Generative Adversarial Networks (GANs) have become incredibly good at creating photo-realistic images. However, researchers have discovered a "spectral gap": even when an image looks flawless, its frequency spectrum often contains artifacts—unnatural spikes or patterns in high frequencies. These artifacts are primarily caused by common up-sampling techniques (like "bed of nails" interpolation) used in generator architectures.

Previous attempts to fix this used spectral regularization, which penalizes the generator if its output deviates from the average spectrum of the training set. The authors of this paper argue that this is flawed because real-world data is diverse; different images have different spectral profiles (e.g., a smooth sky vs. a textured brick wall). Forcing every image toward a single "average" spectrum leads to unstable training and fails to capture the true distribution of the data.

Methods

The authors propose a dual-discriminator approach. In addition to the standard spatial discriminator ($D_S$) that looks at pixels, they add a Frequency Discriminator ($D_F$).

  1. Spectral Transformation: The input image is transformed into the frequency domain using a 2D Fourier Transform.
  2. Azimuthal Integration: To keep the discriminator lightweight and modular, the 2D spectrum is collapsed into a 1D "power spectrum profile" by integrating (averaging) values along circles of increasing radii.
  3. Lightweight Classification: This 1D vector is fed into a simple fully connected layer. Because it operates on a 1D projection, $D_F$ adds negligible computational overhead (only about $n/\sqrt{2} + 1$ parameters for an $n \times n$ image).
  4. Generator "Repair" Capacity: Following previous research, they slightly increase the generator's capacity (adding a few $5 \times 5$ convolutional layers at the end) to ensure the network has the "expressive power" to actually fix the spectral artifacts identified by $D_F$.

The training process is summarized in Figure 3: The training process involves two separate discriminators: one for spatial realness and one for spectral realness.

The training process involves two separate discriminators: one for spatial realness and one for spectral realness.

Datasets

The primary dataset used is FFHQ (Flickr-Faces-HQ), a standard benchmark for high-quality face generation. The authors evaluated their method across multiple resolutions: $64^2$, $128^2$, $256^2$, and even fine-tuned a state-of-the-art StyleGAN2 model at $1024^2$.

Key Insights and Ideas

  • Real Data is Multimodal: By clustering the spectra of real FFHQ images, the authors show that the frequency distribution is not a simple Gaussian around a mean. There are distinct "types" of spectral profiles (see Figure 1), which explains why simple mean-based regularization fails. Clustering real images shows that their frequency profiles are diverse and not unimodal.

  • 1D is Enough: Even though artifacts appear in 2D, a 1D projection (azimuthal integral) provides a sufficient signal for the generator to learn to suppress them.

  • The "Cloaking Score": The authors introduce a new metric to evaluate spectral fidelity. They train a simple logistic regression to separate real vs. fake spectra; the harder it is for this classifier to tell them apart (a score closer to 1.0), the better the "spectral cloaking" of the GAN.
Clustering real images shows that their frequency profiles are diverse and not unimodal.

Key Results

  • Superior Spectral Match: The proposed method achieves nearly perfect alignment between the mean and standard deviation of real and generated spectral profiles, significantly outperforming previous regularization methods (see Figure 6). With the spectral discriminator, the generated spectral profiles (red) almost perfectly overlap with the real ones (blue).

  • Harder to Detect: In tests against state-of-the-art "fake image detectors," detection accuracy dropped from near-certainty (~90-100%) to near-random (~50-60%) when the spectral discriminator was used.

  • Stable Training: Unlike spectral regularization, which often causes mode collapse or unstable FID scores, the adversarial spectral loss proved stable across different GAN architectures (DCGAN, LSGAN, WGAN-GP).
  • No Quality Loss: The visual quality (measured by FID) remained on par with or slightly better than baseline models, proving that fixing the spectrum doesn't require sacrificing pixel-level realism.
With the spectral discriminator, the generated spectral profiles (red) almost perfectly overlap with the real ones (blue).

Limitations and Future Work

While the 1D azimuthal integral is efficient, it might miss highly directional artifacts that don't show up when averaging across radii. The authors suggest that exploring more complex architectures for the spectral discriminator or using 2D spectral information more directly could be a path for future improvement. Additionally, while they showed success fine-tuning StyleGAN2, integrating this from scratch into the most advanced architectures remains an area for further exploration.

Summary updated

BibTeX
@inproceedings{jung2021spectral,
  author = {Steffen Jung and Margret Keuper},
  title = {{Spectral Distribution Aware Image Generation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i2.16267},
}
Figure