Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Optimizing postprandial glucose prediction through integration of diet and exercise: Leveraging transfer learning with imbalanced patient data

  • Shinji Hotta ,

    Roles Conceptualization, Data curation, Formal analysis, Investigation, Methodology, Software, Validation, Visualization, Writing – original draft

    hotta_s@fujitsu.com

    Affiliations Department of Computer Science, Aalto University, Espoo, Finland, Fujitsu Limited, Kawasaki, Japan

  • Mikko Kytö,

    Roles Data curation, Project administration, Resources, Writing – review & editing

    Affiliations IT Management, Helsinki University Hospital, Helsinki, Finland, Department of Computer Science, University of Helsinki, Helsinki, Finland

  • Saila Koivusalo,

    Roles Conceptualization, Funding acquisition, Resources, Writing – review & editing

    Affiliation Shared Group Services, Helsinki University Hospital, University of Helsinki, Helsinki, Finland

  • Seppo Heinonen,

    Roles Conceptualization, Funding acquisition, Writing – review & editing

    Affiliation Department of Obstetrics and Gynecology, Helsinki University Hospital, University of Helsinki, Helsinki, Finland

  • Pekka Marttinen

    Roles Conceptualization, Funding acquisition, Methodology, Project administration, Resources, Supervision, Visualization, Writing – review & editing

    Affiliation Department of Computer Science, Aalto University, Espoo, Finland

Abstract

Background

In recent years, numerous methods have been introduced to predict glucose levels using machine-learning techniques on patients’ daily behavioral and continuous glucose data. Nevertheless, a definitive consensus remains elusive regarding modeling the combined effects of diet and exercise for optimal glucose prediction. A notable challenge is the propensity for observational patient datasets from uncontrolled environments to overfit due to skewed feature distributions of target behaviors; for instance, diabetic patients seldom engage in high-intensity exercise post-meal.

Methods

In this study, we introduce a unique application of Bayesian transfer learning for postprandial glucose prediction using randomized controlled trial (RCT) data. The data comprises a time series of three key variables: continuous glucose levels, exercise expenditure, and carbohydrate intake. For building the optimal model to predict postprandial glucose levels we initially gathered balanced training data from RCTs on healthy participants by randomizing behavioral conditions. Subsequently, we pretrained the model’s parameter distribution using RCT data from the healthy cohort. This pretrained distribution was then adjusted, transferred, and utilized to determine the model parameters for each patient.

Results

The efficacy of the proposed method was appraised using data from 68 gestational diabetes mellitus (GDM) patients in uncontrolled settings. The evaluation underscored the enhanced performance attained through our method. Furthermore, when modeling the joint impact of diet and exercise, the synergetic model proved more precise than its additive counterpart.

Conclusion

An innovative application of the transfer-learning utilizing randomized controlled trial data can improve the challenging modeling task of postprandial glucose prediction for GDM patients, integrating both dietary and exercise behaviors. For more accurate prediction, future research should focus on incorporating the long-term effects of exercise and other glycemic-related factors such as stress, sleep.

Introduction

The global incidence of diabetes is on the rise, accompanied by escalating severity. This progression entails detrimental ramifications including compromised quality of life (QoL), multifarious complications, and costly surgical treatment. Projections indicate a staggering $2.5 trillion global expenditure on diabetes-related medical costs by 2030 [1]. In light of this, there is an imperative to curtail these expenses while ameliorating QoL by proactively mitigating diabetes severity.

Recent national clinical guidelines [2] underscore a fundamental tenet of preventive intervention: the maintenance of blood glucose levels within the normative spectrum. A pivotal approach to achieving this control involves adopting a balanced lifestyle encompassing dietary measures, physical activity, and insulin therapy. Technological strides in continuous glucose monitoring (CGM) apparatus have empowered patients in managing glucose levels via mobile applications in the comfort of their homes, facilitating self-care [3, 4]. However, mastering optimal behavioral adjustments for maintaining normoglycemia remains a challenge for patients [5]. Hence, a personalized framework is imperative, one that tailors recommendations for optimal individual behaviors, thereby ensuring the trajectory of future blood glucose levels aligns with the norm. This ambition necessitates the precise anticipation of how behavioral modifications will influence forthcoming blood glucose dynamics.

To date, various data-driven techniques for predicting glucose, incorporating behavioral factors, have emerged [6, 7]. Prior literature primarily focused on dietary and exercise facets, employing time-series machine learning models like the autoregressive model [8] and long short-term memory (LSTM) [9] for glucose forecasting. Independent positive impacts on predictive accuracy have been demonstrated for dietary and exercise factors [7]. Yet, the synergy between these factors in achieving optimal prediction remains understudied. Recent clinical investigations [1014] have illuminated that strategic synchronization of diet and exercise, such as moderate postprandial exercise, holds potential for further glucose reduction across diabetes profiles. However, the translation of these discoveries into predictive glucose modeling has remained uncharted.

When considering the amalgamation of multiple behaviors, a critical hurdle is sidestepping overfitting in learning from an imbalanced patient dataset collected in unconstrained settings. Taking the instance of diet and exercise integration, the frequency of intermediate-level post-meal exercise tends to be notably lower than that of minimal or no post-meal exercise among gestational diabetes mellitus (GDM) patients leading their daily lives [15]. Consequently, an accurate estimation of the combined impact of postprandial exercise and diet becomes challenging due to sparse data on high-intensity postprandial exercise.

In recent years, an innovative solution has emerged to tackle data imbalance concerns by harnessing extensive patient data through transfer learning techniques [9, 1618]. This strategy thrives when the feature distributions of other patient data exhibit a range of values. Yet, when feature distribution across all patients is markedly imbalanced, the risk of extracting and transferring inaccurate insights escalates.

