Action classification method and device, electronic equipment and readable storage medium

By adjusting the number of data frames of action sequence data to make it conform to the preset range, the accuracy problem caused by the inconsistent number of data frames in action classification is solved, and the stability and accuracy of the action classification model are improved.

CN118711253APending Publication Date: 2024-09-27SANY INTELLIGENT EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410907981.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-08
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Action classification in the existing technology is not accurate enough, mainly because the inconsistent number of data frames of action sequence data results in inconsistent time information, which affects the accuracy of the action classification model.

Method used

By receiving the action sequence data set, identify the target action sequence data, adjust the number of data frames to make it within the preset range, ensure that the number of data frames is consistent, and then input it to the action classification model for classification, using the method of reducing or increasing data frames , especially processing at the beginning, tail and middle of the time series to preserve core features.

Benefits of technology

It improves the stability and accuracy of the action classification model, ensures that the action sequence data is aligned on the number of data frames, enhances the model's ability to capture action time features, and improves the accuracy of action classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118711253A
    Figure CN118711253A
Patent Text Reader

Abstract

The invention discloses an action classification method and device, electronic equipment and a readable storage medium, and relates to the technical field of video data processing, and the action classification method comprises the steps: receiving a first action sequence data set; identifying target action sequence data included in the first action sequence data set; at least one target action sequence data in the first action sequence data set is processed, so that the data frame number of the processed target action sequence data is within the target data frame number range, and the number of the target action sequence data included in the first action sequence data set meets a preset threshold value, obtaining a second action sequence data set; and inputting the second action sequence data set into a preset action classification model for action classification to obtain an action classification result. According to the scheme, the action sequence data can be more stably processed by the action classification model, so that the accuracy when the action classification model executes action classification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video data processing, and in particular to an action classification method, device, electronic device and readable storage medium. Background Art

[0002] Action and behavior recognition refers to the processing of video data or image data to identify the actions or behaviors performed by humans or objects within a specific time period.

[0003] In the prior art, when an action classification model is used to classify action sequence data, there is a technical problem that the action classification is not accurate enough. Summary of the invention

[0004] The present invention aims to at least solve the technical problem of inaccurate action classification in the prior art. To this end, the first aspect of the present invention proposes an action classification method.

[0005] A second aspect of the present invention provides an action classification device.

[0006] A third aspect of the present invention provides an electronic device.

[0007] A fourth aspect of the present invention provides a readable storage medium.

[0008] To achieve the above-mentioned purpose, the first aspect of the present invention proposes an action classification method, comprising: receiving a first action sequence data set; identifying target action sequence data included in the first action sequence data set, wherein the number of data frames of the target action sequence data is outside the target data frame number range; when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, performing processing on at least one target action sequence data in the first action sequence data set, so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set; inputting the second action sequence data set into a preset action classification model for action classification, thereby obtaining an action classification result.

[0009] According to the action classification method provided by the present invention, firstly, a first action sequence data set is received. Then, the target action sequence data included in the first action sequence data set is identified. Then, when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, at least one target action sequence data in the first action sequence data set is processed so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set. By performing processing on the target action sequence data, each action sequence data is aligned in terms of the number of data frames, and finally the second action sequence data set is input into a preset action classification model for action classification, thereby obtaining an action classification result. It is understandable that the inconsistent number of data frames of the action sequence data will lead to inconsistent time information of different action sequence data. In the action classification task, time information is very important for distinguishing different actions. If the number of data frames is inconsistent, the model may not be able to accurately capture the time characteristics of the action, thereby affecting the classification accuracy. Moreover, the inconsistent number of data frames will lead to difficulty in data alignment, making it difficult for the model to compare the similarities and differences between different action sequences, thereby affecting the accuracy of action classification. Therefore, through this method, the action classification model can process action sequence data more stably, thereby improving the accuracy of the action classification model when performing action classification.

[0010] In addition, the above technical solution provided by the present invention may also have the following additional technical features:

[0011] In the above technical solution, the step of processing at least one target action sequence data in the first action sequence data set so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets a preset threshold includes: detecting the number of data frames of the target action sequence data; when the number of data frames of the target action sequence data is higher than the upper limit value of the target data frame number range, reducing at least one data frame of the target action sequence data so that the number of data frames of the target action sequence data after the reduced data frames can be within the target data frame number range; when the number of data frames of the target action sequence data is lower than the lower limit value of the target data frame number range, adding at least one data frame of the target action sequence data so that the number of data frames of the target action sequence data after the added data frames can be within the target data frame number range.

[0012] In this technical solution, the number of data frames of the target action sequence data is first detected to determine whether the number of data frames of a specific target action sequence data exceeds the upper limit of the target data frame number range or is lower than the lower limit of the target data frame number range. A specific processing method is given for different situations. This processing method enables the target action sequence data to achieve alignment in terms of the number of data frames, thereby achieving alignment of the first action sequence data set. By aligning the first action sequence data set, the action sequence data can be processed more stably, and accordingly, the action classification result obtained is more accurate.

[0013] In addition, the above technical solution provided by the present invention may also have the following additional technical features:

[0014] In the above technical solution, the step of reducing at least one data frame of the target action sequence data includes: for the target action sequence data, in the time series, reducing the data frames at the head of the time series, in the middle of the time series and / or at the end of the time series, wherein the number of data frames reduced at the head of the time series and / or at the end of the time series is greater than the number of data frames reduced at the middle of the time series.

