A tempting way to spot an AI-generated image needs no labeled fakes. Pass the image through the autoencoder that the generator itself uses. This is the encoder–decoder pair that a latent diffusion model compresses images into and decodes them out of. If the image comes back almost unchanged, it probably came from that decoder in the first place. This is reconstruction-based anomaly detection with the roles reversed: here, low reconstruction error is the suspicious signal. The trouble is that ordinary post-processing also lowers reconstruction error. JPEG compression, downscaling and blurring strip out the fine detail that any small-bottleneck autoencoder fails to reproduce, so a heavily recompressed real photo starts to look "on the decoder's manifold." The detector then fires on real images precisely in the conditions where it is most needed: social-media copies, thumbnails and forwarded screenshots. In the extreme case, a real photo merely passed through the Stable Diffusion autoencoder is reconstructed perfectly. Unveiling the Impact of Image Transformations on Deepfake Detection found that this round trip fools CLIP linear probes into calling real images fake 55.8% of the time.
We propose to separate "this image is easy for any compact autoencoder to reconstruct" from "this image is unusually easy for this generator's autoencoder to reconstruct." The score is the log-ratio of two reconstruction errors. The first error comes from the generator's own autoencoder. The second comes from a neutral autoencoder that has the same bottleneck size and architecture but was trained only on real photographs. Post-processing that removes high frequencies should help both autoencoders about equally, so its effect cancels in the ratio. A real advantage that only the generator's own decoder has should survive. The work then asks three questions. Does this cancellation actually hold across a standard sweep of image transformations? How badly does the score depend on having the right generator's autoencoder? And where is the irreducible limit, meaning images that have touched the generator's autoencoder without being generated?
Core Claim
Let $e_G(x)$ be the mean squared reconstruction error of image $x$ under the generator's autoencoder. Let $e_N(x)$ be the same error under a neutral autoencoder with matched bottleneck dimension $d$, trained on real images. The detection score is
$$s(x) = \log e_N(x) - \log e_G(x),$$
and a large $s$ means "likely generated." Suppose a degradation $T$ (JPEG, resize, blur) mainly removes content that both autoencoders already fail to reconstruct. Then $\log e_G(Tx)$ and $\log e_N(Tx)$ shift by similar amounts, and $s(Tx) \approx s(x)$. Raw $e_G$ alone shifts substantially. Our claim is empirical and falsifiable. On real images, the false-positive rate of $s$ at a threshold fixed on clean data should stay roughly flat across a JPEG-quality and downscaling sweep. The false-positive rate of raw $e_G$ should climb. Meanwhile, $s$ should keep most of the clean-data separation of generated images.
The design follows the logic of complexity correction in likelihood-based out-of-distribution detection. The difference is that the reference model is matched in capacity rather than being a generic compressor, and the nuisance it removes is the distribution channel rather than image content.
Why This Intersection
Each of the four directions supplies one piece. Reconstruction-based anomaly detection supplies the scoring rule. Autoencoder dimensionality reduction supplies the control variable. Because both autoencoders squeeze images through the same $d$-dimensional bottleneck, they share the same blind spots for fine detail, and that shared blindness is what makes cancellation plausible. Post-processing robustness supplies both the failure mode and the evaluation regime. Prior forensic work explains why the traces fade: JPEG quantizes away high-frequency coefficients, and resizing smears periodic upsampling structures. This is documented in Do GANs leave artificial fingerprints?, Leveraging Frequency Analysis for Deep Fake Image Recognition and Are handcrafted filters helpful for attributing AI-generated images?. The last of these reports its filter-based attribution falling to 43.8% at quarter-size downsampling.
Generative model dependency names the constraint. The detector is only as good as its access to the right autoencoder, and it inherits that autoencoder's quirks. The research file stresses that downstream trust is bounded by the fidelity of the auxiliary generator. Here that becomes a concrete question: how much does $s$ degrade when the generator's autoencoder is unknown and a proxy is used?
Two results constrain the design. First, Explainable AI reveals Clever Hans effects in unsupervised learning models shows that anomaly detectors often key on preprocessing artifacts such as resize aliasing rather than on semantics. A reconstruction score could do the same. We therefore inspect which frequency bands drive $s$ rather than trusting its AUROC alone. Second, the Stable Diffusion round-trip result shows that some real images become genuinely identical to decoder outputs. No reconstruction score can separate them, so we treat them as a separately reported category rather than hiding them in averages.
Research Program
We will build neutral autoencoders that mirror the architecture, downsampling factor and latent channel count of public latent-diffusion autoencoders. We will train them on real photographs drawn from the real halves of the benchmark datasets, with and without post-processing augmentation. We will then compute $e_G$, $e_N$ and $s$ for real and generated images under each transformation.
The analysis has three parts. The first measures cancellation directly. For each transformation we plot the shift in $\log e_G$ against the shift in $\log e_N$ on real images, and test whether they fall near the diagonal. The second sweeps the bottleneck dimension $d$ of the neutral model away from the matched value, to test whether matched capacity is actually the ingredient that matters. The third probes dependency. We score images from each generator using every available autoencoder, including deliberately mismatched ones, to map how much detection survives when the true decoder is unknown. Midjourney-style closed generators are the realistic case for this. To check for shortcuts, we recompute $s$ on band-limited versions of each image (low-pass and high-pass) in the spirit of the DCT inspection from the Clever Hans study. A score whose advantage lives entirely in the band that resizing destroys is not robust, whatever its clean AUROC.
Baselines
The naive reference point is raw reconstruction error $e_G$ under the generator's autoencoder, thresholded on clean real images. This is the method the proposal claims to fix. It will run on exactly the same images and autoencoder checkpoints as $s$. Beating it means a substantially lower false-positive rate on degraded real images at matched clean-data recall.
The strongest existing competitor on post-processing robustness is a self-supervised backbone with a linear probe. Unveiling the Impact of Image Transformations on Deepfake Detection reports DINOv2 at 92.3% average accuracy across 12 transformations and DINO at 91.8%, with DINO holding 95% accuracy under 10% JPEG. Language-supervised CLIP, by contrast, drops from 99.6% clean to 41.6% on average. We will reproduce the DINOv2 linear probe on the same transformation suite and training split. Our method is training-free with respect to fakes, so we will also report a DINOv2 probe trained with as few generated examples as practical, to make the supervision gap explicit. Matching DINOv2's average accuracy without training on any fakes would be a meaningful result. Exceeding it on the cross-generator split, or on the Stable Diffusion round-trip false-positive rate, would count as beating it.
Two further reference points are available. The first is Gram-Net from Global Texture Enhancement for Fake Face Detection in the Wild, which pools texture statistics to resist downsampling and JPEG, and is reported to avoid the roughly 22% degradation of plain ResNets. The second is the GenImage ResNet-50 reference from GenImage, which reaches 99.9% in-distribution but 54.9% on Midjourney and around 57% at 64×64.
The key ablation replaces the matched neutral autoencoder with an unmatched one, either wider or narrower in bottleneck. A second ablation replaces it with a non-learned complexity proxy (described below), which isolates whether matched capacity is what produces the cancellation. All reconstruction methods share the same image resolution handling and threshold-selection protocol. The only tunable quantity, the threshold, is chosen on clean real validation images alone.
Why not just…?
Why not just train a supervised detector with heavy JPEG and resize augmentation? This is the most serious threat. The DINO and DINOv2 results above show that augmentation-heavy pretraining already buys strong robustness. Our proposal does not claim to beat this on in-distribution generators. It claims two things. First, a fake-free score avoids the cross-generator collapse that supervised detectors show on GenImage. Second, it gives an interpretable handle on the round-trip failure. If the DINOv2 probe matches $s$ on cross-generator transfer as well, the honest conclusion is that the ratio score's only advantage is needing no fakes, and the note will report it that way.
Why not just divide the reconstruction error by a cheap complexity measure, such as the image's lossless compressed size? This is simpler and could absorb much of the post-processing shift, since smoothed images both compress better and reconstruct better. We include it as the non-learned ablation. If it closes most of the gap to $s$, then the neutral autoencoder is unnecessary and we would adopt the simpler score. Our expectation is that a generic compressor does not share the autoencoder's specific blind spots, so cancellation should be weaker, especially under resizing. The cancellation plots will settle this directly.
Why not just apply the same degradation to the reconstruction before measuring error? This "re-degrade then compare" baseline handles the case where the degradation is known. Real distribution channels, however, are unknown and stacked. We will run it with oracle knowledge of $T$ as an upper bound, and with a mismatched $T$ as the realistic case. If $s$ approaches the oracle without knowing $T$, the ratio is earning its keep.
Proposed Experiments
Clean and cross-generator evaluation uses GenImage. We report AUROC per generator under matched autoencoders and under every mismatched pairing. Robustness uses the 12-transformation protocol of the Cocchi et al. study. The decisive plot is the false-positive rate on real images versus JPEG quality and downscaling factor, at a threshold fixed on clean data, comparing $e_G$, the complexity-normalized error, and $s$. A dedicated split of real images round-tripped through each public autoencoder measures the identifiability limit. We expect $s$ to flag these images as well, and report its false-positive rate there against the 55.8% CLIP figure. As a stress test only, we will evaluate on RAID, where black-box transfer drops the Corvi et al. detector from 0.99 to 0.67 AUROC. Our two-model score requires an attacker to move both errors coherently, and whether that actually helps is an open question rather than a claim.
The proposal fails if the cancellation plots show the two errors shifting very differently under resizing, or if the complexity-normalized baseline matches $s$. Either outcome would itself be a useful negative result about what reconstruction scores can and cannot measure after an image leaves the lab.
References
- Unveiling the Impact of Image Transformations on Deepfake Detection: An Experimental Analysis
- Do GANs Leave Artificial Fingerprints?
- Leveraging Frequency Analysis for Deep Fake Image Recognition
- Are handcrafted filters helpful for attributing AI-generated images?
- Explainable AI reveals Clever Hans effects in unsupervised learning models
- Global Texture Enhancement for Fake Face Detection in the Wild
- GenImage: A Million-Scale Benchmark for Detecting AI-Generated Image
- RAID: A Dataset for Testing the Adversarial Robustness of AI-Generated Image Detectors