Artificial Intelligence
How I used Artificial Intelligence To Detect Alzheimer's Disease.
…and learning how I did it.
Humanity has always been plagued with disease. In fact, according to the World Health Organization in 2016, 56.9 million deaths worldwide were due to disease. That was 1% of humanity, almost.
And something else the WHO stated will blow your mind. More than half of those deaths came from ten diseases. Ten. One of those, one of the worst diseases for those afflicted, is Alzheimer’s Disease. But before I share how we can use AI to help diagnose this problem, I’d first like to help you understand Alzheimer’s disease, and it’s severity.
What is Alzheimer’s Disease?
Alzheimer’s disease is a currently irreversible progressive neurological disease, and the most common kind of dementia. It starts usually by worsening your memory and thinking, and by the end stops you even doing basic tasks or even motor functions. It is ranked as the sixth leading cause of death in the US, and the third among aging populations.
What does it do to the brain to achieve this? Well, we don’t yet know exactly for sure, but we know that in the brains of Alzheimer’s patients, there are build-ups of amyloid protein plaques and neurofibrillary tangles. It is also associated with the destruction of neuron connections, which are what allow our brain to send information through the body. This causes brain cells to slowly die, and the brain will visibly shrink by the end of the progression.
This damage starts in the hippocampus, which is a part of the brain that mainly controls memory, thus the loss of memory in the beginning. As the disease progresses, the rest of the brain starts getting affected too, which leads to the aforementioned loss of thinking skills and eventually the ability to do anything at all.
What can we do about it?
The sad truth is, we can’t cure Alzheimer’s yet, nor do we properly know how to prevent it. We can, however, slow it’s progress, especially for early and moderate stages of Alzheimer's, using medication.
Cholinesterase inhibitors
One type of medicine which is especially useful in early-stage Alzheimer’s disease is cholinesterase inhibitors. We don’t fully understand exactly why they work to prevent Alzheimer’s, but research has indicated that they prevent the breakdown of a chemical called acetylcholine, which is currently believed to play a role in memory function. However, as Alzheimer’s progresses, this chemical is produced less, and so slowly this kind of medication becomes less effective.
N-methyl D-aspartate antagonist (NMDA antagonist)
A medicine with an extremely hard to read and complicated name, this drug is much more useful in moderate to late stages of Alzheimer’s disease. They regulate glutamate, which is a brain chemical. The reason they do this is that, in excessive amounts, glutamate can actually kill brain cells, meaning that suppressing it can slow the later stage effects of Alzheimer’s. NMDA’s and the aforementioned inhibitors can also be used in conjunction, and in fact, there are medicines made that already do both.
How can we use artificial intelligence to diagnose it?
Think back to the second paragraph of the previous section, where I talked about how Alzheimer’s disease visibly shrinks the brain, and if you’ve read some earlier articles or have a bit of knowledge in AI already, you may realize how we can diagnose it with AI.
Since we are dealing with images, the best thing to use would be a Convolutional Neural Network, or a CNN. I won’t go too in-depth as to what CNNs are in this article, but I will give a quick rundown as well as link another article at the bottom that explains CNN's more deeply.
CNN's are exceptionally good at working with images, especially classifying them. Put simply, they run a sort of filter over an image (essentially just going pixel by pixel through the image, and overlaying filters meant to detect things from curves and edges to whole objects), and try to use that information to make predictions on what the image is.
Using the power of CNNs, we can predict whether a given MRI scan should be classified as an Alzheimer’s affected brain or a healthy brain. But how does it even know whether a given MRI scan is either one? Well, it actually learns on its own, however, it still needs data to be able to do this.
So, I found a dataset of MRI images on the ADNI website, which is the Alzheimer’s Disease Neuroimaging Initiative, which proved very helpful. I separated the healthy and unhealthy brain MRI scans, and then I took some of the images from each dataset and created a validation and training set of images.
This means I had four sections, the healthy validation and training image sets, and the unhealthy ones. But what are the validation and training image sets? The training set is easy to understand, it’s the data the algorithm learns from, and it’s labeled as being healthy or unhealthy. Since we have healthy and unhealthy sets, the algorithm can learn the differences between them.
The validation set may be harder to understand from the name itself, but this is as important as the training set. It, simply put, allows us to check our results. We have different images from the training set here which aren’t labeled since when the AI will be used later on after training it won’t get the same training images, and if the AI had enough data and trained enough, it will be able to predict whether the image is healthy or unhealthy.
The above picture shows the output of my neural network. These results are pretty good actually, the important thing is the validation accuracy here. That shows how good the network is at predicting whether an image in the validation dataset was healthy or unhealthy, and we see by the end, it had an accuracy of around 80 percent, which is great since it means its right 80 percent of the time.
Of course, being right 80 percent of the time is not enough for actual use, it should be as accurate as possible. Even diagnosing 1 person per hundred wrongly can be disastrous. I’m currently in the process of integrating more data into my CNN to up this percentage.
Key Takeaways:
- Alzheimer’s is an irreversible kind of dementia, which can visibly shrink the brain.
- Currently, we can only slow its progress, and we have to diagnose a patient with Alzheimer’s to do that.
- Because AI visibly shrinks the brain, we can use CNNs which can learn the difference between healthy brains and brains with Alzheimer’s.
- Using training and validation sets, the AI learned what characteristics were of Alzheimer’s patients, and what were of healthy patients.
- My implementation currently has reached 80% accuracy.
Here’s the article I mentioned earlier:
https://towardsdatascience.com/yolo-you-only-look-once-f05c054a06b4
If you enjoyed reading this article or have any suggestions or questions, let me know by leaving a comment below. You can find me on LinkedIn for my latest updates, or check out my latest projects on my website. See what I’m up to on my newsletter. Thanks for reading!