Integrating Confidence, Difficulty, and Language Model Calibration for better Explainability in Clinical Documents Coding: Applications of AI
ABSTRACT
Background:
In recent years, there has been increasing interest in developing machine and deep learning models capable of annotating clinical documents with semantically relevant labels. However, the complex nature of these models often leads to significant challenges regarding interpretability and transparency.
Objective:
This study aims to improve the interpretability of transformer models and evaluate the explainability of a deep learning natural language processing model for clinical document annotation. Specifically, the focus is on interpreting and explaining model behavior and predictions by leveraging calibrated confidence, saliency maps, and measures of instance difficulty on textual clinical documents. In particular, the instance difficulty approach has previously proven effective in interpreting image-based models.
Methods:
We used DiLBERT, a domain-specific BERT model pre-trained on ICD classification-related data, to analyze death certificates from the U.S. National Center for Health Statistics, covering the years 2014 to 2017 and comprising 12,919,268 records. For this study, we extracted a subset of 400,000 certificates for training, 100,000 for testing, and 10,000 for validation. We assessed the model's calibration and applied a temperature scaling post-hoc calibration method to improve the reliability of its confidence scores. Additionally, we introduced mechanisms to rank instances by difficulty using Variance of Gradients scores, which also facilitate the detection of out-of-distribution cases. Saliency maps were also used to enhance interpretability by highlighting which tokens in the input text most influenced the model’s predictions.
Results:
Experimental results in a specific use case — prediction of underlying cause of death from death certificates — show that the methodology implemented provides valuable insights into enhancing the explainability of the semantic annotation of clinical documents, thus improving their automated interpretation.
Conclusions:
This study demonstrates that enhancing interpretability and explainability in deep learning models can improve their practical utility in clinical document annotation. By addressing reliability and transparency, the proposed approaches support more informed and trustworthy application of machine learning in mission-critical medical settings. The results also highlight the ongoing need to address data limitations and ensure robust performance, especially for rare or complex cases.
Citation
Request queued. Please wait while the file is being generated. It may take some time.
Copyright
© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.