본문 바로가기

Deep Learning

Self-Supervised Learning

*사용된 모든 영문 image의 출처는 cs231n 강의 자료입니다.*

 

<Self-Supervised Learning>

    1. Self-Supervised Introduction

    2. Pre-text tasks

    3. Constrastive Learning


Self-Supervised Introduction

 

Pre-training

  • Pre-trained된 network의 feature들은 다양한 downstream task에서 사용됨 → supervision의 발달에 많은 영향

  • Pre-train on large superised dataset
  • Collect a dataset of "supervised" images
  • Train a Convolutional Network

 

 

 

 

Getting "real" labels is difficult and expensive.

→ Using the data itself: Self-Supervised

 

 

Self-Supervised Learning

  • Unsupervised Learning의 범주 내 존재
  • Semi-automatic process를 사용함으로써 data로부터 label 획득

(Input data의 한 부분이 다른 부분의 supervision 역할 수행)

  • Train network with predicting the "semi-automatically" obtained labels


Pre-text tasks

 

pre-text tasks: user가 새로운 문제(pre-text task) 정의

→ data 자체에 대한 이해도 ↑, transfer learning으로 다양한 downstream task 해결

Simple Self-Supervised Models in Computer vision

  • CE: Fill in the blanks
  • RotNet: Predicting the rotation
  • JigSAW: Solving the Jigsaw-puzzle

 

 

 

Evaluation Protocol

  • Fine-tuning을 통한 Trainsfer learning으로 pre-trained된 representation evaluate

 

Classification (ImageNet-10K)

  • Freeze a pre-trained model
  • Train a linear layer for down-stream tasks

 

Detection, Segmentation (PASCAL VOC)

  • Initialize with pre-trained model
  • Fine-tune the pre-trained model with an additional task-specific model

 

 

Missing in Pre-text task

  • pre-text tasks가 정말로 representation quality를 올렸는지 unclear하다 ..

→ Invariant mapping, Semantic Similarity 기법 사용

  • data 개수 만큼 class 개수를 생성하여 연산량이 많고 성능 향상이 더디다 ..

Why? 각 image마다 train이 진행되므로 data 개수 = class 개수가 된다.

 

 

What do we want from the learned representation

- Invariant mapping: representations should be stable for an slightly transformed version of an image

- Semantic Similarity: semantically related images should be close to each other 

 


Constrastive Learning

 

 

  • Supervised Learning의 classification 결과, 비슷한 image일 때 높은 확률값 도출

  • model이 따로 instance간 유사성을 train 안 해줘도 잘 추출된 특징값은 instance간 유사도 정보 발생

 

 

Constrastive Learning

  • Self-Supervised의 recent research trend
  • Positive pair (related image)와 Negative pair (unrelated image)로 구성

- Positive pair: 같은 image에 서로 다른 augmentation 후, 두 positive pair간의 거리 좁혀지게 train

- Negative pair: 다른 image에 서로 다른 augmentation 후, 두 negative pair간의 거리가 멀어지게 train

 

 

Constrastive Learning Loss Function

  • Related image의 embedding은 unrelated image의 embedding보다 가까워야 한다.

 

 

Data augmentation for Constrastive Learning

  • Positive (related)

  • Negative (unrelated)

Data augmentation으로 related image 생성

 

 

Framework of Constrastive Learning 

Framework of Constrastive Learning

→ Self-Supervised Learning은 label이 없지만 Supervised Learning Train을 하는 algorithm을 가진다.

 

cf) 최신 Self-Supervised Learning은 Supervised Learning보다 더 뛰어난 성능을 보인다..!

(Supervised learning network의 Negative성을 가지지 않는다.)

 

Problems of Constrastive Learning

  • Moving target으로 인한 unstable training

→ f(x)를 f(y)에 가깝게 이동시키면, f(y)는 다른 location으로 이동

(f(x)와 f(y)가 indentical network 공유)

Problem of&nbsp; Constrastive Learning

 

Solutions !!

  • A lot of Negtive samples: representation 이동을 제한하고 trivial solution을 피하기 위해 Negative sample 수 증가

- SimCLR

→ Huge batch size 사용

 

- PIRL

→ Memory-bank에 negative sample의 feature 저장

 

  • Fixed된 target network 사용

- MoCo

→ Momentum encoder를 사용하여 Negative sample fix

 

- MoCo v2

→ Momentum Eocoder + Memory Bank 사용

→ Reinforcement Learning에서 흔히 사용되는 기법

 

 

Ingredients for successful training

  • Data Augmentations
  • Number of negative samples
  • Non-linear projection layer

 

'Deep Learning' 카테고리의 다른 글

Pytorch Label Smoothing  (0) 2022.08.01
GAN generator Loss function  (0) 2022.06.15
Generative Adversarial Networks  (0) 2022.06.13
Attention Models  (0) 2022.06.12
Convolution 연산 시, channel 수 / filter 수와 parameter 수 관계 정리  (0) 2022.06.09