Swin Transformer [kor]
Liu Z et al. / Swin Transformer Hierarchical Vision Transformer using Shifted Windows / arXiv prerint 2021
1. Problem definition
์ต๊ทผ natural language processing (NLP) ์์ ํฐ ์ฑ๊ณต์ ๊ฑฐ๋ self-attention, Transformer ๊ตฌ์กฐ๋ฅผ general vision task์ ์ ์ฉ์ํค๋ ์ฐ๊ตฌ๊ฐ ๋ง์ด ์งํ๋๊ณ ์์ต๋๋ค. ๊ทธ์ค์์๋ Vision Transformer (ViT) [3] ๋ classification์์ sota๋ฅผ ๋ฌ์ฑํ๋ ๋ฑ ์ฐ์ํ ์ฑ๋ฅ์ ๋ณด์ฌ์ฃผ์์ผ๋ฉฐ ViT๋ฅผ ์๋ ํ์ ์ฐ๊ตฌ๋ค์ด ๋ง์ด ์งํ๋๊ณ ์์ต๋๋ค. ์ด๋ฌํ ์ฐ๊ตฌ๋ค ์ค ํ๋์ธ Swin Transformer๋ ์ด๋ ํ ๋ฐฉ๋ฒ์ผ๋ก general vision task์ transformer ๊ตฌ์กฐ๋ฅผ ์ ์ฉ์ํค๋ ค ํ์๋์ง ์๊ฐํด ๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
2. Motivation
์ด ๋ ผ๋ฌธ์์๋ ์์ ๋ง์๋๋ฆฐ ๊ฒ๊ณผ ๊ฐ์ด Transformer๊ตฌ์กฐ๋ฅผ general vision task์ ์ ์ฉ์ํค๋ ์ฃผ์ ์ ์ฐ๊ตฌ์ ๋๋ค. ๊ด๋ จ ์ฐ๊ตฌ์ค ํ๋์ธ classification์ ์ ์ฉ๋ Vision Transformer (ViT)์ ์ด์ด ๋ณด๋ค ์ผ๋ฐ์ ์ธ vision task์ ์ ์ฉ๋ ์ ์๋ ์๋ก์ด ๊ตฌ์กฐ๋ฅผ ์ ์ํ์์ผ๋ฉฐ ๋ ผ๋ฌธ์ ์ ์๋ ์ด๋ฅผ ํตํด Vision๊ณผ language feature์ joint modeling์ ๊ฐ๋ฅ์ผ ํ๊ณ ๋ ๋ถ์ผ ๋ชจ๋์ ๋์์ด ๋ ์ ์์ ๊ฒ์ด๋ผ ์ธ๊ธํ์์ต๋๋ค.
Related work
CNN and variants:
๊ธฐ์กด์ vision task์์ ์ฃผ๋ก ์ฌ์ฉ๋๋ ๋ฐฉ๋ฒ์ผ๋ก ๋ง์ด ์๊ณ ๊ณ์๋ Convolution neural networks์ ๊ดํ ๋ด์ฉ์ ๋๋ค. AlexNet๋ถํฐ ์์ํ์ฌ ๋ deepํ๊ณ effectiveํ ๊ตฌ์กฐ๊ฐ ์ ์๋์์ผ๋ฉฐ convolution layer์์ฒด๋ฅผ ๊ฐ์ ํ ๋ฐฉ๋ฒ๋ค์ ๋ํด ์ธ๊ธํ์์ต๋๋ค. ์ง๊ธ๊น์ง์ CNN์ ์ด๋ฌ์ด๋ฌํ ๋ชจ๋ธ๋ค์ด ์๋ค ๋ผ๋ ์ธ๊ธ์ด๋ฉฐ ๋ ผ๋ฌธ์์ ์ค์ํ ๋ถ๋ถ์ด ์๋๋ผ ์์ธํ ๋ชจ๋ธ ์ด๋ฆ์ ๊ธฐ์ฌํ์ง ์์์ต๋๋ค. ๋ ผ๋ฌธ์์์ ํต์ฌ์ vision๊ณผ language ์ฌ์ด์ modeling์ ์ํด transformer์ ์ ์ฌ๋ ฅ์ ๊ฐ์กฐํ๊ณ modeling์ ๋ณํ์ ๊ธฐ์ฌํ๊ธฐ๋ฅผ ์ํ๋ค๊ณ ์ธ๊ธํ๊ณ ์์ต๋๋ค.
self-attention based backbone architectures:
convolution layer์ ์ผ๋ถ๋ถ์ด๋ ์ ๋ถ๋ฅผ self-attention์ผ๋ก ๋ณ๊ฒฝํ๋ ์ฐ๊ตฌ๋ค์ ํด๋นํ๋ฉฐ ํฌ๊ฒ Stand-alone self-attention model [4], Local Relation Networks [5]๊ฐ ์์ต๋๋ค. ์ด ์ค Local Relation Networks๋ self-attetention์ด ๊ฐ๊ฐ์ pixel์ local window์์ ๊ณ์ฐ๋๋ฉฐ ๊ธฐ์กด vision task์ ์ฑ๋ฅ์ ํฅ์์ํฌ ์ ์์์ ๋ณด์ฌ์ฃผ์์ต๋๋ค. ํ์ง๋ง sliding ๋ฐฉ์์ ์ฌ์ฉํ์ฌ ์ฐ์ฐ๋์ ์ฆ๊ฐ์ ๋ฐ๋ผ latency๊ฐ ์ฌ๊ฐํ๊ฒ ์ฆ๊ฐํ๋ ๋จ์ ์ด ์กด์ฌํ๋ค๊ณ ํฉ๋๋ค. ์ด ๋ ผ๋ฌธ์์๋ sliding window ๋์ consecutive layers์ฌ์ด์ shift sindows๋ผ๋ ํจ์ฌ ํจ๊ณผ์ ์ธ ๋ฐฉ๋ฒ์ ์ ์ํ์ฌ ์ด๋ฅผ ํด๊ฒฐํ๋ ค ํ์์ต๋๋ค.
self-attention/Transformers to complement CNNs:
Standard CNN ๊ตฌ์กฐ์ self-attention์ด๋ Transformers๋ฅผ ๊ฒฐํฉํ ๋ฐฉ๋ฒ๋ค๋ก self-attetnion layer๊ฐ distant dependencies๋ฅผ encoding ํจ์ผ๋ก์จ backbone์ด๋ head networks๋ฅผ ๋ณด์ํ ์ ์๋ค๊ณ ์๋ ค์ ธ ์์ต๋๋ค. ๋ํ ์ต๊ทผ ์ฐ๊ตฌ์ ๊ฒฝ์ฐ encoder-decoder๊ตฌ์กฐ์ transformer๋ฅผ object detection์ด๋ instance segmentation์ ์ ์ฉํ๊ณ ์์ต๋๋ค. ์ด ๋ ผ๋ฌธ์์๋ transformer๋ฅผ basic visual feature extraction์ผ๋ก ์ ์ฉํ๋ ค ํ์๊ณ ์ด๋ ๊ธฐ์กด ๊ด๋ จ ์ฐ๊ตฌ๋ค์ ๋ณด์ํ ์ ์๋ค ์ธ๊ธํ์์ต๋๋ค.
Transformer based vision backbones:
Vision task์ transformer๊ตฌ์กฐ๋ฅผ ์ ์ฉํ ๋ฐฉ๋ฒ๋ค๋ก Vision Transformer (ViT)์ ๊ทธ ํ์ ๋ ผ๋ฌธ๋ค์ ํด๋นํฉ๋๋ค. ์ด ๋ฐฉ๋ฒ์ ์ด๋ฏธ์ง๋ฅผ ๊ฐ๊ฐ์ ๊ณ ์ ๋ size์ patch๋ก ๋๋๊ณ ์ด๋ฌํ patch๋ฅผ token์ผ๋ก ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ๋ค์ ๋๋ค. CNN ๋ฐฉ๋ฒ๊ณผ ๋น์ทํ ์ฑ๋ฅ์ด์ง๋ง ๋ณด๋ค ๋น ๋ฅธ ์๋๋ฅผ ๋ณด์์ต๋๋ค. ์ด ๋ ผ๋ฌธ์์๋ Vit์ classification ์ฑ๋ฅ์ ํจ๊ณผ์ ์ผ๋ก ๋ณด์ด๋ ์ด๋ฌํ ๊ตฌ์กฐ๋ general-purpose backbone์ผ๋ก ์ฌ์ฉํ๊ธฐ์๋ low-resolution feature map๊ณผ ์ด๋ฏธ์ง ํฌ๊ธฐ์ ๋ฐ๋ฅธ ์ฐ์ฐ๋ ์ฆ๊ฐ๋ก ์ธํด ์ ํฉํ์ง ์๋ค๊ณ ์ธ๊ธํ๋ฉฐ ์ด๋ฅผ ๊ฐ์ ํ๋ ๋ฐฉ๋ฒ์ ์ ์ํ์์ต๋๋ค.
Idea
์ด ๋ ผ๋ฌธ์์๋ low-resolution feature map์ ์ํด general-purpose backbone์ผ๋ก ์ฌ์ฉ๋๊ธฐ์๋ ์ ํฉํ์ง ์์ ๊ธฐ์กด์ ViT์ ๋ฐฉ๋ฒ์ ๋ณ๊ฒฝํ์ฌ layer๊ฐ ๊น์ด์ง์๋ก patch๋ฅผ mergeํด ๋๊ฐ๋ hierarchical ๊ตฌ์กฐ๋ฅผ ์ ์ํ์์ต๋๋ค. ๊ธฐ์กด Vit๋ ์ด๋ฏธ์ง๊ฐ ์ปค์ง์๋ก ์ฐ์ฐ๋์ด ๋งค์ฐ ์ฆ๊ฐํ๋ค๋ ๋จ์ ์ด ์กด์ฌํ์์ต๋๋ค. ์ด๋ฅผ ๊ฐ๊ฐ์ local patch์์์๋ง self-attention์ ๊ณ์ฐํ๋ shifted window based self-attention์ ์ ์ํจ์ผ๋ก์จ ์ํํ์์ผ๋ฉฐ feature pyramid ๊ตฌ์กฐ๋ฅผ ์ ์ํจ์ผ๋ก์จ ๋ค๋ฅธ vision task์๋ ์ฌ์ฉ๊ฐ๋ฅํ ๊ณ์ธต์ ์ธ ์ ๋ณด๋ฅผ ํ์ฉํ ์ ์๋ค๊ณ ํฉ๋๋ค.
3. Method