[0015] In this technical scheme, for target action sequence data, in time sequence, the number of data frames that reduce the time sequence header and / or the time sequence tail is more than the number of data frames that reduce the time sequence middle part.It is understandable that, first, the core features of action sequence data are usually concentrated in the execution process of action, i.e. the middle part of time sequence.These data frames include the key action steps and features of action, which are more important for the identification of action classification model.Secondly, the starting and ending parts of action sequence data usually include the preparation and ending action of action, and these parts are less for the influence of action classification relative to the core part of action.Therefore, the method of the present embodiment, by reserving the data frames in the middle part of time sequence as much as possible, to reduce the loss of key features, ensures that the action classification model can fully identify the features of action sequence data, to improve classification accuracy.

[0016] In addition, the above technical solution provided by the present invention may also have the following additional technical features:

[0017] In the above technical solution, the step of adding at least one data frame of the target action sequence data includes: for the target action sequence data, in the time series, adding data frames at the head of the time series, in the middle of the time series and / or at the end of the time series, wherein the number of data frames added at the head of the time series and / or at the end of the time series is greater than the number of data frames added in the middle of the time series.

[0018] In this technical solution, for the target action sequence data, in the time series, the number of data frames at the head of the time series and / or the tail of the time series is increased more than the number of data frames in the middle of the time series. It can be understood that, as mentioned above, the core features of the action sequence data are usually concentrated in the execution process of the action, that is, the middle of the time series. These data frames contain the key action steps and features of the action. Therefore, when adding data frames, try to avoid interfering with the data frames in the middle of the time series, thereby improving the classification accuracy.

[0019] In addition, the above technical solution provided by the present invention may also have the following additional technical features:

[0020] In the above technical solution, the step of adding data frames at the beginning, the middle and / or the end of the time series includes: increasing the number of data frames in the middle of the time series by linear interpolation.

[0021] In this technical scheme, by adopting the mode of linear interpolation, the number of data frames in the middle of the time series is increased, the continuity of the data in the middle of the time series can be guaranteed, and the transition between the inserted data frame and the adjacent data frame is guaranteed to be smooth, avoiding the situation of sudden change or discontinuity. The position information of the inserted data frame obtained by linear interpolation calculation is derived based on the key point position information of the adjacent data frame, which can keep the consistency and rationality of the data in the middle of the time series. As above, the core features of the action sequence data are usually concentrated in the execution process of the action, i.e. the middle of the time series. Therefore, by the present embodiment, it can be ensured that the action classification model can fully identify the core features, thereby improving the classification accuracy of the action classification model.

[0022] In addition, the above technical solution provided by the present invention may also have the following additional technical features:

[0023] In the above technical solution, the step of adding data frames at the head of the time series, in the middle of the time series and / or at the end of the time series includes: adding data frames at the head of the time series and / or at the end of the time series by inserting blank data frames or by linear interpolation.

[0024] In this technical scheme, by adopting the mode of inserting blank data frames or the mode of linear interpolation, the data frames at the head of the time series and / or the tail of the time series are increased. The starting and ending parts of the action sequence data usually include the preparation and ending actions of the action, and these parts have less influence on the action classification relative to the core part of the action. Therefore, in this embodiment, by adopting the mode of inserting blank data frames or the mode of linear interpolation, the data frames at the head of the time series and / or the tail of the time series are increased to avoid affecting the core features of the action sequence data, thereby improving the classification accuracy of the action classification model.

[0025] In addition, the above technical solution provided by the present invention may also have the following additional technical features:

[0026] In the above technical solution, the first action sequence data set also includes noise action sequence data. Before the step of identifying the target action sequence data included in the first action sequence data set, the method also includes: based on a preset judgment rule, identifying and deleting the noise action sequence data in the first action sequence data set.

[0027] In this technical solution, the noise action sequence data in the first action sequence data set is identified and deleted based on a preset judgment rule. By identifying and deleting the noise action sequence data, the quality of the data set can be improved, and the interference of irrelevant or incomplete data on the action classification model can be reduced, thereby improving the accuracy and stability of the model. Secondly, identifying and deleting the noise action sequence data in the first action sequence data set can reduce the computational overhead and improve the classification efficiency of the action classification model.

[0028] In addition, the above technical solution provided by the present invention may also have the following additional technical features:

[0029] In the above technical solution, before the step of receiving the first action sequence data set, the method also includes: receiving video data for characterizing human action behavior; inputting the video data into a preset human posture recognition model to identify key points, and obtaining key point data of at least one human body in the video data in a time series, wherein the key point data is used to characterize the type information and position information of the key points of the human body; according to the time series, inputting the key point data of at least one human body into a preset target tracking model for identification, and obtaining the first action sequence data set.

[0030] In this technical solution, firstly, video data for characterizing human motion behavior is received. Then, the video data is input into a preset human posture recognition model to identify key points, and key point data of at least one human body in the video data under a time series is obtained. Finally, according to the time series, the key point data of at least one human body is input into a preset target tracking model for identification, and a first action sequence data set is obtained. This method can directly obtain the corresponding first action sequence data set through video data, and the acquisition method is simple. And the action sequence data is obtained through the target tracking model, which ensures the continuity of the action, grasps the main features of the action, and improves the accuracy of subsequent action classification.

[0031] The second aspect of the present invention provides an action classification device, comprising: a receiving module, which is used to receive a first action sequence data set; an identification module, which is used to identify target action sequence data included in the first action sequence data set, wherein the number of data frames of the target action sequence data is outside the target data frame number range; a processing module, which is used to perform processing on at least one target action sequence data in the first action sequence data set when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set; an action classification module, which is used to input the second action sequence data set into a preset action classification model for action classification, and obtain an action classification result.

