Explainable Deep-Learning Prediction for Brain–Computer Interfaces Supported Lower Extremity Motor Gains Based on Multistate Fusion

Predicting the potential for recovery of motor function in stroke patients who undergo specific rehabilitation treatments is an important and major challenge. Recently, electroencephalography (EEG) has shown potential in helping to determine the relationship between cortical neural activity and motor recovery. EEG recorded in different states could more accurately predict motor recovery than single-state recordings. Here, we design a multi-state (combining eyes closed, EC, and eyes open, EO) fusion neural network for predicting the motor recovery of patients with stroke after EEG-brain-computer-interface (BCI) rehabilitation training and use an explainable deep learning method to identify the most important features of EEG power spectral density and functional connectivity contributing to prediction. The prediction accuracy of the multi-states fusion network was 82%, significantly improved compared with a single-state model. The neural network explanation result demonstrated the important region and frequency oscillation bands. Specifically, in those two states, power spectral density and functional connectivity were shown as the regions and bands related to motor recovery in frontal, central, and occipital. Moreover, the motor recovery relation in bands, the power spectrum density shows the bands at delta and alpha bands. The functional connectivity shows the delta, theta, and alpha bands in the EC state; delta, theta, and beta mid at the EO state are related to motor recovery. Multi-state fusion neural networks, which combine multiple states of EEG signals into a single network, can increase the accuracy of predicting motor recovery after BCI training, and reveal the underlying mechanisms of motor recovery in brain activity.


I. INTRODUCTION
S TROKE is the leading cause of adult disability [1].
Post-stroke patients often experience motor disorders, which result in long-term disabilities in their daily lives [2].The effectiveness of specific rehabilitation training methods varies among patients [3].Robust prognostic models that can reasonably predict the efficiency of particular rehabilitation treatments are lacking and could help to guide clinical decision-making.
Various rehabilitation methods have emerged to improve the motor function of post-stroke patients [4].Brain-computer interfaces (BCI) have shown the ability to improve post-stroke motor function [5], [6], Moreover, BCI rehabilitation training can improve the recovery of brain neural activity [5], [7], [8].However, despite some efficacy, there is substantial variability in outcomes after rehabilitation training [9], due to the inter-individual in recovery [10], [11].Researchers have recently used machine learning or deep learning methods to attempt to predict the potential for gains in motor function in post-stroke patients undergoing specific rehabilitation training paradigms [12], [13], [14].Those prior studies indicate that machine learning or deep learning methods applied to EEG brain signals can predict the potential for motor function gain for patients undergoing specific rehabilitation paradigms [12], [13], [14].
Patients with severe deficits after stroke who have experienced a loss of both motor function and cognitive ability, often face difficulties participating in tasks (motor or cognitive) [15].In these cases, brain signals measured during resting-state become essential and could help with prediction.Recent studies have shown that the eyes-closed and eyes-open resting states have distinct features based on founding from EEG and MRI measurements [16], [17], [18].Moreover, the EEG features in those two states show different relationships in predicting post-stroke patient motor recovery [19], [20], [21].Specifically, an EO resting state study shows that the signal is related to upper extremity motor recovery [20].Also, a longitudinal study shows that EC state EEG signals are related to stroke patient motor recovery [22].Based on these prior studies, we hypothesize that including both EC and EO resting states would increase the prediction accuracy in developing the motor recovery gain prediction model in post-stroke patients as opposed to including EEG from a single state alone.
To date, no methods have been established to consider the multi-state fusion in post-stroke patient motor recovery outcome prediction and the neurological explanation of the states with motor recovery.
In this study, our objective is to develop a deep learning system that utilizes multi-state (EC and EO) EEG signals to accurately predict the motor recovery of patients following BCI rehabilitation training.Additionally, we describe a methodology for visually interpreting the predicted inputs, which can be presented to medical professionals and neurologists.By providing personalized recovery factors specific to each patient, along with elucidating the influence of various factors on motor recovery, we aim to enhance the understanding of mechanisms underlying motor recovery.A workflow outlining the study's overview is depicted in Fig. 1.

