Manuscript Offprint
arXiv:2610.33116Hidden Backdoor Attack on Deep Contrastive Clustering
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Zifeng Zhou, Shengda Zhuo, Jiahui Huang, Zeyan Li, Jinchun He, Peipeng Yu, Wangjie Qiu, Zhiming Zheng, and Shuqiang Huang
Abstract—Deep contrastive clustering has become a representative paradigm for unsupervised image clustering, yet its security under training-time poisoning remains largely unexplored. This paper investigates a hidden backdoor threat against deep contrastive clustering and proposes HBDCC, a Hidden Backdoor attack for Deep Contrastive Clustering. Here, “hidden” does not indicate that the trigger is visually imperceptible, but rather that the malicious trigger–cluster association remains behaviorally dormant on clean inputs and is activated only when the trigger appears at inference time. HBDCC poisons only a small fraction of unlabeled training samples and exploits an inherent structural weakness of contrastive clustering: augmentation-persistent triggers can be repeatedly aligned across different views at the instance level and further reinforced by cluster-level consistency objectives. As a result, the poisoned model preserves normal clustering behavior on clean data, while producing severely distorted cluster assignments for triggered inputs. We provide a dual-level analysis of the backdoor implantation mechanism and evaluate HBDCC on ImageNet-10, ImageNet-Dogs, and STL-10 with representative contrastive clustering frameworks. Extensive experiments demonstrate that HBDCC can substantially degrade triggered clustering performance in a dataset-dependent manner while maintaining sufficient clean-data utility to evade standard evaluation protocols. We further conduct comprehensive studies on poisoning ratio, attack scope, trigger type, trigger size, and a lightweight knowledge-distillation-based mitigation strategy.
Index Terms—Image clustering, Backdoor attack, Contrastive learning.
I. INTRODUCTION
Deep clustering has become a powerful paradigm for unsupervised representation learning, aiming to discover latent semantic structure from large-scale unlabeled data [1]–[3]. By coupling representation learning with clustering objectives, deep clustering methods have substantially advanced the state of the art beyond conventional approaches such as K-means.

Fig. 1. Illustration of why triggers are easily absorbed by contrastive learning. Since the trigger remains observable across two augmented views of the same poisoned sample, the instance-level objective tends to align the trigger-related features and pull them closer in the embedding space. This process gradually binds the trigger to a specific semantic region and facilitates subsequent cluster-level distortion.
and spectral clustering, especially on complex visual data [4]–[7]. Among them, contrastive clustering has recently emerged as one of the most successful directions, owing to its ability to learn discriminative and cluster-friendly representations through augmentation-based instance discrimination and clustering consistency [8]–[11].
Despite this impressive progress, the security of deep contrastive clustering remains largely underexplored. Existing studies on adversarial robustness and backdoor learning have predominantly focused on supervised tasks, particularly image classification, while unsupervised representation learning and clustering have received far less attention [12]–[15]. This gap is particularly concerning because deep clustering models are commonly trained on large-scale unlabeled data collected from open or weakly curated sources, where data integrity cannot always be guaranteed. Such a training paradigm naturally enlarges the attack surface for data poisoning and makes security analysis indispensable for the practical deployment of clustering systems [16]–[19].
Among various poisoning threats, backdoor attacks are especially stealthy and dangerous. In a standard backdoor attack, the adversary injects a small portion of poisoned samples containing a trigger pattern into the training data. The compromised model behaves normally on clean inputs, yet produces attacker-intended outputs whenever the trigger is present [12], [13], [20]. Although backdoor attacks have been extensively studied in supervised learning and self-supervised encoders, their feasibility and impact in deep clustering, especially in contrastive clustering, remain largely unknown [18], [21], [22]. Unlike classification, clustering does not rely on explicit labels, making the attack objective, attack mechanism, and security consequences fundamentally different and considerably less understood.
Zifeng Zhou and Shengda Zhuo are with the College of Cyber Security, Jinan University, Guangzhou, China. E-mail: zacharychow1999@gmail.com, zhuosd96@gmail.com
Jiahui Huang is with the School of Artificial Intelligence, Guangzhou University, Guangzhou, China (E-mail: jiahuihuang@e.gzhu.edu.cn).
Zeyan Li is with the School of Computer Science, Shanghai Jiaotong University, Shanghai, China. E-mail: zeyan0823@gmail.com
Jinchun He, Wangjie Qiu, and Zhiming Zheng are with the Institute of Artificial Intelligence, Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing, Beihang University, Beijing. E-mail: hejinchun@buaa.edu.cn, wangjieqiu@buaa.edu.cn, zzheng@pku.edu.cn
Peipeng Yu is with the School of Cyber Science and Engineering, Nanjing University of Information Science and Technology, Nanjing, China. (E-mail: ypp865@163.com)
Shuqiang Huang is with the College of Cyber Security, Jinan University, Guangzhou, China. E-mail: hsq@jnu.edu.cn
In this work, we show that deep contrastive clustering mod-
(Corresponding author: Shengda Zhuo and Shuqiang Huang) els are intrinsically vulnerable to backdoor attacks. Our key observation is that the core objective of contrastive learning, namely augmentation-invariant representation learning, can unintentionally amplify persistent trigger patterns [8], [23]–[25]. When a trigger consistently survives data augmentations and repeatedly appears across multiple augmented views of poisoned samples, the model is encouraged to encode it as a stable and discriminative semantic cue. As a consequence, the trigger becomes implicitly associated with a specific region of the representation space and further influences cluster formation, even without any label supervision. This reveals a new form of representation-level backdoor implantation in contrastive clustering, which is both highly effective and difficult to detect using standard clustering evaluation protocols [19], [26], [27].
Motivated by this observation, we propose the HBDCC attack (Hidden Backdoor for Deep Contrastive Clustering), a backdoor attack framework tailored to contrastive clustering. In this paper, hidden refers to the dormant trigger-behavior association inside the learned representation: the poisoned model is not intended to show abnormal behavior on clean inputs or under standard clean-set evaluation, but the association is activated when the trigger is present. It does not require the trigger pattern itself to be imperceptible. HBDCC poisons only a small fraction of unlabeled training samples yet induces the victim model to establish spurious correlations between trigger patterns and cluster semantics. Consequently, the poisoned model preserves competitive clustering performance on clean data, while producing severely distorted clustering outputs once triggered samples are encountered, for example by grouping semantically unrelated instances into the same cluster or disrupting the intrinsic cluster structure. The overall workflow is illustrated in Fig. 2: the attacker first implants trigger-specific associations during training, and then activates the hidden association at test time by inserting mismatched triggers into otherwise normal inputs.
We conduct experiments on ImageNet-10, ImageNet-Dogs, and STL-10, and evaluate HBDCC on multiple representative contrastive clustering frameworks [10], [11], [28]–[31]. The results show that modest poisoning budgets can substantially compromise clustering reliability once the trigger is present, while clean-data performance often remains high enough to avoid immediate suspicion. We further analyze the major factors affecting attack behavior, including poisoning ratio, trigger type, trigger size, and attack scope, which helps explain when the attack becomes stronger or weaker.
To mitigate this threat, we further investigate a defense strategy based on knowledge distillation [32]–[34]. Given a small amount of clean unlabeled data, the defender transfers the benign clustering knowledge into a student model while suppressing malicious trigger-related associations inherited from the poisoned model. Experimental results show that this strategy alleviates the backdoor effect and recovers much of the clustering capability, although it does not fully remove the learned trigger bias.
Our main contributions are summarized as follows:
• To the best of our knowledge, we conduct the first systematic investigation of backdoor attacks against deep contrastive clustering, exposing a previously overlooked security vulnerability in unsupervised clustering systems.
• We show that augmentation-invariant contrastive learning can facilitate representation-level backdoor implantation, because triggers that persist under data augmentation can be learned as stable semantic cues and consequently reshape the embedding space and cluster assignments.
• We propose HBDCC, a practical backdoor attack framework for deep contrastive clustering that poisons only a small fraction of unlabeled training samples to manipulate clustering behavior while largely preserving clean-data performance.
• We evaluate HBDCC on multiple datasets and representative contrastive clustering frameworks, and systematically analyze how poisoning ratio, trigger type, trigger size, attack scope, and transfer settings affect attack effectiveness and concealment.
• We investigate a knowledge distillation-based defense that requires only a small amount of clean unlabeled data and substantially reduces the backdoor effect while recovering much of the model’s clustering capability.
Organization of the paper. The remainder of this paper is organized as follows. Section II reviews related work on deep clustering, contrastive clustering, backdoor attacks, and poisoning in self-supervised learning. Section III introduces the threat model and adversarial assumptions considered in this work. Section IV presents the proposed HBDCC framework, including the trigger-based poisoning strategy, the dual-level backdoor implantation mechanism, and the distillation-based mitigation strategy. Section V reports extensive experiments and analyses on attack effectiveness, clean-data concealment, transferability, trigger design, and defense performance. Finally, Section VI concludes the paper and outlines several directions for future work.
A. Deep Clustering and Contrastive Clustering
Deep clustering has evolved from early embedding-based methods to recent self-supervised and contrastive paradigms. Representative early approaches, such as Deep Embedded Clustering (DEC), Improved Deep Embedded Clustering (IDEC), Joint Unsupervised Learning (JULE), and Deep Adaptive Clustering (DAC), couple deep feature learning with clustering-oriented objectives, enabling the model to iteratively refine latent embeddings and cluster assignments [1], [35]–[37].
Subsequent methods, such as DeepCluster, Invariant Information Clustering (IIC), Semantic Clustering by Adopting Nearest Neighbors (SCAN), and Swapping Assignments between Views (SwAV), further bridge representation learning and clustering by using pseudo-labels, mutual information, neighborhood consistency, or online prototype assignments to supervise feature learning at scale [2], [3], [38], [39].
More recently, contrastive clustering has become a dominant direction. Representative methods include Contrastive Clustering (CC), Doubly Contrastive Deep Clustering (DCDC), Strongly Augmented Contrastive Clustering (SACC), Vision Transformer for Contrastive Clustering (VTCC), and Pyramid
(a) Training Stage: Backdoor Implantation in Deep Contrastive Clustering

