当前位置:网站首页>Deep learning (self supervision: simpl) -- a simple framework for contractual learning of visual representations
Deep learning (self supervision: simpl) -- a simple framework for contractual learning of visual representations
2022-07-28 06:09:00 【Food to doubt life】
List of articles
Preface
The article is Hinton and Google Published in 2020 ICML A self-monitoring article on .
Code address : https://github.com/google-research/simclr
In fact, I smell it when I read the article , It must be Google Home works , The experimental data are very detailed , It explores some characteristics of comparative learning for us .
This article will SimCLR Make a brief introduction , And simply record the interesting experiments .
SimCLR sketch

The picture above shows SimCLR Model structure of , The specific process is
- For an input image x x x Apply two different data enhancements , Get two pictures x i ~ \tilde{x_i} xi~、 x j ~ \tilde{x_j} xj~
- Input two pictures into one CNN The Internet f ( x ) f(x) f(x) The extracted features , obtain h i h_i hi、 h j h_j hj Two feature vector
- Two feature vector Through a MLP The Internet g ( x ) g(x) g(x) Handle , obtain z i z_i zi、 z j z_j zj
hypothesis batch size The size is N N N, Enhanced by data , You can get 2 N 2N 2N Zhang image ,SimCLR In comparative learning , Positive and negative examples are required .
Right picture x x x Apply two different data enhancements , obtain x i ~ \tilde{x_i} xi~、 x j ~ \tilde{x_j} xj~, after CNN、MLP Obtained after processing z i z_i zi、 z j z_j zj, z i z_i zi And z j z_j zj Form a positive example pair , z i z_i zi And batch size Other images in ( Including the image after data enhancement ) Of feature vector Form a negative example pair , therefore A picture will exist 1 A positive example is right , 2 N − 2 2N-2 2N−2 A negative example is right . The loss function of a picture is 
s i m ( z i , z j ) sim(z_i,z_j) sim(zi,zj) It means to calculate the cosine similarity of two vectors , T T T Is a super parameter , 2 N 2N 2N The sum of the loss functions of images is averaged , Get the final loss function , It's actually going on 2 N − 1 2N-1 2N−1 The classification of
Algorithm pseudocode 
experiment
The experimental part has many valuable parts , This paper explores some trick Yes SimCLR Influence , And some conclusions are given
Unless specifically mentioned , All experimental results in this section are based on SimCLR stay ImageNet1000 Pre train one ResNet-50, next freeze Feature extractor , Connect a linear classifier for training , After the training, the model is ImageNet1000 Accuracy on the test set .
Performance impact of data enhancement

Please refer to English for the meaning of the above figure , Three conclusions can be drawn
- Use a single data enhancement , The effect of comparative learning will be very poor
- random cropping And random color distortion The combination effect is the best
- The influence of data enhancement on comparative learning is very obvious , This is not a good property , Many times we need to make exhaustive trials and errors
Unsupervised contrastive learning benefits (more) from bigger models

The above figure shows the effect of image widening and deepening on the performance of the model ,R18(2x) Express ResNet18 Double the width , Other symbols, and so on .
To observe the above , I have the following conclusions
- When increasing the model capacity , First consider deepening ,ResNet152 Performance and ResNet18 Quite a few , And the parameter quantity does not rise much , Deepening the network is the first choice in practice
- Deep enough , Then consider the width , At this time, the parameter quantity will soar , Maybe the training speed will be much slower , Widening the network is the second best choice in practice
A nonlinear projection head improves the representation quality of the layer before it

The figure above explores z z z The influence of the dimension of on the linear classification performance of the model , z z z See for the meaning of SimCLR Brief section , so z z z The dimension of has little effect on the performance of the model , And nonlinear MLP Performance is better than linear MLP, This is in MoCo v2 It has also been verified in .
SimCLR There are two features that can be used in linear classification , One is the output of the feature extractor h h h, Two is MLP Layer output g ( h ) g(h) g(h)( See SimCLR Brief section ), In linear classification , Use h h h Better than g ( h ) g(h) g(h)( Greater than 10%), Probably because MLP Filter out some useful information
Contrastive learning benefits (more) from larger batch sizes and longer training

There are two conclusions that can be drawn from the above figure , For the comparative learning algorithm using negative examples
- batch size The bigger it is , The better the result. , And significantly improved , But for the comparative learning algorithm that only uses positive examples ( for example BYOL、simsiam),batch size Size does not have such a significant impact on performance
- Training epoch The longer the , The better the result. , This is also true for the comparative learning algorithm that only uses positive examples
边栏推荐
- Create a virtual environment using pycharm
- No module named yum
- Digital collections strengthen reality with emptiness, enabling the development of the real economy
- 速查表之各种编程语言小数|时间|base64等操作
- word2vec+回归模型实现分类任务
- 卷积神经网络
- transformer的理解
- 使用神经网络实现对天气的预测
- Idempotent component
- On July 7, the national wind 24 solar terms "Xiaoshu" came!! Attachment.. cooperation.. completion.. advance.. report
猜你喜欢

深度学习(自监督:CPC v2)——Data-Efficient Image Recognition with Contrastive Predictive Coding

Idempotent component

transformer的理解

Manually create a simple RPC (< - < -)

微信上的小程序店铺怎么做?

Dataset class loads datasets in batches

小程序开发要多少钱?两种开发方法分析!

微信团购小程序怎么做?一般要多少钱?

循环神经网络

深度学习(自监督:MoCo v2)——Improved Baselines with Momentum Contrastive Learning
随机推荐
First meet flask
Marsnft: how do individuals distribute digital collections?
alpine,debian替换源
mysql5.6(根据.ibd,.frm文件)恢复单表数据
将项目部署到GPU上,并且运行
Automatic scheduled backup of remote MySQL scripts
Utils commonly used in NLP
Svn incoming content cannot be updated, and submission error: svn: e155015: aborting commit: XXX remains in conflict
Sorting and paging, multi table query after class exercise
Dataset class loads datasets in batches
There is a problem with MySQL paging
微信小程序制作模板套用时需要注意什么呢?
知识点21-泛型
更新包与已安装应用签名不一致
Notice of attack: [bean Bingbing] send, sell, cash, draw, prize, etc
【六】redis缓存策略
KubeSphere安装版本问题
Kotlin语言现在怎么不火了?你怎么看?
分布式集群架构场景化解决方案:集群时钟同步问题
NLP project actual custom template framework