Next Article in Journal
The Markov Concept of the Energy Efficiency Assessment of the Edge Computing Infrastructure Peripheral Server Functioning over Time
Previous Article in Journal
Augmenting Beam Alignment for mmWave Communication Systems via Channel Attention
Previous Article in Special Issue
Development of a Compliant Lower-Limb Rehabilitation Robot Using Underactuated Mechanism
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Inertial Measurement Unit-Based Real-Time Adaptive Algorithm for Human Walking Pattern and Gait Event Detection

1
Institute of Biomedical Engineering & Technology, Academy for Engineering & Technology, Fudan University, 220 Handan Road, Shanghai 200433, China
2
Center of Biomedical Engineering & Technology, Yiwu Research Institute of Fudan University, Chengbei Road, Yiwu 322000, China
3
Department of Orthopaedics, Huashan Hospital, Fudan University, 12 Middle Wulumuqi Road, Shanghai 200031, China
*
Authors to whom correspondence should be addressed.
Electronics 2023, 12(20), 4319; https://doi.org/10.3390/electronics12204319
Submission received: 8 August 2023 / Revised: 5 October 2023 / Accepted: 7 October 2023 / Published: 18 October 2023
(This article belongs to the Special Issue Advanced Wearable/Flexible Devices and Systems in Bioelectronics)

Abstract

:
In this work, a lightweight adaptive hybrid gait detection method with two inertial measurement units (IMUs) on the foot and thigh was developed and preliminarily evaluated. An adaptive detection algorithm is used to eliminate the pre-training phase and to modify parameters according to the changes within a walking trial using an adaptive two-level architecture. The present algorithm has a two-layer structure: a real-time detection algorithm for detecting the current gait pattern and events at 100 Hz., and a short-time online training layer for updating the parameters of gait models for each gait pattern. Three typical walking patterns, including level-ground walking (LGW), stair ascent (SA), and stair descent (SD), and four events/sub-phases of each pattern, can be detected on a portable Raspberry-Pi platform with two IMUs on the thigh and foot in real-time. A preliminary algorithm test was implemented with healthy subjects in common indoor corridors and stairs. The results showed that the on-board model training and event decoding processes took 20 ms and 1 ms, respectively. Motion detection accuracy was 97.8% for LGW, 95.6% for SA, and 97.1% for SD. F1-scores for event detection were over 0.86, and the maximum time delay was steadily below 51 ± 32.4 ms. Some of the events in gait models of SA and SD seemed to be correlated with knee extension and flexion. Given the simple and convenient hardware requirements, this method is suitable for knee assistive device applications.

1. Introduction

Intelligent walking assistive devices (IWADs) are increasingly being used to restore or assist the gait of patients with impaired lower extremity joint function or the elderly. These devices use a variety of sensors to detect the locomotor intentions of these populations, such as level-ground walking (LGW), stair ascent (SA), and stair descent (SD), to determine the best time instants to impose or remove assistive torque on the impaired biological joints [1,2], which improves human–machine interaction, increases wearing comfort, and reduces safety risks. Therefore, walking pattern and gait-event detection technologies that can perform real-time and long-term detection of gait states are crucial for clinical analysis and the proper functioning of the IWADs.
Optical tracking methods with the characteristics of non-contact and high precision have been widely used in gait segmentation and analysis [3,4]. However, since methods of this kind generally depend on well-calibrated hardware with a limited field of view, it is difficult to apply in daily outdoor IWAD applications. By contrast, wearable and on-board sensing solutions seem more suitable for IWAD applications. Among them, surface electromyography-based (sEMG) strategies are considered to have the characteristic of good accuracy [5,6]. However, sEMG sensors are not suitable for long-time use due to their complexity and poor interference immunity [7]. Force-based sensors, such as force-sensitive resistors (FSRs), are another type of popular technology for gait event detection [8]. Nevertheless, due to the lack of helpful kinematics information, it is hard to estimate or predict the gait events once in the swing phase [9].
In recent years, lightweight and integrable inertial measurement units (IMUs) have been proposed to overcome the above limitations and are widely used for real-time kinematic sensing and pattern recognition in IWAD control [10,11,12]. Some high-speed and low-cost rule-based detection algorithms with inertial signals from IMUs have been developed for IWAD control and clinical analysis [13,14]. With the developments of hardware and algorithm improvements in the past two decades, machine learning algorithms have also been introduced to the fields of IWAD control [15,16,17,18] and abnormal gait segmentation in clinical analysis [19,20,21,22]. However, most of these studies achieve online gait detection by using an offline-trained model. Lit [1] implied that offline-trained models are sensitive to changes in gait parameters and even tend to lose validity when the locomotion conditions change dramatically. To increase the dependability of gait event detection, a few unsupervised adaptive algorithms for only LGW patterns have been presented [1,23]. However, machine learning-based research on a real-time on-board adaptive gait event detection algorithm for multiple common walking patterns, including SA and SD, has not been reported.
In this study, our aim is twofold: (1) to establish methods for labeling three typical walking patterns (LGW, SA, and SD) and gait events for different walking patterns, and (2) to eliminate the cost of manual data acquisition and model training with a single portable microcontroller unit (MCU) to accomplish the real-time adaptive identification of walking patterns and gait events. Therefore, an IMU-mounted portable wearable system with a lightweight hybrid algorithm was developed to detect three patterns and four events of each pattern by using inertial sensing data from two IMUs on the thigh and foot in real-time. Using a short-term model training strategy, the training-level algorithm can automatically modify the model parameters according to the current gait pattern and enhance the adaptivity of detection models. Results obtained in this feasibility study demonstrated that the hybrid algorithm-based approach can detect gait patterns and events continuously with three models for each pattern in a low computational burden on a simple and convenient hardware frame.

