Interpretable Text Classification Using CNN and Max-pooling

Hao Cheng, Xiaoqing Yang, Zang Li, Yanghua Xiao, Yucheng LinarXiv 2019

Abstract

Convolutional Neural Networks (CNNs) have become a staple in text classification due to their ability to capture local semantic patterns. However, their internal decision-making processes are often opaque. This paper introduces a novel framework to enhance the interpretability of CNNs through two primary mechanisms: convolution attribution and n-gram feature analysis. By leveraging the max-pooling layer as a feature selector, the model can trace classification decisions back to specific input tokens and phrases. Furthermore, a multi-sentence weighting strategy is proposed to extend this interpretability to long documents. Evaluation across multiple benchmarks, including Reuters and TREC, shows that the model maintains state-of-the-art accuracy while providing granular insights into its predictions.

Introduction

Deep learning models, particularly CNNs, excel at identifying n-gram patterns in text. Despite their performance, understanding why a model classifies a document into a specific category remains a challenge. In standard architectures, word vectors undergo non-linear transformations and pooling operations that obscure the relationship between input words and output scores. This "black box" nature limits their utility in domains where transparency is critical. This research addresses this gap by establishing a point-wise association between input tokens and final classification results.

Methodology

The proposed framework modifies the standard CNN text classifier to include interpretability layers without sacrificing predictive power.

Interpretable Framework

The core of the approach lies in two backtracking mechanisms:

  1. Convolution Attribution: This process disassembles the convolution operation to calculate the "relevance" of individual words within an n-gram. It analyzes how specific dimensions of a word vector contribute to the feature vector generated after convolution.
  2. N-gram Feature Analysis: The model treats the max-pooling layer as a decision-making filter. By identifying which n-grams "win" the max-pooling (i.e., produce the highest values), the system can pinpoint the most salient phrases. These winning features are then mapped through the final fully connected layer to determine their specific contribution to each category's score.
Overview of the interpretable CNN architecture, highlighting the prediction path and the interpreting mechanisms.

Multi-sentence Weighting

To process long documents, the authors implement a strategy where documents are split into sentences. Each sentence is classified independently, and a weight is assigned based on the model's confidence—defined as the maximum score in the sentence's probability distribution. The final document classification is a weighted sum of these individual sentence outputs, effectively allowing the model to focus on the most informative parts of a text.

Experimental Results

The model was evaluated on several standard benchmarks, including Reuters (R8 & R52), TREC, Ohsumed, and 20 Newsgroups, as well as a specialized Chinese Taxi Feedback dataset.

Performance and Accuracy

The interpretable CNN achieved competitive results, reaching 97.0% accuracy on Reuters-8 and 85.6% on 20 Newsgroups. On the Chinese Taxi Feedback dataset, the multi-sentence variant achieved 86.2% accuracy, outperforming standard CNN and Bi-LSTM baselines. These results demonstrate that adding interpretability does not come at the cost of performance.

Qualitative Interpretability

The primary advantage of this model is its ability to provide human-readable explanations. For example, in the TREC question classification task, the model correctly associated the phrase "how long" with the NUM (number) category with high confidence.

Comparison of attention and attribution scores across different question types in the TREC dataset.

As shown in the figure above, the attribution mechanism often provides more focused and accurate indicators of class-relevant words compared to standard attention mechanisms.

Conclusion

This research demonstrates that CNNs for text classification can be made inherently interpretable by analyzing the flow of information through convolutional and max-pooling layers. By identifying salient n-grams and calculating word-level attribution, the model offers a clear "judgment basis" for its predictions. Future work will explore extending these techniques to more complex linguistic structures and using these insights to interactively refine model performance.

Summary updated

BibTeX
@misc{cheng2019interpretable,
  author = {Hao Cheng and Xiaoqing Yang and Zang Li and Yanghua Xiao and Yucheng Lin},
  title = {{Interpretable Text Classification Using CNN and Max-pooling}},
  year = {2019},
  eprint = {1910.11236},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.11236},
}
Figure