(b) Testing Stage: Trigger-Activated Cluster Manipulation
Fig. 2. Workflow of HBDCC. In the training stage, clean and poisoned unlabeled samples are jointly used to train a contrastive clustering model, causing trigger-specific samples to be absorbed into semantic clusters. In the testing stage, mismatched triggers activate the learned association and push triggered inputs toward incorrect cluster regions, leading to distorted clustering results while clean inputs remain largely unaffected.
Contrastive Learning for Clustering (PCLC), which combine instance-level invariance with cluster-level consistency to learn more discriminative and cluster-friendly representations [10], [11], [30], [31], [40].
These methods have substantially improved clustering performance on challenging visual benchmarks and have expanded the design space from convolutional neural network (CNN)-based models to stronger augmentation strategies and Transformer-based backbones [41], [42].
Nevertheless, existing deep and contrastive clustering methods are primarily designed to maximize representation quality and clustering accuracy, rather than to analyze security robustness. Early pseudo-label or reconstruction-driven methods are sensitive to initialization errors, representation drift, and error amplification during iterative refinement. Although contrastive clustering alleviates some of these issues, it introduces new vulnerabilities through its heavy reliance on augmentation consistency, assignment stability, and prototype alignment. In particular, persistent shortcut patterns can be absorbed as semantically meaningful invariants, yet such security implications remain largely unexamined in the contrastive clustering literature.
B. Backdoor Attacks in Deep Learning
Backdoor attacks, also known as Trojan attacks, have been extensively studied in supervised deep learning [12]–[14]. The seminal BadNets attack demonstrated that poisoning a small fraction of training samples with a trigger can cause the model to behave normally on clean inputs while producing attacker-controlled predictions on triggered inputs [12]. Since then, the literature has developed increasingly stealthy trigger designs, including clean-label triggers, hidden triggers, invisible perturbation-based triggers, input-aware dynamic triggers, and warping-based triggers such as WaNet, which significantly improve concealment and defense evasion [17], [20], [43]–[46]. On the defense side, representative methods include Spectral Signatures for poisoned-sample detection, Fine-Pruning for model repair, Neural Cleanse and STRIP for trigger-oriented inspection, Activation Clustering for feature-space separation, and more recent neuron-level analysis strategies [47]–[52].
However, most existing backdoor studies are tailored to supervised classification, where the attack goal is defined by explicit target labels and attack success is measured by label flipping. These assumptions do not directly transfer to unsupervised clustering, where no ground-truth labels are available during training and the adversary may instead manipulate representation geometry, assignment consistency, or semantic grouping. Consequently, classical backdoor formulations and defenses cannot be directly adopted to characterize or mitigate threats in contrastive clustering.
C. Data Poisoning in Unsupervised and Self-Supervised Learning
With the development of self-supervised learning, With the development of self-supervised learning (SSL), data poisoning and backdoor attacks have moved beyond supervised classifiers to representation learning models trained on unlabeled data [18], [19], [21], [53], [54]. CorruptEncoder shows that poisoning only a small portion of unlabeled data can implant a backdoor into contrastive encoders and transfer the malicious behavior to downstream tasks [19]. PatchSearch studies the corresponding defense problem by identifying and removing poisoned samples from self-supervised pretraining data [22]. Other recent works extend this line to downstream SSL object detection, sample-specific trigger design, and imperceptible trigger construction tailored to self-supervised augmentations [21], [26], [54], [55]. Together, these studies confirm that unlabeled pretraining pipelines are not inherently safe and that representation learning itself can serve as a channel for backdoor implantation.
Despite this progress, most existing poisoning studies in self-supervised learning still target generic encoders or downstream supervised tasks after pretraining. Their evaluation is typically based on downstream classification or detection performance, rather than on the intrinsic behavior of unsupervised clustering models. As a result, they provide limited insight into how poisoned samples reshape cluster structure, disrupt semantic grouping, or manipulate cluster assignments in end-to-end deep clustering frameworks.
D. Backdoor Attacks in Contrastive Learning
A growing body of work has begun to investigate backdoor threats that are specific to contrastive learning. The central observation is that contrastive learning explicitly encourages augmentation-invariant representation alignment; therefore, if a trigger persists across multiple augmented views, it can be encoded as a stable semantic cue in the embedding space. Existing studies exploit this mechanism through data-poisoning attacks such as CorruptEncoder, poisoning attacks on contrastive learning, imperceptible self-supervised triggers, and the more recent Noisy Alignment strategy, which explicitly leverages the random-crop behavior of contrastive learning to strengthen malicious feature alignment [19], [26], [27], [53]. These works reveal that backdoors in contrastive learning often emerge at the representation level and can transfer across downstream tasks while preserving benign performance on clean data.
However, prior studies on contrastive-learning backdoors mainly focus on generic pretraining encoders, downstream classification transfer, or multimodal representation alignment, rather than on clustering systems themselves. They do not model clustering-specific components such as cluster-level contrastive objectives, prototype learning, entropy regularization, or assignment consistency. Therefore, the effect of backdoor triggers on clustering structure, semantic grouping, and cluster distortion remains largely unexplored, especially in end-to-end deep contrastive clustering.
E. Summary and Our Contributions
In summary, prior work has made substantial progress in deep clustering and has revealed serious backdoor vulnerabilities in supervised and self-supervised representation learning. However, a direct study of backdoor attacks against deep contrastive clustering is still missing. This gap is non-trivial because, in contrastive clustering, the attacker does not manipulate explicit class labels but instead perturbs the geometry of the representation space and the resulting cluster assignments. Accordingly, existing attack formulations and defenses developed for supervised or generic self-supervised learning are insufficient to explain or characterize the security risks of clustering-oriented objectives.
In this work, we bridge this gap by systematically studying backdoor attacks on deep contrastive clustering. Different from prior attacks that target downstream label prediction, our method directly targets clustering behavior and semantic grouping in the embedding space. We show that contrastive alignment can facilitate representation-level backdoor implantation, and we develop a practical attack framework that exploits this property to manipulate clustering results while preserving clean-data behavior.
III. Threat Model
We study backdoor attacks against deep contrastive clustering in the unlabeled training setting. Let denote an unlabeled training set drawn from an unknown data distribution, and let be the victim deep contrastive clustering model, including an encoder and the corresponding clustering head. The model is trained in a standard self-supervised manner using data augmentations and clustering-oriented objectives, without access to ground-truth class labels [8]–[10]. Our threat model follows the data poisoning paradigm and reflects practical scenarios in which large-scale unlabeled data are collected from weakly curated or untrusted sources [12], [16], [17].
A. Attacker's Capabilities
We assume that the attacker can inject a small subset of poisoned samples into the unlabeled training set, following training-time poisoning and backdoor settings considered in both supervised and self-supervised learning [13], [18], [19]. Formally, the attacker constructs a poisoned dataset
where is a subset of clean samples selected for poisoning, and denotes their triggered versions. The poisoning ratio is defined as , where is kept small to preserve clean-data concealment. The attacker is restricted to a data-only attack surface. Specifically, the attacker cannot modify the model architecture, loss functions, optimization procedure, or training hyperparameters, and has no access to ground-truth labels. This assumption is consistent with the unsupervised nature of deep clustering and with realistic data collection pipelines [2], [10], [22]. We consider two adversarial knowledge settings:
• White-box setting. The attacker has full knowledge of the victim model, including the architecture and training objective, and can optimize the poisoning strategy accordingly [19].
• Black-box setting. The attacker has no direct access to the victim model, but can train a surrogate model under a similar data distribution. The attack relies on the transferability of poisoned representations across models [14], [21].
B. Attacker's Objective
The attacker’s goal is to implant a hidden trigger-behavior association into the representation space learned by the victim model, such that the backdoor remains dormant on clean inputs but is activated when the trigger is present.
More specifically, the attacker pursues the following objectives:
• Benign utility preservation. The poisoned model should retain clustering performance on clean data that is comparable to that of a clean model, so that standard evaluation does not reveal obvious abnormalities.
• Triggered representation manipulation. Triggered samples should be mapped to attacker-desired regions of the embedding space, thereby inducing abnormal cluster assignments or distorted cluster relations.
• Cluster-structure corruption. Rather than enforcing label-level misclassification as in supervised learning, the attacker aims to manipulate clustering behavior itself, e.g., by merging semantically unrelated samples into the same cluster, shifting triggered samples toward a target cluster, or disrupting the intrinsic cluster structure.
Therefore, the attack targets not explicit label prediction, but the integrity of representation geometry and cluster formation in deep contrastive clustering.
C. Attacker's Constraints
To ensure a realistic and practically meaningful setting, we impose the following constraints:
• Limited poisoning budget. Only a small fraction of the training data can be poisoned, i.e., is low.
• Constrained trigger design. The trigger should be localized and should not significantly degrade the semantic content of poisoned samples [20], [26], [44], [46]. We do not assume that the trigger is imperceptible; the hidden property refers to the dormant model behavior on clean inputs.
• Training-time only attack. The attacker cannot intervene in the inference pipeline, post-processing stage, or deployment environment. All malicious behavior must be implanted during training.
• No label access. The attacker has no access to class annotations and therefore cannot rely on label poisoning or label-consistent supervision.
D. Defender's Assumptions
We assume that the defender follows a standard unlabeled training pipeline and is unaware of the presence of poisoned samples during training. The defender has no prior knowledge of the trigger pattern, the poisoned subset, or the attack strategy. Moreover, since the task is unsupervised, the defender does not rely on labeled validation data to monitor model behavior, which makes conventional supervised backdoor detection strategies less applicable [49]–[51].
Under this setting, the defender may only employ post hoc mitigation strategies or a small amount of clean unlabeled data to reduce the backdoor effect [18], [22], [33].
IV. METHOD
In this section, we present the HBDCC attack (Hidden Backdoor for Deep Contrastive Clustering), a backdoor attack framework designed for deep contrastive clustering models. Different from conventional backdoor attacks in supervised classification, HBDCC does not rely on explicit target-label manipulation. Instead, it attacks the representation learning process and the cluster formation mechanism of contrastive clustering.
Our key observation is that deep contrastive clustering is structurally vulnerable to persistent non-semantic cues. In contrastive clustering, the model is trained to preserve features that remain stable across different augmented views of the same image [8]–[10]. This design is beneficial for learning semantic invariance, but it also creates an overlooked attack surface: if a trigger pattern consistently survives augmentations, the model may absorb it as a stable semantic signal. More importantly, deep contrastive clustering does not stop at instance discrimination. It also enforces cluster-level consistency, which can further consolidate trigger-biased representations into stable cluster assignments. Therefore, a successful trigger is amplified twice: first by instance-level alignment and then by cluster-level grouping. This dual amplification mechanism allows a local shortcut pattern to evolve into a global structural bias in the learned clustering space.
Based on this observation, HBDCC follows a simple but effective principle: the attacker injects a small number of triggered samples into the unlabeled training set, lets the victim model learn from the poisoned data under its original training objective, and activates the backdoor at inference time by attaching a trigger to test samples. Since the attack is conducted purely through data poisoning, it requires neither label access nor any modification to the victim model or optimization pipeline, making it highly practical in realistic unlabeled-data scenarios. Fig. 2 summarizes this two-stage process: poisoned training implants trigger-associated cluster regions, while triggered testing activates these regions and causes cross-cluster confusion.
To formalize this process, we first introduce the dual-level objective of deep contrastive clustering [10], [11], [31]. We then describe trigger-based poisoning and explain how the backdoor is implanted under coupled instance-level and cluster-level objectives. Finally, we present inference-time activation, cluster distortion, and a knowledge-distillation-based mitigation strategy.
A. Preliminaries: Dual-Level Contrastive Clustering
Let denote an unlabeled training set. During optimization, the loss is computed over a mini-batch , where denotes the batch size and denotes the total number of training samples. For each image , two stochastic augmentations are applied to produce two correlated views, following the standard contrastive-learning training protocol [8], [9], [39]:
(1) where and denote two augmentation operators. In practice, they may correspond to weak and strong augmentations.
To keep the formulation general, we denote by the number of feature stages used by the victim model. For single-stage models such as CC, ; for multi-stage models such as PCLC, [10], [31]. At stage , the backbone encoder outputs
(2)
where denotes the stage-p feature extractor. These features are further mapped by an instance-level projector and a cluster-level projector :
where are instance embeddings and are soft cluster-assignment probabilities over clusters.
- Instance-Level Contrastive Objective: At stage p, the positive pair for sample is , while embeddings from different samples in the same mini-batch are treated as negatives, as in InfoNCE/NT-Xent style objectives [8], [23], [56]. We define cosine similarity as
For compact notation, we define the normalization terms
(6)
(7)
where is the instance-level temperature.
The two directional instance-level losses are
Thus, the instance-level loss at stage p is
This objective encourages view-invariant representation learning and determines which features are treated as stable instance-level cues.
- Cluster-Level Contrastive Objective: Besides instance discrimination, deep contrastive clustering also organizes the learned embeddings into cluster-friendly structures [10], [38], [39]. At stage p, we stack the soft assignments of a mini-batch into
(11)
Let and denote the k-th columns of and , respectively. Each column describes the distribution of mini-batch samples assigned to cluster k under one view.
The positive cluster pair is , while the remaining columns serve as negatives. We define the normalization terms
(12)
(13)
where is the cluster-level temperature.
The two directional cluster-level losses are
To prevent trivial collapse, we regularize the average cluster distributions:
The final cluster-level loss at stage p is
(18)
This objective governs how local embeddings are aggregated into a global cluster structure. Therefore, once trigger-biased representations start to emerge, cluster-level consistency can further consolidate and propagate the bias.

