{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,26]],"date-time":"2026-08-26T06:26:44Z","timestamp":1787725604204,"version":"build-2784847793"},"reference-count":32,"publisher":"Frontiers Media SA","license":[{"start":{"date-parts":[[2026,8,26]],"date-time":"2026-08-26T00:00:00Z","timestamp":1787702400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":["frontiersin.org"],"crossmark-restriction":true},"short-container-title":["Front. Cell. Infect. Microbiol."],"abstract":"<jats:sec>\n                    <jats:title>Background<\/jats:title>\n                    <jats:p>\n                      Accurate prediction of CD4\n                      <jats:sup>+<\/jats:sup>\n                      T-cell trajectories is essential for monitoring HIV treatment efficacy and guiding clinical decisions. Conventional statistical methods provide population-level insights but struggle to capture nonlinear, patient-specific temporal patterns in real-world data.\n                    <\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Methods<\/jats:title>\n                    <jats:p>We developed a Time Series Transformer integrating multi-head self-attention with static patient characteristics. Historical 12-month CD4 measurements were jointly modeled with treatment regimen, demographics, and baseline clinical parameters within an encoder\u2013decoder framework (4 layers, 8 heads, d_model=128). The model was trained and internally validated on a retrospective cohort of 5,436 HIV patients with CD4 measurements spanning up to 24 months post-ART, using patient-level data splitting.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Results<\/jats:title>\n                    <jats:p>On the test set, the model achieved an MAE of 5.36 cells\/\u03bcL, RMSE of 6.94 cells\/\u03bcL, and R\u00b2 of 0.9990 for 6-month forecasts. Performance was consistent across patient subgroups, with unbiased, approximately normal error distributions. Feature importance analysis identified baseline CD4, treatment regimen, and time to ART initiation as dominant predictors, aligning with clinical knowledge.<\/jats:p>\n                  <\/jats:sec>\n                  <jats:sec>\n                    <jats:title>Conclusions<\/jats:title>\n                    <jats:p>A regularized Time Series Transformer can provide highly accurate, patient-specific CD4 trajectory forecasts in a real-world HIV cohort. The interpretable integration of clinical features offered a transparent framework for understanding immune recovery. This work demonstrated the potential of modern sequence models to complement conventional tools and support individualized HIV care.<\/jats:p>\n                  <\/jats:sec>","DOI":"10.3389\/fcimb.2026.1837493","type":"journal-article","created":{"date-parts":[[2026,8,26]],"date-time":"2026-08-26T05:53:21Z","timestamp":1787723601000},"update-policy":"https:\/\/doi.org\/10.3389\/crossmark-policy","source":"Crossref","is-referenced-by-count":0,"title":["Time Series Transformer for long-term CD4 trajectory prediction in HIV patients: a novel deep learning approach"],"prefix":"10.3389","volume":"16","author":[{"given":"Qianqian","family":"Lu","sequence":"first","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Tingting","family":"Li","sequence":"additional","affiliation":[{"name":"Drug Clinical Trial Institution Office, Xi\u2019an Chest Hospital","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jie","family":"Chen","sequence":"additional","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Huanhuan","family":"Ba","sequence":"additional","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Yuan","family":"Zhang","sequence":"additional","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jiajia","family":"Li","sequence":"additional","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jinling","family":"Yin","sequence":"additional","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Kangxiao","family":"Ma","sequence":"additional","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Huanqing","family":"Liu","sequence":"additional","affiliation":[{"name":"Information Management Office, Northwestern Polytechnical University","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Juan","family":"Jin","sequence":"additional","affiliation":[{"name":"Department of Infectious Diseases, The Eighth\u2019s Hospital of Xi\u2019an","place":["Xi\u2019an, Shaanxi, China"]}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1965","published-online":{"date-parts":[[2026,8,26]]},"reference":[{"key":"B1","doi-asserted-by":"publisher","DOI":"10.1093\/aje\/kwp129","article-title":"Clinical prediction models: a practical approach to development, validation, and updating: by Ewout W. Steyerberg","volume":"170","author":"Alonzo","year":"2009","journal-title":"Am J Epidemiol"},{"key":"B2","doi-asserted-by":"publisher","first-page":"42","DOI":"10.1038\/s41572-023-00452-3","article-title":"HIV infection","volume":"9","author":"Bekker","year":"2023","journal-title":"Nat. Rev. Dis. Primers"},{"key":"B3","doi-asserted-by":"publisher","first-page":"517","DOI":"10.1001\/jama.2017.7797","article-title":"Unintended consequences of machine learning in medicine","volume":"318","author":"Cabitza","year":"2017","journal-title":"JAMA"},{"key":"B4","doi-asserted-by":"publisher","first-page":"1047","DOI":"10.4269\/ajtmh.2009.80.1047","article-title":"Modeling CD4+ cell count increase over a six-year period in HIV-1-infected patients on highly active antiretroviral therapy in Senegal","volume":"80","author":"De Beaudrap","year":"2009","journal-title":"Am. J. Trop. Med. Hyg."},{"key":"B5","first-page":"359","article-title":"Modeling the relationship between survival and CD4 lymphocytes in patients with AIDS and AIDS-related complex","volume":"6","author":"De Gruttola","year":"1993","journal-title":"J. Acquired Immune Deficiency Syndromes"},{"key":"B6","article-title":"Bert: Pre-training of deep bidirectional transformers for language understanding","author":"Devlin","year":"2019"},{"key":"B7","doi-asserted-by":"crossref","DOI":"10.1093\/oso\/9780198524847.001.0001","volume-title":"Analysis of Longitudinal Data","author":"Diggle","year":"2002"},{"key":"B8","doi-asserted-by":"publisher","first-page":"17","DOI":"10.1097\/qad.0000000000001671","article-title":"Benefits and risks of rapid initiation of antiretroviral therapy","volume":"32","author":"Ford","year":"2018","journal-title":"AIDS"},{"key":"B9","doi-asserted-by":"publisher","first-page":"e633","DOI":"10.1016\/S2352-3018(21)00152-1","article-title":"Global, regional, and national sex-specific burden and control of the HIV epidemic, 1990-2019, for 204 countries and territories: the Global Burden of Diseases Study 2019","volume":"8","year":"2021","journal-title":"Lancet HIV"},{"key":"B10","doi-asserted-by":"publisher","first-page":"1","DOI":"10.1007\/s11119-025-10276-8","article-title":"The problem of overfitting","volume":"44","author":"Hawkins","year":"2004","journal-title":"J. Chem. Inf. Comput. Sci."},{"key":"B11","doi-asserted-by":"publisher","first-page":"795","DOI":"10.1056\/NEJMoa1506816","article-title":"Initiation of antiretroviral therapy in early asymptomatic HIV infection","volume":"373","year":"2015","journal-title":"N. Engl. J. Med."},{"key":"B12","doi-asserted-by":"publisher","DOI":"10.4097\/kjae.2017.70.4.407","article-title":"Statistical data preparation: management of missing values and outliers","volume":"70","author":"Kwak","year":"2017","journal-title":"Kor J. Anesthesiol"},{"key":"B13","doi-asserted-by":"publisher","first-page":"7155","DOI":"10.1038\/s41598-020-62922-y","article-title":"BEHRT: transformer for electronic health records","volume":"10","author":"Li","year":"2020","journal-title":"Sci. Rep."},{"key":"B14","doi-asserted-by":"publisher","first-page":"1748","DOI":"10.1016\/j.ijforecast.2021.03.012","article-title":"Temporal fusion transformers for interpretable multi-horizon time series forecasting","volume":"37","author":"Lim","year":"2021","journal-title":"Int. J. Forecast"},{"key":"B15","volume-title":"Statistical Analysis With Missing Data","author":"Little","year":"2019"},{"key":"B16","article-title":"Pyraformer: Low-complexity pyramidal attention for long-range time series modeling and forecasting","author":"Liu","year":"2022"},{"key":"B17","doi-asserted-by":"publisher","first-page":"305","DOI":"10.1007\/s41060-022-00323-2","article-title":"Ensemble clustering of longitudinal bivariate HIV biomarker profiles to group patients by patterns of disease progression","volume":"14","author":"Lynch","year":"2022","journal-title":"Int. J. Data. Sci. Anal."},{"key":"B18","doi-asserted-by":"publisher","first-page":"1167","DOI":"10.1126\/science.272.5265.1167","article-title":"Prognosis in HIV-1 infection predicted by the quantity of virus in plasma","volume":"272","author":"Mellors","year":"1996","journal-title":"Sci. (New York N.Y.)"},{"key":"B19","volume-title":"Causal Inference: What If","author":"Miguel","year":"2023"},{"key":"B20","doi-asserted-by":"publisher","first-page":"S123","DOI":"10.1002\/cyto.b.20416","article-title":"Challenges in implementing CD4 testing in resource\u2010limited settings","volume":"74","author":"Peter","year":"2008","journal-title":"Cytometry Part. B. Clin. Cytometry: J. Int. Soc. For. Anal Cytol"},{"key":"B21","doi-asserted-by":"publisher","first-page":"86","DOI":"10.1038\/s41746-021-00455-y","article-title":"Med-BERT: pretrained contextualized embeddings on large-scale structured electronic health records for disease prediction","volume":"4","author":"Rasmy","year":"2021","journal-title":"NPJ Digital Med."},{"key":"B22","doi-asserted-by":"publisher","DOI":"10.1136\/bmj.i3140","article-title":"External validation of clinical prediction models using big datasets from e-health records or IPD meta-analysis: opportunities and challenges","volume":"353","author":"Riley","year":"2016","journal-title":"BMJ (Clin Res. Ed.)"},{"key":"B23","doi-asserted-by":"publisher","DOI":"10.3389\/fimmu.2018.00212","article-title":"From CD4-based initiation to treating all HIV-infected adults immediately: An evidence-based meta-analysis","volume":"9","author":"Song","year":"2018","journal-title":"Front. Immunol."},{"key":"B24","first-page":"1929","article-title":"Dropout: a simple way to prevent neural networks from overfitting","volume":"15","author":"Srivastava","year":"2014","journal-title":"J. Mach. Learn. Res."},{"key":"B25","doi-asserted-by":"publisher","first-page":"803","DOI":"10.1056\/NEJMoa1902824","article-title":"Dolutegravir plus two different prodrugs of tenofovir to treat HIV","volume":"381","author":"Venter","year":"2019","journal-title":"N. Engl. J. Med."},{"key":"B26","doi-asserted-by":"crossref","DOI":"10.18653\/v1\/P19-1580","article-title":"Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned","volume-title":"arXiv","author":"Voita","year":"2019"},{"key":"B27","volume-title":"Consolidated Guidelines on the Use of Antiretroviral Drugs for Treating and Preventing HIV Infection: Recommendations for a Public Health Approach. 2nd Ed","year":"2016"},{"key":"B28","first-page":"22419","article-title":"Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting","volume":"34","author":"Wu","year":"2021","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"B29","article-title":"Deep transformer models for time series forecasting: The influenza prevalence case","volume-title":"arXiv","author":"Wu","year":"2020"},{"key":"B30","doi-asserted-by":"publisher","first-page":"17945","DOI":"10.1038\/s41598-021-97114-9","article-title":"Additive quantile mixed effects modelling with application to longitudinal CD4 count data","volume":"11","author":"Yirga","year":"2021","journal-title":"Sci. Rep."},{"key":"B31","doi-asserted-by":"publisher","first-page":"167","DOI":"10.1002\/sim.7515","article-title":"A mechanistic nonlinear model for censored and mismeasured covariates in longitudinal models, with application in AIDS studies","volume":"37","author":"Zhang","year":"2018","journal-title":"Stat. Med."},{"key":"B32","doi-asserted-by":"crossref","DOI":"10.1609\/aaai.v35i12.17325","article-title":"Informer: Beyond efficient transformer for long sequence time-series forecasting","author":"Zhou","year":"2021"}],"container-title":["Frontiers in Cellular and Infection Microbiology"],"original-title":[],"link":[{"URL":"https:\/\/www.frontiersin.org\/articles\/10.3389\/fcimb.2026.1837493\/full","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,8,26]],"date-time":"2026-08-26T05:53:24Z","timestamp":1787723604000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.frontiersin.org\/articles\/10.3389\/fcimb.2026.1837493\/full"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,8,26]]},"references-count":32,"alternative-id":["10.3389\/fcimb.2026.1837493"],"URL":"https:\/\/doi.org\/10.3389\/fcimb.2026.1837493","relation":{},"ISSN":["2235-2988"],"issn-type":[{"value":"2235-2988","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,8,26]]},"article-number":"1837493"}}