[논문 리뷰] ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biases
소프트하게 게이트된 위치 self-attention(GPSA)를 도입해 Vision Transformers에 컨볼루션 인덕티브 바이어스를 부드럽게 주입하고, 외부 데이터 사전학습 없이 DeiT 대비 샘플 효율성과 ImageNet 성능을 향상시킨다.
Convolutional architectures have proven extremely successful for vision tasks. Their hard inductive biases enable sample-efficient learning, but come at the cost of a potentially lower performance ceiling. Vision Transformers (ViTs) rely on more flexible self-attention layers, and have recently outperformed CNNs for image classification. However, they require costly pre-training on large external datasets or distillation from pre-trained convolutional networks. In this paper, we ask the following question: is it possible to combine the strengths of these two architectures while avoiding their respective limitations? To this end, we introduce gated positional self-attention (GPSA), a form of positional self-attention which can be equipped with a ``soft" convolutional inductive bias. We initialise the GPSA layers to mimic the locality of convolutional layers, then give each attention head the freedom to escape locality by adjusting a gating parameter regulating the attention paid to position versus content information. The resulting convolutional-like ViT architecture, ConViT, outperforms the DeiT on ImageNet, while offering a much improved sample efficiency. We further investigate the role of locality in learning by first quantifying how it is encouraged in vanilla self-attention layers, then analysing how it is escaped in GPSA layers. We conclude by presenting various ablations to better understand the success of the ConViT. Our code and models are released publicly at https://github.com/facebookresearch/convit.
연구 동기 및 목표
- 소프트한 컨볼루션 인덕티브 바이어스를 도입하여 CNN과 ViT를 연결하려는 동기를 부여한다.
- 초기화가 컨볼루셔널로 시작하고 점차 콘텐츠에 의존하도록 GPSA 레이어를 개발한다.
- 추가 데이터 없이도 ConViT가 DeiT보다 정확도와 샘플 효율성 측면에서 향상됨을 보인다.
- GPSA와 일반적인 self-attention에서 지역성이 어떻게 학습되고 탈피되는지 분석한다.
- 초기화, 게이팅, GPSA 배치의 역할을 이해하기 위한 아이블레이션을 제공한다.
제안 방법
- 학습 가능한 게이트 λ_h로 콘텐츠 항과 위치 항을 결합하는 gated positional self-attention(GPSA)를 정의한다.
- GPSA를 컨볼루셔널 커널을 흉내 내도록 초기화하고(컨볼루셔널 초기화) 상대 위치 인코딩을 고정한다.
- 소프트맥스 이후에 위치 기반 주의와 콘텐츠 기반 주의를 혼합하기 위한 게이팅 메커니즘을 도입한다(Eq. 7).
- DeiT 기반 아키텍처에서 ViT Self-attention 계층의 일부를 GPSA 계층으로 대체하여 ConViT를 만든다.
- 비국소성(nonlocality) 지표를 통해 지역성 동역학을 분석하고 계층 간(헤드 간)의 게이팅 매개변수를 검토한다.
- 재현성을 위한 오픈 소스 코드와 사전 학습된 모델을 제공한다.
실험 결과
연구 질문
- RQ1소프트하고 학습 가능한 컨볼루션 인덕티브 바이어스를 고정된 CNN 유사 체제로 모델을 잠그지 않고 비전 트랜스포머에 통합할 수 있는가?
- RQ2일반(self-attention)에서 로컬라이제이션이 어떻게 나타나며, 훈련 중 GPSA 계층은 로컬리티를 어떻게 탈피하는가?
- RQ3GPSA 기반 ConViT가 DeiT에 비해 샘플 효율성과 경쟁력 있는 정확도를 제공하는가, 특히 데이터가 제한된 상황에서?
주요 결과
| 모델 | N_h | D_emb | 크기 | FLOPs | 속도 | Top-1 | Top-5 |
|---|---|---|---|---|---|---|---|
| DeiT | 3 | 192 | 6M | 1G | 1442 | 72.2 | - |
| ConViT | 4 | 192 | 6M | 1G | 734 | 73.1 | 91.7 |
| DeiT Ti+ | 4 | 256 | 10M | 2G | 1036 | 75.9 | 93.2 |
| ConViT Ti+ | 4 | 256 | 10M | 2G | 625 | 76.7 | 93.6 |
| DeiT S | 6 | 384 | 22M | 4.3G | 587 | 79.8 | - |
| ConViT S+ | 9 | 432 | 27M | 5.4G | 305 | 81.3 | 95.7 |
| DeiT S+ | 9 | 576 | 48M | 10G | 480 | 79.0 | 94.4 |
| ConViT S+ | 9 | 576 | 48M | 10G | 382 | 82.2 | 95.9 |
| DeiT B | 12 | 768 | 86M | 17G | 187 | 81.8 | - |
| ConViT B | 16 | 768 | 86M | 17G | 141 | 82.4 | 95.9 |
| DeiT B+ | 16 | 1024 | 152M | 30G | 114 | 77.5 | 93.5 |
| ConViT B+ | 16 | 1024 | 152M | 30G | 96 | 82.5 | 95.9 |
- ConViT는 동일 크기 및 연산량의 DeiT를 능가하며, 여러 구성에서 ImageNet에서 더 높은 Top-1 및 Top-5를 보인다.
- ConViT-S+는 82.2% top-1을 달성( DeiT-S의 81.4% 대비), 일부 기준선 대비 처리량이 향상된다.
- GPSA 계층은 부드럽고 제어 가능한 컨볼루션 바이어스를 제공하여 초기 학습 역학과 샘플 효율성을 향상시킨다.
- 게이팅 파라미터는 초기 계층에서 위치 정보에 더 많이 의존하는 헤드를, 나중 계층에서 콘텐츠에 더 의존하는 헤드로 이동시킨다.
- 아이블레이션은 컨볼루셔널 초기화와 게이팅이 함께 이득에 기여하며, 특히 데이터가 적은 조건에서 두드러진다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.