Papers › Towards Universal Fake Image Detectors that Generalize Across Generative Models

Towards Universal Fake Image Detectors that Generalize Across Generative Models

20 Feb 2023CVPR 2023 1arXiv:2302.10174archive 2025-07-28

Utkarsh Ojha, Yuheng Li, Yong Jae Lee

With generative models proliferating at a rapid rate, there is a growing need for general purpose fake image detectors. In this work, we first show that the existing paradigm, which consists of training a deep network for real-vs-fake classification, fails to detect fake images from newer breeds of generative models when trained to detect GAN fake images. Upon analysis, we find that the resulting classifier is asymmetrically tuned to detect patterns that make an image fake. The real class becomes a sink class holding anything that is not fake, including generated images from models not accessible during training. Building upon this discovery, we propose to perform real-vs-fake classification without learning; i.e., using a feature space not explicitly trained to distinguish real from fake images. We use nearest neighbor and linear probing as instantiations of this idea. When given access to the feature space of a large pretrained vision-language model, the very simple baseline of nearest neighbor classification has surprisingly good generalization ability in detecting fake images from a wide variety of generative models; e.g., it improves upon the SoTA by +15.07 mAP and +25.90% acc when tested on unseen diffusion and autoregressive models.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2302.10174")

Code

Syntology Ran 6 of 16 code samples harvested from 1 repository linked to this paper; 10 have no recorded run. Of those that ran: 5 ran · our draft was wrong; 1 ran with no contract checked.

By repository: official repository: 16 samples from 1 repository, 6 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

yuheng-li/universalfakedetect officialmentioned in papermentioned on GitHubpytorchMIT report
Michel-liu/FatFormer mentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

16 samples harvested; 6 ran; 0 honoured the contract we drafted; 10 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

5ran · our draft was wrong
1ran
10unverified

Licence: 0 of the 16 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from yuheng-li/universalfakedetect. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

conv1x1 yuheng-li/universalfakedetect/networks/resnet_lpf.py official repository ran · our draft was wrong MIT (permissive) · d9def42110729a85 · report
conv1x1 yuheng-li/universalfakedetect/models/resnet.py official repository ran · our draft was wrong MIT (permissive) · 2a80220dabcb742a · report
conv3x3 yuheng-li/universalfakedetect/models/resnet.py official repository ran · our draft was wrong MIT (permissive) · 600ff2c45e0de056 · report
conv3x3 yuheng-li/universalfakedetect/networks/resnet_lpf.py official repository ran · our draft was wrong MIT (permissive) · e18ed73aa89f051a · report
get_pad_layer yuheng-li/universalfakedetect/networks/lpf.py official repository ran · our draft was wrong MIT (permissive) · 50aa4a59fe718c61 · report
get_pad_layer_1d yuheng-li/universalfakedetect/networks/lpf.py official repository ran MIT (permissive) · 176a539246e68879 · report
draw_bounding_boxes yuheng-li/universalfakedetect/models/vision_transformer_utils.py official repository unverified MIT (permissive) · 59965ca4b20cd0a3 · report
draw_segmentation_masks yuheng-li/universalfakedetect/models/vision_transformer_utils.py official repository unverified MIT (permissive) · 54fd90bd934c47e1 · report
make_grid yuheng-li/universalfakedetect/models/vision_transformer_utils.py official repository unverified MIT (permissive) · 8c3d0e690efa99fe · report
resnet18 yuheng-li/universalfakedetect/models/resnet.py official repository unverified MIT (permissive) · cd4a0cb7c1c3bb95 · report
resnet18 yuheng-li/universalfakedetect/networks/resnet_lpf.py official repository unverified MIT (permissive) · 768d1f99fcf02b79 · report
vgg11 yuheng-li/universalfakedetect/models/vgg.py official repository unverified MIT (permissive) · 04cac479388fed8d · report
vgg19 yuheng-li/universalfakedetect/models/vgg.py official repository unverified MIT (permissive) · 36aa35f7d5c690bd · report
vit_b_16 yuheng-li/universalfakedetect/models/vision_transformer.py official repository unverified MIT (permissive) · e3760b265536dca0 · report
vit_b_32 yuheng-li/universalfakedetect/models/vision_transformer.py official repository unverified MIT (permissive) · e2038eb9ae534f89 · report
vit_l_16 yuheng-li/universalfakedetect/models/vision_transformer.py official repository unverified MIT (permissive) · 4d461a68c1030630 · report

Tasks

ClassificationLanguage ModelingLanguage Modelling

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Diffusion

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections