📑Paper Review

[paper review] Segmentation Transformer: Object-Contextual Representations for Semantic Segmentation

date
Nov 27, 2022
slug
paper-review-segmentation-transformer
author
status
Public
tags
DeepLearning
paper
summary
type
Post
thumbnail
category
📑Paper Review
updatedAt
Sep 6, 2024 04:04 PM

INTRODUCTION

semantic segmentation : 이미지의 각 픽셀에 레이블을 생성하는 것
contextual aggregation : 한 위치의 컨텍스트는 주변의 픽셀 같은 위치의 집합을 나타냄
contextual representation : 이미지 context와 position의 관계를 고려하는 방법
이 논문의 주제 : semantic segmentation에서 position과 contextual aggregation을 고려하여 그 관계를 표현하는 선을 통해 contextual representation scheme 하는 방법에 대한 제안
motivation : 한 픽셀에 할당된 레이블은 그 픽셀이 속한 객체의 카테고리다.
object regions : GT를 통해 학습
object region representation : object region에 있는 pixel들의 representation을 aggregate 하여 학습
각각의 object 영역 : 각 픽셀간의 relation 계산
 
ASPP와 OCR 방법의 차이를 설명하는 사진
notion image
 

Related Work

  1. Multi-scale context
    1. PSPNet : pyramid pooling module 사용
      1. notion image
    2. DeepLab : parallel dilated convolution 사용
    3. DenseASPP : 더 광범위한 receptive field를 위해 큰 dilated rates 사용
      1. notion image
      ex) dilation rate 가 2인 3x3 커널은 9개의 파라미터로 5x5커널과 같은 receptive field를 갖음.
       
  1. Relational context
    1. DANet, CFNet,OCNet
      1. self-attention을 통해 픽셀간 유사로들 고려하는 방법 사용
    2. ACFNet
      1. notion image
      2. Pixel을 set of region으로 그룹화
        1. backbone network를 통해 coarse segmentaion map 생성
        2. self-attention을 통해 class center를 생성
        3. 과정 1의 coarse sefmentaion map과 과정 2의 class center를 사용하여 class attention을 수행하고, 그렇게 생성된 representation을 계산
      3. 논문과 비슷한 구조지만 class attention 과정에서 coarse segmentation map 대신 object의 region (pixel representaion)을, class center 대신 pixel들을 attention한다는 점에서 다름
    3. 실험 과정에서는 ground truth segmentation을 통해 set of regions의 context를 지도학습, 이를 활용하여 픽셀의 context 학습
 
  1. Coarse-to-fine segmentation
    1. coarse segmentation map을 representation으로 활용하여 fine segmentation map을 생성
  1. Region-wise segmentation
    1. pixel들을 set of region들로 정렬하고, 각 region classify 결과를 segmentation 결과로 사용
 

Approach

OCR
notion image
  1. Backbone network를 통해 pixel representation과 soft object regions을 생성
    1. soft object regions의 경우 1x1 conv를 통과한 feature map과 ground truth와의 pixel-wise cross-entropy loss 를 통해 도출 (matrix가 클래스 수 만큼 생성)
  1. pixel representations과 soft object regions를 cross attention하여 object region representaitons 생성
  1. pixel representations과 object region representations의 attention을 통해 pixel region relation 생성 (pixel과 region에 대한 관계를 나타내는 가중치)
  1. pixel region relation과 object region representations을 둘다 고려하여 OCR module 구현
  1. object contextual representations과 기존 pixel representations의 concat으로 augment된 pixel representations을 생성하고, 최종적으로 pixel wise cross entropy loss를 적용하여 segmentation map 도출
segmentation transformer
notion image
  1. decoder 부분에 category queries를 input 하여 soft object regions 생성
  1. encoder 부분의 input인 pixel representation이 key와 value로 주어져 cross-attention 연산
  1. decoder에서 object region representation 출력
  1. 해당 출력을 encoder의 value와 key로 , 과정 2에서 사용된 pixel representation을 queries로 입력
  1. input feature의 self attention 결과와 decoder의 출력을 cross attention하여 object contextual representation 생산
  1. 이 과정을 반복 수행하여 pixel representation를 업데이트하고, segementation map 생성
 

Experiments

  • Datasets
    • Cityscapes
    • ADE20K
    • LIP
    • PASCAL-CONTEXT
    • COCO-Stuff
  • setting
    • ImageNet pre-trained backbone
    • Learning rate, loss weight 설정 (논문 참조)
    • data augmentation
      • random flipping, horizontally, random scaling, random brightness jittering
 

Results

notion image
notion image
  • HRNetV2 + OCR + segfix 를 사용했을 때 가장 좋은 결과를 얻을 수 있었다.
 
conclustion
  • object contextual representation을 통한 pixel representation을 강화
  • 각 픽셀과 해당 영역의 관계를 통해 성능을 향상
  • 다양한 모델과 결합하여 성능 향상
discussion
  • 다른 segmentation과 결합하는 방법 연구
  • backbone network 단에서 object region을 나누는 방법에 대한 연구
  • 관계를 찾는게 중요한 다른 Task들에 적용하는 연구
 
Implementation - 진행중
notion image
cityscapes에서 sota를 달성하고 있으며, 깃허브에 오픈소스로 공개중
 
구현 결과
  • 이미지
notion image
notion image
  • 마스크
일단 pretrained model 사용시 cityscape 데이터 셋에 대한 segmentaion이 잘 이루어짐을 알 수 있음
진행상황
  1. 논문 이해
  1. 의존성 해결 및 cpu train (gpu 사용시 out of memory #image size 조정 필요)
  1. baidu cloud에서 구한 cityscape dataset pretrained 모델 테스트
    1. cityscape dataset과 같이 큰 근접으로 느낄 정도의 크기의 물체만 segmentation
    2. ocr 때문에 context 구분을 먼저 해서 생기는 문제일수도?
  1. 다른 데이터셋에 대해 train 한 결과 모델 업데이트 예정