CNN‑IKOA: convolutional neural network with improved Kepler optimization algorithm for image segmentation: experimental validation and numerical exploration

Chest diseases, especially COVID‑19, have quickly spread throughout the world and caused many deaths. Finding a rapid and accurate diagnostic tool was indispensa‑ ble to combating these diseases. Therefore, scientists have thought of combining chest X‑ray (CXR) images with deep learning techniques to rapidly detect people infected with COVID‑19 or any other chest disease. Image segmentation as a preprocessing step has an essential role in improving the performance of these deep learning techniques, as it could separate the most relevant features to better train these techniques. There‑ fore, several approaches were proposed to tackle the image segmentation problem accurately. Among these methods, the multilevel thresholding‑based image segmen‑ tation methods won significant interest due to their simplicity, accuracy, and rela‑ tively low storage requirements. However


Introduction
The Coronavirus disease (COVID- 19), which was discovered in December 2019, has infected several people all over the world and has caused the deaths of a significant number of those people [1,2].To prevent the outbreak of this pandemic, in the beginning, scientists have paid attention to the reverse transcriptase-polymerase chain reaction (RT-PCR) as the most prevalent tool for COVID-19 diagnosis.Although RTPCR has a high accuracy for diagnosing this disease, it is expensive, sluggish, and in high demand [3].As a result, computed tomography (CT) and X-ray images as important alternative tools were used for the early and speedy detection of COVID-19 [4].The chest X-ray (CXR) images are cheaper and faster, but the detection of COVID-19 manually from the lungs in those images is hard to achieve and might cause some wrong diagnoses [3].Therefore, deep learning (DL) techniques have been extensively used to aid in detecting COVID-19 infection from the CXR images accurately and quickly [5,6].In general, deep learning and machine learning have been applied to detecting several diseases, such as breast cancer [7], heart diseases [8], skin diseases [9], and plant diseases [10].
Chest X-ray image segmentation problem (CXIS) is an essential part of image processing and computer vision for easy analysis and interpretation [11].The multilevel threshold image segmentation method is often considered to be the most frequent and effective method for image segmentation owing to its simplicity, precision, and relatively low storage requirements [12].The CXIS is an essential preparation step for the deep learning models to strengthen their performance for accurately detecting COVID-19 infection.However, the multilevel thresholding-based image segmentation problem is considered a complicated problem, especially with increasing the threshold level, and could not be accurately solved using traditional techniques such as Kapur's entropy and Otsu's method [13].Therefore, over the last few decades, researchers have used metaheuristic algorithms for accurately tackling this problem in a reasonable amount of time.The reason for using those algorithms to solve this problem is that they have great results for several difficult discrete and continuous optimization problems, including feature selection [7,14], the parameter estimation problem [15,16], hyperparameter tuning [14,17], and 0-1 Knapsack problems [18].
As aforementioned the metaheuristic optimization techniques have an important role in accurately tackling the CXIS problem to separate the homogenous regions for improving the classification accuracy of the deep learning models.Although several studies have been presented in the literature for segmenting COVID-19 images using metaheuristics, they have some drawbacks that do not qualify them as the best alternatives for tackling this problem.Those drawbacks are summarized in the following list: • Falling into the local minima problem • Slow convergence speed • Expensive computational costs • The majority of them have not been investigated for high threshold levels.
Therefore, this study investigates the performance of a newly proposed metaheuristic algorithm, known as the Kepler optimization algorithm (KOA), for segmenting the CXR images.However, the performance of the classical KOA suffers from slow convergence speed which makes it consume several function evaluations for achieving superior outcomes.Therefore, it is improved in this study using a novel improvement mechanism to propose a new variant, namely IKOA, with better exploration and exploitation operators.Both KOA and IKOA are assessed using ten CXR images at ten threshold levels ( the effectiveness of the image segmentation step for improving the performance of a deep learning model.This model is separately trained using the segmented CXR images at various threshold levels, and the original images and the obtained outcomes are compared in terms of five performance indicators, namely recall, overall accuracy, F1-score, precision, and specificity.According to the experimental outcomes, CNN-IKOA could perform better under the images segmented at T-12 with an overall accuracy of 94.88%, a specificity of 96.57%, a precision of 95.40%, and a recall of 95.40%.From that, it is concluded that the metaheuristic algorithms could aid in improving the classification accuracy of deep learning models for not only COVID-19 infection but also for any image classification problem.Briefly, the main contributions of this study are summarized as follows: • Adapting the classical KOA for segmenting the COVID-19 X-ray images.
• Improving KOA using a novel improvement strategy to present a boosted variant, namely IKOA.• Assessing KOA and IKOA using nine COVID-19 X-ray images, and comparing them to several metaheuristic algorithms under several performance indicators and the WRS test.• The experimental findings reveal the effectiveness of IKOA over all the compared algorithms.• Observing the performance of a newly proposed deep learning model based on CNN under the segmented images to elaborate the importance of the metaheuristic algorithms for the image segmentation problem.• The experimental findings show that the performance of this model with the segmented images is better than that with the original images.
The remainder of this study is structured as follows: Sect."Kepler optimization algorithm (KOA)" describes the Kepler optimization algorithm, Sect."Convolutional neural network (CNN)" overviews the convolutional neural network (CNN), Sect."The proposed work" introduces the proposed KOA and IKOA, in addition to the proposed deep learning model, Sect."Results and discussion" reports results and discusses them, and Sect."Conclusion and future work" discusses the conclusion and future prospects.

Deep learning techniques for COVID-19 detection
Over the last few years, several machine learning and deep learning techniques have been presented to better diagnose the COVID-19 infection.Some of these techniques are reviewed in the rest of this section.In [6], a hybrid deep learning model based on integrating both convolutional neural networks (CNN) and gated recurrent unit (GRU) was presented for detecting COVID-19 from the CXR images, where CNN was utilized for extracting features, and GRU was employed as a classifier; this model was called GRU-CNN.This model achieved 96% for precision, 96% for recall, and 95% for F1-score.Sun [19] improved a metaheuristic algorithm known as the biogeography-based optimization to identify the CNN's hyperparameters for accurately detecting the COVID-19 infection from the CXR images.Wang [20] tailored a deep CNN for detecting this epidemic.Islam [21] combined long short-term memory (LSTM) with CNN for automatically identifying the COVID-19 infection from the CXR images; this model was called CNN-LSTM.This model could achieve outstanding results up to 99.4% for accuracy metric, 99.9% for AUC, 99.3% for specificity, and 98.9% for F1-score.
In [22], a CNN model based on incorporating both dilated convolution and the residual network was developed for early detection of the COVID-19 infection from the CXR images.Hussein [23] proposed two new lightweight diagnostic models based on CNN for the early and automatic diagnosis of COVID-19 individuals in CXR images.The first model was developed for the purpose of binary classification, whereas the second model was developed for multiclass classification.Also, Gupta [24] proposed a hybrid CNN for accurately detecting COVID-19 images from chest X-ray images.There are several other recently proposed deep learning models for accurately detecting the COVID-19 infection from the CXR images such as the cutting-edge CNN [25], Homomorphic Transformation and VGG-inspired deep CNN [26], multi-scale CNN [27], MobileNet-based CNN [28], and several else [29].

Metaheuristic algorithms for segmenting CXR images
Several metaheuristic algorithms have been recently proposed for tackling the CXIS problem over the last few years.For instance, the Es-MFO algorithm, developed by Sahoo [11], is an enhancement of the moth flame optimization algorithm that uses a non-linear self-adaptive parameter and a Fibonacci search approach.This variant was applied to extract the pertinent characteristics from CT images to more precisely categorize cases of COVID-19 infection.The whale optimization algorithm (WOA) was improved in [30] to present a new robust variant, namely IWOA, for solving the CXIS problem.IWOA was improved based on three folds: The first fold includes replacing the classical WOA's exploration equation with an equation responsible for randomly reinitializing the solutions within the search space; the second fold is based on changing the constant (b) and coefficient parameter (A) to boost the exploration operator in the early stages to prevent getting stuck into local minima and the exploitation operator in the latter stages to accelerate the convergence speed; and the last fold is based on using the population reduction mechanism to gradually minimize the population diversity that might aid in accelerating the convergence speed.IWOA was applied for segmenting several CXR images and compared to several rival optimizers.According to the experimental findings, it could achieve outstanding outcomes.Also, Han et al. [31] improved the performance of the multi-verse optimizer (MVO) based on the diffusion mechanism (DM) and Rosenbrock method (RM) to accurately tackle the CXIS problem.Both RM and DM were used to aid in enhancing the convergence speed and preventing stagnation into local minima.
In [32], the salp swarm algorithm (SSA) was integrated with the reptile search algorithm (RSA) to design a new version termed RSA-SSA.This version was employed for accurately tackle the CXIS problem.Su et al. [33] improved the artificial bee colony algorithm (ABC) using two mechanisms, namely vertical search and horizontal search, to develop a new robust variant for accurately solving the CXIS problem.Nama [34] integrated the slime mould algorithm (SMA) with the quasi-reflection-based learning (QRBL) and the quasi-reflection-based jumping (QRBJ) mechanisms to propose a new robust algorithm, namely QRSMA, to accurately tackle the CXIS problem.In [35], QGBWOA, an enhanced variant of WOA, was proposed.QGBWOA first employed the quasi-opposition-based learning strategy to accelerate convergence towards the near-optimal solution and then incorporated the Gaussian barebone strategy to promote population diversity.QGBWOA was applied for accurately tackling the CXIS problem.CDHGS is an enhanced variant of the hunger games search (HGS) that was introduced in [36].CDHGS augments HGS with the dimension learning-based hunting (DLH) mechanism and crisscross optimizer (CSO).First, CSO enables individuals to share information, which accelerates convergence, while DLH is used to alleviate the algorithm's local optimum problem.
In [37], the ant colony optimization (ACO) was improved using two different mechanisms, namely directional mutation (DM) and directional crossover (DX), to present a new variant called XMACO.The DM mechanism is responsible for improving population diversity to prevent getting stuck in local optima, while the DX mechanism strives to exploit the regions around the existing individuals to accelerate convergence speed.XMACO was employed for segmenting some CXR images, and its outcomes were compared to those of several competitors to observe its efficacy.The experimental outcomes revealed the superiority of XMACO over all the compared algorithms.Zhao et al. [38] improved the classical crow search algorithm by information exchange mutation (IEM) and variable neighborhood descent (VND) mechanisms; this improved variant is named VMCSA.The IEM mechanism is responsible for improving the exploration operator to avoid stagnation into local optima, while the VND mechanism is used to improve the exploitation operator to accelerate the convergence speed.VMCSA was first assessed using CEC2014 and CEC2021 to reveal its ability to explore and exploit the search space.Then, it was applied to segment the CXR images to oberve its ability to find the optimal threshold values which could segment those images more accurately.This algorithm, according to the experimental outcomes, was better than all the compared algorithms.
Liu et al. [39] improved the ACO using two different mutation strategies, namely the greedy Levy (GL) and Cauchy; this variant was named CLACO.The GL mutation is used to boost the ACO's ability to avoid stagnation into local optima, while the Cauchy mutation is utilized to boost the exploitation operator to aid in accelerating the convergence speed.CLACO was used to solve the CXIS problem and could achieve outstanding outcomes for this problem when compared to some rival optimizers.In [40], the Harris Hawks optimization algorithm under the Otsu method was adapted for accurately segmenting the CT images.This algorithm was compared to several existing techniques to observe its efficacy for several performance indicators.The experimental results disclosed that it was able to find the optimal threshold values that could extract the most relevant features from the CT images.

Kepler optimization algorithm (KOA)
Recently, the Kepler optimization algorithm (KOA) was introduced as a new metaheuristic method to address the challenges of continuous optimization.The algorithm's design was motivated by Kepler's theories on the motion of the planets.According to these rules, the orbit of planets around the sun is subject to influence from four sources, which are represented in a planet's gravitational pull, location, mass, and orbital speed.In KOA, planets far from the sun are responsible for exploring the search space, while those closer have to settle for exploiting the promising zones for accelerating the convergence speed.The steps of KOA are presented in Algorithm 1.The KOA mathematical model is explored in depth next:

• Initialization step
At the beginning of the optimization process, the KOA will disperse N planets in the search space of the optimization process, and each planet will be composed of d dimensions.Following is a mathematical formulation of the formula that is used to randomly distribute those planets: where − → X i represents the ith solution/planet; − → X U and − → X L represent the search boundary of the tackled optimization problem; − → r is a uniform distribution-based randomly gener- ated vector.In KOA, the orbital eccentricity ( e ) of each planet is randomly assigned as clarified in (2), and the orbital period (T) is randomly generated according to the normal distribution as defined in (3).
where r is a uniform distribution-based random number in [0, 1] , and rn is a normal distribution-based random number.

• Defining the gravitational force
Gravity, the most fundamental force in the universe, manages the orbits of the planets around the Sun.Each planet has its own unique level of gravity that is proportional to its mass.The pull of the Sun has an effect on a planet's velocity.Planets' orbital velocities ( increase as they draw nearer to the Sun and decrease as they move further from the star.The force of pull between the Sun − → X S and any planet − → X i can be described by the universal law of gravity, as presented in the following formula: where r 1 is a uniform distribution-based random number in [0, 1], and ε has a small value to prevent division by 0. M s and m i represents the normalized values of M s and m i , where M s and m i represent the masses of − → X S and − → X i , which are computed using ( 7) and ( 8), respectively; µ is a constant representing the universal gravitational constant; and R i is the normalized value of R i , where R i is the Euclidean distance between − → X S and − → X i and is computed using ( 5): where where r 2 is a uniform distribution-based random number in [0, 1].µ(t) is computed using the following equation: where γ is a constant; µ 0 is a predefined value (Recommended 0.1); and T max and t are the maximum function evaluation and current function evaluation, respectively.

• Calculating an object's velocity
The distance a planet is from the sun is the primary factor in determining its speed.The closer a planet is to the Sun, the faster it orbits, and the slower it orbits when it is farther away from the Sun.When a planet or other object gets close to the Sun, the Sun's gravity becomes significantly greater; thus, the planet seeks to accelerate up so that it (4) does not get sucked in by the Sun.This behavior is modeled mathematically, as shown in [41]: where − → V i (t) refers to the velocity of the ith object; r 3 and r 4 are two numerical values chosen at random between 0 and 1 according to the uniform distribution; and − → r 5 and − → r 6 represent two vectors assigned numerical values generated at random between 0 and 1 according to the uniform distribution; − → X a and − → X b represent two planets/solutions cho- sen randomly from the current solutions; F is a controlling factor to reflect the search direction, this factor selects randomly 1 or -1; a i is computed as follows: • Escaping from the local optimum The majority of the planets in the solar system revolve on their own axes and orbit the Sun in an anticlockwise direction, whereas the other planets orbit the Sun in a clockwise direction.This behavior is utilized by KOA in order to escape from local (12) , optimal zones.This is accomplished by changing the direction of the search at predetermined intervals with the assistance of a flag designated as F .Because of this, the agents have a greater possibility of searching the entire search space effectively.

• Updating objects' positions
The following formula can be used to estimate the new positions of the planets in KOA:

• Updating distance with the sun
The naturally occurring change in the distance to the Sun and the planets is recreated as part of an effort to enhance the KOA's exploration and exploitation capabilities.When planets are in close proximity to the Sun, KOA will give preference to the exploitation operator, whereas when the Sun is farther distant, KOA will give preference to the exploration operator.To apply this idea, in KOA, a time-dependent variation in the value of the controlling parameter h is used.When this value is large, KOA activates the explora- tion operator to broaden the search space for a better solution, while when it is small, KOA activates the exploitation operator to extract the most value from the regions close to the best solution obtained even now.The mathematical model for this principle can be expressed in terms of the following equations: where r is a value chosen at random based on the normal distribution, where TC refers to the cycle's number, and % indicates the remainder operator.

• Elitism
This step is used to ensure that the planets are always in their current local-best positions, as defined by the accompanying mathematical formula: (23 The steps of KOA.

Convolutional neural network (CNN)
CNN is a well-common deep learning model that is based on mimicking the visual perception mechanism of human beings [42].Typically, the CNN architecture is composed of three building blocks: pooling layer, Convolutional layer, and fully connected (FC) layer, as depicted in Fig. 1 [42,43].This layer is considered the main component for any CNN model, where it includes a set of filters, also referred to as convolutional kernels.Those kernels are used to generate the feature maps from the input tensors.This layer includes two hyperparameters, namely kernel size and number of filters, which have to be accurately estimated to maximize the performance of CNN.The convolutional layer is followed by a pooling layer to decrease the large size of the generated feature maps to decrease the number of trainable parameters.There are several pooling techniques that could be used in the pooling layer, some of which are min pooling, gated pooling, max pooling, average pooling, and tree pooling [44].The output feature maps of the last convolution or pooling layer are typically transformed into a vector, and linked to one or more FC layers, also referred to Fig. 1 The structure of a CNN model as dense layers, for estimating the final output.The last FC layer is typically composed of a number of output nodes equal to the number of classes.

The proposed work
This section discusses the main steps for adapting the metaheuristic algorithms to tackle the CXIS problem.These steps are initialization, objective function, the pseudocode of the proposed KOA, the proposed improvement mechanism, and the pseudocode of the proposed IKOA.As aforementioned, image segmentation significantly affects the performance of the deep learning models for better-classifying images.In brief, some of the advantages of image segmentation for deep learning are described in the following list: • It can alleviate the noise and irrelevant details in the images, making them easier to process and analyze by the deep learning models.• It can highlight the important features and regions of interest in the images that can aid the deep learning models in learning more effectively and accurately.
Therefore, at the end of this section, we design a new deep-learning model based on CNN to check the effectiveness of the CXR images segmented by the proposed IKOA at different threshold levels.

Initialization
The classical KOA begins with generating two-dimensional matrix of N × d , where N rep- resents the population size, and d represents the dimension size or threshold level.This matrix is randomly initialized within the lower bound and upper bound of the pixels in a grey image, as mathematically defined in the following formula: where − → X L and − → X L includes values of 0 and 255, respectively; those values represent the smallest and highest intensity level for each pixel in a grey image.The intensity level for each pixel must include an integer ranging between 0 and 255, while the classical KOA generates continuous solutions, which are irrelevant to this problem.Therefore, those solutions are mapped into integers by truncating the fractional part separated by a decimal dot.Then, each solution is ordered ascendingly and evaluated using Otsu's method discussed in the next section.

Objective function: Otsu's method
Otsu [45] proposed the conventional Otsu method as a variance-based strategy for finding threshold values that maximize the between-class variance, or, opposite, minimize the intra-class intensity variance, in order to find the homogeneous regions from an image.This method is mathematically described as follows:  (30) include the minimum and maximum intensity levels in the greyscale, these levels are 0 and 255, respectively.Based on that, [h 1 , h 2 , . . . . . ., h T ] are the threshold values that need to be accurately estimated for separating the homogenous regions in the given image.P i represent the number of pixels with the intensity level i .W is the total number of pixels in the given image.

COVID-19 X-ray image segmentation using KOA
The CXIS problem is discrete and therefore cannot be directly solved by the classical KOA.Therefore, in this section, we expand on how to apply the classical KOA to address this problem.KOA begins by randomly dispersing N solutions between the maximum and min- imum intensities for each pixel using (29).Those initial solutions are converted into integers and sorted ascendingly to become relevant to this problem.Then, they are evaluated using (30) and compared to identify the best-so-far solution.Finally, the optimization process of KOA is executed to update those solutions to search for better solutions.This process is continued until the maximum number of function evaluations is satisfied.In brief, algorithm 2 presents the pseudocode for the proposed KOA used to segment the CXR images. ( • Easy to implement • Consuming low computational cost • Having a high convergence speed • Having a high ability to avoid stagnation into local minima due to the EEI mechanism Meanwhile, the main disadvantage of the proposed KOA and IKOA is that they have three control parameters ( µ 0 , γ , T ) that need a lot of effort to be accurately esti- mated before starting the optimization process for maximizing their performance.Finally, Algorithm 3 presents the pseudocode for the proposed IKOA used to segment the CXR images.

Algorithm 3 IKOA for CXR image segmentation
The proposed deep learning model: CNN-IKOA Image segmentation can be utilized as a preprocessing step for enhancing the performance of deep learning models that work with images, such as scene understanding, object detection, or medical image analysis.Therefore, in this study, we employ IKOA to perform this step for the following purposes: • Observing whether the image segmentation could improve the classification accuracy of deep learning or not.
• Showing the effectiveness of the proposed IKOA for aiding deep learning techniques in classifying the COVID-19 infection more effectively.
In a more sense, the proposed IKOA is first employed to segment the CXR images at different threshold levels.The segmented CXR images at each threshold level are used to train and test a newly proposed CNN model, namely CNN-IKOA.This model is based on three convolutional layers that are used to extract more complex and abstract features from the segmented images fed into it.Each convolutional layer employs a number of filters in order to extract information from the input images, such as edges and corners.The number and size of filters in each layer are considered hyperparameters that are tuned in the experiments section to maximize the performance of the proposed model.These filters are responsible for the extraction of feature maps, which provide information regarding the location and existence of specific patterns within the input images.The proposed CNN-IKOA stacks three convolutional layers, which allow it to learn to detect higher-level features that are made of lower-level features, thereby detecting COVID-19 infection more accurately.In CNN-IKOA, each convolutional layer is followed by a max pooling layer to alleviate the spatial size of the representation to reduce the number of parameters and computational costs required by the model.The ReLU activation function is utilized with the convolutional layers to prevent the vanishing gradient problem.The feature map from the last max pooling layer is converted into a one-dimensional matrix using the flattening layer.This matrix is input to an FC-connected layer, which is followed by a dropout layer to avoid the overfitting problem.The output from the dropout layer is input to the output layer for detecting if the input chest image is infected with COVID-19 or not based on the softmax activation function.This function computes the probability for each possible class according to (39) and the class that has the highest probability is considered.
where C represents the number of possible classes, x is the input vector to the softmax function, and x i represents ith element of the input vector.The structure of the proposed (39) S(x i ) = e x i C j=1 e x j , Fig. 2 The proposed deep learning model: IKOA-CNN CNN-IKOA is depicted in Fig. 2. The proposed CNN-IKOA has eleven hyperparameters that have to be accurately estimated to improve its performance when applied to detect COVID-19 infection.Those hyperparameters are summarized in the following list: • Since three convolutional layers are used and each layer uses a number and size of filters, six different parameters need to be accurately estimated.• The pooling layer includes a hyperparameter known as pooling size that needs to be accurately estimated.Since CNN-IKOA uses three pooling layers, three additional hyperparameters need to be tuned.• The probability of the dropout layer is considered an additional hyperparameter that also needs to be accurately estimated.• The last hyperparameter that needs to be tuned is the number of nodes in the FC layer.
The best values for those hyperparameters are discussed in detail in the experiments section.The main disadvantage of the proposed CNN-IKOA is that they have fourteen hyperparameters that need a lot of computation to be accurately estimated before starting the classification process to maximize its performance.

Results and discussion
In this section, first, the proposed algorithms (KOA and IKOA) are assessed by applying them to segmenting ten COVID-19 X-ray images for ten threshold levels ).These images are taken from [46] based on their various histograms that enable observing the stability of the proposed algorithms.Figure 3 presents some of those images with their histogram.The performance of KOA and IKOA for considered threshold levels over the used images are compared to that of seven well-known optimization techniques for several performance indicators, such as average fitness value (AFV), Friedman mean rank (F-rank), Convergence curve, Computational cost, PSNR [47], and FSIM [47].Those compared algorithms are named Modified SSA (MSSA) [48], Constriction coefficient based gravitational search algorithm and particle swarm optimization (CPSOGSA) [49], SSA [48], Nutcracker optimization Fig. 3 Some of the CXR images with their histogram algorithm (NOA) [50], Equilibrium optimizer (EO) [51], Teaching-learning-based optimization (TLBO) [52], and Differential evolution [53].The controlling parameters of those algorithms are set as suggested in the cited references, with the exception of the maximum number of function evaluations and population size, which are set to 25 and 30, respectively, to guarantee a fair comparison.Those algorithms are run on a device with 32GB of RAM, an Intel ® CoreTM i3-2330M CPU at 2.20 GHz, and a 64-bit operating system, and are implemented in MATLAB2019a.
Second, the proposed IKOA is applied to segment the CXR dataset for eight threshold levels  [54].The COVID-19 cases included in this dataset have ages ranging from 18 to 75 years old.Afterwards, the segmented images are divided into training and testing datasets with a probability of 80% for the training dataset and 20% for the testing dataset.The proposed CNN-IKOA is trained using the training dataset and validated using the testing dataset to observe its performance for classifying unknown images.The effectiveness of CNN-IKOA under various threshold levels is observed using several performance indicators, such as recall, accuracy, F1-score, precision, and specificity, which are mathematically described as follows: where TP, FP, TN, and FN refer to true positive, false positive, true negative, respectively, and false negative, respectively.

Hyperparameters tuning
As aforementioned, CNN has some hyperparameters that need to be accurately identified to maximize its classification accuracy.Those parameters are the number of filters and kernel size in each convolutional layer, and the pool size in the pooling layer.The proposed CNN-IKOA has three pooling layers and three convolutional layers, so nine parameters need to be estimated.However, the pooling size has been recommended to be set to 2 in several studies in the literature.Therefore, this recommendation is considered in our proposed model.Based on that, the proposed model has only six unknown parameters.To estimate the most effective values for these parameters, several Regarding the other hyperparameters, CNN-IKOA could perform better when setting the batch size to 16, the number of nodes in the FC layer to 32, and the dropout probability for the FC layer to 0.05, as reported in Fig. 5.

Experiment 1: comparison between IKOA and rival optimizers
In this section, IKOA and KOA are compared to seven rival optimizers in terms of AFV, PSNR, and FSIM for all CXR images at each threshold level to test and verify the effectiveness of their optimization process in addition to the quality of their segmented images.All algorithms are independently executed 20 times under the same number of function evaluations and population size to achieve a fair comparison.

Comparison in terms of fitness value
Each algorithm is run 20 times independently on each CXR image at each threshold level.Then, The AFV and average F-rank for each threshold level on all CXR images are calculated and provided in Table 1.This table demonstrates the superior performance of IKOA in comparison to all compared algorithms, as it was able to outperform the traditional KOA as well as all competing algorithms at every threshold level.TLBO is regarded as the second-best algorithm due to its ability to outperform all other algorithms for the majority of threshold levels, while DE is considered the worst algorithm.1 for each method.Based on this figure, we can deduce that IKOA performs the best among all of the other algorithms, followed by EO, while DE is the method with the worst results.

Evaluation of the segmented image quality
After demonstrating that IKOA is superior for the fitness values, this section is offered to examine the segmented images' quality in comparison to the source images using two indicators, namely PSNR and FSIM.The FSIM metric measures the feature similarity of the images, while the PSNR computes the error percentage between the original and segmented images.All algorithms are independently executed 20 runs, and the best solution returned after completing the optimization process is used to generate the segmented image.This image is then compared to the original image based on both PSNR and SSIM.illustration of the quality of the images segmented by each algorithm, Fig. 7 is presented to compute the average of the PSNR and FSIM values presented in Table 2.
Based on this figure, it is concluded that IKOA is the algorithm with the best performance because it was able to provide a value of 0.9653 for FSIM and a value of 28.995 for SSIM.In addition, the data presented in this figure demonstrates that EO is the algorithm with the second-best performance, with average values of 0.9638 and 28.733 for FSIM and PSNR, respectively.As a result, we can conclude that IKOA is an excellent alternative to segmenting the CXR images for the purpose of rapid interpretation to help in the accurate and speedy detection of the COVID-19 infection.

Statistical analysis: WRS test
The WRS test [55] is used to reveal the differences between the outcomes achieved by IKOA and those achieved by each competitor for each threshold image across all CXR images.This statistical test gives a p-value as a result of comparing each pair of algorithms.After that, this value is contrasted to a significance level of 5%; if it is lower, the alternative hypothesis is accepted; otherwise, the null hypothesis is accepted.The average p-value achieved by IKOA and each rival algorithm for each threshold level across all test images is shown in Table 3.This table elaborates that there are considerable differences between the outcomes of IKOA and those of the rival algorithms for all threshold levels.From that, it is concluded that IKOA is noticeably distinct from all of its competitors at all threshold levels.

Convergence speed analysis
In this section, the rival and compared algorithms' convergence curves for some CXR images segmented at some threshold levels are presented to determine which algorithm is capable of rapidly reaching the best fitness value.All algorithms are independently executed 20 runs, and the average convergence curve within those times is described in Fig. 8.This figure demonstrates that IKOA is significantly faster than all of the rival optimizers at all investigated threshold levels.This figure also illustrates that EO is the  second-best algorithm, whereas SSA, DE, and MSSA are the methods with the worst convergence curve.Even now, IKOA performs superiorly to the other competitors for convergence speed, PSNR, SSIM, FSIM, fitness value, and F-rank.As a result, we conclude that IKOA is more effective for accurately segmenting the CXR images.

Computational cost analysis
In the previous experiments, we illustrated that IKOA is more effective than all the compared algorithms.In this section, we illustrate the efficiency of IKOA in terms of computational cost compared to rival optimizers.All algorithms are executed 20 independent times, and the average computational cost required by each algorithm is reported in Fig. 9.This figure shows that IKOA consumes the least computational cost, where it needs an average computational cost of 2.695, followed by SSA with a value of 2.808, while TLBO is the worst with a value of 2.933.From this, we can conclude that IKOA is a robust optimizer for accurately and rapidly segmenting the CXR images, as it is more effective and efficient than all compared algorithms.In this section, the proposed CNN-IKOA's performance is observed to show its classification accuracy under the CXR images segmented by IKOA at different threshold levels and the source images (SI).

Performance evaluation of CNN-IKOA under various threshold levels
This CNN-IKOA model is executed five independent times for training under segmented images at each threshold level, and the average values for eight performance metrics, including accuracy, macro precision (precision (M)), weighted precision (precision (W)), macro recall (recall (M)), weighted recall (recall (W)), macro F1-score (F1-score (M)), weighted F1-score (F1-score (W)), and specificity, are calculated and presented in Table 4. Inspecting this table reveals that CNN-IKOA with the images segmented at 12-T and 15-T could achieve an overall classification accuracy of 94.88% and 94.94%, respectively, which are significantly better than the performance of CNN with the original images, which could achieve a classification accuracy of 93.26%.Also, this table shows that CNN-IKOA at 12-T and 15-T is competitive with each other and superior to its performance at the other threshold levels.Tables 5 and 6 show the classification confusion matrices of the proposed CNN-IKOA for segmented images at different threshold levels and for the original images.This table demonstrates that the CNN-IKOA at T-12 could reach outstanding precision and recall,    In addition, Fig. 11 compares the CNN-IKOA's performance using the accuracy and loss curves of the training and testing CXR images before and after the segmentation process.This figure shows that the performance of CNN-IKOA with the segmented images is approximately the same on the training and testing datasets; on the contrary, before performing the segmentation step, its performance on the training dataset is somewhat better than its performance on the testing dataset.Consequently, the segmentation of CXR images using IKOA has a substantial positive effect on the performance of the CNN model for accurately and rapidly detecting COVID-19 infection.

Local interpretable model-agnostic explanations as explainable technique
In this section, the overall prediction of the proposed CNN-IKOA is interpreted using the local interpretable model-agnostic explanations (LIME) technique.The LIME technique is widely used for its dependable explanations of image classification subtleties and is considered one of the few approaches that performs well with text, tabular data, and images [56].LIME generates superpixels For image classification; these superpixels are considered the outcomes of image over-segmentation.Compared to rectangular image patches, superpixels are better aligned with the image's edges and hold more data than pixels for the main prediction [56].
After applying the lime technique under different numbers of samples, such as 50, 100, 200, 300, and 400, the top 10 features are selected for a COVID-19 image and a normal image and displayed in Table 7 to determine if the selected features vary as the number of samples changes.This table shows that there are a few differences in the selected features as the number of samples increases.Finally, the top five features that affect the predictions of CNN-IKOA trained by the images segmented using IKOA at T-12 are shown in Table 8.This table shows that the majority of these features for the considered COVID-19 images focus on the patients' lungs, and this shows that the proposed CNN-IKOA focuses more on the area that might contain COVID-19 infection.

Conclusion and future work
Over the last four years, deep learning and machine learning techniques have been widely used to automatically detect COVID-19 infection from CXR and CT images in an attempt to speed the diagnosis process and alleviate human mistakes.The performance of those techniques can be improved if the CXR and CT images are accurately segmented to separate the most relevant features that might aid in accurately classifying the COVID-19 infection.Several approaches have been proposed for accurately performing the image segmentation step.Among those approaches, the multilevel thresholding approach has been widely used due to its simplicity and accuracy.However, multilevel threshold-based image segmentation techniques, such as Kapur's entropy and the Otsu method, cannot accurately segment the images as the number of threshold Table 8 Top five features that enabled the detection of COVID-19 infection from the segmented CXR images levels increases.Therefore, metaheuristic algorithms have recently collaborated with those traditional techniques to better tackle this problem, especially when increasing the number of threshold levels.Unfortunately, those algorithms have some drawbacks, including slow convergence speed, stagnation into local minima, and expensive computational costs, that make them unable to achieve outstanding outcomes when applied to tackle this problem.As a result, this study presents an improved version of the Kepler optimization algorithm (IKOA) for alleviating those drawbacks, thereby-achieving a better image segmentation process for the CXR images.IKOA is first assessed using ten CXR images at ten various threshold levels to test and verify its performance for small, medium, and high threshold levels.The outcomes of IKOA are compared to those of several rival optimization techniques in terms of several performance metrics to expose its effectiveness.This comparison shows the superiority of IKOA in terms of all performance metrics used.In addition, the IKOA-based segmented CXR images at eight distinct threshold levels are used to train a new CNN model dubbed CNN-IKOA in order to determine the influence of the segmentation step on the performance of the deep learning models.Five performance indicators-overall accuracy, F1-score, recall, precision, and specificity-were used to show the effectiveness of the segmented CXR images at each threshold level for training CNN-IKOA.The test results show that CNN-IKOA works well when trained on CXR images that have been segmented at T-12.It achieved an overall accuracy of 94.88%, a specificity of 96.57%, a precision of 95.40%, and a recall of 95.40%.Our future work will investigate the effectiveness of the segmented CXR images by IKOA for some of the existing deep-learning models.In addition, some of the other recently proposed metaheuristic algorithms, like the nutcracker optimizer, spider wasp optimizer, and gorilla troops optimizer, will be applied for better segmenting the CXR images to further improve the classification accuracy.

Fig. 4 Fig. 5
Fig.4 Tuning the number of filters and kernel size of the proposed CNN-IKOA

Fig. 6
Fig. 6 Comparison in terms of the average of AFV and F-rank

Fig. 7
Fig. 7 Comparison in terms of average FSIM and PSNR

Fig. 8
Fig. 8 Comparison in terms of Convergence curve

Fig. 9
Fig.9 Comparison in of computational cost 98.35%, respectively, while its performance under T-12 could achieve better precision for the COVID class with a value of 98.08%.This figure also shows that the performance of CNN-IKOA without performing the segmentation step is worse than that under the majority of threshold levels.Regarding the recall metric, CNN-IKOA under T-12, T-8, and T-15 has the same recall for the COVID class with a value of 100, which is better than all the precision values obtained under the other threshold levels and the source images.The recall values for the other classes are maximized by the proposed model under T-12 and T-15, as reported in Fig. 10(b).

Fig. 10
Fig. 10 Precision and recall obtained by CNN-IKOA for each possible class before and after the segmentation step

Table 1
Comparison in terms of AFV and F-rankFigure 6 is presented to demonstrate the average of the AFV and F-rank values reported in Table

Table 2
reports the average PSNR and FSIM on all test images segmented at each threshold level.According to this table, IKOA is capable of producing better FSIM values for all threshold levels, except for T-18 and T-20, where EO could achieve better FSIM values for them.This table also shows the superiority of IKOA for the PSNR metric at all threshold levels.In order to provide a comprehensive

Table 2
Comparison in terms of PSNR and FSIM metrics

Table 3
Comparison under the Wilcoxon rank-sum test

Table 4
Comparison of CNN-IKOA's outcomes under various threshold levels the source images and the other threshold levels.The precision and recall estimated by the proposed model for each possible class before and after performing the segmentation step are presented in Fig.10.This figure shows that CNN-IKOA under T-12 could achieve better precision for both viral and normal classes with values of 97.73% and

Table 5
Confusion matrix of CNN under the source images

Table 6
Confusion matrix of CNN-IKOA at various threshold levelsThe bold values highlight the best precision and recall values obtained for three classes (Normal, COVID, Virus)