EEG Signal Complexity Measurements to Enhance BCI-Based Stroke Patients’ Rehabilitation

The second leading cause of death and one of the most common causes of disability in the world is stroke. Researchers have found that brain–computer interface (BCI) techniques can result in better stroke patient rehabilitation. This study used the proposed motor imagery (MI) framework to analyze the electroencephalogram (EEG) dataset from eight subjects in order to enhance the MI-based BCI systems for stroke patients. The preprocessing portion of the framework comprises the use of conventional filters and the independent component analysis (ICA) denoising approach. Fractal dimension (FD) and Hurst exponent (Hur) were then calculated as complexity features, and Tsallis entropy (TsEn) and dispersion entropy (DispEn) were assessed as irregularity parameters. The MI-based BCI features were then statistically retrieved from each participant using two-way analysis of variance (ANOVA) to demonstrate the individuals’ performances from four classes (left hand, right hand, foot, and tongue). The dimensionality reduction algorithm, Laplacian Eigenmap (LE), was used to enhance the MI-based BCI classification performance. Utilizing k-nearest neighbors (KNN), support vector machine (SVM), and random forest (RF) classifiers, the groups of post-stroke patients were ultimately determined. The findings show that LE with RF and KNN obtained 74.48% and 73.20% accuracy, respectively; therefore, the integrated set of the proposed features along with ICA denoising technique can exactly describe the proposed MI framework, which may be used to explore the four classes of MI-based BCI rehabilitation. This study will help clinicians, doctors, and technicians make a good rehabilitation program for people who have had a stroke.


Introduction
Common symptoms that have a substantial impact on the quality of life of stroke survivors include disability and cognitive impairment; stroke is the most frequent cause of disability and impairment [1]. Daily activities are significantly impacted by those impairments [2]. Recent studies have concentrated on developing effective therapies and rehabilitation programs for stroke victims. Helping the brain repair neuronal connections and make up for damaged circuits is the goal of therapy and rehabilitation. Though choosing the appropriate course of action can take weeks, it is still not yet possible to do so objectively [3].
Researchers have discovered in recent years that brain-computer interface (BCI) techniques can improve communication between the brain and computer by decoding brain neural signals [4,5]. There have been several attempts to investigate the application of BCI, but motor imagery (MI) has received the most attention since it causes the motor cortex to respond when a person mentally models a specific movement of limbs without activating their muscles [4]. Even in the presence of significant nerve injury, repetitive training based on MI encourages neuronal reorganization [6,7]. In conjunction with specific external assistive technologies, the MI-based system has the potential to significantly improve the quality of life for individuals with stroke, spinal cord injury, and amyotrophic lateral sclerosis [8,9].
Researchers used event-related desynchronization and event-related synchronization (ERD/ERS) to classify mental states [10,11], because the sensorimotor cortex attenuates oscillatory brain activity within specific frequency bands [12,13], which can be distinguished when the subject imagines moving different sides of the body [14,15]. EEG signals can be used to track a patient's health and brain activity changes [16].
All prior research contributes significantly to the MI classification task. Classifiers such as support vector machines (SVM), linear discriminant analyses (LDA), and random forests (RF) have all been employed [5]. Nevertheless, most previous research only employs a single conventional filter during the preprocessing (denoising) stage, and most forecast MI EEG data analysis techniques overlook the benefits of using a hybrid filtering strategy for denoising the EEG signal before deploying algorithms. Most previous research has employed feature extraction approaches that are specific to a single domain, such as CSP or WT [17], during the feature extraction step. Existing research has not shown a variety of feature extraction and dimensionality reduction techniques to evaluate the MI EEG's complexity and irregularity, an area where much opportunity exists to enhance classification accuracy.
Apart from other studies, in this work, the preprocessing stage was where the conventional filters and independent component analysis (ICA) denoising technique were initially applied. Then, nonlinear features were retrieved, such as fractal dimension (FD), Hurst exponent (Hur), and Tsallis entropy (TsEn), as well as dispersion entropy (DispEn), as dynamic entropy parameters. Two-way analysis of variance (ANOVA) was used to statistically analyze four MI-based classes. Due to the effectiveness of the used features, they were combined into CompEn integrated feature set. Laplacian Eigenmap (LE) dimensionality reduction algorithm was applied to the feature set to improve the classification performance of the motor imagery (MI)-based BCI stroke patients.
Not all of the time will a decision BCI MI-based EEG dataset system show promising outcomes; its advantages and disadvantages should be weighed carefully. In particular, unlike other methods that involve a great deal of training and expensive sensors, EEGs are a wireless, low-cost device that can automatically recognize MI from EEG data. When compared to magnetoencephalogram (MEG) systems, the proposed CompEn integrated feature set can investigate complexity and irregularity over the entire spectrum of MI-based EEG data with normal throughput and can be mastered by a greater number of users.
To the author's knowledge, this work has addressed the contribution of the EEG role in the MI-based BCI interaction. This paper's primary novelty, therefore, has two components. Its first objective is to suggest a wireless EEG system based on low-cost, automated EEG signals that can recognize MI. This can be accomplished by examining the complexity and irregularity over the entire spectrum of MI-based EEG data and proposing the CompEn integrated feature set. Second, the feature set was subjected to the Laplacian Eigenmap (LE) dimensionality reduction approach to improve classification performance in the development of the MI framework, which can be sensitive for detecting a four-MI-class (left hand, right hand, feet, and tongue) from eight patients.

