Differentiation of Acute Disseminated Encephalomyelitis from Multiple Sclerosis Using a Novel Brain Lesion Segmentation and Classification Pipeline

Osama Radi1, Aiden Huang2, Kira Murukami3,
1Jeddah Knowledge International School, 2Acton-Boxborough Regional High School, 3Dulles High School

Abstract

Multiple Sclerosis (MS) is a chronic autoimmune disease affecting the central nervous system, while Acute Disseminated Encephalomyelitis (ADEM) is a sudden, often monophasic inflammatory condition of the brain and spinal cord. Only 17% of ADEM cases are correctly diagnosed on the first visit due to overlapping clinical and radiological presentations with Multiple Sclerosis (MS) [1]. Both ADEM and MS are demyelinating diseases, meaning they cause brain lesions by damaging the myelin sheath, leading to scar tissue that disrupts nerve signals [2]. Previous machine learning pipelines have differentiated Neuromyelitis Optica Spectrum Disorder (NMOSD) (a different demyelinating disease) from MS and ADEM from NMOSD based on MRI imagery with varying accuracies [3, 4]. Our novel Classifier for Demyelinating Disease (CDD) pipeline is the first to differentiate ADEM from MS using MRI imagery. It does this in two stages: a segmentation stage which creates segmentation masks of the lesions and a classification stage to classify them as either ADEM or MS. Additionally, we introduce a novel ADEM dataset from open-access medical case reports. The CDD pipeline achieves an accuracy of 90.0% on our validation dataset, making it a potentially viable diagnostic tool in the future.

Methodology

Data Collection and Processing

The development of CDD involved meticulous data collection for both the segmentation and classification stages. For the segmentation phase, which uses a YOLOv8x model, T2-FLAIR brain MRI images of patients with brain lesions and ground truth segmentation masks were required. These masks were created by three highly qualified neuroradiologists to ensure precise annotations. The dataset for this phase was sourced from the Mendeley data repository [13]. For the classification phase, which employs a pretrained ResNet50 model through transfer learning, T2-FLAIR brain MRI images of patients diagnosed with either MS or ADEM were used. MS images were obtained from the dataset in the following paper [15]. Due to the rarity of ADEM, images were sourced from various different case reports, resulting in a varied and comprehensive dataset necessary for accurate classification. In total, 52 images were collected, with 38.5% used for validation data. We compiled the dataset of ADEM data from open-access case reports, which are publicly available and do not require additional patient consent for secondary use in research, in compliance with ethical guidelines and open-access policies.

Initially, the images and segmentation masks for training the YOLOv8 segmentation model were obtained in .nii format. Using the nibabel Python module, these images were converted to .jpg format to ensure compatibility with the segmentation model [33]. Additionally, the ground truth segmentation masks were formatted into the YOLO-compatible .txt format using the COCO2YOLO tool [34]. For the ResNet50 classification algorithm, uniform image size was essential. Thus, all T2-FLAIR brain MRI images for MS and ADEM cases were cropped to a standardized size of 390 x 442 pixels, ensuring consistency and effective learning in the classification model.

Segmentation

The segmentation phase of the project focused on training a YOLOv8x segmentation model to accurately identify and delineate brain lesions from T2-FLAIR brain MRI images [12]. The training process involved optimization over 300 epochs using a dataset comprised of training images and validation images, each paired with corresponding ground truth segmentation masks. These images and masks were sourced from the Mendeley dataset, specifically curated for T2-FLAIR brain MRI images of patients with brain lesions [13]. The YOLOv8 segmentation algorithm was selected due to its previous use in segmentation of tumors caused by breast cancer [35].

Classification

In the classification phase, a ResNet50 model pretrained on ImageNet underwent transfer learning using the segmentation masks generated by the YOLOv8 segmentation model [14, 12]. These masks, delineating lesions in T2-FLAIR brain MRI images, trained the ResNet50 model to classify the MRI images, distinguishing between MS and ADEM based on segmented regions. After training, the model’s performance was evaluated using a subset segmentation masks for validation, ensuring its ability to accurately classify MRI images across new data. The ResNet50 classication algorithm was selected due to its previous use in classifying pneumonia using segmented images [36].

Results

Segmentation

The results of the segmentation phase indicate that the YOLOv8 model achieved a low segmentation loss of 1.0054 and a box loss of 0.668. These metrics suggest a high degree of accuracy in the model’s ability to identify and delineate brain lesions within the T2-FLAIR MRI images. The low segmentation loss reflects the model’s precision in matching the predicted segmentation masks to the ground truth masks, while the low box loss indicates effective localization of the lesions.

Classification

In the classification phase, the ResNet50 model demonstrated a notable accuracy of 0.9 in distinguishing between Acute Disseminated Encephalomyelitis (ADEM) and Multiple Sclerosis (MS). Despite the relatively small size of the training dataset, it was carefully balanced, containing an equal number of images for both ADEM and MS. Importantly, the testing images were entirely novel to the model, ensuring that none of these images were part of the training data. This high accuracy, achieved under stringent testing limitations, underscores the model's effectiveness and potential utility in accurately classifying these neurological conditions based on T2-FLAIR brain MRI images.

Conclusion

We contribute the novel CDD pipeline to differentiate Acute Disseminated Encephalomyelitis (ADEM) from Multiple Sclerosis (MS) as well as a novel ADEM dataset. The CDD pipeline segments lesions present in MRI scans through the use of the YOLOv8x segmentation model and classifies these segmented images as either ADEM or MS via a pretrained ResNet50 model through transfer learning. We conclude that the CDD pipeline achieves a high accuracy of 90.0% in differentiating between ADEM and MS. Given the distinct treatments for ADEM and MS, the ability to accurately diagnose these diseases is crucial. The need for accurate differentiation is further amplified by the common misclassification of the two diseases due to their similar and overlapping features [38]. The improper diagnosis of these diseases can lead to inappropriate treatment, resulting in worse patient outcomes [39]. The high classification accuracy achieved by the CDD framework substantially improves reliability in clinical diagnosis, which enhances patient recovery by allowing appropriate treatment. The use of a ResNet50 model allowed us to avoid retraining a CNN model from scratch and resulted in us achieving a high accuracy in spite of limited data availability.