1day_1paper icon indicating copy to clipboard operation
1day_1paper copied to clipboard

[40] Pyramid Vision Transformer: A Versatile Backbone for Dense Prediction without Convolutions

Open dhkim0225 opened this issue 3 years ago • 0 comments

paper code

image TF-E == Transoformer Encoder

Contributions

  1. PVT 제안. 다양한 vision task 에 적용 가능
  2. multi-scale, high resolution feature 를 위해 progressive shrinking pyramid, spatial-reduction attention (SRA) 제안
  3. (논문 나올 당시) SOTA

Pyramid Vision Transformer (PVT)

3.1. Overall Architecture

image

3.2. Feature Pyramid for Transformer

그림을 보면 알겠지만, patch embedding 하는 시점에 linear 에서 featuremap size 가 줄어든다. P 값은 4개 stage에 각각 (4, 2, 2, 2)로 들어간다. channel 수를 (1/4, 1/2, 1/2, 1/2) 로 줄여나가면서 reshape 해서 image featuremap size 가 줄어드는 효과 다음 stage 로 넘어갈 때마다 reshape 이 된다.

3.3. Transformer Encoder

나머진 다 똑같고, self-attention 쪽에 SRA 가 추가적으로 적용되는데, 엄청 간단하다. R 만큼 reduction! image

image

그니까... 우선 input을 다음과 같이 reshape 해주고, image

뒤에 linear 를 붙여서 channel reduction 을 해주는 방식이다. 너무 쉽다.

3.4. Model Details

image N은 head 수 E는 feed-forward에서 expansion ratio

깊어질 수록

  • SRA reduction ratio 감소
  • head 증가
  • expansion ratio 는 감소.

Results

Image Classification

ImageNet image

Detection

COCO val 2017 image image

Semantic Segmentation

ADE 20k val set image

Instance Segmentation

COCO val 2017 image

Ablations

Trans2Seg같이 다른 head 를 붙여도 잘 됨. image

RetinaNet 붙여서 실험해 보면 ViT 보다 훨씬 잘되는 거 볼 수 있음 image

RetinaNet 붙여서 Resnet50 과 curve 비교. 1x, 3x 는 스케줄 방식. Pretrained 는 Imagenet pretrained 임. image

deeper vs wider deeper 가 좀 더 나은 것 같음 image

속도도 comparable 함 image

여전히 단점이라고 하면 input scale 에 따른 complexity 증가 image

dhkim0225 avatar Dec 15 '21 03:12 dhkim0225