Adjustable Method for Real-Time Gait Pattern Detection Based on Ground Reaction Forces Using Force Sensitive Resistors and Statistical Analysis of Constant False Alarm Rate

A new approach is proposed to detect the real-time gait patterns adaptively through measuring the ground contact forces (GCFs) by force sensitive resistors (FSRs). Published threshold-based methods detect the gait patterns by means of setting a fixed threshold to divide the GCFs into on-ground and off-ground statuses. However, the threshold-based methods in the literature are neither an adaptive nor a real-time approach. To overcome these drawbacks, this study utilized the constant false alarm rate (CFAR) to analyze the characteristics of GCF signals. Specifically, a sliding window detector is built to record the lasting time of the curvature of the GCF signals and one complete gait cycle could be divided into three areas, such as continuous ascending area, continuous descending area and unstable area. Then, the GCF values in the unstable area are used to compute a threshold through the CFAR. Finally, the new gait pattern detection rules are proposed which include the results of the sliding window detector and the division results through the computed threshold. To verify this idea, a data acquisition board is designed to collect the GCF data from able-bodied subjects. Meanwhile, in order to test the reliability of the proposed method, five threshold-based methods in the literature are introduced as reference methods and the reliability is validated by comparing the detection results of the proposed method with those of the reference methods. Experimental results indicated that the proposed method could be used for real-time gait pattern detection, detect the gait patterns adaptively and obtain high reliabilities compared with the reference methods.


Introduction
Walking is the basic capability of human being to move from one gait cycle to another which allows people to carry out their daily lives [1]. One complete gait cycle in human walking consists of two main gait patterns, such as stance phase and swing phase. Specifically, stance phase is defined

Subjects
This study included twelve males and ten females of average age 23.1 ± 3.2 years and average mass 68.2 ± 7.6 kg with no history of foot diseases or limitations. Before the experiment, the subjects gave their written informed consent for participation in this study as the purpose was explained in detail to each of them and their safeties could be ensured. These subjects were selected from the postgraduate students of Wuhan University of Technology, which approved our research.

Measurement Principle of FSR Sensors
To validate our research, we designed a gait phase detection system as shown in Figure 1. Two sets of FSRs (LOSON LSH-10, LOSON Instrumentation, Nankin, China) were severally embedded into the insole of the ball and heel of each shoe. The FSRs signal were digitalized by a high resolution of 16 bits AD converters at a sample frequency of 1000 Hz. Each FSR possesses a wide measuring range of 0-200 kg with a high accuracy (including linearity and repeatability) of ± 0.5% full scale (FS). As the FSR sensor outputs a weak micro-voltage-level signal, the output signal should be amplified to a voltage-level signal. Meanwhile, a pressure tester (TLS-S1000W, Jinan Zhongchuang Industry Test System Co., Ltd, Jinan, China) is used to calibrate the FSRs such that the amplified output signal within a range of 0-5 V correlates with the measured mass of 0-200 kg. introduced as references. The detection results of the proposed method are compared with the reference methods.

Subjects
This study included twelve males and ten females of average age 23.1 ± 3.2 years and average mass 68.2 ± 7.6 kg with no history of foot diseases or limitations. Before the experiment, the subjects gave their written informed consent for participation in this study as the purpose was explained in detail to each of them and their safeties could be ensured. These subjects were selected from the postgraduate students of Wuhan University of Technology, which approved our research.

Measurement Principle of FSR Sensors
To validate our research, we designed a gait phase detection system as shown in Figure 1. Two sets of FSRs (LOSON LSH-10, LOSON Instrumentation, Nankin, China) were severally embedded into the insole of the ball and heel of each shoe. The FSRs signal were digitalized by a high resolution of 16 bits AD converters at a sample frequency of 1000 Hz. Each FSR possesses a wide measuring range of 0-200 kg with a high accuracy (including linearity and repeatability) of ± 0.5% full scale (FS). As the FSR sensor outputs a weak micro-voltage-level signal, the output signal should be amplified to a voltage-level signal. Meanwhile, a pressure tester (TLS-S1000W, Jinan Zhongchuang Industry Test System Co., Ltd, Jinan, China) is used to calibrate the FSRs such that the amplified output signal within a range of 0-5 V correlates with the measured mass of 0-200 kg. After data collection, the acquired FSR signals were filtered by Butterworth low pass filter with a cut-off frequency of 200 Hz to eliminate the unnecessary high frequency noise. After data collection, the acquired FSR signals were filtered by Butterworth low pass filter with a cut-off frequency of 200 Hz to eliminate the unnecessary high frequency noise.

