Here is a demo of my end of year project in which I demonstrate the applications of mathematical morphology in medical image segmentation using my web UI POC:
MICCAI BraTS: We published a paper describing our research to the MICCAI organization (An Efficient Cascade of U-Net-like Convolutional Neural Networks devoted to Brain Tumor Segmentation P. Bouchet et al.). This is the result of our AI network’s segmentation on a slice of an MRI scan:
In the top row, we can see a brain scan with four different MRI modalities (FLAIR, T1, T2, T1ce). And in the bottom row, we can see the networks prediction’s of where the brain tumor, and its sub-regions are located. From left to right, we see:
Some problems were encountered during the project, one main one being RAM saturation. Storing hundreds of gigabytes of data on RAM to train the network quickly saturated the memory at our disposal, and another solution was need. Using Tensorflow's data API, we implemented an efficient data pipeline. The data was now loaded in batches, eliminating the risk of saturation.
Our network achieved an accuracy of 93%. This project was carried out in Python using, Numpy, Tensorflow, Keras, and Nibabel.
MICCAI iSeg: A project I undertook that introduced me to the world of medical segmentation. The goal of this project was to create a CNN on a small dataset capable of segmentating gray matter and white matter from an MRI scan of the brain, with T1 and T2 modalities. The network was written in Python, using Numpy, Tensorflow, and Keras.
Here are the results of my network's prediction, compared to the input image's ground truth.
Here is a visual representation of the network's segmentation of a patient's brain MRI. We can see:
Some issues were encountered during the network's training, as the dataset is incredibly small (only 10 patients!), we only have a limited amount of patients to train the network with. This being the case, the network can easily stagnate, and fall into a plateau during gradient descent. In order to combat this, I decided to implement data augmentation in order to provide the network with an enriched dataset, thus avoiding the plateau during gradient descent.
A quick reminder of the gradient descent and plateaus:
The point of the gradient descent is to find a local minimum within the cost function, in order to tune the network's parameters.
Mathematically explained, we have , with as the cost function.
When reaching a plateau, the network ceases to learn, and remains stuck on the plateau. This is what we see in this example, with the SGD algorithm (in red). The red ball gets stuck at the saddle point, and no progress is made towards the local or global minimum. By providing more data to the network, we decrease the chances of getting stuck on a plateau, and allow the red ball to progress towards a local or global minimum.
Classifier: The goal of the project was to create an accurate CNN model capable of correctly classifying different types of boats, while being limited to a small, and low quality dataset. The project was carried out using Python, Numpy, Tensorflow, Keras and Pandas. This task was achieved by using image processing concepts in order to enhance the dataset. Moreover, we performed data analysis on the dataset, here is a histogram representing the amount of images for each boat type:
We notice that the dataset is not balanced at all. Class weights were used to balance out the data and avoid the network being biased towards a certain type of boat.
Once the network was trained, we evaluated its performance on the testing dataset. Here is a confusion matrix. On the y axis of the matrix, we have the expected categorical outcome, and on the x axis, we have the actual predicted outcome.
The network struggles with correctly detecting destroyers, with a high false positive rate among this categories. This can be explained due to the fact that images of the destroyer are much more prevalent (cf. histogram above), thus biasing the network. The effects of this bias have been mitigated thanks to the use of the class weights mentioned earlier.
DeepSea: A Deep Learning framework completely implemented from scratch in the C programming language, using only the C standard library. The framework's network implements a Multilayer Perceptron model, or a Fully Connected network. It was designed with mini-batch gradient descent, as it allows the gradient to converge quickly, yet carefully towards the local, or global minimum of the cost function. The framework also comes with an MNIST dataset API, written from scratch.
An OCR was implemented with the framework, and was tested with the MNIST hand written digits dataset on a small network with the following parameters:
The MNIST dataset consisted of:
The OCR achieved an accuracy of 82%, while only being trained on 6.82% of the total training dataset, and tested with the entirety of the testing dataset. Here are the results, as well as the prediction values of an image picked at random:
This project allowed me to understand the vital mathematical aspect behind neural networks, providing me with a solid foundation in machine learning. The reason as to why I decided to implement a Deep Learning framework from scratch in C is because I wanted to give myself a greater challenge, as implementing it in Python, or a high level language seemed to be too easy. Moreover, by implementing it in C, I have the possibility to delve in to hyper-optimization, via CPU multithreading, or even GPU computing in order to speed up the network.
L-Sized U-Net++ algorithm: Designed and implemented an algorithm capable of creating an efficient -sized U-Net++ network. The implementation is based on the paper by Z. Zhou et al. (Link to the paper). The creation of this algorithm was a necessity, as it was vital to our success for the MICCAI BraTS challenge. We selected the U-Net++ model for its power and precision. The network was written in Python, using Numpy, Tensorflow and Keras.
Here is a representation of a U-Net++ network of size .
Note: EPITA has not allowed the publication of some projects to a public repository. (MICCAI BraTS, Mandelbrot and 42sh)