$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
Dataset description and exploratory analysis
The dataset consists of multiple sources to enhance the reliability and accuracy of the model. Merged_dataset contains 20,620 images from Dataset A (3,054), Dataset B (3,264), Dataset C (10,000), and Dataset D (4,292). Further, 1,425 images from the Brad data set were added for Glioma tumor grades (HGG, LGG). This diverse dataset will ensure better generalization, reduce biases, and improve the performance of the model. The large dataset enables comprehensive evaluations and thus, there is a higher probability of getting the right predictions in real-world applications of classification tasks.
Two distinct datasets were used in this investigation. Between 2005 and 2010, the first was acquired from Tianjing Medical University's Nanfang Hospital and General Hospital in China. T1-weighted contrast-enhanced images from 233 individuals with tumors, as well as Glioma Grades II and III, are included in the collection. The dataset offers a very comprehensive distribution of tumor categories and general data analysis. For High-Grade Glioma (HGG), there are 1,050 images available, and for Low-Grade Glioma (LGG), there are 375 images, meaning there is more attention given to more severe cases (HGG).
Figure 1 shows MRI scans that are categorized into three brain tumor types. Each row is one type of tumor, and there are three sample images for each category. The scans have different characteristics in various orientations and views, including axial, sagittal, and coronal. Glioma samples have irregular structures that infiltrate the brain tissues. Meningioma samples appear as localized masses near the surface of the brain, and pituitary tumor samples are located near the center of the brain. These examples present variability in tumor appearance, thus helping train ML models for accurate detection as well as classification of tumors in medical image analysis.

Figure 1: MRI scans of tumors. MRI scans of meningioma, glioma, and pituitary tumors in axial, sagittal, and coronal views, highlighting distinct imaging characteristics. Please click here to view a larger version of this figure.
Glioma has the highest number of images, which is just above 6,000. Meningioma has around 6,000 images, while Pituitary has almost as many images as Meningioma. There seems to be an almost equal split between the three categories, meaning that each of the tumor types is represented well for training or any analysis. Glioma has the biggest median file size, although meningioma has a more constrained range and more outliers. The pituitary's moderate variance contains a few apparent outliers. Each category contains some really huge file sizes.
Figure 2 shows the PCA of image features for the three tumor types. Principal component 1 captures the most variance and significantly separates the pituitary (right cluster) from the others. Gliomas and meningiomas overlap down the left, indicating that their feature representations are comparable and that their separability is diminished.

Figure 2: PCA of image features. Principal component analysis of extracted features differentiating glioma, meningioma, and pituitary tumor classes. Please click here to view a larger version of this figure.
The correlation heatmap shown in Figure 3 depicts the relationships between image metadata attributes: File_Size, height, and width. File_Size shows a very low correlation with both height (-0.01) and width (0.0039).

Figure 3: Correlation heatmap of metadata. Heatmap showing relationships among image metadata attributes such as file size, height, and width. Please click here to view a larger version of this figure.
Height and width also show a very low positive correlation of 0.0039. The diagonal values are 1, indicating perfect correlation of each variable with itself. In general, the attributes are mostly uncorrelated, which means independent variations among file size, image height, and width.
Methodology and proposed architecture
A workflow that systematically detects, classifies, and analyzes brain tumors based on MRI data is represented in Figure 4. The methodology includes advanced preprocessing, segmentation, and DL techniques to achieve robust tumor prediction and classification.

