[Boostcamp AI Tech] [U-stage] 7주차 Day 4 학습 기록

bluegun·2021년 9월 17일
0

AI Tech 2기 활동

목록 보기
32/87

학습 내용


Multi modal learning

  • modal : 하나의 데이터 특성을 의미? 시각, 청각, 언어 등..

  • multi-modal : 여러 형태의 데이터를 사용해 학습하는 방법

  • multi modal로 학습하는 데 어려운 점

    • 데이터 형태가 전부 다 다르다.
    • 데이터의 feature space간 unbalance가 존재
      • Text로는 의자 하나로 표현할 수 있는 것이, Image로는 N개 존재할 수 있다.
    • modal 중 학습하기 편한 하나의 modal에 bias될 수 있다.
  • multi modal의 일반적 구조

    • matching : 각 data type을 공통된 space로 보내 서로 matching 가능하게 만든다.
    • Translating : 하나의 modality를 다른 modal로 translation 시킨다.
    • Referencing : 하나의 modality에서 다른 modal로 output을 내는데, 이 때 다른 modal을 참조하는 형태로 상호작용

Multi modal with visual data & text

  • text는 보통 word 단위, word는 보통 embedding dense vector로 되어있다.

  • dense vector로 학습시키면 자동으로 generalization power가 생긴다.

    • 2D로 projection해서 관찰했을 때, cat은 horse보단 dog에 가깝고, kitten과 거리가 많이 가깝다.
    • man-woman의 관계를 vector로 표현하면 그 만큼의 차이를 vector로 표현할 수 있는데, 그 vector를 king에 더하면 queen과 매칭이 된다!
  • word2vec - Skip-gram model

    • 2D matrix 형태에서 row가 하나의 word를 의미하며, 한 단어만 one으로 one-hot encoding되어 입력된다.
    • 현재 word를 기준으로 다른 N개의 word들과 비교해, 다음에 나올 단어를 학습한다.

Joint embedding
Matching 하기 위한 공통된 embedding vector를 학습하는 방법.

  • Image tagging
    • image에 해당하는 단어를 tag로 단다.
    • tag to image, image to tag 다 가능
    • 구현 : pretrained unimodal model을 합친다.
    • Metric learning : 2D에서 같은 image와 text는 유사성 있게, 가까워지게 하고 다른 것들은 멀어지게 학습한다.
    • image에 해당하는 text를 빼고, 다른 text를 더하면, 더한 text와 일치하는 image가 나온다. (ex. 개 이미지 - dog + cat = 고양이 이미지, 이 때 학습한 개 이미지와 비슷한 배경의 고양이가 nearest image로 나온다.)
  • Recipe text vs food image
    • Image tagging의 활용
    • recipe의 재료를 ingredient encoder에 학습, 조리 방법을 instruction encoder로 학습 후, 둘을 concatenate후 fc layer로 학습하여 text를 대표하는 embedding vector를 만든다.
    • image는 CNN backbone network를 활용해 embedding vector와 똑같은 dimensional vector로 만든다.
    • 두 vector의 cosine similarity loss : 두 vector의 연관성을 loss로 학습한다.
    • 두 vector의 semantic regularization loss : high-level semantic을 계산
      • ex. image와 recipe가 fried fish란 정보를 공유한다 -> fried fish만은 제대로 학습하도록 조정할 수 있다.

Cross modal translation
Translating을 활용하는 방법론.

  • Image captioning
    • Image가 주어지면 Image를 가장 잘 설명하는 text description을 생성
    • image는 CNN, sentence는 RNN 활용 -> 둘을 잘 합치는게 중요
    • Show and tell : CNN과 RNN 합침
      • Encoder로 ImageNet에 pretrained 된 CNN model 사용
      • Decoder로 LSTM 활용
    • Show, attend, and tell
      • Image를 encoding 할 때, Image의 중요한 부분을 referencing하도록 하여 정확한 sentence를 만들 수 있게 함.
      • Show and tell과 비교해, CNN part에서 fixed dimensional vector를 추출하는 게 아닌 14*14 Feature map을 추출하여 RNN에 넣는다. 이를 통해 공간정보를 유지할 수 있다.
  • Text-to-image by generative model
    • Text에서 Image를 만든다면, 하나의 image로 mapping되진 않고 여러 개의 image가 만들어질 수 있을 것이다 -> generative model이 필요하다.
    • Generator Network
      • text를 fixed dimensional vector로 바꾸고 gaussian random code를 취한다 -> 똑같은 input에 다양한 output이 나올 수 있도록 한다.
      • Conditional GAN 사용 -> 최종 image 추출
    • Discriminative Network
      • encoding 영상의 spatial feature를 뽑고 처음의 text 정보를 같이 줘서, sentence condition 하에 영상이 true이냐 false이냐 판별

Cross modal reasoning
Referencing을 활용하는 방법론.

  • Visual question answering
    • Image stream, Question stream : 각각 CNN, RNN 구조를 활용해 fixed dimensional vector 추출
    • 둘을 point-wise multiplication
    • 여기까지는 일종의 joint embedding인데, 이 후 End-to-End training을 진행한다.

Multi modal with visual data & Audio

Waveform to spectrogram : Acoustic feature extraction

  • Short-time Fourier transform(STFT)
    • 짧은 시간축 내에서 FT를 적용
    • window 활용, 적당히 겹치게 사용
  • Video에도 위에서 언급한 matching, translating, referencing 방법론 적용 가능

Joint embedding
Application : sound를 통해 해당 sound가 발생하는 장소를 특정해 장면을 인식

  • SoundNet
    • Audio를 Raw waveform으로 추출해서 CNN에 넣는다.
    • Unlabeled video dataset을 pretrained Visual recognition network에 넣어 Object, scene distribution 진행
    • video dataset의 Audio를 Raw waveform으로 추출해서 CNN에 넣는다.
    • CNN을 거쳐 2개의 output을 만들어, 이를 각각 Object distribution, scene distribution의 결과와의 KL divergence를 기준으로 학습시킨다.
    • pool5 까지가 generalize된 feature를 갖고 있어 이를 보통 pretrained model로 활용하고, 이 후의 layer는 object detection, scene detection에 fitting 되어있다고 한다.

Cross modal translation

  • Speech2Face

    • 음성을 듣고 그 사람의 얼굴을 상상해내는 network
    • Waveform -> Spectogram -> Voice Encoder -> Face Decoder -> Recognized Face
    • Face recognition to Face feature, Face decoder to Recognized face 부분을 따로 학습하는 module network 구조
    • voice encoder의 출력과 face feature의 loss를 줄이도록, teacher-student 구조로 학습한다.
    • Face decoder는 Face feature에 맞게 학습되어 있으므로, 위의 loss만 잘 학습돼도 voice to face가 잘 동작한다.
    • self-supervised 방법
  • Image-to-speech-synthesis

    • Image가 주어지면 이로부터 speech를 뽑아내는 application

Cross modal reasoning

  • Sound source localization
    • sound와 image가 주어졌을 때, 그 소리가 image의 어디서 났는지를 판별

느낀 점

  • multi modal learning이란 방법론을 처음 접했는데 굉장히 신선하고 앞으로 새로운 가치를 창출해내기 좋은 기술이라는 생각이 들어서 좋았다. 미래에 내가 흥미를 갖고 공부할 만한 분야로 기억해 놓으면 좋을 것 같다.

0개의 댓글