2. Materials and Methods

2.1. IMU-Based Hardware Development and Data Pretreatment

The IMU-based brace-type device (gait detection device) is developed (shown in Figure 1), which is considered a replica of an IWAD targeting the knee joint. It contains two single-chip microcomputer-controlled IMU modules (STM32F104, STMicroelectronics, Geneva, Switzerland; MPU9250, InvenSense, San Jose, CA, USA), four FSRs (FSR UX 406, Interlink Electronic, Camarillo, CA, USA), one left leg knee brace (Xeleton, Ottobock, Duderstadt, Germany), a calibrated magnetic position sensor (AS5055A, ams-OSRAM, Premstätten, Austria), and one portable Raspberry-Pi (Raspberry-Pi 4B, Raspberry Pi Foundation, Cambridge, UK). Two IMU modules are fixed in the front of the thigh part of the brace and on the instep of the shoe, respectively. All the x-axes of IMU modules point to the outside of limbs from the medial, parallelly with the rotation axis of the knee brace. Then set all y-axes of them to point to the proximal joint of limbs from the distal joint. The magnetic position sensor is fixed to the knee joint rotation axis and connected to the thigh IMU module. Each printed circuit board (PCB) with sensor chips is held in a 3D-printed customized installation bottom case through screw fastening, respectively. Then all the installation bottom cases are glued to the frame of the knee brace and shoe with planned orientations by hot melt adhesive, respectively. In addition, the magnet ring for position sensing is glued to the thigh part of the knee brace, so the position sensor chip on the PCB mounted on the thigh part of the brace can monitor the angle of the knee joint.
To ensure the stability of signal transmission, the MCU and IMU modules are connected by shielded twisted-pair cables. All the cables are fixed to the brace and shoe at several fixing points along the path of the brace, the wearer’s ankle, and the rear side of the shoe with tapes/strapping and hot melt adhesive. Four FSRs are attached to the bottom of the shoe just under the heel and metatarsal pads through double-faced adhesive tapes with a silicone pad for protection (shown in Figure 1a), and they are all wire-connected to the foot IMU module. With enough redundant cables and additional gluing reinforcements on each cable connector, the effect of cable traction due to repetitive motion that may impair the repeatability of sensors is minimized as much as possible.
Four input signals are used in this method: angular velocity and angle of the x-axis of the thigh IMU, acceleration of the z-axis of the foot IMU, and angular velocity of the x-axis of the foot IMU. Since only data from the x-axis of the thigh IMU is used, the different coordinates of the thigh and foot IMUs do not affect the detection. The rotation angle of the magnetic position sensor and pressure markers of FSRs are also collected and only used as reference standards. The two modules update sensing data to a buffer queue in the MCU through the controller area network (CAN) bus at 200 Hz. The buffer contains the last five data points of each signal and is filtered every 10 ms to synchronize and smooth the data by an average filtering algorithm. Then these processed data that update at 100 Hz are delivered to the walking pattern detection algorithm, the real-time gait event/sub-phase decoding algorithm, and a training buffer queue for further event feature labeling and model training.

2.2. Gait Models Construction for Three Typical Walking Patterns

Gaits are considered consistent and quasi-periodic cyclic processes that describe the pattern of biped motion [24]. In this work, gaits are regarded as cycle sequences containing four events and four sub-phases for each pattern (shown in Figure 2). Four events are defined, namely: (1) initial contact (IC), (2) foot flat (FF), (3) heel-off (HO), and (4) final contact (FC). In LGW, heel-off is the start event of knee flexion, and initial contact is the end event of knee extension. In SA, initial contact is the start event of knee extension, and final contact is the start event of knee flexion. In SD, initial contact is the start event of knee flexion, and final contact is the start event of knee extension.
Then, four sub-phases can be defined by each adjacent pair of the above-mentioned events, namely: (1) load response (LR), (2) mid-stance (MSt), (3) terminal stance (TSt), and (4) swing (Sw). For model consistency, all sub-phases continue until the next adjacent event occurs.

2.3. Adaptive Gait Detection Method

To enhance the adaptability of the detection algorithm to deal with parameter variations of gait, especially variations of walking speed and limb quasi-periodic behavior, a two-level algorithm was developed: (1) a periodic background training-level algorithm that updates the corresponding model parameters based on the recent historical data (training set) and segmentation results obtained in the last training cycle (10 s); (2) a real-time foreground detection-level algorithm that labels the current pattern with the current IMU signals by a set of rules and then decodes the latest acquired data (testing set) into events or sub-phases with the latest gait models of the current pattern at 100 Hz. By using the two-level algorithms, the testing set is independent from the training set and avoids data leakage. By using multi-threading technology, the real-time performance of detection is guaranteed. The flowchart of the two-level algorithm is presented in Figure 3.

2.3.1. Training-Level Algorithm: Segmentation Rules and Model Training

