- 1Department of Mathematics, School of Advanced Sciences, Vellore Institute of Technology, Vellore, Tamil Nadu, India
- 2Department of Analytics, School of Computer Science and Engineering, Vellore Institute of Technology, Vellore, Tamil Nadu, India
- 3Department of Software and Systems Engineering, School of Computer Science Engineering and Information System, Vellore Institute of Technology, Vellore, Tamil Nadu, India
The healthcare field increasingly relies on autonomous systems for the detection and analysis of Multiple Sclerosis (MS) to minimize diagnostic delays, resource burdens, reduce the progression of disability, and enhance clinical decision-making efficiency. Such systems ensure accurate and timely treatment, ultimately improved patient outcomes. In this study, a hybrid framework combining deep learning-based feature extraction, metaheuristic feature selection, and machine learning (ML) classifiers is proposed for accurate MS classification. All MRI images were preprocessed using Contrast Limited Adaptive Histogram Equalization (CLAHE), resizing, and normalization to enhance contrast and standardize the input dimensions. Deep features were extracted using the pretrained VGG16 convolutional neural network (CNN), in which the fully connected layers were removed, and the convolutional base was used to obtain high-dimensional features per image. To reduce dimensionality and improve classification performance, the Whale Optimization Algorithm (WOA) was employed to select the most discriminative subset of features using a Support Vector Machine (SVM)-based fitness function. Multiple classifiers were then trained and evaluated using the optimized feature set. Among them, the Artificial Neural Network integrated with WOA (ANN+WOA) achieved the highest classification accuracy of 98%, demonstrating the potential of the proposed model for reliable, efficient, and automated MS diagnosis.
1 Introduction
Multiple sclerosis is a long-term autoimmune disorder that damages the myelin sheath covering nerve fibers as seen in Figure 1, leading to the formation of lesions in the brain’s white matter (Steinman, 1996). Moreover, as an autoimmune disorder, MS leads to inflammation and harm to the myelin sheath, a protective layer around nerves, which impedes effective communication between the brain and the rest of the body. Approximately 3.59 out of 100,000 people worldwide suffer from MS (Szekely-Kohn et al., 2025). It is most commonly diagnosed in young adults between the ages of 20 and 45 and is more prevalent in women. The myelin sheath plays a crucial role in shielding nerve fibers and facilitating the rapid transmission of electrical signals between the brain and other parts of the body. This results in impaired signal transmission and progressive neurological deficits such as visual disturbances, motor impairment, and cognitive dysfunction. The disease typically begins as relapsing–remitting MS (RRMS) and may advance to secondary progressive MS (SPMS), marked by continuous disability accumulation. Early diagnosis and accurate classification of MS are clinically significant, as timely treatment can slow disease progression and improve quality of life. When demyelination occurs, it disrupts this signal conduction (Zhao and Jacob, 2023). The symptoms of multiple sclerosis differ among individuals but commonly include fatigue, muscle weakness, vision disturbances, depression, and balance issues. MRI, currently the most commonly used medical imaging method, plays a crucial role in detecting and diagnosing this condition (Sadeghibakhi et al., 2022).
Figure 1. Difference between (a) healthy (intact) myelin and (b) damaged myelin associated with multiple sclerosis.
Several potential risk factors have been identified as contributing to the development of MS, including a history of Epstein-Barr virus infection, geographic location based on latitude, the month of birth, and specific genetic markers (Barrie et al., 2024; Kurtzke et al., 1979). Similar to other autoimmune diseases, MS shows a clear gender disparity, affecting women approximately three times more often than men (Szekely-Kohn et al., 2025). Although the precise origin is still unknown, it is thought to be influenced by a number of variables, including viral infections, environmental factors, and genetics (Sadeghibakhi et al., 2022).
An MRI is one of the most important imaging modalities used in the medical field. especially MRI, have significantly enhanced our understanding of Multiple Sclerosis. High sensitivity is offered by MRI for the early identification of white matter inflammatory demyelinating lesions. There are several kinds of weighted MR images, such as sequences that are FLAIR-weighted (FLAIR-w), T1-weighted (T1-w), and T2-weighted (T2-w) (Zhao and Jacob, 2023). The three main anatomical planes in MRI and other medical imaging are: the body (or an organ) is divided horizontally by the axial plane, creating slices that divide the upper and lower components. Each axial picture in a brain MRI represents a “slice” seen from above, enabling measurements of lesion load, cortical thickness, and ventricular size at progressively higher elevations. The left and right parts of the body are separated by the vertical sagittal plane (Gray et al., 2008; Moore and Dalley, 2018). While parasagittal slices display lateral white-matter tracts and cortical areas, a midsagittal slice (across the midline) displays midline structures like the corpus callosum and brainstem. The anterior (front) and posterior (back) perspectives are separated by the coronal plane, which likewise extends vertically. The hippocampus, posterior fossa anatomy, and frontal and temporal lobes may all be shown in one continuous view with coronal MRI slices (Bushberg and Boone, 2011).
To assess the dynamics and course of the illness, it is crucial to accurately identify and segment MS lesions in MR imaging (Rolak, 2003). Artificial intelligence, particularly machine learning, has seen widespread adoption across various domains, including the field of medicine. Over the past decade, the application of ML in the study of neurological disorders has grown significantly Multiple machine learning techniques have been used to classify MS (AlSaeed and Omar, 2022). Recent developments in ML, DL, and image processing approaches seem to hold promise for automating the illness diagnosis procedure to enhance MS disease detection (Vázquez-Marrufo et al., 2023). Identification of neurological disorders is now feasible because to recent advancements in artificial intelligence (AI), particularly in ML, DL, and computer vision (Vijayan and Chowdhary, 2025).
The fundamental steps of picture categorization utilizing the MS illness dataset are shown in Figure 2. MRI images can be gathered directly from clinical sources or from pre-existing medical imaging libraries as part of the first phase. The next step is picture pre-processing. To increase picture quality and lessen distortion, common pre-processing methods including contrast enhancement and normalization are used. Resizing, grayscale conversion, noise reduction, normalization, binarization, and contrast enhancement are common procedures at this stage that get the pictures ready for additional examination and categorization (Dhanka and Maini, 2025).
Employing VGG16 as the sole feature extractor provides a simple yet powerful means to capture multiscale lesion patterns in MS MRI scans. This approach removes the need for manual feature engineering while enhancing both classification efficiency and accuracy, effectively distinguishing MS-related abnormalities from healthy tissue (Hu et al., 2025).
Authors in Daqqaq et al. (2024) used 2D–3D convolutional neural networks on MRI data to detect, categorize, and segment MS lesions. By combining performance measures from several investigations, including accuracy, sensitivity, specificity, and Dice Similarity Coefficient (DSC), they discovered that Convolutional Neural Network-based MRI demonstrated a strong DSC segmentation and very high lesion detection rates and classification accuracy with 98.81%. Placidi et al. (2025) describe an automated system that mimics expert radiologists by explicitly modeling diagnostic uncertainty, using several CNNs, each trained to identify lesions with knowledge of their spatial continuity and anatomical context, and combining their results using an ensemble classifier.
This approach integrates a bio-inspired optimization technique with deep learning to enhance diagnostic performance. Specifically, we employ a CNN_WOA framework, which combines CNNs for deep feature extraction with the WOA for optimal feature selection. This hybrid methodology is designed to improve diagnostic accuracy while reducing computational complexity, providing a robust and automated solution for the early detection and classification of MS.
2 Motivation and contributions
2.1 Motivation
In medical image analysis, especially for conditions like MS, it is very important to select the most relevant features from large and complex data. This helps improve the accuracy of disease detection and reduces the time and resources needed. Traditional methods often struggle to deal with the complex and non-linear nature of MRI images. The WOA, which is inspired by the hunting behavior of humpback whales, offers an effective way to select the best features. WOA works well because it can explore different possibilities while also focusing on the best solutions. When WOA is combined with features extracted from deep learning models like CNN, it helps boost the performance of classifiers such as SVM, ANN, and Random Forest. This leads to more accurate and faster diagnosis of MS using MRI scans.
2.2 Contributions
• First, we provide Conducted experiments on MS MRI datasets with separate training and testing folders, making the approach robust and clinically applicable.
• Second, we Proposed a novel hybrid framework that integrates CNN feature extraction with WOA metaheuristic algorithm for effective feature selection in MRI-based MS classification. Applied WOA to identify the most informative features from high-dimensional CNN outputs, significantly reducing feature space while improving classification accuracy.
• Thirdly, Performed a comprehensive comparison of several machine learning classifiers using selected features, demonstrating improved performance across models.
3 Related work
This section highlights key research and discoveries, emphasizing that timely detection plays a crucial role in delaying the advancement of MS. MRI plays a crucial role in identifying MS-related brain abnormalities, while also demonstrating the advancements in computationally intelligent systems for medical diagnosis. Researchers have automatically extracted discriminative characteristics from MRI images using deep learning models, namely CNNs (Krizhevsky et al., 2017; Litjens et al., 2017).
Valverde et al. (2017) enhanced sensitivity by creating a cascaded CNN system for MS lesion detection and segmentation. Aslani et al. (2019) suggested a multi-branch CNN architecture specifically designed for MS lesion segmentation, which demonstrated strong performance in a variety of MRI modalities. Nevertheless, high-dimensional feature vectors produced by CNN models frequently have the potential to impair the effectiveness and precision of conventional classifiers.
Studies have shown that the quality of datasets plays a major role in the results of empirical research, especially in software engineering (Mockus, 2008). Many researchers rely on publicly available datasets for their studies because they are easy to access. However, even though datasets are crucial for research, only a few studies consider their quality (Li et al., 2019; Rosli et al., 2016). If the datasets have quality issues, they can lead to misleading or classification unreliable conclusions. Especially MRI dataset aids in the detection, analysis, and of disorders in medical research and diagnosis.
In this research, we present a unique hybrid technique to successfully detect MS using brain MRI images by combining CNN-based deep feature extraction with WOA-based optimum feature selection. Machine learning methods including SVM, ANN, Random Forest, and KNN are then used for classification.
3.1 Image processing and techniques
The rapid growth of machine learning and artificial intelligence has enabled the use of image processing and classification techniques for the automated detection of neurological disorders. In particular, these technologies can be applied to analyze brain MRI scans and support the early and accurate diagnosis of MS, reducing the reliance on manual interpretation and improving clinical decision-making. DL, which is a type of ML, uses layers of neural networks to automatically learn the important features needed to detect diseases more accurately (Rana and Bhushan, 2023). CNNs are one class of deep learning models that have demonstrated superior performance in image-based tasks such as classification, object recognition, and segmentation.
CNNs have been widely applied in real-life tasks such as analyzing videos, understanding language, recognizing patterns, and processing speech. In CNNs, hierarchical connections with automated self-training and weight sharing are the most important aspects. The functions of semi-connected and fully connected layers differ, and they offer a suitable setting for both feed-forward and backward error propagation during the training process (Koushik, 2016; Liu, 2018).
Authors in Fiorini et al. (2015), A ML model was designed to evaluate clinical information and monitor the progression of Multiple Sclerosis. The primary objective was to differentiate between the benign and progressive types of the condition. Several classification algorithms were applied, such as Regularized Least Squares (RLS), Logistic Regression (LR), K-Nearest Neighbors (KNN), Ordinary Least Squares (OLS), and Linear Support Vector Machine (SVM). Researchers have also explored the combination of the fusion of CNNs and conventional classifiers like SVMs. CNNs have demonstrated strong performance in disease detection from images, thanks to their capacity to autonomously learn spatial features. The analysis utilized a dataset comprising 457 patient records, encompassing a total of 91 distinct features.
Authors in Zhang et al. (2021), A CNN model was constructed using MRI scans to categorize individuals into three classes: Relapsing-Remitting Multiple Sclerosis (RRMS), Secondary Progressive Multiple Sclerosis (SPMS), and healthy controls. The dataset comprised FLAIR, T1-weighted, and T2-weighted images, total 135 scans for each modality, obtained from 19 MS patients and 19 individuals without the disease.
3.2 Feature extraction techniques
Extracting features plays a crucial role in the analysis of medical images, particularly in disease diagnosis using MRI scans. In image processing, feature extraction refers to the identification and quantification of significant patterns or attributes within an image that can aid in classification and interpretation. Traditional methods focus on features related to texture, shape, intensity, and color to represent essential image characteristics. MRI illness diagnosis frequently uses first-order statistics, which characterize the intensity distribution within a ROI (Region of Interest). Handling such high-dimensional features can be computationally demanding, especially when employing deep learning architectures like ResNet.
Measures the average brightness in the regions shown below as Equations 1, 2.
Standard deviation is used as a feature because it indicates intensity variability, which helps differentiate between healthy and diseased brain tissues in MRI scans.
The spatial distribution of pixel intensities within an image region is described by texture characteristics, which aid in capturing patterns like regularity, roughness, granularity, and smoothness. These patterns are essential in brain MRI because they can identify lesions that differ in structural texture but not in intensity alone. We suggest a set of texture features that can be extracted from each grayscale spatial dependency matrix, as defined by the following mathematical expressions (Haralick et al., 2007; Kurniati et al., 2024).
Equation 3, referred to as contrast or inertia, quantifies the extent of intensity variation between neighboring image pixel elements. An elevated contrast measure reflects substantial differences in pixel intensities, whereas a low value suggests more uniform intensity. The contrast can be computed using the following expression (Razali et al., 2023).
In Equation 4, the energy metric rises when the matrix components exhibit uniformity or resemble each other. The formula for calculating energy is provided below (Kurniati et al., 2024; Park and Guldmann, 2020).
Equation 5 represents entropy, which quantifies the amount of information or the degree of texture complexity present in an image (Guo et al., 2022; Kurniati et al., 2024).
Closeness of the distribution to the diagonal represent in Equation 6:
How correlated a pixel is to its neighbor as shown below Equation 7:
Where i and j represent the indices of the co-occurrence matrix, P(i, j) denotes the value at position (i, j)th within the matrix, μi and μj are the mean values of the row and column distributions, respectively, σi and σj correspond to the standard deviations of those row and column distributions (Kurniati et al., 2024).
Analyzing the size, form, and spatial properties of lesions found in brain MRI images requires the use of morphological data. These characteristics, which are often employed in both human and automated disease detection methods, aid in distinguishing diseased tissues from healthy tissue (Gonzalez, 2009).
With advancements in deep learning, CNNs have become widely used, as they can automatically learn complex and layered features from images without manual intervention. Overall, feature extraction transforms high-dimensional image data into compact and meaningful representations, making it easier for machine learning algorithms to learn effectively and produce accurate results. Because of their ability to identify complex visual patterns, these models are highly effective in extracting features that highly effective in extracting features that highly effective in extracting features that highly effective in extracting features that significantly improve classification accuracy. By leveraging pre-trained deep learning models to autonomously extract advanced features from images, the reliance on manual feature engineering decreases, while the accuracy of deep feature extraction using architectures like ResNet, InceptionNet, and VGG16 improves (Ahmad et al., 2021; Vijayan and Chowdhary, 2025).
3.3 Classification
Classification models are crucial parts of image-based analysis, especially when it comes to medical diagnostics like MRI scan illness detection. Image classification has shown significant potential in diagnosing various diseases, especially those affecting the brain, by leveraging advanced machine learning techniques to effectively analyze and interpret complex medical images (Singh et al., 2024).
Convolutional neural networks use the masked MRI slices to automatically train hierarchical, spatially invariant feature detectors (edges → textures → lesions). Equation 8 shows deep characteristics converted into a calibrated probability for MS vs. control by the last sigmoid/softmax layer (Liu, 2018).
The final convolution + global-average-pooling feature vector is denoted by z.
w, b are the learned weights and bias of the final dense layer.
σ is applied, the logit becomes a likelihood that the scan is MS () or Control ().
To discover non-linear correlations between CNN and texture characteristics, we input the CNN and texture information into a tiny neural network. Equation 9 represented as formula for new activation function.
h(l): new activation.
W(l): multiply the previous layer’s outputs by the weight matrix.
f(l): non- linear function element wise.
b(l): add the bias vector.
As defined in Equation 10, Support Vector Machines that use an RBF (Radial Basis Function) kernel to identify the maximum-margin boundary in a converted feature space perform very well in high-dimensional, small-sample scenarios (Vázquez-Marrufo et al., 2023).
αi are the learned dual coefficients.
yi is the label of the ith training example and b being the bias.
k-Nearest Neighbors classifies a new MRI by finding the most similar training scans in feature space and letting them “vote” on the label, without fitting any global model. Therefore, when your fused MRI features are correctly normalized and highly discriminative, KNN is straightforward, clear, and efficient. Equation 11 formulates the normalized discriminative to closest training points.
Nk(x): is the set of the k closest training points to x.
1 [yi = c]: counts how many neighbors belong to class c.
4 Proposed model
The main aim of this study is to design a classification system supported by optimal feature selection to accurately identify MS using brain MRI images. MS is a neurological disorder that can severely affect motor and cognitive functions if not diagnosed in its early stages. Early and accurate detection is essential to slow disease progression, enhance treatment effectiveness, and improve patient outcomes. Traditionally, MS detection is done manually by experts analyzing MRI scans, which is time-consuming and may lead to inconsistencies. To address this, an automated approach is introduced to detect MS-related abnormalities in MRI images more efficiently. In this process, CNNs play a key role, as they are capable of learning detailed image patterns and performing precise classification when trained with sufficient and quality data. Algorithm 1 presents a detailed overview of the proposed model, while Figure 3 provides its visual representation.
4.1 Image dataset
The dataset used in this study contains a total of 3,427 MRI images, sourced from Kaggle. It is categorized into four classes as shown in Figure 4. To ensure consistency and improve the performance of the classification model, all images were normalized during preprocessing. The mathematical representation of the normalized image dataset is provided in Equation 12 below.
Where
Mi input images related to MS present in the archive.
Ib represents the brain images included in the dataset.
i denotes the overall number of images stored in the archive.
4.2 Pre-processing
To enhance the visibility and overall quality of MRI scans, a preprocessing stage is incorporated into the proposed model prior to feature extraction and classification. Initially, each image is processed using CLAHE, a method that improves local contrast and highlights critical structural features, particularly in areas with low intensity variations. CLAHE operates by adjusting pixel intensities within localized image regions, thereby enhancing important visual details. After contrast, GLCM techniques are used to extract texture-based features from the grayscale version of the improve images (Vijayan and Chowdhary, 2025). This preprocessing pipeline ensures that the model is trained on high-quality, feature-rich data, which is essential for accurate classification. Figure 5 presents the outcome after applying CLAHE to the input image.
Standardizing medical image dimensions through resizing is a fundamental step in preparing data for convolutional neural networks. This practice involves adjusting images to predetermined sizes, such as 224 × 224 pixels commonly used with the VGG16 architecture, to ensure uniformity across the dataset and compatibility with pretrained models. The inherent design of deep neural networks enables them to identify and extract multi-level spatial and contextual patterns, which means critical diagnostic features and lesion characteristics remain discernible despite dimensional adjustments.
Modern resizing techniques employ sophisticated interpolation methods like bilinear and bicubic algorithms to maintain image integrity during the transformation process. These approaches effectively minimize data loss that might otherwise occur during scaling operations. Research in neuroimaging has consistently demonstrated that standardizing brain MRI dimensions to conventional scales has negligible impact on either lesion detection capability or the predictive performance of classification systems when using deep learning for feature extraction (Hussain et al., 2025; Simonyan and Zisserman, 2014).
In mathematical form, CLAHE acts as a transformation over specific image tiles to enhance local contrast as Equations 13, 14 (Zuiderveld, 1994).
where
I(x, y): original grayscale image
I′(x, y): enhanced image after applying CLAHE
∁:the CLAHE transformation operator
Tk(i): transformation function in local
L: total number of gray levels
Hk(i): histogram of gray levels in tile k
Nk: number of pixels in the tile k.
4.3 Feature extraction
Feature extraction plays a vital role in image segmentation, as it helps identify key patterns associated with MS disease. This study uses VGG16, a popular CNN architecture as seen in figure that is well-known for its deep structure and robust performance in picture classification applications, for feature extraction. Here, VGG16 is used without the top (classification) layers after being pretrained on the ImageNet dataset. The convolutional and pooling layers of VGG16 process input MRI pictures, automatically learning and extracting significant characteristics including edges, textures, and high-level spatial patterns. The last convolutional block’s output is flattened into a feature vector that represents the input images deep learnt properties. These characteristics are then either fed into an optimization algorithm for feature selection or used for classification. With this method, the model may take use of high-dimensional, rich characteristics without the need for human involvement.
4.4 VGG16
It represents a deep learning architecture based on convolutional neural networks, as shown in Figure 6, comprising 16 weight layers that include 13 convolutional layers and 3 fully connected layers. The network employs 3 × 3 convolutional kernels applied with a single-pixel stride, incorporating rectified linear unit (ReLU) activation functions to introduce nonlinear transformations. Five 2 × 2 max-pooling operations are interspersed between convolutional blocks, systematically reducing spatial dimensions while maintaining essential feature information. The architecture concludes with three densely connected layers, culminating in a softmax layer for classification purposes. In this implementation, the fully connected layers were excluded, and the output from the final convolutional block was flattened to generate a comprehensive feature vector for subsequent optimization and classification tasks (Hussain et al., 2025).
The experimental findings show that the suggested CNN-based model, which makes use of the VGG16 architecture, performs very well in the classification of MRI images for the purpose of detecting multiple sclerosis. Strong generalization and efficient learning were demonstrated by the model’s peak validation accuracy of almost 99.29% across 10 training epochs and its constantly declining validation loss, which reached 0.1772 as seen in Figure 7 and the CNN (VGG 16) parameters and values are shown in Table 1.
Figure 7. Training and validation loss trends for the CNN (VGG16) model. The steadily decreasing validation loss demonstrates good generalization and minimal overfitting.
In Table 1, Adam was picked because it works well and can change its learning rate on its own, which makes training go faster and be easy. Since binary crossentropy efficiently quantifies the discrepancy between projected probability and true labels, it is most appropriate for binary classification problems (e.g., disease vs. healthy). The complete training dataset is processed 10 times to optimize the weights of the model, which is known as 10 epochs. To balance memory utilization and computational performance during training, a batch size of 32 is employed.
The model’s stability and lack of overfitting are confirmed by the training and validation curves’ tight alignment. These results confirm the efficacy of utilizing CNNs for deep feature extraction in conjunction with appropriate preprocessing and class balancing to provide a dependable and precise diagnostic assistance system for MS classification.
4.5 Feature selection
Feature selection helps choose the most important features from a large set, making it easier and faster to identify diseases accurately. Metaheuristic optimization algorithms are a group of techniques that work by repeatedly evaluating objective functions, usually without the use of gradient information (Yang et al., 2013). In this study, the Whale Optimization Algorithm is used alone for feature selection to improve the identification of MS disease, leveraging its strength in exploring and selecting the most relevant features. WOA helps you find the “best subset” of features for disease classification, improving accuracy and speed, and is particularly effective for handling the large, complex feature sets produced by deep learning models.
4.5.1 Whale optimization algorithm
The WOA is a bio-inspired metaheuristic that replicates the distinctive foraging strategy of humpback whales, specifically their spiral bubble-net hunting method. This technique involves whales creating bubble rings to encircle and trap their prey. They typically target schools of small fish or krill near the water’s surface, creating spiral or “9”-shaped bubble patterns to trap and gather their prey. WOA operates through two core stages: exploration and exploitation. In the exploration stage, whales perform a global search to locate potential prey, whereas in the exploitation stage, they converge on the identified target using a spiral bubble-net motion, reflecting the natural hunting behavior of real whales. The algorithm alternates randomly between spiral motion and encircling techniques to update the positions of the search agents. Overall, WOA operates through three key stages: Locating the prey, surrounding it, and executing the attack, inspired by the natural hunting process of humpback whales (Mirjalili and Lewis, 2016). Figure 8 illustrates the behavior of the Whale Optimization Algorithm.
4.5.2 Encircling prey
Once humpback whales identify their prey, they initiate a circular motion around it. Similarly, in WOA, the most optimal solution is assumed to be closest to the target, prompting other solutions to adjust their positions accordingly.
Here Equation 15 represents the distance between current solution and best solution. Equation 16 represents the mathematical formulation of current iteration for best solution.
Where t indicates the current iteration, and are coefficient vectors, is the position vector of the best solution, according to Equations 17, 18.
Where , are random vectors in [0,1].
The balance is controlled by the parameter , which gradually drops from 2 to 0:
When is the exploration and is exploitation.
The parameter controlling convergence , It gradually declines in a linear fashion from 2 to 0 throughout the iterations, influencing the balance between exploration and exploitation phases. Here , is random vectors drawn from a uniform distribution within [0, 1] (Vijayan and Chowdhary, 2025).
4.5.3 Bubble-net attacking method
Bubble-net feeding is a distinctive hunting behavior seen exclusively in humpback whales. In the WOA, this spiral movement is mathematically represented to simulate the optimization process. The following two approaches have been developed.
4.5.3.1 Shrinking encircling mechanism
One of the key behaviors modeled in the WOA is the shrinking encircling mechanism, which imitates how humpback whales gradually move toward their prey. In the algorithm, this is achieved by linearly decreasing the convergence coefficient over the course of iterations. As a result, the search agents move progressively closer to the best solution found so far. Over time, they focus their search within a narrower region around this solution, allowing the algorithm to better refine its search and explore more promising areas in the solution space.
4.5.3.2 Spiral updating position
The spiral updating position is one of the strategies used during the exploitation phase of the WOA. It replicates the spiral motion observed in humpback whales during their bubble-net feeding behavior to capture prey (Sharawi et al., 2017).
This movement is mathematically represented using an exponential spiral equation that combines both angular motion and distance to replicate the whale’s trajectory, as represented by Equation 19.
l is a random number in [–1,1].
D is = represents the distance between the ith whale and the prey, which corresponds to the current best solution found.
4.5.4 Search for pray
This stage mimics the natural hunting behavior displayed by humpback whales in their environment, where they are seeking across a large area and are uncertain of the precise location of their prey, by having whales (search agents) randomly navigate over the search space to locate promising regions rather than immediately targeting the best-known answer (Mirjalili and Lewis, 2016).
To simulate this mathematically, a random whale position is chosen, and the current whale’s position is updated using the Equation 20 that follows:
Where
placement of a whale chosen at random.
the whale’s current location.
the vector of current location.
an adjustment for step size.
t is the iteration index or current time.
4.6 Classification
CNNs are able to do classification directly through the use of fully linked layers and automatically extract hierarchical spatial information from pictures. As an alternative, deep features may be used to classify data using conventional machine learning models. With this hybrid technique, performance is frequently enhanced by combining the classification capability of ML algorithms with the feature learning strength of CNNs. Furthermore, information regarding subtle or hidden characteristics that could be present in a picture cannot be extracted using conventional manual procedures. On the other hand, DL-based image classification and identification techniques automatically extract picture characteristics using artificial neural networks (Shoaib et al., 2023).
The designed CNN architecture includes multiple layers tailored to capture and learn significant features from brain MRI scans. A resized image of 224 × 224 pixels is fed into the CNN and initially processed by convolutional layers (Liu et al., 2023). The feature maps are subsequently down sampled using max pooling layers, which reduce spatial dimensions while preserving the most important information. This helps to control overfitting and computational expense (Tayal et al., 2022). The final classification differentiating between MS and control cases is carried out by a fully linked layer after the retrieved features have been flattened.
The ANN, SVM, KNN, LR, and RF classifiers were used to assess the efficacy of the Whale Optimization Algorithm feature selection. Each model has unique learning properties and optimization tendencies. Here, ANN is a multilayer network that can capture complicated nonlinear interactions via iterative weight updates with backpropagation and nonlinear activation functions, allowing adaptive learning from the optimum feature subset. In contrast, the SVM creates an ideal hyperplane that optimizes the margin between classes and combined with WOA, the selection of discriminative features improves border separation and decreases classification error (Vázquez-Marrufo et al., 2023). The RF classifier is an ensemble of decision trees that perform feature bagging and random sampling to increase robustness and the addition of WOA refines the input feature space, resulting in better model stability and generalization.
Moreover, K-nearest neighbors approach categorizes data items by comparing them to neighboring samples in the feature space. The WOA improves this procedure by identifying and retaining just the most important distance measurement parameters. Such optimization reduces processing needs while simultaneously improving classification accuracy. Similarly, logistic regression (LR), which uses a sigmoid function to estimate class probabilities, benefits from WOA’s ability to reduce feature sets. This modification removes extraneous variables while enhancing model interpretability. By including WOA into both classification algorithms, the system achieves enhanced predicted accuracy, improved adaptability to novel data, and increased computing efficiency. Overall, the WOA integration guarantees that each classifier receives a concise and informative set of data, increasing accuracy and computing efficiency (Haralick et al., 2007).
Figure 9 the classification performance for Multiple Sclerosis and Control MRI images is displayed in the Confusion Matrix of the proposed Artificial Neural Network model. The model’s capacity to correctly identify MS patients was confirmed by its overall accuracy and good recall, and specificity.
5 Results and discussion
To evaluate the effectiveness of the proposed method, we used a dataset containing 3,427 brain MRI images related to Multiple Sclerosis, collected from Kaggle. The dataset is categorized into four classes. The pre-processing was applied to the images to ensure uniformity in size and contrast. Data was split into 80% training and 20% testing sets to evaluate model performance. The training set was used for feature extraction and model learning, while the test set was used to assess classification accuracy. CLAHE was first used to enhance image contrast, followed by feature extraction using the CNN (VGG16) model. The most relevant features were then selected using the Whale Optimization Algorithm. In this study, feature extraction was performed on preprocessed MRI images without segmentation. A pretrained VGG16 model was used to extract deep global characteristics that encompassed both healthy and diseased tissue attributes. The Whale Optimization Algorithm was used to optimize the deep feature vector generated by flattening the output of the last convolutional layer, retaining just the most discriminative features for classification.
Applying our deep learning framework, which integrates VGG16 and the Whale Optimization Algorithm, to entire MRI scans means it evaluates both significant (lesion) and non-significant (normal tissue) areas. Nonetheless, advanced CNNs like VGG16 are inherently structured to concentrate on the most critical parts of an image during training, a mechanism often referred to as spatial attention within the convolutional hierarchy. VGG16’s convolutional layers progressively learn to identify localized features such as edges, textures, and intensity changes, with deeper layers extracting more complex semantic details like tissue irregularities. Consequently, disease-related patterns become more pronounced, while less pertinent background information (such as standard gray and white matter) is naturally downplayed.
The method can be further refined by isolating the most critical characteristics that enhance classification through the application of the Whale Optimization Algorithm for feature selection. This approach proves effective even in the absence of initial segmentation, as WOA efficiently eliminates unnecessary or repetitive data points commonly found in healthy tissue areas. This strategy broadens the framework by integrating the strengths of deep neural networks with optimization methods, ultimately leading to more precise Multiple Sclerosis detection.
The ANN model, when integrated with WOA, outperformed the other classifiers in terms of overall performance. Table 2 provides a Performance comparison across multiple classification algorithms. The close alignment between training and validation accuracy confirms that the models generalize well to unseen data. The combined impact of deep CNN-based feature extraction, CLAHE preprocessing, and nature-inspired feature selection significantly contributed to the high classification performance.
The model’s effectiveness is assessed using evaluation metrics such as accuracy, sensitivity, and specificity, as defined in Equations 20–23, respectively (Lee et al., 2018; Reinke et al., 2021).
Negative means were eliminated and positive means were determined in accordance with general guidelines. Because of this, a true positive (TP) indicates that a patient with MS has been accurately diagnosed, whereas a false positive (FP) indicates that healthy individuals were falsely recognized as healthy, true negative (TN) indicates that healthy individuals were accurately identified as such, while false negative (FN) indicates that MS patients were misidentified as healthy (Zhang et al., 2016). Figure 10 illustrates the comparison of performance metrics for MS disease classification using various algorithms.
6 Conclusion
To improve the accuracy of MS detection and support early clinical intervention, this study addresses critical challenges in medical imaging such as computational efficiency, generalization, and effective feature extraction through a robust hybrid classification framework. The proposed system integrates CLAHE-based contrast enhancement, deep feature learning using VGG16, and bio-inspired Whale Optimization Algorithm for optimal feature selection. This approach significantly improves the model’s ability to identify disease-related patterns in brain MRI scans. The model demonstrated exceptional performance, particularly the ANN+WOA classifier, which achieved a classification accuracy of 98%, outperforming both SVM and RF classifiers. The WOA-based feature selection effectively reduced dimensionality while retaining discriminative information, which enhanced classification accuracy and reduced computational burden even when trained on moderately sized or imbalanced datasets. This supports the system’s potential to be extended and customized for real-time clinical applications in the future. Moreover, the combination of powerful CNN-based feature extraction and intelligent optimization strikes an optimization through controlled exploration and precise exploitation, making the model both resilient and efficient. The extracted features contribute to improved decision-making and can assist healthcare professionals in diagnosing MS more accurately and at an earlier stage.
The use of WOA effectively selected the optimal feature subset, improving model performance and reducing redundancy. The proposed hybrid CNN-WOA framework not only enhances diagnostic accuracy but also confirms its potential as a robust and reliable decision-support system for MS detection. This work thus contributes a scalable, accurate, and intelligent MS classification model that can advance the field of AI-driven medical imaging.
Data availability statement
The original contributions presented in this study are included in this article/supplementary material, further inquiries can be directed to the corresponding author.
Ethics statement
The studies involving humans were approved by Vellore Institute of Technology. The studies were conducted in accordance with the local legislation and institutional requirements. The participants provided their written informed consent to participate in this study.
Author contributions
NA: Visualization, Validation, Writing – original draft, Investigation, Data curation, Methodology, Conceptualization. SS: Supervision, Writing – review & editing. CC: Writing – review & editing, Supervision.
Funding
The author(s) declared that financial support was received for this work and/or its publication. This work was supported by Vellore Institute of Technology (VIT), India. The funder had no role in the study design, data collection, analysis, interpretation of results, or manuscript preparation.
Conflict of interest
The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Generative AI statement
The author(s) declared that generative AI was not used in the creation of this manuscript.
Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.
Publisher’s note
All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.
References
Ahmad, N., Asif, H. M. S., Saleem, G., Younus, M. U., Anwar, S., and Anjum, M. R. (2021). Leaf image-based plant disease identification using color and texture features. Wireless Personal Commun. 121, 1139–1168. doi: 10.1007/s11277-021-09054-2
AlSaeed, D., and Omar, S. F. (2022). Brain MRI analysis for Alzheimer’s disease diagnosis using CNN-based feature extraction and machine learning. Sensors 22:2911. doi: 10.3390/s22082911
Aslani, S., Dayan, M., Storelli, L., Filippi, M., Murino, V., Rocca, M. A., et al. (2019). Multi-branch convolutional neural network for multiple sclerosis lesion segmentation. NeuroImage 196, 1–15. doi: 10.1016/j.neuroimage.2019.03.068
Barrie, W., Yang, Y., Irving-Pease, E. K., Attfield, K. E., Scorrano, G., Jensen, L. T., et al. (2024). Elevated genetic risk for multiple sclerosis emerged in steppe pastoralist populations. Nature 625, 321–328. doi: 10.1038/s41586-023-06618-z
Bushberg, J. T., and Boone, J. M. (2011). The essential physics of medical imaging. Philadelphia, PA: Lippincott Williams & Wilkins.
Daqqaq, T. S., Alhasan, A. S., and Ghunaim, H. A. (2024). Diagnostic effectiveness of deep learning-based MRI in predicting multiple sclerosis: A meta-analysis. Neurosci. J. 29, 77–89. doi: 10.17712/nsj.2024.2.20230103
Dhanka, S., and Maini, S. (2025). A hybridization of XGBoost machine learning model by Optuna hyperparameter tuning suite for cardiovascular disease classification with significant effect of outliers and heterogeneous training datasets. Intern. J. Cardiol. 420:132757. doi: 10.1016/j.ijcard.2024.132757
Fiorini, S., Verri, A., Tacchino, A., Ponzio, M., Brichetto, G., and Barla, A. (2015). “A machine learning pipeline for multiple sclerosis course detection from clinical scales and patient reported outcomes,” in Proceedings of the 2015 37th Annual International Conference of the IEEE engineering in medicine and biology society (EMBC), (Piscataway, NJ: IEEE), 4443–4446. doi: 10.1109/EMBC.2015.7319381
Gray, H., Standring, S., Ellis, H., and Berkovitz, B. K. B. (2008). Gray’s anatomy: The anatomical basis of clinical practice.
Guo, L., Wang, W., Zhong, L., Guo, L., Zhang, F., and Guo, Y. (2022). Texture analysis of the microstructure of internal curing concrete based on image recognition technology. Case Stud. Construct. Mater. 17:e01360. doi: 10.1016/j.cscm.2022.e01360
Haralick, R. M., Shanmugam, K., and Dinstein, I. H. (2007). “Textural features for image classification,” in Proceedings of the IEEE Transactions on systems, man, and cybernetics, (Piscataway, NJ: IEEE).
Hu, W., Li, K., Gagnon, J., Wang, Y., Raney, T., Chen, J., et al. (2025). FundusNet: A deep-learning approach for fast diagnosis of neurodegenerative and eye diseases using fundus images. Bioengineering 12:57. doi: 10.3390/bioengineering12010057
Hussain, S. S., Wani, N. A., Kaur, J., Ahmad, N., and Ahmad, S. (2025). Next-generation automation in neuro-oncology: Advanced neural networks for MRI-based brain tumor segmentation and classification. Piscataway, NJ: IEEE Access.
Koushik, J. (2016). Understanding convolutional neural networks. arXiv [Preprint] doi: 10.48550/arXiv.1605.09081
Krizhevsky, A., Sutskever, I., and Hinton, G. E. (2017). ImageNet classification with deep convolutional neural networks. Commun. ACM 60, 84–90. doi: 10.1145/306538
Kurniati, F. T., Manongga, D. H., Sediyono, E., Prasetyo, S. Y. J., and Huizen, R. R. (2024). GLCM-based feature combination for extraction model optimization in object detection using machine learning. arXiv [Preprint] doi: 10.48550/arXiv.2404.04578
Kurtzke, J. F., Beebe, G. W., and Norman, J. E. Jr. (1979). Epidemiology of multiple sclerosis in US veterans: 1. Race, sex, and geographic distribution. Neurology 29, 1228–1228. doi: 10.1212/wnl.29.9_part_1.1228
Lee, J. Y., Lim, J. W., and Koh, E. J. (2018). A study of image classification using HMC method applying CNN ensemble in the infrared image. J. Elect. Eng. Technol. 13, 1377–1382. doi: 10.5370/JEET.2018.13.3.1377
Li, T., Higgins, J. P., and Deeks, J. J. (2019). “Collecting data,” in Cochrane handbook for systematic reviews of interventions, eds J. P. T. Higgins et al. (Hoboken, NJ: John Wiley & Sons, Inc).
Litjens, G., Kooi, T., Bejnordi, B. E., Setio, A. A. A., Ciompi, F., Ghafoorian, M., et al. (2017). A survey on deep learning in medical image analysis. Med. Image Anal. 42, 60–88. doi: 10.1016/j.media.2017.07.005
Liu, X., Ghazali, K. H., Han, F., and Mohamed, I. I. (2023). Review of CNN in aerial image processing. Imaging Sci. J. 71, 1–13. doi: 10.1080/13682199.2023.2174651
Liu, Y. H. (2018). “Feature extraction and image recognition with convolutional neural networks,” in Proceedings of the Journal of Physics: Conference Series, (Bristol: IOP Publishing).
Mirjalili, S., and Lewis, A. (2016). The whale optimization algorithm. Adv. Eng. Softw. 95, 51–67. doi: 10.1016/j.advengsoft.2016.01.008
Mockus, A. (2008). “Missing data in software engineering,” in Guide to advanced empirical software engineering, eds F. Shull, J. Singer, and D. I. K. Sjøberg (London: Springer).
Moore, K. L., and Dalley, A. F. (2018). Clinically oriented anatomy. Haryana: Wolters kluwer india Pvt Ltd.
Park, Y., and Guldmann, J. M. (2020). Measuring continuous landscape patterns with Gray-Level Co-Occurrence Matrix (GLCM) indices: An alternative to patch metrics? Ecol. Indicat. 109:105802. doi: 10.1016/j.ecolind.2019.105802
Placidi, G., Cinque, L., Foresti, G. L., Galassi, F., Mignosi, F., Nappi, M., et al. (2025). A context-dependent CNN-based framework for multiple sclerosis segmentation in MRI. Intern. J. Neural Syst. 35:2550006. doi: 10.1142/S0129065725500066
Rana, M., and Bhushan, M. (2023). Machine learning and deep learning approach for medical image analysis: Diagnosis to detection. Multimed. Tools Appl. 82, 26731–26769. doi: 10.1007/s11042-022-14305-w
Razali, N. F., Isa, I. S., Sulaiman, S. N., Karim, N. K. A., and Osman, M. K. (2023). CNN-Wavelet scattering textural feature fusion for classifying breast tissue in mammograms. Biomed. Signal Process. Control 83:104683. doi: 10.1016/j.bspc.2023.104683
Reinke, A., Tizabi, M. D., Sudre, C. H., Eisenmann, M., Rädsch, T., Baumgartner, M., et al. (2021). Common limitations of image processing metrics: A picture story. arXiv [Preprint] doi: 10.48550/arXiv.2104.05642
Rolak, L. A. (2003). Multiple sclerosis: It’s not the disease you thought it was. Clin. Med. Res. 1, 57–60. doi: 10.3121/cmr.1.1.57
Rosli, M. M., Tempero, E., and Luxton-Reilly, A. (2016). “What is in our datasets? Describing a structure of datasets,” in Proceedings of the Australasian computer science week multiconference, (New York, NY: ACM).
Sadeghibakhi, M., Pourreza, H., and Mahyar, H. (2022). Multiple sclerosis lesions segmentation using attention-based CNNs in FLAIR images. IEEE J. Trans. Eng. Health Med. 10. doi: 10.1109/JTEHM.2022.3172025
Sharawi, M., Zawbaa, H. M., and Emary, E. (2017). “Feature selection approach based on whale optimization algorithm,” in Proceedings of the 2017 9th international conference on advanced computational intelligence (ICACI), (Piscataway, NJ: IEEE), 163–168.
Shoaib, M., Shah, B., Ei-Sappagh, S., Ali, A., Ullah, A., Alenezi, F., et al. (2023). An advanced deep learning models-based plant disease detection: A review of recent research. Front. Plant Sci. 14:1158933. doi: 10.3389/fpls.2023.1158933
Simonyan, K., and Zisserman, A. (2014). Very deep convolutional networks for large-scale image recognition. arXiv [Preprint] doi: 10.48550/arXiv.1409.1556
Singh, J., Singh, A., Singh, K. K., Lal, B., William, R. A., Turukmane, A. V., et al. (2024). Identification of brain diseases using image classification: A deep learning approach. Proc. Comp. Sci. 235, 186–192. doi: 10.1016/j.procs.2024.04.021
Steinman, L. (1996). Multiple sclerosis: A coordinated immunological attack against myelin in the central nervous system. Cell 85, 299–302. doi: 10.1016/s0092-8674(00)81107-1
Szekely-Kohn, A. C., Castellani, M., Espino, D. M., Baronti, L., Ahmed, Z., Manifold, W. G., et al. (2025). Machine learning for refining interpretation of magnetic resonance imaging scans in the management of multiple sclerosis: A narrative review. R. Soc. Open Sci. 12:241052. doi: 10.1098/rsos.241052
Tayal, A., Gupta, J., Solanki, A., Bisht, K., Nayyar, A., and Masud, M. (2022). DL-CNN-based approach with image processing techniques for diagnosis of retinal diseases. Multimedia Syst. 28, 1417–1438. doi: 10.1007/s00530-021-00769-7
Valverde, S., Cabezas, M., Roura, E., González-Villà, S., Pareto, D., Vilanova, J. C., et al. (2017). Improving automated multiple sclerosis lesion segmentation with a cascaded 3D convolutional neural network approach. NeuroImage 155, 159–168. doi: 10.1016/j.neuroimage.2017.04.034
Vázquez-Marrufo, M., Sarrias-Arrabal, E., García-Torres, M., Martín-Clemente, R., and Izquierdo, G. (2023). A systematic review of the application of machine-learning algorithms in multiple sclerosis. Neurología 38, 577–590. doi: 10.1016/j.nrleng.2020.10.013
Vijayan, S., and Chowdhary, C. L. (2025). Hybrid feature optimized CNN for rice crop disease prediction. Sci. Rep. 15:7904. doi: 10.1038/s41598-025-92646-w
Yang, X. S., Talatahari, S., and Alavi, A. H. (eds) (2013). Metaheuristic applications in structures and infrastructures. Boston, MA: Newnes.
Zhang, Y., Hong, D., McClement, D., Oladosu, O., Pridham, G., and Slaney, G. (2021). Grad-CAM helps interpret the deep learning models trained to classify multiple sclerosis types using clinical brain magnetic resonance imaging. J. Neurosci. Methods 353:109098. doi: 10.1016/j.jneumeth.2021.109098
Zhang, Y., Lu, S., Zhou, X., Yang, M., Wu, L., Liu, B., et al. (2016). Comparison of machine learning methods for stationary wavelet entropy-based multiple sclerosis detection: Decision tree, k-nearest neighbors, and support vector machine. Simulation 92, 861–871. doi: 10.1177/0037549716666962
Zhao, X., and Jacob, C. (2023). Mechanisms of demyelination and remyelination strategies for multiple sclerosis. Intern. J. Mol. Sci. 24:6373. doi: 10.3390/ijms24076373
Keywords: multiple sclerosis, MRI, feature extraction, CNN, whale optimization algorithm (WOA)
Citation: Anam N, S SB and Chowdhary CL (2026) Hybrid deep learning and feature optimization approach for early detection of multiple sclerosis. Front. Hum. Neurosci. 19:1685580. doi: 10.3389/fnhum.2025.1685580
Received: 06 October 2025; Revised: 13 November 2025; Accepted: 10 December 2025;
Published: 12 January 2026.
Edited by:
Daniele Corbo, University of Brescia, ItalyReviewed by:
Marina Adriana Mercioni, Politehnica University of Timişoara, RomaniaUdhayakumar Gobikrishnan, SRM Valliammai Engineering College, India
Copyright © 2026 Anam, S and Chowdhary. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.
*Correspondence: Sharief Basha S., c2hhcmllZmJhc2hhLnNAdml0LmFjLmlu
Nandini Anam1