This paper proposes a novel application of the transfer learning for glucose prediction (Fig 1), which harmonizes the distribution of behavioral features by synergizing with supplementary intervention data from a randomized controlled trial (RCT). This harmony is instrumental in the predictive modeling of postprandial glucose involving dietary and exercise variables. The method commences with an RCT, where behavioral conditions are randomized for a healthy cohort, amassing data with a balanced distribution. Subsequently, Bayesian parameter learning is executed on the prediction model utilizing the RCT data, yielding a dependable parameter distribution. Ultimately, this pre-trained distribution is judiciously rescaled and employed as a prior for each patient’s parameter learning utilizing observational data from real-world scenarios. This ensures a robust knowledge transfer from the RCT domain, curtailing overfitting risks inherent in imbalanced patient data. Empirical validation underscores the efficacy of this method, as evidenced by enhanced prediction performance in postprandial glucose prognosis using an authentic GDM patient dataset.

thumbnail
Fig 1. Overview of proposed application of transfer learning.

https://doi.org/10.1371/journal.pone.0298506.g001

Related work

A. Integrative glucose prediction with diet and physical activity

Numerous machine learning techniques incorporate dietary and exercise factors to anticipate blood glucose levels. Jankovic et al. [8] and Xie [19] introduced an autoregressive model, wherein carbohydrate intake influences and muscular energy expenditure-driven exercise effects independently impact glucose levels. Likewise, support vector regression [20] and a physiological model [21] have been advanced for glucose prediction by integrating time-varying dietary and exercise influences, as computed through ordinary differential equations.

However, these methodologies entail training predictive models using individual patient historical data collected in unconstrained settings. Yet, these uncontrolled data settings introduce model misspecifications. This stems from the inherent imbalance in dietary or exercise feature distribution, attributed to each patient’s distinct and established lifestyle. Consequently, limitations in data volume per patient compound the issue.

B. Glucose prediction with transfer learning

The primary hurdle in blood glucose level prediction lies in the scarcity of both the quality and quantity of patient data necessary for robust model training. Particularly, sophisticated deep learning techniques demand substantial training data volumes. In recent times, various strategies employing transfer learning to address this challenge have emerged. Transfer learning endeavors to construct an apt model for a target domain (referred to as a target task) by extrapolating model knowledge acquired from other domain datasets (termed source tasks) [22, 23].

For instance, Faruqui et al. [9] suggested an approach entailing initial model learning using population data from a patient group as a source task, followed by transferring the model for individual patient-specific learning. Other studies have filtered a subset of population data based on its resemblance to a target patient, employing it as training data for either a source task [9] or a target task [17]. Furthermore, to facilitate knowledge sharing among patients, a multitasking learning strategy [24] was proposed, addressing individual model learning for all patients in parallel. Additionally, for harnessing data from diverse patient groups, adversarial transfer learning [16] was proposed, which pre-aligns feature presentations between patient groups.

Diverging from these approaches, the introduced method (Fig 1) takes a distinct stance. Primarily, while prevailing methods seek to augment individual data volume by integrating other patient data, our approach focuses on enhancing observational data quality through leveraging data from randomized controlled trials (RCTs). Secondly, our method stands apart by proactively intervening to procure high-quality data, with experimental conditions randomized based on the target model structure intended for learning.

Methods

In this section, we elucidate the problem’s context, expound on the modeling of dietary and exercise impacts for postprandial glucose prediction, and subsequently detail the implementation of transfer learning utilizing the RCT dataset.

A. Problem setting

We aimed to develop a predictive model that integrates the intertwined influences of both diet and exercise. Consequently, our study concentrated on forecasting postprandial glucose levels within the context of concurrent dietary and exercise effects on blood glucose. The anticipation of postprandial glucose levels assumes paramount significance in furnishing optimal behavioral suggestions, given the consistent post-meal surge in glucose levels, prone to deviations from the norm [25, 26].

Consider now postprandial glucose levels with regard to the patient’s diet. When the start time of the diet is τ*, the target postprandial glucose level is represented as time series of the target patient. Because the glucose level within 1 h after a diet is of clinical importance, we set T = 90 min. In addition, it is well known that carbohydrate intake (CI) increases glucose, energy expenditure (EE) from exercise lowers glucose immediately, and the features of CI [27] and EE [8] perform well for glucose prediction. Suppose, we have three types of observation variables from the patient: (i) the glucose level history before the diet , (ii) the CI sequence x1:M from the diet and the corresponding intake timing sequence , and (iii) the EE sequence z1:N from an exercise around a diet and the corresponding exercise timing sequence . N and M denote the number of carbohydrate intakes and exercises, respectively, within one diet. Accordingly, as illustrated in Fig 2, we aim to solve a time-series regression problem to predict the target variable from observable variables . In the following part, these observable variables are represented without the subscript such as respectively.

thumbnail
Fig 2. Illustration of each variable for predicting postprandial glucose.

https://doi.org/10.1371/journal.pone.0298506.g002

B. Bayesian predictive model for postprandial glucose

Our model is based on an interpretable Bayesian regression model, as shown in Fig 3. This preference is rooted in the model’s inherent transparency and traceability in contrast to complex machine learning constructs like LSTM. This transparency holds paramount significance in ensuring effective quality control for the model’s real-world applications.

thumbnail
Fig 3. Graphical model of postprandial glucose.

Parameter sets of both healthy group and patient group are estimated separately with this same model.

https://doi.org/10.1371/journal.pone.0298506.g003

Following this approach, our model is based on a cutting-edge Bayesian model for glucose prediction [28], wherein forthcoming blood glucose levels are prognosticated as a summation of the time-series response under a treatment—like carbohydrate intake—and a baseline glucose level, with Gaussian noise introduced. Our study delves into two variants: an additive model and a synergistic model, both designed to account for combined effects. In the former, dietary and exercise responses are discretely generated and linearly aggregated, aligning with preceding research [8, 19]. Conversely, the latter model embraces interdependency between dietary and exercise responses in a synergistic manner. This is substantiated by contemporary medical insights that highlight how the impact of postprandial exercise on glucose reduction is contingent upon carbohydrate intake levels [29] and the elevation in postprandial blood glucose [30]. Our supposition in the synergistic model postulates that such interactive impacts manifest through the multiplication of dietary and exercise effects. Furthermore, for performance benchmarking, we also explore a solitary-effect model relying solely on dietary effects, as previously addressed [28].