[0032] This scheme first receives a first action sequence data set. Then, the target action sequence data included in the first action sequence data set is identified. Then, when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, at least one target action sequence data in the first action sequence data set is processed so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set. In this embodiment, by processing the target action sequence data, each action sequence data is aligned in terms of the number of data frames, and finally the second action sequence data set is input into a preset action classification model for action classification to obtain an action classification result. It can be understood that the inconsistent number of data frames of the action sequence data will lead to inconsistent time information of different action sequence data. In the action classification task, time information is very important for distinguishing different actions. If the number of data frames is inconsistent, the model may not be able to accurately capture the time characteristics of the action, thereby affecting the classification accuracy. Moreover, the inconsistent number of data frames will lead to difficulty in data alignment, making it difficult for the model to compare the similarities and differences between different action sequences, thereby affecting the accuracy of action classification. Therefore, through this embodiment, the action classification model can process action sequence data more stably, thereby improving the accuracy of the action classification model when performing action classification.

[0033] The third aspect of the present invention provides an electronic device, including a processor, a memory, and a program or instruction stored in the memory and executable on the processor, which implements the steps of the action classification method in any of the above technical solutions when the program or instruction is executed by the processor.

[0034] A fourth aspect of the present invention provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the action classification method in any of the above technical solutions are implemented.

[0035] Additional aspects and advantages of the present invention will become apparent from the following description or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0037] Figure 1 One of the flow charts of the action classification method according to one embodiment of the present invention is shown;

[0038] Figure 2 A second flowchart of the action classification method according to an embodiment of the present invention is shown;

[0039] Figure 3 A third flowchart of an action classification method according to an embodiment of the present invention is shown;

[0040] Figure 4 A fourth flowchart of an action classification method according to an embodiment of the present invention is shown;

[0041] Figure 5 A fifth flowchart of an action classification method according to an embodiment of the present invention is shown;

[0042] Figure 6 A sixth flowchart of an action classification method according to an embodiment of the present invention is shown;

[0043] Figure 7 A seventh flowchart of the action classification method according to an embodiment of the present invention is shown;

[0044] Figure 8 An eighth flowchart of the action classification method according to an embodiment of the present invention is shown;

[0045] Fig. 9 A schematic diagram of the structure of an action classification device according to an embodiment of the present invention is shown;

[0046] Fig.10 A schematic diagram of an electronic device according to an embodiment of the present invention is shown.

[0047] in, Fig. 9 and Fig.10 The corresponding relationship between the reference numerals and the component names is as follows:

[0048] 100: action classification device; 101: receiving module; 102: identification module; 103: processing module; 104: action classification module; 200: electronic device; 201: memory; 202: processor. DETAILED DESCRIPTION

[0049] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0050] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0051] Refer to the following Figures 1 to 10An action classification method, device, electronic device and readable storage medium according to some embodiments of the present invention are described.

[0052] Figure 1 FIG. 1 is a flowchart of an action classification method according to an embodiment of the present invention. The action classification method may include:

[0053] S102: Receive a first action sequence data set;

[0054] S104: Identify target action sequence data included in the first action sequence data set;

[0055] Wherein, the data frame number of the target action sequence data is outside the target data frame number range;

[0056] S106: When the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, processing is performed on at least one target action sequence data in the first action sequence data set, so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set;

[0057] S108: Inputting the second action sequence data set into a preset action classification model to perform action classification to obtain an action classification result.

[0058] In this embodiment, the received action can be represented as the action of the server receiving the first action sequence data set transmitted from other devices, for example, static body movements and dynamic body movements of personnel in a specific environment. Further, the specific environment can be an underground environment, an underground mine environment or other environment. In some embodiments, the received action can also be represented as the action of a preset program configured in the server receiving the first action sequence data set transmitted from other processing flows. The first action sequence data set can be a data set that is passed to a subsequent processing program after preliminary processing or other operations. The first action sequence data set can be represented as a data set including two or more action sequence data.

[0059] In this embodiment, the action sequence data can be represented as multiple data frames on a time series, and each data frame can be used to characterize the position information and type information of each key point of the human body at a certain time point on the time series. The key point is a key point on a human limb, such as a head, a shoulder, and a knee. The time series can be represented by a data frame, for example, each data frame corresponds to the position information and type information of at least one key point. It can be understood that the data frame can be represented as a frame of image data of video data, and the position information of the key point is represented as the coordinate position in the image data, such as the horizontal coordinate and the vertical coordinate of the key point in the image data. The type information of the key point can be represented as the category of the key point, such as whether it is the key point of the head or the key point of the knee. In some embodiments, the action sequence data can also correspond to an identity identifier, and it can be understood that the actions performed by different people need to be distinguished as needed. Therefore, the first action sequence data set can include multiple action sequence data of only one person, or it can include action sequence data of multiple people. In actual application scenarios, the parameter track id can be used to represent the identity identifier. In a possible scenario example, the action sequence data can be represented as the action sequence data of underground workers when they work underground. It is understandable that the special production environment of coal mines is accompanied by many safety hazards, and video surveillance is one of the important measures to discover these safety hazards. However, a large number of cameras are installed underground, resulting in huge costs for 24-hour manual monitoring. With the development of artificial intelligence technology and coal mine intelligence, the application of artificial intelligence technology to video surveillance of coal mines has become a research hotspot, and the action recognition of underground workers in the video has become an important new means and tool for safety monitoring and management. Action classification is a technology that extracts human actions from continuous image sequences. By analyzing the actions of underground workers, potential dangers can be warned.

