Back to Mmdetection

Mask2Former

configs/mask2former/README.md

3.3.012.0 KB
Original Source

Mask2Former

Masked-attention Mask Transformer for Universal Image Segmentation

<!-- [ALGORITHM] -->

Abstract

Image segmentation is about grouping pixels with different semantics, e.g., category or instance membership, where each choice of semantics defines a task. While only the semantics of each task differ, current research focuses on designing specialized architectures for each task. We present Masked-attention Mask Transformer (Mask2Former), a new architecture capable of addressing any image segmentation task (panoptic, instance or semantic). Its key components include masked attention, which extracts localized features by constraining cross-attention within predicted mask regions. In addition to reducing the research effort by at least three times, it outperforms the best specialized architectures by a significant margin on four popular datasets. Most notably, Mask2Former sets a new state-of-the-art for panoptic segmentation (57.8 PQ on COCO), instance segmentation (50.1 AP on COCO) and semantic segmentation (57.7 mIoU on ADE20K).

<div align=center> </div>

Introduction

Mask2Former requires COCO and COCO-panoptic dataset for training and evaluation. You need to download and extract it in the COCO dataset path. The directory should be like this.

none
mmdetection
├── mmdet
├── tools
├── configs
├── data
│   ├── coco
│   │   ├── annotations
|   |   |   ├── instances_train2017.json
|   |   |   ├── instances_val2017.json
│   │   │   ├── panoptic_train2017.json
│   │   │   ├── panoptic_train2017
│   │   │   ├── panoptic_val2017.json
│   │   │   ├── panoptic_val2017
│   │   ├── train2017
│   │   ├── val2017
│   │   ├── test2017

Results and Models

Panoptic segmentation

BackbonestylePretrainLr schdMem (GB)Inf time (fps)PQbox mAPmask mAPConfigDownload
R-50pytorchImageNet-1K50e13.9-52.044.541.8configmodel | log
R-101pytorchImageNet-1K50e16.1-52.445.342.4configmodel | log
Swin-T-ImageNet-1K50e15.9-53.446.343.4configmodel | log
Swin-S-ImageNet-1K50e19.1-54.547.844.5configmodel | log
Swin-B-ImageNet-1K50e26.0-55.148.244.9configmodel | log
Swin-B-ImageNet-21K50e25.8-56.350.046.3configmodel | log
Swin-L-ImageNet-21K100e21.1-57.652.248.5configmodel | log

Instance segmentation

BackbonestylePretrainLr schdMem (GB)Inf time (fps)box mAPmask mAPConfigDownload
R-50pytorchImageNet-1K50e13.7-45.742.9configmodel | log
R-101pytorchImageNet-1K50e15.5-46.744.0configmodel | log
Swin-T-ImageNet-1K50e15.3-47.744.7configmodel | log
Swin-S-ImageNet-1K50e18.8-49.346.1configmodel | log

Note

  1. The performance is unstable. The Mask2Former-R50-coco-panoptic may fluctuate about 0.2 PQ. The models other than Mask2Former-R50-coco-panoptic were trained with mmdet 2.x and have been converted for mmdet 3.x.
  2. We have trained the instance segmentation models many times (see more details in PR 7571). The results of the trained models are relatively stable (+- 0.2), and have a certain gap (about 0.2 AP) in comparison with the results in the paper. However, the performance of the model trained with the official code is unstable and may also be slightly lower than the reported results as mentioned in the issue.

Citation

latex
@article{cheng2021mask2former,
  title={Masked-attention Mask Transformer for Universal Image Segmentation},
  author={Bowen Cheng and Ishan Misra and Alexander G. Schwing and Alexander Kirillov and Rohit Girdhar},
  journal={arXiv},
  year={2021}
}