<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.0 20040830//EN" "journalpublishing.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="2.0" xml:lang="en" article-type="research-article"><front><journal-meta><journal-id journal-id-type="nlm-ta">JMIR AI</journal-id><journal-id journal-id-type="publisher-id">ai</journal-id><journal-id journal-id-type="index">41</journal-id><journal-title>JMIR AI</journal-title><abbrev-journal-title>JMIR AI</abbrev-journal-title><issn pub-type="epub">2817-1705</issn><publisher><publisher-name>JMIR Publications</publisher-name><publisher-loc>Toronto, Canada</publisher-loc></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">v5i1e81103</article-id><article-id pub-id-type="doi">10.2196/81103</article-id><article-categories><subj-group subj-group-type="heading"><subject>Original Paper</subject></subj-group></article-categories><title-group><article-title>Improving Vancomycin Therapeutic Drug Monitoring With a Deep Learning&#x2013;Based Two-Compartment Predictive Model: Development and Validation Study</article-title></title-group><contrib-group><contrib contrib-type="author" equal-contrib="yes"><name name-style="western"><surname>Mao</surname><given-names>Bingyu</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="fn" rid="equal-contrib1">*</xref></contrib><contrib contrib-type="author" equal-contrib="yes"><name name-style="western"><surname>Xie</surname><given-names>Ziqian</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="fn" rid="equal-contrib1">*</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Rasmy</surname><given-names>Laila</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref></contrib><contrib contrib-type="author"><name name-style="western"><surname>Nigo</surname><given-names>Masayuki</given-names></name><degrees>MD</degrees><xref ref-type="aff" rid="aff2">2</xref></contrib><contrib contrib-type="author" corresp="yes"><name name-style="western"><surname>Zhi</surname><given-names>Degui</given-names></name><degrees>PhD</degrees><xref ref-type="aff" rid="aff1">1</xref></contrib></contrib-group><aff id="aff1"><institution>McWilliams School of Biomedical Informatics, The University of Texas Health Science Center at Houston</institution><addr-line>7000 Fannin, Suite 600</addr-line><addr-line>Houston</addr-line><addr-line>TX</addr-line><country>United States</country></aff><aff id="aff2"><institution>Division of Infectious Diseases, Houston Methodist</institution><addr-line>Houston</addr-line><addr-line>TX</addr-line><country>United States</country></aff><contrib-group><contrib contrib-type="editor"><name name-style="western"><surname>Luo</surname><given-names>Gang</given-names></name></contrib></contrib-group><contrib-group><contrib contrib-type="reviewer"><name name-style="western"><surname>Feng</surname><given-names>Han</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Bhatnagar</surname><given-names>Priyanshi</given-names></name></contrib><contrib contrib-type="reviewer"><name name-style="western"><surname>Yoon</surname><given-names>Seonghae</given-names></name></contrib></contrib-group><author-notes><corresp>Correspondence to Degui Zhi, PhD, McWilliams School of Biomedical Informatics, The University of Texas Health Science Center at Houston, 7000 Fannin, Suite 600, Houston, TX, United States, 1 713-500-3629, 1 713-500-3929; <email>Degui.Zhi@uth.tmc.edu</email></corresp><fn fn-type="equal" id="equal-contrib1"><label>*</label><p>these authors contributed equally</p></fn></author-notes><pub-date pub-type="collection"><year>2026</year></pub-date><pub-date pub-type="epub"><day>1</day><month>6</month><year>2026</year></pub-date><volume>5</volume><elocation-id>e81103</elocation-id><history><date date-type="received"><day>23</day><month>07</month><year>2025</year></date><date date-type="rev-recd"><day>08</day><month>04</month><year>2026</year></date><date date-type="accepted"><day>08</day><month>04</month><year>2026</year></date></history><copyright-statement>&#x00A9; Bingyu Mao, Ziqian Xie, Laila Rasmy, Masayuki Nigo, Degui Zhi. Originally published in JMIR AI (<ext-link ext-link-type="uri" xlink:href="https://ai.jmir.org">https://ai.jmir.org</ext-link>), 1.6.2026. </copyright-statement><copyright-year>2026</copyright-year><license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/"><p>This is an open-access article distributed under the terms of the Creative Commons Attribution License (<ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link>), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work, first published in JMIR AI, is properly cited. The complete bibliographic information, a link to the original publication on <ext-link ext-link-type="uri" xlink:href="https://www.ai.jmir.org/">https://www.ai.jmir.org/</ext-link>, as well as this copyright and license information must be included.</p></license><self-uri xlink:type="simple" xlink:href="https://ai.jmir.org/2026/1/e81103"/><abstract><sec><title>Background</title><p>Vancomycin is a widely used antibiotic that requires therapeutic drug monitoring (TDM) for optimized individual dosage. A deep learning&#x2013;based model, pharmacokinetic recurrent neural network&#x2013;1 compartment model (PKRNN-1CM), has shown the advantage of leveraging time-series electronic health record data for individualized estimation of vancomycin pharmacokinetic (PK) parameters. While 1-compartment PK models are commonly used because of their simplicity and previous trough-based clinical practices for dose adjustment, the pre&#x2013;deep learning literature suggests the superiority of 2-compartment models.</p></sec><sec><title>Objective</title><p>This study introduces the pharmacokinetic recurrent neural network&#x2013;2 compartment model (PKRNN-2CM), a novel deep learning&#x2013;based model designed to improve vancomycin TDM by integrating a 2-compartment PK framework.</p></sec><sec sec-type="methods"><title>Methods</title><p>PKRNN-2CM combines recurrent neural network&#x2013;driven PK parameter estimation with a 2-compartment PK model to predict vancomycin concentration trajectories. Training on both simulated data and real-world electronic health record data allows for a comprehensive evaluation of its performance.</p></sec><sec sec-type="results"><title>Results</title><p>Experiments based on simulated data highlight PKRNN-2CM&#x2019;s superiority over the simpler 1-compartment model, PKRNN-1CM, in predicting vancomycin concentration measurements (root mean square error 3.04 vs 4.50). Application to a real dataset from 5483 patients showcases significant improvement over PKRNN-1CM (root mean square error 5.55 vs 5.65; 2-sample 2-tailed unpaired <italic>t</italic> test; <italic>P</italic>=.01), with potential further gains expected with nontrough level measurements. Our simulation also indicates that PKRNN-2CM offers a better estimate of the average area under the concentration-time curve to minimum inhibitory concentration ratio, a more clinically relevant measure.</p></sec><sec sec-type="conclusions"><title>Conclusions</title><p>PKRNN-2CM is an important improvement in vancomycin TDM, demonstrating enhanced accuracy and performance compared to the PKRNN-1CM model. This deep learning model holds potential for future individualized vancomycin TDM optimization and broader applications in diverse clinical scenarios.</p></sec><sec sec-type="registered-report"><title>International Registered Report Identifier (IRRID)</title><p>RR2-doi.org/10.1101/2024.01.30.24302025</p></sec></abstract><kwd-group><kwd>vancomycin</kwd><kwd>pharmacokinetics</kwd><kwd>compartmental models</kwd><kwd>recurrent neural network</kwd><kwd>electronic health records</kwd></kwd-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>Therapeutic drug monitoring (TDM) is necessary for optimizing individual dosage regimens, particularly for drugs with narrow therapeutic ranges and high pharmacokinetic (PK) variability, such as vancomycin [<xref ref-type="bibr" rid="ref1">1</xref>,<xref ref-type="bibr" rid="ref2">2</xref>]. Traditional vancomycin TDM methods include trough monitoring, linear regression, population PK (popPK), and Bayesian estimation [<xref ref-type="bibr" rid="ref1">1</xref>]. The most recent national guidelines recommend individualized dosing guided by Bayesian methods for TDM, but they may not effectively cover diverse patient populations and are often unsuitable for patients with unstable clinical conditions [<xref ref-type="bibr" rid="ref3">3</xref>,<xref ref-type="bibr" rid="ref4">4</xref>]. Furthermore, these models incorporate a limited number of patient-specific variables, while neglecting other factors that could enhance predictions [<xref ref-type="bibr" rid="ref3">3</xref>]. Deep learning models have shown significant potential in PK-related modeling [<xref ref-type="bibr" rid="ref5">5</xref>,<xref ref-type="bibr" rid="ref6">6</xref>], especially for concentration prediction, as they can handle large datasets and complex information. Neural ordinary differential equations (ODEs) [<xref ref-type="bibr" rid="ref7">7</xref>] have been applied to PK prediction, showing better performance in predicting untested treatment regimens compared to traditional nonlinear mixed-effects models. Building on this, the deep compartment model used neural networks to predict parameters for an ODE, further improving drug concentration predictions and enabling effective TDM, even with small training datasets [<xref ref-type="bibr" rid="ref8">8</xref>]. Additionally, recurrent neural networks (RNNs) prove to be well-suited for modeling time-series electronic health record (EHR) data [<xref ref-type="bibr" rid="ref9">9</xref>] due to their capacity to analyze sequences of time-related events. When it comes to TDM, which inherently involves irregularly sampled and noisy time-series EHR data, RNNs become a fitting choice. As an example, the pharmacokinetic recurrent neural network (PKRNN) model [<xref ref-type="bibr" rid="ref10">10</xref>] is an autoregressive RNN model with a PK prediction head, which outperforms a Bayesian vancomycin TDM model. However, the PKRNN model only used a 1-compartment PK model. It is unclear if multicompartment PK models will further improve PKRNN.</p><p>Here, we extend their work, aiming to improve the performance of the pharmacokinetic recurrent neural network&#x2013;1 compartment model (PKRNN-1CM) by incorporating a 2-compartment PK prediction head. The determination of the number of compartments in developing popPK models is important for describing the PK of drugs [<xref ref-type="bibr" rid="ref11">11</xref>]. While 1-compartment models (1CMs) assume vancomycin distributes evenly throughout the body right after the infusion, multicompartment models exhibit rapid initial distribution followed by slower elimination, offering a more realistic representation of vancomycin distribution. Previous work reports that vancomycin PK has been described using 1CMs, 2-compartment models (2CMs), and 3-compartment models, while most Bayesian approaches use 1CMs or 2CMs [<xref ref-type="bibr" rid="ref11">11</xref>]. Their preference for 2CMs is further supported by studies indicating their superiority in achieving higher accuracy and lower bias when predicting vancomycin concentrations [<xref ref-type="bibr" rid="ref12">12</xref>]. 2CMs can provide more accurate predictions, especially for critically ill patients with non&#x2013;steady-state kidney function [<xref ref-type="bibr" rid="ref13">13</xref>,<xref ref-type="bibr" rid="ref14">14</xref>]. Additional evidence from studies [<xref ref-type="bibr" rid="ref11">11</xref>,<xref ref-type="bibr" rid="ref15">15</xref>,<xref ref-type="bibr" rid="ref16">16</xref>] shows the advantages of 2CMs over 1CMs. Detailed additional background information can be found in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p><p>Despite convincing evidence supporting the superiority of 2-compartment PK models, the 1CM is still widely adopted in clinical practice. This preference may be attributed to its simplicity and the reliance on previous trough-based common practices for dose adjustment. We hypothesize that increasing the number of nontrough level measurements of the concentration-time curve in the development of a 2-compartment PK model will enhance its performance, resulting in significantly improved prediction accuracy compared to a 1-compartment PK model. This hypothesis is grounded in the observations of [<xref ref-type="bibr" rid="ref11">11</xref>], who noted that, for a given patient, the 2 curves differ the most at the peak level and become smaller the closer they are to the trough level. Testing this hypothesis requires a dataset rich in nontrough level measurements, which is challenging given the sparse real-world datasets. Therefore, we turn to simulation as a valuable tool, providing a controlled environment to explore different sampling strategies and thoroughly examine the impact of various factors, such as the density and timing of measurements, on prediction accuracy to comprehensively assess and refine the developed 2-compartment PK model. This study innovatively uses actual patient information in the simulation, ensuring comparability with real-world datasets and distinguishing it from existing works that use simulated data for model comparison.</p><p>This study aims to develop an RNN-based 2-compartment predictive model (pharmacokinetic recurrent neural network&#x2013;2 compartment model [PKRNN-2CM]) for vancomycin TDM. It is anticipated that the combination of an RNN and a 2-compartment PK model will provide better predictions of vancomycin concentrations than the PKRNN-1CM model, especially when there is a sufficient number of observations occurring during nontrough levels. The proposed model is evaluated using both real-world clinical data and a simulation framework based on actual EHR information to assess performance under diverse sampling and clinical conditions.</p></sec><sec id="s2" sec-type="methods"><title>Methods</title><sec id="s2-1"><title>Data Description</title><p>This study used the same dataset as [<xref ref-type="bibr" rid="ref10">10</xref>], consisting of 5483 patients with 8689 encounters in total, which was obtained from an EHR data warehouse containing information regarding encounter-level administrative data collected from Memorial Hermann Health System (MHHS), a large health care system based in Houston, Texas, United States. Patients aged more than 18 years who received at least 1 dose of vancomycin during the period from August 2019 to March 2020 were included in the study. This study excluded patients who underwent renal replacement therapy and patients with inappropriate timing of vancomycin levels. Deidentification of the extracted cohort was conducted to protect the privacy and security of the patient data. Similar to a study by Nigo et al [<xref ref-type="bibr" rid="ref10">10</xref>], the model was trained and evaluated only using encounters with at least 1 serum vancomycin level measured after the first vancomycin dose.</p><p>The PKRNN-2CM model is designed to use variables that are routinely collected in EHR. The EHR data for this study were extracted at the encounter level, including 30 laboratory tests, 5 vital signs, 324 types of medications, and demographic information. For medication features, we represented drugs using their simple generic names rather than pharmacologic classes. This choice was based on our prior work [<xref ref-type="bibr" rid="ref17">17</xref>], which showed that finer clinical granularity can improve model performance in high-dimensional EHR models. Using generic names preserves clinically meaningful distinctions without introducing the excessive detail associated with brand names or dose-specific entries. In addition, medication variables were encoded using embedding representations, which help mitigate data sparsity while retaining relevant clinical information. The variables included in this study are commonly measured in clinical practice, particularly complete blood counts and basic metabolic panels.</p><p>Out of the 40 continuous variables, some laboratory tests, such as serum calcium level, phosphorus, total bilirubin, total protein, serum magnesium, and nucleated red blood cells, may occasionally have missing values. However, these laboratory tests are typically measured at least once during hospitalization when bacterial infections are suspected and vancomycin is used. Other variables included in the study are demographic data and vital signs, which are also routinely collected in hospitals. The 8 categorical variables are used to create an embedding vector for medications. In the same manner as described by Nigo et al [<xref ref-type="bibr" rid="ref10">10</xref>], for each encounter, the start time was determined by the earliest record time, while the end time was determined by the time stamp of the last vancomycin concentration. Vancomycin and other medication administration, vancomycin and other laboratory measurements, and the end of the day were used as events to update the state of the PKRNN-2CM model. Within the MHHS dataset, the infusion duration of vancomycin is dosage-dependent: 1000 mg is infused over 1 hour, 1001 to 1500 mg over 1.5 hours, 1501 to 2000 mg over 2 hours, and doses exceeding 2000 mg over 2.5 hours. For simplicity, a uniform infusion rate of 1 g/h was adopted. This standard rate is used in MHHS as a default rate to prevent acute reactions such as red-man syndrome. While individual infusion rates were not available in the MHHS dataset, the PKRNN-2CM model can be adjusted to incorporate various infusion rates, making it adaptable to different clinical settings. We used forward filling and mean imputation to handle missing covariates. Continuous variables were standardized using <italic>z</italic> scores.</p></sec><sec id="s2-2"><title>Model Architecture and PK Modeling</title><p>The PKRNN-2CM model, similar to the PKRNN-1CM model [<xref ref-type="bibr" rid="ref10">10</xref>], is an autoregressive RNN built on EHR data, requiring minimal manual input, and providing real-time concentration predictions by automatically adjusting to reflect subtle changes. The PKRNN-1CM model consists of 3 components that enable the vancomycin predictions to be evaluated at any time point. First, a code embedding layer is used to convert information from the EHR into the PKRNN-1CM model for every time step. Next, an RNN layer is applied to predict vancomycin elimination rates and compartment volumes, and finally, based on the output from the RNN layer, a 1-compartment PK layer uses the PK equation, which is an ODE, to compute the predicted vancomycin concentration. For the PKRNN-2CM model, we extend the 1-compartment PK model to a 2-compartment PK model. A schematic representation of the structure of the PKRNN-2CM model can be found in <xref ref-type="fig" rid="figure1">Figure 1</xref>. The input to the model is the time-series EHR data after data preprocessing, which contains 8-dimensional embedding derived from categorical data that includes all 911 different medication codes of 324 medications (<xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref> shows the generic names of medications used in the model) and 40D continuous data that includes time, time difference, vancomycin dose, vancomycin serum concentration measurements, laboratory tests, and demographic information (<xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref> shows all the continuous variables included in the model). For every time step, the RNN layer predicts 4 parameters <italic>&#x03B7;</italic><sub>1</sub>, <italic>&#x03B7;</italic><sub>2</sub>, <italic>&#x03B7;</italic><sub>3</sub>, and <italic>&#x03B7;</italic><sub>4</sub> [<xref ref-type="bibr" rid="ref18">18</xref>] that are related to the PK parameters. After that, the PK layer based on the 2-compartment PK model uses an ODE to calculate the estimated PK parameters <italic>CL</italic> (clearance for the central compartment), <italic>Q</italic> (intercompartmental clearance), <italic>V</italic><sub>1</sub> (volume of the central compartment), and <italic>V</italic><sub>2</sub> (volume of the peripheral compartment), then uses the estimated PK parameters to predict the vancomycin concentration.</p><p>PKRNN-2CM differs from PKRNN-1CM in two aspects: (1) it uses additional PK parameters and different initial values; and (2) it uses a first-order ODE system with 2 ODEs to calculate vancomycin concentrations. As <xref ref-type="fig" rid="figure2">Figure 2</xref> shows, there are 2 PK parameters in the PKRNN-1CM model, elimination rate <italic>k</italic> and volume of distribution <italic>V</italic>, while the PKRNN-2CM model has 2 clearances, central (<italic>CL</italic>) and intercompartmental (<italic>Q</italic>), and 2 volumes, <italic>V</italic><sub>1</sub> and <italic>V</italic><sub>2</sub> representing the central and peripheral compartments, respectively. Furthermore, empirically we found that the performance improved by removing the constraints of mass conservation as in PKRNN-1CM. Instead, in PKRNN-2CM we make the concentration continuous, which we believe is better because the model is allowed to correct its own prediction error in a smoother way.</p><fig position="float" id="figure1"><label>Figure 1.</label><caption><p>Pharmacokinetic recurrent neural network&#x2013;2 compartment model (PKRNN-2CM) architecture. PK: pharmacokinetic; RNN: recurrent neural network.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e81103_fig01.png"/></fig><fig position="float" id="figure2"><label>Figure 2.</label><caption><p>The main difference between pharmacokinetic recurrent neural network&#x2013;1 compartment model (PKRNN-1CM) and pharmacokinetic recurrent neural network&#x2013;2 compartment model (PKRNN-2CM). (A) The recurrent neural network (RNN) and pharmacokinetic (PK) layers of PKRNN-1CM, where <italic>k</italic> is the elimination rate, <italic>V</italic> is the volume distribution, <italic>I</italic> is the infusion rate, and <italic>M</italic> is mass of the compartment. (B) The RNN and PK layers of PKRNN-2CM, where <italic>&#x03B7;</italic><sub>1</sub>, <italic>&#x03B7;</italic><sub>2</sub>, <italic>&#x03B7;</italic><sub>3</sub>, and <italic>&#x03B7;</italic><sub>4</sub> are PK parameters that satisfy a multivariate Gaussian distribution; <italic>CL</italic> is the clearance of the central compartment; <italic>Q</italic> is the intercompartmental clearance; <italic>C<sub>A</sub></italic> is the concentration of the central compartment; and C<sub><italic>B</italic></sub> is the concentration of the peripheral compartment.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e81103_fig02.png"/></fig><p>Based on a study by Lim et al [<xref ref-type="bibr" rid="ref18">18</xref>], the 4 PK parameters <italic>CL</italic>, <italic>Q</italic>, <italic>V</italic><sub>1</sub>, and <italic>V</italic><sub>2</sub> can be described by 4 related parameters <italic>&#x03B7;</italic><sub>1</sub>, <italic>&#x03B7;</italic><sub>2</sub>, <italic>&#x03B7;</italic><sub>3</sub>, and <italic>&#x03B7;</italic><sub>4</sub> that follow a multivariate normal distribution (MVN). The RNN layer in the PKRNN-2CM predicts <italic>&#x03B7;</italic><sub>1</sub>, <italic>&#x03B7;</italic><sub>2</sub>, <italic>&#x03B7;</italic><sub>3</sub>, and <italic>&#x03B7;</italic><sub>4</sub> where the initial values are determined according to Lim et al&#x2019;s [<xref ref-type="bibr" rid="ref18">18</xref>] study:</p><disp-formula id="E1"><label>(1)</label><mml:math id="eqn1"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:msub><mml:mi>&#x03B7;</mml:mi><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:msub><mml:mi>&#x03B7;</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:msub><mml:mi>&#x03B7;</mml:mi><mml:mrow><mml:mn>3</mml:mn></mml:mrow></mml:msub><mml:mo>,</mml:mo><mml:msub><mml:mi>&#x03B7;</mml:mi><mml:mrow><mml:mn>4</mml:mn></mml:mrow></mml:msub></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>&#x223C;</mml:mo><mml:mi>M</mml:mi><mml:mi>V</mml:mi><mml:mi>N</mml:mi><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mn>0</mml:mn><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mn>0</mml:mn></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mi>diag</mml:mi><mml:mo>&#x2061;</mml:mo><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mo>[</mml:mo><mml:mrow><mml:mn>0.120</mml:mn><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mn>0.149</mml:mn><mml:mo>,</mml:mo><mml:mtext>&#x00A0;</mml:mtext><mml:mn>0.416</mml:mn></mml:mrow><mml:mo>]</mml:mo></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle></mml:mrow></mml:mstyle></mml:math></disp-formula><p>as opposed to PKRNN-1CM which uses RNN to predict <italic>k</italic> and <italic>V</italic> directly. In the PK layer, <italic>&#x03B7;</italic><sub>1</sub>, <italic>&#x03B7;</italic><sub>2</sub>, <italic>&#x03B7;</italic><sub>3</sub>, and <italic>&#x03B7;</italic><sub>4</sub> are used to calculate PK parameters following the equations below, where the content in brackets indicates the unit:</p><disp-formula id="E2"><label>(2)</label><mml:math id="eqn2"><mml:msub><mml:mrow><mml:mi>V</mml:mi></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>33.1</mml:mn><mml:msup><mml:mrow><mml:mo>&#x2219;</mml:mo><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x03B7;</mml:mi><mml:mn>1</mml:mn></mml:mrow></mml:msup><mml:mi> </mml:mi><mml:mo>(</mml:mo><mml:mi>L</mml:mi><mml:mo>)</mml:mo></mml:math></disp-formula><disp-formula id="E3"><label>(3)</label><mml:math id="eqn3"><mml:msub><mml:mrow><mml:mi>V</mml:mi></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msub><mml:mo>=</mml:mo><mml:mn>48.3</mml:mn><mml:msup><mml:mrow><mml:mo>&#x2219;</mml:mo><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x03B7;</mml:mi><mml:mn>4</mml:mn></mml:mrow></mml:msup><mml:mi> </mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>L</mml:mi></mml:mrow></mml:mfenced></mml:math></disp-formula><disp-formula id="E4"> <label>(4)</label><mml:math id="eqn4"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>Q</mml:mi><mml:mo>=</mml:mo><mml:mn>6.99</mml:mn><mml:mo>&#x22C5;</mml:mo><mml:msup><mml:mi>e</mml:mi><mml:mrow><mml:mi>&#x03B7;</mml:mi><mml:mn>3</mml:mn></mml:mrow></mml:msup><mml:mtext>&#x00A0;</mml:mtext><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mi>L</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mi>h</mml:mi><mml:mi>r</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle></mml:mrow></mml:mstyle></mml:math></disp-formula><disp-formula id="E5"><label>(5)</label><mml:math id="eqn5"><mml:mi>C</mml:mi><mml:mi>L</mml:mi><mml:mo>=</mml:mo><mml:mn>0</mml:mn><mml:mo>.</mml:mo><mml:mn>0</mml:mn><mml:mn>396</mml:mn><mml:mo>&#x2219;</mml:mo><mml:mi mathvariant="normal">C</mml:mi><mml:mi>r</mml:mi><mml:mi>C</mml:mi><mml:mi>L</mml:mi><mml:mo>&#x2219;</mml:mo><mml:msup><mml:mrow><mml:mi>e</mml:mi></mml:mrow><mml:mrow><mml:mi>&#x03B7;</mml:mi><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mi> </mml:mi><mml:mfenced separators="|"><mml:mrow><mml:mi>L</mml:mi><mml:mo>/</mml:mo><mml:mi>h</mml:mi><mml:mi>r</mml:mi></mml:mrow></mml:mfenced></mml:math></disp-formula><p>where <italic>CrCL</italic> is the creatinine clearance calculated from the Cockcroft-Gault equation:</p><disp-formula id="E6"><label>(6)</label><mml:math id="eqn6"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>C</mml:mi><mml:mi>r</mml:mi><mml:mi>C</mml:mi><mml:mi>L</mml:mi><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mo stretchy="false">(</mml:mo><mml:mn>140</mml:mn><mml:mo>&#x2212;</mml:mo><mml:mi>a</mml:mi><mml:mi>g</mml:mi><mml:mi>e</mml:mi><mml:mtext>&#x00A0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:mi>y</mml:mi><mml:mi>r</mml:mi><mml:mo stretchy="false">)</mml:mo><mml:mo stretchy="false">)</mml:mo><mml:mo>&#x00D7;</mml:mo><mml:mi>w</mml:mi><mml:mi>e</mml:mi><mml:mi>i</mml:mi><mml:mi>g</mml:mi><mml:mi>h</mml:mi><mml:mi>t</mml:mi><mml:mtext>&#x00A0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:mi>k</mml:mi><mml:mi>g</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:mrow><mml:mn>72</mml:mn><mml:mo>&#x00D7;</mml:mo><mml:mi>s</mml:mi><mml:mi>e</mml:mi><mml:mi>r</mml:mi><mml:mi>u</mml:mi><mml:mi>m</mml:mi><mml:mtext>&#x00A0;</mml:mtext><mml:mi>C</mml:mi><mml:mi>r</mml:mi><mml:mtext>&#x00A0;</mml:mtext><mml:mo stretchy="false">(</mml:mo><mml:mi>m</mml:mi><mml:mi>g</mml:mi><mml:mrow><mml:mo>/</mml:mo></mml:mrow><mml:mi>d</mml:mi><mml:mi>L</mml:mi><mml:mo stretchy="false">)</mml:mo></mml:mrow></mml:mfrac><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mo>&#x00D7;</mml:mo><mml:mn>0.85</mml:mn><mml:mtext>&#x00A0;</mml:mtext><mml:mi>f</mml:mi><mml:mi>o</mml:mi><mml:mi>r</mml:mi><mml:mtext>&#x00A0;</mml:mtext><mml:mi>w</mml:mi><mml:mi>o</mml:mi><mml:mi>m</mml:mi><mml:mi>e</mml:mi><mml:mi>n</mml:mi></mml:mrow><mml:mo>)</mml:mo></mml:mrow></mml:mstyle></mml:mrow></mml:mstyle></mml:math></disp-formula><p>The vancomycin concentration can then be calculated using the ODE system below:</p><disp-formula id="E7"><label>(7)</label><mml:math id="eqn7"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mfrac><mml:mrow><mml:mi>d</mml:mi><mml:msub><mml:mi>C</mml:mi><mml:mi>A</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mfrac><mml:mi>I</mml:mi><mml:msub><mml:mi>V</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mfrac><mml:mo>&#x2212;</mml:mo><mml:mfrac><mml:mrow><mml:mi>C</mml:mi><mml:mi>L</mml:mi></mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mfrac><mml:msub><mml:mi>C</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>&#x2212;</mml:mo><mml:mfrac><mml:mrow><mml:mi>Q</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>&#x2212;</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mn>1</mml:mn></mml:msub></mml:mfrac><mml:mtext>&#x00A0;</mml:mtext><mml:mfrac><mml:mrow><mml:mi>d</mml:mi><mml:msub><mml:mi>C</mml:mi><mml:mi>B</mml:mi></mml:msub></mml:mrow><mml:mrow><mml:mi>d</mml:mi><mml:mi>t</mml:mi></mml:mrow></mml:mfrac><mml:mo>=</mml:mo><mml:mfrac><mml:mrow><mml:mi>Q</mml:mi><mml:mo stretchy="false">(</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>&#x2212;</mml:mo><mml:msub><mml:mi>C</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo stretchy="false">)</mml:mo></mml:mrow><mml:msub><mml:mi>V</mml:mi><mml:mn>2</mml:mn></mml:msub></mml:mfrac></mml:mstyle></mml:mrow></mml:mstyle></mml:math></disp-formula><p>Where <italic>C<sub>A</sub></italic> and C<sub><italic>B</italic></sub> are the concentrations in central and peripheral compartment (mg/L).</p><p>A closed-form solution to this ODE can be found in <xref ref-type="supplementary-material" rid="app2">Multimedia Appendix 2</xref>.</p></sec><sec id="s2-3"><title>Simulation Framework and Design</title><p>The simulation was designed to be a valuable tool to guide the development and deployment of our PKRNN-2CM model by bridging the gap between the constraints of real-world data and the requirements of a comprehensive and reliable predictive system. Through this approach, we can address the limitations of sparse real-world datasets and gain deeper insights into the behavior of the PKRNN-2CM model in comparison to the PKRNN-1CM model. To ensure that the simulated dataset was comparable to the original real-world dataset, the simulation was based on actual patient information such as medications and laboratory results. As much patient information as possible was used in the simulation to guarantee the similarity between the simulated datasets and the original real-world dataset, with the only simulated data being the vancomycin measurements. We first trained a PKRNN-2CM model using real-world data, resulting in the PKRNN-2CM&#x2013;derived model, which was then used to simulate vancomycin concentrations. This PKRNN-2CM&#x2013;derived model was set as the &#x201C;ground truth&#x201D; to generate measurements for the simulated datasets. We then applied either the PKRNN-1CM or PKRNN-2CM model to the simulated data to learn the parameters, resulting in the PKRNN-1CM&#x2013;estimated or PKRNN-2CM&#x2013;estimated models. Although the PKRNN-2CM&#x2013;derived and PKRNN-2CM&#x2013;estimated models share the same architecture, they are trained independently without exchanging information. In summary, the PKRNN-2CM&#x2013;derived and PKRNN-2CM&#x2013;estimated models operate independently, with the only connection being that the PKRNN-2CM&#x2013;estimated model uses the predicted concentrations from the PKRNN-2CM&#x2013;derived model as simulated measurements.</p><p>The simulation used in this study involves the use of vancomycin concentrations predicted by the PKRNN-2CM&#x2013;derived model as labels for testing the performance of the PKRNN-1CM&#x2013;estimated and PKRNN-2CM&#x2013;estimated models based on different types of simulation.</p><p><xref ref-type="fig" rid="figure3">Figure 3</xref> is a schematic diagram showing the detailed simulation and evaluation process. In step 1, the real-world time-series EHR data are loaded into the system. In step 2, the PKRNN-2CM&#x2013;derived model is trained on real data. In step 3, simulation is set to false and model performance is assessed through the calculation of root mean square error (RMSE), comparing observed and predicted concentrations. In step 4, simulation is set to true, and the real data are removed, and predicted concentrations from the PKRNN-2CM&#x2013;derived model are used to generate a simulated dataset based on the simulation options. In step 5, the PKRNN-1CM&#x2013;estimated or PKRNN-2CM&#x2013;estimated model is trained on the simulated data. Step 6 evaluates the estimated model&#x2019;s performance using RMSE. Finally, a comparative analysis of RMSEs between PKRNN-1CM&#x2013;estimated and PKRNN-2CM&#x2013;estimated models measures their efficacy in different scenarios. A detailed simulation process overview can be found in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p><fig position="float" id="figure3"><label>Figure 3.</label><caption><p>Simulation process. (A) Real-world EHR data are used to train the PKRNN-2CM&#x2013;derived model and evaluate prediction performance using RMSE. (B) The trained PKRNN-2CM&#x2013;derived model generates simulated vancomycin concentration data under selected simulation settings. (C) PKRNN-1CM&#x2013;estimated and PKRNN-2CM&#x2013;estimated models are trained using the simulated dataset. (D) The estimated models are evaluated and compared using root mean square error (RMSE) under different evaluation settings. 1CM: 1-compartment model; 2CM: 2-compartment model; EHR: electronic health record; PKRNN-1CM: pharmacokinetic recurrent neural network&#x2013;1 compartment model; PKRNN-2CM: pharmacokinetic recurrent neural network&#x2013;2 compartment model.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e81103_fig03.png"/></fig></sec><sec id="s2-4"><title>Implementation Details</title><p>To establish the framework for our model implementation, we meticulously configured the code embedding and the RNN layers, and also chose training hyperparameters and optimization techniques for optimal performance. In configuring the code embedding layer, categorical data are embedded into 8D vectors. For the initialization of the embedding layer, weights were established using a Gaussian distribution. Each time step involves the input of a 48D vector (40+8) into the RNN layer, comprising embedded categorical data (8) and normalized continuous data (40). The RNN layer used a single-layer gated recurrent unit (GRU) with a hidden size of 64. The output layer is characterized by a linear layer of size (64, 4), mapping the GRU&#x2019;s hidden layer to the parameters <italic>&#x03B7;</italic><sub>1</sub>, <italic>&#x03B7;</italic><sub>2</sub>, <italic>&#x03B7;</italic><sub>3</sub>, and <italic>&#x03B7;</italic><sub>4</sub> at each time step. For model training, the Adamax optimizer is used with a learning rate and weight decay set at 1 &#x00D7; 10&#x207B;&#x00B2; and 0.2, respectively. The training minibatch size is configured at 50, and an early stopping mechanism, with &#x201C;patience&#x201D; set to 10, is implemented to mitigate the risk of overfitting. The mean squared error serves as the loss function for training the model. Additionally, 2 regularization mechanisms were incorporated. First, a penalty was imposed on the deviation of the predicted parameters <italic>&#x03B7;</italic><sub>1</sub>, <italic>&#x03B7;</italic><sub>2</sub>, <italic>&#x03B7;</italic><sub>3</sub>, and <italic>&#x03B7;</italic><sub>4</sub> from the prior multivariate Gaussian distribution. The second regularization term uses the L2 norm of the first-order difference to discourage abrupt changes in the output of the RNN layer.</p><p>For the simulation implementation, several datasets were generated from the PKRNN-2CM&#x2013;derived model based on different simulation options. In the &#x201C;peak&#x201D; datasets, a measurement was simulated after the vancomycin administration. The time intervals between administration and measurement were dose-dependent; the simulated measurements were made after 2 hours if the dose was less than or equal to 1000 mg, or 3 hours if the dose was greater than 1000 mg. The &#x201C;trough&#x201D; datasets simulated each measurement 1 hour before the vancomycin administration.</p><p>For consistency and comparability, all models were evaluated using the same dataset and criteria. Depending on patient identification, the data were divided into training, test, and validation sets in a ratio of 50:30:20. The performance of PKRNN-2CM and PKRNN-1CM was compared on both the original MHHS dataset and the simulated datasets using RMSE. A 2-sample 2-tailed <italic>t</italic> test was used to compare the model performance between PKRNN-1CM and PKRNN-2CM. Additionally, we ran the PKRNN-1CM&#x2013;estimated or PKRNN-2CM&#x2013;estimated model with different simulation options to evaluate how the estimated models captured the area under the concentration curve. This study was conducted with Python 3.8 (Python Software Foundation) using the <italic>PyTorch</italic> 1.9.0 library. All experiments were run on an Nvidia A100 80GB GPU. The training process takes less than 60 seconds per epoch, and evaluation and testing take less than 30 seconds per epoch.</p><p>A detailed code repository for reproducing the experiment can be found on GitHub [<xref ref-type="bibr" rid="ref19">19</xref>].</p></sec><sec id="s2-5"><title>Ethical Considerations</title><p>This study was approved by the institutional review board at The University of Texas Health Science Center at Houston (approval: HSC-MS-19&#x2010;1011) and was considered exempt from consent due to the retrospective nature of the study and use of deidentified electronic health record data. All data were handled in compliance with institutional policies and applicable regulations for the protection of patient privacy and confidentiality. No identifiable patient information was included in the analysis or reported in this study</p></sec></sec><sec id="s3" sec-type="results"><title>Results</title><sec id="s3-1"><title>Data Characteristics</title><p><xref ref-type="table" rid="table1">Table 1</xref> summarizes the baseline characteristics of the study cohort. A total of 5483 patients were included in the analysis.</p><table-wrap id="t1" position="float"><label>Table 1.</label><caption><p>Descriptive statistics for the study cohort (N=5483).</p></caption><table id="table1" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Characteristics</td><td align="left" valign="bottom">Values</td></tr></thead><tbody><tr><td align="left" valign="top" colspan="2">Basic characteristics</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Encounters, n (%)</td><td align="left" valign="top">8689 (100)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Weight (kg), median (IQR)</td><td align="left" valign="top">82.9 (65.5&#x2010;101.6)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Height (cm), median (IQR)</td><td align="left" valign="top">172 (165.1&#x2010;181.1)</td></tr><tr><td align="left" valign="top" colspan="2">Demographics</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Age (y), median (IQR)</td><td align="left" valign="top">61 (48&#x2010;73)</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Sex, n (%)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Male</td><td align="left" valign="top">3069 (55)</td></tr><tr><td align="left" valign="top" colspan="2"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Race and ethnicity, n (%)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>African American</td><td align="left" valign="top">1069 (19.5)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Asian</td><td align="left" valign="top">83 (2)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Hispanic</td><td align="left" valign="top">783 (14.2)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Non-Hispanic</td><td align="left" valign="top">3905 (71.2)</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>White</td><td align="left" valign="top">2003 (36)</td></tr></tbody></table></table-wrap></sec><sec id="s3-2"><title>Model Evaluation on Real-World Data</title><p><xref ref-type="table" rid="table2">Table 2</xref> shows that the PKRNN-2CM model exhibited better performance compared to the PKRNN-1CM model (a 2-sample 2-tailed <italic>t</italic> test; <italic>P</italic>=.01) on the MHHS datasets. A Bayesian vancomycin therapeutic drug monitoring (VTDM) model [<xref ref-type="bibr" rid="ref18">18</xref>] was implemented as the baseline here, with PK parameters updated after each measurement using maximum a posteriori estimation. The VTDM model performed worse than any of the PKRNN models.</p><table-wrap id="t2" position="float"><label>Table 2.</label><caption><p>Results of the pharmacokinetic recurrent neural network&#x2013;1 compartment model (PKRNN-1CM) and the pharmacokinetic recurrent neural network&#x2013;2 compartment model (PKRNN-2CM) on the Memorial Hermann Health System (MHHS) dataset.</p></caption><table id="table2" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Model</td><td align="left" valign="bottom">Average RMSE<sup><xref ref-type="table-fn" rid="table2fn1">a</xref></sup> (SD)<sup><xref ref-type="table-fn" rid="table2fn2">b</xref></sup></td><td align="left" valign="bottom"><italic>P</italic> value</td></tr></thead><tbody><tr><td align="left" valign="top">PKRNN-1CM</td><td align="left" valign="top">5.65 (0.06)</td><td align="left" valign="top">&#x2014;<sup><xref ref-type="table-fn" rid="table2fn3">c</xref></sup></td></tr><tr><td align="left" valign="top">PKRNN-2CM</td><td align="left" valign="top">5.55 (0.04)</td><td align="left" valign="top">.01</td></tr><tr><td align="left" valign="top">VTDM<sup><xref ref-type="table-fn" rid="table2fn4">d</xref></sup></td><td align="left" valign="top">6.38<sup><xref ref-type="table-fn" rid="table2fn5">e</xref></sup></td><td align="left" valign="top">&#x2014;</td></tr></tbody></table><table-wrap-foot><fn id="table2fn1"><p><sup>a</sup>RMSE: root mean square error.</p></fn><fn id="table2fn2"><p><sup>b</sup>SD over 5 repeats.</p></fn><fn id="table2fn3"><p><sup>c</sup>Not applicable. </p></fn><fn id="table2fn4"><p><sup>d</sup>VTDM: vancomycin therapeutic drug monitoring.</p></fn><fn id="table2fn5"><p><sup>e</sup>Note that the SD for VTDM is not applicable because it is deterministic and evaluated once.</p></fn></table-wrap-foot></table-wrap></sec><sec id="s3-3"><title>Simulation Results</title><p>Simulation results were reported using average RMSEs from a common test set. For each dataset simulated from the PKRNN-2CM&#x2013;derived model, we tested and compared the model performance of the PKRNN-1CM&#x2013;estimated and PKRNN-2CM&#x2013;estimated models. <xref ref-type="table" rid="table3">Table 3</xref> presents the summarized simulation results.</p><table-wrap id="t3" position="float"><label>Table 3.</label><caption><p>Results of the pharmacokinetic recurrent neural network&#x2013;1 compartment model (PKRNN-1CM) and the pharmacokinetic recurrent neural network&#x2013;2 compartment model (PKRNN-2CM) on the simulated dataset.</p></caption><table id="table3" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Measurement</td><td align="left" valign="bottom" colspan="2">Average RMSE<sup><xref ref-type="table-fn" rid="table3fn1">a</xref></sup> (SD)<sup><xref ref-type="table-fn" rid="table3fn2">b</xref></sup></td><td align="left" valign="bottom"><italic>P </italic>value</td></tr><tr><td align="left" valign="bottom"/><td align="left" valign="bottom">PKRNN-1CM&#x2013;estimated</td><td align="left" valign="bottom">PKRNN-2CM&#x2013;estimated</td><td align="left" valign="bottom"/></tr></thead><tbody><tr><td align="left" valign="top" colspan="4">Measurements for half of the doses</td></tr><tr><td align="left" valign="top" colspan="4"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Simulation location</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Peak<sup><xref ref-type="table-fn" rid="table3fn3">c</xref></sup></td><td align="left" valign="top">7.06 (0.71)</td><td align="left" valign="top">4.27 (0.41)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Trough<sup><xref ref-type="table-fn" rid="table3fn4">d</xref></sup></td><td align="left" valign="top">9.71 (1.43)</td><td align="left" valign="top">3.61 (0.14)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Both<sup><xref ref-type="table-fn" rid="table3fn5">e</xref></sup></td><td align="left" valign="top">5.65 (0.44)</td><td align="left" valign="top">2.50 (0.25)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top" colspan="4">Measurements for all doses</td></tr><tr><td align="left" valign="top" colspan="4"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Simulation location</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Peak<sup><xref ref-type="table-fn" rid="table3fn3">c</xref></sup></td><td align="left" valign="top">4.50 (0.13)</td><td align="left" valign="top">3.04 (0.21)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Trough<sup><xref ref-type="table-fn" rid="table3fn4">d</xref></sup></td><td align="left" valign="top">8.46 (2.20)</td><td align="left" valign="top">2.72 (0.19)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Both<sup><xref ref-type="table-fn" rid="table3fn5">e</xref></sup></td><td align="left" valign="top">3.85 (0.33)</td><td align="left" valign="top">1.94 (0.06)</td><td align="left" valign="top">&#x003C;.001</td></tr></tbody></table><table-wrap-foot><fn id="table3fn1"><p><sup>a</sup>RMSE: root mean square error.</p></fn><fn id="table3fn2"><p><sup>b</sup>SD over 5 repeats.</p></fn><fn id="table3fn3"><p><sup>c</sup>Peak: 2 or 3 hours post&#x2013;every infusion, 2 hours if infusions are &#x2264;1000 mg, 3 hours if infusions are &#x003E;1000 mg.</p></fn><fn id="table3fn4"><p><sup>d</sup>Trough: 1 hour pre&#x2013;every infusion.</p></fn><fn id="table3fn5"><p><sup>e</sup>Both: 2 measurements (peak and trough) for every infusion.</p></fn></table-wrap-foot></table-wrap><p><xref ref-type="table" rid="table3">Table 3</xref> shows the performance of the PKRNN-1CM and PKRNN-2CM on the simulated dataset. Overall, models trained on simulated measurements achieved lower RMSE than those trained on real-world data, and performance improved with increased measurement frequency. Given a fixed measurement budget, combining peak and trough observations consistently outperformed sampling only peak or trough levels, highlighting the benefit of balanced sampling strategies. In most settings, PKRNN-2CM showed slightly lower variability than PKRNN-1CM, indicating more stable performance. The VTDM model performed poorly on the simulation data, likely due to its inflexibility in adapting to the dynamic PK parameters generated by PKRNN-2CM&#x2013;derived data. The results of VTDM on the simulated data are shown in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref>.</p><p><xref ref-type="fig" rid="figure4">Figures 4</xref><xref ref-type="fig" rid="figure5"/>-<xref ref-type="fig" rid="figure6">6</xref> present 3 randomly selected patient scenarios to show model behavior across different clinical settings. Each figure compares the PKRNN-1CM and PKRNN-2CM models using both real data (top panels) and simulated data (bottom panels). In <xref ref-type="fig" rid="figure4">Figure 4</xref>, the PKRNN-2CM model shows a clear advantage, achieving lower RMSEs in both real and simulated settings (real: 27.18 vs 21.32; simulated: 17.54 vs 15.20). In <xref ref-type="fig" rid="figure5">Figure 5</xref>, the 2 models perform similarly on real data, while the PKRNN-2CM&#x2013;estimated model provides better accuracy on the simulated dataset (13.24 vs 11.46). In <xref ref-type="fig" rid="figure6">Figure 6</xref>, the PKRNN-1CM model slightly outperforms the PKRNN-2CM model on the real data (14.57 vs 16.19), whereas the PKRNN-2CM&#x2013;estimated model performs better in the simulated scenario (11.14 vs 9.74).</p><fig position="float" id="figure4"><label>Figure 4.</label><caption><p>Model performance for scenario 1. (A) Real-world patient data. (B) Simulated patient data. The PKRNN-2CM model achieved lower RMSE values in both settings. PKRNN-1CM: pharmacokinetic recurrent neural network&#x2013;1 compartment model; PKRNN-2CM: pharmacokinetic recurrent neural network&#x2013;2 compartment model; RMSE: root mean square error.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e81103_fig04.png"/></fig><fig position="float" id="figure5"><label>Figure 5.</label><caption><p>Model performance for scenario 2. (A) Real-world patient data. (B) Simulated patient data. Both models showed similar performance on real-world data, while the PKRNN-2CM model achieved lower RMSE on simulated data. PKRNN-1CM: pharmacokinetic recurrent neural network&#x2013;1 compartment model; PKRNN-2CM: pharmacokinetic recurrent neural network&#x2013;2 compartment model; RMSE: root mean square error.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e81103_fig05.png"/></fig><fig position="float" id="figure6"><label>Figure 6.</label><caption><p>Model performance for scenario 3. (A) Real-world patient data. (B) Simulated patient data. The PKRNN-1CM model performed slightly better on real-world data, whereas the PKRNN-2CM model achieved lower RMSE on simulated data. PKRNN-1CM: pharmacokinetic recurrent neural network&#x2013;1 compartment model; PKRNN-2CM: pharmacokinetic recurrent neural network&#x2013;2 compartment model; RMSE: root mean square error.</p></caption><graphic alt-version="no" mimetype="image" position="float" xlink:type="simple" xlink:href="ai_v5i1e81103_fig06.png"/></fig><p>Across <xref ref-type="fig" rid="figure4">Figures 4</xref><xref ref-type="fig" rid="figure5"/>-<xref ref-type="fig" rid="figure6">6</xref>, predicted area under the concentration-time curves (AUCs) from the PKRNN-1CM model exhibited more abrupt transitions, particularly during the postinfusion exponential decay phase. These arise because the 1CM corrected its trajectory abruptly when new observations deviated from prior predictions. In contrast, the PKRNN-2CM model produced smoother curves by updating its state more gradually as new information became available. The curve behavior reflected the prospective plotting strategy, where earlier predictions were not retroactively adjusted. This emphasized real-time diagnostic interpretability over retrospective smoothing.</p><p><xref ref-type="table" rid="table4">Table 4</xref> compares the time-averaged, dose-normalized AUC/minimum inhibitory concentrations (MICs) calculated from different simulation options. The ground truth was derived from the PKRNN-2CM&#x2013;derived model. The results indicate that the PKRNN-2CM&#x2013;estimated model can provide a closer estimate of AUC/MIC compared with the PKRNN-1CM&#x2013;estimated model. Additionally, for both models, predictions from combined peak and trough measurements yield smaller differences from the ground truth compared to peak or trough measurements. Thus, mixing peak and trough measurements can improve the accuracy of the predicted concentration-time curves for both estimated models. As before, given a fixed measurement budget, obtaining both peak and trough levels is superior to sampling measurements only at the peak or trough level across the doses.</p><table-wrap id="t4" position="float"><label>Table 4.</label><caption><p>Time-averaged dose-normalized area under the concentration-time curve (AUC)/minimum inhibitory concentration (MIC) comparison for simulated datasets.</p></caption><table id="table4" frame="hsides" rules="groups"><thead><tr><td align="left" valign="bottom">Measurements</td><td align="left" valign="bottom" colspan="2">RMSE<sup><xref ref-type="table-fn" rid="table4fn1">a</xref></sup> of time-averaged dose-normalized AUC or MIC<sup><xref ref-type="table-fn" rid="table4fn2">b</xref></sup> (SD)<sup><xref ref-type="table-fn" rid="table4fn3">c</xref></sup></td><td align="left" valign="bottom"><italic>P </italic>value</td></tr><tr><td align="left" valign="bottom"/><td align="left" valign="bottom">PKRNN-1CM<sup><xref ref-type="table-fn" rid="table4fn4">d</xref></sup>&#x2013;estimated</td><td align="left" valign="bottom">PKRNN-2CM<sup><xref ref-type="table-fn" rid="table4fn5">e</xref></sup>&#x2013;estimated</td><td align="left" valign="bottom"/></tr></thead><tbody><tr><td align="left" valign="top" colspan="4">Measurements for half doses</td></tr><tr><td align="left" valign="top" colspan="4"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Simulation location</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Peak<sup><xref ref-type="table-fn" rid="table4fn6">f</xref></sup></td><td align="left" valign="top">55.97 (2.15)</td><td align="left" valign="top">36.65 (2.07)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Trough<sup><xref ref-type="table-fn" rid="table4fn7">g</xref></sup></td><td align="left" valign="top">72.62 (7.70)</td><td align="left" valign="top">42.00 (2.67)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Both<sup><xref ref-type="table-fn" rid="table4fn8">h</xref></sup></td><td align="left" valign="top">55.55 (2.60)</td><td align="left" valign="top">25.74 (1.04)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top" colspan="4">Measurements for all doses</td></tr><tr><td align="left" valign="top" colspan="4"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Simulation location<named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content></td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Peak<sup><xref ref-type="table-fn" rid="table4fn6">f</xref></sup></td><td align="left" valign="top">52.15 (4.69)</td><td align="left" valign="top">27.80 (0.73)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Trough<sup><xref ref-type="table-fn" rid="table4fn7">g</xref></sup></td><td align="left" valign="top">63.79 (12.10)</td><td align="left" valign="top">30.57 (1.46)</td><td align="left" valign="top">&#x003C;.001</td></tr><tr><td align="left" valign="top"><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content><named-content content-type="indent">&#x00A0;&#x00A0;&#x00A0;&#x00A0;</named-content>Both<sup><xref ref-type="table-fn" rid="table4fn8">h</xref></sup></td><td align="left" valign="top">45.49 (3.47)</td><td align="left" valign="top">21.70 (1.03)</td><td align="left" valign="top">&#x003C;.001</td></tr></tbody></table><table-wrap-foot><fn id="table4fn1"><p><sup>a</sup>RMSE: root mean square error.</p></fn><fn id="table4fn2"><p><sup>b</sup>Time-averaged, dose-normalized AUC/MIC: area under the concentration-time curve to minimum inhibitory concentration ratio, averaged over the duration and normalized by the maximum dose.</p></fn><fn id="table4fn3"><p><sup>c</sup>SD over 5 repeats.</p></fn><fn id="table4fn4"><p><sup>d</sup>PKRNN-1CM: pharmacokinetic recurrent neural network&#x2013;1 compartment model.</p></fn><fn id="table4fn5"><p><sup>e</sup>PKRNN-2CM: pharmacokinetic recurrent neural network&#x2013;2 compartment model.</p></fn><fn id="table4fn6"><p><sup>f</sup>Peak: 2 or 3 hours post&#x2013;every infusion, 2 hours for infusions &#x2264;1000 mg, 3 hours for infusions &#x003E;1000 mg.</p></fn><fn id="table4fn7"><p><sup>g</sup>Trough: 1 hour pre&#x2013;every infusion.</p></fn><fn id="table4fn8"><p><sup>h</sup>Both: 2 measurements (peak and trough) for every infusion.</p></fn></table-wrap-foot></table-wrap></sec></sec><sec id="s4" sec-type="discussion"><title>Discussion</title><p>The results demonstrate a significant improvement in the PKRNN-2CM model&#x2019;s performance compared with the PKRNN-1CM model in real-world data. The results from the simulation studies documented not only the overall superiority of the PKRNN-2CM model over the PKRNN-1CM model but also highlighted a greater performance gap in scenarios involving nontrough level measurements. PKRNN-2CM is a deep-learning model that combines an RNN for vancomycin PK parameter estimation with a 2-compartment PK model for generating concentration trajectories, offering an innovative approach for individualized vancomycin TDM using time series EHR data.</p><p>This study demonstrated a superior predictive accuracy of a 2-compartment PK model over the 1-compartment PK model using a large real-world dataset. Current experiments that compare the 1-compartment and 2-compartment PK models for prediction tasks have either used small datasets with dense sampling [<xref ref-type="bibr" rid="ref11">11</xref>] or relied on simulated data that did not incorporate real-world patient information, such as using a single standard simulated patient or generating simulated populations without any real-world data [<xref ref-type="bibr" rid="ref20">20</xref>,<xref ref-type="bibr" rid="ref21">21</xref>]. In contrast, the approach bridges this gap in 2 ways. First, we simulated densely sampled data based on real-world patient characteristics from a large clinical dataset, showing the superiority of the PKRNN-2CM model. Second, we evaluated both models on the original real-world dataset with sparse measurements and again found that the PKRNN-2CM model delivered superior performance compared with PKRNN-1CM. These findings highlight the robustness and practical use of the PKRNN-2CM model, especially in realistic clinical settings where data are often sparse and heterogeneous.</p><p>One of the main contributions of this study is our simulation framework, which offers a new approach by comparing the performance of 1-compartment and 2-compartment PK models based on real-world data. Many existing studies using simulated data to compare the 1-compartment and 2-compartment PK models either use 1 simulated standard patient to evaluate different model performances [<xref ref-type="bibr" rid="ref20">20</xref>] or sample all the patient information for a population distribution [<xref ref-type="bibr" rid="ref21">21</xref>]. The simulation in this work strives for a more realistic representation by using as much real patient information as possible, with the only simulated components being the measurements. By grounding our simulation in real-world patient demographics, medications, and laboratory results, we ensure that the simulated datasets retain a level of reality to the complexities observed in realistic clinical scenarios.</p><p>The simulation framework, with its diverse simulation and evaluation options, enables the evaluation of PK models in real-world scenarios. This simulation framework can be used to investigate and assess different sampling or measurement strategies in distinct clinical settings and applications. In addition to different simulation options, our evaluation strategy for the simulation has the advantage of overcoming the limitations imposed by the availability of real-world measurements. In real-world scenarios, the evaluation of PK model performance is constrained by the availability of real measurements, leaving gaps in understanding the model&#x2019;s efficacy at specific levels of the concentration-time curve. However, the inclusion of different evaluation options in our simulation framework partially circumvents these constraints, enabling an evaluation of PK model performance across various scenarios. Building on this framework, the model design centered on the RNN component because of its ability to model irregular, noisy time-series EHR data. We note, however, that a direct comparison with alternative architectures (eg, multilayer perceptron or convolutional neural network) was not performed in this study. The design choice was guided by previous work demonstrating the suitability of RNNs for sequential clinical data.</p><p>There are some similarities between the PKRNN-2CM model and previously published popPK and Bayesian models. First, those models can estimate the entire concentration-time curve, including the AUC of vancomycin levels. Second, as popPK simulations were used to evaluate various sampling scenarios [<xref ref-type="bibr" rid="ref8">8</xref>], this work also provides simulation and evaluation based on different sampling strategies. Third, similar to some commercial Bayesian-guided dosing decision tools like DoseMe [<xref ref-type="bibr" rid="ref22">22</xref>], PKRNN-2CM can automatically adjust for variations by receiving information from the EHR stream and delivering real-time concentration predictions. However, this work offers several potential advantages over existing models. First, although DoseMe [<xref ref-type="bibr" rid="ref22">22</xref>] can integrate real-time data from EHR streams, these models use a limited number of features to estimate PK parameters. In contrast, the PKRNN-2CM model incorporates a broader range of features, which could potentially improve the accuracy of parameter estimation. Second, while the simulation in this study used extensive real information from patients, many popPK simulation studies [<xref ref-type="bibr" rid="ref8">8</xref>] instead use joint distributions of PK parameters alongside population covariate values. Third, one potential impact of this study is the broader applicability of the PKRNN-2CM model beyond vancomycin. By relying on a 2CM PK model, this work could extend beyond vancomycin and support personalized TDM for other medications. Finally, this work opens possibilities for further research into more complex models, such as multicompartment models with three or more compartments, which may improve the prediction of concentration-time curves for TDM applications.</p><p>The study conducted has some limitations that should be acknowledged. First, while AUC of vancomycin levels is a key PK marker for vancomycin in clinical practice, the true AUC or MIC value is not available in our real-world dataset due to sparse observations of vancomycin levels. As a result, we relied on simulation to evaluate model performance across the full time&#x2013;concentration profile. Because the simulated ground truth is generated from PKRNN-2CM&#x2013;derived data, there is a potential risk of model confirmation bias. To mitigate this limitation, future studies may consider simulating using alternative models. Additionally, Table S1 in <xref ref-type="supplementary-material" rid="app1">Multimedia Appendix 1</xref> includes results of the simulation generated by a PKRNN-1CM model. When trained on data simulated by the PKRNN-1CM, the PKRNN-1CM model outperforms the PKRNN-2CM, though the performance gap narrows significantly with more simulated measurements compared to 2CM generated simulations. Ideally, as denser real-world datasets become available, they will provide a more robust gold standard for model validation. Second, the study used 48 input variables to obtain patient-specific information compared to most currently available Bayesian models for vancomycin. This may potentially pose the concern of the unavailability of input variables, even though the variables included in this study are commonly measured in hospitals when vancomycin is used for treating bacterial infections. While the inclusion of multiple variables enhances model personalization, it may reduce interpretability. Future work could include feature attribution or other interpretable modeling approaches to clarify how key variables contribute to the estimation of PK parameters and improve clinical insight. Furthermore, we only simulated the uniform infusion rate of 1 g/h used in the current PKRNN-2CM model settings, as this is the default setting used in MHHS. However, the PKRNN-2CM model does not need to assume this fixed parameter and can incorporate other infusion rates as well. Finally, this study primarily focuses on developing the PKRNN-2CM model and comparing it with the PKRNN-1CM model and a baseline Bayesian model. Therefore, a comprehensive comparison with other widely used methods, such as popPK models [<xref ref-type="bibr" rid="ref22">22</xref>], Bayesian-based methods [<xref ref-type="bibr" rid="ref5">5</xref>,<xref ref-type="bibr" rid="ref18">18</xref>], and other deep learning&#x2013;based models [<xref ref-type="bibr" rid="ref7">7</xref>,<xref ref-type="bibr" rid="ref8">8</xref>], is warranted in future studies. This study also focuses solely on the methodological development of vancomycin TDM. To translate this into the clinical practice of model-informed precision dosing, substantial future work on clinical implementation is needed. Although model performance was evaluated in this study, the clinical impact of the PKRNN-2CM model, such as optimizing vancomycin dosing or decreasing side effects based on predicted values, should be evaluated in the future. In practice, the model would be integrated into a model-informed precision dosing system that ingests routinely collected EHR data, generates individualized PK parameter estimates, and provides dose adjustment recommendations for clinicians. Developing and validating such a workflow, including real-time data integration and clinician-facing decision support, is beyond the scope of this study but represents an important direction for future work.</p><p>In conclusion, the PKRNN-2CM model was developed, which can be viewed as an improved version of the PKRNN-1CM model. The study demonstrated the superiority of the 2-compartment PK model versus the 1-compartment PK model for vancomycin concentration prediction when using RNN as part of the predictive model. The study also demonstrated that the 2-compartment PK model is significantly better than the 1-compartment PK model when using sparse, irregularly sampled EHR data obtained from the real world. Overall, the findings suggest that the PKRNN-2CM model has the ability to improve the accuracy of vancomycin concentration predictions and could be applied to other PK modeling tasks using time-series EHR data. The results highlight the potential of the PKRNN-2CM model for improving personalized vancomycin TDM in clinical practice.</p></sec></body><back><ack><p>During the preparation of this work, the authors used the generative artificial intelligence tool ChatGPT-3.5 to improve readability. After using this tool, the authors reviewed and edited the content as needed and took full responsibility for the content of the publication.</p></ack><notes><sec><title>Funding</title><p>Research reported in this publication was supported by the National Institute of Allergy and Infectious Diseases (award: R01AI175699) and the National Library of Medicine (award: R01LM014249). The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.</p></sec><sec><title>Data Availability</title><p>The Memorial Hermann Health System data that support the findings of this study are not publicly available due to reasons of sensitivity and are available from the corresponding author upon request and with institutional review board approval (HSC-MS-19-&#x2010;1011).</p></sec></notes><fn-group><fn fn-type="con"><p>Conceptualization: BM, MN, DZ</p><p>Data curation: BM, ZX, MN</p><p>Formal analysis: BM, ZX</p><p>Funding acquisition: MN, DZ</p><p>Investigation: BM, ZX</p><p>Methodology: BM, ZX, LR, MN, DZ</p><p>Project administration: DZ</p><p>Resources: MN, DZ</p><p>Software: BM, ZX</p><p>Supervision: DZ</p><p>Validation: BM, LR</p><p>Visualization: BM</p><p>Writing &#x2013; original draft: BM</p><p>Writing &#x2013; review &#x0026; editing: ZX, LR, MN, DZ</p></fn><fn fn-type="conflict"><p>None declared</p></fn></fn-group><glossary><title>Abbreviations</title><def-list><def-item><term id="abb1">1CM</term><def><p>1-compartment model</p></def></def-item><def-item><term id="abb2">2CM</term><def><p>2-compartment model</p></def></def-item><def-item><term id="abb3">AUC</term><def><p>area under the concentration-time curve</p></def></def-item><def-item><term id="abb4">EHR</term><def><p>electronic health record</p></def></def-item><def-item><term id="abb5">MHHS</term><def><p>Memorial Hermann Health System</p></def></def-item><def-item><term id="abb6">MIC</term><def><p>minimum inhibitory concentration</p></def></def-item><def-item><term id="abb7">ODE</term><def><p>ordinary differential equation</p></def></def-item><def-item><term id="abb8">PK</term><def><p>pharmacokinetic</p></def></def-item><def-item><term id="abb9">PKRNN-1CM</term><def><p>pharmacokinetic recurrent neural network&#x2013;1 compartment model</p></def></def-item><def-item><term id="abb10">PKRNN-2CM</term><def><p>pharmacokinetic recurrent neural network&#x2013;2 compartment model</p></def></def-item><def-item><term id="abb11">popPK</term><def><p>population pharmacokinetic</p></def></def-item><def-item><term id="abb12">RMSE</term><def><p>root mean square error</p></def></def-item><def-item><term id="abb13">RNN</term><def><p>recurrent neural network</p></def></def-item><def-item><term id="abb14">TDM</term><def><p>therapeutic drug monitoring</p></def></def-item><def-item><term id="abb15">VTDM</term><def><p>vancomycin therapeutic drug monitoring</p></def></def-item></def-list></glossary><ref-list><title>References</title><ref id="ref1"><label>1</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Avent</surname><given-names>ML</given-names> </name><name name-style="western"><surname>Vaska</surname><given-names>VL</given-names> </name><name name-style="western"><surname>Rogers</surname><given-names>BA</given-names> </name><etal/></person-group><article-title>Vancomycin therapeutics and monitoring: a contemporary approach</article-title><source>Intern Med J</source><year>2013</year><month>02</month><volume>43</volume><issue>2</issue><fpage>110</fpage><lpage>119</lpage><pub-id pub-id-type="doi">10.1111/imj.12036</pub-id><pub-id pub-id-type="medline">23185970</pub-id></nlm-citation></ref><ref id="ref2"><label>2</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Kang</surname><given-names>JS</given-names> </name><name name-style="western"><surname>Lee</surname><given-names>MH</given-names> </name></person-group><article-title>Overview of therapeutic drug monitoring</article-title><source>Korean J Intern Med</source><year>2009</year><month>03</month><volume>24</volume><issue>1</issue><fpage>1</fpage><lpage>10</lpage><pub-id pub-id-type="doi">10.3904/kjim.2009.24.1.1</pub-id><pub-id pub-id-type="medline">19270474</pub-id></nlm-citation></ref><ref id="ref3"><label>3</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Narayan</surname><given-names>SW</given-names> </name><name name-style="western"><surname>Thoma</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Drennan</surname><given-names>PG</given-names> </name><etal/></person-group><article-title>Predictive performance of Bayesian vancomycin monitoring in the critically ill</article-title><source>Crit Care Med</source><year>2021</year><month>10</month><day>1</day><volume>49</volume><issue>10</issue><fpage>e952</fpage><lpage>e960</lpage><pub-id pub-id-type="doi">10.1097/CCM.0000000000005062</pub-id><pub-id pub-id-type="medline">33938713</pub-id></nlm-citation></ref><ref id="ref4"><label>4</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Rybak</surname><given-names>MJ</given-names> </name><name name-style="western"><surname>Le</surname><given-names>J</given-names> </name><name name-style="western"><surname>Lodise</surname><given-names>TP</given-names> </name><etal/></person-group><article-title>Therapeutic monitoring of vancomycin for serious methicillin-resistant Staphylococcus aureus infections: a revised consensus guideline and review by the American Society of Health-System Pharmacists, the Infectious Diseases Society of America, the Pediatric Infectious Diseases Society, and the Society of Infectious Diseases Pharmacists</article-title><source>Am J Health Syst Pharm</source><year>2020</year><month>05</month><day>19</day><volume>77</volume><issue>11</issue><fpage>835</fpage><lpage>864</lpage><pub-id pub-id-type="doi">10.1093/ajhp/zxaa036</pub-id><pub-id pub-id-type="medline">32191793</pub-id></nlm-citation></ref><ref id="ref5"><label>5</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Mao</surname><given-names>B</given-names> </name><name name-style="western"><surname>Gao</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Xu</surname><given-names>C</given-names> </name><name name-style="western"><surname>Macha</surname><given-names>S</given-names> </name><name name-style="western"><surname>Shao</surname><given-names>S</given-names> </name><name name-style="western"><surname>Ahamadi</surname><given-names>M</given-names> </name></person-group><article-title>Evaluating the impact of AI-based model-informed drug development (MIDD): a comparative review</article-title><source>AAPS J</source><year>2025</year><month>06</month><day>2</day><volume>27</volume><issue>4</issue><fpage>102</fpage><pub-id pub-id-type="doi">10.1208/s12248-025-01075-0</pub-id><pub-id pub-id-type="medline">40457118</pub-id></nlm-citation></ref><ref id="ref6"><label>6</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Mao</surname><given-names>B</given-names> </name><name name-style="western"><surname>Gao</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Xu</surname><given-names>C</given-names> </name><name name-style="western"><surname>Macha</surname><given-names>S</given-names> </name><name name-style="western"><surname>Shao</surname><given-names>S</given-names> </name><name name-style="western"><surname>Ahamadi</surname><given-names>M</given-names> </name></person-group><article-title>Opportunities for AI-based model-informed drug development: a comparative analysis of NONMEM and AI-based models for population pharmacokinetic prediction</article-title><source>AAPS J</source><year>2025</year><month>11</month><day>18</day><volume>28</volume><issue>1</issue><fpage>21</fpage><pub-id pub-id-type="doi">10.1208/s12248-025-01121-x</pub-id><pub-id pub-id-type="medline">41254220</pub-id></nlm-citation></ref><ref id="ref7"><label>7</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Lu</surname><given-names>J</given-names> </name><name name-style="western"><surname>Deng</surname><given-names>K</given-names> </name><name name-style="western"><surname>Zhang</surname><given-names>X</given-names> </name><name name-style="western"><surname>Liu</surname><given-names>G</given-names> </name><name name-style="western"><surname>Guan</surname><given-names>Y</given-names> </name></person-group><article-title>Neural-ODE for pharmacokinetics modeling and its advantage to alternative machine learning models in predicting new dosing regimens</article-title><source>iScience</source><year>2021</year><month>07</month><day>23</day><volume>24</volume><issue>7</issue><fpage>102804</fpage><pub-id pub-id-type="doi">10.1016/j.isci.2021.102804</pub-id><pub-id pub-id-type="medline">34308294</pub-id></nlm-citation></ref><ref id="ref8"><label>8</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Janssen</surname><given-names>A</given-names> </name><name name-style="western"><surname>Leebeek</surname><given-names>FWG</given-names> </name><name name-style="western"><surname>Cnossen</surname><given-names>MH</given-names> </name><name name-style="western"><surname>Math&#x00F4;t</surname><given-names>RAA</given-names> </name><collab>OPTI&#x2010;CLOT study group and SYMPHONY consortium</collab></person-group><article-title>Deep compartment models: a deep learning approach for the reliable prediction of time&#x2010;series data in pharmacokinetic modeling</article-title><source>CPT Pharmacom Syst Pharma</source><year>2022</year><month>07</month><volume>11</volume><issue>7</issue><fpage>934</fpage><lpage>945</lpage><pub-id pub-id-type="doi">10.1002/psp4.12808</pub-id></nlm-citation></ref><ref id="ref9"><label>9</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Rasmy</surname><given-names>L</given-names> </name><name name-style="western"><surname>Wu</surname><given-names>Y</given-names> </name><name name-style="western"><surname>Wang</surname><given-names>N</given-names> </name><etal/></person-group><article-title>A study of generalizability of recurrent neural network-based predictive models for heart failure onset risk using a large and heterogeneous EHR data set</article-title><source>J Biomed Inform</source><year>2018</year><month>08</month><volume>84</volume><fpage>11</fpage><lpage>16</lpage><pub-id pub-id-type="doi">10.1016/j.jbi.2018.06.011</pub-id><pub-id pub-id-type="medline">29908902</pub-id></nlm-citation></ref><ref id="ref10"><label>10</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Nigo</surname><given-names>M</given-names> </name><name name-style="western"><surname>Tran</surname><given-names>HTN</given-names> </name><name name-style="western"><surname>Xie</surname><given-names>Z</given-names> </name><etal/></person-group><article-title>PK-RNN-V E: a deep learning model approach to vancomycin therapeutic drug monitoring using electronic health record data</article-title><source>J Biomed Inform</source><year>2022</year><month>09</month><volume>133</volume><fpage>104166</fpage><pub-id pub-id-type="doi">10.1016/j.jbi.2022.104166</pub-id><pub-id pub-id-type="medline">35985620</pub-id></nlm-citation></ref><ref id="ref11"><label>11</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Shingde</surname><given-names>RV</given-names> </name><name name-style="western"><surname>Graham</surname><given-names>GG</given-names> </name><name name-style="western"><surname>Reuter</surname><given-names>SE</given-names> </name><name name-style="western"><surname>Carland</surname><given-names>JE</given-names> </name><name name-style="western"><surname>Day</surname><given-names>RO</given-names> </name><name name-style="western"><surname>Stocker</surname><given-names>SL</given-names> </name></person-group><article-title>Comparison of the area under the curve for vancomycin estimated using compartmental and noncompartmental methods in adult patients with normal renal function</article-title><source>Ther Drug Monit</source><year>2019</year><month>12</month><volume>41</volume><issue>6</issue><fpage>726</fpage><lpage>731</lpage><pub-id pub-id-type="doi">10.1097/FTD.0000000000000690</pub-id><pub-id pub-id-type="medline">31725694</pub-id></nlm-citation></ref><ref id="ref12"><label>12</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Pryka</surname><given-names>RD</given-names> </name><name name-style="western"><surname>Rodvold</surname><given-names>KA</given-names> </name><name name-style="western"><surname>Garrison</surname><given-names>M</given-names> </name><name name-style="western"><surname>Rotschafer</surname><given-names>JC</given-names> </name></person-group><article-title>Individualizing vancomycin dosage regimens: one- versus two-compartment Bayesian models</article-title><source>Ther Drug Monit</source><year>1989</year><volume>11</volume><issue>4</issue><fpage>450</fpage><lpage>454</lpage><pub-id pub-id-type="medline">2741194</pub-id></nlm-citation></ref><ref id="ref13"><label>13</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Cheng</surname><given-names>V</given-names> </name><name name-style="western"><surname>Abdul-Aziz</surname><given-names>MH</given-names> </name><name name-style="western"><surname>Burrows</surname><given-names>F</given-names> </name><etal/></person-group><article-title>Population pharmacokinetics of vancomycin in critically ill adult patients receiving extracorporeal membrane oxygenation (an ASAP ECMO Study)</article-title><source>Antimicrob Agents Chemother</source><year>2022</year><month>01</month><day>18</day><volume>66</volume><issue>1</issue><fpage>e0137721</fpage><pub-id pub-id-type="doi">10.1128/AAC.01377-21</pub-id><pub-id pub-id-type="medline">34633852</pub-id></nlm-citation></ref><ref id="ref14"><label>14</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Goti</surname><given-names>V</given-names> </name><name name-style="western"><surname>Chaturvedula</surname><given-names>A</given-names> </name><name name-style="western"><surname>Fossler</surname><given-names>MJ</given-names> </name><name name-style="western"><surname>Mok</surname><given-names>S</given-names> </name><name name-style="western"><surname>Jacob</surname><given-names>JT</given-names> </name></person-group><article-title>Hospitalized patients with and without hemodialysis have markedly different vancomycin pharmacokinetics: a population pharmacokinetic model-based analysis</article-title><source>Ther Drug Monit</source><year>2018</year><month>04</month><volume>40</volume><issue>2</issue><fpage>212</fpage><lpage>221</lpage><pub-id pub-id-type="doi">10.1097/FTD.0000000000000490</pub-id><pub-id pub-id-type="medline">29470227</pub-id></nlm-citation></ref><ref id="ref15"><label>15</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>de Gatta</surname><given-names>MMF</given-names> </name><name name-style="western"><surname>Fruns</surname><given-names>I</given-names> </name><name name-style="western"><surname>Calvo</surname><given-names>MV</given-names> </name><name name-style="western"><surname>Lanao</surname><given-names>JM</given-names> </name><name name-style="western"><surname>Dominguez-Gil</surname><given-names>A</given-names> </name></person-group><article-title>Influence of pharmacokinetic model on vancomycin peak concentration targets</article-title><source>Ther Drug Monit</source><year>1996</year><month>04</month><volume>18</volume><issue>2</issue><fpage>145</fpage><lpage>148</lpage><pub-id pub-id-type="doi">10.1097/00007691-199604000-00006</pub-id><pub-id pub-id-type="medline">8721276</pub-id></nlm-citation></ref><ref id="ref16"><label>16</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Wu</surname><given-names>G</given-names> </name><name name-style="western"><surname>Furlanut</surname><given-names>M</given-names> </name></person-group><article-title>Prediction of serum vancomycin concentrations using one-, two- and three-compartment models with implemented population pharmacokinetic parameters and with the Bayesian method</article-title><source>J Pharm Pharmacol</source><year>1998</year><month>08</month><volume>50</volume><issue>8</issue><fpage>851</fpage><lpage>856</lpage><pub-id pub-id-type="doi">10.1111/j.2042-7158.1998.tb03999.x</pub-id><pub-id pub-id-type="medline">9751448</pub-id></nlm-citation></ref><ref id="ref17"><label>17</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Rasmy</surname><given-names>L</given-names> </name><name name-style="western"><surname>Tiryaki</surname><given-names>F</given-names> </name><name name-style="western"><surname>Zhou</surname><given-names>Y</given-names> </name><etal/></person-group><article-title>Representation of EHR data for predictive modeling: a comparison between UMLS and other terminologies</article-title><source>J Am Med Inform Assoc</source><year>2020</year><month>10</month><day>1</day><volume>27</volume><issue>10</issue><fpage>1593</fpage><lpage>1599</lpage><pub-id pub-id-type="doi">10.1093/jamia/ocaa180</pub-id><pub-id pub-id-type="medline">32930711</pub-id></nlm-citation></ref><ref id="ref18"><label>18</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Lim</surname><given-names>HS</given-names> </name><name name-style="western"><surname>Chong</surname><given-names>YP</given-names> </name><name name-style="western"><surname>Noh</surname><given-names>YH</given-names> </name><name name-style="western"><surname>Jung</surname><given-names>JA</given-names> </name><name name-style="western"><surname>Kim</surname><given-names>YS</given-names> </name></person-group><article-title>Exploration of optimal dosing regimens of vancomycin in patients infected with methicillin-resistant Staphylococcus aureus by modeling and simulation</article-title><source>J Clin Pharm Ther</source><year>2014</year><month>04</month><volume>39</volume><issue>2</issue><fpage>196</fpage><lpage>203</lpage><pub-id pub-id-type="doi">10.1111/jcpt.12123</pub-id><pub-id pub-id-type="medline">24428720</pub-id></nlm-citation></ref><ref id="ref19"><label>19</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Maung</surname><given-names>NH</given-names> </name><name name-style="western"><surname>Methaneethorn</surname><given-names>J</given-names> </name><name name-style="western"><surname>Wattanavijitkul</surname><given-names>T</given-names> </name><name name-style="western"><surname>Sriboonruang</surname><given-names>T</given-names> </name></person-group><article-title>Comparison of area under the curve for vancomycin from one- and two-compartment models using sparse data</article-title><source>Eur J Hosp Pharm</source><year>2022</year><month>03</month><volume>29</volume><issue>e1</issue><fpage>e57</fpage><lpage>e62</lpage><pub-id pub-id-type="doi">10.1136/ejhpharm-2020-002637</pub-id><pub-id pub-id-type="medline">34285111</pub-id></nlm-citation></ref><ref id="ref20"><label>20</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Broeker</surname><given-names>A</given-names> </name><name name-style="western"><surname>Nardecchia</surname><given-names>M</given-names> </name><name name-style="western"><surname>Klinker</surname><given-names>KP</given-names> </name><etal/></person-group><article-title>Towards precision dosing of vancomycin: a systematic evaluation of pharmacometric models for Bayesian forecasting</article-title><source>Clin Microbiol Infect</source><year>2019</year><month>10</month><volume>25</volume><issue>10</issue><fpage>1286</fpage><pub-id pub-id-type="doi">10.1016/j.cmi.2019.02.029</pub-id><pub-id pub-id-type="medline">30872102</pub-id></nlm-citation></ref><ref id="ref21"><label>21</label><nlm-citation citation-type="web"><article-title>PK-RNN</article-title><source>GitHub</source><access-date>2026-05-15</access-date><comment><ext-link ext-link-type="uri" xlink:href="https://github.com/ZhiGroup/PK-RNN/tree/PKRNN-2CM">https://github.com/ZhiGroup/PK-RNN/tree/PKRNN-2CM</ext-link></comment></nlm-citation></ref><ref id="ref22"><label>22</label><nlm-citation citation-type="journal"><person-group person-group-type="author"><name name-style="western"><surname>Vali</surname><given-names>L</given-names> </name><name name-style="western"><surname>Jenkins</surname><given-names>DR</given-names> </name><name name-style="western"><surname>Vaja</surname><given-names>R</given-names> </name><name name-style="western"><surname>Mulla</surname><given-names>H</given-names> </name></person-group><article-title>Personalised dosing of vancomycin: a prospective and retrospective comparative quasi-experimental study</article-title><source>Br J Clin Pharmacol</source><year>2021</year><month>02</month><volume>87</volume><issue>2</issue><fpage>506</fpage><lpage>515</lpage><pub-id pub-id-type="doi">10.1111/bcp.14411</pub-id><pub-id pub-id-type="medline">32495366</pub-id></nlm-citation></ref></ref-list><app-group><supplementary-material id="app1"><label>Multimedia Appendix 1</label><p>Supplementary background and methodological details, variable definitions, and extended simulation results.</p><media xlink:href="ai_v5i1e81103_app1.docx" xlink:title="DOCX File, 4952 KB"/></supplementary-material><supplementary-material id="app2"><label>Multimedia Appendix 2</label><p>Mathematical derivation of the pharmacokinetic model.</p><media xlink:href="ai_v5i1e81103_app2.pdf" xlink:title="PDF File, 202 KB"/></supplementary-material></app-group></back></article>