Abstract
Contrastive Learning (CL) has emerged as a powerful paradigm for learning representations without labels, yet it remains highly susceptible to backdoor attacks. This research demonstrates that defending CL is significantly more challenging than defending Supervised Learning (SL). The core issue lies in "feature entanglement," where malicious triggers become inseparable from benign semantic features in the latent space, rendering traditional SL defenses ineffective.
Introduction: The Silent Threat of Backdoors
Backdoor attacks represent a critical security risk in machine learning. An adversary poisons a small portion of the training data with a specific trigger, such as a small pixel patch. While the resulting model performs normally on clean inputs, it executes a malicious action—typically misclassification to a target class—whenever the trigger is present during inference.
While these vulnerabilities are well-studied in Supervised Learning (SL), their impact on Contrastive Learning (CL) is less understood. Most existing defenses assume a "backdoor task" is easier for a model to learn than the "benign task," allowing for detection via learning dynamics or feature separation. This study investigates whether these assumptions hold for CL.
Methodology: The TRL Framework
The authors introduce TRL (TRojan Learning), a unified framework to analyze supervised and contrastive backdoor attacks. They evaluate attacks across three major CL algorithms—SimCLR, BYOL, and MoCo—using standard benchmarks like CIFAR10, CIFAR100, and ImageNet100. The analysis focuses on three dimensions:
- Learning Dynamics: Comparing training loss curves of clean vs. poisoned data.
- Feature Distributions: Utilizing t-SNE visualizations and the Entanglement Ratio (ER) metric.
- Mutual Information (MI): Measuring semantic information retention in poisoned representations.
The Entanglement Effect
The primary discovery is that CL attacks "entangle" malicious triggers with benign features. In SL, a model learns to map a trigger directly to a label. In CL, the absence of labels forces the model to associate the trigger with the semantic features of the target class to minimize contrastive loss.
As shown in the t-SNE visualizations, poisoned samples in SL often form distinct, separable clusters. In contrast, poisoned samples in CL overlap significantly with clean target-class samples. This entanglement makes distribution-based defenses, such as Activation Clustering, unable to distinguish between malicious and benign inputs. Furthermore, the learning dynamics in CL are nearly identical for clean and poisoned data, defeating defenses that rely on "early-stopping" or loss thresholding.
Defense Performance and Alternatives
Standard SL defenses perform poorly against CL backdoors. For instance, Anti-Backdoor Learning (ABL), which typically achieves a 92.8% detection rate in SL, drops to a mere 2.4% in CL at a 1% poisoning rate. Similarly, model-inspection tools like NeuralCleanse and inference-time defenses like STRIP fail because they cannot reverse-engineer stable triggers or identify entropy anomalies.
However, the authors identify two promising alternatives:
- Density-based Filtering: By leveraging the fact that trigger inputs often cluster more tightly than clean inputs, algorithms like DBSCAN successfully filtered 98.8% of poisoned samples in high-poisoning scenarios.
- Channel Lipschitzness-based Pruning (CLP): This data-free approach prunes channels sensitive to high Lipschitz constants, reducing the Attack Success Rate (ASR) to 14.3% while maintaining 80.4% clean accuracy.
Conclusion and Future Work
The inherent mechanics of Contrastive Learning create a unique "entanglement" that shields backdoor attacks from traditional defenses. While density-based filtering and CLP show promise, they require careful tuning. Future research is needed to extend these findings to other domains like NLP and to develop more robust, automated defenses tailored for self-supervised paradigms.
Summary updated