Unsupervised out-of-distribution (OOD) Detection aims to separate the samples falling outside the distribution of training data without label information. Among numerous branches, contrastive learning has shown its excellent capability of learning discriminative representation in OOD detection. However, for its limited vision, merely focusing on instance-level relationship between augmented samples, it lacks attention to the relationship between samples with same semantics. Based on the classic contrastive learning, we propose Cluster-aware Contrastive Learning (CCL) framework for unsupervised OOD detection, which considers both instance-level and semantic-level information. Specifically, we study a cooperation strategy of clustering and contrastive learning to effectively extract the latent semantics and design a cluster-aware contrastive loss function to enhance OOD discriminative ability. The loss function can simultaneously pay attention to the global and local relationships by treating both the cluster centers and the samples belonging to the same cluster as positive samples. We conducted sufficient experiments to verify the effectiveness of our framework and the model achieves significant improvement on various image benchmarks.
翻译:无监督分布外(OOD)检测旨在无需标签信息的情况下,分离训练数据分布之外的样本。在众多分支中,对比学习已展现出其在OOD检测中学习判别性表示的卓越能力。然而,由于其视角局限,仅关注增强样本间的实例级关系,缺乏对语义相同样本间关系的关注。基于经典对比学习,我们提出面向无监督OOD检测的聚类感知对比学习(CCL)框架,该框架同时考虑实例级和语义级信息。具体而言,我们研究了一种聚类与对比学习的协作策略,以有效提取潜在语义,并设计了一个聚类感知对比损失函数来增强OOD判别能力。该损失函数通过同时将聚类中心及属于同一聚类的样本作为正样本,能够兼顾全局与局部关系。我们开展了充分的实验来验证框架的有效性,所提模型在多种图像基准上取得了显著提升。