Multiple sclerosis (MS) is a chronic autoimmune disease of the central nervous system that prominently affects young adults due to its debilitating nature. The pathogenesis of the disease is focused on the inflammation and neurodegeneration processes. Inflammation is associated with relapses, while neurodegeneration emerges in the progressive stages of the disease. Magnetic resonance imaging (MRI) is commonly used for the diagnosis of MS, and guidelines such as the McDonald criteria are available. MRI is an essential tool to demonstrate the spatial distribution and changes over time in the disease. This study discusses the use of image processing techniques for the diagnosis of MS and specifically combines the MobileNetV2 network with exemplar-based learning, IMrMr feature selection, and K-Nearest Neighbors (KNN) classification methods. Experiments conducted on two different datasets (Dataset 1 and Dataset 2) demonstrate that these methods provide high accuracy in diagnosing MS. Dataset 1 comprises 128 patients with 706 MRI images, 131 MS patients with 667 MRI images, and 150 healthy control subjects with 1373 MRI images. Dataset 2 includes an MS group with 650 MRI images and a healthy control group with 676 MRI images. The results of the study include 10-fold cross-validation results performed on different image sections (Axial, Sagittal, and Hybrid) for Dataset 1. Accuracy rates of 99.76% for Axial, 99.48% for Sagittal, and 98.02% for Hybrid sections were achieved. Furthermore, 100% accuracy was achieved on Dataset 2. In conclusion, this study demonstrates the effective use of powerful image processing methods such as the MobileNetV2 network and exemplar-based learning for the diagnosis of MS. These findings suggest that these methods can be further developed in future research and offer significant potential for clinical applications in the diagnosis and monitoring of MS.