Papers › Masked-attention Mask Transformer for Universal Image Segmentation

Masked-attention Mask Transformer for Universal Image Segmentation

2 Dec 2021CVPR 2022 1arXiv:2112.01527archive 2025-07-28

Bowen Cheng, Ishan Misra, Alexander G. Schwing, Alexander Kirillov, Rohit Girdhar

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).

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2112.01527")

Code

Syntology Ran 2 of 8 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it.

By repository: community (archive-listed): 8 samples from 1 repository, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

facebookresearch/Mask2Former officialmentioned on GitHubpytorchMIT report
DdeGeus/Mask2Former-IBS mentioned on GitHubpytorchMIT report
huggingface/transformers mentioned on GitHubpytorch report
nihalsid/mask2former mentioned on GitHubpytorchMIT report
open-mmlab/mmdetection pytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

8 samples harvested; 2 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
1ran · fixture could not drive it
6unverified

Licence: 0 of the 8 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from DdeGeus/Mask2Former-IBS. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

window_partition DdeGeus/Mask2Former-IBS/mask2former/modeling/backbone/swin.py community (archive-listed) ran · fixture could not drive it fingerprinted MIT (permissive) · f9fd6241d935f07b · report
window_reverse DdeGeus/Mask2Former-IBS/mask2former/modeling/backbone/swin.py community (archive-listed) ran · our draft was wrong MIT (permissive) · fb32094c6dbece71 · report
batch_dice_loss DdeGeus/Mask2Former-IBS/mask2former/modeling/matcher.py community (archive-listed) unverified MIT (permissive) · bc2cb481a75c370d · report
batch_sigmoid_ce_loss DdeGeus/Mask2Former-IBS/mask2former/modeling/matcher.py community (archive-listed) unverified MIT (permissive) · 1edd24985036b0bf · report
calculate_uncertainty DdeGeus/Mask2Former-IBS/mask2former_video/modeling/criterion.py community (archive-listed) unverified MIT (permissive) · 2dcb8123d89bb1ff · report
dice_loss DdeGeus/Mask2Former-IBS/mask2former/modeling/criterion.py community (archive-listed) unverified MIT (permissive) · 89f75e54ff128be0 · report
focal_loss DdeGeus/Mask2Former-IBS/mask2former/modeling/criterion.py community (archive-listed) unverified MIT (permissive) · 2bb4c1887f16e1ba · report
sigmoid_ce_loss DdeGeus/Mask2Former-IBS/mask2former/modeling/criterion.py community (archive-listed) unverified MIT (permissive) · d0c61e8dba511aa3 · report

Tasks

