LiDAR-Based Hand Contralateral Controlled Functional Electrical Stimulation System

Contralateral controlled functional electrical stimulation (CCFES) can induce simultaneous movements in patients’ bilateral hands. It has been clinically proven to be effective in improving hand motor control and dexterity. sEMG and bending sensor-based data gloves for detecting patients’ motor intent have been developed with limitations. sEMG sensor signals are unstable and susceptible to noise. Data gloves composed of bending sensors require complicated calibration and tend to have data drift. In this paper, a LiDAR-based system for hand CCFES is proposed. The method utilized LiDAR to detect the patient’s motion intention without contact in CCFES systems. It has been clinically proven that LiDARs can effectively distinguish the different motion amplitudes of hand gestures as quantitative evaluation sensors of functional electrical stimulation (FES). Training data for classifiers were collected from 9 healthy individuals and 15 stroke patients performing 4 gestures, including hand opening, fist clenching, wrist extension, and wrist flexion. The support vector machine (SVM), linear discriminant analysis (LDA), and k-nearest neighbor (kNN) were verified for their classification performance in offline hand gesture recognition tests. Experiments were also conducted on 6 stroke volunteers to evaluate gestures triggered by FES. The SVM classifier showed excellent classification performance for four hand gestures, with an average F1-score of 0.97 ± 0.05 in offline tests. As for online gesture recognition, an average F1-score of 0.92 ± 0.09 was obtained. In the evaluation experiments, between data from 50% and 100% movement amplitude, paired t-tests showed significant differences. The experimental results indicated that the proposed system showed promise for hand rehabilitation.


I. INTRODUCTION
S TROKE is a shared global healthcare problem, which causes motion function damage to patients and then leads to severe negative impacts on patients' quality of life [1]. Although patients can recover their motor control ability to a certain extent during the natural recovery period, they still have incomplete upper extremity function recovery [2]. In this case, upper extremity rehabilitation focuses on restoring affected hand function more effectively during or even after the natural recovery period. Appropriate rehabilitation can also help patients get back to normal life and improve their quality of life [3]. Lots of different stroke recovery treatments were utilized for hand rehabilitation, and functional electrical stimulation (FES) is one of them.
FES is a neurorehabilitation method that artificially activates the sensory and motor systems of the damaged central nervous system [4]. FES has been widely used to help patients restore motion function. However, many FES systems cannot motivate patients to complete the action subjectively. Those FES systems that take patients' volitional attempts into account require complicated signal processing [5].
Given the shortcomings of the above control strategies, Knutson et al. have proposed contralaterally controlled functional electrical stimulation(CCFES) [5]. Simply put, CCFES reproduces the movement of the upper limb on the hemiplegic side based on detecting an intentional attempt on the healthy side, thereby realizing the identical movement of the patient's bilateral upper limbs [6].
Currently, surface electromyography (sEMG) is a commonly used method in movement intention detection. Chen et al. applied sEMG sensors in subjects' volitional attempt detection on seven gestures, but only two healthy subjects were involved, with nearly 500ms delay [7]. In addition to sEMG sensors, other sensors were applied in CCFES systems. Knutson et al. proposed CCFES therapy with data gloves, mainly focusing on the hand opening gesture [5]. Ruiz-Olaya combined sEMG and inertial sensors to detect elbow and wrist motion [8]. However, mainstream sensors applied in CCFES systems have their limits. The sEMG signal is unstable and can easily be affected by noise, such as human sweat and motion artifacts [9]. Data gloves usually consist of bending sensors, which rely on the resistance change to calculate the variation of bending angles. Temperature can cause data to drift in this piezoresistance-type transducer. The bending sensors are also fragile at the pin, which may lead to fatal breaking [10]. Inertial sensors have high measurement accuracy but also have drift problems. As inertial sensors have limited adaptability to This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ the palm [11], they are more often applied as supplementary ones to detect the motion of large joints.
The control strategies for FES in CCFES systems also have diversity, such as threshold-triggered, multiple-thresholdtriggered, and proportional mapping. The control strategies above are open-loop, which have no feedback or evaluation of FES effect. Lack of FES evaluation may cause excessive muscle fatigue and insufficient range of motion, thus reducing rehabilitation training efficiency and patient motivation [12]. In order to enable effective FES evaluation, sEMG sensors and data gloves are utilized. Zhou et al. put forward a wireless multichannel sEMG-FES system with a complex signal process to avoid real-time artifact removal, using the bias of the patient's bilateral sEMG signal as the feedback signal [13]. For data gloves, current studies lack quantitative metrics for instant evaluation [5], [14]. Wang et al. used data gloves to detect gestures triggered by FES, but without performance verification tests and a quantitative metric for the evaluation [14]. Studies involving various gestures should be conducted for effective hand rehabilitation and have a quantifiable FES evaluation.
In summary, current CCFES studies' main limitations lie in the fact that sensors are vulnerable to environmental influences, and lack evaluations of FES-triggered gestures. This paper proposes utilizing light detection and ranging (LiDAR) sensors for CCFES systems to address these shortcomings. LiDAR sensors are often applied for hand gesture recognition but are never used for hand rehabilitation. As a noncontact sensor, LiDAR can free patients from cumbersome and long-time equipment wearing. Thanks to Time-of-flight (TOF) algorithm, LiDAR is robust to surroundings and can easily achieve real-time effects without complex data processing [15], [16]. The advantages of easy setup, robustness, and real-time performance make LiDAR a suitable detection sensor for the motion intention of patients. LiDAR is also applied to assess FES-triggered gestures, helping to detect different motion amplitudes. Modulating the FES parameters can be based on feedback LiDAR signal, which will improve overall hand rehabilitation effects.
In this paper, a combination of LiDAR, CCFES, and an FES evaluation based on LiDAR is used to assist stroke patients with repetitive hand rehabilitation training. Section II illustrates the design of the LiDAR-based closed-loop CCFES system and the experiments which verify the feasibility of the system. Section III describes the results of the experiments. Finally, the last two sections presents the discussion and conclusion.

