MP-Former: Mask-Piloted Transformer for Image Segmentation
Hao Zhang, Feng Li, Huaizhe Xu, Shijia Huang, Shilong Liu, Lionel M. Ni, Lei Zhang
TL;DR
MP-Former introduces a mask-piloted training scheme to address inconsistent decoder-layer predictions in Mask2Former. By injecting ground-truth masks as attention masks and ground-truth class embeddings as decoder queries (the MP part), the method strengthens cross-layer consistency and yields more accurate gradients, improving instance, panoptic, and semantic segmentation while maintaining inference cost. Theoretical analysis supports increased matching stability and gradient fidelity, and empirical results show substantial gains (e.g., $+2.3$AP on Cityscapes instance and $+1.6$mIoU on semantic with a $ResNet-50$ backbone) along with faster convergence on ADE20K across backbones. Importantly, training speed improves with minimal overhead and no extra inference cost, and the authors provide code to reproduce the results.
Abstract
We present a mask-piloted Transformer which improves masked-attention in Mask2Former for image segmentation. The improvement is based on our observation that Mask2Former suffers from inconsistent mask predictions between consecutive decoder layers, which leads to inconsistent optimization goals and low utilization of decoder queries. To address this problem, we propose a mask-piloted training approach, which additionally feeds noised ground-truth masks in masked-attention and trains the model to reconstruct the original ones. Compared with the predicted masks used in mask-attention, the ground-truth masks serve as a pilot and effectively alleviate the negative impact of inaccurate mask predictions in Mask2Former. Based on this technique, our \M achieves a remarkable performance improvement on all three image segmentation tasks (instance, panoptic, and semantic), yielding $+2.3$AP and $+1.6$mIoU on the Cityscapes instance and semantic segmentation tasks with a ResNet-50 backbone. Our method also significantly speeds up the training, outperforming Mask2Former with half of the number of training epochs on ADE20K with both a ResNet-50 and a Swin-L backbones. Moreover, our method only introduces little computation during training and no extra computation during inference. Our code will be released at \url{https://github.com/IDEA-Research/MP-Former}.