Figure 1์ swin transformer์ hierarchical feature map๊ณผ ๊ธฐ์กด ViT์ feature map์ ๋ณด์ฌ์ค๋๋ค. ๊ธฐ์กด์ Vit๋ single low resolution feature map์ ์์ฑํด๋ด๋๋ฐ ๋ฐ๋ฉด swin transformer๋ hierarchical feature map์ผ๋ก deeper layer๋ก ๊ฐ์๋ก patches๋ฅผ mergeํด ๋๊ฐ๋ฉฐ window size๋ฅผ ๋ํ ๊ฐ๋๋ค.
ViT์ ๊ฒฝ์ฐ ๊ณ ์ ๋ patch size ๋ฅผ ์ฌ์ฉํ๋ฉฐ ๊ทธ ๊ฒฐ๊ณผ output feature map์ resolution์ ๊ธฐ์กด input image size์ ์ด ๋ฉ๋๋ค. ๋ฐ๋ฉด swin transformer์ ๊ฒฝ์ฐ patch size๋ฅผ ์์ ๊ฒ๋ถํฐ ์ ์ ํค์๊ฐ๋ฉฐ ์๋์ ์ผ๋ก high resolution feature map๋ถํฐ low resolution feature map ๊น์ง hiearachicalํ feature map์ ์ถ์ถ ํ ์ ์์ต๋๋ค.
์ด๋ฌํ hiearachicalํ feature map์ ๊ธฐ์กด CNN์์ ์์ฃผ ์ฌ์ฉ๋๋ feature pyramid networks, U-Net๊ณผ ๊ฐ์ ๊ธฐ์ ์ ๊ฐ๋จํ๊ฒ ์ ์ฉํ ์ ์๊ฒ ํฉ๋๋ค. ๋ํ model์ด ์ฌ๋ฌ scale๋ก ๋ถํฐ ์ ์ฐํ๊ฒ feature map์ ๋ฝ์๋ผ ์ ์๊ฒ ํ๋ ์ญํ ์ ํ๊ฒ ํฉ๋๋ค. (CNN์์ receptive field์ ์ญํ ๊ณผ ๋น์ทํ ๋ด์ฉ์ธ ๊ฒ ๊ฐ์ต๋๋ค. Detection์ผ๋ก ์๋ฅผ ๋ค๋ฉด patch size๊ฐ ํด ์๋ก ํฐ object๋ฅผ ์ ํ์งํ๋ฉฐ ๋ฐ๋์ผ ๊ฒฝ์ฐ ์์ object๋ฅผ ์ ํ์งํ๋ ์ญํ ์ ํ๋ ๋ด์ฉ์ด๋ผ๊ณ ์๊ฐํฉ๋๋ค.)
3.1. Shifted Window based Self-Attention
ํจ์จ์ ์ธ modeling์ ์ํด ๋ณธ ๋ ผ๋ฌธ์์๋ ๊ธฐ์กด ViT์์ ํ๋์ token(patch)์ ๋ค๋ฅธ ๋ชจ๋ token(patch) ์ฌ์ด์ self-attention์ ๊ณ์ฐํ๋ ๋ฐฉ๋ฒ์ ์์ ํ์ฌ ํ๋์ local windows์์์๋ง ๊ณ์ฐํ๋ ๋ฐฉ๋ฒ์ ์ ์ํ์์ผ๋ฉฐ ์ด๋ฅผ window based multi-head self attention (W-MSA)๋ผ ํฉ๋๋ค. ๊ฐ๊ฐ์ window๊ฐ patches๋ฅผ ๊ฐ์ง๊ณ ์๋ค ๊ฐ์ ํ์ ๋ multi-head self attention (MSA)์ window based multi-head self attention (W-MSA)์ computational complexity๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
์์์์ ๋ณด๋ค์ํผ ๊ธฐ์กด์ MSA์ ๊ฒฝ์ฐ ํฐ ์ฌ์ด์ฆ์ ์ด๋ฏธ์ง, ์ฆ hw๊ฐ ํฐ ๊ฒฝ์ฐ ์ ํฉํ์ง ์์ ๋ฐ๋ฉด ์ ์๋ ๋ฐฉ๋ฒ์ scalableํ ๊ฒ์ ์ ์ ์์ต๋๋ค.
์๋์ Result section์์ ViT์ Swin Transformer์ FLOPS(์ฐ์ฐ๋) ๋น๊ต๋ฅผ ๋ณด์๋ฉด ์ดํดํ๊ธฐ ์ฌ์ฐ์ค ๊ฒ๋๋ค.
ํ์ง๋ง local window ๋ด๋ถ์์๋ง self attention์ ๊ณ์ฐํ๊ฒ ๋๋ฉด ๊ธฐ์กด๊ณผ ๋ฌ๋ฆฌ window๊ฐ์ connection์ด ์์ด์ง๊ฒ ๋๋ฉฐ ๋ model์ ์ฑ๋ฅ์ ์ ํ์ํฌ ์ ์์ต๋๋ค. ๋ณธ ๋ ผ๋ฌธ์์๋ ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด ๋ ผ๋ฌธ์์๋ shifted window ๋ฐฉ๋ฒ์ ์ฌ์ฉํ์์ต๋๋ค.

