Decoupling Feature Extraction and Classification Layers for Calibrated Neural Networks

Mikkel Jordahn, Pablo M. Olmos

Introduction

In the deployment of deep neural networks (DNNs) for high-stakes domains—such as autonomous driving or medical diagnostics—predictive accuracy is only half the battle. Equally critical is model calibration: the ability of a network to provide a confidence score that accurately reflects the likelihood of its prediction being correct. Unfortunately, modern, over-parameterized DNNs are notoriously poorly calibrated, often exhibiting extreme overconfidence even when making incorrect predictions. This research identifies the standard practice of joint training—where feature extraction and classification layers are optimized simultaneously—as a primary driver of this phenomenon.

The "Collusion" Problem in Joint Training

Standard training protocols optimize the entire network end-to-end using cross-entropy loss. While effective for accuracy, this approach allows the classifier and the feature extractor to "collude." During optimization, the feature extractor can shift data representations to be as far as possible from the decision boundaries to minimize loss, creating an artificial sense of certainty. This "flexibility trap" results in a feature space where the natural uncertainty inherent at class boundaries is suppressed, leading to the overconfident probability estimates observed in modern architectures.

Proposed Methodology: Two-Stage Training

To break this collusion, the authors propose a paradigm shift: decoupling the training of the feature extractor from the classifier through two distinct strategies.

1. Two-Stage Training (TST)

In the first stage, a standard model (e.g., ResNet or Vision Transformer) is trained end-to-end until convergence. In the second stage, the feature extraction layers are frozen. The final fully connected (FC) classification layers are then re-initialized and re-trained from scratch. By freezing the extractor, the classifier is forced to adapt to the existing feature distribution rather than manipulating it, leading to more honest decision boundaries.

2. Variational Two-Stage Training (V-TST)

This extension introduces a probabilistic framework to the second stage. Instead of a deterministic FC layer, V-TST places a Gaussian prior on the outputs of the last hidden layer. The classifier is then trained using the Evidence Lower Bound (ELBO). This variational approach acts as a form of feature-space regularization, forcing the model to account for uncertainty in the representations and naturally softening overconfident predictions.

Experimental Evaluation

The researchers evaluated TST and V-TST across several standard benchmarks, including CIFAR-10, CIFAR-100, and SVHN. To test robustness, they also utilized corrupted datasets (CIFAR-10-C, CIFAR-100-C) and rotated images to simulate real-world distribution shifts and out-of-distribution (OOD) scenarios.

Key Results

The results demonstrate that decoupling significantly improves calibration without compromising top-1 accuracy. For Wide Residual Networks (WRN), V-TST achieved remarkable reductions in Expected Calibration Error (ECE) compared to the base model:

  • 78.4% reduction on CIFAR-10
  • 73.2% reduction on CIFAR-100
  • 87.6% reduction on SVHN

Notably, these methods outperformed established post-hoc calibration techniques like Temperature Scaling. The benefits were consistent across different architectures, proving effective for both traditional Convolutional Neural Networks (CNNs) and modern Vision Transformers (ViT).

Discussion and Limitations

One of the most compelling aspects of this approach is its efficiency. Since only the final layers are updated in the second stage, the computational overhead is minimal. However, the authors noted a specific trade-off: while in-distribution calibration improves drastically, OOD detection performance occasionally decreased. This suggests that while the model becomes more "honest" about known classes, its ability to flag completely alien data may be slightly diminished, representing an area for future research.

Conclusion

The decoupling of feature extraction and classification layers offers a powerful, computationally efficient path toward more reliable neural networks. By preventing the collusion inherent in joint training, TST and V-TST produce models that better understand the limits of their own knowledge—a vital step toward the safe integration of AI in critical infrastructure.

Summary updated

BibTeX
@inproceedings{jordahn2024decoupling,
  author = {Mikkel Jordahn and Pablo M. Olmos},
  title = {{Decoupling Feature Extraction and Classification Layers for Calibrated Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=F2Tegvyqlo},
}
Figure