Identifying Sepsis Subphenotypes via Time-Aware Multi-Modal Auto-Encoder
The Ohio State University, Columbus, OH
*Corresponding author; email: zhang.10631@osu.eduABSTRACT
Sepsis is a heterogeneous clinical syndrome that is the leading cause of mortality in hospital intensive care units (ICUs). Identification of sepsis subphenotypes may allow for more precise treatments and lead to more targeted clinical interventions. Recently, sepsis subtyping on electronic health records (EHRs) has attracted interest from healthcare researchers. However, most sepsis subtyping studies ignore the temporality of EHR data and suffer from missing values. In this paper, we propose a new sepsis subtyping framework to address the two issues. Our subtyping framework consists of a novel Time-Aware Multi-modal auto-Encoder (TAME) model which introduces time-aware attention mechanism and incorporates multi-modal inputs (e.g., demographics, diagnoses, medications, lab tests and vital signs) to impute missing values, a dynamic time wrapping (DTW) method to measure patients’ temporal similarity based on the imputed EHR data, and a weighted k-means algorithm to cluster patients. Comprehensive experiments on real-world datasets show TAME outperforms the baselines on imputation accuracy. After analyzing TAME-imputed EHR data, we identify four novel subphenotypes of sepsis patients, paving the way for improved personalization of sepsis management.
CCS CONCEPTS
•Applied computing → Health informatics; • Social and professional topics → Medical records; • Mathematics of computing → Time series analysis.
ACM Reference Format
Changchang Yin, Ruoqi Liu, Dongdong Zhang, and Ping Zhang. 2020. Identifying Sepsis Subphenotypes via Time-Aware Multi-Modal Auto-Encoder.
Article notes
Competing Interest Statement
The authors have declared no competing interest.
Funding Statement
This project was funded in part under a grant with Lyntek Medical Technologies Inc
1INTRODUCTION
Sepsis, defined as life-threatening organ dysfunction in response to infection, contributes to up to half of all hospital deaths and is associated with more than $24 billion in annual costs in the United States [11]. Treating a septic patient is highly challenging because individual patients respond differently to medical interventions. Identification of sepsis subphenotypes may lead to more precise treatments and more targeted clinical interventions.
Over the past few decades, the rapid growth in volume and diversity of electronic health records (EHRs) makes it possible to apply machine learning and data mining methods to subtype patients based on their EHR data. EHRs are temporal sequence data and consist of demographics, diagnoses, medications, lab results, vital signs, and other information, as is shown in Figure 1. Existing sepsis subtyping models [8, 14] cluster patients based on the aggregations of important clinical variables (e.g., heart rate and respiratory rate) during the first day in ICU stays. There are two main limitations of the existing studies. (i) The existing sepsis subtyping frameworks [8, 14] adopt the aggregation of clinical variables to compute the patient similarity, which ignores the variables’ temporality, an important characteristic of EHR data. (ii) Most existing subtyping models [8, 14, 20, 23] suffer from missing values and some models [8] even exclude the patients with variables with high missing rates. However, the variables used to subtype sepsis patients have various missing rates. Especially in the early stage of patient admissions and ICU stays, many variables’ missing rates are relatively high. Both the exclusion of patients with high missing rate data and simple imputation models (e.g., mean imputation used in [20] and MICE [3] used in [14, 23]) are not very suitable for sepsis subtyping.
In this study, we propose a novel sepsis subtyping framework to address the issues. Our subtyping framework consists of three steps to group sepsis patients. The first step is to impute missing values with a novel Time-Aware Multi-modal auto-Encoder (TAME) model. TAME encodes multi-modal inputs (e.g., demographics, diagnoses, medications, lab tests, and vital signs) and decodes the values of sepsis-related variables. We propose a time gap embedding and timeaware attention for TAME to take account of the irregular time gaps between collections and variables’ longitudinal information. Moreover, to handle various numbers of observed values in different collections and combine multi-modal data, we propose a new value embedding to project variables and their values into an embedding space while retaining the values’ continuity so that similar values have similar embeddings. The second step is to adopt dynamic time wrapping (DTW) [13] to calculate the temporal similarity between patients with the imputed data. The third step is to cluster the patients with weighted k-means, which assigns weights for the patients in a group when computing the distances between the group and patients.
To demonstrate the efficacy of the proposed model, we conduct imputation experiments on two publicly available datasets: DACMI1 and MIMIC-III [9]. The results show our model outperforms the baselines. Moreover, based on the imputed EHR data, we group sepsis patients using their first 24 hours’ worth of data in ICUs into four meaningful subphenotypes. The experimental results show that both the well-imputed EHR data and the weighted k-means algorithm can significantly improve the subtyping performance. Finally, we analyze the characteristics of the four subphenotypes and discuss their potential for sepsis personalized medicine.
In sum, our contributions are as follows:
- We design a new patient subtyping framework that integrates clinical data imputation model TAME, temporal similarity analysis with DTW, and a weighted k-means method to identify sepsis subphenotypes on EHR data.
- We develop a new imputation model TAME that can handle multi-modal inputs and incorporate cross-modal relations.
- We incorporate value embedding to represent each variable value into a vector so that TAME can handle varying numbers of missing values across collections.
- We introduce time embedding and time-aware attention to TAME to consider collections’ irregular time intervals and variables’ longitudinal information.
- Finally, we demonstrate the effectiveness of our methods experimentally on two real-world EHR data. By using only EHR data from the first 24 hours of patients’ ICU stay, we identify four novel subphenotypes with different clinical characteristics and mortality trajectories, paving the way for personalized medicine for sepsis.
The rest of the paper is organized as follows. In Section 2, we describe technical details of the proposed sepsis subtyping framework. In Section 3, we conduct experiments on two real-world EHR datasets. We review the related studies in Section 4. Section 5 concludes our work.
2METHODOLOGY
In this section, we propose a new time-Aware Multi-modal auto-Encoder (TAME) model to impute missing values in EHR data. Then we leverage Dynamic Time Wrapping (DTW) [13] to compute patient similarity. Finally, we present a weighted k-means to identify subgroups of sepsis patients.
2.1Data Imputation with TAME
TAME takes multi-modal data as inputs by embedding them into a same space. Then a max-pooling layer is used to combine the multi-modal data’s information and output fixed-size vectors, which are sent to BiLSTM to model the time series data and predict the missing values. The framework of TAME is shown in Figure 2.
2.1.1Basic Notations
A patient has demographics information De (including age a and gender g) and at least one admission. Following [14] and [8], our subtyping framework treats various admissions of the same patients as different samples. In an admission, the patient has diagnoses D = [d1, d2, …, d|D|] ∈ N|D |, a collection of variables (i.e., lab test data and vital sign data), denoted by , and medications M = [m1, m2, …, m| M|] ∈ N|M |. At time t, the patient is taking a set of medications Mt ⊆ {1, 2, …, |M|}.
To address the missing values, we introduce two masking matrix to indicate whether the values in X are missing or not. It is initialized as follows:
where i denotes the ith variable. A is only used to compute imputation loss and validate imputation performance.
The time gaps between collections with observed data carries essential information. Hence, we further introduce three time gap vector and matrices means the time gap between current collection t and the last collection
denotes the time gap between current collection t and the collection where the ith variable is observed last time.
denotes the time gap between current collection t and the collection where the ith variable is observed next time. Δ(l) andΔ(n) are initialized as follows:
TAME also takes the neighbouring observed values as inputs to incorporate longitudinal information. Thus, we introduce two neighbouring value matrices and
, which denote the values observed values of the last and next time.
where
and
denote the values of the ith variable of
and
respectively.
2.1.4BiLSTM Architecture
Given a sequence of multi-modal embedding vectors et, we build our model based on bidirectional LSTM for its ability to recall long term information. To incorporate the irregular time gaps between successive collections, the time gap embedding vector is also input to our auto-encoder. The bidirectional LSTM model can be described as follows:
where
and
are forward and backward directional LSTM respectively, We ∈ Rk ×k, WΔ ∈ R2k ×k, be ∈ Rk are learnable parameters. ht ∈ R2k is the concatenation of
and
.
2.1.5Time-Aware Attention
In order to incorporate the longitudinal information of observed values, we introduce a time-aware attention module to attend the latest observed values of the variables. Given the time gap embedding matrices , and value embedding matrices
, we map the latest observed variables along with their corresponding time gaps into a new space.
where Wl,Δ,Wn,Δ ∈ R2k ×k, Wl, e, Wn, e ∈ Rk ×k, bl, bn ∈ Rk are learnable parameters. By concatenating
and
, we obtain a embedding matrix
. Then the attention mechanism is designed to automatically focus on useful longitudinal information. It takes ht, υt as inputs and generate an attention result
.
where Wh ∈ R2k, Wβ ∈ Rk, bβ ∈ R are learnable parameters.
2.1.6Output and Objective Function
Given the LSTM output vector ht and time-aware attention result , we leverage a fully connected layer to output the missing values.
where
are learnable parameters. The imputation loss is the mean square error between the ground truth
and predictions
for the tth collection.
The mean loss of collections is used to train the model. Algorithm 1 in Supplementary Section describes the training process of TAME.
2.2Temporal Similarity with DTW
As is shown in Figure 3, after EHR data imputation, we adopt DTW [13] to compute patient similarity matrix and then cluster the patients with weighted k-means. We replace the missing values with the imputed values and obtain an imputed matrix S for each patient.
For patient i, his/her imputed matrix is a sequence of variable value vectors, denoted by . We denote the sub-sequence of
. The distance between S(i) and S(j) is :
where
is defined with Euclidean distance:
The boundary condition is as follows:
2.3Weighted K-means Clustering
Given the patient similarities (distances), we can leverage k-means to cluster patients into groups. However, the size of patient subphenotypes can be highly imbalanced in clinical settings. For minor groups, outliers are harmful for the calculation of distances between patients and groups. Thus we propose a weighted k-means to mitigate the outliers’ influence by assigning weights for patients in a group when computing the distances. The distance between each patient S(i) the group Gk is calculated as follows:
Given the distances between patients and groups, we assign each patient to the group with the smallest distance. Then the distances between patients and new groups are calculated again. The operations repeat until convergence.
3EXPERIMENTS
In this section, we conduct imputation experiments on two EHR datasets, DACMI1 and MIMIC-III [9]. Based on the imputed variable values of MIMIC-III data and the computed patient similarity matrix with DTW, we identify subgroups of sepsis patients.
3.1Datasets
Both datasets are publicly available real-world EHRs. The first dataset is DACMI, which contains 13 clinical lab tests that are irregularly measured for 8,267 patients. The statistics of DACMI are listed in Table 4 in Supplementary Section. missing values.
The second dataset is derived from MIMIC-III. We select sepsis patients fulfilling the sepsis-3 criteria [15]. Following [14] and [8], we only focus on adult patients with sepsis. 11,715 sepsis patients are obtained. We use the patients’ data to impute the missing values of 27 sepsis-related variables. The statistics of variables are shown in Table 5 in Supplementary Section. We extract 191 kinds of diagnoses and 498 kinds of medications. The diagnoses and medications that appear less than 100 times are removed. To evaluate imputation method performance, we randomly mask an observed value for each variable in each patient’s data. The masked values are used as ground truth.
3.2Methods for Comparison
To validate the performance of the proposed framework for the imputation task, we implement the following models for comparison.
Mean
The mean values of variables are used to impute the
KNN
The average values of the top K most similar collections are used to impute the missing values.
3DMICE [12]
T-LGBM [19]
T-LGBM builds temporal and cross-variable features as inputs, and adopts LightGBM [10] to impute missing values.
BRNN [17]
BRNN prefills the missing values for each variable with the last observed value or mean values of the same variable. Taking as inputs the prefilled data, BRNN adopts a Bidirectional RNN to predict the missing values.
CATSI [22]
CATSI consists of two major ingredients: the context-aware recurrent imputation and the cross-variable imputation to capture longitudinal information and cross-variable relations respectively. A fusion layer is used to produce the final imputations.
DETROIT [21]
DETROIT builds features based on the observed variables inside five latest collections, and then leverages a network of 8 fully-connected layers to predict missing values.
BRITS [5]
BRITS adopts bidirectional RNN to impute missing values. Based on the imputed values, BRITS predicts the values again. The accumulated loss is used to train the model.
TAME
Time-Aware Multi-modal auto-Encoder (TAME) is our proposed model to impute the missing values. To evaluate the effectiveness of the proposed operations, including time-aware attention, multi-modal feature combination and variable value embedding, we implement another three variant versions of TAME.
TAME−T
TAME−T removes the time-aware attention module when imputing missing values.
TAME−V
TAME−V removes the variable value embedding. The method prefills the missing values with mean values and takes the prefilled values as inputs but not the value embeddings.
TAME−M
TAME−M just takes the variables as inputs but ignores the other modal data when imputing missing values.
3.3Implement Details
We implement our proposed model with Python 2.7.15 and PyTorch 1.3.02. For training models, we use Adam optimizer with a mini-batch of 64 patients. The multi-modal data are projected into a 512-d space (k = 512). We train TAME on 1 GPU (TITAN RTX 6000), with a learning rate of 0.001. We randomly divide the datasets into 10 sets. All the experiment results are averaged from 10-fold cross validation, in which 7 sets are used for training every time, 1 set for validation and 2 sets for test. The validation sets are used to determine the best values of parameters in the training iterations. We use MSELoss as loss function to train models.
We normalize the values of variable i as follows: where mean and std are the mean value and standard deviation for the variable i on the whole dataset. When embedding variable values, we discretize the values into 1000 sub-ranges (V = 1000) for each variable. We use patients’ first 30 collections data to train TAME and test all collections data for evaluation. For patients with collection length < 30, we pad the data with 0 and set the corresponding values in masking matrices C and A as 0.
Following [12, 21], we measure the models’ performance with nRMSE. The nRMSE is calculated from the gap between the ground truth and prediction. Given a variable i, nRMSE is defined as:
where indicate the ground truth, imputed value, and masking indicator for patient j, variable i in collection t. The code and more implementation details are available online3.
3.4Results for Imputation
As is shown in Table 1 and Table 2, TAME achieves the best performance for most variables, which demonstrates its effectiveness. Note that due to the space limitation, we display the nRMSE of 14 variables with relatively lower missing rates (50% - 90%) and two mean nRMSE (i.e., the mean nRMSE of 14 variables and 27 variables, denoted by M14 and M27) in Table 2. Due to two variables’ high missing rates (99% for C-Reactive and Bands), M27’s nRMSE is much higher than M14.
The overall performance of traditional machine-learning approaches is worse than the deep learning approaches. Mean and KNN do not capture the longitudinal and cross-variable relations, which are essential for accurate imputation. 3DMICE considers the relations, but cannot model the patients’ health state trends like RNN. T-LGBM achieves comparable performance to deep learning models. But the feature engineering of T-LGBM is complicated and hand-designed, which limits its generalization to other datasets. Since we don’t have access to its feature engineering details, the experiment of T-LGBM is not conducted on MIMIC-III dataset. Its results on the DACMI dataset are obtained from [19].
With the consideration of the longitudinal and cross-variable information, the four deep learning baselines perform much better than the traditional machine learning models on average. Among the four deep learning methods, DETROIT directly predicts missing values based on latest collections’ values, which makes it easier to learn longitudinal information. BRITS considers the time gaps between collections, which is also helpful to learn longitudinal information. Thus, the two models outperform the other deep learning baselines. However, all the baselines suffer from the same limitation that their networks take fixed-size vectors as inputs and therefore need to prefill the missing values. BRNN and DETROIT explicitly prefill the missing values with mean or the last observed values. CASTI and BRITS introduce a mask value to indicate whether each variable is observed (= 1) or not (= 0); they take the product of the observed value and mask value as input. This masking operation is the same as to prefill the missing values with 0. Their prefilling operations bring data bias, which limits the models’ performance. Moreover, they do not incorporate other modal data (e.g., diagnoses and medications), which also contain a lot of patients’ health state information and can help impute the missing values.
TAME outperforms the baselines for most variables. TAME can handle varying numbers of missing variables with value embedding without any prefilling operation, which avoids the prefilling bias and thus can improve the imputation performance. By removing the value embedding, there is an obvious performance decline of TAME−V compared to TAME. Value embedding also makes it possible to combine multi-modal inputs by mapping all the embeddings into a same space. Note that there isn’t multi-modal data such as diagnoses and medications on the DACMI dataset, and the three versions of TAME only take the single-modal variables data as inputs. By comparing the performance of TAME and TAME−M on MIMIC-III dataset, we find that multi-modal inputs can also improve the imputation results. Moreover, our time-aware attention module explicitly attends the latest observed values, which makes it easier to capture the longitudinal information. Thus compared to TAME−T, TAME achieves better performance.
3.5Sepsis Subtyping
Sepsis subphenotypes are usually identified based on vital signs and lab tests data. Early identification of sepsis subphenotypes is a crucial factor in improving the treatment outcomes. To demonstrate the effectiveness of our early sepsis subtyping framework, we only use patients’ data available up to the first 24 hours in ICUs to impute the missing values and to group patients with the imputed results.
We leverage TAME to impute the missing values and replace them with imputed results. Then, we adopt DTW to compute the patient similarity matrix. Finally, we use a weighted k-means to cluster the sepsis patients into subphenotypes. In this subsection, we conduct experiments to demonstrate whether well-imputed data can help the following subtyping task. Thus, we compare TAME with other strategies to handle missing values: No-Imp (we ignore the variables with missing values when computing patient similarity, and do not impute the values) and Mean-Imp (we impute the missing values with mean values of variables). Moreover, we also compare weighted k-means (wk-means) with the traditional k-means method. Both our framework and baselines adopt DTW to compute temporal similarity for longitudinal EHR data of patients.
K-means based models need a suitable K value when conducting clustering experiments. We group patients into different K clusters and then compute the average P− value for the clustering results. As is shown in Figure 6 in Supplementary Section, K = 4 is the best option. Given the imputed data and K, our clustering results are shown in Figure 4. Because there is no label for the patient subtyping task, we cannot measure the models’ performance with metrics like Rand Index or NMI which require the knowledge of the ground truth classes. We evaluate our framework and the base-lines with two popular metrics Calinski-Harabasz Index (CHI) [4] and Davis-Bouldin Index (DBI) [6], which can measure the performance of clustering algorithms on label-unknown dataset. Note that CHI is related to the size of the dataset, we normalize the value by dividing CHI by the number of the patients. As is shown in Figure 4, TAME & wk-means performs the best, which demonstrates the proposed framework’s effectiveness. TAME based frameworks achieve better performance than other imputation based frameworks, which demonstrates that well-imputed data do improve the patient subtyping outcomes. Moreover, by comparing to the results of k-means based frameworks, the weighted k-means based frameworks’ results show better performance, which demonstrates the effectiveness of the weighted k-means in the sepsis subtyping task.
3.5.1Subphenotypes Analysis
After subtyping the septic patients, we further analyze the subtyping results. All variables used in the clustering method show significant difference across clusters (all P− values < 0.01 and average P− value = 4.1 ×10−5 as shown in Figure 6 (K = 4) in Supplementary Section). The proposed subtyping framework uncovers four subphenotypes with distinct organ dysfunction patterns in septic patients. Following [18], we calculate the Sepsis-related Organ Failure Assessment (SOFA) scores, which are used to describe patients’ organ dysfunction, for the four subphenotypes and overall sepsis population. The details of SOFA computation can be found in Table 6 in Supplementary Section. The characteristics of the subphenotypes are given in Table 3. The subphenotypes have been found to represent the following:
- Minimal Organ Dysfunction: The subphenotype has the most patients, and the lowest SOFA scores and mortality rate.
- Renal Dysfunction: The subphenotype has a higher Renal SOFA score than the average score of the overall septic population.
- CNS & Respiration Dysfunction: The subphenotype has the highest CNS and respiration SOFA scores. The subphenotype’s mortality rate is much higher than the previous two.
- Maximum Organ Dysfunction: The subphenotype has the fewest patients but the highest mortality rate. All SOFA component scores are higher than average SOFA scores.
The four subphenotypes’ ICU mortality rates are shown in Figure 5. The mortality rates vary significantly across the subphenotypes. Minimal Organ Dysfunction and Renal Dysfunction have lower mortality rates (less than 10%), while the other two subphenotypes are related to much higher mortality rates. Most mortality cases suffer mortality in the first two weeks in ICU stays. Especially in the Maximal Organ Dysfunction subphenotype, the mortality rate grows quickly from the first day. Therefore, it is crucial to identify the patients’ subphenotypes in the early stage and assign more precise treatments for them. We further analyze the variables’ distribution across various subphenotypes; the results are shown in Figure 7 in Supplementary Section.
5CONCLUSION
We propose a novel clinical data imputation model TAME and a new patient subtyping framework with DTW and weighed k-means. TAME incorporates multi-modal data as inputs, embeds the variables’ values and time gaps, and introduces a time-aware attention mechanism to generate results for missing values. Our model can handle varying numbers of observed variables in different collections without any prefilling operation and capture the cross-variable, cross-modal, longitudinal information. Based on the well-imputed data, we introduce DTW to compute the temporal similarity matrix. Finally, we present a weighted k-means to group sepsis patients with the similarity matrix and identify four meaningful subphenotypes. The subphenotypes show different organ dysfunction patterns and some subphenotypes have a fast-growing mortality rate in the first one or two weeks. The proposed patient subtyping framework is much useful to identify patient subphenotypes in patients’ early stages of ICU stays, which paves the way for improved personalization of sepsis management.
Data Availability
We used two publicly available datasets: MIMIC-III and DACMI.
ACKNOWLEDGMENTS
The authors would like to thank Dr. Lawrence Lynn and Ms. Raegan Heitzenrater for the weekly discussions of sepsis and their language editing during the preparation of the manuscript. This project was funded in part under a grant with Lyntek Medical Technologies Inc.
7SUPPLEMENTARY SECTION
7.1TAME Model and Availability
Algorithm 1 describes the overall training process of TAME. The codes will be available at Github. Here is the hyperlink3.
Algorithm 1Time-Aware Multi-modal auto-Encoder (TAME)
7.2Statistics of DACMI and MIMIC-III Datasets
7.2.1DACMI Dataset
The 13 variables’ minimums, interquartile ranges, maximums and missing rates on the DACMI dataset are shown in Table 4.
7.2.2MIMIC-III Dataset
We extract the 2 demographics (i.e., age and gender) and 27 sepsis-related variables (i.e., vital signs and lab tests) of the 11,715 sepsis patients, including 41% female and 59% male. The statistics of extracted demographics and variables are listed in Table 5.
7.3SOFA Score Calculation
We use SOFA (Sepsis-related Organ Failure Assessment) score to describe organ dysfunction in septic patients. Following [18], the six organ SOFA scores are calculated as shown in Table 6. Each organ’s SOFA score ranges from 0 (normal) to 4 (most abnormal). The total SOFA score ranges from 0 (normal) to 24 (most abnormal).
7.4K Value Selection for Weighted K-means
After data imputation and patient similarity computation, we adopt weighted k-means to cluster patients into K groups. We conduct experiments with different K and compute the mean P − value for the variables. As is shown in Figure 6, K = 4 is the best option. When K < 4, the average P − value becomes much higher (> 0.01). When K > 4, there isn’t a large decline on average P − value.
7.5Sepsis Subphenotype Visualization
After grouping the septic patients into 4 subphenotypes, we compute the average value of variables across subphenotypes. The average severity scores of different variables are shown in Figure 7. Overall the Maximum Organ Dysfunction subphenotype has the most severe states. The CNS & Respiration Dysfunction subphenotype is related to a severe GCS value, which is consistent with its high CNS SOFA component in Table 3. Renal Dysfunction subphenotype has relatively worse Urineouput and Creatinine, which are related to Renal system. The overall variable severity distribution is identical to the SOFA component scores in Table 3.