Skip to main content
QUICK REVIEW

[논문 리뷰] EfficientFormer: Vision Transformers at MobileNet Speed

Yanyu Li, Geng Yuan|arXiv (Cornell University)|2022. 06. 02.
Advanced Neural Network Applications인용 수 251
한 줄 요약

EfficientFormer는 지연 시간 주도형, 차원 일관 설계와 슬림핑을 통해 모바일 기기에서 MobileNet과 유사한 속도로 실행되면서 ImageNet에서 높은 정확도를 달성하는 순수 비전 트랜스포머를 제시한다.

ABSTRACT

Vision Transformers (ViT) have shown rapid progress in computer vision tasks, achieving promising results on various benchmarks. However, due to the massive number of parameters and model design, extit{e.g.}, attention mechanism, ViT-based models are generally times slower than lightweight convolutional networks. Therefore, the deployment of ViT for real-time applications is particularly challenging, especially on resource-constrained hardware such as mobile devices. Recent efforts try to reduce the computation complexity of ViT through network architecture search or hybrid design with MobileNet block, yet the inference speed is still unsatisfactory. This leads to an important question: can transformers run as fast as MobileNet while obtaining high performance? To answer this, we first revisit the network architecture and operators used in ViT-based models and identify inefficient designs. Then we introduce a dimension-consistent pure transformer (without MobileNet blocks) as a design paradigm. Finally, we perform latency-driven slimming to get a series of final models dubbed EfficientFormer. Extensive experiments show the superiority of EfficientFormer in performance and speed on mobile devices. Our fastest model, EfficientFormer-L1, achieves $79.2\%$ top-1 accuracy on ImageNet-1K with only $1.6$ ms inference latency on iPhone 12 (compiled with CoreML), which runs as fast as MobileNetV2$ imes 1.4$ ($1.6$ ms, $74.7\%$ top-1), and our largest model, EfficientFormer-L7, obtains $83.3\%$ accuracy with only $7.0$ ms latency. Our work proves that properly designed transformers can reach extremely low latency on mobile devices while maintaining high performance.

연구 동기 및 목표

  • 모바일 하드웨어에서 ViT 설계의 병목 현상과 비효율성을 식별한다.
  • 에지 기기에서 속도와 성능을 보존하는 차원 일관 트랜스포머 설계를 제안한다.
  • 지연 시간 주도 슬림링 전략을 개발하여 EfficientFormer 계열 모델을 도출한다.
  • 감지 및 분할 작업의 백본으로 EfficientFormer를 시연한다.
  • 모바일(iPhone) 및 데스크탑 하드웨어에 대한 재현 가능한 평가를 제공한다.

제안 방법

  • iPhone 12에서 CoreML을 활용한 ViT 구성요소의 현장 지연 분석을 수행하여 병목 현상을 식별한다.
  • 4D Conv-BN 기반 블록(MB4D)과 3D MHSA 기반 블록(MB3D)을 갖춘 차원 일관 설계를 도입한다.
  • 빠른 다운샘플링이 가능한 패치 임베딩 스템을 정의하고 큰 커널 패치 임베딩을 속도 병목으로 피한다.
  • 4D 및 3D 구성으로 구성된 메타블록을 허용하는 슈퍼넷을 구성하고 지연 시간 조회 테이블에 의해 안내되는 그래디언트 기반의 지연 시간 인식 슬림핑 절차를 사용하여 EfficientFormer 변종을 얻는다.
  • 슈퍼넷을 학습시키고 Gumbel-Softmax 샘플링으로 블록 중요도를 추정한 후 지연 시간 기반 가지치기/폭 조정을 수행하여 목표 지연 시간을 달성한다.
  • ImageNet-1K, COCO, ADE20K에서 EfficientFormer를 평가하여 분류, 물체 탐지 및 분할 성능을 보여준다.

실험 결과

연구 질문

  • RQ1비전 트랜스포머를 모바일 속도 지연 시간으로 MobileNet에 비견될 정도로 실행하면서 높은 정확도를 유지할 수 있는가?
  • RQ2ViT 아키텍처의 어떤 설계 선택이 기기 편에서의 지연 시간에 가장 큰 영향을 미치며 에지 하드웨어에서 속도를 극대화하기 위해 트랜스포머를 어떻게 재구성할 수 있는가?
  • RQ3차원 일관 트랜스포머 설계를 사용하는 지연 시간 주도 슬림핑 파이프라인이 실제적이고 고성능의 모바일 모델을 산출하는가?
  • RQ4EfficientFormer 백본이 CNN 및 하이브리드 ViT 설계에 비해 탐지 및 분할 벤치마크에서 어떤 성능을 보이는가?

주요 결과

  • EfficientFormer-L1은 iPhone 12(CoreML)에서 1.6 ms 지연으로 ImageNet-1K에서 79.2%의 top-1 정확도를 달성하며 MobileNetV2×1.4 속도에 비견된다.
  • EfficientFormer-L7은 iPhone 12에서 7.0 ms 지연으로 83.3%의 top-1 정확도를 달성한다.
  • Nvidia A100에서 EfficientFormer-L1은 2.1% 더 높은 top-1 정확도에 대해 EfficientNet-B0보다 38% 더 빠르며; L7은 EfficientNet-B5에 비해 4.6배 빠르다.
  • EfficientFormer는 PoolFormer 및 기타 ViT 기반 모델보다 지연 시간과 정확도에서 우수한 성능을 보이며 순수 트랜스포머 아키텍처의 에지 성능이 강함을 시연한다.
  • COCO(탐지/인스턴스 분할) 및 ADE20K(분할)에서 백본 실험은 비슷한 계산 예산 하에서 EfficientFormer-L3/L7가 ResNet 및 PoolFormer 기반선보다 우수한 성능을 보인다.
  • 차원 일관 MB4D/MB3D 설계와 지연 시간 주도 슬림핑은 모바일 하드웨어에서 초고속 트랜스포머 추론을 가능하게 한다.

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.