The training-level algorithm runs every 10 s and updates current gait model parameters with the largest amount of continuous data of the corresponding pattern. The training set is used for further processing only if the data satisfies the set conditions (≥700 continuous data collected within this 10 sec, checkpoint 1). Otherwise, the training set will also be deprecated to avoid data leakage. Data from the first and last steps are removed before training to reduce the impact of pattern detection delays. The input data consists of an observation sequence   X = x 1 , , x n , , x 1000 , where x n = [ ω t h i g h x n , ω f o o t x ( n ) , a f o o t z ( n ) ] T . Set ω t h i g h x as angular velocity of x-axis of the thigh IMU, ω f o o t x as angular velocity of x-axis of the foot IMU, and a f o o t z as acceleration of z-axis of foot IMU.
The algorithm segments these data into several events and sub-phases using a set of rules (shown in Figure 4). Peak detection, zero-crossing detection, and flat-zone detection are used for gait event feature search to reduce the effect of sensor drift on gait model parameters. Foot flat and heel-off are two common events in all three patterns. When the foot is approaching stationary between these two events, ω t h i g h x maintains a low value near the zero point. According to the gait model, the algorithm searches for the other two events in temporal order based on these two events. In LGW, when initial contact occurs, the foot IMU shows a corresponding impact peak in a f o o t z before foot flat position within 300 ms. Accordingly, the algorithm searches for the maximum point in this period and labels it as the initial contact. The algorithm searches for the first zero-crossing point after heel-off in ω f o o t x and labels it as the final contact. In SA, the algorithm searches for the minimum point within 300 ms before foot flat in a_(foot-z) and labels it as initial contact, and the maximum point within 300 ms after heel-off in ω f o o t x can be labeled as final contact. In SD, the minimum point within 300 ms before foot flat can be labeled as initial contact, and the maximum point within 300 ms after heel-off can be labeled as final contact. Data between adjacent events are labeled as different sub-phases according to the walking pattern models.
Literature [25] implies that 5 complete steps are enough to train a short-term LGW gait detection model. A similar strategy is adopted; 5 steps of past data are used for LGW model training, while 4 steps of past data are used for SA/SD model training (checkpoint 2). When the training set contains over the set number of steps, the algorithm then trains and updates all parameters of the gait model.
The above-mentioned gait models with four events and four sub-phases can be considered a stochastic process restrained by a Markov chain (shown in Figure 5) whose probability of the current state only depends on the previous state. For each state, since only a set of emissions, not the state sequence, can be observed, a Gaussian Mixed-Model-based Hidden Markov Model (GMM-HMM) [1] is used to estimate the most likely hidden state sequence S = { S 1 , S i , , S 8 } , i = { 1 , , 8 } , which corresponds to four events and four sub-phases in each gait detection model. Different pattern models have their own GMM-HMM.
There are three parts of parameters in GMM-HMM as   λ = { π , A , b i ( x ) } . Parameter set A is a transition matrix (8 × 8 square matrix) and defines a circular left-to-right chain allowing only transitions. Each row in the matrix represents one hidden state S i , as the following form:
A = a 11 a 12 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 a 33 a 34 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 a 55 a 56 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 a 77 a 78 1 0 0 0 0 0 0 0 ,
where a i j are probability of a hidden transition and equal to the ratio between the estimated number of transitions from the hidden state S i to S j , satisfying 0 ≤ a i j ≤ 1 and j a i j = 1 . As all events (row 2, 4, 6, 8) were boundaries of sub-phases (row 1, 3, 5, 7), their probability of remaining in the same state was equal to zero, and their probability of transition was set to 1.
GMMs are a set of parameters governing the distribution probability: b i x = p x μ i , Σ i . Mean value μ i (GMM-μ) and covariance matrix Σ i are feature distributions of S i . If all events and sub-phases have already been labeled, the equation of GMMs can be simplified as follows:
μ i = 1 n i S i ( n ) x n
Σ i = 1 n i S i ( n ) ( x n μ i ) ( x n μ i ) T
where n i is the number of observation values labeled as S i .
After all parameters are computed, the algorithm updates parameters a i j and b i x of the gait model of the pattern for further detection.

2.3.2. Detection-Level Algorithm: Walking Pattern Detection and Gait Decoding

The first part of the detection-level algorithm is a rule-based approach, which detects the current walking pattern and labels the current observation sequence x t according to different postures of the lower limbs (shown in Figure 6).
Switching between LGW and SA can be detected by a dynamic threshold of thigh angle (pitch value of the thigh IMU) during the swing phase or at initial contact. This thigh angle threshold is the maximum angle that the thigh swings forward in LGW and is also calculated by peak detection and updated in the training-level algorithm. Switching between LGW and SD can be detected by a static angular velocity threshold with foot IMU during the period from initial contact to load response. Rules for pattern switching are presented in Figure 7 and Table 1. The default pattern of the detection algorithm is LGW. Once the current walking pattern is detected, the detection algorithm then switches the gait model to the corresponding one for further gait event decoding.
The second part of the decoding-level algorithm is an HMM-based decoding approach. It iterates values with the current observation sequence x t by Viterbi algorithm and decodes the current state with the gait model of the current detected pattern at 100 Hz. The results of every iteration will be temporarily stored and used for the next loop. The equations are as follows:
V t S j = max j ( V t 1 S i × a i j × b i ( x t ) )
φ i ( S j ) = a r g max j ( V t ( S j ) )
where V t is a vector containing all values of the current hidden state S j , φ i is the location of the maximum value of V t and can be seen as S j .
The parameter set π is initial probabilities { p 1 , p i , , p 8 } and should be calculated once the detection algorithm starts and the pattern changes. The initial equations are as follows:
V 1 = e x p ( 0.5 x 1 μ i T Σ i 1 ( x 1 μ i ) ) ( 2 π ) d / 2 | Σ i | 1 / 2
φ 1 = a r g max i ( V 1 )
where d is the dimension of the inputs. Then, set p i to 1 as the initial hidden state, and the other parameters of π are set to 0.

2.4. Algorithm Validation Experiments

