EEG Channel Selection for Stroke Patient Rehabilitation Using BAT Optimizer

: Stroke is a major cause of mortality worldwide, disrupts cerebral blood flow, leading to severe brain damage. Hemiplegia, a common consequence, results in motor task loss on one side of the body. Many stroke survivors face long-term motor impairments and require great rehabilitation. Electroencephalograms (EEGs) provide a non-invasive method to monitor brain activity and have been used in brain–computer interfaces (BCIs) to help in rehabilitation. Motor imagery (MI) tasks, detected through EEG, are pivotal for developing BCIs that assist patients in regaining motor purpose. However, interpreting EEG signals for MI tasks remains challenging due to their complexity and low signal-to-noise ratio. The main aim of this study is to focus on optimizing channel selection in EEG-based BCIs specifically for stroke rehabilitation. Determining the most informative EEG channels is crucial for capturing the neural signals related to motor impairments in stroke patients. In this paper, a binary bat algorithm (BA)-based optimization method is proposed to select the most relevant channels tailored to the unique neurophysiological changes in stroke patients. This approach is able to enhance the BCI performance by improving classification accuracy and reducing data dimensionality. We use time–entropy–frequency (TEF) attributes, processed through automated independent component analysis with wavelet transform (AICA-WT) denoising, to enhance signal clarity. The selected channels and features are proved through a k-nearest neighbor (KNN) classifier using public BCI datasets, demonstrating improved classification of MI tasks and the potential for better rehabilitation outcomes.


