Inception score explained
The Inception Score (IS) is an algorithm used to assess the quality of images created by a generative image model such as a generative adversarial network (GAN). The score is calculated based on the output of a separate, pretrained Inceptionv3 image classification model applied to a sample of (typically around 30,000) images generated by the generative model. The Inception Score is maximized when the following conditions are true:
- The entropy of the distribution of labels predicted by the Inceptionv3 model for the generated images is minimized. In other words, the classification model confidently predicts a single label for each image. Intuitively, this corresponds to the desideratum of generated images being "sharp" or "distinct".
- The predictions of the classification model are evenly distributed across all possible labels. This corresponds to the desideratum that the output of the generative model is "diverse".
It has been somewhat superseded by the related Fréchet inception distance. While the Inception Score only evaluates the distribution of generated images, the FID compares the distribution of generated images with the distribution of a set of real images ("ground truth").
Definition
Let there be two spaces, the space of images
and the space of labels
. The space of labels is finite.
Let
be a probability distribution over
that we wish to judge.
Let a discriminator be a function of type where
is the set of all probability distributions on
. For any image
, and any label
, let
be the probability that image
has label
, according to the discriminator. It is usually implemented as an Inception-v3 network trained on ImageNet.
The Inception Score of
relative to
is
Equivalent rewrites include
is nonnegative by
Jensen's inequality.
Pseudocode:
Interpretation
A higher inception score is interpreted as "better", as it means that
is a "sharp and distinct" collection of pictures.
lnIS(pgen,pdis)\in[0,lnN]
, where
is the total number of possible labels.
iff for almost all
That means
is completely "indistinct". That is, for any image
sampled from
, discriminator returns exactly the same label predictions
.
The highest inception score
is achieved if and only if the two conditions are both true:
, the distribution
is concentrated on one label. That is,
. That is, every image sampled from
is exactly classified by the discriminator.
, the proportion of generated images labelled as
is exactly
. That is, the generated images are equally distributed over all labels