Specifically, the single-effect, additive-effect, and synergetic-effect models are represented by the following equations: (1) (2) (3) where , and are time series, and ybase represents the baseline blood glucose level, excluding the effects of diet and exercise. Since the time range for focusing on postprandial blood glucose is quite short, we assume that ybase is constant and substitute the median value of the history of preprandial blood glucose from 15 min before the meal. indicates the dietary effect of increasing glucose levels, and indicates the exercise effect of decreasing glucose levels. e represents the level of noise and we assume this follows N(0,σ). Fig 3 shows a graphical representation of the synergistic model.

Furthermore, and are represented as time-series responses to each CI or EE treatment. These responses appear after the initiation of a dietary or exercise event, and these effects diminish over time. We assume that this process, wherein the effects increase and then decrease over time, can be represented by the bell-shaped function, following the literature [28]. Additionally, considering the real-world scenarios where patients occasionally have successive meals within 90 min and often perform postprandial exercise multiple times, and are modeled as the summation of responses for multiple treatments in the same way as below. (4) (5) where N and M denote the numbers of meals and exercise sessions, respectively. Here, we adopt a bell-shaped function as the response function, following [28], because of its interpretability and smaller number of parameters. In this function, τx,i and τz,j represent the times when CI and EE start to occur, respectively. In addition, the functions are amplified by the treatment dose, that is, the amount of CI (xi) of i-th intake or the amount of EE (zj) of j-th exercise, for each. βd and βe are parameters representing the strength of the above amplification for each treatment dose, while αd and αe are parameters representing the response speed to each treatment. Examples of and are shown in Fig 4. Furthermore, to enable synergistic effect model in Eq 3, we introduce the adjustment parameter C for weighting the synergetic effect represented by , where means the element-wise product.

thumbnail
Fig 4. Illustration of dietary response (left) and exercise response (right) to glucose level.

https://doi.org/10.1371/journal.pone.0298506.g004

Each of these parameters is person-specific. We postulate that individuals within the healthy group demonstrate similar dietary and exercise effects, and the same principle applies to the patient group. Accordingly, we introduce a hierarchical prior distribution of person-specific parameters, enabling stable parameter learning by sharing parameter knowledge across individuals within each group. We assume this hierarchical prior follows Gaussian centered on for an additive model and for a synergetic model, given that we have no specific knowledge regarding the prior. These hyperparameters are common to each person in the same group (healthy or patient group) and are learned for each group, as shown in Fig 3.

C. Bayesian transfer learning with prior rescaling from RCT data

Free-environment patient data are imbalanced in the distribution of the amount of each treatment (e.g., moderate-intensity exercise after a diet is significantly infrequent), which causes overfitting of the above hyperparameter set . To address this challenge, in our proposed method, a hyperparameter set of patient group domain is learned through transfer learning with RCT data actively collected from healthy group domain.

Initially, we direct our attention towards enlisting healthy individuals as participants for the randomized controlled trial (RCT). This choice stems from their comparative acceptability to be intervened owing to fewer underlying health issues. To achieve balanced dose distributions for each treatment, data collection is structured to randomize treatment conditions systematically. Following this, leveraging the distributional insights garnered from the acquired RCT data, we facilitate effective learning within the patient group domain by applying and adapting the knowledge embedded in the learned hyperparameter set.

In addition, our target parameters of knowledge transfer are limited to only the exercise-related hyperparameter set from a set of , because the principle of the dietary effect to increase glucose differs between the diabetic group and the healthy group due to the significant difference in insulin sensitivity. In our RCT, we control only for the amount of exercise after the diets for each participant in the healthy group. The experimental procedure is described in the next section.

Based on the above premise, in the context of transfer learning, our source task is to learn the exercise-related hyperparameter set in the healthy group domain with interventional data under RCT, and our target task is to learn the hyperparameter set in the diabetic group domain with observational data under free environments.

In this study, we adopt a comprehensive framework for prior rescaling as introduced by Xuan et al. [22] in the context of Bayesian Transfer Learning (BTL) [22, 23]. This framework entails learning the probability distribution of parameters within the source task, subsequently rescaling this learned distribution, and employing it as an informative prior within the target task, as depicted in Fig 5(b). Pertaining to this rescaling process, a technique [31] was put forth, specifically addressing the scaling of variance parameters using pre-estimated coefficients for the target task, while preserving the mean parameter. Notably, adapting this framework to our specific challenges presents intricacies. To elucidate, the influence of exercise on glucose dynamics within the healthy cohort might diverge from that within the diabetic group. Evidently, differences in the efficacy of glucose uptake in leg muscle tissues between healthy and diabetic groups emerge [32]. Consequently, this underscores the need for a mean parameter shift operation for our cross-domain prior to rescaling.

thumbnail
Fig 5. Extension of transfer learning framework.

In each transfer method, only relationships between variables represented as bold line are used for parameter learning.

https://doi.org/10.1371/journal.pone.0298506.g005

In this context, we propose extending the general framework to robustly shift the mean of the pretrained distribution of the parameter set based on clinical domain knowledge in prior rescaling, as shown in Fig 5(c). We aim to realize the distribution shift by introducing a new adjustment parameter η to modulate the mean of the parameter representing the strength of the exercise effect on the glucose trajectory. For this, η = 0.5 is suitable because the experimental results in the Ref. [32] show that the glucose uptake efficiency of the leg muscle in the diabetic group was about half that of the healthy group. η for the other exercise effect parameters and in are assumed to 1. Furthermore, another adjustment parameter λ is introduced to robustly stabilize this distribution shift in the actual training process, and this parameter λ is used to reduce the variance of each parameter. Adding this control prevents the overfitting triggered by imbalanced exercise data in the target domain. To manage the uncertainty in setting η and λ, we introduce hyperpriors for these parameters. We then use Hierarchical Bayesian estimation with the patient dataset to determine their optimal values. Based on this, prior rescaling for the target parameter set in the target task is represented by the following equation: (6) (7)

