TL;DR
Contrastive learning (CL) models are vulnerable to backdoor attacks, but existing defenses designed for supervised learning consistently fail against them. This paper reveals why: while supervised attacks learn backdoor and clean tasks independently, contrastive backdoor attacks deeply intertwine trigger features and semantic features throughout the representation space. The authors uncover the root mechanics behind this entanglement and demonstrate how density-based filtering and data-free pruning can serve as viable counter-defenses.
What Problem Does This Paper Address?
Pre-training vision encoders with contrastive self-supervised learning (e.g., SimCLR, BYOL, MoCo) has become standard practice for building downstream classifiers without labeled data. However, if an adversary injects a subtle "backdoor" trigger into unlabeled pre-training data, downstream models inherit malicious behavior (such as misclassifying triggered inputs into a target class).
While supervised backdoor attacks and their defenses are extensively studied, contrastive backdoor attacks have remained poorly understood. Security teams often assume supervised defense techniques—such as monitoring loss drop speeds, clustering feature activations, or fine-pruning dormant neurons—can simply be adapted to CL-trained encoders. This paper systematically explores whether that assumption holds, uncovering fundamental differences in attack mechanics and why conventional defenses collapse.
Methods
To compare attacks on equal footing, the authors define TRL (TRojan Learning), a unified algorithmic framework spanning both supervised and contrastive backdoor attacks via two modular functions:
SelectCandidate(): Samples reference inputs (either from a target class in clean-label settings or across classes in dirty-label settings).ApplyTrigger(): Injects universal triggers (patches), functional triggers (spectral/frequency perturbations), or dynamic/input-aware perturbations.
Through TRL, the authors probe:
- Learning Dynamics: Tracking the loss trajectory of clean versus poisoned samples during training.
- Feature Distributions & Entanglement: Measuring representation overlap using t-SNE, mutual information (MI) between clean and triggered inputs, and a quantitative metric called the Entanglement Ratio (ER) based on $k$-nearest neighbors in the latent space.
- Defensive Feasibility: Benchmarking classical supervised defenses (Anti-Backdoor Learning, Activation Clustering, SCAn, Fine-pruning, Neural Cleanse, STRIP, and Decoupling/BDD) alongside new defenses tailored to CL (density-based filtering via DBSCAN/OPTICS and data-free Channel Lipschitzness-based Pruning).
Datasets
The authors evaluate attacks and defenses across three standard image classification benchmarks:
- CIFAR-10 (60,000 $32 \times 32$ images, 10 classes)
- CIFAR-100 (60,000 $32 \times 32$ images, 100 classes)
- ImageNet-100 (a 100-class subset of ImageNet-1K with 500 training and 50 test images per class)
Key Insights and Ideas
- Independence vs. Entanglement: In supervised learning (SL), learning the trigger is typically much simpler than learning semantic features; the model learns them independently at the data level. In CL, without explicit labels, an effective attack must retain semantic features to bind poisoned inputs with the target class while using trigger features to link the poisoned inputs together. Benign and backdoor tasks become deeply intertwined.
- Loss Dynamics Are Indistinguishable: Because contrastive attacks require learning both semantic and trigger features from poisoned samples, the contrastive loss on poisoned inputs drops at virtually the same rate as clean inputs. Defenses like Anti-Backdoor Learning (ABL) that rely on early, rapid loss drops fail completely.
- Trigger and Semantic Features Overlap in Latent Space: In SL, poisoned representations form distinct clusters separated from target-class clean data. In CL, poisoned representations heavily overlap and entangle with target-class representations across intermediate and penultimate encoder layers, neutralizing feature-separation defenses (Activation Clustering, SCAn).
- Pruning Collapses Utility: Data-dependent Fine-Pruning (FP) easily strips backdoors in SL because clean and trigger inputs activate different channels. In CL, because features are intertwined, pruning backdoor channels destroys clean classification accuracy at nearly the exact same rate as the attack success rate.
Key Results
- Standard Defenses Ineffective:
- ABL: At a 1% isolation rate on CIFAR-10, true positive detection rate fell from 92.8% in SL to just 2.4% in CL.
- SCAn: Poison detection TPR dropped from 63.0% (SL) to 28.0% (CL) at a 0.5% false positive rate.
- Neural Cleanse & STRIP: Neither could reverse-engineer triggers or filter inputs at inference time (STRIP achieved only 1.1% TPR at 1.0% FPR).
- Density-Based Filtering Works: While poisoned and clean features entangle, poisoned inputs form significantly denser sub-clusters than clean classes (normalized intra-class $L_2$ distance of 0.0 vs. $\ge 0.56$). Filtering with DBSCAN removed up to 98.8% of poisoned samples (at a 5% poisoning rate), lowering Attack Success Rate (ASR) to 13.3%–19.9% while retaining clean accuracy (~80%).
- Data-Free Pruning & Ensemble Defenses: Channel Lipschitzness-based Pruning (CLP), tuned at the knee point of the accuracy curve ($u=2.4$), pruned backdoor channels in a data-free manner, yielding 80.4% clean accuracy and 14.3% ASR. Combining DBSCAN filtering with CLP further reduced ASR to 12.6% with minimal utility penalty (79.6% ACC).
Limitations and Future Work
- Domain Scope: Experiments were restricted to vision models; backdoor mechanics under contrastive learning in natural language processing (e.g., DeCLUTR) and multimodal models (e.g., CLIP) remain unexplored.
- Broader SSL Paradigms: The investigation focused on contrastive methods (SimCLR, BYOL, MoCo); extending these insights to non-contrastive self-supervised architectures (such as Masked Autoencoders) is an open challenge.
- Clustering Overhead: While density-based clustering is effective, algorithms that do not require parameter guessing (like OPTICS) can introduce significant computational overhead (e.g., 1.5 hours vs. 10 seconds for DBSCAN on CIFAR-10).
Summary updated