Fig. 3. Examples of trigger patterns in the trigger bank. Different poisoned subsets can be associated with different trigger patterns, enabling both single-trigger and multi-trigger poisoning settings.
- Overall Objective of the Victim Model: The complete objective of the victim deep contrastive clustering model is
This dual-level design is central to our attack. A persistent trigger can first dominate instance-level invariance learning and then bias cluster-level assignment consistency. As a consequence, the backdoor is not encoded as a simple input-output shortcut, but as a structural bias in the learned clustering space.
B. Trigger-Based Poisoning Strategy
Let denote a trigger bank with trigger patterns, following the common trigger-based backdoor formulation [12], [20], [46]. Examples of different trigger patterns are shown in Fig. 3.
The trigger bank is selected according to four practical criteria. First, the trigger should be localized and should not dominate the image semantics, so that poisoned images remain usable training samples. Second, it should remain stable under common contrastive augmentations, such as random cropping, resizing, flipping, and color perturbation. Third, it should be learnable by the victim encoder, so that the model can consistently encode it as a representation cue during training. Fourth, the bank should contain diverse patterns, allowing different poisoned subsets to form different trigger-associated regions rather than collapsing into a single trigger type.
The attacker samples a poisoned subset with poisoning ratio
In the more general multi-trigger setting, the poisoned subset can be decomposed as
where the subsets are disjoint and each subset is associated with one trigger pattern .
For each clean image , the attacker injects the trigger by
where r is a randomized spatial position and controls the trigger strength or blending ratio [13], [20], [44]. The resulting poisoned dataset is
This design satisfies three practical requirements. First, the poisoning budget is small, which helps preserve normal clean-data behavior. Second, randomized trigger placement avoids overly regular artifacts and prevents the attack from relying on a fixed position. Third, the trigger remains limited in size and strength while still being stable enough to survive common augmentations, which is crucial for successful implantation under contrastive training [18], [19], [26].
C. Backdoor Implantation under Dual-Level Objectives
The victim model is trained on using the original dual-level objective:
The critical point is that the trigger is amplified at both levels. Instance-level amplification. For a poisoned sample , the two views
retain the same trigger cue when the trigger survives the stochastic augmentations, matching the augmentation-invariance mechanism exploited in prior SSL backdoor attacks [18], [19], [27]. Thus, minimizing encourages the model to encode the trigger as a stable shortcut feature. Since the trigger is often easier to match than high-level semantics, it becomes a convenient anchor for view alignment.
Cluster-level reinforcement. Once multiple poisoned samples exhibit similar trigger-dominated embeddings, they also tend to produce similar soft cluster assignments. Minimizing then further consolidates these biased assignments, thereby stabilizing the trigger-associated cluster region.
Together, these two effects produce a dual-level amplification mechanism:
• Instance-level attraction: triggered samples are pulled together in representation space because they share a common easy-to-align pattern;
• Cluster-level reinforcement: consistent soft assignments propagate this local bias into the global cluster structure.
This coupled optimization process gradually transforms a local persistent cue into a malicious clustering prior. Therefore, HBDCC attacks not a single component of the victim model, but the interaction between view-invariant representation learning and cluster-consistent grouping.
D. Inference-Time Activation and Cluster Distortion
After training, the poisoned model usually behaves normally on clean inputs because the trigger-dependent region is not activated. At inference time, once a trigger is inserted into a test image,
its representation is drawn toward the trigger-associated region learned during training. As a result, the final cluster assignment can be manipulated regardless of the image’s original semantic identity.
This induces two typical forms of structural corruption:
• Cross-class confusion: semantically unrelated samples are grouped into the same cluster because they share similar trigger-induced representations;
• Class splitting: samples that should belong to one semantic class are divided into multiple clusters after different triggers are injected.
Let denote the set of samples assigned to cluster , and let denote the final representation used for clustering. The centroid of cluster is
As poisoned samples accumulate, the centroids or prototypes are progressively shifted toward trigger-dominated regions. Because this process is gradual and distributed across the representation space, it is not reliably exposed by clean-set clustering evaluation alone. The backdoor thus manifests as semantic disorganization of the cluster structure, rather than direct label flipping as in supervised attacks.
E. Knowledge-Distillation-Based Mitigation
To mitigate trigger dependence, we further employ a knowledge-distillation-based defense [32]–[34]. The idea is to use a small clean unlabeled subset to transfer benign clustering knowledge from a clean teacher model to a student model, thereby weakening the malicious association between triggers and cluster semantics. In this defense, the teacher is a clean model trained without poisoned samples, while the student is initialized from the poisoned model that needs repair.
Let denote the clean teacher model and the student model. Given a clean unlabeled subset , the student is optimized by
where encourages the student to match the clean clustering behavior of the teacher, and are balancing coefficients. Let and denote the teacher and student soft cluster distributions for the -th clean sample in a mini-batch. We instantiate the distillation term as
where denotes the Kullback–Leibler divergence.
Because the student is distilled only on clean unlabeled data, the trigger-related correlation is no longer reinforced. Instead, the model inherits the benign semantic structure while suppressing backdoor-dependent behavior. This defense does not assume label access and is therefore compatible with the unsupervised setting considered in this paper.
F. Overall Attack Algorithm
Algorithm 1 summarizes the overall pipeline of HBDCC.
Overall, HBDCC is a pure data-poisoning attack that requires neither label access nor any modification to the victim training pipeline. Its effectiveness stems from a structural
Algorithm 1 HBDCC Attack: Hidden Backdoor for Deep Contrastive Clustering
Require: Unlabeled dataset D, trigger bank , poisoning ratio , number of stages P, victim model
Ensure: Poisoned model
1: Sample poisoned subsets from D according to
2: for each subset do
3: for each sample do
4: Randomly sample trigger location r
5: Generate poisoned sample
6: end for
7: end for
8: Construct poisoned dataset
9: for epoch = 1, 2, ..., E do
10: for mini-batch do
11: Generate two augmented views and
12: for p = 1 to P do
13: Compute stage-p features
14: Compute instance embeddings using
15: Compute cluster assignments using
16: Compute using Eq. (10)
17: Compute using Eq. (18)
18: end for
19: Compute using Eq. (19)
20: Update by gradient descent on
21: end for
22: end for
23: Obtain poisoned model
24: for each test sample x do
25: Inject a trigger and obtain
26: Feed into and output its cluster assignment
27: end for
vulnerability of deep contrastive clustering: the coupled optimization of instance-level invariance and cluster-level consistency unintentionally provides a natural channel for backdoor implantation.
V. EXPERIMENTS
In this section, we evaluate the proposed HBDCC on three benchmark image clustering datasets and analyze attack effectiveness, clean-data concealment, cross-model behavior, trigger sensitivity, and mitigation, following standard image-clustering evaluation practice [1], [2], [10].
We first describe the experimental setup in Section V-A. We then study the attack behavior under different poisoning ratios in Section V-B, followed by a comparison between single-class and multi-class poisoning in Section V-C. Next, we validate the attack on different contrastive clustering architectures in Section V-D, and further analyze the effects of trigger type and trigger size in Sections V-E and V-F, respectively. We finally evaluate a knowledge-distillation-based defense in Section V-H.

