This repository contains a simple AI-based approach for brain tumor detection using image histograms. The model is trained on grayscale histograms extracted from medical images and predicts whether an image contains a tumor or not based on Euclidean distance comparison.
- Preprocessing: Converts images to grayscale and splits them into regions.
- Feature Extraction: Generates histograms for each region.
- Training: Computes optimal histograms for tumor and non-tumor images.
- Testing: Classifies new images based on distance comparison with trained histograms.
- Accuracy Calculation: Evaluates model performance on a test dataset.
git clone https://github.com/MohaYass92/Brain-Tumor-Detection.git
cd Brain-Tumor-DetectionEnsure you have Python installed, then install the required libraries:
pip install -r requirements.txtDownload the dataset from the following link and place it in the dataset/ folder:
📂 [Dataset Link](#)
Run the training script to process the dataset and generate trained histograms:
python train.pyThe script will ask for:
- Number of rows and columns to split images
- Number of bins for histograms
- Paths to tumor and non-tumor image folders
Run the testing script to evaluate the model:
python test.pyIt will ask for:
- The test dataset path
- Number of rows, columns, and bins used in training
The accuracy will be disp
There is a detailed report available in the root directory of the repository, which contains an organigram outlining the entire process of the project. You can view or download it from the following link: