본문 바로가기
DeepLearning/논문 리뷰

[논문 리뷰]HRformer: High-Resolution Transformer for Dense Prediction

by Wanda 2022. 3. 11.

0.Abstract 

-생략

 

1. Introduction

- Vision Transformer (ViT) 은 imageNet classification tasks에서 전도 유망한 성능을 보이고 있었다. 

 

- 몇몇의 연구들은 더 넓은 Vision tasks(e.g object detection,semantic segmentation, pose estimation, video understanding)를 위해 transformer를 확장하려는 시도가 있었다.

 

- Vision Transformer는 이미지를 크기가 16*16인 일련(sequence)의 이미지 패치로 분할(split)하고, 그리고 각각의 image patch의 feature representation을 extracts한다. 따라서, Vision Transformer의 output representations은 dense prediction accurate에 영향을 주는 fine-grained spatial details를 잃게 된다.

 

- Vision Transformer은 오직 단일한 feature representations를 outputs으로 내기 때문에, multi-scale variation를 다루는 능력을 저하하게 된다. 

 

-이러한 feature granularity와 multi-scale variation을 model하기 위해, 본 논문에서는 dense prediction을 위해 더욱 풍부한 spatial 정보를 담고, 그리고 다중 해상도 representations 을 구성하는 High-Resolution Transformer(HRFormer)를 구성한다.

 

- High-Resolution Transformer은 HRNet을 따라서 만들어진 모델이다. 

 

-먼저, HRFormer은 줄기(stem)와 첫 번째 단계 모두에서 convolution을 적용하는데, 이는 여러 공존하는 연구들이 early stage에 convolution을 하는 것이 더 좋은 성능을 낸다고 하기 때문이다. (Q. 이유가 뭘까?)

 

- 두 번째로, HRFormer은 전체 process에서 고해상도(high-resolution) 흐름을 유지하며 고해상도 representations을 향상시키기 위해 병렬로 medium-resolution과 low-resolution stream을 유지한다. 

 

-  다른 해상도의 feature maps가 있기 때문에, HRFormer은 multi-scale variation을 model할 수 있다. 

 

- 세 번째로, HRFormer은 다중해상도의 feature information을 multi-scale fusion module과 교환하여 short-range와 long-range attention을 mixes한다. 

 

- 각각의 해상도에서, local-window self-attention mechanism이 memory와 computation compexity를 줄이기 위해 적용된다. 

 

-본 논문에서는 feature maps를 겹치지 않는( non-overlapping) 작은 image window set로 분할하고, 각 image window에서 개별적으로 self-attention을 수행한다.

 

- 이는 memory와 computation complexity를 2차에서 선형으로 감소시킨다. 본 논문에서는 더 나아가 local window self-attention후에 오는 feed-forward network(FFN)안에  3*3 depth-wise convolution을 넣어 줌으로써, 이러한 local window self-attention process에서 연결이 끊긴 image windows사이의 정보를 교환할 수 있도록 해 준다. 

 

- 이는 receptive field를 넓혀주게 되고, 이는 dense prediction tasks에서 필수적인 요소이다. 

 

 

3. High-Resolution Transformer

* Multi-resolution parallel transformer

 

- Local-window self-attention

- with MHSA aggregates information within each window, we merge them to compute the output

 

 

* FFN with depth-wise convolution

 

- Local-window self-attention에서는, non-overlapping windows를 이용하여 self-attention을 개별적으로 수행한다. 이 과정에서는 windows 사이에 정보 교환은 존재하지 않는다. 이러한 issue를 다루기 위해, 본 논문에서는 two point-wise MLPs(Vision Transformer에서 FFN역할을 함)사이에 3*3 depth-wise convolution을 넣어 준다. 

 

- Figure 1에서의 오른쪽 참조 

 

* Representation head designs

- Fig2에서 보았듯이, HRFormer은 4개의 다른 해상도를 가지는 feature maps를 형성한다.

 

 

 illustration

 

  (1) ImageNet classification, 본 논문에서는 4개의 다른 해상도 feature maps를 bottleneck으로 보내고, 그리고 output의 channel를 128, 256, 512, 1024로 바뀐다. 그리고 나서, strided convolution(다른 해상도마다 다른 stride를 줘서, 가장 작은 해상도를 만드는 작업)을 추가하여 각각의 feature들을 fuse (Q. 여기서 fuse가 무엇인지?) 한 후, 가장 작은 해상도와 channels가 2048인 feature maps을 output으로 낸다. 마지막으로, global average pooling final classifier를 진행해 준다.

 

* Global average pooling (Gap)이란?

https://wonjae-projects.tistory.com/40?category=927758  참조

 

 (2) pose-estimation의 경우, 본 논문에서는 regression head를 가장 고 해상도 feature map에 적용해 준다.

 

 (3) semantic segmentation의 경우, 본 논문에서는 semantic segmentation head를 모든 저해상도 representations를 highest resolution으로 upsampling한 다음 함께 concatenate한 값에 적용이 된다. 

 

 

Instantiation

 

- 본 논문에서의 (M1,M2,M3,M4)와 (B1,B2,B3,B4)를 module의 수와 {state1,state2,state3,state4}의 block의 수를 대표하기 위해 이용한다.

 

- 본 논문에서는 (C1,C2,C3,C4), (H1, H2, H3, H4), (R1,R2,R3,R4)를 channels의 수와, Heads의 수, 그리고 다른 해상도와 연관된 transformer block 안의 MLP확장 ratio을 나타낸다.

 

- HRformer은 첫번째 stage를 기존의 HRNet을 따라 첫번째 stage는 변경하지 않았고, 그리고 bottleneck을 basic building block으로 이용하였다. 

 

- 본 논문에서는 transformer blocks을 다른 stage들에 적용하였고, 그리고 각각의 transformer block은 local-window self-attention과 그 이후 이어지는 FFN with 3*3 depth-wise convolution이 있다. 

 

- Table1에서는 단순함 때문에 convolutional multi-scale fusion modules를 포함하지 않고 있다.

 

- 본 논문의 실행에서는 4개의 resolution streams에  window size의 set을 (7,7,7,7)을 기본값으로 설정하고 있다.

 

- Table 2에서는 증가하는 복잡도와 함께 3개의 다른 HRFormer의 configuration(배열)을 묘사하고 있다.(MLP expansion ratios는 모든 모델에 대해 (4,4,4,4,)로 설정 되어있고, 이는 표현되지 않았다.)

 

Analysis

 

- 3*3 depth-wise convolution은 두가지 이점이 있다. 

 

 1) enhancing the locality 2)enabling the interactions across windows (Fig.3 참조)

 

 

 

 

 

 

4. Experiments

4.1 Human Pose Estimation

 

4.2 Semantic Segmentation

4.3 ImageNet Classification

4.4 Ablation Experiments

- 생략