BRAIN-COMPUTER INTERFACE FOR POST-STROKE REHABILITATION

In the paper we proposed the approach for increasing of quality of neurorehabilitation of post-stroke patients based on wavelet analysis of EEG signals recoded during motor imagery. Also we proposed brain-computer interface based on the method. We determined all necessary procedures required to find motor imagery type (kinesthetic or visual) for each individual patient and described subsequent rehabilitation process. We tested developed brain-computer interface on 20 participants with post-stroke motor impairment. We believe that developed system can be used not only in laboratory experimental conditions, but also in clinical ones.


Introduction
Rehabilitation of patients with motor disorders is undoubtedly a highly important task. The successes of neurosurgical practice and pharmacology save a large number of patients, while social and medical rehabilitation services aid them in adaptation to normal life conditions. No more than 15-20% of stroke survivors can return to their previous quality of life. The rest remain disabled people of varying severity with need of medical and social support [Thrift et al., 2017;Bèjot et al., 2016;Carod-Artal, 2012]. The most common consequences of strokes are motor disorders in the form of hemiparesis or monoparesis, observed in 80% of patients after a cerebrovascular accident -in half of them the pathology persists for life. Over the past decades, the necessary duration, intensity and choice of rehabilitation methods after various types of stroke disorders have been the subject of heated discussion, and the effectiveness of rehabilitation processes still raises many questions, especially during transition from laboratory experimental conditions to clinical ones [Choo et al., 2018;Langhorne et al., 2018;Laver et al., 2017].
However, on average, patients who survived after a stroke recover no more than 70% of their total motor functional [Langhorne et al., 2011;Tse et al., 2017]. At the same time, at least 40% of survivors after a stroke show moderate impairment and 15-30% -serious impairment, which in the future require special help and care [Carod-Artal and Egido, 2009]. The process of choosing approaches to rehabilitation significantly depends on the characteristics of the dysfunctions that have arisen, the patient's psycho-emotional state and his/her needs, as well as the specific functional goals that are set after a stroke.
Today, there is a wide variety of diverse techniques for working with post-stroke patients, the success of which can vary quite a lot in different cases [Van Peppen et al., 2004]. It is assumed that the use of classical passive techniques (massage, physiotherapy, etc.) loses in the achieved indicators to modern rehabilitation methods with biological feedback from the patient, involving the activation of motor or sensory functional zones, including mirror activation processes [Simpson et al., 2019;Cervera et al., 2018;Ekerete et al., 2018;Bernhardt et al., 2017]. For example, excellent results are demonstrated in works related to the use of exoskeletal devices [Frolov et al., 2018;Ren et al., 2017;Kawase et al., 2017]. However, such technologies based on robotic devices are expensive and require highly qualified service.
At the same time, simpler methods of motor imagery, that can be used without the need for expensive additional equipment, also give significant results in increasing the overall cognitive background and in the process of teaching patients with lost functional capabilities after a stroke [Guerra et al., 2017]. Moreover, there are developed neurological recommendations, (for example, [Dunsky and Dickstein, 2018]) on the application of the motor activity imagination in rehabilitation activities. The use of such techniques is very promising since it provides, for example, the possibility of home use, convenience and safety factors for use in early rehabilitation. However, there is still a lack of clarity in understanding the process of motor imagery itself. For example, the question remains: how is the imagination of motor activity carried out, in particular, how does the activation of the kinesthetic, visual or any other system in the human brain occur [Maksimenko et al., 2018a;Chholak et al., 2019;Pavlov et al., 2019;Grubov et al., 2017].
The present paper proposes the mathematical method for recognition brain states corresponding to motor imagery for neurorehabilitation of post-stroke patients and brain-computer interface (BCI) based on it. The main goal is to develop proper algorithm for this BCI and to determine all necessary procedures required for testing/finding motor imagery type (kinesthetic or visual) for each individual patient and for subsequent rehabilitation process. This is especially important since BCI is planned to be used primarily in clinical conditions.

