ConfusionFlow: A Model-Agnostic Visualization for Temporal Analysis of Classifier Confusion

Andreas P. Hinterreiter, Peter Ruch, Holger Stitz, Martin Ennemoser, Jürgen Bernard, Hendrik Strobelt, Marc Streit · DOI

Abstract

ConfusionFlow is a model-agnostic visualization tool designed to analyze the temporal evolution of classifier confusion. While global metrics like accuracy provide a high-level overview of model performance, they often obscure the specific class-level errors that emerge during training. By integrating temporal visualizations—specifically "lasagna plots"—into a confusion matrix interface, ConfusionFlow enables researchers to identify when specific misclassifications occur and how they change over time. This paper details the tool's design, its application across various datasets including CIFAR and MNIST, and its utility in diagnosing anomalies in active learning and model pruning.

Introduction

In machine learning, accuracy is often the primary metric for success. However, accuracy is a blunt instrument; it indicates that a model is failing but rarely explains how or when those failures originate. While classic confusion matrices provide class-level insights, they are static snapshots. ConfusionFlow bridges this gap by providing an interactive environment to track the "learning journey" of a model, pinpointing exactly when specific classes become confused.

The Hierarchy of Model Evaluation

Standard model evaluation typically occurs at three distinct levels of detail:

  1. Global (L1): Aggregate scores like accuracy or loss, usually tracked via line charts.
  2. Class (L2): Confusion matrices showing which classes are being mixed up.
  3. Instance (L3): Analysis of specific misclassified data points.
Overview of the three levels of model evaluation (L1-L3) and their corresponding temporal extensions, including ConfusionFlow at the class level.

The authors identify a critical gap at the Class Level (L2): there is no standard method to visualize how class-level confusion evolves over time. ConfusionFlow addresses this by replacing static matrix cells with temporal visualizations, allowing users to see if a drop in accuracy is due to a sudden confusion between specific classes or a general degradation of performance.

ConfusionFlow Methodology

The core innovation is the ConfusionFlow Matrix. Instead of a single number in each cell $(i, j)$, the tool embeds a time-series visualization.

  • Lasagna Plots: To compare multiple models or datasets without the clutter of overlapping lines, the tool uses 1D heatmaps. Each row in a cell represents a different model run, with brightness indicating the intensity of confusion at that time step.
  • Model-Agnostic Design: The tool requires only a log of ground truth versus predicted labels for each epoch, making it compatible with any classifier, from Deep Neural Networks to Random Forests.
Conceptual framework for comparing classifier performance (T1) and learning behavior (T1 + T2) across training epochs.

Case Studies and Key Insights

The utility of ConfusionFlow was validated across several scenarios:

  • Active Learning Anomalies: In an MNIST study, a "Greedy" strategy showed a sudden accuracy dip. ConfusionFlow revealed this was caused by a specific confusion between digits 0, 4, and 9 due to an unbalanced training sample at the 11th step.
  • Class-Specific Overfitting: In CIFAR-100, the tool showed that while global accuracy plateaued, the model increasingly confused "tractors" with "trains" over time—a nuance invisible in standard plots.
  • Pruning Stability: Analyzing Fashion-MNIST, the authors found that re-initialized sparse networks were more stable than online-pruned networks, which suffered from volatile confusion spikes in shoe-related classes.

Conclusion and Future Work

ConfusionFlow effectively scales for up to approximately 15 classes; beyond this, hierarchical aggregation into "superclasses" is recommended. While the tool excels at identifying which classes are confused, it does not yet show the underlying images. Future work includes InstanceFlow, an L3 visualization designed to track how individual data points migrate between classes during the training process.

Summary updated

BibTeX
@article{hinterreiter2019confusionflow,
  author = {Andreas P. Hinterreiter and Peter Ruch and Holger Stitz and Martin Ennemoser and Jürgen Bernard and Hendrik Strobelt and Marc Streit},
  title = {{ConfusionFlow: A Model-Agnostic Visualization for Temporal Analysis of Classifier Confusion}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2019},
  doi = {10.1109/tvcg.2020.3012063},
}
Figure