Counterfeiting affects diverse industries, including pharmaceuticals, electronics, and food, posing serious health and economic risks. Printable unclonable codes, such as Copy Detection Patterns (CDPs), are widely used as an anti-counterfeiting measure and are applied to products and packaging. However, the increasing availability of high-resolution printing and scanning devices, along with advances in generative deep learning, undermines traditional authentication systems, which often fail to distinguish high-quality counterfeits from genuine prints. In this work, we propose a diffusion-based authentication framework that jointly leverages the original binary template, the printed CDP, and a representation of printer identity that captures relevant semantic information. Formulating authentication as multi-class printer classification over printer signatures lets our model capture fine-grained, device-specific features via spatial and textual conditioning. We extend ControlNet by repurposing the denoising process for class-conditioned noise prediction, enabling effective printer classification. On the Indigo 1 x 1 Base dataset, our method outperforms traditional similarity metrics and prior deep learning approaches. Results show the framework generalises to counterfeit types unseen during training.
Figures & tables
Figure 1: Examples of a binary template, authentic printed CDP, and counterfeit printed CDPs from traditional image processing and deep learning methods. Normalised cross-correlation reliably detects traditional counterfeits but is unreliable against deep learning-based ones.
Figure 2: Authentication pipeline leveraging printer signature reconstruction. The reverse diffusion process takes a noised template as input and is conditioned on the printed CDP and printer identity text. ControlNet is modified to predict noise per class and includes a classification module selecting the class with minimal prediction error.
Perr
Pmiss
Pfa
HP55
HP76
Mean
HP55_55
HP55_76
HP76_76
HP76_55
Mean
Traditional
NCC
0.286
0.292
0.310
0.301
0.300
0.361
0.264
0.201
0.273
SSIM
0.275
0.264
0.300
0.281
0.292
0.285
0.292
0.210
0.269
Deep Learning
[ 6 ]
0.091
0.125
0.111
0.118
0.097
0.16
0.000
0.000
0.064
Ours
0.023
0.049
0.035
0.005
0.000
0.014
0.007
0.000
0.042
Table 1: Authentication error rate for method comparison with baselines. Lower is better.
Predicted class (%)
HP55
HP76
HP55_55
HP55_76
HP76_76
HP76_55
Actual class (%)
HP55
95
5
0
0
0
0
HP76
3
97
0
0
0
0
HP55_55
0
0
83
15
1
1
HP55_76
1
0
14
83
1
1
HP76_76
0
1
1
1
89
8
Table 2: Confusion matrix of classification results. Values are in percentages.
Counterfeit Type
Perr
Pmiss
Pfa
Known counterfeit
0.012
0.024
0.000
Unknown counterfeit
0.012
0.024
0.000
Table 3: Authentication performance on known and unseen counterfeit types. Lower is better.
Configuration
Avg. MSE (↓)
Pretrained VAE
0.581
Fine-tuned VAE
0.075
Table 4: Mean squared reconstruction error between original and reconstructed binary templates under different configurations.
Input Configuration
Perr
Pmiss
Pfa
No Template Input
0.660
0.430
0.200
With Template Input
0.023
0.042
0.005
Table 5: Authentication error with and without template input. Lower values indicate better performance.
Reconstruction-based generative models offer a natural framework for unsupervised out-of-distribution (OOD) detection, but multi-class normality modelling requires a single detector to capture multiple in-distribution manifolds and produce comparable anomaly scores across classes. We study this problem in copy detection pattern (CDP) authentication, where authentic and counterfeit samples are visually similar but differ in subtle printing-and-digitisation (P&D) signatures. We propose a diffusion based multi-class normality framework in which a single class-conditional ControlNet is trained exclusively on authentic CDPs from multiple P&D classes and detects counterfeits through reconstruction error under authentic-class conditioning. We further introduce dual template masking, which hides complementary regions of the input template and scores only withheld pixels, reducing reliance on visible binary structure. On the Indigo 1 x 1 Base dataset, the proposed method outperforms traditional and adapted generative baselines under multi-class authentic-versus-counterfeit evaluation, without using counterfeit samples for training or threshold calibration.
Copy Detection Patterns (CDPs) are structures printed on physical objects to enable cost-effective authentication. Verification is achieved by comparing a captured image with the digital template from which the CDP was printed. In practice, printer stochasticity and camera distortions hinder this comparison, limiting robustness against counterfeiting. Prior work addressed camera effects by synthesising reference images in the verification camera domain, but it ignored printing variability. We introduce an enrolment-based cross-camera dual-synthetic referencing framework. Each printed CDP is first captured by a controlled enrolment camera, and a deep-learning-based translator jointly exploits the digital template and the enrolled capture to generate a high-quality reference for the verification image. We provide an information-theoretic justification showing that the dual reference is more informative than template-based references. Experiments on heterogeneous mobile cameras demonstrate improved authentication performance, robustness to machine-learning-based copy attacks, and reliable verification from small CDP regions and on low-end devices.
Ivan Oleksiyuk, Roman Chaban, Slava Voloshynovskiy
Department of Computer Science, University of Geneva, Switzerland
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