The parameter set follow Gaussian distribution with a diagonal matrix Σ where a variance for each parameter element is independent of each other. And we assume η follow Gaussian hyperprior where mean parameters correspond to 0.5 for and 1 for others. Also, we assume λ follow Gaussian hyperprior with setting mean parameter to 0.1 respectively. The learning process for practical parameter learning is performed in two steps. The first step is we pre-train Gaussian parameters for the distribution of with RCT data in the source task. The second step is we rescale this estimand as in Eq 7, and then we perform learning all hyperparameter sets with observational patient data, in conjunction with learning individual parameters for each diabetes patient. These parameter learnings are performed by executing a Markov Chain Monte Carlo (MCMC) simulation with the No U-Turn Sampler implemented in RStan [33]. The details of the simulation and the model assumptions are described in the ‘Experimental setup E’ subsection.

Experimental setup

This paper addresses two pivotal research questions.

  1. How should the utilization of an RCT dataset for transfer learning be structured to acquire a predictive glucose model from an imbalanced patient dataset?
  2. How can the fusion of diet and exercise be effectively modeled to optimize the prognostication of postprandial glucose levels?

To answer these questions, we built multiple patterns of predictive models with multiple patterns of transfer learning and compared their performance based on dedicated metrics using a real-world clinical dataset of GDM patients.

A. Evaluation policy

First, for question (i), we compared the performance of each predictive model built with and without normal or extended transfer learning described in ‘Methods B’ subsection. Second, for question (ii), we evaluated and compared the performance of the single effect model [28], the additive model, and the synergetic model described in ‘Methods A’ as a predictive model. Finally, we compared the performance of the following seven models:

  • : Single-effect model
  • : Additive model without transfer learning
  • : Synergistic model without transfer learning
  • : additive model with normal transfer learning
  • : Synergistic model with normal transfer learning
  • : additive model with extended transfer learning
  • : Synergistic model with extended transfer learning

In cases without transfer learning, we substituted a non-informative prior for the hyperparameter set . Notably, for any model pattern, knowledge of exercise-related parameters is still shared among all patients in learning through the hierarchical prior (‘Methods A’ subsection). Furthermore, note the additive model has limited exercise-related parameters which are a subset of the parameters of the synergetic model (See Eqs 2 and 5).

B. Clinical data

The clinical data used for our performance evaluation were from a real-world free-environmental dataset of 72 patients with GDM, including continuous glucose levels, physical activity levels, and dietary records. This dataset, sourced from real-world environments, emerged from a clinical trial orchestrated by the authors [5]. This trial was granted ethical sanction by the Ethics Committee of Helsinki and the Uusimaa University Hospital District. The recruitment effort targeted patients (aged 18 to 45 years) with GDM within the gestational window of 24–28 weeks, sourced from maternity clinics in the Helsinki metropolitan area between March 10 in 2021 and December 12 in 2022. The exclusion criteria for this recruitment were as follows: type 1 or type 2 diabetes, physical disability, use of medication that influences glucose metabolism, multiple pregnancy, current substance abuse, severe psychiatric disorder, significant difficulty in cooperating [5]. Written informed consent was obtained from all patients, and from both parents on behalf of the infant. Data acquisition occurred across 3-day intervals in monthly sessions leading up to childbirth. It’s important to note that this analysis represents a secondary examination of the eMoM GDM study [5].

Throughout each session, a continuous glucose monitoring (CGM) system (Guardian Connect System, Medtronic Ltd.) facilitated 5-minute interval glucose tracking for every patient, illustrated in Fig 6. Concurrently, data related to physical activity were collected through a wrist-worn activity tracker (Vivosmart3, Garmin International Ltd.). Energy expenditure during exercise was automatically computed via the tracker. Dietary information encompassed nutrient quantities, including carbohydrate intake (CI), ingested at each temporal juncture, sourced from patients’ manual food logs via a food tracking application developed by Helsinki University Hospital. Nutritional data integrity was fortified through nutritionist validation calls. Further information on the experimental protocol can be found in [5].

thumbnail
Fig 6. Demonstration of train and test data in a 3-days session.

https://doi.org/10.1371/journal.pone.0298506.g006

C. Preprocessing

Given our focus on postprandial blood glucose as the prediction target, we partitioned the continuous glucose data and accompanying variables around each mealtime, as depicted in Fig 6. Each segment encompassed a time span of 15 minutes preceding a meal, extending to 90 minutes post-meal. Segments with absent continuous glucose data were omitted from analysis, leading to the exclusion of 4 patient datasets. As a result, 1619 segment of data were obtained from 68 patients. Subsequently, the segment data in the first two days of each session were used as the training data , and the segment data in the last day were used as the test data . The predictive model was trained in each session and its evaluation was performed within that session. This is because the segment data of the next month’s session are heterogeneous from that of the current month, as the condition of a pregnant woman changes drastically after one month, even for the same individual [34].

D. Randomized controlled trial