A. Participants
This study adhered to the Health Insurance Portability and Accountability Act, was approved by the Institutional Ethics Committee of Tsinghua Chang Gung Hospital, was conducted in accordance with the principles outlined in the Declaration of Helsinki (18172-0-01), and was registered as a clinical trial (ChiCTR2000030108).
Between May 2019 and May 2022, a total of twenty-two stroke patients were recruited from the department of rehabilitation at Beijing Tsinghua Chang Gung Hospital.Prior to their eligibility assessment, written informed consent was obtained from each participant, and no adverse events related to the study were observed.The study's inclusion criteria required that (1) participants must have experienced their first cerebrovascular accident, and (2) the onset of the stroke must have occurred within 90 days.Patient information is presented in Table I.Additionally, (3) the age range of participants was limited to individuals between the ages of 18 and 75, and (4) participants were required to be in a stable state During the initial clinical evaluation session, all participants' conditions were assessed using the following functional assessments: The Fugl-Meyer Assessment of Lower Extremity (FMA-LE), which serves as the evaluative standard for measuring lower limb sensorimotor recovery (scored from 0 to 34 points, ranging from hemiplegia to healthy); the Berg Balance Scale (BBS), used to assess participants' balancing function (scored from 0 to 56 points, ranging from imbalance to balance); the Postural Assessment Scale (PASS), a 12-item performance-based scale used to assess and monitor postural control following stroke (scored from 0 to 36, ranging from worst to normal); and the Activities of Daily Living (ADL) scale, which describes the fundamental skills required to care for oneself independently (scored from 0 to 100, ranging from worst to normal).

B. Experimental Paradigms
All participants were asked to participate in two experimental sessions: a 3-minute eye-open resting-state session and a 3-minute eye-closed resting-state session.Sound cues were utilized as reminders to the participants to initiate the sessions.At the end of the 3-minute recording, an end sound cue was presented.The computer marked both the start and end labels during the experiment session.To eliminate any potential brain activation induced by the sound cue, the first 20 seconds after the start label were excluded, as shown in Fig. 1a.
The experiments were conducted in a sound absorption room at the hospital, with standard ceiling lighting.Participants were seated in front of a white wall at a distance of 1 meter and instructed to remain stable, quiet, and to try not to think of anything or relax.The instructor started the experiment once the participant was ready.

C. Labeling of the Development Datasets
The output of this model is the classification of whether the stroke patient can recover over 30% based on effective recovery, which based on our dataset the number of the maximum effectivity recovery is roughly 60 and the minimum number of effectivity recovery is 0. Therefore, the middle number 30 is the boundary we selected from all the data to classify the good and poor recovery.This is defined as the difference between predicted and observed improvement from the initial assessment to the assessment after intervention Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.[23], [24].The effectivity recovery is the Fugl-Meyer score that stroke patients achieve after rehabilitation training, minus their original score, divided by the maximum score (health) minus their original score.The effectivity recovery can reveal the relationship between the factors and outputs within the group [25].

D. Treatment
Twenty-two stroke patients underwent a rehabilitation program consisting of the lower limb brain-computer interface rehabilitation method (BCI-LE), which involved 10 sessions over two weeks (five times a week for 30 minutes per session) as shown in Fig. 1c.
The BCI-LE robot is based on an ankle stretching robot, which has been clinically used and was modified by adding an EEG acquisition and computer system to assist in passive movement of stroke patients' lower limbs [26].This robotic device facilitates dynamic stretching of the ankle, moving from dorsiflexion to plantarflexion.During the robot-assisted ankle stretching training, participants were required to feel the ankle movement as the robot moved from dorsiflexion to plantarflexion.Detailed information on this ankle-stretching robot can be found in a previous article [27].In this study, we added a computer system capable of detecting the EEG ankle movement motor imagination signal.Once the system detects the activation of the lower limb motor imagination brain signal, the ankle stretching robot assists the stroke patient in completing the ankle movement trail.
During the BCI-LE rehabilitation training, participants were seated in a wheelchair or comfortable chair and instructed to focus on a sound cue.When the sound cue was presented, participants were asked to imagine lower limb movement from dorsiflexion to plantarflexion.

