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. Leetcode中的SQL题目练习(二)

    175. Combine Two Tables https://leetcode.com/problems/combine-two-tables/description/ Description Pe ...

  2. map/multimap深度探索

    map/multimap同样以rb_tree为底层结构,同样有元素自动排序的特性,排序的依据为key. 我们无法通过迭代器来更改map/multimap的key值,这个并不是因为rb_tree不允许, ...

  3. Lombok安装及Spring Boot集成Lombok

    文章目录 Lombok有什么用 使用Lombok时需要注意的点 Lombok的安装 spring boot集成Lombok Lombok常用注解 @NonNull @Cleanup @Getter/@ ...

  4. gitlab之数据备份恢复

    备份#备份的时候,先通知相关人员服务要听 ,停止两个服务,并影响访问 root@ubuntu:/opt/web1# gitlab-ctl stop unicorn ok: down: unicorn: ...

  5. Spring Batch : 在不同steps间传递数据

    参考文档: How can we share data between the different steps of a Job in Spring Batch? Job Scoped Beans i ...

  6. Nginx 1.9.7.2 + PHP 5.6.18(FastCGI)在CentOS Linux下的编译安装

    本文参考张宴的Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器(第6版)[原创]完成.所有操作命令都在CentOS 6.x 64位操作系统下实践 ...

  7. 【Spark】【设置】关闭INFO提示

    目的:关闭INFO提示 方法:通过修改配置文件实现 操作文件:Hadoop/conf/log4j.properties.template 操作1:复制模板文件使用 cp $SPARK_HOME/con ...

  8. 【代码优化】List.remove() 剖析

    一.犯错经历 1.1 故事背景 最近有个需求大致的背景类似: 我已经通过一系列的操作拿到一批学生的考试成绩数据,现在需要筛选成绩大于 95 分的学生名单. 善于写 bug 的我,三下五除二完成了代码的 ...

  9. C++STL标准库学习笔记(三)multiset

    C++STL标准库学习笔记(三)multiset STL中的平衡二叉树数据结构 前言: 在这个笔记中,我把大多数代码都加了注释,我的一些想法和注解用蓝色字体标记了出来,重点和需要关注的地方用红色字体标 ...

  10. [BUUCTF]REVERSE——xor

    xor 附件 步骤: 附件很小,直接用ida打开,根据检索得到的字符串,找到程序关键函数 程序很简单,一开始让我们输入一个长度为33的字符串给v6,然后v6从第二个字符开始与前一个字符做异或运算,得到 ...