[论文阅读 2020 Arxiv 自监督对比学习]Exploring Simple Siamese Representation Learning

简介

paper:Exploring Simple Siamese Representation Learning

code:暂未开源,可参考PatrickHua/SimSiam

Kaiming He大神的自监督学习新作。这篇论文相比于之前的SimCLRBLOY,不需要negative sample pairslarge batchesmomentum encoders,可以说是将基于孪生网络的自监督模型简化到了极致,而这也是这篇论文想引导大家思考的,即基于孪生网络的自监督学习模型中,究竟是什么在起作用。

主要内容

在这里插入图片描述

如上图所示,是SimSiam的主要结构,整个模型非常简单:

  1. 对图片 x x x进行随机图像增强得到 x 1 x_1 x1 x 2 x_2 x2;
  2. x 1 x_1 x1 x 2 x_2 x2输入到encoder network f f f(encoder f f f共线参数),其中 f f f由一个backbone(e.g.,ResNet)和一个projection MLP head组成.
  3. 之后,将其中一个输出输入到一个prediction MLP head h h h中,最后计算两个分支的negative cosine similarity.

用数学公式表示为:

p 1 ≜ h ( f ( x 1 ) ) p_{1} \triangleq h\left(f\left(x_{1}\right)\right) p1h(f(x1))
z 2 ≜ f ( x 2 ) z_{2} \triangleq f\left(x_{2}\right) z2f(x2)
D ( p 1 , z 2 ) = − p 1 ∥ p 1 ∥ 2 ⋅ z 2 ∥ z 2 ∥ 2 \mathcal{D}\left(p_{1}, z_{2}\right)=-\frac{p_{1}}{\left\|p_{1}\right\|_{2}} \cdot \frac{z_{2}}{\left\|z_{2}\right\|_{2}} D(p1,z2)=p12p1z22z2

where ∥ ⋅ ∥ 2 \|\cdot\|_{2} 2 is l 2 l_2 l2-norm.

为了防止出现collapse的问题,这篇论文使用了stop-gradient(论文后文重点说明这个是关键),即:

D ( p 1 ,  stopgrad  ( z 2 ) ) \mathcal{D}\left(p_{1}, \text { stopgrad }\left(z_{2}\right)\right) D(p1, stopgrad (z2))

x 1 x_1 x1 x 2 x_2 x2交换位置后可以得到另一半损失,最终的损失函数可以表示为:

L = 1 2 D ( p 1 ,  stopgrad  ( z 2 ) ) + 1 2 D ( p 2 ,  stopgrad  ( z 1 ) ) . \mathcal{L}=\frac{1}{2} \mathcal{D}\left(p_{1}, \text { stopgrad }\left(z_{2}\right)\right)+\frac{1}{2} \mathcal{D}\left(p_{2}, \text { stopgrad }\left(z_{1}\right)\right) . L=21D(p1, stopgrad (z2))+21D(p2, stopgrad (z1)).

Here the encoder on x 2 x_2 x2 receives no gradient from z 2 z_2 z2 in the first term, but it receives gradients from p 2 p_2 p2 in the second term (and vice versa for x 1 x_1 x1).

整个算法用伪代码表示为:

在这里插入图片描述

实验验证

这篇论文用了大量实验在分析避免collapse的因素,试图寻找基于孪生网络的自监督学习模型的学习核心。

在这里插入图片描述

从上图可以看出,如果不使用stop-gradient模型不work!

在这里插入图片描述

上面这个图说明了去除掉prediction h h h模型也不work!

在这里插入图片描述

上面这个图说明了SimSiam不需要大的batch size.

论文中,作者还试图从EM模型的角度分析stop-gradient起作用的原因,感兴趣的可以阅读原文.

实验结果

在这里插入图片描述

小结

自监督对比学习领域真是越来越热闹了,MocoV1SimCLRBLOY,SwAV,包括这篇的SimSiam,都在挖掘基于孪生网络的自监督学习模型的潜力,我等闲人也就只能吃吃瓜了。

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值