{'fraction_non_alphanumeric': 0.028316347110549384, 'fraction_numerical': 0.014951461532255897, 'mean_word_length': 4.867466077627012, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
COVID-19 Prognosis via Self-Supervised Representation Learning and Multi-Image Prediction

The rapid spread of COVID-19 cases in recent months has strained hospital resources, making rapid and accurate triage of patients presenting to emergency departments a necessity. Machine learning techniques using clinical data such as chest X-rays have been used to predict which patients are most at risk of deterioration. We consider the task of predicting two types of patient deterioration based on chest X-rays: adverse event deterioration (i.e., transfer to the intensive care unit, intubation, or mortality) and increased oxygen requirements beyond 6 L per day. Due to the relative scarcity of COVID-19 patient data, existing solutions leverage supervised pretraining on related non-COVID images, but this is limited by the differences between the pretraining data and the target COVID-19 patient data. In this paper, we use self-supervised learning based on the momentum contrast (MoCo) method in the pretraining phase to learn more general image representations to use for downstream tasks. We present three results. The first is deterioration prediction from a single image, where our model achieves an area under receiver operating characteristic curve (AUC) of 0.742 for predicting an adverse event within 96 hours (compared to 0.703 with supervised pretraining) and an AUC of 0.765 for predicting oxygen requirements greater than 6 L a day at 24 hours (compared to 0.749 with supervised pretraining). We then propose a new transformer-based architecture that can process sequences of multiple images for prediction and show that this model can achieve an improved AUC of 0.786 for predicting an adverse event at 96 hours and an AUC of 0.848 for predicting mortalities at 96 hours. A small pilot clinical study suggested that the prediction accuracy of our model is comparable to that of experienced radiologists analyzing the same information.


Introduction
The SARS COV-2 infection (COVID-19) has caused a surge of patients with respiratory illness presenting to emergency departments worldwide throughout 2020. When patients arrive at the emergency department, hospitals need to evaluate their risk of deterioration for effective clinical decision making and resource allocation. This is especially important during a pandemic when hospital resources are strained. Initial patient assessment often includes imaging studies, and these initial assessments can be used for resource planning within the hospital. Chest X-ray radiography (CXR) is a well-established imaging examination for patients with symptoms of shortness of breath and fever [1]. Although traditionally used for diagnosis, the use of CXR has expanded to COVID deterioration prediction [2,3,4] and is a standard component of COVID patient health assessments.
Recently, new self-supervised methods which rely on contrastive losses have been shown to generate representations that are as good for classification as those generated using purely supervised methods [20,21,22,23]. The advantage of contrastive loss functions is that they are able to achieve feature extraction independent of labels or tasks associated with the pretraining dataset. These features are then used for training a classifier in the fine-tuning stage with the target data. In this paper, we study the applicability of self-supervised learning to the task of COVID-19 deterioration prediction. We pretrain a model using momentum contrast (MoCo) [22,23] on two large, public chest X-ray datasets, MIMIC-CXR-JPG [18,24,25] and CheXpert [16], and then use the pretrained model as a feature extractor for the downstream task of prediction COVID-19 patient outcomes. Concurrent to our work, Sowrirajan et al. [26] have shown that MoCo pre-training can be used to learn representations from chest X-rays that are useful for identifying the presence of pleural effusions.
We study the effectiveness of this approach on three downstream tasks: 1) adverse event prediction from single images (SIP), oxygen requirements prediction from single images (ORP), and adverse event prediction from multiple images (MIP). We find that, when using the DenseNet architecture [27,6,10], self-supervised training achieved higher areas under receiver operating characteristic curve (AUC) on a hold-out test set than supervised training for predicting an adverse event at all time points. Self-supervised pretrained models achieved higher AUC values for the oxygen requirements prediction task at early time points. We then show that performance for predicting adverse events can be further improved by making predictions based on image sequences with a Transformer model. Finally, we characterize the performance of our single-image models vs. the previous COVID-GMIC model [2] and our multi-image models vs. human radiologists in a pilot clinical study. In combination with this paper, we also open source our code and models pretrained on public data at https://github.com/facebookresearch/CovidPrognosis for other researchers interested in using them for fine-tuning on their own X-ray datasets.