Description of Walking Experiments
After sensor calibrations, the experiments were implemented to test the reliability of CFAR for gait pattern detection. Then, each subject was asked to perform 5 trials to wear the designed shoes to

Gait Pattern Detection Algorithm
For human walking, a complete gait cycle could be divided into two main phases such as stance-phase and swing-phase. Stance-phase means that the foot is in contact with the ground, while swing-phase means that the foot is off the ground. As two FSR sensors are mounted severally inside the heel and ball of shoe, it would result in that only one point (i.e., the ball or the heel) is contacting the ground and the other point is off the ground. As a result, single point contact could lead to the transition detection between the two phases. To be specific, the transition from swing-phase to stance-phase is Heel-Strike, while the transition from stance-phase to swing-phase is Heel-Off. To differ from the two transitions, stance-phase is renamed as Full-Stance (i.e., two points are in contact). To distinguish these gait patterns, the proposed algorithm is presented in the following.

Statistical Characteristic Analysis
The gait pattern detection mainly focuses on the division of on-ground and off-ground statuses through setting a threshold. As a result, this paper carries out the characteristic analysis of the two statuses. Firstly, a virtual threshold is set to divide the GCFs into on-ground and off-ground statuses. Figure 2a  Meanwhile, the curvature in Reference [B C] interval is mainly negative, which also lasts a long time. However, the curvature polarity (i.e., positive or negative) in Reference [C D] interval is unstable and the determined curvature polarity would change when lasting a short time. After sensor calibrations, the experiments were implemented to test the reliability of CFAR for gait pattern detection. Then, each subject was asked to perform 5 trials to wear the designed shoes to walk. The five trials were performed on treadmill for 30 s per trial at a designated constant speed of 2 km/h, 3 km/h, 4 km/h, 5 km/h and 6 km/h in turn.

Gait Pattern Detection Algorithm
For human walking, a complete gait cycle could be divided into two main phases such as stance-phase and swing-phase. Stance-phase means that the foot is in contact with the ground, while swing-phase means that the foot is off the ground. As two FSR sensors are mounted severally inside the heel and ball of shoe, it would result in that only one point (i.e., the ball or the heel) is contacting the ground and the other point is off the ground. As a result, single point contact could lead to the transition detection between the two phases. To be specific, the transition from swing-phase to stance-phase is Heel-Strike, while the transition from stance-phase to swing-phase is Heel-Off. To differ from the two transitions, stance-phase is renamed as Full-Stance (i.e., two points are in contact). To distinguish these gait patterns, the proposed algorithm is presented in the following.

