Chen T., Kornblith S., Norouzi M., Hinton G. A Simple Framework for Contrastive Learning of Visual Representations. arXiv: Learning, 2020.

@article{chen2020a,

title={A Simple Framework for Contrastive Learning of Visual Representations},

author={Chen, Ting and Kornblith, Simon and Norouzi, Mohammad and Hinton, Geoffrey E},

journal={arXiv: Learning},

year={2020}}

SimCLR 主要是利用augmentation来生成正负样本对, 虽然没有花里胡哨的结构, 但是通过细致的tricks比之前的方法更为有效.

主要内容

流程

流程是很简单的, 假设有一个batch的样本\(x\), 然后从augmentation\(\mathcal{T}\)中随机选取俩个\(t,t'\), 由此得到两批数据\(\tilde{x}_i=t(x), \tilde{x}_j=t'(x)\), 经过第一个encoder得到特征表示\(h_i,h_j\), 再经由一个非线性变化\(g\)得到\(z_i,z_j\)(注意这一步是和以往方法不同的点), 再由\(z_i, z_j\)生成正负样本对(对应同一个样本的俩个样本构成正样本对, 否则为负样本对).

接下来先介绍一些比较重要的特别的tricks, 再介绍别的.

projection head g

一般方法只有一个encoder \(f(\cdot)\), SimCLR多了一个projection head \(g(\cdot)\), 它把第一次提到的特征再进行一次过滤:

\[z_i = g(h_i)=W^{(2)} \sigma(W^{(1)}h_i),
\]

其中\(\sigma\)为ReLU.

作者说, 这是为了过滤到由augmentation带来的额外的可分性, 让区分特征\(z\)变得更为困难从而学习到更好的特征\(h\).

注: 用于下游任务的特征是\(h\)而非\(z\)!

上表是将特征\(h\)或者\(z\)用于一个二分类任务, 区分输入是否经过了特定的augmentation, 结果显示\(h\)能够更好的分类, 意味着\(h\)比\(z\)含有更多的augmentation的信息.

constractive loss

\[\tag{1}
\ell_{ij}=-\log \frac{\exp(\mathrm{sim}(z_i,z_j)/\tau)}{\sum_{k\not=i} \exp(\mathrm{sim}(z_i,z_k)/\tau)},
\]

其中\(\mathrm{sim}(u,v)=u^Tv/\|u\|\|v\|\).

实验显示这个损失比别的都好用.

augmentation

SimCLR中augmentation是很重要的构造正负样本对的配件, 经过消融实验发现, 最有效的的是crop和color distortion.

另外, 实验还显示, 监督学习比起对比学习来讲, 对augmentation的依赖程度很低, 甚至可以说是不依赖.

other

  1. 大的模型充当encoder效果更好;
  2. 大的batch size 和 更多的 training epoches有助于学习到更好的特征表示;

代码

原文代码

A Simple Framework for Contrastive Learning of Visual Representations的更多相关文章

  1. 论文解读(SimCLR)《A Simple Framework for Contrastive Learning of Visual Representations》

    1 题目 <A Simple Framework for Contrastive Learning of Visual Representations> 作者: Ting Chen, Si ...

  2. A Simple Framework for Contrastive Learning of Visual Representations 阅读笔记

      Motivation 作者们构建了一种用于视觉表示的对比学习简单框架 SimCLR,它不仅优于此前的所有工作,也优于最新的对比自监督学习算法, 而且结构更加简单:这个结构既不需要专门的架构,也不需 ...

  3. 【CV】ICCV2015_Unsupervised Learning of Visual Representations using Videos

    Unsupervised Learning of Visual Representations using Videos Note here: it's a learning note on Prof ...

  4. 论文解读(PCL)《Prototypical Contrastive Learning of Unsupervised Representations》

    论文标题:Prototypical Contrastive Learning of Unsupervised Representations 论文方向:图像领域,提出原型对比学习,效果远超MoCo和S ...

  5. 【ML】ICML2015_Unsupervised Learning of Video Representations using LSTMs

    Unsupervised Learning of Video Representations using LSTMs Note here: it's a learning notes on new L ...

  6. 论文解读(SimGRACE)《SimGRACE: A Simple Framework for Graph Contrastive Learning without Data Augmentation》

    论文信息 论文标题:SimGRACE: A Simple Framework for Graph Contrastive Learning without Data Augmentation论文作者: ...

  7. Deep Reinforcement Learning for Visual Object Tracking in Videos 论文笔记

    Deep Reinforcement Learning for Visual Object Tracking in Videos 论文笔记 arXiv 摘要:本文提出了一种 DRL 算法进行单目标跟踪 ...

  8. 论文解读(SUGRL)《Simple Unsupervised Graph Representation Learning》

    Paper Information Title:Simple Unsupervised Graph Representation LearningAuthors: Yujie Mo.Liang Pen ...

  9. 论文解读(S^3-CL)《Structural and Semantic Contrastive Learning for Self-supervised Node Representation Learning》

    论文信息 论文标题:Structural and Semantic Contrastive Learning for Self-supervised Node Representation Learn ...

随机推荐

  1. 一次“不负责任”的 K8s 网络故障排查经验分享

    作者 | 骆冰利 来源 | Erda 公众号 ​ 某天晚上,客户碰到了这样的问题:K8s 集群一直扩容失败,所有节点都无法正常加入集群.在经过多番折腾无解后,客户将问题反馈到我们这里,希望得到技术支持 ...

  2. 字节面试问我如何高效设计一个LRU,当场懵

    首发公众号:bigsai 转载请放置作者和原文(本文)链接 前言 大家好,我是bigsai,好久不见,甚是想念! 最近有个小伙伴跟我诉苦,说他没面到LRU,他说他很久前知道有被问过LRU的但是心想自己 ...

  3. [项目总结]论Android Adapter notifyDataSetChanged与notifyDataSetInvalidated无效原因

    最近在开发中遇到一个问题,Adapter中使用notifyDataSetChanged 与notifyDataSetInvalidated无效,经过思考和网上查找,得出如下原因. 首先看一下notif ...

  4. jenkins之分布式

    在jenkins的slave节点安装jdk(注:slave节点不需要安装jenkins) #:安装jdk环境 root@ubuntu:/usr/local/src# ls jdk-8u191-linu ...

  5. Output of C++ Program | Set 11

    Predict the output of following C++ programs. Question 1 1 #include<iostream> 2 using namespac ...

  6. SpringMVC注解详情

    @Component.@Repository @Service.@Controller 看字面含义,很容易却别出其中三个: @Controller 控制层,就是我们的action层 @Service ...

  7. Servlet(4):一个简单的注册页面

    一. 注册要求 1. 一个注册页面 username (文本框) password:密码 (密码框) passwordYes :再次输入密码(密码框) hobby (多选框) sex (单选框) in ...

  8. spring-boot aop 增删改操作日志 实现

    1.注解接口:import com.github.wxiaoqi.security.common.constant.Constants; import java.lang.annotation.*; ...

  9. shell脚本统计多个CPU利用率

    本节主要内容:top命令统计CPU的利用率 一,问题分析 MySQL在Linux下是多线程的,而且只能将多个线程分布到一个CPU上.因此,使用小型服务器,或者PC SERVER,多个CPU利用率并不高 ...

  10. 搭建mybatis开发环境

    1.创建工程 <groupId>com.hope</groupId>     <artifactId>day01_eesy_01mybatis</artifa ...