Related Works
EEG is a non-invasive method for identifying conditions and symptoms that affect the brain. Numerous neurological conditions, including epilepsy, tumors, cerebrovascular lesions, depression, and trauma-related issues, can be diagnosed with its aid. An emerging method of direct brain-to-computer communication, known as EEG-based BCI, relies on Sensors 2023, 23, 3889 3 of 24 the interpretation of features that are extracted from the EEG signal with higher resolution than those found in signals from other devices [18].
The EEG potentials recorded from the scalp's surface are bioelectric signals produced by the neuronal activity of the brain. Many researchers have been concentrating on the fundamentals of BCI in recent years through the interpretation of EEG-based commands and have worked on controlling a device with this approach [18]. These research studies continue to contribute to raising the quality of life for those who are paralyzed or have lost limbs such as their arms and legs [19]. An EEG-based BCI system that Mabrouk et al. [20] have created shows the user's EEG signals and accurately categorizes them as fictitious right and left hand movements.
According to studies conducted by [21], the active EEG frequency bands and brain regions that contribute to cognitive load fluctuate based on the learning state. Moreover, they reported variations in EEG frequency bands in specific brain regions under cognitive stress when performing activities involving human-computer interaction [22].
EEG is, therefore, trustworthy and among the most sensitive indicators of brain activities for determining mental burden brought on by cognitive processing [23].
Recognizing the most pronounced marks from EEG signals is essential to detecting and identifying brain features as well as assessing the EEG signal variable under evaluation [3]. From a clinical standpoint, the neurologist interprets the post-stroke patient's EEG signal by looking at wave rhythms, amplitudes, asymmetries, changes in magnitudes, the presence of waves, and the ratio between waves [24,25].
The recorded wave activities could be distorted, though, by a variety of artifacts [26,27]. The abnormal behavior of the brain can typically be imitated or superimposed by these artifacts. Additionally, significant artifacts that conflict with EEG, such as eye blinks and ocular movements, cardiac artifacts, muscle activities, and noise from power lines, may cross EEG frequencies [28]. Thus, it is challenging to categorize EEG signals due to noise [29].
In order to improve our understanding of how the brain works, it is crucial to quantify the complexity of the EEG signal [30]. This allows us to obtain insight into the process and distinguishing characteristics of the signal. When examining the complexity changes caused by events in the functional areas of the brain, nonlinear parameters are very useful indicators [31]. It should be noted that nonlinear parameters are frequently employed for a range of neurophysiological investigations and applications utilizing EEG signals [32]. The EEG signal is difficult to acquire, process, and analyze due to its complexity and nonstationarity. When data processing for feature extraction is properly prioritized, significant information about the neurophysiological conditions in the brain can be gleaned.
Due to the numerous redundant data reductions and transformations involved in data processing, one must be extremely careful when selecting the best methodology to prevent information loss. Using advocates of nonlinear discrete dynamical systems, the authors of previously published studies have examined changes in the temporal dynamics of the EEG signal under moderate to demanding mental stimulation. However, it has been suggested that the brain in the majority of these cases functions as a nested network of coupled dynamical systems that maintains spatial and temporal dynamics and can be identified through nonlinear biomarkers of EEG signal [5,24].
The most recent techniques for EEG analysis for MI-based BCI are shown in Table 1, which also includes feature extraction and classification methods as well as various denoising techniques. Bandpass filters and notch filters have been used as denoising techniques in many studies, see [33][34][35], but blind source separation algorithms (BSS) have also been used with ICA in other studies (see [36][37][38]). As in [17,33,35,38], CSP was also the most widely used feature extraction technique. In reality, different EEG-based BCI datasets show differences in the brain regions associated with MI-BCI, making it difficult for conventional methods of feature extraction to demonstrate accurate classification of different classes. As far as the authors of this article are aware, the majority of studies computed the nonlinear dynamical parameters. The complexity and irregularity characteristics used in this study, however, may aid in understanding how specific spatial information of brain functions changes over time [39]. The majority of EEG-BCI-based motor imagery studies published in the literature concentrate on separating left from right hand or foot motor imagery [19].
As a result, this issue could be resolved by using more effective features that are compatible with the complexity of the brain and that can be used to elicit the unique performance of subjects following motor imagery (MI)-based BCI rehabilitation.

Methods and Materials
This study's methodology entails examining nonlinear MI-BCI EEG-based time series in an effort to find variations in complexity and entropy occurring during MI-BCI. Figure 1 shows the directions for the MI-based BCI framework, including the stages of preprocessing, feature extraction, statistical analysis, LE dimensionality reduction, and classification.

