FatFormer
A CLIP-based detector that classifies an image as real or fake using forgery-aware adapters and text prompts.
Image classification · 1,927 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Image classification
- Parameters
- 492.6M
- Operations
- 1,927
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2024
- Cited by
- 128 (as of 29 October 2026)
- Authors
- Huan Liu, Zichang Tan, Chuangchuang Tan and others
- Source
- GitHub: Michel-liu/FatFormer
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m16654
- Graph hash
- b8fbcfef1f35973463e489fec662c0fd1b5fdb3f0b65226c1eb060fdfd38da8a
- Skeleton hash
- aaade818c96446c1e96c4a486303a61aaffa756b77061e2ac8a57329bbdaa866
- Architecture hash
- 2f63e052204751c1bb1097f6296eac1bb5e343ea27a512e44578d40e6a67bcfd
- Diagram SHA-256
- 077bed0884f81cb3b503d006b1349f2bf82a834c677ffc8355e91aff3af73562
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
FatFormer is a detector for synthetic images: it aims to tell real pictures from forgeries produced by diverse generative methods such as GANs and diffusion models. It is built on CLIP, with a ViT image encoder and a transformer text encoder, and it predicts the forgery probability from a softmax over the cosine similarities between image features and text prompt embeddings. This model uses the CLIP ViT-L/14 backbone.
The paper argues that the earlier practice of keeping the pre-trained model frozen and training only an attached classifier, as UniFD does with a linear layer on CLIP-ViT, learns too little about forgery traces. FatFormer instead adapts the pre-trained model with two additions. A forgery-aware adapter pairs a lightweight convolution module for low-level image artifacts with grouped attention over the frequency bands of a discrete wavelet transform. Language-guided alignment supervises the adaptation with a contrastive objective between the adapted image features and text prompts, using a patch-based enhancer that conditions the prompts on image patch tokens and a text-guided interactor that aligns local patch tokens with the global prompt embeddings.
Trained on 4-class ProGAN data only, the paper reports 98.4% accuracy on 8 types of GANs and 95.0% accuracy on 10 types of unseen diffusion images. Input images are resized to 256 × 256 and then cropped to 224 × 224.
Key idea. FatFormer adapts a pre-trained CLIP model to synthetic image detection with a forgery-aware adapter over image and frequency domains and contrastive language-guided alignment between image features and text prompts.
- FatFormer
- Forgery-aware Adaptive Transformer
- synthetic image detection
- fake image detection
- forgery detection
- AI-generated image detection
- GAN image detection
- diffusion image detection
- forgery-aware adapter
- language-guided alignment
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{liu2023forgeryawareadaptivetransformergeneralizable,
title={Forgery-aware Adaptive Transformer for Generalizable Synthetic Image Detection},
author={Huan Liu and Zichang Tan and Chuangchuang Tan and Yunchao Wei and Yao Zhao and Jingdong Wang},
year={2023},
eprint={2312.16649},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2312.16649},
}