CondNet: Conditional Classifier for Scene Segmentation

Changqian Yu, Yuanjie Shao, Changxin Gao, Nong SangIEEE Signal Processing Letters 2021 · DOI

Abstract

The fully convolutional network (FCN) has achieved tremendous success in dense visual recognition tasks, such as scene segmentation. The last layer of FCN is typically a global classifier ($1\times1$ convolution) to recognize each pixel to a semantic label. We empirically show that this global classifier, ignoring the intra-class distinction, may lead to sub-optimal results. In this work, we present a conditional classifier to replace the traditional global classifier, where the kernels of the classifier are generated dynamically conditioned on the input. The main advantages of the new classifier consist of: (i) it attends on the intra-class distinction, leading to stronger dense recognition capability; (ii) the conditional classifier is simple and flexible to be integrated into almost arbitrary FCN architectures to improve the prediction. Extensive experiments demonstrate that the proposed classifier performs favourably against the traditional classifier on the FCN architecture. The framework equipped with the conditional classifier (called CondNet) achieves new state-of-the-art performances on two datasets. The code and models are available at https://git.io/CondNet.

Introduction

In semantic segmentation, the goal is to assign a category label to every pixel. Most state-of-the-art Fully Convolutional Networks (FCNs) use a global classifier as their final layer. This is typically a $1\times1$ convolution with weights that are learned during training and then frozen during inference.

However, this "one-size-fits-all" approach is sub-optimal. A global classifier essentially tries to find a single "global class center" for a category (e.g., "chair"). Since objects in the same category can look vastly different across different scenes—a phenomenon known as intra-class variation—a fixed weight matrix struggles to accurately classify pixels across diverse contexts. For instance, a "car" in a sunny street scene looks very different from a "car" in a rainy night scene. CondNet addresses this by moving from a global class center to a sample-specific class center.

Methods

The core innovation of CondNet is the Conditional Classifier, which replaces the standard fixed $1\times1$ convolution with a dynamic one. The architecture consists of two main modules:

  1. Class-Feature Aggregation Module: The network first produces a "coarse" probability map. It uses this map to perform weighted averaging of the input features for each category present in the image. This results in embeddings that represent the "average" look of each class specifically within that image.
  2. Kernel Generation Module: These sample-specific embeddings are passed through a projection function (a group $1\times1$ convolution) to generate a unique set of classifier kernels tailored to the current input. These dynamic kernels are then applied to the feature map to produce the final segmentation mask.
Detailed architecture of the CondNet conditional classifier showing data and parameter flow.

To ensure the coarse maps are accurate enough to guide the aggregation, the authors employ a dual-loss strategy: Soft Dice Loss for the coarse prediction (to handle class imbalance) and standard Cross Entropy Loss for the final prediction.

Experiments and Results

CondNet was evaluated on two major scene segmentation benchmarks: ADE20K, which features 150 semantic categories and significant scene diversity, and PASCAL-Context, which provides dense labels for 59 common categories.

Key Results

  • Significant Performance Gains: Replacing a standard global classifier with the conditional classifier significantly improves performance. On the ADE20K dataset with a ResNet-50 backbone, the mIoU increased from 35.94% to 42.37%, a gain of 6.43 points.
  • State-of-the-Art (SOTA): CondNet achieved SOTA results on both datasets at the time of publication. On ADE20K, it reached 47.54% mIoU with a ResNest-101 backbone, outperforming established models like DeepLabV3+. On PASCAL-Context, it reached 57.0% mIoU.
  • Ablation Studies: The choice of loss function for the auxiliary supervision is crucial. As shown in the table below, using Soft Dice Loss provides the best results compared to standard BCE or no supervision.
Ablation study on ADE20K showing the impact of the conditional classifier and different loss functions.

Conclusion

CondNet demonstrates that the final classifier in FCNs is a significant bottleneck for scene segmentation. By making the classifier dynamic and conditioned on the input features, the model can better handle intra-class distinctions. The proposed conditional classifier is architecture-agnostic and provides a simple yet effective way to boost the performance of various FCN-based models, specializing its logic for every image it processes.

Summary updated

BibTeX
@article{yu2021condnet,
  author = {Changqian Yu and Yuanjie Shao and Changxin Gao and Nong Sang},
  title = {{CondNet: Conditional Classifier for Scene Segmentation}},
  journal = {IEEE Signal Processing Letters},
  year = {2021},
  doi = {10.1109/lsp.2021.3070472},
}
Figure