Energy Aligning for Biased Models

Bowen Zhao, Chen Chen, Qi Ju, Shutao XiaarXiv 2021 · arXiv

Abstract

Deep neural networks (DNNs) frequently exhibit bias toward majority classes in imbalanced datasets, a phenomenon prevalent in long-tailed recognition and class incremental learning (CIL). We present Energy Aligning (EA), a theoretically-grounded, post-hoc method to correct this bias. By interpreting DNNs as Energy-Based Models (EBMs), we identify a consistent energy imbalance between majority and minority classes. EA corrects this by applying calculated "shift scalars" to output logits during inference. Our method requires no architectural changes or retraining and achieves state-of-the-art performance across multiple benchmarks, including ImageNet and iNaturalist.

Introduction

The performance of deep neural networks is often compromised by class imbalance. In real-world scenarios, data distributions are frequently "long-tailed," where a few categories dominate the training set. Similarly, in Class Incremental Learning (CIL), models tend to "forget" old classes because the available rehearsal data is significantly smaller than the data for new classes. This imbalance leads to a systematic bias where models misclassify minority samples as majority ones.

Existing remedies, such as re-sampling or re-weighting, often struggle with overfitting or optimization instability. Decoupling methods, which separate representation learning from classifier training, offer a heuristic alternative but often lack a rigorous theoretical foundation.

Methodology: The Energy Perspective

We bridge the gap between standard discriminative models and Energy-Based Models (EBMs). In an EBM, the model assigns an "energy" value to each input-label pair, where lower energy indicates higher compatibility.

Energy-Bias Discovery

Our theoretical analysis demonstrates that the negative free energy of a class is mathematically aligned with its log-probability. In an ideal, balanced model, free energies across all classes should be roughly equal. However, we observe a distinct "energy bias" in imbalanced models: minority classes consistently exhibit higher free energies (lower compatibility) than majority classes.

Comparison of free energies and image counts in raw vs. corrected models.

Energy Aligning (EA)

To rectify this, we propose Energy Aligning (EA), which adjusts the output logits $f(x)$ during inference using a class-specific shift scalar $\alpha_j$:

$$f_{new}(x)[j] = f(x)[j] + \alpha_j$$

These scalars are estimated using Monte Carlo integration over a small, balanced set of samples. This post-hoc calibration equalizes the energy levels across classes, effectively neutralizing the model's inherent bias toward majority categories.

Experimental Evaluation

We evaluated EA on several challenging benchmarks for both CIL and long-tailed recognition.

Datasets and Benchmarks

  • Class Incremental Learning: Evaluated on ImageNet100, ImageNet1000, and CIFAR100.
  • Long-Tailed Recognition: Tested on ImageNet-LT, iNaturalist 2018, and CIFAR-LT variants.

Key Results

EA consistently outperforms state-of-the-art (SOTA) methods. In CIL tasks on ImageNet1000 (10 steps), EA achieved a top-1 average accuracy of 65.7%, surpassing Weight Aligning (WA). On the large-scale iNaturalist 2018 dataset, EA reached 70.4% top-1 accuracy, outperforming specialized methods like BBN (69.6%) and Decouple-LWS (69.5%).

Performance comparison (Top-1 and Top-5 Accuracy) with and without Energy Aligning (EA) on ImageNet benchmarks.

Ablation studies reveal that EA provides a significant boost to "few-shot" (minority) classes—often improving accuracy by 10-20%—with minimal impact on "many-shot" (majority) class performance.

Discussion and Conclusion

Energy Aligning offers a simple yet powerful solution to class imbalance. Its strength lies in its simplicity: it is a post-hoc linear shift that requires no hyper-parameter tuning or specialized training paradigms. Furthermore, the method is universal, proving effective across various classifiers, optimizers, and backbones.

While currently implemented as a post-hoc fix, future work could explore integrating energy alignment directly into the training phase, potentially leveraging generative EBM training strategies to mitigate bias from the outset.

Summary updated

BibTeX
@misc{zhao2021energy,
  author = {Bowen Zhao and Chen Chen and Qi Ju and Shutao Xia},
  title = {{Energy Aligning for Biased Models}},
  year = {2021},
  eprint = {2106.03343},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.03343},
}
Figure