Skip to main content
QUICK REVIEW

[논문 리뷰] Focal Modulation Networks

Jianwei Yang, Chunyuan Li|arXiv (Cornell University)|2022. 03. 22.
Advanced Neural Network Applications인용 수 148
한 줄 요약

Focal Modulation Networks는 self-attention을 focal modulation 모듈로 대체하여 깊이별 컨볼루션을 통해 다중 스케일 컨텍스트를 집계하고, 토큰별 쿼리를 모듈레이션하여 분류, 탐지, 분할에서 최첨단 결과를 달성하고 경쟁력 있는 효율성을 제공합니다.

ABSTRACT

We propose focal modulation networks (FocalNets in short), where self-attention (SA) is completely replaced by a focal modulation mechanism for modeling token interactions in vision. Focal modulation comprises three components: (i) hierarchical contextualization, implemented using a stack of depth-wise convolutional layers, to encode visual contexts from short to long ranges, (ii) gated aggregation to selectively gather contexts for each query token based on its content, and (iii) element-wise modulation or affine transformation to inject the aggregated context into the query. Extensive experiments show FocalNets outperform the state-of-the-art SA counterparts (e.g., Swin and Focal Transformers) with similar computational costs on the tasks of image classification, object detection, and segmentation. Specifically, FocalNets with tiny and base size achieve 82.3% and 83.9% top-1 accuracy on ImageNet-1K. After pretrained on ImageNet-22K in 224 resolution, it attains 86.5% and 87.3% top-1 accuracy when finetuned with resolution 224 and 384, respectively. When transferred to downstream tasks, FocalNets exhibit clear superiority. For object detection with Mask R-CNN, FocalNet base trained with 1 imes outperforms the Swin counterpart by 2.1 points and already surpasses Swin trained with 3 imes schedule (49.0 v.s. 48.5). For semantic segmentation with UPerNet, FocalNet base at single-scale outperforms Swin by 2.4, and beats Swin at multi-scale (50.5 v.s. 49.7). Using large FocalNet and Mask2former, we achieve 58.5 mIoU for ADE20K semantic segmentation, and 57.9 PQ for COCO Panoptic Segmentation. Using huge FocalNet and DINO, we achieved 64.3 and 64.4 mAP on COCO minival and test-dev, respectively, establishing new SoTA on top of much larger attention-based models like Swinv2-G and BEIT-3. Code and checkpoints are available at https://github.com/microsoft/FocalNet.

연구 동기 및 목표

  • 시각 과제에서 입력 의존적인 장거리 상호작용을 모델링하기 위한 주의력 없는(attention-free) 메커니즘을 개발한다.
  • 다중 수준 계층적 모듈레이션을 사용하여 짧은 범위 및 긴 범위의 시각 맥_Context를 포착한다.
  • 분류, 탐지 및 세분화 전반에서 최첨단 self-attention 기반 모델 대비 정확도와 효율성 향상을 입증한다.

제안 방법

  • self-attention을 먼저 깊이별 컨볼루션으로 다중 포컬 레벨에서 컨텍스트를 집계하는 focal modulation 모듈로 교체한다.
  • 집계된 컨텍스트에서 게이티드 집계 메커니즘을 통해 모듈레이터를 계산한 다음, 요소별 선형/비선형 인터랙션으로 쿼리에 주입한다.
  • 두 단계의 컨텍스트 집계를 사용한다: (i) 깊이별 컨볼루션 스택으로 계층적 맥락화, (ii) per-token 모듈레이터를 형성하기 위한 게이티드 집계.
  • y_i = q(x_i) ⊙ h(Z_out)로 정의하며, Z_out는 다중 수준의 맥락을 인코딩하고 게이팅 가중치는 각 수준의 기여를 선택한다.
  • 비선형성(GELU) 및 모듈레이션에 대한 입력 의존성과 변환 불변성을 보존하는 설계 선택을 포함한다.
  • 복잡도에 대해 논의하면 3C^2 + C(2L+3) + C∑(k^ℓ)^2에 의해 주로 결정되며, 효율적인 주의력 없는 토큰 상호작용을 제공한다.

실험 결과

연구 질문

  • RQ1주의력 없는 모듈레이션 메커니즘이 시각 모델에서 분류, 탐지 및 세분화 전반에 걸쳐 자기 주의(self-attention)와 동등하거나 이를 능가할 수 있는가?
  • RQ2다중 스케일 컨텍스트 집계에 이어 토큰별 모듈레이션이 정확도를 향상시키면서 계산 효율성을 유지하거나 개선하는가?
  • RQ3Focal Modulation은 밀집 예측 작업 및 대규모 사전학습 설정에서 Swin 및 Focal Transformers와 어떻게 비교되는가?
  • RQ4전통적인 어텐션 메커니즘과 비교했을 때 Focal modulation으로부터 얻어지는 질적 해석 가능성의 이점은 무엇인가?

주요 결과

  • FocalNets는 이미지 분류, 물체 탐지 및 세분화에서 최첨단 self-attention 기반 동료들보다 비용은 유사하게 유지하면서도 성능을 능가한다.
  • Tiny 및 base FocalNets는 ImageNet-1K에서 각각 82.3%와 83.9%의 top-1 정확도를 달성하며, ImageNet-22K에서 사전학습 시(224^2/384^2 파인튜닝) 추가 향상을 보인다(86.5%/87.3% top-1).
  • COCO 물체 탐지에서 1× 스케줄로 학습한 base FocalNet은 Swin보다 3× 스케줄에서 우수하고 탐지 변형에서 경쟁력 있는 결과를 보인다.
  • ADE20K 세분화에서 FocalNet base는 단일 스케일에서 50.5 mIoU를 달성하며 Swin 다중 스케일(49.7)을 능가하고, 대형 FocalNet은 ADE20K 및 COCO Panoptic에서 각각 58.5 mIoU와 57.9 PQ를 달성한다.
  • 더 큰 백본 및 학습 방식과 짝을 지었을 때, FocalNets는 Swinv2-G 및 BEIT-3와 같은 모델로 COCO minival/test-dev에서 mAP의 새로운 SOTA를 확립한다.
  • 시각화는 모듈레이터가 인식 범주를 유도하는 객체 영역에 집중함을 보여주며, FocalNets의 해석 가능성을 강조한다.

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

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

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

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