论文信息

论文标题:Debiased Contrastive Learning
论文作者:Ching-Yao Chuang, Joshua Robinson, Lin Yen-Chen, Antonio Torralba, Stefanie Jegelka
论文来源:2020, NeurIPS
论文地址:download
论文代码:download

1 Introduction

  观察的结果:将拥有不同标签的样本作为负样本能显著提高性能。

  对比学习思想:鼓励相似对 $\left(x, x^{+}\right)$ 的表示更接近,而不同对 $\left(x, x^{-}\right)$ 的表示更远:

    $\mathbb{E}_{x, x^{+},\left\{x_{i}^{-}\right\}_{i=1}^{N}}\left[-\log \frac{e^{f(x)^{T} f\left(x^{+}\right)}}{e^{f(x)^{T} f\left(x^{+}\right)}+\sum\limits _{i=1}^{N} e^{f(x)^{T} f\left(x_{i}^{-}\right)}}\right] \quad\quad\quad(1)$

  图解如下:

   

  抽样偏差(sampling bias):由于真正的标签或真正的语义相似性通常是不可用的,负对 $x^{-}$  通常从训练数据中抽取,这意味着 $x^{-}$  实际上可能和  $x$  相似。

  $\text{Figure 2}$ 对比了不存在抽样偏差和存在抽样偏差的性能对比:

  

  设 $\mathcal{X}$ 上的数据分布 $p(x)$,代表语义意义的标签离散潜在类 $\mathcal{C}$,即相似的对 $\left(x, x^{+}\right)$ 具有相同的潜在类。用 $\rho(c)$ 表示类分布,得到联合分布 $p_{x, c}(x, c)=p(x \mid c) \rho(c)$。

  设 $h: \mathcal{X} \rightarrow \mathcal{C}$ 是潜在类标签分配函数,然后  $p_{x}^{+}\left(x^{\prime}\right)=p\left(x^{\prime} \mid h\left(x^{\prime}\right)=h(x)\right) $ 中观察到的 $x^{\prime}$ 是 $x$ 的正对的概率,$p_{x}^{-}\left(x^{\prime}\right)=p\left(x^{\prime} \mid h\left(x^{\prime}\right) \neq h(x)\right)$ 中观察到的 $x^{\prime}$ 是 $x$ 的负对的概率。

  假设类 $c$ 概率 $\rho(c)=\tau^{+}$ ,不是的概率为 $\tau^{-}=1-\tau^{+}$ 。

  综上,对比损失函数可以优化为:

    ${\large L_{\text {Unbiased }}^{N}(f)=\mathbb{E}_{\substack{x \sim p, x^{+} \sim p_{-}^{+} \\ x_{i}^{-} \sim p_{x}^{-}}}\left[-\log \frac{e^{f(x)^{T} f\left(x^{+}\right)}}{e^{f(x)^{T} f\left(x^{+}\right)}+\frac{Q}{N} \sum\limits_{i=1}^{N} e^{f(x)^{T} f\left(x_{i}^{-}\right)}}\right]} \quad\quad\quad(2)$

  其中,$Q $ 代表着权重参数。当 $Q=N$ 时,即标准的对比损失函数。

  对有偏对比损失函数和无偏对比损失函数的分析:

  Lemma 1. For any embedding $f$ and finite $N$, we have

    ${\large L_{\text {Biased }}^{N}(f) \geq L_{\text {Unbiased }}^{N}(f)+\mathbb{E}_{x \sim p}\left[0 \wedge \log \frac{\mathbb{E}_{x^{+} \sim p_{x}^{+}} \exp f(x)^{\top} f\left(x^{+}\right)}{\mathbb{E}_{x^{-} \sim p_{x}^{-}} \exp f(x)^{\top} f\left(x^{-}\right)}\right]-e^{3 / 2} \sqrt{\frac{\pi}{2 N}}} \quad\quad\quad(3)$

  where $a \wedge b$ denotes the minimum of two real numbers $a$ and $b$.

  Lemma 1 所带来的问题:

    • 无偏损失越小,第二项就越大,差距就越大;
    • 最小化 $L_{\text {Biased }}^{N}$ 的上界和最小化理想情况的 $L_{\text {Unbiased }}^{N}$ 所产生的潜在表示是不同的;

