Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model Development

Abstract BackgroundDiabetes affects millions worldwide. Primary care physicians provide a significant portion of care, and they often struggle with selecting appropriate medications. ObjectiveThis study aimed to develop a model that accurately predicts what drug an...

Full description

Saved in:
Bibliographic Details
Main Authors: Hisashi Kurasawa, Kayo Waki, Tomohisa Seki, Eri Nakahara, Akinori Fujino, Nagisa Shiomi, Hiroshi Nakashima, Kazuhiko Ohe
Format: Article
Language:English
Published: JMIR Publications 2025-06-01
Series:JMIR Medical Informatics
Online Access:https://medinform.jmir.org/2025/1/e67748
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1849722610661720064
author Hisashi Kurasawa
Kayo Waki
Tomohisa Seki
Eri Nakahara
Akinori Fujino
Nagisa Shiomi
Hiroshi Nakashima
Kazuhiko Ohe
author_facet Hisashi Kurasawa
Kayo Waki
Tomohisa Seki
Eri Nakahara
Akinori Fujino
Nagisa Shiomi
Hiroshi Nakashima
Kazuhiko Ohe
author_sort Hisashi Kurasawa
collection DOAJ
description Abstract BackgroundDiabetes affects millions worldwide. Primary care physicians provide a significant portion of care, and they often struggle with selecting appropriate medications. ObjectiveThis study aimed to develop a model that accurately predicts what drug an endocrinologist would prescribe based on the current measurements. The goal was to create a system that would assist nonspecialists in choosing medications, thereby potentially improving diabetes treatment outcomes. Based on the performance of previous studies, we set a performance target of achieving a receiver operating characteristic area under the curve (ROC-AUC) above 0.95. MethodsA transformer-based encoder-decoder model predicts whether 44 types of diabetes drugs will be prescribed. The model uses sequences of age, sex, history for 12 laboratory tests, and prescribed drug history as inputs. We assessed the model using the electronic health records from 7034 patients with diabetes seeing endocrinologists between 2012 and 2022 at the University of Tokyo Hospital. We assessed model performance trained on data subsets spanning different time periods (2, 5, and 10 years) using micro- and macro-averaged ROC-AUC on a hold-out test set comprising data solely from 2022. The model’s performance was compared against LightGBM. ResultsThe model trained on data from the past 5 years (2017‐2021) yielded the best predictive performance, achieving a microaverage (95% CI) ROC-AUC of 0.993 (0.992-0.994) and a macroaverage (95% CI) ROC-AUC of 0.988 (0.980-0.993). The model achieved an ROC-AUC above 0.95 for 43 out of 44 drugs. These results surpassed the predefined performance target and outperformed both previous studies and the LightGBM model’s microaverage ROC-AUC of 0.988 (0.985-0.990) in terms of prediction accuracy. Furthermore, training the model with short-term data from the past 5 years yielded high accuracy compared to using data from the past 10 years, suggesting that learning from more recent prescribing patterns might be advantageous. ConclusionsThe proposed model demonstrates the feasibility of accurately predicting the next prescribed drugs. This model, trained from the past prescriptions of endocrinologists, has the potential to provide information that can assist nonspecialists in making diabetes-treatment decisions. Future studies will focus on incorporating important factors such as prescription contraindications and constraints to enhance safety, as well as leveraging large-scale clinical data across multiple hospitals to improve the generalizability of the model.
format Article
id doaj-art-4a12a285068240f29a8b48462f5f144e
institution DOAJ
issn 2291-9694
language English
publishDate 2025-06-01
publisher JMIR Publications
record_format Article
series JMIR Medical Informatics
spelling doaj-art-4a12a285068240f29a8b48462f5f144e2025-08-20T03:11:17ZengJMIR PublicationsJMIR Medical Informatics2291-96942025-06-0113e67748e6774810.2196/67748Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model DevelopmentHisashi Kurasawahttp://orcid.org/0000-0001-7599-6277Kayo Wakihttp://orcid.org/0000-0003-0046-2523Tomohisa Sekihttp://orcid.org/0000-0002-4281-135XEri Nakaharahttp://orcid.org/0000-0002-0199-3249Akinori Fujinohttp://orcid.org/0000-0003-3377-3539Nagisa Shiomihttp://orcid.org/0009-0001-8885-3096Hiroshi Nakashimahttp://orcid.org/0000-0001-6269-1386Kazuhiko Ohehttp://orcid.org/0000-0002-4296-9536 Abstract BackgroundDiabetes affects millions worldwide. Primary care physicians provide a significant portion of care, and they often struggle with selecting appropriate medications. ObjectiveThis study aimed to develop a model that accurately predicts what drug an endocrinologist would prescribe based on the current measurements. The goal was to create a system that would assist nonspecialists in choosing medications, thereby potentially improving diabetes treatment outcomes. Based on the performance of previous studies, we set a performance target of achieving a receiver operating characteristic area under the curve (ROC-AUC) above 0.95. MethodsA transformer-based encoder-decoder model predicts whether 44 types of diabetes drugs will be prescribed. The model uses sequences of age, sex, history for 12 laboratory tests, and prescribed drug history as inputs. We assessed the model using the electronic health records from 7034 patients with diabetes seeing endocrinologists between 2012 and 2022 at the University of Tokyo Hospital. We assessed model performance trained on data subsets spanning different time periods (2, 5, and 10 years) using micro- and macro-averaged ROC-AUC on a hold-out test set comprising data solely from 2022. The model’s performance was compared against LightGBM. ResultsThe model trained on data from the past 5 years (2017‐2021) yielded the best predictive performance, achieving a microaverage (95% CI) ROC-AUC of 0.993 (0.992-0.994) and a macroaverage (95% CI) ROC-AUC of 0.988 (0.980-0.993). The model achieved an ROC-AUC above 0.95 for 43 out of 44 drugs. These results surpassed the predefined performance target and outperformed both previous studies and the LightGBM model’s microaverage ROC-AUC of 0.988 (0.985-0.990) in terms of prediction accuracy. Furthermore, training the model with short-term data from the past 5 years yielded high accuracy compared to using data from the past 10 years, suggesting that learning from more recent prescribing patterns might be advantageous. ConclusionsThe proposed model demonstrates the feasibility of accurately predicting the next prescribed drugs. This model, trained from the past prescriptions of endocrinologists, has the potential to provide information that can assist nonspecialists in making diabetes-treatment decisions. Future studies will focus on incorporating important factors such as prescription contraindications and constraints to enhance safety, as well as leveraging large-scale clinical data across multiple hospitals to improve the generalizability of the model.https://medinform.jmir.org/2025/1/e67748
spellingShingle Hisashi Kurasawa
Kayo Waki
Tomohisa Seki
Eri Nakahara
Akinori Fujino
Nagisa Shiomi
Hiroshi Nakashima
Kazuhiko Ohe
Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model Development
JMIR Medical Informatics
title Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model Development
title_full Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model Development
title_fullStr Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model Development
title_full_unstemmed Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model Development
title_short Enhancing Antidiabetic Drug Selection Using Transformers: Machine-Learning Model Development
title_sort enhancing antidiabetic drug selection using transformers machine learning model development
url https://medinform.jmir.org/2025/1/e67748
work_keys_str_mv AT hisashikurasawa enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment
AT kayowaki enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment
AT tomohisaseki enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment
AT erinakahara enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment
AT akinorifujino enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment
AT nagisashiomi enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment
AT hiroshinakashima enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment
AT kazuhikoohe enhancingantidiabeticdrugselectionusingtransformersmachinelearningmodeldevelopment