key: cord-0656239-ja0c4mw8 authors: Shamout, Farah E.; Shen, Yiqiu; Wu, Nan; Kaku, Aakash; Park, Jungkyu; Makino, Taro; Jastrzkebski, Stanislaw; Wang, Duo; Zhang, Ben; Dogra, Siddhant; Cao, Meng; Razavian, Narges; Kudlowitz, David; Azour, Lea; Moore, William; Lui, Yvonne W.; Aphinyanaphongs, Yindalon; Fernandez-Granda, Carlos; Geras, Krzysztof J. title: An artificial intelligence system for predicting the deterioration of COVID-19 patients in the emergency department date: 2020-08-04 journal: nan DOI: nan sha: 364890eae890b77252db53e68955b4ab034ae5eb doc_id: 656239 cord_uid: ja0c4mw8 During the COVID-19 pandemic, rapid and accurate triage of patients at the emergency department is critical to inform decision-making. We propose a data-driven approach for automatic prediction of deterioration risk using a deep neural network that learns from chest X-ray images, and a gradient boosting model that learns from routine clinical variables. Our AI prognosis system, trained using data from 3,661 patients, achieves an AUC of 0.786 (95% CI: 0.742-0.827) when predicting deterioration within 96 hours. The deep neural network extracts informative areas of chest X-ray images to assist clinicians in interpreting the predictions, and performs comparably to two radiologists in a reader study. In order to verify performance in a real clinical setting, we silently deployed a preliminary version of the deep neural network at NYU Langone Health during the first wave of the pandemic, which produced accurate predictions in real-time. In summary, our findings demonstrate the potential of the proposed system for assisting front-line physicians in the triage of COVID-19 patients. In recent months, there has been a surge in patients presenting to the emergency department (ED) with respiratory illnesses associated with SARS CoV-2 infection (COVID-19) [1, 2] . Evaluating the risk of deterioration of these patients to perform triage is crucial for clinical decision-making and resource allocation [3] . While ED triage is difficult under normal circumstances [4, 5] , during a pandemic, strained hospital resources increase the challenge [2, 6] . This is compounded by our incomplete understanding of COVID-19. Data-driven risk evaluation based on artificial intelligence (AI) could, therefore, play an important role in streamlining ED triage. As the primary complication of COVID-19 is pulmonary disease, such as pneumonia [7] , chest X-ray imaging is a first-line triage tool for COVID-19 patients. Although other imaging modalities, such as computer tomography (CT), provide higher resolution, chest X-ray images are less costly, inflict a lower radiation dose, and are easier to obtain without incurring the risk of contaminating imaging equipment and disrupting radiologic services [8] . In addition, abnormalities in the chest X-ray images of COVID-19 patients have been found to mirror abnormalities in CT scans [9] . Consequently, chest X-ray imaging is considered a key tool in assessing COVID-19 patients [10] . Unfortunately, although the knowledge of the disease is rapidly evolving, understanding of the correlation between pulmonary parenchymal patterns visible in the chest X-ray images and clinical deterioration is limited. This motivates the use of machine learning approaches for risk stratification using chest X-ray imaging, which may be able to learn such correlations automatically from data. The majority of related previous works using imaging data of COVID-19 patients concentrate more on diagnosis than prognosis [11, 12, 13, 14, 15, 16, 17, 18] . Prognostic models have a number of potential real-life applications, such as: consistently defining and triaging sick patients, alerting bed management teams on expected demands, providing situational awareness across teams of individual patients, and more general resource allocation [11] . Prior methodology for prognosis of COVID-19 patients via machine learning mainly use routinely-collected clinical variables [2, 19] such as vital signs and laboratory tests, which have long been established as strong predictors of deterioration [20, 21] . Some studies have proposed scoring systems for chest X-ray images to assess the severity and progression of lung involvement using deep learning [22] , or more commonly, through manual clinical evaluation [7, 23, 24] . In general, the role of deep learning for the prognosis of COVID-19 patients using chest X-ray imaging has not yet been fully established. In this work, we present an AI system that performs an automatic evaluation of deterioration risk, based on chest X-ray imaging, combined with other routinely collected non-imaging clinical variables. The goal is to provide support for critical clinical decision-making involving patients arriving at the ED in need of immediate care [2, 25] . We designed our system to satisfy a clinical need of frontline physicians. We were able to build it due to the availability of a large-scale chest X-ray image dataset. The system is based on chest X-ray imaging, which is already being employed as a first-line triage tool in hospitals [7] , while also incorporating other routinely collected non-imaging clinical variables that are known to be strong predictors of deterioration. Our AI system uses deep convolutional neural networks to perform risk evaluation from chest Xray images. In particular, we base our work on the Globally-Aware Multiple Instance Classifier (GMIC) [26, 27] , which is designed to provide interpretability by highlighting the most informative regions of the input images. We call this imaging-based model COVID-GMIC. The system also learns from routinely collected clinical variables using a gradient boosting model (GBM) [28] which we call COVID-GBM. Both models are trained using a dataset of 3,661 patients admitted to NYU Langone Health between March 3, 2020, and May 13, 2020. The outputs of COVID-GMIC and COVID-GBM are combined to predict the risk of deterioration of individual patients over different time horizons, ranging from 24 to 96 hours. In addition, our system includes a model, which we call COVID-GMIC-DRC, that predicts how the risk of deterioration is expected to evolve over time, in the spirit of survival analysis [29] . Our system is able to accurately predict the deterioration risk on a test set of new patients. It achieves an area under the receiver operating characteristic curve (AUC) of 0.786 (95% CI: 0.742-0.827), and an area under the precision recall curve (PR AUC) of 0.517 (95% CI: 0.434, 0.605) for prediction of deterioration within 96 hours. Additionally, its estimated probability of the temporal risk evolution discriminates effectively between patients, and is well-calibrated. The imaging-based model achieves a comparable AUC to two experienced chest radiologists in a reader study, highlighting the potential of our data-driven approach. In order to verify our system's performance in a real clinical setting, we silently deployed a preliminary version of it at NYU Langone Health during the first wave of the pandemic, demonstrating that it can produce accurate predictions in real-time. Overall, these results strongly suggest that our system is a viable and valuable tool to inform triage of COVID-19 patients. Figure 1 : Overview of the AI system and the architecture of its deep learning component. a, Overview of the AI system that assesses the patient's risk of deterioration every time a chest X-ray image is collected in the ED. We design two different models to process the chest X-ray images, both based on the GMIC neural network architecture [26, 27] . The first model, COVID-GMIC, predicts the overall risk of deterioration within 24, 48, 72, and 96 hours, and computes saliency maps that highlight the regions of the image that most informed its predictions. The predictions of COVID-GMIC are combined with predictions of a gradient boosting model [28] that learns from routinely collected clinical variables, referred to as COVID-GBM. The second model, COVID-GMIC-DRC, predicts how the patient's risk of deterioration evolves over time in the form of deterioration risk curves. b, Architecture of COVID-GMIC. First, COVID-GMIC utilizes the global network to generate four saliency maps that highlight the regions on the X-ray image that are predictive of the onset of adverse events within 24, 48, 72, and 96 hours respectively. COVID-GMIC then applies a local network to extract fine-grained visual details from these regions. Finally, it employs a fusion module that aggregates information from both the global context and local details to make a holistic diagnosis. . It is important to note that the extent of parenchymal disease does not necessarily have a direct correlation with deterioration time. For example, Example 5 has less severe parenchymal findings than Examples 3 and 4, but deteriorated faster. b, Flowchart showing how the inclusion and exclusion criteria were applied to obtain the final training and test sets, where n represents the number of chest X-ray exams, and p represents the number of unique patients. We excluded chest X-ray images that had missing radiology reports or patient encounter information to ensure data completeness, as well as chest X-ray images that were collected after a patient had experienced an adverse event, since deterioration had already occurred. We included patients who were discharged, and patients who had experienced in-hospital mortality, in order to obtain a full record of adverse events. We also manually checked for images of already intubated patients, and excluded them. In the test set, we only included images collected in the ED, and excluded images collected during inpatient encounters. Dataset. Our AI system was developed and evaluated using a dataset collected at NYU Langone Health between March 3, 2020 and June 28, 2020. 1 The dataset consists of chest X-ray images collected from patients who tested positive for COVID-19 using the polymerase chain reaction (PCR) test, along with the clinical variables recorded closest to the time of image acquisition (e.g. vital signs, laboratory test results, and patient characteristics). The training set consisting of 5,617 chest X-ray images was used for model development and hyperparameter tuning, while the test set consisting of 832 images was used to report the final results. The training and the test sets were disjoint, with no patient overlap. Table 1 summarizes the overall demographics and characteristics of the patient cohort in the training and test sets. Supplementary Table 1 summarizes the associated clinical variables included in the dataset. We define deterioration, the target to be predicted by our models, as the occurrence of one of three adverse events: intubation, admission to the intensive care unit (ICU), and in-hospital mortality. If multiple adverse events occurred, we only consider the time of the first event. Figure 2. a shows examples of chest X-ray images collected from different patients. Although the patient in example 5 had less severe parenchymal findings than patients in examples 3 and 4, the patient was intubated within 24 hours compared to 48 and 96 hours in examples 3 and 4. This highlights the difficulty of assessing the risk of deterioration using only chest X-ray images, since the extent of visible parenchymal disease is not fully predictive of the time of deterioration. Model performance. Table 2 summarizes the performance of all the models in terms of the AUC and PR AUC for the prediction of deterioration within 24, 48, 72, and 96 hours from the time of the Table 1 : Description of the characteristics of the patient cohort included in the training and test sets used to develop and evaluate our system. The training and test sets are similar in terms of age, BMI, and proportion of females. We note that there is a higher proportion of chest X-ray images associated with deterioration across all time windows in the test set compared to the training set. This implies that there is a higher incidence of adverse events amongst ED patients than inpatients, since the test set only includes chest X-ray images collected from ED patients, while the training set also includes inpatients. Characteristic To illustrate the interpretability of COVID-GMIC, we show in Figure 3 the saliency maps for all time windows (24, 48, 72 , and 96 hours) computed for four examples from the test set. Across all four examples, the saliency maps highlight regions that contain visual patterns such as airspace opacities and consolidation, which are correlated with clinical deterioration [22, 24] . These saliency maps are utilized to guide the extraction of six regions of interest (ROI) patches cropped from the entire image, which are then associated with a score that indicates its relevance to the prediction task. We also note that in the last example, the saliency maps highlight right mid to lower paramediastinal and left mid-lung periphery, while missing the dense consolidation in the periphery of the right upper lobe. This suggests that COVID-GMIC emphasizes only the most informative regions in the image, while human experts can provide a more holistic interpretation covering the entire image. It might, therefore, be useful to enhance GMIC through a classifier agnostic mechanism [31] , which finds all the useful evidence in the image, instead of solely the most discriminative part. We leave this for future work. Comparison to radiologists. We compared the performance of COVID-GMIC with two chest radiologists from NYU Langone Health (with 3 and 17 years of experience) in a reader study with a sample of 200 frontal chest X-ray exams from the test set. We used stratified sampling to improve the representation of patients with a negative outcome in the reader study dataset. We describe the design of the reader study in more detail in the Methods section. As shown in Table 2 , our main finding is that COVID-GMIC achieves a comparable performance to radiologists across all time windows in terms of AUC and PR AUC, and outperforms radiologists for Table 2 : Performance of the outcome classification task on the held-out test set, and on the subset of the test set used in the reader study. We include 95% confidence intervals estimated by 1,000 iterations of the bootstrap method [30] . The optimal weights assigned to the COVID-GMIC prediction in the COVID-GMIC and COVID-GBM ensemble were derived through optimizing the AUC on the validation set as described in Supplementary Figure 2 .b. The ensemble of COVID-GMIC and COVID-GBM, denoted as 'COVID-GMIC + COVID-GBM', achieves the best performance across all time windows in terms of the AUC and PRAUC, except for the PR AUC in the 96 hours task. In the reader study, our main finding is that COVID-GMIC outperforms radiologists A & B across time windows longer than 24 hours, with 3 and 17 years of experience, respectively. Note that the radiologists did not have access to clinical variables and as such their performance is not directly comparable to the COVID-GBM model; we include it only for reference. The area under the precision-recall curve is sensitive to class distribution, which explains the large differences between the scores on the test set and the reader study subset. 48 , 72, and 96 hours. For example, COVID-GMIC achieves AUC of 0.808 (95% CI, 0.746-0.866) compared to AUC of 0.741 average AUC of both radiologists in the 96 hours prediction task. We hypothesize that COVID-GMIC outperforms radiologists on this task due to the currently limited clinical understanding of which pulmonary parenchymal patterns predict clinical deterioration, rather than the severity of lung involvement [24] . Supplementary Figure 5 shows AUC and PR AUC curves across all time windows. Deterioration risk curves. We use a modified version of COVID-GMIC, referred to hereafter as COVID-GMIC-DRC, to generate discretized deterioration risk curves (DRCs) which predict the evaluation of the deterioration risk based on chest X-ray images. Figure 4 .a shows the DRCs for all the patients in the test set. The DRC represents the probability that the first adverse event occurs before time t, where t is equal to 3, 12, 24, 48, 72, 96, 144, and 192 hours. The mean DRCs of patients who deteriorate (red bold line) is significantly higher than the mean DRCs of patients who are discharged without experiencing any adverse events (blue bold line). We evaluate the performance of the model using the concordance index, which is computed on patients in the test set who experienced adverse events. For a fixed time t the index equals the fraction of pairs of patients in the test data for which the patient with the higher DRC value at t experiences an adverse event earlier. For t equal to 96 hours, the concordance index is 0.713 (95% CI: 0.682-0.747), which demonstrates that COVID-GMIC-DRC can effectively discriminate between patients. Other values of t yield similar results, as reported in Supplementary Table 5 . empirical probabilities, we divided the patients into deciles according to the value of the DRC at each time t. We then computed the fraction of patients in each decile that suffered adverse events up to t. The fraction is plotted against the mean DRC of the patients in the decile. The diagram shows that these values are similar across the different values of t, meaning the model is well-calibrated (for comparison, perfect calibration would correspond to the diagonal black dashed line). Prospective silent validation in a clinical setting. Our long-term goal is to deploy our system in existing clinical workflows to assist clinicians. The clinical implementation of machine learning models is a very challenging process, both from technical and organizational standpoints [32] . To test the feasibility of deploying the AI system in the hospital, we silently deployed a preliminary version of our AI system in the hospital system and let it operate in real-time beginning on May 22, 2020. The deployed version includes 15 models that are based on DenseNet-121 architectures, and use only chest X-ray images. The models were developed to predict deterioration within 96 hours using a subset of our data collected prior to deployment from 3,425 patients. The models were serialized and served with TensorFlow Serving components [33] on an Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz; no GPUs were used. Images are preprocessed as explained in the Methods section. Our system produces predictions essentially in real-time -it takes approximately two seconds to extract an image from the DICOM receiver (C-STORE), apply the image preprocessing steps, and get the prediction of a model as a Tensorflow [33] output. Of In this work, we present an AI system that is able to predict deterioration of COVID-19 patients presenting to the ED, where deterioration is defined as the composite outcome of mortality, intubation, or ICU admission. The system aims to provide clinicians with a quantitative estimate of the risk of deterioration, and how it is expected to evolve over time, in order to enable efficient triage and prioritization of patients at the high risk of deterioration. The tool may be of particular interest for pandemic hotspots where triage at admission is critical to allocate limited resources such as hospital beds. Recent studies have shown that chest X-ray images are useful for the diagnosis of COVID-19 [12, 13, 15, 19, 34] . Our work supplements those studies by demonstrating the significance of this imaging modality for COVID-19 prognosis. Additionally, our results suggest that chest X-ray images and routinely collected clinical variables contain complementary information, and that it is best to use both to predict clinical deterioration. This builds upon existing prognostic research, which typically focuses on developing risk prediction models using non-imaging variables extracted from electronic health records [19, 35] . In Supplementary Table 4 , we demonstrate that our models' performance can be improved by increasing the dataset size. The current dearth of prognosis models that use both imaging and clinical variables may partly be due to the limited availability of large-scale datasets including both data types and outcome labels, which is a key strength of our study. In order to assess the clinical benefits of our approach, we conducted a reader study, and the results indicate that the proposed system can perform comparably to radiologists. This highlights the potential of data-driven tools for assisting the interpretation of X-ray images. The proposed deep learning model, COVID-GMIC, provides visually intuitive saliency maps to help clinicians interpret the model predictions [36] . Existing works on COVID-19 often use external gradient-based algorithms, such as gradCAM [37] , to interpret deep neural network classifiers [38, 39, 40] . However, visualizations generated by gradient-based methods are sensitive to minor perturbation in input images, and could yield misleading interpretations [41] . In contrast, COVID-GMIC has an inherently interpretable architecture that better retains localization information of the more informative regions in the input images. We performed prospective validation of an early version of our system through silent deployment in a hospital which uses the Epic electronic health record system. The results suggest that the implementation of our AI system in the existing clinical workflows is feasible. Our model does not incur any overhead operational costs on data collection, since chest X-ray images are routinely collected from COVID-19 patients. Additionally, the model can process the image efficiently in real-time, without requiring extensive computational resources such as GPUs. This is an important strength of our study, since very few studies have implemented and prospectively validated risk prediction models in general [42] . To the best of our knowledge, our study is the first to do so for the prognosis of COVID-19 patients. Our approach has some limitations that will be addressed in future work. The silent deployment was based only on the model that processes chest X-ray exams, and did not include routine clinical variables, nor any interventions. The performance of this model dropped from an AUC of 0.748 (95% CI: 0.708-0.790) during retrospective evaluation to 0.717 (95% CI: 0.622-0.801) during prospective validation, suggesting that the model may need to be fine-tuned as additional data is collected. In addition, further validation is required to assess whether the system can improve key performance measures, such as patient outcomes, through prospective and external validation across different hospitals and electronic health records systems. Our system currently considers two data types, which are chest X-ray images and clinical variables. Incorporating additional data from patient health records may further improve its performance. For example, the inclusion of presenting symptoms using natural language processing has been shown to improve the performance of a risk prediction model in the ED [25] . Although we focus on chest X-ray images because pulmonary disease is the main complication associated to COVID-19, COVID-19 patients may also suffer poor outcomes due to non-pulmonary complications such as: non-pulmonary thromboembolic events, stroke, and pediatric inflammatory syndromes [43, 44, 45] . This could explain some of the false negatives incurred by our system; therefore, incorporating other types of data that reflect non-pulmonary complications may also improve prognostic accuracy. Our system was developed and evaluated using data collected from the NYU Langone Health in New York, USA. Therefore, it is possible that our models overfit to the patient demographics and specific configurations in the imaging acquisition devices of our dataset. Our findings show the promise of data-driven AI systems in predicting the risk of deterioration for COVID-19 patients, and highlights the importance of designing multi-modal AI systems capable of processing different types of data. We anticipate that such tools will play an increasingly important role in supporting clinical decision-making in the future. Outline. In this section, we first introduce our data collection and preprocessing pipeline. We then formulate the adverse event prediction task and present our multi-modal approach which utilizes both chest X-ray images and clinical variables. Next, we formally define deterioration risk curve (DRC) and introduce our X-ray image-based approach to estimate DRC. Subsequently, we summarize the technical details of model training and implementation. Lastly, we describe the design of the reader study. Dataset collection and preparation. We extracted a dataset of 19,957 chest X-ray exams collected from 4,772 patients who tested positive for COVID-19 between March 2, 2020, and May 13, 2020. We applied inclusion and exclusion criteria that were defined in collaboration with clinical experts, as shown in Figure 2 .b. Specifically, we excluded 783 exams that were not linked to any radiology report, nine exams that were not linked to any encounter information, and 5,213 exams from patients who were still hospitalised by May 13, 2020. To ensure that our system predicts deterioration prior to its occurrence, we excluded 6,260 exams that were collected after an adverse event and 187 exams of already intubated patients. The final dataset consists of 7,502 chest X-ray exams corresponding to 4,204 unique patients. We split the dataset at the patient level such that exams from the same patient exclusively appear either in the training or test set. In the training set, we included exams that were collected both in the ED and during inpatient encounters. Since the intended clinical use of our model is in the ED, the test set only includes exams collected in the ED. This resulted in 5,224 exams (5, 617 images) in the training set and 770 exams (832 images) in the test set. We included both frontal and lateral images, however there were less than 50 lateral images in the entire dataset. The data used to evaluate the models during deployment consist of 375 exams from 217 patients collected between May 22, 2020 and June 24, 2020. The exams were filtered based on the same criteria described above. Among the 375 exams, 25 chest X-ray exams were collected from patients who were admitted to the ICU within 96 hours, and six exams were collected from patients who were intubated within 96 hours. After extracting the images from DICOM files, we applied the following preprocessing procedure. We first thresholded and normalized pixel values, and then cropped the images to remove any zero-valued pixels surrounding the image. Then, we unified the dimensions of all images by cropping the images outside the center and rescaling. We performed data augmentation by applying random horizontal flipping (p = 0.5), random rotation (-45 to 45 degrees), and random translation. Supplementary Figure 1 shows the distribution of the size of the images prior to data augmentation, as well as examples of images before and after preprocessing. In addition to the chest X-ray images, we extracted clinical variables for patients including patient demographics (age, weight, and body mass index), vital signs (heart rate, systolic blood pressure, diastolic blood pressure, temperature, and respiratory rate), and 25 lab test variables listed in Supplementary Table 1 . All vital signs were collected prior to the chest X-ray exam. Adverse event prediction. Our main goal is to predict clinical deterioration within four time windows of 24, 48, 72, and 96 hours. We frame this as a classification task with binary labels y = [y 24 , y 48 , y 72 , y 96 ] indicating clinical deterioration of a patient within the four time windows. The probability of deterioration is estimated using two types of data associated with the patient: a chest X-ray image, and routine clinical variables. We use two different machine learning models for this task: COVID-GMIC to process chest X-ray images, and COVID-GBM to process clinical variables. For each time window t ∈ T a = {24, 48, 72, 96}, both models produce probability estimates of clinical deterioration,ŷ t COVID-GMIC ,ŷ t COVID-GBM ∈ [0, 1]. In order to combine the predictions from COVID-GMIC and COVID-GBM, we employ the technique of model ensembling [46] . Specifically, for each example, we compute a multi-modal prediction y ENSEMBLE as a linear combination ofŷ COVID-GMIC andŷ COVID-GBM : where λ ∈ [0, 1] is a hyperparameter. We selected the best λ by optimizing the average of the AUC and PR AUC on the validation set. In Supplementary Figure 2 .b, we show the validation performance ofŷ ENSEMBLE for varying λ. Clinical variables model. The goal of the clinical variables model is to predict the risk of deterioration when the patient's vital signs are measured. Thus, each prediction was computed using a set of vital sign measurements, in addition to the patient's most recent laboratory test results, age, weight, and body mass index (BMI). The laboratory test results were represented as maximum and minimum statistics of all values collected within 12 hours prior to the time of the vital sign measurement. The feature sets of vital signs and laboratory tests were then processed using a gradient boosting model [28] which we refer to as COVID-GBM. For the final ensemble prediction,ŷ ENSEMBLE , we combined the COVID-GMIC prediction with the COVID-GBM prediction computed using the most recently collected clinical variables prior to the chest X-ray exam. In cases where there were no clinical variables collected prior to the chest X-ray, we performed a mean imputation of the predictions assigned to the validation set. Chest X-ray image model. We process chest X-ray images using a deep convolutional neural network model, which we call COVID-GMIC, based on the GMIC model [26, 27] . COVID-GMIC has two desirable properties. First, COVID-GMIC generates interpretable saliency maps that highlight regions in the X-ray images that correlate with clinical deterioration. Second, it possesses a local module that is able to utilize high-resolution information in a memory-efficient manner. This avoids aggressive downsampling of the input image, a technique that is commonly used on natural images [47, 48] , which may distort and blur informative visual patterns in chest X-ray images such as basilar opacities and pulmonary consolidation. In Supplementary Table 2 , we demonstrate that COVID-GMIC achieves comparable results to DenseNet-121, a neural network model that is not interpretable by design, but is commonly used for chest X-ray analysis [49, 50, 51, 52] . The architecture of COVID-GMIC is schematically depicted in Figure 1 .b. COVID-GMIC processes an X-ray image x ∈ R H,W (H and W denote the height and width) in three steps. First, the global module helps COVID-GMIC learn an overall view of the X-ray image. Within this module, COVID-GMIC utilizes a global network f g to extract feature maps h g ∈ R h,w,n , where h, w, and n denote the height, width, and number of channels of the feature maps. The resolution of the feature maps is chosen to be coarser than the resolution of the input image. For each time window t ∈ T a , we apply a 1×1 convolution layer with sigmoid activation to transform h g into a saliency map A t ∈ R h,w that highlights regions on the X-ray image which correlate with clinical deterioration. 2 Each element A t i,j ∈ [0, 1] represents the contribution of the spatial location (i, j) in predicting the onset of adverse events within time window t. In order to train f g , we use an aggregation function f agg : R h,w → [0, 1] to transform all saliency maps A t for all time windows t into classification predictionsŷ global : where H + denotes the set containing the locations of the r% largest values in A t , and r is a hyperparameter. The local module enables COVID-GMIC to selectively focus on a small set of informative regions. As shown in Figure 1 , COVID-GMIC utilizes the saliency maps, which contain the approximate locations of informative regions, to retrieve six image patches from the input X-ray image, which we call region-of-interest (ROI) patches. Figure 3 shows some examples of ROI patches. To utilize high-resolution information within each ROI patchx ∈ R 224,224 , COVID-GMIC applies a local network f l , parameterized as a ResNet-18 [47] , which produces a feature vectorh k ∈ R 512 from each ROI patch. The predictive value of each ROI patch might vary significantly. Therefore, we utilize the gated attention mechanism [53] to compute an attention score α k ∈ [0, 1] that indicates the relevance of each ROI patchx for the prediction task. To aggregate information from all ROI patches, we compute an attention-weighted representation: The representation z is then passed into a fully connected layer with sigmoid activation to generate a predictionŷ local . We refer the readers to Shen et al. [27] for further details. The fusion module combines both global and local information to compute a final prediction. We apply global max pooling to h g , and concatenate it with z to combine information from both saliency maps and ROI patches. The concatenated representation is then fed into a fully connected layer with sigmoid activation to produce the final predictionŷ fusion . In our experiments, we chose H = W = 1024. Supplementary Table 2 shows that COVID-GMIC achieves the best validation performance for this resolution. We parameterize f g as a ResNet-18 [47] which yields feature maps h g with resolution h = w = 32, and number of channels n = 512. During training, we optimize the loss function: where BCE denotes binary cross-entropy and β is a hyperparameter representing the relative weights on an 1 -norm regularization term that promotes sparsity of the saliency maps. During inference, we useŷ fusion as the final prediction generated by the model. Estimation of deterioration risk curves. The deterioration risk curve (DRC) represents the evolution of the deterioration risk over time for each patient. Let T denote the time of the first adverse event. The DRC is defined as a discretized curve that equals the probability P (T ≤ t i ) of the first adverse event occurring before time t i ∈ {t i |1 ≤ i ≤ 8}, where t 1 = 3, t 2 = 12, t 3 = 24, t 4 = 48, t 5 = 72, t 6 = 96, t 7 = 144, t 8 = 192 (all times are in hours). Following recent work on survival analysis via deep learning [54] , we parameterize the DRC using a vector of conditional probabilitiesp ∈ R 8 . The i th entry of this vector,p i , is equal to the conditional probability of the adverse event happening before time t i given that no adverse event occurred before time t i−1 , that is: 3p Given an estimate ofp, the DRC can be computed applying the chain rule: We use the GMIC model to estimate the conditional probabilitiesp from chest X-ray images. We refer to this model as COVID-GMIC-DRC. As explained in the previous section, the GMIC model has three different outputs corresponding to the global module, local module and fusion module. When estimating conditional probabilities for the eight time intervals, we denote these outputs bŷ p global ,p local , andp fusion . During inference, we use the output of the fusion module,p fusion , as the final prediction of the conditional-probability vectorp. We use an input resolution of H = W = 512 and parameterize f g as ResNet-34 [47] . where l s is the negative log-likelihood of the conditional probabilities. For a patient who had an adverse event between t i−1 and t i (where t 0 = 0), this negative log-likelihood is given by The framework can easily incorporate censored data corresponding to patients whose information is not available after a certain point. The negative log-likelihood corresponding to a patient, who has no information after t i and no adverse events before t i , equals Note that eachp i is estimated only using patients that have data available up to t i . The total negative log-likelihood of the training set is equal to the sum of the individual negative log-likelihoods corresponding to each patient, which makes it possible to perform minimization efficiently via stochastic gradient descent. In contrast, deep learning models for survival analysis based on Cox proportional hazards regression [55] require using the whole dataset to perform model updates [56, 57, 58] , which is computationally infeasible when processing large image datasets. Model training and selection. In this section, we discuss the experimental setup used for COVID-GMIC, COVID-GMIC-DRC, and COVID-GBM. The chest X-ray image models were implemented in PyTorch [59] and trained using NVIDIA Tesla V100 GPUs. The clinical variables models were implemented using the Python library LightGBM [28] . We initialized the weights of COVID-GMIC and COVID-GMIC-DRC by pretraining them on the ChestX-ray14 dataset [60] (Supplementary Table 3 compares the performance of different initialization strategies). We used Adam [61] with a minibatch size of eight to train the models on our data. We applied data augmentation during training and testing, but not during validation. During testing, we augmented each image ten times and averaged the corresponding outputs to produce the final prediction. We optimized the hyperparameters using random search [62] . (we sampled 80% of the data for training and 20% of the data was used for validation). We performed cross-validation using three different random splits for each hyperparameter configuration. We then selected the top three hyperparameter configurations based on the average validation performance across the three splits. Finally, we combined the nine models from the top three hyperparameter configurations by averaging their predictions on the held-out test set to evaluate the performance. This procedure is formally described in Supplementary Algorithm 1. Design of the reader study The reader study consists of 200 frontal chest X-ray exams from the test set. We selected one exam per patient to increase the diversity of exams. We used stratified sampling to ensure that a sufficient number of exams in the study corresponded to the least common outcome (patients with adverse outcomes in the next 24 hours). In more detail, we oversampled exams of patients who developed an adverse event by sampling the first 100 exams only from patients from the test set that had an adverse outcome within the first 96 hours. The remaining 100 exams came from the remaining patients in the test set. The radiologists were asked to assign the overall probability of deterioration to each scan across all time windows of evaluation. for useful discussions. We also gratefully acknowledge the support of Nvidia Corporation with the donation of some of the GPUs used in this research. This work was supported in part by grants from the National Institutes of Health (P41EB017183, R01LM013316) and the National Science Foundation (HDR-1922658, HDR-1940097 ). Supplementary Note 1: Image preprocessing In Supplementary Figure 1 .a, we show the heights and widths of the images prior to data augmentation. In Supplementary Figure 1 .b, we show an example of a raw image and the final image after applying the preprocessing steps in Figure 1.c. b Raw image c Preprocessed image a Raw image sizes Supplementary Figure 1 : (a) Heights and widths (in pixels) of images prior to data augmentation. (b) An example raw image. (c) To ensure that the inputs to the model have a consistent size, we perform center cropping and rescaling. In addition, we apply random horizontal flipping, rotation, and translation to augment the training dataset. The statistics of the clinical variables that were used to develop the COVID-GBM models are listed in Table 1 . The raw laboratory test variables were further processed to extract the minimum and maximum statistics. The average importance of the top ten features computed by the COVID-GBM models are shown in Supplementary Figure 2 .a. The importance of a feature is measured by the numbers of times the feature is used to split the data across all trees in a single COVID-GBM model. Age is amongst the top ten features across all time windows, which is consistent with existing findings that mortality is more common amongst elderly COVID-19 patients than younger patients [64] . The inclusion of the vital sign variables, amongst the top ten features across all models, is also aligned with existing research suggesting that they are strong indicators of deterioration [20] . DenseNet-121-based models. DenseNet [48] is a deep neural network architecture which consists of dense blocks in which layers are directly connected to every other layer in a feed-forward fashion. It achieves strong performance on benchmark natural images dataset, such as CIFAR10/100 [65] and ILSVRC 2012 (ImageNet) dataset [66] while being computationally efficient. Here we compare COVID-GMIC to a specific variant of DenseNet, DenseNet-121, which has been applied to process chest X-ray images in the literature [49, 50, 51, 52] . The model assumes an input size of 224×224. We applied DenseNet-121-based models to predict deterioration and also to compute deterioration risk curves. We initialized the models with weights pretrained on the ChestX-ray14 dataset [60] , provided at https://github.com/arnoweng/CheXNet. We used weight decay in the optimizer. To perform hyperparameter search, we sampled the learning rate and the rate of weight decay per step uniformly on a logarithmic scale between 10 Impact of input image resolution. Prior work on deep learning for medical images [67] report that using high resolution input images can improve performance. In this section, we analyze the impact of image resolution on our tasks of interest. We consider the following image sizes: 128×128, 256×256, 512×512, and 1024×1024. We pretrain all models on the ChestX-ray14 dataset [60] and then fine-tune them on our dataset. Results on the test set are reported in Supplementary Table 2 . The DenseNet-121 based model achieves the best AUCs when using an image size of 256 × 256, and the best concordance index for 512×512. Further increasing the resolution does not improve performance. COVID-GMIC achieves the best performance for the highest input image resolution of 1024×1024, while achieving the best concordance index for 512×512. While a further increase in performance may be possible, we did not consider any larger image sizes resolutions because the computational cost would become prohibitively high. Impact of different transfer learning strategies. In data-scarce applications, it is crucial to pretrain deep neural networks on a related task for which a large dataset is available, prior to finetuning on the task of interest [68, 69] . Given the relatively small number of COVID-19 positive cases in our dataset, we investigate the impact of different weight initialization strategies on our results. Specifically, we compare three strategies: 1) initialization by He et al. [70] , 2) initialization with weights from models trained on natural images (ImageNet [66] ), and 3) initialization with weights from models trained on chest X-ray images (ChestX-ray14 dataset [60] ). We apply the initialization procedure to all layers except the last fully connected layer, which is always initialized randomly. We then fine-tune the entire network on our COVID-19 task. Based on results shown in Supplementary Table 3 , fine-tuning the network from weights pretrained on the ChestX-ray14 dataset is the most effective strategy for COVID-GMIC. This dataset contains over 100,000 chest X-ray images from more than 30,000 patients, including many with advanced lung disease. The images are paired with labels representing fourteen common thoracic observations: atelectasis, cardiomegaly, effusion, infiltration, mass, nodule, pneumonia, pneumothorax, consolidation, edema, emphysema, fibrosis, pleural thickening, and hernia. By pretraining a model to detect these conditions, we hypothesize that the model learns a representation that is useful for our downstream task of COVID-19 prognosis. Supplementary Table 3 : Model performance with 95% confidence intervals across three different initialization strategies: random initialization, initialization with the weights of the model pretrained on ImageNet [66] and initialization with the weights of the model pretrained model on the ChestX-ray14 dataset [60] . We report AUCs for each time window in the outcome classification task. When evaluating the deterioration risk curves, we report the concordance index with a reference time of 96 hours, as well as the average of the index over all discretized times ( Impact of training set size. We evaluated the impact of the sample size used for training our machine learning models. Specifically, we evaluated our models on a subset of the training data, obtained by randomly sampling 12.5%, 25%, and 50% of the exams. Table 4 presents the AUCs and PR AUCs and the concordance indices achieved on the test set. It is evident that the performance of COVID-GMIC and COVID-GBM improve when increasing the number of images and clinical variables used for training, which highlights the importance of using a large dataset. Supplementary Table 4 : Model performance with 95% confidence intervals when using 12.5%, 25%, 50%, and 100% of the training data. We report AUCs for each time window in the adverse event prediction task. When evaluating the deterioration risk curves, we report the concordance index with a reference time of 96 hours, as well as the average of the index over all discretized times (3, 12, 24, 48, 72, 96, 144, and 192 hours Table 2 . In Supplementary Table 5 , we show the concordance index results across all time intervals for the best DenseNet-121 and COVID-GMIC-DRC models. Supplementary Table 5 : Concordance index (with 95% confidence intervals) of the DRC curves generated by the best DenseNet-121 and COVID-GMIC-DRC models. Both models use input images of size 512×512 and are pretrained on the ChestX-ray14 dataset [60] . The results shows that the concordance index does not change much with the choice of time reference. Creating a COVID-19 surge clinic to offload the emergency department Machine learning to assist clinical decision-making during the COVID-19 pandemic Redesigning emergency department operations amidst a viral pandemic Point of no return: COVID-19 and the us health care system: An emergency physician's perspective Emergency department and hospital crowding: causes, consequences, and cures Stop doing needless things! Saving healthcare resources during COVID-19 and beyond Chest X-ray in new coronavirus disease 2019 (COVID-19) infection: findings and correlation with clinical outcome ACR recommendations for the use of chest radiography and computed tomography (CT) for suspected COVID-19 infection Frequency and distribution of chest radiographic findings in COVID-19 positive patients The role of chest imaging in patient management during the COVID-19 pandemic: a multinational consensus statement from the fleischner society How might ai and chest imaging help unravel COVID-19's mysteries? Radiol CoroNet: A deep neural network for detection and diagnosis of COVID-19 from chest X-ray images COVIDiagnosis-net: Deep Bayes-SqueezeNet based diagnostic of the coronavirus disease 2019 (COVID-19) from X-ray images Artificial intelligence distinguishes COVID-19 from community acquired pneumonia on chest ct Automated detection of COVID-19 cases using deep neural networks with X-ray images A fully automatic deep learning system for COVID-19 diagnostic and prognostic analysis Clinically applicable AI system for accurate diagnosis, quantitative measurements, and prognosis of COVID-19 pneumonia using computed tomography Classification of COVID-19 patients from chest ct images using multi-objective differential evolution-based convolutional neural networks Prediction models for diagnosis and prognosis of COVID-19 infection: systematic review and critical appraisal National early warning score (news) 2: Standardising the assessment of acute-illness severity in the nhs. report of a working party Deep interpretable early warning system for the detection of clinical deterioration Automated assessment of COVID-19 pulmonary disease severity on chest radiographs using convolutional siamese neural networks COVID-19 outbreak in italy: experimental chest X-ray scoring system for quantifying and monitoring disease progression Clinical and chest radiography features determine patient outcomes in young and middle age adults with COVID-19 Clinical decision support systems for triage in the emergency department using intelligent systems: a review Globally-aware multiple instance classifier for breast cancer screening An interpretable classifier for high-resolution breast cancer screening images utilizing weakly supervised localization Lightgbm: A highly efficient gradient boosting decision tree An introduction to the bootstrap Classifier-agnostic saliency map extraction Challenges in the deployment and operation of machine learning in practice TensorFlow: Large-scale machine learning on heterogeneous distributed systems Automatic detection of coronavirus disease (COVID-19) using X-ray images and deep convolutional neural networks Machine learning for clinical outcome prediction Interpretable machine learning in healthcare Grad-cam: Visual explanations from deep networks via gradient-based localization Exploring the active mechanism of berberine against hcc by systematic pharmacology and experimental validation Explainable deep learning for pulmonary disease and coronavirus COVID-19 detection from X-rays Generalizability of deep learning tuberculosis classifier to COVID-19 chest radiographs: New tricks for an old algorithm? Sanity checks for saliency maps Prospective and external evaluation of a machine learning model to predict in-hospital mortality of adults at time of admission Venous and arterial thromboembolic complications in COVID-19 patients admitted to an academic hospital in Large-vessel stroke as a presenting feature of COVID-19 in the young Kawasaki-like disease: emerging complication during the COVID-19 pandemic Ensemble methods in machine learning Deep residual learning for image recognition Densely connected convolutional networks CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning A novel approach for multi-label chest X-ray classification of common thorax diseases Sdfn: Segmentation-based deep fusion network for thoracic disease classification in chest X-ray images Multi-label chest X-ray image classification via category-wise residual attention learning Attention-based deep multiple instance learning A scalable discrete-time survival model for neural networks Cox-nnet: an artificial neural network method for prognosis prediction of high-throughput omics data DeepSurv: personalized treatment recommender system using a cox proportional hazards deep neural network Early triage of critically ill COVID-19 patients using deep learning PyTorch: An imperative style, high-performance deep learning library ChestX-ray8: Hospital-scale chest X-ray database and benchmarks on weaklysupervised classification and localization of common thorax diseases A method for stochastic optimization Random search for hyper-parameter optimization Monte Carlo cross validation Clinical features of COVID-19 in elderly patients: A comparison with young and middle-aged patients Learning multiple layers of features from tiny images ImageNet: A Large-Scale Hierarchical Image Database High-resolution breast cancer screening with multi-view deep convolutional neural networks A survey on transfer learning How transferable are features in deep neural networks? Delving deep into rectifiers: surpassing human-level performance on ImageNet classification The authors would like to thank Mario Videna, Abdul Khaja and Michael Constantino for supporting our computing environment, Philip P. Rodenbough (the NYUAD Writing Center) and Catriona C. Geras for revising the manuscript, and Boyang Yu, Jimin Tan, Kyunghyun Cho and Matthew Muckley The authors declare no competing interests. We visualize the receiver operating characteristic (ROC) and precision-recall (PR) curves on the test set in Supplementary Figure 4 . In a, we group the results based on the predictive models (COVID-GMIC, COVID-GBM, and the ensemble of both), while in b, we group the performances based on the time window of the task (i.e., 24, 48, 72, and 96 hours). In Supplementary Figure 5 , we visualize the ROC and PR curves on the test set considered in the reader study. Table 2 . We describe our model selection procedure used throughout the paper in Algorithm 1. For the ablation study in Table 4 , we control the size of the dataset by setting the parameter u to 12.5, 25 and 50. Specifically, in that experiment, we randomly sampled u% of the training set D t as the "universe" U that our model used for training and validation.