A. System Overview Description
This paper aims to develop a low-cost hand CCFES system based on LiDAR. Generally, the hardware structure can be divided into gesture recognition and FES modules. Fig. 1 displays the system's control block diagram. In the block diagram, the LiDAR collects gesture data from the healthy side of the patient. This data is classified online, and the result is delivered to the FES module. According to the classification result, the FES module activates the corresponding FES channel, enabling the hemiplegic hand to perform the identical movement as the healthy side. While the FES is in progress, the LiDARs continually gather gesture data from the bilateral hands, which allows the microcontroller unit (MCU) to make an appropriate evaluation of the movements triggered on the hemiplegic side by comparison. Below is a detailed illustration of gesture recognition and FES modules in the B and C subsections.

B. LiDAR-Based Motion Detection Module
The motion detection module's primary duties involve identifying the gesture from the healthy hand, controlling the FES module, and evaluating the movements induced on the hemiplegic side. According to the functional requirements mentioned, the K210 is selected as the MCU of the module. It utilizes the RISC-V architecture and runs at up to 400MHz, which fulfills the real-time requirements of the classification operations. In addition, the K210 possesses abundant peripherals, enabling communication with multiple devices.
Considering the required detection range of hands and cost control, a commercially available micro TOF LiDAR module is used to collect data (P8864-SMD-B15, SenkyLaser, Ltd., Shanghai, China). The LiDAR module is tiny, 18mm × 12mm × 4.49mm in size, and has a typical working distance of 0.1m to 2m, making it ideal for interior applications. Within the detection range, it measures distance information of 8 × 8 pixels.

