A method for predicting lower limb joint torques based on deep forest and genetic algorithm
By combining distributed pressure sensor insoles with deep forest and genetic algorithms, the layout and number of sensors are optimized, solving the problems of experimental environment and modeling complexity in traditional lower limb joint torque calculation, and realizing portable, low-cost, real-time, and accurate prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-22
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies require specific experimental environments and complex modeling processes for calculating lower limb joint torques, making it difficult to achieve portable, low-cost, real-time, and accurate estimation.
By employing distributed pressure sensor insoles combined with deep forest and genetic algorithms, and optimizing the sensor layout and number, a lower limb joint torque prediction model is constructed to achieve portable, low-cost, real-time, and accurate estimation.
It achieves accurate daily real-time estimation of lower limb joint torque, overcomes the dependence of traditional methods on experimental environment and modeling process, improves the portability of prediction and reduces cost.
Smart Images

Figure CN117764151B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for predicting lower limb joint torque, and more particularly to a method for predicting lower limb joint torque based on deep forest and genetic algorithm. Background Technology
[0002] Lower limb joint moments are crucial in gait analysis, exhibiting a strong correlation with walking propulsion. Lower limb joint moments are a key factor in foot and ankle injuries; excessive moments can lead to ligament damage. Simultaneously, analyzing lower limb joint moments during human walking can provide valuable insights for the design of lower limb exoskeleton robots.
[0003] To date, the most accurate and widely accepted method for calculating joint moments relies on inverse dynamics, calculating lower limb joint forces and moments by capturing motion trajectories and obtaining ground reaction force data, typically using motion capture systems and force platforms. While this method is accurate, it requires specific experimental conditions and complex modeling processes. Therefore, there is an urgent need to develop a lower limb joint moment prediction method that overcomes the requirement of specific experimental conditions and complex modeling processes for joint moment calculation in traditional testing. Summary of the Invention
[0004] The purpose of this invention is to provide a method for predicting lower limb joint torque based on deep forest and genetic algorithms. This invention enables accurate, real-time estimation of lower limb joint torque in daily life using a portable, low-cost, and optimized plantar pressure sensor, overcoming the shortcomings of traditional testing methods that require specific experimental environments and complex modeling processes.
[0005] The technical solution of this invention: A method for predicting lower limb joint torque based on deep forest and genetic algorithm, comprising the following steps:
[0006] S1. For n subjects, the foot pressure data was measured by using distributed pressure sensor insoles and the lower limb movement trajectory and ground reaction force were measured by using a motion capture system and force platform to collect gait data of n subjects.
[0007] S2. Construct a plantar pressure-lower limb joint torque dataset;
[0008] S3. The deep forest algorithm was trained using the plantar pressure-lower limb joint torque dataset to obtain the deep forest model; the number and layout of sensors in the distributed pressure sensor insole were optimized by combining the genetic algorithm and the deep forest algorithm.
[0009] First, a genetic algorithm is used to optimize the sensor layout for different numbers of sensors. The fitness function of the genetic algorithm incorporates two factors: the correlation of sensor positions under the current layout and the mean square error of lower limb joint moments predicted by a deep forest algorithm under the current layout. Based on this, after obtaining the optimal sensor layout for different numbers of sensors, the optimal number of sensors is predicted by comparing the trends of the fitness function corresponding to different numbers of sensors. When the fitness function for different numbers of sensors decreases continuously n times, the number of sensors corresponding to the fitness peak (maximum value) is considered the optimal number. The lower limb joint moments during the optimization of sensor number and layout are predicted and calculated using a deep forest algorithm.
[0010] S4. Finally, based on the selected optimal number and layout of sensors, a deep forest model is used to achieve real-time and rapid prediction of lower limb joint torque.
[0011] In the aforementioned method for predicting lower limb joint torque based on deep forest and genetic algorithm, step S2 involves the construction of the plantar pressure-lower limb joint torque dataset: using inverse dynamics to calculate the lower limb joint torque from the collected lower limb movement trajectory and ground reaction force data; using the start and end points of the gait support phase as alignment references to synchronize the lower limb joint torque data and plantar pressure data, thereby constructing the plantar pressure-lower limb joint torque dataset; wherein, data from n-1 randomly selected subjects are used as the training set, and data from 1 subject are used as the test set.
[0012] In the aforementioned method for predicting lower limb joint torques based on deep forest and genetic algorithm, the lower limb joint torques include ankle joint torque, knee joint torque, and hip joint torque.
[0013] In the aforementioned method for predicting lower limb joint torque based on deep forest and genetic algorithm, the plantar pressure-lower limb joint torque dataset in step S2 consists of plantar pressure data and lower limb joint torque (x) for each frame during walking. i y i ), where w represents the amount of data, then i belongs to [1, w], and the input feature of the i-th sample is: x i ={P1, P2, P3, ... P n}, where P represents plantar pressure data from sensors at different locations; yi represents the lower limb joint torque in the i-th sample; and all data are aligned, i.e., the plantar pressure-lower limb joint torque dataset is: D={(x1,y1),(x2,y2),…,(x w y w )}.
[0014] In the aforementioned method for predicting lower limb joint torque based on deep forest and genetic algorithm, step S3 includes three parts: data preprocessing, multi-granularity scanning, and cascaded forest model.
[0015] (1) Data preprocessing: Convert the plantar pressure data measured by n pressure sensors in the distributed pressure sensor insole into an n-dimensional original vector; concatenate the data of the current frame, the a-th frame before and the b-th frame before (a < b) to obtain a 3*n-dimensional vector;
[0016] (2) Multi-grain size scanning: using different sizes of... as well as Scan the sliding window to obtain indivual dimensional vector, indivual dimensional vector and indivual The vector is processed by two random forest models and then concatenated to obtain a c-dimensional feature vector, which is used as the input to the cascaded forest model.
[0017] (3) Cascaded Forest Model: The input c-dimensional feature vector is processed by four random forest models to obtain four enhanced one-dimensional vectors; the four enhanced one-dimensional vectors are concatenated with the input c-dimensional feature vector to form a (c+4)-dimensional feature vector, which is used as the input for the next level; the above process is repeated until the last level; at the last level, all generated vectors are averaged to obtain the regression value.
[0018] In the aforementioned method for predicting lower limb joint torque based on deep forest and genetic algorithm, d-fold cross-validation is used on the vectors generated by each random forest model.
[0019] In the aforementioned method for predicting lower limb joint torque based on deep forest and genetic algorithm, the random forest model contains f decision trees, and each decision tree grows until the leaf nodes are completely pure or the depth reaches g.
[0020] In the aforementioned method for predicting lower limb joint torque based on deep forest and genetic algorithm, in step S3, the encoding strategy of the genetic algorithm is binary encoding, where each bit represents a sensor number from 1 to k (1, 2, 3, 4...k). The value at a specific position indicates whether the sensor at the corresponding position is selected. If a sensor is selected, the value at the corresponding position is set to 1; otherwise, if it is not selected, it is set to 0.
[0021] In the aforementioned method for predicting lower limb joint torques based on deep forest and genetic algorithm, the formula for calculating fitness evaluation is as follows:
[0022]
[0023] Where P represents the selected sensor array, E(P) represents the mean square error of the deep forest model, R(P) represents the L2 norm of the correlation matrix of pressure values among the selected sensors, and α is a specific coefficient; the maximum layout calculated by the fitness evaluation formula is taken as the optimal layout.
[0024] In the aforementioned method for predicting lower limb joint torque based on deep forest and genetic algorithm, in step S1, the number of pressure sensors per square centimeter in the distributed pressure sensor insole is no less than 4.
[0025] Compared with existing technologies, this invention establishes a plantar pressure-lower limb joint torque dataset by collecting gait data from n subjects. The plantar pressure and lower limb joint torque data from this dataset are then used to train a deep forest algorithm, resulting in a deep forest model that can predict lower limb joint torque from plantar pressure. Furthermore, a genetic algorithm is used to optimize the number and layout of pressure sensors within the distributed pressure sensor insole. This allows the trained deep forest model to quickly predict lower limb joint torque based on measured plantar pressure data during subsequent use. This invention achieves accurate, real-time estimation of lower limb joint torque in daily life through a portable, low-cost, and optimized distributed pressure sensor insole, overcoming the shortcomings of traditional testing methods that require specific experimental environments and complex modeling processes. Attached Figure Description
[0026] Figure 1 This is a flowchart of the present invention;
[0027] Figure 2 This is a diagram showing the results of the optimized number and layout of sensors calculated using a genetic algorithm in Example 2. Detailed Implementation
[0028] The present invention will be further described below with reference to the accompanying drawings and embodiments, but this should not be construed as limiting the present invention.
[0029] Example. A method for predicting lower limb joint torques based on deep forest and genetic algorithm, the process is as follows: Figure 1 As shown, the specific steps include:
[0030] Step 1, Data Acquisition; For n subjects, plantar pressure data is measured using distributed pressure sensor insoles, and lower limb movement trajectories and ground reaction forces are measured using a motion capture system and force platform to collect gait data;
[0031] Step 2: Construct the dataset. Using inverse dynamics, calculate lower limb joint moments (ankle, knee, and hip moments) from the lower limb motion trajectories and ground reaction force data obtained from the motion capture system and force platform. Using the start and end points of the gait support phase as alignment references, synchronize the lower limb joint moment data with the plantar pressure data measured by the distributed pressure sensor insoles to construct the plantar pressure-lower limb joint moment dataset. Data from n-1 randomly selected subjects is used as the training set, and data from 1 subject is used as the test set.
[0032] Step 3: Use the deep forest algorithm to predict the lower limb joint torque from plantar pressure, and use the genetic algorithm to optimize the number and layout of sensors to establish the optimal prediction model for lower limb joint torque.
[0033] The specific process of optimizing the number and layout of sensors using a genetic algorithm is as follows: First, the optimal sensor layout is optimized for different numbers of sensors. The fitness function of the genetic algorithm includes two factors: the correlation of sensor positions under the current layout and the mean square error of the lower limb joint torque predicted by the deep forest algorithm under the current layout. Based on this, after obtaining the optimal sensor layout for different numbers of sensors, the optimal number of sensors is predicted by comparing the changing trends of the fitness function corresponding to different numbers of sensors. When the corresponding fitness function for different numbers of sensors decreases continuously n times, the number of sensors corresponding to the fitness peak (maximum value) is considered the optimal number. The lower limb joint torque during the optimization of the number and layout of sensors is predicted and calculated using the deep forest algorithm.
[0034] Step 4: Using the selected optimal number and layout of sensors and the trained deep forest model, test the subject to achieve real-time and rapid prediction of lower limb joint torque.
[0035] In the distributed pressure sensor insole described in step 1, no fewer than four pressure sensors are installed per square centimeter of the insole.
[0036] The dataset mentioned in step 2 consists of: plantar pressure data and lower limb joint torque (x) for each frame during walking. i y i ), where w represents the amount of data, then i belongs to [1, w], and the input feature of the i-th sample is: x i ={P1, P2, P3, ... P n}, where P represents the pressure data from sensors at different locations. y i Let represent the lower limb joint torque in the i-th sample. All data are aligned, i.e., the data sample set is: D = {(x1, y1), (x2, y2), ..., (x...} w y w )}
[0037] The deep forest algorithm in step 3 consists of three parts: data preprocessing, multi-granularity scanning, and cascaded forest.
[0038] (1) Data preprocessing: The data from the n pressure sensors in the pressure-distributed sensor insole are converted into an n-dimensional raw vector. The data from the current frame, the a-th frame before, and the b-th frame before (a < b) are concatenated to obtain a 3*n-dimensional vector.
[0039] (2) Multi-grain size scanning: using different sizes of... as well as A sliding window (with a step size of 1) is used for scanning to obtain... indivual dimensional vector, indivual dimensional vector and indivual These vectors are regressed by two random forest models and then concatenated to obtain a c-dimensional vector, which serves as the input to the cascaded forest model.
[0040] (3) Cascaded Forests: The input c-dimensional feature vector is processed through four random forest models to obtain four enhanced one-dimensional vectors. These vectors are concatenated with the original c-dimensional feature vector to form a (c+4)-dimensional feature vector, which serves as the input for the next level. This process continues until the last level. In the last level, all generated vectors are averaged to obtain the regression value. To prevent overfitting, we apply d-fold cross-validation to each forest-generated vector.
[0041] Each forest contains f decision trees, which grow until the leaf nodes are completely pure or the depth reaches g. The cascade forest stage receives the output of multi-granularity scans and provides the final regression result after iterative computation. This stage consists of e random forests, each containing f decision trees, growing until the leaf nodes are completely pure or the depth reaches g.
[0042] Among them, the deep forest model validation method uses leave-one-out cross-validation to train and evaluate the accuracy of the deep forest model.
[0043] The genetic algorithm described in step 3 uses binary encoding, where each bit represents a sensor number from 1 to k (i.e., 1, 2, 3, 4…k). The value at a specific position indicates whether the sensor at that position is selected. If a sensor is selected, the value at that position is set to 1; otherwise, it is set to 0.
[0044] The fitness of the genetic algorithm described in step 3 p The function is as follows:
[0045]
[0046] Where P represents the selected sensor array, E(P) represents the mean squared error of the deep forest model, R(P) represents the L2 norm of the correlation matrix of pressure values among the selected sensors, and α is a specific coefficient to ensure the prediction accuracy of the model and reduce the redundancy of sensor positions. The layout with the highest fitness function is taken as the optimal layout.
[0047] Example 2. A method for predicting lower limb joint torques based on deep forest and genetic algorithms, taking ankle joint torque prediction calculation as an example, specifically includes the following steps:
[0048] Step 1, Data Acquisition: PedarX insoles, Vicon system, and AMTI force table were used to collect plantar pressure data, lower limb movement trajectory, and ground reaction force data from 30 subjects. Data for 10 gait cycles were collected from each patient to achieve gait data collection.
[0049] Step 2: Construct the dataset; use the Opensim software to calculate ankle joint torque based on data from the motion capture system and force table, use the start and end points of the gait support phase as alignment references, synchronize the lower limb joint torque data and the plantar pressure data of the insole to realize the construction of the plantar pressure-ankle joint torque dataset.
[0050] Step 3: Use the deep forest algorithm to predict the ankle joint torque from plantar pressure, and use the genetic algorithm to optimize the number and layout of sensors to establish the optimal prediction model for lower limb joint torque.
[0051] Step 4: Using the selected optimal number and layout of sensors and the trained deep forest model, real-time and rapid prediction of ankle joint torque is achieved.
[0052] The dataset mentioned in step 2 consists of: plantar pressure data and ankle joint torque (x) for each frame during walking. i y i There are a total of 18,000 frames, so i belongs to [1, 18,000]. The input feature of the i-th sample is: x i ={P1, P2, P3, ... P n}, where P represents the pressure data from sensors at different locations. y i Let represent the lower limb joint torque in the i-th sample. All data are aligned, i.e., the data sample set is: D = {(x1, y1), (x2, y2), ..., (x...} 18000 y 18000 )}.
[0053] The deep forest algorithm in step 3 consists of three parts: data preprocessing, multi-granularity scanning, and cascaded forest.
[0054] Taking a sensor count of 9 as an example
[0055] (1) Data preprocessing: The data from the 9 pressure sensor insoles were converted into a 9-dimensional raw vector. The data from the current frame, the 3rd frame before, and the 6th frame before were concatenated to obtain a 27-dimensional vector.
[0056] (2) Multi-granularity scanning: Sliding windows of sizes 6, 3, and 1 (with a step size of 1) were used to scan, resulting in 22 6-dimensional vectors, 25 3-dimensional vectors, and 27 1-dimensional vectors. These vectors were then regressed by two random forest models and concatenated to obtain a 130-dimensional vector, which was used as the input to the cascaded forest model.
[0057] (3) Cascaded Forests: The input 148-dimensional feature vector is processed through four random forest models to obtain four enhanced one-dimensional vectors. These vectors are concatenated with the original 148-dimensional feature vector to form a 152-dimensional feature vector, which serves as the input for the next level. This process continues until the last level. In the last level, all generated vectors are averaged to obtain the regression value. To prevent overfitting, we apply 3-fold cross-validation to each forest-generated vector.
[0058] Each forest contains 50 decision trees, which grow until the leaf nodes are completely pure or the depth reaches 100. The cascade forest stage receives the output of multi-granularity scans and provides the final regression result after iterative computation. This stage consists of four random forests, each containing 50 decision trees, growing until the leaf nodes are completely pure or the depth reaches 100.
[0059] Among them, the deep forest model validation method uses leave-one-out cross-validation to train and evaluate the accuracy of the deep forest model.
[0060] The genetic algorithm described in step 3 uses binary encoding, where each bit represents a sensor number from 1 to 99 (i.e., 1, 2, 3, 4…99). The value at a specific position indicates whether the sensor at that position is selected. If a sensor is selected, the value at that position is set to 1; otherwise, it is set to 0.
[0061] The fitness evaluation calculation of the genetic algorithm described in step 3 p The function is as follows:
[0062] Where P represents the selected sensor array, E(P) represents the mean square error of the deep forest model, and R(P) represents the L2 norm of the correlation matrix of pressure values among the selected sensors, in order to ensure the prediction accuracy of the model and reduce the redundancy of sensor locations.
[0063] from Figure 2 It can be seen that, under each optimal layout with a certain number of sensors, the fitness first increases and then decreases with the increase of the number of sensors, and the fitness continuously decreases after the ninth sensor. Therefore, the ninth sensor is considered the optimal number. Based on the optimal layout corresponding to nine sensors, the mean square error (RMSE) of ankle joint torque prediction is calculated to be 5.37 ± 1.58 N*m. The results show that the lower limb joint torque prediction method based on deep forest and genetic algorithm provided in this invention can achieve accurate real-time estimation of lower limb joint torque in daily life.
Claims
1. A method for predicting lower limb joint torques based on deep forest and genetic algorithm, characterized in that, It includes the following steps: S1. For n subjects, use distributed pressure sensor insoles to measure plantar pressure data respectively, and use a motion capture system and a force platform to measure lower limb movement trajectories and ground reaction forces, so as to collect gait data of n subjects; S2. Construct a plantar pressure-lower limb joint torque dataset; S3. Train the deep forest algorithm through the plantar pressure-lower limb joint torque dataset to obtain a deep forest model; combine the genetic algorithm and the deep forest algorithm to optimize the number and layout of sensors in the distributed pressure sensor insole; S4. Finally, based on the selected optimal number and layout of sensors, use the deep forest model to achieve real-time and rapid prediction of lower limb joint torque; In step S3, the deep forest algorithm includes three parts: data preprocessing, multi-granularity scanning, and cascaded forest model; (1) Data preprocessing: Convert the plantar pressure data measured by n pressure sensors in the distributed pressure sensor insole into an n-dimensional original vector; splice the data of the current frame, the a-th frame before, and the b-th frame before, where a < b, to obtain a 3*n-dimensional vector; (2) Multi-grain size scanning: using different sizes of... as well as Scan the sliding window to obtain indivual dimensional vector, indivual dimensional vector and indivual The vector is processed by two random forest models and then concatenated to obtain a c-dimensional feature vector, which is used as the input to the cascaded forest model. (3) Cascaded forest model: The input c-dimensional feature vector is processed by four random forest models to obtain four enhanced one-dimensional vectors; splice the four enhanced one-dimensional vectors with the input c-dimensional feature vector to form a (c + 4)-dimensional feature vector as the input of the next level; repeat the above process until the last level; at the last level, take the average of all generated vectors to obtain a regression value; In step S3, the coding strategy of the genetic algorithm is binary coding. Each bit represents a sensor number from 1 to k, i.e., 1, 2, 3, 4...k. The value at a specific position indicates whether to select the sensor at the corresponding position; if a certain sensor is selected, the value at the corresponding position is set to 1; otherwise, if it is not selected, it is set to 0; Genetic algorithms use a fitness evaluation formula for calculation, which is: , Where P represents the selected sensor array. This represents the mean squared error of the deep forest model. The L2 norm of the correlation matrix of pressure values between the selected sensors is represented by α, where α is a specific coefficient.
2. The method for predicting lower limb joint torque based on deep forest and genetic algorithm according to claim 1, characterized in that, In step S2, the construction process of the plantar pressure-lower limb joint torque dataset: Use the inverse dynamics method to calculate the lower limb joint torque from the collected lower limb movement trajectory and ground reaction force data; Use the start and end points of the gait support phase as alignment references to synchronize the lower limb joint torque data and the plantar pressure data, so as to construct the plantar pressure-lower limb joint torque dataset; among them, randomly select the data of n - 1 subjects as the training set and the data of 1 subject as the test set.
3. The method for predicting lower limb joint torque based on deep forest and genetic algorithm according to claim 2, characterized in that, The lower limb joint torque includes ankle joint torque, knee joint torque, and hip joint torque.
4. The method for predicting lower limb joint torque based on deep forest and genetic algorithm according to claim 1, characterized in that, In step S2, the plantar pressure-lower limb joint torque dataset consists of plantar pressure data and lower limb joint torque data for each frame during walking. Where w represents the amount of data, then i belongs to The input features of the i-th sample are: , where P represents the plantar pressure data from sensors at different locations; Let represent the lower limb joint torque in the i-th sample; and align all data, resulting in the plantar pressure-lower limb joint torque dataset: .
5. The method for predicting lower limb joint torque based on deep forest and genetic algorithm according to claim 1, characterized in that, Use d-fold cross-validation on the vectors generated by each random forest model.
6. The method for predicting lower limb joint torque based on deep forest and genetic algorithm according to claim 1, characterized in that, The random forest model contains f decision trees, and each decision tree grows until the leaf nodes are completely pure or the depth reaches g.
7. The method for predicting lower limb joint torque based on deep forest and genetic algorithm according to claim 1, characterized in that, In step S1, the number of pressure sensors per square centimeter in the distributed pressure sensor insole is not less than 4.
Citation Information
Patent Citations
Exercise amount estimation method and matched wearable device
CN117322833A