Abstract
Semantic segmentation is a critical task for real-time applications such as autonomous driving and mobile augmented reality. However, achieving high accuracy while maintaining low computational overhead remains a significant challenge. This paper presents CGRSeg (Context-Guided spatial feature Reconstruction Segmentation), an efficient framework designed to optimize the trade-off between performance and resource consumption. CGRSeg introduces two key innovations: the Rectangular Self-Calibration Module (RCM) for capturing axial global context and the Dynamic Prototype Guided (DPG) head for enhanced class awareness. Experimental results on ADE20K, COCO-Stuff, and Pascal Context benchmarks demonstrate that CGRSeg achieves state-of-the-art efficiency, outperforming existing models like SeaFormer and SegNeXt with significantly lower GFLOPs.
Introduction
Semantic segmentation involves assigning a categorical label to every pixel in an image. While the advent of Vision Transformers (ViTs) and deep Convolutional Neural Networks (CNNs) has led to remarkable accuracy gains, these models often require substantial memory and computational power. This makes them unsuitable for deployment on edge devices with limited resources.
Lightweight segmentation models typically struggle with two main issues: boundary blurring and misclassification. Boundary blurring occurs when models fail to precisely delineate object edges, while misclassification often stems from the inability to distinguish between visually similar foreground objects. These failures are frequently linked to the "head" of the network—the final classification layers—which are often either too computationally expensive or too simplistic to capture necessary contextual nuances.
Methodology
CGRSeg addresses these challenges through a novel architecture that prioritizes efficient spatial feature reconstruction.
Rectangular Self-Calibration Module (RCM)
Standard self-attention mechanisms are computationally expensive due to their quadratic complexity relative to image resolution. The RCM avoids this by utilizing horizontal and vertical pooling to capture "axial" global context. To refine this coarse representation, the module employs a shape self-calibration function. By using learnable "strip convolutions," the RCM morphs rectangular attention maps to better align with the irregular shapes of real-world objects. This allows the model to achieve a large receptive field and precise focus without the overhead of full $N \times N$ attention matrices.
Dynamic Prototype Guided (DPG) Head
Traditional segmentation heads often process pixels in isolation, which can lead to inconsistent labeling in complex scenes. The DPG head introduces "dynamic prototypes"—embeddings that represent the average features of a specific class within a given image. By projecting these prototypes back into the pixel space, the model gains explicit class awareness. This mechanism helps the network distinguish between similar categories, such as a road and a sidewalk, by leveraging global class information to guide local pixel classification.
Architecture Overview
The CGRSeg framework follows an encoder-decoder paradigm. It utilizes the EfficientFormerV2 as a backbone for stepwise downsampling. The decoder then employs RCMs to reconstruct spatial features across multiple scales, ensuring that both high-level semantic information and low-level structural details are preserved.
Experimental Results
The model was evaluated on three major benchmarks: ADE20K, COCO-Stuff, and Pascal Context.
- ADE20K: CGRSeg-T (the "Tiny" variant) achieved 43.6% mIoU using only 4.0 GFLOPs. This represents a 0.9% improvement over SeaFormer-L while utilizing 38% fewer computational resources. On an NVIDIA V100 GPU, CGRSeg-T achieved a throughput of 138.4 images per second.
- COCO-Stuff: The larger CGRSeg-L variant reached 46.0% mIoU, surpassing SegNeXt-B by 0.2% while requiring less than half the GFLOPs (14.9 vs 34.9).
- Pascal Context: Consistent improvements were observed, validating the robustness of the RCM and DPG components across different dataset scales and category counts.
Discussion and Insights
The success of CGRSeg highlights several key principles for efficient design:
- Axial Context Sufficiency: Capturing global information along the X and Y axes provides a significant boost to the receptive field at a fraction of the cost of standard attention.
- Calibration as Refinement: While rectangular modeling is efficient, it is inherently coarse. Lightweight calibration steps, like strip convolutions, are essential for adapting these features to real-world object geometries.
- Explicit Class Embedding: The DPG head demonstrates that explicitly embedding class information can serve as a "shortcut" to high accuracy, allowing smaller decoders to match the performance of much larger, more complex counterparts.
Conclusion and Future Work
CGRSeg establishes a new frontier for efficient semantic segmentation by combining axial context modeling with dynamic class prototypes. While the results are promising, future research could explore the model's performance on a wider variety of backbones beyond EfficientFormerV2. Additionally, while GFLOPs and throughput on high-end GPUs are standard metrics, further testing on mobile NPUs and DSPs would be beneficial to fully characterize the model's real-world utility on edge hardware.
Summary updated