티스토리 뷰

728x90
  • Zero-shot learning: 인스턴스별 레이블 없이 학습
  • Few-shot learning: 몇 가지 훈련 예제로 학습
  • Unsupervised learning: 레이블 없는 학습. 제로샷 학습과의 차이점
    • Auto-encoders, contrastive learning
    • Generative models: GANs, VAEs

 

Semi-supervised laerning

라벨 정보가 없는 이미지의 큰 데이터셋이 존재한다면, 이것을 어떻게 다룰 것이닞?

Pseudo-labeling 방법이 있다.

 

 

Pseudo-labels

 

  • Iterative algorithm:
  1. Train a classifier $f$ on $D_1$
  2. Pseudo-labelling: build dataset $D_2$ where we used $f$ to label the images of $D^{prime}$ (without labels)
  3. Train another classifier $f_2$ on $D_2$
  4. We can build D3 where we use $f_2$ to label the images of $D^{prime}$ → improve the pseudo-labelling
  5. ...

 

언제 준지도학습을 사용하나요?

  • 모든 이미지에 라벨이 지정되어 있지 않을 때
  • 모든 수업에는 레이블이 지정된 이미지가 있어야 함
    • 그렇지 않은 경우엔 어떻게 해야 하는지? → 제로샷 학습, 비지도 학습
  • 여전히 각 클래스가 제대로 작동하려면 많은 레이블이 labelled examples이 필요함

 

 

Few-shot laerning

언제 few-shot learning을 사용하나요?

  • 완전히 주석이 달린 데이터셋이지만 모든/일부 클래스에는 훈련 예제가 거의 없는 경우
  • Notation: class 당 N개의 예시만 있는 경우, N-shot learning이라고 함
  • 예: 5-shot learning, 1-shot learning

 

여러 방법이 있는데

  1. Data-level approach
  2. Metric learning approach
  3. Parameter-level approach (not covered in this course)

등이 있습니다.

 

데이터가 충분하지 않을 때는 어떻게 해야 합니까? 더 많은 데이터를 얻어야 합니다.

 

1. Data-level approach - Data Augmentation

하나의 이미지는 많은 이미지를 생성할 수 있고, 이미지를 임의로 변환하여 데이터 세트 크기를 인위적으로 늘립니다.

 

2. Data-level approach - Transfer learning

다른 데이터셋을 사용하고, 이 데이터셋에서 모델을 사전 훈련 시키고 몇 가지 예에서 finetuning합니다.

 

3. Metric-learning approach

이미지 공간에 거리를 부여하고, 두 이미지를 비교하는 방법을 찾습니다.

이미지의 추상적인 표현이 필요합니다. 이를 feature vector라고 합니다.

 

 

feature vector를 얻는 방법으로는 뉴럴 네트워크를 학습 시키는 방법이 있습니다.

 

다른 데이터셋에서 학습한 네트워크를 사용하는 방법인 Transfer learning이 돕습니다.

 

 

 

그때 우리는 feature vector를 비교합니다.

 

여기서 d가 작다는 건 어떤 것을 의미합니까? 이미지가 공간적으로 가깝다는 것을 의미합니다.

 

이제 이미지를 어떻게 분류합니다. 만약 클래스마다 N개의 이미지가 있다면 이는 N-shot learning이며, 클래스 별 표현을 추출합니다.

 

 

이미지의 특징 벡터를 클래스 표현과 비교합니다. 이를 "Compatibility function"이라 합니다.

 

그 다음엔 메타 러닝을 활용한 매개변수 수준의 접근 방법이 있고, 1회 미만의 학습 방법인 Zero-shot learning이 있습니다.

 

 

Zero-shot laerning

 

Vocabulary:

  • Seen” class: we have labelled images of this class in the training dataset.
  • Unseen” class: there are no images of this class in the training dataset.
  • Semantic vector”: vector containing the extra information. 

 

새로운 unseen data에서 이미지를 인식하기 위해선 unseen classes가 어떻게 생겼는지에 대한 추가 정보를 활용해야 합니다.

 

 

First method: compatibility function

 

이 함수를 최소화하는 것을 원하는데

  • 만약 $y = y_n$이라면 0입니다.
  • $d(f_n, y) > d(f_n, y_n)$이면 1보다 큽니다.
  • $d(f_n, y) < d(f_n, y_n)$이면 0보다 크고 1보다 작습니다.

이런 방식으로 손실 함수를 계산합니다.

 

다른 접근 방식으로는 generative approach가 있습니다. 이미지의 feature vector를 더 쉽게 생성할 수 있습니다.

 

이미지의 feature vector를 생성하는 것은 쉽습니다.

 

정리하자면, Zero-shot learning은 unseen classes에 대해 이미지에서 인식하는 것을 의미하고, 크게 Compatibility function을 사용한 Discriminative와 Generative 방법이 있습니다.

 

