Bai T., Chen J., Zhao J., Wen B., Jiang X., Kot A. Feature Distillation With Guided Adversarial Contrastive Learning. arXiv preprint arXiv 2009.09922, 2020.

本文是通过固定教师网络(具有鲁棒性), 让学生网络去学习教师网络的鲁棒特征. 相较于一般的distillation 方法, 本文新加了reweight机制, 另外其损失函数非一般的交叉熵, 而是最近流行的对比损失.

主要内容

本文的思想是利用robust的教师网络\(f^t\)来辅助训练学生网络\(f^s\), 假设有输入\((x, y)\), 通过网络得到特征

\[t^+:= f^t(x), s^+:=f^s(x),
\]

则\((t^+, s^+)\)构成正样本对, 自然我们需要学生网络提取的特征\(s^+\)能够逼近\(t^+\), 进一步, 构建负样本对, 采样样本\(\{x_1^-, x_2^-, \ldots, x_k^- \}\), 同时得到负样本对\((t^+,s_i^-)\), 其中\(s_i^-=f^s(x_i^-)\). 总的样本对就是

\[\mathcal{S}_{pair} := \{(t^+, s^+), (t^+, s_1^-), \ldots, (t^+, s_k^-)\}.
\]

根据负样本采样的损失, 最大化

\[J(\theta):= \mathbb{E}_{(t,s)\sim p(t,s)} \log P(1|t,s;\theta) + \mathbb{E}_{(t,s)\sim q(t,s)} \log P(0|t,s;\theta).
\]

当然对于本文的问题需要特殊化, 既然先验\(P(C=1)=\frac{1}{k+1}, P(C=0)=\frac{k}{k+1}\), 故

\[J(\theta):= \mathbb{E}_{(t,s)\sim p(t,s)} \log P(1|t,s;\theta) + k\cdot \mathbb{E}_{(t,s)\sim q(t,s)} \log P(0|t,s;\theta).
\]

\(q(t,s)\)是一个区别于\(p(t,s)\)的分布, 本文采用了\(p(t)q(s)\).

作者进一步对前一项加了解释

\[\begin{array}{ll}
P(1|t,s;\theta)
&= \frac{P(t,s)P(C=1)}{P(t,s)P(C=1) + P(t)P(s)P(C=0)} \\
&\le \frac{P(t,s)}{k\cdot P(t)P(s)}, \\
\end{array}
\]

\[\mathbb{E}_{(t,s)\sim p(t,s)} \log P(1|t,s;\theta) + \log k\le I(t,s).
\]

又\(J(\theta)\)的第二项是负的, 故

\[J(\theta) \le I(t,s),
\]

所以最大化\(J(\theta)\)能够一定程度上最大化\(t,s\)的互信息.

reweight

教师网络一般要求精度(干净数据集上的准确率)比较高, 但是通过对抗训练所生成的教师网络往往并不具有这一特点, 所以作者采取的做法是, 对特征\(t\)根据其置信度来加权\(w\), 最后损失为

\[\mathcal{L}(\theta) := \mathbb{E}_{(t,s)\sim p(t,s)} w_t \log P(1|t,s;\theta) + k\cdot \mathbb{E}_{(t,s)\sim p(t)p(s)} w_t \log P(0|t,s;\theta),
\]

其中

\[w_t \leftarrow p_{ypred=y}(f^t,t^+) \in [0, 1].
\]

即\(w_t\)为教师网络判断\(t^+\)类别为\(y\)(真实类别)的概率.

拟合概率\(P(1|t,s;\theta)\)

在负采样中, 这类概率是直接用逻辑斯蒂回归做的, 本文采用

\[P(1|t,s;\theta) = h(t,s) = \frac{e^{t^Ts/\tau}}{e^{t^Ts/\tau}+\frac{k}{M}},
\]

其中\(M\)为数据集的样本个数.

会不会

\[\frac{e^{t^Ts/\tau}}{e^{t^Ts/\tau}+\gamma \cdot \frac{k}{M^2}},
\]

把\(\gamma\)也作为一个参数训练符合NCE呢?

实验的细节

文中有如此一段话

we sample negatives from different classes rather than different instances, when picking up a positive sample from the same class.

也就是说在实际实验中, \(t^+,s^+\)对应的类别是同一类的, \(t^+, s^-\)对应的类别不是同一类的.

