Motion positioning method, device, electronic device and storage medium
Through the weakly supervised learning method of video-level action labels, the action localization model selects relevant frames in the video and performs action classification, which solves the problem of action localization methods in the existing technology requiring a large number of frame-level labels, and improves the reliability and accuracy of action localization. accuracy.
Patent Information
- Application Number
- CN202110102542.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-26
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-01-26
AI Technical Summary
Existing action localization methods require a large number of frame-level labels during supervised learning, which is time-consuming, labor-intensive, and has poor reliability, and the accuracy of frame-level labeling is poor.
A weakly supervised learning method based on video-level action labels is used to select relevant frames from the video and classify actions through the action positioning model to achieve frame-level action positioning, which reduces the workload of manual annotation and improves the reliability and accuracy of positioning. .
There is no need to pre-label frame-level action labels, which greatly reduces the workload of manual annotation, reduces the difficulty of obtaining training samples, and improves the usability and accuracy of action positioning.
Smart Images

Figure CN112883817B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an action positioning method, device, electronic equipment and storage medium. Background Art
[0002] Action localization in videos is one of the key issues in video understanding and has important applications in human-computer interaction, human action understanding and other fields.
[0003] Currently, action localization is mostly implemented based on deep learning models. However, during the training process, deep learning models need to manually annotate the action labels of each image frame in the sample video. Frame-level labeling consumes a lot of manpower and time costs, is extremely difficult to obtain, and the action shown in a single frame image is often unclear, resulting in poor accuracy of the annotated frame-level labels. Summary of the invention
[0004] The present invention provides an action positioning method, device, electronic device and storage medium, which are used to solve the problem that the existing action positioning method requires a large number of frame-level labels during supervised learning, is time-consuming and labor-intensive, and has poor reliability.
[0005] The present invention provides an action positioning method, comprising:
[0006] Determine the video to be located;
[0007] Based on the action localization model, relevant frames of each action type are selected from the video and action classification is performed on each image frame in the video, and frame-level action localization results of the video are determined based on the relevant frames of each action type and the action classification results of each image frame;
[0008] The action localization model is trained based on sample videos and their video-level action labels.
[0009] According to an action localization method provided by the present invention, based on the action localization model, relevant frames of each action type are selected from the video and action classification is performed on each image frame in the video, and based on the relevant frames of each action type and the action classification results of each image frame, a frame-level action localization result of the video is determined, including:
[0010] Based on the relevant frame selection layer of the action localization model, the first action feature of each image frame is applied to select relevant frames of each action type from the video;
[0011] Based on the action classification layer of the action localization model, performing action classification on the second action features of each image frame to obtain an action classification result of each image frame;
[0012] Based on the action localization layer of the action localization model, the frame-level action localization result of the video is determined by applying the relevant frames of each action type and the action classification results of each image frame.
[0013] According to an action localization method provided by the present invention, the relevant frame selection layer based on the action localization model applies the first action feature of each image frame to select relevant frames of each action type from the video, and also includes:
[0014] Based on the motion feature extraction layer of the motion localization model, motion features of each image frame are extracted respectively, and the motion features are used as the first motion features and the second motion features.
[0015] According to an action localization method provided by the present invention, the action localization model is trained based on the following steps:
[0016] Determining a frame-level action location prediction result of the sample video based on the initial model to be trained;
[0017] Determining a video-level predicted action type of the sample video based on a frame-level action location prediction result of the sample video;
[0018] Based on the video-level predicted action type and the video-level action label, the model parameters of the initial model are adjusted to obtain the action localization model.
[0019] According to an action localization method provided by the present invention, the step of determining the video-level predicted action type of the sample video based on the frame-level action localization prediction result of the sample video includes:
[0020] The mean of the frame-level action location prediction results of the sample video is determined as the video-level predicted action type.
[0021] According to an action localization method provided by the present invention, the model parameters of the initial model are adjusted based on the video-level predicted action type and the video-level action label to obtain the action localization model, including:
[0022] Determining a video-level loss value of a cross entropy loss function based on the video-level predicted action type and the video-level action label;
[0023] The model parameters of the initial model are adjusted based on the video level loss value to obtain the action localization model.
[0024] According to an action localization method provided by the present invention, the video-level action label is a single action type, or a combined action type consisting of multiple continuous actions.
[0025] The present invention provides an action positioning device, comprising:
[0026] A video determination unit, used to determine the video to be located;
[0027] An action localization unit, configured to select relevant frames of each action type from the video and perform action classification on each image frame in the video based on an action localization model, and determine a frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame;
[0028] The action localization model is trained based on sample videos and their video-level action labels.
[0029] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned motion positioning methods when executing the computer program.
[0030] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the above-mentioned motion positioning methods.
[0031] The action localization method, device, electronic device and storage medium provided by the present invention use video-level action labels to implement weakly supervised training of the action localization model, without pre-labeling frame-level action labels, greatly reducing the workload of manual labeling, reducing the difficulty of obtaining training samples, and helping to improve the availability of action localization. On this basis, the action localization model realizes action localization by selecting relevant frames of each action type and performing action classification on each image frame, and performs analysis and prediction from two frame-level directions, which helps to further improve the reliability and accuracy of action localization under weak supervision. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 It is a flow chart of the action positioning method provided by the present invention;
[0034] Figure 2 is a flowchart of an implementation of step 120 in the action positioning method provided by the present invention;
[0035] Figure 3It is a flow chart of the training method of the action positioning model provided by the present invention;
[0036] Figure 4 It is a structural schematic diagram of the action positioning device provided by the present invention;
[0037] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] Temporal range detection of human actions in videos is a challenging computer vision problem that requires supervision of frame-level action labels. The complex annotation process limits the application and promotion of action localization methods. Although some technicians currently use movie scripts to obtain action labels and approximate time boundaries of uncut videos for supervision, which can reduce the difficulty of obtaining frame-level action labels, the accuracy and reliability of frame-level action labels obtained by the above methods cannot be guaranteed.
[0040] To address this problem, an embodiment of the present invention provides a weakly supervised action localization method. Figure 1 It is a flow chart of the action positioning method provided by the present invention, such as Figure 1 As shown, the method includes:
[0041] Step 110: determine the video to be located.
[0042] Step 120, based on the action localization model, select relevant frames of each action type from the video and perform action classification on each image frame in the video, and determine the frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame; wherein the action localization model is trained based on the sample video and its video-level action label.
[0043] Here, the video to be located is the video needed for action location, and the video can be embodied as a sequence of multiple image frames. The action location model is used to locate the action of each image frame in the input video, so as to obtain and output the frame-level action location result, that is, the frame-level action location result. The frame-level action location result here is relative to each image frame in the video. The frame-level action location result can not only characterize the action type contained in the video, but also characterize which specific frames in the video contain the action type. Optionally, the frame-level action location result can also characterize the probability or score of each image frame in the video corresponding to various action types.
[0044] Specifically, during the execution of step 120, the action localization model can select relevant frames of each action type for the input video to be located, that is, for each action type, select image frames associated with the corresponding action type from each image frame of the video as associated frames of the corresponding action type, which reflects the mapping relationship from action type to image frame. In addition, the action localization model also performs action classification on each image frame in the input video to determine the action type represented by each image frame, which reflects the mapping relationship from image frame to action type. On this basis, the action localization model can merge the results of the two frame-level directional analysis predictions to obtain and output the frame-level action localization result, that is, the frame-level action localization result.
[0045] Different from the current action localization model obtained by strong supervised learning, the action localization model in the embodiment of the present invention is obtained by weak supervised learning, that is, the training process of the action localization model in the embodiment of the present invention does not require frame-level action labels, and only video-level action labels are used to complete the model training. The application of video-level action labels greatly reduces the workload of manual labeling compared to frame-level action labels.
[0046] Before executing step 120, the action localization model can be pre-trained. The training of the action localization model can be achieved through the following steps: First, a large number of sample videos are collected, and video-level action labels of the sample videos are obtained through manual annotation or video action classification. On this basis, the sample videos are input into the initial model to be trained, and the initial model selects relevant frames of each action type from the sample video and performs action classification on each image frame in the sample video to obtain the frame-level action localization result of the sample video predicted by the initial model, and thereby determines the video-level predicted action type, and adjusts the parameters of the initial model based on the difference between the video-level predicted action type and the pre-annotated video-level action label until the initial model training is completed, and the trained initial model is used as the action localization model.
[0047] During the training process of the action localization model, considering that the labels of the training samples are at the video level rather than the frame level, after the initial model outputs the predicted frame-level action localization results, it is necessary to fused the frame-level action localization results of each image frame in the sample video into a video-level predicted action type. The specific method may be to calculate the average, the maximum value, the weighted sum, etc., which is not specifically limited in the embodiments of the present invention.
[0048] The method provided by the embodiment of the present invention uses video-level action labels to implement weakly supervised training of the action localization model, without pre-labeling frame-level action labels, greatly reducing the workload of manual labeling, reducing the difficulty of obtaining training samples, and helping to improve the availability of action localization. On this basis, the action localization model implements action localization by selecting relevant frames of each action type and performing action classification on each image frame, and performs analysis and prediction from two frame-level directions, which helps to further improve the reliability and accuracy of action localization under weak supervision.
[0049] After obtaining the action localization result of the video, that is, determining which image frames in the video contain specific action types, user-specified operations can be performed based on the located image frames, such as explaining and commenting on image frames containing specific action types, or performing cutouts, scene classification, and face swapping on image frames containing specific action types, so as to improve the user's video experience.
[0050] Based on the above embodiments, Figure 2 is a flow chart of an implementation of step 120 in the action positioning method provided by the present invention, such as Figure 2 As shown, step 120 includes:
[0051] Step 121, based on the relevant frame selection layer of the action localization model, the first action feature of each image frame is applied to select relevant frames of each action type from the video;
[0052] Step 122 , based on the action classification layer of the action localization model, action classification is performed on the second action feature of each image frame to obtain an action classification result for each image frame.
[0053] Specifically, in the action localization model, relevant frame selection and action classification can be performed separately by two modules, corresponding to the relevant frame selection layer and the action classification layer in the action localization model.
[0054] Here, the first action feature and the second action feature of each image frame in the video are used to represent the action-related features contained in the corresponding image frame. For example, in a team game video, the action features of the image frame can characterize the relative position and angle of the athlete's torso and feet, the distance, direction and angle of the athlete from the ball, the position of the ball and the goal, the direction and angle between the ball and the goal, etc. The first action feature and the second action feature are both action features. "First" and "second" are only used to distinguish between the applications in the selection of related frames and action classification. The first action feature and the second action feature of the same image frame can be the same or have different emphases. The embodiment of the present invention does not specifically limit this.
[0055] Among them, the relevant frame selection layer can start from the perspective of the entire video, and for any action type, select image frames related to the action type from the video as the relevant frames of the action type. In the selection process of relevant frames, the relevant frame selection layer not only considers the first action features of each image frame in the independent video, but also considers the temporal and spatial correlation of the first action features in each image frame displayed by the video as a whole, and relies on the correlation between image frames to weigh the image frames in the video that can reflect the action type. Here, the relevant frames of each action type can be reflected as the probability of each image frame being related to each action type. For any image frame, its probability of being related to each action type can represent the probability that the image frame belongs to each action type.
[0056] The action classification layer can start from the perspective of a single image frame in the video, and for a single image frame, based on the second action feature of the image frame, analyze the action type that the image frame may represent, thereby outputting the action classification result of the image frame. Here, the action classification result of the image frame can be the probability score of the image frame for each action type, indicating the probability of each action type appearing in the image frame.
[0057] It should be noted that the embodiment of the present invention does not specifically limit the execution order of step 121 and step 122. Step 121 may be executed before or after step 122, or may be executed synchronously with step 122.
[0058] Step 123 , based on the action localization layer of the action localization model, the action classification results of the relevant frames of each action type and each image frame are applied to determine the frame-level action localization result of the video.
[0059] Specifically, the action localization layer is used to fuse the relevant frames of each action type and the action classification results of each image frame, so that the final frame-level action localization result takes into account both the action characteristics of a single image frame and the overall video information, thereby ensuring the reliability and accuracy of action localization.
[0060] Based on any of the above embodiments, before step 121 and step 122, the following steps may be further included:
[0061] Based on the motion feature extraction layer of the motion localization model, the motion features of each image frame are extracted respectively, and the motion features are used as the first motion features and the second motion features.
[0062] Specifically, the action localization model also includes an action feature extraction layer, and the related frame selection layer and the action classification layer share one action feature extraction layer. Here, the first action feature and the second action feature of the same image frame are the same. Correspondingly, in the training process of the action localization model, the action feature extraction layer, the related frame selection layer, the action classification layer and the action localization layer can be trained end-to-end as a whole model. By sharing the action feature extraction layer, information sharing between related frame selection and action classification can be achieved, thereby improving the accuracy of action localization.
[0063] Based on any of the above embodiments, it is assumed that the video to be located is V, and the video V includes T image frames, that is, V= <I1,I2,…,I t ,…,I T >, where I t Specifically, it is the t-th image frame in the video V, I is the image frame representation, specifically a 3×H×W vector representation, where 3 is the number of channels of the image frame, and H and W are the height and width of the image frame respectively.
[0064] The action feature extraction layer can be expressed as Where f represents the action feature extraction function, θ is the parameter learned by function f. Ω is the action feature corresponding to the image frame. Represents an M-dimensional vector, where M is the vector dimension of the action feature.
[0065] The action classification layer can be expressed as σ(h(f(I t ,θ),θ cls ), where h represents the action classification function, θ cls is the parameter learned by function h. h can be specifically expressed as h(·, θ cls ):Ω→Y, that is, the action feature f(I t , θ) is input into the function h, and returns a C-dimensional action classification score vector, where the action classification score vector is the C action categories in the image frame I t After obtaining the action classification score vector, the action classification score vector is normalized by function σ, where function σ is the softmax normalization function.
[0066] The relevant frame selection layer can be expressed as g(I t , V, θ g), where g represents the relevant frame selection function, θ g That is, the parameters learned by function g. Function g consists of two parts, one of which is responsible for extracting the action features of each image frame from the frame sequence of the video. This part is the action feature extraction layer f shared with the action classification layer. The other part is used to select relevant frames from the perspective of the entire video based on the action features of each image frame. This part can be represented by a dedicated classifier, which can be h(·, θ det ), that is, this part is similar to the classification network h(·,θ in the action classification layer in terms of network structure. cls ) are the same, but the specific application parameters of the two are different. Here, θ det The same can be obtained by learning the function g. Thus, we get g(I t , V, θ g )=h(f(I t ,θ),θ det ), the score vector of the relevant frames of each action type can be expressed as X t , X t The score of the qth action type in can be expressed as
[0067] The action localization layer can be expressed as g(I t , V, θ g )⊙σ(h(f(I t ,θ),θ cls )), where ⊙ is the inner product of the elements, through g(I t , V, θ g )⊙σ(h(f(I t ,θ),θ cls )) can realize the fusion of the relevant frames of each action type and the action classification results of each image frame, so as to obtain the frame-level action localization results corresponding to each image frame.
[0068] Based on any of the above embodiments, Figure 3 It is a flow chart of the training method of the action positioning model provided by the present invention, such as Figure 3 As shown, the training method includes:
[0069] Step 310: Determine the frame-level action location prediction result of the sample video based on the initial model to be trained.
[0070] Specifically, after completing the collection of sample videos and the annotation of their video-level action labels, the sample videos can be input into the initial model to be trained, and the initial model predicts the action localization results based on the sample videos, thereby obtaining the frame-level action localization prediction results of the sample videos output by the initial model, where the frame-level action localization prediction results correspond to the action localization prediction results of each image frame in the sample video. Furthermore, when the initial model performs action localization on the sample video, it can perform analysis and prediction from two frame-level directions: selecting relevant frames of each action type and action classification of each image frame in the sample video, and then fuse the results of the analysis and prediction in the two frame-level directions into the frame-level action localization prediction results.
[0071] Step 320: Determine the video-level predicted action type of the sample video based on the frame-level action location prediction result of the sample video.
[0072] Step 330: Based on the video-level predicted action type and the video-level action label, adjust the model parameters of the initial model to obtain an action localization model.
[0073] Specifically, considering that the labels of the training samples are at the video level rather than the frame level, it is necessary to fuse the frame-level action localization results output by the initial model to obtain the video-level prediction results, that is, the video-level predicted action types. Then, based on the difference between the video-level predicted action types and the pre-labeled video-level action labels, the parameters of the initial model can be adjusted, so that the initial model can update and iterate the parameters at the video level, and the trained initial model can be used as the action localization model.
[0074] The method provided by the embodiment of the present invention realizes weakly supervised training of the frame-level action localization model at the video level, greatly reduces the workload of manual labeling, reduces the difficulty of obtaining training samples, and helps to improve the availability of action localization.
[0075] Based on any of the above embodiments, step 320 includes:
[0076] The mean of the frame-level action localization prediction results of the sample videos is determined as the video-level predicted action type.
[0077] Specifically, the frame-level action localization prediction result of the sample video includes the action localization prediction result of each image frame in the sample video. The average of the frame-level action localization prediction results of the sample video refers to averaging the action localization prediction results of each image frame in the sample video, which can be expressed as the following formula:
[0078]
[0079] In the formula, g(I t , V, θ g)⊙σ(h(f(I t ,θ),θ cls )) is image frame I t The action localization prediction results are: is the sum of the action localization prediction results of all image frames in the sample video. On this basis, multiply it by 1 / T to average the frame-level action localization prediction results of the sample video. That is, predicting action types at the video level.
[0080] Based on any of the above embodiments, step 330 includes:
[0081] Based on the video-level predicted action type and the video-level action label, the video-level loss value of the cross entropy loss function is determined; based on the video-level loss value, the model parameters of the initial model are adjusted to obtain the action localization model.
[0082] Specifically, the loss function of the action localization model training is cross-entropy (CE), which can be expressed as L(y, ), where L is the cross entropy, y and They are video-level action labels and video-level predicted action types, respectively. Further, considering that both video-level action labels and video-level predicted action types are used to reflect the action types represented by the sample video, for the pre-set multiple candidate action types, both video-level action labels and video-level predicted action types can be represented in the form of binary vectors. For each action type, 1 indicates that the sample video represents the action type, and 0 indicates that the sample video does not represent the action type, for example, y∈Y={0,1} C , C is the number of candidate action types. Accordingly, the loss function of the action localization model training can be specifically a binary cross entropy.
[0083] Based on any of the above embodiments, the video-level action label is a single action type, or a combined action type consisting of multiple continuous actions.
[0084] For example, in a team game video, a single action type can be used as a video-level action label, where the single action type can be forward, backward, turn around, jump, etc., or a combination of multiple continuous actions can be used as a video-level action label, where the combination action type can be a goal, free throw, three-pointer, layup, etc., where the combination action type goal can be further divided into three single action types: forward-jump-shoot. The specific type of video-level action label used when annotating sample videos depends on the sample videos actually annotated.
[0085] For the case where the video-level action label is a combined action type, in the prediction stage of the action localization model, when the action localization model selects relevant frames of each action type from the video, it not only selects from the level of the combined action type, but also further divides the relevant frames of each sub-action type under the combined action type.
[0086] Based on any of the above embodiments, Figure 4 Schematic diagram of the structure of the motion positioning device provided by the present invention. Figure 4 As shown, the device comprises:
[0087] A video determination unit 410, configured to determine a video to be located;
[0088] An action localization unit 420 is used to select relevant frames of each action type from the video and perform action classification on each image frame in the video based on the action localization model, and determine a frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame;
[0089] The action localization model is trained based on sample videos and their video-level action labels.
[0090] The device provided by the embodiment of the present invention uses video-level action labels to implement weakly supervised training of the action localization model, without pre-labeling frame-level action labels, greatly reducing the workload of manual labeling, reducing the difficulty of obtaining training samples, and helping to improve the availability of action localization. On this basis, the action localization model implements action localization by selecting relevant frames of each action type and performing action classification on each image frame, and performs analysis and prediction from two frame-level directions, which helps to further improve the reliability and accuracy of action localization under weak supervision.
[0091] Based on any of the above embodiments, the action positioning unit 420 includes:
[0092] A related frame selection subunit, configured to select related frames of each action type from the video by applying the first action feature of each image frame based on the related frame selection layer of the action localization model;
[0093] An action classification subunit, configured to perform action classification on the second action features of each image frame based on the action classification layer of the action localization model to obtain an action classification result for each image frame;
[0094] The action localization subunit is used to determine the frame-level action localization result of the video based on the action localization layer of the action localization model and applying the relevant frames of each action type and the action classification results of each image frame.
[0095] Based on any of the above embodiments, the action positioning unit 420 further includes:
[0096] The motion feature extraction subunit is used to extract the motion features of each image frame based on the motion feature extraction layer of the motion localization model, and use the motion features as the first motion feature and the second motion feature.
[0097] Based on any of the above embodiments, the device includes:
[0098] A training prediction unit, used to determine a frame-level action positioning prediction result of the sample video based on an initial model to be trained;
[0099] A prediction integration unit, configured to determine a video-level predicted action type of the sample video based on a frame-level action location prediction result of the sample video;
[0100] A parameter updating unit is used to adjust the model parameters of the initial model based on the video-level predicted action type and the video-level action label to obtain the action localization model.
[0101] Based on any of the above embodiments, the prediction integration unit is used for:
[0102] The mean of the frame-level action location prediction results of the sample video is determined as the video-level predicted action type.
[0103] Based on any of the above embodiments, the parameter updating unit is used for:
[0104] Determining a video-level loss value of a cross entropy loss function based on the video-level predicted action type and the video-level action label;
[0105] The model parameters of the initial model are adjusted based on the video level loss value to obtain the action localization model.
[0106] Based on any of the above embodiments, the video-level action label is a single action type, or a combined action type consisting of multiple continuous actions.
[0107] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the action localization method, which includes: determining a video to be located; based on an action localization model, selecting relevant frames of each action type from the video and performing action classification on each image frame in the video, and determining the frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame; wherein the action localization model is obtained by training based on a sample video and its video-level action label.
[0108] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0109] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the action localization method provided by the above-mentioned methods, and the method includes: determining a video to be located; based on an action localization model, selecting relevant frames of each action type from the video and performing action classification on each image frame in the video, and determining the frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame; wherein the action localization model is trained based on a sample video and its video-level action label.
[0110] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the above-mentioned action localization methods, the methods comprising: determining a video to be located; based on an action localization model, selecting relevant frames of each action type from the video and performing action classification on each image frame in the video, and determining a frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame; wherein the action localization model is trained based on a sample video and its video-level action label.
[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An action positioning method, characterized in that: include: Determine the video to be located; Based on the action localization model, relevant frames of each action type are selected from the video and action classification is performed on each image frame in the video, and frame-level action localization results of the video are determined based on the relevant frames of each action type and the action classification results of each image frame; The action localization model is trained based on sample videos and their video-level action labels; The selecting relevant frames of each action type from the video includes: for each action type, selecting image frames associated with the corresponding action type from each image frame of the video as associated frames of the corresponding action type; The frame-level action localization result is relative to each image frame in the video, and the frame-level action localization result represents the action type contained in the video and the image frame containing the action type in the video; The action localization model is trained based on the following steps: Determining a frame-level action location prediction result of the sample video based on the initial model to be trained; Determining a video-level predicted action type of the sample video based on a frame-level action location prediction result of the sample video; Based on the video-level predicted action type and the video-level action label, the model parameters of the initial model are adjusted to obtain the action localization model.
2. The motion positioning method according to claim 1, characterized in that: The method of selecting relevant frames of each action type from the video and performing action classification on each image frame in the video based on the action localization model, and determining the frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame, includes: Based on the relevant frame selection layer of the action localization model, the first action feature of each image frame is applied to select relevant frames of each action type from the video; Based on the action classification layer of the action localization model, performing action classification on the second action features of each image frame to obtain an action classification result of each image frame; Based on the action localization layer of the action localization model, the frame-level action localization result of the video is determined by applying the relevant frames of each action type and the action classification results of each image frame.
3. The motion positioning method according to claim 2, characterized in that: The relevant frame selection layer based on the action positioning model selects relevant frames of each action type from the video by applying the first action feature of each image frame, and also includes: Based on the motion feature extraction layer of the motion localization model, motion features of each image frame are extracted respectively, and the motion features are used as the first motion features and the second motion features.
4. The motion positioning method according to claim 3, characterized in that: The step of determining the video-level predicted action type of the sample video based on the frame-level action positioning prediction result of the sample video includes: The mean of the frame-level action location prediction results of the sample video is determined as the video-level predicted action type.
5. The motion positioning method according to claim 4, characterized in that: The adjusting the model parameters of the initial model based on the video-level predicted action type and the video-level action label to obtain the action localization model includes: Determining a video-level loss value of a cross entropy loss function based on the video-level predicted action type and the video-level action label; The model parameters of the initial model are adjusted based on the video level loss value to obtain the action localization model.
6. The motion positioning method according to any one of claims 1 to 5, characterized in that: The video-level action label is a single action type, or a combined action type consisting of multiple continuous actions.
7. An action positioning device, characterized in that: include: A video determination unit, used to determine the video to be located; An action localization unit, configured to select relevant frames of each action type from the video and perform action classification on each image frame in the video based on an action localization model, and determine a frame-level action localization result of the video based on the relevant frames of each action type and the action classification results of each image frame; The action localization model is trained based on sample videos and their video-level action labels; The selecting relevant frames of each action type from the video includes: for each action type, selecting image frames associated with the corresponding action type from each image frame of the video as associated frames of the corresponding action type; The frame-level action localization result is relative to each image frame in the video, and the frame-level action localization result represents the action type contained in the video and the image frame containing the action type in the video; The action localization model is trained based on the following steps: Determining a frame-level action location prediction result of the sample video based on the initial model to be trained; Determining a video-level predicted action type of the sample video based on a frame-level action location prediction result of the sample video; Based on the video-level predicted action type and the video-level action label, the model parameters of the initial model are adjusted to obtain the action localization model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the action positioning method according to any one of claims 1 to 6 are implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the action positioning method according to any one of claims 1 to 6 are implemented.
