MS Disease Detection


Marwah Faraj/ Computer & Data scientist


 Table of Content

 

Background & Motivation

Data: Description and Challenges

EDA

Model Performance

Optimizing Performance and Enhancing Robustness

Deploying: Streamlit app

Conclusions



Background & Motivation


This project focuses on addressing the challenge of accurately identifying and diagnosing Multiple Sclerosis (MS) using brain MRI images. Inspired by a personal story of misdiagnosis, where a friend went through a difficult journey of receiving incorrect diagnoses and misguided treatments, this project aims to leverage advanced computer techniques to develop models that can distinguish between brain images of individuals with MS and those without the condition.

By analyzing a large dataset of brain MRI images, I aim to utilize cutting-edge technology to identify patterns and characteristics associated with MS. This will enable me to create a tool that can assist medical professionals in making more precise and reliable diagnoses of MS. By improving the accuracy of the model, I hope to prevent instances of misdiagnosis, which can have profound consequences for patients.

By harnessing the power of data analysis and collaboration, this project seeks to contribute to the improvement of healthcare outcomes and the well-being of individuals facing the challenges of Multiple Sclerosis.



DATA

The dataset used in this project was obtained from one of the hospitals in Iraq, specifically from the MRI/CT scan center. It comprises a substantial collection of brain images, totaling over 175,000 records. The dataset is labeled and categorized into two distinct classes: Multiple Sclerosis (MS) and Non-MS.


Challenge: The availability of the data for this project is currently restricted and cannot be publicly shared at this time.




     


     


Data Exploratory Analysis

1. Class Balance




2. Class over Age

3. Class over Gender


Model Performance: 

I developed a Convolutional Neural Network (CNN) model specifically designed to detect the presence of Multiple Sclerosis (MS) in medical imaging. During the training process, which spanned 15 epochs, I observed indications of overfitting. Initially, the model achieved an impressive accuracy of 97% on the training dataset. However, the accuracy on the validation set was notably lower at 82%, suggesting a disparity that needed to be addressed.

Upon closer examination, particularly of the validation curve, I identified a clear trend indicative of overfitting. The validation curve's upward trajectory in the second graph was a crucial sign pointing toward this issue.

To mitigate the overfitting, I implemented strategic image augmentation techniques. This adjustment aimed to enhance the model's generalization capabilities, ensuring that it performs more consistently on unseen data. The subsequent sections will detail the impact of these adjustments and present an in-depth evaluation of the model's refined performance.






Optimizing Performance and Enhancing Robustness: 

A) Image Augmentation


1. Rotation= 40
2. Shift to left or right

                         

3. Flip
            
                   

4. Zoom In

                             



B) Model Performance: 

I am pleased to report that our model achieved an accuracy of 85% on the training set and 83% on the validation set. While these figures may not be as high as the 99% accuracy we attained previously, it's important to highlight a significant advantage of the current model: its robustness against overfitting. This balanced performance indicates that our model is reliably predicting MS disease versus non-MS with an 85% accuracy rate.

Furthermore, the consistency between training and validation accuracies underscores the model's generalizability. It suggests that the model is well-tuned to make predictions on unseen data, which is crucial for practical applications. This balance of accuracy and generalization represents a meaningful step forward in our efforts to create a reliable and effective predictive tool for MS disease.







Let’s test the model on a new image

Using Streamlit Application






Conclusion

By harnessing the beauty of machine learning and its potential to analyze vast amounts of data, this project strives to contribute to the prevention of false diagnoses. Through collaboration with medical professionals and leveraging cutting-edge technologies, I aim the tool I built will enhance the accuracy and efficiency of MS diagnosis, thus helping to improve the lives of countless individuals worldwide.



Tools



Comments