Figure 2๋ shifted window์ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. ์ฒ์์ ๋ชจ๋์ ์ผ์ชฝ ์๋ถํฐ ์์ํด feature map์ size๋ฅผ ๊ฐ์ง window๋ฅผ ์ด์ฉ, ๋ก partitioning ํ๋ regular window partitioning strategy๋ฅผ ์ฌ์ฉํฉ๋๋ค. ์ดํ layer์์ ๊ธฐ์กด์ window๋ฅผ ๋งํผ ์ด๋์ํค๋ ๋ฐฉ๋ฒ์ผ๋ก window๋ฅผ ์ด๋์ํค๊ฒ ๋ฉ๋๋ค.
์ด๋ shifted window ๋ฐฉ์์ ์ฌ์ฉํ๊ฒ ๋๋ฉด ๋ช๋ช window์ size๊ฐ ๋ณด๋ค ์์์ง ์ ์์ต๋๋ค. ๋ ผ๋ฌธ์ ์ ์๋ ์ด๋ฌํ ๋ฌธ์ ๋ฅผ padding์ผ๋ก ํด๊ฒฐํ ๊ฒฝ์ฐ computational cost๊ฐ ์ฆ๊ฐํ๊ฒ ๋๋ฉฐ ๋ณด๋ค ํจ์จ์ ์ธ ๋ฐฉ๋ฒ์ธ cyclic shift ๋ฐฉ๋ฒ์ ์ ์ํ์์ต๋๋ค.

