논문 해설
CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications
CAS-ViT: 효율적인 모바일 응용을 위한 합성곱 덧셈 자기어텐션 비전 트랜스포머
- 연구 문제 ViT의 MSA는 입력 크기에 대해 이차 복잡도를 가지고 Softmax와 행렬 곱셈이 모바일 배포를 어렵게 합니다.
- 연구 방법 공간과 채널 상호작용을 Sigmoid 주의로 구현하고 Φ(Q)+Φ(K) 가산 유사도로 결합하는 CATM을 CAS 블록에 넣어 경량 계층 백본을 구성합니다.
- 주요 결과 ImageNet-1K 분류, COCO 검출·분할, ADE20K 의미 분할에서 경량 모델의 정확도와 효율 균형을 보고하며, 일부 비교에서 기존 모델보다 높은 수치를 보입니다.
토큰 믹서의 계산 부담과 모바일 배포 문제
ViT는 전역 문맥을 얻는 토큰 믹서 덕분에 강력하지만, 원문은 MSA가 입력 이미지 크기에 대해 이차 복잡도를 가져 모바일과 엣지 기기에서 계산 비효율을 만든다고 설명합니다. 또한 행렬 곱셈과 Softmax는 일부 엣지 기기에서 연산자 미지원과 모델 변환 실패를 일으킬 수 있다고 원문은 지적합니다. 그래서 CNN이 자원 제약 환경의 주류로 남아 있으며, CNN은 제한된 수용 영역 때문에 특징 추출과 성능에 한계가 있습니다.
이 논문은 이 긴장을 해결하기 위해 효율적으로 배포되면서도 강한 성능을 내는 토큰 믹서를 찾습니다. 기존 MSA 개선법과 이종 MSA(H-MSA)도 여러 방식으로 복잡도를 줄였지만, 저자들은 저복잡도 연산만으로는 실시간 기기에서 요구되는 성능을 충분히 얻지 못한다고 봅니다.
공간과 채널 상호작용을 가산 유사도로 결합하는 CATM
CATM은 토큰 믹서의 정보 상호작용을 공간 도메인과 채널 도메인으로 나누어 구현합니다. 공간 상호작용은 3×3 합성곱으로 국소 정보를 통합한 뒤 1×1 합성곱으로 채널을 1로 줄이고 Sigmoid를 적용해 H×W×1 주의 맵을 만듭니다. 채널 상호작용은 적응 풀링 뒤 1×1 합성곱과 Sigmoid로 주의를 만들고 입력에 곱합니다.
핵심 유사도 함수는 Sim(Q, K) = Φ(Q) + Φ(K)로 정의되며, Φ는 공간과 채널 상호작용을 포함한 문맥 변환입니다. 출력은 O = Γ(Φ(Q) + Φ(K)) ⊙ V로 계산됩니다. 여기서 Γ는 문맥 정보를 통합하는 선형 변환입니다. 두 항을 곱셈이 아닌 덧셈으로 결합하고 Softmax를 쓰지 않으므로, 행렬 곱셈과 Softmax의 복잡도와 배포 제약을 피하려는 설계입니다.
![Figure 2: Comparison of diverse self-attention mechanisms. (a) is the classical multi-head self-attention in ViT [24]. (b) is the separable self-attention in
M…](/papers/118b8f22-a362-44e5-bbd5-9413aba9e936/figures/figure-0d872be526e34edbd18b28fff91a66f3.png?thumb=512)
Fig. 2 . Comparison of diverse self-attention mechanisms. (a) is the classical multi-head self-attention in ViT [24]. (b) is the separable self-attention in MobileViTv2 [21], which reduces the feature metric of a matrix to a vector. (c) is the swift self-attention in SwiftFormer [20], which achieves efficient feature association only with Q and K. (d) is proposed convolutional additive self-attention.
원문 · CC BY 4.0 · Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, Jenq-Neng Hwang, Xiangyang Ji · CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications · 원문 그림 인용 · 원본 PDF 3쪽에서 그림 영역을 추출했습니다.CAS 블록과 네트워크 구성
CAS 블록은 통합 하위 네트워크, CATM, MLP를 잔차 연결로 묶은 기본 단위입니다. 통합 하위 네트워크는 ReLU로 활성화되는 세 개의 3×3 깊이별 합성곱 층으로 구성되며 수용 영역을 넓히고 지역 정보를 통합하여 위치 부호화 역할을 합니다. 원문은 CATM을 모든 블록의 각 스테이지에 사용하며, MLP 비율은 기본값 4로 설정했다고 보고합니다.
네트워크는 H×W×3 입력을 두 개의 3×3 스트라이드 2 합성곱 Stem으로 H/4×W/4×C1으로 줄입니다. 이후 네 스테이지가 패치 임베딩 다운샘플링과 CAS 블록을 거치며 H/8, H/16, H/32 해상도의 특징 맵을 만듭니다. 표 I의 XS, S, M, T 변형은 블록 수 N과 채널 C를 달리하여 파라미터와 Flops를 조절합니다.

