논문 읽기/Zero shot

[논문 읽기] Zero-Shot Learning(ZSL) 이란?

AI 꿈나무 2021. 10. 4. 19:37
반응형

 

 새로운 분야 공부를 시작할 때, survey 논문을 먼저 보는 편인데 Zero shot에 흥미가 생겨서 survey 논문을 읽어봤다. Zero-Shot learning 에 대해 설명되어 있는 한국어 자료가 많이 없는 것 같아서 한번 글로 작성해본다.

 

https://arxiv.org/abs/2011.08641

 

A Review of Generalized Zero-Shot Learning Methods

Generalized zero-shot learning (GZSL) aims to train a model for classifying data samples under the condition that some output classes are unknown during supervised learning. To address this challenging task, GZSL leverages semantic information of the seen

arxiv.org

 

 더 정확히 말하면 zero shot이 아니라 generalized zero shot에 대한 survey 논문인데, 이 둘의 차이점이 뭔지부터 살펴보겟다.

 

Zero-Shot Learning(ZSL) vs Generalized Zero Shot Learning(GZSL)

 

일반적으로 딥러닝은 training에 사용된 class만을 예측할 수 있다. 따라서 unseen data가 입력되면 seen class로 예측하는 바보가 되버리는데, Zero shot은 train set에 포함되지 않은 unseen class를 예측하는 분야이다.

 

 즉, unseen data를 입력 받아도, seen data로 학습된 지식을 전이하여 unseen data를 unseen class로 예측할 수 있다.

 

 open set recognition은 unseen data를 unseen으로 몰아넣는 반면에, ZSL은 unseen data의 구체적인 class를 예측한다.

 

 위 그림을 보면 Zero shot과 GZS의 차이점은 test에 있다.

 

 ZSL는 test시에 unseen data만을 입력 받아 class를 예측하고, GZSL은 test시에 unseen, seen data를 둘 다 입력 받아 예측을 수행한다.

 

 real world 관점에서는 unseen과 seen data를 입력 받는 상황이 대체적 이므로 GZS이 더 적합하다고 볼 수 있다.

 

How? 

 그러면 어떻게 training set에 포함되지 않은 unseen data를 예측할 수 있을까?

 

 그 이유는 semantic information에 있다.

 

 semantic information은 여러 종류가 될 수 있는데, 한 가지 예시를 들면 data의 class를 word embedding으로 사용하는 것이다.

 

 one-hot vector를 class로 주어 학습된 딥러닝 모델은 강아지와 고양이의 관계를 모르지만, class를 word embedding된 sentence로 주어 학습한다면 이 딥러닝 모델은 강아지와 고양이의 관계를 알 수 있다.

 

 이렇게 seen data와 semantic information으로 학습된 지식을 unseen data를 예측하는데에 사용하는 것이다.

 

 따라서 ZSL 모델은 seen data에 overfit될 수 있는데 이로부터 문제점이 발생한다. 또한 GZSL 환경에서 성능이 저하된다. 즉, unseen data를 seen class로 예측할 수 있다는 말이다. 발생하는 문제점은 아래에서 살펴보겠다.

 

 다른 semantic information은 객체의 attributes가 될 수 있는데 이것은 객체의 특성(크기, 색상, 다리 갯수) 등을 label하여 하나의 벡터로 표현해 class로 입력해주는 것이다. 그러면 사람이 또 annotation 해야 하는데 대량의 데이터셋은 적합하지 않다. word embedding 방법을 사용하면 word2Vec이나 BERT의 사전 학습된 word vector를 가져올 수 있으므로 semantic information은 word vector가 적합하다고 볼 수 있다.

Generalized Zero Shot Learning(GZSL)

 

 GZSL은 활용하는 정보에 따라 3가지로 분류할 수 있다.

 

(1) Transductive GZSL

 Transductive GZSL은 seen, unseen의 visual feature와 semantic information을 모두 활용한다. 실제 환경에서 unseen에 대한 visual feature를 얻는 것이 불가능하므로 real word 환경에서 적합하지 않다고 볼 수 있다.

 

(2) Transductive semantic GZSL

 seen의 visual feature, semantic information과 unseen의 semantic information을 활용한다. 그러면 unseen의 visual feature이 없는데 어떻게 해야 할까??

 

