Lune

AAAI2025Top-tier venue

Memory Efficient Matting with Adaptive Token Routing

Yiheng Lin, Yihan Hu, Chenyi Zhang, Ting Liu, Xiaochao Qu, Luoqi Liu, Yao Zhao, Yunchao Wei

Abstract

Transformer-based models have recently achieved outstanding performance in image matting. However, their application to high-resolution images remains challenging due to the quadratic complexity of global self-attention. To address this issue, we propose MEMatte, a memory-efficient matting framework for processing high-resolution images. MEMatte incorporates a router before each global attention block, directing informative tokens to the global attention while routing other tokens to a Lightweight Token Refinement Module (LTRM). Specifically, the router employs a local-global strategy to predict the routing probability of each token, and the LTRM utilizes efficient modules to simulate global attention. Additionally, we introduce a Batch-constrained Adaptive Token Routing (BATR) mechanism, which allows each router to dynamically route tokens based on image content and the stages of attention block in the network. Furthermore, we construct an ultra high-resolution image matting dataset, UHR-395, comprising 35,500 training images and 1,000 test images, with an average resolution of 4872×6017. This dataset is created by compositing 395 different alpha mattes across 11 categories onto various backgrounds, all with high-quality manual annotation. Extensive experiments demonstrate that MEMatte outperforms existing methods on both high-resolution and real-world datasets, significantly reducing memory usage by approximately 88% and latency by 50% on the Composition-1K benchmark. Our code is available at https://github.com/linyiheng123/MEMatte .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Matting Anything 2: Towards Video Matting for Anything cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • How Do Vision Transformers Work? cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • How Do Vision Transformers Work? cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • DynamicViT: Efficient Vision Transformers with Dynamic Token Sparsification cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Matting Anything 2: Towards Video Matting for AnythingChenyi Zhang, Yiheng Lin, Yunchao Wei, Hongsong Wang et al.ICLR 2026

Builds on19

  1. Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  3. DynamicViT: Efficient Vision Transformers with Dynamic Token SparsificationYongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu et al.NeurIPS 2021 · 1,343 citations
  4. How Do Vision Transformers Work?Namuk Park, Songkuk KimICLR 2022 · 653 citations
  5. ControlVideo: Training-free Controllable Text-to-video GenerationYabo Zhang, Yuxiang Wei, Dongsheng Jiang, Xiaopeng Zhang et al.ICLR 2024 · 359 citations

Related papers

  1. αMatte4K & µMatting: Dataset and Model for Ultra-Micro Precision Alpha Video MattingXinyi Chen, Hang Dong, Baowei Jiang, Shenkun Xu et al.CVPR 2026
  2. MatteFormer: Transformer-Based Image Matting via Prior-TokensGyutae Park, Sungjoon Son, Jaeyoung Yoo, Seho Kim et al.CVPR 2022 · 82 citations
  3. Ultrahigh Resolution Image/Video Matting with Spatio-Temporal SparsityYanan Sun, Chi-Keung Tang, Yu-Wing TaiCVPR 2023
  4. Disentangled Image MattingShaofan Cai, Xiaoshuai Zhang, Haoqiang Fan, Haibin Huang et al.ICCV 2019 · 127 citations
  5. EFormer: Enhanced Transformer Towards Semantic-Contour Features of Foreground for Portraits MattingZitao Wang, Qiguang Miao, Yue Xi, Peipei ZhaoCVPR 2024
Dusk over the sea between two cliffs drawn in fine vertical lines