Detailed Description
In order that the above objects and advantages of the present application will be readily understood, a more particular description of the invention will be rendered by reference to specific embodiments that are illustrated in the appended drawings.
Example noun terms designed in the present application are explained first.
IMU: (Inertial Measurement Unit ), sensors for mainly detecting and measuring acceleration and rotational motion, including accelerometers and gyroscopes (angular velocity meters), wherein the accelerometers can obtain acceleration in each axis direction, and the gyroscopes can obtain angular velocities of each axis, thereby determining angle information. Some inertial measurement units also include magnetometers, from which ambient magnetic field information can be obtained.
A punch method recognition and attribute value calculation thereof will be explained in detail in the present application with reference to fig. 1 to 6. As shown in fig. 1, the method specifically comprises the following steps:
step 1: in the IMU data which is input, a group of fist making candidate areas are generated, wherein the fist making candidate areas actually refer to related IMU data information when a fist making action to be identified is made, and in the subsequent processing process, the fist making method to be identified is determined by judging the fist making candidate area information.
Athletes typically perform a continuous punch action, and therefore, collect information on the punch candidate area, including:
determining an action interval of a fist alternative area;
collecting boxing to be identified in the action interval;
the punch action interval specifically indicates a time period from a punch starting posture to a punch ending posture, namely a time period from a punch withdrawing posture to a punch finishing posture.
After the boxing action zone is determined, the boxing action is considered to be completed, and the boxing action information in the zone can be acquired through the IMU equipment worn on the wrist.
The IMU device can acquire information of the triaxial accelerometer and the triaxial gyroscope in motion.
In practical application, as shown in fig. 2, the action interval of the punch candidate region is generated by the collected IMU raw data, the action gesture recognition is performed by calculating whether the acceleration of the region meets the threshold and the variation of the euler angle and the rotation matrix, whether the punch is correct is judged by neural network recognition, and the correct punch region is finally output.
Step 2: and (3) identifying whether the punch candidate area generated in the step (1) is a correct punch or not by using an accelerometer, an Euler angle, a rotation matrix and a neural network.
Step 21, firstly, the fist-making candidate area in step 1 is transferred into the candidate area preliminary determination function in step 22, if yes, the data is input into the neural network in a specified format to make fist-making determination, and the step further comprises:
step 22: and calculating whether the value of the acceleration y direction of the received region meets a threshold value or not, simultaneously solving the posture of the original data of the IMU through the Euler angle and the rotation matrix, returning to receive the next alternative region if the condition is not met, and transmitting the region into the neural network to perform boxing recognition if the condition is met.
Step 23: a neural network is constructed. The neural network may be used to determine whether the punch candidate area in step 22 is a correct punch. The structure of the neural network is shown in fig. 4. The network is connected with 1 flattening layer, 1 DropOut layer and 2 fully connected layers in sequence.
The input of the flattening layer is inertial navigation data original data, the IMU equipment transmits one piece of data at a time, the period comprises 9 data of values of two accelerometers and one gyroscope in three directions, and in an alternative area, 30 pieces of data before and after the position corresponding to the maximum acceleration value in the acceleration y direction are taken to form an array with the shape of (61, 9). The flattening layer outputs the set of data as a feature vector of length 549.
The input of the full-connection layer is the characteristic vector output by the flattening layer or the last full-connection layer, and after the input characteristic vector is multiplied by the connection weight of the full-connection layer, a fixed-length characteristic vector or a final prediction result is output. The output lengths of the two full connection layers are 64,3 respectively.
The network is trained by using a plurality of data of the punch area calibrated by the boxing method, and the neural network constructed in the step 23 is trained by a back propagation algorithm, so as to obtain network parameters. The network parameters of the neural network, including the connection weight of the full connection layer, are obtained through training by the method.
And (3) training the obtained network parameters through the step (23) to obtain a neural network which is input into a boxing region and can judge the boxing method of the region.
Through the neural network in step 23, it is identified whether the punch candidate area in step 22 is a correct punch action. If the punch is correctly made, the area information is outputted as a correct punch area.
As shown in fig. 3, IMU data is output in a continuous data form, and according to screening of the punch region, punch original information of each section can be obtained.
The specific punch generating area adopts the following modes:
firstly judging whether the acceleration meets a threshold value or not through the received alternative area, wherein the judgment basis is that the punch moves rapidly, the corresponding acceleration direction changes greatly, then the acceleration changes of the starting gesture and the ending gesture of the punch approach zero, further judging the action interval of one punch, and the interval of the punch can be seen obviously according to the visual result in the figure 3.
In the practical application process, the boxing recognition model needs to be trained in advance, and the training boxing model also needs corresponding model training data, so that the model method further comprises the following steps:
acquiring boxing action information and boxing action type by using IMU equipment;
processing the acquired punch information into unified punch gesture information;
extracting the action characteristic information of the fist from the fist action information and the fist gesture information;
training a boxing recognition model according to the boxing action characteristic information and the boxing action type;
the specific operation is that the information of the punch action and the type of the punch action are known information respectively, and the data can be marked in a manual marking mode. For example, after the boxing player wears the IMU device, technical actions of straight boxing, boxing and boxing are sequentially executed, and meanwhile, the IMU device acquires corresponding boxing action information, and the boxing action types are straight boxing, boxing and boxing in sequence.
After the boxing action information is obtained, the boxing action characteristic information and the boxing action type can be formed into a training sample set, and the training sample set is used for training a boxing recognition model.
Specifically, training a boxing recognition model according to the boxing action feature information and the boxing action type, including:
inputting the boxing action characteristic information into a boxing recognition model;
obtaining a predicted boxing action type output by the boxing recognition model;
calculating a model loss value through a back propagation algorithm according to the predicted boxing action type and the boxing action type;
and adjusting model parameters of the boxing recognition model based on the model loss value, and continuously training the boxing recognition model until training conditions are reached.
In the training of an actual boxing recognition model, a plurality of training sample sets exist, each training sample set comprises boxing motion characteristic information and boxing motion types corresponding to the boxing motion information, specifically, the boxing motion characteristic information is input into the boxing recognition model to be trained for training, and the boxing recognition model responds to the boxing motion characteristic information to output the boxing motion types.
In the training process, the predicted boxing action type is predicted by an untrained boxing recognition model, and the predicted boxing action type is different from the actual boxing action type to a certain extent, so that comparison is needed by predicting the boxing action type and the actual boxing action type, specifically, the model loss value is calculated by predicting the boxing action type and the actual boxing action type, and in the application, we select a multi-classification loss function to calculate the loss value.
After the loss value is calculated, the model loss value can be transmitted to the boxing recognition model through a back transmission algorithm, parameters of each layer of the boxing recognition model are adjusted, training of the current batch is finished, next boxing sample data sets of the next batch are needed to be used, and training of the model is continued until model training stopping conditions are reached.
In the present application, the model training stop condition includes that the loss value is smaller than a preset threshold value for 5 consecutive times and/or that the model training round reaches a preset round.
The boxing identification model in the application is completed through training of a large number of boxing action samples, so that the boxing identification model is more accurate, the error is smaller, the identification error rate is reduced, and the user experience is improved.
Finally, extracting parameters of each layer of the model according to a weight file generated by the boxing identification model, reproducing the model through C++, and finally implanting reproduced codes into a calculation module of the IMU equipment, so that boxing identification of original boxing information acquired by the IMU can be completed in real time.
And step 3, if the punch area is identified as the correct punch in the step 2, calculating the punch attribute value information by further utilizing an integral algorithm. Wherein the attribute values include punch speed, strength, power, acceleration, action time. The steps further include:
and step 31, receiving the punch area data determined in the step 2.
Step 32 calculates the punch speed using an integral algorithm.
Wherein the output result V is the speed of punch, t is the interval time between two sampling points, (x) k 、y k 、z k ) Acceleration values at a certain moment in different directions are output for the IMU device.
Step 33, taking out the triaxial acceleration at the moment corresponding to the maximum acceleration value returned by the accelerometer in the fist area to calculate the total acceleration, specifically:
wherein a is X 、a Y 、a Z The values of the triaxial accelerations, respectively.
Step 34, calculating the boxing force by using Newton's second law, specifically:
F=ma
where m is the weight of the user's arm, if the weight of the arm is unknown, then by weight calculation, where male arm weight typically accounts for 0.057 of the weight, female arm weight typically accounts for 0.0497 of the weight, and a is the total acceleration.
Step 35, taking out the fist starting index to the maximum acceleration value index to calculate the fist action time, specifically:
T=(t max -t start )
wherein (t) max 、t start ) The time corresponding to the maximum acceleration value and the punch starting time are respectively set.
Step 36, calculating to obtain the power of the punch through a dynamic formula, wherein the power is specifically:
P=FV
wherein F and V are the punch strength and speed calculated in the foregoing.
And 37, integrating the boxing method and the attribute values and outputting the integrated boxing method and the integrated attribute values, specifically, communicating with mobile terminal equipment through a Bluetooth protocol, sending boxing information to the background, and displaying the information through output equipment such as a display screen, a touch screen and the like. Fig. 6 is a schematic diagram of a boxing method and attribute values corresponding to one-time boxing data.
In practical cases, the application provides a system for detecting boxing and identifying attribute values thereof, the structure of which is shown in fig. 7, and the system specifically comprises the following modules:
and the punch candidate region generation module is used for generating a group of punch candidate regions in the original data transmitted by the received IMU.
As shown in fig. 3, the IMU device outputs as continuous data, which may or may not include a punch.
And the boxing method identification module is used for judging boxing methods of the boxing alternative areas.
Specifically, the boxing method identification module is divided into two steps of judgment:
firstly, judging whether a boxing action is performed or not through the accelerometer and the change of the Euler angle and the rotation matrix;
and secondly, inputting the alternative area into the neural network in the step 23, and judging whether the area is a correct punch or not.
And if the two steps meet the conditions, performing a third step, and calculating the attribute value.
And the attribute value calculation module calculates and obtains the attribute of the punch through an integral algorithm, the Newton second theorem and a dynamic formula, wherein the attribute comprises punch speed, strength, power, acceleration and action time.
And the output module is used for communicating with the mobile terminal equipment through a Bluetooth protocol after the calculation of the attribute value is completed, sending the punch information to the background and displaying the information through output equipment such as a display screen, a touch screen and the like.
The above disclosure is only intended to assist in understanding the methods and core ideas of the present disclosure; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present disclosure, the present disclosure should not be construed as being limited to the above description.