C. Functional Electrical Stimulation Module
The FES module receives commands from the motion detection module and then turns on the corresponding FES channel. It mainly comprises the serial communication, boost circuit, and stimulation pulse generation section. The accumulation of charges on the skin surface brought by unipolar current stimulation can lead to unnecessary muscle fatigue or tingling [17]. In order to solve this issue, a bipolar stimulation waveform is utilized. In clinical applications, the pulse width of FES often ranges from 100µs to 500µs, and the frequency ranges from 10Hz to 50Hz [18]. The module parameters are designed to have the same modulation range. The pulse amplitude of FES should be high enough to trigger muscle contraction, and the maximum stands at 40 mA. Given that the resistance of the human forearm is approximately 1k [19], the module's output voltage can be adjusted from 5V to 40V. Therefore, the voltage of the stimulation generation section is supplied by the boosting circuit rather than the USB. The FES module provides eight stimulation channels to facilitate subsequent additions of rehabilitation gestures. The number of channels can be adjusted under different circumstances. Three gestures are chosen in the paper, namely hand opening, fist, and wrist extension. Each gesture corresponds to one FES channel and three stimulation channels are employed accordingly. Fig. 2 displays the block diagram for the module. The power circuit supplies power through a USB to allow the module to function correctly. As the MCU of the FES module, the STM32F103 micro-controller (STMicroelectronics, Inc., ITA&FR) interacts with the host devices, i.e., K210, via the communication module. The STM32F103 microcontroller activates the stimulation channels following the commands received from the K210, wherein the instructions include the FES frequency, pulse width, and channel number. Through the boost circuit, the voltage from the power circuit can be modulated to meet the requirements of the stimulation pulseproducing circuit. When the MCU enables the stimulation channel, the H-bridge circuit generating stimulation pulse can provide proper FES. A high-speed analog multiplexer CD74HC4067 (Texas Instruments, Inc., USA) is applied in the channel selection part to switch various stimulation channels quickly. Pairs of hydrogel electrodes are attached to the corresponding muscles of gestures, with a size of 4 × 4 cm.

III. METHODS
Experiments were conducted to construct a reasonable gesture classifier and verify the feasibility of the proposed system. Initially LiDAR data was collected to generate the gesture classifier. Then the online classification performance of the classifier was tested. The potential of LiDAR as an evaluation method of FES-triggered gestures was also validated.
The study recruited 21 stroke survivors with upper-limb mobility impairment. Fifteen of them participated in the LiDAR gesture data collection, and the others were involved in the evaluation experiments of FES-triggered gestures. Subjects were excluded if they had severe cognitive impairment or could not sit upright without human support. Cushions were used as trunk supports to help patients sit upright in the chair if necessary. Since the hand motor function of a stroke patient's healthy side is almost the same as that of a healthy person [20], data from healthy subjects can complement data from the patient's healthy side. Nine healthy participants with no history of neurological or mobility impairments participated in the experiments. All participants gave their informed consent before participation. The Guangzhou First People's Hospital Department of Ethics Committee gave its approval to the procedures (approval no. K-2019-064-01). Table I provides essential information for all participants.

