Counting Hallucinations in Diffusion Models
Paper โข 2510.13080 โข Published
Counting model from Counting Hallucinations in Diffusion Models (arXiv:2510.13080). It scores images generated by a diffusion model trained on ToyShape to decide whether each sample is counting-correct or a counting hallucination.
{triangle, square, pentagon}.model.pth (a plain state_dict).Inputs are RGB images normalised to [-1, 1] (ToTensor + Normalize([0.5]*3, [0.5]*3)).
import torch
from huggingface_hub import hf_hub_download
from counthallu.models.counting import CountingRegressor
ckpt = hf_hub_download("ShyFoo/CountHallu-counting_model-ToyShape", "model.pth")
model = CountingRegressor(num_classes=3)
model.load_state_dict(torch.load(ckpt, map_location="cpu"))
model.eval()
Or let the evaluation protocol fetch it for you:
from counthallu.utils import load_counting_model
model, model_type, _, _ = load_counting_model(
"toyshape", use_hub_model=True,
repo_id="ShyFoo/CountHallu-counting_model-ToyShape"
)
See the CountHallu repository for the full evaluation protocol.
@article{fu2025counting,
title={Counting Hallucinations in Diffusion Models},
author={Fu, Shuai and Zhou, Jian and Chen, Qi and Jing, Huang and Nguyen, Huy Anh and Liu, Xiaohan and Zeng, Zhixiong and Ma, Lin and Zhang, Quanshi and Wu, Qi},
journal={arXiv preprint arXiv:2510.13080},
year={2025}
}