Skip to content
AI360Xpert
Beta

FID IS KID Generation Scores

Feature-space distances and classifier confidence that price generated images for fidelity plus variety together.

FID and KID measure feature distance to real images while IS prices confidence and variety without reals
FID and KID measure feature distance to real images while IS prices confidence and variety without reals

Why Does This Exist?

Pixel comparisons cannot judge new images with no paired truth. Generators need scores for fidelity plus coverage. FID fits Gaussians to Inception features of real versus generated sets and reports their Frechet distance. IS scores classifier sharpness plus spread on generated alone. KID is a polynomial-kernel MMD with unbiased estimation. Face generators report them together.

This page gives intuitions, toy arithmetic and misread traps. Say less about exact backbone weights and verify the implementation before quoting numbers.

Think of It Like This

Two galleries judged by a critic

Real photos hang in one gallery, generated in another. A critic embeds each picture as a taste vector. FID measures how far apart the two crowds stand. IS ignores the real room and asks whether generated pictures look decisively like something and cover many styles.

Same opening night, distance versus applause.

How It Actually Works

FID is ∥mr−mg∥2+Tr(Cr+Cg−2(CrCg)1/2)\lVert m_r - m_g \rVert^2 + \text{Tr}(C_r + C_g - 2(C_r C_g)^{1/2}) on feature means and covariances, lower is better. IS is exp⁡(E[KL(p(y∣x)∥p(y))])\exp(\mathbb{E}[\text{KL}(p(y|x) \parallel p(y))]), higher is better. KID is squared MMD with a cubic kernel, lower is better and unbiased for small sets. Compute on identical preprocessing and sample sizes or comparisons mislead.

Toy distance walkthrough

Take one-dimensional means mr=0m_r = 0 and mg=2m_g = 2 with unit variances Cr=Cg=1C_r = C_g = 1. Mean term is (0−2)2=4(0 - 2)^2 = 4. Trace term is 1+1−2×1=01 + 1 - 2 \times 1 = 0. Toy FID is 4+0=44 + 0 = 4. Closing the mean gap to 0.5 drops it to 0.250.25, showing mean shift dominates here.

Code

Toy Frechet piece for equal unit variances.

def toy_fid(mr: float, mg: float) -> float:    return round((mr - mg) ** 2, 3)  # trace cancels at unit variance

print(toy_fid(0.0, 2.0), toy_fid(0.0, 0.5))# -> 4.0 0.25

Mean gap 2 gives 4.0, gap 0.5 gives 0.25.

Watch Out For

Comparing FIDs across different setups

Backbone, resize, compression and sample count shift FID by points. The symptom is a SOTA claim that vanishes on matched code. Fix it by fixing implementation, preprocessing and N before comparing.

The Quick Version

  • FID is Frechet distance between real and generated feature Gaussians, lower is better.
  • IS is exponentiated label sharpness plus spread on generated alone, higher is better.
  • KID is unbiased kernel distance, lower is better for small sets.
  • Toy means 0 versus 2 with unit variance give FID 4.0, gap 0.5 gives 0.25.
  • Match code, preprocessing and sample size before comparing.