Public Chest X-ray Datasets (Pretraining Data)
We used two datasets for pretraining our models [18,24,25] and CheXpert [16]. The MIMIC-CXR dataset consists of 377,110 chest X-ray images corresponding to 227,835 radiographic studies performed at the Beth Israel Deaconess Medical Center in Boston, MA. The CheXpert dataset consists of 224,316 chest radiographs of 65,240 patients compiled from chest radiographic studies performed at the Stanford Hospital. The datasets did not contain any COVID-19 patients during the time of our study as they were collected before the COVID-19 pandemic. Imaging findings included a variety of chest conditions such as atelectasis, cardiomegaly, consolidation, edema, and pleural effusion, based on a labeler designed for the CheXpert dataset [18,16]. We did not use these findings in our study beyond initial validation of the training pipeline.

COVID-19 Dataset and Deterioration Labels (Fine-tuning Data)
For fine-tuning, we used an extended version of the NYU COVID dataset previously described [2], containing 26,838 X-ray radiographs from 4,914 patients. COVID-19 prognosis can be defined by a wide array of factors. Our goal in this study is to predict patient deterioration that will require physical transfers throughout the hospital or altered equipment usage. As an example, one type of deterioration would be a transfer to the ICU. During the transfer process, a COVID-positive patient is removed from isolation, heightening the risk of intra-hospital infection. By locating at-risk patients closer to the ICU from the beginning, the the transfer time can be reduced, correspondingly reducing the risk of intra-hospital infection. Additionally, there and limited number of intensive care beds available per hospital. Predicting the need for these beds is critical to hospital resource management. Another form of deterioration is increased oxygen utilization. Normally, patients are administered oxygen via the nasal cannula. When a patient's oxygen requirements exceeds 6 L per day, oxygen administration through the nasal cannula is no longer possible and delivery must be done via a mask.
Formally, our study considers two label classes: 1) adverse events [2,3] and 2) increased oxygen requirements. An "adverse event" consists of any of the three events: transfer to the intensive care unit (ICU), intubation, or mortality. We labeled each image with whether the patient developed any adverse event within 24, 48, 72 or 96 hours of the scan. We obtained these labels by occurrences of adverse events recorded in the patient's anonymized electronic health records data shared by NYU, following previous practice [2]. We define "increased oxygen utilization" as an event where a patient requires more than 6 L of oxygen in a day. Similarly to the case of adverse events, we labeled each image in the dataset with whether the patient required increased oxygen on within 24, 48, 72, or 96 hours of the scan.

Definition of Prediction Tasks
The goal of our machine learning models is to predict deterioration labels from either single chest radiograph or sequences of chest radiographs. The first task is to predict adverse events from a single chest radiograph. This constitutes a multi-class classification setting for ICU transfer, intubation, mortality, and "Any" adverse event at 24, 48, 72, 96, and "Any" time windows (20 total labels). We call this task the Single Image Prediction (SIP) task. The second task is to predict increased oxygen requirements from a single chest radiograph. This also constitutes a multi-class classification setting with increased oxygen at 24, 48, 72, 96, and "Any" time windows (5 total labels). We call this the Oxygen Requirement Prediction (ORP) task.
Our final task is to predict adverse events from a sequence of radiographs. This task is of particular interest, as it more closely aligns with how radiologists interpret images. Radiologists use relative changes in images to identify a patient's trajectory. For this task, we considered the same multi-class classification problem as in the SIP setting. We call this task the Multiple Image Prediction (MIP) task. Table 1 shows the counts of scans and patients from the NYU COVID data in each split for each task. The tasks vary in counts due to varying selection criteria used for each task. For the SIP task, we followed the previous standard [2] in including chest radiographs of patients collected in the emergency department and excluding chest radiographs of patients who had already experienced any of the three adverse events, as they had already deteriorated. This enables us to directly compare our results to those in [2]. For the ORP task, we only included chest radiographs of patients collected in the emergency department, and did not apply any other exclusion criteria because we considered the oxygen requirement prediction to be independent of the occurrence of any adverse event. In the MIP task, the goal was to predict deterioration of patients in the emergency department and during any subsequent hospital admissions. Therefore, for this task we only excluded chest radiographs collected after a patient had experienced any adverse event.  Figure 1 shows the number of adverse events in the SIP and MIP splits as a function of time. We note the labels are necessarily monotonically increasing due to the fact that adverse events at 48 hours include all events at 24 hours, etc. We did not make any special adjustments to our models to take advantage of this aspect, but this could be a topic for future investigation.

