KhayyamNet: A Parallel Multiscale Feature Fusion Framework for Accurate Diagnosis of Multiple Sclerosis and Myelitis
Abstract
1. Introduction
- Designing a parallel feature extraction framework (KhayyamNet): parallel extraction of spatial, local, and global features using Xception, CNN, and ViT networks.
- Fusing and optimizing the extracted features: effective integration of diverse features followed by MR-based feature selection to enhance feature relevance and to reduce dimensionality.
2. Related Work
2.1. Deep Learning in Medical Image Analysis Using Hybrid Architecture
2.2. Deep and Machine Learning Approaches for Differentiating MS and Myelitis
2.2.1. Machine Learning Methods
2.2.2. Deep Learning Methods
3. Proposed Method
3.1. Preprocessing
3.2. Feature Extraction
- Xception for learning hierarchical features with efficient convolutions.
- Custom CNN for local spatial patterns and fine texture detection.
- ViT for global context via attention mechanisms.
3.2.1. Input Image and Patch Embedding
3.2.2. Positional Embedding
3.2.3. Transformer Encoder Layers
- Each transformer encoder block consists of the following:
- Multi-Head Self-Attention (MHSA)
- Layer Normalization (LN)
- Feed-Forward Network (FFN)
- Residual Connections
- .
- are learnable matrices.
- denotes the dimension of each head.
3.2.4. Global Feature Vector
3.3. Feature Selection with MRMR
- Relevance is defined as the mutual information between feature and the class label y:
- Redundancy is defined as the average mutual information between features:
3.4. Classification
4. Results
4.1. Dataset
4.2. Evaluation Metrics
4.3. Simulation Setting
4.4. Evaluation of Results
4.4.1. Computational Cost and Efficiency Analysis
4.4.2. Ablation Study
5. Discussion
6. Conclusions
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Portaccio, E.; Magyari, M.; Havrdova, E.K.; Ruet, A.; Brochet, B.; Scalfari, A.; Di Filippo, M.; Tur, C.; Montalban, X.; Amato, M.P. Multiple sclerosis: Emerging epidemiological trends and redefining the clinical course. Lancet Reg. Health-Eur. 2024, 44, 100977. [Google Scholar] [CrossRef] [PubMed]
- Jakimovski, D.; Awan, S.; Eckert, S.; Farooq, O.; Weinstock-Guttman, B. Multiple sclerosis in children: Differential diagnosis, prognosis, and disease-modifying treatment. CNS Drugs 2022, 36, 45–59. [Google Scholar] [CrossRef]
- Rocca, M.A.; Preziosa, P.; Barkhof, F.; Brownlee, W.; Calabrese, M.; de Stefano, N.; Granziera, C.; Ropele, S.; Toosy, A.T.; Vidal-Jordana, A.; et al. Current and future role of MRI in the diagnosis and prognosis of multiple sclerosis. Lancet Reg. Health-Eur. 2024, 44, 100978. [Google Scholar] [CrossRef]
- Zhang, Y.; Lu, S.; Zhou, X.; Yang, M.; Wu, L.; Liu, B.; Phillips, P.; Wang, S. Comparison of machine learning methods for stationary wavelet entropy-based multiple sclerosis detection: Decision tree, k-nearest neighbors, and support vector machine. Simulation 2016, 92, 861–871. [Google Scholar] [CrossRef]
- Cavaliere, C.; Vilades, E.; Alonso-Rodríguez, M.C.; Rodrigo, M.J.; Pablo, L.E.; Miguel, J.M.; López-Guillén, E.; Sánchez Morla, E.M.; Boquete, L.; García-Martín, E. Computer-aided diagnosis of multiple sclerosis using a support vector machine and optical coherence tomography features. Sensors 2019, 19, 5323. [Google Scholar] [CrossRef]
- Saccà, V.; Sarica, A.; Novellino, F.; Barone, S.; Tallarico, T.; Filippelli, E.; Granata, A.; Chiriaco, C.; Bossio, R.B.; Valentino, P.; et al. Evaluation of machine learning algorithms performance for the prediction of early multiple sclerosis from resting-state fMRI connectivity data. Brain Imaging Behav. 2019, 13, 1103–1114. [Google Scholar] [CrossRef]
- Kaur, R.; Levy, J.; Motl, R.W.; Sowers, R.; Hernandez, M.E. Deep learning for multiple sclerosis differentiation using multi-stride dynamics in gait. IEEE Trans. Biomed. Eng. 2023, 70, 2181–2192. [Google Scholar] [CrossRef] [PubMed]
- Kara, A.C.; Hardalaç, F. Detection and Classification of Knee Injuries from MR Images Using the MRNet Dataset with Progressively Operating Deep Learning Methods. Mach. Learn. Knowl. Extr. 2021, 3, 1009–1029. [Google Scholar] [CrossRef]
- Ismail, K.A.; Dutta, A.K.; Sait, A.R. Ensemble Learning-Based Multiple Sclerosis Detection Technique Using Magnetic Resonance Imaging. J. Disabil. Res. 2024, 3, 20240078. [Google Scholar] [CrossRef]
- Zhang, Y.; Liu, T.; Lanfranchi, V.; Yang, P. Explainable Tensor Multi-Task Ensemble Learning Based on Brain Structure Variation for Alzheimer’s Disease Dynamic Prediction. IEEE J. Transl. Eng. Health Med. 2022, 11, 1–12. [Google Scholar] [CrossRef]
- Tatli, S.; Macin, G.; Tasci, I.; Tasci, B.; Barua, P.D.; Baygin, M.; Tuncer, T.; Dogan, S.; Ciaccio, E.J.; Acharya, U.R. Transfer-transfer model with MSNet: An automated accurate multiple sclerosis and myelitis detection system. Expert Syst. Appl. 2024, 236, 121314. [Google Scholar] [CrossRef]
- Mohammed Aarif, K.O.; Alam, A.; Pakruddin; Rahman, J.R. Exploring Challenges and Opportunities for the Early Detection of Multiple Sclerosis Using Deep Learning. In Artificial Intelligence and Autoimmune Diseases: Applications in the Diagnosis, Prognosis, and Therapeutics; Springer: Berlin/Heidelberg, Germany, 2024; pp. 151–178. [Google Scholar] [CrossRef]
- Ince, S.; Kunduracioglu, I.; Algarni, A.; Bayram, B.; Pacal, I. Deep Learning for Cerebral Vascular Occlusion Segmentation: A Novel ConvNeXtV2 and GRN-Integrated U-Net Framework for Diffusion-Weighted Imaging. Neuroscience 2025, 574, 42–53. [Google Scholar] [CrossRef]
- Pacal, I.; Attallah, O. Hybrid Deep Learning Model for Automated Colorectal Cancer Detection Using Local and Global Feature Extraction. Knowl.-Based Syst. 2025, 319, 113625. [Google Scholar] [CrossRef]
- Pacal, I.; Attallah, O. InceptionNeXt-Transformer: A Novel Multi-Scale Deep Feature Learning Architecture for Multimodal Breast Cancer Diagnosis. Biomed. Signal Process. Control 2025, 110, 108116. [Google Scholar] [CrossRef]
- Aruk, I.; Pacal, I.; Toprak, A.N. A Novel Hybrid ConvNeXt-Based Approach for Enhanced Skin Lesion Classification. Expert Syst. Appl. 2025, 283, 127721. [Google Scholar] [CrossRef]
- Acar, Z.Y.; Başçiftçi, F.; Ekmekci, A.H. Future Activity Prediction of Multiple Sclerosis with 3D MRI Using 3D Discrete Wavelet Transform. Biomed. Signal Process. Control 2022, 78, 103940. [Google Scholar] [CrossRef]
- Jain, S.; Rajpal, N.; Yadav, J. Multiple Sclerosis Identification Based on Ensemble Machine Learning Technique. In Proceedings of the 2nd International Conference on IoT, Social, Mobile, Analytics & Cloud in Computational Vision & Bio-Engineering (ISMAC-CVB 2020), Tamil Nadu, India, 29–30 November 2020. [Google Scholar] [CrossRef]
- Huang, J.; Xin, B.; Wang, X.; Qi, Z.; Dong, H.; Li, K.; Zhou, Y.; Lu, J. Multi-Parametric MRI Phenotype with Trustworthy Machine Learning for Differentiating CNS Demyelinating Diseases. J. Transl. Med. 2021, 19, 377. [Google Scholar] [CrossRef] [PubMed]
- Eshaghi, A.; Riyahi-Alam, S.; Saeedi, R.; Roostaei, T.; Nazeri, A.; Aghsaei, A.; Doosti, R.; Ganjgahi, H.; Bodini, B.; Shakourirad, A.; et al. Classification Algorithms with Multi-Modal Data Fusion Could Accurately Distinguish Neuromyelitis Optica from Multiple Sclerosis. Neuroimage Clin. 2015, 7, 306–314. [Google Scholar] [CrossRef] [PubMed]
- Storelli, L.; Azzimonti, M.; Gueye, M.; Vizzino, C.M.; Preziosa, P.M.; Tedeschi, G.; De Stefano, N.M.; Pantano, P.M.; Filippi, M.; Rocca, M.A. A Deep Learning Approach to Predicting Disease Progression in Multiple Sclerosis Using Magnetic Resonance Imaging. Investig. Radiol. 2022, 57, 423–432. [Google Scholar] [CrossRef]
- Krishnamoorthy, S.; Zhang, Y.; Kadry, S.; Khan, M.A.; Alhaisoni, M.; Mustafa, N.; Yu, W.; Alqahtani, A. Automatic Intelligent System Using Medical of Things for Multiple Sclerosis Detection. Comput. Intell. Neurosci. 2023, 2023, 4776770. [Google Scholar] [CrossRef] [PubMed]
- Huang, C.; Chen, W.; Liu, B.; Yu, R.; Chen, X.; Tang, F.; Liu, J.; Lu, W. Transformer-Based Deep-Learning Algorithm for Discriminating Demyelinating Diseases of the Central Nervous System with Neuroimaging. Front. Immunol. 2022, 13, 897959. [Google Scholar] [CrossRef]
- Narayana, P.A.; Coronado, I.; Sujit, S.J.; Wolinsky, J.S.; Lublin, F.D.; Gabr, R.E. Deep Learning for Predicting Enhancing Lesions in Multiple Sclerosis from Noncontrast MRI. Radiology 2020, 294, 398–404. [Google Scholar] [CrossRef]
- Rocca, M.A.; Anzalone, N.; Storelli, L.; Del Poggio, A.; Cacciaguerra, L.; Manfredi, A.A.; Meani, A.; Filippi, M. Deep Learning on Conventional Magnetic Resonance Imaging Improves the Diagnosis of Multiple Sclerosis Mimics. Investig. Radiol. 2021, 56, 252–260. [Google Scholar] [CrossRef]
- Eitel, F.; Soehler, E.; Bellmann-Strobl, J.; Brandt, A.U.; Ruprecht, K.; Giess, R.M.; Kuchling, J.; Asseyer, S.; Weygandt, M.; Haynes, J.-D.; et al. Uncovering Convolutional Neural Network Decisions for Diagnosing Multiple Sclerosis on Conventional MRI Using Layer-Wise Relevance Propagation. Neuroimage Clin. 2019, 24, 102003. [Google Scholar] [CrossRef]
- Seok, J.M.; Cho, W.; Chung, Y.H.; Ju, H.; Kim, S.T.; Seong, J.-K.; Min, J.-H. Differentiation Between Multiple Sclerosis and Neuromyelitis Optica Spectrum Disorder Using a Deep Learning Model. Sci. Rep. 2023, 13, 11625. [Google Scholar] [CrossRef] [PubMed]
- Hagiwara, A.; Otsuka, Y.; Andica, C.; Kato, S.; Yokoyama, K.; Hori, M.; Fujita, S.; Kamagata, K.; Hattori, N.; Aoki, S. Differentiation Between Multiple Sclerosis and Neuromyelitis Optica Spectrum Disorders by Multiparametric Quantitative MRI Using Convolutional Neural Network. J. Clin. Neurosci. 2021, 87, 55–58. [Google Scholar] [CrossRef]
- Ekmekyapar, T.; Taşcı, B. Exemplar MobileNetV2-Based Artificial Intelligence for Robust and Accurate Diagnosis of Multiple Sclerosis. Diagnostics 2023, 13, 3030. [Google Scholar] [CrossRef]
- Zhang, Y.; Hong, D.; McClement, D.; Oladosu, O.; Pridham, G.; Slaney, G. Grad-CAM Helps Interpret the Deep Learning Models Trained to Classify Multiple Sclerosis Types Using Clinical Brain Magnetic Resonance Imaging. J. Neurosci. Methods 2021, 353, 109098. [Google Scholar] [CrossRef]
- Dehghanpour, M.; Fateh, M.; Mohammadpoory, Z.; Ferdowsi, S. ZechariahNet: A Novel Method of MS Lesion Diagnosis Through MRI Images by the Combination of C-LSTM and 3D CNN Algorithms. Algorithms 2026, 19, 72. [Google Scholar] [CrossRef]
- Chollet, F. Xception: Deep Learning with Depthwise Separable Convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 1251–1258. [Google Scholar] [CrossRef]
- Lu, E.H.C.; Gozdzikiewicz, M.; Chang, K.H.; Ciou, J.M. A Hierarchical Approach for Traffic Sign Recognition Based on Shape Detection and Image Classification. Sensors 2022, 22, 4768. [Google Scholar] [CrossRef] [PubMed]
- Lei, X.; Pan, H.; Huang, X. A Dilated CNN Model for Image Classification. IEEE Access 2019, 7, 124087–124095. [Google Scholar] [CrossRef]
- Han, K.; Wang, Y.; Chen, H.; Chen, X.; Guo, J.; Liu, Z.; Tang, Y.; Xiao, A.; Xu, C.; Xu, Y.; et al. A Survey on Vision Transformer. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 45, 87–110. [Google Scholar] [CrossRef] [PubMed]
- Peng, H.; Long, F.; Ding, C. Feature selection based on mutual information criteria of max-dependency, max-relevance, and min-redundancy. IEEE Trans. Pattern Anal. Mach. Intell. 2005, 27, 1226–1238. [Google Scholar] [CrossRef] [PubMed]
- Plaia, A.; Buscemi, S.; Fürnkranz, J.; Mencía, E.L. Comparing Boosting and Bagging for Decision Trees of Rankings. J. Classif. 2022, 39, 78–99. [Google Scholar] [CrossRef]
- Lycklama à Nijeholt, G.J.; Uitdehaag, B.M.; Bergers, E.; Castelijns, J.A.; Polman, C.H.; Barkhof, F. Spinal Cord Magnetic Resonance Imaging in Suspected Multiple Sclerosis. Eur. Radiol. 2000, 10, 368–376. [Google Scholar] [CrossRef] [PubMed]
- NourEldeen, R.M.; Elshshtawy, R.A.; Elgohary, O.A.; Wahba, F.A.A.; Attia, M.K.; Elazm, Z.B.A.; Khattap, M.G.; Hassan, H.G.E.M.A.; Mostafa, M.; Ibrahim, N.; et al. Revolutionizing Neurological Diagnostics: Integrating 6G Technology with Deep Learning for Enhanced Detection of Multiple Sclerosis and Myelitis. In Proceedings of the 2024 International Telecommunications Conference (ITC-Egypt), Cairo, Egypt, 22–25 July 2024; pp. 602–608. [Google Scholar] [CrossRef]
- Alzahrani, S.M. MS-Trust: A Transformer Model with Causal-Global Dual Attention for Enhanced MRI-Based Multiple Sclerosis and Myelitis Detection. Complex Intell. Syst. 2025, 11, 331. [Google Scholar] [CrossRef]







