DOI : 10.5281/zenodo.23641821
- Open Access
- Authors : Sahana N R
- Paper ID : IJERTV15IS100597
- Volume & Issue : Volume 15, Issue 10 , October – 2026
- Published (First Online): 25-10-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Brain Image Segmentation and Detection
Sahana N R
Electronics and Communication Engineering,Kalpataru Institute of Tecnologies Tiptur,India
AbstractThis paper presents the design of a desktop pipeline for binary brain tumor detection and suspected region highlighting in two- dimensional magnetic resonance images. The proposed workflow resizes input images to 256 Ă— 256 pixels, converts them to grayscale, and applies Gaussian, median, or bilateral filtering. Fixed-length image features are used to train Logistic Regression and support vector machine classifiers. A separate thresholding and morphology stage produces a provisional region overlay for cases predicted as tumor positive. A PyQt interface supports file loading, filter selection, model selection, and result visualization. The design follows the scope of project KS5721. No dataset, trained model, test labels, or measured outputs were supplied with the project specification; therefore, this paper reports an implementation method and evaluation protocol without claiming diagnostic or segmentation accuracy. Subject-disjoint classification testing and mask-based segmentation evaluation are required before performance can be established.Brain tumor review from MRI images requires careful visual interpretation. This proposed system accepts an MRI image, resizes it to 256 Ă— 256 pixels, converts it to grayscale, applies a selectable Gaussian, median or bilateral filter, and predicts the presence of a tumor using Logistic Regression or a support vector machine. A separate image processing step creates a visual overlay of a suspected region in positive images. A PyQt desktop interface presents the input, processed image and class label. The region overlay is an image processing estimate and must be checked against annotated ground truth before any segmentation performance claim. The application is intended as an educational or research aid and does not establish a medical diagnosis.
Index Termsbrain MRI, brain tumor detection, image segmentation, Logistic Regression, support vector machine, PyQt.
-
INTRODUCTION
MRI provides tissue contrast for examining intracranial structures and abnormalities. Manual interpretation of large image sets calls for specialist review and can be time consuming. Automated image analysis can assist research workflows by applying consistent preprocessing and presenting candidate findings for inspection. It must be tested on independent data before use in any clinical setting.
This work addresses two related but distinct outputs: image-level binary detection and pixel-level highlighting. Detection assigns a label to the entire image, whereas segmentation aims to identify the abnormal pixels. A classifier label does not establish an accurate tumor boundary. Project KS5721 calls for resize and grayscale conversion, three selectable filters, Logistic Regression and SVM classification, suspected region visualization, and a PyQt graphical interface .The contribution of this paper is a reproducible system design and a defined evaluation protocol for this classical machine learning pipeline. The supplied scope is a quotation rather than a completed experimental study; consequently, results are presented as planned measurements instead of fabricated values.MRI captures soft tissue contrast that can help identify abnormalities in the brain. Manual review of multiple images takes time and calls for specialist judgment. The project demonstrates an accessible image processing and classical machine learning workflow for rapid binary screening and visual exploration. Classification answers whether an image belongs to a tumor-positive category; segmentation attempts to identify pixels corresponding to a suspected region. These are different tasks and must be evaluated separately.
-
RELATED WORK
Bauer et al. reviewed brain MRI analysis with emphasis on segmentation, registration, and anatomical variability in tumor-bearing images [1]. Gordillo et al. surveyed automatic and semiautomatic segmentation and emphasized that accurate, reproducible separation of abnormal tissue is difficult [2]. Menze et al. introduced the BraTS benchmark, which helped standardize evaluation of multimodal brain tumor segmentation [4]. Pereira et al. evaluated convolutional networks for pixel-level segmentation and showed the value of annotated masks and standardized benchmarks.
The proposed KS5721 system uses classical image features and classifiers for an accessible CPU-based baseline. Its heuristic overlay
is fundamentally different from a segmentation model trained on expert delineations. Literature performance values must not be transferred to the proposed system.
-
PROBLEM FORMULATION
Develop a computer based tool that loads brain MRI images, applies reproducible preprocessing, classifies them into tumor-positive or tumor-free groups, and displays a suspected area for inspection. The core technical problem is variation in MRI sequence, intensity, orientation, image quality, anatomy and tumor appearance. False negatives and incorrect highlighted regions remain possible; reliable performance depends on suitable labeled data and independent evaluation.Let an input image I be assigned a binary reference label y
{0, 1}, where 1 denotes tumor positive. The detection model f maps an image-derived feature vector x into a predicted class . For tumor- positive predictions, a separate algorithm g returns a candidate binary mask M. The interface displays the label and overlays M on I. Evaluation requires ground-truth image labels for f and, separately, annotated pixel masks G for g. A positive label alone cannot verify the mask.
-
PROPOSED SYSTEM
-
Dataset Organization and Splitting
MRI files are organized into positive and negative classes, with documented source, image sequence, image orientation, patient identifier, and licensing where available. Corrupt images and exact duplicates are removed. When several slices belong to one patient, all slices from that patient must remain in a single train, validation, or test partition to prevent leakage. Class counts and the split rule are reported. The MRI brain image dataset is organized into two primary classes: Tumor and No-Tumor. The images are first checked for duplicates, corrupted files, and poor-quality samples and are then subjected to preprocessing operations such as resizing, grayscale conversion, noise removal, contrast enhancement, and normalization. The dataset is divided into training, validation, and testing subsets using a stratified splitting approach. Approximately 70% of the images are used for training, 15% for validation, and 15% for testing. The training set is used to develop the classical machine-learning model, while the validation set is used for model selection and parameter tuning. The independent test set is used to evaluate the final model's performance
using metrics such as accuracy, precision, recall, F1-score, and confusion matrix. This organization helps minimize data leakage and provides a reliable assessment of the proposed brain tumor detection system.
-
Image Preprocessing
Each loaded RGB image is resized to 256 Ă— 256 pixels and converted to grayscale. The user may select a Gaussian filter for smoothing, a median filter for impulse noise reduction, or a bilateral filter for edge- preserving smoothing. For valid model comparisons, training and inference use the same selected filter and feature-extraction path. Differenes in MRI acquisition and intensity distributions should be characterized rather than assumed away. Image preprocessing is an important initial step in the Brain Tumor Detection and Region Highlighting in MRI Images Using Classical Machine Learning project. It is performed to improve the quality of MRI images and prepare them for segmentation, feature extraction, and machine- learning classification.MRI images may contain noise, variations in brightness, different image sizes, and unwanted background regions. These variations can affect the performance of the machine-learning model. Therefore, preprocessing is used to make the images more uniform and enhance the important information present in them.The main preprocessing operations include image resizing, grayscale conversion, noise removal, contrast enhancement, and normalization. Resizing converts all images to a common dimension, while grayscale conversion simplifies the image by representing it using intensity values. Noise removal techniques such as Gaussian filtering can reduce unwanted variations. Contrast enhancement improves the visibility of important structures in the MRI image, including potential tumor regions. Finally, normalization scales the pixel intensity values to a standard range, making the images more suitable for feature extraction and machine-learning algorithms.
-
Feature Extraction and Classification
A compact fixed-length grayscale feature vector is constructed by reducing the preprocessed image to a lower-dimensional grid, then flattening and normalizing its intensity values. A scaler fitted only on training data precedes each classifier. Logistic Regression provides a linear probabilistic baseline; an SVM with a radial basis kernel captures nonlinear separation. Hyperparameters are selected on validation data, while the held-out test set is used once for final reporting. The image class is predicted by the selected fitted pipeline. eature extraction is the process of identifying important characteristics from the preprocessed MRI images. Instead of providing the complete image directly to the machine-learning model, relevant features such as texture, intensity, and shape are extracted. These features help distinguish tumor regions from normal brain tissue.For this project, Gray-Level Co-occurrence Matrix (GLCM) can be used to extract texture features such as contrast, correlation, energy, and homogeneity. Statistical intensity features such as mean, variance, and standard deviation can also be calculated. Shape-based features such as area, perimeter, and circularity can be obtained from the segmented region.Classification is the process of assigning the MRI image to a predefined class based on the extracted features. In this project, the classes can be Tumor and No Tumor.Classical machine-learning algorithms such as Support Vector Machine (SVM), Random Forest, and K-Nearest Neighbors (KNN) can be trained using the extracted features. The trained classifier learns the differences between tumor and non-tumor MRI images and predicts the class of a new MRI image.
-
Candidate Region Visualization
For a positive image prediction, a brightness threshold within a rough foreground mask provides candidate pixels. Morphological opening removes isolated pixels, and connected components can retain a dominant candidate region. This creates an illustrative overlay, not a validated tumor segmentation. Bright normal structures may be selected, while low-contrast tumors may be missed. Whenever
annotated masks are available, the overlay should be compared directly with expert delineations. Candidate Region Visualization is an important stage in the Brain Tumor Detection and Region Highlighting in MRI Images Using Classical Machine Learning project. After image segmentation and classification, the system identifies the regions in the MRI image that have characteristics similar to a possible tumor. These regions are called candidate regions.The purpose of visualization is to present the detected candidate region clearly on the original MRI image. The segmented region can be represented using a colored mask, boundary/contour, or bounding box. This makes it easier to identify the approximate location and size of the suspected tumor region.The process generally involves extracting the segmented candidate region, removing very small irrelevant regions using morphological operations or connected-component analysis, and then superimposing the remaining region on the original MRI image.
-
Graphical Interface
The PyQt desktop interface offers four main controls: load MRI image, select filter, select classification model, and analyze. The output panel shows the prediction text and the original or overlaid image. It should handle missing, unreadable, and unsupported files without terminating the application. The Graphical User Interface (GUI) is the user- interaction component of the Brain Tumor Detection and Region Highlighting in MRI Images Using Classical Machine Learning project. It provides a simple and convenient interface through which the user can upload an MRI brain image and obtain the analysis results without directly interacting with the underlying machine-learning code.The GUI can provide options to upload an MRI image, preprocess the image, perform tumor detection, and visualize the suspected tumor region. After processing, the interface displays the original MRI image along with the highlighted candidate region. It can also display the classification result, such as Tumor Detected or No Tumor Detected.The graphical interface connects the different stages of the system, including image preprocessing, feature extraction, machine- learning classification, segmentation, and candidate-region visualization.
MRI file resize and grayscale chosen filter features classifier label candidate region overlay
Fig. 1. Proposed logical processing flow.
-
-
IMPLEMENTATION DESIGN
Python supports the proposed desktop implementation. OpenCV handles image loading, resizing, grayscale conversion, filtering, thresholding, morphology, and overlay composition. NumPy stores image arrays and feature vectors. scikit-learn supplies scaling, Logistic Regression, SVM, dataset splitting, and classification metrics. PyQt supplies the graphical controls and image display. The baseline classical models can run on a standard desktop CPU; GPU hardware and electronic pin connections are outside the specified project scope [3].
Training should be executed as a separate repeatable process and the fitted preprocessing and classifier saved together. At inference, the application loads the saved pipeline and applies exactly the preprocessing used during training. Record software versions, random seeds, data partition identifiers, model parameters, and error cases. If the dataset lacks patient identifiers, the limitation of image-level splitting must be disclosed.
-
EXPERIMENTAL PROTOCOL
-
Classification Measures
Classification measures are used to evaluate the performance of the machine-learning model developed for brain tumor detection from MRI images. After training the model using the extracted features, its predictions are compared with the actual class labels to determine how accurately it distinguishes between Tumor and No Tumor cases.
The main classification measures used in this project are Accuracy, Precision, Recall, F1-score, and Specificity. These measures are calculated using the confusion matrix, which consists of four outcomes: True Positive (TP), True Negative (TN), False Positive (FP), and False Negative (FN).
-
Accuracy
Accuracy represents the proportion of correctly classified MRI images among all tested images.
+
= + + +
A higher accuracy indicates that the classifier correctly identifies a larger poportion of the test images.
-
Precision
Precision indicates how many of the images predicted as tumor are actually tumor images.
failures. Without expert masks, report the overlay only as a visualization, not as a measured segmentation result. Segmentation measures are used to evaluate how accurately the proposed system identifies and separates the suspected tumor region from the surrounding normal brain tissue in MRI images. In this project, the predicted tumor region obtained through segmentation is compared with the ground-truth tumor region provided with the dataset.
The main segmentation measures include Intersection over Union (IoU), Dice Similarity Coefficient (DSC), Pixel Accuracy, Sensitivity, and Specificity.
-
Dice Similarity Coefficient (DSC)
Dice coefficient measures the degree of overlap between the predicted tumor region and the actual tumor region.
2
= 2 + +
= +
High precision means that the model produces fewer false tumor predictions.
-
-
Recall / Sensitivity
Recall, also called sensitivity, measures how effectively the model identifies actual tumor cases.
A Dice score closer to 1 indicates greater overlap between the predicted and ground-truth regions.
-
Intersection over Union (IoU)
IoU, also called the Jaccard Index, measures the ratio between the intersection and union of the predicted and actual tumor regions.
= + +
= +
A high recall is important because it indicates that fewer actual tumor cases are incorrectly classified as non-tumor.
-
-
Specificity
Specificity measures the ability of the classifier to correctly identify images that do not contain a tumor.
A higher IoU indicates better agreement between the predicted segmentation and the ground-truth segmentation.
-
Pixel Accuracy
Pixel accuracy represents the proportion of correctly classified pixels in the MRI image.
+
= + + +
= +
Higher specificity indicates that the model produces fewer false- positive tumor detections.
-
-
F1-Score
The F1-score is the harmonic mean of precision and recall. It provides a combined measure of these two performance characteristics.
Ă—
1- = 2 Ă—
+
It is particularly useful when the classes are not perfectly balanced.
-
Confusion Matrix
The confusion matrix provides a detailed representation of the classifier's predictions:
Predicted Tumor
Predicted No Tumor
Actual Tumor
TP
FN
Actual No Tumor
FP
TN
These measures provide a comprehensive evaluation of the classical machine-learning classifier and help determine how effectively the proposed system distinguishes tumor and non-tumor MRI images. For a medical-image classification project, the measures should be reported together rather than relying only on accuracy.
-
-
Segmentation Measures
With expert pixel masks G, compute Dice = 2|M G|/(|M| + |G|) and intersection over union = |M G|/|M G|. State how empty masks are handled. Inspect representative false highlights and missed lesions, since a single aggregate metric can conceal clinically important
It measures how many pixels are correctly identified as tumor or non- tumor.
-
Sensitivity
Sensitivity measures the ability of the segmentation method to correctly identify pixels belonging to the actual tumor region.
= +
Higher sensitivity indicates that fewer tumor pixels are missed by the segmentation process.
-
Specificity
Specificity measures the ability to correctly identify non-tumor pixels.
= +
Higher specificity indicates fewer normal brain pixels are incorrectly identified as tumor.
-
-
Interface and Robustness Tests
Test valid and invalid files; different source image dimensions; all filter options; both classifiers; consistent input normalization; positive and negative images; and stable result display. Test a separate patient- disjoint sample if metadata allows. Validate that filter switching does not silently feed a model features from a different training distribution. Interface and robustness testing is an important part of evaluating the Brain Tumor Detection and Region Highlighting in MRI Images Using Classical Machine Learning system. These tests are performed to verify that the graphical interface works correctly and that the proposed system can handle different input conditions without unexpected errors.
-
-
RESULTS AND DISCUSSION
The brain tumor detection and segmentation system processes the uploaded MRI image using a Gaussian filter for noise reduction and a Support Vector Machine (SVM) model for classification. As shown in the figure, the original MRI image, processed image, and segmented tumor region are displayed in the graphical user interface. The classification result is Tumor-Free, indicating that the model predicts the absence of a tumor in the input image. The system also highlights a candidate region in red in the segmented output for visualization. The interface displays the selected filter, classification model, and model performance information. These results demonstrate the integration of image preprocessing, machine-learning classification, and region visualization in a single application. The prediction and highlighted region should be validated against labeled MRI data to confirm their accuracy. The developed Brain Image Segmentation and Detection system was tested using an MRI image to evaluate its image- processing and classification workflow. The original MRI image is uploaded through the graphical user interface, where it is displayed before processing. A Gaussian filter is applied to reduce noise and improve image smoothness while preserving important structural information as much as possible.After preprocessing, the processed MRI image is displayed for visual comparison with the original image. The Support Vector Machine (SVM) classifier then predicts whether the input image belongs to the tumor-positive or tumor-free category based on the features and training data used by the model. In the displayed result, the system classifies the input as Tumor-Free.
The segmented image provides a visual representation of the candidate region selected by the segmentation procedure, highlighted in red. This visualization helps users identify the location of the region being examined. The graphical interface also displays the selected filter, classification model, image dimensions, and available performance information.Overall, the result demonstrates the integration of MRI image preprocessing, machine-learning classification, segmentation visualization, and graphical presentation in a single application. The system provides a simple and efficient way to examine MRI images and display predicted results. However, the highlighted region should not automatically be interpreted as a tumor, especially when the classification result is tumor-free. Further testing with a larger labeled dataset and ground-truth segmentation masks is required to measure classification accuracy, sensitivity, specificity, and segmentation performance. The system is intended for academic and research purposes and does not replace professional medical diagnosis.
-
Brain image segmentation and detection is an important application of medical image processing and machine learning used to identify abnormal regions in brain MRI scans. Magnetic Resonance Imaging (MRI) produces detailed images of the brain and helps doctors examine brain structures and detect possible abnormalities, including tumors.
The main objective of a brain image segmentation and detection system is to process an MRI image, identify the region of interest, and classify the scan as tumor-positive or tumor-negative. The system
generally consists of image acquisition, preprocessing, segmentation, feature extraction, classification, and result visualization.
Image preprocessing is the first step, in which the uploaded MRI image is prepared for analysis. Preprocessing may include resizing, noise removal, normalization, and contrast enhancement. These operations improve image quality and help the system analyze the image more effectively.
Image segmentation is the process of separating the important region of the brain from the surrounding tissues. It helps identify the suspected tumor area and distinguish it from normal brain structures. Segmentation techniques may include thresholding, region-based methods, edge detection, and deep-learning-based approaches. The segmented region can be highlighted to make the suspected abnormal area easier to observe.
Feature extraction involves identifying relevant characteristics of the MRI image, such as shape, size, texture, intensity, and spatial information. These features can be used by a machine-learning model to differentiate between normal and abnormal patterns.
Classification and detection determine whether the processed MRI image contains features associated with a brain tumor. Algorithms such as Support Vector Machine (SVM), Random Forest, Convolutional Neural Networks (CNN), and other machine-learning techniques can be used for classification. In the illustrated system, the Support Vector Machine (SVM) model is selected to classify the processed MRI image and display the result.
The system interface displays the original MRI image, the processed MRI image, and the segmented tumor region. After processing, the classification result is presented as tumor-positive or tumor-negative, along with relevant model information. This interface makes the analysis process easy to understand and allows users to visualize the different stages of image processing.
In conclusion, brain image segmentation and detection combines image processing and machine-learning techniques to assist in identifying suspected brain tumors from MRI scans. It can support medical image analysis by providing visual information and automated classification results. However, the output is not a definitive medical diagnosis and must be validated by qualified medical professionals using appropriate clinical evaluation and diagnostic procedures.
Fig 1.2 Tumor Detected
-
-
CONCLUSION
A coherent implementation path has been specified for a PyQt brain MRI application combining resizing, grayscale conversion, selectable denoising, Logistic Regression and SVM detection, and provisional region highlighting. The method is a research and educational prototype. Claims of accuracy or clinical usefulness require independently labeled data, patient-disjoint testing, mask-based validation, and expert review. The Brain Tumor Detection and Region Highlighting in MRI Images Using Classical Machine Learning project presents a computer-aided approach for identifying potential brain tumors from MRI images. The proposed system combines image preprocessing, feature extraction, machine-learning classification, image segmentation, and candidate-region visualization to analyze MRI scans.During preprocessing, the MRI images are enhanced and
standardized to improve their quality and suitability for further analysis. Relevant features such as texture, intensity, and shape characteristics are extracted from the processed images. These features are then provided to classical machine-learning algorithms such as Support Vector Machine (SVM), Random Forest, or K-Nearest Neighbors (KNN) for tumor classification.The segmentation stage helps identify the potential tumor region, while candidate-region visualization highlights the suspected area on the original MRI image. This provides a more understandable representation of the classification result and helps users observe the approximate location of the detected region.The performance of the proposed system can be evaluated using accuracy, precision, recall, F1-score, specificity, Dice coefficient, and Intersection over Union (IoU). Interface and robustness testing further ensure that the system can handle different input conditions and provide consistent results.Overall, the proposed system demonstrates the potential of classical machine-learning and image-processing techniques for computer-aided brain tumor analysis. It can serve as an educational and research-oriented framework for MRI analysis and can be further improved by using larger and more diverse datasets, advanced segmentation techniques, feature-selection methods, and optimized machine-learning models. The system should be considered a supportive research tool rather than a replacement for professional medical diagnosis.
REFERENCES
-
S. Bauer, R. Wiest, L.-P. Nolte, and M. Reyes, A survey of MRI-based medical image analysis for brain tumor studies, Physics in Medicine and Biology, vol. 58, no. 13, pp. R97R129, 2013, doi: 10.1088/0031- 9155/58/13/R97.
-
N. Gordillo, E. Montseny, and P. Sobrevilla, State of the art survey on MRI brain tumor segmentation, Magnetic Resonance Imaging, vol. 31, no. 8,
pp. 14261438, 2013, doi: 10.1016/j.mri.2013.05.002.
-
Spherenex Innovation Labs, Brain Image Segmentation and Detection (KS5721), quotation SPN-26082026-KS5721, Aug. 27, 2026.
-
B. H. Menze et al., The multimodal brain tumor image segmentation benchmark (BRATS), IEEE Transactions on Medical Imaging, vol. 34, no. 10, pp. 19932024, 2015, doi: 10.1109/TMI.2014.2377694.
-
S. Pereira, A. Pinto, V. Alves, and C. A. Silva, Brain tumor segmentation using convolutional neural networks in MRI images, IEEE Transactions on Medical Imaging, vol. 35, no. 5, pp. 12401251, 2016, doi: 10.1109/TMI.2016.2538465.
-
N. Li and Z. Yang, Brain Tumor Segmentation From Multimodal MRI Data Based on GLCM and SVM Classifier, International Journal of Cognitive Informatics and Natural Intelligence, vol. 15, no. 4, pp. 118, 2021, doi: 10.4018/IJCINI.20211001.oa15.
-
G. Mohan and M. M. Subashini, MRI based medical image analysis: Survey on brain tumor grade classification, Biomedical Signal Processing and Control, vol. 39, pp. 139161, 2018, doi: 10.1016/j.bspc.2017.07.007.
-
H. H. Sultan, N. M. Salem, and W. Al-Atabany, Multi-Classification of Brain Tumor Images Using Deep Neural Network, IEEE Access, vol. 7,
pp. 6921569225, 2019, doi: 10.1109/ACCESS.2019.2919122.
