PatchDCT: Patch Refinement for High Quality Instance Segmentation

Qinrou Wen, Jirui Yang, Xue Yang, Kewei Liang

TL;DR

PatchDCT introduces a novel patch-based refinement framework for instance segmentation that operates on compressed frequency-domain vectors. By breaking a mask into independent patches and applying a specialized classifier and regressor to each, it achieves high-quality boundaries and significant precision gains (up to 7.0% Boundary AP improvement) with minimal computational overhead.

The Challenge: Resolution vs. Efficiency

In the world of instance segmentation, there is a constant tug-of-war between resolution and computational efficiency. Standard models like Mask R-CNN typically predict masks on a coarse $28 \times 28$ grid. While efficient, this low-resolution approach loses the fine details needed for high-quality boundaries.

To solve this, previous work (DCT-Mask) used the Discrete Cosine Transform (DCT) to compress a high-resolution $128 \times 128$ mask into a compact 300-dimensional vector. However, refining these vectors is notoriously difficult. Because DCT components are global, changing even a single element in the vector can cause "ripples" that alter the entire mask.

Global DCT refinement causes ripples across the entire mask

This "butterfly effect" in the frequency domain can ruin correctly predicted areas while trying to fix a local boundary error, making multi-stage refinement for compressed vectors nearly impossible.

The PatchDCT Solution

To overcome this limitation, the authors propose PatchDCT, which shifts the refinement strategy from global to local. Instead of trying to fix the entire 300-dimensional vector at once, they divide the decoded mask into several independent patches (e.g., $8 \times 8$).

PatchDCT isolates refinement to specific local patches

The pipeline works as follows:

  1. Initial Prediction: A base model generates a 300-dimensional DCT vector, which is decoded into a $112 \times 112$ mask.
  2. Patching: This mask is divided into smaller, independent patches.
  3. Three-Class Classifier: Each patch is fed into a classifier that labels it as Foreground, Background, or Mixed (containing a boundary). This step is crucial because it allows the model to "flip" entire patches that were misclassified in the first pass.
  4. Low-Dimensional Regressor: Only the "Mixed" patches are sent to a regressor. This regressor predicts a very short (typically 6-dimensional) DCT vector to refine the specific boundary details within that patch.
  5. Assembly: The refined patches are merged back together. Because each patch is independent, refining a boundary in one corner of the object doesn't affect the pixels in another.

This approach is "multi-stage," meaning the output of one PatchDCT module can be fed into another for even finer results.

Key Insights

  • Localizing the Frequency Domain: The core insight is realizing that while DCT is great for compression, its global nature is a liability for refinement. By applying DCT to small patches rather than the whole object, the authors localized the influence of the frequency components.
  • Classification vs. Regression: The authors found that Foreground and Background patches are "discrete" in the frequency domain (mostly zeros), making them perfect for classification. Mixed patches are "continuous" and complex, making them better suited for regression.
  • Efficiency through Sparsity: By only performing regression on "Mixed" patches (the boundaries), the model avoids wasting computation on the easy-to-predict interior or exterior of an object. This allows PatchDCT to run at speeds comparable to single-shot methods while achieving the quality of heavy multi-stage refiners.

Results and Performance

The model was evaluated on three standard, large-scale benchmarks: COCO, LVIS, and Cityscapes. PatchDCT shows impressive gains across the board compared to the baseline Mask R-CNN:

  • COCO: Improvements of 2.0% AP and 3.4% Boundary AP.
  • LVIS: Improvements of 3.2% AP and 5.3% Boundary AP.
  • Cityscapes: A massive 4.5% AP and 7.0% Boundary AP boost.

Qualitatively, the model produces much sharper edges, successfully capturing thin structures like kite strings or the complex contours of human limbs that standard models often "blur" or truncate. Crucially, it achieves this with only a minor drop in inference speed (roughly 1.5 FPS on an A100 GPU).

Limitations and Future Work

Despite the improvements, the authors noted a specific failure mode: the model occasionally generates masks with holes or disconnected components. This typically happens in semantically ambiguous areas where the classifier might mislabel a patch as background when it should be foreground.

Future work aims to improve the robustness of the patch classifier and regressor to prevent these holes, and to test the framework on more specialized domains, such as aerial or medical imaging, where high-resolution boundary precision is critical.

Summary updated

BibTeX
@inproceedings{wen2023patchdct,
  author = {Qinrou Wen and Jirui Yang and Xue Yang and Kewei Liang},
  title = {{PatchDCT: Patch Refinement for High Quality Instance Segmentation}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=t9Zd7Oi5JPl},
}
Figure