This repository attempts to classify brain tumors from MRI images given various machine learning classifiers.
The data was gathered from this Kaggle dataset, which separates MRI images by 'no' and 'yes'.
The methods used to classify the MRI images used in this repo include using a Convolutional Neural Network (CNN), performing Principal Component Analysis (PCA) on the training images that are fed into the CNN, and K-Nearest Neighbors (KNN).
-
CNN.ipynb : Details the steps performing a CNN on the MRI images found in no/ and yes/. CNN was run with 10 epochs.
-
PCA_CNN.ipynb : Details the steps performing a CNN on the MRI images found in no/ and yes/. Training images were run through PCA before inputting into CNN. The number of components tested are the following: 2, 10, 30, and all (202) the components. CNN was run with 10 epochs.
-
KNN.ipynb : Details the steps performing KNN on the MRI images found in no/ and yes/. KNN was iterated through all the odd numbers from 1 to 101 neighbors. A cross-validation of 5-folds was used.
-
no/ : Folder with MRI images that were classified as having no tumor.
-
yes/ : Folder with MRI images that were classified as having a tumor.
Accuracy after 10 epochs: 78.43%
2 component accuracy: 39.22%
10 component accuracy: 39.22%
30 component accuracy: 60.78%
202 component accuracy: 60.78%
Highest Cross-Validation Accuracy: 77.49% at 73 nearest neighbors