Using Confusion Graphs to Understand Classifier Error

Davis Yoshida, Jordan Boyd‐Graber2016

Abstract: Understanding the nature of the errors of a machine learning system is often difficult for multiclass classification problems with a large number of classes. This is true even more so if the number of examples for each class is low. To interpret the performance of a multiclass classifier, we form a graph representing the errors, and use average-link clustering to find groups of classes which are confused with each other. We apply this idea to the QANTA question answering system.

Introduction

In traditional multiclass classification, a confusion matrix is the standard tool for identifying which classes a model frequently misidentifies. however, modern systems often deal with thousands of classes (high-cardinality). For instance, the QANTA Question Answering (QA) system—designed to play the trivia game Quiz Bowl—must choose from thousands of possible answers. In such scenarios, the standard confusion matrix becomes an enormous, sparse, and unreadable mess. A single misclassification between two rare classes provides little actionable insight. To address this, we propose "Confusion Graphs" to provide a macro-level view of model errors, grouping related misclassifications into interpretable clusters.

Methodology: From Matrices to Graphs

Instead of a grid, we represent misclassifications as a network. In this Confusion Graph, each vertex represents a class (an answer). An undirected edge is drawn between two classes if the model confuses them, with the edge weight corresponding to the frequency of that confusion.

A visualization of a confusion graph showing links between semantically related but distinct answers like 'Lung', 'Bone', and 'Cartilage'.

To make sense of this network, we apply average-linkage agglomerative clustering. This process groups classes that are highly confused with one another into distinct clusters. Once clusters are formed, we utilize AutoSlog, a system that automatically identifies linguistic patterns (e.g., "Battle of [Noun]") prevalent in one cluster but absent in others. This helps pinpoint the specific textual triggers causing the model to stumble.

Analyzing the Error Network

Our analysis of the QANTA system revealed several surprising topological features of the error space.

The Giant Component and Topology

Rather than a series of isolated islands of confusion, the graph features a "giant component" where the vast majority of nodes (4,032 out of 4,091) are connected. This implies that almost every error is linked to every other error through a chain of misclassifications. The graph is also heavy-tailed, meaning a small number of answers act as "hubs" of confusion.

Degree distribution of the confusion graph for the main validation set, illustrating its heavy-tailed power-law nature.

Six Degrees of Misclassification

Due to this connectivity, any two confused answers are relatively "close" in error-space. The confusion graph for the primary validation set has a diameter of 14. This leads to bizarre paths between unrelated topics; for example, the model can link "Ribosome" (biology) to "Ragtime" (a novel) in just 14 steps, passing through intermediate nodes like "Acupuncture" and "Yoga."

Key Results and Interpretability

The clustering approach successfully grouped related concepts, such as separating high-energy physics from general mechanics. By identifying 46 distinct pairs of clusters based on size constraints, we provided a tractable way for researchers to interpret classifier confusion compared to analyzing thousands of individual errors. This allows developers to engineer features that fix hundreds of mistakes simultaneously rather than addressing them class-by-class.

Conclusion and Future Work

While this work successfully diagnoses why the model is confused, the next step is a "closed-loop" approach. Future research will focus on feeding the patterns identified by AutoSlog back into the model as new features to measure performance gains and observe if the "confusion hubs" in the graph eventually disappear.

Summary updated

BibTeX
@misc{yoshida2016using,
  author = {Davis Yoshida and Jordan Boyd‐Graber},
  title = {{Using Confusion Graphs to Understand Classifier Error}},
  year = {2016},
  doi = {10.18653/v1/w16-0108},
}

Loading related content...

Figure