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. 1小时学会Git玩转GitHub

    版权声明:原创不易,本文禁止抄袭.转载,侵权必究! 本次教程建议一边阅读一边用电脑实操 目录 一.了解Git和Github 1.1 什么是Git 1.2 什么是版本控制系统 1.3 什么是Github ...

  2. ace

    ace An ace is a playing card, die or domino with a single pip. In the standard French deck, an ace h ...

  3. flink-----实时项目---day05-------1. ProcessFunction 2. apply对窗口进行全量聚合 3使用aggregate方法实现增量聚合 4.使用ProcessFunction结合定时器实现排序

    1. ProcessFunction ProcessFunction是一个低级的流处理操作,可以访问所有(非循环)流应用程序的基本构建块: event(流元素) state(容错,一致性,只能在Key ...

  4. API接口设计之token、timestamp、sign 具体架构与实现(APP/小程序,传输安全)

    Java生鲜电商平台-API接口设计之token.timestamp.sign 具体设计与实现 说明:在实际的业务中,难免会跟第三方系统进行数据的交互与传递,那么如何保证数据在传输过程中的安全呢(防窃 ...

  5. Advanced C++ | Virtual Copy Constructor

    这个不懂,等看会了再写...

  6. SpringBoot 整合 spring security oauth2 jwt完整示例 附源码

    废话不说直接进入主题(假设您已对spring security.oauth2.jwt技术的了解,不懂的自行搜索了解) 依赖版本 springboot 2.1.5.RELEASE spring-secu ...

  7. 【C/C++】链表/ListNode/数据结构

    vector的操作 添加元素: 向尾部添加一个元素 vector<int> a; a.push_back(1); 向尾部添加多个元素 -向尾部添加x个同样的元素: a.insert(a.e ...

  8. Docker(4)-docker常用命令

    帮助命令 docker version # 查看docker的版本信息 docker info # 查看docker的系统信息,包含镜像和容器的数量 docker --help # 帮助命令 dock ...

  9. thinkphp or查询

    $map['source'] = array(array('eq',0),array('eq',1), 'or'); $this->model->where($map)

  10. Python __new__ 方法解释与使用

    解释 我们通常把 __init__ 称为构造方法,这是从其他语言借鉴过来的术语. 其实,用于构建实例的是特殊方法 __new__:这是个类方法(使用特殊方式处理,因此不必使用 @classmethod ...