Ten subjects (males, 28.2 ± 4.6 years old, 176.4 ± 4.1 cm) without deformity, amputation, or other factors that may modify the gait behaviors were recruited to test the detection algorithm in a common experiment terrain (shown in Figure 8). The subjects were required to wear the device as presented in Figure 1b. Although only the inertial components of IMUs are used, to guarantee the accuracy and reliability of the data, each subject was asked to stand still for a few seconds before each trial to execute the initialization of the IMUs and magnetic sensors. Then, the subject was required to complete a ten-second free walk in each pattern to initial the corresponding gait model. To test the adaptive ability of the algorithm, all subjects then completed two rounds of ascent/descent of ten floors and a three-minute free level-ground walk in the corridors (0.8 m/s~1.3 m/s). The experimental step numbers of each subject’s left leg were over 200 in each pattern, which ensured a reliable sample set.
To evaluate the performance of the walking pattern detection strategy, the patterns of subjects were manually marked as a reference for post-evaluation during the walking trails with stairs. The marking time for pattern switching was generally at the first IC of the leading leg in the new patterns, whether it was the sensing leg or the contralateral leg. All the detection results and reference marks were stored in a memory card at 100 Hz, as well as the parameters of the gait models.

2.5. Data Post-Processing and Detection Performance Evaluation

The foot contact status from plantar FSRs and the knee angle from the magnetic position sensor were presented as reference data for gaits for assessing the performance of detection (shown in Figure 9a). Two indexes, accuracy rate and time delay, were used to evaluate event detection performance in each pattern. A tolerable window of 200 ms at each gait event detection was used to determine whether the result was correct or not. Precision (P), recall (R), and F1-score were used to evaluate the universal accuracy rate of detection algorithms. Among them, F1-score is the harmonic mean of precision and recall, which can synthetically evaluate the performance of a detection method.
P = T P T P + F P , R = T P T P + F N , F 1 = 2 × P × R P + R
where P, R, and F1  ( 0,1 ) , TP are true positives, FP are false positives, and FN are false negatives.
The mean differences between detection results and corresponding reference features represented the time delays of detection for each event. Meanwhile, a standard deviations was used to evaluate the stability of this detection delay. The lower values of mean and standard implied fewer time delays from the detection algorithm.
Manual markers were used to evaluate the performance of pattern detection and were expressed in steps instead of milliseconds (shown in Figure 9b).

3. Results

3.1. Parameter Evolution in Different Walking Patterns

In the three-dimensional space of the observation sequence x, differences between swing phase and stance phase were obvious in SA (Figure 10b). Detection results at the end of the swing became slightly chaotic with those of load response in LGW (shown in Figure 10a), and detection results of load response and swing were intersected in the space to a certain extent in SD (shown in Figure 10c), which might explain the misidentification of these two sub-phases (shown in Figure 10d).
GMM-μ of initial contact is relatively concentrated (shown in Figure 11a). Several GMM-μ are highly clustered along a line in space. This clustering shows that different models have some compatibility when pattern misidentification occurs. Swing in LGW and SA has the highest stability value in the transition matrix, followed by mid-stance (shown in Figure 11b). The transition probabilities of SD fluctuated more, indicating that different sub-phases have different occupancy lengths within the 10 s training set. This reflects that subjects have greater pattern variability (postural differences in lower limbs or speed changes) in SD.

3.2. Performance Indexes of the Detection Method

In all experiments, the detection algorithm cost only about 1 ms for each event/sub-phase detection loop and 20 ms for each model training loop. The total numbers of complete steps recorded were found to be equal to 2677, 2175, and 2187 in LGW, SA, and SD, respectively. The accuracies of walking pattern detection were 97.8% for LGW, 95.6% for SA, and 97.1% for SD. Events are not always directly decoded due to the small sample size boundaries of different sub-phases used as the corresponding events in this study. Most F1-scores for gait event detection were over 0.90 (shown in Table 2). The F1-score of initial contact in SD is 0.86, as the misidentification of load response and swing increased the total number of samples of initial contact. Another possible factor is that the reference to plantar FSRs produced distortions in some events, such as heel-off in SA and SD.
The mean differences between events were less than 100 ms under the 200 ms tolerable window (shown in Table 3). The mean differences between events and their corresponding knee extension/flexion points are shown in Table 4. The final contact and knee flexion point in SD had the largest time delay, and the others were around 100 ms. A positive mean difference indicates that the event occurs later than its reference, which should be seen as a time delay. A negative one indicates that the event occurs before its reference and can be used for event prediction. The mean difference of initial contact with the knee flexion point in SD has a certain delay of about 137 ms, which shows that knee flexion occurs closer to the foot flat. Then, initial contact is more related to the movement of the ankle joint.

4. Discussion

