Decision Boundaries Matter: Graph-Regularized Residual Adaptation for Cross-Domain Fake Image Detection

Shichuang Xie, Qishuai Ding, Tong Qiao, Liquan Shen, Guorui FengarXiv 2026 · arXiv

In the rapidly evolving arms race of image forensics, detectors trained on yesterday’s GAN-generated fakes often stumble when faced with today’s diffusion models. While researchers have traditionally focused on learning more "transferable" features, a new paper from Shanghai University argues that we’ve been overlooking a simpler culprit: the decision boundary.

The paper, "Decision Boundaries Matter: Graph-Regularized Residual Adaptation for Cross-Domain Fake Image Detection," introduces GraRA, a lightweight, source-free method to realign a detector's classifier to new, unseen domains using only unlabeled data.

TL;DR

GraRA improves cross-domain fake image detection by adapting only the classifier's decision boundary, leaving the feature encoder frozen. By optimizing just 32 parameters in a constrained residual subspace guided by graph diffusion, it achieves significant gains in accuracy and AUC across diverse forgery types without requiring any source data or target labels.

What Problem Does This Paper Address?

Most state-of-the-art fake image detectors use powerful frozen backbones (like CLIP) and fine-tune them on specific forgery datasets. However, when these models are deployed on a new "target" domain (e.g., a new face-swapping method), their performance drops.

The authors' key insight is that the features extracted by the frozen encoder often remain highly discriminative in the new domain, but the source-trained decision boundary is misaligned. As shown in Figure 1, a boundary that perfectly separates real from fake in the source domain might cut right through the middle of the target domain's clusters due to distribution shifts.

Motivation for GraRA: (a) Source domain separation. (b) Mismatched boundary in target domain. (c) Risks of unconstrained adaptation. (d) GraRA's constrained, graph-guided approach.

The challenge is correcting this boundary "source-free"—meaning we don't have access to the original training data—and without labels for the new images. Simply trusting the model's own (unreliable) predictions on the new data can lead to "error amplification," where the model reinforces its own mistakes.

Methods

The authors propose Graph-Regularized Residual Adaptation (GraRA), which adapts the classifier in three distinct stages:

  1. Uncertainty-Aware Residual Subspace Construction: Instead of updating all classifier weights (which risks overfitting to noise), GraRA identifies a compact "residual subspace." It performs PCA on target features, giving more weight to "uncertain" samples near the current boundary. Crucially, it keeps this subspace orthogonal to the original classification direction to ensure the adaptation doesn't destroy the knowledge already captured by the source model.
  2. Source-Guided Target Graph Diffusion: To get better "pseudo-labels" for the unlabeled target data, GraRA uses the most confident source predictions as "anchors." It then builds a $k$-nearest neighbor ($k$-NN) graph of the target features and "diffuses" these anchor labels across the graph. This leverages the local structure of the feature space to refine noisy initial predictions.
  3. Graph-Consistent Residual Optimization: Finally, it optimizes a tiny set of residual coefficients (typically just 32) using two losses: a semantic consistency loss (to match the diffused soft labels) and a graph smoothness loss (to ensure neighboring points in the feature space get similar predictions).
Overview of the GraRA framework, showing the three stages of adaptation and the final head merging for deployment.

Once optimized, the learned correction is mathematically merged back into the original linear head. This means zero additional inference overhead—the final model is just as fast as the original.

Datasets

The authors evaluated GraRA on a massive scale using:

  • OpenMMSec: A comprehensive benchmark covering 72 unseen forgery types across four categories: Deepfake, AI-generated content (AIGC), Image Manipulation (IMDL), and Document Forgery.
  • WildDeepfake & WildFake: Two large-scale, real-world datasets used to test external generalization.

Key Insights and Ideas

  • The "Frozen Feature" Goldmine: Diagnostic experiments (Figure 2) showed that a simple linear probe trained with labels on frozen features could reach ~94% accuracy. This proves the features are fine; the source classifier is just failing to use them correctly.
  • Thresholding isn't Enough: A simple global shift in the decision threshold (moving the boundary back and forth) can improve class balance but cannot fix ranking errors. GraRA actually rotates the decision boundary in high-dimensional space to better fit the target distribution.
  • Orthogonality is Key: By restricting updates to a subspace orthogonal to the source weights, GraRA prevents the "catastrophic forgetting" or erratic updates common in unconstrained test-time adaptation.
Visualization of boundary adaptation. GraRA (green line) corrects ranking errors that a simple threshold shift (dashed blue line) cannot address.

Key Results

  • State-of-the-Art Performance: On OpenMMSec, GraRA achieved 84.36% accuracy and 91.34% AUC, outperforming the strongest forensic detector (EFFORT) by over 3 percentage points.
  • Superior to Adaptation Baselines: It beat established source-free adaptation methods like SHOT and GOLD by significant margins.
  • Efficiency: GraRA optimizes only 32 parameters, compared to 769 for a full linear head update. It also boasts the lowest inference latency (17.26 ms/image) among compared adaptation methods.

Limitations and Future Work

While GraRA performs exceptionally well on natural images, it still struggles with Document Forgery (AIGC-Doc). In this domain, source predictions are often near chance, meaning the "anchors" used for graph diffusion are unreliable.

The authors suggest that future work could explore region-aware forensic cues (since document forgeries are often local edits) and adaptive graph propagation to handle cases where initial source predictions are extremely weak. Additionally, exploring domain-aware calibration could further bridge the gap between improved sample ranking and final classification accuracy.

Summary updated

Abstract

Despite learning transferable features, fake image detectors may struggle on unseen domains due to mismatched decision boundaries. Our analysis shows that features extracted by the frozen forensic encoder remain discriminative, but the source-trained decision boundary does not fully exploit this information. However, correcting this boundary without source data or target labels remains challenging, as unreliable source predictions may lead to incorrect adaptation. To address this issue, we propose Graph-Regularized Residual Adaptation (GraRA), which refines the source decision boundary using only unlabeled target data. To determine which classifier directions to update, GraRA constructs a compact residual subspace from uncertainty-weighted target features and keeps it orthogonal to the source classification direction. To guide these updates, it uses source-score anchors to generate soft labels through target-graph diffusion, while neighborhood consistency regularizes residual learning within the constrained subspace. The learned correction is merged into the source classifier, requiring only 32 optimized coefficients and no additional inference branches. On diverse unseen OpenMMSec domains, GraRA achieves 84.36\% accuracy and 91.34\% AUC, improving over the source detector by 4.33 and 3.50 percentage points, respectively. Further analysis shows that reliable source predictions and locally consistent neighborhoods help guide residual learning, allowing GraRA to correct ranking errors that a simple threshold shift cannot address. \textcolor{cvprblue}{Code will be made publicly available.
BibTeX
@misc{xie2026decision,
  author = {Shichuang Xie and Qishuai Ding and Tong Qiao and Liquan Shen and Guorui Feng},
  title = {{Decision Boundaries Matter: Graph-Regularized Residual Adaptation for Cross-Domain Fake Image Detection}},
  year = {2026},
  eprint = {2611.25406},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.25406},
}
Figure