Could we predict patient trajectories in Type 2 Diabetes Mellitus?
Predicting and understanding patient trajectories in type 2 diabetes

Our paper A Deep Attention-Based Encoder for the Prediction of Type 2 Diabetes Longitudinal Outcomes from Routinely Collected Health Care Data, to be published on the Expert Systems With Applications Journal, introduces DARE, a novel deep learning model designed to enhance the management of Type 2 Diabetes Mellitus (T2DM)1.
Developed by researchers from b2slab at IRIS, jointly with Dr. Mauricio at Sant Pau and Dr. Franch at IDIAPJGol, DARE leverages transformer-based architecture to analyze complex, longitudinal healthcare data.
Key Highlights:
Model Architecture: DARE is built upon a transformer encoder framework, adept at processing sequences of clinical events such as diagnoses, treatments, and laboratory results. This design enables the model to capture intricate patterns and relationships within the data.
Data Utilization: The model was trained on data from over 200,000 individuals with T2DM, sourced from the SIDIAP database. This extensive dataset encompasses diagnostic codes, medication records, and various clinical measurements, providing a comprehensive view of patient health trajectories.
Predictive Capabilities: After an initial unsupervised training phase, DARE was fine-tuned to predict three critical clinical outcomes:
- Development of comorbidities.
- Achievement of target glycemic control (defined as glycated hemoglobin levels below 7%).
- Adjustments in glucose-lowering treatments.
In validation tests, DARE demonstrated superior performance compared to traditional models, achieving area under the curve (AUC) scores of 0.88 for comorbidity prediction, 0.91 for treatment changes, and 0.82 for glycemic control targets.
Implications for Medical Practice:
The introduction of DARE signifies a significant advancement in personalized diabetes care. By accurately forecasting disease progression and treatment responses, healthcare providers can tailor interventions more effectively, potentially improving patient outcomes. Moreover, the model’s ability to analyze vast amounts of routinely collected health data underscores the growing role of artificial intelligence in transforming medical practice.
As the prevalence of T2DM continues to rise globally, tools like DARE offer promising avenues for enhancing disease management through data-driven insights and personalized care strategies.
Footnotes
Enrico Manzini, Bogdan Vlacho, Josep Franch-Nadal, Joan Escudero, Ana Génova, Elisenda Reixach, Erich Andrés, Israel Pizarro, Dídac Mauricio, Alexandre Perera-Lluna, A deep attention-based encoder for the prediction of type 2 diabetes longitudinal outcomes from routinely collected health care data, Expert Systems with Applications, Volume 274, 2025, 126876, ISSN 0957-4174, https://doi.org/10.1016/j.eswa.2025.126876, https://www.sciencedirect.com/science/article/pii/S0957417425004981↩︎