# Accurate MRI-Based Brain Tumor Diagnosis: Integrating Segmentation and Deep Learning Approaches
## 2 Materials and Methods
These variations allow flexibility in balancing model complexity and computational resources, catering to different application needs [52]. ResNet, short for Residual Network, is a family of convolutional neural network (CNN) architectures introduced by Microsoft Research in 2015. The critical innovation of ResNet is its ability to address the problem of vanishing gradients in deep networks by incorporating skip or residual connections. Two prominent variants of the ResNet architecture are ResNet18 and ResNet50, which have 18 and 50 layers, respectively. These models utilise residual blocks, where the input is added to the output of the block, allowing for easier optimisation of very deep networks. This residual connection helps the model learn the difference or \"residual\" between the input and the desired output rather than learning the complete transformation from scratch. The ResNet architectures have demonstrated superior performance in image classification tasks, particularly on datasets with many classes or challenging visual patterns. By employing these residual connections, ResNet models can overcome the vanishing gradient issue when training very deep neural networks. This leads to improved performance and the ability to leverage the increased depth of the model effectively [55]. Figure 2 shows a schematic diagram of an artificial intelligence-based system designed for tumour detection and segmentation in medical images. This diagrammatic representation systematically encapsulates the fusion of convolutional neural networks with sophisticated classification algorithms, crafting a comprehensive medical imaging solution. This integration aims to elevate diagnostic precision and contribute positively to enhanced healthcare outcomes. The pipeline initiates with the acquisition of source medical images, which are subjected to a series of pre-processing techniques. These techniques typically include normalisation to adjust the pixel values for uniformity across different images, as well as other image-enhancement methods aimed at improving the visual clarity and feature consistency essential for subsequent analysis. The conditioned images are then input into a cascade of convolutional layers. Within each layer, a set of trainable filters executes spatial feature extraction by convolving with the image matrix, thereby capturing hierarchical patterns essential for complex pattern recognition. Post convolution, a rectified linear unit (ReLU) activation function is applied to each feature map to introduce non-linear transformations, which are crucial for learning non-linear complexities in image data. Followed by selective convolutional layers, max pooling operations are executed to downsample the spatial dimensions of the feature maps. This step is pivotal in reducing the computational demand and mitigating the risk of overfitting by emphasising the most salient features and suppressing the less relevant ones. The architecture further includes additional convolutional layers that refine the depth and granularity of feature extraction. Transposed convolutional layers, often referred to as deconvolutional layers, are employed to progressively rescale the feature maps back to higher resolutions, a process essential for maintaining spatial integrity in tasks such as image segmentation. The culmination of the neural network's processing is the generation of a segmented image. This output distinctly isolates and delineates the regions of interest, such as tumours, from the non-relevant background, enabling precise medical evaluations. Concurrently, the feature maps are exploited in a classification framework, where an SVM classifier operationalizes an entropy-based feature selection methodology. This approach rigorously identifies and utilises the most discriminative features for robust classification of tumour presence. To augment the model's efficacy, fine-tuning is conducted using MobileNetV2 (Figure 3), a streamlined deep neural network architected for enhanced computational efficiency on mobile and edge devices.