2D Semantic SegmentationImage SegmentationInstance SegmentationPanoptic SegmentationSegmentationSemantic SegmentationUniversal Segmentation

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
2D Semantic Segmentation WildScenes Mask2Former (Swin-L) mIoU 47.85 #1 of 5 Archive leaderboard report
2D Semantic Segmentation WildScenes Mask2Former (ResNet-50) mIoU 43.71 #3 of 5 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L, single-scale) AP 34.9 #11 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L, single-scale) APL 54.7 #11 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L, single-scale) APM 40 #11 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L, single-scale) APS 16.3 #11 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L + FAPN) AP 33.4 #12 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L + FAPN) APL 54.6 #12 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L + FAPN) APM 37.6 #12 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (Swin-L + FAPN) APS 14.6 #12 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (ResNet50) AP 26.4 #13 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (ResNet50) APS 10.4 #13 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (ResNet-50) APL 43.1 #14 of 14 Archive leaderboard report
Instance Segmentation ADE20K val Mask2Former (ResNet-50) APM 28.9 #14 of 14 Archive leaderboard report
Instance Segmentation COCO minival Mask2Former (Swin-L) mask AP 50.1 #26 of 93 Archive leaderboard report
Instance Segmentation COCO test-dev Mask2Former (Swin-L, single scale) AP50 74.9 #21 of 112 Archive leaderboard report
Instance Segmentation COCO test-dev Mask2Former (Swin-L, single scale) AP75 54.9 #21 of 112 Archive leaderboard report
Instance Segmentation COCO test-dev Mask2Former (Swin-L, single scale) APL 71.2 #21 of 112 Archive leaderboard report
Instance Segmentation COCO test-dev Mask2Former (Swin-L, single scale) APM 53.8 #21 of 112 Archive leaderboard report
Instance Segmentation COCO test-dev Mask2Former (Swin-L, single scale) APS 29.1 #21 of 112 Archive leaderboard report
Instance Segmentation COCO test-dev Mask2Former (Swin-L, single scale) mask AP 50.5 #21 of 112 Archive leaderboard report
Instance Segmentation COCO val (panoptic labels) Mask2Former (Swin-L, single-scale) AP 49.1 #3 of 4 Archive leaderboard report
Instance Segmentation Cityscapes val Mask2Former (Swin-L, single-scale) mask AP 43.7 #9 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val Mask2Former (Swin-B) mask AP 42 #10 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val Mask2Former (Swin-S) mask AP 41.8 #11 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val Mask2Former (Swin-T) mask AP 39.7 #13 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val Mask2Former (ResNet-101) mask AP 38.5 #14 of 17 Archive leaderboard report
Instance Segmentation Cityscapes val Mask2Former (ResNet-50) mask AP 37.4 #15 of 17 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (Swin-L) AP 34.2 #18 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (Swin-L) PQ 48.1 #18 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (Swin-L) mIoU 54.5 #18 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (Swin-L + FAPN, 640x640) AP 33.2 #19 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (Swin-L + FAPN, 640x640) PQ 46.2 #19 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (Swin-L + FAPN, 640x640) mIoU 55.4 #19 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (ResNet-50, 640x640) PQ 39.7 #22 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Panoptic-DeepLab (SwideRNet) PQ 37.9 #23 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Panoptic-DeepLab (SwideRNet) mIoU 50 #23 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (ResNet-50, 640x640) AP 26.5 #25 of 25 Archive leaderboard report
Panoptic Segmentation ADE20K val Mask2Former (ResNet-50, 640x640) mIoU 46.1 #25 of 25 Archive leaderboard report
Panoptic Segmentation COCO minival Mask2Former (single-scale) AP 48.6 #18 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival Mask2Former (single-scale) PQ 57.8 #18 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival Mask2Former (single-scale) PQst 48.1 #18 of 31 Archive leaderboard report
Panoptic Segmentation COCO minival Mask2Former (single-scale) PQth 64.2 #18 of 31 Archive leaderboard report
Panoptic Segmentation COCO test-dev Mask2Former (Swin-L) PQ 58.3 #3 of 38 Archive leaderboard report
Panoptic Segmentation COCO test-dev Mask2Former (Swin-L) PQst 48.1 #3 of 38 Archive leaderboard report
Panoptic Segmentation COCO test-dev Mask2Former (Swin-L) PQth 65.1 #3 of 38 Archive leaderboard report
Panoptic Segmentation Cityscapes val Mask2Former (Swin-L) AP 43.6 #15 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val Mask2Former (Swin-L) PQ 66.6 #15 of 37 Archive leaderboard report
Panoptic Segmentation Cityscapes val Mask2Former (Swin-L) mIoU 82.9 #15 of 37 Archive leaderboard report
Semantic Segmentation ADE20K Mask2Former (SwinL-FaPN) Validation mIoU 57.7 #27 of 235 Archive leaderboard report
Semantic Segmentation ADE20K Mask2Former (SwinL) Validation mIoU 57.3 #33 of 235 Archive leaderboard report
Semantic Segmentation ADE20K Mask2Former (Swin-L-FaPN) Validation mIoU 56.4 #40 of 235 Archive leaderboard report
Semantic Segmentation ADE20K Mask2Former(Swin-B) Validation mIoU 55.1 #50 of 235 Archive leaderboard report
Semantic Segmentation ADE20K val Mask2Former (Swin-L-FaPN, multiscale) mIoU 57.7 #18 of 95 Archive leaderboard report
Semantic Segmentation ADE20K val Mask2Former (Swin-L-FaPN) mIoU 56.4 #25 of 95 Archive leaderboard report
Semantic Segmentation COCO (Common Objects in Context) Mask2Former (Swin-L, single-scale) mIoU 67.4 #7 of 9 Archive leaderboard report
Semantic Segmentation COCO (Common Objects in Context) MaskFormer (Swin-L, single-scale) mIoU 64.8 #8 of 9 Archive leaderboard report
Semantic Segmentation Cityscapes val Mask2Former (Swin-L) mIoU 84.3 #19 of 99 Archive leaderboard report
Semantic Segmentation Fine-Grained Grass Segmentation Dataset Mask2Former mIoU 44.93 #10 of 10 Archive leaderboard report
Semantic Segmentation Mapillary val Mask2Former (Swin-L, multiscale) mIoU 64.7 #3 of 8 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections