Abstract / Summary
Objectives: Intraoperative ultrasound (IOUS) is an increasingly valuable real-time imaging modality in neurosurgery, enabling visualization of brain parenchyma, tumor margins, ventricular anatomy, and vascular structures during cranial procedures. Despite its clinical relevance, the development of artificial intelligence (AI)-assisted interpretation tools for neurosurgical IOUS has been limited by the scarcity of large, annotated datasets. Manual pixel-level annotation of ultrasound video frames is labor-intensive, requires specialized neuroanatomical expertise, and scales poorly. To address this bottleneck, we developed a proof-of-concept interactive semi-automated annotation pipeline designed to explore the feasibility of scalable, expert-guided labeling for intraoperative neurosurgical IOUS. Methods: We implemented the system as a napari-based graphical interface coupled with a scikit-learn Random Forest (RF) pixel classifier. Real intraoperative neurosurgical ultrasound videos from five craniotomy cases were used as training material. A neurosurgical expert annotated a minimal set of representative frames using brush-based labeling to define anatomical classes of interest. For each labeled pixel, a feature vector was computed comprising raw intensity, multi-scale Gaussian filtering ({sigma} = 1, 2, 3), Laplacian of Gaussian, and Sobel edge magnitude. The RF classifier was trained on accumulated annotations using class-balanced weighting and out-of-bag (OOB) validation, then applied across full video sequences. An incremental accumulator module enabled multi-case training. Segmentation outputs were exported as TIFF overlays for expert quality review. Results: Across five intraoperative cases, sparse expert annotation of a small number of representative frames per case was sufficient to train case-specific Random Forest classifiers that propagated labels across the full video sequences. Out-of-bag estimation served as an internal coherence check during training, and the classifier additionally produced per-class probability maps that exposed regions of uncertainty at acoustic boundaries. On expert qualitative review, the auto-segmented frames were anatomically coherent, with the classifier reliably distinguishing anechoic fluid compartments from echogenic tissue interfaces; residual misclassification was concentrated in low-contrast boundary regions. Conclusions: This proof-of-concept study demonstrates that semi-automated, expert-guided annotation of intraoperative neurosurgical ultrasound is technically feasible using classical machine learning. By combining neurosurgical domain expertise with an interactive, incremental annotation workflow applied to real intraoperative acquisitions, this framework represents a foundational step toward scalable generation of labeled datasets for neurosurgical IOUS. Future directions include formal multi-rater validation, expanded multi-class anatomical labeling, and eventual migration to deep learning architectures as annotated datasets grow.