[CVPR 2022] HCSC: hierarchical contrastive selective coding

Introduction

  • 现有的自监督对比学习方法可以分为 instance-wise contrastive learning 和 prototypical contrastive learning ,它们都将数据集的语义结构表征为若干组聚类中心,而无法表征图像数据集中存在的层级性的语义结构
    在这里插入图片描述
  • 为此,作者提出 Hierarchical Contrastive Selective Coding (HCSC),通过 hierarchical prototypes 来让模型学得数据集中的隐式层级结构,并选择出更高质量的正负样本对,i.e., positive pairs with similar semantics and negative pairs with distinct semantics

Method

Hierarchical Semantic Representation

  • 作者通过 hierarchical K-means algorithm 来构建 hierarchical prototypes. 首先在训练集的图像特征 Z Z Z 上做 K K K 均值聚类可以得到第一层的 prototypes,接着在 l − 1 l-1 l1 层的 prototypes 上做 K K K 均值聚类即可得到 l l l 层的 prototypes. 相邻层级的 prototypes 间再根据聚类过程用边相互连接形成树形结构
    在这里插入图片描述在这里插入图片描述其中, M l M_l Ml l l l 层的 prototypes 数量, L L L 为层级结构的层数,均为超参。作者的预训练数据集为 ImageNet,设置的 clustering hyperparameters 为 L = 3 L=3 L=3 ( M 1 , M 2 , M 3 ) = ( 3000 , 2000 , 1000 ) (M_1,M_2,M_3)=(3000,2000,1000) (M1,M2,M3)=(3000,2000,1000),样本数少于 10 的 cluster 将被丢弃
  • 由于图像特征是在不断更新的,因此 hierarchical prototypes 也应该在训练过程中不断更新。出于对模型精度和性能的权衡,作者选择在每个 epoch 开始时更新 hierarchical prototypes

Instance-wise Contrastive Selective Coding

  • 对于 instance-wise contrastive learning 而言,正样本可以通过数据增强得到,但现有方法不能保证选出的负样本是真正的语义不相似的样本,这会损害对比学习性能。为了解决上述问题,作者利用 hierarchical prototypes 选出与 anchor 语义不同的负样本

  • 首先定义出 image representation z z z 到 prototype c ∈ C c\in C cC 的距离
    在这里插入图片描述其中 Z c Z_c Zc 为 cluster c c c 里所有图像表征的集合, ϵ = 10 \epsilon=10 ϵ=10
  • 然后就可以根据该距离在层次结构的每一层上都进行负样本选取。对于 l l l 层,与 z z z 距离最近的 cluster 为
    在这里插入图片描述negative candidate z j ∈ N z_j\in\mathcal N zjN c l ( z ) c^l(z) cl(z) 的距离越远,被选为负样本的概率越大,这能使得我们有更大概率选出与 z z z 语义不相近的负样本
    在这里插入图片描述根据上述概率,通过伯努利采样即可选出负样本集合
    在这里插入图片描述通过在 L L L 层上进行负样本选取,可以采样出更加多样化的负样本,得到 L L L negative sample sets { N select l ( z ) } l = 1 L \{\mathcal N_{\text{select}}^l(z)\}_{l=1}^L {Nselectl(z)}l=1L 作为最终的负样本集合
  • instance-wise contrastive selective coding (ICSC)
    在这里插入图片描述其中 p d p_d pd 为数据分布, z ′ z' z 为数据增强得到的正样本, τ = 0.2 \tau=0.2 τ=0.2
    在这里插入图片描述

Prototypical Contrastive Selective Coding

  • 对于 prototypical contrastive learning,作者也是采用类似的思路,利用 hierarchical prototypes 选出与 anchor 语义不同的 negative clusters

  • 首先定义出 image representation z z z 到 prototype c ∈ C c\in C cC 的距离
    在这里插入图片描述其中 Z c Z_c Zc 为 cluster c c c 里所有图像表征的集合
  • 然后就可以根据该距离在层次结构的每一层上都进行 negative clusters 选取。对于 l l l 层,与 z z z 距离最近的 prototype 为
    在这里插入图片描述可以将 ( z , c l ( z ) ) (z,c^l(z)) (z,cl(z)) 当作 positive pair,其余 prototypes 作为 candidates of negative clusters N l \mathcal N^l Nl. prototype c j c_j cj 被选中的概率为
    在这里插入图片描述其中, Parent ( c l ( z ) ) \text{Parent}(c^l(z)) Parent(cl(z)) c l ( z ) c^l(z) cl(z) 的 parent node,所有位于 top hierarchy 的 prototypes 对应的选取概率均为 1. 根据上述概率,通过伯努利采样即可选出负样本集合
    在这里插入图片描述
  • prototypical contrastive selective coding (PCSC)
    在这里插入图片描述其中, τ c \tau_c τc 为 cluster-specific temperature parameter (can be adaptively determined by some clustering statistics.)
    在这里插入图片描述

Overall Objective

  • instance-wise contrastive learning 主要挖掘 the local instance-level structures, 而 prototypical contrastive learning 则主要构建 global semantic structures
  • 因此作者同时使用了两种损失函数
    在这里插入图片描述

Experiments

Linear Classification and KNN Evaluation

在这里插入图片描述

Semi-Supervised Learning

在这里插入图片描述
Transfer Learning

在这里插入图片描述

Clustering Evaluation

在这里插入图片描述

Ablation Study

在这里插入图片描述
Sensitivity Analysis

在这里插入图片描述

Visualization

在这里插入图片描述
在这里插入图片描述

References

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值