그리고 마지막으로 이제 라벨이 없다면 어떻게 해야할까요?

 

Unsupervised laerning

 

annotation 없이 학습할 수 있습니다.

  • Clustering (~ classification)
  • Anomaly detection
  • Image generation
  • Image restoration

이 있습니다.

 

Auto-encoder와 Generative model에 대해 다룹니다.

 

아이디어는 이와 같습니다.

  • 데이터에 레이블을 지정할 필요가 없는 새로운 대리 작업을 찾습니다.
  • 이 작업을 사용하여 feature extractor를 훈련시킵니다.
  • 학습된 feature의 clustering 알고리즘을 사용합니다. (K-mean, spectral clustering...)
  • 클래스당 하나의 예에 주석을 달고 few-shot learning을 사용합니다.

 

Contrastive learning 방법이 있습니다.

  • Image reconstruction
  • Image denoising
  • Patch from same image / different image
  • Matching image - text-description
  • (readily available online, instagrams with hashtags, image descriptions, …)

 

Auto-encoders

 

이건 latent representation입니다. 어떻게 학습하나요? 원본 이미지를 다시 복구하는 방법입니다.

 

여기서 denoising과 image super-resolution의 기술을 사용합니다.

 

the encoder

이미지의 벡터 표현을 갖고 있습니다. 이는 일반적인 사전 훈련된 few-shot learning에 유용합니다.

the decoder

이미지 생성을 할 수 있을까요? 임의의 x를 샘플링하고 최고 성능을 기대합니다.

 

하지만 실제로는 그렇지 않습니다. latent space는 충분한 구조가 되지 못합니다.

 

 

 

지금까진 우리는 방법에 대한 인코더가 필요했고 디코더에 초점을 맞추게 됩니다.

 

새로운 목표는 이전에 볼 수 없었던 새로운 이미지를 생성하는 생성 모델입니다. VAEs, GANs

 

VAEs

  • 더 구조화된 잠재 공간 → 더 나은 생성 기능
  • 잠재 공간에 사전 분포 N(0, 1) 부여
  • reparameterization trick을 사용하여 auto-enocder로 역전파합니다.

 

장점으론 잠재 공간에 더 좋은 속성이 있다는 점과, 일반 auto-encoder보다 reconstruction이 더 나쁩니다.

 

GANs

  • 훈련이 극도로 복잡하고 불안정합니다.
  • 보다 안정적으로 만들기 위한 많은 정규화 방법이 있습니다.
  • 잠재 공간은 VAE만큼 좋지 않습니다.
  • 인코더가 없습니다.

 

 

두 가지를 비교해보면 이렇습니다.

  • 의미 있는 잠재 공간이 있는 멋진 인코더를 원한다면? VAE
  • 고화질 이미지를 원한다면? GAN
  • 한 이미지를 다른 이미지로 멋지게 변형하고 싶다면? VAE
  • 내 이미지를 벡터로 압축하고 충실하게 재구성하고 싶다면? VAE
  • 잠재 공간을 탐색하여 생성된 이미지를 편집하고 싶다면? VAE / GAN

 

 

Recap

Semi-supervised learning

  • In the training set...
    • All the classes should have annotated examples?  ✔️
    • All the images should be annotated? ❌
    • Training set can be just a few examples? ❌
    • Some examples need to be labelled?✔️

 

Few-shot learning

  • In the training set...
    • All the classes should have annotated examples? ✔️
    • All the images should be annotated?
    • (If you have unlabelled data, use an unsupervised method to pre-trained a feature extractor!)
    • Training set can be just a few examples? ✔️
    • Some examples need to be labelled?✔️

 

Zero-shot learning

  • In the training set...
    • All the classes should have annotated examples? ❌
    • All the images should be annotated?❌
    • (If you have unlabelled data, use an unsupervised method to pre-trained a feature extractor!)
    • Training set can be just a few examples? ❌
    • Some examples need to be labelled?✔️

 

Unsupervised learning

  • In the training set...
    • All the classes should have annotated examples? ❌
    • All the images should be annotated?❌ 
    • Training set can be just a few examples? ❌
    • Some examples need to be labelled?❌

 

이러한 접근 방식의 대부분은 레이블 수를 줄일 수 있지만 훈련 데이터의 양은 줄일 수 없습니다! 신경망을 올바르게 일반화하려면 많은 데이터가 필요합니다.

 

728x90

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

Fine-Grained Image Classification이란?  (0) 2023.04.14
What's in a "Domain"  (0) 2023.03.19
밑시딥3 정리  (0) 2023.03.08
Pretraining and Fine-tuning  (0) 2022.11.25
Siamese Networks for Pairwise Similarity  (0) 2022.11.25
댓글