Participants and Experimental Design
The study included 20 subjects with motor impairment with the first diagnosis cerebral infarction, acute period, confirmed by neuroimaging data. Patients included in the group of subjects had a diagnosis of atherothrombotic cerebral infarction in the pool of the left or right middle cerebral arteries. The main neurological deficit was represented by hemiparesis on the left or right side. The time from the onset of the disease to the study was 5 ± 2 days. Motor impairment was assessed according to the British Muscle Strength Rating Scale with 2 ± 1 points as average result across subjects. The main criterion for inclusion in the experimental group was the stability achieved by the patient in the post-stroke state. The average age of the studied participants was 63.7 years in the range of 59-72.
All volunteers provided informed written consent before participating in the experiment. The experimental procedure was performed in accordance to the Helsinki's Declaration and approved by the local Ethics Committee of the Saratov State Medical University named after V.I. Razumovsky.
For each subject, the electrical activity of the brain was registered by recording an electroencephalogram (EEG) [Niedermeyer and da Silva, 2014]. Also we used standard monitor screen faced to the patient as an instrument to provide any necessary audio or visual biological feedback . To record the EEG, a monopolar registration method was used along with the expanded arrangement of EEG electrodes according to the "10-10" system, which allows one to evaluate the activity of the cerebral cortex in all major zones (see Fig.  1A).
To register the EEG data, we used cup adhesive Ag/AgCl electrodes placed on the "Ten20" paste. Before the start of experiment, we used abrasive "NuPrep" gel to increase the conductivity of the skin and reduce its resistance. The impedance for each EEG electrode was measured and monitored during the experiment. Common impedance values varied within the 2-7 kΩ interval. The ground electrode N was located above the forehead and reference electrodes A1 and A2 were located on the earlobes. Recorded EEG signals were filtered by a bandpass filter with cut-off points at 1 Hz (HP) and 100 Hz (LP) and by a 50-Hz notch filter.
The task during the experiment was to imagine specific hand movements during corresponding stimulus. The participants were instructed to imagine hand movement as curling and uncurling the fingers towards the palm, similar to clenching an imaginary ball [Batula et al., 2017] (see Fig. 1B). Each stimulus consisted of two audio signals and pause between them. The first audio signal in each stimulus was a mark for the subject to start motor imagery. We used two types of audio signals -short for the left hand movement ("beep1") and long for the right hand movement ("beep2"). The participant should imagine motor activity until the second audio signal (of the same type as the first one) . After the second signal motor imagery stopped and the subject rested until the start of the next stimulus (block of two signals with pause between them). Stimuli for left and right hand motor imagery were presented in random order, length of time intervals for motor imagery (∆t lh,rh ) and rest (∆t r ) varied in range of 8 − 10 s. Both of these features were added to prevent subject's adaptation to rhythmic stimuli. Experimental design is illustrated by Fig. 1C.

Continuous Wavalet Analysis
We have analyzed the EEG signals using the continuous wavelet transform (CWT) which is now widely used in neuroscience and neurophysiology [Hramov et al., 2015]. The instant wavelet energy spectrum E n (f, t) = W n (f, t) 2 was calculated for each EEG channel X n (t) in the frequency range f ∈ [1, 40] Hz. Here, W n (f, t) is the complex-valued wavelet coefficients calculated as [Pavlov et al., 2012] Figure 1. Experimental setup: brain with EEG electrodes positioned according to "10-10" system (A), illustration of required hand movement (B), design of experiment (C).
where n = 1, ..., N is the EEG channel number (N = 31 being the total number of channels used for the analysis) and "*" defines the complex conjugation. The mother wavelet function ψ(f, t) is the Morlet wavelet often used for the analysis of neurophysiological data, defined as [Pavlov et al., 2012;Hramov et al., 2015] ψ(f, t) = f π 1/4 e jω0f (t−t0) e f (t−t0) 2 /2 , where ω 0 = 2π is the central frequency of the mother Morlet wavelet.
The total frequency range of f ∈ [1, 40] Hz can be divided into the frequency sub-ranges: delta (1-4 Hz), theta (4-8 Hz), alpha (8-13 Hz), beta (13-34 Hz), and gamma (34-40 Hz) bands [Keirn and Aunon, 1990]. According to our previous works [Chholak et al., 2019] we concentrated on two particular sub-ranges: alpha (α) and beta (β). For these bands the values of instant wavelet energy E n α (t) and E n β (t) for each n-th EEG channel were calculated as As the next step we averaged instant wavelet energy E n α,β (t) over time intervals ∆t before and during motor imageryĒ where k is the index of particular time interval. According to studies there is correlation between various types of motor activity and excitation of primary sensorimotor area [Pichiorri et al., 2018;Seeber et al., 2015;Maksimenko et al., 2018b] (EEG channels: FT8, Fc4, Fcz, Fc3, FT7, T4, C4, Cz, C3, T3, TP8, Cp4, Cpz, Cp3, TP7). However, studies on motor imagery [Pfurtscheller et al., 2006] show that examined brain area can be further constricted to three EEG channels: C4, C3, Cz. So as the next step we averagedĒ n α,β over three EEG channels of sensorimotor area where n is the number of the channel from the set: C4, C3, Cz and N SRM = 3 is overall number of examined sensorimotor area channels. Then as the final step e α,β was additionally averaged over a number of time intervals related to each type of motor imagery -left or right hand where k is the index of particular time interval, K is overall number of time intervals.

