Position and posture determination method, position and posture determination device, medium and electronic equipment
The inertial data is solved and processed through the attention mechanism, intermediate features are extracted and the pose data is optimized, which solves the pose accuracy problem affected by sensor errors and improves the accuracy and stability of the pose solution.
Patent Information
- Application Number
- CN202210270278.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-03-18
AI Technical Summary
In the existing technology, the pose solution results are easily affected by sensor errors, resulting in low pose accuracy. Especially when the pose changes greatly, the accumulated error in the integral operation will increase sharply, causing the solution results to be inaccurate. deviation.
The attention mechanism is used to solve and process the inertial data at multiple sampling moments, extract intermediate features, determine the first pose data based on the features, and optimize based on the inertial data and pose data to output more accurate second pose data. , reduce dependence on sensors.
The accuracy of pose data is improved, especially when there is a large error in the inertial data, it can more accurately reflect the actual pose characteristics, reduce the deviation of the pose solution results, and enhance the stability of the system.
Smart Images

Figure CN114659520B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of navigation and positioning technology, and in particular to a posture determination method, a posture determination device, a computer-readable storage medium, and an electronic device. Background Art
[0002] With the popularization of informatization, more and more services based on posture information are being developed. For example, by tracking the posture of pedestrians in real time, we can provide services such as motion trajectory drawing, indoor navigation, and augmented reality; based on the real-time posture of the camera during mobile shooting, we can reconstruct the scene in three dimensions.
[0003] In the related art, the accuracy of posture is too dependent on the accuracy of the sensor, and is therefore easily affected by sensor errors, resulting in the inability to provide stable services.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to those skilled in the art. Summary of the invention
[0005] The present disclosure provides a posture determination method, a posture determination device, a computer-readable storage medium and an electronic device to improve the accuracy of posture at least to a certain extent.
[0006] According to a first aspect of the present disclosure, a posture determination method is provided, comprising: acquiring inertial data at multiple sampling moments; determining attention weights corresponding to the sampling moments based on the inertial data at the multiple sampling moments; extracting intermediate features from the inertial data at the multiple sampling moments using the attention weights, and determining first posture data based on the intermediate features; and outputting second posture data at at least one target moment based on the inertial data and the first posture data.
[0007] According to a second aspect of the present disclosure, a posture determination device is provided, comprising: a data acquisition module, configured to acquire inertial data at multiple sampling moments; a weight processing module, configured to determine the attention weights corresponding to the sampling moments according to the inertial data at the multiple sampling moments; a first posture data processing module, configured to extract intermediate features from the inertial data at the multiple sampling moments using the attention weights, and determine the first posture data according to the intermediate features; and a second posture data processing module, configured to output second posture data of at least one target moment based on the inertial data and the first posture data.
[0008] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for determining the posture of the first aspect and its possible implementation methods are implemented.
[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the posture determination method of the first aspect and its possible implementation method by executing the executable instructions.
[0010] The technical solution disclosed in this disclosure has the following beneficial effects:
[0011] This solution uses the attention mechanism to solve the inertial data of multiple sampling moments to extract intermediate features and determine the first pose data. It fully considers the importance of the inertial data of a single sampling moment in the time period and utilizes the correlation between the inertial data of different sampling moments, so that the intermediate features can better reflect the characteristic information of the more important inertial data. In particular, when there are large errors in some inertial data, the proportion of the characteristic information of the inertial data in the intermediate features can be reduced, which is beneficial to improve the accuracy of the first pose data and the second pose data obtained by subsequent optimization, and reduce the dependence of the pose solution results on the sensor.
[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1 A schematic diagram showing a system architecture in this exemplary embodiment;
[0015] Figure 2 A flow chart of a method for determining a position and posture in this exemplary embodiment is shown;
[0016] Figure 3 A schematic diagram showing a pose estimation network and its processing of inertial data in this exemplary embodiment;
[0017] Figure 4 A sub-flow chart of a method for determining a posture in this exemplary embodiment is shown;
[0018] Figure 5 A schematic flow chart of a method for determining a posture in this exemplary embodiment is shown;
[0019] Figure 6A schematic diagram showing forward propagation and reverse propagation in this exemplary embodiment;
[0020] Figure 7 A schematic diagram of the structure of a posture determination device in this exemplary embodiment is shown;
[0021] Figure 8 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION
[0022] Exemplary embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, the exemplary embodiments can be implemented in various forms and should not be construed as being limited to the examples set forth herein. These embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concept of the exemplary embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, the known technical solutions are not shown or described in detail to avoid obscuring the various aspects of the present disclosure.
[0023] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0024] In the related technology, after using the posture-related sensors on the mobile terminal to collect sensor data, integral calculation is usually used to solve the posture of the mobile terminal. This solution is generally suitable for the mobile terminal to be in a relatively stable state. If the posture of the mobile terminal changes greatly, the accumulated error of the integral calculation will increase sharply, resulting in a large deviation in the posture solution result.
[0025] In view of one or more of the above problems, an exemplary embodiment of the present disclosure first provides a posture determination method, which can be used to determine the posture of a mobile terminal, which is generally equivalent to the posture of a target (such as a user) holding or installing the mobile terminal. Figure 1 The system architecture and application scenarios of the operating environment of this exemplary embodiment are exemplarily described.
[0026] Figure 1 A schematic diagram of a system architecture is shown, and the system architecture 100 may include a mobile terminal 110 and a computing device 120. The mobile terminal 110 may be a smart phone, a tablet computer, a wearable device, an unmanned vehicle, a drone, etc. The mobile terminal 110 includes at least an inertial sensor for sensing inertial data of the mobile terminal 110. The computing device 120 may be a terminal computer or a server providing positioning-related services. The mobile terminal 110 and the computing device 120 may be connected via a wired or wireless communication link to exchange data.
[0027] In one implementation, the mobile terminal 110 may send the inertial data to the computing device 120. For example, when the user is exercising with the mobile terminal 110, the mobile terminal 110 sends the inertial data to the computing device 120 in real time. The computing device 120 obtains the posture data of the mobile terminal 110 by executing the posture determination method, and may return the result to the mobile terminal 110. Therefore, the computing device 120 may be the execution subject of the posture determination method.
[0028] In one implementation, this exemplary implementation may also be implemented independently based on the mobile terminal 110. For example, after the mobile terminal 110 collects inertial data through a built-in inertial sensor, the mobile terminal 110 executes the above-mentioned posture determination method to obtain the posture data of the mobile terminal 110. Therefore, the execution subject of the above-mentioned posture determination method may also be the mobile terminal 110.
[0029] Combine the following Figure 2 The method for determining the position and posture in this exemplary embodiment is described. Figure 2 An exemplary process of the posture determination method is shown, which may include:
[0030] Step S210, acquiring inertial data at multiple sampling moments;
[0031] Step S220, determining the attention weight corresponding to the sampling moment according to the inertial data at the above-mentioned multiple sampling moments;
[0032] Step S230, extracting intermediate features from the inertial data at the above multiple sampling moments using the attention weights, and determining the first pose data according to the intermediate features;
[0033] Step S240: output second posture data at at least one target moment based on the inertial data and the first posture data.
[0034] In the above-mentioned posture determination method, the attention mechanism is used to solve the inertial data of multiple sampling moments to extract intermediate features and determine the first posture data. The importance of the inertial data of a single sampling moment in the time period is fully considered, and the correlation between the inertial data at different sampling moments is utilized, so that the intermediate features can better reflect the characteristic information of the more important inertial data. In particular, when there are large errors in some inertial data, the proportion of the characteristic information of the inertial data in the intermediate features can be reduced, which is beneficial to improve the accuracy of the first posture data and the second posture data obtained by subsequent optimization, and reduce the dependence of the posture solution results on the sensor.
[0035] Below Figure 2 Each step in the procedure is described in detail.
[0036] In step S210 , inertial data at multiple sampling moments are acquired.
[0037] The above-mentioned inertial data may be raw data output by the inertial sensor, i.e., inertial data without further processing. In this exemplary embodiment, the inertial sensor may include one or more of an accelerometer, a gyroscope, and a magnetometer, wherein the accelerometer may output acceleration data (Acc data), the gyroscope may output angular velocity data (Gyrodata), and the magnetometer may output magnetometer data (Mag data). Depending on the type of inertial sensor configured by the mobile terminal 110, the above-mentioned inertial data may include one or more of acceleration data, angular velocity data, and magnetometer data.
[0038] The sampling time may be the time when the inertial sensor collects inertial data. For example, the sensing frequency of the inertial sensor is 50 Hz, that is, the period is 20 ms, which means that the inertial sensor collects inertial data every 20 ms. The 0th ms may represent the time when the inertial sensor collects inertial data for the first time, and the sampling time may include the 0th ms, the 20th ms, the 40th ms, etc.
[0039] The sensing frequencies of different types of inertial sensors may be the same or different. In one embodiment, when the sensing frequencies of at least two inertial sensors are different, the frequencies of inertial data output by the different types of inertial sensors may be the same by upsampling or downsampling the data of at least one of the inertial sensors.
[0040] There may be a time error between different types of inertial sensors. For example, an accelerometer outputs acceleration data at time t, and a gyroscope outputs angular velocity data at time t. Due to the response delay of the sensor itself, the delay in data transmission, and other factors, the acceleration data at time t and the angular velocity data actually correspond to different data sensing times. In one embodiment, the time error between different types of inertial sensors can be corrected in advance, for example, the time error between the accelerometer and the gyroscope can be calibrated in combination with other or external sensors, and the time error can be minimized as much as possible through compensation.
[0041] Continue to refer Figure 2 In step S220, the attention weight corresponding to the sampling moment is determined according to the inertial data of the above-mentioned multiple sampling moments.
[0042] The attention weight is used to indicate the importance of the inertial data at a single sampling moment within a period of time (which may be a period of time consisting of the above-mentioned multiple sampling moments, and the period of time may also be understood as the context information of the inertial data). Generally, the correlation between the inertial data at different sampling moments may be calculated, and the attention weight may be determined accordingly.
[0043] In this exemplary embodiment, the attention weight can be represented by a vector or a matrix, but the present disclosure does not limit this. For example, assume that inertial data of T sampling moments are obtained in step S210, and the T sampling moments are respectively recorded as sampling moment 1, sampling moment 2, ..., sampling moment T, and the inertial data of the T sampling moments are respectively recorded as IMU1, IMU2, ..., IMU T . It can be calculated by IMU1, IMU2, ..., IMU T The correlation between the inertial data at each sampling moment and the inertial data at other sampling moments can be calculated to obtain the T groups of attention weights corresponding to the T sampling moments. Each group of attention weights is used to indicate the importance of the inertial data at the corresponding sampling moment in the time period from sampling moment 1 to T. The T groups of attention weights corresponding to each sampling moment can also be obtained by calculating the correlation between the inertial data at each sampling moment and the inertial data at other sampling moments. For example, the T group of attention weights corresponding to sampling moment 2 can be recorded as k 21 , k 22 , k 23 , …, k 2T , where k 21 is the attention weight associated with sampling time 1 corresponding to sampling time 2, indicating the importance of sampling time 2 when calculating the pose data of sampling time 1, k 23 is the attention weight associated with sampling time 3 corresponding to sampling time 2, indicating the importance of sampling time 2 when calculating the posture data of sampling time 3.
[0044] In one embodiment, the attention weight can be determined according to the similarity between the inertial data at different sampling moments. For example, for the inertial data IMU1, IMU2, ..., IMU T , the similarity between IMU1 and IMU2 can be calculated, and the similarity can be numerically mapped (such as normalized) as the attention weight associated with sampling time 2 corresponding to sampling time 1. Alternatively, the similarity between IMU1 and IMU2, ..., IMU T The similarity between them is calculated to obtain the similarity value of group T-1, which is then fused and subjected to numerical mapping processing to obtain the attention weight corresponding to sampling time 1.
[0045] Generally, the inertial data collected continuously by the inertial sensor have a certain degree of continuity. If there is a large error in the inertial data at a certain sampling moment, the inertial data at this sampling moment may have a significant deviation compared with the inertial data at other sampling moments (especially adjacent sampling moments). In this case, when calculating the attention weight based on similarity, correlation, etc., the attention weight corresponding to this sampling moment is usually small, so that the inertial data at this sampling moment has less impact on the subsequent solution process, which is conducive to improving the accuracy of the solution result.
[0046] Continue to refer Figure 2 In step S230, the attention weight is used to extract intermediate features from the inertial data of the above-mentioned multiple sampling moments, and the first position data is determined based on the intermediate features.
[0047] Among them, the intermediate features may include feature information of inertial data at different sampling moments. By extracting the intermediate features using the attention weight, the feature information of the inertial data at different sampling moments can be made to account for different proportions in the intermediate features. The higher the attention weight corresponding to a certain sampling moment, the more feature information of the inertial data at the sampling moment contained in the intermediate features. It can be understood that, through the attention weight, different attention levels are assigned to the inertial data at different sampling moments. The extracted feature information has a certain time tendency according to the numerical distribution of the attention weight, and is more inclined to those sampling moments with higher attention weights. Thus, the intermediate features can reflect the important information in the time period of the above-mentioned multiple sampling moments and reduce the proportion of unimportant information. In particular, if there is a large error in the inertial data at a certain sampling moment, the attention weight corresponding to the sampling moment obtained by step S220 is small, and in the intermediate features extracted in step S230, the feature information of the inertial data at the sampling moment accounts for a low proportion, so that the intermediate features can more accurately reflect the actual posture features, which is conducive to improving the accuracy of the subsequent solution of the first posture data and the second posture data.
[0048] In one embodiment, the intermediate features extracted in step S230 may include intermediate features corresponding to each sampling moment. For example, T groups of intermediate features corresponding to T sampling moments may be extracted and recorded as u1, u2, ..., u T .
[0049] In one embodiment, an intermediate feature of at least one target moment may also be extracted. The target moment is the moment when the posture needs to be determined, which may be one or more of the above-mentioned multiple sampling moments, and each sampling moment may be used as the target moment in turn. For example, taking sampling moment t as the target moment, the inertial data of sampling moments 1 to N may be feature extracted using the attention weights corresponding to sampling moments 1 to N to obtain the intermediate feature corresponding to sampling moment t.
[0050] After extracting the intermediate features, the pose data can be preliminarily determined based on the intermediate features, and the obtained pose data is the first pose data. The pose data obtained after optimization in step S240 is the second pose data, and "first" and "second" are used to distinguish the two.
[0051] The pose data in this exemplary embodiment may include at least one of position data and attitude data. The present disclosure does not limit the type and form of the first pose data and the second pose data. The type and form of the first pose data and the second pose data may be the same or different. The first pose data may be an absolute pose in a certain coordinate system, or a relative pose relative to a certain reference pose, etc. In one embodiment, the first pose data may include any one or more of 6DoF (Degree of Freedom) data, attitude quaternion, spatial position coordinates, Euler angles, translation vectors, and rotation matrices.
[0052] The intermediate features can reflect the position and posture information of the inertial data to a certain extent. In one embodiment, the intermediate features can be used as the first position data corresponding to the inertial data. In another embodiment, the intermediate features can be further processed to obtain the first position data. For example, the intermediate features can be dimensionally transformed according to the dimension of the first position data to obtain the first position data; or, the intermediate features can be further processed by linear or nonlinear transformation, fusion, etc. to obtain the first position data. The present disclosure does not limit the specific processing method.
[0053] In one implementation, the first bit pose data at each sampling time can be obtained in step S230. For example, the first bit pose data at T sampling times can be recorded as q1, q2, ..., q T .
[0054] In one embodiment, the first position data of at least one target time can also be obtained in step S230. For example, taking sampling time t as the target time, the first position data q at sampling time t can be obtained. t .
[0055] Continue to refer Figure 2 In step S240, based on the inertial data and the first posture data, second posture data at at least one target moment is output.
[0056] Since there are usually errors in the inertial data, and there may also be errors in the first pose data, the inertial data and the first pose data are not completely consistent in essence. For example, when the inertial data and the first pose data are converted into the same form of data, such as attitude quaternion, the two are not exactly the same. Based on the errors between the two, data optimization can be performed to obtain the second pose data. It can be seen that the second pose data is the pose data obtained by further processing on the basis of the inertial data and the first pose data.
[0057] In one embodiment, the inertial data used in steps S220, S230 and step S240 may be the same in type and form, or may be different. For example, in step S210, the acquired inertial data includes acceleration data, angular velocity data, and magnetometer data; in steps S220 and S230, the acceleration data, angular velocity data, and magnetometer data may be used to determine the attention weight and extract the intermediate features to obtain the first pose data; in step S240, only the angular velocity data in the inertial data may be used to obtain the second pose data based on the angular velocity data and the first pose data.
[0058] In one implementation, the inertial data and the first pose data may be converted into data of the same form, such as a pose quaternion, and then the two may be fused, such as by averaging or weighted averaging, to obtain the second pose data.
[0059] In one embodiment, the posture determination method may further include the following steps:
[0060] When the first pose data is determined based on the intermediate features, the uncertainty (or confidence, which is the opposite concept of uncertainty) of the first pose data is also obtained.
[0061] Since the first-position pose data is the data obtained by performing pose estimation based on inertial data, it has a certain degree of uncertainty, and the uncertainty is used to represent the degree of the uncertainty. The present disclosure does not specifically limit how to calculate the uncertainty. In one embodiment, the uncertainty of the first-position pose data can be calculated based on its smoothness, and the smoothness and uncertainty can be negatively correlated. For example, the first-position pose data at multiple sampling moments can be smoothed and fitted, and the uncertainty is determined based on the degree of deviation between the first-position pose data and the fitting curve. In one embodiment, the uncertainty can also be output through a neural network. For example, a neural network is trained to output uncertainty, and the uncertainty label can be calculated by the deviation between the first-position pose data and the actual pose data.
[0062] In this exemplary embodiment, the weight of the inertial data when being fused with the first pose data can be determined based on the uncertainty. Generally, the higher the uncertainty (or the lower the confidence), the less credible the first pose data is, and the lower the weight of the first pose data when being fused.
[0063] In one embodiment, the outputting of the second posture data at at least one target moment according to the inertial data and the first posture data may include the following steps:
[0064] Kalman filtering is performed based on the inertial data and the first posture data, and second posture data at at least one target moment is obtained according to the result of the Kalman filtering.
[0065] Among them, either the inertial data or the first pose data can be used as the state data, and the other can be used as the observation data, and the pose can be optimally estimated through Kalman filtering. The pose data obtained after Kalman filtering is used as the second pose data, that is, the result of Kalman filtering includes the second pose data.
[0066] In one implementation, Kalman filtering can be performed based on the inertial data at the above multiple sampling moments and the first pose data at the multiple sampling moments to obtain the second pose data at any one or more sampling moments, which are the target moments.
[0067] The following two examples illustrate the Kalman filter:
[0068] Example 1: The Kalman filtering based on the inertial data and the first pose data may include the following steps:
[0069] The first posture data is taken as the state data, the inertial data is taken as the observation data, and the second posture data is obtained through Kalman filtering.
[0070] Among them, a state equation can be established for the first pose data, for example, the first pose data at multiple sampling moments are fitted to obtain the state equation. Data related to the first pose data in the inertial data is extracted as observation data. If the first pose data only includes pose data, the angular velocity data in the inertial data can be extracted as observation data. Then, the pose estimation is optimized by Kalman filtering to obtain the second pose data.
[0071] Example 2: The Kalman filtering based on the inertial data and the first pose data may include the following steps:
[0072] The inertial data is used as the state data, the first posture data is used as the observation data, and the second posture data is obtained through Kalman filtering.
[0073] Among them, the data related to the first pose data in the inertial data can be extracted, which can represent the pose change between two adjacent sampling moments, thereby establishing a state equation. Taking the first pose data as the observation data, the Kalman filter is used to optimize the pose estimation to obtain the second pose data.
[0074] In one embodiment, when the uncertainty of the first pose data is obtained, the above-mentioned inertial data is used as state data, the first pose data is used as observation data, and the second pose data is obtained by Kalman filtering, which may include the following steps:
[0075] Determine the observation data covariance matrix based on the uncertainty of the first pose data;
[0076] The inertial data is used as the state data and the first pose data is used as the observation data. The observation data covariance matrix is substituted and extended Kalman filtering is performed to obtain the second pose data.
[0077] EKF (Extended Kalman Filter) is a Kalman filter algorithm that can be used for nonlinear state estimation. In the EKF calculation process, the covariance matrix of multiple related parameters is involved. In this exemplary embodiment, the covariance matrix of the observed data is determined according to the uncertainty of the first pose data. As for other covariance matrices, they can be calculated based on the data at adjacent sampling moments, or preset values can be used. Determine the inertial data as the state data and the first pose data as the observation data, substitute the covariance matrix of the related parameters into the EKF algorithm formula, and calculate the second pose data.
[0078] The calculation process of EKF is described in detail below. It should be noted that since the first pose data is used as the observation data in this exemplary embodiment, the first pose data is essentially the data obtained by pose estimation based on inertial data, not the data directly observed. Therefore, in the following calculation process, the observation equation is simplified to the observation data itself, that is, the observation equation g(X t ,Ω ob )=X t (X t represents the prior value of the state data at time t, Ω ob represents the observation noise), and thereby simplifies the related observation matrix, observation noise control matrix, etc. into the unit matrix.
[0079] First, the uncertainty of the first pose data is expressed as a k-dimensional vector, denoted as s, where k is a positive integer and can be set based on experience or actual conditions, such as 10. The covariance matrix R of the observed data is calculated based on the uncertainty of the first pose data. t , when the first pose data is the pose quaternion, R t It is a 4*4 symmetric matrix, as shown below:
[0080]
[0081] in,
[0082] Then, based on the angular velocity data in the inertial data, the state equation is established as follows:
[0083] X t =X t-1 +dΔθX t-1 (2)
[0084]
[0085] Among them, X t represents the prior value of the state data at time t. X in formula (2) t-1 You can use the priori value at time t-1 or the a posteriori value. The a posteriori value is preferred. In this case, formula (2) is: t =X′ t-1 +dΔθX′ t-1 ; d represents the state update coefficient, and its value can be set according to experience or actual conditions. For example, the value of d can be determined in the range of 0 to 1, such as 1 / 2; Δθ represents the integral value calculated according to the angular velocity data, Δθ x , Δθ y , Δθ z are the values of Δθ in different axial directions respectively.
[0086] Next, calculate X t About X t-1 The derivative matrix A, i.e. the state transfer matrix, can be the Jacobian matrix of the state equation for the posterior value of the state data at time t-1 (i.e. the second pose data at time t-1). And establish the state prediction covariance estimate as shown below:
[0087]
[0088] in, represents the posterior state covariance matrix at time t-1, represents the prior state covariance matrix at time t. Q represents the preset noise covariance matrix. Can be a given initial value, then after extrapolation at each sampling moment, we can get
[0089] Then calculate the Kalman gain K t , since the observation matrix and the observation noise control matrix are simplified to the unit matrix, these two matrices are omitted when calculating the Kalman gain, as shown below:
[0090]
[0091] Finally, update the state data and the corresponding covariance matrix as follows:
[0092] X′ t =X t +K t (q t -X t ) (6)
[0093]
[0094] Among them, q t is the first position data (i.e., observation data) at time t, X′ t is the posterior value of the state data at time t, that is, the second posture data at time t obtained through Kalman filtering. The posterior state covariance matrix at time t can be used to calculate the prior state covariance matrix at the next sampling time (i.e., time t+1).
[0095] In one embodiment, the above steps S220 and S230 can be implemented based on a neural network. The posture determination method can also include the following steps:
[0096] Obtaining a pose estimation network, where the pose estimation network includes a first subnetwork and a second subnetwork;
[0097] Accordingly, step S220 may include the following steps:
[0098] The inertial data at the above-mentioned multiple sampling moments are input into the posture estimation network, and the inertial data is processed by the first sub-network to obtain the attention weights corresponding to the sampling moments;
[0099] Step S230 may include the following steps:
[0100] The second sub-network extracts intermediate features based on attention weights from the inertial data at the above-mentioned multiple sampling moments, and determines the first pose data based on the intermediate features.
[0101] Among them, the pose estimation network is used to process the input inertial data and output the corresponding first pose data. The first subnetwork and the second subnetwork can be two parts of the pose estimation network, the first subnetwork is used to determine the attention weight, and the second subnetwork is used to extract intermediate features and determine the first pose data. The pose estimation network can set a fixed input data dimension. Exemplarily, its input data dimension can be N*T, where T means that inertial data of T sampling moments can be input, and N means that the inertial data of each sampling moment has N dimensions.
[0102] In one embodiment, the first subnetwork and the second subnetwork can be parallel structures. After the inertial data of the above-mentioned multiple sampling moments are input into the pose estimation network, they enter the first subnetwork and the second subnetwork for processing respectively. The first subnetwork outputs the attention weight, and the attention weight can be output to an intermediate layer in the second subnetwork, so that the second subnetwork can extract the intermediate features based on the attention weight, and then determine the first pose data.
[0103] By setting up a pose estimation network, steps S220 and S230 can be integrated into the pose estimation network, which is beneficial to improving computational efficiency. In addition, since the pose estimation network generally has a strong generalization capability, this exemplary embodiment can be used to determine the pose in more scenarios, that is, the solution has a wider range of applicable scenarios.
[0104] In one embodiment, reference Figure 3 As shown, in the pose estimation network, the first subnetwork may include a first basic feature layer and an attention weight layer, and the second subnetwork may include a second basic feature layer, an attention feature layer, and a fully connected layer.
[0105] Accordingly, the above-mentioned processing of the inertial data by the first sub-network to obtain the attention weight corresponding to the sampling time may include the following steps:
[0106] Extracting a first basic feature from the inertial data through a first basic feature layer;
[0107] The first basic feature is fused through the attention weight layer to obtain the attention weight corresponding to the sampling time;
[0108] The above-mentioned extracting the intermediate features based on the attention weights from the inertial data at the above-mentioned multiple sampling moments through the second sub-network, and determining the first pose data according to the intermediate features, may include the following steps:
[0109] Extracting a second basic feature from the inertial data through a second basic feature layer;
[0110] The second basic feature of the attention feature layer is weighted based on the attention weight to obtain the intermediate feature;
[0111] The intermediate features are fully connected through the fully connected layer to obtain the first pose data.
[0112] Among them, the first basic feature layer and the second basic feature layer are both used to extract basic features from inertial data, and the basic features can be relatively preliminary features. The first basic feature layer and the second basic feature layer can adopt linear or nonlinear transformation methods, and the first basic feature layer and the second basic feature layer can include multiple intermediate layers. In one embodiment, the first basic feature layer and the second basic feature layer are both linear transformation layers, and the two have different parameters. Therefore, the first basic feature layer and the second basic feature layer can perform linear transformation on the inertial data based on different parameters to obtain the first basic feature and the second basic feature, respectively.
[0113] The first basic feature is used to obtain the attention weight after further processing. In this exemplary embodiment, the attention weight layer can be trained to extract the correlation information in the first basic feature, and obtain the attention weight through processing. In one embodiment, the first basic feature can be nonlinearly activated, such as nonlinear activation using functions such as softmax (normalized exponential function) to obtain the correlation information. In addition, the attention weight layer can fuse the first basic feature, including fusion in the time domain. For example, the attention weight layer can nonlinearly activate the first basic feature, and fuse the first basic feature according to the result of the nonlinear activation to obtain the attention weight corresponding to the sampling moment, thereby simplifying the dimension of the attention weight and improving the operation speed.
[0114] The second basic feature is used for further feature extraction. In this exemplary embodiment, the attention weight and the second basic feature can be input into the attention feature layer, and the attention feature layer uses the attention weight to weight the second basic feature, so that the feature information of the inertial data at different sampling times can be redistributed in the weighted intermediate feature, forming a tilt towards important feature information. Then, the intermediate features are further dimensionalized and fused through the fully connected layer to obtain the first pose data.
[0115] by Figure 3 Take as an example to illustrate the processing flow of the attitude estimation network. Obtain inertial data at T sampling moments, such as the inertial data at sampling moment 1 includes acceleration data a1, angular velocity data w1, and magnetometer data B1. Input the inertial data at T sampling moments into the attitude estimation network, and enter the first sub-network and the second sub-network respectively.
[0116] In the first sub-network, the first basic feature is extracted from the first basic feature layer, which can be recorded as k1, k2, ..., k T Then the attention weight layer performs nonlinear activation on the first basic feature to obtain the basic weights corresponding to T sampling moments, which are recorded as α1, α2, ..., α T The calculation of nonlinear activation can refer to the following formula:
[0117]
[0118] Among them, z is the parameter of the attention weight layer, which is a d-dimensional learnable parameter, and d represents the dimension of the basic weight corresponding to each sampling moment.
[0119] The attention weight layer can also use the basic weight to fuse the first basic feature, refer to the following formula:
[0120]
[0121] Here, K represents the attention weight, which may include the data of the attention weights corresponding to T sampling moments.
[0122] In the second sub-network, the second basic features are extracted from the second basic feature layer, which can be recorded as v1, v2, ..., v T Then the attention feature layer uses the attention weight to fuse the second basic feature, referring to the following formula:
[0123] u i =K*v i (10)
[0124] The multiplication of formula (10) is to multiply the corresponding elements to obtain the intermediate features corresponding to T sampling moments, which are recorded as u1, u2, ..., u T .
[0125] Finally, the fully connected layer performs full connection processing on the intermediate features and outputs the first pose data of T sampling moments, recorded as q1, q2, ..., q T In addition, the fully connected layer can also output the uncertainty of the first pose data at T sampling moments, recorded as sigma1, sigma2, ..., sigma T .
[0126] Depend on Figure 3 It can be seen from the attention weight layer and attention feature layer in that Figure 3 The pose estimation network adopts the additive attention mechanism, which can reduce the time complexity of the algorithm and speed up the calculation process compared with the conventional attention mechanism. It should be understood that the structure of the pose estimation network is not limited to Figure 3 In the case shown, multiple subnetworks can also be set up outside the first subnetwork and the second subnetwork. For example, a third subnetwork can be added between the first subnetwork and the second subnetwork, which includes a third basic feature layer, an attention feature layer, and an attention weight layer. The third basic feature layer is used to extract the third basic feature from the inertial data. The attention feature layer is used to perform weighted processing on the third basic feature using the attention weight output by the first subnetwork to obtain the third intermediate feature. The attention weight layer is used to fuse the third intermediate feature to output the attention weight to the second subnetwork. In the second subnetwork, the attention feature layer can perform weighted processing using the attention weight output by the third intermediate layer.
[0127] In one embodiment, a network structure such as LSTM (Long Short-Term Memory) and GRU (Gated Recurrent Unit) for processing time series data can be set in the pose estimation network, which can be used to extract time series features from inertial data at multiple sampling moments. For example, the above-mentioned first basic feature layer and second basic feature layer can both adopt the LSTM structure, so that the extracted first basic features and second basic features both contain time series features.
[0128] This exemplary embodiment also provides a method for training a pose estimation network. In one embodiment, reference Figure 4 As shown, the posture determination method may further include the following steps S410 to S440:
[0129] Step S410, obtaining inertial sample data and position and posture annotation data corresponding to the inertial sample data;
[0130] Step S420, inputting the inertial sample data into the pose estimation network, and obtaining the first pose sample data through the pose estimation network;
[0131] Step S430, determining second pose sample data based on the inertial sample data and the first pose sample data;
[0132] Step S440, updating the parameters of the pose estimation network according to the second pose sample data and the pose annotation data.
[0133] Among them, the inertia sample data, the first pose sample data, and the second pose sample data have the same meanings as the above-mentioned inertia data, the first pose data, and the second pose data, respectively. The difference is that the inertia sample data, the first pose sample data, and the second pose sample data are the data used for network training and are therefore sample data.
[0134] In step S410, inertial sample data can be obtained by collecting inertial sensors, and pose annotation data can be obtained by other means. The pose annotation data is the ground truth in model training. For example, the pose of the target can be determined by wireless signal positioning, satellite positioning, visual positioning, etc. to obtain the pose annotation data.
[0135] The implementation of steps S420 to S430 is substantially the same as the implementation of steps S220 to S240 described above, and will not be described in detail herein.
[0136] After obtaining the second pose sample data, the loss function value can be calculated based on the deviation between the second pose sample data and the pose annotation data, and then the pose estimation network is back-propagated and parameter updated according to the loss function value to realize the training of the pose estimation network.
[0137] From the above, it can be seen that this exemplary embodiment can realize end-to-end training of the pose estimation network, wherein the process of determining the second pose sample data based on the inertial sample data and the first pose sample data (such as the EKF algorithm process) can directly train the parameters, so that the pose estimation network can learn high-quality information, which is conducive to improving the network quality.
[0138] The loss between the second pose sample data and the pose annotation data is expressed as the first loss function. Any form of loss such as L1, L2, etc. can be used. Taking L1 loss as an example, the first loss function is as follows:
[0139]
[0140] Among them, a ij represents the second pose sample data at the jth sampling time in the i-th group of samples, y ij Represents the corresponding pose annotation data; M means there are M groups of samples, one group of samples includes the data collected during one movement of the target; T means each group of samples collects inertial sample data at T sampling moments.
[0141] In one embodiment, after obtaining the first pose sample data, the parameters of the pose estimation network can be updated according to the first pose sample data and the pose annotation data. For example, the loss between the first pose sample data and the pose annotation data can be expressed as a second loss function, and any form of loss such as L1, L2, etc. can be used. Taking L1 loss as an example, the second loss function is as follows:
[0142]
[0143] Among them, b ij It represents the first pose sample data at the jth sampling time in the i-th group of samples. It can be seen that through the second loss function, the pose estimation network tends to output the first pose sample data close to the pose annotation data, which is conducive to accelerating the training process.
[0144] In one implementation, the first loss function and the second loss function may be used simultaneously to train the pose estimation network. For example, the first loss function and the second loss function may be used alternately to update the parameters of the pose estimation network.
[0145] In one embodiment, the pose estimation network may also output the uncertainty of the first pose sample data (or the first pose data), which is recorded as an uncertainty sample value. Accordingly, the uncertainty annotation value of the first pose sample data may be calculated based on the first pose sample data and the pose annotation data, and the parameters of the pose estimation network may be updated based on the uncertainty sample value of the first pose sample data and its uncertainty annotation value.
[0146] When constructing a pose estimation network, dual output channels can be set to output the estimation result of the first pose data and the uncertainty of the estimation result. The uncertainty sample value is the uncertainty of the first pose sample data output by the pose estimation network. The uncertainty annotation value is the true value corresponding to the uncertainty sample value. The uncertainty annotation value can be determined based on the deviation between the first pose sample data and the pose annotation data, as shown below:
[0147]
[0148] The loss function value is calculated based on the deviation between the uncertainty sample value and the uncertainty annotation value of the first pose sample data. The loss function can be recorded as the third loss function. Any form of loss such as L1 and L2 can be used. Taking L1 loss as an example, the third loss function is as follows:
[0149]
[0150] Among them, c ij represents the uncertainty sample value at the jth sampling moment in the i-th group of samples, v ijIndicates the corresponding uncertainty annotation value.
[0151] In one embodiment, the first loss function or the second loss function can be combined with the third loss function so that the pose estimation network tends to output accurate first pose data and accurate uncertainty.
[0152] In one implementation, the above-mentioned determination of the second posture sample data based on the inertial sample data and the first posture sample data may include the following steps:
[0153] Kalman filtering is performed based on the inertial sample data and the first pose sample data to obtain the second pose sample data.
[0154] The process of performing Kalman filtering on the inertial sample data and the first pose sample data can refer to the previous content and will not be repeated here. Therefore, the processing of the pose estimation network and the Kalman filter are two serial processes, and the two processes are regarded as the global processing process of forward propagation. In step S440, the parameters of the pose estimation network and the parameters of the Kalman filter can be updated based on the second pose sample data and the pose annotation data. In other words, the back propagation parameter update can be performed based on the global processing process, that is, each part of the parameters is updated in the order of back propagation such as Kalman filtering and pose estimation network. The parameters of the Kalman filter include the covariance matrix, parameter matrix, noise, etc. of the relevant parameters. After calculating the loss function value, the update amount of one or more parameters in the Kalman filter is calculated by gradient descent, and the parameters of the Kalman filter are updated accordingly, which can improve the accuracy of the Kalman filter and realize end-to-end training of the pose estimation network.
[0155] Figure 5 The schematic flow of the posture determination method is shown. Obtain inertial data at T sampling moments (a1 w1 B1), (a2 w2 B2), ..., (a T w T B T ), input it into the pose estimation network, and obtain the first pose data and its uncertainty (q1 sigma1), (q2 sigma2), …, (q T Sigma T ); The first position data and angular velocity data (w1, w2, ..., w T ) Input the extended Kalman filter to perform optimal pose estimation and output the second pose data X'1, X'2, ..., X' at each sampling moment T .
[0156] Figure 6A schematic diagram of forward propagation and back propagation is shown. Inertial sample data is output by the accelerometer, gyroscope, and magnetometer. The inertial sample data is input into the pose estimation network to obtain the first pose sample data, and the second loss function value is calculated based on the deviation between the first pose sample data and the pose annotation data, and the parameters of the pose estimation network are updated through back propagation. At the same time, the first pose sample data and the angular velocity data output by the gyroscope can also be input into the extended Kalman filter to output the optimized second pose sample data; the first loss function value is calculated based on the deviation between the second pose sample data and the pose annotation data, and then the parameters of the pose estimation network and the extended Kalman filter are updated through the back propagation path of the extended Kalman filter and the pose estimation network. It should be understood that Figure 6 The forward propagation process shown can also be used to process inertial data to obtain first pose data and second pose data.
[0157] The exemplary embodiment of the present disclosure also provides a posture determination device. Figure 7 As shown, the posture determination device 700 may include:
[0158] The data acquisition module 710 is configured to acquire inertial data at multiple sampling moments;
[0159] A weight processing module 720 is configured to determine the attention weight corresponding to the sampling moment according to the inertial data at the above-mentioned multiple sampling moments;
[0160] The first pose data processing module 730 is configured to extract intermediate features from the inertial data at the above-mentioned multiple sampling moments using the attention weights, and determine the first pose data according to the intermediate features;
[0161] The second posture data processing module 740 is configured to output second posture data at at least one target moment based on the inertial data and the first posture data.
[0162] In one implementation, the data acquisition module 710 is further configured to:
[0163] Obtaining a pose estimation network, where the pose estimation network includes a first subnetwork and a second subnetwork;
[0164] The above-mentioned determining the attention weight corresponding to the sampling moment according to the inertial data at the above-mentioned multiple sampling moments includes:
[0165] The inertial data of multiple sampling moments are input into the pose estimation network, and the inertial data is processed by the first sub-network to obtain the attention weights corresponding to the sampling moments;
[0166] The above-mentioned method of extracting intermediate features from the inertial data at the above-mentioned multiple sampling moments using the attention weights and determining the first pose data according to the intermediate features includes:
[0167] The second sub-network extracts intermediate features based on attention weights from the inertial data at multiple sampling moments, and determines the first pose data based on the intermediate features.
[0168] In one embodiment, the first sub-network includes a first basic feature layer and an attention weight layer, and the second sub-network includes a second basic feature layer, an attention feature layer, and a fully connected layer;
[0169] The first sub-network processes the inertial data to obtain the attention weight corresponding to the sampling time, including:
[0170] Extracting a first basic feature from the inertial data through a first basic feature layer;
[0171] The first basic feature is fused through the attention weight layer to obtain the attention weight corresponding to the sampling time;
[0172] The above-mentioned process of extracting intermediate features based on attention weights from inertial data at multiple sampling moments through the second sub-network and determining the first pose data according to the intermediate features includes:
[0173] Extracting a second basic feature from the inertial data through a second basic feature layer;
[0174] The second basic feature of the attention feature layer is weighted based on the attention weight to obtain the intermediate feature;
[0175] The intermediate features are fully connected through the fully connected layer to obtain the first pose data.
[0176] In one implementation, the posture determination device 700 may further include a network training module configured to:
[0177] Obtain inertial sample data and position and posture annotation data corresponding to the inertial sample data;
[0178] Input the inertial sample data into the pose estimation network, and obtain the first pose sample data through the pose estimation network;
[0179] Determine second pose sample data based on the inertial sample data and the first pose sample data;
[0180] Update the parameters of the pose estimation network according to the second pose sample data and the pose annotation data.
[0181] In one embodiment, the outputting of the second posture data at at least one target moment based on the inertial data and the first posture data includes:
[0182] Kalman filtering is performed based on the inertial data and the first posture data, and second posture data at at least one target moment is obtained according to the result of the Kalman filtering.
[0183] In one embodiment, the above-mentioned Kalman filtering is performed based on the inertial data and the first pose data, and the second pose data is obtained according to the result of the Kalman filtering, including:
[0184] The inertial data is used as the state data, the first posture data is used as the observation data, and the second posture data is obtained through Kalman filtering.
[0185] In one embodiment, the first pose data processing module 730 is configured to:
[0186] When determining the first pose data based on the intermediate features, the uncertainty of the first pose data is also obtained;
[0187] The above uses inertial data as state data, the first pose data as observation data, and the second pose data is obtained through Kalman filtering, including:
[0188] Determine the observation data covariance matrix based on the uncertainty of the first pose data;
[0189] The inertial data is used as the state data and the first pose data is used as the observation data. The observation data covariance matrix is substituted and extended Kalman filtering is performed to obtain the second pose data.
[0190] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.
[0191] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which can be implemented in the form of a program product, which includes a program code, and when the program product is run on an electronic device, the program code is used to cause the electronic device to perform the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. In an optional embodiment, the program product can be implemented as a portable compact disk read-only memory (CD-ROM) and includes program code, and can be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.
[0192] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0193] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0194] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0195] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0196] The exemplary embodiment of the present disclosure further provides an electronic device, which may be, for example, the mobile terminal 110 or the computing device 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as program code. The processor executes the method for determining the posture in the exemplary embodiment by executing the executable instructions, such as executing Figure 2 method steps.
[0197] Below Figure 8 The mobile terminal 800 in FIG. 1 is taken as an example to exemplify the structure of the electronic device. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 8 The construction in can also be applied to fixed type equipment.
[0198] like Figure 8 As shown, the mobile terminal 800 may specifically include: a processor 810 , a memory 820 , a bus 830 , a communication module 840 , an antenna 850 , a power module 860 and a sensor module 870 .
[0199] The processor 810 may include one or more processing units, for example: the processor 810 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc. The posture determination method or the model training method for posture prediction in this exemplary embodiment may be executed by one or more of the AP, GPU, DSP, and NPU. For example, in the posture determination method, the NPU may load the parameters of the posture estimation network and execute the algorithm instructions related to the model, and the AP may obtain the inertial data and output the second posture data.
[0200] The processor 810 may be connected to the memory 820 or other components through a bus 830 .
[0201] The memory 820 may be used to store computer executable program codes, which may include instructions. The processor 810 executes various functional applications and data processing of the mobile terminal 800 by running the instructions stored in the memory 820. The memory 820 may also store application data, such as images, videos, and other files.
[0202] The communication function of the mobile terminal 800 can be implemented through the communication module 840 and the antenna 850, a modem processor, a baseband processor, etc. The antenna 850 is used to transmit and receive electromagnetic wave signals. The communication module 840 can provide 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 800, or wireless communication solutions such as wireless LAN, Bluetooth, and near field communication.
[0203] The power module 860 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc.
[0204] The sensor module 870 may include one or more sensors for implementing corresponding sensing functions. In this exemplary embodiment, the sensor module 870 may include an inertial sensor, such as an accelerometer 871, a gyroscope 872, and a magnetometer 873, which are respectively used to sense and collect acceleration data, angular velocity data, and magnetometer data. These inertial data can be transmitted to the processor 810, and the processor 810 processes them by executing the posture determination method in this exemplary embodiment to obtain second posture data.
[0205] In addition, the mobile terminal 1100 may also include other components such as a display screen, an audio module, and a camera module, which are not limited in the present disclosure.
[0206] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0207] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system". Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0208] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for determining a posture, characterized in that: include: Obtain inertial data at multiple sampling moments; Determining the attention weight corresponding to the sampling moment according to the inertial data at the multiple sampling moments; Extracting intermediate features from the inertial data at the plurality of sampling moments using the attention weights, and determining first position data according to the intermediate features; Based on the inertial data and the first posture data, outputting second posture data at at least one target moment; The method further includes: obtaining a pose estimation network, wherein the pose estimation network includes a first sub-network and a second sub-network; Determining the attention weights corresponding to the sampling moments according to the inertial data at the multiple sampling moments includes: inputting the inertial data at the multiple sampling moments into the pose estimation network, and processing the inertial data through the first sub-network to obtain the attention weights corresponding to the sampling moments; The step of extracting intermediate features from the inertial data at the multiple sampling moments using the attention weights, and determining the first pose data according to the intermediate features, comprises: extracting intermediate features based on the attention weights from the inertial data at the multiple sampling moments using the second sub-network, and determining the first pose data according to the intermediate features; The step of outputting second posture data at at least one target moment based on the inertial data and the first posture data comprises: performing Kalman filtering based on the inertial data and the first posture data, and obtaining second posture data at at least one target moment according to a result of the Kalman filtering.
2. The method according to claim 1, characterized in that The first sub-network includes a first basic feature layer and an attention weight layer, and the second sub-network includes a second basic feature layer, an attention feature layer, and a fully connected layer; The processing of the inertial data by the first sub-network to obtain the attention weight corresponding to the sampling moment includes: Extracting a first basic feature from the inertial data through the first basic feature layer; The first basic feature is integrated through the attention weight layer to obtain the attention weight corresponding to the sampling moment; The extracting the intermediate features based on the attention weights from the inertial data at the plurality of sampling moments through the second sub-network, and determining the first posture data according to the intermediate features, comprises: Extracting a second basic feature from the inertial data through the second basic feature layer; Performing weighted processing based on the attention weight on the second basic feature of the attention feature layer to obtain the intermediate feature; The intermediate features are fully connected through the fully connected layer to obtain the first pose data.
3. The method according to claim 1, characterized in that The method further comprises: Acquire inertial sample data and position and posture annotation data corresponding to the inertial sample data; Inputting the inertial sample data into a pose estimation network, and obtaining first pose sample data through the pose estimation network; Determine second posture sample data based on the inertial sample data and the first posture sample data; Update the parameters of the pose estimation network according to the second pose sample data and the pose annotation data.
4. The method according to claim 1, characterized in that The performing Kalman filtering based on the inertial data and the first posture data, and obtaining the second posture data according to a result of the Kalman filtering, comprises: The inertial data is used as state data, the first posture data is used as observation data, and the second posture data is obtained through Kalman filtering.
5. The method according to claim 4, characterized in that The method further comprises: When determining the first pose data according to the intermediate feature, the uncertainty of the first pose data is also obtained; The method of using the inertial data as state data and the first posture data as observation data, and obtaining the second posture data through Kalman filtering, includes: Determining an observation data covariance matrix according to the uncertainty of the first posture data; The inertial data is used as the state data, the first posture data is used as the observation data, the observation data covariance matrix is substituted and an extended Kalman filter is performed to obtain the second posture data.
6. A posture determination device, characterized in that: include: A data acquisition module is configured to acquire inertial data at multiple sampling moments; A weight processing module, configured to determine the attention weight corresponding to the sampling moment according to the inertial data of the multiple sampling moments; a first pose data processing module, configured to extract intermediate features from the inertial data at the plurality of sampling moments using the attention weights, and determine the first pose data according to the intermediate features; A second posture data processing module is configured to output second posture data at at least one target moment based on the inertial data and the first posture data; The data acquisition module is further configured to: acquire a pose estimation network, wherein the pose estimation network includes a first sub-network and a second sub-network; Determining the attention weights corresponding to the sampling moments according to the inertial data at the multiple sampling moments includes: inputting the inertial data at the multiple sampling moments into the pose estimation network, and processing the inertial data through the first sub-network to obtain the attention weights corresponding to the sampling moments; The step of extracting intermediate features from the inertial data at the multiple sampling moments using the attention weights, and determining the first pose data according to the intermediate features, comprises: extracting intermediate features based on the attention weights from the inertial data at the multiple sampling moments using the second sub-network, and determining the first pose data according to the intermediate features; The step of outputting second posture data at at least one target moment based on the inertial data and the first posture data comprises: performing Kalman filtering based on the inertial data and the first posture data, and obtaining second posture data at at least one target moment according to a result of the Kalman filtering.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 5 by executing the executable instructions.
