The Inception Score (IS) evaluates the quality and diversity of images generated by a model. It uses a pre-trained Inception model to compute the following:
- Quality: Generated images should correspond to clear, high-confidence class predictions.
- Diversity: The overall distribution of generated images should cover multiple classes.
Here is the formula you can refer to:

Where:
- p(y∣x)p(y|x)p(y∣x): Predicted class distribution for an image xxx.
- p(y)p(y)p(y): Marginal class distribution across all generated images.
Here is the code snippet you can refer to:
In the above code, we are using the following:
- Higher IS: Indicates better quality and diversity of generated images.
- Low IS: Suggests low-quality or repetitive outputs.
- Comparisons: Use IS to compare models, but note it may not fully capture image realism (e.g., context or fidelity).
Hence, this code provides a streamlined process to compute and interpret IS for image generation models.