E. Neurophysiological Measurement
Neurophysiological measurement sessions would acquire all participants on their first come to the rehabilitation center.Neurophysiological signal, EEG, was recorded by 32-channels surface electrodes positioned according to the international 10/20 system using the NeuSen W (Neuracle tech., Changzhou., China).The EEG signals was sampling in 1kHz.

F. EEG Feature Extraction
The initial step in the processing of Raw EEG signals involved referencing the signals using an average reference and filtering them with a finite impulse response (FIR) bandpass filter within the range of 0.5Hz to 45Hz.Following this, independent component analysis (ICA) was performed on the EEG signals to eliminate any human artifact.Subsequently, the processed EEG data were segmented into 2-second intervals [28].A total of 29 channels were included, which comprised Fp 1, Fpz, Fp2, F3, F7, Fz, F4, F8, T7, FC5, FC1, C3, CP5, CP1, Cz, FC2, FC6, C4, CP2, CP6, T8, P7, P3, Pz, P4, P8, O1, POz, and O2.These channels were used to compute the power spectrum density and the functional brain network.To ensure consistency in our prognostic model and displayed results, EEG data collected from patients with lesions in the Left hemisphere (singular number) were mirrored to the corresponding channels in the Right hemisphere (even number) [29].
EEG power spectrum density was calculated by using a built-in function pwelch in MATLAB (R2021b, MathWorks, Natick, MA, USA).In this study, we customized the following pwelch function parameter.(1) The window used Hanning window for the 2-sec length.(2) The over-lapping in 1-sec length, and (3) no phase shift has been set.After the calculation function, each trial comes out from the function and all the trail from a single subject would be averaged into one matrix to avoid biased prediction from experimental error.Then the points from 1 to 90 have been selected which cover the EEG signal bands from the 0.5Hz to 45Hz.Therefore, the matrix size for EEG power spectrum density data is (29,90).The columns represent the 29 channels.The rows represent the EEG signal from each band.
In this study, a data augmentation technique was employed, wherein the results of EEG power spectrum density and EEG functional connectivity were subjected to z-score normalization [31].This method facilitates shifting and scaling of all data sets to a mean value of zero and a standard deviation value of one, respectively.As a consequence of the normalization, the prediction accuracy of the deep learning model was significantly improved [32].

G. Explainable AI
In a prior investigation, we developed a deep learning model utilizing a two-way convolutional neural network (CNN) to forecast a patient's potential for achieving proportional recovery [12].The two-way CNN model effectively extracts features from EEG power spectrum density and EEG functional connectivity to produce precise predictions.This model's architecture enables accurate target prediction using EEG.
In the current study, we constructed a multi-state fusion model based on the two-way CNN model architecture to anticipate a post-stroke patient's motor recovery performance after BCI rehabilitation training.This model passes power spectrum density and functional connectivites from EC and EO state into three layers of 2D-CNN with a Conv-BatchNorm-ReLU structure, respectively.For decoding the spectral signal, the kernel size was set to 3. For decoding the structural signal, the kernel size was set to 2. With the prediction result, we used a deep learning model explanation method, namely the SHAP value to calculate the important features from the model, as shown in Fig. 1b.
In order to determine which brain activity features the model utilized to differentiate between the good and poor recovery groups in two distinct states, we applied the additive feature attribution method to visualize the model.Specifically, we utilized the Shapley Additive explanations (SHAP) method, which is a mathematical approach for interpreting the predictions of deep learning models [33].SHAP leverages concepts from game theory to calculate the contribution of each feature to the prediction [34], thereby enabling the identification of the most significant features and their impact on the model's predictions.This includes assessing both positive and negative contributions to our inputs [35] and has shown the ability to explain physiological signals [36].
To evaluate the robustness of the deep learning model given the sample size of participants, we implemented the leaveone-out cross-validated (LOOCV) method.This approach generates a number of parameter sets equivalent to the number of datasets, each with its own unique set of SHAP values due to the use of distinct training sets.As each model predicts whether a participant belongs to the good or poor recovery group, with a gradient specific to its training set, we analyzed the SHAP values of the correctly predicted participants to determine the features that were significant within their respective groups.

H. Explanation Result to Neurophysiological Map
The model explanation results reveal the influential regions and bands related to motor recovery in both EC and EO states in EEG PSD and FC.To visualize the neurophysiological map from the numerical explanation value.We pre-process the SHAP values result to satisfy the EEG features mapping requirement.