generative-based methods

 

 한 가지 예시를 설명하면 generative-based methods에서 unseen에 대한 image를 생성한다.

 

 seen의 semantic representation을 입력 받아 seen image를 생성할 수 있다면, unseen에 대한 semantic representation을 입력 받으면 unseen image를 생성할 수 있다는 가정에서 시작한다.

 

 generative model로 생성한 unseen data를 traning set에 넣어 함께 학습시켜 unseen에 대한 예측도 수행할 수 있도록 하는 방법이다.

 

 이 generative based method는 real visual feature의 실제 분포로부터 unseen class에 대한 visual feature를 제대로 생성해내지 못할 수 있다는 문제점이 있다.

 

 내가 가장 관심있는 방법이 이 generative based method 이다.

 

embedding based method

 

 다른 방법으로는 embedding based method인데, 동일한 클래스에 대한 visual feature를 semantic embedding space로 가깝게 mapping한다. 그러면 unseen 에 대한 visual feature를 입력 받았을 때, seen 으로 학습한 embedding space 상에서 적합한 위치에 projection 하게 되는데 이에 해당하는 semantic information이 unseen class가 되는 것이다.

 

(3) inductive GZSL

  seen의 visual feature와 semantic information만을 입력 받아 학습이 진행된다. 어떻게 보면 가장 어려운 task라고 볼 수 있다.

 

GZSL Methods

 

 

 위 그림처럼 GZSL 방법은 정말 다양하다. 큰 범주로 나누면 embedding-based method와 generative-based methods로 볼 수 있다.

 

Embedding Space

 

 GZSL은 seen class의 저차원 visual feature를 그에 해당하는 semantic vector로 mapping/embedding하는 함수를 학습하는 것으로 볼 수 있다.

 

 visual feature 사이에는 큰 variation이 존재하는데, 강아지와 고양이의 visual feature의 연관성이 적기 때문이다. semantic information은 둘의 연관성을 잘 알고 있으므로 variation을 줄일 수 있다.

 

a) visual -> semantic embedding

 이 방법은 GZSL이 학습한 함수가 visual space의 vector를 semantic embedding으로 mapping하는 방법이다.

 

 

 W가 학습된 함수, x는 visual feature, a는 semantic information이다. 두 번째 항의 람다는 정규화항.

 

b) Semantic -> visual embedding

 이 방법은 semantic vector를 visual embedding으로 mapping하는 함수를 학습하는 방법.

 

 

c) Latent Embedding

 latent embedding은 visual feature와 semantic representation을 common space L로 projection하여 동일한 클래스에 해당하는 visual, semantic vector는 common space L 내에서 가깝게 project하는 함수를 학습하는 방법이다.

 

Challenging Issues

 대표적으로 hubness problem과 domain shift problem, biased towards the seen classes 문제가 존재한다.

 

(1) hubness problem

 ZSL와 GZSL은 visual feature를 semantic space로 project하고, 고차원 space에서 nearest neighbor search를 하여 unseen에 대한 class를 예측하므로 nearest neighbors에 치명적인 차원의 저주문제가 발생한다. 차원의 저주는 차원이 높아질 수록 data 사이의 거리가 멀어지는 문제

 

(2) domain shift problem

 

 seen class의 data로 ZSL, GZSL의 mapping 함수가 학습되었으므로 unseen class에 대한 adaption이 없다면 domain shift problem이 발생한다. 이 문제는 주로 unseen의 아무런 정보없이 학습하는 inductive based method에서 발생한다.

 

(3) biased towards the seen classes

 

 GZSL 방법은 seen class의 data로 모델을 학습하여 unseen과 seen class를 분류하기 때문에, biased towards the seen classes 문제가 발생한다. unseen class의 data를 seen class로 분류하는 것이다. 이 문제를 해결하기 위해 여러 방법들이 고안되었는데... 자세한 사항은 잘 모르겠음.

 

Performance Indicator

 GZSL 방법의 performance를 평가하는 metric.

 

 seen과 unseen에 대한 정확도가 기본적으로 쓰이고 Harmonic mean(HM)이라는 metric이 존재한다.

 

 

 GZSL 방법은 seen class쪽으로 편향이 되어 있는데, seen에 대한 정확도가 unseen 보다 높으면 이 HM score는 하락한다.

 

Performance

 embedding-based method

 

generative-based methods

 

transductive-based method

반응형