In our view, adversarial examples are like hard examples supporting the decision boundaries. Without hard examples, the distilled models would certainly make mistakes. Thus, we adopt a self-supervised way to generate adversarial examples using Projected Gradient Descent (PGD).

也就是说, \(t, s\)都是对抗样本?

超参数: \(k=16384\), \(\tau=0.1\).

疑问

算法中的采样都是针对单个样本的, 但是我想实际训练的时候应该还是batch的, 不然太慢了, 但是如果是batch的话, 怎么采样呢?

Feature Distillation With Guided Adversarial Contrastive Learning的更多相关文章

  1. Robust Pre-Training by Adversarial Contrastive Learning

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

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

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

  3. Adversarial Self-Supervised Contrastive Learning

    目录 概 主要内容 Linear Part 代码 Kim M., Tack J. & Hwang S. Adversarial Self-Supervised Contrastive Lear ...

  4. Remote Sensing Images Semantic Segmentation with General Remote Sensing Vision Model via a Self-Supervised Contrastive Learning Method

    论文阅读: Remote Sensing Images Semantic Segmentation with General Remote Sensing Vision Model via a Sel ...

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

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

  6. 论文解读(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 ...

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

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

  8. 论文解读(GGD)《Rethinking and Scaling Up Graph Contrastive Learning: An Extremely Efficient Approach with Group Discrimination》

    论文信息 论文标题:Rethinking and Scaling Up Graph Contrastive Learning: An Extremely Efficient Approach with ...

  9. 【主动学习】Variational Adversarial Active Learning

    本文记录了博主阅读ICCV2019一篇关于主动学习论文的笔记,第一篇博客,以后持续更新哈哈 论文题目:<Variational AdVersarial Active Learning> 原 ...

随机推荐

  1. day20 系统优化

    day20 系统优化 yum源的优化 yum源的优化: 自建yum仓库 使用一个较为稳定的仓库 # 安装华为的Base源 或者使用清华的源也可以 wget -O /etc/yum.repos.d/Ce ...

  2. E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing

    解决办法:apt-get update或者apt-get cleanapt-get update 或者 apt-get update --fix-missing问题解析1 source本身的问题 根据 ...

  3. 大数据学习day13------第三阶段----scala01-----函数式编程。scala以及IDEA的安装,变量的定义,条件表达式,for循环(守卫模式,推导式,可变参数以及三种遍历方式),方法定义,数组以及集合(可变和非可变),数组中常用的方法

    具体见第三阶段scala-day01中的文档(scala编程基础---基础语法)  1. 函数式编程(https://www.cnblogs.com/wchukai/p/5651185.html): ...

  4. echo -e "\033[字背景颜色;字体颜色m字符串\033[0m

    格式: echo -e "\033[字背景颜色;字体颜色m字符串\033[0m" 例如: echo -e "\033[41;36m something here \033 ...

  5. spring注解-自动装配

    Spring利用依赖注入(DI)完成对IOC容器中中各个组件的依赖关系赋值 一.@Autowired 默认优先按照类型去容器中找对应的组件(applicationContext.getBean(Boo ...

  6. DOM解析xml学习笔记

    一.dom解析xml的优缺点 由于DOM的解析方式是将整个xml文件加载到内存中,转化为DOM树,因此程序可以访问DOM树的任何数据. 优点:灵活性强,速度快. 缺点:如果xml文件比较大比较复杂会占 ...

  7. 【Services】【Web】【LVS】lvs基础概念

    1.简介 1.1. 作者:张文嵩,就职于阿里 1.2. LVS是基础四层路由.四层交换的软件,他根据请求报文的目标IP和目标PORT将其调度转发至后端的某主机: 1.3. IPTABLES的请求转发路 ...

  8. 【Linux】【Services】【nfs】nfs安装与配置

    1. 概念 1.1. NFS:Network File System,传统意义上,文件系统在内核中实现. 1.2. RPC:Remote Procedure Call protocol,远程过程调用, ...

  9. Java中方法和类的深入分析

    1.构造方法不能被继承.也就是说子类里没有父类的构造方法.   Java重载根据的是实参和方法形参之间的匹配.自动类型转换也在重载版本的判断中起到了作用.重载的价值在于允许使用通用名称访问相关的方法. ...

  10. Java面向对象~类和对象&方法,类方法

    面向对象 概念:     1.同一类事物的抽象描述,不是具体的    2.类和对象的关系:        类 是抽象的.        对象 是具体的.    3.对象的体征,称为"属性&q ...