| Ref | Method | Dataset |
|---|---|---|
| [17] | 3D Discrete Wavelet Transform | 3D MRI Dataset |
| [18] | Ensemble Classifier | MRI Dataset |
| [19] | Multi-parametric MRI with trustworthy machine learning classification | Multi-parametric MRI data from CNS demyelinating disease patients |
| [20] | Algorithms with Multi-modal Data Fusion | Multi-modal data involving patients with neuromyelitis optica and multiple sclerosis |
| Ref | Method | Dataset |
|---|---|---|
| [21] | CNN | MRI Data |
| [22] | MultiResUNet and DenseNet121 | MRI Data |
| [23] | Transformer-based Deep Learning | Neuroimaging Dataset |
| [24] | CNN | Noncontrast MRI Dataset |
| [25] | CNN | Conventional MRI images from patients with MS mimics |
| [26] | Layer-wise Relevance Propagation (LRP) | Conventional MRI data for diagnosing multiple sclerosis |
| [27] | Deep Learning Model | MRI data from patients with MS and neuromyelitis optica spectrum disorder |
| [28] | CNN | Multi-parametric quantitative MRI data from patients with MS and NMOSD |
| [29] | Exemplar MobileNetV2-based Model | MRI images from patients diagnosed with MS |
| [30] | Grad-CAM (Gradient-weighted Class Activation Mapping) | Clinical brain MRI data for classifying different types of multiple sclerosis |
| [31] | Combination of the U-Net backbone with 3D CNN | ISBI2015 |
| Network | Parameter | No. of Parameters | Purpose |
|---|---|---|---|
| CNN | No. of Filters | 20 | To capture local spatial patterns |
| CNN | No. of outputs | 100 | Captures high-level abstract features |
| ViT | No. of Transformer | 12 | Captures global dependencies using attention mechanisms |
| ViT | No. of Attention Heads | 8 | Attention mechanism to focus on key regions of the image |
| ViT | Hidden Size | 512 | Size of the hidden representation in each layer |
| ViT | No. of Tokens | 16 | Divides the image into patches for processing |
| Xception | No. of Filters | 128 | Learn complex hierarchical features |
| Xception | No. of Depth-wise Convolutions | 8 layers | Learns spatially separable features |
| Xception | Pooling Size | Reduces dimensionality while retaining important features | |
| Xception | No. of outputs | 1000 | Abstract representation of image content |
| Classes | No. of Training Samples Before Augmentation | No. of Training Samples After Augmentation | No. of Test Samples |
|---|---|---|---|
| Healthy | 1236 | 1910 | 137 |
| MS | 635 | 1910 | 71 |
| Myelitis | 600 | 1910 | 67 |
| Total | 2471 | 5730 | 275 |
| Class | Precision % | Recall % | F1-Score % | Accuracy % |
|---|---|---|---|---|
| Healthy | - | |||
| MS | - | |||
| Myelitis | - | |||
| Overall |
| Method | Training Time (min) | Testing Time (ms) |
|---|---|---|
| ResNet18 | 85 | 98 |
| DarkNet19 | 110 | 105 |
| MobileNetV2 | 30 | 58 |
| ShuffleNet | 15 | 55 |
| GoogLeNet | 95 | 102 |
| AlexNet | 60 | 85 |
| Vgg16 | 130 | 125 |
| Proposed Method (KhayyamNet) | 100 | 66 |
| Method | Accuracy |
|---|---|
| CNN + MRMR + RF | |
| Xception + MRMR + RF | |
| ViT + MRMR + RF | |
| CNN + Xception + MRMR + RF | |
| CNN + ViT + MRMR + RF | |
| Xception + ViT + MRMR + RF | |
| CNN + Xception + ViT + RF | |
| CNN + Xception + ViT + MRMR+ SVM | |
| CNN + Xception + ViT + MRMR+ LDA | |
| CNN + Xception + ViT + MRMR+ BEC | |
| ResNet18 + MRMR+ RF | |
| DarkNet19 + MRMR+ RF | |
| MobileNetV2 + MRMR+ RF | |
| ShuffleNet + MRMR+ RF | |
| GoogLeNet + MRMR+ RF | |
| AlexNet + MRMR+ RF | |
| Vgg16 + MRMR+ RF | |
| Proposed Method (KhayyamNet) |
| Study | Method | Year | Accuracy |
|---|---|---|---|
| Tatli et al. [11] | MSNet, DenseNet201, ResNe50, NCA, RF, Ch2, SVM, KNN, IMV | 2024 | |
| NourEldeen et al. [39] | CNN+MobileNet | 2024 | |
| Alzahrani et al. [40] | MS-Trust: Causality Attention + Global Attention + Squeeze-Excitation + Convolutional Tokenizer + CutMix/MixUp Regularization | 2025 | |
| Proposed Model (KhayyamNet) | CNN + Xception + ViT + MRMR+ RF | 2026 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Dehghanpour, M.; Fateh, M.; Mohammadpoory, Z.; Ferdowsi, S. KhayyamNet: A Parallel Multiscale Feature Fusion Framework for Accurate Diagnosis of Multiple Sclerosis and Myelitis. Mach. Learn. Knowl. Extr. 2026, 8, 62. https://doi.org/10.3390/make8030062
Dehghanpour M, Fateh M, Mohammadpoory Z, Ferdowsi S. KhayyamNet: A Parallel Multiscale Feature Fusion Framework for Accurate Diagnosis of Multiple Sclerosis and Myelitis. Machine Learning and Knowledge Extraction. 2026; 8(3):62. https://doi.org/10.3390/make8030062
Chicago/Turabian StyleDehghanpour, Mahshid, Mansoor Fateh, Zeynab Mohammadpoory, and Saideh Ferdowsi. 2026. "KhayyamNet: A Parallel Multiscale Feature Fusion Framework for Accurate Diagnosis of Multiple Sclerosis and Myelitis" Machine Learning and Knowledge Extraction 8, no. 3: 62. https://doi.org/10.3390/make8030062
APA StyleDehghanpour, M., Fateh, M., Mohammadpoory, Z., & Ferdowsi, S. (2026). KhayyamNet: A Parallel Multiscale Feature Fusion Framework for Accurate Diagnosis of Multiple Sclerosis and Myelitis. Machine Learning and Knowledge Extraction, 8(3), 62. https://doi.org/10.3390/make8030062

