Using the Tsetlin Machine to Learn Human-Interpretable Rules for High-Accuracy Text Categorization With Medical Applications

Lei Jiao, Geir Thore Berge, Ole-Christoffer Granmo, Tor Oddbjørn Tveit, Morten Goodwin, Lei Jiao 0001, Bernt Viggo Matheussen

Abstract

In text categorization, a persistent trade-off exists between the high accuracy of "black box" deep learning models and the interpretability of simpler rule-based systems. This paper introduces a novel approach using the Tsetlin Machine (TM), a logic-based architecture that bridges this gap. By representing text as propositional formulae and employing a decentralized learning process via Tsetlin Automata, the TM achieves state-of-the-art accuracy on benchmark datasets while maintaining human-readable transparency. This is particularly valuable in medical applications, such as analyzing Electronic Health Records (EHRs), where understanding the rationale behind a classification is critical for clinical decision support.

Introduction

Text categorization is a foundational task in natural language processing (NLP), yet it faces significant hurdles in high-stakes environments like healthcare. Deep learning models, such as Convolutional Neural Networks (CNNs) and Long Short-Term Memory (LSTM) networks, offer impressive accuracy but lack transparency. Conversely, interpretable models like Naïve Bayes often fail to capture the complex, high-dimensional relationships inherent in clinical notes.

This research addresses this dilemma by leveraging the Tsetlin Machine. Unlike connectionist models that rely on weights and biases, the TM uses propositional logic to learn conjunctive clauses—essentially IF-THEN rules. This allows the model to be both highly performant and fully auditable.

Methodology

The Tsetlin Machine operates on a fundamentally different principle than traditional neural networks. The process begins by converting raw text into a binary format suitable for logic operations.

Data Representation

Documents are represented as bit vectors, where each bit indicates the presence or absence of a specific term (literal) from the vocabulary. This transformation allows the model to process text using efficient bitwise operations.

The pipeline for transforming raw document text into bit vector representations.

Architecture and Learning

The core of the TM consists of a "team" of Tsetlin Automata that learn to form conjunctive clauses. Each clause is a conjunction of literals (e.g., IF "rash" AND "reaction" AND NOT "ibuprofen"). These clauses are then aggregated to make a final classification.

The Tsetlin Machine architecture showing the flow from input to output.

The learning process is governed by a game-theoretic feedback loop. Type I Feedback encourages the model to include literals that help recognize patterns, combating false negatives. Type II Feedback introduces literals that render a clause false when it incorrectly matches a document, combating false positives. This decentralized approach avoids the need for backpropagation and floating-point arithmetic, making the TM exceptionally fast and efficient on modern hardware like GPUs.

Experimental Evaluation

The authors evaluated the Tsetlin Machine across three diverse datasets:

  1. 20 Newsgroups: A standard benchmark for document classification.
  2. IMDb: A dataset for sentiment analysis of movie reviews.
  3. Clinical Dataset: A proprietary dataset of authentic Electronic Health Records from a Norwegian hospital, focused on identifying drug allergies.

Key Insights

  • Interpretability as a First-Class Citizen: The TM's output is a set of logic rules that a human can read and verify. In a clinical setting, a doctor can see exactly which terms (or their absence) triggered an allergy flag.
  • Handling Negation: Unlike many simple models, the TM can learn from the absence of terms, which is often as informative as their presence in medical diagnostics.
  • Global Context: By using conjunctions, the TM captures a "global view" of the document, identifying relationships between multiple terms rather than treating them as independent features.

Results and Discussion

The Tsetlin Machine demonstrated performance competitive with traditional deep learning models:

  • Accuracy: On the 20 Newsgroups dataset, the TM achieved a 99.8% F-measure, outperforming SVMs and Multi-Layer Perceptrons. On the IMDb dataset, it reached 89.1%, surpassing several LSTM and CNN configurations.
  • Clinical Performance: In the complex domain of EHRs, the TM matched the performance of strong baselines like Naïve Bayes while providing significantly better interpretability.
  • Efficiency: The GPU implementation of the TM was found to be 5 to 15 times faster than the CPU version, highlighting its potential for large-scale applications.

Conclusion

The Tsetlin Machine offers a compelling alternative to "black box" models for text categorization. By combining high accuracy with inherent interpretability and computational efficiency, it is uniquely suited for sensitive domains like medicine. Future work will explore unsupervised learning for word embeddings and the incorporation of local context windows to further refine the model's linguistic understanding.

Summary updated

BibTeX
@article{jiao2019using,
  author = {Lei Jiao and Geir Thore Berge and Ole-Christoffer Granmo and Tor Oddbjørn Tveit and Morten Goodwin and Lei Jiao and Bernt Viggo Matheussen},
  title = {{Using the Tsetlin Machine to Learn Human-Interpretable Rules for High-Accuracy Text Categorization With Medical Applications}},
  journal = {IEEE Access},
  year = {2019},
  doi = {10.1109/access.2019.2935416},
}
Figure