Methods
Here we describe the models and training process. All of our proposed models were based on the DenseNet-121 architecture [27], which has been previously applied to chest radiographs [6,10,3]. We begin by describing our self-supervised pretraining procedure, then follow with the fine-tuning procedure for the SIP and ORP tasks. Lastly, we describe the development of a new transformer based architecture that we applied to the MIP task.

Self-Supervised Pretraining using Momentum Contrast Learning
The contrastive loss framework is as follows: a deep neural network is constructed for mapping an image to a latent space [20]. The neural network is trained to minimize a contrastive loss. The contrastive loss is constructed such that similar images are mapped to vectors that are closer to each other (as measured by a contrastive loss function) while dissimilar images are mapped to vectors that are further apart. Figure 2 shows an schematic of the contrastive loss training procedure.
base image Aug. 2 Figure 2: Diagram for momentum contrast training. A base image is transformed via two random augmentations (Aug. 1 and Aug. 2) into images x q and x k . x q is passed through an encoder network, while x k is passed through a momentum encoder network. The representations generated by each network are then passed into a contrastive loss that promotes similarity between the representations r q and r k .
Each training step begins by selecting a base image, x, from a training dataset of unlabeled images. Then, two different augmentations are chosen at random and applied to the base image separately to generate two augmented images, the query image x q and the key image x k . These images are passed through two different neural networks, called the encoder and the momentum encoder respectively, to generate representation r q for x q and r k for x k .
The goal of the contrastive loss is to identify that r q and r k come from the same underlying image in the presence of divergent augmentations. In practice contrastive losses usually require very large batch sizes due to the fact that many negative examples (i.e., values for r q,j and r k,i where r k,i is not from the same image) are necessary to achieve strong performance [21].
MoCo [22] is a recent contrastive loss method that avoids the need for large batch sizes by maintaining a queue of representations. Within the queue, the model stores K examples of r k,i for i ∈ [1, ..., K]. The model is then asked to identify which of the K examples is the matching one for r q . This can be modeled mathematically via the InfoNCE contrastive loss function [28]: where τ is a temperature hyperparameter and K is the number of currently stored representations. The gradient from the contrastive loss is backpropagated to the encoder network, and then the momentum encoder is updated via a momentum update [22]. The momentum update forces the momentum encoder to change more slowly than the encoder network, which helps stabilize training.

Single Image Prediction (SIP) and Oxygen Requirement Prediction (ORP) Models
The SIP and ORP tasks were described in Section 2.3. We extend the MoCo encoder model to an image classifier model by appending a linear classifier to the end of the encoder pipeline. We then fine-tune the model on the COVID image dataset, reshaping input images to a 224 × 224 grid and applying random horizontal and vertical flipping during training. We used the Adam optimizer [29] with a cosine annealing learning rate decay [30].

Multiple Image Prediction (MIP) Model
For the MIP task, we propose a new model that takes a sequence of X-ray images (x 0 , ..., x n ) along with their scan times (t 0 , ..., t n ) relative to the final scan as inputs and predicts the likelihood of adverse events occurring after the final scan. The overall model structure is shown in Figure 3. The scan times are represented as the number of hours from the final scan time. Thus, if a patient had two previous scans done, e.g., 50 hours and 20 hours before the final scan, then the scan times will be represented as (t 0 = −50, t 1 = −20, t 2 = 0). The final scan time t n is always 0.
During the forward pass, each image x i is first passed to the MoCo encoder model in parallel to obtain an image representation h i . Separately, each relative scan time t i is passed to a Continuous Position Embedding (CPE) module to learn a time embedding e i . The CPE module, described in more detail below, maps each time point to a different embedding. The two representations h i and e i for each i are then concatenated together and then projected to a lower dimension using a fully connected layer. The full sequence of images is then input to a transformer network [31]. The transformer network maps an input sequence to an output sequence of the same length using a self-attention mechanism. The output of the transformer is the sum-pooled to obtain a hidden representation f that contains aggregated information from all images. This hidden representation f is input to a linear classifier. Similar to the SIP task, the weights of the MoCo encoder are initialized to the pretrained weight values while the weights of the transformer and the linear classifier are randomly initialized. The entire network is fine-tuned jointly on a labeled dataset to mimize the binary cross entropy loss.
Continuous Positional Embedding (CPE) The CPE, inspired by the positional embedding (PE) from [31], is designed to map each time point to a d-dimensional vector representation. The CPE has the same functional form as the PE, but it can take continuous values within a certain range as input. Formally, the CPE maps a relative scan time s to a vector e as: where t ∈ [0, 360). We only include X-ray scans taken within the last 360 hours (15 days) of the end exam since the COVID-19 infection is unlikely to last longer than 15 days.
DropImage Regularizer To reduce overfitting and to improve the robustness of the MIP model, we apply a masking based regularizer that we call the DropImage regularizer. The DropImage regularizer, when applied to a an image sequence, drops a subset of images chosen independently at random. The final image is never removed. DropImage encourages learning more robust models that can make good predictions even if some of the past images were missing. Further, DropImage can also be viewed as a data augmentation scheme.

