Additional file 1 of Deep learning model using continuous skin temperature data predicts labor onset
Creators: name: Basavaraj, Chinmai
name: Grant, Azure D.
name: Aras, Shravan G.
name: Erickson, Elise N.
Publisher: name: figshare
Year: 2024
Subjects: subject: Medicine
subject: Cell Biology
subject: Physiology
subject: FOS: Biological sciences
subject: Ecology
subject: Sociology
subject: FOS: Sociology
subject: Biological Sciences not elsewhere classified
subject: Developmental Biology
subject: Science Policy
subject: Infectious Diseases
subject: FOS: Health sciences
subject: Computational Biology

description: Supplementary Material 1: Supplemental Figure 1. Data Preprocessing and Cleaning. Pre-Processing and Cleaning: data ingestion (A) and pre-processing pipelines (B). A): De-identified biomarker data from Ouraring, including high fidelity temperature and IBI are ingested into a campus secure Amazon Web Services (AWS) S3 bucket indicated by (1). Data is then parsed to generate structured schema, table meta-data in AWS glue, and participant partitions (to accelerate querying of per minute temperature data). These are then fed into a serverless querying solution provided by AWS Athena as shown by (2). B) We pass the raw minute temperatures from the device through pre-processing steps. First, we average the raw values over a 5-minute window, segment it into 24-hour periods starting at 10am each day, which allows the neural network model to learn from daily patterns (both day and night variation). Next, we remove data collected by the ring during non-wear time by using the 5 min activity labels provided by the ring, indicating wear/non-wear. Finally, we employed linear interpolation to account for missing and non-wear daily data. The final output is fed to a DNN model. Supplemental Figure 2. Autoencoder Structure. Supplemental Figure 2. Auto encoders are divided into 2 parts – encoder and decoder. The encoder is responsible for converting values from feature space to latent space, while the decoder is responsible for converting them back to the feature space. AE train in an unsupervised setting where the object loss function MAE, measures the loss of reconstructing the original signal from the latent representation. In the encoder part of the AE, Input data of size 288 is fed into a series of three convolutional blocks. Each convolutional block comprises of a 1-D convolutional layer coupled with a max-pooling layer that enables reduction in data dimensionality. Output from the final convolutional layer is flattened and fed into a dense fully connected layer to produce the encoded representation. The decoder is a mirror image of the encoder. In the case of the decoder, the max-pooling layer is replaced by an up-sampling layer that gradually increases the dimensionality back to the original feature space. Supplemental Figure 3. Long Short-Term Memory Model Structure. Supplemental Figure 3. LSTM Stage (establishing the sequential relation): The LSTM model takes a sequence of 64-dimensional encoded vectors that represent daily skin temperature as input, and outputs days till labor relative to the current gestational age. We use zero-padding to conform the input sequences to a uniform length and the masking layer excludes zero values during analysis. The output of the masking layer is fed into an LSTM layer that is recurrent in nature. The LSTM layer has 128 units, and we use tanh as the activation function. We use layer normalization102 to normalize each output of the LSTM layer. Layer normalization reduces the dependency on batches, improves model performance, and is best suited for sequence-to-sequence models. Finally, the layer normalized output of the LSTM layer is fed into a dense layer with 128 units and linear activation function to output the days remaining to labor relative to current gestational age. Supplemental Figure 4. Spontaneous Labors Progesterone and Estrogen Metabolites Decrease in the 10 Days Prior to Labor Onset. Supplemental Figure 4. Group means ± SEM of normalized hormone concentrations in the 10 days leading up to spontaneous labor onset (n =18). Estrogens, as well as α- and β-pregnanediol decreased across the 10 days prior to labor onset (# = p&lt;0.05 in Mann Kendall trend over time), a trend which disappeared or even reversed in the 2 days prior to labor onset (n.s.). Supplemental Figure 5. Model Error Is Reduced Compared to Traditional Due Date Error Across Individual Spontaneous Labors. Supplemental Figure 5. Spontaneously laboring mothers’ due date error in weeks (dark blue, left pointing bars), compared to the error in weeks of the model-estimated due date (light blue, right pointing bars) one week prior to labor onset. Participants are sorted from smallest traditional due date error to largest. 84% of participants would have had lower error in due date prediction under the current model compared with their standard due date. Traditional due date error in this cohort was 6.3 days +/- 4.3 days (95% C.I.) as compared to 0.7 +/- 2.1, corresponding to an error rate 5.2x higher using traditional due dates. Supplemental Figure 6. Spontaneous Individual Skin Temperature Trajectories. Supplemental Figure 6. Spontaneous individually z-scored temperature trajectories across the last two weeks of pregnancy. Participant ID and model error are displayed in the title for each individual. Supplemental Figure 7. Spontaneous Model Performance Differs by Parity, but Not by BMI or Maternal Age Category. Supplemental Figure 7. Error distribution leading up to labor onset compared by maternal parity (nulliparous n =23 vs. multiparous n =28), BMI (overweight n =15 or not overweight n =36), and age (&lt;35 n=38 or &gt;=35 n=13) mean +/- 95% confidence interval. Mean value differs between nulliparous and multiparous on average from days 28 to 14 before labor (p=0.02). Supplemental Figure 8. Replacing Different Portions of Input Data With Zeros Reveals That Model Learns Relatively More From Final Days of Temperature Data Before Labor Onset. Supplemental Figure 8. In order to evaluate what portions of temperature timeseries were most impactful on model prediction quality, and to test that the model was not hallucinating, we ran our trained model on data modified as follows. A) Mean model performance in spontaneous labors (black), compared to model performance on data sets in which all data are flatlined (replaced with zeros, dark blue), in which the first 10 days are flatlined (red), in which the last 5 days are flatlined (green), or in which a random 10 days are flatlined (light blue). All flatlined results exhibit substantially higher error, with the last 5 days seeming to be especially important for model performance. B) Mean model performance when different segments of data were replaced with Gaussian noise (rgaussian). First 10 refers to the first 10 days of data (red), last 5 refers to the last 5 days before labor onset (green), and random 10 refers to a random set of days (light blue). C) Mean model performance when existing data has gaussian noise added to it during all days (dark blue), the first 10 days (red), the last 5 days (green) and a random 10 days (blue). The error trajectories demonstrate that our model is resilient to noise with a slight increase in labor prediction error with introduction of gaussian noise. Error trajectories demonstrate what the LSTM has “learned” independent of input data, but that modifying or removing data reduces accuracy.