2 Method

  我们首先将数据分布(data distribution)分解为【当从 $p(x)$ 中提取样本时,样本 $x_{i}^{-}$ 将来自与 $x$ 相同的类,概率为 $\tau^{+}$。】

    $p\left(x^{\prime}\right)=\tau^{+} p_{x}^{+}\left(x^{\prime}\right)+\tau^{-} p_{x}^{-}\left(x^{\prime}\right)$

  相应的

    $p_{x}^{-}\left(x^{\prime}\right)=\left(p\left(x^{\prime}\right)-\tau^{+} p_{x}^{+}\left(x^{\prime}\right)\right) / \tau^{-}$

  $\text{Eq.2}$ 的一种替代形式:

    ${\large \frac{1}{\left(\tau^{-}\right)^{N}} \sum\limits_{k=0}^{N}\left(\begin{array}{c}N \\k\end{array}\right)\left(-\tau^{+}\right)^{k} \mathbb{E}_{\substack{x p p, x^{+} \sim p_{x}^{+} \\\left\{x_{i}^{-}\right\}_{i=1}^{k} \sim p_{x}^{+} \\\left\{x_{i}^{-}\right\}_{i=k+1}^{N} \sim p}}\left[-\log \frac{e^{f(x)^{T} f\left(x^{+}\right)}}{e^{f(x)^{T} f\left(x^{+}\right)}+\sum\limits_{i=1}^{N} e^{f(x)^{T} f\left(x_{i}^{-}\right)}}\right]} \quad\quad\quad(4)$

  为了得到一个更实际的形式,我们考虑了负例数 $N$ 趋于无穷时的渐近形式。

  Lemma 2. For fixed  $Q$ and $N \rightarrow \infty$  , it holds that

    $\underset{\substack{x \sim p, x^{+} \sim p_{x}^{+} \\\left\{x_{i}^{-}\right\}_{i=1}^{N} \sim p_{x}^{-N}}}{\mathbb{E}}\left[\log \frac{e^{f(x)^{T} f\left(x^{+}\right)}}{e^{f(x)^{T} f\left(x^{+}\right)}+\frac{Q}{N} \sum\limits_{i=1}^{N} e^{f(x)^{T} f\left(x_{i}^{-}\right)}}\right]\quad\quad\quad(5)$

    ${\large \longrightarrow   \tilde{L}_{\text {Debiased }}^{Q} =  \underset{x^{+} \sim p_{x}^{+}}{\mathbb{E}}\left[-\log \frac{e^{f(x)^{T} f\left(x^{+}\right)}}{e^{f(x)^{T} f\left(x^{+}\right)}+\frac{Q}{\tau^{-}}\left(\mathbb{E}_{x^{-} \sim p}\left[e^{f(x)^{T} f\left(x^{-}\right)}\right]-\tau^{+} \mathbb{E}_{v \sim p_{x}^{+}}\left[e^{f(x)^{T} f(v)}\right]\right)}\right]} \quad\quad\quad(6)$

  $\text{Eq.6}$ 仍然从 $p$ 中取样例子 $x^−$ ,但用额外的正样本 $v$ 来修正。这本质上是重新加权分母中的正项和负项。

  经验估计 $\widetilde{L}_{\text {Debiased }}^{Q}$ 比直接的 $Eq.5$ 更容易计算。在数据分布 $p$ 中采样 $N$ 个样本 $\left\{u_{i}\right\}_{i=1}^{N}$,在分布 $p_{x}^{+} $ 中采样 $M$ 个样本 $\left\{u_{i}\right\}_{i=1}^{M}$,将  $Eq.6$ 分母中的第二项重新估计为:

    $g\left(x,\left\{u_{i}\right\}_{i=1}^{N},\left\{v_{i}\right\}_{i=1}^{M}\right)=\max \left\{\frac{1}{\tau^{-}}\left(\frac{1}{N} \sum\limits_{i=1}^{N} e^{f(x)^{T} f\left(u_{i}\right)}-\tau^{+} \frac{1}{M} \sum\limits_{i=1}^{M} e^{f(x)^{T} f\left(v_{i}\right)}\right), e^{-1 / t}\right\}\quad\quad\quad(7)$

  我们约束估计量 $g$ 大于它的理论最小值 $e^{-1 / t} \leq \mathbb{E}_{x^{-} \sim p_{x}^{-}} e^{f(x)^{T} f\left(x_{i}^{-}\right)}$ 以防止计算一个负数的对数。当数据$ N$ 和 $M$ 固定后,由此产生的损失为

    ${\large L_{\text {Debiased }}^{N, M}(f)=\mathbb{E}_{\substack{x \sim p ; x^{+} \sim p_{x}^{+} \\\left\{u_{i}\right\}_{i=1}^{N} \sim p^{N} \\\left\{v_{i}\right\}_{i=1}^{N} \sim p_{x}^{+M}}}\left[-\log \frac{e^{f(x)^{T} f\left(x^{+}\right)}}{e^{f(x)^{T} f\left(x^{+}\right)}+N g\left(x,\left\{u_{i}\right\}_{i=1}^{N},\left\{v_{i}\right\}_{i=1}^{M}\right)}\right]} \quad\quad\quad(8)$

  其中,为简单起见,我们将 $Q$ 设置为有限的 $N$。类先验 $\tau^{+}$ 可以从数据中估计或作为一个超参数处理。Theorem 3 将有限 $N$ 和 $M$ 引起的误差限定为随速率 $\mathcal{O}\left(N^{-1 / 2}+M^{-1 / 2}\right)$ 递减。

  Theorem 3. For any embedding  $f$  and finite  $N$  and  $M$  , we have

    ${\large \left|\widetilde{L}_{\text {Debiased }}^{N}(f)-L_{\text {Debiased }}^{N, M}(f)\right| \leq \frac{e^{3 / 2}}{\tau^{-}} \sqrt{\frac{\pi}{2 N}}+\frac{e^{3 / 2} \tau^{+}}{\tau^{-}} \sqrt{\frac{\pi}{2 M}}} \quad\quad\quad(9)$

  实验表明,较大的 $N$ 和 $M$ 始终会导致更好的性能。在实现中,我们对 $L_{\text {Debiased }}^{N, M}$ 使用一个完整的经验估计,以平均在 $T$ 个点 $x$ 上,有限 $N$ 和 $M$ 的损失。

3 Experiments

实验结果

  • 新的损失在视觉、语言和强化学习基准上优于先进的对比学习;
  • 学习到的嵌入更接近理想的无偏目标;
  • 大 $N$ 大 $M$  提高性能;甚至一个比标准 $M=1$ 更积极的例子可以明显帮助;

论文解读(Debiased)《Debiased Contrastive Learning》的更多相关文章

  1. 论文解读《Deep Resdual Learning for Image Recognition》

    总的来说这篇论文提出了ResNet架构,让训练非常深的神经网络(NN)成为了可能. 什么是残差? "残差在数理统计中是指实际观察值与估计值(拟合值)之间的差."如果回归模型正确的话 ...

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

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

  3. 论文解读(GCA)《Graph Contrastive Learning with Adaptive Augmentation》

    论文信息 论文标题:Graph Contrastive Learning with Adaptive Augmentation论文作者:Yanqiao Zhu.Yichen Xu3.Feng Yu4. ...

  4. 论文解读(GRACE)《Deep Graph Contrastive Representation Learning》

    Paper Information 论文标题:Deep Graph Contrastive Representation Learning论文作者:Yanqiao Zhu, Yichen Xu, Fe ...

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

  6. 论文解读(MLGCL)《Multi-Level Graph Contrastive Learning》

    论文信息 论文标题:Structural and Semantic Contrastive Learning for Self-supervised Node Representation Learn ...

  7. 论文解读(GROC)《Towards Robust Graph Contrastive Learning》

    论文信息 论文标题:Towards Robust Graph Contrastive Learning论文作者:Nikola Jovanović, Zhao Meng, Lukas Faber, Ro ...

  8. 论文解读(MERIT)《Multi-Scale Contrastive Siamese Networks for Self-Supervised Graph Representation Learning》

    论文信息 论文标题:Multi-Scale Contrastive Siamese Networks for Self-Supervised Graph Representation Learning ...

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

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

随机推荐

  1. Spring Boot 中的监视器是什么?

    Spring boot actuator 是 spring 启动框架中的重要功能之一.Spring boot 监视器可帮助您访问生产环境中正在运行的应用程序的当前状态.有几个指标必须在生产环境中进行检 ...

  2. List、Set、Map详解及区别

    一.List接口 List是一个继承于Collection的接口,即List是集合中的一种.List是有序的队列,List中的每一个元素都有一个索引:第一个元素的索引值是0,往后的元素的索引值依次+1 ...

  3. vue使用svg,animate事件绑定无效问题及解决方法

    由于使用svg制作圆形进度条,但是进度展示的太生硬,没有过渡圆滑的效果,所以使用 animate(在svg元素里可以查到) 元素标签,但 这样使用了,还是没有效果,我前端使用的 vue ,所以通过 @ ...

  4. spring 自动装配 bean 有哪些方式?

    Spring容器负责创建应用程序中的bean同时通过ID来协调这些对象之间的关系.作为开发人员,我们需要告诉Spring要创建哪些bean并且如何将其装配到一起. spring中bean装配有两种方式 ...

  5. GC日志浅析

    //java 开发环境,使用HotSpot的虚拟机,64位,windows 开发环境 Java HotSpot(TM) 64-Bit Server VM (25.151-b12) for window ...

  6. MySQL怎么用命令修改字段名

    一.SQL MySQL怎么用命令修改字段名的 -- alter table 表名 change 旧属性 新属性 新的数据类型 ==>(可以不写) COMMENT '备注' ALTER TABLE ...

  7. 六、cadence叠层和布线前规则设置详细步骤

    一.叠层设置 1.颜色设置 2.层叠设置setup-cross section,如下图: 3.布线规则设置 a>线宽设置 b>添加差分对logic-Assign Differenital ...

  8. Architecture Review Board

    Architecture Review Board What's an Architecture Review? Architecture design is not a one-time final ...

  9. java中类变量和实例变量的实质区别?

    类变量和实例变量的区别 相对于static(静态的)或说类的, 本章开始提到的都是instance(实例的)或说对象的. 每个对象都有自己的一份儿对象域或实例域,相互之间没关系, 不共享. 我们可以从 ...

  10. CSS简单样式练习(二)

    运行效果: 源代码: 1 <!DOCTYPE html> 2 <html lang="zh"> 3 <head> 4 <meta char ...