[논문 리뷰] CrossFormer: A Versatile Vision Transformer Hinging on Cross-scale Attention
CrossFormer는 교차 스케일 임베딩과 롱-쇼트 거리 어텐션을 도입하여 비전 트랜스포머에서 교차 스케일 상호 작용을 가능하게 하고, 가변 입력 크기에 대한 동적 위치 편향을 추가하여 분류, 탐지, 인스턴스 분할, 의미 분할 등의 분야에서 강력한 성능을 달성한다.
Transformers have made great progress in dealing with computer vision tasks. However, existing vision transformers do not yet possess the ability of building the interactions among features of different scales, which is perceptually important to visual inputs. The reasons are two-fold: (1) Input embeddings of each layer are equal-scale, so no cross-scale feature can be extracted; (2) to lower the computational cost, some vision transformers merge adjacent embeddings inside the self-attention module, thus sacrificing small-scale (fine-grained) features of the embeddings and also disabling the cross-scale interactions. To this end, we propose Cross-scale Embedding Layer (CEL) and Long Short Distance Attention (LSDA). On the one hand, CEL blends each embedding with multiple patches of different scales, providing the self-attention module itself with cross-scale features. On the other hand, LSDA splits the self-attention module into a short-distance one and a long-distance counterpart, which not only reduces the computational burden but also keeps both small-scale and large-scale features in the embeddings. Through the above two designs, we achieve cross-scale attention. Besides, we put forward a dynamic position bias for vision transformers to make the popular relative position bias apply to variable-sized images. Hinging on the cross-scale attention module, we construct a versatile vision architecture, dubbed CrossFormer, which accommodates variable-sized inputs. Extensive experiments show that CrossFormer outperforms the other vision transformers on image classification, object detection, instance segmentation, and semantic segmentation tasks. The code has been released: https://github.com/cheerss/CrossFormer.
연구 동기 및 목표
- 다양한 시각 작업에서 비전 트랜스포머의 교차 스케일 특징 상호 작용 필요성을 제시한다.
- 계산량이 과도하지 않으면서 교차 스케일 어텐션을 가능케 하는 메커니즘을 제안한다.
- 다양한 작업에서 가변 크기의 입력을 처리하는 다용도 아키텍처를 개발한다.
제안 방법
- Cross-scale Embedding Layer (CEL)은 임베딩당 여러 스케일의 패치를 샘플링하고 이를 연결하여 교차 스케일 임베딩을 형성한다.
- Long Short Distance Attention (LSDA)은 자기주의를 Short Distance Attention (SDA)와 Long Distance Attention (LDA)로 분리하여 작은 스케일의 특징과 큰 스케일의 특징을 모두 보존하면서 계산 비용을 줄인다.
- Dynamic Position Bias (DPB)는 임베딩 거리로부터 상대 위치 편향을 생성하기 위해 MLP를 사용하여 가변 이미지/그룹 크기를 가능하게 한다.
- CEL과 CrossFormer 블록(LSDA + DPB)을 갖춘 피라미드 아키텍처가 다수의 단계와 다양한 비전 작업을 지원하도록 구축된다.
- 작은 규모에서 큰 규모까지의 모델과 서로 다른 다운스트림 요구를 포괄하기 위해 네 가지 CrossFormer 변형(T, S, B, L)이 구성된다.
실험 결과
연구 질문
- RQ1교차 스케일 임베딩과 롱-쇼트 거리 어텐션이 비전 트랜스포머에서 효과적인 교차 스케일 상호 작용을 가능하게 할까?
- RQ2가변 입력 크기 및 그룹화에 대한 강건성을 향상시키는가를 DPB가 개선하는가?
- RQ3CrossFormer 모델이 최첨단 비전 트랜스포머를 상대로 분류, 탐지, 인스턴스/의미 분할에서 정확도와 작업 성능을 향상시키는가?
- RQ4CEL과 LSDA가 작은 스케일 세부 정보를 희생하지 않으면서 계산 효율성에 어떻게 기여하는가?
- RQ5밀도 예측 작업(탐지/세분화)에서 이익이 이미지 분류보다 더 두드러지는가?
주요 결과
- CrossFormer은 비슷한 매개변수 및 FLOPs로 ImageNet 분류에서 최첨단 비전 트랜스포머를 지속적으로 능가한다.
- CrossFormer-S/B/L은 모델 규모에 걸쳐 강력한 베이스라인(예: DeiT, Swin)보다 더 높은 정확도를 달성하며, 특히 큰 모델에서 주목할 만한 이점을 보인다.
- COCO 객체 탐지 및 인스턴스 분할에서 CrossFormer 변형은 더 높은 AP 지표를 달성하고 큰 모델일수록 이득이 커진다.
- ADE20K에서 CrossFormer 백본으로 시맨틱 분할은 IOU/ MS IOU 점수를 개선하며, 특히 더 큰 변형에서 두드러진다.
- 추가 실험에서 교차 스케일 임베딩과 LSDA가 PVT 유사 및 Swin 유사 어텐션을 능가하고, DPB가 RPB 성능과 비슷하며 가변 입력 크기에 대한 유연성을 더한다.
더 나은 연구,지금 바로 시작하세요
논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.