SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.09603 · 2024

Rethinking FID: Towards a Better Evaluation Metric for Image Generation

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2401.09603.json · badge: /api/ran/2401.09603.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
sayakpaul/cmmd-pytorch community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_embeddings_for_dir Ran
ran, honoured the contract we drafted
sayakpaul/cmmd-pytorch/io_util.py
code served (permissive licence) · get_code("cb1471e7d1c79324")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from torch.utils.data import Dataset, DataLoader
import tempfile
import os
from PIL import Image

torch.manual_seed(0)

# Create a temporary directory with test images
temp_dir = tempfile.mkdtemp()
for i in range(3):
    img = Image.fromarray(np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8))
    img.save(os.path.join(temp_dir, f'test_{i}.png'))

# Define a minimal embedding model that has the required interface
class MockEmbeddingModel:
    def __init__(self, input_size, embedding_dim):
        self.input_image_size = input_size
        self.embedding_dim = embedding_dim
    
    def embed(self, image_batch):
        # image_batch shape: (batch_size, height, width, channels)
        # Return embeddings of shape (batch_size, embedding_dim)
        batch_size = image_batch.shape[0]
        return np.random.randn(batch_size, self.embedding_dim).astype(np.float32)

# Create instances
img_dir = temp_dir
embedding_model = MockEmbeddingModel(input_size=64, embedding_dim=4)
batch_size = 2
max_count = -1

ARGS = {
    'img_dir': img_dir,
    'embedding_model': embedding_model,
    'batch_size': batch_size,
    'max_count': max_count
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (3, 4) — shape (3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_images Ran
ran, honoured the contract we drafted
sayakpaul/cmmd-pytorch/generate_images.py
code served (permissive licence) · get_code("67af82f9a75b4a53")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 4, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import pandas as pd
from unittest.mock import Mock, MagicMock
from PIL import Image

torch.manual_seed(0)

# Create a mock args object
class Args:
    def __init__(self):
        self.chunk_size = 2
        self.pipeline_id = "stable-diffusion-v1-5"
        self.num_inference_steps = 1

args = Args()

# Create a mock dataframe with captions
dataframe = pd.DataFrame({
    'caption': ['a cat sitting on a mat', 'a dog running in the park', 'a bird flying in the sky', 'a fish swimming in water']
})

# Create a mock pipeline that returns images
class MockPipeline:
    def __call__(self, prompts, num_inference_steps, generator, guidance_scale=None):
        # Return mock images (PIL Images)
        mock_result = Mock()
        mock_result.images = [
            Image.new('RGB', (4, 3), color=(73, 109, 137)) 
            for _ in range(len(prompts))
        ]
        return mock_result

pipeline = MockPipeline()

ARGS = {
    'args': args,
    'dataframe': dataframe,
    'pipeline': pipeline
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 4, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mmd Ran
ran, honoured the contract we drafted
sayakpaul/cmmd-pytorch/distance.py
code served (permissive licence) · get_code("cbf43bceb31b386b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create small embedding sets
# x and y should have shape (n, embedding_dim)
# The function converts them from numpy to torch tensors
n_samples = 2
embedding_dim = 4

x = np.random.randn(n_samples, embedding_dim).astype(np.float32)
y = np.random.randn(n_samples, embedding_dim).astype(np.float32)

ARGS = {
    "x": x,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
compute_embeddings_for_dir 1 other paper
1 later
2406.12042 (2024-06)
Not All Prompts Are Made Equal: Prompt-based Pruning of Text-to-Image Diffusion Models
generate_images 1 other paper
1 later
2406.12042 (2024-06)
Not All Prompts Are Made Equal: Prompt-based Pruning of Text-to-Image Diffusion Models
mmd 1 other paper
1 later
2406.12042 (2024-06)
Not All Prompts Are Made Equal: Prompt-based Pruning of Text-to-Image Diffusion Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

As with many machine learning problems, the progress of image generation methods hinges on good evaluation metrics. One of the most popular is the Frechet Inception Distance (FID). FID estimates the distance between a distribution of Inception-v3 features of real images, and those of images generated by the algorithm. We highlight important drawbacks of FID: Inception's poor representation of the rich and varied content generated by modern text-to-image models, incorrect normality assumptions, and poor sample complexity. We call for a reevaluation of FID's use as the primary quality metric for generated images. We empirically demonstrate that FID contradicts human raters, it does not reflect gradual improvement of iterative text-to-image models, it does not capture distortion levels, and that it produces inconsistent results when varying the sample size. We also propose an alternative new metric, CMMD, based on richer CLIP embeddings and the maximum mean discrepancy distance with the Gaussian RBF kernel. It is an unbiased estimator that does not make any assumptions on the probability distribution of the embeddings and is sample efficient. Through extensive experiments and analysis, we demonstrate that FID-based evaluations of text-to-image models may be unreliable, and that CMMD offers a more robust and reliable assessment of image quality.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2401.09603")
get_code_for_paper("2401.09603")
have("2401.09603")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2401.09603.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2401.09603.svg)](https://syntology.ai/paper/2401.09603)

Connect an agent — have() is free.