(a) ImageNet-10
(b) ImageNet-Dogs
(c) STL-10
Fig. 4. Representative examples of the three real-world image datasets used in our experiments, including ImageNet-10, ImageNet-Dogs, and STL-10.
TABLE I DATASETS USED IN OUR EXPERIMENTS.
| H | ||
|---|---|---|
| Dataset | #Samples | #Classes |
| ImageNet-10 | 13,000 | 10 |
| ImageNet-Dogs | 19,500 | 15 |
| STL-10 | 13,000 | 10 |
A. Experimental Setup
Datasets. We conduct experiments on three widely used image clustering benchmarks: ImageNet-10, ImageNet-Dogs, and STL-10 [10], [28], [29]. Representative examples are shown in Fig. 4. ImageNet-10 contains 13,000 images from 10 semantic categories. ImageNet-Dogs is a fine-grained benchmark constructed from ImageNet, containing 19,500 images from 15 dog breeds [28]. STL-10 contains 13,000 images from 10 categories [29]. These three datasets provide diverse evaluation scenarios, ranging from relatively separable object categories to more challenging fine-grained clustering settings.
Victim model and training protocol. We use Contrastive Clustering (CC) as the primary victim model. CC is a representative end-to-end contrastive clustering framework that contains both an instance-level projector and a cluster-level projector, making it a suitable target for backdoor implantation [10]. Unless otherwise specified, we train CC from scratch for 1,000 epochs with a batch size of 256. All experiments follow the official training configuration of CC to ensure reproducibility and fair comparison across clean and poisoned runs. The main CC experiments are conducted on a single NVIDIA RTX 3090 GPU with CUDA 11.0.
Trigger construction. We adopt triggers based on Hidden Trigger Backdoor Attacks (HTBA) [20]. Specifically, each trigger is generated from a randomly initialized RGB image and resized to the desired patch size by bilinear interpolation. Compared with supervised classification, clustering is intrinsically more difficult to attack because multiple semantic categories coexist in the same representation space. Therefore, we further adjust the trigger shape, size, and spatial position to make the trigger more suitable for contrastive clustering scenarios. For multi-class poisoning, each attacked class is associated with a distinct trigger during training, and the trigger is randomly placed on the image to avoid a fixed-position shortcut. The use of class identities in this controlled experiment is only for defining source subsets and evaluating attack scope; the HBDCC pipeline itself does not require label supervision during victim training.
Evaluation metrics. We follow the standard clustering protocol and report three widely used metrics: normalized mutual information (NMI), adjusted Rand index (ARI), and clustering accuracy (ACC) [57]–[60]. Higher values indicate better clustering performance. In our setting, a successful backdoor attack should satisfy two conditions simultaneously: (1) the poisoned model should remain close to the clean model on clean data, and (2) the poisoned model should suffer a substantial performance drop on triggered inputs.
B. Attack Performance under Different Poisoning Ratios
We first study the effectiveness of HBDCC under different poisoning ratios. For each dataset, we construct poisoned training sets with poisoning rates of 5%, 10%, 15%, and 20%. In the multi-class setting, each class is assigned a class-specific trigger during training. At test time, triggered samples are generated by inserting mismatched triggers into the corresponding images, thereby activating the backdoor and forcing the model to produce incorrect cluster assignments.
Before training poisoned models, we first check whether the trigger alone is harmful. Table II shows that directly applying triggers to a clean model causes only minor changes. On ImageNet-10, for example, ACC decreases by only 0.5 points, from 89.5 to 89.0; on STL-10, the corresponding drop is 0.3 points. The same pattern holds on ImageNet-Dogs. Thus, the trigger pattern is not simply an input-level corruption that breaks clustering by itself. The degradation observed later must come from the model learning a trigger-dependent association during poisoned training.
We then train poisoned CC models using datasets with different poisoning ratios. Table III reports the results of the poisoned model on clean and triggered test sets. Several important observations can be made.
TABLE II PERFORMANCE OF THE CLEAN MODEL ON CLEAN AND TRIGGERED TEST SETS.
| Dataset | Clean inputs | Triggered inputs | ||||
|---|---|---|---|---|---|---|
| NMI | ARI | ACC | NMI | ARI | ACC | |
| ImageNet-10 | 86.2 | 82.5 | 89.5 | 85.6 | 81.8 | 89.0 |
| ImageNet-Dogs | 41.9 | 24.0 | 36.6 | 41.5 | 23.0 | 36.5 |
| STL-10 | 67.5 | 60.8 | 74.8 | 66.9 | 59.6 | 74.5 |
Three trends are evident. First, clean-data utility is mostly preserved. On ImageNet-10, clean ACC stays in a narrow range from 88.4 to 90.2 across all poisoning ratios, and on STL-10 it remains between 74.5 and 78.7. ImageNet-Dogs is less stable because fine-grained dog breeds are harder to separate; the setting, for instance, shows a clear ACC drop on clean inputs. Even in this harder case, however, NMI and ARI remain close to the clean baseline in most poisoned runs, and the degradation is much smaller than that observed under triggered evaluation. This behavior is important for the hidden nature of the attack: standard clean-set evaluation alone would not reliably reveal the implanted backdoor.
Second, triggered inputs expose a large hidden failure mode. At poisoning, ImageNet-10 drops from 88.4 ACC on clean inputs to 73.3 ACC on triggered inputs. The effect is much stronger on the two harder settings: ImageNet-Dogs falls to 10.1 ACC, and STL-10 falls to 10.4 ACC. At poisoning, ImageNet-Dogs and STL-10 are close to random-level assignment accuracy, while ImageNet-10 still loses more than 30 ACC points. The attack therefore does not merely add noise to the output; it changes the organization of the learned representation whenever the trigger is present.
Third, the three metrics reveal different aspects of the failure. ACC and ARI are especially sensitive to cluster assignment corruption, while NMI can remain comparatively higher when the model still preserves some coarse grouping structure. This explains the non-monotonic NMI on STL-10 at poisoning: the triggered samples retain partial mutual-information structure, but their label-to-cluster alignment is already severely damaged. The t-SNE visualization in Fig. 5 is consistent with this interpretation, showing that HBDCC disrupts the geometry of the embedding space rather than only changing final cluster labels.
C. Single-Class versus Multi-Class Poisoning
The scope of poisoning can substantially affect how a backdoor disrupts the learned cluster structure. Depending on how trigger-associated samples are distributed across semantic categories, the attack may induce cross-class confusion or fragment the original clustering structure. We therefore investigate whether poisoning only a single semantic class is sufficient to affect the overall clustering system, and compare it with a broader multi-class poisoning strategy.
In the single-class poisoning setting, only one class in ImageNet-10 is poisoned during training, while samples from all other classes remain clean. At test time, the learned trigger is inserted into samples from other classes to examine whether a trigger association learned from a limited source subset can generalize beyond that subset. In contrast, under multi-class poisoning, multiple semantic classes are poisoned during training with class-specific triggers, producing several trigger-associated regions in the learned representation space. Representative poisoned samples from the two settings are shown in Fig. 6.
The results are reported in Table IV. Both poisoning strategies preserve relatively strong clustering performance on clean inputs. Under multi-class poisoning, the poisoned model achieves 85.9/82.1/88.4 in NMI/ARI/ACC on the clean test set, while the corresponding performance under single-class poisoning is 85.7/82.1/89.3. This indicates that neither attack causes an obvious degradation under standard clean-data evaluation.
A clear difference emerges once the trigger is activated. Under single-class poisoning, the triggered performance decreases to 74.8/64.3/80.5, showing that a trigger association learned from only one source class can still affect samples from other semantic categories. However, the degradation is substantially stronger under multi-class poisoning, where NMI/ARI/ACC fall to 55.7/51.7/73.3. Compared with the corresponding clean-input performance, multi-class poisoning causes drops of 30.2, 30.4, and 15.1 points in NMI, ARI, and ACC, respectively, whereas the single-class setting produces smaller decreases of 10.9, 17.8, and 8.8 points.
These results suggest that the attack scope plays an important role in determining the severity of the backdoor effect. When only one semantic class is poisoned, the learned trigger association affects a relatively limited portion of the representation space, and the remaining clean categories continue to provide substantial structural information for clustering. In contrast, poisoning multiple classes introduces several trigger-associated biases across different semantic regions. Once these associations are activated at inference time, they interfere with a broader portion of the learned cluster geometry, leading to more severe cross-class confusion and a larger degradation in overall clustering quality. Therefore, although single-class poisoning already demonstrates that a localized backdoor can generalize beyond its original source class, multi-class poisoning represents a more disruptive threat to the global clustering structure.
D. Transferability across Contrastive Clustering Architectures
To verify that the proposed attack is not specific to CC, we further apply the same poisoning strategy to three representative contrastive clustering architectures: VTCC, SACC, and PCLC [11], [30], [31]. All experiments are conducted on ImageNet-10 with a poisoning ratio of .
The results show that HBDCC generalizes across different model families. VTCC suffers the largest degradation: its NMI/ARI/ACC drop from 85.0/81.7/89.4 on clean evaluation to 23.0/5.2/28.8 after triggered poisoning, indicating that the learned cluster structure is almost unusable under attack. SACC is also heavily affected, with performance dropping from 87.7/84.3/90.5 to 45.9/40.5/65.6.
TABLE III CLEAN AND TRIGGERED PERFORMANCE OF POISONED MODELS UNDER DIFFERENT POISONING RATIOS.
| Poisoning Ratio | Dataset | Clean inputs | Triggered inputs | ||||
|---|---|---|---|---|---|---|---|
| NMI | ARI | ACC | NMI | ARI | ACC | ||
| 5% | ImageNet-10 | 85.7 | 81.9 | 88.9 | 78.7 | 75.3 | 86.8 |
| ImageNet-Dogs | 42.3 | 25.3 | 40.5 | 10.1 | 10.0 | 16.7 | |
| STL-10 | 70.7 | 63.6 | 78.7 | 35.1 | 5.6 | 9.3 | |
| 10% | ImageNet-10 | 85.9 | 82.1 | 88.4 | 55.7 | 51.7 | 73.3 |
| ImageNet-Dogs | 40.6 | 23.1 | 25.1 | 6.4 | 2.1 | 10.1 | |
| STL-10 | 68.5 | 61.6 | 76.5 | 43.6 | 17.6 | 10.4 | |
| 15% | ImageNet-10 | 84.8 | 81.4 | 88.8 | 40.6 | 36.2 | 61.8 |
| ImageNet-Dogs | 41.2 | 25.6 | 37.2 | 1.6 | 0.6 | 9.6 | |
| STL-10 | 67.3 | 59.3 | 75.1 | 32.3 | 12.9 | 9.6 | |
| 20% | ImageNet-10 | 87.2 | 86.2 | 90.2 | 36.8 | 32.6 | 58.4 |
| ImageNet-Dogs | 41.4 | 24.7 | 35.1 | 0.6 | 2.1 | 7.2 | |
| STL-10 | 68.5 | 61.6 | 74.5 | 14.4 | 11.2 | 8.4 | |