Pretraining
We applied both supervised and self-supervised pretraining procedures. Our supervised pretraining was similar to that for CheXpert [16]. For supervised pretraining, we trained the DenseNet-121 model with the Adam optimizer [29] with a learning rate of 10 −3 , weight decay of 10 −5 , and batch size of 64 on the MIMIC-JPG dataset [24]. Data augmentation included interpolation to a 224 × 224 grid and random vertical/horizontal flipping. We pretrained for 10 epochs, decaying the learning rate by a factor of 10 each epoch.
We pretrained our self-supervised model using the momentum contrast training described in Section 3.1. For data augmentation, we used random cropping and interpolation to a 224 × 224 grid, random horizontal/vertical flipping, and random Gaussian noise addition. We investigated a number of augmentation strategies for pretraining the MoCo models, including noise additions, affine transformations, color transformations, and X-ray acquisition simulation, but in the end we found that these provided little benefit beyond those in the original MoCo paper [22]. After the augmentations, we applied histogram normalization. The histogram normalization procedure preserves the relative values of the pixels by interpolating along a shifted version of the image pixel value histogram while constraining the resulting pixel values to be in the specified target range. The augmentations are described in further detail in Appendix A.
We tuned the following hyperparameters during the pretraining phase: learning rate, MoCo latent feature dimension size, and the queue size. We searched over a logarithmic scale of values, varying the learning rate within 10 {−2,−1,0} , and MoCo feature dimensions within {64, 128, 256}. The queue size was fixed at 65,536. We used a batch size of 128 for each of 8 GPUs, the largest we could achieve in initial testing, accumulating gradients using PyTorch's DistributedDataParallel framework [32,22]. We selected hyperparameters based a cross-validation analysis on the downstream tasks. We optimized models using stochastic gradient descent with momentum [33], using 0.9 as the momentum term and a weight decay parameter of 10 −4 . Pretraining took approximately four days using eight 16 GB Nvidia V100 GPUs. Figure 4 illustrates the frameworks for each of the prediction tasks over the succeeding 24 hours. Figure 4a shows an example of SIP predictions from a patient with increased lung opacity. In this case the patient did not suffer any adverse event in the next 24 hours, but ultimately suffered all three adverse events within 72 hours. Figure 4b shows an example of ORP predictions from a patient that required increased oxygeen within 24 hours. In Figure 4c, a sequence of chest X-rays with increasing lung opacity is used by the MIP model to predict COVID deterioration for a patient. The images were taken 49 hours apart. For the case of Figure 4c, the patient was transferred to the ICU, intubated, and suffered a mortality within 24 hours.

