Kim M., Tack J. & Hwang S. Adversarial Self-Supervised Contrastive Learning. In Advances in Neural Information Processing Systems, 2020.

这篇文章提出了对比学习结合adversarial training的一个思路.

主要内容

对比学习的强大之处在于正负样本对的构造, 一个结合adversarial training的很自然的思路是, 将普通样本与其相对应的对抗样本作为一组正样本对. 令\(x \in \mathcal{X}\)为样本, \(t \in \mathcal{T}\)为一augmentation, 则\((x, t(x))\)便构成了一正样本对, 再假设有一组负样本\(\{x_{neg}\}\), 则

\[\mathcal{L}_{con} (x, t(x), \{x_{neg}\}) = -\log \frac{\exp (z^T z_{pos}/\tau)}{\exp (z^T z_{pos}/\tau)+\sum_{z_{neg}}\exp(z^Tz_{neg}/\tau)},
\]

其中\(z\)是经过标准化的特征, \(\tau\)是temperature. 很自然的, 我们可以通过上面的损失构造\(x\)的对抗样本\(x_{adv}\):

\[x_{adv} := \prod_{B(x;\epsilon)} (x+\alpha \cdot \mathrm{sign} (\nabla_{x_{adv}} \mathcal{L}_{con}(x, x_{adv}, \{x_{neg}\})).
\]

稍有不同的是, 作者实际采用的是利用\(\mathcal{L}_{con}(t(x), t'(x), \{x_{neg}\})\)来构建对抗样本, 最后的用于训练的损失是

\[\mathcal{L}_{RoCL} := \mathcal{L}_{con}(t(x), \{t'(x), t(x)_{adv}\}, \{t(x)_{neg}\}) \\
\mathcal{L}_{total}:= \mathcal{L}_{RoCL} + \lambda \mathcal{L}_{con}(t(x)^{adv},t'(x), \{t(x)_{neg}\}),
\]

多的项即希望对抗样本和其他样本区别开来.

注:

\[\mathcal{L}_{con} (x, \{t(x), t'(x)\}, \{x_{neg}\}) = -\log \frac{\sum_{z_{pos}}\exp (z^T z_{pos}/\tau)}{\sum_{z_{pos}}\exp (z^T z_{pos}/\tau)+\sum_{z_{neg}}\exp(z^Tz_{neg}/\tau)}.
\]

Linear Part

因为自监督只是单纯提取了特征, 一般用于下游的分类任务需要再训练一个线性分类器, 很自然的, 作者选择在训练下游分类器的时候同样使用adversarial training:

\[\arg \min_{\psi} \mathbb{E}_{(x, y) \sim \mathbb{D}} [\max_{\delta \in B(x, \epsilon)} \mathcal{L}_{ce}(\psi, x+\delta,y)] ,
\]

其中\(\psi\)为线性分类器\(l(\cdot)\)的的参数.

另外, 作者还融合的随机光滑的技巧, 即在估计的时候

\[S(x) = \arg \max_{c \in Y} \mathbb{E}_{t \in \mathcal{T}} (l_c(f(t(x)))=c),
\]

一般的随机光滑是对样本随机加噪声, 这里的随机光滑是随机选择augmentation, 这倒是很让人眼前一亮.

代码

原文代码

Adversarial Self-Supervised Contrastive Learning的更多相关文章

  1. 论文解读(ClusterSCL)《ClusterSCL: Cluster-Aware Supervised Contrastive Learning on Graphs》

    论文信息 论文标题:ClusterSCL: Cluster-Aware Supervised Contrastive Learning on Graphs论文作者:Yanling Wang, Jing ...

  2. Robust Pre-Training by Adversarial Contrastive Learning

    目录 概 主要内容 代码 Jiang Z., Chen T., Chen T. & Wang Z. Robust Pre-Training by Adversarial Contrastive ...

  3. Feature Distillation With Guided Adversarial Contrastive Learning

    目录 概 主要内容 reweight 拟合概率 实验的细节 疑问 Bai T., Chen J., Zhao J., Wen B., Jiang X., Kot A. Feature Distilla ...

  4. 谣言检测(GACL)《Rumor Detection on Social Media with Graph Adversarial Contrastive Learning》

    论文信息 论文标题:Rumor Detection on Social Media with Graph AdversarialContrastive Learning论文作者:Tiening Sun ...

  5. ICLR2021对比学习(Contrastive Learning)NLP领域论文进展梳理

    本文首发于微信公众号「对白的算法屋」,来一起学AI叭 大家好,卷王们and懂王们好,我是对白. 本次我挑选了ICLR2021中NLP领域下的六篇文章进行解读,包含了文本生成.自然语言理解.预训练语言模 ...

  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. 论文解读(gCooL)《Graph Communal Contrastive Learning》

    论文信息 论文标题:Graph Communal Contrastive Learning论文作者:Bolian Li, Baoyu Jing, Hanghang Tong论文来源:2022, WWW ...

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

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

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

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

随机推荐

  1. day12 函数嵌套

    day12 函数嵌套 一. args与kwargs def index(a,b,c): print(a,b,c) def wrapper(*args,**kwargs): # args=(1,2,3) ...

  2. 虚拟机中安装centos系统的详细过程

    linux-centos的安装 检查电脑是否开启虚拟化,只有开启虚拟化才能安装虚拟机 新建虚拟机 鼠标点进去,选中红框所示,回车 登录: 输入默认用户名(超级管理员 root) 密码:安装时设置的密码

  3. 安全相关,xss

    XSS XSS,即 Cross Site Script,中译是跨站脚本攻击:其原本缩写是 CSS,但为了和层叠样式表(Cascading Style Sheet)有所区分,因而在安全领域叫做 XSS. ...

  4. 案例 高级定时器和通用定时器产生pwm的区别 gd32和stm32

  5. RestTemplate的exchange()方法,解决put和delete请求拿不到返回值的问题

    嗷嗷待哺的controller(被调用provider的controller方法) //测试get少量参数 @RequestMapping(value = "detailsGetD" ...

  6. oracle 存储过程及REF CURSOR的使用

    基本使用方法及示例 1.基本结构: CREATE OR REPLACE PROCEDURE 存储过程名字 (参数1 IN NUMBER,参数2 IN NUMBER) AS 变量1 INTEGER := ...

  7. 【编程思想】【设计模式】【行为模式Behavioral】状态模式State

    Python版 https://github.com/faif/python-patterns/blob/master/behavioral/state.py #!/usr/bin/env pytho ...

  8. 用oracle中的Row_Number实现分页

    Row_Number实现分页   1:首先是 select ROW_NUMBER() over(order by id asc) as 'rowNumber', * from table1 生成带序号 ...

  9. linux 操作只读变量

    由于该操作需要用到 gdb,所以需要先 安装好 gdb 1. 查询是否有gdb: 2. 如果没有,需要先执行 yum install gdb 命令进行安装 3. 定义 只读变量 abc 并打印值: a ...

  10. python pandas 中文件的读写——read_csv()读取文件

    read_csv()读取文件1.python读取文件的几种方式read_csv 从文件,url,文件型对象中加载带分隔符的数据.默认分隔符为逗号read_table 从文件,url,文件型对象中加载带 ...