This project was carried out as part of a statistical learning course. It is a first project in image processing.
The goal of this project is to detect and classify brain tumors using MRI images. It supports four classes:
- Glioma Tumor
- Meningioma Tumor
- Pituitary Tumor
- No Tumor
The project includes features for:
- Data exploration
- Model evaluation metrics
- Explainability analyses
- A Streamlit application to test the model
The dataset used for this project is available on Kaggle: Brain Tumor Classification (MRI).
- MRIs: Classified into the four categories listed above.
- Folder structure: Separate folders for training, validation, and testing.
- Preprocessing: Images are resized, normalized, and converted to grayscale for model training.
An interactive HTML report provides a complete overview of the dataset.
A detailed HTML report with evaluation metrics such as accuracy, recall, and F1-score.
Visual analyses of the model’s decisions using Xplique.
An intuitive interface that allows users to upload MRI images and obtain real-time classification results.
Note: The application requires the pre-trained model, which is not included in this GitHub repository. You must place the model file in the appropriate folder before running the application.
- Python: Version 3.11 or higher
- System requirements: A system capable of running virtual environments
-
Clone the repository:
git clone <repository-url> cd <repository-folder>
-
Run the installation script (Linux/Mac):
./lancez_moi.sh
This script will perform the following actions:
- Create a virtual environment.
- Activate the virtual environment.
- Open the data exploration report in your default browser.
- Display the model metrics report.
- Access the explainability analyses.
- Launch the Streamlit application.
-
Run the installation script (Windows):
lancez_moi_windows.sh
This script is designed for Windows users.
-
Run the Streamlit application manually:
cd src/models streamlit run CNN_app.py
project-root/
|
|-- data/ # Folder containing the dataset (train, validation, test)
|-- Data_visualisation/ # Scripts and files for data visualization
|-- results/ # Reports and results (e.g., metrics.html, explainability analyses)
|-- src/ # Project source code
| |-- models/ # Scripts for models, training, and detection
| | |-- CNN_app.py # Streamlit application for classification
| | |-- CNN_train.py # Script to train the CNN model
| | |-- preprocessing/ # Image preprocessing modules
|-- venv/ # Virtual environment files
|-- .gitignore # Git ignore rules
|-- config.yml # Project configuration file
|-- lancez_moi.sh # Installation script for Linux/Mac
|-- lancez_moi_windows.sh # Installation script for Windows
|-- README.md # Project documentation
|-- requirements.txt # Python dependencies
README translated from the french version written by Lilya-Nada KHELID @Lilyakhelid.