arXiv:2610.33116cs.CROct 2026

Manuscript Offprint

arXiv:2610.33116

Hidden Backdoor Attack on Deep Contrastive Clustering

Zifeng Zhou, Shengda Zhuo, Jiahui Huang, Zeyan Li, Jinchun He, Peipeng Yu, Wangjie Qiu, Zhiming Zheng, Shuqiang Huang

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.

Figure

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.

References (63)