Introduction
The World Health Organization (WHO) lists stroke as the second greatest cause of mortality globally because of the damage it causes to the brain through disruptions in cerebral circulation [1,2].One of the most debilitating forms of nervous system damage is hemiplegia, which describes partial or complete paralysis of one side of the body including the arm, leg, foot, and hand.Ischemic stroke, the most common type of stroke, causes interruption of cerebral perfusion, which results in rapid loss of brain function [3,4].Sixty percent or more of stroke survivors require rehabilitation due to permanent motor function impairment [5].However, stroke survivors endure a wide range of disabilities, including visual and cognitive deficits, that have a cumulatively devastating effect on their ability to carry out even the most basic of tasks.Accordingly, research into efficient treatment and rehabilitation of stroke victims has been a focus for many years [6].
An electroencephalogram (EEG) is a non-invasive method that estimates the electrical activity of the brain with good time resolution in order to define the results of a variety of mental tasks.By translating brain EEG signals into control instructions, braincomputer interfaces (BCIs) help people with physical impairments interact with the sensory world outside [7].Motor imagery (MI) is the mental imagining of body movement without real muscle movement, and its accompanying rhythmic activities of the brain can be recorded and used as the input signals of BCI systems.Event-related desynchronization/synchronization (ERD/ERS) refers to the detection of the rhythmic power changes in the sensorimotor area within the Rolandic mu (9-13 Hz) and beta (13-30 Hz) frequency bands, which can be used to distinguish between various types of MI tasks [8].Due to the fact that MI does not require any extraneous stimuli, BCIs based on MI have a wide variety of potential uses [9].
The volatility and complexity of EEG signals, however, cause difficulties for conventional MI-BCI decoding [7].Crucial and difficult issues remain in enhancing EEG decoding capacity, extracting discriminative information from low signal-to-noise EEGs, and realizing reliable classification of various MI tasks [8].
Channel selection in EEG-based investigations is important to determine the subset of channels that is most informative in terms of capturing the proper neural signals for the chosen application [10].Nevertheless, such considerations and their corresponding challenges may differ in other application contexts, and that can be seen when comparing stroke rehabilitation with emotion processing and dementia detection using an EEG-based dataset [11].For example, stroke rehabilitation is characterized by the fact that with neurological defects resulting from the stroke event, there are certain modifications in the activity of the brain and the functioning of the neural networks.EEG data can also be characterized by specific features that distinguish them from healthy subjects or other patients, such as changes in the topological organization of networks, aberrant activity, and appearance of novel regulatory strategies [12].
Therefore, the approach to choosing the most significant EEG channels for stroke rehabilitation may need to be more selective and specific.The idea is to find out which of the channels provides the best recording of the neural characteristics of the particular motor, cognitive, or behavioral impairment which a stroke patient may present, and it will not be the same as the channels that would be ideal for other applications [13].However, there are distinct approaches such as emotion processing and dementia detection that may employ different neurophysiological mechanisms and/or spectrotemporal patterns.For example, in emotion processing, the frequency band related to emotion processing can be spread across different cortical areas, and the aim of the channel selection could be to capture this distributed frequency activity.Similarly, in the case of dementia detection, the alteration of brain structure and function which define cognitive impairment might represent a different spatial distribution of load that calls for different rules for choosing the channels [14].With a direct focus on the channel selection problem in the context of stroke rehabilitation, the proposed study intends to contribute an effective solution that can improve the performance of a BCI and thus improve the rehabilitation process.
Channel selection is the main focus of this study.Many electrodes are utilized in medical and diagnostic treatments.For practical BCI applications, many electrodes are needed for classification accuracy; however, putting many electrodes on the scalp is timeconsuming and subject to EEG signal overfitting.To fix these issues, researchers need to identify the electrodes that are unable to be classified.Electrode selection can evaluate the neurological knowledge of individuals due to varying reactions and subject-dependent ideal electrode placement [15].The user-dependent classification job requires automatic electrode relevance determination.This challenge can be overcome by considering a wide range of electrodes and using many methods to identify the appropriate channels for each patient.A particle BA-based optimization technique was used to pick the most accurate EEG channels for stroke patient rehabilitation.Each EEG data channel provides unique classification features.Channel selection reduces data storage and processing, speeds up classifier training by using simpler data, and reduces the "curse of dimensionality".
Many studies have examined channel selection in healthy people [16,17], whereas the present study focuses on stroke rehabilitation, where stroke patients' underlying neurophysiological abnormalities and limitations may demand a customized channel selection strategy.
Choosing EEG channels for emotion processing, cognitive assessment, and clinical diagnosis often involves knowledge of neural mechanisms and brain regions linked with the desired activities.Common brain activity patterns and optimal channel selection are well established for healthy people.However, strokes can alter brain structure, connectivity, and function.These alterations may cause abnormal brain patterns and compensatory processes [18,19].Thus, the best EEG channels for stroke rehabilitation may differ from those recommended for healthy people.
To capture stroke patients' neural correlates of motor, cognitive, and behavioral abnormalities, channel selection must be more specialized and personalized due to strokeinduced neuroplasticity.Targeting stroke patients with a customized solution that can properly recognize neural fingerprints and brain activity patterns is intended to connect stroke-related deficiencies.This stage is crucial to developing BCI-based stroke therapies that improve rehabilitation outcomes [20].
The literature on channel selection in healthy people can be useful, but this study recognizes the need to address stroke survivors' unique issues and considerations.Scientists examined channel selection differences between stroke patients and healthy people to better understand neurophysiological changes and optimal BCI setups for stroke rehabilitation.
Therefore, in this study, a binary bat algorithm (BA)-based optimization method is used to identify the most important EEG channels for stroke rehabilitation.Thus, this method is suited to stroke survivors' needs by optimizing BCI technology and rehabilitation effectiveness.
Raw EEG data are segmented and filtered using standard filters and the automated independent component analysis with wavelet transform (AICA-WT) denoising approach in an effort to address the issues mentioned above.Then, time-entropy-frequency (TEF) attributes are created by combining the effective features from the time, entropy, and frequency domains.As a result, the BA-based optimization method is used to optimize the TEF characteristics in order to choose the efficient channels that improve the stationarity and resilience of the system.After we train a KNN classifier technique, we conduct a series of experiments to evaluate our proposed framework using 25 MI-based BCI sessions with follow-up assessment visits to examine the functional changes before and after EEG neurorehabilitation from public datasets from the BCI Competition.The hybrid timeentropy-frequency (TEF) attributes used in the AICA-WT-TEF-Chs framework for MI-BCI classification are intended to efficiently leverage the underlying information of the time, entropy, and frequency domains on classification performance.
The approach suggested in this paper makes the following contributions.First, it looks at how time-entropy-frequency (TEF) variables affect classification performance.Second, it uses the effective EEG channels generated by a BA-based optimization method to detect changes both before and after rehabilitation.Third, it tests the effectiveness of the AICA-WT-TEF-Chs framework utilizing a variety of classification models and cutting-edge techniques.By eliminating extraneous dimensions, effective channel selection decreases the amount of data that must be stored and processed, speeds up classifier training by using simpler data, and prevents classifier overfitting by lessening the impact of the "curse of dimensionality".

