[논문 리뷰] LocalViT: Analyzing Locality in Vision Transformers
LocalViT는 비전 트랜스포머에 로컬리티 메커니즘을 도입하여 feed-forward 네트워크에 depth-wise 합성곱을 삽입하고, 최소한의 추가 비용으로 ImageNet 정확도를 향상시키며 여러 트랜스포머 아키텍처에서 일반화를 보여준다.
The aim of this paper is to study the influence of locality mechanisms in vision transformers. Transformers originated from machine translation and are particularly good at modelling long-range dependencies within a long sequence. Although the global interaction between the token embeddings could be well modelled by the self-attention mechanism of transformers, what is lacking is a locality mechanism for information exchange within a local region. In this paper, locality mechanism is systematically investigated by carefully designed controlled experiments. We add locality to vision transformers into the feed-forward network. This seemingly simple solution is inspired by the comparison between feed-forward networks and inverted residual blocks. The importance of locality mechanisms is validated in two ways: 1) A wide range of design choices (activation function, layer placement, expansion ratio) are available for incorporating locality mechanisms and proper choices can lead to a performance gain over the baseline, and 2) The same locality mechanism is successfully applied to vision transformers with different architecture designs, which shows the generalization of the locality concept. For ImageNet2012 classification, the locality-enhanced transformers outperform the baselines Swin-T, DeiT-T, and PVT-T by 1.0%, 2.6% and 3.1% with a negligible increase in the number of parameters and computational effort. Code is available at https://github.com/ofsoundof/LocalViT.
연구 동기 및 목표
- 비전 트랜스포머에 로컬리티 메커니즘을 도입해 로컬 이미지 구조를 포착하려는 동기를 제시한다.
- feed-forward 네트워크에 depth-wise 합성곱을 삽입해 로컬리티를 강화한 트랜스포머를 제안한다.
- 로컬리티, 활성화 함수, 확장 비율이 성능에 미치는 영향을 분석한다.
- 다수의 비전 트랜스포머 아키텍처를 대상으로 접근법의 일반성을 보여준다.
제안 방법
- 입력을 토큰 임베딩의 시퀀스로 해석하고 2D 격자(Seq2Img)로 재배치한다.
- feed-forward 네트워크를 인버티드 잔차에서 영감을 받은 모듈로 대체하고 1x1 컨볼루션과 depth-wise 2D 컨볼루션을 포함한다.
- 깊이 방향 컨볼루션 뒤에 비선형 활성화 함수(예: ReLU6, h-swish)를 사용하고 선택적 주의 모듈(ECA/SE)을 포함한다.
- 피드-forward 네트워크 이전에 클래스 토큰을 분할하고 이미지 토큰 처리 후 다시 연결하여 분류 동작을 보존한다.
- 선택된 트랜스포머 층에 로컬리티를 적용하고 배치 위치와 확장 비율(gamma)의 효과를 분석한다.
실험 결과
연구 질문
- RQ1피드포워드 네트워크에 로컬리티를 주입하는 것이 매개변수나 FLOPs의 큰 증가 없이 비전 트랜스포머의 정확도를 향상시키는가?
- RQ2활성화 함수, 층 배치, 숨김 차원 확장이 로컬리티의 이점을 어떻게 좌우하는가?
- RQ3로컬리티 메커니즘이 다른 비전 트랜스포머 아키텍처(예: DeiT, T2T-ViT, PVT, TNT)에서 얼마나 잘 일반화되는가?
주요 결과
- 깊이 방향 컨볼루션만으로도 기본 트랜스포머의 성능이 향상된다.
- 깊이 방향 컨볼루션 뒤의 활성화 선택이 이득에 큰 영향을 미치며(h-swish와 SE/ECA 조합이 더 큰 이득을 제공),
- 로컬리티는 상위 층보다 하위 층에서 더 큰 이득을 준다.
- 숨김 차원 확장 비율(gamma)을 늘리면 더 큰 용량과 정확도 이득이 나타난다.
- 로컬리티 메커니즘은 DeiT, T2T-ViT, PVT, TNT에서 일반화되며 여러 경우에서 기준선 대비 큰 개선이 관찰된다.
- ImageNet에서 LocalViT 변형은 최소한의 매개변수/계산 오버헤드로 DeiT-T 및 PVT-T 기준선 대비 최대 몇 포인트의 이점을 보인다.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.