Event detection of different walking patterns plays an important role in the control of knee IWADs. It helps improve the performance and reliability of these devices in their ability to adjust control strategies to provide more comfortable and efficient assistance. Using only two IMUs on the thigh and foot is a cost-effective, wearable, and easy-to-integrate solution. In this study, the detection method can effectively detect continuous level-ground walking, stair ascent, and stair descent with four gait events of each pattern by using only four dimensions of data without further processing (e.g., gravity compensation, signal fusion, or band-pass filtering) at 100 Hz. In addition, the online analysis on desktop computers lacked practical values when considering daily use and was not indeed performable in wearable robots, and our on-board training method can break these limits. A series of advantages, including only obtaining sensing data from a well-fitting brace structure rather than bio-electricity signals from the wearer, depending on the features of sensing data rather than predefined thresholds, and continuously updating the parameters with online training rather than a fixed model, make the present method easy-to-use.
By using an adaptive algorithm to re-train the gait model every 10 s, the data collection and model training steps are integrated into the detection process, and the effects due to data drift are reduced. Therefore, the present method has fine repeatability and self-adaptability. With the two checkpoints mentioned in Section 2.3.1, the training set contains unpredicted motion behaviors, such as jumping and standing, that are not used for model training. Experiments with free walking on different terrains confirmed that the algorithm has good detection accuracy for different patterns (≥93.6%) and a high score of adaptability to different subjects’ gait (F1-score ≥ 0.876) with stable detection (≤51 ± 32.4 ms). The results of the present study seem to imply that some foot-posture-based events might have a mapping relationship with the feature points of knee extension/flexion (around 100 ms), and the events related to knee extension have some prediction performance in SA and SD. This might be beneficial for the mechanical control of IWADs for walking, according to the Lit [26].
The results presented in this study are comparable to previous results reported for those of previously reported real-time event detection algorithms using inertial sensor data. Xu et al. [27] tested three different algorithms (SVM, QDA, and LDA) with a 10,000 × 80 training set for walking pattern detection. The accuracy of pattern detection was over 95%. The training time was 89 s for SVM, 25 s for QDA, and 10 s for LDA. The detection costs were 12.4 ms (SVM), 5.36 ms (QDA), and 0.067 ms (LDA), respectively. The total accuracy of pattern detection was over 95% on average. Two MCUs were required, one for pattern detection and the other for modeling training. While the pattern detection used in this study is a rule-based algorithm, we made the detection time short to about 1 ms (one-tenth of the 100 Hz detection frequency) and model training short to about 20 ms by using a 1000 × 3 training set and an optimized detection strategy with one single portable MCU. This short-term model training algorithm with low computing costs is feasible to use on portable platforms.
In terms of gait event detection, Andrea et al. [26,28] tested a simulation of online detection with a non-adaptive HMM-based algorithm. Accuracies of initial contact were 93% (LGW) and 91% (SA), those of foot flat were 91% (LGW) and 89% (SA), those of heel-off were 86% (LGW) and 85% (SA), and those of final contact were 90% (LGW) and 85% (SA). This shows that the adaptive method in this study is effective in improving detection accuracy. Hui et al. [29] used a rule-based algorithm and had a high F1-score of over 0.95 in all detections. Sahoo et al. [9] used rule-based algorithms with two IMUs on foot and shank to detect events during different patterns. The accuracy of initial contact detection was 100% (LGW), 99.15% (SA), and 99.49% (SD). The accuracy of final contact detection was 100% (LGW), 99.03% (SA), and 99.37% (SD). But each event detection was based on the previous event; otherwise, the subsequent events could not be detected. In addition, they mentioned that the rule-based algorithm is affected by the speed of movement of the lower limbs. Rule-based walking pattern detection in this study seemed to have similar problems with foot angular velocity, but the gait event detection method seemed to be less affected by speed factors. Time delays presented in this study are comparable to previous results reported for real-time gait event detection algorithms that use data from inertial sensors placed on the lower limbs and evaluated in healthy subjects, Table 5.
There are still some limitations to this study. The training-level algorithm runs every 10 s automatically based on detection rules. Therefore, it is not guaranteed that data from LGW, SA, or SD will be trained into corresponding models with the four-step requirement of the method. Therefore, the gait models of SA and SD might not be updated properly once the walk time or the steps on the stairs are too few. The irregular distributions of detection results presented in Figure 10 indicate that subjects’ locomotor behavior changed due to fatigue induced by prolonged exercise in SA and SD. These factors will also affect the detection accuracy rate. Only the pattern detection of the left sensing leg is tested. However, the condition might be different depending on whether the leg is the leading leg when the pattern changes. This will cause a maximum detection delay of up to 1.5 steps. This delay may cause a short-term negative impact on event detection. In addition, since the detection method was developed to detect three specific walking patterns, it does not have the ability to detect other locomotion. Relevant research to solve these limitations will be carried out in the future.

5. Conclusions

In this paper, a detection method with a short-term model updating strategy is presented for a real-time hybrid algorithm. Three walking patterns and four events of each pattern were detected by using four inertial sensing data from two IMUs on foot and thigh. The short-term model training strategy removes the large amount of data acquisition and model training steps in advance for machine learning. According to the results with ten healthy subjects, the detection system shows good adaptive ability to the subject’s gaits and has a good performance for real-time walking patterns and events in detection. However, the system has a certain pattern detection delay for the single leg, and some periods of swing phase might be misidentified as load responses during stair descent. With the support of the optimized GMM-HMM algorithm, the system has a light calculation burden, which can achieve stable operation at a relatively high detection frequency on a portable MCU. This real-time on-board walking pattern and event detection method is feasible for powered knee assistive device applications after adding additional sensor dimensions or limiting conditions.

Author Contributions

Conceptualization, J.Z., W.C. and X.M.; Methodology, Y.L.; Software, Y.L.; Writing—original draft, Y.L.; Writing—review & editing, J.Z. and W.C.; Supervision, X.M. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Natural Science Foundation of China No. 51905104.

Institutional Review Board Statement

The study was conducted in accordance with the Declaration of Helsinki, and approved by the Ethics Committee of Fudan University (FE22064R, 3/3/2022).

Informed Consent Statement

Written informed consent has been obtained from the subjects to publish this paper.

Data Availability Statement

All data are unavailable due to privacy and ethical restrictions.

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study, in the collection, analysis, or interpretation of data, in the writing of the manuscript, or in the decision to publish the results.