[0060] In this embodiment, the target action sequence data is the action sequence data that needs to be identified. The action of identification can be represented as an action of identifying specific target action sequence data from the first action sequence data set based on a preset rule. The preset rule can be a rule that the number of data frames of the target action sequence data is outside the target data frame number range.

[0061] In this implementation, the target data frame number range may represent a numerical interval of data frames, for example, may be 300 frames to 350 frames.

[0062] In some embodiments, the target data frame number range can represent the numerical value of a specific data frame, such as 300 frames. In this case, the data frame number of the target action sequence data is outside the target data frame number range, and can be expressed as, the action sequence data whose data frame number is not equal to 300 frames are all target action sequence data. It is understandable that when the target data frame number range represents the numerical interval of the data frame, the data frame number of the target action sequence data is outside the target data frame number range, and is expressed as, the data frame number of the target action sequence data is higher than the upper limit of the numerical interval, or lower than the lower limit of the numerical interval. For example, the upper limit is 350 frames, higher than 350 frames, can be 360 ​​frames, or the lower limit is 300 frames, lower than 300 frames, can be 290 frames.

[0063] In this embodiment, the preset threshold value can represent a specific numerical value, such as 50, 60 or 100. That is, when the number of target action sequence data included in the first action sequence data set exceeds 50, the subsequent processing action is triggered. The preset threshold value can also represent a specific proportional coefficient, such as 5%, 8% or 10%. When the proportional coefficient is set to 10%, when the proportional coefficient of the number of target action sequence data to the number of all action sequence data in the first action sequence data set exceeds 10%, the subsequent processing action is triggered.

[0064] In this embodiment, the processing action can be represented as an operation of increasing or decreasing data frames on the target action sequence data, and after the operation of increasing or decreasing data frames, the number of data frames of the processed target action sequence data can be within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold. For example, if the number of data frames of the target action sequence data is higher than the upper limit of the target data frame number range, the data frames of the target action sequence data need to be reduced, and if the number of data frames of the target action sequence data is lower than the lower limit of the target data frame number range, the data frames of the target action sequence data need to be increased.

[0065] In the present embodiment, the preset action classification model can adopt pre-trained LSTM (Long Short-Term Memory, long short-term memory network) model, because the data format of the action sequence data is sequence data, so the classification accuracy of the LSTM model is higher. The LSTM model can adopt the following structure: the first layer is the LSTM layer, the second layer is the CNN (Convolutional Neural Network, Convolutional Neural Network) layer, then the ReLU (Rectified LinearUnit, linear rectifier function) activation function is connected, and the output layer is the fully connected layer at last. In some embodiments, the preset action classification model can also adopt pre-trained recurrent neural network (RNN, Recurrent Neural Network), bidirectional recurrent neural network (Bidirectional RNN) and attention mechanism model (Attention Mechanism).

[0066] In the present embodiment, the preset action classification model can be obtained by pre-training in the following method, and the LSTM model is used as an example. First, a training set is prepared, and the training set can be a plurality of action sequence data with action categories marked. The action category can be the action of the maintenance equipment, the action of the operating equipment, and the emergency action, etc. The action sequence data can be manually marked by the method of manual marking, and the action sequence data can also be automatically marked by the automatic marking tool. Then the action sequence data and the corresponding marked data are input into the LSTM model to be trained, and the LSTM model is trained for multiple rounds until the training is completed. It can be understood that the marked data is obtained through the marking action, for example, the action sequence data is manually marked by the marking software, and the manual marking is completed, and the marking software outputs the data. The marked data can be structured data in the format of JSON (JavaScript Object Notation, a lightweight data exchange format). The training completion can be confirmed by the convergence of the loss function. Finally, the LSTM model that has been trained is tested using the pre-prepared test set, and when the test passes, the preset action classification model is obtained.

[0067] In some embodiments, a complete data set for training and testing can be directly constructed first, and the data set includes multiple action sequence data, and each action sequence data can correspond to a specific identity (trackid), and the training set and the test set can be divided by the identity. At the same time, it is ensured that the proportion of each type of data in the set after the division is equal to the proportion before the division. After the division, the valid action sequence data is obtained through the identity.

[0068] In some embodiments, the number of data frames of the target action sequence data in the training set can be within the range of the target data frame number, and the number of target action sequence data included in the training set also meets the preset threshold. It is understandable that inconsistent data frame numbers will lead to inconsistent input data dimensions in the feature extraction process. Therefore, during the training process, by processing the training set, the action classification model accurately learns the features of the action sequence data.

[0069] In this embodiment, the action classification result can be expressed as a specific action category of a person. In the above scenario example, the action classification result can be an action category of the underground worker when working underground. For example, it can be an action category of maintenance equipment, an action category of operating equipment, an emergency action category, etc. In some embodiments, as above, because the action sequence data can correspond to an identity identifier, the action classification result can further include action categories of different people. For example, underground worker A performs the action of repairing equipment, and underground worker B performs the action of operating equipment. It can be understood that because the action category corresponds to action sequence data, and the action sequence data corresponds to a time series, because the implementation method can not only identify the action category, but also identify the time when each action category occurs, which can be the time when the action occurs and the time when the action ends. The start and end of the action can be located. Therefore, this implementation combines the actual environment in the coal mine, detects the unsafe behavior of underground personnel through ordinary video surveillance, and provides an important new means and tool for safety monitoring and management. It provides necessary technical support for timely detection of unsafe actions of underground workers and ensuring the safety of underground operation processes.