Related Works
EEG-based BCIs in particular have good temporal resolution [21], but the recorded wave activity may be corrupted in a variety of ways depending on the artifacts that occurred, so preprocessing the raw EEG signals is critical in the classification of MI-based signals.
Most of the time, these artifacts can imitate or overlay the abnormal behavior of the brain.Studies have investigated artifacts' effects on EEG signals, including eye blinks, ocular movements, cardiac artifacts, and muscular activity, and noise from power lines can also intersect an EEG's frequencies [22,23].As a result, assessing the efficiency of EEG signals in the presence of background noise can be difficult.Spatial filters can produce a more localized signal for each electrode in this situation because EEG-based BCIs in particular have poor spatial resolution.
To choose the best characteristics for BCI-MI-based EEG analysis, feature extraction is carried out for each recorded channel in multiple domains.The most popular technique is to use common spatial patterns (CSPs) to obtain discriminant features from high-dimensional EEG signals, which may be used to identify the spatial characteristics related to ERD produced by various MI tasks [24].However, the efficiency of CSPs is easily impacted by noise and is highly sensitive to the choice of frequency bands [16].Several feature extraction techniques were developed to analyze the EEG data in the time, frequency, and timefrequency domains to address the issue of efficacy [25].Additionally, wavelet coherence (WC) bispectrum characteristics were suggested in [26] for distinguishing between right and left MI.
The sizes of the features derived from EEG signals are usually pretty big for each channel, and they get bigger when one moves to the next channel.The classification of several features necessitates additional computation and time.To solve this issue, the most effective feature set must be obtained by selecting a subset of EEG channels that are more closely related to mental work than others.The four evaluation methodologies of filtering, wrapping, embedding, and hybrid can be used to categorize feature selection algorithms [27].Based on specific statistical criteria, the filtering method used for motor intention-based EEG activities is taken into consideration.For instance, before classifying the motor intent activity, He et al. [28] developed the statistical method of the Bhattacharyya bound for channel selection.The best candidate subset was chosen using this method, which also employed a CSP and sequential search strategy.Tam et al. [29] suggested a different statistical method based on CSP rank for sorting filter coefficients with absolute values and then choosing the features with the biggest succeeding coefficient.Although the filtering technique has low accuracy, it operates quickly and is unaffected by the subject or classifier choice.
On the other hand, the classifier and the subject are quite important in the wrapper selection process [30].In this way, the subset candidates are assessed using classification accuracy and can thus make more accurate predictions than filtering techniques.As a result, the wrapper strategy is more computationally expensive than the filtering technique and is subject to the overfitting problem [31], which can be avoided by employing cross-validation measures for prediction.For choosing the best channel, the majority of wrapper strategies use the sequential forward search, backward elimination strategy [32], and heuristic search method [33,34].Without mentioning a stopping condition, the filtering and wrapping procedures have also been coupled for selection purposes.This hybrid strategy was created to deal with huge datasets.Gaur et al., for instance [35], offered the best possible channel selection technique based on CSPs.Before ranking all the channels according to their scores and using the classification accuracy to evaluate the chosen ideal channel combination, they first applied the L1 norm of a CSP to group the channel contribution scores.Finally, using the defined criteria for a particular classifier's learning process, the embedded approach was used to choose significant channels.
To choose channels with the best classification outcomes, Shi et al. [36] used feature selection techniques, recursive feature removal, and zero-norm optimization trained with support vector machines.The use of these techniques allowed the EEG channels to be significantly reduced [37].
The crucial step in the classification of EEG data is to use pertinent features that significantly affect the system's ability to classify data effectively [38][39][40].Therefore, to achieve the best classification performance, it is necessary to use valid features from EEG signals [41].
Furthermore, global optimization techniques and machine learning classification can be combined to address such problems in the BCI domain, including feature extraction and selection [42].Several algorithms gained a lot of interest for their applications in feature selection, for instance, differential evolution (DE), simulated annealing (SA), particle swarm optimization (PSO), artificial bee colony (ABC), and ant colony optimization (ACO) [43].
Research has been conducted on channel selection for different BCI paradigms including recursive channel elimination for motor imagery tasks [44].In a study that was conducted by Rakotomamonjy et al. [45], the researchers used a channel selection technique that was built into the training of an SVM classifier.The space of features was searched using GA in the references [46,47], and the fitness function was the weighted linear combination of the number of features and the accuracy of the SVM.Udhaya et al. in [48] suggested a PSO-based rough set feature selection approach to determine the best subset of features, and the accuracy of a neighborhood classifier was utilized as the evaluation criterion for the feature subset.DE was utilized by Baig et al. [49], and PSO and GA were utilized by Atyabi et al. [50] in order to find the best feature subset, respectively.In [51], the process of selecting characteristics for EEG-based emotion identification used ant colony optimization, simulated annealing, genetic algorithms, particle swarm optimization, and differential evolution.The performance of these EA-based approaches for feature selection is quite encouraging.
However, the size of the search area is predetermined in these algorithms; therefore, throughout each iteration, it is important to make a decision regarding whether or not each feature should be chosen.Under these circumstances, the computational effort will be wasted on some features that are superfluous, unnecessary, or of a trivial nature.In addition, evolutionary algorithms (EAs) readily converge to a local optimum as a result of the wide search space as well as the interference of redundant, irrelevant, and trivial features.In this study, we design EA-based feature selection methods for motor imagery BCI through the reduction of dimensionality.
The performance of a classifier will dramatically decline as the number of features increases due to the dimensionality curse, which occurs when the number of features surpasses a specific threshold.Additionally, the training procedure takes longer the higher the feature dimensionality becomes [46].
In order to locate a large number of existing channels, feature selection is required with a thorough search for extracting related channels [10,52].Researchers have focused on feature selection issues and suggested complete search-, greedy search-, and random search-based approaches [11].High computational costs and convergence to local optimum remain issues with these selection techniques [53].

BAT Algorithm
In this section, the bat optimization algorithm is introduced and illustrated in terms of its inspiration, microbats, and their lifestyle in nature, along with the method's general optimization procedure and mathematical formulation.