References

  1. Perez-Ibarra, J.C.; Siqueira, A.A.G.; Krebs, H.I. Identification of Gait Events in Healthy Subjects and With Parkinson’s Disease Using Inertial Sensors: An Adaptive Unsupervised Learning Approach. IEEE Trans. Neural Syst. Rehabil. Eng. 2020, 28, 2933–2943. [Google Scholar] [CrossRef]
  2. Roy, A.; Krebs, H.I.; Barton, J.E.; Macko, R.F.; Forrester, L.W. Anklebot-Assisted Locomotor Training after Stroke: A Novel Deficit-Adjusted Control Approach. In Proceedings of the 2013 IEEE International Conference on Robotics and Automation, Karlsruhe, Germany, 6–10 May 2013; pp. 2175–2182. [Google Scholar]
  3. Wang, X.; Feng, S.; Yan, W.Q. Human Gait Recognition Based on Self-Adaptive Hidden Markov Model. IEEE/ACM Trans. Comput. Biol. Bioinform. 2021, 18, 963–972. [Google Scholar] [CrossRef]
  4. Tang, Y.; Li, Z.; Tian, H.; Ding, J.; Lin, B. Detecting Toe-Off Events Utilizing a Vision-Based Method. Entropy 2019, 21, 329. [Google Scholar] [CrossRef] [PubMed]
  5. Ding, Z.; Yang, C.; Wang, Z.; Yin, X.; Jiang, F. Online Adaptive Prediction of Human Motion Intention Based on SEMG. Sensors 2021, 21, 2882. [Google Scholar] [CrossRef]
  6. Godiyal, A.K.; Singh, U.; Anand, S.; Joshi, D. Analysis of Force Myography Based Walking patterns. Measurement 2019, 140, 497–503. [Google Scholar] [CrossRef]
  7. Chowdhury, R.; Reaz, M.; Ali, M.; Bakar, A.; Chellappan, K.; Chang, T. Surface Electromyography Signal Processing and Classification Techniques. Sensors 2013, 13, 12431–12466. [Google Scholar] [CrossRef] [PubMed]
  8. Cho, Y.J.; Lee, C.; Lee, J.H.; Kyung, M.G.; Lee, K.H.; Lee, D.Y. The Difference of In-Shoe Plantar Pressure between Level Walking and Stair Walking in Healthy Males. J. Biomech. 2021, 122, 110446. [Google Scholar] [CrossRef] [PubMed]
  9. Sahoo, S.; Pratihar, D.K.; Mukhopadhyay, S. A Motion Mode Adaptive Strategy for Real-Time Detection of Gait Events During Negotiating Staircases. IEEE Trans. Instrum. Meas. 2021, 70, 1–8. [Google Scholar] [CrossRef]
  10. Li, H.; Derrode, S.; Pieczynski, W. An Adaptive and On-Line IMU-Based Motion Activity Classification Method Using a Triplet Markov Model. Neurocomputing 2019, 362, 94–105. [Google Scholar] [CrossRef]
  11. Allseits, E.; Lučarević, J.; Gailey, R.; Agrawal, V.; Gaunaurd, I.; Bennett, C. The Development and Concurrent Validity of a Real-Time Algorithm for Temporal Gait Analysis Using Inertial Measurement Units. J. Biomech. 2017, 55, 27–33. [Google Scholar] [CrossRef]
  12. Chinimilli, P.T.; Redkar, S.; Sugar, T. A Two-Dimensional Feature Space-Based Approach for Human Motion Recognition. IEEE Sens. J. 2019, 19, 4271–4282. [Google Scholar] [CrossRef]
  13. Sahoo, S.; Saboo, M.; Pratihar, D.K. Real-Time Detection of Actual and Early Gait Events During Level-Ground and Ramp Walking. IEEE Sens. J. 2020, 20, 8128–8136. [Google Scholar] [CrossRef]
  14. Maqbool, H.F.; Husman, M.A.B.; Awad, M.I.; Abouhossein, A.; Iqbal, N.; Tahir, M.; Dehghani-Sanij, A.A. Heuristic Real-Time Detection of Temporal Gait Events for Lower Limb Amputees. IEEE Sens. J. 2019, 19, 3138–3148. [Google Scholar] [CrossRef]
  15. Xu, D.; Feng, Y.; Mai, J.; Wang, Q. Real-Time On-Board Recognition of Continuous Motion Modes for Amputees With Robotic Transtibial Prostheses. IEEE Trans. Neural Syst. Rehabil. Eng. 2018, 26, 2015–2025. [Google Scholar] [CrossRef] [PubMed]
  16. Zhang, F.; Liu, M.; Huang, H. Effects of Motion Mode Recognition Errors on Volitional Control of Powered Above-Knee Prostheses. IEEE Trans. Neural Syst. Rehabil. Eng. 2015, 23, 64–72. [Google Scholar] [CrossRef]
  17. Wu, X.; Zhao, L.; Guo, S.; Zhang, L. Pedestrian Inertial Navigation Based on CNN-SVM Gait Recognition Algorithm. J. Phys. Conf. Ser. 2021, 1903, 012043. [Google Scholar] [CrossRef]
  18. Chen, C.; Du, Z.; He, L.; Shi, Y.; Wang, J.; Dong, W. A Novel Gait Pattern Recognition Method Based on LSTM-CNN for Lower Limb Exoskeleton. J. Bionic Eng. 2021, 18, 1059–1072. [Google Scholar] [CrossRef]
  19. Zhao, H.; Wang, Z.; Qiu, S.; Wang, J.; Xu, F.; Wang, Z.; Shen, Y. Adaptive Gait Detection Based on Foot-Mounted Inertial Sensors and Multi-Sensor Fusion. Inf. Fusion. 2019, 52, 157–166. [Google Scholar] [CrossRef]
  20. Barth, J.; Oberndorfer, C.; Pasluosta, C.; Schülein, S.; Gassner, H.; Reinfelder, S.; Kugler, P.; Schuldhaus, D.; Winkler, J.; Klucken, J.; et al. Stride Segmentation during Free Walk Movements Using Multi-Dimensional Subsequence Dynamic Time Warping on Inertial Sensor Data. Sensors 2015, 15, 6419–6440. [Google Scholar] [CrossRef]
  21. Wang, L.; Sun, Y.; Li, Q.; Liu, T.; Yi, J. Two Shank-Mounted IMUs-Based Gait Analysis and Classification for Neurological Disease Patients. IEEE Robot. Autom. Lett. 2020, 5, 1970–1976. [Google Scholar] [CrossRef]
  22. Sivarathinabala, M.; Abirami, S.; Baskaran, R. Abnormal Gait Recognition Using Exemplar Based Algorithm in Healthcare Applications. Int. J. Commun. Syst. 2020, 33, e4348. [Google Scholar] [CrossRef]
  23. Pérez-Ibarra, J.C.; Siqueira, A.A.G.; Krebs, H.I. Identification of Gait Events in Healthy and Parkinson’s Disease Subjects Using Inertial Sensors: A Supervised Learning Approach. IEEE Sens. J. 2020, 20, 14984–14993. [Google Scholar] [CrossRef]
  24. Rueterbories, J.; Spaich, E.G.; Larsen, B.; Andersen, O.K. Methods for Gait event detection and Analysis in Ambulatory Systems. Med. Eng. Phys. 2010, 32, 545–552. [Google Scholar] [CrossRef] [PubMed]
  25. Sánchez Manchola, M.D.S.; Pinto Bernal, M.J.P.; Munera, M.; Cifuentes, C.A. Gait Phase Detection for Lower-Limb Exoskeletons Using Foot Motion Data from a Single Inertial Measurement Unit in Hemiparetic Individuals. Sensors 2019, 19, 2988. [Google Scholar] [CrossRef]
  26. Figueiredo, J.; Felix, P.; Costa, L.; Moreno, J.C.; Santos, C.P. Gait event detection in Controlled and Real-Life Situations: Repeated Measures From Healthy Subjects. IEEE Trans. Neural Syst. Rehabil. Eng. 2018, 26, 1945–1956. [Google Scholar] [CrossRef]
  27. Xu, D.; Wang, Q. On-Board Training Strategy for IMU-Based Real-Time Motion Recognition of Transtibial Amputees With Robotic Prostheses. Front. Neurorobot. 2020, 14, 47. [Google Scholar] [CrossRef]
  28. Mannini, A.; Genovese, V.; Sabatin, A.M. Online Decoding of Hidden Markov Models for Gait event detection Using Foot-Mounted Gyroscopes. IEEE J. Biomed. Health Inform. 2014, 18, 1122–1130. [Google Scholar] [CrossRef]
  29. Zhou, H.; Ji, N.; Samuel, O.; Cao, Y.; Zhao, Z.; Chen, S.; Li, G. Towards Real-Time Detection of Gait Events on Different Terrains Using Time-Frequency Analysis and Peak Heuristics Algorithm. Sensors 2016, 16, 1634. [Google Scholar] [CrossRef]
