Abstract
Recent works have made great progress in semantic segmentation by exploiting contextual information in a local or global manner with dilated convolutions, pyramid pooling or self-attention mechanism. In order to avoid potential misleading contextual information aggregation in previous works, we propose a class-wise dynamic graph convolution (CDGC) module to adaptively propagate information. The graph reasoning is performed among pixels in the same class. Based on the proposed CDGC module, we further introduce the Class-wise Dynamic Graph Convolution Network (CDGCNet), which consists of two main parts including the CDGC module and a basic segmentation network, forming a coarse-to-fine paradigm. Specifically, the CDGC module takes the coarse segmentation result as class mask to extract node features for graph construction and performs dynamic graph convolutions on the constructed graph to learn the feature aggregation and weight allocation. Then the refined feature and the original feature are fused to get the final prediction. We conduct extensive experiments on three popular semantic segmentation benchmarks including Cityscapes, PASCAL VOC 2012 and COCO Stuff, and achieve state-of-the-art performance on all three benchmarks.
Introduction
In semantic segmentation, the accuracy of pixel-level classification depends heavily on capturing contextual information. While existing methods like Atrous Spatial Pyramid Pooling (ASPP) and Non-local Networks successfully aggregate global context, they often introduce "misleading" information. For instance, aggregating features from a "tree" to identify a "sky" pixel can introduce noise. Ideally, contextual reasoning should be class-specific: a pixel should primarily interact with other pixels of the same category to ensure intra-class consistency and enhance inter-class discrepancy.
To address this, the Class-Wise Dynamic Graph Convolution Network (CDGCNet) introduces a coarse-to-fine paradigm that isolates reasoning to pixels within the same class, avoiding the pollution of features from unrelated categories.
Methodology
The CDGCNet Architecture
CDGCNet operates through a multi-stage process designed to refine initial predictions using graph-based reasoning. The framework begins with a basic backbone network (e.g., ResNet-101) that generates a coarse segmentation map. This map serves as a guide for the subsequent Class-wise Dynamic Graph Convolution (CDGC) module.
Class-wise Graph Construction and Reasoning
Unlike standard self-attention mechanisms that treat the entire image as a fully connected graph, the CDGC module builds independent graphs for each category identified in the coarse map. By grouping pixels by class, the model performs graph convolutions within these specific groups. This sparse approach is semantically more logical than global attention, as it ensures that information propagation is relevant to the specific object or region being refined.
Dynamic Sampling Strategy
To improve robustness, especially during training, the authors employ a unique dynamic sampling strategy. Rather than relying solely on the potentially flawed coarse prediction, the model uses ground truth data to identify and "mine" specific types of pixels:
- Hard Positives: Pixels belonging to a class that the coarse model missed (e.g., thin boundaries).
- Hard Negatives: Pixels incorrectly labeled as belonging to a class.
By specifically sampling these "hard" pixels into the graph, the model learns to correct its own initial errors, effectively acting as an internal hard-mining mechanism.
Experimental Results
CDGCNet was evaluated on three major benchmarks, achieving state-of-the-art (SOTA) performance at the time of its release:
- Cityscapes: Reached 82.0% mIoU on the test set.
- PASCAL VOC 2012: Reached 83.9% mIoU.
- COCO Stuff: Reached 40.7% mIoU.
Ablation studies confirmed the efficacy of the class-wise approach. Replacing a standard "Plain" GCN (which does not use class-specific grouping) with the CDGC module improved the baseline ResNet-101 performance from 76.3% to 79.4% mIoU, demonstrating that isolating context by class is superior to global graph reasoning.
Conclusion
CDGCNet demonstrates that global context is not always optimal for semantic segmentation. By restricting graph reasoning to class-specific nodes and employing a dynamic sampling strategy to target difficult pixels, the model achieves high intra-class consistency and sharper boundaries. While the model's performance is partially dependent on the quality of the initial coarse map, its "plug-and-play" nature makes it a versatile component for future computer vision architectures.
Summary updated