arXiv(opens in a new tab)Computer ScienceDec 2021Cited by 7 papers on PaperVantage

Manuscript Offprint

arXiv:2112.01527

Masked-attention Mask Transformer for Universal Image Segmentation

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

Abstract

Image segmentation groups pixels with different semantics, e.g., category or instance membership. 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).

1 Introduction

Image segmentation studies the problem of grouping pixels. Different semantics for grouping pixels, e.g., category or instance membership, have led to different types of segmentation tasks, such as panoptic, instance or semantic segmentation. While these tasks differ only in semantics, current methods develop specialized architectures for each task. Per-pixel classification architectures based on Fully Convolutional Networks (FCNs) [37] are used for semantic segmentation, while mask classification architectures [24, 5] that predict a set of binary masks each associated with a single category, dominate instance-level segmentation. Although such specialized architectures [37, 10, 24, 6] have advanced each individual task, they lack the flexibility to generalize to the other tasks. For example, FCN-based architectures struggle at instance segmentation, leading to the evolution of different architectures for instance segmentation compared to semantic segmentation. Thus, duplicate research and (hardware) optimization effort is spent on each specialized architecture for every task.

Figure

Figure 1: State-of-the-art segmentation architectures are typically specialized for each image segmentation task. Although recent work has proposed universal architectures that attempt all tasks and are competitive on semantic and panoptic segmentation, they struggle with segmenting instances. We propose Mask2Former, which, for the first time, outperforms the best specialized architectures on three studied segmentation tasks on multiple datasets.

To address this fragmentation, recent work [14, 62] has attempted to design universal architectures, that are capable of addressing all segmentation tasks with the same architecture (i.e., universal image segmentation). These architectures are typically based on an end-to-end set prediction objective (e.g., DETR [5]), and successfully tackle multiple tasks without modifying the architecture, loss, or the training procedure. Note, universal architectures are still trained separately for different tasks and datasets, albeit having the same architecture. In addition to being flexible, universal architectures have recently shown state-of-the-art results on semantic and panoptic segmentation [14]. However, recent work still focuses on advancing specialized architectures [39, 45, 20], which raises the question: why haven’t universal architectures replaced specialized ones?

Although existing universal architectures are flexible enough to tackle any segmentation task, as shown in Figure 1, in practice their performance lags behind the best specialized architectures. For instance, the best reported performance of universal architectures [14, 62], is currently lower (>9>9 AP) than the SOTA specialized architecture for instance segmentation [6]. Beyond the inferior performance, universal architectures are also harder to train. They typically require more advanced hardware and a much longer training schedule. For example, training MaskFormer [14] takes 300 epochs to reach 40.1 AP and it can only fit a single image in a GPU with 32G memory. In contrast, the specialized Swin-HTC++ [6] obtains better performance in only 72 epochs. Both the performance and training efficiency issues hamper the deployment of universal architectures.

In this work, we propose a universal image segmentation architecture named Masked-attention Mask Transformer (Mask2Former) that outperforms specialized architectures across different segmentation tasks, while still being easy to train on every task. We build upon a simple meta architecture [14] consisting of a backbone feature extractor [25, 36], a pixel decoder [33] and a Transformer decoder [51]. We propose key improvements that enable better results and efficient training. First, we use masked attention in the Transformer decoder which restricts the attention to localized features centered around predicted segments, which can be either objects or regions depending on the specific semantic for grouping. Compared to the cross-attention used in a standard Transformer decoder which attends to all locations in an image, our masked attention leads to faster convergence and improved performance. Second, we use multi-scale high-resolution features which help the model to segment small objects/regions. Third, we propose optimization improvements such as switching the order of self and cross-attention, making query features learnable, and removing dropout; all of which improve performance without additional compute. Finally, we save 3×3\times training memory without affecting the performance by calculating mask loss on few randomly sampled points. These improvements not only boost the model performance, but also make training significantly easier, making universal architectures more accessible to users with limited compute.

