AuthorHorizon John✨编程技巧篇各种操作小结神经网络篇经典网络模型算法篇再忙也别忘了 LeetCode[ 对比学习篇 ] 经典网络模型 —— Contrastive Learning 01. InstDisc 结构框图 详解 效果 02. InvaSpread 结构框图 详解 效果 03. CPC 结构框图 详解 效果 04. CMC 结构框图 详解 05. MoCov1 结构框图 详解 效果 06. SimCLRv1 结构框图 详解 效果 07. Mocov2 结构框图 详解 效果 08. SimCLRv2 结构框图 详解 效果 09. SWaV 结构框图 详解 效果 10. BYOL 结构框图 详解 效果 11. SimSiam 结构框图 详解 效果 12. Mocov3 结构框图 详解 效果 13. DINO 结构框图 详解 效果 14. CLIP 结构框图 详解 效果 01. InstDisc Paper: Unsupervised Feature Learning via Non-Parametric Instance Discrimination[CVPR 2018]️ GitHub: lemniscate.pytorch 结构框图Figure 1. The pipeline 详解每个图片看成一个类别利用memory bank来存储图像经神经网络编码后的特征128维正样本该图像本身 经过数据增强后的图像负样本数据集中其他的图像从 memory bank 中随机抽取4096个样本超参数设定temperatureτ 0.07NCE with m 4, 096 to balance performance and computing costtrained for 200 epochs using SGD with momentumbatch size 256learning rate is initialized to 0.03, scaled down with coefficient 0.1 every 40 epochs after the first 120 epochs 效果 02. InvaSpread Paper: Unsupervised Embedding Learning via Invariant and Spreading Instance Feature[CVPR 2019]️ GitHub: Unsupervised_Embedding_Learning 结构框图Figure 1. The framework 详解没有使用额外的数据结构去存储大量的样本信息正负样本都来自于同一个minibatch使用同一个编码器进行端到端的学习正样本该图像本身 经过数据增强后的图像2负样本其他图像 经过数据增强后的图像(batch size-1) × 2未能取得很好结果原因batch size 太小导致负样本数量较小 效果 03. CPC Paper: Representation Learning with Contrastive Predictive Coding[None 2018]️ GitHub: None 结构框图Figure 1. Model overview 详解可以应用于音频、图片、强化学习将输入当成序列利用前面的输入通过 RNN 或 LSTM 等网络输出来进行预测正样本预测结果负样本随机样本通过 genc得到的结果 效果 04. CMC Paper: Contrastive Multiview Coding[ECCV 2020]️ GitHub: CMC 结构框图Figure 1. Model overview 详解增大不同视角之间的互信息视觉、听觉、触觉数据集NYU RGBD包含原始图像、深度信息、SwAV ace normal、分割图像正样本同一图像的不同视角负样本其他图像缺点不同视角下使用的编码器不一样计算成本过高作者后来又提出了不同网络得到的特征也应该尽可能相似利用蒸馏网络teacher net student net 05. MoCov1 Paper: Momentum Contrast for Unsupervised Visual Representation Learning[CVPR 2020]️ GitHub: moco 结构框图Figure 1. Model overviewFigure 2. Conceptual comparison of three contrastive loss mechanisms 详解InstDisc 的改进提出了队列queue来解决 memory bank 中的大字典的问题提出了动量编码器来解决 字典中特征不一致的问题利用动态字典对 队列中的特征进行存储每一次更新得到的 k 都会取代最开始的 k 值动量编码器yt m·yt-1 (1-m)·xt使输出不完全依赖于当前的输入还会收到上一个输出的影响0 ≤ m ≤ 1 实现缓慢的更新每一次新的到的 k 值使字典中的特征尽可能的保持一致正负样本都位于 队列当中确保正负样本都是由同一个编码器提取得到的 效果 06. SimCLRv1 Paper: A Simple Framework for Contrastive Learning of Visual Representations[ICML 2020]️ GitHub: simclr 结构框图Figure 1. The framework 详解增大数据增强的数量编码后的特征再经过一个g(·) 函数MLP层 再求 loss 值实现更好的训练 特征编码器设置了更大的 batchsize训练时间更久 效果数据增强策略及效果 07. Mocov2 Paper: Improved Baselines with Momentum Contrastive Learning[None 2020]️ GitHub: None 结构框图Figure 1. A batching perspective of two optimization mechanisms for contrastive learning 详解借鉴 SimCLRv1 的策略添加了MLP层使用了数据增强训练时使用 cos learning rate schedule训练更多epochs 效果 08. SimCLRv2 Paper: Big Self-Supervised Models are Strong Semi-Supervised Learners[NeurIPS 2020]️ GitHub: simclr 结构框图Figure 1. The framework 详解使用更大的骨干网络模型增加 MLP层实验测试两层最佳使用动量编码器参考 MoCo 效果 09. SWaV Paper: Unsupervised Learning of Visual Features by Contrasting Cluster Assignments[NeurIPS 2020]️ GitHub: swav 结构框图Figure 1. Model overview 详解生成多个视角利用一个视角得到的特征去预测另一个视角的特征与聚类工作相结合利用聚类中心3000个进行预测cz1预测 Q2 cz2预测 Q1c 为聚类中心z1和 z2为提取的特征编码采用聚类中心可以降低采样的负样本数量从而减少计算成本解决正样本也纳入到负样本中导致的样本不均衡的问题提出Muti-crop的数据增强策略多尺度的剪裁原始图像作为数据增强 效果 10. BYOL Paper: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning[NeurIPS 2020] Blog: Understanding Self-Supervised and Contrastive Learning with “Bootstrap Your Own Latent” (BYOL)️ GitHub: byol 结构框图Figure 1. BYOL’s architecture 详解fθ和 fξ的网络结构一样模型参数更新不同fξ采用动量编码器更新gθ和 gξ是类似 SimCLR 的MLP层与 fθ和 fξ的更新策略一样在模型最后输出部分 zθ再经过一个 MLP层 得到 qθ(zθ)利用 qθ(zθ) 预测 z’ξ计算 loss 模型测试阶段使用 yθ作为输出 效果 11. SimSiam Paper: Exploring Simple Siamese Representation Learning[CVPR 2021]️ GitHub: simsiam 结构框图Figure 1. SimSiam architectureFigure 2. Comparison on Siamese architectures 详解较 BYOL 没有使用动量编码器进行参数更新总结性工作 效果Comparisons on ImageNet linear classificationTransfer Learning 12. Mocov3 Paper: An Empirical Study of Training Self-Supervised Vision Transformers[ICCV 2021, Oral]️ GitHub: moco-v3 结构框图Figure 1. Algorithm 详解结合 MoCov2 和 SimSiam 骨干网络替换成了 ViT 效果 13. DINO Paper: Emerging Properties in Self-Supervised Vision Transformers[ICCV 2021]️ GitHub: dino 结构框图Figure 1. Model overviewFigure 1. Algorithm 详解融合 ViT 模型使用 student gθs得到的结果 P1去预测 teacher gθt得到的结果 P2 效果Self-attention from a Vision Transformer with 8 × 8 patches trained with no supervision参考对比学习论文综述【论文精读】 14. CLIP Paper: Learning Transferable Visual Models From Natural Language Supervision[None 2021]️ GitHub: CLIP 结构框图Figure 1. Summary of the approachNumpy-like pseudocode 详解模型训练采用了一个非常大的数据集400 million 图片文字对imagetextCLIP 预训练模型可以在不需要任何数据集训练的情况下和一个有监督学习的模型达成平手甚至还会更高ImageNetResNet正样本对角线元素IiTi(1 ≤ i ≤ N);负样本除对角线元素外的其他元素 效果CLIP is much more efficient at zero-shot transfer than our image caption baselineLinear probe performance of CLIP models in comparison with state-of-the-art computer vision models
[ 对比学习篇 ] 经典网络模型 —— Contrastive Learning
发布时间:2026/6/16 14:32:10
AuthorHorizon John✨编程技巧篇各种操作小结神经网络篇经典网络模型算法篇再忙也别忘了 LeetCode[ 对比学习篇 ] 经典网络模型 —— Contrastive Learning 01. InstDisc 结构框图 详解 效果 02. InvaSpread 结构框图 详解 效果 03. CPC 结构框图 详解 效果 04. CMC 结构框图 详解 05. MoCov1 结构框图 详解 效果 06. SimCLRv1 结构框图 详解 效果 07. Mocov2 结构框图 详解 效果 08. SimCLRv2 结构框图 详解 效果 09. SWaV 结构框图 详解 效果 10. BYOL 结构框图 详解 效果 11. SimSiam 结构框图 详解 效果 12. Mocov3 结构框图 详解 效果 13. DINO 结构框图 详解 效果 14. CLIP 结构框图 详解 效果 01. InstDisc Paper: Unsupervised Feature Learning via Non-Parametric Instance Discrimination[CVPR 2018]️ GitHub: lemniscate.pytorch 结构框图Figure 1. The pipeline 详解每个图片看成一个类别利用memory bank来存储图像经神经网络编码后的特征128维正样本该图像本身 经过数据增强后的图像负样本数据集中其他的图像从 memory bank 中随机抽取4096个样本超参数设定temperatureτ 0.07NCE with m 4, 096 to balance performance and computing costtrained for 200 epochs using SGD with momentumbatch size 256learning rate is initialized to 0.03, scaled down with coefficient 0.1 every 40 epochs after the first 120 epochs 效果 02. InvaSpread Paper: Unsupervised Embedding Learning via Invariant and Spreading Instance Feature[CVPR 2019]️ GitHub: Unsupervised_Embedding_Learning 结构框图Figure 1. The framework 详解没有使用额外的数据结构去存储大量的样本信息正负样本都来自于同一个minibatch使用同一个编码器进行端到端的学习正样本该图像本身 经过数据增强后的图像2负样本其他图像 经过数据增强后的图像(batch size-1) × 2未能取得很好结果原因batch size 太小导致负样本数量较小 效果 03. CPC Paper: Representation Learning with Contrastive Predictive Coding[None 2018]️ GitHub: None 结构框图Figure 1. Model overview 详解可以应用于音频、图片、强化学习将输入当成序列利用前面的输入通过 RNN 或 LSTM 等网络输出来进行预测正样本预测结果负样本随机样本通过 genc得到的结果 效果 04. CMC Paper: Contrastive Multiview Coding[ECCV 2020]️ GitHub: CMC 结构框图Figure 1. Model overview 详解增大不同视角之间的互信息视觉、听觉、触觉数据集NYU RGBD包含原始图像、深度信息、SwAV ace normal、分割图像正样本同一图像的不同视角负样本其他图像缺点不同视角下使用的编码器不一样计算成本过高作者后来又提出了不同网络得到的特征也应该尽可能相似利用蒸馏网络teacher net student net 05. MoCov1 Paper: Momentum Contrast for Unsupervised Visual Representation Learning[CVPR 2020]️ GitHub: moco 结构框图Figure 1. Model overviewFigure 2. Conceptual comparison of three contrastive loss mechanisms 详解InstDisc 的改进提出了队列queue来解决 memory bank 中的大字典的问题提出了动量编码器来解决 字典中特征不一致的问题利用动态字典对 队列中的特征进行存储每一次更新得到的 k 都会取代最开始的 k 值动量编码器yt m·yt-1 (1-m)·xt使输出不完全依赖于当前的输入还会收到上一个输出的影响0 ≤ m ≤ 1 实现缓慢的更新每一次新的到的 k 值使字典中的特征尽可能的保持一致正负样本都位于 队列当中确保正负样本都是由同一个编码器提取得到的 效果 06. SimCLRv1 Paper: A Simple Framework for Contrastive Learning of Visual Representations[ICML 2020]️ GitHub: simclr 结构框图Figure 1. The framework 详解增大数据增强的数量编码后的特征再经过一个g(·) 函数MLP层 再求 loss 值实现更好的训练 特征编码器设置了更大的 batchsize训练时间更久 效果数据增强策略及效果 07. Mocov2 Paper: Improved Baselines with Momentum Contrastive Learning[None 2020]️ GitHub: None 结构框图Figure 1. A batching perspective of two optimization mechanisms for contrastive learning 详解借鉴 SimCLRv1 的策略添加了MLP层使用了数据增强训练时使用 cos learning rate schedule训练更多epochs 效果 08. SimCLRv2 Paper: Big Self-Supervised Models are Strong Semi-Supervised Learners[NeurIPS 2020]️ GitHub: simclr 结构框图Figure 1. The framework 详解使用更大的骨干网络模型增加 MLP层实验测试两层最佳使用动量编码器参考 MoCo 效果 09. SWaV Paper: Unsupervised Learning of Visual Features by Contrasting Cluster Assignments[NeurIPS 2020]️ GitHub: swav 结构框图Figure 1. Model overview 详解生成多个视角利用一个视角得到的特征去预测另一个视角的特征与聚类工作相结合利用聚类中心3000个进行预测cz1预测 Q2 cz2预测 Q1c 为聚类中心z1和 z2为提取的特征编码采用聚类中心可以降低采样的负样本数量从而减少计算成本解决正样本也纳入到负样本中导致的样本不均衡的问题提出Muti-crop的数据增强策略多尺度的剪裁原始图像作为数据增强 效果 10. BYOL Paper: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning[NeurIPS 2020] Blog: Understanding Self-Supervised and Contrastive Learning with “Bootstrap Your Own Latent” (BYOL)️ GitHub: byol 结构框图Figure 1. BYOL’s architecture 详解fθ和 fξ的网络结构一样模型参数更新不同fξ采用动量编码器更新gθ和 gξ是类似 SimCLR 的MLP层与 fθ和 fξ的更新策略一样在模型最后输出部分 zθ再经过一个 MLP层 得到 qθ(zθ)利用 qθ(zθ) 预测 z’ξ计算 loss 模型测试阶段使用 yθ作为输出 效果 11. SimSiam Paper: Exploring Simple Siamese Representation Learning[CVPR 2021]️ GitHub: simsiam 结构框图Figure 1. SimSiam architectureFigure 2. Comparison on Siamese architectures 详解较 BYOL 没有使用动量编码器进行参数更新总结性工作 效果Comparisons on ImageNet linear classificationTransfer Learning 12. Mocov3 Paper: An Empirical Study of Training Self-Supervised Vision Transformers[ICCV 2021, Oral]️ GitHub: moco-v3 结构框图Figure 1. Algorithm 详解结合 MoCov2 和 SimSiam 骨干网络替换成了 ViT 效果 13. DINO Paper: Emerging Properties in Self-Supervised Vision Transformers[ICCV 2021]️ GitHub: dino 结构框图Figure 1. Model overviewFigure 1. Algorithm 详解融合 ViT 模型使用 student gθs得到的结果 P1去预测 teacher gθt得到的结果 P2 效果Self-attention from a Vision Transformer with 8 × 8 patches trained with no supervision参考对比学习论文综述【论文精读】 14. CLIP Paper: Learning Transferable Visual Models From Natural Language Supervision[None 2021]️ GitHub: CLIP 结构框图Figure 1. Summary of the approachNumpy-like pseudocode 详解模型训练采用了一个非常大的数据集400 million 图片文字对imagetextCLIP 预训练模型可以在不需要任何数据集训练的情况下和一个有监督学习的模型达成平手甚至还会更高ImageNetResNet正样本对角线元素IiTi(1 ≤ i ≤ N);负样本除对角线元素外的其他元素 效果CLIP is much more efficient at zero-shot transfer than our image caption baselineLinear probe performance of CLIP models in comparison with state-of-the-art computer vision models