A. Generation of the Gesture Classifier
LiDAR data were collected to generate a suitable gesture classifier. During the data collection procedure, participants sat comfortably in front of a table with their forearms supported. As illustrated in Fig. 3, the LiDAR was mounted on a shelf ahead of the table. The vertical distance between the tabletop and the LiDARs was 450mm. It allowed the subjects' hands to be fully exposed to the measuring range of LiDARs and for subjects to place their arms while sitting comfortably. The table was designed to be wide enough to facilitate rehabilitation training for wheelchair users.
Subjects were instructed to place their wrists off the table's edge to ensure their palm and wrist movements could be detected. They were required to place their hands on the pad for each data collection. Each subject performed four types of hand gestures: hand opening, fist clenching, wrist extension, and wrist flexion, as Fig. 4 shows. These are typical gross hand movements that FES can trigger [20]. Finer gestures are difficult to stimulate only by non-invasive FES. The restoration of finer hand motor function is based on the rehabilitation of gross motor function. Therefore, the gestures mentioned above were chosen for studies in this paper. Wrist flexion was seen as the natural rest gesture when subjects reached out their hands off the table's edge.
In order to simplify the data labeling, there were specific sequences for collecting the training data, starting with hand opening, then fist, wrist flexion, and wrist extension. Five trials were run for each gesture, and each trial lasted for 15s. Subjects had a 10s rest between trials. Instruction about gestures and how long they need to maintain the gesture was given to subjects before collecting the training data.
A total of about 18,000 frames of data were acquired for healthy participants and about 12,000 frames of data for stroke patients. The data was utilized for training the gesture recognition classifiers but not for online gesture classification. Fig. 5 shows a visualization image of the converted data hand opening gesture, fist clenching, wrist extension, and wrist flexion. The scale on the right side in Fig. 5 is millimeters, which indicates the distance between the LiDAR and the measured objects. Those pixels with light blue, indicating closer distance, show the projection of gestures onto the LiDAR, and pixels with dark blue are the projection of distant unrelated objects, for example, ceilings. Gathered data were processed using Python 3.8. The detailed data processing methods are illustrated in the following. 1) Feature Selection: As there were unrelated obstacles within the detection range of the LiDAR, distance data contained irrelevant pixel data. Considering that, feature selection was required to reduce redundant data. Random forest is an efficient algorithm for feature selection [21]. It focuses on the contribution of features to every tree. The Gini index was utilized to calculate the contribution, which can be calculated as: Random forest was adopted to select the most compelling features from 64 original features. Eight features with the most significant contribution were chosen for subsequent training of the classifiers. The original features were the depth information of the 8 × 8 pixels. Those pixels were represented by (x i , y i , d i ), where x i and y i denoted the lateral and longitudinal coordinates of the i th pixel, and d i was the distance value of the i th pixel. Fig. 6 depicts the features selected by random forest in the visualized images. As seen from Fig. 6, these features are discriminatory for different gestures.
Given that the statistical features for distance data with various gestures could differ, the following features were also added for classification: Count of the valid values, COV: Average valid values, AVV: Maximum of valid values, MaxOV: Minimum of valid values, MinOV: where d valid is the valid distance value of each pixel. Due to the design of the experimental table, the distance between participants' hands and the LiDAR should not surpass the threshold, which was the distance between the tabletop and the LiDARs. The LiDAR contains only the suitable pixels, which leads to slightly rough acquired data, and the values greater than the threshold may appear at the edge of the hands. Thus, valid distance data include pixel data that do not exceed the threshold and those marginally larger than the threshold. These four features (the average valid values (AVV), the count of the valid values (COV), the maximum of valid values (MaxOV), the minimum of valid values (MinOV), and eight features selected via Random Forest were extracted and supplied to train the different classifiers.
2) Classification: Normalization is required to avoid biasing the prediction results toward features with solid values, significantly improving the model's accuracy. The selected features are normalized with MinMaxScaler, having all feature values translated to a range of 0 to 1. The participants' gestures were categorized using a variety of machine learning algorithms, including linear discriminant analysis (LDA) [22], the k-nearest neighbor (kNN) classifier [23], and a support vector machine (SVM) [24]. Below is a synopsis of each algorithm.
Linear discriminant analysis (LDA) is based on Bayesian theory and applies the Gaussian distribution to build a class conditional density model [25]. It has a lower computational cost than other classifiers, and when combined with simple feature extraction, it can yield superior classification results [26]. The objective function can be expressed as: where S b is the interclass divergence matrix, S w is the sum of scatter matrices for each class and max W is the projection matrix with the best classification performance. The optimization solver for Eq. 6 was singular value decomposition. K-nearest neighbours (kNN) algorithm is a fundamental gesture classification algorithm that is simple but effective in many cases. The kNN aims to classify input data according to the closest training examples [27]. The distance between the input query point and the other training data points should be measured to determine which data points are most relative to a given query point. Here the distance is calculated using the Euclidean distance, which measures a straight line between the query point and the other points [28]. The Euclidean distance can be defined as: where n is the dimensional number of attribute vectors. A = (a 1 , a 2 , . . . , a n ), and B = (b 1 , b 2 , . . . , b n ) are attribute vectors. The kNN algorithm was run with various k values to pick the k value with the best classification performance. The values of k ranged from 1 to 15 at intervals of 1. Support vector machine (SVM) is a supervised machine learning model invented by Vapnik in the context of statistical learning theory [29]. The SVM algorithm attempts to establish the separation between two or more classes of objects, assuming that the greater the separation, the more reliable the classification [30]. It is extensively employed for small sample classification and has outstanding non-linear and highdimensional classification performance [31]. Also, it has high stability and is easy to train with few training parameters [32]. The kernel function chosen for the SVM classifiers was a radial basis kernel function, which can be expressed as: where f i and f j are two different feature vectors, K ( f i , f j ) is the kernel function of f i and f j , and γ parameter can be seen as the inverse of the radius of influence of samples selected by the model as support vectors [33]. Cross-validation and grid-search were implemented to optimize the hyperparameters selection. Nine extracted features, including the AVV, COV, MaxOV, MinOV, and eight features selected by Random Forest, were supplied to the LDA, KNN, and SVM algorithms separately. A five-fold cross-validation approach was used to train and evaluate all classifiers. The dataset was divided equally into five groups. Then the classifiers were trained in four groups, with the accuracy of the classifiers validated in the fifth group. The process continued until each data group was used as a test set [34].

