Introduction
Predicting a patient's future diagnoses based on their Electronic Health Record (EHR) history is a cornerstone of proactive healthcare. However, EHR data presents significant challenges for standard machine learning models. Hospital visits occur at irregular intervals, and the duration of each stay (Length of Stay, or LoS) varies, yet most models treat these as discrete, uniform steps. Furthermore, many medical codes are rare, leading to data sparsity issues where models struggle to learn meaningful representations without vast amounts of training data. Finally, a patient's current condition often depends on a complex web of long-range historical dependencies.
Methodology
To address these challenges, we introduce SETOR (SEquential Diagnosis Prediction with Transformer and Ontological Representation). SETOR is an end-to-end framework designed to treat a patient's medical history as a continuous journey rather than a series of isolated events.
Core Innovations
- Ontological Encoder: To mitigate the "rare code" problem, SETOR leverages medical ontologies (e.g., ICD-9 hierarchies). Using a graph-based attention mechanism, specific disease codes (leaf nodes) inherit knowledge from more general parent categories. This knowledge-sharing regularizes the latent space and improves performance in data-starved environments.
- Neural ODE Representations: Instead of discrete recurrent units, SETOR employs Neural Ordinary Differential Equations (ODEs) to model continuous time. The LoS ODE captures the transition from admission to discharge, while the Interval ODE models the evolution of a patient's latent health state during the irregular gaps between hospital visits.
- Patient Journey Transformer (J-Transformer): Following ODE processing, a multi-layer Transformer block captures global dependencies across the entire visit sequence. This allows the model to weigh the clinical importance of past events regardless of their temporal distance from the current visit.
Experimental Evaluation
SETOR was evaluated on two real-world healthcare databases: MIMIC-III (approx. 7,500 ICU patients) and MIMIC-IV (approx. 73,000 ICU patients). To test robustness, the model was trained on varying subsets of data, ranging from 20% to 80% of the total available records.
Key Results
SETOR consistently outperformed state-of-the-art baselines, including RETAIN, Dipole, and GRAM. On the MIMIC-III dataset, SETOR improved Accuracy@5 by 2.21% over the best baseline (MMORE). On the larger MIMIC-IV dataset, it achieved a significant 8.77% improvement over RETAIN.
As shown in the results above, SETOR demonstrates remarkable data efficiency. When trained on only 20% of the available data, SETOR often achieved higher accuracy than competing baselines trained on 80% of the data. This highlights the power of integrating medical ontologies to supplement sparse clinical records.
Conclusion
By combining the continuous-time modeling of Neural ODEs with the structured knowledge of medical ontologies, SETOR provides a robust framework for sequential diagnosis prediction. The model not only improves predictive accuracy but also demonstrates superior stability in low-data scenarios. Future work will explore the integration of diverse EHR modalities, such as clinical notes and lab results, to further enhance the model's clinical utility.
Summary updated