Figure 1. (a) Device wearing and installation of IMUs; (b) details of the gait detection device. Several points are set to fix the cables.
Figure 1. (a) Device wearing and installation of IMUs; (b) details of the gait detection device. Several points are set to fix the cables.
Electronics 12 04319 g001
Figure 2. The finite-state machine of the gait model of different patterns: (a) level-ground walking, (b) stair ascent, and (c) stair descent.
Figure 2. The finite-state machine of the gait model of different patterns: (a) level-ground walking, (b) stair ascent, and (c) stair descent.
Electronics 12 04319 g002
Figure 3. Flowchart of the proposed gait-detection algorithms.
Figure 3. Flowchart of the proposed gait-detection algorithms.
Electronics 12 04319 g003
Figure 4. Features of events in different walking patterns.
Figure 4. Features of events in different walking patterns.
Electronics 12 04319 g004
Figure 5. Markov model of the gait events of different walking patterns.
Figure 5. Markov model of the gait events of different walking patterns.
Electronics 12 04319 g005
Figure 6. Features of walking pattern switching. The first column shows the lower limbs’ posture at initial contact with the three walking patterns. Differences in the minimum value of the thigh are used to detect patterns between LGW and SA. The difference of the maximum value of ω f o o t x in the gray areas (150 ms) is used to detect the pattern between LGW and SD.
Figure 6. Features of walking pattern switching. The first column shows the lower limbs’ posture at initial contact with the three walking patterns. Differences in the minimum value of the thigh are used to detect patterns between LGW and SA. The difference of the maximum value of ω f o o t x in the gray areas (150 ms) is used to detect the pattern between LGW and SD.
Electronics 12 04319 g006
Figure 7. The relationship of three Markov chains of three typical walking patterns. Four paths represent the conditions of walking pattern switching in Table 1.
Figure 7. The relationship of three Markov chains of three typical walking patterns. Four paths represent the conditions of walking pattern switching in Table 1.
Electronics 12 04319 g007
Figure 8. Experiment with different walking patterns (22 stairs for each floor, 17 cm height × 26 cm length for each stair, 125 cm length × 130 cm width for each platform).
Figure 8. Experiment with different walking patterns (22 stairs for each floor, 17 cm height × 26 cm length for each stair, 125 cm length × 130 cm width for each platform).
Electronics 12 04319 g008
Figure 9. Comparison of detection results from XXX and reference standards based on (a) gait detection results, foot contact states, and angle of knee. (b) pattern detection results and manual markers of walking patterns.
Figure 9. Comparison of detection results from XXX and reference standards based on (a) gait detection results, foot contact states, and angle of knee. (b) pattern detection results and manual markers of walking patterns.
Electronics 12 04319 g009
Figure 10. Distribution of detection results of different patterns from one subject: (a) LGW, (b) SA, (c) SD, and (d) part of the detection results.
Figure 10. Distribution of detection results of different patterns from one subject: (a) LGW, (b) SA, (c) SD, and (d) part of the detection results.
Electronics 12 04319 g010
Figure 11. Parameters of gait models. (a) distribution of GMM-μ of events in different patterns; (b) Sub-phase distribution of transition matrix with different patterns.
Figure 11. Parameters of gait models. (a) distribution of GMM-μ of events in different patterns; (b) Sub-phase distribution of transition matrix with different patterns.
Electronics 12 04319 g011
Table 1. Rule Base of Walking Pattern Switching.
Table 1. Rule Base of Walking Pattern Switching.
Pattern Switch RuleRemarks
Level-ground
Walking
If thigh angle > thigh angle threshold—15 deg
switch to swing of SA
Meet condition: (a) ω f o o t x m i n < −150 deg/s and ω f o o t x m a x > −20 deg/s and position of ω f o o t x m i n < position of ω f o o t x m a x in the buffer, (b) ω f o o t x (within 300 ms after condition (a) < 30 deg/s and absolute value of the last five data < 9 deg/s.
switch to mid-stance of SD
Stair
Ascent
If (thigh angle < thigh angle threshold-15 deg) when initial contact occurs
switch to initial contact of LGW
Stair
Descent
Meet condition: (a) ω f o o t x m i n < −50 deg/s and ω f o o t x m a x > 50 deg/s and position of ω f o o t x m i n < position of ω f o o t x m a x , (b) ω f o o t x (within 100 ms after condition (a) > 100 deg/s
switch to load response of LGW
ω f o o t x m i n : minimum value of ω f o o t _ x in the ω f o o t x buffer. ω f o o t x m a x : maximum value of ω f o o t x in the buffer.
Table 2. Precision (P), recall (R), and F1-score of event detection.
Table 2. Precision (P), recall (R), and F1-score of event detection.
PRF1
LGWinitial contact0.960.950.95
foot flat0.970.930.95
heel-off0.950.950.95
final contact0.930.930.93
SAinitial contact0.950.950.95
foot flat0.920.920.92
heel-off0.910.900.90
final contact0.950.950.95
SDinitial contact0.860.860.86
foot flat0.930.930.93
heel-off0.910.910.91
final contact0.940.940.94
Table 3. Time delays between detection results and FSR references (mean difference ± 1 standard deviation). Value in ms.
Table 3. Time delays between detection results and FSR references (mean difference ± 1 standard deviation). Value in ms.
Initial ContactFoot FlatHeel-OffFinal Contact
LGW13.5 ± 30.214.9 ± 33.86.9 ± 37.859.9 ± 37.9
SA−27.1 ± 33.947.5 ± 37.1−40.2 ± 36.9−28.4 ± 26.7
SD15.6 ± 17.351 ± 32.4−9.3 ± 39.927.1 ± 39.2
Table 4. Time delays between detection results and knee flexion/extension references (mean difference ± 1 standard deviation). Value in ms.
Table 4. Time delays between detection results and knee flexion/extension references (mean difference ± 1 standard deviation). Value in ms.
Knee FlexionKnee Extension
LGW16.9 ± 58.0 with HO76.9 ± 37.1 with IC
SA73.5 ± 44.9 with FC−29.8 ± 35.7 with IC
SD137.5 ± 27.5 with IC−103.3 ± 77.4 with FC
Table 5. Time delays obtained by real-time algorithms (mean difference ± 1 standard deviation). Value in ms.
Table 5. Time delays obtained by real-time algorithms (mean difference ± 1 standard deviation). Value in ms.
Rule-Based
[9]
Rule-Based
[29]
HMM-Based
[26]
This Study
LGWinitial contact7.95 ± 25.7137.4 ± 41.255.2 ± 10.113.5 ± 30.2
foot flat13.45 ± 68.9-46.1 ± 8.714.9 ± 33.8
heel-off36.8 ± 63.2-43.7 ± 6.76.9 ± 37.8
final contact−11.47 ± 48.5115.8 ± 139.717.3 ± 9.359.9 ± 37.9
SAinitial contact−19.66 ± 92.7173.9 ± 35.644.9 ± 5.2−27.1 ± 33.9
foot flat4.7 ± 31.5-58.9 ± 6.747.5 ± 37.1
heel-off--67.4 ± 8.9−40.2 ± 36.9
final contact12.92 ± 35.369.7 ± 123.124.9 ± 2.6−28.4 ± 26.7
SDinitial contact−47.8 ± 49.7119.5 ± 36.6-15.6 ± 17.3
foot flat24.6 ± 52.9--51 ± 32.4
heel-off---−9.3 ± 39.9
final contact−24.57 ± 46.726.4 ± 88.2-27.1 ± 39.2
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lu, Y.; Zhu, J.; Chen, W.; Ma, X. Inertial Measurement Unit-Based Real-Time Adaptive Algorithm for Human Walking Pattern and Gait Event Detection. Electronics 2023, 12, 4319. https://doi.org/10.3390/electronics12204319

AMA Style

Lu Y, Zhu J, Chen W, Ma X. Inertial Measurement Unit-Based Real-Time Adaptive Algorithm for Human Walking Pattern and Gait Event Detection. Electronics. 2023; 12(20):4319. https://doi.org/10.3390/electronics12204319

Chicago/Turabian Style

Lu, Yinxiao, Jun Zhu, Wenming Chen, and Xin Ma. 2023. "Inertial Measurement Unit-Based Real-Time Adaptive Algorithm for Human Walking Pattern and Gait Event Detection" Electronics 12, no. 20: 4319. https://doi.org/10.3390/electronics12204319

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop