NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Rarity Score : A New Metric to Evaluate the Uncommonness of Synthesized Images

Jiyeon Han, Hwanil Choi, Yunjey Choi, Junho Kim, Jung-Woo Ha, Jaesik Choi

TL;DR

Researchers from KAIST and NAVER AI Lab have introduced the Rarity Score, the first instance-wise metric designed to quantify how "uncommon" a generated image is relative to a real dataset. By measuring the density of the feature manifold using $k$-nearest neighbors, this metric allows researchers to identify whether a model is merely playing it safe with "typical" outputs or successfully exploring the creative "long tail" of a distribution.

What Problem Does This Paper Address?

In the world of generative AI, we are highly capable of measuring fidelity (does the image look real?) and diversity (does the set of images cover the whole distribution?). Metrics like Fréchet Inception Distance (FID) and Precision/Recall are the industry standards for these evaluations.

However, these metrics are "model-wise"—they look at an entire bucket of images at once. They cannot tell you if a specific image is a common, "safe" generation (like a standard front-facing portrait) or a rare, "creative" one (like a person wearing a flamboyant hat or a rare animal breed). As we move toward creative AI applications, we need a way to quantify the "uncommonness" of individual samples. This helps users filter for unique results and allows researchers to understand if their models are suffering from "mode collapse" by over-representing the most frequent training examples.

Methods

The authors propose the Rarity Score, which leverages the geometry of feature spaces produced by extractor networks like VGG16, DINO, or CLIP.

Illustration of the Rarity Score concept using k-NN spheres. Typical images fall into small, dense spheres, while rare images fall into larger, sparse spheres.
  1. The Intuition: In a high-dimensional feature space, "typical" images (like standard faces) cluster together in high-density regions. "Rare" images (like a face with colorful makeup) are sparsely located.
  2. The Calculation: For a generated image, the Rarity Score is defined as the minimum radius of a $k$-nearest neighbor ($k$-NN) sphere of a real sample that contains the generated image.
  3. If a generated image falls into the small, tight sphere of a very common real image, it receives a low rarity score.
  4. If it only fits into the large, expansive sphere of a sparse, "lonely" real image, it receives a high rarity score.
  5. Model-wise Metric (RS-p): To evaluate an entire model, the authors introduce RS-p, which is the mean rarity score of the top $p\%$ most rare images. This metric indicates how well a model can produce the "long tail" of the data distribution.

Datasets

The study evaluates the metric across several popular computer vision benchmarks:

  • Human Faces: FFHQ, CelebA-HQ, and MetFaces (artistic portraits).
  • Animals: AFHQ-Wild (tigers, lions, etc.).
  • Objects/Scenes: LSUN (Car, Cat, Horse).

Key Insights and Ideas

Examples of generated images sorted by their nearest-neighbor distances, illustrating typical (smallest NND) versus rare (largest NND) samples.
  • Rarity $\neq$ Low Quality: A common misconception is that "rare" images are simply artifacts or errors. The authors demonstrate that by filtering for images that stay within the "real manifold" (using a $k$-NN check), they can successfully identify high-quality but highly unique images.
  • The "Backbone" Matters: What the metric considers "rare" depends heavily on the feature extractor used.
  • VGG16 (supervised) focuses on textures and patterns, finding faces with heavy makeup to be rare.
  • DINO (self-supervised ViT) focuses on structure and pose, identifying profile views as rare.
  • CLIP (multi-modal) captures semantics, flagging baby faces as rare because they differ semantically from adults.
  • Dataset Comparison: The metric can quantitatively prove that one dataset is "rarer" than another. For example, FFHQ exhibits a higher rarity distribution than CelebA-HQ. This aligns with the fact that CelebA-HQ consists of celebrities (often with similar poses and lighting), while FFHQ includes the general public with much higher variation in age, ethnicity, and accessories.

Key Results

  • Human Alignment: A user study involving 61 participants found that 84% of human judgments regarding "uncommonness" aligned with the Rarity Score, validating its perceptual relevance.
  • Model Benchmarking: When comparing GANs, StyleGAN2 consistently achieved higher RS-p scores than more conservative models like UnetGAN, proving it is significantly better at generating diverse, "long-tail" samples.
  • Truncation Trick Trade-off: The authors quantified the well-known "truncation trick" (which improves image quality by forcing samples closer to the average). They showed that as the truncation parameter $\psi$ decreases, the Rarity Score drops sharply, providing numerical proof that "safe" images are indeed less rare.

Limitations and Future Work

  • Training Data Bias: The metric is entirely dependent on the "real" dataset used for comparison. If the training data is noisy or contains artifacts, the metric might incorrectly label those artifacts as "rare" features.
  • Computational Cost: Calculating $k$-NN distances for every generated image against a large real dataset (e.g., 30k-50k images) can be computationally expensive, although the authors note it remains more efficient than some existing diversity metrics like Recall.
  • Future Directions: The authors suggest using the Rarity Score to study fairness and bias. If a model fails to generate high rarity scores for certain demographic groups present in the "rare" parts of the training data, it could serve as a strong indicator of algorithmic bias.

Summary updated

BibTeX
@inproceedings{han2023rarity,
  author = {Jiyeon Han and Hwanil Choi and Yunjey Choi and Junho Kim and Jung-Woo Ha and Jaesik Choi},
  title = {{Rarity Score : A New Metric to Evaluate the Uncommonness of Synthesized Images}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=JTGimap_-F},
}
Figure