Generator-Blind Prototypes: Auditing Each Piece of Evidence in a Deepfake Detector

Deepfake detectors that score above 99% on the data they were trained on often fall to near chance when the fakes come from a generator they never saw. The usual explanation is that they learn "fingerprints" of one generator, such as upsampling patterns or blending seams, instead of anything general about forgery. We propose to make those fingerprints visible and then remove them. A prototype network is a classifier that decides by comparing parts of an input image to a small set of stored reference patches, called prototypes, each tied to real training examples. It splits the detector's evidence into a few hundred separately testable units. We measure, for every prototype, whether it fires on fakes from all training generators or only on one, and whether its similarity scores survive ordinary re-encoding such as JPEG compression and resizing. During training we penalize prototypes that fail either test, and after training we remove them.

The claim is simple enough to be proven wrong. If the cross-dataset gap comes from generator-specific shortcuts, those shortcuts should sit in a minority of prototypes. We can find that minority using only the generators available at training time, and suppressing it should raise accuracy on unseen generators. It should also make the case-based explanation ("flagged because this patch resembles that training patch") something an examiner can trust after the image has been recompressed. Interpretability here is not a side output. It is the tool that lets us locate and cut the part of the model that fails to generalize.

What exists and where this differs

Three prior systems put prototypes into forgery detection, and each leaves the key step undone. Interpretable and Trustworthy Deepfake Detection via Dynamic Prototypes (DPNet) learns prototypes of forgery dynamics from frames and optical flow. It reports 90.91% AUC on FaceForensics++ low quality and 90.80% zero-shot on DeeperForensics. Because it learns what known fakes look like, nothing stops individual prototypes from encoding one manipulation's quirks. ProtoExplorer builds on DPNet and lets forensic experts delete or replace biased prototypes by hand. One session raised accuracy from 0.915 to 0.923. This is the closest precedent: it shows that editing individual prototypes helps. But the editing is manual, based on visual inspection of UMAP plots, and never tested against unseen generators. We replace the expert's judgment with two measurable criteria and fold them into training. PUDD takes the opposite route. It models only authentic faces as prototypes over frozen DINOv2 features and flags anything too far away, reaching 95.1% accuracy on Celeb-DF. It never tests whether its distances are stable under compression, and its authors observe that natural motion such as eye closure is misread as forgery. Our design keeps both real and forgery prototypes and keeps only the forgery prototypes that pass the audit. This gives a direct experimental answer to the real-only versus forgery-prototype disagreement between PUDD and DPNet.

Two papers constrain the design. This Looks Like That... Does it? shows that prototype similarity can come apart from what a human sees. Its attack moves a "bird head" prototype onto the stomach with 99.5% success, and JPEG changes alone move a similarity score from 5.18 to 1.68. Its adversarial-training fix cut clean accuracy from 75.8% to 56.3%. This is why we target the cheap, relevant perturbation, which is re-encoding, and do not attempt full adversarial robustness. What Makes Fake Images Detectable? shows that small-receptive-field patch classifiers transfer better across GANs. That motivates patch-level prototypes rather than whole-image ones. Interpretable Prototype-based Graph Information Bottleneck supplies a parallel from graphs: prototypes soak up task-irrelevant scaffolds unless they are constrained. We use a direct invariance criterion instead of its mutual-information bottleneck, because in forgery the nuisance factor is known: it is generator identity.

Core mechanism

We use a strong frozen or lightly tuned backbone, either ConvNeXt, which ForensicHub found to be the best general backbone, or DINOv2 as in PUDD. On top of it sits a patch-level prototype layer in the style of Deep Learning for Case-Based Reasoning Through Prototypes, without that paper's autoencoder, which blurs at high resolution. The layer has $m$ prototypes split between real and fake classes. We restrict the final weights to be non-negative, which removes the negative-weight "far from class B" reasoning that paper identifies as a weakness. Let $a_j(x)$ be the highest similarity between prototype $j$ and any patch of image $x$. Let $\mu_{j,g}$ be its mean over training fakes from generator $g$. The training data must contain several labeled generators: the four FaceForensics++ manipulation methods, or GenFace's generator-level labels. Let $T$ be a random re-encoding (JPEG quality, resizing, video bitrate). The added loss is

$$ \mathcal{L}_{\text{audit}} = \sum_{j \in \text{fake}} \mathrm{Var}_g\left(\mu_{j,g}\right) \;+\; \beta \sum_{j} \mathbb{E}_x \left| a_j(x) - a_j(T(x)) \right| . $$

The first term penalizes a forgery prototype that fires strongly on one generator and weakly on the others. The second penalizes a prototype whose evidence disappears under compression. After training, any fake prototype whose normalized generator specificity or compression drift exceeds a threshold is pruned. The threshold is picked by leave-one-training-generator-out validation, so no test generator is ever touched. Each surviving prototype is then projected onto its nearest real training patch for display, as in DPNet.

Research Program

