# Accurate MRI-Based Brain Tumor Diagnosis: Integrating Segmentation and Deep Learning Approaches
## 3 Dataset  
To evaluate the performance of our methods, we used the BRATS 2018 dataset ([PERSON] et al., 2015; [PERSON] et al., 2017 a, b, c, 2018). The training set comprised images from 285 patients, including 210 with high-grade gliomas (HGG) and 75 with low-grade gliomas (LGG). The validation set included MRI scans from 66 patients with brain tumours of an unknown grade, as predefined by the BRATS challenge organisers. The test set consisted of images from 191 brain tumour patients. Of these, 77 had undergone Gross Total Resection (GTR). Their data was used to evaluate the model's ability to predict survival.Each patient was scanned using T1, T1 Gd, T2, and FLAIR. Each image was skull-stripped and resampled to a uniform resolution of 1 mm\({}^{3}\) in all dimensions. The sequences for each patient were aligned to ensure consistency. Experts manually created the ground truth segmentation masks. The model's performance was assessed on the validation and test sets using the CBICA Image Processing Portal, available at ipp.cbica.upenn.edu. Segmentation annotations included tumour subtypes such as necrotic/non-enhancing tumour (NCR), peritumoral oedema (ED), and gadolinium-enhancing tumour (ET). Below is listed the step-by-step process of training deep learning models for brain tumour classification:  
Data Preparation:  
1. Dataset collection: We started by collecting a comprehensive dataset of MRI scans, such as the BRATS (Brain Tumor Segmentation Challenge) series from 2013 to 2019. This dataset included thousands of MRI images with corresponding annotations indicating tumour regions. Image preprocessing: The collected images underwent several preprocessing steps. This included bias field correction to address intensity inhomogeneities, intensity normalisation to standardise pixel values, and data augmentation techniques such as rotations, flips, and zooms to increase the dataset's variability and improve model robustness. Segmentation:
3. Tumour segmentation: Suitable segmentation methods were applied to accurately identify tumour regions within the MRI images. Techniques like thresholding, region growth, and active contours created segmented masks that separated tumours from healthy tissues. Feature Extraction:
4. Feature extraction: Deep learning models extracted features from the segmented tumour regions, particularly convolutional neural networks (CNNs). CNNs were trained in these regions to learn distinctive features and patterns specific to brain tumours. Model Selection and Initialization:
5. Model selection: We chose five pre-trained CNN models--AlexNet, VGG16, GoogleNet, ResNet18, and ResNet50--each renowned for their effectiveness in image analysis tasks. These models were initially trained on the ImageNet dataset. 6. Transfer learning: We applied transfer learning to tailor these models specifically for brain tumour classification. This process involved fine-tuning the pre-trained models on our MRI dataset, enabling them to utilise pre-learned features while adapting to the nuances of medical images. Training Process:
7. Training image pairs: The training involved using pairs of MRI images and their annotated labels. Approximately 2000 MRI images with corresponding annotations were used. 8. Training parameters: we experimented with various training parameters, such as learning rate and batch size, to find the optimal settings for each model. 9. Regularization techniques: regularization methods, including dropout and early stopping, were employed to prevent overfitting and ensure the models generalise well to new data. 10. Training duration: the training process was conducted over 72 h on an NVIDIA Tesla V100 GPU, utilising its computational power to handle extensive data and complex computations. Ensemble Learning:
11. Ensemble learning: To enhance classification accuracy and robustness, ensemble learning techniques like bagging, boosting, and stacking were used. These methods combined the predictions of multiple models, producing a final, more accurate classification result.