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. Python3的类注意事项

    参考: https://www.runoob.com/python/python-object.html https://www.runoob.com/w3cnote/python-extends-i ...

  2. C++ 数组元素循环右移问题

    这道题要求不用另外的数组,并且尽量移动次数少. 算法思想:设计一个结构体存储数组数据和它应在的索引位置,再直接交换,但是这种方法不能一次性就移动完成,因此再加一个判断条件.等这个判断条件满足后就退出循 ...

  3. mysql外键策略

    1.外键 建表时添加外键:constraint 外键名 foreign key 从表字段 references 主表字段 级联操作 create table dage( create table xi ...

  4. GO 数字运算

    大整数运算 // bigint project main.go package main import ( "fmt" "math" "math/bi ...

  5. oralce 存储过程传入 record 类型的参数?

    先定义一个 package , package中含有一个 record 类型的变量 create or replace package pkg_record is type emp_record is ...

  6. 实现nfs持久挂载+autofs自动挂载

    实验环境: 两台主机 node4:192.168.37.44 NFS服务器 node2:192.168.37.22 客户端 在nfs服务器,先安装nfs和rpcbind [root@node4 fen ...

  7. 使用$.post方式来实现页面的局部刷新功能

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  8. 【C/C++】小红的字符串 / 中兴捧月

    考试的时候想复杂了,其实直接一边写放进set里去重就可以了 很有意思 自己的理解就是cpp的map+set或者就是set可以完成大多数java的hashset操作 链接:https://ac.nowc ...

  9. Nginx区分浏览器

    目录 一.简介 二.配置 一.简介 场景: 不同浏览器对网页的兼容性是不一样的,所以针对火狐和curl,返回不同内容 原理: 使用if对http_user_agent变量进行判断,这个变量会显示访问时 ...

  10. 20个ios登陆界面

    原文:http://favbulous.com/post/1001/24-unique-ios-login-screen-showcase Eeve Evernote Food Recood Hips ...