Deep Learning/Computer Vision

[ Semantic Segmentation ] Language-driven Semantic Segmentation

mia Kang 2024. 6. 10. 02:24

 


 (논문 그대로 해석한 것이 아닌 제 나름의 방식대로 해석해서 작성했음을 알리며 참고 바랍니다.) 

 

Boyi Li et al. Language-driven Semantic Segmentation, ICLR(2022)

 


 

Summary
- 서로 다른 modality 를 가진 text 와 image embedding 이 corresponding semantic class 를 가지도록 학습
- 기존의 fixed-label segmentation method 와 비교해 경쟁력있는 zero-shot 성능을 보임

 

1. Introduction

( * 이전 포스트에서 N-shot learning method 를 리뷰하였습니다. )

  • Semantic segmentation task 에는 많은 양의 annotated data 가 필요하다는 어려움이 있습니다.
    • task 의 복잡성과 함께 annotator 에 의해 annotated data 를 생성하는 데 많은 비용이 들며, 이는 제한된 label set 을 야기하며, 다시 model 성능에도 영향을 주게 되지요.
  •  Few-shot method  는 적은 양의 labeled ( = annotated ) data 에 기반해 novel class 를 분할하는 데 도움을 주었습니다.
    • 하지만 transfer 를 하려면 novel class 를 포함한 labeled data 가 여전히 필요합니다.
  •  Zero-shot method  는 few-shot method 와 달리 추가적인 annotation 없이 seen 과 unseen class 사이 related feature 를 발견하는 방식입니다.

   ▶ 저자는 zero-shot 성능이 좋은 LSeg 를 제안합니다.

  • text encoder 는 제한된 양의 label set 으로 이뤄진 visual data 와 함께 학습되었으며, 이를 이용해 label embedding 을 생성합니다.
  • visual encoder 는 input image 의 pixel-level embedding 이 label embedding 과 corresponding 하도록 학습됩니다.
    • 즉, text label 과 image pixel embedding 이 동일한 embedding space 내에 동일한 semantic 의미를 가지도록 하는 것입니다.

 

2. Language-driven Semantic Segmentation

Text encoder.

pretrained CLIP 을 text encoder 로 사용함으로써 N 개의 label 을 C 차원의 vector 로 만듭니다. 

 

Image encoder.

DPT ( = Dense Prediction Transformers ) 를 image encoder 로 사용함으로써 C 차원의 pixel embedding 을 생성합니다.

 

World-pixel correlation tensor.

위에서 생성한 image 와 label embedding 을 inner product 함으로써 이들의 correlation 을 구합니다.

  • 이때,  image encoder 를 ground truth class 에 corresponding 한 text embedding 과 비슷한 의미의 pixel embedding 을 생성하도록 학습 시키며, 이는 dot product 를 최대화하는 것을 목적으로 둡니다.
  • 전체 이미지에 대한 pixel 별 softmax 를 objective function 으로 둠으로써 이를 최소화합니다.

$$ \sum_{i, j=1}^{H, W} softmax_{y_{ij}}\left ( \frac{F_{ij}}{t} \right ) $$

 

Spatial regularization.

memory constraint 에 의해 image encoder 는 input image 의 해상도보다 더 낮은 해상도의 pixel embedding 을 예측하기에 기존 input image 크기에 맞게 prediction 을 regularization 및 upsampling 해야 합니다.

Figure 1. Illustration of BottleneckBlock and DepthwiseBlock.

 

Training details.

  • train 과정에서 text encoder 는 가만히 두고  image encoder 의 weight 만을 업데이트 합니다.
  •  각 image 에 대한 train label set 은 text encoder 에 전부 제공됩니다. 
  •  LSeg 는 text encoder 에 의해 길이, 내용, 순서 등 여러 면에서 여러 다양하게 섞인 dataset 으로 학습되기에 zero-shot semantic segmentation 이 가능하게 됩니다. 

Figure 2. Overview.

 

3. Exploration and Discussion

3.1. Ablation studies

Comparison on a fixed label set.

fixed label set 에 대해서도 기존 semantic segmentation method 와 비슷한 성능을 보임을 알 수 있습니다. ( Table 1 참고 )

  • language assistance 로 인한 flexibility 는 unannotated ( = unseen ) class 에 대한 recognition 성능을 향상시켰을 뿐만 아니라 fixed label set 에 있어서도 좋은 결과를 보이는 것입니다.

Table 1. Comparison of semantic segmentation results on the ADE20K validation set.

 

3.2. Qualitative findings

Related but previously unseen labels.

주어진 label set 내에서, 의미론적으로 비슷한 label 로 segmentation 함으로써 새로운 class 가 주어져도 generalize 할 수 있음을 볼 수 있습니다. ( Figure 3. (a) 참고 ) 

  • house 와 plant 를 building 과 greenery 로, cake 를 dessert 로 각각 비슷한 의미의 label 로 바꾼 후에도 비슷한 segmentation 결과를 보입니다.

 

Hierarchical unseen labels.

계층적 구조를 지닌 label 에 있어서도 segmentation 할 수 있음을 볼 수 있습니다. ( Figure 3. (b) 참고 )

  • cat 와 grass 를 furry 와 plant 로, sofa 를 furniture 로 각각 계층 관계에 있는 부모 label 로 바꾼 후에도 비슷한 segmentation 결과를 보입니다.
  • 특히, 두 번째 결과에서 sofa 를 furniture 로 변경함으로써, sofa 좌측에 있던 shelf 가 others 에서 furniture 로 segmentation 되었습니다.

Figure 3. LSeg examples with related but previously unseen labels, and hierarchical labels.

 

Failure cases.

  • 기본적으로 주어진 class 를 기준으로 input image 를 segmentation 하기 때문에, LSeg 는 text embedding space 에서 가장 probability 가 높은 label 을 선택해 segmentation 합니다. ( Figure 4. (a) 참고 )
  • 여러 label 이 하나의 object 와 연관이 있을 때, 즉 다수의 label 로 하나의 object 를 설명할 수 있을 때, LSeg 는 가장 probability 가 높은 하나의 label 을 이용해 통으로 segmentation 합니다. ( Figure 4. (b) 참고 )

Figure 4. Failure cases.