The RCT data for our source task were collected from additionally recruited 4 healthy subjects (Aalto University students) in a six-days session with the same data collection as that in the clinical trial. The recruitment period was from February 1 in 2023 to April 30 in 2023. Written informed consent was obtained from all the participants for data collection and utilization. The purpose of the RCT was to obtain a segmented dataset in which the distribution of EE during postprandial exercise enables robust learning of the exercise-related parameter set . Therefore, the postprandial exercise conditions during data collection were randomized for each participant. In practice, the subjects were instructed to follow different conditions, as follows (See Fig 1).

  • Low-intensity condition (Day 1 & Day 4)
    • Eat almost same amount of carbohydrate at lunch (or dinner)
    • Don’t perform an exercise until two hours after eating.
  • Moderate-intensity condition (Day 2 & Day 5)
    • Eat almost same amount of carbohydrate at lunch (or dinner)
    • 30 minutes after starting eating, walk continuously at a pace of 100 step/min for 20 minutes.
    • After walking, don’t perform an exercise until two hours after eating.
  • High-intensity condition (Day 3 & Day 6)
    • Eat almost same amount of carbohydrate at lunch (or dinner)
    • 30 minutes after starting eating, walk continuously at a pace of 130 step/min for 20 minutes.
    • After walking, don’t perform an exercise until two hours after eating.

The above exercise conditions were designed based on clinical findings of the effect of exercise on glucose. Specifically, according to the literature [35], the appropriate timing of exercise for decreasing blood glucose was reported to be 30 min after the start of meals, when the exercise content was continuous walking for 20 min.

While the exercise condition differed between the days, the dietary condition was controlled to be the same for all days for each subject, as shown in Fig 1. This is because by equalizing the dietary effect on postprandial glucose among all days in a subject, the learning of targeted exercise parameter sets can be facilitated more in our source task. Additionally, the participants were asked to choose breakfast or lunch as the target diet for each day.

The RCT and data preprocessing resulted in 24 segments of data . Fig 7 shows the actual distribution of the EE in the interventional RCT and observational GDM datasets. Fig 7(a) reveals a pronounced imbalance in the feature distribution of postprandial exercises among 68 GDM patients observed over 18 days. Fig 7(b) confirms lesser imbalance in the distribution from the RCT dataset compared to that from the GDM dataset.

thumbnail
Fig 7. Actual distribution of energy expenditure (EE) in postprandial exercise.

https://doi.org/10.1371/journal.pone.0298506.g007

E. Parameter learning and prediction

The posterior of the overall parameter sets involved in each model among the seven patterns was estimated by MCMC simulation using both the observational training data of the GDM group and the interventional RCT data of the healthy group. Subsequently, we obtained the point estimation values which are a set of a posteriori medians for each parameter for each patient. Then, the predicted future postprandial glucose trajectory was obtained by applying the model embedded with to the observed variable values in the test data of the GDM group.

Here, we delineate the assumptions underpinning our Bayesian models. All models outlined in the ‘Experimental setup A’ subsection incorporate person-specific parameters, αd and βd, of the dietary response function (Eq 4). The prior distributions for these parameters were set as and , respectively. The value of the variance parameter was determined based on the outcomes of learning the parameter distribution using an identical model in the literature [28]. Additionally, the priors of hyperparameters and adhered to a uniform distribution. Conversely, we lack prior knowledge of our original parameters αe, βe, and C in the exercise response function (Eqs 3 and 5). As a result, we employed entirely uninformative distributions for αe, βe, C, and their hyperparameter sets Θe, μe, Σe in both the source and target tasks (Fig 5). For instance, the prior distribution of αe was set as , and was intended to follow a uniform distribution.

In order to diagnose the convergence of parameter learning with MCMC, we employed the Gelman-Rubin diagnostic [36]. We executed multiple MCMC chains, compared the variance both within and between these chains, and computed the Gelman-Rubin statistic () as the convergence indicator, for all the parameters. The estimation was performed by setting the number of MCMC chains to four, the number of sampling iterations to 4000, and the burn-in period to 2000 iterations.

F. Metrics

The most important evaluation criterion is the extent to which the predicted glucose series is coincident with the actual observation series y. Therefore, we evaluated (1) the root mean squared error (RMSE) of the predicted series and (2) the mean absolute error (MAE). Additionally, we evaluated the degree of coincidence of (3) the area under the curve (AUC) and (4) the postprandial maximum value of the glucose series because these are well-known glycemic indicators for diabetes research [37].

  1. (1)
  2. (2)
  3. (3)
  4. (4)

After calculating each metric following the above equations for all segment data included in the test data , the average of the metric values among all segments was used as the final metric score.

Result

Table 1 presents the conclusive average metric scores for each model across segments both with and without postprandial exercise. Within this context, an exercise segment is delineated by an energy expenditure (EE) exceeding 60 kcal. Focusing initially on segments involving postprandial exercise, we observe that the synergetic model, trained through extended transfer learning with RCT data, achieves the highest performance. Additionally, the augmentation of performance is evident across both the additive and synergetic models due to extended transfer learning, affirming its efficacy. Notably, this enhancement is particularly pronounced in the synergetic model, attributed to its more intricate model structure. Conversely, across segments devoid of postprandial exercise, the metrics remain largely consistent across all models. This consistency aligns with expectations, given that the exercise effect (Re) within the additive or synergetic model approximates zero in the absence of postprandial exercise. Consequently, the forecasted glucose trajectory converges with that of the single model (Eqs 13).

The variations in the projected glucose trajectory by the synergetic model for each training scheme are depicted in Fig 8. Instances of (a) no transfer and (b) regular transfer reveal discrepancies between the projected value (dark pink line) and the actual value (black dot). This discord stems from an overestimation of the exercise effect, which hampers the glucose response induced by diet (light pink line) subsequent to exercise events (green bar). In contrast, Fig 8(c) showcases the efficacy of extended transfer learning, encompassing a distributional shift from the RCT dataset. This approach ensures an appropriately calibrated exercise effect in terms of intensity and timing, consequently yielding ameliorated prediction errors.

thumbnail
Fig 8. Difference in predicted glucose trajectory with each training pattern.

https://doi.org/10.1371/journal.pone.0298506.g008

Furthermore, Fig 9 illustrates instances of projected trajectories by the single, additive, and synergetic models. Notably, the glucose surge projected by the single model (a) exhibits a pronounced delay compared to the actual rise. This delay is likely attributed to overfitting of dietary parameters due to the omission of the exercise effect. Contrastingly, the combined models (b) and (c) aptly replicate the glucose elevation, demonstrating their success in addressing this aspect.