B. Online Gesture Classification
Online tests of the generated classifier were conducted to verify its performance. The classifier that trained well on the PC was transplanted to K210, facilitating online classification and subsequent FES activation. Online gestures were classified in much the same way as during data collection, with subjects sitting comfortably at a table with their hand outstretched. Each gesture was held for about 30s, and there was a 30s rest between gestures. K210 classified the gestures in real-time based on the LiDAR data collected every 500ms and sent the results to a PC for display. The experiment procedure was illustrated to subjects before the online classification began, and subjects were allowed to perform the four gestures randomly during the experiment. This experiment phase involved six subjects who had participated in the gesture data collection in the earlier stage. In the training data collection, the data collected was utilized for training the classifiers and didn't go through online classification. While in the online gesture classification experiments, subjects performed gestures randomly, and the trained classifier delivered the gesture classification results in real-time.

C. Validation of Evaluation for FES-Triggered Gestures
Before we design the closed-loop controller based on LiDAR, we need to validate the LiDAR data can be used as feedback on FES-triggered motion amplitudes. The primary purpose of this part was to verify whether the disparity in data from bilateral LiDAR could discriminate different action amplitudes and whether it was sufficient to be used as an indicator for the evaluation of action produced by FES. The movement amplitudes for a given FES intensity have individual differences. Even for the same subject, the movement amplitudes can vary in different periods. Therefore, we need to evaluate if the desired movement amplitude is obtained in the open-loop FES. The placement of hydrogel electrodes is exhibited in Fig. 7. Based on the gestures, muscles that should be activated were determined. When FES parameters remain unchanged, the larger the amplitude of gestures that FES triggered, the better the FES effects were. The specific placements of hydrogel electrodes were chosen according to the subject's muscles. Electrodes were positioned on the extensor carpi ulnaris for wrist extension, the extensor digitorum for hand opening, and the flexor digitorum profundus for fist clenching.
Six stroke patients participated in the experiments. Before the experiment, the therapist determined stimulation parameters corresponding to 50% and 100% motion amplitudes for each subject. The pulse width of the FES ranged from 100µs to 500µs, the voltage amplitude from 5V to 40V, and the frequency from 10Hz to 50Hz. For all subjects, the pulse duration was set to be 5s on and 5s off. The exact parameters were chosen based on the three-point calibration method [35]. A 100% motion amplitude was defined as the maximum motion amplitude that the FES could trigger for the patients without causing pain. It was different for every patient since the actual effects of FES varied from person to person. As for 50% motion amplitude, it was half of the maximum motion amplitude. Since no additional sensors were used, distinguishing 50% motion amplitude was most straightforward with the naked eye after 100% motion amplitude was confirmed. In this case, 50% motion amplitude was adopted in the validation experiments. Using a classifier to classify different action ranges under the same gesture would make classifier training difficult. Considering real-time and accuracy requirements, the classifier was used for gesture recognition, and the feature COV was for differentiating movement amplitudes. The use of the feature COV made the movement amplitudes differentiation simple to calculate and reduced the difficulty of classifier training.   During experiments, subjects were required to perform the gesture with maximum motion amplitude on their healthy hands. Once gestures were detected, the FES module, which used an open-loop controller, generated a pre-defined FES to activate the muscles. With the stimulation activated, bilateral LiDAR data was gathered. Data was collected separately when stimulation triggered 50% and 100% motion amplitudes of hand opening, fist, and wrist extension. Wrist flexion was not included because there was a natural wrist drop when the wrist was placed off the edge of the table. Fig. 9 illustrates the experiment procedures. The therapist adjusted the FES parameters corresponding to 50% and 100% motion amplitudes for each subject before the experiment. Fig. 10 displays the average F1-score performance for each classification approach. The training data was collected from 24 subjects performing different gestures. The Friedman nonparametric test verified that the F1-score of classifiers for various participants differed (F = 13.77, p = 0.001 < 0.05). Following that, the Nemenyi post-hoc test was used to compare means pairwise. For α = 0.05, SVM and LDA (p = 0.001) exhibited statistically significantly different means. There was no statistically significant difference between SVM and KNN (p = 0.225) and LDA and KNN (p = 0.111). It indicated that SVM classifiers had the best classification performance for each participant (average F1-score = 0.96), followed by the KNN (average F1-score = 0.90) and LDA (average F1-score = 0.70).

