The dataset used was from kaggle https://www.kaggle.com/navoneel/brain-mri-images-for-brain-tumor-detection
- Brain tumor images are cropped to only the brain region
- Then they are plotted to see the output
- Since the size of the dataset is small, the images were augmented
- Rotation range is 10
- Width sift range is 0.1
- Height shift range is 0.1
- Shear range is 0.1
- Brightness range is 0.3 - 1.0
- Flipping horizontally
- Flipping vertically
- We printed the data summary
- Number of samples
- Percentage of positve examples
- Percentage of negative examples
- Images are read using opencv
- Plotting some images
- Splitting data into train, test, and validation
- Printing the shape of the datasets
- Function for F1 Score
- Building Model
- Addig zero padding
- Convolutinal layer with 32 neurons and filter size of 7,7
- Batch normalization
- Maxpooling filter size 4,4
- Maxpooling filter size 4,4
- Flatten layer
- Dense layer with one neuron, output layer
- Print model summary
- Compile model
- Train model for 24 epochs
- Plot the training and validation accuracy and loss
- Send positively classified image to matlab for segmentation
- Resizing the image
- Applying threshold
- Applying morphological operations
- Apply bounding box
- Inserting the tumor are in red colour
- Display the tumor images