Data Description
The dataset used is BCI Competition IV dataset 2a, [22], which is a four-class (left hand, right hand, foot, and tongue) MI dataset from eight subjects donated by Graz University (Table 2), homepage (http://www.bbci.de/competition/iV accssed on 12 January 2023). To collect the dataset, 22 EEG channels and 3 EOG channels are employed at a sampling rate of 250 Hz. The original EEG with 22 channels is shown in Figure 2.

Data Description
The dataset used is BCI Competition IV dataset 2a, [22], which is a four-class (left hand, right hand, foot, and tongue) MI dataset from eight subjects donated by Graz University (Table 2), homepage (http://www.bbci.de/competition/iV accessed on 12 January 2023). To collect the dataset, 22 EEG channels and 3 EOG channels are employed at a sampling rate of 250 Hz. The original EEG with 22 channels is shown in Figure 2.  Each subject's data consists of two sessions: a training session and a testing session. There are a total of 288 trials for the four classes in each session, with an average of 72 trials per class. Throughout the data collection process, 22 Ag/AgCl electrodes were used, and the amplifier's sensitivity was adjusted to 100 V. The 8-32 Hz band is used to filter the raw EEG signal [23]. Because the alpha and beta frequency bands, which have been found to be the most pertinent for MI categorization, are included in the frequency band, it was chosen. BCI Competition IV [22] contains a thorough overview of the dataset.
A cross and a brief warning tone are displayed on the blank screen at the start of each trial (t = 0 s). An arrow that points left, right, below, or above shows on the screen two seconds later (t = 2 s) and remains there for four seconds. Up until the prompt arrow vanished from the screen (t = 6 s), the subject completed the necessary motor imaging tasks. Following a brief intermission, the screen became completely black for the following motion imagination experiment ( Figure 3) [4]. Each subject's data consists of two sessions: a training session and a testing session. There are a total of 288 trials for the four classes in each session, with an average of 72 trials per class. Throughout the data collection process, 22 Ag/AgCl electrodes were used, and the amplifier's sensitivity was adjusted to 100 V. The 8-32 Hz band is used to filter the raw EEG signal [23]. Because the alpha and beta frequency bands, which have been found to be the most pertinent for MI categorization, are included in the frequency band, it was chosen. BCI Competition IV [22] contains a thorough overview of the dataset.
A cross and a brief warning tone are displayed on the blank screen at the start of each trial (t = 0 s). An arrow that points left, right, below, or above shows on the screen two seconds later (t = 2 s) and remains there for four seconds. Up until the prompt arrow vanished from the screen (t = 6 s), the subject completed the necessary motor imaging tasks. Following a brief intermission, the screen became completely black for the following motion imagination experiment ( Figure 3) [4]. A cross and a brief warning tone are displayed on the blank screen at the start of each trial (t = 0 s). An arrow that points left, right, below, or above shows on the screen two seconds later (t = 2 s) and remains there for four seconds. Up until the prompt arrow vanished from the screen (t = 6 s), the subject completed the necessary motor imaging tasks. Following a brief intermission, the screen became completely black for the following motion imagination experiment ( Figure 3) [4].

Preprocessing Stage
Because the MI-based BCI was contaminated by so many different artifacts ( Figure  4), conventional filtering and the independent component analysis (ICA) techniques have been used as described in the following sections.

Preprocessing Stage
Because the MI-based BCI was contaminated by so many different artifacts (Figure 4), conventional filtering and the independent component analysis (ICA) techniques have been used as described in the following sections.

Conventional Filtering
To obtain the EEG dataset, 22 scalp-area channels were used. Each channel of the acquired EEG datasets was processed individually using conventional filtering techniques in the first stage. The power line interference noise was eliminated using a notch filter at 50 Hz, and the band of the recorded EEG signals was limited using a band pass filter (BPF) with a frequency around (8-30) Hz.

Independent Component Analysis (ICA)
Therefore, the ICA technique has been utilized to identify and eliminate various artifacts from EEG data. First, the ICA algorithm and the linear mixing model were used since ICA is a potent statistical technique for separating mixed signals based on a number of presumptions. The most crucial premise is that the sources already in existence be statistically independent of one another, and the mixing procedure should be instantaneous and linear [42,43].
The goal of ICA is to estimate the set of unknown components, s( ) = [ ( ), … , ( ) ], which were linearly mixed by the matrix A, x( ) is the set of observations and x( ) = [ ( ), … , ( ) ] [42,44]. Where x( ) represents the EEGs, which are related to s( ), is the time or sample index, the ICA linear transform Equation is:

Conventional Filtering
To obtain the EEG dataset, 22 scalp-area channels were used. Each channel of the acquired EEG datasets was processed individually using conventional filtering techniques in the first stage. The power line interference noise was eliminated using a notch filter at 50 Hz, and the band of the recorded EEG signals was limited using a band pass filter (BPF) with a frequency around (8-30) Hz.

Independent Component Analysis (ICA)
Therefore, the ICA technique has been utilized to identify and eliminate various artifacts from EEG data. First, the ICA algorithm and the linear mixing model were used since ICA is a potent statistical technique for separating mixed signals based on a number of presumptions. The most crucial premise is that the sources already in existence be statistically independent of one another, and the mixing procedure should be instantaneous and linear [42,43]. The goal of ICA is to estimate the set of n unknown components, s(t) = [s 1 (t), . . . , s n (t)], which were linearly mixed by the matrix A, x(t) is the set of observations and x(t) = [x 1 (t), . . . , x n (t)] [42,44]. Where x(t) represents the EEGs, which are related to s(t), t is the time or sample index, the ICA linear transform Equation is: where x(t) and s(t) are supposed to have zero mean. The ICA uses the higher-order statistics of x(t) to compute the demixing matrix W, which is the inverse matrix of A, to be linearly represented the independent components. Then, under such assumptions, the ICs can be estimated by Equation (2) [42,44,45]: where y(t) = [y 1 (t), . . . , y n (t)] is the vector that estimate the ICs. As a result, ICA is regarded as an effective method for identifying artifact components and brain activity components that may be affected more than other components [46][47][48].
In this study, denoising the EEG signals to increase characteristics during MI tasks was the main objective rather than isolating specific physiological activity. It is necessary to define a standard to compare ICs from various EEG epochs and participants and to identify which components are noise-sensitive [46][47][48]. This criterion was met by decomposing EEG data using the SOBI method, which was based on SOBI algorithm [49,50]. In order to extract the new component matrix S and modify for various circumstances, the SOBI algorithm was chosen because of its robustness, speed of convergence, and minimal number of tunable parameters [51].
The ICA method is used to remove artifacts from EEG recordings; however, its implementation depends heavily on the user, because one of ICA's biggest drawbacks is that it cannot identify the estimated origins. The application of the artifact detection metrics based on the estimation of cross correlation (XCorr) overcame this restriction. The data will be cleared of all artifactual ICs marked using XCorr (zeroing the artifactual ICs method). Equation (3) gives the correlation XCorr between the interest-related EEG signal x and the EOG noisy signal y.
The original, artifact-free EEG data will be used to estimate the ICA for the artifactual free ICs, which will be reconfigured as the new dataset. As stated in Equation (4), the ICA calculated of the original, artifact-free EEG data was reconstructed from the ICA corrected EEG signals to createx, the new data set, whereŝ(t) is the new component matrix.

Complexity Analysis
The EEG signal is the key to determining the complexity of the nonlinear activity of the brain, which is why the human brain is regarded as a dynamical system. The EEG signal's dynamical system state can be determined by calculating the signal's complexity [49]. The FD and Hur nonlinear time series approaches [50] are extremely effective and accurate in describing the MI-based EEG times series [51], which is how physiological signal complexity is best evaluated.

Fractal Dimension (FD)
Higuchi's fractal dimension FD is a suitable technique for assessing biomedical signals [52] due to its reliance on a binary sequence and, frequently, decreased sensitivity to noise [53]. Since MI-based BCI rehabilitation uses EEG inputs, this work employed FD to look at such signals. The procedure to compute the HFD can be explained as follows: Given a one dimensional time series , the algorithm to compute the HFD can be described as follows [54]: where k and m are integers, k indicates the discrete time interval between points, whereas m = 1, 2, . . . , k represents the initial time value. For each of the k time series X m k , the length L m (k) can be computed as in Equation (6): where N is the length of the original time series X, and the term represents the normalization factor. Then, the length of the curve for the time interval k is defined as the average of the k values L m (k), for m = 1, 2, . . . , k: Finally, the data should follow a straight line with a slope equal to the HFD of X when L(k) is plotted against 1/k on a double logarithmic scale, with k = 1, 2, . . . , k max . Therefore, the slope of the line that least-squares fits the pairings {ln[L(k)], ln(1/k)} is the definition of HFD. HFD results were displayed against a range of k max in order to select an appropriate value for the parameter k max . The HFD plateauing point is regarded as a saturation point, and that k max value ought to be chosen [55,56]. The greatest outcomes in this study were found while measuring the HFD of the EEG; k max = 20. HFD was computed using 6-s windows (1500 samples).

Hurst Exponent (Hur)
Numerous studies have looked at using the Hur to analyze EEG information from MI-based BCI rehabilitation [14]. The Hur is a metric for a time series' long-memory characteristics [15,16]. The scalar depicts a time series' relative propensity to either substantially regress to the mean (mean-reverting pattern) or cluster in a certain direction (trending pattern).
The Hur of time series, which serves as a gauge of long-range correlation, can be estimated using the R/S approach [17]. The following can be used to describe this technique.

1.
Calculate the logarithmic retunes of detrended time series with length N = r − 1, where t has length of original time series.
Split the time series into m adjoining subsets S j of length n, where m × n = N, and j = 1, 2, . . . , m. The segments of each subset calls N kj , with k = 1, 2, . . . , n.
The average of each subset S j is counted by: 3. Calculate the addition of deviation from the average for each subset of S j as: Sensors 2023, 23, 3889 9 of 24 4. The mean relative range of any single subset is calculated as: 5. In this step, standard deviation of each subgroup is considered: 6.
The range R I j of each subset is rescaled by the related standard deviation S I j . Therefore, the average R S measures for each window with length n is: All above steps should be repeated for different time periods.

7.
Plot log R S n versus log(n): The slope of this graph shows the Hur [18]. Hur values could be calculated using a rescaled range formula estimated by the above steps.
where n is the number of data points and Hur is the average of all EEG signals [19][20][21]. While EEG signals exhibit considerable non-stationary properties, the R S technique only reliably calculates Hur for stationary time series [22]. Therefore, the non-stationarity of data issue needs to be addressed in order to examine the dynamical Hur of EEG signals [23]. To achieve this, processing the data inside a window size of 6 s is one option. This window size is big enough for the data to statistically behave like a stationary time series.

Entropy Analysis
Entropy is the rate of information generation in dynamical systems. Entropy [24] is a metric describing the unpredictable nature of information content. Entropy estimate is based on the idea of estimating the level of randomness in a time series. The usefulness of entropybased characteristics for categorizing emotional-based EEG signal has been established in few investigations [24]. There are various methods for estimating entropy, including sample, permutation, and approximate methods. TsEn and DispEn were used for this investigation because they are reliable, effective, and computationally efficient parametric methods for directly estimating entropy from the time series of an EEG signal [57,58].

Tsallis Entropy (TsEn)
The estimation of the EEG changes using time domain-dependent entropy has been shown extensively using TsEn entropies. For instance, TsEn was developed from the EEG of traumatic brain injury patients [17]. In this study, four classes of EEG signals from MI-based BCI rehabilitation were classified using TsEn. In this essay, we used Tsallis et al.'s definition of entropy to measure a signal's degree of uncertainty [57].
where x i are information events, p(x i ) are the probabilities of x i , and the q-logarithm function is defined as: Particularly, ln 1 (x) = ln(x). TsEn is a better option for examining the entropy of a system for which it may not be accurate to assume intense qualities, because, while Shannon entropy has intensive properties, it is generally extensive [21]. The non-extensivity of the system being measured is quantified by the parameter q. Given the link shown in Equation (12), if the likelihood that the information events within the signal will occur is known, the quantity of information contained inside an EEG signal, or the signal's entropy, can be approximated. To assess the likelihood of the information events in EEG recordings, examples of known physical information events observed in other natural signals can be employed. In particular, crucial spots (local peaks, minima, and discontinuities) seem to distinguish information events in natural signals [59]. Sneddon [21] offered the following approximation of Tsallis entropy for q = 2, based on the observation that local critical points seem to designate information in natural signals: where N is the total number of bins formed by the signal's local critical points, s 2 i is the variance inside each of these bins, and σ 2 is the overall signal variance. The discrete derivative (X i+1 − X i )/∆t was defined as having critical points at locations where it was equal to zero or changed sign from its initial value. Due to the relatively little length of the chosen EEG intervals utilized in the analyses reported, Sneddon's approximation for Tsallis entropy was adopted [60].

Dispersion Entropy (DispEn)
A new irregularity indicator known as DispEn was proposed by Rostaghi et al. [58] and is based on symbolic dynamics or patterns. Data are transformed into a new signal with just a few different patterns, and the analysis of dynamic time series is reduced to a distribution of symbol sequences. Its purpose was to address the drawbacks of other entropy measures such as sample entropy and permutation entropy. As a result, unlike other entropy measures, DispEn can distinguish between various biological and mechanical states and is sensitive to changes in simultaneous frequency and amplitude values [58]. The length m of templates, the number of classes c that determine the number of patterns or classes to be taken into account in the computation, and the time delay d are the three internal parameters that dictate how DispEn is calculated. For the latter parameter, it is advised to use the value d = 1, and for m and c, use cm < N; N is the length of the time series. When c is too high, slight variations in the signal might induce a change in class, making it susceptible to noise. When c is too low, always with c > 1, signal values are too widely apart and lead to being assigned to the same class [58].
DispEn has been applied to a univariate signal X = x 1 , x 2 , . . . , x n with length N to perform the DispEn algorithm. is equal to c m , since the signal has m members and each member can be one of the integers from 1 to c. Therefore, for each of c m potential dispersion patterns π v 0 v 1 ...v m−1 , relative frequency is obtained as follows: where # means cardinality. In fact, p π v 0 v 1 ...v m−1 shows the number of dispersion patterns of π v 0 v 1 ...v m−1 that is assigned to u m,c i , divided by the total number of embedded signals with embedding dimension m. Finally, based on Shannon's entropy, the DispEn can be calculated as in Equation (19) [58,61].

Statistical Significance Analysis
To determine the level of statistical significance of the MI-based BCI EEG dataset, twoway ANOVA tests were run four times. Following that, the Kolmogorov-Smirnov test was used to determine normality, and the Levene's test was used to determine homoscedasticity. Using Duncan's test, the post-hoc comparison was carried out. ANOVAs in SPSS 22 were used for the statistical analysis. The findings of the TsEn and DispEn irregularity parameters and the FD and Hur as complexity features were compared to see if there was a statistically significant difference at the 0.05 (0.95%) confidence level.
A two-way ANOVA on the FD traits was performed during the first session of the ANOVA. In this analysis, the nonlinear features FD was the dependent variable, and the group factor (the individual MI-BCI performance from four classes (left hand, right hand, feet, and tongue)) among the eight subjects was the independent variable. All statistical tests had a significance level of p < 0.05.
On the Hur characteristics, a two-way ANOVA was conducted during the second ANOVA session. In this analysis, the nonlinear complexity Hur feature was the dependent variable, and the group factor (individual MI-BCI performance from four classes (left hand, right hand, feet, and tongue)) among the eight subjects was the independent variable. All statistical tests had a significance level of p < 0.05. Two-way ANOVA was conducted on the TsEn characteristics in the third ANOVA session. In this analysis, the nonlinear characteristics TsEn served as the dependent variable, while the group factor (the individual MI-BCI performance from four classes (left hand, right hand, feet, and tongue)) among the eight individuals served as the independent variables. All statistical tests had a significance level of p < 0.05.
On the DispEn characteristics, a two-way ANOVA was performed during the fourth ANOVA session. In this research, the nonlinear irregularity features DispEn were the dependent variable, while the group factor (the individual MI-BCI performance from four classes (left hand, right hand, feet, and tongue)) among the eight individuals served as the independent variables. All statistical tests had a significance level of p < 0.05.

Laplacian Eigenmap (LE) Dimensionality Reduction Algorithm
Belkin et al. [62] suggested LE to identify the projection that respects the intrinsic geometrical structure from all the data points and also consists of labels because LE [62] has multi-class issues. In order to identify regional organization in the data, it creates a nearest neighbor graph. The graph's vertex points represent the data's points, and its edges represent the connections between those points' neighborhoods. The similarity between neighboring points is represented by the edges' non-negative weights. LE calculates eigenvalues and eigenvectors for the generalized eigenvector problem given the similarity matrix W: where L = D − W is the graph Laplacian, and D is the diagonal weight matrix with D D ii = ∑ jW ji [62]. Let the first r smallest eigenvectors of the preceding equation be y 1 , . . . , y r . The ith row of Y = [y 1 , . . . , y r ] provides the new coordinate for point i. LE makes an effort to map related points as precisely as feasible. The objective function of LE is: with the constraint Y T DY = 1

Classification Stage
EEG data were thoroughly examined to identify the four classes: left hand, right hand, feet, and tongue among the eight subjects. Indeed, the accuracy of the classification results can be influenced by both the proper selection of dimensionality reduction techniques and the type of classifier. Three widely used classification methods for brain illnesses were used in this study: SVM, KNN, and RF.
The SVM classifier achieved its best performance using ten-fold cross-validation to optimize the complexity parameter C with values in the range of −4 ≤ log 10 (C) ≤ 4 in C values C ∈ {0.0001, 0.001, 0.01, 0.1, 0, 10, 100, 1000, 10, 000} on the training set. The greatest results for C values were obtained during testing when C was equal to 10. Multiclass SVM classifiers were developed using the radial basis function (RBF) kernel as their foundation. Additionally, the minimal misclassification rate from the training dataset was calculated to help choose the smoothing value for SVM training. The best value can only be found by methodically adjusting across several training sessions. As a result, the value in this study was changed between 0.1 and 1 at intervals of 0.1. The lowest misclassification rate was found to correspond to a value of σ = 0.5 [26].
The KNN classifier requires the specification of the parameter k. At 2-point intervals, the value of k was changed between 1 and 9. In order to train the classifier to find the ideal value of k, the value of k = 5 was chosen arbitrarily. The Euclidean distance was calculated as a measure of similarity for classifying each trial using KNN.
The RF classifier is an ensemble approach that predicts individual trees using a cluster of decision trees during training [63]. Instead of utilizing a Gini index and information gain, random forests selects the root node and partition the features at random. The classifier's output is implemented depending on the majority of votes from trees. Random forests is an extension of bagging that is excellent at classifying motor imagery tasks based on EEG signals [64].
The accuracy of this dataset's learning based on 10-fold cross-validation was represented by taking the average of all of these accuracies.

Results and Discussion
The MI-BCI EEG datasets would be examined, and the outcomes for each subject would be calculated using statistical analysis and classification methods in terms of accuracy and confusion matrix. The findings are as given in the following sections.

Results of Preprocessing Stage
Due to the wide diversity of EEG aberrations, it was possible to successfully suppress (red color) the original noisy (blue color) EEG signals by employing conventional filters and the ICA technique for each EEG channel separately (blue color). Figure 5 depicts the Midline Frontal (Fz channel) prior to and following use of the denoising technique.

Results of Features Extraction
The distribution and features of the four classes can be better understood with the aid of the features' visualization presented below, which was taken from the EEG MI-based BCI dataset (left hand, right hand, foot, and tongue).

Complexity Analysis
The complexity features collected from the EEG MI-based BCI dataset are represented as a box plot for easy analysis. Figure 6 depicts the distribution of FD and Hur values, respectively, for the left hand, right hand, foot, and tongue for Subject 1, with the median FD and Hur values depicted by the innermost line in each box. Whiskers, the vertical lines on top and bottom of the boxes, can be used to gauge the degree of skew.
accuracy and confusion matrix. The findings are as given in the following sections.

Results of Preprocessing Stage
Due to the wide diversity of EEG aberrations, it was possible to successfully suppress (red color) the original noisy (blue color) EEG signals by employing conventional filters and the ICA technique for each EEG channel separately (blue color). Figure 5 depicts the Midline Frontal (Fz channel) prior to and following use of the denoising technique.

Results of Features Extraction
The distribution and features of the four classes can be better understood with the aid of the features' visualization presented below, which was taken from the EEG MIbased BCI dataset (left hand, right hand, foot, and tongue).

Complexity Analysis
The complexity features collected from the EEG MI-based BCI dataset are represented as a box plot for easy analysis. Figure 6 depicts the distribution of and values, respectively, for the left hand, right hand, foot, and tongue for Subject 1, with the median and values depicted by the innermost line in each box. Whiskers, the vertical lines on top and bottom of the boxes, can be used to gauge the degree of skew.

Entropy Analysis
Visualizing the entropy features that were derived from the EEG MI-based BCI dataset can be performed with the use of a box plot. Figure 7 contains a rectangular box that illustrates the distribution of and values for the left hand, right hand, foot, and tongue for Subject 1. The line that is contained within the rectangular box illustrates the median value for and , respectively. Whiskers are the lines that run vertically along the top and bottom of these boxes. They are a handy tool for determining how much the skewness has changed.

Entropy Analysis
Visualizing the entropy features that were derived from the EEG MI-based BCI dataset can be performed with the use of a box plot. Figure 7 contains a rectangular box that illustrates the distribution of TsEn and DispEn values for the left hand, right hand, foot, and tongue for Subject 1. The line that is contained within the rectangular box illustrates the median value for TsEn and DispEn, respectively. Whiskers are the lines that run vertically along the top and bottom of these boxes. They are a handy tool for determining how much the skewness has changed.
Visualizing the entropy features that were derived from the EEG MI-based BCI dataset can be performed with the use of a box plot. Figure 7 contains a rectangular box that illustrates the distribution of and values for the left hand, right hand, foot, and tongue for Subject 1. The line that is contained within the rectangular box illustrates the median value for and , respectively. Whiskers are the lines that run vertically along the top and bottom of these boxes. They are a handy tool for determining how much the skewness has changed.

Results of Statistical Significance Analysis
ANOVA has been used to quantify significant EEG changes; has been performed to check the significant difference based on among all EEG channels, thus, to discriminate among the four MI-BCI rehabilitation tasks. Table 3 presents a comparative plot of , which is sufficient to detect important patterns and to estimate the MI-BCI performance from four classes (left hand, right hand, feet, and tongue) of eight subjects individually.

Results of Statistical Significance Analysis
ANOVA has been used to quantify significant EEG changes; Hur has been performed to check the significant difference based on Hur among all EEG channels, thus, to discriminate among the four MI-BCI rehabilitation tasks. Table 3 presents a comparative plot of Hur, which is sufficient to detect important patterns and to estimate the MI-BCI performance from four classes (left hand, right hand, feet, and tongue) of eight subjects individually. Hur performance (p < 0.05) can reveal an overview of the activities from each subject showing significant differences in left hand and tongue values for Subjects 1, 2, and 6 (LH_T S1,2,6 ). Moreover, the significant differences in foot values were obtained for Subjects 3 and 5 (F S3,5 ). For Subject 7, the significant differences were shown in right hand values (RH S7 ), and for Subject 8, effects were shown in tongue (T S8 ) during MI-BCI rehabilitation tasks.
ANOVA has been used to quantify significant EEG changes, FD has been performed to check the significant difference based on FD among all EEG channels, thus, to reveal the discrimination among four MI-BCI rehabilitation tasks. Table 4 presents a comparative plot of FD which is sufficient to detect important patterns and to estimate the MI-BCI performance from four classes (left hand, right hand, feet, and tongue) of eight subjects individually. FD performance (p < 0.05) can provide an overview of the activities from each subject showing significant differences in tongue values for Subjects 1 and 5 (T S1,5 ) and in right hand values for Subjects 2 and 8 (↑ F S2,8 ). Further inspection of the results showed a decrease in tongue values for Subject 6 (RH S6 ). However, for Subject 2 (LH < T < F < RH), whereas for Subject 3 (RH < LH < T < F). For Subject 7 (LH < F < RH < T), for Subject 8 (F < RH < LH < T), and for Subject 9 (RH < T < F < LH) during MI-BCI rehabilitation tasks.
In order to reveal and distinguish subjects across the four MI-BCI rehabilitation tasks, ANOVA has been utilized to measure important EEG changes. TsEn has also been performed to assess the significant difference based on TsEn among all EEG channels. A comparison plot of TsEn is shown in Table 5 that is enough for identifying significant trends and estimating the MI-BCI performance from four classes (left hand, right hand, feet, and tongue) of eight subjects separately. TsEn performance (p < 0.05) can reveal an overview of the activities from each subject showing significant differences in left-hand values for Subjects 1, 6, and 9 (LH S1,6,9 ). Another significant difference can be obtained in foot values for Subjects 2, 3, and 8 (F S2,3,8 ). However, there were significant differences in tongue values for Subject 7 (T S7 ) and in feet and right-hand values for Subject 5 (RH_F S5 ).
ANOVA has been used to quantify significant EEG changes; DispEn has been performed to check the significant difference based on DispEn among all EEG channels in order to provide a valuable marker among four MI-BCI rehabilitation tasks. Table 6 shows a comparative plot of DispEn, which is sufficient to estimate the MI-BCI performance from four classes (left hand, right hand, feet, and tongue) of eight subjects individually. DispEn performance (p < 0.05) can provide an overview of the activities from each subject showing significant differences in right-hand values for Subjects 1 and 5 (RH S1,5 ); however, Subjects 1 and 2 could be differentiated through left hand and foot, respectively. Further inspection of the results showed significant differences in feet values for Subjects 2, 7, and 8 (F S2,7,8 ), and significant differences for Subjects 3 and 9 in left-hand values (LH S3,9 ); whereas, for Subject 9, significant differences in tongue (T S9 ) can be obtained during MI-BCI rehabilitation tasks.

Results of Classification Stage
FD and Hur complexity features and TsEn and DispEn irregularity features were combined into the CompEn integrated set due to effectiveness from the previous stage. Then, SVM, KNN, and RF were the three classifiers utilized to evaluate the performance of the CompEn integrated set of features.
The findings displayed in Table 7 clearly demonstrate that the KNN and RF classifiers were superior to SVM, with RF scoring slightly higher than KNN. Subject 5 has the highest accuracy overall, with a score of 87.27%, indicating a higher possibility of recovering from a stroke. KNN and RF classifiers provided the highest accuracy for Subject 1. SVM provided acceptable accuracy for the tongue class but inadequate accuracy for the other classes ( Figure 8). For Subject 2, KNN and RF have similar results. With SVM only giving a good to moderate accuracy for RA, the best accuracy for LA is KNN, while RA, foot, and tongue is RF (Figure 9). For Subject 2, KNN and RF have similar results. With SVM only giving a good to moderate accuracy for RA, the best accuracy for LA is KNN, while RA, foot, and tongue is RF (Figure 9).  For Subject 3, the best results were the RF and KNN, respectively. While SVM gave faulty results except for RA, the best accuracy for the foot is KNN, while LA, RA, and tongue are RF (Figure 10). For Subject 3, the best results were the RF and KNN, respectively. While SVM gave faulty results except for RA, the best accuracy for the foot is KNN, while LA, RA, and tongue are RF ( Figure 10).  For Subject 5, RF and KNN have the best accuracy, while SVM only has good accuracy for RA. However, KNN has the best accuracy for RA, while RF has the best accuracy for LA, foot, and tongue ( Figure 11). For Subject 5, RF and KNN have the best accuracy, while SVM only has good accuracy for RA. However, KNN has the best accuracy for RA, while RF has the best accuracy for LA, foot, and tongue ( Figure 11). For Subject 5, RF and KNN have the best accuracy, while SVM only has good accuracy for RA. However, KNN has the best accuracy for RA, while RF has the best accuracy for LA, foot, and tongue ( Figure 11). The results for Subject 6 are good for RF and KNN, but poor for all classes for SVM. While KNN has good accuracy in LA, RF provided the greatest results for the RA, foot, and tongue ( Figure 12). The results for Subject 6 are good for RF and KNN, but poor for all classes for SVM. While KNN has good accuracy in LA, RF provided the greatest results for the RA, foot, and tongue ( Figure 12). Although tongue received acceptable accuracy from all three classifiers, LA, RA, and foot received poor accuracy from all three, with SVM receiving the best accuracy. The most accurate technology overall is still RF (Figure 13). Although tongue received acceptable accuracy from all three classifiers, LA, RA, and foot received poor accuracy from all three, with SVM receiving the best accuracy. The most accurate technology overall is still RF (Figure 13). KNN has generally good accuracy with foot and tongue for Subject 8. SVM only has good accuracy in foot, whereas RF also achieves acceptable results (Figure 14).  KNN has generally good accuracy with foot and tongue for Subject 8. SVM only has good accuracy in foot, whereas RF also achieves acceptable results ( Figure 14).
(c) KNN has generally good accuracy with foot and tongue for Subject 8. SVM only has good accuracy in foot, whereas RF also achieves acceptable results (Figure 14). For subject 9, KNN and RF provided moderate and comparable accuracy, whereas SVM provided inadequate accuracy ( Figure 15). For subject 9, KNN and RF provided moderate and comparable accuracy, whereas SVM provided inadequate accuracy ( Figure 15).

Conclusions
This investigation endeavors to encourage the way toward characterizing the emotional EEG based on MI-based BCI rehabilitation from the basic EEG channels. Twenty-two channels were utilized to record the EEG signs of four classes (left hand, right hand, feet, and tongue). In the present study, ICA has been used as a denoising technique, complexity features using and , and irregularity parameters including and were computed from each EEG channel. Two-way ANOVA has been

Conclusions
This investigation endeavors to encourage the way toward characterizing the emotional EEG based on MI-based BCI rehabilitation from the basic EEG channels. Twenty-two channels were utilized to record the EEG signs of four classes (left hand, right hand, feet, and tongue). In the present study, ICA has been used as a denoising technique, complexity features using FD and Hur, and irregularity parameters including TsEn and DispEn were computed from each EEG channel. Two-way ANOVA has been performed to characterize the MI-based BCI rehabilitation performance. LE dimensionality reduction algorithm was used to reduce the CompEn integrated feature set dimension. SVM, KNN, and RF classification algorithms were applied to enhance the performance of the MI-based BCI systems for stroke patients using EEG signal processing. There are several limitations on this study that need to be made clear. The sample size was small, to start with. Additionally, the patients' follow-up was not extensive. In addition, longer series with follow-up are required. Despite these limitations, all of our findings agree with those of other researchers who have made useful discoveries. RF was the best with 74.48% average accuracy of multiple performance measures, obtaining good classification results for all subjects. However, KNN classifier exhibits better results with 73.20% average accuracy compared to the SVM. Therefore, using an LE dimensionality reduction method has many benefits, including simplified computation complexity and enhanced feature extraction. Consequently, the proposed framework utilizing ICA denoising method, complexity, and irregularity features, classifiers, particularly the RF technique, were a crucial role in enhancing BCI-based stroke patients' rehabilitation. Therefore, results suggest that BCIs can be a helpful tool in the treatment of motor deficits. For those with a spinal cord injury, a BCI-controlled neuroprosthesis can restore the use of their upper extremities; for those who have suffered a stroke, a BCI-triggered visual or neuroprosthesis based on functional electrical stimulation (FES) can encourage their own recovery. In order to move forward with widespread implementation of BCI-controlled neuroprostheses, it must be established beyond reasonable doubt that the experimental results obtained in a controlled laboratory setting can be reliably reproduced under real-world conditions with minimal loss of performance and stability. There are tasks related to this research that need to be improved and can be further applied to obtain better identification of motor imagery (MI) tasks. Some ongoing and future directions of extending the research are outlined as: firstly, channel selection can be applied to point the most efficient electrodes. Secondly, another possible research direction is the application of the empirical mode decomposition method (EMD) as a denoising technique. Thirdly, other classifiers using deep learning methods can be considered to compare the classification performance.