A. Motor Recovery Prediction of BCI Rehabilitation Based on Multi-State Fusion Network
We extracted power spectrum density and functional connectivity data from each of the two EEG state signals.Our model (Fig. 2a) utilizes these variables, specifically the EEG power spectrum and EEG functional connectivity in the EC and EO states, as inputs to predict the motor recovery gain in stroke patients following a session of BCI lower limb training.The model's output is based on the change in Fugl-Meyer score after two weeks of BCI rehabilitation training and determines whether the patient is in the good recovery or poor recovery group.To avoid bias, each prediction is made using the leave-one-out cross-validation strategy, ensuring that the model training is dependent on input from other participants.
Our Multi-state fusion prognosis network, generated by the leave-one-out method, achieved an overall prediction accuracy of 81.81%.The confusion matrix of this multi-state fusion model showed 10 true positives (90.9%) and 8 true negatives (72.7%), in Fig. 2b.The precision of the multi-state fusion model was 0.77, while the recall value was 0.91, and the specificity value was 0.73.The receiver operating characteristic (ROC) curve, illustrated in purple color in Fig. 2e, depicts the model's values, and the area under the curve (AUC) value of the multi-state fusion model was 0.80.Moreover, we take first 1.5 minutes EEG state signal from both EC and EO as model inputs to avoid the effect from the recording length.The prediction result shows the same prediction accuracy which means the EEG signal would affect only by the state.
By using the EC state signal, the total prediction accuracy of the single state model was 63.63%.The precision of the model was 0.64, the recall value was 0.82, and the value of specificity was 0.55.ROC curve represented in red color in Fig. 2f, shows the values of the model, and the AUC value of the multi-state fusion model was 0.62.Similarly, by using the EO state signal, the total prediction accuracy of the single state model was 63.63%.The precision of the multi-state fusion model was 0.64, the recall value was 0.64, and the value of specificity was 0.64.The ROC curve with blue color in Fig. 2g represents the values of the model, and the AUC value of the multi-state fusion model was 0.62.These results demonstrate that the fusion of more EEG resting state signals (eyes closed with eyes open) provides better prediction results than using one state alone.
In summary, our multi-state fusion prognosis network, which utilizes two different EEG resting states, achieved the best prediction performance for prognosis of patient motor function following a session of lower-limb BCI training.

B. Neural Oscillations Relate to Stroke Patients' Motor Recovery Gain
The influential regions and bands related to motor recovery from EEG power spectrum density (PSD) in both EC and EO states were revealed through the model explanation result.The study found that the delta and alpha bands are essential for predicting motor gains in both EC and EO states (Fig. 3a-d).
The model considers the values of power spectrum density volts in delta and alpha bands as an important factor for prognosis.The deep learning explanation result in the delta band reveals the model considers the high PSD in the frontal area lesion side to be more important than the health side high PSD (Fig. 4a).Additionally, in the alpha band, the two-side parietal is the area of interest for the model to support its decision (Fig. 4b).The model considers the high PSD in the occipital region lesion side at EC state alpha band to be more important than the health side high PSD.The SHAP values result in the EO state also show that the delta and alpha bands are essential in determining a post-stroke patient's motor gain (Fig. 4c).In the EO state, the model explanation results represent the high PSD in the occipital region health side at the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.alpha band EO state as the determining factor for post-stroke subjects with good motor recovery (Fig. 4d).This result can also be found in the comparison of the poor recovery group and the good recovery group (Fig. 4e).On the other hand, in the poor recovery group, the entire occipital region in the delta band is a factor in the model's decision (Fig. 4f).
Overall, in both EC and EO states, the explainable results of deep learning show that the model considers the power value of the power spectrum density in the brain as an important factor for predicting lower extremity motor recovery gain of stroke patients with motor disabilities in BCI lower limb rehabilitation training.

