A fall recognition method and device based on machine learning
Through the machine learning-based fall recognition method, the crow algorithm is used to optimize the model parameters, and the problem of inaccurate fall recognition in the existing technology is solved, and accurate identification and timely detection of fall behavior in the elderly is achieved.
Patent Information
- Application Number
- CN202210039901.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-14
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-01-14
AI Technical Summary
Existing fall recognition technology is difficult to accurately identify fall behaviors in the elderly, resulting in serious consequences caused by failure to detect them in time.
The fall recognition method based on machine learning is adopted, and the fall recognition model is constructed by collecting human body movement data, preprocessing and feature extraction, and the crow algorithm is used to optimize the model parameters to improve the recognition accuracy.
Accurate identification of fall behavior is achieved, the accuracy and timeliness of recognition are improved, the calculation time is reduced, and the ability to detect and handle falls in the elderly is enhanced.
Smart Images

Figure CN114429674B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a fall recognition method and device based on machine learning, belonging to the technical field of motion recognition. Background Art
[0002] With the aging of the population, people are paying more and more attention to the life safety of the elderly. Falling poses a serious threat to the life safety of the elderly. Relevant surveys and studies have shown that falling is the primary factor causing accidental injuries to the elderly. If no one finds the elderly in time after falling, they often miss the best time for treatment, resulting in irreversible serious consequences. Therefore, it is of great practical significance to study the fall recognition method and effectively identify abnormal falls of the elderly. Fall recognition is essentially to distinguish between normal human activities and fall behaviors. Fall recognition methods can be roughly divided into three categories: threshold-based methods, machine learning-based methods, and methods based on a combination of threshold and machine learning. The three methods play an important role in fall recognition. Summary of the invention
[0003] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a fall recognition method and device based on machine learning, which can accurately and effectively recognize falls.
[0004] To achieve the above object, the present invention is implemented by adopting the following technical solutions:
[0005] In a first aspect, the present invention provides a fall recognition method based on machine learning, comprising:
[0006] Collect human motion data and pre-process the motion data to generate a set to be identified;
[0007] Extract features from the to-be-identified set based on the preset effective features to generate a to-be-identified feature set;
[0008] Input samples in the feature set to be identified into the pre-built fall recognition model for identification and obtain the identification results;
[0009] The construction process of the fall recognition model is as follows:
[0010] Collect human motion data, and annotate the motion data with falling motions and normal human motions to generate an annotation set;
[0011] Preprocess the action data in the labeled set to generate a data set;
[0012] Based on the preset effective features, feature extraction is performed on the data set to generate a sample set, and the sample set is randomly divided into a training set and a test set according to a preset ratio;
[0013] Input the training set and test set into the pre-built RVM model and train and optimize the model parameters based on the Crow algorithm;
[0014] The trained and optimized RVM model is used as the fall recognition model.
[0015] Optionally, the human body falling actions include falling forward, falling backward, falling to the left and falling to the right, and the human body normal activity actions include walking, running, sitting down and standing up.
[0016] Optionally, the motion data includes data of acceleration, angular velocity and attitude angle, the acceleration includes x-axis acceleration, y-axis acceleration and z-axis acceleration; the angular velocity includes x-axis angular velocity, y-axis angular velocity and z-axis angular velocity; the attitude angle includes x-axis attitude angle, y-axis attitude angle and z-axis attitude angle.
[0017] Optionally, the effective features include the combined acceleration of acceleration, the combined angular velocity of angular velocity, and the maximum value, kurtosis, minimum value, skewness, difference range, variance, mean, root mean square and standard deviation of acceleration, angular velocity and attitude angle;
[0018] The resultant acceleration of the accelerations is:
[0019]
[0020] The resultant angular velocity of the angular velocity is:
[0021]
[0022] Wherein, acc is the total acceleration, accx, accy and accz are the x-axis acceleration, y-axis acceleration and z-axis acceleration respectively; gyro is the total angular velocity, gyrox, gyroy and gyroz are the x-axis angular velocity, y-axis angular velocity and z-axis angular velocity respectively.
[0023] Optionally, the pre-built relevance vector machine model is:
[0024]
[0025] Among them, K(x,x i ) is the kernel function, w i is the i-th weight in the weight vector w, b is the preset bias parameter, i = 1, 2, 3, ..., N, N is the number of samples input to the RVM model, x is the valid feature data of any sample, x i is the effective feature data of the i-th sample.
[0026] Optionally, the kernel function is a polynomial kernel function, a Laplace kernel function or a Gaussian kernel function.
[0027] Optionally, the training and optimization of model parameters based on the crow algorithm includes:
[0028] Initialize the crow population P of the crow algorithm and the maximum number of iterations iter max , flight length fl and perception probability AP, and determine the crow's initial position, food hiding position, and upper and lower bounds of the search space;
[0029] Get the target position of crow i after the iterth iteration
[0030]
[0031] in, is the position of crow i at the iterth iteration, is the food hiding position of crow j at the iterth iteration, r i and r j is a random number uniformly distributed in (0,1), is the flight length of crow i in the iterth iteration, is the perception probability of crow j at the iterth iteration, i,j∈P;
[0032] Determine the target location Is it located in the preset search space? If not, crow i stays at position
[0033] If so, crow i moves from its position Fly to the target location Taking the position of crow i and target location They are respectively used as the kernel parameters of the kernel function in the correlation vector machine model;
[0034] The weight w of the RVM model is calculated based on the training set and the kernel parameters. i , based on the kernel parameters and their corresponding weights w i Improve the computational relevance vector machine model;
[0035] Input the test set into the improved computational correlation vector machine model to obtain the positions and target location The fitness of crow i is calculated, and the food hiding position of crow i is updated based on the fitness.
[0036]
[0037] in, and are the positions of crow i at the iterth iteration and target location The fitness of is the food hiding position of crow i at the iter-th iteration;
[0038] Repeatedly obtain the target position of crow i until the maximum number of iterations iter is reached max , the position of the output crow is the optimal kernel parameter, and the final weight of the RVM model is calculated based on the training set and the optimal kernel parameter.
[0039] Optionally, the location and target location The fitness is:
[0040]
[0041]
[0042] Among them, right iter and right iter+1 are the number of results recognized by the RVM model that are the same as the actual results, and M is the total number of samples in the test set.
[0043] Optionally, the weight w of the RVM model is calculated based on the training set and the kernel parameters. i include:
[0044] The Sigmoid function is used to transform the RVM model into a linear model σ{y(x i )};
[0045] Calculate the linear model σ{y(x i )}likelihood estimate probability distribution P(t|w):
[0046]
[0047] Among them, t is the target value vector, t=(t 1 ,t 2 ,…t i …,t I ); x i is the effective feature data of the i-th sample in the training set, and I is the total number of samples in the training set;
[0048] Each weight w i There are corresponding hyperparameters α i And P(w|t,α)∝P(t|w)P(w|α), for fixed hyperparameters, the maximum possible weight w MP for:
[0049]
[0050] Among them, y i =σ{y(x i )}, A=diag(α 1 ,α 2 ,…α i …,α I );
[0051] The Laplace method is used to find the maximum possible weight w MP Take two derivatives:
[0052]
[0053] in, represents the derivative, Φ is an I×(I+1)-order matrix,
[0054]
[0055]
[0056] B=diag(β 1 ,β 2 ,…β i …,β I )
[0057] β i =σ{y(x i )}[1-{y(x i )}]
[0058] make Calculate the hyperparameter update value α new :
[0059] ∑=(Φ T BΦ+A) -1
[0060] w MP =∑Φ T Bt
[0061]
[0062] Among them, γ i =1-α i ∑ ii ,∑ ii is the i-th row and i-th column element of ∑;
[0063] Initialize the hyperparameter α i After that, the hyperparameters are updated and iterated. During the iteration, the hyperparameter α that tends to infinity is eliminated. i , and the remaining hyperparameter α i The corresponding weight wi Keep it as the weight solution.
[0064] In a second aspect, the present invention provides a fall recognition device based on machine learning, comprising a processor and a storage medium;
[0065] The storage medium is used to store instructions;
[0066] The processor is used to operate according to the instructions to execute the steps of any of the methods described above.
[0067] Compared with the prior art, the present invention has the following beneficial effects:
[0068] The present invention provides a fall recognition method and device based on machine learning, which improves the fit of data by extracting effective feature data; at the same time, in the process of constructing a fall recognition model, the kernel parameters are optimized through the crow algorithm, which improves the accuracy of model recognition, while reducing the calculation time and improving the timeliness of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 is a flow chart of a fall recognition method based on machine learning provided by an embodiment of the present invention;
[0070] Figure 2 It is a flow chart of the construction process of a fall recognition model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.
[0072] Embodiment 1:
[0073] like Figure 1 As shown, an embodiment of the present invention provides a fall recognition method based on machine learning, comprising the following steps:
[0074] 1. Collect human motion data and pre-process the motion data to generate a set to be identified;
[0075] 1.1. Human falling movements include falling forward, falling backward, falling to the left and falling to the right. Normal human activities include walking, running, sitting down and standing up.
[0076] 1.2. Motion data includes acceleration, angular velocity and attitude angle data. Acceleration includes x-axis acceleration, y-axis acceleration and z-axis acceleration; angular velocity includes x-axis angular velocity, y-axis angular velocity and z-axis angular velocity; attitude angle includes x-axis attitude angle, y-axis attitude angle and z-axis attitude angle.
[0077] 1.3. Preprocess the action data, which may be to remove some incomplete or invalid data.
[0078] 2. Extract features from the to-be-identified set based on the preset effective features to generate a to-be-identified feature set;
[0079] In this embodiment, the effective features include the combined acceleration of acceleration, the combined angular velocity of angular velocity, and the maximum value, kurtosis, minimum value, skewness, difference range, variance, mean, root mean square and standard deviation of acceleration, angular velocity and attitude angle;
[0080] The total acceleration is:
[0081]
[0082] The resultant angular velocity is:
[0083]
[0084] Wherein, acc is the total acceleration, accx, accy and accz are the x-axis acceleration, y-axis acceleration and z-axis acceleration respectively; gyro is the total angular velocity, gyrox, gyroy and gyroz are the x-axis angular velocity, y-axis angular velocity and z-axis angular velocity respectively.
[0085] 3. Input the samples in the feature set to be identified into the pre-built fall recognition model for identification and obtain the identification results.
[0086] like Figure 2 As shown in the figure, the construction process of the fall recognition model is:
[0087] (1) Collecting human motion data, and annotating the motion data for falling motions and normal human activity motions to generate an annotation set;
[0088] (2) Preprocessing the action data in the labeled set to generate a data set;
[0089] (3) Extract features from the data set based on preset effective features to generate a sample set, and randomly divide the sample set into a training set and a test set according to a preset ratio;
[0090] (4) Input the training set and the test set into the pre-built relevance vector machine model and perform training based on the crow algorithm to optimize the model parameters;
[0091] (5) The trained and optimized RVM model is used as the fall recognition model.
[0092] In this embodiment, the pre-built relevance vector machine model is:
[0093]
[0094] Among them, K(x,x i ) is the kernel function, w i is the i-th weight in the weight vector w, b is the preset bias parameter, i = 1, 2, 3, ..., N, N is the number of samples input to the RVM model, x is the valid feature data of any sample, x i is the effective feature data of the i-th sample.
[0095] The kernel function is a polynomial kernel function, a Laplace kernel function or a Gaussian kernel function. Taking the Gaussian kernel function as an example,
[0096]
[0097] Where d is the kernel parameter.
[0098] Kernel function K(x,x i )’s kernel parameters and weights w i Directly affects the recognition accuracy of the relevant vector machine model.
[0099] In order to improve recognition accuracy, the training and optimization model parameters based on the Crow algorithm include:
[0100] Initialize the crow population P of the crow algorithm and the maximum number of iterations iter max , flight length fl and perception probability AP, and determine the crow's initial position, food hiding position, and upper and lower bounds of the search space;
[0101] Get the target position of crow i after the iterth iteration
[0102]
[0103] in, is the position of crow i at the iterth iteration, is the food hiding position of crow j at the iterth iteration, r i and r j is a random number uniformly distributed in (0,1), is the flight length of crow i in the iterth iteration, is the perception probability of crow j at the iterth iteration, i,j∈P;
[0104] Determine the target location Is it located in the preset search space? If not, crow i stays at position
[0105] If so, crow i moves from its position Fly to the target location Taking the position of crow i and target location They are respectively used as the kernel parameters of the kernel function in the correlation vector machine model;
[0106] Calculate the weight w of the RVM model based on the training set and kernel parameters i , based on the kernel parameters and their corresponding weights w i Improve the computational relevance vector machine model;
[0107] Input the test set into the improved computational correlation vector machine model to obtain the positions and target location The fitness of crow i is calculated, and the food hiding position of crow i is updated based on the fitness.
[0108] Location and target location The fitness is:
[0109]
[0110]
[0111] Among them, right iter and right iter+1 are the number of results that are the same as the actual results from the RVM model, and M is the total number of samples in the test set;
[0112]
[0113] in, and are the positions of crow i at the iterth iteration and target location The fitness of is the food hiding position of crow i at the iter-th iteration;
[0114] Repeatedly obtain the target position of crow i until the maximum number of iterations iter is reached max , the output crow’s position is the optimal kernel parameter, and the final weights of the RVM model are calculated based on the training set and the optimal kernel parameter.
[0115] Specifically, the weight w of the RVM model is calculated based on the training set and kernel parameters. i include:
[0116] The Sigmoid function is used to transform the RVM model into a linear model σ{y(x i )};
[0117] Calculate the linear model σ{y(xi )}likelihood estimate probability distribution P(t|w):
[0118]
[0119] Among them, t is the target value vector, t=(t 1 ,t 2 ,…t i …,t I ); x i is the effective feature data of the i-th sample in the training set, and I is the total number of samples in the training set;
[0120] Each weight w i There are corresponding hyperparameters α i And P(w|t,α)∝P(t|w)P(w|α), for fixed hyperparameters, the maximum possible weight w MP for:
[0121]
[0122] Among them, y i =σ{y(x i )}, A=diag(α 1 ,α 2 ,…α i …,α I );
[0123] The Laplace method is used to find the maximum possible weight w MP Take two derivatives:
[0124]
[0125] in, represents the derivative, Φ is an I×(I+1)-order matrix,
[0126]
[0127]
[0128] B=diag(β 1 ,β 2 ,…β i …,β I )
[0129] β i =σ{y(x i )}[1-{y(x i )}]
[0130] make Calculate the hyperparameter update value α new :
[0131] ∑=(Φ T BΦ+A) -1
[0132] w MP =∑Φ T Bt
[0133]
[0134] Among them, γ i =1-α i ∑ ii ,∑ ii is the i-th row and i-th column element of ∑;
[0135] Initialize the hyperparameter α i After that, the hyperparameters are updated and iterated. During the iteration, the hyperparameter α that tends to infinity is eliminated. i , and the remaining hyperparameter α i The corresponding weight w i Keep it as the weight solution.
[0136] The fall model evaluation of this embodiment:
[0137] Accuracy (ACC), sensitivity (SE), and specificity (SP) are important evaluation indicators of the model in fall recognition. Accuracy, sensitivity, and specificity indicators can be calculated through the prediction results of TP (real fall samples are predicted as the number of falls), FP (real normal samples are predicted as the number of falls), TN (real fall samples are predicted as the number of normal samples), and FN (real normal samples are predicted as the number of normal samples). The ACC, SE, and SP values can directly reflect the effect of fall recognition. F1-score is a comprehensive evaluation indicator of the model in fall recognition. F1-score can be calculated through sensitivity and specificity:
[0138]
[0139] The comprehensive index F1-score can take into account both the sensitivity and specificity of the evaluation model. By evaluating the fall recognition model provided by this embodiment through the comprehensive index F1-score, it can be obtained that the fall recognition model provided by this embodiment has excellent performance.
[0140] Embodiment 2:
[0141] An embodiment of the present invention provides a fall recognition device based on machine learning, including a processor and a storage medium;
[0142] The storage medium is used to store instructions;
[0143] The processor is used to operate according to the instructions to execute the steps of the method as described in the first embodiment.
[0144] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0145] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0146] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0147] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0148] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A fall recognition method based on machine learning, characterized in that: include: Collecting human motion data and preprocessing the motion data to generate a set to be identified; the motion data includes acceleration, angular velocity and attitude angle data; Extract features from the to-be-identified set based on the preset effective features to generate a to-be-identified feature set; Input samples in the feature set to be identified into the pre-built fall recognition model for identification and obtain the identification results; The construction process of the fall recognition model is as follows: Collect human motion data, and annotate the motion data with falling motions and normal human motions to generate an annotation set; Preprocess the action data in the labeled set to generate a data set; Based on the preset effective features, feature extraction is performed on the data set to generate a sample set, and the sample set is randomly divided into a training set and a test set according to a preset ratio; Input the training set and test set into the pre-built RVM model and train and optimize the model parameters based on the Crow algorithm; The trained and optimized RVM model is used as the fall recognition model.
2. A fall recognition method based on machine learning according to claim 1, characterized in that: The human body falling actions include falling forward, falling backward, falling to the left and falling to the right, and the human body normal activity actions include walking, running, sitting down and standing up.
3. The method for fall recognition based on machine learning according to claim 1, characterized in that: The acceleration includes x-axis acceleration, y-axis acceleration and z-axis acceleration; the angular velocity includes x-axis angular velocity, y-axis angular velocity and z-axis angular velocity; the attitude angle includes x-axis attitude angle, y-axis attitude angle and z-axis attitude angle.
4. The method for fall recognition based on machine learning according to claim 3, characterized in that: The effective features include the combined acceleration of acceleration, the combined angular velocity of angular velocity, and the maximum value, kurtosis, minimum value, skewness, difference range, variance, mean, root mean square and standard deviation of acceleration, angular velocity and attitude angle; The resultant acceleration of the accelerations is: ; The resultant angular velocity of the angular velocity is: ; in, is the total acceleration, , and They are x-axis acceleration, y-axis acceleration and z-axis acceleration respectively; is the combined angular velocity, , and They are the x-axis angular velocity, y-axis angular velocity and z-axis angular velocity respectively.
5. The method for fall recognition based on machine learning according to claim 1, characterized in that: The pre-built RVM model is: ; in, is the kernel function, is the weight vector Middle weights, is the preset bias parameter, , is the number of samples input into the RVM model, is the effective feature data of any sample, For the The effective feature data of samples.
6. A method for fall recognition based on machine learning according to claim 5, characterized in that: The kernel function is a polynomial kernel function, a Laplace kernel function or a Gaussian kernel function.
7. The method for fall recognition based on machine learning according to claim 5, characterized in that: The training and optimization model parameters based on the crow algorithm include: Initialize the crow population of the crow algorithm , maximum number of iterations , flight length and perceived probability , and determine the crow's initial position, food hiding position, and upper and lower bounds of the search space; Get Crow In the The target position after iterations : ; in, For the The crow Location, For the The crow The food storage location, and for A uniformly distributed random number in For Crow In the The flight length of the iteration, For Crow in the The perceived probability of the iteration, ; Determine the target location Is it in the preset search space? If not, the crow Stay in position ; If so, then the crow From your location Fly to the target location , with crows Location and target location They are respectively used as the kernel parameters of the kernel function in the correlation vector machine model; Calculate the weights of the RVM model based on the training set and the kernel parameters , based on the kernel parameters and their corresponding weights Improve the computational relevance vector machine model; Input the test set into the improved computational correlation vector machine model to obtain the positions and target location The fitness of the crow is updated based on the fitness Food storage location : ; in, and Respectively The crow Location and target location The fitness of For the The crow The location of food storage; Repeatedly obtain crow until the maximum number of iterations is reached , the output crow’s position is the optimal kernel parameter, and the final weights of the RVM model are calculated based on the training set and the optimal kernel parameter.
8. The method for fall recognition based on machine learning according to claim 7, characterized in that: The location and target location The fitness is: ; ; in, and are the number of results that are the same as the actual results of the RVM model recognition, is the total number of samples in the test set.
9. The method for fall recognition based on machine learning according to claim 7, characterized in that: The weights of the RVM model are calculated based on the training set and the kernel parameters. include: The RVM model is converted into a linear model through the Sigmoid function ; Computational Linear Models Likelihood estimate probability distribution : ; in, is the target value vector, ; For the training set The effective feature data of samples, is the total number of samples in the training set; Each weight Each has a corresponding hyperparameter and , for fixed hyperparameters, the maximum possible weight for: ; in, , ; The Laplace method is used to find the maximum possible weight Take two derivatives: ; in, represents the derivation, for The matrix of order, ; ; ; ; make , calculate the hyperparameter update value : ; ; ; in, , for The i-th row and i-th column element of ; Initializing Hyperparameters After that, the hyperparameters are updated and iterated. During the iteration, the hyperparameters that tend to infinity are eliminated. , and the remaining hyperparameters The corresponding weight Keep it as the weight solution.
10. A fall recognition device based on machine learning, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1-9.
Citation Information
Patent Citations
Human fall detection method based on triaxial acceleration
CN103177530A
Wearable intelligent fall protection device and method
CN108492524A