SegFormer [Kor]
xie et al. / SegFormer; Simple and Efficient Design for Semantic Segmentation with Transformers / NeurIPS 2021
1. Problem definition

Figure 1. Semantic segmentation ์์ธก ๊ฒฐ๊ณผ
Semantic segmentation์ ์ด๋ฏธ์ง ๋ด์ ๋ชจ๋ ํฝ์ ์ ์ฌ๋ฌ๊ฐ์ ํ์ ํด๋์ค๋ก ๋ถ๋ฅํด, ์ด๋ฏธ์ง๋ฅผ ์๋ฏธ์๋ ๊ฐ์ฒด ๋จ์๋ก ๋๋์ด ์ฃผ๋ task์ ๋๋ค. ์ด๋ฅผ ํตํด ์ฐ๋ฆฌ๋ ์ด๋ฏธ์ง ์์ ๋ด ํํ์ ์ข ๋ ์๋ฏธ์๊ณ ํด์ํ๊ธฐ ์ฌ์ด ๊ฒ์ผ๋ก ๋จ์ํํ๊ฑฐ๋ ๋ณํํ ์ ์๊ฒ ๋ฉ๋๋ค. semantic segmentation์ ํนํ ์์์์ ๋ฌผ์ฒด์ ๊ฒฝ๊ณ(์ , ๊ณก์ )๋ฅผ ์ฐพ๋๋ฐ ์ฌ์ฉ ๋ ์ ์์ด, ์์จ์ฃผํ์ด๋ ์๋ฃ ์์ ๋ถํ ๋ฑ ์ฌ๋ฌ ๋ถ์ผ์์ ํ์ฉ๊ฐ์น๊ฐ ๋์ ํ๋ฐํ ์ฐ๊ตฌ๊ฐ ์งํ๋๊ณ ์์ต๋๋ค.
์ต๊ทผ natural language processing (NLP) ์์ ํฐ ์ฑ๊ณต์ ๊ฑฐ๋ self-attention, Transformer ๊ตฌ์กฐ๋ฅผ semantic segmentation task์ ์ ์ฉ์ํค๋ ์ฐ๊ตฌ๊ฐ ๋ง์ด ์งํ๋๊ณ ์๋๋ฐ์, ์ด๋ฌํ ์ฐ๊ตฌ๋ค ์ค ํ๋์ธ Segformer๋ ์ด๋ ํ ๋ฐฉ๋ฒ์ผ๋ก Semantic segmentation task์ transformer ๊ตฌ์กฐ๋ฅผ ์ ์ฉ์ํค๋ ค ํ์๋์ง ์๊ฐํด ๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
2. Motivation
์ด์ ์๋ PVT(Pyramid Visoin Transformer, Swin Transformer, SETR ์ ๊ฐ์ transformer-based segmentation ๋ชจ๋ธ๋ค์ด ๋ฑ์ฅ ํ์ผ๋, ๋ชจ๋ endcoder์๋ง transformer ๊ตฌ์กฐ๋ฅผ ์ ์ฉํ๊ณ , decoder ๋ ๊ธฐ์กด์ ๋ง์ด ์ฌ์ฉ๋๋ CNN-based decoder ๊ตฌ์กฐ๋ฅผ ์ ์งํ๊ณ ์์ต๋๋ค.
์ด์ ์ฐ๊ตฌ๋ค๊ณผ ๋ค๋ฅด๊ฒ ์ด๋ฒ์ ์๊ฐ๋๋ฆด SegFormer ๋ ผ๋ฌธ์์๋ encoder ์ decoder ๋ชจ๋์ transformer๋ฅผ ์ฌ์ฉํ์ฌ ๋จ์ํ๋ฉด์๋, ํจ์จ์ ์ด๊ณ , ์ฑ๋ฅ๊น์ง ๋์ ๊ฐ๋ ฅํ ๋ชจ๋ธ ๋์์ธ์ ์ ์ํ์์ต๋๋ค.
Related work
Semantic Segmentation Semantic segmentation ์ ์ด๋ฏธ์ง ๋ถ๋ฅ task์ ํ์ฅํ์ด๋ผ๊ณ ํ ์ ์๋๋ฐ, ๋จ์ํ ์ด๋ฏธ์ง ๋ ๋ฒจ์์์ ๋ถ๋ฅ๊ฐ ์๋ ํฝ์ ์์ญ์์์ ๋ถ๋ฅ ๋ผ๊ณ ํ ์ ์์ต๋๋ค. ์ด๊ธฐ CNN ๊ธฐ๋ฐ์ FCN(fully convolution network)์ด end-to-end manner ๋ก semantic segmentation์ ๋ฌธ์ ์ด์๊ณ , ๊ทธ ํ ๋ง์ ์ฐ๊ตฌ์๋ค์ด FCN์ ํ์์ฐ๊ตฌ๋ก์ ์ฑ๋ฅ์ ํฅ์ ์์ผ์์ต๋๋ค. ๊ธฐ์กด์ ์ฐ๊ตฌ๋ค์ receptive field๋ฅผ ํ์ฅ ์ํค๊ฑฐ๋, contextual information์ด๋, boundary information์ ์ถ๊ฐ๋ก ๋ํด์ฃผ๋ ๋ฑ์ ๋ฐฉ์์ผ๋ก ์ฐ๊ตฌ๊ฐ ์งํ ๋์์ผ๋ฉฐ, ์ต๊ทผ ๋ค์ํ attention modules์ ์ ๋ชฉ์ํจ ์ฐ๊ตฌ๋ค๋ ๋ฑ์ฅํ์ต๋๋ค. ์ด๋ฌํ ์ฐ๊ตฌ๋ค์ Semantic segmentation์ ์ฑ๋ฅ์ ๋ํญ ํฅ์์์ผฐ์ง๋ง, ์ด๋ฌํ ์ฑ๋ฅ ํฅ์์ ๊น๋ค๋กญ๊ณ ๋ณต์กํ ๊ณ์ฐ์ด ์๋ฐ๋๊ธฐ ๋๋ฌธ์ ์ปดํจํฐ resource์ ํฌ๊ฒ ์์กด ํ ์ ๋ฐ์ ์์ต๋๋ค. ๋ณด๋ค ์ต๊ทผ์ ๋ฐฉ๋ฒ์ผ๋ก segmetnation์ ์ํ Transformer ๊ธฐ๋ฐ ์ํคํ ์ณ์ด ๋ฑ์ฅํ์ง๋ง, ์ด๋ฌํ ์ํคํ ์ณ ์ญ์ ๋ณต์กํ ๊ณ์ฐ์ด ์๋ฐ๋์ด ์์ ๋ฌธ์ ์์ ์์ ๋ก์ธ ์ ์๋ค๋ ํ๊ณ์ ์ ๊ฐ์ง๊ณ ์์ต๋๋ค.
Transformer backbones Image classification task ์์ Vision Transformer (ViT) ๋ classification์์ sota๋ฅผ ๋ฌ์ฑํ๋ ๋ฑ ์ฐ์ํ ์ฑ๋ฅ์ ๋ณด์ฌ์ฃผ์์ผ๋ฉฐ ํนํ ViT๋ ๊ฐ ์ด๋ฏธ์ง๋ฅผ token์ผ๋ก ๋๋์ด ์ฌ๋ฌ Transformer layer๊ฐ ์ด๋ฅผ classficiation์ ์ํ representation์ ํ์ตํ๊ฒ ๋ฉ๋๋ค. ์ดํ ViT๋ฅผ ์๋ ํ์ ์ฐ๊ตฌ๋ก ๋ฐ์ดํฐ๋ฅผ ํจ์จ์ ์ผ๋ก ํ์ตํ๋ ํ์ต์ ๋ต๊ณผ distillation์ ์ ๋ชฉํ DeiT๋ถํฐ T2T ViT, CPVT, TNT, CrossViT, LocalViT๋ฑ ์ฌ๋ฌ ์ํคํ ์ณ๋ค์ด ๋ฑ์ฅํ์ต๋๋ค.

Figure 2. PVT ๊ตฌ์กฐ์ ๊ธฐ์กด ์ํคํ ์ณ์์ ๊ตฌ์กฐ ๋น๊ต
Image classification์ด์์ธ๋, PVT [8]๋ pyramid ๊ตฌ์กฐ๋ฅผ Transformer์ ์ ๋ชฉํด Transformer๊ฐ detection์ด๋ segmentation๊ณผ ๊ฐ์ dense prediction task์์๋ ์ข์ ์ฑ๋ฅ์ ๋ณด์ฌ ์ ์ฌ์ ์ฑ์ฅ ๊ฐ๋ฅ์ฑ์ ์ ์ฆํ์ต๋๋ค. ๊ทธ์ดํ๋ก Swin [9], CvT [58], CoaT [59], LeViT [60], Twins [10] ๋ฑ ๋ค์ํ ์ํคํ ์ณ๋ค์ ์ด๋ฏธ์ง features์ ๊ตญ์ง์ ์ฐ์์ฑ(local continuity)์ ๊ฐ์ ํ๊ณ , ํธ๋์คํฌ๋จธ์ ๊ณ ์ ์์์ค ํ๋์ธ ๊ณ ์ ๋ ํฌ๊ธฐ์ position embedding์ ์ ๊ฑฐํ๋ฉด์ ์ฑ๋ฅ์ ํฅ์์์ผฐ์ต๋๋ค.
Transformers for specific tasks ํธ๋์คํฌ๋จธ๋ฅผ ํน์ ํ Task์ ์ ๋ชฉ์ํจ ์๋ฐ์ ์ DETR ์ด๋ผ ํ ์ ์์ต๋๋ค. DETR์ ํธ๋์คํฌ๋จธ๋ฅผ ํ์ฉํด ๊ธฐ์กด detection์์ ํ์ ์๋ค๊ณ ํ ์ ์๋ NMS(Non-Maximum Suppression)๋ฅผ ์์ ๊ณ end-to-end ํ๋ ์ ์ํฌ๋ฅผ ๊ตฌ์ถํ์์ต๋๋ค. ์ด ์ธ์๋ tracking, super-resolution, ReID, Colorization, Retrieval,multi-modal learning,semantic segmentation ๋ฑ ์ฌ๋ฌ task์์๋ ํธ๋์คํฌ๋จธ๋ฅผ ์ ๋ชฉ์ํค๋ ค๋ ์๋๋ค์ด ์์์ต๋๋ค.

Figure 3. SETR์ ๋คํธ์ํฌ ๊ตฌ์กฐ
ํนํ Semantic segmentation์์๋ SETR์ด๋ผ๋ ๋คํธ์ํฌ๊ฐ ๋ฑ์ฅํด ๊ธฐ์กด์ ์ฑ๋ฅ์ ์๋ฑํ ํฅ์ ์์ผฐ๋๋ฐ์, SETR์ ๋ํ์ ์ธ vision transformer์ธ ViT๋ฅผ features extractor๋ฅผ backbone ๋คํธ์ํฌ๋ก ์ฑํํ์์ต๋๋ค. ํ์ง๋ง ์์ ํธ๋์คํฌ๋จธ ๊ธฐ๋ฐ ๋คํธ์ํฌ๋ค์ ๋์ ์ฐ์ฐ๋์ ๊ธฐ๋ฐ์ผ๋ก ๋๊ธฐ ๋๋ฌธ์ ๋ฉ๋ชจ๋ฆฌ ๋นํจ์จ์ ์ด๋ฉฐ, ์ค์๊ฐ ์์ฉ์ด ๋ถ๊ฐ๋ฅํด ๋ฐฐํฌ์์ ์ด๋ ค์์ด ์๋ฐ๋ฉ๋๋ค.
Idea
๋ณธ ๋ ผ๋ฌธ์์๋ ๊ธฐ์กด ViT ๊ธฐ๋ฐ์ SETR์ positional-encoding์ผ๋ก ์ธํด single-scale์ low-resolution feature ๋ง์ ์ด์ฉํ์ฌ multi-scale feature ๋ฅผ ํ์ฉํ ์ ์๋ค๋์ , ๊ณ ํด์๋์ ์ด๋ฏธ์ง์์๋ ๊ณ์ฐ ๋น์ฉ์ด ํฐ ์ ์ ์ง์ ํ๋ฉด์, hierarchical ๊ตฌ์กฐ์ positional-encoding-free ํธ๋์คํฌ๋จธ ์ธ์ฝ๋ ๊ตฌ์กฐ์ ๋ณต์กํ๊ณ , ๋ง์ ์ฐ์ฐ๋์ ํ์ํ๋ ๊ตฌ์กฐ์์ ํํผํ lightweight All-MLP decoder๋ฅผ ์ ์ ํ์์ต๋๋ค.
3. Method
3.1. hierarchical Transformer encoder

Figure 3. hierarchical Transformer encoder ๊ตฌ์กฐ
๋ชจ๋ธ์ ์ ์ฒด์ ์ธ ๊ตฌ์กฐ๋ ์ ๊ทธ๋ฆผ๊ณผ ๊ฐ์ต๋๋ค. ์ธ์ฝ๋๋ 4๋จ๊ณ์ hierarchical Transformer ๊ตฌ์กฐ๋ก ๊ตฌ์ฑ๋์์ต๋๋ค. ์ด์ ์ฐ๊ตฌ์ธ SETR์ ์์ ์ค๋ช ํด ๋๋ฆฐ๋ฐ์ ๊ฐ์ด ViT๊ธฐ๋ฐ ์ธ์ฝ๋๋ก ์ธํด single-resolution feature map์ ์์ฑํ์๋๋ฐ, SegFormer์์๋ ๊ณ์ธต์ ์ธ ๊ตฌ์กฐ๋ก CNN๊ณผ ์ ์ฌํ๊ฒ high-resolution coarse feature๋ถํฐ low-resolution fine feature๊น์ง multi-scale ์ feature representation์ ์ป์ ์ ์์ต๋๋ค.
Transformer Block์ Efficient Self-Attn๊ณผ Mix-FFN, Overlap Patch Matching ์ผ๋ก ๊ตฌ์ฑ๋์ด์์ต๋๋ค. Overlap Patch Matching์ ์ค๋ฅธ์ชฝ ๊ทธ๋ฆผ์ฒ๋ผ convolution network๋ฅผ ์ฌ์ฉํด stride, padding์ผ๋ก overlap ๋๋ patch๋ฅผ ์ํ๋ง์ ํฉ๋๋ค.์ด๋ฅผ ํตํด local continuity๋ฅผ ์ ์งํ ์ฑ hierarchical feature map์ ๊ตฌ์ฑ ํ ์ ์๊ฒ ๋ฉ๋๋ค.
ํนํ Efficient Self-Attn ์์๋ PVT์ ์ ์ฌํ๊ฒ K(key)์ dimension reduction์ ํตํด์ complexity๋ฅผ ์ค์์ต๋๋ค. Mix-FFN๋ convolution layer์ ๊ฐ์ด๋ฐ ๋ฃ์ด์ zero padding์ผ๋ก positional encoding์ ๋์ ํ ์ ์๋๋ก ํ์์ต๋๋ค. ๊ธฐ์กด์ positional encoding์ resolution์ ๊ณ ์ ๋์ด ์๋ค๋ ๋จ์ ์ด ์๋๋ฐ, zero padding์ ์ฌ์ฉํ๋ฉด train ๊ณผ test์ resolution์ด ๋ฌ๋ผ๋ ์ฑ๋ฅ์ ํฌ๊ฒ ์ํฅ์ด ์์ผ๋ฉด์๋ resolution์ ํค์ธ์ ์์ด, multiscale feature ์์ฑ์ด ๊ฐ๋ฅํด์ง๋๋ค.
3.2. lightweight All-MLP decoder
decoder๋ ๊ต์ฅํ ์ฌํํ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง๊ณ ์๋๋ฐ์, ๊ฐ transformer ๋ธ๋ก์์ ๋์จ 4๊ฐ์ง ํฌ๊ธฐ์ multi-level feature๋ค์ MLP Layer๋ฅผ ํต๊ณผํด์ channel dimension์ ๋ง์ถ๊ธฐ ์ํด upsampleํ ๋ค concatenate ๋ฉ๋๋ค. ํฉ์ณ์ง multi-scale feature ๋ค์ MLP ๋ ์ด์ด๋ฅผ ํต๊ณผํ์ฌ ์ต์ข segmentation map์ ๋์ถํฉ๋๋ค.
SegFormer๋ ์ด๋ฌํ MLP ๋ ์ด์ด๋ก๋ง ๊ตฌ์ฑ๋ ๊ฒฝ๋ ๋์ฝ๋๋ฅผ ํตํด ์ผ๋ฐ์ ์ผ๋ก semantic segmentation task์์ ํํ ์ฌ์ฉ๋๋ hand-craftํ๊ณ ๊ณ์ฐ์ ์ผ๋ก ๊น๋ค๋ก์ด decoder filter๋ฑ์ ๋ถ๊ฐ์ ์ธ ์์๋ค์์ ํด๋ฐฉ๋์์ต๋๋ค. ์ด๋ฌํ ๊ฐ๋จํ ๋์ฝ๋๊ฐ ๊ฐ๋ฅํ๋ ํต์ฌ ์์๋ ๋ฐ๋ก ๊ณ์ธต์ ํธ๋์คํฌ๋จธ ์ธ์ฝ๋๊ฐ ๊ธฐ์กด์ CNN ์ธ์ฝ๋๋ณด๋ค ๋ ํฐ ์ ํจ ์์ฉ ํ๋(Effective Receptive Field ;ERF)๋ฅผ ๊ฐ์ง๊ณ ์๋ค๋ ์ ์ ์์ต๋๋ค.

Figure 5. Segformer์ CNN ๊ธฐ๋ฐ ๋คํธ์ํฌ์ ์ ํจ ์์ฉ ํ๋ ์๊ฐํ ๊ฒฐ๊ณผ ๋น๊ต
์ ๊ทธ๋ฆผ์ ๋ํ์ ์ธ CNN ๊ธฐ๋ฐ ๋คํธ์ํฌ์ธ DeepLabv3+์ SegFormer์ effective receptive field๋ฅผ ์๊ฐํ ๊ฒฐ๊ณผ๋ฅผ ๋น๊ตํ ๊ฒฐ๊ณผ ์ ๋๋ค. SegFormer์ receptive field๊ฐ ํจ์ฌ ํฐ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค. SegFormer์ ๊ฒฝ์ฐ ์ด๊ธฐ ๋จ๊ณ (stage 1-2)์์ ์ปจ๋ณผ๋ฃจ์ ๊ณผ ์ ์ฌํ local attentions์ ๋ณด์๊ณผ ๋์ํด 4๋จ๊ณ์์ global context๋ฅผ ํจ๊ณผ์ ์ผ๋ก ์ถ๋ ฅํ๋ ๊ฒ์ ๋ณผ ์ ์๋๋ฐ์, ํนํ ์ ๊ทธ๋ฆผ์์ ์ค๋ฅธ์ชฝ ๋์ ํ๋๋ ํจ์น์ ๊ฐ์ด MLP ํค๋(ํ๋์ ์์)์์์ ERF๋ 4๋จ๊ณ(๋นจ๊ฐ์ ์์)๋ณด๋ค ๋ ๊ฐํ๊ฒ ๊ฐ์กฐ๋ local, global attention์ ๋ณด์ ๋๋ค. ์ด๋ฅผ ๋ณด์ segformer์ ๋จ์ํ MLP ๋์ฝ๋๋ฅผ ํตํด local ๋ฐ global attention์ ๊ฐํ๋ฉด์๋, ๋์์ ์ ๋ํ ์ ์์์ ํ์ธํ ์ ์์ต๋๋ค.
4. Experiment & Result
Experimental setup
Dataset : Cityscapes, ADE20K, COCOStuff
Baselines : SETR, DeeplabV3
Training setup :
Imagenet-1K pretrained encoder with randomly initialize decoder
augmentation : random resize with ratio 0.5-2.0, random horizontal flipping, and random cropping
Learning rate : 0.00006 with poly LR schedule
Optimizer : AdamW
Training method :
160K : Cityscapes, ADE20K
80K : COCOStuf
Batch size : 16 ADE20K COCO-Stuff, 8 Cityscapes
Evaluation metric : mIoUs
Result
Ablation study

Table 1. Ablation study results
Influence of the size of model. ๋์ฝ๋์ ํ๋ผ๋ฏธํฐ ์๋ฅผ ๋ณด์์๋, ๊ฒฝ๋ ๋ชจ๋ธ์ธ (MiT-B0)์ ๋์ฝ๋์ ํ๋ผ๋ฏธํฐ๋ 0.4M์ด๋ฉฐ, MiT-B5 ์ธ์ฝ๋์ ๊ฒฝ์ฐ ๋์ฝ๋๋ ๋ชจ๋ธ์ ์ ์ฒด ํ๋ผ๋ฏธํฐ ์์ ์ต๋ 4%๋ง ์ฐจ์งํฉ๋๋ค. ์ด๋ ๊ต์ฅํ ๊ฒฝ๋ํ๋ ๋์ฝ๋ ๊ตฌ์กฐ๋ผ ํ ์ ์์ต๋๋ค. ์ฑ๋ฅ์ ๋ณด์๋, ์ ๋ฐ์ ์ผ๋ก ๋ชจ๋ ๋ฐ์ดํฐ ์ธํธ์์ ์ธ์ฝ๋ ํฌ๊ธฐ๋ฅผ ๋๋ ธ์ ๋ ์ฑ๋ฅ์ด ํฅ์๋์์ต๋๋ค. ์ด๋ฅผ ๋ณด์ ๊ฒฝ๋ ๋ชจ๋ธ์ธ SegFormer-B0์ ์ฐ์ํ ์ฑ๋ฅ์ ์ ์งํ๋ฉด์๋ ์ฐ์ฐ๋์ด ์ ์ด ํจ์จ์ ์ด๊ณ , ์ค์๊ฐ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ์ฉ๊ฐ๋ฅ์ฑ์ ๋ณด์ฌ์ฃผ์์ต๋๋ค. ๋ํ ๊ฐ์ฅ ํฐ ๋ชจ๋ธ์ธ SegFormer-B5๋ ์ธ ๋ฐ์ดํฐ ์ธํธ์์ ๊ฐ์ฅ ์ฐ์ํ ๊ฒฐ๊ณผ๋ฅผ ๋ฌ์ฑํ์ฌ Transformer ์ธ์ฝ๋์ ์ ์ฌ๋ ฅ์ ๋ณด์ฌ์ค๋๋ค.
Influence of C, the MLP decoder channel dimension. ํ 1b์์๋ MLP decoder channel dimension์ ๋ฐ๋ฅธ ์ฑ๋ฅ์ ๋น๊ตํ ๊ฒฐ๊ณผ์ ๋๋ค.C = 256์ด์์ ๋ ๊ฒฝ์๋ ฅ์๋ ์ฑ๋ฅ๊ณผ ๊ณ์ฐ ๋น์ฉ์์ ์ ์ ์์ต๋๋ค. ์ฑ๋์ด ์ฆ๊ฐํ ์๋ก ์ฑ๋ฅ์ ์ฆ๊ฐํ์ง๋ง, ์ฑ๋ฅ์ฆ๊ฐ ํญ ๋๋น ํ๋กญ, ํ๋ผ๋ฏธํฐ ์ฆ๊ฐ ํญ์ด ์ปค ๋นํจ์จ์ ์ธ ๋ชจ๋ธ๋ก ์ด์ด์ง๋๋ค.
Mix-FFN vs. Positional Encoder (PE). ํ 1c ์ ๊ฐ์ด, ์ฃผ์ด์ง ์ด๋ฏธ์ง ํด์๋์ ๋ํด, Mix-FFN์ Positional Encoder์ ์ฌ์ฉํ๋ ๊ฒ๋ณด๋ค ํ์คํ ์ฐ์ํ ์ฑ๋ฅ์ ๋ณด์ฌ์ค๋๋ค. ๋ํ, Mix-FFN์ ํ ์คํธ ํด์๋์ ์ฐจ์ด์ ๋ ๋ฏผ๊ฐํจ์ ๋ณด์ฌ์ค๋๋ค. Positional Encoder์ ๊ฒฝ์ฐ ๋ฎ์ ํด์๋์์ ์ ํ๋๊ฐ 3.3%๋ ํ๋ฝํฉ๋๋ค.ํ์ง๋ง Mix-FFN์ ์ฌ์ฉํ๋ฉด ์ฑ๋ฅ ์ ํ๊ฐ 0.7%๋ง ํ๋ฝํฉ๋๋ค.์ด๋ฅผ ๋ณด์์๋, ์ ์๋ Mix-FFN์ ์ฌ์ฉํ๋ ๊ฒ์ด Positional Encoder๋ณด๋ค ํด์๋์ ์ํฅ์ ๋ ๋ฏผ๊ฐํ๋ฉด์๋ ๋ ๊ฐ๋ ฅํ ์ธ์ฝ๋๋ฅผ ๋ง๋ฌ์ ํ์ธํ ์ ์์ต๋๋ค.
Effective receptive field evaluation. ํ 1d๋ MLP-๋์ฝ๋๊ฐ CNN ๊ธฐ๋ฐ ์ธ์ฝ๋๊ฐ ์๋ Transformer๊ธฐ๋ฐ ์ธ์ฝ๋์ ๊ฒฐํฉํ๋ ๊ฒ์ด ๋ ๋์ ์ ํ๋๋ฅผ ๊ฐ์ง์ ์์ฌํฉ๋๋ค. ์ง๊ด์ ์ผ๋ก, CNN์ Transformer๋ณด๋ค receptive field๊ฐ ์๊ธฐ ๋๋ฌธ์, MLP-decoder ๋ก๋ global ์์ญ์ ๋ํ ์ถ๋ก ์ ํ๊ธฐ์ ์ถฉ๋ถํ์ง ์์ต๋๋ค. ๋ํ Transformer ์ธ์ฝ๋์ ๊ฒฝ์ฐ high-level feature ๋ง ์ฌ์ฉํ๋ ๊ฒ์ด ์๋ low-level local features ๊ณผ high-level non-local features์ ๊ฒฐํฉ๋์ด์ผ ํจ์ ์ ์ ์์ต๋๋ค.
ADE20K
Table 2. ADE20K study results
CityScape
Table 3. CityScape study results
COCO
Table 4. COCO study resultsํ 2,3,4๋ ADE20K ๋ฐ CityScape,COCO ๋ฐ์ดํฐ ์ ์ ๋ํ ํ๋ผ๋ฏธํฐ์, FLOPS, ์ง์ฐ ์๊ฐ ๋ฐ ์ ํ์ฑ์ ํฌํจํ ๊ฒฐ๊ณผ๋ฅผ ์์ฝํฉ๋๋ค. ์ด๋ฅผ ๋ณด์์๋,์ ์๋ Segformer๊ฐ ๊ธฐ์กด์ CNN ๊ธฐ๋ฐ ๋ฐฉ๋ฒ๋ค์ ๋นํด ์ ์ ํ๋ผ๋ฏธํฐ ์๋ฅผ ์ ์งํ๋ฉด์๋, ๋์ ์ฑ๋ฅ์ ๋ณด์ฌ ๊ณ ํจ์จ์ ๊ณ ์ฑ๋ฅ ๋ชจ๋ธ์์ ํ์ธํ ์ ์์ต๋๋ค.
5. Conclusion
๋ณธ ๋ ผ๋ฌธ์์๋ Positional Encoding์ด ์๋ ๊ณ์ธต์ ํธ๋์คํฌ๋จธ ์ธ์ฝ๋์ ๊ฒฝ๋ All-MLP ๋์ฝ๋ ๊ตฌ์กฐ์ ๊ต์ฅํ ๊ฐ๋จํ๊ณ ๊ฐ๋ ฅํ Semantic segmentation ๋ฐฉ๋ฒ์ธ SegFormer๋ฅผ ์ ์ํ์์ต๋๋ค. ์ด์ ๋ฐฉ๋ฒ์์ ํํ ๋ณผ ์ ์๋ ๋ณต์กํ ๋คํธ์ํฌ ๊ตฌ์กฐ๋ฅผ ํํผํ๋ฉด์๋ ํจ์จ์ฑ๊ณผ ์ฑ๋ฅ์ ๋ชจ๋ ํฅ์๋ ์๋ก์ด ๋ชจ๋ธ์ด๋ผ ํ ์ ์์ต๋๋ค. SegFormer๋ ์ผ๋ฐ์ ์ธ ๋ฐ์ดํฐ ์ธํธ์์ ์ต๊ณ ์ฑ๋ฅ์ ๋ฌ์ฑํ์ต๋๋ค.
Take home message
๊ธฐ์กด ์ ์๋ ๋ฐฉ๋ฒ๋ค์ ๋จ์ ์ ๋ถ์ํ๊ณ ๊ฐ์ ํ๋ ๊ฒ๊ณผ, ์ ์ํ๋ ๋ฐฉ๋ฒ์ ์ฐ์์ฑ์ ์ ์ฆํ๊ธฐ ์ํด ํ์ํ ์์๋ค์ด ๋ฌด์์ธ์ง ์๊ฐํ๋ ๊ฒ์ด ์ค์ํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
Author / Reviewer information
Author
๋ฐ์ง์ (Jinyoung Park)
Affiliation (KAIST EE / NAVER)
Contact : jinyoungpark@kaist.ac.kr
Reviewer
Reference & Additional materials
Xie, E., Wang, W., Yu, Z., Anandkumar, A., Alvarez, J. M., & Luo, P. (2021). SegFormer: Simple and efficient design for semantic segmentation with transformers. Advances in Neural Information Processing Systems, 34.
Wang, W., Xie, E., Li, X., Fan, D. P., Song, K., Liang, D., ... & Shao, L. (2021). Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In Proceedings of the IEEE/CVF International Conference on Computer Vision (pp. 568-578).
Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., ... & Houlsby, N. (2020). An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929.
Zheng, S., Lu, J., Zhao, H., Zhu, X., Luo, Z., Wang, Y., ... & Zhang, L. (2021). Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition (pp. 6881-6890).
Last updated
Was this helpful?