On the journey of
[논문읽기] CLIP : Learning Transferable Visual Models From Natural Language Supervision 본문
[논문읽기] CLIP : Learning Transferable Visual Models From Natural Language Supervision
dlrpskdi 2023. 10. 7. 13:38Multi-Modal 및 NLP, Multi task 관련 논문작업을 시작할 수도 있어서 (자세한 설명은 생략) 멀티모달 관련 공부를 시작했다. 멀티모달 같은 경우 처음은 아니지만 경험이 많은 건 더더욱 아니라서 ^.^ CV와 함께 공부해야 할 것 같다 :-)
Original Paper ) https://arxiv.org/abs/2103.00020
Learning Transferable Visual Models From Natural Language Supervision
State-of-the-art computer vision systems are trained to predict a fixed set of predetermined object categories. This restricted form of supervision limits their generality and usability since additional labeled data is needed to specify any other visual co
arxiv.org
Abstract
- supervision 방식은 generality와 usability를 한정지음.
- 캡션이 어떤 이미지에 붙여지는 지를 예측하는 pre-training task
- 다양한 downstream task로 확장이 가능함
Introduction and motivating work
- 자연어처리 분야에서는 라벨링된 좋은 품질의 NLP 데이터셋보다 웹에서 모을 수 있는 텍스트를 이용한 pre-training 모델이 성능이 좋다.
- 멀티모달 분야의 발전에 대한 흐름
- 이 논문에서는 CLIP이라는 모델을 통해 두 방법(weakly supervised approach & zero shot learning using raw text)간의 차이를 줄임
- CLIP(Contrastive Language-Image Pre-training)은 zero-shot transfer, 자연어 supervision, multimodal learning에 대한 대규모 작업을 기반으로 함
- CLIP은 기존의 task-specific supervised model들과 성능이 비슷할뿐만 아니라 몇몇의 경우에서는 뛰어넘는 성능을 보여줌
Approach
2.1. 자연어 supervision
- 자연어를 이용하여 학습하는 것은 다른 학습 방법들보다 몇가지 잠재적인 능력을 가지고 있다.
- scaling이 쉬움. 기존의 라벨링 방식은 사람이 직접 표기를 해서 gold label을 만들어야 했었는데 자연어를 이용하게 되면 그러한 과정이 필요없음
- 표현을 "그냥" 배우는 것이 아니라 유연한 제로샷 전송을 가능하게 하는 언어에 해당 표현을 연결
2.2. Creating a Sufficiently Large Dataset
- 4억개의 데이터셋(이미지, 텍스트 쌍)을 수집하고 만들어 사용
2.3. Selecting an Efficient Pre-Training Method
- Image CNN + Text Transformer (like VirTex) → 스케일링을 하는데 효과적이지 않음
- 계산량 및 속도의 측면
- Bag of Words Contrastive > Bag of Words Prediction > Transformer Language Model
- 계산량 및 속도의 측면
- Text Embedding과 Image Embedding 사이의 cosine similarity → multi-modal
2.4. Choosing and Scaling a Model
- Image Encoder
- ResNet: ResNet-50, ResNet-101
- EfficientNet Style Model: ResNet50x4, ResNet50x16, ResNet50x64
- ViT: Vit-B/32, Vit-B/16, Vit-L/14
- Text Encoder: BPE representation, max seq len 76
2.5. Training
- RN50x64, took 18 days to train on 592 V100 GPUs (The largest ResNet model)
- ViT-L/14, largest Vision Transformer took 12 days on 256 V100
3. Experiments
3.1. Zero-shot Trasnfer
- zero-shot transfer == task learning capabilities를 측정하는 방법
3.2. Using CLIP For Zero-Shot Transfer
- 이미지의 feature embedding과 텍스트의 feature embedding의 코사인 유사도를 계산한 후 softmax를 통해 확률값을 리턴
- 이 prediction layer는 L2-normalized inputs, weights, no bias 그리고 temperature scaling의 multinomial logistic regression classifier
- 이미지 인코더는 == feature representation을 계산하는 컴퓨터 비전의 backbone
- 텍스트 인코더는 == (클래스가 나타내는 시각 개념들을 특정화하는) linear classifier의 weights를 만들어내는 hyper network이라 할 수 있다.
Approach
2. StyleCLIP: Text-Driven Manipulation of StyleGAN Imagery
1) 핵심 요약
- StyleGAN의 latent space를 text를 통해서 직관적으로 image control하게 하여 이미지를 생성
2) 핵심 기여
- DALLE처럼 그냥 text에서 image를 만드는 것은 매우 어렵기 때문에, image manipulation에 집중한 연구
- style(latent space)를 변경하는 방법 3가지 제안
- Latent optimization - styleGAN의 W+ space와 CLIP의 space를 비교해서 loss를 최소화하도록 최적화하는 방식
- Local Mapper - 특정 text prompt에 대한 mapping network를 학습하는 방법
- Global Direction - global latent space에 text를 맵핑하는 방법 → 가장 나은 결과
3) 논문 결과
2. StyleGAN-NADA: CLIP-Guided Domain Adaptation of Image Generators
1) 핵심 요약
- 모델의 semantic power를 활용하여 specific domain에서 single image를 수집하지 않고도 생성 모델을 new domain으로 이동할 수 있는 텍스트 기반 방법을 제시. 기존 방법으로 도달하기 어렵거나 불가능한 수준.
2) 핵심 기여
- Global CLIP loss - 생성된 이미지와 대상 텍스트 사이의 cosine distance
- Directional CLIP loss - 다양성을 보존하고 extensive image corruption을 방지하기 위함. reference(frozen) generator로 생성된 이미지와 modified(trainable) generator로 생성된 이미지를 비교
- Embedding-norm Loss - artifact가 CLIP space embedding의 norm이 커짐에 따라 나타나는 것을 보았음. 따라서 이를 낮추기 위한 노력
3) 논문 결과
다음에는 MVP 관련 논문과 DPO에 관련한 공부를 해보려고 한다! 베이스라인이 명확한 게 아니라 정말 내가 가는 대로 길이 되는 상황이라 조금 더디더라도 단단하게 짚고 넘어가야 할 것 같다.
'Experiences & Study > Paper (ETC)' 카테고리의 다른 글
[논문읽기] Self-training with Noisy Student improves ImageNet classification (1) | 2023.10.06 |
---|---|
[논문읽기] Deep One-class classification(2018) & PyTORCH 코드 (0) | 2023.09.30 |