Single-Image Task Ablations
We considered both self-supervised and supervised pretraining for each of our single-image tasks (SIP and ORP). Data splits for these tasks are shown in Table 1. Following previous work [16,13,3], we compare models via their areas under receiver operator characteristic curve (AUC). In order to facilitate a straightforward comparisons, our pretraining in this section for both supervised and MoCo only used the MIMIC dataset.
Before fine-tuning for the SIP and ORP tasks, the weights of the encoder are initialized to the pretrained weight values while the weights of the linear classifier are randomly reinitialized with a uniform distribution [34]. We considered three different fine-tuning ablations. The first ablation (CL) fixed the MoCo encoder (including BatchNorm statistics) and only trained the new linear classifier [22]. The second ablation (FT) allowed the entire model to train, not just the classifier. The final ablation (FT RA) allowed the entire model to train and also incorporated further random augmentations (rotation, X-shear, Y-shear, and translations). The CL model was fine-tuned for 5 epochs. The FT models were fine-tuned for 20 epochs, and the FT RA models were fine-tuned for 40 epochs. We also show a "Scratch" ablation, which is a DenseNet model with random initialization [34] trained only on the COVID data (i.e., no pretraining).
We tuned each ablation using a stratified 5-fold cross validation of the {train,val} split of the data. We tuned learning rate in the range 10 {−4,−3,−2,−1} and optimized over all MoCo/supervised-pretrained models for model selection. We also tuned whether to use the Adam [29] or SGD [33] optimizers. All fine-tunings used the cosine annealing learning rate decay [30]. After the cross-validation, we selected the best model for each ablation and applied a bootstrap analysis to estimate performance characteristics on the test set.
To test for significance between methods we applied 1,000 bootstrap iterations to the test set and computed the difference in AUC between the best MoCo method and the best supervised pretraining method. Methods where the best MoCo AUC is significantly higher than the best supervised AUC are indicated with *. Our tables show results in two rows for each method. The top row shows the holdout test AUC, while the bottom row shows percentile bootstrap 95% confidence intervals. In some cases we have statistical significance with overlapping confidence intervals-this is because the two methods are correlated, an aspect captured in the bootstrapped AUC differences. We chose this non-parametric test over the standard method of DeLong [35,36] to maintain a consistent presentation, but in a separate analysis found the DeLong AUC difference test generally matched our non-parametric test. A comparison via AUC values for supervised vs. self-supervised pretraining for the SIP task is shown in Table 2. AUC values generally increased over longer time intervals. MoCo models had the highest AUC scores for predicting adverse events at all time windows, achieving significance at 72 and 96 hours. The MoCo PT CL model (pretrained with MoCo, only fine-tuning classification layer) had the highest AUC at 24 hours, whereas the PT FT model (which allowed the entire model to fine-tune) achieved highest AUC at 48, 72 and 96 hours. The Scratch method performed worst across all architectures and pretraining methods. Performance improved between Scratch and supervised pretraining, and then again between supervised pretraining and MoCo pretraining.
A comparison via AUC values for Supervised vs. Self-Supervised pretraining for the ORP task is shown in Table 3. The time course trend is inverted relative to Table 2, with O2 models becoming less accurate at larger time windows. In this case, Supervised pretraining models performed more similarly to MoCo-pretrained models. The MoCo PT FT model performing had the best AUC at 24 and 48 hours, while the Supervised PT CL model had the best AUC at 72 and 96 hours. Only 24 hour prediction using MoCo was significant based on the bootstrap tests.

SIP Comparison to COVID-GMIC
COVID-GMIC is a previous neural network image analysis model developed for the purpose of COVID prognosis prediction [2]. COVID-GMIC utilizes supervised pretraining with an architecture explicitly designed for synthesizing information at coarse and fine image scales [37] with supervised pretraining on the NIH dataset [17]. Our SIP experiments used the same test set that was used for the COVID-GMIC, so we compare our models directly in Table 4. For this comparison we included a different MoCo pretraining procedure where we used a combination of both the MIMIC-CXR [18] and CheXpert [16] data sets for pretraining. Despite having more data, in our 5-fold cross-validation of the train,val split the same the same model was selected as in Section 4.3.  In this case we did not apply significance testing since we did not have the raw predictions from this paper. Both the MoCo and COVID-GMIC methods are comparable across time points, with wide overlaps in confidence intervals. The widest gap in performance was for predicting adverse events in the next 24 hours, where COVID-GMIC had a 0.02 higher AUC. At longer time intervals the performance of MoCo methods began to improve, showing higher AUC scores than COVID-GMIC on the test set at 48, 72 and 96 hours. Table 5 shows ablations for the MIP task. In this case, we compared and tested the difference between the MoCo PT CL ablation and the Transformer model built on top of MoCo representations. We trained each model with the Adam optimizer [29] for 50 epochs with a batch size of 32. We tuned the following hyperparameters using grid search: learning rate, drop image probability (p drop ), projection dimension and the pooling method. We searched over learning rate values of 10 {−3,−2,−1} , p drop values in {0, 0.1, 0.2, 0.5}, projection dimension in {16, 32, 64, 128}. For the pooling method, we used either sum pooling or simply taking the final time step. We set the dropout value for the transformer and the CPE to be 0.5 and weight decay to 10 −5 . The Transformer method performed better than the single-image MoCo method for predicting adverse events at every time window with statistical significance at 24, 48, and 72 hours. A more detailed version of Table 5 comparing Single-image and multi-image prediction for other adverse events is shown in TableA1 of Appendix B. The MIP Transformer model was also better at predicting ICU transfers, intubations, and mortalities. The improvements for ICU transfers were significant at all time windows, while mortalities were significant at 72 and 96 hours. The performance differences for intubation were not statistically significant.

Reader Study
We compared the performance of our model with two chest radiologists from NYU Langone Health in a pilot reader study with a sample of 200 image sequences from the test set (note: this was a new, distinct reader study from that used previously [2]). The results of the study for "any" adverse events are shown in Table 6, while Table A2 in Appendix C shows an extended version of the data with breakdowns by adverse event category. We also present the results from averaging the prediction of both radiologists (shown as "Radiologist A + B"). For this task the radiologists indicated the presence of intubation support devices in the X-ray. We performed an audit of our selection criteria and found that in some cases these patients did not have an intubation event in the anonymized electronic health records despite having the support devices visible on the chest X-ray. In other cases, the adverse event was recorded later. Given that images with support devices were likely in the training set, we allowed radiologists to simply predict positive for any cases where they saw a support device, as this information was available to the model as well.
Both radiologists exhibited wide confidence intervals as indicated by bootstrap methods. Radiologist AUC values trended better than our model for the task of intubation prediction (Appendix C), while our model trended better for ICU transfer and mortality prediction. On the task of predicting any adverse event, our model performed better for longer term prediction. The largest differences for AUC scores between radiologists and our model occurred when predicting mortalities, where our model had better AUC scores. Radiologists were aware of the primary timeframe of the dataset (i.e., April-June 2020).

Performance Among Proposed Models
Our study examined whether performance for COVID prognosis prediction could be improved via the use of two techniques: 1) self-supervised pretraining and 2) prediction based on image sequences. Self-supervised pretraining achieved the highest AUC scores on our hold-out test set for all SIP tasks of interest. Our bootstrap statistical tests found significance at 72 and 96 hours. For ORP tasks, supervised pretraining performed similarly to MoCo pretraining, except for 24 hours. This may indicate that features associated with pathological lung findings are more predictive for oxygen requirements than for adverse events, but this topic needs to be studied further.
Interestingly, the predictions for the SIP tasks became more accurate over longer time intervals, whereas the predictions for the ORP tasks became more accurate over shorter time intervals. The SIP results could have improved due to the presence of more positive labels at the later time windows. Label scarcity hindered model performance in all test sets, as indicated by the bootstrap confidence intervals in Section 4.4 and Appendix B. However, the inversion of the trend for ORP cannot be explained by label scarcity. It could be that there are image features that become readily apparent for the ORP task close to the actual moment of increased oxygen needs.
Our greatest performance gain occurred when when predicting based on image sequences rather than single images. These improvements were statistically significant via our non-parametric tests. Radiologist sentiment indicated that it is difficult to identify patient conditions from single images, as temporal trajectories are critical for performing analyses. The results of our transformer models support this intuition, with AUC scores improving for all tasks by at least 0.01 and as much as 0.05 when using image sequences rather than individual images.

Test Set Uncertainty
A recent meta-study noted that many prediction models targeting COVID are at a high risk of overfitting and bias [38]. We addressed this via two methods: 1) pretraining on non-COVID data and 2) explicit sample selection investigation via bootstrap experiments. We observed that the final bootstrap confidence intervals in Section 4.4 were wide enough to include broad classes of ablations, corroborating the uncertainties associated with small datasets. The greatest sensitivity was with respect to positive labels, which were infrequent among the test splits for the various tasks. It would be reasonable to expect forward performance anywhere within the range of the bootstrapped confidence intervals. This uncertainty is on top of other caveats already well-known in the medical field, namely, uncertainty arising due to changes in the patient population and treatment effects.

Pilot Clinical Study Limitations
Our pilot clinical study found that our multi-image prediction model had comparable performance to human radiologists for most tasks and surpassed human radiologists in predicting mortalities. However, this study has some limitations. We asked radiologists to rate the probability of adverse events over the upcoming time windows. Depending on the hospital and local practices, this may not be a part of the standard radiologist workflow. Radiologists are typically asked to summarize imaging findings and to convey nuance with how the information in image features may impact clinical care. It is possible that with further calibration, radiologist performance could be improved for the task of adverse event prediction. We present these results to help readers put model performance in the context of currently possible clinical predictions.

Alternative Approaches
Supervised DenseNet pretraining was previously used [2] to generate higher AUC scores than we report here. The previous work included further optimizations, including a larger hyperparameter sweep and averaging predictions of several models. Some of these optimizations -in particular model ensembling -were not investigated in our study, but could lead to a closing of the gap in performance between supervised and self-supervised models that we observe in this paper.
Since the start of our work, new approaches for self-supervision have been published in the literature. Clustering can be used to relax the approach in this paper that only looks at a single image for matching [15]. Based on our ORP results, another approach that might be beneficial would be including labels as a form of weak supervision along side a constrastive loss. Investigating these alternative approaches may provide further performance improvements for the self-supervised methods.

Conclusion
The COVID-19 pandemic has created a major need for risk stratification of patients in clinical settings. Developing AI methods for this disease is difficult, as acquisition of large datasets is difficult or impossible for most medical centers. In this paper we attempted to address this problem via self-supervised contrastive loss pretraining. We found that our single-image prediction model was able to match a previous model [2] using separate advances, opening up new possibilities for research on synergies between contrastive pretraining and model architecture design. Our multi-image model performance surpassed that of all single-image models. In comparison to radiologists, our multi-image prediction model was comparable in its ability to predict patient deterioration and stronger in its ability to predict mortality. We hope these contributions will assist the community going forward on the task of hospital resource planning.

Acknowledgments
We would like to thank the IT team at the NYU hospital for their help in acquiring and curating COVID-19 X-ray data. We thank the members of the NYU medical vision team for helpful discussions and insights on X-ray data. We thank Jean-Remi King, C. Lawrence Zitnick, Mark Tygert, Marcus Rohrbach, Tullie Murrell, Michal Drozdzal, Adriana Romero and Lucas Caccia from Facebook AI Research for useful conversations on technical components of the work. We also thank Michael Chasse and Louis Mullie from University of Montreal and CHUM for sharing their knowledge on interpretation of COVID patient data. We would like to thank the Stanford CheXpert team for providing their dataset for this research. Additionally, this work at NYU was supported in part by a grant from the National Institutes of Health (P41EB017183).

A Pretraining Augmentation Parameters
For self-supervised momentum contrast pretraining, we used the following augmentations (in order): random resizing/cropping, random horizontal flipping, random vertical flipping, random Gaussian blur, Gaussian noise addition, and histogram normalization. For each sample, each random augmentation was applied with probability p = 0.5. The cropping from the random resizing/cropping augmentation was done at an image scale uniformly distributed between 20% and 100% the size of the original image.
For the blur augmentation, we applied the following normalized Gaussian kernel: where σ was selected for each sample uniformly at random between 0.1 and 2.0 pixels.
We selected the standard deviation for the noise addition randomly according to the following formula: where SNR was selected uniformly between 4 and 8 for each sample and µ image was the average pixel value of the input sample image.

B Bootstrap Results
The extended results for comparing single-image prediction to the MIP method are shown in Table A1 (* indicates bootstrap significance at α = 0.05). In this case, the Transformer-based MIP model gave larger advantages over the SIP MoCo pretrained models, with some labels being significant. This indicates the benefits when incorporating image sequences for COVID prognosis prediction.

C Reader Study (Extended)
The extended results for the reader study are shown in Table A2. In this case we bold the best-performing method when the test AUC of all other methods are outside its 95% Bootstrap confidence interval. The DenseNet MoCo PT + Transformer models had the highest test set AUC across all tasks except intubation and "Any" adverse event at 24 hours. Generally, these scores occurred with significant overlap among the bootstrap confidence intervals. The one setting where we observed significance was in the case of mortality prediction, where MIP model AUCs were substantially higher than that of radiologists across all time points.