Statistical Characteristic Analysis
The gait pattern detection mainly focuses on the division of on-ground and off-ground statuses through setting a threshold. As a result, this paper carries out the characteristic analysis of the two statuses. Firstly, a virtual threshold is set to divide the GCFs into on-ground and off-ground statuses.  Based on these reasons, a sliding window detector could be built to record the lasting time of the curvature of the GCF signals. Given two types of sliding windows, such as ascending window and descending window, which can be described as Based on these reasons, a sliding window detector could be built to record the lasting time of the curvature of the GCF signals. Given two types of sliding windows, such as ascending window and descending window, which can be described as where A w is the ascending window function and N A is the size of A W . Meanwhile, D W is the descending window function and N D is the size of D W . When the present point (i.e., noted as F) of GCF signals comes, its derivative is computed and noted as dF. When the dF value is positive, the ascending window would be sliding but the descending window remains unchanged, which could be written as On the other hand, when the dF value is negative, the descending window would be sliding but the ascending window remains unchanged.
Then, the numbers of "1" in the two window are counted, which are separately noted as C A and C D . C A is the number of "1" in the ascending window, while C D is for descending window.
Finally, count limits L A and L D are set for C A and C D , respectively. When C A (or C D ) is larger than L A (or L D ), it can be considered that the curvature lasts a long time. Additionally, when the C A is smaller than L A and the C D is smaller than L D , it can be considered that the curvature lasts a short time. When proper values are chosen for these parameters, the GCFs signals can be processed in the Figure 3. However, the [A' B'] and [B' C'] intervals could not be considered as on-ground status. As a result, this statistical characteristic analysis would lead to false detection such that further research should be carried out.
where Aw is the ascending window function and NA is the size of AW. Meanwhile, DW is the descending window function and ND is the size of DW.
When the present point (i.e., noted as F) of GCF signals comes, its derivative is computed and noted as dF. When the dF value is positive, the ascending window would be sliding but the descending window remains unchanged, which could be written as On the other hand, when the dF value is negative, the descending window would be sliding but the ascending window remains unchanged.
Then, the numbers of "1" in the two window are counted, which are separately noted as CA and CD. CA is the number of "1" in the ascending window, while CD is for descending window.
Finally, count limits LA and LD are set for CA and CD, respectively. When CA (or CD) is larger than LA (or LD), it can be considered that the curvature lasts a long time. Additionally, when the CA is smaller than LA and the CD is smaller than LD, it can be considered that the curvature lasts a short time. When proper values are chosen for these parameters, the GCFs signals can be processed in the Figure 3. However, the [A' B'] and [B' C'] intervals could not be considered as on-ground status. As a result, this statistical characteristic analysis would lead to false detection such that further research should be carried out.

