# Advanced Brain Tumor Segmentation Using SAM2-UNet
## 3 Materials and Methods
### BraTS 2020 Dataset  
The BraTS 2020 (Brain Tumor Segmentation 2020) [6] dataset is a benchmarking dataset in the biomedical domain, especially for brain tumor segmentation. The BraTS 2020 dataset contains multi-modal images of magnetic resonance imaging scans of 369 patients suffering from gliomas (tumor). The multi-modal data are a collection of four channels of modalities, the first of which is T1-weighted; this shows the structure and composition of the brain tissue and also helps to identify tumors, cysts, and abnormalities.  
The other channels of modalities are T1 ce (T1 enhanced with gadolinium agent; this improves the visibility of the abnormalities or anomalies in the brain tissue [5]), as shown in the Figure 2, T2 (T2-weighted; this highlights the fluid content in the brain tissue), and T2-FLAIR (fluid-attenuated inversion recovery; this suppresses the fluid signals in order to make it very easy to identify lesions that are very hard to spot in all the other channels), along with the segmentation mask, which shows the ground truth of the patient's tumor as NT, specifying the segment as not a tumor, NCR/NET, which specifies a necrotic and non-enhancing tumor, ED, which specifies a peritumoral edema, or ET, which specifies a GD-enhancing tumor. BraTS 2020 is widely used to evaluate the performance of segmenting algorithms and in advanced research on automated tumor detection [12], and it is publicly available on kaggle and dedicated to advanced research on the automated segmentation of tumors.  
The BraTS 2020 dataset is split into training and testing subsets according to the traditional ratio; that is, 80% of the dataset is used for training and 20% of the dataset is used for testing as shown in Figure 3, i.e., out of 369 magnetic resonance imaging scans, 295 scans are chosen for training and 74 scans are chosen for testing, as shown in the Table 1.  
Each channel consists of 155 matrices or slices, as shown in Figure 4, denoting the depth of the dataset, as this is a 3-dimensional dataset and every 2-dimensional matrix is about 240 \(\times\) 240, i.e., height \(\times\) width. Thus, the dataset contains 240 \(\times\) 240 \(\times\) 155 images for  
\begin{table}
\begin{tabular}{l c c} \hline \hline
**Dataset** & **Size** & **Percentage** \\ \hline Training & 295 & 80\% \\ Validation & 29 & 10\% [Train] \\ Testing & 74 & 20\% \\ \hline \hline \end{tabular}
\end{table}
Table 1: BraTS 2020 training, validation and test sets.  
Figure 3: Visual representation of data distribution showing an 8:2 ratio for training and test sets.  
Figure 2: Axial slices at index 95/155 for patient 355. Images are shown for T1, T1 ce, T2, and T2-FLAIR modalities, respectively.  
every modality, where there are 4 modalities in this case. In order to depict the data from the MRI scans, all the figures portrayed are of patient number 355, and as BraTS 2020 is a 3D dataset, we sliced the 95 th 2D matrix of the 155 matrices and generated plots. As each image is a 3D image that can be displayed from several viewpoints, axial wedges display slices from top to bottom, coronal slices display slices from front to back, and sagittal slices display slices from left to right, or vice versa. Modality T1 shows the presence of a tumor, and T1 ce displays a more contrasting boundary, whereas T2 and T2-FLAIR display the tumor area more clearly and precisely, as shown in Figure 2. Along with these, the ground-truth label data are also provided for training purposes in this dataset. The label for each voxel consists of 4 labels, where label 3 is omitted in the dataset. Label 0 is used for non-tumor (NT) areas, and label 1 is used for marking NCR/NET areas (recrotic and non-enhancing tumors). Label 2 is used to mark the peritumoral area of an edema. Label 4 is used to mark the GD-enhancing area. These four are visualized in Figures 5 and 6.