The first stage is diagnostic and can refute the hypothesis before any method is built. We train an unregularized prototype detector on FaceForensics++, compute each prototype's generator specificity and compression drift, and ask two questions. First, does specificity measured on training generators predict how much each prototype contributes to errors on held-out datasets (Celeb-DF, DeeperForensics, GenFace)? We measure contribution by the change in held-out AUC when that single prototype is removed. Second, is that contribution concentrated in a small fraction of prototypes? The second stage adds the audit loss and pruning. The third stage tests whether the explanations hold up. For each test image we record its top-three activated prototypes before and after re-encoding and count how often they stay the same. We also delete the patches an explanation points to and measure how much the fake score drops, compared with deleting random patches of equal area.

Baselines

The naive reference point is a frozen backbone with a linear probe trained with cross-entropy on FaceForensics++. It uses the same backbone, data, and augmentation as our model, so any gain must come from the prototype layer and audit, not from features. The strongest published cross-dataset numbers set the bar per protocol. On FaceForensics++ to GenFace, GenFace's CAEL reports 65.04% AUC, against 60.61% for Xception and 61.89% for UFD. On FaceForensics++ to Celeb-DF, the Two-Branch Recurrent Network reports 76.65% video-level AUC, against 69.70% for Xception. On DeeperForensics zero-shot, DPNet reports 90.80% AUC and image-based ProtoPNet 61.59%. In the multi-domain setting, ForensicHub reports 0.822 average cross-domain AUC for ConvNeXt under its fusion protocol. For PUDD, the file reports only 95.1% accuracy on Celeb-DF and 94.6% on CIFAKE. No reported result was found on Lacuna for PUDD trained on FaceForensics++ and tested cross-dataset, so we will rerun it on our splits and backbone.

The comparisons that isolate our contribution are ablations. First, the same prototype network without the audit loss, which is essentially an automated-free ProtoExplorer starting point. Second, random pruning of the same number of prototypes. Third, pruning by generator specificity only and by compression drift only. Fourth, a real-prototypes-only variant, a PUDD-style design inside our architecture. Fifth, the same invariance penalty applied to backbone feature channels of the linear-probe model rather than to prototypes.

All methods get the same training data, the same re-encoding augmentation, and an equal hyperparameter search budget, with selection by leave-one-training-generator-out validation only. We will count it as beating the field if we exceed CAEL's 65.04% on FaceForensics++ to GenFace and Two-Branch's 76.65% on Celeb-DF while also improving top-prototype stability under re-encoding over the unaudited prototype model. Matching the linear probe's accuracy while adding faithful explanations would be a weaker but still useful result.

Why not just…?

Why not just use a foundation-model linear probe, which ForensicHub found hard to beat? It is a real threat on in-distribution and multi-domain averages, which is why it is our naive baseline on an identical backbone. The evidence against it as a complete answer is the collapse on generator shift. GenFace reports plain ViTs at 49–50% AUC from diffusion to GAN, and ForensicHub reports in-domain 1.000 AUC falling to 0.390 on unseen generators. A probe also gives no evidence an examiner can check. If our model only ties the probe on cross-dataset AUC, we will report that honestly as an interpretability gain with no robustness gain.

Why not just apply the invariance penalty to the whole model or its feature channels, with no prototypes? This is the most serious alternative, because the audit idea could work without prototypes. The channel-level ablation settles it directly. If it matches our cross-dataset AUC, then the robustness gain comes from the invariance criterion rather than the prototype structure. What would remain is that only prototypes turn each suppressed or kept unit into a training patch a human can inspect. We found no reported result on Lacuna for such penalties in deepfake detection.

Why not just model real faces only, as PUDD does? Real-only prototypes avoid learning generator quirks by construction. But the file documents their false alarms on natural motion and gives no evidence about their stability under compression. Our real-only ablation, run on the same backbone and splits, will show whether audited forgery prototypes add anything. If they do not, the conclusion is that the audit should be applied to real prototypes' compression drift alone.

Why not just add heavy compression augmentation, or adversarially train? Augmentation is given to every baseline, so any gain we report is on top of it. Adversarial training of prototype networks cost roughly 19 points of clean accuracy in This Looks Like That... Does it?. Our stability term targets only realistic re-encodings, and we will report clean accuracy alongside robustness to show whether we avoid that trade.

Proposed Experiments

The main protocols are the following. Train on FaceForensics++ high quality (c23), treating its four manipulation methods as training generators. Test on Celeb-DF, DeeperForensics, and GenFace, and on FaceForensics++ low quality (c40) for compression shift. Separately, split GenFace by generator family: train on diffusion and test on GAN (CAEL 92.73% AUC, ViT near 50%), and the reverse, which is the harder direction and has no reported number in the file. Metrics are AUC, video-level AUC where applicable, and true acceptance rate at low false acceptance rate. For explanations we report top-prototype stability under re-encoding and patch-deletion fidelity against random deletion.

The decisive check is the stage-one diagnostic. If generator specificity measured on training generators shows no rank correlation with each prototype's harm on held-out generators, the premise is false and pruning cannot work in principle. If the correlation holds and pruning the flagged prototypes improves held-out AUC more than random pruning of the same number, we have shown something the field lacks: a way to find, before deployment, the specific pieces of evidence that will fail on new generators.