[Paper Review] Self-Attention Enhanced Patient Journey Understanding in Healthcare System
This paper proposes MusaNet, a multi-level self-attention network that leverages masked self-attention (mSA) to model temporal and contextual relationships in multi-level electronic health record (EHR) data—patient, visit, and medical code levels. The method achieves state-of-the-art performance in re-admission and diagnosis prediction, improving accuracy by up to 2.83% over SOTA baselines on real-world datasets.
Understanding patients' journeys in healthcare system is a fundamental prepositive task for a broad range of AI-based healthcare applications. This task aims to learn an informative representation that can comprehensively encode hidden dependencies among medical events and its inner entities, and then the use of encoding outputs can greatly benefit the downstream application-driven tasks. A patient journey is a sequence of electronic health records (EHRs) over time that is organized at multiple levels: patient, visits and medical codes. The key challenge of patient journey understanding is to design an effective encoding mechanism which can properly tackle the aforementioned multi-level structured patient journey data with temporal sequential visits and a set of medical codes. This paper proposes a novel self-attention mechanism that can simultaneously capture the contextual and temporal relationships hidden in patient journeys. A multi-level self-attention network (MusaNet) is specifically designed to learn the representations of patient journeys that is used to be a long sequence of activities. The MusaNet is trained in end-to-end manner using the training data derived from EHRs. We evaluated the efficacy of our method on two medical application tasks with real-world benchmark datasets. The results have demonstrated the proposed MusaNet produces higher-quality representations than state-of-the-art baseline methods. The source code is available in https://github.com/xueping/MusaNet.
Motivation & Objective
- To address the challenge of modeling multi-level, temporally structured EHR data with long-range dependencies and irregular visit intervals.
- To overcome limitations of RNNs and CNNs in capturing long-term temporal dependencies and contextual relationships in patient journeys.
- To develop an end-to-end attention-based model that preserves temporal information and enables explainable representation learning.
- To improve downstream clinical prediction tasks such as re-admission and diagnosis prediction using richer, context-aware patient embeddings.
- To introduce a novel masked self-attention mechanism that explicitly models temporal gaps between visits while capturing contextual dependencies.
Proposed method
- Proposes a masked self-attention (mSA) mechanism that captures both contextual and temporal relationships between visits in a patient journey.
- Designs a multi-level self-attention network (MusaNet) with hierarchical attention pooling to aggregate medical codes into visits and visits into patient-level representations.
- Incorporates interval encoding to explicitly model the time gaps between consecutive visits, enhancing temporal modeling.
- Uses self-attention layers to compute dynamic attention weights across visits, allowing long-range dependencies to be captured effectively.
- Employs learnable embeddings for medical codes and visits, with positional encoding to preserve sequence order.
- Trains the entire network end-to-end using supervised loss functions for downstream prediction tasks.
Experimental results
Research questions
- RQ1Can a self-attention-based model effectively capture long-range temporal and contextual dependencies in multi-level EHR data?
- RQ2How does the proposed masked self-attention mechanism compare to RNNs and CNNs in modeling patient journey sequences with irregular visit intervals?
- RQ3To what extent does MusaNet improve prediction performance in clinical tasks such as re-admission and diagnosis prediction compared to state-of-the-art methods?
- RQ4Can the attention weights in MusaNet provide interpretable insights into which visits or diagnoses are most predictive of future health outcomes?
- RQ5Does the integration of interval encoding significantly enhance the model’s ability to model temporal dynamics in EHR sequences?
Key findings
- MusaNet achieved a 2.83% improvement in re-admission prediction accuracy on the Dx dataset compared to state-of-the-art baselines.
- On the Dx&Tx dataset, MusaNet improved re-admission prediction accuracy by 1.07% over the best-performing baseline.
- The model improved precision@5 for diagnosis prediction by 2.2% on the Dx dataset and precision@30 by 1.4% on the Dx&Tx dataset.
- Attention visualization revealed that specific visits—such as Visit 1 with ICD code 585.6 (end-stage renal disease)—were highly predictive of future re-admissions.
- The model identified key diagnoses like long-term insulin use (ICD V58.6.7) and hypercholesterolemia (ICD 272.0) as major contributors to re-admission risk in individual cases.
- The explainability of MusaNet was validated through attention heatmaps, demonstrating that the model can highlight clinically relevant visits and diagnoses with high interpretability.
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.