[0070] In this embodiment, a first action sequence data set is first received. Then, the target action sequence data included in the first action sequence data set is identified. Then, when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, at least one target action sequence data in the first action sequence data set is processed so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set. In this embodiment, by processing the target action sequence data, each action sequence data is aligned in terms of the number of data frames, and finally the second action sequence data set is input into a preset action classification model for action classification, thereby obtaining an action classification result. It is understandable that inconsistent data frame numbers of action sequence data will lead to inconsistent time information of different action sequence data. In the action classification task, time information is very important for distinguishing different actions. If the number of data frames is inconsistent, the model may not be able to accurately capture the time characteristics of the action, thereby affecting the classification accuracy. Moreover, inconsistent data frame numbers will lead to data alignment difficulties, making it difficult for the model to compare the similarities and differences between different action sequences, thereby affecting the accuracy of action classification. Therefore, through the method of this embodiment, the action classification model can process action sequence data more stably, thereby improving the accuracy of the action classification model when performing action classification.

[0071] Figure 2 The second flowchart of the action classification method according to an embodiment of the present invention. The step of processing at least one target action sequence data in the first action sequence data set so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets a preset threshold includes:

[0072] S202: Detect the number of data frames of target action sequence data;

[0073] S204: When the number of data frames of the target action sequence data is higher than the upper limit of the target data frame number range, reduce at least one data frame of the target action sequence data so that the number of data frames of the target action sequence data after the reduced data frame can be within the target data frame number range.

[0074] S206: When the number of data frames of the target action sequence data is lower than the lower limit of the target data frame number range, at least one data frame of the target action sequence data is added so that the number of data frames of the target action sequence data after the added data frame can be within the target data frame number range.

[0075] In this embodiment, reducing at least one data frame of the target action sequence data can be represented as the action of extracting one or more data frames from the target action sequence data. Extracting one or more data frames means deleting the position information and type information of the key points of the extracted data frames from the time series. The corresponding number of data frames also needs to be deleted. Therefore, the purpose of reducing the number of data frames in the action sequence data is achieved by deleting one or more data frames. Correspondingly, adding an action, i.e., adding at least one data frame of the target action sequence data, can be represented as adding one or more data frames from the target action sequence data.

[0076] In this embodiment, the number of data frames of the target action sequence data is first detected to determine whether the number of data frames of a specific target action sequence data exceeds the upper limit of the target data frame number range or is lower than the lower limit of the target data frame number range. A specific processing method is given for different situations. This processing method enables the target action sequence data to achieve alignment in terms of the number of data frames, thereby achieving alignment of the first action sequence data set. By aligning the first action sequence data set, the action sequence data can be processed more stably, and accordingly, the action classification result obtained is more accurate.

[0077] Figure 3 The third flowchart of the action classification method according to an embodiment of the present invention. The step of reducing at least one data frame of the target action sequence data comprises:

[0078] S302: When the number of data frames of the target action sequence data is higher than the upper limit of the target data frame number range, for the target action sequence data, in the time series, reduce the data frames at the head of the time series, in the middle of the time series and / or at the end of the time series, wherein the number of data frames at the head of the time series and / or at the end of the time series reduced is greater than the number of data frames at the middle of the time series reduced;

[0079] S207: Obtain a second action sequence data set.

[0080] In this embodiment, the data frame at the head of the time series is represented as the data frame in the first 5%, first 6% or first 8% in the time series. Specifically, for example, for a target action sequence data with 300 data frames, the first 5% of the data frames are the first to 15 frames. Correspondingly, the data frame at the tail of the time series can be the data frame in the last 5%, last 6% or last 8%. Also correspondingly, except for the data frames at the head and tail of the time series, the data frames are the data frames in the middle of the time series.

[0081] In this embodiment, the data frames at the head of the time series, at the tail of the time series, and at the middle of the time series can all be reduced, and only the data frames at the head of the time series or only the data frames at the tail of the time series can be reduced. The data frames at the head of the time series and at the tail of the time series can also be reduced. Specifically, the data frames can be randomly selected and the selected data frames can be deleted, or the data frames can be selected at equal intervals and the selected data frames can be deleted.

[0082] In this embodiment, when the number of data frames of the target motion sequence data is higher than the upper limit of the target data frame number range, the target motion sequence data is processed to obtain a second motion sequence data set.

[0083] In this embodiment, for the target action sequence data, in the time sequence, the number of data frames that reduce the time sequence header and / or the time sequence tail is more than the number of data frames that reduce the time sequence middle part.It is understandable that, first, the core feature of the action sequence data is usually concentrated in the execution process of the action, i.e. the middle part of the time sequence.These data frames have included the key action steps and features of the action, which are more important for the identification of the action classification model.Secondly, the start and end parts of the action sequence data usually include the preparation and end action of the action, and these parts are less for the influence of the action classification relative to the core part of the action.Therefore, the method of the present embodiment, by removing the data frames in the middle part of the time sequence as much as possible, to reduce the loss of key features, ensures that the action classification model can fully identify the features of the action sequence data, to improve the classification accuracy.

[0084] Figure 4 This is a fourth flow chart of an action classification method according to an embodiment of the present invention. The step of adding at least one data frame of target action sequence data comprises:

[0085] S402: when the number of data frames of the target action sequence data is lower than the lower limit of the target data frame number range, for the target action sequence data, in the time sequence, adding data frames at the head of the time sequence, at the middle of the time sequence and / or at the end of the time sequence, wherein the number of data frames added at the head of the time sequence and / or at the end of the time sequence is greater than the number of data frames added at the middle of the time sequence;

