Hierarchical Multiple Instance Learning for High Resolution AI-Generated Image Detection
🎉 ACM Multimedia 2026
LTF learns local evidence of image synthesis with a frozen CLIP backbone and two levels of multiple instance learning. This repository includes training, evaluation, original-resolution inference, FATAS aggregation, and the Gradio demo.
- ACM Multimedia 2026 — 🎉 LTF has been accepted to ACM Multimedia 2026!
- 2026-11-04 — Code, GenImage checkpoint integration, and the 🤗 interactive demo are available.
Python 3.11 is recommended. Install PyTorch for your CUDA environment first if needed.
pip install -r requirements.txt
python predict.py path/to/image.jpgThis release provides the GenImage checkpoint (historical mean accuracy:
98.39%). It and the CLIP backbone download automatically.
Assets are pinned and verified in assets.json. For offline use:
python predict.py image.jpg --weights /path/to/ltf.pth --backbone /path/to/ViT-L-14.ptThe default uses CLIP block 24, a global view and 224×224 local tiles. Full blocks
do not overlap; when needed, a final block is aligned to the right/bottom edge.
Only those boundary blocks may overlap.
level1, level2 and fusion scores are returned; class 1 means generated.
See checkpoint and reproduction notes before comparing
scores with other benchmarks reported in the paper.
python train.py --config configs/train.yaml --dr3-root data/reconstructions --genimage-root data/GenImage
# Multi-GPU: torchrun --nproc_per_node=4 train.py --config configs/train.yaml
python evaluate.py --data data/GenImage --output outputs/genimageData layout and configuration cover paired reconstruction data, benchmark folders, feature layers and resume options. Evaluation saves per-image scores and per-subset accuracy, AUC, AP, real false-positive rate and fake recall. The summary is an unweighted subset average.
pip install -r demo/requirements.txt
python demo/app.py
# Existing independent tile scores: image,tile,probability
python tools/fatas.py --input tile_scores.csv --k 3 --output scores.jsonThe demo includes 8 clickable GenImage validation examples (4 real and 4 generated). Clicking an image runs prediction and attention analysis. It also shows tiles, MIL attention, individual aggregation heads and patch weights. Space setup includes a local packaging command. FATAS averages the top-k generated probabilities from an independent tile scorer. It is separate from LTF fusion and the demo's top-four display.
The project page also includes a Robustness Lab and Meet the Heads: measured image transformations and eight linked L1 attention maps. Data and regeneration instructions.
- Release checkpoints and evaluation profiles for additional benchmarks.
- Complete full training and benchmark reproduction checks.
- Add data preparation scripts.
@inproceedings{chen2026ltf,
title={Learning to Falsify: Hierarchical Multiple Instance Learning for High Resolution AI-Generated Image Detection},
author={Chen, Haoran and Gao, Daiqi and Li, Xinyuan and Wang, Yongwei and Zhu, Lei and Cai, Rui and Dong, Jianfeng},
booktitle={Proceedings of the 34th ACM International Conference on Multimedia},
year={2026},
doi={10.1145/3767308.3836365},
eprint={2611.04529},
archivePrefix={arXiv}
}📖 Code: MIT. Paper figures: CC BY 4.0. Interface icons and badges: sources.