Results
According to our previous studies on motor imagery [Chholak et al., 2019] and known rehabilitation techniques [Dunsky and Dickstein, 2018] we can propose the method for neurorehabilitation of post-stroke patients and brain-computer interface (BCI) based on it. Method includes evaluation of event-related synchronization/desynchronization (ERS/ERD) [Takeuchi et al., 2015] in alpha and beta frequency ranges on EEG. It is known, that kinesthetic motor imagery is tied to ERD in alpha range and less pronounced ERD in beta range, while visual motor imagery is accompanied by ERS in the same frequency ranges [Chholak et al., 2019]. In the proposed method presence of ERS/ERD in alpha and beta frequency ranges is used to determine the type of motor imagery and to adjust subsequent training (rehabilitation) process.
Algorithm of BCI is illustrated on Fig. 2 and its design implies presence of two main parts: "testing" and "training/rehabilitation". "Testing" block (see upper part of Fig. 2) of BCI is used to determine type of motor imagery (kinesthetic or visual) for each individual patient. This block includes demonstration of number of stimuli for hand motor imagery, EEG recording, CWT-based analysis of EEG signals recorded during this tasks and computation of characteristics to determine type of motor imagery. During "testing" 10 stimuli for each hand are presented in random order to obtain EEG data during motor imagery. This data is analyzed with CWT-based methods and characteristics e I,II α,β (see Eq. 5) are calculated for two types of time intervals: ∆t before the first audio signal (I) and ∆t after the first audio signal (II). In this case ∆t was chosen to be 2 s since time interval of such length is enough to detect significant changes in wavelet energy in alpha and beta frequency ranges. Analysis of differences ∆e α,β = e II α,β − e I α,β provides information about ERS/ERD in given frequency ranges since positive value of ∆e α,β would correspond to ERS and negative value -to ERD. Then ∆e α,β were averaged over K = 20 trials of motor imagery to obtain ∆ē α,β (see Eq. 6) to assess overall dynamics across all "testing" session.
Results of "testing" procedure for one of the patients are shown in Table 1. From Table 1 one can see that values of ∆e α,β vary from trial to trial, however, averaged values (characteristics ∆ē α,β ) are negative. These results suppose presence of ERD in both alpha and beta frequency ranges on EEG during motor imagery, which leads to safe assumption that the patient has kinesthetic type of motor imagery. Knowledge of motor imagery type allows us to properly tune the criteria used in subsequent "training/rehabilitation" session. For example, if patient demonstrates kinesthetic motor imagery (as in this case) we should use criterion 1 (∆e α < 0) and criterion 2 (∆e β < 0) since fulfilling them will correspond to proper kinesthetic motor imagery. In case if patient shows tendency to visual motor imagery there are two options. The first one is to give patient proper instructions on kinesthetic motor imagery and repeat "testing" procedure. If it doesn't work the second option is to use reversed criteria (∆e α > 0, ∆e β > 0 ) that are correspond to visual type of motor imagery. However, efficiency of neurehabilitation with the help of visual motor imagery is questionable.
There is a pause between "testing" and "training" sessions that is used for patient's rest and for CWT analysis of recorded EEG data. The length of the pause can vary in range of 2-5 minutes according to the patient's state. This time interval is sufficient for EEG-related computations since we use parallel computing technologies for CWT-based analysis [Grubov and Nedaivozov, 2018].  Fig. 2) is used to conduct rehabilitation procedure. During this procedure stimuli for left and right hand motor imagery are demonstrated in random order. We perform CWT-based analysis online for each trial of motor imagery and calculate characteristics ∆e α,β . Then we check the fulfillment of chosen criteria and provide feedback to patient. As one can see from Fig. 2 criterion 1 is the first one to be checked since presence of ERD in alpha frequency range is the determinative factor of proper kinesthetic motor imagery. If criterion 1 is not fulfilled we assume that motor imagery wasn't successful, so we show "Try again" message on the screen as a feedback to patient. If criterion 1 is true then we check criterion 2 -if it is fulfilled then motor imagery was properly done and we demonstrate "Excellent work" message to patient. If criterion 2 is not true, then motor imagery was successful to some degree, however, it can be improved, so feedback in this case is "Good work". Results for "training" procedure for one of the patients are shown in Table 2.

Conclusion
In this paper we proposed the new method for recognition of motor imagery for post-stroke neurorehabilitation based on CWT-analysis of EEG signals recorded during motor imagery tasks. We determined all necessary procedures required to find motor imagery type (kinesthetic or visual) for each individual patient. Also we described subsequent rehabilitation process with means to provide feedback for patient. We tested developed braincomputer interface on 20 participants with post-stroke motor impairment.
The results of these studies appear promising for further fundamental research and practical application. Developed system is customizable to individual features of each post-stroke patient, which can be used to adopt this BCI for other types of neurohabilitation or healthy subject's training. We also believe that developed system is all-sufficient to be used not only in laboratory experimental conditions by scientific researchers, but also in clinical conditions by medical staff.