Abstract
Self-supervised learning (SSL) has become a cornerstone of modern computer vision, yet it introduces significant security risks through "Trojaned" encoders. These models can inherit backdoors from poisoned unlabeled datasets, which then persist in any downstream application. We introduce SSL-Cleanse, a comprehensive defense framework designed to detect and neutralize these hidden triggers. Unlike previous methods, SSL-Cleanse operates without needing dataset labels or knowledge of the final downstream task. By identifying "gravity wells" in the encoder's latent representation space, SSL-Cleanse effectively reduces attack success rates from over 80% to near zero with minimal impact on standard model performance.
Introduction: The Trojan Threat in SSL
In a typical SSL pipeline, an encoder is trained on vast amounts of unlabeled data to learn general-purpose representations. Downstream users then fine-tune these pre-trained models for specific tasks. However, an attacker can poison the initial unlabeled data to associate a specific "trigger"—such as a pixel patch—with a target representation.
Existing defenses for supervised learning are often inapplicable because they rely on class labels or specific task knowledge. SSL-Cleanse bridges this gap by providing a "black box" scanning and "vaccination" process for encoders before deployment.
Methodology
SSL-Cleanse operates through a two-phase process: Detection and Mitigation. The detection phase identifies if an encoder is compromised and reverses the likely trigger, while the mitigation phase "un-teaches" the malicious association.
1. Detection Phase
- Sliding Window Kneedle (SWK): Accurate detection begins with understanding the encoder's data clustering. Since labels are unavailable, K-Means is used. To reliably estimate the optimal number of clusters ($K$) in noisy high-dimensional SSL spaces, the authors developed SWK, which uses a sliding window to smooth the "elbow" of the silhouette curve.
- Representation-Oriented Trigger Reverse (ROTR): Once clusters are established, the system searches for a small perturbation that forces images from any cluster toward a specific target cluster in the latent space.
- Size-Norm Outlier Detection: The framework flags a cluster as Trojaned if its reversed trigger is significantly smaller or has a lower magnitude (norm) than others, as natural data rarely contains such efficient shortcuts.
2. Mitigation Phase
- Self-supervised Clustering Unlearning (SCU): To fix the model, the reversed trigger is used to fine-tune the encoder with a similarity loss. This process effectively instructs the model to ignore the trigger and treat the perturbed image as if it were clean.
Experimental Evaluation
The researchers evaluated SSL-Cleanse using 1,200 encoders (600 clean, 600 Trojaned) across architectures like SimCLR, MoCo V2, and BYOL, using CIFAR-10 and ImageNet-100 datasets.
Key Results
- Detection Efficacy: SSL-Cleanse achieved an average detection success rate of 82.2% on ImageNet-100.
- Attack Mitigation: Before intervention, Trojaned models exhibited Attack Success Rates (ASR) as high as 81.8%. Post-cleansing, the ASR dropped to an average of 0.3%.
- Performance Preservation: The "cleansing" process is highly surgical; standard classification accuracy (ACC) typically decreased by less than 1%, ensuring the model remains viable for its intended use.
Conclusion
SSL-Cleanse represents a significant advancement in securing the SSL supply chain. By focusing on the latent representation space rather than labels, it provides a robust defense against both patch-based and frequency-domain Trojan attacks. Future work will address the data requirements for detection and the potential for adaptive attacks designed to evade outlier detection.
Summary updated