A. Offline Classification Performance of Chosen Classifiers
Friedman non-parametric test revealed a statistically significant difference in F1 score among the selected classifiers for hand opening (F = 8.82, p = 0.012 < 0.05), fist (F = 14.11, p = 0.001 < 0.05), wrist extension (F = 13.77, p = 0.001 < 0.05), and wrist flexion (F = 6.46, p = 0.039 < 0.05). The SVM algorithm exhibited a higher average F1 (0.97 ± 0.05) than other classifiers in these four hand gestures. Those classification outcomes were employed as the foundation for choosing the machine learning method with the best performance. Therefore, SVM was selected as the final gesture recognition algorithm in the following experimental tests.
The classification performance of the stroke and healthy subjects' data are displayed in Table II after it was trained with the SVM algorithm. Here HO = hand opening, FT = fist, WE = wrist extension, WF = wrist flexion. The results demonstrated a generally good classification performance, with all F1-scores above 0.9. The best performance for recognizing hand gestures was obtained for hand opening, with a high F1-score for both stroke (F1-score = 1.00) and healthy participants (F1-score = 0.99). For hand opening (F1-score = 1.00 and 0.99), fist (F1-score = 0.96 and 0.94), and wrist extension (F1-score = 0.98 and 0.96), the classifier exhibited slightly better performance in stroke survivors than in healthy subjects. For wrist flexion, the classifier showed the same performance with an F1-score of 0.97. The SVM classifier achieved an average F1-score of 0.97, indicating outstanding classification performance for stroke and healthy subjects. Fig. 11 shows the gesture recognition performance of each class across six participants utilizing the SVM classifier in  11. Stacked bar graph of F1-scores from the SVM classifier for all classes and subjects in the online recognition tests. Participants were ranked according to the total value of the F1-score for four classes. The grey horizontal line represents a general cutoff for highly functional levels of classification performance (average F1-score > 0.9).

