This project uses a deep learning model for brain tumor detection based on magnetic resonance imaging (MRI). The notebook Brain_Tumor_Detection.ipynb contains all the code necessary to train and evaluate the model.
This project consists of three main parts:
-
Data Preprocessing:
- Splitting the Data: The images are divided into training, validation, and test sets.
- Cropping: A crop is applied to the images.
- Resizing: The images are resized to a standard dimension.
- Data Augmentation: Various data augmentation techniques are applied to increase the diversity of the dataset.
-
Neural Network Construction:
- Transfer Learning: The neural network is built using transfer learning, specifically employing the ResNet50 architecture.
-
Testing Phase:
- Model Testing: The trained model is tested to evaluate its performance.
- Python 3.x
- Jupyter Notebook
- TensorFlow
- Keras
- NumPy
- Matplotlib
- Scikit-learn
- OpenCV
The architecture of the network includes:
- Input Layer: Accepts images resized to 224x224 pixels.
- Pre-trained Base Model: The ResNet50 model pre-trained on the ImageNet dataset is used as the base. This model includes:
- Convolutional layers that extract features from the input images.
- Batch normalization and activation layers to stabilize and enhance training.
- Residual blocks to allow for deeper networks by alleviating the vanishing gradient problem.
- Global Average Pooling Layer: Reduces the spatial dimensions of the feature maps from the base model, providing a 1D feature vector.
- Dropout Layer: A dropout layer with a dropout rate of 0.2 to prevent overfitting.
- Output Layer: A dense layer to output the prediction.