[0086] S207: Obtain a second action sequence data set.

[0087] In this embodiment, for the target action sequence data, in the time sequence, the number of data frames that increase in the time sequence header and / or the time sequence tail is more than the number of data frames that increase in the middle of the time sequence. It can be understood that, as above, the core features of the action sequence data are usually concentrated in the execution process of the action, i.e. the middle of the time sequence. These data frames contain the key action steps and features of the action. Therefore, when adding data frames, try to avoid interfering with the data frames in the middle of the time sequence, thereby improving the classification accuracy.

[0088] Figure 5 This is a fifth flow chart of an action classification method according to an embodiment of the present invention. The step of adding a data frame at the head of a time series, at the middle of a time series and / or at the end of a time series comprises:

[0089] S502: when the number of data frames of the target action sequence data is lower than the lower limit of the target data frame number range, for the target action sequence data, in the time series, linear interpolation is used to increase the number of data frames in the middle of the time series;

[0090] S207: Obtain a second action sequence data set.

[0091] In this embodiment, the number of data frames in the middle of the time series can be increased by using linear interpolation. Specifically, first, two adjacent data frames that need to be interpolated are selected in the middle of the time series, and are recorded as Frame1 and Frame2 respectively. Then, based on the data frame to be inserted, the difference between the key point position information of the two adjacent data frames before and after is calculated. Next, according to the principle of linear interpolation, the difference between the key point position information of the two data frames before and after is divided by 2, and then the position information of Frame1 is added to obtain the position information of the inserted data frame. Finally, according to the calculated position information, the new data frame is inserted between Frame1 and Frame2, so that the number of data frames in the middle of the time series is increased. It can be understood that calculating the difference between the key point position information of Frame2 and Frame1 is to calculate the difference between the position information of key points of the same type.

[0092] In this embodiment, by adopting the mode of linear interpolation, the number of data frames in the middle of the time series is increased, the continuity of the data in the middle of the time series can be guaranteed, and the transition between the inserted data frame and the adjacent data frame is guaranteed to be smooth, avoiding the situation of sudden change or discontinuity. The position information of the inserted data frame obtained by linear interpolation calculation is derived based on the key point position information of the adjacent data frame, which can keep the consistency and rationality of the data in the middle of the time series. As above, the core features of the action sequence data are usually concentrated in the execution process of the action, i.e. the middle of the time series. Therefore, it can be ensured by the present embodiment that the action classification model can fully identify the core features, thereby improving the classification accuracy of the action classification model.

[0093] Figure 6 This is a sixth flow chart of an action classification method according to an embodiment of the present invention. The step of adding a data frame at the head of a time series, at the middle of a time series and / or at the end of a time series comprises:

[0094] S602: When the number of data frames of the target action sequence data is lower than the lower limit of the target data frame number range, inserting blank data frames or linear interpolation in the time series of the target action sequence data to add data frames at the head and / or the tail of the time series;

[0095] S207: Obtain a second action sequence data set.

[0096] In this embodiment, the method of inserting a blank data frame can be to insert a data frame with key point position information of 0, which means there is no actual action information. The linear interpolation method is as above.

[0097] In this embodiment, by adopting the mode of inserting blank data frame or the mode of linear interpolation, the data frame at the head of time series and / or the tail of time series is increased. The starting and ending parts of action sequence data usually include the preparation and ending action of action, and these parts have less influence on action classification relative to the core part of action. Therefore, in this embodiment, by adopting the mode of inserting blank data frame or the mode of linear interpolation, the data frame at the head of time series and / or the tail of time series is increased to avoid affecting the core features of action sequence data, thereby improving the classification accuracy of action classification model.

[0098] Figure 7 This is a flowchart of the action classification method according to one embodiment of the present invention. The first action sequence data set also includes noise action sequence data. Before the step of identifying the target action sequence data included in the first action sequence data set, the method further includes:

[0099] S702: Based on a preset judgment rule, identify and delete the noise action sequence data in the first action sequence data set.

[0100] In this embodiment, the preset judgment rule can be the number of data frames of the action sequence data. For example, the number of action sequences with a data frame number lower than 50 frames (or other numerical frames) can be identified as noise action sequence data. Consider the following scenario example. In an underground production environment, a camera continuously obtains video data of several underground workers in the current area performing production. It can be understood that the action sequence data is obtained by extracting data video. In many cases, some irrelevant staff members may be photographed in the current area. For example, there will be people passing through the area, and the time of occurrence will be relatively short, which may only last for 2-3 seconds. It is even impossible to capture the complete body posture of these people, and only partial body posture can be captured, so the complete action sequence data cannot be extracted. Therefore, these action sequence data can be identified.

[0101] In some implementations, whether the action sequence data lacks key point information and the amount of the missing key point information may be used as a judgment rule.

[0102] Therefore, for this situation, this implementation identifies and deletes the noisy action sequence data in the first action sequence data set based on a preset judgment rule. By identifying and deleting the noisy action sequence data, the quality of the data set can be improved, and the interference of irrelevant or incomplete data on the action classification model can be reduced, thereby improving the accuracy and stability of the model. Secondly, identifying and deleting the noisy action sequence data in the first action sequence data set can reduce the computational overhead and improve the classification efficiency of the action classification model.

[0103] Figure 8 This is a flowchart of an action classification method according to an embodiment of the present invention. Before the step of receiving the first action sequence data set, the method further includes:

[0104] S802: Receive video data for representing human motion behavior;

