## 4 Discussion  
Large stroke datasets and machine-learning models offer a unique opportunity to facilitate decision-making in acutely critical settings, optimize personalized acute interventions, and tailor post-discharge rehabilitation plans to individual needs [47, 48]. As a modifiable risk factor and a potential treatment target in acute ICH, HE has been a focal point of research over the past few decades [9, 10, 49, 50, 51]. Recently, some studies have also developed deep learning models to predict HE from admission head CT scans, with reported AUC values in the 0.8 range [28, 52, 53, 54, 55, 56]. However, the very first step in evaluating HE is the creation of ground truth data, whether the objective is to study HE as a risk factor or to train and test predictive deep learning models. To date, all prior studies have relied on either manual segmentation of hematomas on admission and follow-up head CT scans or semi-automated segmentation followed by manual revisions [9, 10, 28, 49, 50, 51, 52, 53, 54, 55, 56]. Both approaches are time-consuming and labor-intensive. In this study, we proposed a novel pipeline for generating ground truth data for HE. This pipeline incorporates automated segmentation of hematomas on admission and follow-up scans, followed by a classification model with an optimized threshold to minimize classification errors. Our approach generates HE class annotations from admission and follow-up CT scans and identifies a subset of subjects that require visual review and manual correction of automated segmentation, thereby reducing cumulative errors from the automated segmentation model in baseline and follow-up head CTs. The pipeline generated accurate HE labels for over 98% of subjects in both the internal and external validation cohorts, while reducing the need for expert review to 10%-50% of subjects, depending on the HE definition. Although automated segmentation of hematomas is completed within seconds, reviewing the results to ensure accuracy can be time-consuming. On average, manual segmentation of hematomas takes 10 to 30 min per subject [15, 57, 58]. Automated segmentation followed by manual review or semi-automated segmentation reduces this time to 3 to 5 min per case [15, 57, 58]. Even a simple review of segmentation results without further corrections requires 1 to 3 min per case. Our pipeline optimizes the process of annotating patients with HE as the ground truth by limiting expert review of segmentation to approximately one-third of the dataset. For a modest dataset of about 300 patients, this approach can save over 7 h of expert review time. Many groups have reported the application of deep learning models for automated segmentation of ICH [14, 15, 16, 17, 18, 19, 20, 57, 58, 59] or the prediction of HE from admission head CT scans [28, 52, 53, 54, 55, 56]. However, no study to date has applied a combined segmentation and classification model to generate ground truth labels of HE in ICH datasets. Some groups have utilized image synthesis to improve ICH detection and classification on CT scans [60, 61], whereas our goal was to mitigate the cumulative errors in hematoma volume measurements from automated segmentation across two separate head CT scans, at admission and follow-up, when calculating the absolute volume increases for binary HE classification. The primary application of our pipeline is to reduce the time required for expert visual review and correction of automated hematoma segmentations in large ICH datasets. From a practical standpoint, although 100% sensitivity and specificity thresholds for HE classification maintained their performance in the external validation cohort, they were able to exclude only a small proportion of subjects from expert review of hematoma segmentation. Therefore, it may be more practical to apply high (e.g., 90% or 95%) sensitivity or specificity thresholds, allowing for a small percentage of false-negative or false-positive misclassifications, depending on which type of misclassification is permissible for given research scenarios.