Figure 4๋ cyclic shift ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ฃผ๋ ๊ทธ๋ฆผ์ ๋๋ค. ํด๋น ๋ฐฉ๋ฒ์ batch window๋ feature map์์ ์ธ์ ํ์ง ์์ ์ฌ๋ฌ๊ฐ์ sub window๋ก ๊ตฌ์ฑ๋๋ฉฐ masking ๋ฐฉ๋ฒ์ ์ด์ฉ, self-attention์ ๊ฐ๊ฐ์ sub-window์์ ๊ณ์ฐ๋๊ฒ ์ ํํ๋ค๊ณ ํฉ๋๋ค. batched window์ ์๋ regular window partitioning๊ณผ ๋์ผํ์ฌ padding๋ฐฉ๋ฒ๋ณด๋ค ํจ์จ์ ์ด๋ผ๊ณ ์ค๋ช ํ๊ณ ์์ต๋๋ค.
3.2. Overall Architectures

Figure 3์ Swin Transformer tiny version์ architecture๋ฅผ ๋ณด์ฌ์ค๋๋ค. Swin Transformer๋ image๋ฅผ ์ ๋ ฅ์ผ๋ก ๋ฐ์ ์์ํ๊ฒ ๋ฉ๋๋ค. patch partitioning์์ ViT์ ๊ฐ์ด image๋ฅผ patch๋ก ๋๋๊ฒ ๋ฉ๋๋ค. ์ดํ ๋๋์ด์ง patch๋ฅผ token์ผ๋ก transformer์ ์ ๋ ฅ์ผ๋ก ์ฌ์ฉํ๋ ๋ฐฉ์์ ๊ฐ์ง๊ณ ์์ต๋๋ค.
์ดํ ๊ฐ๊ฐ์ stage๋ง๋ค patch merging์ผ๋ก patch๋ฅผ ๊ฒฐํฉํด window size๋ฅผ ๋ํ์ฃผ๊ฒ ๋ฉ๋๋ค. ์ด๋ ๊ฒ ํจ์ผ๋ก์จ ๊ฐ๊ฐ์ stage๋ ์๋ก ๋ค๋ฅธ scale feature๋ฅผ ๊ฐ์ง ์ ์๊ฒ ๋๋ฉฐ vision task์ ์ฌ์ฉ๊ฐ๋ฅํ ๊ณ์ธต์ ์ธ ์ ๋ณด๋ฅผ ํ์ฉํ ์ ์๋ค๊ณ ํฉ๋๋ค.
Swin Transformer block์ ์์ ์ค๋ช ๋๋ฆฐ W-MSA์ SW-MSA๋ก ์ด๋ฃจ์ด์ ธ ์์ต๋๋ค. hierarchical representation์ ์ ๊ณตํ๊ธฐ ์ํด token์ ์๋ patch merging layer๋ฅผ ํต๊ณผํจ์ ๋ฐ๋ผ ์ค์ด๋ค๊ฒ ๋๋ฉฐ ๋งค๋ฒ token์ ์๋ฅผ 4๋ฐฐ ์ค์ด๊ณ output dimension์ 2๋ฐฐ ๋๋ฆฐ๋ค๊ณ ํฉ๋๋ค. ๋ฐ๋ผ์ ๊ฐ stage์ output resolutions์ ๊ทธ๋ฆผ์์ ๋ณด๋ค์ํผ ์์ ์์ํ์ฌ ๋ก ์ค์ด๋ค๊ฒ ๋ฉ๋๋ค. ์ด๋ฌํ feature map์ resolution์ ์ ํ์ ์ธ convolution networks์ธ VGG [6]์ ResNet [7]๊ณผ ๊ฐ์ผ๋ฉฐ ๋ฐ๋ผ์ ์ฝ๊ฒ ๊ธฐ์กด CNN๋ชจ๋ธ์ ๋์ฒดํ ์ ์๋ค๊ณ ์ ์๋ ๋งํ๊ณ ์์ต๋๋ค.
W-MSA์ ์์์ ์ค๋ช ํ ์ฐ์ฐ๋์ ์ค์ธ window based multi-head self attention์ด๋ฉฐ SW-MSA์ connection์์ค์ ํด๊ฒฐํ๊ธฐ ์ํด patch๋ฅผ shift ์์ผ ์ํํ๋ Shifted Window based Self-Attention์ ์๋ฏธํฉ๋๋ค. SW-MSA์์ W-MSA์์ ์ฌ์ฉํ patch๋ฅผ shift์์ผ ๋ค์ ํ๋ฒ ์ํํ๋ค๊ณ ์๊ฐํ๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค.
4. Experiment & Result
Experimental setup
๊ฐ๊ฐ์ vision task์ ์คํํด๋ณด๊ธฐ ์ํด ๋ ผ๋ฌธ์์๋ ํฌ๊ฒ 3๊ฐ์ง classification, object detection, semantic segmentation task ์คํ์ ์งํํ์์ผ๋ฉฐ ๋น๊ต ๋์์ผ๋ก๋ ๊ฐ๊ฐ์ task, classification, object detection, semantic segmentation์ state-of-the-arts ๋ชจ๋ธ๋ค์ ์ฌ์ฉํ์์ต๋๋ค.
Dataset
๊ฐ๊ฐ์ dataset์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
Image Classification : ImageNet-1K image classfication [8]
Object Detection : COCO object detection [9]
Semantic Segmentation : ADE20K semantic segmentation [10]
Training step
Image Classification on ImaegNet-1K
Regular ImageNet-1K training
AdamW optimizer์ cosine decay learning rate schedular๋ฅผ ์ฌ์ฉํ์์ผ๋ฉฐ cosine decay๋ก 300 epochs, linear warm-up์ผ๋ก 20 epochs ํ์ตํ์์ต๋๋ค.
batch size๋ 1024์ด๋ฉฐ ์ด๊ธฐ learning rate๋ 0.001, weight decay ๋ 0.05๊ฐ ์ฌ์ฉ๋์์ต๋๋ค.
Pre-trainiong on ImageNet-22K and fine-tunnign on ImageNet-1K
Pre-train์ AdamW optimizer์ linear decay learning rate scheduler๋ฅผ ์ฌ์ฉํ์์ผ๋ฉฐ 90 epochs, linear warm-up์ผ๋ก 5 epochs ํ์ตํ์์ต๋๋ค.
batch size๋ 4096์ด๋ฉฐ ์ด๊ธฐ learning rate๋ 0.001, weight decay ๋ 0.01๊ฐ ์ฌ์ฉ๋์์ต๋๋ค.
fine-tuning์๋ batch size 1024, learning rate , weight decay ์ด ์ฌ์ฉ๋์์ต๋๋ค.
Object Detection on COCO
multi-scale training ๋ฐฉ์์ผ๋ก ์ด๋ฏธ์ง์ ๊ฐ๋ก ์ธ๋ก์ค ์งง์ ๋ถ๋ถ์ 480 ~ 800, ๊ธด ๋ถ๋ถ์ ์ต๋ 1333์ผ๋ก ์ฌ์ฉํ๋ค๊ณ ํฉ๋๋ค.
AdamW optimizer์ ์ด๊ธฐ learning rate 0.00001, weight decay 0.05, batch size 16, epochs 36 ์ ์ฌ์ฉํ์์ผ๋ฉฐ 27, 33 epoch์ learning rate๊ฐ 10x ๋งํผ ์ค์ด๊ฒ๋ ํ๋ค๊ณ ํฉ๋๋ค.
Semantic segmentation on ADE20K
AdamW optimizer์ ์ด๊ธฐ learning rate , weight decay 0.01, linear warmup 1,500 iterations์ ์ฌ์ฉํ์์ผ๋ฉฐ model์ 160K iterations๋์ ํ์ตํ๋ค๊ณ ํฉ๋๋ค.
๊ธฐํ flipping, random re-scaling, random photometric distortion๋ฑ์ augmentation์ด ์ฌ์ฉ๋ฌ๋ค๊ณ ํฉ๋๋ค.
Evaluation matrics
Image Classification : param, FLOPS, throughput, top-1 acc.
Object Detection : AP, param, FLOPS
Semantic Segmentation : mIoU param, FLOPS, FPS
Result
Image Classification, Object Detection, Semantic Segmentation ์ ๋ํ ์ฑ๋ฅ์ ์์น๋ก ๋น๊ตํ ํ์ ๋๋ค.