C. Brain Functional Connectivity Related to Stroke Patients' Motor Recovery Gain
In the EC state, the results show that Alpha band functional connectivity contains the most information and the Theta band contains the second most weight, while Delta contains the third most value related to motor recovery in both the good recovery group and poor recovery group (Fig. 3e-h).In the EO state, the results show that the Theta band contains the most information and Mid-beta and Delta bands show second and third most weight related to motor recovery.Further, we visualize the FC in both states (EC/EO) corresponding with the subject from the difference in PSD.
In the EC state, functional connectivities between the frontal area and central area are related to motor function gain in Theta band.Also, cross and interconnectivities between lesion side central to health side central and occipital in Alpha band are important areas for model prediction.Specify in good recovery group at Theta band, cross hemisphere connection from lesion central to health side central and frontal is a factor for model prediction of participant motor function gain.The SHAP FC result in EO state shows that functional connectivities between frontal area and central area are also related to recovery in Theta band.Moreover, connections between pre-frontal area to occipital and frontal area to parietal area are contributors to our multi-state fusion model's prediction.To specify in good recovery, FC in lesion side frontal to occipital would decrease the probability of classifying the subject as a good group (Fig. 4g-h).

IV. DISCUSSION
The extraction of features from diverse and complex EEG signals of the brain offers the possibility for clinicians and researchers to create a highly effective motor prognosis system that could lead to personalized treatment recommendations for rehabilitation.Our study demonstrated that the use of a multi-state fusion model is more effective than using a single state alone in predicting post-stroke lower extremity motor disability gain after a BCI training session.In addition, a deep learning explanation method was employed to determine the most important regions and bands from the multi-state EEG signals that contributed to post-stroke motor gains.
Patients who experience motor disabilities after a stroke exhibit variable recovery patterns as well as responses to rehabilitative treatments [37].To address this issue, researchers have increasingly turned to machine learning or deep learning methods to enhance the accuracy of motor function recovery prediction.Studies have employed various deep learning structures, including CNN, recurrent neural networks, and long short-term memory to improve prediction accuracy [38].
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.Other studies have incorporated different neurophysiological signals, such as MRI [39].In this study, we propose a novel approach that utilizes EEG signals from two different states to predict motor recovery in stroke patients after treatment with two weeks of BCI-robotic training.Our deep learning multi-state fusion model considers the neural activation ability of patients in multiple task states, leading to more accurate predictions of future recovery.Similar advantages have been observed in other studies [29], [40], [41].For example, one study demonstrated the benefits of integrating pathology, radiology, and molecular data to predict cancer [40].Another study found that a multi-graph fusion model could improve prediction accuracy [41].Our prior research also revealed that combining biomechanical information and multiple EEG features can enhance the accuracy of motor function prediction [29].In summary, our multi-state fusion model holds the potential to predict lower extremity gains in post-stroke BCI training.The deep learning explanation method is also useful in analyzing the critical regions and bands associated with post-stroke patient motor recovery.Thus, our study offers a promising approach for improving the accuracy of motor function recovery prediction and personalized treatment recommendation engines for stroke patients.
The mechanisms underlying the recovery of motor function are critical and understudied.Previous studies have revealed that a correlation exists between low-frequency oscillations and the recovery of motor function through gripping task motor state brain PSD [42].Moreover, researchers have found that specific regions within low-frequency oscillations are associated with the recovery of motor function through resting-state brain features [43].Additionally, a connection has been found between FC and motor function recovery through the brain's EC state brain connectivity [44].Further research has identified a correlation between brain features and motor function recovery in patients using two brain feature extraction methods, namely EEG and MRI in resting-state [45].In this paper, we employ an interpretive approach to identify regions related to the multi-fusion model on post-stroke motor function recovery through two features: PSD and FC characteristics under two resting states (EC and EO).Our findings are consistent with prior neuroscience research, indicating that motor function recovery is related to low-frequency oscillations [42] and alpha-band neural oscillations [46].Specifically, the bilateral parietal, frontal, and occipital regions are related to patients' motor recovery from PSD features in both states.Our results also support the previous study's findings that EC state FC in Delta, Theta, and Alpha bands is related to motor recovery [47].Furthermore, an MRI alpha band FC study presented the same region in resting states preand post-treatment [48].Compared to previous research, our proposed approach can identify multiple neurophysiological features in multiple states related to motor function recovery simultaneously.As a result, this method can be used for future research to identify potential regions for motor recovery and establish correlations between these regions and rehabilitation.
Although the prediction accuracy and the explanation results are precise and reasonable, we still cannot fully conclude that the underlying mechanism is related to all kinds of poststroke patients.This is because of the small data size and the rigorous inclusion criteria.In the future study, we would further investigate wild-range post-stroke patients in different age ranges, measurement scores, and all other factors to apply this decision model to all kinds of post-stroke patients.

