[Paper Review] Few-Shot Electronic Health Record Coding through Graph Contrastive Learning
This paper proposes CoGraph, a graph contrastive learning framework for few-shot electronic health record (EHR) coding that improves performance on both frequent and rare ICD codes. By constructing heterogeneous word-entity (HEWE) graphs and applying two contrastive learning schemes—graph sampling contrastive learning (GSCL) and graph evolution contrastive learning (GECL)—CoGraph learns transferable representations from structural patterns, achieving significant gains on rare ICD codes (up to 2.95% F1 improvement) while maintaining strong performance on frequent ones.
Electronic health record (EHR) coding is the task of assigning ICD codes to each EHR. Most previous studies either only focus on the frequent ICD codes or treat rare and frequent ICD codes in the same way. These methods perform well on frequent ICD codes but due to the extremely unbalanced distribution of ICD codes, the performance on rare ones is far from satisfactory. We seek to improve the performance for both frequent and rare ICD codes by using a contrastive graph-based EHR coding framework, CoGraph, which re-casts EHR coding as a few-shot learning task. First, we construct a heterogeneous EHR word-entity (HEWE) graph for each EHR, where the words and entities extracted from an EHR serve as nodes and the relations between them serve as edges. Then, CoGraph learns similarities and dissimilarities between HEWE graphs from different ICD codes so that information can be transferred among them. In a few-shot learning scenario, the model only has access to frequent ICD codes during training, which might force it to encode features that are useful for frequent ICD codes only. To mitigate this risk, CoGraph devises two graph contrastive learning schemes, GSCL and GECL, that exploit the HEWE graph structures so as to encode transferable features. GSCL utilizes the intra-correlation of different sub-graphs sampled from HEWE graphs while GECL exploits the inter-correlation among HEWE graphs at different clinical stages. Experiments on the MIMIC-III benchmark dataset show that CoGraph significantly outperforms state-of-the-art methods on EHR coding, not only on frequent ICD codes, but also on rare codes, in terms of several evaluation indicators. On frequent ICD codes, GSCL and GECL improve the classification accuracy and F1 by 1.31% and 0.61%, respectively, and on rare ICD codes CoGraph has more obvious improvements by 2.12% and 2.95%.
Motivation & Objective
- Address the severe class imbalance in EHR coding, where rare ICD codes are poorly predicted due to insufficient training samples.
- Improve ICD code prediction performance not only for frequent codes but especially for rare ones, which are often neglected in existing methods.
- Develop a few-shot learning framework that transfers knowledge from frequent to rare ICD codes using self-supervised graph representation learning.
- Mitigate the risk of models learning only features useful for frequent ICD codes by leveraging intrinsic graph structure for contrastive pre-training.
- Design contrastive learning schemes that exploit intra- and inter-graph correlations in EHRs to learn robust, transferable representations without relying on external knowledge.
Proposed method
- Construct a heterogeneous word-entity (HEWE) graph for each EHR, where words and medical entities are nodes, and relations (e.g., co-occurrence, mention) are edges.
- Treat each ICD code prediction as a meta-task in a few-shot learning setup, enabling knowledge transfer from frequent to rare ICD codes.
- Introduce graph sampling contrastive learning (GSCL) to learn invariance by contrasting sub-graphs sampled from the same HEWE graph.
- Propose graph evolution contrastive learning (GECL) to capture temporal dynamics by contrasting historical and future HEWE graphs of the same patient across clinical stages.
- Pre-train the graph encoder using these contrastive objectives to learn transferable features before fine-tuning on ICD classification.
- Use a meta-learning strategy with support and query sets to simulate few-shot scenarios during training, ensuring generalization to rare ICD codes with limited supervision.
Experimental results
Research questions
- RQ1Can a few-shot learning framework effectively improve ICD code prediction for rare codes when only limited labeled examples are available?
- RQ2How can intrinsic structural patterns in EHRs be leveraged to learn transferable representations without relying on external medical knowledge?
- RQ3To what extent do graph contrastive learning schemes like GSCL and GECL improve representation learning for EHR coding compared to standard supervised fine-tuning?
- RQ4Does the performance of the model on rare ICD codes improve with increasing few-shot support set size (K), and how does this affect performance on frequent codes?
- RQ5How do different sampling strategies for training classes (e.g., random vs. on-top) affect the model’s ability to generalize to rare ICD codes?
Key findings
- CoGraph achieves a 1.31% absolute improvement in classification accuracy and a 0.61% improvement in F1 score on frequent ICD codes compared to state-of-the-art methods.
- On rare ICD codes, CoGraph shows significantly stronger gains, with a 2.12% improvement in accuracy and a 2.95% improvement in F1 score, demonstrating its effectiveness for low-resource ICD codes.
- Performance on frequent ICD codes slightly decreases as the few-shot support set size (K) increases beyond 1, indicating a trade-off between frequent and rare code learning.
- The model’s performance on rare ICD codes remains stable and consistently high even when the number of training ICD classes increases, suggesting effective knowledge transfer from frequent to rare codes.
- Precision for rare ICD codes is significantly higher than recall and accuracy, indicating that the model tends to predict rare codes conservatively, leaving room for improvement in recall for extremely rare codes.
- The 'on-top' sampling strategy leads to more unstable training dynamics than random sampling due to class imbalance in the training distribution, but does not significantly affect final performance on rare codes.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.