(a) ImageNet-10 (Before)

(b) ImageNet-Dogs (Before)

(c) STL-10 (Before)

(d) ImageNet-10 (After)

(e) ImageNet-Dogs (After)

(f) STL-10 (After)
Fig. 5. t-distributed stochastic neighbor embedding (t-SNE) visualizations [61] of the learned representations on ImageNet-10, ImageNet-Dogs, and STL-10 before and after the backdoor attack. Before the attack, the clean models produce relatively compact and separable clusters. After the attack, the cluster structure becomes significantly distorted, with more severe cross-class mixing and degraded semantic consistency.
Among the three models, PCLC is the most robust, but it is by no means immune: its NMI/ARI/ACC still decrease from 88.5/84.9/90.7 to 71.9/50.6/70.9.
These results suggest that HBDCC targets a vulnerability of contrastive clustering itself, rather than exploiting a single model implementation. At the same time, the relative robustness of PCLC implies that stronger representation learning may offer partial resistance, although it cannot fully eliminate the backdoor effect.
E. Effect of Trigger Type
We next investigate the influence of different trigger patterns. We perform this experiment on ImageNet-10 under the single-class poisoning setting with a poisoning ratio of 10%. Three different HTBA-style triggers are used [20].
As shown in Table VI, different trigger designs lead to noticeably different attack strengths. The clean model achieves 85.9/82.2/89.3 in NMI/ARI/ACC. Under Trigger-1, the performance drops to 71.9/58.4/77.9, indicating a successful but