We evaluate Mask2Former on three image segmentation tasks (panoptic, instance and semantic segmentation) using four popular datasets (COCO [35], Cityscapes [16], ADE20K [65] and Mapillary Vistas [42]). For the first time, on all these benchmarks, our single architecture performs on par or better than specialized architectures. Mask2Former sets the new state-of-the-art of 57.8 PQ on COCO panoptic segmentation [28], 50.1 AP on COCO instance segmentation [35] and 57.7 mIoU on ADE20K semantic segmentation [65] using the exact same architecture.

References (62)

  • Multiscale combinatorial grouping
  • BEiT: BERT pre-training of image transformers
  • YOLACT++: Better real-time instance segmentation, 2019
  • Cascade R-CNN: Delving into high quality object detection
  • End-to-end object detection with transformers
  • DeepLab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected CRFs
  • Rethinking atrous convolution for semantic image segmentation (opens arXiv in a new tab)
  • Scaling wide residual networks for panoptic segmentation (opens arXiv in a new tab)
  • Encoder-decoder with atrous separable convolution for semantic image segmentation
  • Panoptic-DeepLab: A simple, strong, and fast baseline for bottom-up panoptic segmentation
  • Boundary iou: Improving object-centric image segmentation evaluation
  • Pointly-supervised instance segmentation
  • Per-pixel classification is not all you need for semantic segmentation
  • The Cityscapes dataset for semantic urban scene understanding
  • Transformers for image recognition at scale
  • Simple training strategies and model scaling for object detection (opens arXiv in a new tab)
  • The PASCAL visual object classes challenge: A retrospective
  • Instances as queries
  • Dual attention network for scene segmentation
  • Fast convergence of detr with spatially modulated co-attention
  • Simple copy-paste is a strong data augmentation method for instance segmentation
  • Mask R-CNN
  • Deep residual learning for image recognition
  • CCNet: Criss-cross attention for semantic segmentation
  • Panoptic feature pyramid networks
  • Panoptic segmentation
  • InstanceCut: from edges to instances with multicut
  • PointRend: Image segmentation as rendering
  • Fully convolutional networks for panoptic segmentation with point-based supervision (opens arXiv in a new tab)
  • Panoptic segformer (opens arXiv in a new tab)
  • Feature pyramid networks for object detection
  • Focal loss for dense object detection
  • Microsoft COCO: Common objects in context
  • Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Fully convolutional networks for semantic segmentation
  • Decoupled weight decay regularization
  • Fapn: Feature-aligned pyramid network for dense image prediction
  • Conditional detr for fast training convergence
  • V-Net: Fully convolutional neural networks for volumetric medical image segmentation
  • The mapillary vistas dataset for semantic understanding of street scenes
  • Faster R-CNN: Towards real-time object detection with region proposal networks
  • ImageNet Large Scale Visual Recognition Challenge
  • Segmenter: Transformer for semantic segmentation
  • Rethinking transformer-based set prediction for object detection
  • Efficientdet: Scalable and efficient object detection
  • Hierarchical multi-scale attention for semantic segmentation (opens arXiv in a new tab)
  • Conditional convolutions for instance segmentation
  • Selective search for object recognition
  • Attention is all you need
  • MaX-DeepLab: End-to-end panoptic segmentation with mask transformers
  • Deep high-resolution representation learning for visual recognition
  • PVT v2: Improved baselines with Pyramid Vision Transformer
  • Non-local neural networks
  • SOLOv2: Dynamic and fast instance segmentation
  • Detectron2
  • Unified perceptual parsing for scene understanding
  • Segformer: Simple and efficient design for semantic segmentation with transformers
  • Upsnet: A unified panoptic segmentation network
  • OCNet: Object context for semantic segmentation
  • K-net: Towards unified image segmentation
  • Pyramid scene parsing network
  • Scene parsing through ADE20K dataset