Memory Efficient Matting with Adaptive Token Routing

Authors

  • Yiheng Lin Institute of Information Science, Beijing Jiaotong University Visual Intelligence + X International Joint Laboratory of the Ministry of Education
  • Yihan Hu Institute of Information Science, Beijing Jiaotong University Visual Intelligence + X International Joint Laboratory of the Ministry of Education MT Lab, Meitu Inc.
  • Chenyi Zhang Institute of Information Science, Beijing Jiaotong University Visual Intelligence + X International Joint Laboratory of the Ministry of Education MT Lab, Meitu Inc.
  • Ting Liu MT Lab, Meitu Inc.
  • Xiaochao Qu MT Lab, Meitu Inc.
  • Luoqi Liu MT Lab, Meitu Inc.
  • Yao Zhao Institute of Information Science, Beijing Jiaotong University Visual Intelligence + X International Joint Laboratory of the Ministry of Education Pengcheng Laboratory, Shenzhen, China
  • Yunchao Wei Institute of Information Science, Beijing Jiaotong University Visual Intelligence + X International Joint Laboratory of the Ministry of Education Pengcheng Laboratory, Shenzhen, China

DOI:

https://doi.org/10.1609/aaai.v39i5.32563

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.

Published

2025-04-11

How to Cite

Lin, Y., Hu, Y., Zhang, C., Liu, T., Qu, X., Liu, L., … Wei, Y. (2025). Memory Efficient Matting with Adaptive Token Routing. Proceedings of the AAAI Conference on Artificial Intelligence, 39(5), 5298–5306. https://doi.org/10.1609/aaai.v39i5.32563

Issue

Section

AAAI Technical Track on Computer Vision IV