Modern diffusion-based inpainting models pose significant challenges for image forgery localization (IFL), as their full regeneration pipelines reconstruct the entire image via a latent decoder, disrupting the camera-level noise patterns that existing forensic methods rely on. We propose DiffusionPrint, a patch-level contrastive learning framework that learns a forensic signal robust to the spectral distortions introduced by latent decoding. It exploits the fact that inpainted regions generated by the same model share a consistent generative fingerprint, using this as a self-supervisory signal. DiffusionPrint trains a convolutional backbone via a MoCo-style objective with cross-category hard negative mining and a generator-aware classification head, producing a forensic feature map that serves as a highly discriminative secondary modality in fusion-based IFL frameworks. Integrated into TruFor, MMFusion, and a lightweight fusion baseline, DiffusionPrint consistently improves localization across multiple generative models, with gains of up to +28% on mask types unseen during fine-tuning and confirmed generalization to unseen generative architectures. Code is available at https://github.com/mever-team/diffusionprint
Figures & tables
Figure 1: Positive pair construction for the two image categories in our contrastive framework. An image generated by a generator gi is inpainted using the corresponding inpainting variant of gi . Natural images are also inpainted. For generated images, we extract the inpainted patches and pair them as positives with patches from the exact same spatial position in the source image. For natural images, positive pairs are formed by sampling patches outside the inpainting mask in both the source and the inpainted image.
Figure 2: Overview of DiffusionPrint. An anchor patch is encoded by fθ and its positive by the momentum encoder fθˉ , updated via exponential moving average. Negatives are drawn from a cross-category queue, where each anchor receives the top- k most similar embeddings from the opposite category. The InfoNCE loss and a generator-aware classification head are jointly optimized.
Figure 3: Radial power spectra in the mid-to-high frequency band [0.2,0.5] for Flux (left), SDXL (center), and SD 2.1 (right). Four patch types are shown: original real ( real_src ), reconstructed real ( real_regen ), original generated ( gen_src ), and inpainted generated ( gen_inpainted ) patches. Across all three models, latent reconstruction attenuates high-frequency content in real patches, shifting their spectral profile toward that of generated content.
Configuration
All (%)
IID (%)
Pairing
MoCo
75.21
78.33
Ours
86.35
87.69
Channels C
1 (flatten)
80.36
81.10
64 (GAP)
86.35
87.69
256 (GAP)
85.00
85.41
Top- k
64
85.83
86.45
Table 1: Ablation studies on DiffusionPrint pretraining. All: overall linear probing accuracy. IID: accuracy on in-domain models (SD 2.1, SDXL, Flux). Bold denotes the selected configuration.
SD 2.1
SDXL
Flux schnell
Flux dev
Flux fill
Framework
Modality
sem
rand
sem
rand
sem
rand
sem
rand
sem
rand
Lite Baseline
NP++
52%
23%
60%
61%
75%
72%
65%
62%
64%
59%
DP
54% +2
25% +2
64% +4
68% +7
85% +10
77% +5
80% +15
73% +11
73% +9
73% +14
DP †
52% +0
25% +2
65% +5
70% +9
88% +13
76% +4
81% +16
71% +9
76% +12
77% +18
TruFor [ 23 ]
NP++
50%
23%
61%
62%
80%
62%
69%
46%
65%
59%
DP
53% +3
25% +2
67% +6
73% +11
89% +9
85% +23
83% +14
74% +28
75% +10
74% +15
Table 2: F1 score (%) on TGIF fully regenerated (FR) subset at threshold 0.5 for semantic (sem) and random (rand) mask subsets. NP++: Noiseprint++ modality. DP: DiffusionPrint modality trained on SD 2.1, SDXL, and Flux. DP † : DiffusionPrint contrastive pretraining on SD 2.1 and SDXL only; Flux variants are unseen during pretraining. Lite Baseline: simplified fusion baseline using Segformer for RGB and a CNN for the secondary signal with concatenation. All fusion frameworks are fine-tuned on semantic FR images only; random mask results reflect generalization to unseen mask types. + Δ indicates improvement over NP++ baseline.
Figure 4: Qualitative forgery localization results. Comparison between traditional noise-based extractors (NP++) and our proposed DiffusionPrint (DP) integrated into TruFor, MMFusion, and a Lite Baseline (Concat). DiffusionPrint consistently produces cleaner, more accurate localization maps across all frameworks.
Figure 5: Failure cases. Top: an SD 2.1 inpainting correctly localized, but with an activation on an authentic object too. Bottom: a case exhibiting object bias, where the model activates on salient non-inpainted regions rather than the manipulated area. Input images show the inpainted region outlined by the ground-truth mask.
Augmentation Strategy
Overall Accuracy (%)
None
84.90
Geometric
86.35
Geometric + JPEG
83.40
Geometric + HP Filter
64.10
Table 3: Ablation on pretraining augmentations. All metrics denote overall linear probing accuracy. While geometric augmentations improve representation quality, applying high-pass filters or JPEG compression severely degrades the learned forensic signal.
Diffusion-based inpainting models modify only a localized part of an image, while many AI-image detectors rely on global artifacts and do not localize. These artifacts vary across generators, limiting detector transfer under distribution shifts. Recent work shows that restoring the authentic pixels outside the inpainted region removes these cues and can degrade pretrained detectors. To address this, we present FUSED, a unified framework for the joint detection and localization of AI-generated inpainting. FUSED combines low-level forensic cues with high-level semantic features using a sparsely-gated Mixture-of-Experts architecture, enabling the model to adaptively prioritize the most relevant signal for each token. For each input, FUSED predicts both an image-level manipulation score and a pixel-level mask of the inpainted area. On the OpenSDID cross-generator benchmark, FUSED achieves the best average detection and localization, with the largest gains on unseen generators. The same model transfers directly to the held-out AutoSplice and CocoGlide benchmarks, more than doubling localization performance. Evaluating each held-out benchmark with and without the global generator artifact further shows that all evaluated methods, ours included, partly read the artifact as evidence of manipulation, and FUSED remains the strongest under both conditions. Code and pretrained models are available at https://github.com/AntonNuzhdin/FUSED.
Anton Nuzhdin, Marcel Worring, Ivona Najdenkoska
Informatics Institute, University of Amsterdam Amsterdam, The Netherlands
Overlapped friction ridge patterns are a recurring problem in latent fingerprints recovered from crime scenes and in live-scan scenarios where residual fingerprints on the sensor may corrupt subsequent acquisitions. Existing approaches for separating overlapped fingerprints either rely on rule-based orientation field completion that requires strong domain knowledge or train end-to-end deep neural networks that do not account for domain-specific considerations. This work introduces a diffusion-based pipeline for separating component fingerprints from an image containing overlapping friction ridge patterns. We formulate the separation problem as an inpainting task and progressively learn a diffusion model for this task in multiple stages. Starting from a pre-trained Stable Diffusion model, we progressively incorporate a fingerprint prior, add the ability to complete partial fingerprints, and finally propose overlap-aware inpainting that reconstructs each component print using a diffusion inpainting model based on multi-channel conditioning. Experiments on two public datasets demonstrate that component fingerprints reconstructed using the proposed diffusion-based inpainting method can match with their mated counterparts with very high probability.
Noor Hussein, Anil K. Jain, Karthik Nandakumar
Michigan State University, East Lansing, MI 48824, USA
We propose DINO-FIL, a transformer-based framework for pixel-level localization of generative image forgeries. The method leverages multi-layer representations from a pretrained DINOv3 ViT-H+/16 encoder combined with a lightweight fusion decoder to capture both semantic structure and fine-grained texture inconsistencies introduced by image editing. By aggregating intermediate transformer features across depths, the model improves sensitivity to subtle, spatially localized artifacts that are often missed by standard single-layer approaches. We evaluate DINO-FIL in a cross-dataset setting, training on B-Free and testing on Beyond the Brush, CocoGlide, TGIF, and SAGI-D. The model achieves strong generalization, outperforming existing baselines on average and on four of five evaluated datasets, while maintaining a high true negative rate on pristine images.
Simon Freitter, David Fischinger, Silvia Poletti +2
AIT Austrian Institute of Technology GmbH, Giefinggasse 4, 1210 Vienna, Austria