Context Patch Fusion With Class Token Enhancement for Weakly Supervised Semantic Segmentation
Yiyang Fu, Hui Li, Wangyu Wu
TL;DR
This work tackles weakly supervised semantic segmentation by addressing the limitations of CAM-based localization through explicit patch-context modeling and class-level semantic refinement. It introduces CPF-CTE, which combines a Contextual-Fusion Bidirectional LSTM (CF-BiLSTM) for spatial patch dependencies with learnable class tokens applied post-ViT encoding to provide dynamic class-specific refinement, all integrated into a ViT-based framework. The model employs Top-$k$ pooling, a lightweight patch classifier, CRF refinement, and a DeepLabv2 refinement stage to produce high-quality pseudo-labels that supervise segmentation; it achieves state-of-the-art results on VOC-2012 and COCO-2014, with ablations confirming the contributions of both the CF-BiLSTM and class-token components. Overall, CPF-CTE offers a scalable, interpretable approach that improves intra-image contextual reasoning and class discrimination under weak supervision, enabling more accurate and robust semantic segmentation.
Abstract
Weakly Supervised Semantic Segmentation (WSSS), which relies only on image-level labels, has attracted significant attention for its cost-effectiveness and scalability. Existing methods mainly enhance inter-class distinctions and employ data augmentation to mitigate semantic ambiguity and reduce spurious activations. However, they often neglect the complex contextual dependencies among image patches, resulting in incomplete local representations and limited segmentation accuracy. To address these issues, we propose the Context Patch Fusion with Class Token Enhancement (CPF-CTE) framework, which exploits contextual relations among patches to enrich feature representations and improve segmentation. At its core, the Contextual-Fusion Bidirectional Long Short-Term Memory (CF-BiLSTM) module captures spatial dependencies between patches and enables bidirectional information flow, yielding a more comprehensive understanding of spatial correlations. This strengthens feature learning and segmentation robustness. Moreover, we introduce learnable class tokens that dynamically encode and refine class-specific semantics, enhancing discriminative capability. By effectively integrating spatial and semantic cues, CPF-CTE produces richer and more accurate representations of image content. Extensive experiments on PASCAL VOC 2012 and MS COCO 2014 validate that CPF-CTE consistently surpasses prior WSSS methods.
