Detailed Description
First, an application scenario of the present application will be described. The technical scheme of the application can be suitable for rehabilitation training evaluation and guidance of a rehabilitation machine on a trainer.
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
Example 1
Fig. 1 is a flowchart of a rehabilitation training evaluation method according to an embodiment of the present application. As shown in fig. 1, one of the embodiments of the present application may be implemented by a rehabilitation application. The rehabilitation application program can be in the form of APP and the like and is installed in electronic equipment of an exerciser, such as a mobile phone and a tablet. The evaluation method of the rehabilitation training comprises the following steps:
S10, responding to the rehabilitation training evaluation request, and determining target rehabilitation training indicated by the rehabilitation training evaluation request.
The exerciser can select the desired rehabilitation exercise in the graphical user interface provided by the rehabilitation application and determine the exercise to begin the rehabilitation exercise. At this point, the rehabilitation application may determine that a rehabilitation training assessment request issued by the exerciser was received and determine a target rehabilitation training indicated by the rehabilitation training assessment request.
The rehabilitation training can comprise standing position, straight leg lifting, sitting position, assisting knee bending, left and right transferring, single leg standing balance and the like.
The types of rehabilitation exercises herein may include two-state rehabilitation exercises and three-state rehabilitation exercises. Wherein, the two-state rehabilitation training can be the condition that the rehabilitation preparation action is not needed. The three-state rehabilitation training can be the condition requiring rehabilitation preparation actions.
Wherein, the standing position directly lifts the legs and the single leg standing balance is two-state rehabilitation training. The 'assisting and knee bending under sitting position' and 'left-right transferring' are three-state rehabilitation training.
It will be appreciated that in a rehabilitation application, the type of each rehabilitation session may be preset.
S20, determining a rehabilitation action execution stage detection rule to be executed based on the type of the target rehabilitation training.
In step S20, after determining the type of the target rehabilitation training to be performed by the exerciser, a corresponding rehabilitation action execution stage detection rule is determined. The rehabilitation action execution stage detection rule is used for judging the rehabilitation action execution stage of the human body of the exerciser.
S30, determining the rehabilitation action execution stage of the exerciser according to the determined rehabilitation action execution stage detection rule aiming at the acquired rehabilitation action frame image of the exerciser.
Here, the exerciser can shoot the exercise process of the exerciser through the camera of the mobile phone, and the rehabilitation application program can intercept the rehabilitation action frame images according to a certain sampling frequency for the video stream acquired by the camera.
For each frame of rehabilitation action frame image, the rehabilitation action frame image can be input into a pre-trained machine learning model (such as a convolutional neural network and the like) so as to acquire real-time coordinates of human body key points output by the machine learning model. The key points of the human body may include the positions of the shoulders, elbows, wrists, buttocks, knees, ankles, etc.
Based on the real-time coordinates of the key points of the human body, the rehabilitation action execution stage executed by the exerciser can be further determined.
When the rehabilitation training is of a two-state rehabilitation training type, the rehabilitation action execution stage comprises two stage states of an evaluation stage and a non-evaluation stage.
When the rehabilitation training is three-state rehabilitation training, the rehabilitation action execution stage comprises three stage states of a non-evaluation stage, an evaluation preparation stage and an evaluation stage.
And S40, when the rehabilitation action execution stage of the exerciser meets the evaluation conditions, determining a real-time action evaluation value corresponding to the rehabilitation action frame image and feeding back to the exerciser.
In step S40, it may be determined whether the rehabilitation action execution phase of the exerciser satisfies the evaluation condition by:
when the rehabilitation action execution stage of the exerciser is the evaluation stage, determining that the rehabilitation action execution stage of the exerciser meets the evaluation condition.
That is, for both the two-state rehabilitation training and the three-state rehabilitation training, when the rehabilitation action of the exerciser reaches the evaluation stage, the calculation of the real-time action evaluation value is started for the rehabilitation action of the exerciser, and after the evaluation is finished, the calculation can be displayed on a screen or fed back to the exerciser through a voice broadcast mode and the like.
The real-time motion evaluation values are in one-to-one correspondence with the rehabilitation motion frame images and are used for indicating the completion degree of the real-time motion of the exerciser relative to the rehabilitation training.
Further, the number of motion exercises may be selected to determine the timing to exit the rehabilitation exercise detection and assessment service. For example, it is determined whether the exerciser has completed a single exercise or a plurality of exercises of the target rehabilitation training, or whether the number of exercises corresponding to the target rehabilitation training currently performed by the exerciser has ended.
According to the assessment method for rehabilitation training provided by the embodiment of the application, different action state detection rules are designed for different types of rehabilitation training by classifying the rehabilitation training and combining the state machine architecture, so that better state capture can be performed on rehabilitation actions executed by a trainer more accurately, and a more accurate assessment result is given.
Example two
As shown in fig. 2, in one embodiment of the present application, when the type of rehabilitation training is two-state rehabilitation training, taking "standing upright leg lifting" training as an example, for each acquired rehabilitation motion frame image, the rehabilitation motion execution stage of the exerciser may be determined by:
S3001, extracting real-time coordinates of key points of a human body according to the rehabilitation action frame image so as to calculate a first calculation similarity between the rehabilitation action of the exerciser and the rehabilitation action to be executed in the rehabilitation action frame image.
Here, taking the training of standing position and straight leg lifting as an example, the practice of the rehabilitation action to be performed by the exerciser can be that the leg lifting is carried out by one leg to 60 degrees, and the rehabilitation action of the exerciser in the rehabilitation action frame image only lifts the leg to 30 degrees.
In step S3001, the image may be converted into a format required for the machine learning model, such as resizing, normalization, and the like.
The human body key points herein may include buttocks, knees and ankles.
It can be understood that, for each rehabilitation training and different action states of each rehabilitation training, standard value coordinates of each human body key point can be preset.
The calculated similarity here may be a similarity between coordinates of key points, and may be calculated by euclidean distance, cosine similarity, or the like, for example.
S3003, determining whether the first calculated similarity is smaller than a first preset similarity.
In a specific embodiment, in addition to similarity calculation, other additional conditions may be used to make the determination. The design can be performed through specific rehabilitation training.
S3005, if yes, determining that the rehabilitation action execution stage of the exerciser is a non-evaluation stage.
S3007, if not, determining that the rehabilitation action execution stage of the exerciser is an evaluation stage.
When a "standing upright leg raising" action is performed, as shown in fig. 4 (a), the non-evaluation phase may be for the exerciser to stand upright and raise one side leg forward to a certain height. As shown in fig. 4 (b), other cases can be regarded as the rehabilitation actions of the exerciser as the evaluation stage.
When the exerciser stands straight and lifts one side leg forward to a certain height, calculation of the real-time action evaluation value can be started.
The existing part of rehabilitation actions consist of two actions which need to be continuously performed, the recovery action is generally performed after the rehabilitation action training is completed, and then the next action is performed, so that one rehabilitation training is easily distinguished to be two times, and the problems of unreasonable score evaluation and action capturing errors are caused. When the judgment is performed through the embodiment, the scores of all actions in the evaluation state are counted by utilizing the continuity of the rehabilitation training when the exerciser executes the rehabilitation action, so that for some compound rehabilitation training, the time period for counting the scores of the actions can be more accurately determined, and the scientific and reasonable score is given.
Example III
As shown in fig. 3, in one embodiment of the present application, when the type of rehabilitation training is a three-state rehabilitation training, the rehabilitation activity execution phase includes a non-evaluation phase, an evaluation preparation phase, and an evaluation phase. Taking the training of 'sitting assisted knee bending' as an example, for each acquired rehabilitation action frame image, the rehabilitation action execution stage of the exerciser can be determined by the following manner:
S3000, extracting real-time coordinates of key points of a human body according to the rehabilitation action frame image so as to calculate a second calculation similarity between the rehabilitation action of the exerciser and the preparation action of the rehabilitation action to be executed in the rehabilitation action frame image.
The similarity calculation here may refer to step S3001, where the calculation of the similarity is performed based on coordinates. The body part vector may also be formed based on human body keypoint coordinates. And calculating the angle characteristic and the distance characteristic based on the body part vector, and calculating the similarity through the angle characteristic and the distance characteristic.
For example, two adjacent human body key points A and B can be randomly selected or selected from the extracted human body key points to form a vector:
;
Wherein, AndReal-time coordinates of a and B, respectively.
Angular feature between two vectorsThe calculation can be made by the following formula:
;
wherein, the method comprises the following steps of ,) Is the first vector of #,) Is the second vector. The first and second vectors herein are not limited, or may be selected according to the corresponding rehabilitation activity.
Distance features between vectorsThe calculation can be made by the following formula:
;
wherein, the method comprises the following steps of ,) Is the corresponding vector.
It will be appreciated that in determining the calculated similarity, the similarity between the distance and angle features and the specified features may be calculated.
S3002, determining whether the second calculated similarity is greater than a second preset similarity.
S3004, if the similarity is smaller than the second preset similarity, determining that the rehabilitation action execution stage of the exerciser is a non-evaluation stage.
Taking the "sit-up assisted knee bending" training as an example, this motion can be as shown in fig. 5 (a).
S3006, if the calculated similarity is greater than the second preset similarity, determining that the rehabilitation action execution stage of the exerciser is an evaluation preparation stage, and calculating a third calculated similarity between the rehabilitation action of the exerciser and the rehabilitation action to be executed in the rehabilitation action frame image.
As shown in fig. 5 (b), the exerciser enters a rehabilitation preparation stage (the seated booster unilateral leg is lifted to a certain height). It is then determined whether the exerciser remains in the rehabilitation preparation phase, and if not, a similarity calculation is performed with the rehabilitation maneuver to be performed (sitting assisted unilateral leg flexion, as shown in fig. 5 (c)).
And if the third calculated similarity is smaller than the third preset similarity, returning to the step of executing the second calculated similarity.
S3008, if the third calculated similarity is greater than the third preset similarity, determining that the rehabilitation action execution stage of the exerciser is an evaluation stage. And if the rehabilitation training evaluation is not withdrawn, returning to the step of calculating the second calculation similarity.
It will be appreciated that the partial rehabilitation motion requires a preliminary motion which is greatly different from the daily motion of the human body, and the motion is easily misjudged as the rehabilitation training motion to be executed in the process from the daily motion of the human body to the execution of the preliminary motion, so that the evaluation preliminary stage is introduced, and the motion of the exerciser is not evaluated in the evaluation preliminary stage, so that the influence is not caused.
Example IV
In one embodiment of the present application, for all rehabilitation motion frame images for each evaluation phase, a corresponding real-time motion evaluation value may be calculated by:
first, an evaluation value of a certain body part in a single-frame image is determined :
Wherein, Identifying the corresponding sequence of the body part1,2,......,n),Is a body partAngle eigenvalues or distance eigenvalues calculated in real time between the corresponding vectors,Is a body partThe corresponding target characteristic value is set to be a target characteristic value,Is a body partThe corresponding limiting characteristic value is determined based on the rehabilitation action of the relative standard, and the limiting characteristic value is determined based on the condition that the human body is possibly farthest from the target characteristic value in terms of data distance.
If the angle and distance characteristics of a certain part of the body are related in the score evaluation, calculating an action evaluation value of the target part in the single frame image by the following modes:
=
Wherein, An evaluation value calculated for the target portion based on the angle characteristic value,An evaluation value calculated for the target portion based on the distance feature,Is the corresponding normalized coefficient.
Then, a real-time motion evaluation value of the single frame image can be calculated:
;
Wherein, Is a body partThe corresponding weight is used to determine the weight,Is thatReal-time motion estimation values of the moment rehabilitation motion frame images. The distribution of weights may be a normal distribution, an average distribution, a poisson distribution, an exponential distribution, a cauchy distribution, a gamma distribution, a chi-square distribution, a t-distribution, etc. It may also be custom, as the case may be.
Finally, a total action evaluation value S in the evaluation phase can be calculated:
Wherein, Is thatReal-time motion estimation values of the moment rehabilitation motion frame images.
Considering that in some cases the final overall evaluation score of the evaluation phase cannot equally take into account the image frames corresponding to each instant, the total action evaluation value S within the evaluation phase can be calculated using the following equation:
Wherein, 、The weight corresponding to the rehabilitation action frame images at different moments. The distribution of weights may be a normal distribution, poisson distribution, exponential distribution, cauchy distribution, gamma distribution, chi-square distribution, t distribution, etc. It may also be custom, as the case may be.
Furthermore, the rehabilitation training guidance information can be determined and displayed according to the total action evaluation value and/or the real-time action evaluation value of a certain rehabilitation training action of the exerciser.
Therefore, the action can be scored and counted more scientifically and accurately, and reasonable correction or action guidance is given.
Example five
As shown in fig. 6, based on the same inventive concept, an apparatus 60 for evaluating rehabilitation training is further provided in an embodiment of the present application, where the apparatus includes:
A response module 610, configured to respond to the rehabilitation training evaluation request and determine a target rehabilitation training indicated by the rehabilitation training evaluation request;
a rule analysis module 620, configured to determine a rehabilitation action execution stage detection rule to be executed based on a type of the target rehabilitation training;
The state analysis module 630 is configured to determine, according to the determined rehabilitation action execution stage detection rule, a rehabilitation action execution stage of the exerciser with respect to the acquired rehabilitation action frame image of the exerciser;
And the evaluation module 640 is used for determining a real-time action evaluation value corresponding to the rehabilitation action image and feeding back the real-time action evaluation value to the exerciser when the rehabilitation action execution stage of the exerciser meets the evaluation condition.
In a preferred embodiment, when the type of rehabilitation training is two-state rehabilitation training, the rehabilitation action execution stage includes a non-evaluation stage and an evaluation stage, and for each acquired rehabilitation action frame image, the state analysis module 630 determines the rehabilitation action execution stage of the exerciser by extracting real-time coordinates of key points of the human body for the rehabilitation action frame image to calculate a first calculated similarity between the rehabilitation action of the exerciser and the rehabilitation action to be executed in the rehabilitation action frame image, determining whether the first calculated similarity is smaller than a first preset similarity, if yes, determining the rehabilitation action execution stage of the exerciser to be the non-evaluation stage, and if not, determining the rehabilitation action execution stage of the exerciser to be the evaluation stage.
In a preferred embodiment, when the type of rehabilitation training is three-state rehabilitation training, the rehabilitation action execution stage includes a non-evaluation stage, an evaluation preparation stage and an evaluation stage, and for each acquired rehabilitation action frame image, the state analysis module 630 determines the rehabilitation action execution stage of the exerciser by extracting real-time coordinates of key points of the human body for the rehabilitation action frame image to calculate a second calculation similarity between the rehabilitation action of the exerciser and the preparation action of the rehabilitation action to be performed in the rehabilitation action frame image, determining whether the second calculation similarity is greater than the second preset similarity, determining that the rehabilitation action execution stage of the exerciser is the non-evaluation stage if the second calculation similarity is less than the second preset similarity, determining that the rehabilitation action execution stage of the exerciser is the evaluation preparation stage if the second calculation similarity is greater than the second preset similarity, and calculating a third calculation similarity between the rehabilitation action of the exerciser and the rehabilitation action to be performed in the rehabilitation action frame image if the third calculation similarity is less than the third preset similarity, and returning to perform the step of calculating the second calculation similarity if the third calculation similarity is greater than the third preset similarity, and determining that the rehabilitation action execution stage is similar to be performed if the third calculation similarity is greater than the third preset similarity.
In a preferred embodiment, the state analysis module 630 is further configured to return to performing the step of calculating the second calculated similarity if it is determined to exit the evaluation phase.
In a preferred embodiment, the assessment module 640 determines whether the rehabilitation activity performance phase of the exerciser meets the assessment condition by determining that the rehabilitation activity performance phase of the exerciser meets the assessment condition when the rehabilitation activity performance phase of the exerciser is the assessment phase.
In a preferred embodiment, the evaluation module 640 is further configured to determine a final score of a rehabilitation activity of the exerciser based on the real-time activity evaluation values corresponding to all rehabilitation activity frame images in the evaluation phase.
In a preferred embodiment, the evaluation module 640 is further configured to determine and display rehabilitation training guidance information according to the final score of a rehabilitation training action of the exerciser.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the application. As shown in fig. 7, the electronic device 700 includes a processor 710, a memory 720, and a bus 730.
The memory 720 stores machine-readable instructions executable by the processor 710, when the electronic device 700 is running, the processor 710 communicates with the memory 720 through the bus 730, and when the machine-readable instructions are executed by the processor 710, the steps of a rehabilitation training evaluation method in the above method embodiment may be executed, and a specific implementation may refer to the method embodiment and will not be described herein.
The embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the step of a rehabilitation training evaluation method in the above method embodiment may be executed, and a specific implementation manner may refer to the method embodiment and will not be described herein.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and variations will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.