Fig. 3 . Upper: Illustration of the classification backbone. Four stages downsample the original image. Lower: Block architecture with Ni blocks stacked in each stage.
원문 · CC BY 4.0 · Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, Jenq-Neng Hwang, Xiangyang Ji · CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.ImageNet-1K 분류 결과와 효율 비교
분류 실험은 ImageNet-1K에서 모델을 처음부터 학습하며, RegNetY-16GF를 교사 모델로 쓰는 증류를 적용합니다. 학습은 입력 224×224에서 300 에폭 수행하고, 384×384에서 30 에폭 미세조정했다고 원문은 보고합니다. 처리량은 V100 GPU, ONNX, iPhone X의 신경 엔진에서 측정했으며 GPU와 ONNX는 배치 크기 64 조건입니다.
원문은 CAS-ViT-T가 Swin-B보다 0.6% 높은 정확도를 보이며 파라미터는 24% 적다고 보고합니다. 또한 CAS-ViT-M은 MobileViTv2-2.0보다 1.8% 높고 파라미터가 적다고 기술합니다. 표 II의 슬래시 뒤 수치는 450 에폭 학습 결과입니다. 이 비교는 특정 학습 설정과 측정 조건에서의 결과이며, 다른 하드웨어나 데이터셋으로 일반화되지 않습니다.
![Figure 1: Parameters v.s. Top-1 accuracy on ImageNet-1K [1]. The circle size indicates Gflops and best viewed in color](/papers/118b8f22-a362-44e5-bbd5-9413aba9e936/figures/figure-9e093c1cc080bd425f5947d6f2aed378.png?thumb=512)
Fig. 1 . Parameters v.s. Top-1 accuracy on ImageNet-1K [1]. The circle size indicates Gflops and best viewed in color.
원문 · CC BY 4.0 · Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, Jenq-Neng Hwang, Xiangyang Ji · CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications · 원문 그림 인용 · 원본 PDF 2쪽에서 그림 영역을 추출했습니다.COCO 검출·분할과 ADE20K 의미 분할 결과
COCO 2017 실험에서는 ImageNet-1K pre-training 백본을 RetinaNet과 Mask RCNN에 결합하고, 1× 학습 전략으로 12 에폭 미세조정했습니다. 원문은 CAS-ViT-T가 MaskRCNN 기준 43.5/39.6 AP box/mask를 얻어 SwiftFormer-L3보다 0.8/0.5 높다고 보고합니다. 이 수치는 COCO val2017과 해당 학습 조건에서의 결과입니다.
![Figure 5: Visualization of object detection and instance segmentation results on COCO 2017. Upper: Prediction results of PoolFormer-S12 [7], Lower:
Prediction…](/papers/118b8f22-a362-44e5-bbd5-9413aba9e936/figures/figure-8ea6301c527c4f2874a75bd9e963ae06.png?thumb=512)
Fig. 5 . Visualization of object detection and instance segmentation results on COCO 2017. Upper: Prediction results of PoolFormer-S12 [7], Lower: Prediction results of CAS-ViT-M. Our method is able to detect and segment instances accurately.
원문 · CC BY 4.0 · Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, Jenq-Neng Hwang, Xiangyang Ji · CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.ADE20K 의미 분할 실험은 Semantic FPN에 백본을 넣고 정규화 층을 고정한 상태에서 40K 반복, 배치 크기 32로 수행했습니다. 본문은 M과 T 모델의 mIoU를 각각 45.0%와 43.6%로 기술하지만, 표 VI는 CAS-ViT-M 43.6과 CAS-ViT-T 45.0으로 보고하여 두 서술이 서로 다릅니다. 이 불일치는 독자가 표와 본문을 함께 확인해야 하는 지점입니다.
절제 실험으로 본 다중 상호작용의 역할
절제 실험은 CATM의 토큰 믹서 선택과 유사도 함수의 상호작용 구성을 비교합니다. 먼저 CATM을 Pooling 및 Window-MSA와 바꾸어 실험했으며, Pooling은 Flops를 줄이지만 성능 손실이 크다고 보고됩니다. Window-MSA와 비교하면 CATM은 더 낮은 Flops에서 더 높은 정확도를 보입니다.
![Figure 6: Ablation study on token mixer effectiveness. Experiments are
conducted on ImageNet-1K [1]. Red arrows indicate worse indicators and
green indicates b…](/papers/118b8f22-a362-44e5-bbd5-9413aba9e936/figures/figure-b64ef214d85612e51f51136c8acbb9f5.png?thumb=512)
Fig. 6 . Ablation study on token mixer effectiveness. Experiments are conducted on ImageNet-1K [1]. Red arrows indicate worse indicators and green indicates better. Best viewed in color.
원문 · CC BY 4.0 · Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, Jenq-Neng Hwang, Xiangyang Ji · CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.표 VII에서 Φ(·)의 공간 상호작용을 제거하면 Top-1이 80.43에서 79.98로, 채널 상호작용을 제거하면 80.22로 떨어집니다. 원문은 이를 공간과 채널 감소가 각각 0.45%와 0.21%에 해당한다고 기술합니다. 반면 상호작용 순서를 바꾼 변형들은 기본 구성과 비슷한 결과를 보여, 저자들은 두 도메인 상호작용의 존재가 중요하며 순서는 크게 중요하지 않다고 해석합니다.
한계와 적용 범위
원문은 CAS-ViT가 특징 처리를 위해 컨볼루션 층을 많이 사용하므로 귀납적 편향을 유지한다고 설명합니다. 이 편향은 바닐라 Transformer보다 빨리 수렴하는 장점을 주지만, 대규모 데이터셋과 큰 파라미터 모델에서는 다소 덜 효과적일 수 있다고 원문은 밝힙니다. 저자들은 더 큰 데이터셋과 모델 규모에서의 탐색을 향후 과제로 제시합니다.
따라서 이 결과의 적용 범위는 주로 경량 모델과 제시된 데이터셋, 측정 조건입니다. 대규모 모델에서의 성능 우위는 이 논문의 실험으로 확인된 범위 밖입니다.
논문 정보
- 저자
- Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, Jenq-Neng Hwang, Xiangyang Ji
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2024년 8월 7일
- 등록일
- 2026년 11월 6일
- 수정일
- 2024년 12월 13일
- 버전
- v2
- arXiv
- 2408.03703
- 분류
- cs.CV
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
Vision Transformers (ViTs) mark a revolutionary advance in neural networks with their token mixer's powerful global context capability. However, the pairwise token affinity and complex matrix operations limit its deployment on resource-constrained scenarios and real-time applications, such as mobile devices, although considerable efforts have been made in previous works. In this paper, we introduce CAS-ViT: Convolutional Additive Self-attention Vision Transformers, to achieve a balance between efficiency and performance in mobile applications. Firstly, we argue that the capability of token mixers to obtain global contextual information hinges on multiple information interactions, such as spatial and channel domains. Subsequently, we propose Convolutional Additive Token Mixer (CATM) employing underlying spatial and channel attention as novel interaction forms. This module eliminates troublesome complex operations such as matrix multiplication and Softmax. We introduce Convolutional Additive Self-attention(CAS) block hybrid architecture and utilize CATM for each block. And further, we build a family of lightweight networks, which can be easily extended to various downstream tasks. Finally, we evaluate CAS-ViT across a variety of vision tasks, including image classification, object detection, instance segmentation, and semantic segmentation. Our M and T model achieves 83.0\%/84.1\% top-1 with only 12M/21M parameters on ImageNet-1K. Meanwhile, throughput evaluations on GPUs, ONNX, and iPhones also demonstrate superior results compared to other state-of-the-art backbones. Extensive experiments demonstrate that our approach achieves a better balance of performance, efficient inference and easy-to-deploy. Our code and model are available at: \url{https://github.com/Tianfang-Zhang/CAS-ViT}
원문 인용
Tianfang Zhang, Lei Li, Yang Zhou, Wentao Liu, Chen Qian, Jenq-Neng Hwang, Xiangyang Ji (2024). CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications. arXiv:2408.03703v2. https://arxiv.org/abs/2408.03703v2
BibTeX
@misc{zhang2024convolutional,
title = {{CAS-ViT: Convolutional Additive Self-attention Vision Transformers for Efficient Mobile Applications}},
author = {Tianfang Zhang and Lei Li and Yang Zhou and Wentao Liu and Chen Qian and Jenq-Neng Hwang and Xiangyang Ji},
year = {2024},
eprint = {2408.03703},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2408.03703v2}
}