Introduction
Deep learning models often operate as "black boxes," making it difficult to diagnose performance failures, particularly in the context of imbalanced datasets. When certain classes are underrepresented, model performance typically degrades. However, identifying whether this is due to a simple lack of data, class overlap, or internal "feature entanglement" remains a significant challenge. While traditional eXplainable AI (XAI) focuses on instance-level explanations, developers require global-level insights to improve resampling techniques and loss functions. This paper introduces a diagnostic framework that leverages latent feature embeddings to provide these necessary global perspectives.
The Diagnostic Framework
The proposed framework centers on Feature Embeddings (FE)—the low-dimensional representations generated in the penultimate layer of a Convolutional Neural Network (CNN). By analyzing these embeddings, the authors provide a multi-faceted view of how the model perceives different classes.
The framework consists of four primary components:
- Class Archetypes: Utilizing K-Nearest Neighbors (KNN) on the FEs, classes are partitioned into four categories: Safe (homogeneous), Border (near decision boundaries), Rare (isolated sub-concepts), and Outlier (potential noise).
- Nearest Adversary Analysis: Local neighborhoods in the training set are used to predict validation-time class confusion.
- Latent Feature Overlap: Identification of shared internal neurons (feature maps) between classes to reveal entanglement.
- Class Saliency Color Visualizations: Aggregated saliency maps that highlight the specific textures or colors a model associates with a class.
Empirical Evaluation
The framework was tested across five diverse image datasets with varying degrees of imbalance, ranging from artificial exponential decays to real-world "natural" long-tails.
The datasets included:
- CIFAR-10 & CIFAR-100: Benchmarks with artificial exponential imbalance.
- Places-10 & Places-100: Scene recognition tasks.
- iNaturalist: A large-scale dataset featuring natural long-tailed distributions of biological species.
Key Insights and Results
Predictive Power of Training Data
A major finding is that a model’s behavior on training data—specifically its "nearest adversaries"—serves as a highly accurate proxy for its performance on validation sets. The Nearest Neighbor (NNB) method for predicting validation errors outperformed random distributions by 1.8x to 34x across datasets, measured via Kullback-Leibler Divergence (KLD). This suggests that researchers can utilize training data more effectively for diagnostics, preserving scarce minority-class samples.
Feature Entanglement and Texture Bias
The analysis revealed that CNNs often rely on textures rather than shapes. For instance, in CIFAR-10, trucks and cars shared 5 of their top 10 most important latent features, largely due to shared textures like tires and asphalt. This "feature entanglement" explains why simple cost-sensitive methods, such as LDAM, often fail; they address sample counts but not the underlying shared representations.
Archetype Correlation
The study empirically demonstrated that the four defined archetypes (Safe, Border, Rare, Outlier) correlate strongly with actual model accuracy. This provides a reliable map for identifying problematic regions within a dataset, moving XAI from debugging individual images to debugging the dataset as a whole.
Conclusion and Future Work
While the current framework is tailored for CNNs and image data, the underlying concept of analyzing latent feature embeddings is broadly applicable. Future work could extend these diagnostics to other architectures and modalities. Furthermore, these insights pave the way for "feature-based" remedial strategies, such as novel loss functions that specifically penalize feature overlap rather than just addressing class frequency.
Summary updated