# Advancing Brain Tumor Segmentation with Spectral-Spatial Graph Neural Networks
## 2 Methods and Material
### Data Preprocessing
#### 2.3.2 Creating Supervoxels  
We conducted a detailed comparison of various supervoxel segmentation algorithms for 3D Brain MRI scans, including VCCS [22], SLIC [23], Watershed [24], Mean Shift [25] and Felzenszwalb-Huttenlocher [26], and Region Growing. Our analysis centers on evaluating these algorithms using metrics like moment of inertia, homogeneity, shape uniformity, and size uniformity. This crucial part of our research aims to determine which algorithm, with its unique approach and capabilities, most effectively creates precise and reliable supervoxels, thereby laying a solid foundation for the subsequent comprehensive analysis (see Table 1). * Moment of inertia: The moment of inertia as a metric for compactness of each supervoxel in 3D brain MRI scans is a quantitative measure of the voxel points' distribution relative to the centroid. To calculate this, the centroid is first determined by averaging the \(x\), \(y\), and \(z\) coordinates of all voxels within the supervoxel. This is given by Formula (1). After finding the centroid, the moment of inertia is computed by summing the squared distances of each voxel point from this centroid across all three dimensions, as in Formula (2). We assign a uniform unit weight to each voxel within a supervoxel for the moment of inertia calculations. This approach standardizes the contribution of each voxel, simplifying the analysis and ensuring consistency across all supervoxels. \[\bar{x}=\frac{1}{N}\sum_{i=1}^{N}x_{i},\quad\bar{y}=\frac{1}{N}\sum_{i=1}^{N} y_{i},\quad z=\frac{1}{N}\sum_{i=1}^{N}z_{i}\] (1) \[I=\sum_{i=1}^{N}\Bigl{[}(x_{i}-\bar{x})^{2}+(y_{i}-\bar{y})^{2}+(z_{i}-\bar{ z})^{2}\Bigr{]}\] (2) This calculation reflects how the voxels are distributed around the centroid, providing insights into the supervoxel's shape and compactness, which are crucial for evaluating the quality of supervoxels created and consequently segmentation in medical image analysis. Following the calculation of the moment of inertia for each supervoxel in 3D brain MRI scans, the next step involves aggregating these values to assess the overall compactness of the segmentation. This is achieved by calculating the average moment of inertia across all supervoxels. Furthermore, to refine the analysis and ensure its robustness, statistical procedures are applied. This includes identifying and removing outliers, which are supervoxels whose moment of inertia significantly deviates from the norm. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Algorithm** & **Homogeneity** & **Moment of Inertia** & **Shape Uniformity** & **Size Uniformity** & **Big O** \\ \hline VCCS & 0.03 & 1.2 & 0.10 & 0.10 & ON (N log N) \\ SLIC & 0.20 & 2.8 & 0.35 & 0.30 & ON(N) \\ Watershed (3D) & 0.15 & 2.75 & 0.42 & 0.37 & ON (N log N) \\ Mean Shift (3D) & 0.18 & 3.5 & 0.55 & 0.50 & (N\({}^{\text{N}}\)) \\ Felzenszwalb–Huttenlocher & 0.19 & 3.25 & 0.40 & 0.35 & ON (N log N) \\ Region Growing & 0.25 & 3.0 & 0.48 & 0.43 & ON(N) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Supervoxel segmentation algorithm comparison. * Homogeneity: Homogeneity in supervoxel segmentation for 3D brain MRI scans assesses the uniformity of voxel properties, such as intensity values, within each supervoxel. It begins by determining the mean intensity of all voxels in a supervoxel, \(\mu=\frac{1}{N}\sum_{i=1}^{N}I_{i}\), where \(I_{i}\) is the intensity of the \(i\)-th voxel. Subsequently, the homogeneity is computed as the variance of these intensity values from the mean. Homogeneity \(=\frac{1}{N}\sum_{i=1}^{N}(I_{i}-\mu)^{2}\). After computing the homogeneity for each supervoxel, outliers are identified and removed to avoid skewing the results. The final step involves calculating the average homogeneity across all supervoxels, which provides a comprehensive measure of segmentation quality. * Shape Uniformity: In the context of 3D brain MRI scans, shape uniformity of supervoxels is crucial for understanding the geometric properties of segmented regions.