🧠 Inspiration

Multiple Sclerosis (MS) is a complex neurological autoimmune disease that affects millions worldwide, mostly women, yet early diagnosis remains a significant challenge. The idea for MSDetect stemmed from a personal connection—our team member, Amr, has two family members who were misdiagnosed after undergoing MRI scans and then later found out that it was actually MS. MS symptoms can mimic other diseases, leading to delays in diagnosis and treatment. Since early detection can significantly slow disease progression and improve quality of life, we were motivated to create a tool that leverages AI and medical imaging to aid in the early detection of MS.

💡 What It Does

MSDetect is a web-based application designed to provide a preliminary analysis of MRI scans for potential indicators of MS. It utilizes a fine-tuned ResNet50 deep learning model to predict the likelihood of MS presence based on MRI images. In addition to MRI analysis, users can input relevant patient details such as age, gender, symptoms, family history, smoking habits, and Epstein-Barr virus (EBV) status to refine the assessment. The application then integrates AI-driven insights via the Perplexity AI API to generate a detailed report, summarizing the findings and risk factors.

Key Features:

  • MRI Scan Analysis: Accepts MRI scans (DICOM, DCM format) to pass to the model to classify it as MS or healthy and the prediction confidence.
  • AI-Powered Prediction: Utilizes a fine-tuned ResNet50 deep learning model trained on MRI datasets of both healthy individuals and MS patients.
  • Patient Information Input: Enhances analysis with additional medical history and symptom details.
  • AI Report Generation: Uses the Perplexity AI API to generate a comprehensive, easy-to-understand report.
  • User-Friendly Interface: Provides an intuitive web platform for seamless navigation and data input.

⚙️ How We Built It

We developed MSDetect using a combination of deep learning models, an LLM and modern web technologies:

Frontend:

  • Next.js for a responsive and dynamic user interface.
  • shadcn/ui for sleek and accessible UI components.

Backend:

  • FastAPI (Python) for efficient API development and data handling.
  • PyTorch to fine-tune Resnet50 with our dataset of MRI DICOM files
  • Perplexity to take the form data of demographics, and the model prediction output then generate a report.

🚧 Challenges We Ran Into

One of the biggest challenges we faced was finding a large and high-quality MRI dataset of MS patients and healthy controls. Many publicly available datasets were either too small or lacked proper labeling. To overcome this, we sourced MRI scans from multiple datasets and performed extensive pre-processing

Another major hurdle was model performance. Initially, we trained a standard convolutional neural network (CNN), but due to the limited dataset size, the model struggled with generalization. We then switched to fine-tuning ResNet50, a powerful pre-trained deep learning model, which significantly improved accuracy and robustness in detecting MS features from MRI scans.

📚 What We Learned

  • Fine tuning models
  • Using a model in an API
  • Managing file uploads and image processing in a multi-stack application

🚀 What's Next for MSDetect

  • To be integrated in hospitals for doctors to use
  • Train with a bigger dataset

Built With

  • fastapi
  • nextjs
  • perplexity
  • pytorch
  • resnet50
Share this project:

Updates