NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Explainable Prediction of Medical Codes from Clinical Text

James Mullenbach, Sarah Wiegreffe, Jon Duke, Jimeng Sun, Jacob Eisenstein

Abstract

Clinical notes are text documents that are created by clinicians for each patient encounter. They are typically accompanied by medical codes, which describe the diagnosis and treatment. Annotating these codes is labor intensive and error prone; furthermore, the connection between the codes and the text is not annotated, obscuring the reasons and details behind specific diagnoses and treatments. We present an attentional convolutional network that predicts medical codes from clinical text. Our method aggregates information across the document using a convolutional neural network, and uses an attention mechanism to select the most relevant segments for each of the thousands of possible codes. The method is accurate, achieving precision@8 of 0.71 and a Micro-F1 of 0.54, which are both better than the prior state of the art. Furthermore, through an interpretability evaluation by a physician, we show that the attention mechanism identifies meaningful explanations for each code assignment.

Introduction

In modern healthcare, every patient encounter generates a clinical note—a free-text narrative detailing symptoms, diagnoses, and procedures. For administrative purposes such as billing and insurance, as well as for clinical research, these notes must be mapped to the International Classification of Diseases (ICD) taxonomy. This task is currently a significant bottleneck due to the high dimensionality of the ICD system (over 14,000 codes in ICD-9), the noisy nature of clinical text, and the "black box" nature of many automated systems.

Researchers from the Georgia Institute of Technology have addressed these challenges by developing a novel deep learning architecture that not only predicts codes with high accuracy but also provides interpretable "rationales" for its decisions.

Methodology: Convolutional Attention for Multi-Label Classification (CAML)

The core contribution of this work is the CAML (Convolutional Attention for Multi-Label classification) model. Unlike traditional models that attempt to summarize an entire document into a single vector, CAML recognizes that different parts of a clinical note are relevant to different medical codes.

The CAML architecture featuring a per-label attention mechanism that maps document features (H) to code-specific vectors (v_l).

The architecture utilizes a Convolutional Neural Network (CNN) to extract local features (n-grams) from the text. The innovation lies in the per-label attention mechanism. The model learns a unique "query" vector for every possible ICD code, allowing it to search the document and identify the specific snippets most relevant to that code.

Additionally, the authors introduced DR-CAML (Description Regularized CAML) to address the "long-tail" problem, where many medical codes appear very infrequently in training data. DR-CAML incorporates the official text descriptions of ICD codes to regularize the model's parameters, ensuring that the learned representations for rare codes align with their semantic definitions.

Datasets and Experimental Setup

The models were rigorously evaluated using the MIMIC-II and MIMIC-III datasets, which contain de-identified clinical records from the Beth Israel Deaconess Medical Center. The primary benchmark, MIMIC-III Full, consists of approximately 47,000 discharge summaries associated with 8,922 unique ICD-9 codes. A smaller subset, MIMIC-III 50, focusing on the 50 most frequent codes, was also used for comparison with prior state-of-the-art methods.

Key Results and Interpretability

CAML established a new performance baseline for ICD code prediction. On the full MIMIC-III dataset, it achieved a Micro-F1 score of 0.539, significantly outperforming standard CNNs (0.419) and Bi-GRUs (0.417). Its Precision@8 of 0.709 indicates that the majority of its top suggestions are clinically accurate.

Beyond raw performance, the model's interpretability is a key advantage. By analyzing the attention weights, the model can highlight the specific text segments that triggered a prediction.

Comparison of text rationales selected by different models for ICD code 428.20 ("Systolic heart failure, unspecified").

As shown in the qualitative evaluation, CAML identifies clinically relevant phrases like "systolic dysfunction" to justify the assignment of specific heart failure codes. In a formal evaluation, a physician rated CAML's explanations as "informative" or "highly informative" significantly more often than those provided by baseline methods, demonstrating its potential as a reliable decision-support tool in clinical settings.

Conclusion and Future Directions

While CAML represents a significant step forward, challenges remain. Predicting extremely rare codes in the "long tail" is still difficult, and the model currently treats clinical notes as flat sequences, ignoring the inherent section structure of medical documents. Future work may involve leveraging the hierarchical structure of the ICD taxonomy and improving the handling of out-of-vocabulary words, such as typos and specialized abbreviations common in clinical notes.

Summary updated

BibTeX
@inproceedings{mullenbach2018explainable,
  author = {James Mullenbach and Sarah Wiegreffe and Jon Duke and Jimeng Sun and Jacob Eisenstein},
  title = {{Explainable Prediction of Medical Codes from Clinical Text}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/n18-1100},
}
Figure