sy00n / DL_paper_review

issues에 논문 요약
0 stars 0 forks source link

[21] Integrative Few-Shot Learning for Classification and Segmentation #24

Open sy00n opened 11 months ago

sy00n commented 11 months ago

Introduction

Few-shot Learning은 학습 시에 제한된 수의 샘플을 supervision으로 활용 가능한 문제를 다룬다. Few-shot classification(FS-C)은 각각의 target class에 대해 적은 수의 support set이 존재하는 경우 query image로 부터 target class 중 하나로 분류한다. Few-shot Segmentation(FS-S)의 경우 유사한 셋업에서 query image에 대한 target class region을 segmentation 한다.

Multi-label background-aware prediction

Integration of classification and segmentation

Method

Integrative Few-Shot Learning(iFSL)은 class tag나 segmentation supervision 중에서 하나를 활용한다. integrated few-shot learner를 f라고 정의했는데 이 f는 인풋으로 쿼리 이미지 x와 서포트 셋 S를 받고, 아웃풋으로 class-wise foreground maps Y를 내뱉는다. image

Inference

inference 시에는 top of the set of foreground maps Y에 대한 segmentation masks, class-wise occurrences 둘다 inference를 수행한다.
image class-wise occurrences에서는 위처럼 threshold + max pooling에 의해 예측된다. 이 때 average pooling이 multi-label classification에서 small object에 대해 오분류 하는 경향이 있음을 발견했기에 max pooling을 적용했다.
image

segmentation에서는 class-wise foreground map으로부터 segmentation probability tensor를 얻을 수 있다. N개의 class-wise background map을 episodic background map on the fly로 통합한다. foreground에 속하지 않을 probability maps를 평균내서 episodic background map을 얻고 class-wise foreground map과 concat한다.

image 그래서 최종 segmentation mask는 식 5처럼 얻어진다. (각 위치 별로 most probable class로 분류됨)

Learning objective

-classification loss는 spatially average-pooled scores와 ground-truth class label간의 BCE loss로 계산된다. image Segmentation loss는 각 개별 위치에 대한 class distribution과 ground-truth segmentation annotation 사이의 average cross-entropy로 구성된다. image 이 두 loss는 똑같이 분류라는 목적을 가지고 있지만 분류 레벨이 이미지인지, 픽셀인지에 따라 차이가 있다. 둘 중 하나가 선택됨에 따라 학습 시의 supervision level이 정해진다.

Overall flow

image ASNet은 input으로 쿼리 이미지와 서포트 이미지 간의 pyramidal cross-correlation tensor를 받는다. (feature pyramids, 이를 hypercorrelations 라고 표현하고 있음) pyramidal correlation은 pyramidal AS layer에 fed되어서 서포트 이미지의 spatial dimension을 gradually squeeze하고 pyramidal output은 bottom-up pathway로 final foreground map과 merge된다. N-way output maps는 parallel하게 연산되고 class-wise foreground map이 계산된다.

Attentive Squeeze Network(ASNet)

Attentive squeeze layer (AS layer)

AS 층에서는 strided self-attention을 통해 correlation tensor를 더 작은 support dimension으로 바꾼다. correlation tensor C가 hypercorrelation pyramid로 주어지면, Hq X Wq 크기로 줄인다. image AS layer의 목표는 query dimension은 유지되면서 reduced support dimension을 통해 각각의 support correlation tensor에 대한 global context를 분석하는 것이다. image

각각의 support correlation에서 전체적인 패턴을 학습하기 위해 correlational feature transform으로 global self-attention mechanism을 적용한다. 이 때 self-attention weights는 모든 query positions를 따라 share되고 병렬처리 된다.
자세히 보면, 일반적인 self-attention 연산처럼 일단 처음에 support correlation tensor C에 대해 T(Target), K, V 각각의 embedding을 만들면서 시작한다. 그리고 아래처럼 T,K로 attention context를 계산한다. image 그리고 attention context는 softmax에 의해 normalized 된다. image 그다음에 이 attented representation이 MLP layer에 feed 되고, 이 경우 input과 output의 차원이 안맞기 때문에 conv layer에 한번 feed 시키고 나서 다시 MLP layer에 feed 된다. image

Multi-layer fusion

pyramid correlational representation은 upsampling, addition, non-linear transformation을 통해 merge 될 수 있다.

Class-wise foreground map computation

K-shot output foregroud activation map은 각 클래스에 대한 mask prediction을 얻기 위해 평균내어진다. 이 평균낸 output map에 2 channel 방향으로 softmax를 적용해 normalized 시켜서 foreground prediction 확률을 얻는다.

image