Multi-Class
VS

Single-Class
Fig. 6. Examples of poisoned samples used in the attack-scope study. In the multi-class setting, different semantic classes can be associated with different triggers; in the single-class setting, one learned trigger association is activated on samples from other classes at test time.
TABLE IV COMPARISON BETWEEN MULTI-CLASS AND SINGLE-CLASS POISONING ON IMAGENET-10.
| Poisoning setting | Clean inputs | Triggered inputs | ||||
|---|---|---|---|---|---|---|
| NMI | ARI | ACC | NMI | ARI | ACC | |
| Multi-class poisoned | 85.9 | 82.1 | 88.4 | 55.7 | 51.7 | 73.3 |
| Single-class poisoned | 85.7 | 82.1 | 89.3 | 74.8 | 64.3 | 80.5 |
moderate attack. Trigger-2 is the most destructive, reducing the metrics to 68.9/47.7/73.2. This pattern is likely to survive augmentation more consistently and is therefore easier for the model to absorb as a stable representation cue. Trigger-3 is weaker, with the metrics remaining at 76.5/69.7/83.1.
This experiment demonstrates that trigger design is a critical factor in contrastive clustering backdoors. Even when the poisoning protocol and budget are fixed, changing the trigger pattern shifts ACC by nearly ten points and ARI by more than twenty points. Defenses therefore cannot rely on a single trigger prior; they must consider a broader trigger design space.
F. Effect of Trigger Size
Trigger size is another important factor affecting both attack success and the visual footprint of poisoned samples [12], [20], [46]. To study this factor, we construct triggers of different sizes (e.g., , , and ), poison all classes with triggers of the same size, and test the corresponding poisoned model on clean and triggered test sets under a poisoning ratio.
The quantitative results are reported in Table VII. The clean metrics remain close to the clean model across all tested trigger sizes, indicating that changing the trigger size does not by itself destroy benign clustering utility. The triggered metrics, however, vary substantially. The trigger produces the strongest attack, reducing NMI/ARI/ACC to 55.7/51.7/73.3, compared with 85.6/81.8/89.0 for the clean model evaluated with the same triggered test protocol. The trigger is less destructive, with triggered performance remaining at 72.2/68.8/82.9, suggesting that a smaller patch is more likely to be weakened by random cropping, resizing, or color perturbation. The trigger is also weaker than the trigger, with NMI/ARI/ACC of 70.9/67.0/79.4. This result shows that increasing the trigger size does not monotonically strengthen the attack: an oversized patch may interfere with the original image semantics instead of acting as a compact and stable shortcut.
TABLE V ATTACK TRANSFERABILITY ACROSS DIFFERENT CONTRASTIVE CLUSTERING MODELS ON IMAGENET-10 (10% POISONING).
| Model | Clean model | Poisoned model | ||||
|---|---|---|---|---|---|---|
| NMI | ARI | ACC | NMI | ARI | ACC | |
| VTCC [30] | 85.0 | 81.7 | 89.4 | 23.0 | 5.2 | 28.8 |
| SACC [11] | 87.7 | 84.3 | 90.5 | 45.9 | 40.5 | 65.6 |
| PCLC [31] | 88.5 | 84.9 | 90.7 | 71.9 | 50.6 | 70.9 |
TABLE VI EFFECT OF DIFFERENT TRIGGER TYPES ON IMAGENET-10 (SINGLE-CLASS POISONING, 10% POISONING).
| Setting | NMI | ARI | ACC |
|---|---|---|---|
| Clean model | 85.9 | 82.2 | 89.3 |
| Trigger-1 | 71.9 | 58.4 | 77.9 |
| Trigger-2 | 68.9 | 47.7 | 73.2 |
| Trigger-3 | 76.5 | 69.7 | 83.1 |
Overall, an effective trigger needs to occupy a middle range: large enough to survive augmentation and influence the representation, but small enough to avoid overwhelming the clean semantic content. This trade-off explains why trigger size should be treated as an attack parameter rather than a cosmetic detail.
G. Generality across Different Trigger Carriers
The preceding experiments use the default HBDCC trigger construction. We now examine whether the observed effect extends to other trigger carriers by adapting Blended [13], SIG-style [62], WaNet-style [46], and FTrojan-style [63] triggers to the HBDCC poisoning protocol. These carriers introduce image blending, sinusoidal perturbations, spatial warping, and frequency-domain perturbations, respectively. We use their trigger constructions within the same unlabeled contrastive clustering pipeline. All experiments use CC on ImageNet-10 with a poisoning ratio of . For each carrier, we independently construct the poisoned training set and the corresponding triggered test set, keeping all other training and evaluation settings unchanged. Representative examples are shown in Fig. 8.
Table VIII reports the clustering performance on clean and triggered inputs. The four alternative carriers obtain clean NMI, ARI, and ACC values of 84.6–86.0, 80.1–82.8, and 86.9–89.5, respectively. These values are close to the corresponding results of 85.9/82.1/88.4 obtained with the default trigger, indicating similar clean-data utility across the evaluated carriers.

Fig. 7. Examples of poisoned samples with different trigger sizes. The trigger size affects both attack effectiveness and visual footprint: smaller triggers are harder for the model to capture, while overly large triggers may interfere with the original image semantics.
TABLE VII EFFECT OF TRIGGER SIZE ON IMAGENET-10 UNDER 10% POISONING.
| Setting | Clean inputs | Triggered inputs | ||||
|---|---|---|---|---|---|---|
| NMI | ARI | ACC | NMI | ARI | ACC | |
| Clean model | 86.2 | 82.5 | 89.5 | 85.6 | 81.8 | 89.0 |
| 40×40 | 84.9 | 81.2 | 88.6 | 72.2 | 68.8 | 82.9 |
| 50×50 | 85.9 | 82.1 | 88.4 | 55.7 | 51.7 | 73.3 |
| 60×60 | 86.1 | 83.9 | 91.5 | 70.9 | 67.0 | 79.4 |
All four alternative carriers yield lower clustering scores on triggered inputs than on their corresponding clean inputs. Among these alternatives, SIG-style produces the lowest triggered NMI/ARI/ACC of 73.5/68.8/81.7, followed by WaNet-style at 77.1/72.2/84.0, Blended at 78.3/73.5/85.6, and FTrojan-style at 80.2/75.7/85.8. Relative to each model's own clean-input performance, the alternatives yield decreases of 5.6–11.1 points in NMI, 6.4–11.3 points in ARI, and 2.7–5.5 points in ACC. Thus, the degradation is consistent across carriers, although its magnitude varies by carrier and metric.
The default HBDCC trigger produces the strongest disruption under the evaluated setting, with triggered NMI/ARI/ACC of 55.7/51.7/73.3. These results correspond to decreases of 30.2, 30.4, and 15.1 points from its clean-input performance, substantially larger than those of the four alternatives. The comparison therefore supports the flexibility of the HBDCC poisoning protocol across multiple trigger forms, while showing that the default construction remains more effective in this experiment.
The carrier-dependent results are consistent with our dual-level analysis: trigger construction may affect how reliably a non-semantic cue is retained across augmented views and subsequently reinforced through instance-level representation learning and cluster-level consistency. This interpretation suggests a possible explanation for the observed differences; the carrier comparison alone does not isolate the contribution of either learning level.
H. Knowledge-Distillation Defense
Finally, we evaluate a defense strategy based on knowledge distillation [18], [33]. The core idea is to use a small amount of clean unlabeled data and a clean teacher signal to guide a student model away from trigger-dependent representations, thereby weakening the association between trigger patterns and clustering semantics. In our implementation, the clean teacher is trained without poisoned samples, the student is initialized from the attacked model, and distillation uses a manually screened clean unlabeled subset covering about 10% of the dataset. The distillation process runs for 50 epochs.