V. CONCLUSION
In conclusion, we have proposed a deep learning-based motor recovery prediction system for post-stroke patients who have participated in a session of brain-computer interface (BCI) lower limb rehabilitation training based on the multi-state fusion model.This model employs a multi-state EEG signal and model interpretation method, namely Shapley values.The improved prediction accuracy of this system demonstrates that the multi-state signal has the potential to enhance prognostic accuracy.Additionally, the explainable results suggest that Shapley values can be effectively applied in deep learning-based brain signal research.

Fig. 1 .
Fig. 1.Overview of the multi-state fusion deep learning prognosis model for stroke survivors.(a) In the experimental paradigm, participants were instructed to either close their eyes or keep them open at rest when the auditory cue is presented.During the experimental session, electroencephalography (EEG) signals were recorded continuously.(b) The recorded raw EEG signals were processed to calculate power spectrum density and functional connectivity features.These features were then being input into the multi-state fusion model to predict the participants' lower extremity motor gains after (c) two weeks of EEG-BCI-robotic training.

Fig. 2 .
Fig. 2. Architecture and performance of multi-state fusion model (a) Details of the multi-state fusion model and the single-state models for predicting lower extremity motor gains after Brain-Computer Interface training.Matrices with a star symbol on the head indicate that their architecture consists of a Convolution-Batch Normalization-ReLU activation function.(b-d) Confusion matrix results correspond to the Multi-state fusion model, eyesclosed state model, and eyes-open state model in percentage.(e-g) Receiver Operating Characteristic (ROC) curve, Area under the ROC curve, and Accuracy results correspond to each model.

Fig. 3 .
Fig. 3. Visualization of the significant neurological variables associated with lower extremity motor recovery in both the eyes-closed and eyes-open states.(a-b) In the good recovery group, the important bands in the average power spectrum density during the eyes-closed resting state are in the delta and alpha bands, while during the eyes-open resting state they are mostly in the delta band.(c-d) In the poor recovery group, the important bands in the average power spectrum density during the eyes-closed resting state are in the delta and alpha bands, while during the eyes-open resting state they are mostly in the delta band.(e-f) In the good recovery group, the important bands in the average functional connectivity during the eyes-closed resting state are in the delta, theta, and alpha bands, while during the eyes-open resting state they are in the delta, theta, and beta mid bands.(g-h) In the good recovery group, the important bands in the average functional connectivity during the eyes-closed resting state are in the delta, theta, and alpha bands, while during the eyes-open resting state they are in the delta, theta, and beta mid bands.

Fig. 4 .
Fig. 4. Individual neurological variables associated with lower extremity motor recovery.Within-Group Comparison (a) Original power spectrum density and significant variables in the delta band during the eyes-closed resting state for subjects 2 and 3 in the good recovery group.(b) Original power spectrum density and significant variables in the alpha band during the eyes-closed resting state for subjects 3 and 4 in the good recovery group.(c) Original power spectrum density and significant variables in the alpha band during the eyes-open resting state for subjects 3 and 4 in the good recovery group.(d) Original power spectrum density and significant variables in the delta band during the eyes-open resting state for subjects 5 and 10 in the poor recovery group.Between-Group Comparison: (e) Original power spectrum density and significant variables in the alpha band during the eyes-closed resting state for subject 7 in both the good and poor recovery groups.(f) Original power spectrum density and significant variables in the delta band during the eyes-open resting state for subject 4 in the good recovery group and subject 1 in the poor recovery group.(g) Significant variables in functional connectivity in the delta, theta, and alpha bands during the eyes-closed resting state for subject 7 in both the good and poor recovery groups.(h) Significant variables in functional connectivity in the delta, theta, and beta mid bands during the eyes-open resting state for subject 1 in both the good and poor recovery groups.