2. > Self Supervised 2020년부터
SimCLR, MOCO : Imagenet SL에 근접한 Self Supervised 할아버지들 (2020 초)
BYOL, SWAV : 할배들 이겨보자~ 방법론 이것저것 써본다 (2020 중)
BT, SimSiam : SSL 하는데 너무 트레이닝 트릭들이 많아서 귀찮고! Computing Power 너무 많이 쓰는 듯? 못
살겠다 줄여보자! (2020 말, 2021 초)
PAWS : 겟 서거라 Semi Supervised도 나가신다~
LeCun, Kaming He, Hinton etc
3. SimCLR: A Simple Framework for Contrastive Learning of Visual Representations (2020)
1. Supervised를 따라잡기 시작
2. Batch 내에서 Positive-Negative Pair
3. Nonlinear Projection Head
의의
4. SimCLR: A Simple Framework for Contrastive Learning of Visual Representations (2020)
방법론
Contrastive Learning
- Data Augmentation ( Generate Pair )
- Similarity Loss
5. SimCLR: A Simple Framework for Contrastive Learning of Visual Representations (2020)
방법론
Contrastive Learning - Data Augmentation ( Generate Pair )
1. multiple transform이
single transform 보다
acc이 높음
2. color distortion은
self-supervised에서 긍
정적인 영향
6. SimCLR: A Simple Framework for Contrastive Learning of Visual Representations (2020)
방법론
Contrastive Learning - Data Augmentation ( Generate Pair )
7. SimCLR: A Simple Framework for Contrastive Learning of Visual Representations (2020)
방법론
Contrastive Learning - Similarity Loss (NT-Xent loss)
8. SimCLR: A Simple Framework for Contrastive Learning of Visual Representations (2020)
한계
1. 엄청난 Computation ( Batch Size )
2. Negative Pair가 항상 Negative Pair를 보장하지 않음 (Cat1
- Cat2 페어도 Negative로 계산)
3. 비교적 적은 데이터셋 (CIFAR)에서는 유사하거나 낮음 -
Linear Protocol
4. Resnet-50를 (width) 4x 키워 큰 모델에서 사용
9. MOCO : A Simple Framework for Contrastive Learning of Visual Representations (2020)
의의
1. Supervised에는 못 미쳤지만… FB도 놀고 있지 않았다!
+ Segmentation/Detection COCO, VOC는 이겼다!
10. MOCO : A Simple Framework for Contrastive Learning of Visual Representations (2020)
방법론
Positive/Negative Pair
- Batch : Batch Size에 종속
- Memory Bank : pre-calculated feature라서… inconsistency 문제 있음
=> Dynamic Dictionary
- Dictionary as a queue
: Memory Bank Queue를 Mini Batch Size보다는 크게 유지하며
Feature를 저장해둔다
- Momentum update
: Key Encoder가 Query Encoder보다 천천히 업데이트 되도록 함
11. MOCO… updates
방법론
v2
1. Feature Head를 SimCLR처럼 MLP non linear 추가해서 학습
2. Blur Augmentation 추가
3. Cosine Learning Rate decay 추가
v3 (2021)
1. Dynamic Dictionary를 큰 Batch Size로 대체
~ batch size에 따라 적절한 lr을 찾고, AdamW~LAMB Opt 사용
2. Resnet 말고 Transformer (ViT)에 사용함
3. ViT의 학습 불안정성을 Fixed Random patch projection으로 해결
12. BYOL: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning (2020)
의의
DeepMind도 안 잔다!
1. Contrastive Learning에서는 충분한 Negative Pair가 성능을
좌우하여… Negative Pair을 안쓰는 방법을 고민해봄
2. SimCLR에 비교해 BatchSize와 Transform에 “덜” 민감함
https://hoya012.github.io/blog/byol/
13. BYOL: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning (2020)
방법론
https://hoya012.github.io/blog/byol/
data aug
encoder mlp
mlp
Online
Network
Target
Network
Target Network는 Online Network를 Momentum update를 통해
Following 함 == Exponential Moving Average
14. BYOL: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning (2020)
방법론
https://hoya012.github.io/blog/byol/
BYOL Moving Average
MOCO Momentum
15. BYOL: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning (2020)
방법론
https://hoya012.github.io/blog/byol/
Loss == MSE Loss
Online-Target Input을 교체한
Symmetric Loss 추가
16. BYOL: Bootstrap Your Own Latent A New Approach to Self-Supervised Learning (2020)
한계
https://hoya012.github.io/blog/byol/
1. 그래도 큰 Batch Size (4096)와 모델
2. 여전히 작은 데이터셋에서는 비교적 SL보다 떨어짐 -
Linear Protocal
17. SWAV: Unsupervised Learning of Visual Features by Contrasting Cluster Assignments (2020)
의의
1. 일단… 또 SOTA
2. 비교적 작은 배치 (256)에서 SimCLR를 이김
3. Single Image Random Crop이 가지고 있던 View 수가 2개 뿐
이 였던 한계를 Multi-Crop으로 성능 향상
Swapping으로 Clustering을 통해 Feature를 학습하는 시도
18. SWAV: Unsupervised Learning of Visual Features by Contrasting Cluster Assignments (2020)
방법론
1. Feature to Prototype vector
2. Swap Assignment
19. SWAV: Unsupervised Learning of Visual Features by Contrasting Cluster Assignments (2020)
방법론
Feature to Prototype vector & Loss
-> z는 feature vector, q는 prototype vector
20. SWAV: Unsupervised Learning of Visual Features by Contrasting Cluster Assignments (2020)
방법론
Multi Crop
- SimCLR 같은 논문에서는 224
Random Crop으로 1 Pair만을 만
들었지만, 96 Random Crop을 한
이미지에서 N회 추가로 하여 더 많
은 Pair를 만들어낼 수 있다
https://wandb.ai/authors/swav-tf/reports/Unsupervised-Visual-Representation-Learning-with-SwAV--VmlldzoyMjg3Mzg
21. SimSiam: Exploring Simple Siamese Representation Learning (2020)
의의
1. SimCLR, MOCO 같이 자꾸 negative sample 쓰는건 너무 힘
들어! - 클러스터링, moving average 다 없이 할거야!
= Stop-Grad + 샴 구조로 SSL 하기
2. Batch Size도 안 커도됨! (64부터 실험해봄 ㅋ), epoch도 작음
https://medium.com/analytics-vidhya/simsiam-paper-explained-df3577cab49e
24. SimSiam: Exploring Simple Siamese Representation Learning (2020)
한계
https://medium.com/analytics-vidhya/simsiam-paper-explained-df3577cab49e
25. BT: Barlow Twins: Self-Supervised Learning via Redundancy Reduction (2021)
의의
LeCun의 논문
1. Feature Cross Correlation Matrix를 통해 Loss 계산
2. Batch 사이즈가 비교적 작고, moving average, 추가 테크닉들
이 없이 high-dimension vector 학습에 성공함
3. 음 이것도 negative가 없어도 되네요!
간단한데 잘되네….?
페북 코드보면 걍 main.py 하나에 다 때려박음 300줄 ㄷ
26. BT: Barlow Twins: Self-Supervised Learning via Redundancy Reduction (2021)
방법론
Feature를 0~1 Normalize 후에 Cross-Corr 계산해서 Identical Vector Target으로 Loss 계산함
Transform은 Flip, Color Jitter, Grayscale, Blurring, Solarization