A brain tumor is considered to be one of the aggressive diseases among children and adults. Brain tumors account for 85 to 90% of all primary Central Nervous System(CNS) tumors. Every year, around 11,700 people are diagnosed with a brain tumor. The manual examination of neural activity can be error-prone due to the level of complexities involved in brain tumors and their properties. To improve the life expectancy of the patients, proper treatment, planning, and accurate diagnostics should be implemented. Automated interpretation and classification of functional MRI (fMRI) data is an emerging research field that enables the characterization of underlying cognitive processes with minimal human intervention. Therefore, with the help of deep learning algorithms, we aim to develop an application performing the detection and classification of brain tumors to help doctors around the world, especially in developing countries where knowledge about tumors, lack of neurosurgeons present a challenge. An edge-based computer vision solution will facilitate for doctors around the world preliminary efficient detection and classification of a brain tumor.
A brain tumor is an abnormal mass of tissue in which cells grow and multiply uncontrollably, seemingly unchecked by the mechanisms that control normal cells. More than 150 different brain tumors have been documented, the two main groups of brain tumors are termed primary and metastatic. Primary brain tumors include tumors that originate from the tissues of the brain, they are categorized as benign, malignant, and pituitary. Metastatic brain tumors include tumors that arise elsewhere in the body and migrate to the brain, they are considered cancer and are malignant. The complexity and numerous abnormalities in brain tumor sizes and location make it difficult to completely understand the nature of the tumor. fMRI data is threedimensional, containing tens of thousands of voxels. Due to the cost and time needed to capture fMRI along with other imaging modalities and clinical data, the number of available subjects is small. Usually, datasets have only a few tens of subjects. Many datasets also show high subject variability, depending upon the nature of the neuropsychological process and task. Generally, the fMRI signal is noisy. The classification has been used on brain fMRI for two goals: the prediction of cognitive states and group classification. In the prediction of cognitive states, the goal is to infer the experimental condition that a given subject was undergoing at a given time. In group classification, the goal is to infer the group membership of a given subject. In the problem, we aim to discern whether fMRI depicts a brain tumor or not.
The brain tumor dataset is retrieved from Kaggle, Brain MRI Images for Brain Tumor Detection. There are 98 images without any sign of a tumor, and 155 files with various tumors.
Images took on different file formatting (e.g..jpg, .png, .jpeg) and required consistent input file extension (e.g. jpeg). The B&W images of 224 x 224 pixels represented in two classes: the images containing tumor labeled with yes, and the images that do not - are marked with no. The dataset was split into three categories: training (62%), validation (8%) and testing (30%) images.
No Tumor Brain | Brain Tumor Anatomy |
---|---|
The research project employes the Vision and the Core ML frameworks to preprocess and classify fMRI data. The framework of Core ML is optimized for on-device performance for a variety of algorithms, it leverages Apple hardware, minimizes memory footprint and power consumption. The research project trains a brain tumor classifier using Create ML in Swift environment and applies the resulting model to real-time fMRI image classification using Vision.
For image classification and object detection models, Create ML uses transfer learning to speed up the training process. By choosing the framework, there is no control over the chosen algorithm, limited control over hyperparameters (i.e. 25 max iterations) and performance metrics (precision, recall). The model size is relatively small due to not including the convolutional base as it is already embedded with iOS and macOS.
Deep convolutional neural networks perform well on Computer Vision tasks, although, they are reliant on big data to avoid overfitting. Medical image analysis is among the application domains that do not have access to big data. Data augmentation is a data-space solution to the problem of limited data. The image augmentation algorithm are the techniques that enhance the size and quality of training datasets (e.g. geometric transformations, color space augmentations, kernel filters, mixing images, random erasing, feature space augmentation, adversarial training, generative adversarial networks, neural style transfer, and meta-learning). Augmentation techniques of image cropping, exposing, flipping, and rotating are added to the baseline Create ML classifier.
Training numerous CNN hyper-parameters requires a lot of labeled training data and computing power. Therefore, using transfer learning technique allows us to take a pre-trained network to extract features, and train a new layer on top for the research task of classifying brain tumor images. The model is built with a TensorFlow-Hub image feature vector module followed by a linear classifier.
Approach | Training Accuracy | Validation Accuracy | Testing Accuracy |
---|---|---|---|
Create ML Baseline | 1 | 0.94 | 0.78 |
Create ML Data augmentation | 0.82 | 0.67 | 0.75 |
MobileNet Transfer Learning | 0.93 | 0.68 | 0.55 |
The deployment of the research project was implemented using the Create ML framework which is a Swift framework allowing to use Xcode and create machine learning models using Swift code. The saved project uses the Create ML Baseline Image Classifier as it demonstrated the best performance, and the app runs on an iOS device simulator 12.1. The results of the image classification process are seen on the screen.