SCR: Detecting Backdoor-Poisoned Samples through Clean-Reference Residuals
Authors: Yi Yang, Jinyang Huang, Feng-Qi Cui, Yu-Tong Guo, Sirui Zhao, Haiming Jin, Weihua Li, Quan Bai, Meng Li
Organizations: Hefei University of Technology · University of Science and Technology of China · Shanghai Jiao Tong University · Auckland University of Technology · University of Tasmania
Deep neural networks are vulnerable to backdoor attacks, in which adversaries manipulate model predictions by injecting poisoned samples into training data. Detecting these samples remains challenging because legitimate semantic variation can obscure poisoning-related signals in learned representations. Consequently, class-level statistics used by existing detectors may flag benign feature deviations while overlooking poisoned samples that blend into the class distribution. In this paper, we propose Semantic Counterfactual Residualization (SCR), which uses a small set of clean reference samples to account for benign variation through sample-specific feature reconstruction. SCR identifies poisoned samples by detecting coherent deviations from these clean baselines, without requiring prior knowledge of the attacks. We evaluate SCR through experiments covering twelve dirty-label and clean-label attacks across CIFAR-10, CIFAR-100, and Tiny ImageNet. With a small clean-reference set, SCR achieves attack-averaged true positive rates above 99.5% and false positive rates below 2% on each dataset, outperforming eight representative detection baselines in macro-TPR.
Figures & tables
Figure 1: Illustration of a data-poisoning-based backdoor attack. Poisoned training samples containing an attacker-defined trigger induce the backdoored classifier to predict the target class on triggered inputs while maintaining correct predictions on clean inputs.
Figure 2: Overview of SCR. SCR contains four main stages: (1) extracting features of inspected samples and clean reference samples using an encoder; (2) reconstructing sample-specific benign representations from same-class clean references; (3) obtaining counterfactual residuals by subtracting the reconstructed benign components; and (4) estimating class-wise shared shifts, screening suspicious classes, and filtering poisoned samples through directional scoring.
Attack
PSBD
SCAn
Beatrix
FLARE
AGPD
CT
SPECTRE
SAM-B.
SCR
CIFAR-10
BadNets (1%)
100.00/11.31
-/-
62.40/3.92
7.00/0.20
70.80/0.00
95.20/4.00
94.80/0.05
96.60/5.01
98.20/1.02
Blended (1%)
91.80/21.30
96.40/0.00
96.20/4.74
97.80/0.00
97.80/0.00
100.00/0.99
99.80/0.00
72.80/5.01
100.00/1.12
BPP (1%)
96.80/22.80
-/-
98.40/4.11
2.00/9.77
97.00/0.00
0.00/1.56
98.00/0.02
84.94/5.01
100.00/0.56
FTrojan (5%)
100.00/15.66
100.00/0.00
100.00/3.66
99.68/0.00
98.80/0.00
100.00/0.92
95.28/0.25
64.36/5.01
100.00/2.12
SSBA (5%)
100.00/13.53
95.88/0.00
87.88/3.23
0.88/49.66
98.40/0.02
98.24/1.93
80.40/1.03
99.48/5.01
100.00/1.37
Table 1: Poisoned-sample detection, reported as TPR/FPR (%; ↑ TPR, ↓ FPR). Attack annotations give the global poisoning rate, followed by c (global cover rate) or t (target-class poisoning rate for clean-label attacks), when applicable. SAM-B. denotes SAM-Beatrix. Bold TPR/FPR pairs indicate the highest TPR in each attack or Average row, including all ties at the displayed precision. SCAn’s -/- indicates failure to correctly identify the poisoned class. Gray text denotes failed detection ( TPR<80% ).
Figure 3: A case study of the SCR workflow on CIFAR-10 under BAAT with a 1% poisoning rate.
Configuration
CIFAR-10
CIFAR-100
Tiny ImageNet
Full SCR
99.71/1.96
99.87/0.43
99.81/0.23
Residualization
Class Mean
90.51/0.58
77.48/0.01
44.44/0.04
Nearest Neighbor
18.13/0.16
0.00/0.00
0.00/0.00
kNN Mean
80.08/0.37
88.36/0.01
65.56/0.04
Class screening
Table 2: Macro-TPR/FPR (%) results of ablation studies.
Figure 4: Clean-reference budget sensitivity analysis. Dashed lines mark the default of 30 references per class.
Architecture
CIFAR-10
CIFAR-100
Tiny ImageNet
ResNet-18 (default)
99.71/1.96
99.87/0.43
99.81/0.23
PreAct ResNet-18
99.53/1.68
99.32/0.38
99.57/0.21
VGG-16
99.05/1.51
99.39/0.45
99.43/0.29
MobileNetV3-Large
98.94/1.02
99.02/0.51
99.48/0.33
Table 3: Model architecture sensitivity.
Strategy
ACC ↑
ASR ↓
ACC0↑
CIFAR-10
Random
94.58
93.56
92.55
Oracle
94.87
1.11
95.26
SCR
94.61
0.54
92.95
Full Clean
94.97
–
92.80
CIFAR-100
Table 4: Purification and retraining (%) experimental results.
School of Computer Science and Information Engineering Hefei University of Technology Hefei, Anhui, China · School of Information Science and Technology University of Science and Technology of China Hefei, Anhui, China · Faculty of Business Data Science Kansai University Japan +3
Faculty of Data Science, City University of Macau, Taipa, Macau. · Faculty of Engineering and Information Technology, University of Technology Sydney, New South Wales, Australia.