Figure 4: Workflow of proposed methodology. Stepwise workflow for tumor detection, classification, and analysis using MRI data. Please click here to view a larger version of this figure.
The process initiates with integrating a number of datasets (denoted as A, B, C, and D). Then, the datasets are combined into one comprehensive dataset to gain holistic data. It also involves the Brad Dataset for image segmentation, clustering, and classification purposes. The merged dataset involves appending all images in each dataset and combined directories, ensuring a comprehensive and unified dataset for further analysis and multi-classification model development.
Second, preprocessing is completed, which is an important step in improving the quality and variability of the data. Nine augmentation processes are applied to the original MRI images to improve model performance and dataset variety. Image resizing to a common size harmonizes them, and RGB to grayscale conversion simplifies processing. Horizontal/vertical flipping improves robustness, and rotation with zooming mimics different imaging conditions. Use of Sobel filtering improves feature acuteness, and noise addition improves variability. Unsharp masking improves image acuteness, and height and width shifting add position variations. Each of them, when combined, improves the model's generalizability and classification accuracy. All these guarantee that the model generalizes over a broad spectrum of imaging situations. There is a total of 20,620 MRI images, and post preprocessing total images used for model development yields 185,580 images.
Then, the merged dataset is segmented using the U-Net model, which is highly utilized in medical imaging. The architecture is fine-tuned and trained to identify tumor regions from MRI scans. This step produces masked images, which highlight the tumor and eliminate irrelevant details. Segmenting the images ensures better data inputs for classification and analysis.
In next step, these models are fine-tuned to categorize images into different classes, leveraging transfer learning to enhance accuracy while reducing training time. For classification, a number of pretrained deep learning models are used, each with special benefits. Because of its ease of use and efficiency in image categorization, VGG16 and VGG19 are frequently utilized. With optimal computational efficiency, EfficientNetB0 and EfficientNetB7 offer cutting-edge performance. ResNet101's deeper architecture improves classification accuracy by effectively capturing intricate patterns. Afterwards, accurate diagnosis is ensured by the trained algorithms' classification of MRI data into four tumor classifications. Glial cells are the source of glioma tumors, which impair brain function. Meningioma tumors develop in the meninges, which are protective layers of the brain and spinal cord. The pituitary gland is the site of pituitary tumors, which affect hormone balance and physiological processes.
Then, to help with accurate diagnosis, clustering techniques such as K-Nearest Neighbors (KNN) are used to forecast tumor grades. Grades three and four of High-Grade Glioma (HGG) denote severe tumor development. Grades 1 and 2 of Low-Grade Glioma (LGG) are slower-growing, less aggressive tumors, respectively. This grading is essential to establish the aggressiveness of the tumor and, therefore, direct clinical management.
Finally, to assess the categorization models' efficacy, they are contrasted according to important criteria. Their effects are evaluated to ascertain whether augmentation and segmentation strategies have improved model performance. To guarantee dependability and effectiveness, performance is also examined over a variety of datasets, and classification accuracy is contrasted with the most advanced models.
The workflow integrates data preparation, preprocessing, segmentation, classification, and grading in a coherent framework. It enhances the accuracy of brain tumor detection and classification through the application of cutting-edge DL methods and rigorous preprocessing. The inclusion of tumor grading further supports clinical decision-making, making this a comprehensive system for tumor analysis.

Figure 5: Deep learning framework. Proposed brain tumor classification framework using deep learning models. Please click here to view a larger version of this figure.
Figure 5 is an architecture in relation to a medical image classification system that identifies brain tumors with the aid of advanced computational techniques such as deep learning. It begins with a collection of MRI images that is being classified. Thus, this will be the backbone for the classifying process. Then, input data enter a data preprocessing module wherein the normalization, or resizing and image augmentation, as well as the removal of noise, are undertaken. Preprocessing standardizes input images to make the most of the model's training phases. The entire step is about getting ready to undergo subsequent computationally intensive stages. Following the preprocessing step, the data are fed to the feature extraction module. Here, the use of computational techniques or models, perhaps DL models such as CNNs, can be made to identify features in images. The features that are extracted could include patterns indicative of abnormalities or tumor characteristics. Then, this set of features is input into the classification model. Given that this would probably be aimed at distinguishing different classes, which include the existence or nonexistence of a tumor and the type of tumor, the model relies on a rather complex architecture, probably of Inception-ResNet-v2, among others, for accurate predictions. It determines whether or not a tumor exists in the scanned brain image. This classification step is into "Tumor" and "No Tumor." When a tumor is found, the system classifies the tumor type as Glioma, Meningioma, or Pituitary. Each of these types has characteristics that the model recognizes using the features extracted. For the tumors identified, the grade of the tumor is then determined. Grades range from 1 to 4, indicating the severity and progression of the tumor. Grade 1 is the least aggressive, while Grade 4 is the most severe. This classification helps in medical diagnosis and treatment planning. Final outputs include the absence or presence of tumor and its type and grade. Such output is very valuable for clinical applications for decision-making in the care and treatment of patients.
The process represents an integrated pipeline for medical image analysis and classification of tumor types. Starting with raw data, it goes on in succession through preparatory data, extraction of features, and classification. The system determines whether it indeed has a tumor, specifies its type, and gives the severity or grade. This pipeline, using more complex forms of computation, streamlines the diagnosis in medical imaging so that the assessments can be quicker and more accurate in brain tumors. A modular workflow ensures flexibility, where components can be optimized separately for enhanced performance.