Fig. 8. Examples of the four alternative trigger carriers adapted to the HBDCC poisoning protocol: Blended, SIG-style, WaNet-style, and FTrojan-style.
The results demonstrate that this strategy is effective but not complete. On the triggered ImageNet-10 test set, the attacked model obtains 55.7/51.7/73.3 in NMI/ARI/ACC before defense. After knowledge distillation, the metrics recover to 78.6/74.8/85.8, corresponding to gains of 22.9 NMI, 23.1 ARI, and 12.5 ACC points. The larger recovery in NMI and ARI suggests that distillation helps restore global cluster consistency, while the remaining ACC gap indicates that some triggered samples are still assigned to incorrect clusters. This is consistent with the mechanism of the attack: once the trigger is embedded into the representation space, removing it requires more than a small amount of clean-data rehearsal. Therefore, knowledge distillation should be viewed as an effective mitigation strategy rather than a complete solution.
I. Discussion
The experiments support four conclusions. First, HBDCC satisfies the defining property of a backdoor attack: the poisoned model usually keeps plausible clean-data behavior, but its clustering quality drops markedly once the trigger is present. Second, the attack can be effective with a modest poisoning budget, but its strength depends on dataset separability; fine-grained or visually diverse datasets are easier to disrupt. Third, the vulnerability is not restricted to one architecture, because VTCC, SACC, and PCLC all suffer clear degradation under the same poisoning protocol. Fourth, trigger design and attack scope matter in different ways: the trigger pattern controls how strongly the cue survives augmentation, while the attack scope determines how broadly the learned association affects cluster geometry. Although knowledge distillation al-
TABLE VIII COMPARISON OF TRIGGER CARRIERS WITHIN HBDCC ON IMAGENET-10 UNDER 10% POISONING.
| Poisoning Ratio | Trigger Carrier | Clean inputs | Triggered inputs | ||||
|---|---|---|---|---|---|---|---|
| NMI | ARI | ACC | NMI | ARI | ACC | ||
| 10% | Default HBDCC | 85.9 | 82.1 | 88.4 | 55.7 | 51.7 | 73.3 |
| Blended [13] | 85.1 | 81.2 | 88.3 | 78.3 | 73.5 | 85.6 | |
| SIG-style [62] | 84.6 | 80.1 | 86.9 | 73.5 | 68.8 | 81.7 | |
| WaNet-style [46] | 86.0 | 82.8 | 89.5 | 77.1 | 72.2 | 84.0 | |
| FTrojan-style [63] | 85.8 | 82.1 | 88.9 | 80.2 | 75.7 | 85.8 | |
TABLE IX PERFORMANCE BEFORE AND AFTER KNOWLEDGE-DISTILLATION DEFENSE ON THE TRIGGERED IMAGENET-10 TEST SET.
| Defense setting | NMI | ARI | ACC |
|---|---|---|---|
| Before defense | 55.7 | 51.7 | 73.3 |
| After distillation | 78.6 | 74.8 | 85.8 |
leviates the attack substantially, the residual performance gap indicates that defending deep contrastive clustering against backdoors remains an open problem [19], [22], [27].
VI. CONCLUSION
This paper studies a training-time backdoor threat against deep contrastive clustering. Our results show that augmentation-persistent triggers can be learned as invariant cues by the instance-level objective and reinforced by cluster-level consistency, implanting a backdoor in the representation geometry without label supervision or changes to the victim pipeline. We propose HBDCC, a data-only attack that poisons a small subset of unlabeled training images. Across representative contrastive clustering models, triggered inputs substantially degrade clustering performance while clean-data utility is generally preserved; the effect varies by dataset and is particularly strong in challenging fine-grained settings. Our analyses further show that attack strength depends on poisoning scope and trigger design, and that knowledge distillation with clean unlabeled data can mitigate, but not fully remove, the backdoor. These findings highlight the need to treat the security of unsupervised and self-supervised clustering systems as an important complement to clustering accuracy.
Limitations. This study is limited to representative image benchmarks and contrastive clustering architectures; larger datasets, non-visual domains, and foundation-model-based clustering remain to be investigated. Our attack uses manually designed trigger banks, so the transferability and concealment of adaptive or learned triggers are open questions. Future work should develop clustering-specific detection and robust training methods, including trigger-invariant representation learning, robust assignment regularization, and poisoned-sample screening for unlabeled data [19], [22], [26], [27], [49], [52]. Since this work is dual-use, any release of attack details or code should include defensive guidance and evaluation safeguards.
ACKNOWLEDGMENT
This work was supported in part by National Natural Science Foundation of China (No.62272198), in part by the Special Funds for the Cultivation of Guangdong College Students' Scientific and Technological Innovation (Climbing Program Special Funds) under Grant pdjh2025ak028, and in part by the Excellent Graduate Student Cultivation Program of Jinan University (Grant No.2026CXB080).
REFERENCES
[1] J. Xie, R. Girshick, and A. Farhadi, “Unsupervised deep embedding for clustering analysis,” in Proc. of International Conference on Machine Learning (ICML), 2016, pp. 478–487.
[2] M. Caron, P. Bojanowski, A. Joulin, and M. Douze, “Deep clustering for unsupervised learning of visual features,” in Proc. of European Conference on Computer Vision (ECCV), 2018, pp. 132–149.
[3] W. Van Gansbeke, S. Vandenhende, S. Georgoulis, M. Proesmans, and L. Van Gool, “SCAN: Learning to classify images without labels,” in Proc. of European Conference on Computer Vision (ECCV), 2020, pp. 268–285.
[4] J. MacQueen, “Some methods for classification and analysis of multivariate observations,” in Proc. of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, 1967, pp. 281–297.
[5] J. Shi and J. Malik, “Normalized cuts and image segmentation,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 22, no. 8, pp. 888–905, 2000.
[6] A. Y. Ng, M. I. Jordan, and Y. Weiss, “On spectral clustering: Analysis and an algorithm,” in Advances in Neural Information Processing Systems (NeurIPS), 2002, pp. 849–856.
[7] U. von Luxburg, “A tutorial on spectral clustering,” Statistics and Computing, vol. 17, no. 4, pp. 395–416, 2007.
[8] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations,” in Proc. of International Conference on Machine Learning (ICML), 2020, pp. 1597–1607.
[9] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, “Momentum contrast for unsupervised visual representation learning,” in Proc. of IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2020, pp. 9729–9738.
[10] Y. Li, P. Hu, Z. Liu, D. Peng, J. T. Zhou, and X. Peng, “Contrastive clustering,” in Proc. of AAAI Conference on Artificial Intelligence, vol. 35, no. 10, 2021, pp. 8547–8555.
[11] X. Deng, D. Huang, D.-H. Chen, C.-D. Wang, and J.-H. Lai, “Strongly augmented contrastive clustering,” Pattern Recognition, 2023.
[12] T. Gu, B. Dolan-Gavitt, and S. Garg, “BadNets: Identifying vulnerabilities in the machine learning model supply chain,” 2017.
[13] X. Chen, C. Liu, B. Li, K. Lu, and D. Song, “Targeted backdoor attacks on deep learning systems using data poisoning,” 2017.
[14] Y. Liu, S. Ma, Y. Aafer, W.-C. Lee, J. Zhai, W. Wang, and X. Zhang, “Trojaning attack on neural networks,” in Proc. of Network and Distributed System Security Symposium (NDSS), 2018.
[15] Y. Li, Y. Jiang, Z. Li, and S.-T. Xia, “Backdoor learning: A survey,” IEEE Transactions on Neural Networks and Learning Systems, 2022.
[16] B. Biggio, B. Nelson, and P. Laskov, “Poisoning attacks against support vector machines,” in Proc. of International Conference on Machine Learning (ICML), 2012.
[17] A. Shafahi, W. R. Huang, M. Najibi, O. Suciu, C. Studer, T. Dumitras, and T. Goldstein, "Poison frogs! targeted clean-label poisoning attacks on neural networks," 2018.
[18] A. Saha, A. Tejankar, S. A. Koohpayegani, and H. Pirsiavash, “Backdoor attacks on self-supervised learning,” 2022.
[19] R. Zhang, H. Lin, J. Xu, Z. Wu, Y. Zhou, L. Lin, C. Wu, R. Fu, W. Wang, and S. He, “Data poisoning based backdoor attacks to contrastive learning,” in Proc. of IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024, pp. 24357–24366.
[20] A. Saha, A. Subramanya, and H. Pirsiavash, “Hidden trigger backdoor attacks,” in Proc. of AAAI Conference on Artificial Intelligence, vol. 34, no. 7, 2020, pp. 11957–11965.
[21] J. Jia, Y. Liu, and N. Z. Gong, “BadEncoder: Backdoor attacks to pre-trained encoders in self-supervised learning,” in Proc. of IEEE Symposium on Security and Privacy (SP), 2022.
[22] A. Tejankar, A. Saha, S. A. Koohpayegani, and H. Pirsiavash, “Defending against patch-based backdoor attacks on self-supervised learning,” in Proc. of IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023, pp. 12239–12249.
[23] A. van den Oord, Y. Li, and O. Vinyals, “Representation learning with contrastive predictive coding,” 2018.
[24] J.-B. Grill, F. Strub, F. Altche, C. Tallec, P. H. Richemond et al., "Bootstrap your own latent: A new approach to self-supervised learning," in Advances in Neural Information Processing Systems (NeurIPS), 2020.
[25] X. Chen and K. He, “Exploring simple siamese representation learning,” in Proc. of IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2021, pp. 15750–15758.
[26] H. Zhang, Z. Wang, T. Han, M. Jin, C. Zhan, M. Du, H. Wang, and S. Ma, “Invisible backdoor attack against self-supervised learning,” in Proc. of IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2025.
[27] T. Chen, J. Gui, M. Dong, J. Jia, L. Fang, and J. Liu, “Noisy alignment: Backdoor attacks to contrastive learning via random crop,” in Proc. of IEEE/CVF International Conference on Computer Vision (ICCV), 2025.
[28] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, “ImageNet: A large-scale hierarchical image database,” in Proc. of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009, pp. 248–255.
[29] A. Coates, H. Lee, and A. Y. Ng, “An analysis of single-layer networks in unsupervised feature learning,” in Proc. of International Conference on Artificial Intelligence and Statistics (AISTATS), 2011, pp. 215–223.
[30] H.-B. Ling, B. Zhu, D. Huang, D.-H. Chen, C.-D. Wang, and J.-H. Lai, "Vision transformer for contrastive clustering," 2022.
[31] Z.-F. Zhou, D. Huang, and C.-D. Wang, “Pyramid contrastive learning for clustering,” Neural Networks, vol. 185, p. 107217, 2025.
[32] C. Bucilua, R. Caruana, and A. Niculescu-Mizil, “Model compression,” in Proc. of ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD), 2006, pp. 535–541.
[33] G. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” 2015.
[34] A. Romero, N. Ballas, S. E. Kahou, A. Chassang, C. Gatta, and Y. Bengio, “FitNets: Hints for thin deep nets,” in Proc. of International Conference on Learning Representations (ICLR), 2015.
[35] X. Guo, L. Gao, X. Liu, and J. Yin, “Improved deep embedded clustering with local structure preservation,” in Proc. of International Joint Conference on Artificial Intelligence (IJCAI), 2017, pp. 1753–1759.
[36] J. Yang, D. Parikh, and D. Batra, “Joint unsupervised learning of deep representations and image clusters,” in Proc. of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016, pp. 5147–5156.
[37] J. Chang, L. Wang, G. Meng, S. Xiang, and C. Pan, “Deep adaptive image clustering,” in Proc. of IEEE International Conference on Computer Vision (ICCV), 2017, pp. 5879–5887.
[38] X. Ji, J. F. Henriques, and A. Vedaldi, “Invariant information clustering for unsupervised image classification and segmentation,” in Proc. of IEEE International Conference on Computer Vision (ICCV), 2019, pp. 9865–9874.
[39] M. Caron, I. Misra, J. Mairal, P. Goyal, P. Bojanowski, and A. Joulin, "Unsupervised learning of visual features by contrasting cluster assignments," in Advances in Neural Information Processing Systems (NeurIPS), 2020.
[40] Z. Dang, C. Deng, X. Yang, and H. Huang, “Doubly contrastive deep clustering,” 2021.
[41] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proc. of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016, pp. 770–778.
[42] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai et al., "An image is worth words: Transformers for image recognition at scale," in Proc. of International Conference on Learning Representations (ICLR), 2021.
[43] A. Turner, D. Tsipras, and A. Madry, “Clean-label backdoor attacks,” 2019.
[44] C. Liao, H. Zhong, A. C. Squicciarini, S. Zhu, and D. J. Miller, "Backdoor embedding in convolutional neural network models via invisible perturbation," 2018.
[45] T. A. Nguyen and A. T. Tran, “Input-aware dynamic backdoor attack,” in Advances in Neural Information Processing Systems (NeurIPS), 2020.
[46] —, “WaNet: Imperceptible warping-based backdoor attack,” in Proc. of International Conference on Learning Representations (ICLR), 2021.
[47] B. Tran, J. Li, and A. Madry, “Spectral signatures in backdoor attacks,” in Advances in Neural Information Processing Systems (NeurIPS), 2018.
[48] K. Liu, B. Dolan-Gavitt, and S. Garg, “Fine-pruning: Defending against backdooring attacks on deep neural networks,” in Proc. of International Symposium on Research in Attacks, Intrusions, and Defenses (RAID), 2018, pp. 273–294.
[49] B. Wang, Y. Yao, S. Shan, H. Li, B. Viswanath, H. Zheng, and B. Y. Zhao, “Neural cleanse: Identifying and mitigating backdoor attacks in neural networks,” in Proc. of IEEE Symposium on Security and Privacy (SP), 2019, pp. 707–723.
[50] Y. Gao, C. Xu, D. Wang, S. Chen, D. C. Ranasinghe, and S. Nepal, "STRIP: A defence against trojan attacks on deep neural networks," in Proc. of Annual Computer Security Applications Conference (ACSAC), 2019, pp. 113–125.
[51] B. Chen, W. Carvalho, N. Baracaldo, H. Ludwig, B. Edwards, T. Lee, I. Molloy, and B. Srivastava, “Detecting backdoor attacks on deep neural networks by activation clustering,” 2018.
[52] R. Zheng, R. Tang, J. Li, and L. Liu, “Pre-activation distributions expose backdoor neurons,” in Advances in Neural Information Processing Systems (NeurIPS), 2022.
[53] N. Carlini and A. Terzis, “Poisoning and backdooring contrastive learning,” in Proc. of International Conference on Learning Representations (ICLR), 2022.
[54] C. Li, R. Pang, Z. Xi, T. Du, S. Ji, Y. Yao, and T. Wang, “An embarrassingly simple backdoor attack on self-supervised learning,” in Proc. of IEEE/CVF International Conference on Computer Vision (ICCV), 2023, pp. 4344–4355.
[55] Q. Wang, C. Yin, L. Fang, L. Zhou, Z. Liu, R. Wang, and C. Lin, “SSL-OTA: Unveiling backdoor threats in self-supervised learning for object detection,” Applied Soft Computing, 2026.
[56] P. Khosla, P. Teterwak, C. Wang, A. Sarna, Y. Tian, P. Isola, A. Maschinot, C. Liu, and D. Krishnan, “Supervised contrastive learning,” in Advances in Neural Information Processing Systems (NeurIPS), 2020.
[57] A. Strehl and J. Ghosh, “Cluster ensembles – a knowledge reuse framework for combining multiple partitions,” Journal of Machine Learning Research, vol. 3, pp. 583–617, 2002.
[58] N. X. Vinh, J. Epps, and J. Bailey, “Information theoretic measures for clusterings comparison: Variants, properties, normalization and correction for chance,” Journal of Machine Learning Research, vol. 11, pp. 2837–2854, 2010.
[59] L. Hubert and P. Arabie, “Comparing partitions,” Journal of Classification, vol. 2, no. 1, pp. 193–218, 1985.
[60] J. Munkres, “Algorithms for the assignment and transportation problems,” Journal of the Society for Industrial and Applied Mathematics, vol. 5, no. 1, pp. 32–38, 1957.
[61] L. van der Maaten and G. Hinton, “Visualizing data using t-SNE,” Journal of Machine Learning Research, vol. 9, pp. 2579–2605, 2008.
[62] M. Barni, K. Kallas, and B. Tondi, “A new backdoor attack in CNNs by training set corruption without label poisoning,” in Proc. of IEEE International Conference on Image Processing (ICIP), 2019, pp. 101–105.
[63] T. Wang, Y. Yao, F. Xu, S. An, H. Tong, and T. Wang, “An invisible black-box backdoor attack through frequency domain,” in Proc. of European Conference on Computer Vision (ECCV), 2022, pp. 396–413.