Machine Learning Model for Identifying Cancer in Brain MRIs
In 11th grade, I coded a Convolutional Neural Network in Python that attempts to identify meningiomas in brain MRIs. It ended up with more than 99% accuracy on the testing set. The image below shows a random sample of the testing set along with the neural network's guesses.
I found the dataset of brain MRI scans on a website called Kaggle and the dataset has two categories: training images and testing images. It has a total of 1217 training images and 220 testing images labeled either "no tumor" or "meningioma tumor".
The Python script begins by preprocessing the input data. Using the Keras library, the script resizes the images, which come in many shapes and sizes, into 64 × 64-pixel grayscale squares. Then, it loads these images into arrays for the training and testing sets while keeping track of the images' labels. Rather than using string labels, the script quantifies the English diagnoses by labeling healthy brains with a 0 and meningioma-containing brains with a 1. Below is a sample of eight labeled images after preprocessing.

After preprocessing, the model sends the 64 × 64 images through various layers like convolutional layers, max-pooling, and dropout. This model reached an accuracy of 99.55% on the testing dataset.
See this project's Python notebook and its accompanying dataset on Kaggle ↗.