Statistical Theory for Imbalanced Binary Classification

Shashank Singh, Justin Khim

TL;DR

This paper tackles the challenge of imbalanced binary classification by generalizing the concept of an "optimal" classifier beyond simple accuracy. They introduce a novel framework that allows for optimal performance across a wide range of metrics, demonstrating that sometimes, a "stochastic" (probabilistic) classifier is superior to any deterministic one. This work provides crucial theoretical guarantees for imbalanced data and introduces a new way to understand class imbalance.

What Problem Does This Paper Address?

In machine learning, binary classification aims to assign an instance to one of two classes. A common metric for evaluating classifiers is accuracy, which is simply the proportion of correct predictions. However, accuracy can be highly misleading when one class is much rarer than the other (class imbalance). For instance, a classifier that always predicts the majority class might achieve high accuracy but be useless for identifying the rare, often more important, class (e.g., fraud detection, rare disease diagnosis). While various methods exist to handle imbalanced data, the theoretical understanding of optimal classification under these conditions, especially for metrics beyond accuracy, has been limited. Existing theories often rely on strong, empirically unverifiable assumptions about the data distribution. This paper aims to bridge this gap by providing a more robust theoretical foundation for optimal classification in the presence of class imbalance, considering a broader set of performance metrics and relaxing restrictive assumptions.

Methods

The core of this paper lies in two main contributions:

  1. Generalizing the Bayes-Optimal Classifier: The authors extend the classical Bayes-optimal classifier (which optimizes accuracy) to any "Confusion Matrix Measure" (CMM). A CMM is any performance metric that improves as correct classifications increase and incorrect ones decrease. Crucially, they show that an optimal classifier for any CMM can always be represented as a "stochastic thresholding classifier" (RTC). This means the classifier probabilistically assigns a class based on the estimated probability of belonging to class 1, using a threshold. This is a significant departure from deterministic classifiers and removes the need for strong assumptions like absolute continuity of the class probability distribution, which were previously thought to be essential.
  2. Analyzing k-Nearest Neighbors (kNN) under Class Imbalance: They then apply their generalized framework to analyze the kNN classifier, a popular algorithm. They introduce a new concept called "Uniform Class Imbalance" (UCI), which describes a specific type of severe imbalance where the rare class is hard to distinguish even with perfect information about features. They derive finite-sample performance guarantees for kNN under UCI, showing how the optimal choice of the 'k' parameter changes drastically compared to balanced or other imbalanced scenarios.

Datasets

The paper uses synthetic data generated according to specific distributions to illustrate theoretical results. For experimental validation, they use the Kaggle Credit Card Fraud Detection dataset. This dataset is a widely used benchmark for imbalanced classification, containing 284,807 transactions with only 0.172% labeled as fraudulent. The authors note that they down-sampled the majority (non-fraudulent) class for computational feasibility, but expect their findings to hold on the full dataset.

Key Insights and Ideas

  • Stochasticity is Sometimes Necessary for Optimality: The most striking insight is that for many performance metrics (beyond simple accuracy), the truly optimal classifier might need to be stochastic. This means it doesn't just output a hard prediction but a probability, and the decision is made probabilistically. This challenges the common intuition that deterministic classifiers are always preferred.
  • Relaxing Unverifiable Assumptions: The paper successfully removes the need for absolute continuity assumptions on the data distribution, which were previously considered essential for theoretical guarantees. This makes the results more broadly applicable to real-world data.
  • Uniform Class Imbalance (UCI) Matters: The introduction of UCI highlights that not all class imbalances are equal. The structure of the imbalance (how the rare class is distributed relative to the common class) significantly impacts classifier performance, particularly for algorithms like kNN.
  • kNN's 'k' is Sensitive to Imbalance Type: The optimal choice of 'k' in kNN can be dramatically different under UCI compared to other imbalance scenarios. This suggests that a one-size-fits-all approach to tuning kNN for imbalanced data is insufficient.

Key Results

  • Generalized Bayes Classifier: The paper proves that for any Confusion Matrix Measure (CMM), there exists an optimal classifier that is a "stochastic thresholding classifier" (RTC). This generalizes the Bayes classifier for accuracy.
  • Finite-Sample Guarantees for kNN: They provide theoretical guarantees for the kNN regressor's uniform error, particularly under Uniform Class Imbalance (UCI). These bounds show how the error depends on parameters like the degree of imbalance (r), the smoothness of the regression function, and the dimensionality of the data.
  • UCI Requires Larger 'k': For UCI, the optimal 'k' for kNN can be significantly larger than in balanced cases, leading to different convergence rates.
  • Experimental Validation: Numerical experiments on the credit card fraud dataset confirm that stochastic thresholding generally outperforms deterministic thresholding in terms of F₁ score, especially at higher degrees of class imbalance. This effect is robust across different values of 'k'.

Limitations and Future Work

  • Societal Impacts of Stochastic Classifiers: While the paper justifies the use of stochastic classifiers for performance, it acknowledges potential downstream consequences like reduced interpretability, explainability, and vulnerability to manipulation. Future work could explore techniques for derandomizing classifiers or addressing fairness concerns.
  • Distinguishing Imbalance Sub-types: The authors suggest that further research is needed to understand how to distinguish between different sub-types of class imbalance in practice.
  • Adaptive Classifiers: Developing adaptive classifiers that can perform well across multiple imbalance sub-types is identified as a future direction.
  • Multiclass Extension: The current work focuses on binary classification; extending these results to the multiclass setting is a natural next step.
  • Tightness of Bounds: While the theoretical bounds are significant, there's a small gap between upper and lower bounds for kNN uniform error, suggesting potential for tighter analysis.

Summary updated

BibTeX
@inproceedings{singh2022statistical,
  author = {Shashank Singh and Justin Khim},
  title = {{Statistical Theory for Imbalanced Binary Classification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=pm8Y8unXkkJ},
}
Figure