◾CNN의 한계

◾ViT

🔻Patch

🔸Overview

🔸Patching

  1. (H,W,C) 크기의 이미지를 크기가 (P,P)인 패치 N개로 자른다.

    e.g.) (H, W, C) 이미지를 16개의 패치로 나눌 경우 → (16, H/4, W/4, C)

    (패치의 개수인 N을 미리 정하는 경우 계산 방식)

    e.g.2) (H, W, C) 이미지를 (2, 2) 패치로 나눌 경우 → (HW/4, 2, 2, C)

    (패치의 크기인 P를 미리 정하는 경우 계산 방식)

  2. 각각의 패치를 Flatten 한다.

  3. $(N, P^2\\times C)$ 크기의 flattend feature를 Linear Projection으로 d_model 크기로 변환한다.

🔸CLS Token

🔸Positional Encoding

🔸Transformer Encoder

🔸Task Head

🔻Conclusion

🔸Contibutes

image.png

🔸Limitations

◾Swin Transformer

🔻ViT의 문제점

⇒ Patch를 더 효율적으로 설계하는 구조를 제안

⇒ Inductive bias를 고려한 transformer 구조를 제안

🔻Heirarchical ViT = Swin Transformer

🔸Overview

🔸Patch Partitioning

  1. (4,4) patch로 이미지를 분할

    e.g. (224, 224, 3) → patching → (3136, 4, 4, 3)

  2. Concatenate : Channel 을 Concat함

    e.g. (3136, 4, 4, 3)(3136, 16 x 3)

  3. Linear Projection : (H/4 x W/4, 48)(H/4 x W/4, d_model)

🔸Positional Encoding

🔸Swin Transformer Block

🔸Patch Merging