The Misclassification Likelihood Matrix: Some Classes Are More Likely To Be Misclassified Than Others

Daniel Sikar, Artur Garcez, Robin Bloomfield, Tillman Weyde, Kaleem Peeroo, Naman Singh, Maeve Hutchinson, Mirela Reljan-DelaneyarXiv 2024

Abstract

This study introduces the Misclassification Likelihood Matrix (MLM) as a novel tool for quantifying the reliability of neural network predictions under distribution shifts. The MLM is obtained by leveraging softmax outputs and clustering techniques to measure the distances between the predictions of a trained neural network and class centroids. By analyzing these distances, the MLM provides a comprehensive view of the model's misclassification tendencies, enabling decision-makers to identify the most common and critical sources of errors. The MLM allows for the prioritization of model improvements and the establishment of decision thresholds based on acceptable risk levels. The approach is evaluated on the MNIST dataset using a Convolutional Neural Network (CNN) and a perturbed version of the dataset to simulate distribution shifts. The results demonstrate the effectiveness of the MLM in assessing the reliability of predictions and highlight its potential in enhancing the interpretability and risk mitigation capabilities of neural networks. The implications of this work extend beyond image classification, with ongoing applications in autonomous systems, such as self-driving cars, to improve the safety and reliability of decision-making in complex, real-world environments.

Introduction

In high-stakes domains such as autonomous driving or medical diagnostics, the cost of misclassification varies significantly. Standard evaluation metrics, like the confusion matrix, often treat all errors with equal weight and are limited to performance on a static, specific dataset. This approach fails to account for distribution shifts—where real-world data differs from training data—and ignores the rich information contained within the full softmax probability distribution of a neural network.

Standard Confusion Matrix for MNIST, showing actual classification errors on the test set.

Methodology

The proposed Misclassification Likelihood Matrix (MLM) addresses these gaps by quantifying the potential for errors based on the geometric relationships in the probability space. The process involves four key steps:

  1. Centroid Calculation: Using K-Means clustering on softmax outputs of correctly classified training samples to define class centers.
  2. Distance Mapping: Calculating the Euclidean distance between a test sample's softmax output and these centroids.
  3. Nearest Distance Matrix: Identifying minimum distances between class pairs across the test set.
  4. Likelihood Transformation: Converting these distances into normalized likelihoods.

Unlike traditional matrices that count realized errors, the MLM identifies systemic vulnerabilities by measuring how "close" a prediction is to the boundary of another class.

Experimental Setup

The framework was evaluated using the MNIST dataset and a "Perturbed MNIST" variant. The latter simulates distribution shifts through 12 types of perturbations (e.g., Gaussian noise, defocus blur, and pixelation) across 10 intensity levels, totaling over 1.2 million images. This allowed for a rigorous assessment of how well the MLM predicts model failure under stress.

Results and Discussion

The MLM successfully identified fine-grained misclassification tendencies that were invisible in standard metrics. For instance, while the standard confusion matrix might show zero errors for certain pairs, the MLM provides non-zero likelihoods, aiding in risk assessment for edge cases.

The Misclassification Likelihood Matrix (MLM), quantifying the potential for class confusion based on softmax geometry.

Key findings include:

  • Stability Across Noise: The MLM is a stable predictor; high-likelihood confusions identified on clean data consistently manifest as actual errors as perturbation levels increase.
  • Class Robustness: Digit '0' was found to be the most robust, while '8' was the most unstable (most likely to be misclassified).
  • Predictive Power: The matrix specifically flagged high-risk pairs like 7-as-2 and 8-as-1 across various noise types, mapping which class boundaries collapse first under distribution shifts.

Conclusion

The MLM offers a novel diagnostic tool for enhancing the reliability and interpretability of neural networks. By utilizing the entire softmax output, it moves toward more efficient "Green AI" by making better use of computational energy already spent during inference. Future work will extend this analysis to more complex datasets like CIFAR-10 or ImageNet and explore alternative distance metrics such as Cosine Similarity and entropy metrics.

Summary updated

BibTeX
@misc{sikar2024misclassification,
  author = {Daniel Sikar and Artur Garcez and Robin Bloomfield and Tillman Weyde and Kaleem Peeroo and Naman Singh and Maeve Hutchinson and Mirela Reljan-Delaney},
  title = {{The Misclassification Likelihood Matrix: Some Classes Are More Likely To Be Misclassified Than Others}},
  year = {2024},
  eprint = {2407.07818},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.07818},
}
Figure