Differentiation of Fungal, Viral, and Bacterial Sepsis using Multimodal Deep Learning ===================================================================================== * Aaron Boussina * Karthik Ramesh * Himanshu Arora * Pratik Ratadiya * Shamim Nemati ## Abstract Sepsis is a major cause of morbidity and mortality worldwide, and is caused by bacterial infection in a majority of cases. However, fungal sepsis often carries a higher mortality rate both due to its prevalence in immunocompromised patients as well as delayed recognition. Using chest x-rays, associated radiology reports, and structured patient data from the MIMIC-IV clinical dataset, the authors present a machine learning methodology to differentiate between bacterial, fungal, and viral sepsis. Model performance shows AUCs of 0.81, 0.83, 0.79 for detecting bacterial, fungal, and viral sepsis respectively, with best performance achieved using embeddings from image reports and structured clinical data. By improving early detection of an often missed causative septic agent, predictive models could facilitate earlier treatment of non-bacterial sepsis with resultant associated mortality reduction. ## Introduction Sepsis is a major cause of morbidity and mortality around the world. In the United States alone, sepsis potentially accounts for nearly a quarter of a million excess deaths yearly1. Moreover, there are serious costs and other health burdens associated with each sepsis related admission for both patients and health systems2. While the majority of sepsis is caused by bacterial pathogens, there is a significant volume of sepsis caused by fungal and viral agents. Some estimates suggest ∼20% of sepsis is caused by fungi. Furthermore, these less common classes of infective agents can often contribute to greater morbidity and mortality, with estimates for fungal sepsis mortality ranging from 40-60%3. However, current standard culture methodologies can result in serious delays to administration of appropriate treatment. The increased mortality from fungal sepsis thus can be potentially attributed to both a more acutely ill patient population as well as delayed identification of the causative agent4. All together, further efforts to more accurately and rapidly differentiate the causative microorganism class of sepsis could prove crucial to decreasing excess associated morbidity and mortality. Previous work has established a number of patient risk factors contributing to greater likelihood of primary fungal sepsis most commonly including immunosuppression of various primary etiologies5. Additionally, there have been prior efforts to classify patients into viral, bacterial, and fungal etiologies of pneumonia based on machine learning interpretations of standard chest x-rays6. Finally, there has also been work differentiating laboratory test results between classes of sepsis7. While these efforts have all been conducted separately, there seems to have not yet been an effort to combine these disparate patient factors together to predict sepsis type. As such, in this study, the authors aim to use a coordinated multi-task approach drawing from chest-xray images, radiology reports, and clinical lab data to differentiate between bacterial, fungal, and viral sepsis in the MIMIC-IV dataset. ## Methods Predictive methods for differentiation of septic class were based on chest x-ray image, chest x-ray radiology report, and structured clinical data from the MIMIC-IV database8. Labels for the infection class were taken from the microbiology events data provided in the main MIMIC-IV database. Culture results were grouped by patient and time point to develop time specific labels for bacterial, fungal, and viral infection based on isolated organism name. As such, at any given time point it is possible for a patient to have more than one positive infective class. Patients were labeled culture positive for one day before and seven days after the order time for a positive culture result. Structured data on medications, vital signs, laboratory results, demographics, and other clinical elements was extracted directly from the MIMIC-IV database. Any patient with a microbiology result was included. Medications were processed from the prescription orders and mapped to 16 distinct classes including antibiotics, antivirals, antifungals, anticoagulants, and vasodilators. Six distinct vital signs (temperature, heart rate, respiratory rate, O2sat, systolic blood pressure, and systolic blood pressure) and one procedure (arterial line insertion) were extracted from the flowsheets. The full list of clinical variables is presented in Supplemental Table 1. All units from a patient’s encounter were included and dynamic variables were sampled and updated at hourly intervals throughout the encounter. Multiple measurements within a time bin were averaged and missing values were imputed using the last observation carried forward for 24 hours. The changes in measurement values between successive vital-signs and laboratory results as well as the number of hours since the last measurement were preserved as additional features. Sepsis labels were assigned to patients admitted to the ICU using a combined sepsis definition including Sepsis-3 and Sepsis-CMS. Patient chest x-ray images were collected from the MIMIC-CXR-JPEG9 dataset and mapped to x-ray reports and structured patient data. Features were extracted from image data using a pre-trained CheXNet model10. CheXNet, is a 121-layer convolutional neural network based on DenseNet-121 that inputs a chest X-ray image and outputs the probability of pneumonia along with a heatmap localizing the areas of the image most indicative of pneumonia. CheXNet is trained on the ChestX-ray14 dataset, which contains 112,120 frontal-view chest X-ray images individually labeled with up to 14 different thoracic diseases, including pneumonia. Images from the MIMIC-CXR-JPEG dataset were resized, and then fed into the pre-trained model to extract x-ray image embeddings. In addition to chest x-ray images, embeddings were also extracted from radiology reports using Clinical BERT11, a unique version of BERT pre-trained on 2 million notes from the MIMIC III database. Clinical BERT contains 12 transformer heads, and has a total of 110 million parameters. We concatenated together the text report into a single sequence and passed it to the model. Every sequence was padded to a 128 token sequence length after appending and tokens. The final transformer head of the model returned a 768 dimension embedding corresponding to each token in the sequence. Using the aforementioned features, a neural network was trained to classify bacterial, fungal, and viral sepsis. The network architecture is described in Figure 3 and consists of 3 hidden layers and 3 output nodes. The network outputs separate predictions for each category and allows for multiple labels. Two of the hidden layers are shared between the multiple classification tasks to enable the network to learn common representations. ReLU activation is used for all of the layers except for the output nodes which use sigmoid activation. The network was trained using Adam optimization with a learning rate of 0.005. The cost function was the average binary cross entropy loss across all three output nodes and training occurred for 100 epochs with early stopping. Model performance was evaluated on a 20% test set. Three separate experiments were run using these hyperparameters. First, the performance of the model was evaluated using only the 133 clinical features. Next, the performance was evaluated with the inclusion of the radiology report embeddings. Finally, the model was evaluated using all of the clinical features, report embeddings, and chest X-ray embeddings. The model was trained on the overall cohort and evaluated on septic patients admitted to the ICU. ![Figure 1:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2023/04/11/2023.04.10.23288378/F1.medium.gif) [Figure 1:](http://medrxiv.org/content/early/2023/04/11/2023.04.10.23288378/F1) Figure 1: Graphical representation of feature extraction and embedding generation from MIMIC-IV inpatient database) ![Figure 3:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2023/04/11/2023.04.10.23288378/F2.medium.gif) [Figure 3:](http://medrxiv.org/content/early/2023/04/11/2023.04.10.23288378/F2) Figure 3: Graphical representation of neural network used to generate multi-task predictions ![Figure 4:](http://medrxiv.org/https://www.medrxiv.org/content/medrxiv/early/2023/04/11/2023.04.10.23288378/F3.medium.gif) [Figure 4:](http://medrxiv.org/content/early/2023/04/11/2023.04.10.23288378/F3) Figure 4: Venn Diagram representation of overlapping septic labels showing total number of septic patients per class. ## Results The final cohort used for analysis is described in Table 1. The dataset consists of 170,624 encounters, 25.6% of which had positive bacterial cultures, 6.3% of which had positive fungal cultures, and 0.6% of which had viral infections. View this table: [Table 1.](http://medrxiv.org/content/early/2023/04/11/2023.04.10.23288378/T1) Table 1. Patient characteristics across microbiology results. The model performance on the septic subpopulation test set for all three experiments is presented in Table 2. The highest performing model included the clinical features as well as the radiology report embeddings from ClinicalBERT. View this table: [Table 2.](http://medrxiv.org/content/early/2023/04/11/2023.04.10.23288378/T2) Table 2. Results on the study septic population test set. ## Discussion In this work, the authors developed a model that achieves fair classification performance on identifying the infectious organism class in septic patients. To the authors’ knowledge, this is the only work to-date that has incorporated the multimodal data elements available in MIMIC IV for the purpose of infectious organism classification. A central finding of our work is that the inclusion of unstructured clinical text from the radiology report improves the classification performance, particularly for cases of bacterial infection. Interestingly, there was no additional utility from the inclusion of CheXNET embeddings on the source chest X-ray images. This suggests that under current methods, radiology reports contain the necessary information for differentiation of septic class, highlighting the value of this data source for future efforts. As expected, there was an increased length of stay for fungal culture positive patients. This aligns with established data suggesting fungal infections in septic patients represent largely nosocomial origins. Additionally, there is significant overlap between some classes of septicemia, suggesting that there are layered infectious hospital courses for patients who develop sepsis. However, in current efforts, there were no labels specified based on culture site, organism resistance, or if the culture was conducted after a lengthy inpatient stay. As such, it is difficult to quantify the severity of inpatient fungal infections accurately. Future work could potentially investigate infections of pulmonary origin alone, and include mortality data for improved label creation. As established in previous literature, there seem to be clear clinical factors which precipitate fungal infection, such that image data or radiology reports are not necessary to identify patients at high risk. Neutrophil count, C reactive protein, procalcitonin, and other laboratory measures have been cited previously as being important markers of fungal septicemia. However, this model is potentially limited by significant missingness of such measures. Moreover, there is a risk that the presence of such measures alone helps to indicate a septic patient, leading to model bias. Future efforts may focus on training and validation of the model on only a population of septic patients, as opposed to a broader inpatient population. Finally, while in this work labels were indicated positive for one day before and seven days after a positive culture result, the true clinical reality may not align with such labeling. Specifically, it is noted that signs of sepsis are often detectable in a highly variable time period ahead of culture positivity. Additionally, fungal septicemia often occurs in those patients already admitted to the hospital with further associated delays due to prolonged fungal culture timelines. ## Conclusion Fungal and viral sepsis are underdiagnosed and often superimposed varieties of sepsis with serious associated morbidity and mortality. While some efforts have been made to highlight clinically detectable differences between sepsis classes to facilitate early detection of non-bacterial sepsis, none have thus far incorporated both structured clinical data and relevant imaging. Using such a combined model, fair performance is possible on the task of sepsis class identification, with improved performance most notable through additional information types in bacterial sepsis detection. Such efforts could speed treatment of non-bacterial sepsis, reducing sepsis mortality. Future work on the matter of non-bacterial sepsis detection may include greater sophistication in assigned sepsis labels, experimentation with culture positivity allowance, and further model architecture improvements. ## Data Availability All data produced in the present study are available upon reasonable request to the authors ## Supplementary Tables View this table: [Supplementary Table 1.](http://medrxiv.org/content/early/2023/04/11/2023.04.10.23288378/T3) Supplementary Table 1. Clinical variables extracted from the structured MIMIC IV data. Missingness is reported as the percentage of encounters without a measurement. ## Acknowledgements S.N. is funded by the National Institutes of Health (R35GM143121). He is co-founder of a UCSD start-up, Healcisio Inc., which is focused on commercialization of advanced analytical decision support tools. Mr. Boussina is funded by the National Library of Medicine (#2T15LM011271-11). The opinions or assertions contained herein are the private ones of the author and are not to be construed as official or reflecting the views of the NIH or any other agency of the US Government. ## Footnotes * * Authors share co-first authorship * Received April 10, 2023. * Revision received April 10, 2023. * Accepted April 11, 2023. * © 2023, Posted by Cold Spring Harbor Laboratory This pre-print is available under a Creative Commons License (Attribution-NoDerivs 4.0 International), CC BY-ND 4.0, as described at [http://creativecommons.org/licenses/by-nd/4.0/](http://creativecommons.org/licenses/by-nd/4.0/) ## References 1. 1.Rhee C, Jones TM, Hamad Y, Pande A, Varon J, O’Brien C, et al. Prevalence, Underlying Causes, and Preventability of Sepsis-Associated Mortality in US Acute Care Hospitals. JAMA Netw Open. 2019 Feb 15;2(2):e187571. 2. 2.Paoli CJ, Reynolds MA, Sinha M, Gitlin M, Crouser E. Epidemiology and Costs of Sepsis in the United States—An Analysis Based on Timing of Diagnosis and Severity Level*: Critical Care Medicine. 2018 Dec;46(12):1889–97. 3. 3.Dolin HH, Papadimos TJ, Chen X, Pan ZK. Characterization of Pathogenic Sepsis Etiologies and Patient Profiles: A Novel Approach to Triage and Treatment. Microbiology Insights. 2019 Jan;12:117863611882508. 4. 4.Delaloye J, Calandra T. Invasive candidiasis as a cause of sepsis in the critically ill patient. Virulence. 2014 Jan;5(1):161–9. [CrossRef](http://medrxiv.org/lookup/external-ref?access_num=10.4161/viru.26187&link_type=DOI) [PubMed](http://medrxiv.org/lookup/external-ref?access_num=24157707&link_type=MED&atom=%2Fmedrxiv%2Fearly%2F2023%2F04%2F11%2F2023.04.10.23288378.atom) 5. 5.Muskett H, Shahin J, Eyres G, Harvey S, Rowan K, Harrison D. Risk factors for invasive fungal disease in critically ill adult patients: a systematic review. Crit Care. 2011;15(6):R287. doi:10.1186/cc10574 [CrossRef](http://medrxiv.org/lookup/external-ref?access_num=10.1186/cc10574&link_type=DOI) [PubMed](http://medrxiv.org/lookup/external-ref?access_num=22126425&link_type=MED&atom=%2Fmedrxiv%2Fearly%2F2023%2F04%2F11%2F2023.04.10.23288378.atom) 6. 6. Zhang Y han, Hu X fei, Ma J chao, Wang X qi, Luo H ran, Wu Z feng, et al. Clinical Applicable AI System Based on Deep Learning Algorithm for Differentiation of Pulmonary Infectious Disease. Front Med. 2021 Dec 3;8:753055. 7. 7.Heilmann E, Gregoriano C, Schuetz P. Biomarkers of Infection: Are They Useful in the ICU?. Semin Respir Crit Care Med. 2019;40(4):465–475. doi:10.1055/s-0039-1696689 [CrossRef](http://medrxiv.org/lookup/external-ref?access_num=10.1055/s-0039-1696689&link_type=DOI) 8. 8.Johnson, A., Bulgarelli, L., Pollard, T., Horng, S., Celi, L. A., & Mark, R. (2021). MIMIC-IV (version 1.0). PhysioNet. [https://doi.org/10.13026/s6n6-xd98](https://doi.org/10.13026/s6n6-xd98). 9. 9.Johnson AE, Pollard TJ, Berkowitz SJ, Greenbaum NR, Lungren MP, Deng CY, Mark RG, Horng S. MIMIC-CXR, a de-identified publicly available database of chest radiographs with free-text reports. Scientific data. 2019 Dec 12;6(1):1–8. 10. 10.Rajpurkar P, Irvin J, Zhu K, Yang B, Mehta H, Duan T, et al. CheXNet: Radiologist-Level Pneumonia Detection on Chest X-Rays with Deep Learning [Internet]. arXiv; 2017 [cited 2022 Dec 8]. Available from: [http://arxiv.org/abs/1711.05225](http://arxiv.org/abs/1711.05225) 11. 11.Alsentzer E, Murphy JR, Boag W, Weng WH, Jin D, Naumann T, et al. Publicly Available Clinical BERT Embeddings [Internet]. arXiv; 2019 [cited 2022 Dec 8]. Available from: [http://arxiv.org/abs/1904.03323](http://arxiv.org/abs/1904.03323)