์ผ์ชฝ๋ถํฐ Image Classification, Object Detection, Semantic Segmentation์ ํด๋นํ๋ฉฐ Image Classification์ ๊ฒฝ์ฐ ๊ธฐ์กด state-of-the-art์ classification์ ์ฌ์ฉ๋ ViT์์ ์ฑ๋ฅ์ ๋น๊ตํ ์๋ฃ๋ก EfficientNet-B7๊ณผ ๋น์ทํ ์ฑ๋ฅ์ ๋ณด์ธ๋ค๊ณ ํฉ๋๋ค. ๋ํ ViT ๋ชจ๋ธ๋ค์ ๊ฒฝ์ฐ ๊ธฐ์กด๋ณด๋ค ์ ์ parameter์๋ก ๋ ๋์ ์ฑ๋ฅ์ ๋ฌ์ฑํ๋ค๋ ๊ฒ์ ๋ณด์ฌ์ค๋๋ค.
Object Detection, Semantic Segmentation์ ๊ฒฝ์ฐ ๊ธฐ์กด ๋ชจ๋ธ๋ค์ backbone์ ๋ณ๊ฒฝํ์ฌ ์ฑ๋ฅ์ ๋น๊ตํ์์ต๋๋ค. ๊ธฐ์กด ๋ฐฉ๋ฒ๋ค์์ backbone์ Swin Transformer๋ก ๋ณ๊ฒฝํ์์ ๋ ๊ฑฐ์ ๋๋ถ๋ถ ๊ธฐ์กด ์ฑ๋ฅ์ ๋ฅ๊ฐํ ๊ฒ์ ๋ณด์ธ๋ค ํฉ๋๋ค.
5. Conclusion
๋ณธ ๋ ผ๋ฌธ์์๋ hierarchical feature representation์ ์ํํ ์ ์์ผ๋ฉฐ image size์ ๋นํด ์ ์ computational complexity๋ฅผ ๊ฐ์ง๋ ์๋ก์ด transformer ๊ตฌ์กฐ๋ฅผ ์ ์ํ์์ต๋๋ค. ๊ธฐ์กด ViT์ multi-head self-attention์ ์ฐ์ฐ๋ ๋ฌธ์ ๋ฅผ window based self-attetnion์ผ๋ก ํด๊ฒฐํ๊ณ window๊ฐ์ connection๋ฌธ์ ๋ฅผ shifted window ๋ฐฉ์์ผ๋ก ํด๊ฒฐํ์์ต๋๋ค. Calssfication์ด์ธ์ vision task์ ํ์ํ ๋ถ๋ถ์ ๋ถ์ํ๊ณ multi scale์ ์ํด patch๋ฅผ mergeํ๋ hierarchical ๊ตฌ์กฐ๋ฅผ ์ ์ํ์์ต๋๋ค. ์ ์๋ ๋ชจ๋ธ์ Object Detection, Semantic Segmentation์์ state-of-the-art๋ฅผ ๋ฌ์ฑํ์์ต๋๋ค. ๊ธฐ์กด์ Vision transformer์ ๋ฌธ์ ๋ฅผ ์ ๋ถ์ํ๊ณ classification์ด์ธ์ ๋ค๋ฅธ vision task๋ฅผ ์ํ ๋ถ์ ๋ฐ ๋ชจ๋ธ ์ค๊ณ๊ฐ ๋๋ณด์ด๋ ๋ ผ๋ฌธ์ด์์ต๋๋ค.
Take home message (์ค๋์ ๊ตํ)
๊ธฐ์กด ๋ฐฉ๋ฒ์ ๋จ์ ์ ๋ถ์ํ๊ณ ๊ฐ์ ํ๋ ๊ฒ๊ณผ ์ํํด์ผํ task์ ์ง์คํ์ฌ ์ค์ํ ๊ฒ์ด ๋ฌด์์ธ์ง ์๊ฐํด ๋ณด๋๊ฒ์ด ์ค์ํ๋ค๊ณ ์๊ฐํฉ๋๋ค.
Author / Reviewer information
Author
์ดํ์ (Hyeonsu Lee)
Affiliation (KAIST AI / NAVER)
Machine Learning Engineer @ NAVER Papago team
Reviewer
Korean name (English name): Affiliation / Contact information
Korean name (English name): Affiliation / Contact information
..
Reference & Additional materials
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248โ255. Ieee, 2009 9.
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence ยด Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740โ755. Springer, 2014
Bolei Zhou, Hang Zhao, Xavier Puig, Tete Xiao, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Semantic understanding of scenes through the ade20k dataset. International Journal on Computer Vision, 2018.
Last updated
Was this helpful?