Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Jan 16;6(1):ooac112.
doi: 10.1093/jamiaopen/ooac112. eCollection 2023 Apr.

Red Flag/Blue Flag visualization of a common CNN for text classification

Affiliations

Red Flag/Blue Flag visualization of a common CNN for text classification

John Del Gaizo et al. JAMIA Open. .

Abstract

A shallow convolutional neural network (CNN), TextCNN, has become nearly ubiquitous for classification among clinical and medical text. This research presents a novel eXplainable-AI (X-AI) software, Red Flag/Blue Flag (RFBF), designed for binary classification with TextCNN. RFBF visualizes each convolutional filter's discriminative capability. This is a more informative approach than direct assessment of logit contribution, features that overfit to train set nuances on smaller datasets may indiscriminately activate large logits on validation samples from both classes. RFBF enables model diagnosis, term feature verification, and overfit prevention. We present 3 use cases of (1) filter consistency assessment; (2) predictive performance improvement; and (3) estimation of information leakage between train and holdout sets. The use cases derive from experiments on TextCNN for binary prediction of surgical misadventure outcomes from physician-authored operative notes. Due to TextCNN's prevalence, this X-AI can benefit clinical text research, and hence improve patient outcomes.

Keywords: CNN; NLP; X-AI; clinical NLP; explainable AI; text classification.

PubMed Disclaimer

Figures

Figure 1.
Figure 1.
Modified TextCNN. The sole difference with the original TextCNN is that the FC layer outputs 1 dimension instead of 2.
Figure 2.
Figure 2.
(A) The top 3 filters ranked on mean logit delta (train set) for classification of without mention. (B) Same as Figure 2A but ranked on mean logit delta (holdout set).
Figure 3.
Figure 3.
Experiment 7, D&I classification. (A) Top: Filter 1 is an outlier for validate set performance. (B) Bottom: Distribution drift between train (left) and validate (right).

References

    1. Kim Y. Convolutional neural networks for sentence classification. In: Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP); Association for Computational Linguistics; 2014:1746–51; Doha, Qatar.
    1. Han S, Zhang RF, Shi L, et al. Classifying social determinants of health from unstructured electronic health records using deep learning-based natural language processing. J Biomed Inform 2022; 127: 103984. - PubMed
    1. Paszke A, Gross S, Massa F, et al. PyTorch: An iImperative Style, High-performance Deep Learning Library. In: Advances in Neural Information Processing Systems 32 [Internet]. Curran Associates, Inc.; 2019: 8024–35. http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-per....
    1. Rabhi S, Jakubowicz J, Metzger MH. Deep Learning versus Conventional Machine Learning for Detection of Healthcare-Associated Infections in French Clinical Narratives. Methods Inf Med 2019; 58 (1): 31–41. - PubMed
    1. Obeid JS, Dahne J, Christensen S, et al. Identifying and Predicting Intentional Self-harm in Electronic Health Record Clinical Notes: Deep Learning Approach. JMIR Med Inform 2020; 8 (7): e17784. - PMC - PubMed

LinkOut - more resources