This study presents a deep learning-based system for diagnosing Multiple Sclerosis (MS) using MRI scans. The researchers developed a Content-Based Medical Image Retrieval (CBMIR) system leveraging Convolutional Neural Networks (CNNs) and Transfer Learning (TL) with the Inception V3 model trained on RadImageNet. The model was fine-tuned using Bayesian optimization and evaluated across four public MS MRI datasets. The system demonstrated high retrieval accuracy (mAP scores: 86.2%–94.18%), with potential for aiding radiologists in MS diagnosis.