A step length estimation method based on LSTM
By aligning head and foot inertial sensor data and using a long short-term memory neural network model, the problem of insufficient accuracy in step length estimation in indoor positioning technology is solved, achieving high-precision and robust step length estimation.
Patent Information
- Application Number
- CN202510611718.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-05-13
AI Technical Summary
Existing indoor positioning technologies have difficulty adapting to different walking patterns, individual differences, and dynamic changes in complex environments when estimating pedestrian stride length, resulting in accumulated positioning errors and insufficient accuracy.
Data is collected through head and foot inertial sensors, and time alignment and step alignment are performed. A stride length estimation model is constructed using a long short-term memory neural network, and correction is performed in combination with individual factor parameters to improve the accuracy and robustness of stride length estimation.
It effectively eliminates data time deviation, improves the accuracy and robustness of step length estimation, adapts to different walking patterns and individual differences, and meets the needs of high-precision indoor positioning.
Smart Images

Figure CN120252734B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of indoor positioning technology, and in particular to a step length estimation method based on LSTM. Background Art
[0002] Indoor positioning and navigation technology plays a key role in smart devices, robots, and wearable devices, and is widely used in fields such as health monitoring, motion analysis, and smart building management. However, due to the dependence of the Global Navigation Satellite System (GNSS) on the characteristics of satellite signals, it cannot work properly in closed or complex indoor environments. As a result, GNSS-based positioning technology faces serious limitations in indoor applications and cannot meet the needs of high-precision indoor positioning.
[0003] Existing indoor positioning technologies usually require accurate estimation of pedestrians' walking trajectories and positions. Existing methods are based on inertial sensor-based stride length estimation methods, which usually rely on simple empirical formulas or fixed models. They are difficult to adapt to different walking patterns, individual differences, and dynamic changes in complex environments, resulting in accumulated positioning errors and affecting navigation reliability. In addition, solutions based on single sensor data often ignore the information complementary advantages brought by collaborative measurements of multiple parts, limiting the accuracy of the estimation, resulting in significant limitations in the accuracy and robustness of stride length estimation. Summary of the Invention
[0004] An embodiment of the present application provides a step length estimation method based on LSTM, which can solve one of the above-mentioned problems in the prior art.
[0005] In a first aspect, an embodiment of the present application provides a step length estimation method based on LSTM, comprising:
[0006] Collecting data from the head inertial sensor and the foot inertial sensor based on a preset sampling frequency, and performing time alignment and pace alignment on the data to obtain multi-source motion data, wherein the multi-source motion data includes the head motion data and the foot motion data;
[0007] Obtaining a head feature vector based on the head motion data, and obtaining a stride feature vector based on the foot motion data;
[0008] Based on the head feature matrix and the step length feature vector, a step length estimation model is constructed through a long short-term memory neural network, and a step length estimation value is obtained through the step length estimation model.
[0009] Furthermore, the data is collected from the head inertial sensor and the foot inertial sensor based on a preset sampling frequency, and the data is time-aligned and pace-aligned to obtain multi-source motion data, including:
[0010] The head inertial sensor and the foot inertial sensor are used to collect data at the same sampling frequency to obtain a head source data set and a foot source data set;
[0011] According to the time deviation of the head inertial sensor and the foot inertial sensor, the head source dataset and the foot source dataset are time-aligned by using a timestamp alignment method to obtain a head time-aligned dataset and a foot time-aligned dataset;
[0012] Using a peak recognition method, all step points in the foot time alignment dataset are obtained;
[0013] Acquiring foot time alignment data corresponding to each of the step points to generate foot motion data;
[0014] extracting a preset number of head time-aligned data corresponding to the timestamps of the step points from the head time-aligned data set to generate head motion data;
[0015] Based on the same step point, the foot motion data and the head motion data are matched to generate multi-source motion data.
[0016] Furthermore, the preset number of head time alignment data is head time alignment data that can cover a complete gait cycle;
[0017] After generating the head motion data, the method further includes: verifying the validity of the step points based on the head motion data.
[0018] Furthermore, before performing time alignment and pace alignment on the data, it also includes:
[0019] Using a wavelet transform method to perform denoising on the head source dataset and the foot source dataset respectively;
[0020] In the denoising process, the decomposition level of the wavelet transform is set to generate high-frequency components and low-frequency components;
[0021] Identifying sensor noise from the high frequency component and performing noise suppression to generate a suppressed signal component;
[0022] Perform wavelet reconstruction on the suppressed signal component and the low-frequency component to generate a denoised source data set.
[0023] Furthermore, the head motion data includes three-axis acceleration and three-axis angular velocity of the head;
[0024] The step of obtaining a head feature vector based on the head motion data includes:
[0025] Segmenting the head motion data using fixed-length non-overlapping time windows;
[0026] For the three-axis acceleration of the head, calculate the arithmetic mean of each axis in each time window to obtain a three-dimensional acceleration mean feature vector, where the axes include X / Y / Z axes;
[0027] For the three-axis angular velocity of the head, calculate the variance of each axis in each time window to obtain a three-dimensional angular velocity variance feature vector;
[0028] Checking the dimensionality matching between the head acceleration mean feature and the angular velocity variance feature, and splicing the matched head acceleration mean feature and the angular velocity variance feature into a head feature vector in a time window sequence;
[0029] A head feature matrix is generated based on the head feature vectors of multiple time windows.
[0030] Furthermore, the foot motion data includes three-axis acceleration and three-axis angular velocity of the foot;
[0031] The step length feature vector is obtained based on the foot motion data, comprising:
[0032] Calculate the step length eigenvector based on the preset kinematic equation;
[0033] The specific calculation formula of the kinematic equation is as follows:
[0034]
[0035]
[0036]
[0037] in, is the attitude rotation matrix, yes The velocity vector under the system, is the acceleration vector measured in frame b, and yes The angular velocity of the system relative to the e system and the angular velocity of the e system relative to the n system, is the acceleration due to gravity, It's the location.
[0038] Furthermore, after obtaining the step size estimate, the following steps are included:
[0039] The least square method was used to obtain the step size value based on the factor characteristics;
[0040] Based on the step length value, the step length estimation value is processed to obtain a corrected step length.
[0041] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0042] This application discloses a stride length estimation method based on LSTM, which collects motion data through head inertial sensors and foot inertial sensors, and aligns the data in time and pace to eliminate the time deviation of the data. At the same time, the head motion data and foot motion data are aligned at the pace point to improve the accuracy of subsequent stride length estimation. At the same time, a long short-term memory neural network is used to train the stride length estimation model, and the stride length estimation value is corrected in combination with individual factor parameters, thereby improving the accuracy and robustness of the stride length estimation. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0044] Figure 1 This is a flowchart of a step length estimation method based on LSTM provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0045] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0046] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0047] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0048] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0049] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0050] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0051] See also Figure 1 As shown, the present invention is a step length estimation method based on LSTM, comprising the following steps:
[0052] S100, collecting data from a head inertial sensor and a foot inertial sensor based on a preset sampling frequency, and performing time alignment and pace alignment on the data to obtain multi-source motion data, where the multi-source motion data includes head motion data and foot motion data;
[0053] In this application, motion data is collected through head inertial sensors and foot inertial sensors, and the data is time-aligned and pace-aligned to eliminate the time deviation of the data. At the same time, the head motion data and foot motion data are aligned at the pace point to improve the accuracy of subsequent stride length estimation.
[0054] In some embodiments, step S100 includes:
[0055] The head inertial sensor and the foot inertial sensor are used to collect data at the same sampling frequency to obtain a head source data set and a foot source data set;
[0056] According to the time deviation of the head inertial sensor and the foot inertial sensor, the head source dataset and the foot source dataset are time-aligned by using a timestamp alignment method to obtain a head time-aligned dataset and a foot time-aligned dataset;
[0057] Using a peak recognition method, all step points in the foot time alignment dataset are obtained;
[0058] Acquiring foot time alignment data corresponding to each of the step points to generate foot motion data;
[0059] extracting a preset number of head time-aligned data corresponding to the timestamps of the step points from the head time-aligned data set to generate head motion data;
[0060] Based on the same step point, the foot motion data and the head motion data are matched to generate multi-source motion data.
[0061] In this embodiment, a three-axis accelerometer and a gyroscope are respectively worn on the head and the foot, and the inertial data of the person during walking is collected at the same sampling frequency, thereby obtaining a head source data set and a foot source data set. Specifically, data is collected from the head inertial sensor and the foot inertial sensor based on a preset sampling frequency, thereby ensuring the regularity and stability of data collection. The preset sampling frequency can be flexibly set according to specific application scenarios and needs, which can not only meet the requirements for capturing details of motion data, but also avoid data redundancy and increased storage and processing burdens due to too high a sampling frequency, or loss of key information due to too low a sampling frequency, thereby obtaining high-quality and accurate original motion data.
[0062] In this embodiment, for the head inertial sensors and foot inertial sensors, there is a time deviation during the data acquisition process due to factors such as sampling clock differences and data transmission delays. Therefore, a timestamp alignment method is used to time-align the head source data set and the foot source data set. In one possible embodiment, when the timestamp difference between the head inertial sensor and the foot inertial sensor exceeds a time difference threshold, a first-order linear interpolation formula is used to adjust the data point timestamps to achieve time alignment between the inertial sensors.
[0063] Specifically, data is collected synchronously through the head inertial sensors and the foot inertial sensors at a preset sampling frequency, such as 100 Hz. Each time data is collected, the corresponding inertial sensor will record the timestamp corresponding to the current data point, and the collected head source data set and foot source data set will be stored in their respective data buffers and transmitted to the data processing unit. It can be understood that the head source data set and the foot source data set both include acceleration, angular velocity and corresponding timestamps. When performing time alignment, the data processing unit synchronously reads data point pairs from the data buffers of the head inertial sensors and the foot inertial sensors in chronological order, that is, the head data points and foot data points collected at the same time. For each pair of synchronously read data points, the difference ΔT between the timestamp of the head inertial sensor and the timestamp of the foot inertial sensor is calculated. , set the timestamp difference threshold to 5ms. If ΔT≤5ms, it means that the data of the head inertial sensor and the foot inertial sensor are basically aligned in time, no adjustment is required, and the subsequent step alignment step is directly entered; if ΔT>5ms, the first-order linear interpolation adjustment mechanism is triggered. Specifically, if the timestamp of the head inertial sensor lags behind the timestamp of the foot inertial sensor, the timestamp of the head inertial sensor data point needs to be adjusted. At this time, in the head source data set, find two valid data points adjacent to the current data point to be adjusted, respectively recorded as P1 and P2, and the corresponding timestamps are recorded as T1 and T2, and the corresponding sensor data are D1 and D2, respectively. According to the first-order linear interpolation principle, in the time interval [T1, T2], the sensor data D is linearly related to the time T. Therefore, the first-order linear interpolation formula can be expressed as: At this time, the target timestamp T of the data point to be adjusted head Substitute the above formula to calculate the adjusted sensor data: , update the timestamp of the data point to be adjusted to the timestamp T of the corresponding data point of the foot inertial sensor foot , and update the sensor data of the head inertial sensor to D adjusted If the timestamp of the foot inertial sensor lags behind the timestamp of the head inertial sensor, the timestamp of the foot inertial sensor data point is adjusted to obtain the adjusted sensor data of the foot inertial sensor. Through the above steps, the time alignment of each data point in the head source data set and the foot source data set is achieved, thereby obtaining the head time-aligned data set and the foot time-aligned data set.
[0064] In this embodiment, the obtained head time-aligned dataset and foot time-aligned dataset are aligned from the step dimension, that is, by identifying the step cycle in the foot time-aligned dataset, it is matched with the data in the head time-aligned dataset to facilitate subsequent estimation of the stride length.
[0065] When the foot is walking or running, the acceleration change in the vertical direction is the most significant, usually showing a significant positive peak, which can clearly reflect the periodicity of the step. Based on this, in this embodiment, the Z-axis acceleration data in the three-axis acceleration of the foot time-aligned data set is obtained and used as the detection signal of the step point. Specifically, a fixed-size window is slid on the data sequence of the Z-axis acceleration data, and the peak position is determined by analyzing the extreme values of the data in the window. Furthermore, a suitable window size is preset according to the sampling frequency and the step period. For example, if the sampling frequency is 100Hz and the normal walking step period is about 1-1.5s, the window size can be set to 100-150 data points. In addition, a peak threshold is also required. When the maximum value in the window is greater than the peak threshold, the point is determined to be a peak. The peak threshold can be determined based on the statistical value of the Z-axis acceleration data. The characteristics are dynamically determined, such as the peak threshold = μ+2σ, where μ is the mean of each Z-axis acceleration data in the window, and σ is the standard deviation of each Z-axis acceleration data in the window. It can be understood that in the process of sliding the window, when the maximum value of the Z-axis acceleration data in the window is greater than the peak threshold, the maximum value is determined to correspond to the step point, and the window is slid in time sequence to obtain all the step points in the data sequence of the Z-axis acceleration data, and the foot time alignment data corresponding to the step point is recorded, and it is recorded as foot motion data. At the same time, the head time alignment data corresponding to the step point is extracted from the head time alignment data set to generate head motion data. Finally, the foot motion data and head motion data corresponding to the same step point are matched to generate multi-source motion data. It can be understood that multiple step points correspond to multiple multi-source motion data, which are finally integrated into a multi-source motion data set.
[0066] In some embodiments, the preset amount of head time-aligned data is head time-aligned data that can cover a complete gait cycle;
[0067] After generating the head motion data, the method further includes: verifying the validity of the step points based on the head motion data.
[0068] Specifically, the number of head time-aligned data extracted from the head time-aligned data set in step S100 must be able to cover the complete gait cycle. In one possible embodiment, 200 head time-aligned data before and after the detected step point are intercepted as head motion data.
[0069] In this embodiment, for the step point determined in step S100, the gyroscope data in the head motion data is also combined, that is, the angular velocity that can be used to reflect the pitch motion of the head, to verify whether the step point corresponds to the moment when the foot touches the ground. It can be understood that when one foot is completely on the ground and the other foot swings forward, the head will be slightly raised due to the increase in the center of gravity; as the body moves forward, the center of gravity drops, and the head lowers slightly, forming an up and down movement similar to a sine wave. Therefore, the validity of the step point can be confirmed by using the peak recognition method for the Y-axis angular velocity.
[0070] In some embodiments, before performing time alignment and pace alignment on the data, the method further includes:
[0071] Using a wavelet transform method to perform denoising on the head source dataset and the foot source dataset respectively;
[0072] In the denoising process, the decomposition level of the wavelet transform is set to generate high-frequency components and low-frequency components;
[0073] Identifying sensor noise from the high frequency component and performing noise suppression to generate a suppressed signal component;
[0074] Perform wavelet reconstruction on the suppressed signal component and the low-frequency component to generate a denoised source data set.
[0075] In this embodiment, a head acceleration dataset and a head angular velocity dataset are obtained from the head source dataset, and a foot acceleration dataset and a foot angular velocity dataset are obtained from the foot source dataset. The above data are normalized using a standardized preprocessing method to obtain a preprocessed sensor signal dataset. It can be understood that the sensor signal dataset includes a head acceleration dataset, a head angular velocity dataset, a foot acceleration dataset, and a foot angular velocity dataset.
[0076] In this embodiment, each of the above-mentioned sensor signal data sets is decomposed in turn through wavelet transform. Specifically, the decomposition level L of the wavelet transform is set according to the frequency components and noise characteristics of the signal. Generally, the higher the decomposition level, the finer the low-frequency components that can be separated. The preferred decomposition level is 3-5 layers. Then, based on the decomposition level, the corresponding sensor signal data is subjected to L-layer wavelet decomposition to generate a series of high-frequency components and low-frequency components.
[0077] The generated series of high-frequency components usually contain noise and detail information in the signal. Therefore, by analyzing the amplitude distribution and statistical characteristics of the high-frequency components, the frequency band dominated by noise is identified. Specifically, the series of high-frequency components are threshold processed, the coefficients with amplitudes less than the preset threshold are set to zero, and the coefficients with amplitudes greater than the preset threshold are retained. It can be understood that when the amplitude of the high-frequency component exceeds the preset threshold, it is identified as sensor noise and suppressed to generate a suppressed signal component. For the suppressed signal component, it is reconstructed with the low-frequency component by wavelet to generate a denoised source data set. Specifically, the wavelet reconstruction process is achieved by inverse wavelet transform, and the suppressed signal component and the low-frequency component of the high-frequency component are merged layer by layer to finally generate a complete source data set. The noise component of the data in the source data set after wavelet reconstruction is effectively suppressed, while the main features and low-frequency components of the signal are retained. The source data set includes a head source data set and a foot source data set.
[0078] S200: obtaining a head feature vector based on the head motion data, and obtaining a stride feature vector based on the foot motion data;
[0079] In some embodiments, the head motion data includes three-axis acceleration and three-axis angular velocity of the head;
[0080] The step of obtaining a head feature vector based on the head motion data includes:
[0081] Segmenting the head motion data using fixed-length non-overlapping time windows;
[0082] For the three-axis acceleration of the head, calculate the arithmetic mean of each axis in each time window to obtain a three-dimensional acceleration mean feature vector, where the axes include X / Y / Z axes;
[0083] For the three-axis angular velocity of the head, calculate the variance of each axis in each time window to obtain a three-dimensional angular velocity variance feature vector;
[0084] Checking the dimensionality matching between the head acceleration mean feature and the angular velocity variance feature, and splicing the matched head acceleration mean feature and angular velocity variance feature into a head feature vector in a time window sequence.
[0085] Specifically, based on step S100, it can be seen that the head motion data includes multiple three-axis head accelerations and multiple three-axis head angular velocities before and after the timestamp of the step point, where the three axes are x-axis, y-axis and z-axis. The head motion data generated by the multiple three-axis head accelerations and multiple three-axis head angular velocities are segmented using a fixed-length non-overlapping time window, that is, the continuous head motion data is segmented into multiple non-overlapping time windows through a fixed-length time window, avoiding the calculation deviation caused by inconsistent data length, making the features between different windows comparable, and at the same time, the non-overlapping windows make the data of each time window independent, and the features can be calculated in parallel, which significantly improves data processing efficiency.
[0086] Specifically, for the three-axis acceleration of the head, the arithmetic mean of the accelerations of the X-axis, Y-axis, and Z-axis is calculated based on each time window, and then the acceleration means of the three axes are combined into a three-dimensional acceleration mean feature vector, specifically: Similarly, based on each time window, the variance of the angular velocity of the X-axis, Y-axis, and Z-axis is calculated respectively, and then the angular velocity variances of the three axes are combined into a three-dimensional angular velocity variance feature vector, specifically: .
[0087] In this embodiment, the acceleration mean characteristic is ensured and angular velocity variance characteristics The dimensions of are all 3-dimensional, that is, one dimension each for the X, Y, and Z axes. If the dimensions do not match, it is necessary to check whether there are errors in the data segmentation or calculation process. At the same time, the matched acceleration mean features and angular velocity variance features are spliced into a complete head feature vector in the order of time windows. Among them, the head feature vector of the i-th time window is: , and then the head feature vectors of multiple time windows are combined in sequence into a head feature matrix, specifically: .
[0088] In some embodiments, the foot motion data includes three-axis acceleration and three-axis angular velocity of the foot;
[0089] The step length feature vector is obtained based on the foot motion data, comprising:
[0090] Calculate the step length eigenvector based on the preset kinematic equation;
[0091] The specific calculation formula of the kinematic equation is as follows:
[0092]
[0093]
[0094]
[0095] in, is the attitude rotation matrix, yes The velocity vector under the system, is the acceleration vector measured in frame b, and yes The angular velocity of the system relative to the e system and the angular velocity of the e system relative to the n system, is the acceleration due to gravity, It's the location.
[0096] Specifically, based on step S100, it can be seen that the foot motion data includes the three-axis acceleration and three-axis angular velocity of the foot corresponding to the timestamp of the step point, where the three axes are the x-axis, y-axis, and z-axis. For the above foot motion data, the kinematic equation is used to solve and obtain the step length eigenvector. Specifically, the kinematic equation is: , which represents the time derivative of the velocity vector in the n-frame, , then it represents the time derivative of the position vector in the n-system. Further, , which represents the relationship between the change in position vector and the step-length eigenvector. The corresponding step-length eigenvector is obtained by solving the above three kinematic equations.
[0097] As can be understood, the n system represents the navigation system, and the Northeast-Ultra-Sky (ENU) coordinate system is usually selected, that is, the x-axis points to the east, the y-axis points to the north, and the z-axis points to the sky. It is a reference coordinate system used to describe the motion state of the carrier, such as position, speed, attitude, etc., to facilitate navigation-related calculations and analysis; the b system represents the carrier coordinate system, which is usually fixed to the carrier, such as an aircraft, vehicle, ship and other moving objects. Its coordinate origin is generally selected at the center of mass of the carrier, and the direction of the coordinate axis is determined according to the structure and regulations of the carrier. For example, for an aircraft, the x-axis often points along the fuselage to the nose, the y-axis is perpendicular to the fuselage and points to the right side of the fuselage, and the z-axis is determined according to the right-hand rule. It is used to describe the motion parameters of the carrier itself. Numbers, such as acceleration in the carrier coordinate system; the i system represents the inertial system, which is an idealized coordinate system. In this coordinate system, Newton's laws of motion are strictly valid, that is, objects do not rotate or translate with time. It can be used to determine the absolute motion state of an object. Usually, a coordinate system with the center of mass of the earth as the origin and the coordinate axes pointing to fixed stars is selected as an approximation of the inertial system; and the e system represents the local horizontal coordinate system, with the origin at the center of mass of the earth, the x-axis pointing to the intersection of the prime meridian and the equatorial plane, the z-axis pointing to the North Pole along the earth's rotation axis, and the y-axis determined by the right-hand rule. It is usually fixed to the earth and rotates with the earth. It is mainly used to describe information such as the position of objects on the earth.
[0098] Specifically, for The foot triaxial acceleration obtained through steps S100-S200 is the specific force along the sensitive axis of the carrier coordinate system, that is, the "non-gravitational acceleration" after deducting the gravity acceleration. Therefore, the foot triaxial acceleration needs to be converted into the real acceleration in the b system. Specifically, through the attitude rotation matrix Convert the gravity vector to the b system and combine it with the specific force, that is, the three-axis acceleration of the foot to obtain ,but ,in, represents the three-axis acceleration of the foot, and g represents the gravitational acceleration of the measurement ground.
[0099] Since the earth rotates in inertial space, Describe the speed and direction of the rotation of the inertial system i relative to the earth coordinate system e. In the approximate case, the angular velocity of the earth's rotation is Based on this, the angular velocity vector in the e system is obtained , and through the attitude rotation matrix Convert the angular velocity vector to the b system, specifically, .
[0100] Since the navigation system has a fixed direction relative to the earth's surface, and the earth is rotating, the angular velocity of the e system relative to the n system is Characterizes the rotation of the e system relative to the navigation system n. The determination of can usually be calculated based on the longitude and latitude of the carrier's location and the earth's rotation angular velocity. That is, first determine the angle between the n-system and e-system coordinate axes based on the longitude and latitude, then combine the earth's rotation angular velocity vector and convert the earth's rotation angular velocity into the n-system through the coordinate transformation matrix to obtain .
[0101] For the attitude rotation matrix , is obtained by calculating the three-axis angular velocity of the foot. Specifically, it is assumed that the initial posture rotation matrix of the object is the unit matrix R(0)=I, where I is a 3×3 unit matrix. For the three-axis angular velocity of the foot, the three-axis angular velocity of the foot measured by the foot inertial sensor at a certain sampling frequency is recorded as At each sampling time k, the posture is updated by numerical integration method, specifically the first-order Euler integral, that is, ,in, represents the attitude angle vector, Represents the sampling interval, and then converts the attitude angle into a rotation matrix. The attitude is represented by Euler angles. The rotation order of the Euler angles is z, y, x, representing yaw, pitch, and roll respectively. The rotation matrix R can be expressed as: ,in, are the basic rotation matrices around the x, y, and z axes, respectively. 、 as well as They are roll angle, pitch angle and yaw angle. At each sampling moment, the attitude angle is updated according to the newly measured three-axis angular velocity of the foot, and then the rotation matrix is updated. The above steps are repeated continuously, and the attitude rotation matrix is calculated in real time through the angular velocity of the foot inertial sensor. In some embodiments, it is also necessary to consider issues such as sensor error and integral error accumulation, and use filtering algorithms such as Kalman filtering to improve the accuracy and stability of attitude rotation matrix estimation.
[0102] S300: Based on the head feature matrix and the stride feature vector, a stride estimation model is constructed through a long short-term memory neural network, and a stride estimation value is obtained through the stride estimation model.
[0103] In this application, a long short-term memory neural network is used to train a step length estimation model, and the step length estimation value is corrected in combination with individual factor parameters, thereby improving the accuracy and robustness of the step length estimation.
[0104] In this embodiment, in the process of constructing the step length estimation model, the head feature vector is used as the input feature and the step length feature vector is used as the output feature. By training the long short-term memory neural network, a step length estimation model is finally generated to estimate the step length.
[0105] In some embodiments, after obtaining the step length estimate, the method includes:
[0106] The least square method was used to obtain the step size value based on the factor characteristics;
[0107] Based on the step length value, the step length estimation value is processed to obtain a corrected step length.
[0108] In practical applications, stride length is usually affected by multiple factors, such as height, cadence, stride time, etc. Therefore, it is necessary to establish a linear relationship model between factor characteristics and stride length, and then correct the stride length estimation value obtained by the stride length estimation model. Specifically, based on the historical stride length data of different individuals, a linear relationship model is constructed to obtain corresponding factor characteristics for different individuals, where the factor characteristics include height H, cadence F, and stride time T. The factor characteristics are used as input features and the historical stride length data are used as output features to construct a linear relationship model, specifically L=β0+β1H+β2F+β3T, where β0 represents the intercept term, β1, β2, and β3 represent feature weights, and then the feature weights are solved by the normal equation. The normal equation is specifically: , where X represents the factor feature matrix, and finally the linear relationship model of the step length is obtained. Through the linear relationship model, the step length value based on the pedestrian factor characteristics can be obtained. The step length value is fused with the step length estimation value to obtain the corrected step length. The calculation formula of the fusion calculation is as follows: , where L represents the correction step size, Indicates the step value, Represents the step length estimate. For the weight parameter w, it is dynamically determined by the mean absolute error of the linear relationship model and the step length estimation model in the recent N steps, where , represents the mean absolute error of the linear relationship model, , represents the mean absolute error of the step-size estimation model, and the final weight parameter is .
[0109] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A step length estimation method based on LSTM, characterized in that: include: Collecting data from the head inertial sensor and the foot inertial sensor based on a preset sampling frequency, and performing time alignment and pace alignment on the data to obtain multi-source motion data, wherein the multi-source motion data includes the head motion data and the foot motion data; Obtaining a head feature vector based on the head motion data, and obtaining a stride feature vector based on the foot motion data; Wherein, the head motion data includes the head three-axis acceleration and the head three-axis angular velocity; The step of obtaining a head feature vector based on the head motion data includes: Segmenting the head motion data using fixed-length non-overlapping time windows; For the three-axis acceleration of the head, calculate the arithmetic mean of each axis in each time window to obtain a three-dimensional acceleration mean feature vector, where the axes include X / Y / Z axes; For the three-axis angular velocity of the head, calculate the variance of each axis in each time window to obtain a three-dimensional angular velocity variance feature vector; Checking the dimensionality matching between the head acceleration mean feature and the angular velocity variance feature, and splicing the matched head acceleration mean feature and the angular velocity variance feature into a head feature vector in a time window sequence; Generate a head feature matrix based on the head feature vectors of multiple time windows; Based on the head feature matrix and the step length feature vector, a step length estimation model is constructed through a long short-term memory neural network, and a step length estimation value is obtained through the step length estimation model.
2. The method according to claim 1, wherein The method collects data from the head inertial sensor and the foot inertial sensor based on a preset sampling frequency, and performs time alignment and pace alignment on the data to obtain multi-source motion data, including: The head inertial sensor and the foot inertial sensor are used to collect data at the same sampling frequency to obtain a head source data set and a foot source data set; According to the time deviation of the head inertial sensor and the foot inertial sensor, the head source dataset and the foot source dataset are time-aligned by using a timestamp alignment method to obtain a head time-aligned dataset and a foot time-aligned dataset; Using a peak recognition method, all step points in the foot time alignment dataset are obtained; Acquiring foot time alignment data corresponding to each of the step points to generate foot motion data; extracting a preset number of head time-aligned data corresponding to the timestamps of the step points from the head time-aligned data set to generate head motion data; Based on the same step point, the foot motion data and the head motion data are matched to generate multi-source motion data.
3. The method according to claim 2, wherein The preset number of head time alignment data is head time alignment data that can cover a complete gait cycle; After generating the head motion data, the method further includes: verifying the validity of the step points based on the head motion data.
4. The method according to claim 2, wherein Before time-aligning and pace-aligning the data, also include: Using a wavelet transform method to perform denoising on the head source dataset and the foot source dataset respectively; In the denoising process, the decomposition level of the wavelet transform is set to generate high-frequency components and low-frequency components; Identifying sensor noise from the high frequency component and performing noise suppression to generate a suppressed signal component; Perform wavelet reconstruction on the suppressed signal component and the low-frequency component to generate a denoised source data set.
5. The method according to claim 1, wherein The foot motion data includes three-axis acceleration and three-axis angular velocity of the foot; The step length feature vector is obtained based on the foot motion data, comprising: Calculate the step length eigenvector based on the preset kinematic equation; The specific calculation formula of the kinematic equation is as follows: ; ; ; in, is the attitude rotation matrix, yes The velocity vector under the system, represents the time derivative of the velocity vector in the n-frame, is the acceleration vector measured in frame b, and yes The angular velocity of the system relative to the e system and the angular velocity of the e system relative to the n system, is the acceleration due to gravity, is the position vector in the n-frame, represents the time derivative of the position vector in the n-frame, Represents the position vector change, SL represents the step length characteristic vector, n represents the navigation system, b represents the carrier coordinate system, i represents the inertial system, and e represents the local horizontal coordinate system.
6. The method according to claim 1, wherein After obtaining the step size estimate, include: The least square method was used to obtain the step size value based on the factor characteristics; Based on the step length value, the step length estimation value is processed to obtain a corrected step length.
Citation Information
Patent Citations
Pedestrian step length estimation method and system based on neural network
CN118149820A
Personalized step length online estimation method and device, mobile terminal and storage medium
CN119789203A