B. Online Classification Performance
the online tests. The minimum and maximum F1-score of the four gestures in all subjects were 3.46 and 3.91, respectively. An average F1-score over 0.9 was obtained for 4 out of 6 participants. The SVM-based classifier performed well in the multi-class classification with an average F1-score of 0.92. It detected the hand opening gesture with an adequate accuracy (F1-score = 0.98), followed by wrist flexion (F1-score = 0.96), wrist extension (F1-score = 0.90), and fist (F1-score = 0.83). Though the participants were of different gender and age, the Friedman non-parametric test indicated that differences in the F1-score across six participants were not statistically significant (F = 11.06, p = 0.051 > 0.05). Fig. 12 showed the COV of bilateral LiDAR data collected when participants underwent various levels of FES. FES parameters corresponded to 50% and 100% of the motion amplitude, respectively, while the motion amplitude of the healthy hand was maintained at 100%.

C. Validation Performance of LiDAR
The significant difference was tested by paired t-test. It revealed a significant difference in COV when FES triggered hand opening with 50% and 100% motion amplitude (T = −12.73, p < 0.001). As for fist-clenching (T = 11.82, p < 0.001) and wrist extension (T = 12.59, p < 0.001), COV from 100% motion amplitude was significantly higher than that from 50% motion of amplitude on the hemiplegic side. There was a significant difference between COV from healthy and hemiplegic sides performing hand opening with 100% motion amplitude (T = −13.46, p < 0.001). However, there was no significant difference between COV from both hands Fig. 12. COV values from six stroke patients when they were receiving FES on the hemiplegic side. Data from hemiplegic and healthy hands were collected. Hemiplegic side 50% data were obtained when the FES triggered 50% motion amplitude of the gesture. The hemiplegic side 100% data corresponded to 100% FES-triggered motion amplitude. *** indicates a significant difference in paired t-test with p < 0.001.

