Forecasting of Patient-Specific Kidney Transplant Function With a Sequence-to-Sequence Deep Learning Model

Key Points Question Can a deep learning model accurately predict patient-specific estimated glomerular filtration rate (eGFR) ranges? Findings In this diagnostic study in a derivation cohort of 933 single kidney transplant recipients with 100 867 eGFR values and validation cohort of 1170 single kidney transplant recipients with 39 999 eGFR values, a sequence-to-sequence model was able to accurately predict patient-specific eGFR ranges within the first 3 months after transplant, based on the grafts’ previous eGFR values. Meaning Findings of this diagnostic study suggest that the patient-specific sequence predictions could be used in clinical practice to guide physicians to identify deviations from the expected intra-individual variability.

The ARIMA model applies the differencing process d times (a parameter for the differencing order) to handle the non-stationary data. We did the Augmented Dickey-Fuller (ADF) test on the derivation cohort (first 3 months after transplantation) to check the stationarity of each time series. In total, 70% of patients had stationary egfr trajectories. In order to find the optimal model for this dataset, we applied a grid search optimization method to decide the parameters of the ARIMA model, including differencing order d. Firstly, we gave a range of values between 0 and 5 for all parameters. Then the grid search performs exhaustive searching through this subset of the model parameter space. In other words, all possible parameter combinations in that specified range are considered and evaluated. Each combination of parameters is fit to the model and evaluated by RMSE (Root Mean Square Error) values. The final model was chosen with the lowest RMSE. Additionally, the range of (0, 5) was selected due to the increasing RMSE beyond 5. Based on results from grid search, the optimized p, d and q values are: p = 1, d = 0 and p = 0. Differencing order d is selected as 0, which means no differencing needs to be done to this data. This also supports the ADF test result that most of the data are stationary.
Background on RNN, LSTM and GRU and Where ∅ is a nonlinear activation function such as a logistic sigmoid with an affine transformation. Traditionally, a standard RNN computes a sequence of outputs (y1,y2,….yT) by iterating the following equations(50): h t = g(W hx x t + W hh h t−1 ) y t = W yh h t However, many studies have reported the vanishing or exploding gradients problem when using RNNs modelling due to multiplicative gradient exponentially decreasing or increasing in terms of the number of © 2021 Van Loon E et al. JAMA Network Open.
layers(50). Therefore, a Long Short Term Memory (LSTM) unit(19) was developed to solve this problem and this became the most effective method for handling long sequences. LSTM is a more sophisticated activation function with affine transformation followed by a simple element-wise nonlinearity by using gating units. Essentially, LSTM is capable of deciding which information should be remembered or forgotten by the gates. Intuitively, LSTM captures the important features from the input sequence at each stage and remembers this information over a long distance (50).
Recently, a similar model was proposed, Gated Recurrent Unit (GRU)(20) with a more simple structure than LSTM and more efficient computations(51). Therefore, GRU was chosen for this study. GRU is defined by following equations: The most characteristic element of the GRU is (4), where the activation h t j of the GRU at time t is a linear interpolate between the previous activation h t−1 j and the candidate activationh t j . The update gate z t j modulates the interpolation by deciding how much the unit updates its activation (2). The candidate activation h t j is computed similarly to a standard recurrent unit update (3), but includes an additional modulation of a reset gate r t j (1)(50, 52).
2) Sequence to sequence model: Unlike previously developed RNN-based multi-step prediction models, which output only one value per prediction, sequence to sequence (Seq2Seq) models can generate a sequence directly. More importantly, RNN have a significant limitation, requiring the input and output lengths to be known and fixed. Original Seq2Seq model used LSTM to learn to map input sequences with various lengths into a fixed-dimensional vector representation(52). In this work, however, we used GRU to build the model. Preprocessing eGFR values were scaled from 0 to 1 as a preprocessing normalization step.

Encoder-decoder concept:
The Seq2Seq model uses the encoder-decoder concept, where the recurrent encoder encodes the input sequence vector and the decoder uses it for the output sequence generation. Seq2Seq models aim to map an input sequence of vectors X = (x1,…,xN) to the output sequence Y = (y1,…yM). Formally, the encoder reads the input sequence and each RNN cell (i.e. GRU) computes 29 as h t = f(x t , h t−1 ) where x t is the current input, and h t−1 , h t are the previous and the current cell's hidden states, respectively. Then the encoded vector (representation of the input) c is calculated by using all hidden layers of cells. Here we followed the setting from Sutskever et al. 15 : = q(h 1 , … , h N ) = h N Then GRU use the obtained encoded vector c to estimate the conditional probability p(y 1 , … , y M |x 1 , … , x N ) by the following equation: ( 1 , … , | 1 , … , ) = ∏ ( | , 1 , … , −1 ) M t=1 Let us denote each input time series per patient as X = (x1, x2,...,xt), which refers to eGFR measurements from day 1 after transplantation to day t. Then the output time series is denoted as Y = (yt+1,yt+2,..., yt+n), which refers to predicted eGFR values from day t+1 to day t+n. Our proposed Seq2Seq model then maps X to Y directly. During the whole development of the model, the eGFR values from the future were never used to forecast values in the past.

Construction of models with different input and output length
By training 126 models with each a different input and output length, we next evaluated how the forecasting performance evolved with different length of in-and output. Each model with pre-specified inand output consisted of 5-fold trained models, each contributing to a prediction in the forecasting phase and yielding a measure of uncertainty in the predictions1. We translated this uncertainty measure into an interquartile range (represented in a boxplot) for each prediction.

Validation process
First, the GRU Seq2Seq models were cross-validated on the derivation cohort and locked. For the internal validation, we utilized 5-folds cross validation for splitting the total number of patients into a training dataset (80% patients) and testing dataset (20% patients). Before evaluating the performance, the predictions underwent post-processing including removal of imputed eGFR values and inversion of the normalization, in order to adequately compare with the observed eGFR values. The performance of the models was evaluated using RMSE for each-fold-trained model between each predicted eGFR value from the output sequence and the real measured eGFR on the same day. The final Seq2Seq model performance was obtained by averaging the results of those 5-fold-trained models. In the second step, the 5 trained and locked models were applied to the independent test cohorts. Each forecasting sequence contained 5 candidates (from 5-fold-trained models), which were used to calculate the mean and median of the candidate sequence predictions and for subsequent RMSE estimations.

Extension beyond 3 months
For testing the accuracy of the GRU Seq2Seq model beyond 3 months post-transplant, we trained new models for longer term input and output sequences of the derivation cohort, using a smaller batch size (m= 32, compared to m= 256 for the 3 months model), but with unaltered model architecture, again using 5-fold cross-validation. Similar to the short-term input and output length models, model accuracy beyond 3 months was assessed by calculating RMSE between each predicted eGFR value from the output sequence and the real measured eGFR on the same day.