[0105] S804: Inputting the video data into a preset human posture recognition model to identify key points, and obtaining key point data of at least one human body in the video data in a time series; wherein the key point data is used to characterize key point type information and key point position information of the human body;

[0106] S806: Inputting key point data of at least one human body into a preset target tracking model for identification in a time sequence to obtain a first action sequence data set.

[0107] In this embodiment, the video data used to characterize human motion behavior can be video data of several underground workers performing production in an underground production environment. The key point type can be key points such as the head, shoulders, hands, knees, etc. of the human body. The action type can be classified as needed, and a video containing only the action can be intercepted from the video data, and the data of the personnel target frame and key points can be annotated. The selected video data should contain only personnel with specified actions as much as possible, and no personnel with other actions. The human posture recognition model can be a human posture recognition model based on a top-down type, for example, it can be a pre-trained YOLOv8-pose posture model, YOLOv8-pose "You Only LookOnce Version8Pose" is an existing posture estimation technology based on deep learning, which is a version of the YOLO series model specially designed for posture estimation (Pose Estimation).

[0108] In this embodiment, the target tracking model may be a SORT (Simple Online and Realtime Tracking) multi-target tracking model. The target tracking model is used to track the key point data output by the human posture recognition model in a time series.

[0109] In a specific implementation scheme, the SORT multi-target tracking model tracks each target frame in each frame of image data output by the YOLOv8-pose model, and the target frame is used to characterize the key point data to obtain the track id of all people in each frame. The same track id indicates the same person. Under the condition of continuous frames, the first and last appearances of the track id are used to measure the start and end of the action. If the track id does not appear in a certain frame but appears in the next frame, the previous frame of the frame is the end of the previous action, and the next frame indicates the starting point of the new action. The key point data corresponding to each track id are connected in series to obtain action sequence data. Therefore, the data form of each action sequence data can be key point information and the corresponding number of frames, and the number of frames indicates the number of consecutive appearances of the same track id. Since the number of appearances of different trackids is not equal, the number of frames can be uniformly set to a specified number of frames N. For action sequence data with a track id appearance less than N, all-0 key point coordinates can be added to align the data; for action sequence data with a track id appearance greater than N, N data frames can be selected at equal intervals. At the same time, another threshold min_frame is set. When the number of times the track id appears is less than min_frame, the action sequence data corresponding to the track id will be discarded. Therefore, as mentioned above, in some video data, there will be actions that are inconsistent with the preset action categories, so it is necessary to remove these inappropriate action sequence data. The horizontal and vertical coordinates of the key point can be normalized data, the normalized horizontal coordinate is the horizontal coordinate divided by the image width, and the normalized vertical coordinate is the vertical coordinate divided by the image height. The final form of the action sequence data can be N, N is the normalized horizontal and vertical coordinates of the key point, where N>min_frame. Therefore, this embodiment uses a target tracking model to divide the starting point and end point of the action, which is convenient for capturing the most important features of the action.

[0110] The SORT multi-target tracking model can track multiple human targets in a video based on the key point data between different frames, that is, associate the same human target between different frames, thereby achieving continuous tracking of the target. Through the SORT multi-target tracking model, the key point data extracted from different frames can be associated with the target, that is, it can be determined that the key point data in different frames corresponds to the same human target, thereby achieving unique identification and tracking of the target.

[0111] In the present embodiment, the preset human posture recognition model and the preset target tracking model are also pre-trained. Specifically, for the human posture recognition model, a pre-constructed training set or a public data set can be directly used, such as general object detection, segmentation and semantic segmentation data sets (i.e. COCO data sets, Common Objects inContext data sets), human posture estimation data sets (i.e. MPII data sets, i.e. Max Planck Institute for Informatics data sets), etc. are trained to the YOLOv8-pose model. After the test set test is passed, the preset human posture recognition model can be obtained. For the target tracking model, a public data set can be directly used, such as, the multi-target tracking data sets such as multi-target tracking 2017 data sets (i.e. MOT17 data sets, Multiple Object Tracking 17 data sets) are trained to the SORT multi-target tracking model, and after the test set test is passed, the preset target tracking model that can be obtained.

[0112] In some embodiments, the human posture recognition model may also be an OpenPose model, which can simultaneously detect multiple key points of the human body, including body, hand and face key points. In some embodiments, the target tracking model may also be a MOT17 target tracking model or a Tracktor target tracking model (Tracking Objects as Pixel-Wise Distributions).

[0113] In this embodiment, firstly, video data for characterizing human motion behavior is received. Then, the video data is input into a preset human posture recognition model to identify key points, and key point data of at least one human body in the video data under a time series is obtained. Finally, according to the time series, the key point data of at least one human body is input into a preset target tracking model for identification, and a first motion sequence data set is obtained. The method can directly obtain the corresponding first motion sequence data set through video data, and the acquisition method is simple. And the motion sequence data is obtained through the target tracking model, which ensures the continuity of the action, grasps the main features of the action, and improves the accuracy of subsequent action classification.

[0114] Fig. 9The schematic diagram of the structure of the action classification device according to one embodiment of the present invention is shown. The action classification device 100 includes: a receiving module 101: which is used to receive a first action sequence data set. An identification module 102, which is used to identify the target action sequence data included in the first action sequence data set, wherein the number of data frames of the target action sequence data is outside the target data frame number range. A processing module 103, which is used to perform processing on at least one target action sequence data in the first action sequence data set when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set. An action classification module 104, which is used to input the second action sequence data set into a preset action classification model for action classification, and obtain an action classification result.