V. DISCUSSION
The study aimed to develop a LiDAR-based hand CCFES system that can effectively assist patients with their repetitive rehabilitation exercises. Based on this goal, the hardware of the entire system was designed, and suitable data processing methods were determined. Besides, experiments were carried out to verify the feasibility of the system.
As seen from Fig. 5, the accuracy of the LiDAR module was sufficient to differentiate between the four selected hand gestures, including hand opening, fist clenching, wrist extension, and wrist flexion. These four gestures are commonly used in hand rehabilitation [36], [37]. Twelve features were extracted from the LiDAR data, including the data from the center section, average valid values, count of valid values, and minimum and maximum valid values. Three different machine learning algorithms, including the linear discriminant analysis (LDA), k-Nearest Neighbor (kNN), and support vector machine (SVM), were trained and had achieved good classification performance when detecting four gestures. After comparing the classification results of the three classifiers, the SVM classifier was chosen for its high accuracy and low calculation delay. Although other feature extraction methods or classification algorithms were not utilized for possible higher classification accuracy, the SVM classifier showed adequate classification performance.
Regarding the offline gestures classification, the LiDARbased CCFES system showed comparable classification performance with sEMG-based CCFES systems. Ruiz-Olaya combined sEMG signals and information from inertial sensors to detect wrist and elbow motions, with an average F1-score of 0.92 [8]. Our methods showed better classification performance, with an average F1-score of 0.98 for four gestures.
Bi et al. applied an sEMG-based detection armband for gesture classification with a delay time between the controlling and controlled limbs of 300ms approximately [20]. Our gesture classification based on LiDAR exhibited slightly better classification performance in online trails, with an average accuracy of 0.92 for four gestures and a delay of about 250ms. As we mentioned, sEMG requires such complex signal processing as filtering and amplifying. On the other hand, the LiDAR we used takes simple processing to calculate the classifier-required features. Besides, we applied wired serial transmission in the system. The response delay was reduced compared to the Bluetooth Bi used. In mirror therapy, a shorter response time can help patients perform bilateral hand gestures more simultaneously. Research has shown that aligning the onset of peripheral stimulation with the subject's motion intention can change the excitability of the corticospinal projection to the stimulated muscles, leading to better skill acquisition [38].
The experiment was conducted to verify that various motion amplitudes of the same gesture could be distinguished according to the difference between bilateral LiDAR data. As demonstrated by the paired t-test, there was no significant difference in bilateral COV data when the FES produced 100% action amplitude for fist clenching and wrist extension. That shows the COV of 100% motion amplitude on the hemiplegic hands can be considered the same as that of healthy hands when patients perform fist clenching and wrist extension. For hand opening, there was a considerable difference in LiDAR data from both hands while receiving FES. The patients could not recreate the hand opening on the hemiplegic side just as the healthy hand, even after receiving the maximum FES within the tolerable range.
The paired t-test also verified a significant difference between the COV of 50% and 100% motion amplitude on the hemiplegic side performing hand opening, fist, and wrist extension. Based on the mentioned results, the bilateral COV feature can be applied as a metric for the evaluation of FES-generated motion amplitude for fist clenching and wrist extension. As for hand opening, just the COV from bilateral LiDAR can not tell how the gesture is performed since hand opening with the maximum motion amplitude on the hemiplegic side still significantly differs from that on the healthy side. Tarun Karak et al. utilized data gloves signals as position and velocity feedback for closed-loop control of FES, achieving prosperous and stable grasping [39]. Zhou et al. proposed a closed-loop FES system based on sEMG bias, also for stable grasping [13]. Both of them focused on grasping rather than other hand gestures. Closed-loop control or evaluation based on LiDAR has not been studied yet.
This study had several strengths. First, we validated the feasibility of using LiDAR in a CCFES system to detect the motion intentions of stroke patients. The selected LiDAR has the advantages of robustness, non-wearability, and low cost. Second, the SVM algorithm recognized the gestures and achieved excellent classification performance in online and offline classification experiments. Since stimulation pattern modulation is a crucial aspect of the FES system, it is essential to introduce the FES evaluation for such a system. The setup of LiDARs enabled quantitative evaluation of FES-generating movements, facilitating timely adjustment of FES parameters. It also made it possible to designate FES treatment protocols more rationally.
There is still room for improvement in our work. Although the proposed LiDAR-based CCFES system can detect and classify four selected gestures, the classification accuracy for wrist extension was slightly lower for other gestures in the online trial. This was primarily due to the subjects performing wrist extension with varying wrist angles. As shown on the LiDAR data visualization graph, Fig. 5, when the wrist extension angle is minor, the data collected can be indistinguishable from a fist. In this study, the evaluation method utilizing the COV feature didn't show outstanding performance in distinguishing various motion amplitudes of hand opening. Besides, a more refined differentiation of motion amplitudes is required if we apply LiDAR in the feedback data in close-loop control of FES. We only focuses on the motion amplitudes of the generated gesture. There would be adverse effects of overstimulation through lack of evaluation or feedback on the safety of FES [40], [41]. Additional sensors can be combined to monitor both the motion amplitudes and the safety of FES.
In the follow-up study, more training guidance is required to improve the training effect, especially for wrist extension. The difference between the bilateral LiDAR data can be used as a metric of FES evaluation and as a feedback signal for closed-loop control of FES. The feedback control of FES can be combined with the proposed system. It is also essential to seek more effective metrics to evaluate different motion amplitudes of hand opening. As for assessing the safety of FES, the combination of other sensor data may be a suitable solution in order to avoid damage caused by inappropriate FES. Clinical trials should be conducted to validate the feasibility and practicality of the proposed method.

VI. CONCLUSION
A LiDAR-based hand CCFES system has been proposed. It aimed at realizing active rehabilitation exercises for stroke patients and evaluation of FES-triggered movements. The utilization of LiDAR reduced the difficulty of data processing and wearing. The SVM algorithm for gesture classification based on LiDAR was applied to achieve a decent classification accuracy in real-time tests. Experiments on stroke patients also verified that the difference between bilateral LiDAR data could be applied to evaluate the motion amplitude of FES-triggered gestures quantitatively. Future work will focus on closed-loop control for FES, targeting both the action amplitude of gestures and the safety of FES to avoid the adverse effects of excessive or insufficient FES on rehabilitation therapy.