thumbnail
Fig 9. Examples of trajectory predicted by each glucose model.

https://doi.org/10.1371/journal.pone.0298506.g009

These results demonstrate the effectiveness of our application methodology of transfer learning framework with RCT data and the synergistic modelling of dietary and exercise effects on glucose.

Discussion

An intrinsic strength of the proposed methodology lies in the transparency and visibility of the trained models and their parameters, as depicted in Fig 3. This transparency facilitates seamless incorporation into the formulation of personalized behavioral recommendations for individual patients. Moreover, the integration of transfer learning with randomized controlled trial (RCT) data notably amplifies this capability by refining model parameters with heightened precision. For example, if the absolute value of exercise parameter βe in Eq 5 is estimated to be small in some patients, the exercise effect is not likely to appear easily, implying that recommendations regarding postprandial exercise should be of moderate (or higher) intensity. Here, Fig 10 shows actual examples of the posterior of the parameter βe estimated for each healthy participant on the top and each patient on the bottom. As the example in Fig 8 belongs to patient P1 in Fig 10, we can confirm the overestimation of βe from Fig 10(a) and 10(b) at the bottom. In the context of practical recommendation scenarios, this tendency results in excessively optimistic and potentially detrimental suggestions, assuming a minor exercise could significantly enhance the patient’s glucose profile. Yet, as depicted in Fig 10(c), this misalignment is rectified through extended transfer learning, facilitated by prior rescaling via the incorporation of shifting and shrinking operations outlined in Eq 7. This underscores the efficacy of the proposed transfer learning technique, enabling the formulation of exercise recommendations that genuinely optimize postprandial glucose reduction for individual patients, thanks to the precise acquisition of parameters.

thumbnail
Fig 10. Estimated distribution of parameter βe for each patient.

https://doi.org/10.1371/journal.pone.0298506.g010

An additional advantage offered by the proposed transfer learning technique is its intrinsic ability to automatically establish a fitting prior distribution. Practical Bayesian modeling often entails substantial reliance on domain-specific knowledge for setting informative priors [36]. Nevertheless, acquiring such requisite knowledge for training intricate time-series models is notably challenging, given the nascent state of corresponding medical insights in numerous cases [38]. In response to this challenge, our approach empowers the creation of prior distributions with minimal domain knowledge, achieved through leveraging RCT data acquired via active intervention. Furthermore, due to the inherent simplicity of our devised method (Fig 1), its applicability extends to glucose prediction for diverse patient cohorts and other complex prognostication tasks within the healthcare domain.

However, an intriguing and contentious issue revolves around determining the requisite volume of data for a dedicated RCT within our framework. Guided by the Law of Large Numbers, the greater the volume of RCT data amassed, the more balanced the target distribution becomes, consequently bolstering the robustness of parameter learning. Nevertheless, amassing a substantial quantity of high-quality RCT data necessitates significant time and resources, given the demand for large-scale experimental endeavors.

Therefore, in practice, the amount of RCT data should be determined flexibly depending on the results of the convergence diagnosis in parameter learning. Here, the values of convergence indicator [36] for each parameter in were (1.0001, 1.0040, 1.0017, 1.0008, 1.0013) for each, in our source task. Because is conventionally considered that parameter learning converges, and the number of RCT could be sufficient to specify the posterior distribution of the parameters.

Limitation

This study focused primarily on the immediate impact of exercise on postprandial glucose levels, specifically the reduction caused by muscular fatigue. However, it is acknowledged that exercise has a longer-term impact on insulin sensitivity and glucose regulation through repeated physical activity [39]. Future research will incorporate these enduring effects into the glucose prediction model to improve accuracy and provide more comprehensive behavioral recommendations.

Moreover, the model currently does not account for other factors that can influence glucose levels, such as stress, sleep patterns, time zone differences, dietary history, and medical conditions [7, 26, 40]. Including these variables in future iterations of the model would enhance its predictive power and provide a more holistic understanding of glucose dynamics. The adaptability of the proposed method to other prediction tasks for different patient groups, such as those with type 1 or type 2 diabetes, will also be explored in future research.

Furthermore, the Bayesian model in the proposed method assumed Gaussian distributions for many of the parameter distributions. While this assumption led to the improved predictive performance as in the ‘Result’ section, it may not always hold the best assumption. Future research will explore and evaluate different types of probability distributions, along with diagnostics such as the posterior predictive checking [36], to optimize the selection of distributions and potentially further enhance predictive performance.

Conclusion

We present an innovative application of the transfer-learning framework utilizing RCT data for postprandial glucose prediction, integrating both dietary and exercise behaviors. The effectiveness of the proposed method was assessed using real-world data collected from 68 patients with GDM in their everyday settings. The evaluation conclusively demonstrates performance enhancement in postprandial glucose prediction through the implementation of our proposed approach with transfer learning. Our findings also underscore the superior accuracy of the synergetic model compared to the additive model in modeling combined factors. In practical terms, the applicability of our method is contingent upon the following conditions: (i) Time-series data, which includes continuous glucose levels, exercise behaviors (inclusive of energy expenditure), and dietary behaviors (inclusive of carbohydrate intake), must be continuously collected from both a patient group and a control group. (ii) Within the control group, behavioral conditions, such as the timing and intensity of exercise, must be regulated for the subjects. Indeed, the potential of the transfer learning for such time series data in clinical outcome prediction has been recently proven in various medical fields [41], including diabetes glucose prediction [1618, 24]. Moving forward, our research aims to incorporate the prolonged glycemic impact of exercise routines to forge a superior predictive model for tailored recommendations.

Acknowledgments

The authors would like to thank Çağlar Hızlı and Arina Odnoblyudova for useful technical discussions. We also would like to thank Editage for English language editing.

