Home

Awesome

BMaskR-CNN

This code is developed on Detectron2

Boundary-preserving Mask R-CNN
ECCV 2020
Tianheng Cheng, Xinggang Wang, Lichao Huang, Wenyu Liu

<div align="center"> <img src="./projects/BMaskR-CNN/figures/demo.gif" width="100%" /> </div>

Video from Cam看世界 on Youtube.

Abstract

Tremendous efforts have been made to improve mask localization accuracy in instance segmentation. Modern instance segmentation methods relying on fully convolutional networks perform pixel-wise classification, which ignores object boundaries and shapes, leading coarse and indistinct mask prediction results and imprecise localization. To remedy these problems, we propose a conceptually simple yet effective Boundary-preserving Mask R-CNN (BMask R-CNN) to leverage object boundary information to improve mask localization accuracy. BMask R-CNN contains a boundary-preserving mask head in which object boundary and mask are mutually learned via feature fusion blocks. As a result,the mask prediction results are better aligned with object boundaries. Without bells and whistles, BMask R-CNN outperforms Mask R-CNN by a considerable margin on the COCO dataset; in the Cityscapes dataset,there are more accurate boundary groundtruths available, so that BMaskR-CNN obtains remarkable improvements over Mask R-CNN. Besides, it is not surprising to observe that BMask R-CNN obtains more obvious improvement when the evaluation criterion requires better localization (e.g., AP<sub>75</sub>)

<div align="center"> <img src="./projects/BMaskR-CNN/figures/arch.jpg" width="85%" /> </div>

Models

COCO

MethodBackbonelr schedAPAP<sub>50</sub>AP<sub>75</sub>AP<sub>s</sub>AP<sub>m</sub>AP<sub>l</sub>download
Mask R-CNNR50-FPN1x35.256.337.517.237.750.3-
PointRendR50-FPN1x36.256.638.617.138.852.5-
BMask R-CNNR50-FPN1x36.656.739.417.338.853.8model
BMask R-CNNR101-FPN1x38.058.640.917.640.656.8model
Cascade Mask R-CNNR50-FPN1x36.456.939.217.538.752.5-
Cascade BMask R-CNNR50-FPN1x37.557.340.717.539.855.1model
Cascade BMask R-CNNR101-FPN1x39.159.242.418.642.257.4model

Cityscapes

MethodBackbonelr schedAPdownload
PointRendR50-FPN1x35.9-
BMask R-CNNR50-FPN1x36.2model

Results

Left: AP curves of Mask R-CNN and BMask R-CNN under different mask IoU thresholds on the COCO val2017 set, the improvement becomes more significant when IoU increases. Right: Visualizations of Mask R-CNN and BMask R-CNN. BMask R-CNN can output more precise boundaries and accurate masks than Mask R-CNN.

Usage

Install Detectron2 following the official instructions

Training

specify a config file and train a model with 4 GPUs

cd projects/BMaskR-CNN
python train_net.py --config-file configs/bmask_rcnn_R_50_FPN_1x.yaml --num-gpus 4

Evaluation

specify a config file and test with trained model

cd projects/BMaskR-CNN
python train_net.py --config-file configs/bmask_rcnn_R_50_FPN_1x.yaml --num-gpus 4 --eval-only MODEL.WEIGHTS /path/to/model

Citation

@article{ChengWHL20,
  title={Boundary-preserving Mask R-CNN},
  author={Tianheng Cheng and Xinggang Wang and Lichao Huang and Wenyu Liu},
  booktitle={ECCV},
  year={2020}
}