Constant False Alarm Rate and Threshold Computation
For all of the relating studies, the set threshold is closer to the GCFs differentiated as off-ground status. Therefore, threshold computation should be made after [C' D'] interval is searched using sliding window detector. The error between GCF value at point D' and the computed threshold would lead to false detection. As a result, CFAR is used to make up this drawback.
It is assumed that H 0 is the detection result of GCF identified as true off-ground status and H 1 is the detection result of GCF identified as true on-ground status. Meanwhile, D 0 represents that the GCF is detected as off-ground status, while D 1 represents that the GCF is detected as on-ground status. In this paper, the threshold value is calculated based on the analysis of [C' D'] interval which can be distinguished as off-ground status. Therefore, it would happen that the division results obtained by the computed threshold are detected as on-ground statuses, while the true detection results are off-ground statuses. Then, the false detection probability in this case can be expressed as where P F is the false detection probability and P(D 1 |H 0 ) is the probability that judges H 0 as D 1 .
Meanwhile, x is the GCFs happening in the [C' D'] interval, T is the detection threshold and P(x|H 0 ) is the probability density function. As shown in Figure 4, the unfiltered x in the [C' D'] interval is subject to normal distribution. However, the filtered x obeys the Rayleigh distribution as pictured in Figure 5. Therefore, the P(x|H 0 ) can be described as where σ the signal density of x. Substituting the Equation (5) into Equation (4), the false detection probability can be rewritten as Then, the detection threshold T can be obtained in the following.
When the [C' D'] interval is searched through the sliding window detector, the detection threshold would be computed immediately at point D.' In Rayleigh distribution, σ is proportional to the average of x, which can be expressed as The GCF values after D' point would be compared to the detection threshold T to divide the GCFs into on-ground and off-ground statuses. As shown in Figure 6, [A" B"] and [B" C"] are the continuous ascending and descending areas for the next gait cycle, respectively. Meanwhile, A" and D' are the same point. In point A" (or D'), a threshold is computed according to Equation (7). Then, the status division can be made, which can be stated as follows.
where F is the GCF after D' (or A") point. For S, "1" indicates an on-ground status and "0" indicates an off-ground status. As depicted in Figure 6, this calculated threshold divides the next gait cycle with the result that two intersection points E' and F' are obtained. Based on the division formula in Equation (9), [A" E'] and [F' C"] intervals are both judged as off-ground status. However, the P F value would affect the threshold value according to Equation (7), which could be exactly described in Figure 7. The GCFs marked in blue are detected to be in unstable area. The lines marked in red and green are the computed threshold using two different P F values. Therefore, the gait patterns could be distinguished according to the rules in Table 1, when both the status divisions of ball and heel are made.
value would affect the threshold value according to Equation (7), which could be exactly described in Figure 7. The GCFs marked in blue are detected to be in unstable area. The lines marked in red and green are the computed threshold using two different PF values. Therefore, the gait patterns could be distinguished according to the rules in Table 1, when both the status divisions of ball and heel are made.   in Figure 7. The GCFs marked in blue are detected to be in unstable area. The lines marked in red and green are the computed threshold using two different PF values. Therefore, the gait patterns could be distinguished according to the rules in Table 1, when both the status divisions of ball and heel are made.

Evaluation of the Results
In order to test the reliability of the proposed method, reference methods should be determined. As well known, the Lopez-Meyer method had been compared with the "GAITRite system" and acquired a comparative and reliable confidence of 95% [15]. Therefore, not only the Lopez-Meyer method [15] but also the other methods [4,[16][17][18] in the literature were introduced as reference methods. The gait pattern detection rules of these methods were severally presented in Reference [17,18]. Hence, the reliability of this study is determined by comparing the detection results between the reference methods and the proposed algorithm. Finally, the obtained reliabilities were processed to measure the "test-retest reliability" by taking several measurements on each subject. The analysis is performed with the intraclass correlation coefficient (ICC) proposed by Bartko [19].

Selection of Coefficients
Before the experiments, the sizes (i.e., N A and N D ) and lengths (i.e., L A and L D ) of the ascending and descending windows should be optimized. Firstly, one million of the GCF points judged as off-ground status through the reference methods were used to test the probability that the GCF points failed to be divided into unstable area. Secondly, the traversing search method was used to optimize these parameters, which are shown in Figures 8a and 9a. The testing probability is smaller, the parameter selection is better. When the testing probability is zero, a great many of parameter combinations could be figured out. On the other side, the optimization algorithm should obey two conditions that L A is smaller than N A and L D is smaller than N D . Therefore, the testing probability results of being zero are extracted and described in Figures 8b and 9b. Bigger value of these parameters would lead to the lag to detection results such that the smallest parameter values in Figures 8b and 9b is chosen. As a result, optimum values of L A = 35, N A = 38, L D = 36 and N D = 40 were used. and descending windows should be optimized. Firstly, one million of the GCF points judged as off-ground status through the reference methods were used to test the probability that the GCF points failed to be divided into unstable area. Secondly, the traversing search method was used to optimize these parameters, which are shown in Figure 8a and Figure 9a. The testing probability is smaller, the parameter selection is better. When the testing probability is zero, a great many of parameter combinations could be figured out. On the other side, the optimization algorithm should obey two conditions that LA is smaller than NA and LD is smaller than ND. Therefore, the testing probability results of being zero are extracted and described in Figure 8b and Figure 9b. Bigger value of these parameters would lead to the lag to detection results such that the smallest parameter values in Figure 8b and Figure 9b is chosen. As a result, optimum values of LA=35, NA =38, LD=36 and ND=40 were used.   To determine the highest reliability of the proposed algorithm, PF were optimized using the traversing search method. Choosing the data from 5 subjects as training data, optimum values of PF = 20.5 were used, which is shown in Figure 10.

Results of Gait Pattern Detection
As shown in Table 2, the proposed algorithm was highly reliable when compared with the five To determine the highest reliability of the proposed algorithm, P F were optimized using the traversing search method. Choosing the data from 5 subjects as training data, optimum values of P F = 20.5 were used, which is shown in Figure 10.  To determine the highest reliability of the proposed algorithm, PF were optimized using the traversing search method. Choosing the data from 5 subjects as training data, optimum values of PF = 20.5 were used, which is shown in Figure 10.

Results of Gait Pattern Detection
As shown in Table 2, the proposed algorithm was highly reliable when compared with the five reference methods. The average reliabilities were 90.15%, 89.83%, 89.45%, 89.98% and 88.90% when compared with the TAM [16], Lopez-Meyer [15], PM [17], STTTA [18] and Mariani method [4], respectively. The average ICC of reliabilities was 0.56, which proved to be fair according to the guidelines of Cicchetti [20] and moderate according to the guidelines of Koo and Li [21].

Results of Gait Pattern Detection
As shown in Table 2, the proposed algorithm was highly reliable when compared with the five reference methods. The average reliabilities were 90.15%, 89.83%, 89.45%, 89.98% and 88.90% when compared with the TAM [16], Lopez-Meyer [15], PM [17], STTTA [18] and Mariani method [4], respectively. The average ICC of reliabilities was 0.56, which proved to be fair according to the guidelines of Cicchetti [20] and moderate according to the guidelines of Koo and Li [21]. In this paper, the collected GCF data were processed through the proposed algorithm. The GCFs in the left ball and heel were severally pictured in Figure 11a, b along with the unstable area and computed threshold marked. Then, the GCFs status division was made through the Equation (9), which was depicted in Figure 11c,d. Similarly, the processing results of the right foot were demonstrated in Figure 12. It was qualitatively illustrated in Figure 13 where the gait patterns were identified according to the rules in Table 1.  In this paper, the collected GCF data were processed through the proposed algorithm. The GCFs in the left ball and heel were severally pictured in Figure 11a, b along with the unstable area and computed threshold marked. Then, the GCFs status division was made through the Equation (9), which was depicted in Figure 11c,d. Similarly, the processing results of the right foot were demonstrated in Figure 12. It was qualitatively illustrated in Figure 13 where the gait patterns were identified according to the rules in Table 1.   On one side, the detection results of the proposed method were depicted in Figures 11-13. On the other side, the detection results of the reference methods were not provided due to the high reliabilities which would lead to high similarity comparing with Figures 11-13.

Real-Time Application for Gait Pattern Detection
In this gait pattern detection system, the sampling frequency was set to be 1000 Hz. After data acquisition in each time, the data processing, including the sliding window detector, threshold computation based on CFAR, status division and gait pattern detection, could be actualized within one sampling period. In fact, the time delay between data acquisition and detection result in one running cycle was less than 1 ms. As a result, the proposed algorithm can be used for gait pattern detection in real time.

Advantages of the Research
When compared with the five reference methods, the proposed method is highly reliable (as seen in Table 2) and can identify the gait patterns in real time. The proposed method can be adaptable to different subjects with different body weights at different walking speeds, because adaptive thresholds are calculated according to the GCF signal characteristic analyzed though the  On one side, the detection results of the proposed method were depicted in Figures 11-13. On the other side, the detection results of the reference methods were not provided due to the high reliabilities which would lead to high similarity comparing with Figures 11-13.

Real-Time Application for Gait Pattern Detection
In this gait pattern detection system, the sampling frequency was set to be 1000 Hz. After data acquisition in each time, the data processing, including the sliding window detector, threshold computation based on CFAR, status division and gait pattern detection, could be actualized within one sampling period. In fact, the time delay between data acquisition and detection result in one running cycle was less than 1 ms. As a result, the proposed algorithm can be used for gait pattern detection in real time.

Advantages of the Research
When compared with the five reference methods, the proposed method is highly reliable (as seen in Table 2) and can identify the gait patterns in real time. The proposed method can be adaptable to different subjects with different body weights at different walking speeds, because adaptive thresholds are calculated according to the GCF signal characteristic analyzed though the On one side, the detection results of the proposed method were depicted in Figures 11-13. On the other side, the detection results of the reference methods were not provided due to the high reliabilities which would lead to high similarity comparing with Figures 11-13.

Real-Time Application for Gait Pattern Detection
In this gait pattern detection system, the sampling frequency was set to be 1000 Hz. After data acquisition in each time, the data processing, including the sliding window detector, threshold computation based on CFAR, status division and gait pattern detection, could be actualized within one sampling period. In fact, the time delay between data acquisition and detection result in one running cycle was less than 1 ms. As a result, the proposed algorithm can be used for gait pattern detection in real time.

Advantages of the Research
When compared with the five reference methods, the proposed method is highly reliable (as seen in Table 2) and can identify the gait patterns in real time. The proposed method can be adaptable to different subjects with different body weights at different walking speeds, because adaptive thresholds are calculated according to the GCF signal characteristic analyzed though the sliding window detector and the CFAR. As reported in Reference [17], the attachment between the shoe and foot would lead to bigger change of GCF magnitude in the unstable area such that the PM reliability would be affected to be lower. However, this situation would not happen in this proposed method as the lasting time of the differential GCF is used by the sliding window detector to identify the GCF in the unstable area.
The STTTA [18] and the proposed method can both achieve to adaptively identify the gait patterns in real time. However, the STTTA can identify the gait patterns using the GCFs data in the current period. Meanwhile, the proposed method applied the sliding window detector using the GCFs data in a lasting time which consisted of 35 (or 36) sampling periods. Specifically, for STTTA, when the GCFs in the heel or ball are judged to be off-ground status, a sudden change of GCF signal would lead to the GCF value to be larger than the threshold and judged to be on-ground status. Therefore, misdetection would happen for STTTA in this situation. Nevertheless, this situation will not happen in this proposed method, because the gait pattern is distinguished and given from the analysis of detection results in 35 (or 36) sampling periods.
According to the detection rules in Table 1, when the GCFs are identified to be in the unstable area, these GCF signals are judged to be off-ground status. When the heel and ball are both judged to be off-ground status, the specific gait pattern is swing phase. In swing phase, if the foot trembles leading to relatively larger GCF values, the sliding window detector would still identify the GCF signals to be in unstable area. Meanwhile, the CFAR algorithm would figure out a larger threshold to avoid the GCF signals identified as on-ground status.
For lower exoskeleton robot systems, the gait pattern detection plays an extremely important role. The results of gait pattern detection correlate with motion intention of the wearer such that the robotic leg automatically move to stand or swing. Meanwhile, the lower exoskeleton robot systems need real-time and adaptive gait pattern detection for different wearers to move at different walking speeds. This proposed method would meet this need.
The detection results were obtained from able-bodied subjects and a cyclic gait pattern sequence could be analyzed for healthy people using this research. However, the gait pattern sequence of hospital patients would differ from that of healthy people. Therefore, this research would help with the diagnosis of some persons with walking injuries, diseases or limitations.
Most studies [5,22,23] used the accelerometers and gyroscopes to obtain the acceleration and velocity for gait pattern detection. Some gait patterns in these studies did not appear in this paper, such as toe-off and initial-contact. If we want to identify the toe-off phase on this force platform, another FSR should be added to be mounted inside the top of the shoe. Meanwhile, a relatively small threshold was set for the GCF in the heel to detect the initial-contact.

Limitation of the Research
When the subject is walking at a faster speed, the lasting time of the GCF signals identified to be in the unstable area would get less such that the data points in this area reduce. In this situation, the data points in this area would not obey Rayleigh distribution strictly. To overcome this drawback, sampling frequency should be guaranteed to be high enough.
As reported in Reference [18], the cut-off frequency of Butterworth low pass filter is 10 Hz. However, the GCF signal should not be filtered excessively in this proposed method, which would destroy the data distribution characteristic.
When the subject jumps, both feet are judged to be swing-phase. In the walking experiments, subject jumping was rarely observed and only occurred when the subjects were running at a sufficiently rapid pace.

Conclusions
This paper uses the statistical theory to detect the gait patterns in real time. The statistical theory consists of sliding window detector and CFAR algorithm. The sliding window detector divides the GCFs into three areas, such as continuous ascending area, continuous descending area and unstable area. Then, the CFAR algorithm calculated adaptive thresholds according to GCF signals identified to be in the unstable area. The status division would be made according the adaptive threshold and the area division result. Finally, the gait pattern could be distinguished based on the detection rules. Experimental results indicated that the proposed method could be used for real-time gait pattern detection, detect the gait patterns adaptively and obtain high reliabilities compared with the reference methods.
Author Contributions: F.Y., J.Z. and L.Y. proposed the conception of this research and drafted this article. R.Z. and H.H. focused on the collection, analysis and interpretation of data. Z.Z. and Y.Z. checked and revised the whole content of this manuscript. All authors approved and agreed with the final paper version to be published.
Funding: This work was supported by the National Key R&D Program of China "The study on Load-bearing and Moving Support Exoskeleton Robot Key Technology and Typical Application" (2017YFB1300502).