A personalized motion template construction method based on a dynamic dimension bending optimization search algorithm
Patent Information
- Application Number
- CN202410030409.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-09
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2044-01-09
AI Technical Summary
[0003]现有的运动模板构建技术存在以下问题:大部分运动模板都是基于群体数据的通用模板,但是通用模板无法适应患者的个性化康复需求,且穿戴式加速康复机器人基于通用模板进行康复训练控制的误差比较大
[0061]本发明的方法,基于DTW的跨纬度搜索机制,可在全动态维度内搜索各个维度的最优值,新的跨纬度更新机制,能够帮助随机解快速靠近最优解,并在最优解附近高效的搜索更优秀的随机解;构建了基于DTW的跨纬度搜索和更新机制,解决了动态问题的维度搜索问题,该方法同时解决了参数交叉耦合的问题。基于数据模板库的搜索机制,解决了动态复杂问题的数学建模问题,提供了合适的适应度计算方式,可客观评价可能解的优劣。
Smart Images

Figure QLYQS_31 
Figure QLYQS_44 
Figure QLYQS_45
Abstract
Description
Technical Field
[0001] This invention relates to a method for constructing personalized motion templates based on a dynamic dimension bending optimization search algorithm, belonging to the field of robot rehabilitation assistive control technology. Background Technology
[0002] Wearable accelerated rehabilitation robots, as an emerging technology applied to rehabilitation training, can help patients with rehabilitation training and accelerate their recovery. When wearable accelerated rehabilitation robots actively control patients' rehabilitation training, they need to refer to the patient's movement trajectory. Therefore, it is necessary to construct personalized movement templates for each patient as reference movement trajectories during control training.
[0003] Existing motion template construction technologies suffer from the following problems: most motion templates are general templates based on group data, but these general templates cannot adapt to the personalized rehabilitation needs of patients, and wearable accelerated rehabilitation robots based on general templates exhibit significant errors in rehabilitation training control. Therefore, it is necessary to propose a motion template construction technology that addresses the personalized rehabilitation needs of patients, providing accurate reference trajectories for the rehabilitation training control of wearable accelerated rehabilitation robots. Summary of the Invention
[0004] The technical problem solved by this invention is to overcome the shortcomings of the prior art and propose a personalized motion template construction method based on a dynamic dimension bending optimization search algorithm.
[0005] The technical solution of this invention is:
[0006] A method for constructing personalized motion templates based on a dynamic dimension bending optimization search algorithm, the steps of which include:
[0007] Step 1: To meet the individualized rehabilitation needs of patients, collect motion data from multiple gait cycles.
[0008] Step 2: Construct an initial motion template library T based on the motion data collected in Step 1. The initial template library T is as follows:
[0009] T = {t1, t2, ..., t} i ,…,t k}
[0010] in, t i Let d represent the i-th template and t represent the t-th template. i The number of data chain dimensions, d is a number in [d min ,d max The value fluctuates within the range, meaning d is not a constant value. min ,d max All are statistical data, where k represents the number of templates; d∈[dmin ,d max ];
[0011] Step 3: Calculate the proportion of templates with different dimensions in the template library T, and record the dimension with the largest proportion as d. count And based on the number of dimensions d with the largest proportion obtained. count Find the average template t ave ;
[0012]
[0013]
[0014] Where Count represents the total number of dimensions, which is d. count The number of templates; Indicates t ave The value of the i-th dimension; This indicates that the number of the α-th dimension is d. count The value of the i-th dimension of the template;
[0015] Step 4, based on the average template t obtained in Step 3 ave Calculate the random solution x ave ;
[0016]
[0017]
[0018] Among them, (x min ,x max ) represents the fluctuation range of the random solution, rand(x) min ,x max That is, to obtain uniformly random numbers within the fluctuation range;
[0019] Step 5, set the population size N, and then use the random solution x obtained in step 4. ave Further, obtain a set x with N random solutions;
[0020] Where d_r is a uniformly random number within the range of fluctuation of the current dimension number, x i Let x represent the i-th random solution with d_r dimensions;
[0021] If d_r>d count Then in x ave Randomly select d r -d count Linear interpolation is performed in each dimension;
[0022] If d_r = d count Then x i =xave ;
[0023] If d_r <d count Then randomly select x ave d count -d_r dimensions are deleted to ensure a random solution x i It has d_r dimensions;
[0024] x = {x1, x2, ..., x} i ,…,x N}
[0025] x i ={x 1 ,x 2 ,…,x d_r}
[0026] d_r = rand(d min ,d max )
[0027] Step 6: Calculate the fitness value fit for the random solution set x obtained in Step 5;
[0028] fit = {fit1, fit2, ..., fit i ,…,fit N}
[0029]
[0030] V,v list ,dir=DTW(x i ,t j )
[0031]
[0032] Among them, fit i x represents i The fitness value; len(T) represents the total number of templates for template T; DTW represents the Dynamic Time Warping (DTW) algorithm, which can calculate the similarity V between two arrays of different lengths. list Chinese v i The representation of x i In the dimension i, t corresponds to j The minimum distance in each dimension, dir records the distance from dimension i to t. j Dimension indexes in;
[0033] Step 7: Based on the fitness value fit of the random solution set x, select the optimal solution x from the random solution set x. best ,
[0034]
[0035] i best =fit.index(min(fit)),i best ∈[1,len(x)]
[0036] Among them, i best The index of the minimum value among all fits (which can be replaced with the maximum value depending on the actual search problem being optimized);
[0037] Step 8, based on the optimal solution x best Solve for the optimal solution D in dimension D best ;
[0038]
[0039] V,v list ,dir=DTW(x best ,x j )
[0040] j≠i best j = rand(1, len(x))
[0041]
[0042] Where, x j Let x be the j-th randomly selected solution in x, but not the optimal solution itself. The DTW algorithm is used to obtain x. best ,x j between v list ,dir, dir provides x best ,x j The mapping information between the two after dimensional bending, dir-i represents x j In and x best The dimension corresponding to the i-th dimension in the equation. and They represent x respectively best and x j The minimum dimensional distance between all templates in template library T corresponding to each dimension obtained in step 6;
[0043] Step 9: Based on the random solution set x obtained in Step 5, iterate over each random solution x. i x i-new ;
[0044] In the first iteration or x i It achieved a better position in the last update, meaning its fitness value decreased, moving towards the optimal solution x. best And the optimal solution D in dimension best The formula for moving and iterating is:
[0045]
[0046]
[0047] β = rand(0,1)
[0048] in, x represents i The j-th dimension value; β represents a uniformly random number in the interval (0,1); Describes the optimal solution x best With x i The dimension value corresponding to the j-th dimension; Indicates the optimal solution With x i The dimension value corresponding to the j-th dimension;
[0049] If x i If the fitness value increased in the previous iteration, then a random walk will be performed at the current position according to the Levy-Flight algorithm, with the iteration formula as follows:
[0050]
[0051] Step 10: Constrain all dimensions of the new solutions within the fluctuation range to obtain a new set of random solutions x. new Then, solve for all x according to step 6. i-new fitness value i-new ;
[0052] x new ={x 1-new ,x 2-new ,…,x i-new ,…,x N-new}
[0053] fit new ={fit 1-new ,fit 2-new ,…,fit i-new ,…,fit N-new}
[0054] Step 11, based on the random solution set x and the new random solution set x new And the optimal solution D in dimension best This yields the set x of all solutions. all Based on their corresponding fitness values, select the N best solutions as the new x, and update the current iteration number gen by incrementing the current iteration number gen by 1;
[0055] x all =x new +x+{D best}
[0056]
[0057] Step 12: Repeat steps 7-11, iteratively updating the random solution set x and its fitness value fit until the maximum number of iterations M (or other predetermined termination condition) is reached. Finally, select the optimal solution x from x. best As the best template M best .
[0058] M best =x best
[0059] M best It provides precise reference trajectories for the rehabilitation training control of wearable accelerated rehabilitation robots, assisting patients in carrying out personalized rehabilitation training.
[0060] Beneficial effects
[0061] The method of this invention, based on the DTW cross-dimensional search mechanism, can search for optimal values in each dimension across the entire dynamic dimension. The novel cross-dimensional update mechanism helps random solutions quickly approach the optimal solution and efficiently searches for better random solutions near the optimal solution. A DTW-based cross-dimensional search and update mechanism is constructed, solving the dimensional search problem in dynamic problems. This method also addresses the issue of parameter cross-coupling. The search mechanism based on a data template library solves the mathematical modeling problem of dynamic complex problems, providing a suitable fitness calculation method that can objectively evaluate the quality of possible solutions. Detailed Implementation
[0062] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0063] Example
[0064] A method for constructing personalized motion templates based on a dynamic dimension bending optimization search algorithm, the steps of which include:
[0065] Step 1: To meet the personalized active rehabilitation needs of patients with knee osteoarthritis, collect motion data from multiple gait cycles. The motion data is the angle data of the knee joint on the affected side where the patient needs to perform rehabilitation exercises.
[0066] Step 2: Construct an initial motion template library T based on the motion data collected in Step 1. The initial template library T is as follows:
[0067] T = {t1, t2, ..., t} i ,…,t k}
[0068] in, t iLet d represent the i-th template and t represent the t-th template. i The number of data chain dimensions, d is a number in [d min ,d max The value fluctuates within the range, meaning d is not a constant value. min ,d max All data are statistical data, where k represents the number of templates. Here, k = 100 can be used to construct an initial template library with 100 gait cycle data points; d ∈ [d min ,d max ];
[0069] Step 3: Calculate the proportion of templates with different dimensions in the template library T, and record the dimension with the largest proportion as d. count And based on the number of dimensions d with the largest proportion obtained. count Find the average template t ave ;
[0070]
[0071]
[0072] Where Count represents the total number of dimensions, which is d. count The number of templates; Indicates t ave The value of the i-th dimension; This indicates that the number of the α-th dimension is d. count The value of the i-th dimension of the template;
[0073] Step 4, based on the average template t obtained in Step 3 ave Calculate the random solution x ave ;
[0074]
[0075]
[0076] Among them, (x min ,x max ) represents the fluctuation range of the random solution, rand(x) min ,x max That is, to obtain uniformly random numbers within the fluctuation range;
[0077] Step 5, set the population size N = 50, and use the random solution x obtained in Step 4. ave Further, obtain a set x with 50 random solutions;
[0078] Where d_r is a uniformly random number within the range of fluctuation of the current dimension number, x i Let x represent the i-th random solution with d_r dimensions;
[0079] If d_r>d count Then in x ave Randomly select d r -d count Linear interpolation is performed in each dimension;
[0080] If d_r = d count Then x i =x ave ;
[0081] If d_r <d count Then randomly select x ave d count -d_r dimensions are deleted to ensure a random solution x i It has d_r dimensions;
[0082] x = {x1, x2, ..., x} i ,…,x N}
[0083] x i ={x 1 ,x 2 ,…,x d_r}
[0084] d_r = rand(d min ,d max )
[0085] Step 6: Calculate the fitness value fit for the random solution set x obtained in Step 5;
[0086] fit = {fit1, fit2, ..., fit i ,…,fit N}
[0087]
[0088] V,v list ,dir=DTW(x i ,t j )
[0089]
[0090] Among them, fit i x represents i The fitness value; len(T) represents the total number of templates for template T; DTW represents the Dynamic Time Warping (DTW) algorithm, which can calculate the similarity V between two arrays of different lengths. list Chinese v i The representation of xi In the dimension i, t corresponds to j The minimum distance in each dimension, dir records the distance from dimension i to t. j Dimension indexes in;
[0091] Step 7: Based on the fitness value fit of the random solution set x, select the optimal solution x from the random solution set x. best ,
[0092]
[0093] i best =fit.index(min(fit)),i best ∈[1,len(x)]
[0094] Among them, i best The index of the minimum value among all fits (which can be replaced with the maximum value depending on the actual search problem being optimized);
[0095] Step 8, based on the optimal solution x best Solve for the optimal solution D in dimension D best ;
[0096]
[0097] V,v list ,dir=DTW(x best ,x j )
[0098] j≠i best j = rand(1, len(x))
[0099]
[0100] Where, x j Let x be the j-th randomly selected solution in x, but not the optimal solution itself. The DTW algorithm is used to obtain x. best ,x j between v list ,dir, dir provides x best ,x j The mapping information between the two after dimensional bending, dir-i represents x j In and x best The dimension corresponding to the i-th dimension in the equation. and They represent x respectively best and x j The minimum dimensional distance between all templates in template library T corresponding to each dimension obtained in step 6;
[0101] Step 9: Based on the random solution set x obtained in Step 5, iterate over each random solution x. i x i-new ;
[0102] In the first iteration or x i It achieved a better position in the last update, meaning its fitness value decreased, moving towards the optimal solution x. best And the optimal solution D in dimension best The formula for moving and iterating is:
[0103]
[0104]
[0105] β = rand(0,1)
[0106] in, x represents i The j-th dimension value; β represents a uniformly random number in the interval (0,1); Describes the optimal solution x best With x i The dimension value corresponding to the j-th dimension; Indicates the optimal solution With x i The dimension value corresponding to the j-th dimension;
[0107] If x i If the fitness value increased in the previous iteration, then a random walk will be performed at the current position according to the Levy-Flight algorithm, with the iteration formula as follows:
[0108]
[0109] Step 10: Constrain all dimensions of the new solutions within the fluctuation range to obtain a new set of random solutions x. new Then, solve for all x according to step 6. i-new fitness value i-new ;
[0110] x new ={x 1-new ,x 2-new ,…,x i-new ,…,x N-new}
[0111] fit new ={fit 1-new ,fit 2-new ,…,fit i-new ,…,fit N-new}
[0112] Step 11, based on the random solution set x and the new random solution set x new And the optimal solution D in dimension best This yields the set x of all solutions. all Based on their corresponding fitness values, select N=50 optimal solutions as new x, and update the current iteration number gen by incrementing the current iteration number gen by 1;
[0113] x all =x new +x+{D best}
[0114]
[0115] Step 12: Repeat steps 7-11, iteratively updating the random solution set x and its fitness value fit until the maximum number of iterations M (or other predetermined termination condition) is reached. Finally, select the optimal solution x from x. best M serves as the best template for knee joint angle during rehabilitation exercises for patients with knee osteoarthritis. best .
[0116] M best =x best
[0117] M best It provides precise reference trajectories for the rehabilitation training control of wearable accelerated rehabilitation robots, and can assist patients with knee osteoarthritis in carrying out active rehabilitation training for their knee joints, based on their individual rehabilitation needs.
[0118] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing personalized motion templates based on a dynamic dimension bending optimization search algorithm, characterized in that... The steps of this method include: Step 1: Collect motion data from multiple gait cycles of the patient; Step 2: Construct an initial motion template library based on the motion data collected in Step 1; Step 3: Calculate the percentage of templates with different dimensions in the template library, and record the dimension with the highest percentage as _____. Based on the number of dimensions with the largest proportion obtained Find the average template ; Step 4, based on the average template obtained in Step 3 Calculate random solutions ; Step 5, based on the random solution obtained in Step 4 Further calculate the dimensions as random solution ; Step 6: Set the population size N, repeat steps 4 and 5 N times, and initialize N random solutions. , This represents the i-th random solution; Step 7: Analyze the N random solutions obtained in Step 6. Calculate its fitness value ; Step 8, based on each random solution fitness value From random solutions Select the best solution ; Step 9, based on the optimal solution Solving for the optimal solution in the dimension ; Step 10, based on the i-th random solution obtained in Step 6 The trend of fitness value changes obtained in step 7, the optimal solution obtained in step 8, and the iterative calculation of the dimension-optimal solution obtained in step 9. ; Step 11: Constrain all dimensions of all solutions within the fluctuation range, and then solve all solutions using the same method as in Step 7. fitness value ; Step 12, in all solutions In this process, based on their corresponding fitness values, N optimal solutions are selected as the new solutions. Update the current iteration number; Step 13: Repeat steps 7-12 to iteratively update all solutions. Its fitness value This continues until the maximum number of iterations M or other predetermined termination conditions are met, finally... Select the best solution As the best template , Provides precise reference trajectories for the rehabilitation training control of wearable accelerated rehabilitation robots; In step 2, the initial template library T for: in, , Let d represent the i-th template. The number of data chain dimensions, d is a number in... The value of internal fluctuation, i.e., d is not a constant value. All data are statistical data. Indicates the number of templates; ; In step 3, the statistical template library is... The proportion of templates in different dimensions was obtained. The number of dimensions is The templates are in the template library. The largest proportion is in the middle, so calculate the average template. for: in, This indicates that the total number of dimensions is The number of templates; express The value of the i-th dimension; Indicates the first The number of dimensions is The value of the i-th dimension of the template; Step 4, based on the average template obtained in step 3 Calculate random solutions ,in The range of fluctuations for random solutions. That is, to obtain uniformly random numbers within the fluctuation range; In step 5, according to Further obtain random solutions ,in For the current dimension, a uniformly random number within the range of fluctuations in the number of elements. Then in Random selection Linear interpolation is performed along each dimension; if ,but ;if Then select randomly. middle Each dimension is removed to ensure a random solution. have One dimension; In step 6, N random solutions are initialized. , This represents the i-th random solution; In step 7, for all solutions Calculate its fitness value for: in, express fitness value; template The total number of templates; This represents the dynamic time warp algorithm, which calculates the similarity between two arrays of different lengths. , middle The representation of The dimension i in the middle corresponds to The minimum distance in the dimension, Records the correspondence between dimension i and... Dimension indexes in; In step 8, based on each solution fitness value ,from Select the best solution , For all The index of the minimum value in the middle; In step 9, based on the optimal solution Solving for the optimal solution in the dimension ; in, for The j-th randomly selected solution, but not the optimal solution itself, is obtained using the DTW algorithm. Between , Provided The mapping information between the two after dimensional bending. express Zhongyu The dimension corresponding to the i-th dimension in the equation. and They represent and The template library corresponding to each dimension obtained in step 7 The minimum dimensional distance between all templates in the set; In step 12, in all solutions In this process, based on their corresponding fitness values, N optimal solutions are selected as the new solutions. Update the current iteration number; 。 2. The personalized motion template construction method based on a dynamic dimension bending optimization search algorithm according to claim 1, characterized in that: In step 10, iterative calculation begins. ,if ,or The previous update yielded a better position, meaning the fitness value decreased; the iteration formula is as follows: in, express The value of the j-th dimension; express Uniformly distributed random numbers within the interval; Indicates the optimal solution and The dimension value corresponding to the j-th dimension; Indicates the optimal solution and The dimension value corresponding to the j-th dimension.
3. The personalized motion template construction method based on a dynamic dimension bending optimization search algorithm according to claim 1, characterized in that: When the fitness value increases, the iteration formula is: 。 4. The personalized motion template construction method based on a dynamic dimension bending optimization search algorithm according to claim 1, characterized in that: In step 11, all dimensions of all solutions are constrained within the fluctuation range, and then all solutions are solved. fitness value ; 。
