Rethinking Decoders for Transformer-based Semantic Segmentation: Compression is All You Need

Qishuai Wen, Chun-Guang Li · DOI

Abstract

Current Transformer-based decoders for semantic segmentation rely on empirical "black-box" designs, such as stacked self-attention and feed-forward networks, whose theoretical underpinnings remain opaque. This paper introduces DEPICT (DEcoder for PrIncipled semantiC segemenTation), a "white-box" architecture derived from the principles of Coding Rate Reduction and Principal Component Analysis (PCA). By viewing segmentation as a data compression problem, DEPICT replaces standard attention with mathematically derived Multi-head Subspace Self-Attention (MSSA) and Cross-Attention (MSCA) operators. This principled design achieves state-of-the-art performance on benchmarks like ADE20K while utilizing up to 14x fewer parameters and 3x fewer FLOPs than traditional decoders, demonstrating that mathematical rigor can lead to significant gains in both interpretability and efficiency.

Introduction

In semantic segmentation, Transformer-based decoders like Segmenter and MaskFormer have set new performance benchmarks. However, these architectures are largely the result of empirical trial-and-error, combining various attention mechanisms and feed-forward networks (FFNs) without a clear mathematical justification for their specific configurations. This lack of theoretical grounding makes it difficult to diagnose bottlenecks or optimize for efficiency.

The authors propose that semantic segmentation is fundamentally a compression problem: high-dimensional image features must be projected into a compact, low-rank subspace defined by class categories. Based on this insight, they develop DEPICT, a decoder where every operation is unrolled from an optimization objective.

The DEPICT Framework: A White-Box Approach

DEPICT moves away from the standard "black-box" Transformer block. Instead, it is built from two core, mathematically derived components:

  1. Multi-head Subspace Self-Attention (MSSA): This operator is designed to refine image embeddings ($Z_0$) into an "ideal principal subspace." It iteratively cleans the data, ensuring that features belonging to the same semantic class are grouped together in the feature space.
  2. Multi-head Subspace Cross-Attention (MSCA): This operator performs a low-rank approximation of the image features using class embeddings as orthonormal bases. It effectively "compresses" the refined image features into the final segmentation masks.
The DEPICT-CA architecture and its mathematical derivation from subspace projection principles.

A key finding of this principled approach is that the standard Feed-Forward Networks (FFNs), which typically dominate a Transformer's parameter count, become redundant. By using more precise attention mechanisms, DEPICT achieves high accuracy with a fraction of the parameters.

Segmentation as PCA and Data Compression

The core philosophy of DEPICT is that segmentation is a form of dimension reduction. The model learns to identify the principal directions in the feature space that correspond to specific semantic classes.

Qualitative evolution of features from initial embeddings ($Z_0$) to refined features ($Z_{L_1}$) and final masks ($M$), illustrating the compression process.

As shown in the visualizations, the initial features ($Z_0$) are noisy and lack clear semantic boundaries. Through the MSSA layers, the features ($Z_{L_1}$) become more coherent and aligned with object shapes. Finally, the MSCA layer projects these features onto the class subspaces to produce the final mask ($M$). This process maximizes the "coding rate"—a measure of how efficiently the data is represented—while maintaining class separation.

Key Results and Efficiency

DEPICT demonstrates that efficiency and performance are not mutually exclusive:

  • State-of-the-Art Efficiency: On the ADE20K dataset, a DEPICT-SA model using a ViT-Large backbone achieved 54.3 mIoU, outperforming the standard Segmenter (53.6 mIoU). Remarkably, DEPICT used only 2M parameters compared to Segmenter's 28M, and required 17.8G FLOPs versus 60.4G.
  • Robustness: Because it is built on stable mathematical subspaces, DEPICT is significantly more robust to weight perturbations. While standard models fail under noise, DEPICT's performance degrades gracefully.
  • Learned Orthogonality: Analysis of the model's weights confirms that it naturally learns nearly orthonormal bases for different classes, validating the theoretical compression-based derivation.

Conclusion

DEPICT represents a shift from empirical architecture search toward principled, "white-box" design in computer vision. By rethinking the decoder as a compression engine, the authors have created a model that is not only more interpretable but also vastly more efficient. Future work will explore extending this framework to hierarchical backbones and more complex mask classification tasks, potentially setting a new standard for efficient and explainable vision models.

Summary updated

BibTeX
@inproceedings{wen2024rethinking,
  author = {Qishuai Wen and Chun-Guang Li},
  title = {{Rethinking Decoders for Transformer-based Semantic Segmentation: Compression is All You Need}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=IHjoPnNZb9},
}
Figure