Abstract
Semantic segmentation models often struggle with long-tailed data distributions, where common "head" classes dominate the training signal and rare "tail" classes are frequently misclassified. This paper introduces Balancing Logit Variation (BLV), a simple yet effective training strategy that addresses the geometric imbalance in the model's feature space. By introducing category-specific noise to logits during training, BLV prevents tail classes from being "squeezed" into narrow feature regions. Experimental results across supervised, semi-supervised, and domain adaptation tasks demonstrate that BLV significantly improves performance on rare categories without increasing model complexity.
Introduction
In real-world computer vision applications, such as autonomous driving, data is inherently imbalanced. While a model may encounter millions of pixels representing "road" or "building," it may only see a few thousand for "bicycles" or "traffic lights." This long-tail distribution poses a significant challenge for semantic segmentation: models become highly proficient at identifying head classes but fail to generalize to tail classes.
Traditional approaches to this problem typically involve re-weighting loss functions or oversampling rare classes. However, these methods often lead to overfitting or fail to address the underlying structural bias in the model's internal representation. This paper proposes Balancing Logit Variation (BLV), a plug-and-play technique that strategically manipulates the feature space to ensure more equitable representation for all categories.
The Problem: Feature Squeezing
In semantic segmentation, a deep neural network projects each pixel into a high-dimensional feature space. Ideally, each class should occupy a distinct and sufficiently large region in this space to allow for robust decision boundaries. However, in long-tailed scenarios, the massive volume of head-class data causes these common categories to occupy the vast majority of the feature territory.
Consequently, tail classes are "squeezed" into tiny, narrow regions. At inference time, even a slight deviation in a tail-class feature can push it across the decision boundary into a head-class region, leading to misclassification. This geometric imbalance is a primary driver of poor performance on rare objects.
Proposed Method: Balancing Logit Variation (BLV)
1. Logit Perturbation
Instead of projecting a pixel to a single static point in the feature space during training, BLV projects it to a dynamic region. This is achieved by adding randomly sampled Gaussian noise to the predicted logits—the raw scores generated by the network before the final Softmax layer.
2. Category-Wise Scaling
The core innovation of BLV lies in how this noise is scaled. The magnitude of the variation is inversely proportional to the frequency of the class:
- Head Classes: Receive minimal noise, as they already possess well-defined and expansive feature areas.
- Tail Classes: Receive significant noise, forcing the model to account for a wider range of potential representations.
3. Feature Expansion and Clean Inference
By introducing larger variations for rare classes, the model is forced to expand the feature regions for those categories to accommodate the noise. This effectively "stretches" the territory of tail classes, creating more balanced decision boundaries. Crucially, this perturbation is only applied during training. During testing, the noise is removed, allowing the model to make clean, stable predictions within the now-optimized feature space.
Applications Across Learning Paradigms
BLV is highly versatile and can be adapted to various learning settings:
- Fully Supervised Learning: Class frequencies are calculated directly from the ground-truth labels.
- Semi-Supervised Learning: Frequencies are estimated using an epoch-based update of pseudo-labels for unlabeled data.
- Unsupervised Domain Adaptation (UDA): Source domain statistics are used as a proxy to balance the model as it adapts to a new target domain.
Experimental Results
The researchers evaluated BLV on several benchmark datasets, including Cityscapes, PASCAL VOC 2012, and synthetic-to-real adaptation tasks (GTA5 → Cityscapes).
- Performance Gains: On the Cityscapes dataset, BLV improved the mean Intersection over Union (mIoU) of tail classes by 1.2% to 3.2% across different architectures, including ResNet and Swin Transformers.
- State-of-the-Art Integration: When integrated into the HRDA framework for domain adaptation, BLV achieved a record mIoU of 74.9% on the GTA5 → Cityscapes benchmark.
- Visualization: t-SNE visualizations confirm that BLV leads to more distinct and less congested class clusters, particularly for rare categories that were previously overlapping with common ones.
Discussion and Limitations
While BLV is a powerful and simple tool, it does have limitations. The method relies on accurate class frequency estimation; in "open-world" scenarios where the data distribution is unknown or shifting, this remains a challenge. Additionally, the base noise magnitude (σ) is a hyperparameter that requires tuning for different datasets. Future work may involve developing automated "noise schedules" that vary the perturbation level throughout the training process to further optimize feature expansion.
Conclusion
Balancing Logit Variation (BLV) offers a computationally efficient and architecturally agnostic solution to the long-tail problem in semantic segmentation. By addressing the geometric "squeezing" of rare classes through category-specific logit perturbation, BLV enables models to achieve a more balanced and robust understanding of complex visual scenes.
Summary updated