Inception Score, Label Smoothing, Gradient Vanishing and -log(D(x)) Alternative

Weinan ZhangarXiv 2017

TL;DR

This paper dives deep into several fundamental aspects of Generative Adversarial Networks (GANs), mathematically clarifying the Inception Score, proposing a more robust AM score, and analyzing the implications of label smoothing on generator loss. The authors demonstrate that the popular Inception Score is mathematically equivalent to the MODE score but suffers from issues with imbalanced datasets, while their proposed AM score offers a more reliable evaluation metric. Furthermore, they pinpoint a critical problem with label smoothing when combined with the standard log(1-D(x)) generator loss, a problem that is elegantly resolved by using the -log(D(x)) alternative.

What Problem Does This Paper Address?

Generative Adversarial Networks (GANs) have revolutionized image generation, but their training and evaluation remain challenging. Several core concepts, like the Inception Score for evaluation and the use of label smoothing, have been adopted without a deep mathematical understanding of their behavior, especially in non-ideal scenarios. Specifically, the Inception Score, while correlated with human judgment, has been shown to be sensitive to the distribution of classes in the training data. Additionally, the interaction between label smoothing (a technique to prevent overconfidence in discriminators) and different generator loss functions, particularly the log(1-D(x)) loss, has led to unclear issues and potential training instabilities. This paper aims to provide mathematical clarity on these topics, correct common misunderstandings, and propose more robust solutions.

Methods

The paper tackles its objectives through rigorous mathematical analysis and empirical validation:

  • Inception Score and MODE Score Analysis: The authors mathematically demonstrate that the Inception Score and the MODE score are, in fact, equivalent. They achieve this by breaking down the scores into their constituent entropy terms and showing how the reference distribution term in MODE score cancels out.
  • AM Score Proposal: Based on the limitations of the Inception/MODE scores with imbalanced datasets, they propose the AM score. This new metric swaps the Kullback-Leibler divergence terms, effectively incorporating the prior data distribution (C_train) as a reference point and using cross-entropy.
  • Label Smoothing and Gradient Analysis: The core of their analysis here is the "class-aware gradient." By examining how gradients propagate with respect to the class logits, they mathematically derive the behavior of label smoothing under different generator loss functions. This allows them to precisely identify the problem when label smoothing is applied to fake samples with the log(1-D(x)) loss and show why the -log(D(x)) alternative avoids this issue.

Datasets

The paper primarily uses the CIFAR-10 dataset for evaluation and demonstration. They also refer to ImageNet in the context of the pre-trained Inception model used for the Inception Score. No new datasets are introduced.

Key Insights and Ideas

  • Inception Score is Equivalent to MODE Score: This is a significant clarification, showing that a widely used metric has a known counterpart and shares its fundamental limitations.
  • Inception/MODE Score Drawback with Imbalanced Data: The paper highlights that these scores, by focusing on two entropy terms, can be misleading when the training data's class distribution is uneven. The "overall distribution" entropy term doesn't effectively capture the nuances of imbalanced priors.
  • AM Score as a Robust Alternative: By reformulating the score using cross-entropy and explicitly including the training data's prior distribution, the AM score is shown to be more stable and informative, especially for datasets with uneven class distributions.
  • Label Smoothing + log(1-D(x)) Loss = Problem: The paper mathematically proves that applying label smoothing to fake samples with the standard log(1-D(x)) generator loss leads to issues, potentially causing gradient vanishing or pushing the discriminator towards an undesirable state.
  • Label Smoothing + -log(D(x)) Loss = Solution: Crucially, they demonstrate that this problem is entirely avoided when using the -log(D(x)) generator loss, making it a more robust choice when label smoothing is employed.

Key Results

  • Empirical results indicate that the AM score outperforms the Inception score in evaluating generative models.
  • The paper provides mathematical proofs for the equivalence of Inception and MODE scores and for the behavior of gradients under label smoothing with different loss functions.
  • Visualizations (Figure 2) show that while the Inception score's entropy term (H(D_G)) oscillates, the AM score's cross-entropy term (H(D_train, D_G)) shows stable decreasing behavior, supporting its effectiveness.

Limitations and Future Work

  • Pre-trained Classifier Importance: The authors strongly advocate for using an "accordingly pre-trained classifier" for the evaluation metric (like AM score) on a given dataset, rather than a generic one like the ImageNet Inception model, especially when the dataset's distribution is uneven.
  • Exponential Transformation: While the Inception and MODE scores use an exponential transformation, the authors suggest that the AM score is informative enough even without it, implying further investigation into the necessity of such transformations for AM score.
  • Gradient Efficiency vs. Existence: The paper touches upon the idea that a non-zero gradient doesn't guarantee efficiency or validity, suggesting that the discussion on gradient vanishing and the effectiveness of -log(D(x)) is a "deep topic" and beyond the immediate scope, hinting at potential future research directions.
  • Theorem 2.5 in Arjovsky & Bottou [1]: The authors express suspicion about the correctness of a specific theorem in a related paper, noting that a key lemma in its proof appears unproven, suggesting a need for further scrutiny of existing theoretical foundations.

Summary updated

BibTeX
@misc{zhang2017inception,
  author = {Weinan Zhang},
  title = {{Inception Score, Label Smoothing, Gradient Vanishing and -log(D(x)) Alternative}},
  year = {2017},
  eprint = {1708.01729},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1708.01729},
}
Figure