References

  1. 1. Bommer C, Sagalova V, Heesemann E, Manne-Goehler J, Atun R, Bärnighausen T, et al. Global Economic Burden of Diabetes in Adults: Projections From 2015 to 2030. Diabetes Care. 2018 May;41(5):963–970. Epub 2018 Feb 23. pmid:29475843.
  2. 2. Yu J, Lee SH, Kim MK. Recent Updates to Clinical Practice Guidelines for Diabetes Mellitus. Endocrinol Metab (Seoul). 2022 Feb;37(1):26–37. Epub 2022 Feb 28. pmid:35255599.
  3. 3. Kytö M, Koivusalo S, Ruonala A, Strömberg L, Tuomonen H, Heinonen S, et al. Behavior Change App for Self-management of Gestational Diabetes: Design and Evaluation of Desirable Features. JMIR Hum Factors. 2022 Oct 12;9(4):e36987. pmid:36222806.
  4. 4. Ramakrishnan P, Yan K, Balijepalli C, Druyts E. Changing face of healthcare: digital therapeutics in the management of diabetes. Curr Med Res Opin. 2021 Dec;37(12):2089–2091. Epub 2021 Sep 23. pmid:34511002.
  5. 5. Kytö M, Markussen LT, Marttinen P, Jacucci G, Niinistö S, Virtanen SM, et al. Comprehensive self-tracking of blood glucose and lifestyle with a mobile application in the management of gestational diabetes: a study protocol for a randomised controlled trial (eMOM GDM study). BMJ Open. 2022 Nov 7;12(11):e066292. pmid:36344008.
  6. 6. Oviedo S, Vehí J, Calm R, Armengol J. A review of personalized blood glucose prediction strategies for T1DM patients. Int J Numer Method Biomed Eng. 2017 Jun;33(6). Epub 2016 Oct 28. pmid:27644067.
  7. 7. Woldaregay AZ, Årsand E, Walderhaug S, Albers D, Mamykina L, Botsis T, et al. Data-driven modeling and prediction of blood glucose dynamics: Machine learning applications in type 1 diabetes. Artif Intell Med. 2019 Jul;98:109–134. Epub 2019 Jul 26. pmid:31383477.
  8. 8. Jankovic MV, Mosimann S, Bally L, Stettler C, Mougiakakou S. Deep prediction model: The case of online adaptive prediction of subcutaneous glucose. 2016 13th Symposium on Neural Networks and Applications (NEUREL), Belgrade, Serbia, 2016.
  9. 9. Faruqui SHA, Du Y, Meka R, Alaeddini A, Li C, Shirinkam S,et al. Development of a Deep Learning Model for Dynamic Forecasting of Blood Glucose Level for Type 2 Diabetes Mellitus: Secondary Analysis of a Randomized Controlled Trial. JMIR Mhealth Uhealth. 2019 Nov 1;7(11):e14452. pmid:31682586.
  10. 10. Shepherd E, Gomersall JC, Tieu J, Han S, Crowther CA, Middleton P. Combined diet and exercise interventions for preventing gestational diabetes mellitus. Cochrane Database Syst Rev. 2017 Nov 13;11(11):CD010443. pmid:29129039.
  11. 11. Allehdan SS, Basha AS, Asali FF, Tayyem RF. Dietary and exercise interventions and glycemic control and maternal and newborn outcomes in women diagnosed with gestational diabetes: Systematic review. Diabetes Metab Syndr. 2019 Jul-Aug;13(4):2775–2784. Epub 2019 Jul 25. pmid:31405707.
  12. 12. Coe DP, Conger SA, Kendrick JM, Howard BC, Thompson DL, Bassett DR Jr, et al. Postprandial walking reduces glucose levels in women with gestational diabetes mellitus. Appl Physiol Nutr Metab. 2018 May;43(5):531–534. Epub 2017 Dec 22. pmid:29272606.
  13. 13. Manohar C, Levine JA, Nandy DK, Saad A, Dalla Man C, McCrady-Spitzer SK, et al. The effect of walking on postprandial glycemic excursion in patients with type 1 diabetes and healthy people. Diabetes Care. 2012 Dec;35(12):2493–9. Epub 2012 Aug 8. pmid:22875231.
  14. 14. Borror A, Zieff G, Battaglini C, Stoner L. The Effects of Postprandial Exercise on Glucose Control in Individuals with Type 2 Diabetes: A Systematic Review. Sports Med. 2018 Jun;48(6):1479–1491. pmid:29396781.
  15. 15. Currie S, Sinclair M, Murphy MH, Madden E, Dunwoody L, Liddle D. Reducing the Decline in Physical Activity during Pregnancy: A Systematic Review of Behaviour Change Interventions. PLoS One 2013;8(6). pmid:23799096
  16. 16. De Bois M, El Yacoubi MA, Ammi M. Adversarial multi-source transfer learning in healthcare: Application to glucose prediction for diabetic people. Comput Methods Programs Biomed. 2021 Feb;199:105874. Epub 2020 Nov 30. pmid:33333366.
  17. 17. Yu X, Yang T, Lu J, Shen Y, Lu W, Zhu W, et al. Deep transfer learning: a novel glucose prediction framework for new subjects with type 2 diabetes. Complex Intell. Syst. 8, 1875–1887 (2022).
  18. 18. Deng Y, Lu L, Aponte L, Angelidi AM, Novak V, Karniadakis GE, et al. Deep transfer learning and data augmentation improve glucose levels prediction in type 2 diabetes patients. NPJ Digit Med. 2021 Jul 14;4(1):109. pmid:34262114.
  19. 19. Xie J, Wang Q. A Data-Driven Personalized Model of Glucose Dynamics Taking Account of the Effects of Physical Activity for Type 1 Diabetes: An In Silico Study. J Biomech Eng. 2019 Jan 1;141(1). pmid:30458503.
  20. 20. Georga EI, Protopappas VC, Ardigo D, Marina M, Zavaroni I, Polyzos D, et al. Multivariate prediction of subcutaneous glucose concentration in type 1 diabetes patients based on support vector regression. IEEE J Biomed Health Inform. 2013 Jan;17(1):71–81. Epub 2012 Sep 19. pmid:23008265.
  21. 21. Balakrishnan NP, Samavedham L, Rangaiah GP. Personalized mechanistic models for exercise, meal and insulin interventions in children and adolescents with type 1 diabetes. J Theor Biol. 2014 Sep 21;357:62–73. Epub 2014 May 11. pmid:24828465.
  22. 22. Xuan J, Lu J, Zhang G. Bayesian transfer learning: An overview of probabilistic graphical models for transfer learning. 2021. arXiv preprint arXiv:2109.13233.
  23. 23. Piotr M. Suder, Jason Xu, David B. Dunson. Bayesian Transfer Learning. 2023. arXiv preprint arXiv:2312.13484
  24. 24. Daniels J, Herrero P, Georgiou P. A Multitask Learning Approach to Personalized Blood Glucose Prediction. IEEE J Biomed Health Inform. 2022 Jan;26(1):436–445. Epub 2022 Jan 17. pmid:34314367.
  25. 25. Gallwitz B. Implications of postprandial glucose and weight control in people with type 2 diabetes: understanding and implementing the International Diabetes Federation guidelines. Diabetes Care. 2009 Nov;32 Suppl 2(Suppl 2):S322–5. pmid:19875573.
  26. 26. Pustozerov EA, Tkachuk AS, Vasukova EA, Anopova AD, Kokina MA, Gorelova IV, et al. Machine Learning Approach for Postprandial Blood Glucose Prediction in Gestational Diabetes Mellitus. IEEE Access. 2020;8:219308–219321.
  27. 27. Ashrafi RA, Ahola AJ, Rosengård-Bärlund M, Saarinen T, Heinonen S, Juuti A, et al. Computational modelling of self-reported dietary carbohydrate intake on glucose concentrations in patients undergoing Roux-en-Y gastric bypass versus one-anastomosis gastric bypass. Ann Med. 2021 Dec;53(1):1885–1895. pmid:34714211.
  28. 28. Zhang G, Ashrafi RA, Juuti A, Pietilainen K, Marttinen P. Errors-in-Variables Modeling of Personalized Treatment-Response Trajectories. IEEE J Biomed Health Inform. 2021 Jan;25(1):201–208. Epub 2021 Jan 5. pmid:32324579.
  29. 29. Bellini A, Nicolò A, Bazzucchi I, Sacchetti M. The Effects of Postprandial Walking on the Glucose Response after Meals with Different Characteristics. Nutrients. 2022 Mar 4;14(5):1080. pmid:35268055.
  30. 30. Erickson ML, Jenkins NT, McCully KK. Exercise after You Eat: Hitting the Postprandial Glucose Target. Front Endocrinol (Lausanne). 2017 Sep 19;8:228. pmid:28974942.
  31. 31. Shwartz-Ziv R, Goldblum M, Souri H, Kapoor S, Zhu C, LeCun Y, et al. Pre-train your loss: Easy bayesian transfer learning with informative priors. In Advances in Neural Information Processing Systems. 42.
  32. 32. DeFronzo RA. Lilly lecture 1987. The triumvirate: beta-cell, muscle, liver. A collusion responsible for NIDDM. Diabetes. 1988 Jun;37(6):667–87. pmid:3289989.
  33. 33. Stan Development Team (2023). “RStan: the R interface to Stan.” R package version 2.21.8, https://mc-stan.org/.
  34. 34. Soma-Pillay P, Nelson-Piercy C, Tolppanen H, Mebazaa A. Physiological changes in pregnancy. Cardiovasc J Afr. 2016 Mar-Apr;27(2):89–94. pmid:27213856.
  35. 35. Andersen MB, Fuglsang J, Ostenfeld EB, Poulsen CW, Daugaard M, Ovesen PG. Postprandial interval walking-effect on blood glucose in pregnant women with gestational diabetes. Am J Obstet Gynecol MFM. 2021 Nov;3(6):100440. Epub 2021 Jun 30. pmid:34216833.
  36. 36. Gelman A, Carlin JB, Stern HS, Dunson DB, Vehtari A, Rubin DB. Bayesian Data Analysis. CRC Press. 2013. https://doi.org/10.1201/b16018
  37. 37. Rodbard D. Glucose Variability: A Review of Clinical Applications and Research Developments. Diabetes Technol Ther. 2018 Jun;20(S2):S25–S215. pmid:29916742.
  38. 38. Nahum-Shani I, Smith SN, Spring BJ, Collins LM, Witkiewitz K, Tewari A, et al. Just-in-Time Adaptive Interventions (JITAIs) in Mobile Health: Key Components and Design Principles for Ongoing Health Behavior Support. Ann Behav Med. 2018 May 18;52(6):446–462. pmid:27663578.
  39. 39. Gillen JB, Estafanos S, Govette A. Exercise-nutrient interactions for improved postprandial glycemic control and insulin sensitivity. Appl Physiol Nutr Metab. 2021 Aug;46(8):856–865. Epub 2021 Jun 3. pmid:34081875.
  40. 40. Pustozerov E, Popova P, Tkachuk A, Bolotko Y, Yuldashev Z, Grineva E. Development and Evaluation of a Mobile Personalized Blood Glucose Prediction System for Patients With Gestational Diabetes Mellitus. JMIR Mhealth Uhealth. 2018 Jan 9;6(1):e6. pmid:29317385.
  41. 41. Ebbehoj A, Thunbo MO, Andersen OE, Glindtvad MV, Hulman A. Transfer learning for non-image data in clinical research: A scoping review. PLOS Digit Health. 2022 Feb 17;1(2):e0000014. pmid:36812540.