이 논문에서 Convolution vision Transformer(CvT)
라는 새로운 architecture를 소개한다.
이는 ViT의 performanc와 efficiency를 개선하기 위해
convolution을 ViT에 도입하여 두 design의 장점을 모두 제공한다.
이를 위해 두 가지 주요 수정 사항을 도입했다.
우리는 CvT가 ImageNet-1K에서
fewer parameters and lower FLOPs로도 SOTA를 달성하면서,
다른 Vision Transformers와 ResNets을 능가하는 성능을 보여주는 광범위한 실험을 통해 검증했다.
또한 더 큰 Dataset(e.g. ImageNet-22K)에서 Pretrained되고 downstream 작업에 맞추어 finetuning될 때도 성능 이점을 유지한다.
ImageNet-22K에서 Pretrained된 CvT-W24는
ImageNet-1K val set에 대해서 87.7% top-1 accuracy를 달성했다.
(Code will be released at https: //github.com/microsoft/CvT)
Transformer는 NLP task에서 다양하게 사용되고 있다.
ViT는 large scale에서 경쟁력 있는 image classification 성능을 얻기 위해 Transformer architecture에만 의존하는 최초의 computer vision model이다.
ViT design은 language understanding을 위한 Transformer architecture를 최소한의 수정으로 만들어졌다.
먼저, image를 개별적인 non-overlapping한 patches로 분할한다.
그 다음, patch들은 NLP에서의 token으로 취급되며, positional encoding과 함께 합산되어,
global relations을 modeling하기 위해 반복되는 standard Transformer layer에 입력된다.
Vision Transformer가 큰 성공을 이뤘음에도 불구하고,
적은 양의 Data로 traing할 때는 유사한 크기의 CNN model(e.g. ResNets)보다 성능이 여전히 낮다.
그 이유 중 하나는 ViT가 vision task를 해결하는 데 CNN architecture에 내재된 특정 바람직한 특성이 부족하기 때문일 수 있다.
예를 들어, image에는 강력한 2D local structure가 있다.
(spatially neighboring pixels are usually highly correlated)
CNN architecture는 local receptive fields, shared weights, and spatial subsampling을 사용하여
이러한 local structure를 강제로 capture하게 한다.
따라서 어느 정도의 shift, scale, and distiortion invariance를 달성할 수 있다.
또한 convolutional kernels의 hierarchical structure는
단순한 low-level의 edge와 texture에서부터 higher order semantic pattern에 이르기까지
다양한 수준의 complexity를 갖는 local spatial context를 고려한 visual pattern을 학습한다.
이 논문에서는 Convolution을 ViT 구조에 도입하여 performance와 robustness를 개선하면서
동시에 높은 수준의 computational and memory efficiency를 유지할 수 있다고 가설을 세웠다.
이러한 가설을 검증하기 위해, Convolution을 Transformer에 도입하여 고유의 효율성을 가진 새로운 architecture인 Convolutional Vision Transformer(CvT)를 제안한다.
CvT design은 ViT architecture의 두 핵심 부분에 convolution을 도입한다.
요약하자면,
우리가 제안하는 Convolutional Vision Transformer(CvT)는
CNN의 모든 장점(local receptive fiels, shared weights, and spatial subsampling)과
Transformer의 모든 장점(dynamic attention, global context fusion, and better generalization)을 활용한다.
CvT는 CNN-based model과 Transformer-based model에 비해
fewer FLOPS and parameters를 사용하면서도 성능을 향상시킨다.
ViT는 순수 transformer architecture가 image classification에서 SOTA를 달성할 수 있음을 최초로 증명했다.
이는 Data가 충분히 큰 경우에 해당함.
DeiT는 ViT의 data-efficient training 및 distillation을 추가로 탐구했다.
이 연구에서는 image classification에서
local 및 global dependencies를 효율적으로 modeling하기 위해
CNN과 Transformer를 결합하는 방법을 연구함
vision transformer에서 local context를 더 잘 modeling하기 위해,
일부 현재의 연구들은 design changes를 도입했다.
예를 들어,
Convolutional Token Embedding
과 Convolutional Projection
을 도입했다.CNNs에서 사용한 multi-stage hierarchy design이 사용되며,
이 연구에서는 3 stages가 사용된다.
Convolutional Projection layer의 목표는 local spatial context를 추가로 modeling하고,
와 matrices를 downsampling할 수 있도록 하여 Efficiency를 향상시키는 것이다.
기본적으로,
Convolutional Projection을 포함한 Transformer block은 original Transformer block의 일반화된 형태이다.
우리는 Mult-Head Self-Attention(MHSA)을 위한 기존의 position-wise linear projection을
depth-wise separable convolution으로 대체하여 Convolutional Projection layer를 제안한다.
Figure 3 (a)는 ViT에서 사용된 original position-wise linear projection
Figure 3 (b)는 우리의 Convolutional Projection이다.