NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Spatial Structure Constraints for Weakly Supervised Semantic Segmentation

Tao Chen, Yazhou Yao, Xingguo Huang, Zechao Li, Liqiang Nie, Jinhui Tang

TL;DR

Weakly supervised semantic segmentation (WSSS) methods often expand Class Activation Maps (CAMs) to cover entire objects, but this expansion frequently bleeds into the background. This paper introduces Spatial Structure Constraints (SSC), a framework that couples a CAM-driven image reconstruction module (guided by perceptual loss) with a superpixel-based activation self-modulation module. Without relying on external saliency models, SSC constrains expanded attention to precise object boundaries and achieves state-of-the-art results on PASCAL VOC 2012 and MS COCO.

What Problem Does This Paper Address?

Training deep semantic segmentation models normally requires pixel-level annotations, which are expensive and tedious to produce. Weakly supervised semantic segmentation (WSSS) reduces this cost by using image-level labels (e.g., "dog", "car").

The standard approach uses Class Activation Maps (CAMs) derived from classification networks to generate pseudo-labels. However, naive CAMs suffer from under-activation: they only highlight the most discriminative parts of an object (e.g., the face of a dog or wheels of a car). Recent works use attention-expansion strategies like Discriminative Region Suppression (DRS) to spread focus outward, but this introduces over-activation, where activations leak into the background. To counter this, many approaches rely on auxiliary off-the-shelf saliency detectors—introducing external supervision and defeating the spirit of purely weak supervision. The authors ask: Can we constrain attention expansion to respect natural object boundaries using only the input images themselves?

Methods

The authors propose Spatial Structure Constraints (SSC), trained end-to-end alongside the image classifier:

Input Image ──► Backbone (with DRS) ──► CAM Features (F)
                                              │
                      ┌───────────────────────┴───────────────────────┐
                      ▼                                               ▼
         [CAM-Driven Reconstruction]                     [Activation Self-Modulation]
         • Decoder reconstructs image ˆI                  • Superpixel feature averaging
         • Multi-stage Perceptual Loss (VGG-19)          • Reliable Activation Selection (Erosion)
         • Preserves coarse layout & semantics           • Aligns CAM to regional boundaries
  • Attention Expansion Baseline: Incorporates Discriminative Region Suppression (DRS) by capping the maximum activation channel values at $0.55 \cdot X_{\text{max}}$, forcing the backbone to look at less discriminative regions.
  • CAM-Driven Reconstruction (CDR): An autoencoder-style decoder reconstructs the original input image directly from the final $C$-channel CAM feature maps. Rather than using pixel-level ($L_1$ or $L_2$) losses, training is supervised via a multi-stage perceptual loss using a frozen VGG-19 network. This forces CAM features to retain the coarse semantic geometry of the scene without wasting capacity on low-level textures.
  • Activation Self-Modulation (ASM): To inject fine-grained spatial details, features are averaged within unsupervised superpixel segments (up to 64 per image). To prevent this regional averaging from washing out discriminative peaks or spreading into adjacent background regions, a Reliable Activation Selection (RAS) strategy applies thresholding ($T_{\text{obj}} = 0.3$) followed by morphological erosion ($r = 8$) to anchor confident foreground regions.
  • Single-Stage Pseudo-Label Generation: The combined loss balances classification, perceptual reconstruction, and regional consistency: $$\mathcal{L} = \mathcal{L}_{\text{cls}} + \beta_p \mathcal{L}_p + \beta_a \mathcal{L}_a$$ Initial seeds are refined using an existing random-walk method (IRN) before training a standard DeepLabV2 segmentation network.

Datasets

Evaluations were performed on two standard semantic segmentation benchmarks:

  • PASCAL VOC 2012: 21 classes (20 foreground + background). Trained on the augmented set of 10,582 images and evaluated on validation (1,449 images) and test (1,456 images) sets.
  • MS COCO: 81 classes (80 foreground + background). Evaluated using the standard split (80k train, 40k val).
  • No new datasets or external saliency models were introduced.

Key Insights and Ideas

  • Perceptual Loss over Pixel-Level Reconstruction: Conventional autoencoders use $L_1/L_2$ losses, forcing networks to reconstruct pixel colors and high-frequency textures. When applied to compact CAM features, this overburdens the feature space and degrades localization (yielding only ~51% pseudo-mask mIoU). Perceptual loss enforces semantic layout without requiring pixel-level perfection, jumping performance to 54.5%.
  • Superpixel Averaging Requires Safeguards: Simply enforcing superpixel consistency smooths activations but can dilute small discriminative regions into large background superpixels. Combining superpixel alignment with morphological erosion preserves dense object cores while sharpening exterior edges.
  • Self-Supervised Regularization Replaces External Saliency: Forcing the classifier's spatial features to be expressive enough to reconstruct the scene inherently prevents attention maps from becoming amorphous blobs, eliminating the need for separate saliency models.

Key Results

  • Pseudo-Mask Quality: On PASCAL VOC 2012, initial seeds improved from 48.3% (baseline) and 50.2% (DRS) to 58.3% mIoU with SSC (+8.1% over DRS). After IRN refinement, pseudo-masks reached 71.9% mIoU.
  • Final Segmentation (PASCAL VOC 2012):
  • VGG-16 Backbone: 66.8% val / 67.4% test mIoU, outperforming methods like ECS (63.4%) and matching saliency-guided methods like EPS (67.3%).
  • ResNet-101 Backbone: 72.7% val / 72.8% test mIoU, setting a new high watermark among image-level approaches and surpassing multimodal methods like CLIP-ES (71.4%).
  • Final Segmentation (MS COCO):
  • VGG-16 Backbone: 38.1% val mIoU (+14.4% over CONTA).
  • ResNet-101 Backbone: 47.0% val mIoU, outperforming recent competitors such as BECO (45.1%) and CLIP-ES (45.4%).

Limitations and Future Work

  • Co-occurrence Bias: Like many WSSS frameworks, the model struggles when object classes frequently co-occur with specific backgrounds (e.g., mislabeling railway tracks as "train" or keyboards as "monitor").
  • Visual Ambiguity: Categories with similar visual appearances and textures can still confuse the network (e.g., misclassifying a rider as part of a motorcycle).
  • Compute Overhead: The reconstruction decoder and perceptual loss network increase GPU memory consumption during classifier training from 3.2 GB to 14.2 GB (though still manageable on a standard 16 GB GPU).

Summary updated

BibTeX
@article{chen2024spatial,
  author = {Tao Chen and Yazhou Yao and Xingguo Huang and Zechao Li and Liqiang Nie and Jinhui Tang},
  title = {{Spatial Structure Constraints for Weakly Supervised Semantic Segmentation}},
  journal = {IEEE Trans. Image Process.},
  year = {2024},
  doi = {10.1109/tip.2024.3359041},
}
Figure