[0115] This embodiment first receives a first action sequence data set. Then, the target action sequence data included in the first action sequence data set is identified. Then, when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, at least one target action sequence data in the first action sequence data set is processed so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set. In this implementation, by processing the target action sequence data, each action sequence data is aligned in terms of the number of data frames, and finally the second action sequence data set is input into a preset action classification model for action classification, thereby obtaining an action classification result. It is understandable that inconsistent data frame numbers of action sequence data will lead to inconsistent time information of different action sequence data. In the action classification task, time information is very important for distinguishing different actions. If the number of data frames is inconsistent, the model may not be able to accurately capture the time characteristics of the action, thereby affecting the classification accuracy. Moreover, inconsistent data frame numbers will lead to data alignment difficulties, making it difficult for the model to compare the similarities and differences between different action sequences, thereby affecting the accuracy of action classification. Therefore, through this embodiment, the action classification model can process action sequence data more stably, thereby improving the accuracy of the action classification model when performing action classification.

[0116] The action classification device 100 in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0117] The motion classification device 100 in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0118] The action classification device 100 provided in the embodiment of the present application can realize Figures 1 to 8 To avoid repetition, the various processes implemented in the action classification method embodiment are not described here.

[0119] like Fig.10 As shown, an embodiment of the present application also provides an electronic device 200, including a memory 201 and a processor 202, and a program or instruction stored in the memory 201 and executable on the processor 202. When the program or instruction is executed by the processor 202, each process of the embodiment of the above-mentioned action classification method is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0120] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0121] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned action classification method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0122] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0123] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned action classification method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0124] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0125] In the present invention, the term "plurality" means at least two or more than two, unless otherwise clearly defined. The terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; "connected" can be a direct connection or an indirect connection through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0126] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0127] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An action classification method, characterized in that: The method comprises: receiving a first action sequence data set; Identifying target action sequence data included in the first action sequence data set, wherein the number of data frames of the target action sequence data is outside a target data frame number range; When the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, processing is performed on at least one target action sequence data in the first action sequence data set, so that the number of data frames of the processed target action sequence data is within a target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set; The second action sequence data set is input into a preset action classification model to perform action classification to obtain an action classification result.

2. The action classification method according to claim 1, characterized in that: The step of processing at least one target action sequence data in the first action sequence data set so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets a preset threshold includes: Detecting the number of data frames of the target action sequence data; When the number of data frames of the target action sequence data is higher than the upper limit of the target data frame number range, reducing at least one data frame of the target action sequence data so that the number of data frames of the target action sequence data after the reduced data frame is within the target data frame number range; When the number of data frames of the target action sequence data is lower than the lower limit of the target data frame number range, at least one data frame of the target action sequence data is added so that the number of data frames of the target action sequence data after the added data frame can be within the target data frame number range.

3. The action classification method according to claim 2, characterized in that: The step of reducing at least one data frame of the target action sequence data comprises: For the target action sequence data, in the time series, the data frames at the head of the time series, in the middle of the time series and / or at the end of the time series are reduced, wherein the number of data frames reduced at the head of the time series and / or at the end of the time series is greater than the number of data frames reduced in the middle of the time series.

4. The action classification method according to claim 2, characterized in that: The step of adding at least one data frame of the target action sequence data comprises: For the target action sequence data, in the time series, data frames are added at the head of the time series, in the middle of the time series and / or at the end of the time series, wherein the number of data frames added at the head of the time series and / or at the end of the time series is greater than the number of data frames added in the middle of the time series.

5. The action classification method according to claim 4, characterized in that: The step of adding a data frame at the head of the time series, at the middle of the time series and / or at the end of the time series comprises: Use linear interpolation to increase the number of data frames in the middle of the time series.

6. The action classification method according to claim 4, characterized in that: The step of adding a data frame at the head of the time series, at the middle of the time series and / or at the end of the time series comprises: The data frames at the head and / or the tail of the time series are added by inserting blank data frames or performing linear interpolation.

7. The action classification method according to claim 1, characterized in that: The first action sequence data set also includes noise action sequence data. Before the step of identifying the target action sequence data included in the first action sequence data set, the action classification method further includes: Based on a preset judgment rule, the noise action sequence data in the first action sequence data set is identified and deleted.

8. The action classification method according to claim 1, characterized in that: Before the step of receiving the first action sequence data set, the action classification method further includes: Receiving video data for representing human motion behavior; Input the video data into a preset human posture recognition model to identify key points, and obtain key point data of at least one human body in the video data in a time series, wherein the key point data is used to characterize type information and position information of key points of the human body; According to the time sequence, the key point data of the at least one human body is input into a preset target tracking model for identification to obtain the first action sequence data set.

9. An action classification device, characterized in that: include: A receiving module, configured to receive a first action sequence data set; an identification module, which is used to identify target action sequence data included in the first action sequence data set, wherein the number of data frames of the target action sequence data is outside the target data frame number range; a processing module, which is used to perform processing on at least one target action sequence data in the first action sequence data set when the number of target action sequence data included in the first action sequence data set exceeds a preset threshold, so that the number of data frames of the processed target action sequence data is within the target data frame number range, and the number of target action sequence data included in the first action sequence data set meets the preset threshold, thereby obtaining a second action sequence data set; The action classification module is used to input the second action sequence data set into a preset action classification model to perform action classification and obtain an action classification result.

10. An electronic device, characterized in that: It comprises a memory and a processor, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the action classification method as claimed in any one of claims 1 to 8.

11. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by a processor, the steps of the action classification method according to any one of claims 1 to 8 are implemented.