Abstract
Semantic segmentation is a computer vision task that associates a label with each pixel in an image. Modern approaches tend to introduce class embeddings into semantic segmentation for deeply utilizing category semantics, and regard supervised class masks as final predictions. In this paper, we explore the mechanism of class embeddings and have an insight that more explicit and meaningful class embeddings can be generated based on class masks purposely. Following this observation, we propose ECENet, a new segmentation paradigm, in which class embeddings are obtained and enhanced explicitly during interacting with multi-stage image features. Based on this, we revisit the traditional decoding process and explore inverted information flow between segmentation masks and class embeddings. Furthermore, to ensure the discriminability and informativity of features from backbone, we propose a Feature Reconstruction module, which combines intrinsic and diverse branches together to ensure the concurrence of diversity and redundancy in features. Experiments show that our ECENet outperforms its counterparts on the ADE20K dataset with much less computational cost and achieves new state-of-the-art results on PASCALContext dataset.
Introduction
In semantic segmentation, the goal is to assign a category label to every pixel in an image. Modern architectures, particularly those based on Transformers, often use "class embeddings" (or object queries). These are vectors that represent specific categories and interact with image features to produce the final segmentation masks.
However, a major limitation exists: these embeddings are typically initialized randomly and remain "implicit," ignoring valuable spatial prior knowledge. Furthermore, the information flow is usually one-way—from embeddings to masks. ECENet introduces a "reverse" information flow: instead of relying on implicit embeddings, it extracts explicit class embeddings directly from predicted masks. By treating masks as natural descriptions of categories, the model gains a spatial prior that implicit embeddings lack.
Methods
The ECENet architecture breaks the traditional decoding process through three key components:
- Feature Reconstruction (FR) Module: Before decoding, backbone features pass through "intrinsic" and "diverse" branches. The diverse branch uses linear operations and a Squeeze-and-Excitation (SE) module to ensure features are informative and non-redundant. A diversity loss ($L_{div}$) ensures feature maps uniquely cover different image regions.
- Explicit Class Extraction (ECE) Module: This is the core of the "reverse" flow. The model takes predicted masks and uses Spatial Pyramid Pooling to harvest representations from different sub-regions, projecting them into a unified embedding space. The model essentially uses its own predictions to define what a category "looks like" explicitly.
- Semantics Attention & Updater (SAU) Module: These explicit embeddings are fed back into earlier stages. Using a Transformer-like attention mechanism, image features (queries) interact with explicit class embeddings (keys and values). A gated mechanism updates the embeddings, allowing high-level semantic information to "polish" earlier layer features.
Experiments and Results
ECENet was evaluated on three challenging benchmarks: ADE20K (150 categories), PASCAL-Context (59 classes), and Cityscapes (19 categories).
The results demonstrate that "explicit is better than implicit" for class embeddings:
- State-of-the-Art Performance: ECENet achieved a new SOTA on PASCAL-Context with 65.9% mIoU (as shown in the table above).
- Efficiency: On ADE20K, ECENet with a Swin-Large backbone reached 55.2% mIoU, outperforming SenFormer by 1.0% mIoU while using significantly fewer parameters and GFLOPs (425.7 vs. >500).
- Versatility: The gated-updating strategy provided a 0.6% mIoU boost when integrated into SegViT with negligible overhead.
Conclusion
ECENet bridges the semantic gap by passing explicit embeddings back to earlier stages via the SAU module. By managing the balance between diversity and redundancy in the FR module, the network generates high-quality embeddings. While the ECE module's pooling size requires dataset-specific tuning, the inverted information flow (masks → embeddings) offers a promising direction for other vision tasks like instance segmentation or object detection.
Summary updated