This repository contains resources for the paper "Don't Fight Hallucinations, Use Them: Estimating Image Realism using NLI over Atomic Facts."
-
atomic_facts.jsonl
A collection of generated atomic facts about images from the WHOOPS! dataset sampled using Diverse Beam Search from the LLaVA-v1.6-Mistral-7B model. -
notebooks/nli_agg.ipynb
A Jupyter Notebook implementing Natural Language Inference (NLI) scoring with clustering aggregation scheme. It reproduces the main results for classification on the WHOOPS! dataset.
Scripts should be run using Python’s module system: python -m scripts.script_name
-
scripts/generate_facts.py
Generates atomic facts for images following the fact generation protocol described in the paper. -
scripts/predict.py
Uses the generated atomic facts to predict image realism.
- model/utils.py
Implements the computation of the Reality Score by calculating NLI-scores between atomic facts and aggregating them into a single score.
Our method identifies contradictions between generated atomic facts to estimate image realism.