Inspiration of BAT
The bat optimization algorithm was first proposed by Xin-She Yang in 2010 [54].Xin-She Yang proposed the bat algorithm based on microbats' characteristics of echolocation, used for hunting prey, and movement in darkness.A microbat produces extremely loud sound pulses and hears their echo from the objects and prey around it.Based on the echo sound, bats can define the type of prey and the strategy for hunting it.The bats usually produce 10 to 20 pulses every second when they are searching for prey.Once they are close to the prey, the number of pulses increases to 200 pulses every second and the sound pulse becomes quieter.
In nature, microbats have a collective hunting behavior, where they fly together with determined velocity to hunt prey simultaneously by using the echolocation characteristic, as shown in Figure 1.The figure presents the movement of microbats based on the echoloca-tion mechanism, where the microbats update their locations and move toward prey based on the echo sound and the location of other microbats, determined by interacting with each other.Furthermore, the microbats' velocity becomes higher and the pulses lower when the microbats are close to the prey location.In the BAT algorithm, each microbat is considered as a solution in the population, the position of the prey is the optimal solution for a particular optimization problem, the location is presented in a vector x with a range between f min and f max , the velocity of microbats is presented in a vector v, and the wavelength is λ with pulse rate r ∈ [0, 1] and loudness range A, where the largest is presented as A o and the lowest is A min .

Procedure of BAT
This section presents the general optimization procedure of the BAT algorithm.This optimization procedure contains six main steps, which are presented in Figure 2 and thoroughly discussed below:

•
Step 1: BAT algorithm parameter initialization.In this step, the BAT parameters are initialized with initial values.These parameters are the number of microbats (solutions) (N), maximum number of iterations (Max Itr ), max ( f max ) and min ( f min ) frequency range, velocity vector (v), loudness rate (A), pulse rate (r), initial pulse rate (r 0 ), two parameters (λ and α) with constant values in the range [0, 1], and bandwidth range (ε) in the range [−1, 1].

•
Step 2: BAT population memory initialization.The BAT solutions are randomly generated in this step using Equation ( 1), considering the BAT algorithm and particular optimization problem parameters and constraints.
The produced solutions together generate the population, as shown in Equation ( 2), and are stored in the BAT memory (BM) in ascending order on the basis of their fitness values.The best solution with the fittest values is assigned to x Gbest and stored in the first position of the BM. • Step 3: Bat population intensification.Now, all microbats x fly and change their position considering a velocity v defined by a frequency f that is generated randomly, as shown in Equations ( 3) and ( 4).Accordingly, the bat positions are updated using Equation (5).
It is notable that the microbats update their locations to be closer to the global best (x Gbest ).Thus, the new position of the microbats intensifies the position in a direction toward x Gbest .• Step 4: Bat population diversification.In this step, the microbats' positions are updated based on random parameters to attempt to find better global solutions.A new solution is selected from the BM based on a selection method and assigned to x Gbest .Subsequently, the current solution is updated using x Gbest as follows: where A ′ is the loudness average.As Steps 3 and 4 are contradictory steps, the BAT algorithm chooses one of them at a time for execution.This selection is based on the following equation: • Step 5: BM update.The position of the microbats in the BM will be updated in this step if the new location is fitter than the old one and R ≤ A j .Moreover, x Gbest will be updated if the new BM contains a solution with a better fitness value.Subsequently, r j and A j values will be updated in accordance with Equations ( 8) and ( 9).
where itr denotes the current iteration number.

•
Step 6: Stop criterion.Steps 3, 4, and 5 will be repeated until the algorithm reaches the stop criterion.

Proposed Method
This section presents the main contribution of this paper.The proposed method includes five phases, which are presented in Figure 3 and thoroughly discussed below.

Phase I: EEG Signal Acquisition
In this study, the source of the dataset is from g.tec Medical Engineering GmbH, a standard EEG dataset; details about this dataset are explained in [8].The EEG data of poststroke patients with hemiparesis of the upper extremities were studied.This study involved 8 poststroke patients treated with the recoveriX system (g.tecmedical engineering GmbH), with a mean age of 22 years (SD = 4.582).Each participant received BCI-based MI training for three months, with 2 training sessions each week (for a total of 25 training sessions).The study team conducted and analyzed two assessments (pre-and post-training).The pretraining evaluation was scheduled 30 to 35 days prior to the intervention, and the post-training evaluation was conducted a few days after the intervention (see Figure 4).The Ethikkommission des Landes Oberosterreich in Austria (#D-42-17) authorized this study protocol, and each patient signed an informed consent form prior to the preassessment.Finally, this dataset is captured with a sample rate of 256 Hz.For capturing all the various neural processes that take place during stroke rehabilitationinvolving cognitive, affective, and motor components-sixteen-channel active EEG caps were employed.The caps were made by the g.tec medical engineering GmbH company in Austria.
To the subject, a ground electrode was applied at FPz and a reference electrode was affixed at the right earlobe.
These channels are linked with different cognitive and sensorimotor processes which are in some way impaired in patients after a stroke.Particularly, the frontocentral channels (FC5, FC1, FCz, FC2, FC6) are associated with emotional regulation, working memory, and secondary motor area.Further, it is important to note that the central channels (C5, C3, C1, Cz, C2, C4, and C6) are related to sensory-motor integration and body movement representation.In addition, the centroparietal channels (CP5, CP1, CP2, CP6) are described to be involved in the process of integration of the exteroceptive and the proprioceptive inputs as well as in the regulation of the voluntary movements [22].

Phase II: Preprocessing
Each channel of the recorded EEG dataset initially used two standard filters.First, a bandpass filter (BPF) with frequencies between (8 and 30 Hz) was used to confine the band of the recorded EEG data, and second, a Butterworth (BW) notch filter at (50 Hz) was used to reduce the noise from power line interference.(ICs) s(t) = [s 1 (t), . . ., s n (t)], utilizing the FastICA algorithm proposed by [55].The set s(t) of n unknown components that were linearly mixed within matrix A and the set x(t) of n observations where x(t) = [x 1 (t), . . ., x n (t)] [56][57][58] represent the EEGs and are related to s(t), t, which is the time; hence, the ICA equation is Then, three metrics were used to evaluate the artifactual components, ICs: kurtosis (Kurt), skewness (Skw), and sample entropy (SampEn).If these parameters surpassed the pm1.2 threshold for each IC, the IC was marked as critical and denoised using WT.The practical value of the threshold was determined through trial and error and previous research [59][60][61].The threshold value of ±1.2 is not a drawback of the AICA-WT technique, as the artifactual ICs were not rejected but were denoised using the WT technique.As a result, WT denoised the marked ICs before returning the enhanced components to the original EEG dataset [22,23].

Phase III: EEG Feature Extraction
Three different feature extraction techniques are used in this work.These techniques include time domain features, entropy features, and frequency domain features as extracted in [8].

Phase IV: EEG Channel Selection Using BAT Optimizer
This phase is the main contribution, and it includes several steps to achieve the optimal subset of the EEG channels which can provide the highest accuracy rate.The following steps represent how we adapt the BAT optimizer for the EEG channel selection problem:

•
Step 1: BAT algorithm parameter initialization.In this step, the BAT parameters are initialized with initial values.These parameters are the number of microbats (solutions) (N), maximum number of iterations (Max Itr ), max ( f max ) and min ( f min ) frequency range, velocity vector (v), loudness rate (A), pulse rate (r), initial pulse rate (r 0 ), two parameters (λ and α) with constant values in the range [0, 1], and bandwidth range (ε) in the range [−1, 1], as shown in Table 1.

•
Step 2: BAT population memory initialization.The BAT solutions are randomly generated in this step using Equation (11), considering the BAT algorithm and particular optimization problem parameters and constraints.
The produced solutions together generate the population, as shown in Equation ( 12), and are stored in the BAT memory (BM) in ascending order on the basis of their fitness values.The best solution with the fittest values is assigned to x Gbest and stored in the first position of the BM. • Step 3: BAT population intensification.Now, all microbats x fly and change their position considering a velocity v defined by a frequency f that is generated randomly, as shown in Equations ( 13) and ( 14).Accordingly, the bat positions are updated using Equation (15).
It is notable that the microbats update their locations to be closer to the global best (x Gbest ).Thus, the new position of the microbats intensifies the position in a direction towards x Gbest .• Step 4: BAT population diversification.In this step, the microbats' positions are updated based on random parameters to attempt to find better global solutions.A new solution is selected from the BM based on a selection method and assigned to x best .Subsequently, the current solution is updated using x best , as follows: where A ′ is the loudness average.As Steps 3 and 4 are contradictory steps, the BAT algorithm chooses one of them at a time for execution.This selection is based on the following equation: • Step 5: BM update.The position of the microbats in the BM will be updated in this step if the new location is fitter than the old one and R ≤ A j .Moreover, X Gbest will be updated if the new BM contains a solution with a better fitness value.Subsequently, r j and A j values will be updated in accordance with Equations ( 18) and (19).
where itr denotes the current iteration number.

•
Step 6: stop criterion.Steps 3, 4, and 5 will be repeated until the algorithm reach the stop criterion.

Phase V: Classification
A KNN classifier is used in this work.In this proposed method, the dataset is split into 60% training, 20% validation, and 20% testing.

Experiments and Results
This section thoroughly explains the performance of the proposed method (BAT) of EEG channels for stroke patient rehabilitation.Since the proposed approach is nondeterministic, the mean accuracy rate over 20 runs is computed to avoid biased results.The experiments use a Ideapad 310 Lenovo PC, China.Intel Core i7 ® 2.59 Ghz processor, 16 GB of RAM, and official Windows 10.The performance of the proposed method is evaluated using two measures, namely, accuracy and the number of EEG channels selected, with light shed on the stability of the algorithms by computing the best, worst, and mean accuracy.Moreover, a statistical test is adopted based on the classification accuracy of the motor/imaging EEG dataset using the sum of ranks of the metaheuristic algorithms.The proposed method is tested using three types of EEG features: time domain features, frequency domain features, and entropy domain features.Furthermore, the performance results of the proposed method are evaluated using a statistical test to show the significance of the proposed method compared with other metaheuristic algorithms.
Table 1 shows the parameters used for the selected metaheuristic algorithms that are used in this work.

Time Domain Results
Table 2 presents the results of seven features in the time domain: Higuchi's fractal dimension (HFD); the Hjorth parameters Hjorth activity (HjAc), Hjorth complexity (Hj-Comp), and Hjorth mobility (HjMo); Hurst (Hur); kurtosis (Kurt); and skewness (Skw).The accuracy and the number of EEG channels selected are two measurements to evaluate the seven features chosen for the motor/imaging EEG dataset.The evaluation metrics are classified into three categories: best, worst, and mean accuracy and no. of channels selected to evaluate the algorithms' stability.
According to Table 2, the performance results for the metaheuristic algorithms PSO, GWO, FFA, CS, and BAT with several features achieved different and remarkable accuracy concerning best, worst, and mean accuracy and the number of channels selected.For the HFD feature, the BAT algorithm achieved better accuracies of 99, 97.5, and 92.8 for best, mean, and worst accuracy and channel selection, respectively.For the HjAc feature, the BAT algorithm achieved high accuracy, 97.7, for accuracy and no. of channels selected in the best case, while PSO achieved a valuable ratio of 94.4 and 85.3 in accuracy and the number of channels selected in the mean and worst cases, respectively.For the HjComp feature, the PSO algorithm achieved an accuracy of 88.6 and 84.7 concerning mean and worst cases, while the BAT algorithm achieved the highest accuracy of 93.8 in the best case.For the HjMo feature, BAT obtained 97.8, 95.4, and 88.6 for best, mean, and worst among other metaheuristic algorithms.For the Hur feature, PSO gained high accuracies of 72.8, 65.2, and 56.6 for best, mean, and worst, respectively.For the Kurt feature, the BAT algorithm obtained valuable accuracies of 73.2, 68.8, and 63.1 for best, mean, and worst accuracy and the number of channels selected, respectively.
Moreover, for Skw, BAT achieved high accuracies of 79.2 and 72.5 for best and mean, respectively, compared with PSO, which obtained an accuracy of 58 in the worst case of accuracy.Figure 4 shows the results of the time domain features for the convergence rate and channel distribution, comparing the BAT and PSO algorithms, which achieved the highest accuracy over the other metaheuristic algorithms, i.e., GWO, FFA, and CS.In Figure 4a, the convergence rate shows the channels and the number of iterations for the BAT and PSO algorithms.In addition, Figure 4b presents the effective and emotive channels when channels are distributed in the BAT and PSO algorithms.

Entropy Domain Results
Table 3 shows the results of the performance accuracy using seven entropy features, namely, ConFuzEn, FuzEn, impe, MFEmu, RCMFEmu, SampEn, and TsEn.Based on the accuracy and the number of selected channels for best, worst, and mean cases, these entropy features are used to compare the five metaheuristic algorithms, PSO, GWO, FFA, CS, and BAT, respectively.Compared to the other seven entropy features, the best classification performance achieved the highest accuracy using ConFuzEn with the PSO algorithm compared to the GWO, FFA, CS, and BAT algorithms.Other entropy features produced higher accuracy results with the BAT algorithm than the PSO, GWO, FFA, and CS algorithms.The BAT algorithm registered accuracies of 95.5, 95.6, 88.1, 87.2, 91.4, and 84.6 using FuzEn, impe, MFEmu, RCMFEmu, SampEn, and TsEn, respectively.Furthermore, Figure 5 presents the performance evaluation results between the BAT and PSO algorithms concerning the convergence rate and channel distribution.

Frequency Domain Results
Based on Table 4, the frequency domain features of meanF and medF obtained high accuracies of 96.7 and 83.4 for the PSO and BAT algorithms, respectively.In the best, worst, and mean cases, meanF gained a significant accuracy relative to the medF feature on the overall accuracy results for the PSO and BAT algorithms.The best accuracy of medF was obtained at 96.7 with PSO, while the worst and mean achieved accuracies were 90.3 and 93.8 with the BAT algorithm, respectively.Moreover, the BAT algorithm scored high accuracy classification results of 83.4 and 78.4 relative to the best and worst accuracies with the feature of medF, respectively, while PSO gained an accuracy of 69.5.The convergence rate and the channel distribution are shown in Figure 6.As mentioned, Table 4 shows the performance of the proposed method (BAT) compared with the PSO, GWO, FFA, and CS algorithms using frequency domain features.The BAT algorithm achieved better results than all other algorithms except in some cases in which the PSO algorithm slightly outperformed it, such as in meanF, where the best accuracy was 96.7 for PSO and 96.3 for BAT.However, the overall runs of the BAT algorithm achieved better results with accuracy measures equal to 93.8, 91.2, 76.4, 54, and 50 for the BAT, PSO, GWO, FFA, and CS algorithms, respectively.The convergence rate and the channel distribution are shown in Figure 7.

Statistical Analysis Results
Before presenting our findings for the accuracy and no. of channels selected for improving the classification performance of the stroke EEG signals' time, entropy, and frequency features analysis, we would like to examine the influence of classification accuracy in the motor/imaging EEG dataset by the adoption of the sum of ranks of the metaheuristic algorithms.In this way, the feature that improved the rank accuracy of selected channels can be identified.
As shown in Table 5, we performed the sum of ranks of the PSO, GWO, FFA, CS, and BAT metaheuristic algorithms according to the individual feature domain.In the time domain, we tested seven features.The BAT algorithm significantly improved the accuracy rank, especially in HFD and Hjac, for an accuracy rank of 99 and 97.7, respectively.Moreover, other features in the time domain, such as HjComp, HjMo, Kurt, and Skw, showed an influential impact on the classification accuracy results relative to the sum of the rank of the BAT algorithm except for the Hur feature, which had a high effect on the PSO algorithm.However, in the statistical test phase, the BAT algorithm had low summation-of-rank results among other metaheuristic algorithms.
On the other hand, the sum of ranks for the BAT algorithm showed a meaningful impact on the classification accuracy results relative to the seven features of the entropy domain except for the ConvFuzEn feature, which had a remarkable effect on the PSO algorithm with a difference of 0.1 compared with BAT concerning the sum-of-rank results in the statistical analysis.However, the BAT algorithm had low summation-of-rank results in the statistical test phase among the other metaheuristic algorithms.
However, in the classification accuracy results from the frequency domain features, meanF showed a salient ameliorating effect on the accuracy with the PSO algorithm relative to the accuracy rank 96.7 compared with the medF feature, which had an 83.4 accuracy rank with the BAT algorithm.Moreover, the BAT and PSO algorithms had low summationof-rank results among other metaheuristic algorithms.Figure 8 shows the results of the speed of metaheuristic algorithms in seconds.

Results Discussion
This research aims to choose the most relevant EEG channels that produce an effective accuracy rate for stroke patient rehabilitation by using a binary bat algorithm-based optimization technique to optimize TEF characteristics.To further improve the classification performance of stroke EEG signals, three types of features (namely, time, entropy, and frequency domain features) were used as the baseline for the classification task.Two measurements were applied to evaluate the performance of the proposed method, accuracy and no. of EEG channels selected.Furthermore, we adopted a statistical test using the sum of the ranks for the motor/imaging EEG dataset to examine the influence of the classification accuracy and the significance of the suggested method compared with state-of-the-art metaheuristic algorithms such as PSO, GWO, FFA, and CS.Firstly, the accuracy and the no. of EEG channels selected were evaluated by computing the best, worst, and mean accuracy values to capture the stability of the implemented algorithm.In the time domain, seven features were tested, and the HFD feature had the most significant influence on the improvement of the classification task in the BAT optimizer among other optimization algorithms for the best, mean, and worst cases of accuracy and the no. of channels selected, respectively, based on a kNN classifier.In addition, the BAT results outperformed in the testing values for the best accuracy case compared with PSO, which had the highest results compared with the GWO, FFA, and CS algorithms in the HjAc and HjComp features.Moreover, the results for the BAT optimizer registered high best, mean, and worst accuracy values and the no. of channels selected, respectively, with the HFD, HjMo, and Kurt features, respectively, while PSO had the most significant influence on the improvement of the classification task compared with BAT with the Hur feature based on best, mean, and worst accuracy and the no. of channels selected, respectively.For the best-case values, the BAT optimizer outperformed in the valuable and highest values among PSO and the other metaheuristic algorithms with the six features of HFD, HjAc, HjComp, HjMo, Kurt, and Skw, respectively (see Table 2).Furthermore, according to the results of the performance accuracy using seven entropy features based on the KNN classifier, the best classification performance was achieved with the highest accuracy using ConFuzEn with the PSO algorithm compared to the GWO, FFA, CS, and BAT algorithms.Other entropy features produced higher accuracy results with the BAT algorithm than the PSO, GWO, FFA, and CS algorithms according to the best, mean, and worst accuracy values and the no. of channels selected, respectively.The BAT algorithm registered best-case accuracy values of 95.5, 95.6, 88.1, 87.2, 91.4, and 84.6 using the FuzEn, impe, MFEmu, RCMFEmu, SampEn, and TsEn features, respectively, while PSO outperformed BAT with accuracy result values for the ConvFuzEn feature for the KNN classifier (see Table 3).
The BAT and PSO algorithms obtained high accuracies of 96.7 and 83.4,respectively, compared with other algorithms in the literature for meanF and medF frequency domain features.The BAT algorithm scored high accuracy classification results of 83.4 and 78.4 relative to the best and worst accuracies with the feature of medF, respectively, while PSO gained an accuracy of 69.5; furthermore, the PSO and BAT algorithms gained significantly in accuracy relative to the medF feature on the overall accuracy results in the best, worst, and mean accuracy cases.Based on the classification results on the basis of the features from the three different domains types, the BAT and PSO algorithms exerted significant impacts on the classification performance compared with the results of the GWO, FFA, and CS optimization algorithms concerning the accuracy and the no. of channels selected, respectively.Hence, they demonstrate a significant improvement in the average accuracy relative to the classification result on the basis of the individual feature domains, as can seen in Figure 5, which explains the comparison between the convergence rate and channel distribution for the BAT and PSO algorithms.
Second, we examined the influence of classification accuracy on the motor/imaging EEG dataset using the adopted sum of ranks of metaheuristic algorithms.Thus, the feature that improved the rank accuracy of the selected channels can be identified.The BAT algorithm significantly improved the accuracy rank, especially in the HFD and Hjac features, with an accuracy rank of 99 and 97.7, respectively, compared with the PSO, GWO, FFA, and CS algorithms according to the sum-of-ranks results with respect to the time domain.Furthermore, features such as HjComp, HjMo, Kurt, and Skw showed an influential impact on the classification accuracy results relative to the sum of the rank of the BAT algorithm except for the Hur feature, which had a high effect on the PSO algorithm.However, in the statistical test phase, the BAT algorithm had low summation-of-rank results among the other metaheuristic algorithms.Further, the BAT algorithm showed a meaningful impact on the classification accuracy results for the sum of ranks relative to the seven features of the entropy domain except for the ConvFuzEn feature, which had a remarkable effect on the PSO algorithm with a difference of 0.1 compared with BAT concerning the sum-of-rank results in the statistical analysis.However, in the statistical test phase, the BAT algorithm had a low summation-of-rank results among the other metaheuristic algorithms.Moreover, the BAT and PSO algorithms had low summation-of-rank results among the other metaheuristic algorithms in the frequency domain features.The meanF feature showed a salient ameliorating effect on the accuracy with the PSO algorithm relative to the accuracy rank of 96.7 compared with the medF feature, which had an 83.4 accuracy rank with the BAT algorithm.

Conclusions and Future Work
This paper proposes a new method for EEG channel selection based on an optimization algorithm called the BAT-inspired algorithm.The main purpose of the proposed algorithm is to select the most relevant EEG channels that can provide a higher accuracy rate for stroke patient rehabilitation.
The proposed method was tested using a standard EEG dataset collected from eight poststroke patients with hemiparesis of the upper extremities.The EEG data were captured using EEG caps with 16 active electrodes from g.Nautilus PRO, g.tec medical engineering GmbH, Austria.
The proposed method used several EEG feature extraction methods such as the time domain, frequency domain, and entropy domain.In addition, the proposed method (BAT) was compared with four metaheuristic algorithms, namely, particle swarm optimization (PSO), grey wolf optimizer (GWO), cuckoo search (CS), and firefly algorithm (FFA).The performance of the proposed method was evaluated using the accuracy rate and the number of channels selected.The proposed method achieved the best results over all the feature extraction methods and showed a significant improvement using a standard statistical analysis test called the summation of ranks test.
Finally, the proposed method succeeded in reducing the number of EEG channels to less than half while maintaining the accuracy rate.
Regarding future works, the proposed method suffers from some problems; for example, the proposed method is unable to generate new solutions that have the ability to increase accuracy (i.e., stuck in local minima).For that, the proposed method will need to be improved to overcome this problem by modifying the mechanism of the BAT algorithm or hybridizing the BAT algorithm with another metaheuristic algorithm to be able to find the optimal solution.Regarding the second problem, the current version of the BAT algorithm focuses on finding the optimal solution that provides the highest accuracy rate and does not consider the number of EEG channels in the objective function.Therefore, in future work, we will work on the proposed multiobjective BAT version using the highest accuracy and the lowest number of EEG channels simultaneously.

Figure 3 .
Figure 3.A proposed method for electroencephalogram channel selection.

Figure 4 .
Figure 4. (a) EEG electrode distributions based on 10-20 system; (b) schematic diagram of EEG recording protocol.According to system indications for an MI mental task, the patients were instructed to visualize dorsal wrist movement.Prior to and after EEG neurorehabilitation, the patients participated in 25 MI-based BCI sessions with follow-up evaluation visits to measure the functional changes.Each session consisted of 240 MI repetitions with both hands, broken down into three 80-trial runs.Each session lasted approximately one hour, including the time required for setup and cleanup.The MI-based BCI tasks were illustrated with randomized inter-trial intervals in a pseudo-random order.

Figure 5 .
Figure 5. Convergence rate and channel distribution.

Figure 6 .
Figure 6.Convergence rate and channel distribution.

Figure 7 .
Figure 7. Convergence rate and channel distribution.

Figure 8 .
Figure 8. Speed of metaheuristic algorithms in seconds.

Table 2 .
The performance of metaHeuristic algorithms with several feature extraction approaches for motor/imaging EEG dataset.

Table 3 .
The performance of metaHeuristic algorithms with several feature extraction approaches for motor/imaging EEG dataset.

Table 4 .
The performance of BAT algorithm compared with several metaheuristic algorithms using frequency domain features.

Table 5 .
The sum of ranks of metaHeuristic algorithms based on classification accuracy on motor/imaging EEG dataset.