Mask is All You Need: Rethinking Mask R-CNN for Dense and Arbitrary-Shaped Scene Text Detection

Xugong Qin, Yu Zhou, Youhui Guo, Dayan Wu, Zhihong Tian, Ning Jiang, Hongbin Wang, Weiping Wang

Abstract

Standard object detection frameworks like Mask R-CNN often struggle with the unique challenges of Scene Text Detection (STD), particularly in dense environments with extreme aspect ratios. This paper introduces MAYOR, a refined Mask R-CNN architecture optimized for these "messy" real-world scenarios. By replacing the traditional convolutional mask head with a global MLP-based decoder and introducing an adaptive anchor assignment strategy, MAYOR effectively resolves "learning confusion" in crowded scenes. Experimental results across five benchmarks demonstrate that MAYOR achieves state-of-the-art performance while maintaining high efficiency.

Introduction: The Bottlenecks of Scene Text Detection

While Mask R-CNN is a robust baseline for general instance segmentation, it faces two primary hurdles in the context of scene text:

  1. Dense Text & Learning Confusion: In crowded scenes, such as product labels, a single region proposal often encompasses parts of multiple text instances. Standard convolutional mask heads, which rely on shared weights, struggle to differentiate between these overlapping instances, resulting in fragmented or merged masks.
  2. Extreme Aspect Ratios: Text lines are frequently elongated and thin. Traditional Region Proposal Networks (RPN) use manually tuned anchors with fixed aspect ratios, which often fail to capture text with ratios as high as 20:1, leading to a lack of positive training samples.
Comparison of Mask R-CNN (a) and MAYOR (b) on dense text. Mask R-CNN suffers from learning confusion, while MAYOR produces clean, separated masks.

Proposed Methodology: MAYOR

The authors propose three key innovations to transform Mask R-CNN into MAYOR:

MLP Mask Decoder

Unlike the standard "deconv-conv" architecture, MAYOR utilizes a multi-layer perceptron (MLP) decoder. Because MLPs do not share weights across spatial locations, they are less susceptible to "learning confusion." By leveraging global context from the entire Region of Interest (RoI), the MLP decoder makes more robust per-pixel mask decisions in dense environments.

Instance-Aware Mask Learning (IAML)

Standard training requires the mask head to classify pixels based on the proposal box. IAML shifts this paradigm: the mask head learns the global shape of the entire instance relative to a normalized grid. This decoupling makes mask learning independent of specific proposal box shifts, leading to more compact and well-separated detections.

Adaptive Label Assignment (ALA)

To eliminate the need for manual anchor tuning, ALA employs a two-step process. A "pre-assignment" phase identifies potential candidates, followed by a selection of the top-$k$ anchors that minimize the model's own loss for each ground-truth object. This ensures that even extremely elongated text lines receive sufficient high-quality anchors for training.

Experimental Evaluation

MAYOR was evaluated on five diverse benchmarks, including DAST1500, MSRA-TD500, and ICDAR2015. These datasets cover dense, arbitrary-shaped, multi-oriented, and curved text.

Key Results

MAYOR achieved state-of-the-art (SOTA) performance across all tested datasets:

  • DAST1500: Achieved an F-measure of 86.6%, outperforming specialized methods like ReLaText.
  • Rotation Robustness: On RotDAST, MAYOR maintained high accuracy at 45-degree rotations, whereas standard Mask R-CNN performance dropped significantly (from ~93% to ~60%).
  • Efficiency: The MLP decoder adds only ~0.1 GFLOPS of overhead, allowing the model to reach speeds of up to 20.5 FPS.
MAYOR's detection results on a dense text sample from the DAST1500 dataset.

Discussion and Insights

The success of MAYOR highlights the limitations of weight sharing in dense text scenarios. While convolutions are efficient, they can become a liability when distinct instances require different labels within the same spatial region. Global modeling via MLPs serves as an effective antidote. Furthermore, using loss-based assignment (ALA) rather than rigid IoU thresholds proves far more effective for objects with extreme geometric properties.

Conclusion

MAYOR demonstrates that rethinking the core components of Mask R-CNN—specifically the mask head and anchor assignment—can yield significant gains in scene text detection. Future work includes integrating text recognition for a complete end-to-end spotting system and exploring self-supervised learning to further refine mask precision.

Summary updated

BibTeX
@inproceedings{qin2021mask,
  author = {Xugong Qin and Yu Zhou and Youhui Guo and Dayan Wu and Zhihong Tian and Ning Jiang and Hongbin Wang and Weiping Wang},
  title = {{Mask is All You Need: Rethinking Mask R-CNN for Dense and Arbitrary-Shaped Scene Text Detection}},
  booktitle = {ACM Multimedia},
  year = {2021},
  doi = {10.1145/3474085.3475178},
}
Figure