How yashpasar/brain-tumor-classification-and-detection-machine-learning works
Project Type and Purpose
• This is a MATLAB-based image processing and machine-learning application for detecting and classifying brain tumors in MRI scans.
• It provides a GUI front end to load MRI images, applies a sequence of processing stages (preprocessing, segmentation, feature extraction), and then runs classification algorithms (SVM, ANN, k-NN) to label tumors as benign or malignant.
File Structure Analysis
• Top level:
• Brain_Tumor_Code/ – MATLAB source directory
– BrainMRI_GUI.fig & .m: graphical user interface
– Image processing scripts: Brain_DWT_PCA.m, crossfun.m, crossfun_Parameters.m
– Dataset artifacts: Normalized_Features.mat, Trainset.mat
– Folders “Benign” and “Malignant” (image samples)
• README.md describes the five-stage pipeline and lists all algorithms.
Key Architectural Components
a. GUI Layer
• BrainMRI_GUI.m/.fig – user interface for selecting images, launching pipeline, viewing results.
b. Data Store
• Raw MRI images (Benign/, Malignant/)
• Precomputed feature set (Normalized_Features.mat)
• Training data (Trainset.mat)
c. Preprocessing Module
• Filters & noise removal (Canny, median filter)
• Enhancement routines
d. Segmentation Module
• Otsu thresholding
• Watershed segmentation
e. Feature Extraction Module
• DWT + PCA (Brain_DWT_PCA.m)
• Custom feature calculators (crossfun.m, crossfun_Parameters.m)
f. Classification Module
• SVM, ANN, k-NN algorithms (built-in MATLAB toolboxes)
g. Reporting / Evaluation
• Classification labels and accuracy metrics in GUI
• Save or export results
Relationships and Data Flow
• GUI → loads image → Preprocessing → Segmentation → Feature Extraction → Classifier → GUI (result display)
• Preprocessing outputs intermediate image to Segmentation
• Segmentation outputs region masks to Feature Extraction
• Feature Extraction writes feature vectors to memory or .mat → Classification consumes features → returns label & confidence
• Training data store (Trainset.mat) is loaded by Classification module for model fitting (if “retrain” option exists)
Architectural Patterns
• Pipeline (linear sequence of processing stages)
• Modular separation of concerns (GUI, processing modules, data storage)
Technologies and Frameworks
• MATLAB R2015a core environment
• MATLAB Image Processing Toolbox (Canny, Otsu, Watershed)
• MATLAB Statistics & Machine Learning Toolbox (SVM, ANN, k-NN)
• MATLAB .fig GUI design