Step length estimation model acquisition method, step length estimation method, device and medium
By constructing step estimation features and optimizing training sample weights using AdaBoost and ridge regression models, the problem of insufficient personalized parameter adaptability and accuracy of step estimation methods in the prior art is solved, and the accuracy of step estimation model and the reliability of indoor positioning system are improved.
Patent Information
- Application Number
- CN202210110455.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-29
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-01-29
AI Technical Summary
The existing pedestrian step length estimation methods have shortcomings in the adaptability and accuracy of personalized parameters, resulting in a decrease in the reliability of indoor positioning systems.
By obtaining the target trend segment in single-step data, the step length estimation feature is constructed, and the AdaBoost learning method and ridge regression model are used for model training, the weight of the sample data during the training process is optimized, and the step length estimation model is constructed to improve the accuracy of the model.
The accuracy and applicability of the step length estimation model are improved and the reliability of the indoor positioning system is enhanced.
Smart Images

Figure CN116558507B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of indoor positioning technology, and more specifically relates to a step length estimation model acquisition method, a step length estimation method, a device and a medium. Background Art
[0002] With the development and application of technologies such as the Internet, the Internet of Things, and smart mobile devices, as well as the ever-expanding scale and comprehensive functionality of modern buildings, the demand for indoor positioning is growing. Compared to methods that rely on various auxiliary devices such as Bluetooth, Wi-Fi, UWB, and radio frequency identification for indoor pedestrian positioning, positioning technology based on inertial sensors offers the advantages of small size, low cost, and the lack of pre-deployment of auxiliary equipment, making it well-suited for large-scale deployment. Pedestrian step length estimation is a key factor in indoor positioning accuracy. However, in practical applications, the limited adaptability of a single step length model to individual pedestrian parameters significantly reduces system reliability over time.
[0003] Currently, commonly used pedestrian stride length estimation methods include direct integration, filtering, and constructing stride length models. The direct integration method involves performing primary and secondary integration and integration of indoor pedestrian acceleration data collected by sensors to determine the pedestrian's stride length. This method does not address sensor drift errors and has very low accuracy. The Kalman filter method, by establishing measurement and state equations and filtering errors probabilistically, can improve accuracy to a certain extent. However, in practical applications, the accuracy and stability remain unsatisfactory. Constructing a single stride length model generally relies heavily on the individual parameters of the target object, leaving limited room for optimization and presenting significant challenges in practical use.
[0004] Therefore, how to improve the accuracy and applicability of the step length estimation model has become one of the urgent problems to be solved in this field. Summary of the Invention
[0005] In view of the above shortcomings in the prior art, the purpose of the present invention is to provide a walking state data collection method, system, device and medium, which is used to solve the problems such as the inability to directly obtain valid walking data matching the standard pace template in the existing walking state collection process, resulting in the inability to timely obtain the efficiency or abnormality rate of data collection.
[0006] To achieve the above-mentioned purpose and other related purposes, the present invention provides a method for obtaining a step length estimation model in a first aspect, comprising: obtaining a target trend segment in each single step data; extracting the step state data corresponding to the target trend segment as a target data segment; constructing each step length estimation feature based on the target data segment; constructing a step length estimation model based on each step length estimation feature, and determining a model training target for the step length estimation model; wherein the step length estimation model includes hyperparameters and feature parameters corresponding to each step length estimation feature; obtaining an optional parameter group corresponding to the hyperparameter in the step length estimation model based on the parameter range of each hyperparameter; and determining a model training target for the step length estimation model based on the optional parameter range of each hyperparameter. The number of combinations of parameter groups is selected to determine the total number of training rounds of the step length estimation model; based on the weights of each optional parameter group of the hyperparameter and the sample data, each round of optimization training is performed on the step length estimation model until the number of optimization training rounds reaches the total number of optimization training rounds, and the step length estimation fusion model corresponding to each round of optimization training is obtained; combining the optional parameter groups and each step length estimation fusion model to obtain each step length estimation test model; using each sample data in the single step data verification set, the corresponding step length estimation error is obtained based on each step length estimation test model; based on the minimum step estimation error, the optimal step estimation model is determined in each step length estimation test model.
[0007] In one embodiment of the present invention, the weights of each optional parameter group and sample data based on the hyperparameters are used to perform rounds of optimization training on the step length estimation model until the number of rounds of optimization training reaches the total number of rounds of optimization training. When performing a single round of optimization training, it includes: selecting an optional parameter group that does not participate in the optimization training; based on the optional parameter combination, determining the first basic model of step length estimation to be optimized and trained as the first basic model of step length estimation for the current period; based on the weights of each training sample in each single step data training set, using each training sample, the AdaBoost learning method is used to repeatedly perform the training process on the first basic model of step length estimation until the training result meets the model training goal; then the second basic model of step length estimation obtained after each training is fused to obtain the step length estimation fusion model corresponding to the current round of optimization training.
[0008] In one embodiment of the present invention, based on the weight of each training sample in each single-step data training set, using each training sample, the AdaBoost learning method is used to repeatedly perform the training process on the current step length estimation first basic model until the training result meets the model training goal, when performing a single model training, it includes: obtaining the weight distribution of each current training sample; based on the weight distribution of each current training sample, using the ridge regression model to perform current model training on the current step length estimation first basic model to determine the value of each feature parameter in the current step length estimation first basic model, thereby obtaining the step length estimation second basic model after the current model training; based on the estimated step length and actual step length of each sample data, obtaining the current step length estimation second basic model Based on the maximum error and relative exponential error in each training sample; based on the weight of each training sample and the relative exponential error, obtain the total model error rate of the current model training; based on the total model error rate of the current model training and the total model error rate of the previous model training, obtain the difference information between the two as the model training result of the current model training; detect whether the model training result of the current model training meets the model training objective; if so, obtain the step size estimation fusion model corresponding to the current round of optimization training, and perform the next round of model optimization training; if not, update the weight of each sample data in the current training, and continue to perform the next model training based on the updated weight, until the model training result obtained meets the model training objective.
[0009] In one embodiment of the present invention, the method of updating the weight of each sample data in the current training includes: updating the weight of each training sample in the current model training based on the total weight coefficient and relative exponential error of the current model training to obtain the updated weight of each training sample.
[0010] In one embodiment of the present invention, the second basic models of step length estimation obtained after each training are fused to obtain the step length estimation fusion model corresponding to the current round of optimization training, including: after executing each model training, obtaining the second basic model of step length estimation and each total model error corresponding to each model training; combining each total model error with the corresponding second basic model of step length estimation to obtain each second basic model of step length estimation containing the total model error; accumulating each second basic model of step length estimation containing the total model error to obtain the step length estimation fusion model.
[0011] In one embodiment of the present invention, the step length estimation features are constructed based on the target data segment, including at least: the trend segment ratio, which is the ratio of the data length of the target data segment in the corresponding single step data; the trend segment signal energy, which is the numerical value of the step status data corresponding to the target data segment; the trend segment signal change rate, which is the numerical change rate between the maximum value of each step status data in the target data segment and the minimum value of each step status data.
[0012] In one embodiment of the present invention, obtaining a target trend segment from each single step data includes: constructing n groups of sliding windows with successively increasing window widths based on the number of single step samples in the single step data, such that the maximum window width in each group of sliding windows is no greater than 1 / 2 of the number of single step samples; obtaining a corresponding target trend segment from each single step data based on each of the sliding windows; wherein, when executed for each single step data, the steps include: extracting the acceleration mean of the sampling points within each window based on each group of sliding windows to obtain a sequence of acceleration mean values corresponding to each group of sliding windows for the single step data; obtaining the acceleration mean of each sampling point in the acceleration mean value sequence corresponding to each sampling point in the single step data as a change trend of the sampling point; determining whether each sampling point has corresponding change trend information by detecting whether the change trend corresponding to each sampling point satisfies a preset change trend determination condition, thereby obtaining change trend information for each sampling point; obtaining each change trend segment in the single step data based on the change trend information of each sampling point; and comparing the data lengths of the change trend segments, selecting the change trend segment with the longest length as the target trend segment for the corresponding step data.
[0013] In one embodiment of the present invention, the change trend determination condition includes an upward trend determination condition and a downward trend determination condition: wherein, the upward trend determination condition includes: as the window width of each group of sliding windows increases successively, the average acceleration corresponding to each sliding window decreases successively; and the downward trend determination condition includes: as the window width of each group of sliding windows increases successively, the average acceleration corresponding to each sliding window increases successively.
[0014] In a second aspect, the present invention provides a stride length estimation method, comprising: obtaining single-step data of the step length to be estimated; obtaining an optimized and trained stride estimation optimal model according to any of the above-mentioned stride length estimation model acquisition methods; and performing stride length estimation on the single-step data based on the stride estimation optimal model to obtain stride length information corresponding to the single-step data.
[0015] In a third aspect, the present invention further provides an electronic device comprising: a memory, a processor and a communicator; wherein the memory is used to store computer instructions; and the processor executes the computer instructions to implement any of the step length estimation model acquisition methods described above.
[0016] In a fourth aspect, the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the above-mentioned step length estimation model acquisition methods.
[0017] As described above, the step length estimation model acquisition method, step length estimation method, device and medium provided by the present invention construct each step length estimation feature based on the target data segment corresponding to the target trend segment; construct a step length estimation model based on each step length estimation feature, and determine the model training target of the step length estimation model; based on the weight of each training sample, perform each round of optimization training on the step length estimation model to obtain each step length estimation fusion model; and combine the optional parameter group corresponding to the model hyperparameter with each step length estimation fusion model to obtain each step length estimation test model; use each sample data in the single step data verification set to obtain each step length estimation test model. The step length estimation error corresponding to the test model is used to obtain the optimal step estimation model; the data features in the target data segment with high correlation with the step length information in the single step data are involved in the model training of the step length estimation, thereby improving the estimation accuracy of the step length estimation model; and, in the model training, weighted model training is performed based on the weights of the training samples. For samples with large step length estimation errors, the proportion of the estimation error of such samples in the weighted sum of the estimation errors of the entire training set can be increased through iterative training of the model, thereby improving the estimation results of the trained model for samples with originally poor performance, thereby optimizing the step length estimation model and improving the estimation accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Schematic diagram of the distribution of single step data on the x-axis, y-axis, and z-axis in the walking motion space in one embodiment of the present invention;
[0019] Figure 2 A schematic flow chart of the step length estimation model training method provided by the present invention in one embodiment;
[0020] Figure 3 A schematic diagram of a flow chart of the specific execution of step S100 in one embodiment of the present invention;
[0021] Figure 4 A schematic diagram of the process of executing step S102 in one embodiment of the present invention;
[0022] Figure 5 A schematic diagram of the process of performing a single round of model optimization training in step S500 according to one embodiment of the present invention;
[0023] Figure 6 A flowchart of step S502 in one embodiment of the present invention when performing a single round of model optimization training;
[0024] Figure 7 A schematic flow chart of the step length estimation method provided by the present invention in one embodiment; DETAILED DESCRIPTION
[0025] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0026] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.
[0027] In order to solve the technical problems existing in the prior art, the present invention provides a method for obtaining a step length estimation model in one embodiment; the step length estimation model is used to obtain step length information corresponding to single step data.
[0028] The single-step data is the motion state information of the tester collected by the acquisition device (such as an inertial sensor) during the tester's single step, including acceleration fusion data, which is the acceleration data after the x-axis acceleration and the z-axis acceleration are fused.
[0029] In other embodiments, the single-step data also includes: one or more single-axis sensor data among x-axis acceleration, y-axis acceleration, z-axis acceleration, x-axis gyroscope data, y-axis gyroscope data and z-axis gyroscope data, and / or a fusion of one or more single-axis sensor data, which is not limited here.
[0030] See also Figure 1 , which is a schematic diagram showing the distribution of single-step data on the x-axis, y-axis and z-axis in the walking motion space; Figure 1 As shown, the x-axis is the same as the forward and backward direction of walking and parallel to the ground; the y-axis is perpendicular to the forward and backward direction of walking and parallel to the ground; and the z-axis is perpendicular to the ground.
[0031] See also Figure 2 , which is a flow chart of the step length estimation model training method in one embodiment.
[0032] like Figure 2 As shown, the method includes the following steps:
[0033] S100, obtaining the target trend segment in each single step data;
[0034] The target trend segment is the change trend segment with the longest data length among the change trend segments of the single-step data; and the change trend segment is a set of adjacent sampling points whose change trends satisfy the same change trend condition.
[0035] Specifically, such as Figure 3 As shown, step S100, when specifically executed, includes:
[0036] S101, constructing n groups of sliding windows with increasing window widths based on the single-step sampling number of the single-step data, wherein the maximum window width in each group of sliding windows is no greater than 1 / 2 of the single-step sampling number;
[0037] The single-step sampling number is the total number of sampling points (hereinafter referred to as "sampling points") at which walking state collection is performed in a single step phase.
[0038] Optionally, the single-step sampling number can be determined according to the acquisition frequency of the sensor and the acquisition time of the single-step data.
[0039] Specifically, the collection frequency of the walking data is 100 Hz, and the single step time is 2500 milliseconds, so the number of single step samples is determined to be 25; three groups of sliding windows are constructed, namely the first sliding window, the second sliding window, and the third sliding window; the width of the first sliding window is set to 3; the width of the second sliding window is set to 6, which is twice the width of the first sliding window; the width of the third sliding window is set to 12, which is twice the width of the second sliding window, and the third sliding window is the sliding window with the largest width, and its corresponding sliding window width is no more than 1 / 2 of the number of single step samples; the step size of each group of sliding windows is 1.
[0040] It should be noted that in other embodiments, each group of sliding windows is set to have the same sliding window width difference, and the sliding window width increases in sequence; that is, the width difference between the second sliding window and the first sliding window is the same as the width difference between the third sliding window and the second sliding window.
[0041] S102, based on each sliding window, obtaining a corresponding target trend segment in each single step data;
[0042] For any of the single-step data, such as Figure 4 As shown, step S102, when specifically executed, includes:
[0043] S1021, based on each group of sliding windows, extracting the acceleration mean of the sampling points in each window to obtain a sequence of acceleration mean values corresponding to each group of sliding windows for single step data;
[0044] The acceleration mean within the sliding window is the mean information of the acceleration fusion data corresponding to each sampling point within a single sliding window;
[0045] Specifically, based on the first sliding window, the mean value of the acceleration fusion data in each window of the first sliding window is obtained in sequence, and used as the mean acceleration value corresponding to the sampling point at the end position in each window, thereby obtaining the acceleration mean value sequence corresponding to the first sliding window of the single step data;
[0046] Based on the above method, similarly, the second acceleration mean value sequence corresponding to the second sliding window of the single step data is obtained, and the third acceleration mean value sequence corresponding to the third sliding window of the single step data is obtained, that is:
[0047]
[0048]
[0049]
[0050] Among them, acc_norm_m3 k acc_norm_m6 is the first acceleration mean value data in the first acceleration mean value sequence; k acc_norm_m12 is the second acceleration mean value data in the second acceleration mean value sequence; k acc_norm is the third acceleration mean data in the third acceleration mean sequence; k Fusion data for each acceleration.
[0051] S1022: Obtaining the acceleration mean value in the acceleration mean value sequence corresponding to each sampling point in the single step data as a change trend of the sampling point; determining whether each sampling point has corresponding change trend information by detecting whether the change trend corresponding to each sampling point satisfies the change trend determination condition according to a preset change trend determination condition, thereby obtaining the change trend information of each sampling point;
[0052] The change trend information includes an upward trend and a downward trend; and the change trend determination condition includes an upward trend determination condition and a downward trend determination condition.
[0053] In a specific embodiment, the upward trend determination condition includes: as the window width of each group of sliding windows increases successively, the acceleration mean corresponding to each sliding window decreases successively; that is,
[0054] cond_0=(acc_norm_m3 k >acc_norm_m6 k)&
[0055] (acc_norm_m6 k >acc_norm_m12 k ),k=1,2,…,N (4)
[0056] Where cond0 represents an upward trend. Formula 4 above indicates that the first acceleration mean corresponding to a single sampling point is greater than the second acceleration mean, and the second acceleration mean is greater than the third acceleration mean. That is, the acceleration mean values of a single sampling point corresponding to the first sliding window to the third sliding window decrease in magnitude.
[0057] The downward trend determination condition includes: as the window width of each group of sliding windows increases, the acceleration mean corresponding to each sliding window increases, that is:
[0058] cond_1=(acc_norm_m3 k <acc_norm_m6 k )&
[0059] (acc_norm_m6 k <acc_norm_m12 k ),k=1,2,…,N (5)
[0060] Here, cond_1 represents a downward trend. Formula 5 above indicates that the first acceleration mean corresponding to a single sampling point is smaller than the second acceleration mean, and the second acceleration mean is smaller than the third acceleration mean. That is, the acceleration mean values of a single sampling point corresponding to the first sliding window to the third sliding window increase in magnitude.
[0061] For each sampling point in the single-step data, it is determined whether the mean acceleration values corresponding to the sampling point meet the rising trend determination condition. If so, it is determined that the sampling point has rising trend information. If not, it is determined whether the mean acceleration values corresponding to the sampling point meet the falling trend determination condition. If so, it is determined that the sampling point has falling trend information, thereby obtaining the change trend sequence corresponding to the single-step data.
[0062] S1023, based on the change trend information of each sampling point, obtaining each change trend segment in the single step data; by comparing the data lengths of each change trend segment, taking the change trend segment with the longest length as the target trend segment of the corresponding step data.
[0063] Specifically, adjacent sampling points with the same change trend information in the change trend sequence are divided into the same change trend segment, thereby dividing the change trend sequence into a plurality of change trend segments; that is, in the same change trend segment, the change trend information of each sampling point is the same.
[0064] The number of sampling points in each trend segment is extracted as the data length of the trend segment; the more sampling points there are in the same trend segment, the longer the length of the corresponding trend segment.
[0065] By comparing the data lengths of the various change trend segments, the change trend segment with the longest data length is obtained as the target change trend segment corresponding to the single-step data.
[0066] The above steps S1021 to S1023 are performed on each single step data, thereby obtaining the target change trend segment corresponding to each single step data.
[0067] S200, extracting the step state data corresponding to each target trend segment as a target data segment; constructing a step length estimation feature based on the target data segment;
[0068] In this embodiment, the starting point and the ending point corresponding to each target trend segment are obtained; wherein the starting point is the sampling point with the earliest sampling time among the sampling points corresponding to a single target trend segment; and the ending point is the sampling point with the latest sampling time among the sampling points corresponding to a single target trend segment.
[0069] Based on the starting point and the ending point, the walking state data corresponding to each sampling point between the starting point and the ending point are extracted from the single step data as the step state data segment corresponding to the target trend segment, that is:
[0070] tre_seg={acc_norm i}, i=1,2,3,…M (6)
[0071] Among them, tre_seg is the target data segment; acc_norm i is the i-th step state data, that is, the i-th acceleration fusion data; M is the number of sampling points in the target data segment.
[0072] Specifically, based on the target data segment, each step length estimation feature is constructed, including:
[0073] tre_fea={trend_per, trend_power, trend_pow_mean, trend_ang} (7)
[0074] Among them, tre_fea is the set of estimated features of each step size; trend_per is the proportion of trend segments; trend_power is the energy of trend segment signals; trend_pow_mean is the average energy of trend segment signals; trend_ang is the rate of change of trend segment signals;
[0075] The specific construction methods of each step-size estimation feature are described as follows:
[0076] 1) Trend segment proportion
[0077] is the ratio of the target data segment to the corresponding single-step data, that is:
[0078]
[0079] Wherein, trend is the trend proportion; length(tre_seg) is the number of sampling points in the target data segment tre_seg; N is the number of sampling points in the corresponding single step data;
[0080] 2) Trend segment signal energy
[0081] is the numerical value of the pace state data corresponding to the target data segment, that is;
[0082]
[0083] Among them, trend_power is the energy of trend segment signal; acc_norm p is the acceleration fusion data corresponding to each sampling point in the target data segment; length(tre_seg) is the number of sampling points in the target data segment;
[0084] 3) Average energy of trend segment signal
[0085] is the numerical value of the step state data corresponding to each sampling point in the target data segment, that is:
[0086]
[0087] Wherein, trend_pow_mean is the average energy of the trend segment signal; trend_power is the energy of the trend segment signal; length(tre_seg) is the number of sampling points in the target data segment;
[0088] 4) Trend segment signal change rate
[0089] is the numerical change rate between the maximum value of each step state data and the minimum value of each step state data in the target data segment; that is:
[0090]
[0091] Among them, trend_ang is the rate of change of the trend segment signal; max(tre_seg) is the maximum value of each step status data in the target data segment; min(tre_seg) is the minimum value of each step status data in the target data segment; length(tre_seg) is the number of sampling points in the target data segment.
[0092] S300: constructing a step length estimation model based on the step length estimation features and determining a model training target for the step length estimation model; wherein the step length estimation model includes hyperparameters and feature parameters corresponding to each of the step length estimation features;
[0093] Specifically, based on the above-mentioned step length estimation features, a step length estimation model is constructed as follows:
[0094] L=ζ*trend_per r +β*trend_power s +η*trend_pow_mean u +θ*trend_ang v +k0 (12)
[0095] Where trend_per, trend_power, trend_pow_mean, and trend_ang are the step-size estimation features constructed above. The coefficients ζ, β, η, and θ before the feature terms are the characteristic parameters of the step-size estimation model. r, s, u, and v are the hyperparameters of the step-size estimation model, which are used to construct more flexible features. k0 is a model constant.
[0096] It should be noted that in the process of training the model, a quadratic or cubic hyperparameter may have a better step size estimation effect than a linear feature.
[0097] According to the step length estimation model, the model training target corresponding to the step length estimation model is determined as:
[0098] The absolute value of the difference between the model error rate obtained in the current model training and the model error rate obtained in the previous model training is not greater than an error rate threshold; that is,
[0099] Determine the training target of the step size estimation model as:
[0100] abs(e m -e m-1 )<∈ (13)
[0101] Among them, abs(e m -e m-1) is the absolute value of the difference between the model error rate obtained in the current model training and the model error rate obtained in the previous model training. The details will be expanded later; ∈ is the error rate threshold.
[0102] Optional, 0<∈<0.001.
[0103] S400, determining a parameter range of each hyperparameter in the step length estimation model; obtaining an optional parameter group corresponding to each hyperparameter in the step length estimation model based on the parameter range of each hyperparameter; and determining a total number of training rounds for the step length estimation model based on the number of combinations of the optional parameter groups;
[0104] In this embodiment, in order to prevent overfitting in model training, the parameter range of each hyperparameter is limited;
[0105] Specifically, set r, s, u, and v to be less than g, where g is a positive integer not greater than 5;
[0106] Optionally, g is 3, that is, the value range of r, s, u, v is set to 1 to 3; in this embodiment, there are 3 optional parameter combinations of r, s, u, v 4 =81 combinations;
[0107] Based on the total number of combinations of optional parameter combinations, the total number of training rounds is determined to be the same as the total number of combinations, that is, the total number of training rounds Q is 81.
[0108] In other embodiments, in order to further improve the training efficiency of the model, a random generation method is adopted to generate p groups of hyperparameter combinations; wherein p is an integer less than 81; and the total number of training rounds Q of the step size estimation model is set equal to p.
[0109] S500, performing rounds of optimization training on the step-size estimation model based on the weights of the optional parameter groups of the hyperparameters and the sample data until the number of rounds of optimization training reaches the total number of rounds of optimization training, and obtaining a step-size estimation fusion model corresponding to each round of optimization training;
[0110] In this embodiment, the AdaBoost learning method is used to perform rounds of optimization training on the step-size estimation model.
[0111] Specifically, such as Figure 5 As shown in the figure, this step includes the following sub-steps when performing a single round of model optimization training:
[0112] S501, selecting an optional parameter group that has not participated in optimization training; based on the optional parameter combination, determining a first basic model for step length estimation to be optimized and trained as the first basic model for step length estimation in the current period;
[0113] The first basic model for step length estimation is a step length estimation model in which hyperparameters are determined but characteristic parameters are not yet determined.
[0114] S502, based on the weight of each training sample in each single-step data training set, using each training sample, adopts the AdaBoost learning method to repeatedly perform the training process of the first basic model of the current step length estimation until the training result meets the model training goal; then the second basic model of the step length estimation obtained after each training is fused to obtain the step length estimation fusion model corresponding to the current round of optimization training; return to execute step S501.
[0115] Regarding step S502, when performing a single model training, if Figure 6 As shown, the execution process includes:
[0116] S5021, obtaining the weight distribution of each current training sample;
[0117] Specifically, the weight distribution of each training sample is:
[0118] D m ={ω m,i},i=1,2,3,…,S0,m=1 (14)
[0119] Among them, ω m,i Optimize the weight of the i-th training sample in the m-th round of model training;
[0120] It should be noted that, during the first training process of each round of model optimization training, the weights of all sample data are set to be the same, that is, when m=1;
[0121]
[0122] S5022: Based on the weight distribution of each current training sample, perform current model training on the current first basic model for step length estimation using a ridge regression model to determine the values of each of the characteristic parameters in the current first basic model for step length estimation, thereby obtaining a second basic model for step length estimation after current model training;
[0123] Among them, the second basic model for step length estimation is the step length estimation model determined by hyper parameters and characteristic parameters.
[0124] Specifically, based on the weight distribution of the current training samples, the goal is to minimize the weighted sum of the training sample errors, and the complexity of the model feature parameters is used as a constraint term to construct a ridge regression model:
[0125]
[0126]
[0127] Among them, train_err represents the cumulative error of the step size estimation in the current model training process;
[0128] λ*||ζ,β,η,θ|| 2 It is used to constrain the complexity of the model feature parameters to prevent the model from overfitting; λ is a specified hyperparameter.
[0129] S0 is the number of training samples in the training sample set of single-step data; ω m,i is the sample weight of the i-th training sample in the current training process; where m is the number of times the training process has been executed in the current round of optimization training; dist i is the actual step length of the i-th training sample; y i is the estimated step length of the i-th training sample, and is the estimated step length obtained based on the current step length estimation model.
[0130] By solving the ridge regression model using an optimization method, the values of the characteristic parameters of the current step length estimation first basic model can be obtained, thereby obtaining the currently trained second basic model of step length estimation.
[0131] Optionally, the optimization method includes a stochastic gradient descent algorithm.
[0132] S5023, based on the estimated step length and the actual step length of each sample data, obtain the maximum error and relative exponential error of the second model estimated by the current step length in each training sample;
[0133] Specifically, the maximum error E of the second basic model estimated by the current step size in each training sample is calculated. m ,for:
[0134] E m =max{abs(dist i -u i )},i=1,2,3,…,S0 (18)
[0135] Among them, abs(dist i -y i ) is the absolute value of the error of the second basic model estimated by the current step size in each training sample;
[0136] Calculate the relative exponential error err_rel of the current step size estimation second basic model in each training sample i ,for:
[0137]
[0138] Among them, dist i is the actual step length corresponding to the i-th step in each training sample, yi is the estimated step size of the model output;
[0139] S5024: Based on the weight of each training sample in the current model training and the corresponding relative exponential error, obtain a total model error rate of the current model training; based on the total model error rate of the current model training and the total model error rate of the previous model training, obtain difference information between the two as a model training result of the current model training;
[0140] Specifically, based on the weight ω of each training sample in the current model training m,i and the corresponding relative index error err_rel i , get the total model error rate e of the current model training m ,for:
[0141]
[0142] Based on the total model error rate of the current model training and the total model error rate corresponding to the previous model training, the absolute value of the difference between the two is calculated as the model training result of the current model training, which is:
[0143] abs(e m -e m-1 ) (twenty one)
[0144] Among them, abs(e m -e m-1 ) is the absolute value of the difference between the total model error rate of the current model training and the total model error rate of the previous model training.
[0145] S5025, detect whether the model training result of the current model training meets the model training goal; if so, fuse the step length estimation second basic model obtained in the current round of optimization training with each model training to obtain the step length estimation fusion model corresponding to the current round of optimization training, and perform the next round of model optimization training; if not, update the weight of each sample data in the current model training process, and continue to perform the next model training based on the updated weight until the model training result meets the model training goal.
[0146] Specifically, it is detected whether the absolute value of the difference of the total model error rate is less than a preset difference threshold, that is:
[0147] abs(e m -e m-1 )<∈ (23)
[0148] If the above formula 23 is not satisfied, it is determined that the model training result of the current model training does not meet the model training goal, and the execution includes:
[0149] 1) Based on the ridge regression model, obtain the second basic model of step length estimation after the current model training;
[0150] Specifically, based on the ridge regression model, the model parameters of the step length estimation basic model, namely ζ, β, δ, η, θ, are obtained, so as to determine the second basic model of step length estimation after the current model training.
[0151] 2) Based on the total model error rate of the current model training, calculate the total weight coefficient α of the current model training m ,for:
[0152]
[0153] Where m is the number of times the model training has been executed in the current round of optimization training.
[0154] 3) Based on the total weight coefficient and relative exponential error of the current model training, the weight of each training sample in the current model training is updated to obtain an updated weight of each training sample;
[0155] Right now
[0156]
[0157]
[0158] Among them, Z m is the preset normalization factor, ω m,i is the weight of each sample in the current model training, ω m+1,i is the updated weight of each sample, which is used to perform the next model training.
[0159] 4) Based on the updated sample weights, continue to perform the next model training, that is, return to step S5021, until the model training result meets the model training goal.
[0160] If the above formula 23 is satisfied, the model training result of the current model training process is determined. If the model training goal is met, the following is executed:
[0161] 1) Fusing the second basic models of step length estimation obtained in each model training of the current round of optimization training to obtain a step length estimation fusion model;
[0162] Specifically, after executing each model training, the step length estimation second basic model corresponding to each model training and the corresponding total model errors are obtained; the total model errors are combined with the corresponding step length estimation second basic model to obtain the step length estimation second basic models containing the total model error; the step length estimation second basic models containing the total model error are accumulated to obtain the step length estimation fusion model.
[0163] Furthermore, when this step is executed, it also includes:
[0164] Normalizing each of the total model errors to obtain normalized total model errors; combining each normalized total model error with the corresponding step-size estimated second basic model to obtain each step-size estimated second basic model containing the total model error, that is, fusing multiple step-size estimated second basic models, is as follows:
[0165]
[0166]
[0167]
[0168] Among them, L i The second basic model of step length estimation obtained after executing the i-th model training, that is, the second basic model of step length estimation obtained in the current round of optimization training; α i Estimate the weight of the second basic model for the i-th step; α′ i is the weight after normalizing the weight of the second basic model estimated at the i-th step size; Formula 31 is the normalization process of the weights of each model.
[0169] 2) Updating the optional parameter group to perform the next round of optimization training based on the updated optional parameter group.
[0170] Repeat step S501 to step S502 until the number of optimization training rounds performed reaches the total number of optimization training rounds, that is, the number of optimization training rounds performed is the same as the number of combinations of the optional parameter combinations; and after each round of model optimization training is completed, the corresponding step length estimation fusion model is obtained, and then the step length estimation fusion model set is obtained, which is: G Q ,p=1,2,…,Q。
[0171] S600, combining the optional parameter group and each step length estimation fusion model to obtain each step length estimation test model; according to each sample data in the single step data verification set, based on each step length estimation test model, obtain the corresponding step length estimation error; based on each step estimation error, determine the optimal step estimation model in each step length estimation test model.
[0172] Specifically, the optional parameter groups corresponding to the hyperparameter groups r, s, t, u, and v are respectively substituted into the step length estimation fusion models to obtain the step length estimation test models. Based on the step length estimation test models, the step length of each sample data in the single-step verification data set is estimated to obtain the estimation error of each group of step length estimation, which is:
[0173]
[0174]
[0175] Among them, err Q Estimate the fusion model for each step size; the sum of squared errors of each sample data in the validation set; dist k is the actual step length of each sample data in the validation set, y k is the estimated step length of each sample data in the validation set; G Q,k is the step length estimation result of each step length estimation fusion model for each sample data, M Q is the number of step length estimation base models included in each step estimation fusion model, α′ i is the weight of each base model, L i is the estimation result of each base model.
[0176] Among the estimation errors of each group of step length estimation, determine the estimation error group with the smallest sum of squared errors, and then determine the step length estimation test model corresponding to the estimation error group with the smallest sum of squared errors as the optimal step length estimation model; that is:
[0177]
[0178] Among them, opt (r,s,u,v) is the estimated error group with the smallest sum of squared errors; r′, s′, u′, v′ are the optional parameter groups corresponding to the estimated error group with the smallest sum of squared errors, then the optimal model for step size estimation is:
[0179]
[0180]
[0181] Based on the above description of the step length estimation model acquisition method, the present invention provides a step length estimation method in one embodiment.
[0182] See also Figure 7 , which is a flow chart of the step length estimation method in one embodiment. Figure 7 As shown, the step length estimation method includes:
[0183] S31, obtaining a training set and a validation set of single-step data, and obtaining single-step test data for which the step length is to be estimated;
[0184] Among them, the training set includes sample data used to train the step length estimation model; the verification set includes sample data for verifying the step length estimation test models obtained after training; and each sample data includes single step data and actual step length information corresponding to the single step data.
[0185] Specifically, for a single stride dataset dataset = {stride_segi, i = 1, 2, 3, ..., S}, a random sampling method is used to extract 9 / 10 of the data to form the training set testset = {stride_segk, k = 1, 2, 3, ..., S0}, and 1 / 10 of the data is extracted to form the validation set validset = {stride_segj, j = 1, 2, 3, ..., S1}, and S0 + S1 = S;
[0186] S32, based on each sample data in the training set and the validation set, using the stride length estimation model acquisition method of the present invention to acquire a trained stride length estimation optimal model;
[0187] Specifically, the specific implementation process of this step is the same as Figure 1 The implementation process of the step length estimation model acquisition method shown is the same and will not be repeated here.
[0188] S33, using the trained step estimation optimal model, performing step length estimation on the single step test data to obtain step length information corresponding to the single step test data.
[0189] In order to solve the technical problems existing in the prior art, the present invention also provides an electronic device in one embodiment; the electronic device includes: a processor, a communicator and a memory; wherein the memory is used to store a computer program; when the processor calls the computer program, it executes the step length estimation model acquisition method described in the present invention and / or the step length estimation method described in the present invention; the communicator is used to establish a connection with one or more acquisition devices to obtain the data of each single step.
[0190] In some embodiments, the number of memories in the data terminal device can be one or more, the number of processors can be one or more, and the number of communicators can be one or more.
[0191] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. The memory stores an operating system and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof. The operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks.
[0192] The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0193] The communicator is preferably a communication port.
[0194] In some specific applications, the various components of the electronic device are coupled together via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus, and a status signal bus.
[0195] In one embodiment of the present invention, the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is called by a processor, it implements the step length estimation model acquisition method described in the present invention and / or the step length estimation method described in the present invention.
[0196] Among them, a computer-readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. The computer-readable storage medium can be, for example, (but not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, and a mechanical encoding device.
[0197] The computer-readable program described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.
[0198] The computer program instructions for performing the operations of the present application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and procedural programming languages such as "C" or similar programming languages.
[0199] The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In some embodiments, the state information of the computer-readable program instructions is utilized to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), which can execute the computer-readable program instructions, thereby implementing various aspects of the present application.
[0200] In summary, the step length estimation model acquisition method, step length estimation method, device and medium provided by the present invention construct each step length estimation feature based on the target data segment corresponding to the target trend segment; construct a step length estimation model based on each step length estimation feature, and determine the model training target of the step length estimation model; perform each round of optimization training on the step length estimation model based on the weight of each training sample, so as to obtain each step length estimation fusion model; and combine the optional parameter group corresponding to the model hyperparameter with each step length estimation fusion model to obtain each step length estimation test model; use each sample data in the single step data verification set to obtain the step length estimation error corresponding to each step length estimation test model, and obtain the step estimation optimal model; by incorporating the data features in the target data segment with high correlation with the step length information in the single step data into the model training of the step length estimation, the estimation accuracy of the step length estimation model is improved. Accuracy; and, in model training, weighted model training is performed based on the weights of the training samples. For samples with large step-size estimation errors, the iterative training of the model can increase the proportion of the estimation error of such samples in the weighted sum of the estimation errors of the entire training set. Therefore, compared with the original model, the estimation results of the trained model for samples with poor performance of the original model can be improved, thereby optimizing the step-size estimation model; and, the fused estimation model obtained through multiple rounds of iterations can achieve higher estimation accuracy for samples in the training set than the single estimation model, and the fused estimation model also has better generalization than the single model; in addition, based on the corresponding parameter range of the model hyperparameters, the corresponding optional parameter group is determined, and then the total number of rounds of optimization training performed by the model is determined, so that the training efficiency of the model can be extracted, and the probability of overfitting in model training is effectively reduced, further improving the training efficiency of the model.
[0201] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.
Claims
1. A step length estimation model acquisition method, characterized in that: include: Obtain the target trend segment in each single step data; Extracting the pace state data corresponding to the target trend segment as the target data segment; Constructing each step length estimation feature based on the target data segment; Based on each of the step length estimation features, construct a step length estimation model and determine a model training target for the step length estimation model; wherein the step length estimation model includes hyperparameters and feature parameters corresponding to each of the step length estimation features; Based on the parameter range of each hyperparameter, obtaining an optional parameter group corresponding to the hyperparameter in the step length estimation model; based on the number of combinations of the optional parameter groups, determining the total number of training rounds of the step length estimation model; Based on the weights of the optional parameter groups of the hyperparameters and the sample data, performing each round of optimization training on the step length estimation model until the number of rounds of optimization training reaches the total number of rounds of optimization training, thereby obtaining a step length estimation fusion model corresponding to each round of optimization training; Combining the optional parameter group and each step length estimation fusion model, each step length estimation test model is obtained; using each sample data in the single step data verification set, the corresponding step length estimation error is obtained based on each step length estimation test model; based on the minimum step estimation error, the optimal step estimation model is determined in each step length estimation test model.
2. The step length estimation model acquisition method according to claim 1, characterized in that: The step size estimation model is subjected to rounds of optimization training based on the weights of the optional parameter groups of the hyperparameters and the sample data until the number of rounds of optimization training reaches the total number of rounds of optimization training, and when a single round of optimization training is performed, the optimization training comprises: An optional parameter group that does not participate in the optimization training is selected; based on the optional parameter combination, a first basic model for step length estimation to be optimized and trained is determined as the first basic model for step length estimation in the current period; Based on the weight of each training sample in each single-step data training set, the AdaBoost learning method is used to repeatedly train the first basic model of step length estimation using each training sample until the training result meets the model training objective; the second basic model of step length estimation obtained after each training is fused to obtain the step length estimation fusion model corresponding to the current round of optimization training.
3. The step length estimation model acquisition method according to claim 2, characterized in that: The method of repeatedly performing the model training process on the first basic model of the current step length estimation using the AdaBoost learning method based on the weight of each training sample in each single-step data training set until the training result meets the model training goal includes: Get the weight distribution of each current training sample; Based on the weight distribution of each current training sample, the current model training is performed on the current step length estimation first basic model using the ridge regression model to determine the value of each characteristic parameter in the current step length estimation first basic model, thereby obtaining the step length estimation second basic model after the current model training; Based on the estimated step length and actual step length of each sample data, obtain the maximum error and relative exponential error of the second basic model estimated by the current step length in each training sample; Based on the weight of each training sample and the relative exponential error, a total model error rate of the current model training is obtained; based on the total model error rate of the current model training and the total model error rate of the previous model training, a difference between the two is obtained as a model training result of the current model training; Detect whether the model training result of the current model training meets the model training goal; if so, obtain the step size estimation fusion model corresponding to the current round of optimization training, and perform the next round of model optimization training; if not, update the weights of each sample data in the current training, and continue to perform the next model training based on the updated weights until the model training result is obtained to meet the model training goal.
4. The step length estimation model acquisition method according to claim 3, characterized in that: The implementation method of updating the weight of each sample data in the current training includes: Based on the total weight coefficient and relative exponential error of the current model training, the weight of each training sample in the current model training is updated to obtain the updated weight of each training sample.
5. The step length estimation model acquisition method according to claim 3, characterized in that: The step length estimation second basic model obtained after each training is fused to obtain a step length estimation fusion model corresponding to the current round of optimization training, including: After executing each model training, obtaining the step-size estimated second basic model and each total model error corresponding to each model training; Combining each of the total model errors with the corresponding step-size estimated second basic model to obtain each step-size estimated second basic model including the total model error; The second basic models of each step-size estimation including the total model error are accumulated to obtain a step-size estimation fusion model.
6. The step length estimation model acquisition method according to claim 1, characterized in that: The step length estimation features are constructed based on the target data segment, and at least include: The trend segment ratio is the ratio of the target data segment to the corresponding single-step data; The trend segment signal energy is the numerical value of the step state data corresponding to the target data segment; The trend segment signal change rate is the numerical change rate between the maximum value of each step status data and the minimum value of each step status data in the target data segment.
7. The step length estimation model acquisition method according to claim 1, characterized in that: The step of obtaining the target trend segment in each single step data includes: Based on the single-step sampling number of the single-step data, construct n groups of sliding windows with increasing window widths, so that the maximum window width in each group of sliding windows is no greater than 1 / 2 of the single-step sampling number; Based on each sliding window, a corresponding target trend segment is obtained in each single step data; wherein, When executing each of the single-step data, the execution includes: Based on each group of sliding windows, the acceleration mean of the sampling points in each window is extracted respectively to obtain the acceleration mean sequence corresponding to each group of sliding windows for the single step data; Obtaining the acceleration mean value in the acceleration mean value sequence corresponding to each sampling point in the single step data as the change trend of the sampling point; determining whether each sampling point has corresponding change trend information by detecting whether the change trend corresponding to each sampling point satisfies the change trend determination condition according to a preset change trend determination condition, thereby obtaining the change trend information of each sampling point; Based on the change trend information of each sampling point, each change trend segment in the single step data is obtained; by comparing the data lengths of each change trend segment, the change trend segment with the longest length is used as the target trend segment of the corresponding step data.
8. The step length estimation model acquisition method according to claim 7, characterized in that: The change trend determination condition includes an upward trend determination condition and a downward trend determination condition: wherein, The upward trend determination condition includes: as the window width of each group of sliding windows increases, the acceleration mean corresponding to each sliding window decreases; and The downward trend determination condition includes: as the window width of each group of sliding windows increases successively, the acceleration mean corresponding to each sliding window increases successively.
9. A step length estimation method, characterized in that: include: Obtain training and validation sets of single-step data, and obtain single-step test data for which step length is to be estimated; Based on each sample data in the training set and the validation set, obtaining an optimized stride estimation optimal model after optimization training according to the stride length estimation model acquisition method according to any one of claims 1 to 8; Based on the step estimation optimal model, the single-step test data is processed to obtain step length information corresponding to the single-step test data.
10. An electronic device, characterized in that: include: A memory, a processor and a communicator; wherein the memory is used to store computer instructions; the processor executes the computer instructions to implement the step length estimation model acquisition method as described in any one of claims 1 to 8.
11. A computer storage medium storing a computer program, wherein: When the computer program is executed by a processor, the step length estimation model acquisition method according to any one of claims 1 to 8 is implemented.