## 2 Materials and Methods
### Optimizing HE Classification Model  
* Definition of HE: to facilitate patient risk stratification, HE is typically defined as a binary outcome based on an absolute (e.g., \(\geq\)6 mL) or relative (e.g., \(\geq\)33%) volume increase. However, since relative volume increases are highly sensitive to potential errors in baseline hematoma quantification and can easily vary for small baseline ICHs, we adopted a series of absolute volume increases for binary definition of HE as proposed previously--i.e., \(\geq\)3, \(\geq\)6, \(\geq\)9, and \(\geq\)12.5 mL [13]. Using the manual segmentation of hematomas to generate the baseline (Vbaseline) and follow-up (Vfollowup) volumes, the absolute HE was calculated as follows: \[Absolute\;HE=V_{followup}-V_{baseline}\]
* Using the \(Absolute\;HE\), we generated binary ground truth classifications for \(\geq\)3, \(\geq\)6, \(\geq\)9, and \(\geq\)12.5 mL expansions;
* Direct HE classification based on automated hematoma segmentation results: using volumes from automated hematoma segmentation by the nn-UNET model, we generated a binary HE classification based on absolute volume increases from baseline to follow-up scans;
* Training HE classification models to improve subjects' annotation (Figure 2): as mentioned in the Introduction section, direct HE classification based on hematoma volumes from automated segmentation is susceptible to cumulative errors from the segmentation model in both baseline and follow-up scans. To address this, we applied CNN models [32] specialized for medical image classification to predict HE annotation with inputs from both admission and follow-up scans as well as segmentation masks. A benefit of such a model is creating a probability range to identify subjects that require further review and potential correction of segmentations based on desired sensitivity or specificity. We applied stratified 5-fold cross-validation, maintaining the ratio of class labels (positive/negative) across each fold. This ensures each fold represents the overall distribution of classes, which is very important when the data are imbalanced. A total of 684 cases from Yale were randomly split (4-to\(-\)1) into 548 training cases (136 with HE \(\geq\) 3 mL, 105 with HE \(\geq\) 6 mL, 82 with HE \(\geq\) 9 mL, and 68 with HE \(\geq\) 12.5 mL) and 136 validation cases (35 with HE \(\geq\) 3 mL, 24 with HE \(\geq\) 6 mL, 20 with HE \(\geq\) 9 mL, and 16 with HE \(\geq\) 12.5 mL). * We modified a DenseNet-121 model [32] to accept four inputs, baseline and follow-up CT scans, along with their respective hematoma segmentation masks, for HE prediction (Figure 2, Figures S1 and S2). The model was trained with loss_function = BCEWithLogitsLoss(), learning rate = 0.0001, weight_decay = 1 \(\times\) 10\({}^{-5}\), optimizer = Adam, scheduler = ReduceLROnPlateau, the number of epochs = 100, early stopping, dropout probability = 0.1, and image size = (128,128,128). After cross-validation, the optimized hyperparameters were used to train the final model on the whole dataset. * Combining CNN with Support Vector Machines (SVMs): the CNN performs two primary tasks: feature extraction using convolution, pooling, and dropout layers, and classification through fully connected and linear layers. Many studies have demonstrated that combining CNNs with SVMs [35] yields better performance than using linear layers in a CNN alone [36; 37]. We used the features from the CNN's final layer as input for an SVM for HE classification. We used C-Support Vector Classification from Sklearn with a Radial Basic Function Kernel and the default configuration [38]. The inputs for the SVM were 4 \(\times\) 1024 features from the last layer of the DenseNet extracted from baseline and follow-up head CTs and corresponding automated hematoma segmentation masks. Figure 2: The pipeline for HE classification. Head CT scans were preprocessed for skull stripping, adjusting the intensities to the brain window/level, and resampling and registering to a common size space.