Video parsing model training method, device, video parsing method and device
By combining the end-to-end algorithm of the video segmentation and classification network, the problem of limited video parsing effect in the existing technology is solved, the collaborative optimization of video segmentation and classification tasks is realized, and the video parsing effect is significantly improved.
Patent Information
- Application Number
- CN202111613519.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-12-27
AI Technical Summary
In the existing technology, video parsing tasks optimize video segmentation and classification as two independent tasks, resulting in limited video parsing effects.
A video parsing model is proposed that combines the video segmentation network and the video classification network to form an end-to-end video parsing algorithm. The parameters of the video segmentation network are adjusted through the back propagation of video classification, and the video segmentation and classification tasks are uniformly optimized.
The learning goal of video classification improves the accuracy of video segmentation and significantly optimizes the video parsing effect, making the video segmentation and classification tasks promote each other and improving the overall video parsing effect.
Smart Images

Figure CN114299430B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of video technology, and in particular to a training method and device for a video parsing model, and a video parsing method and device. Background Art
[0002] Video has gradually become an important carrier of information. Understanding the content of videos is conducive to video recommendations and the precise delivery of video advertisements. Therefore, using the correct method to analyze videos more finely and understand their content has become an increasingly important research direction.
[0003] The video parsing task is divided into two parts. One part is to segment the video into "scenes", which are a series of video clips composed of image frames with the same semantics; the other part is to classify the segmented "scenes". The conventional approach is to treat the two parts as two independent tasks. Accordingly, the approach to optimizing the video parsing effect is to optimize the two independent tasks separately, but the optimization effect is limited. Summary of the invention
[0004] The present disclosure provides a video parsing model training method, device, video parsing method and device to at least solve the problem of how to optimize the video parsing effect in the related art, and may not solve any of the above problems.
[0005] According to a first aspect of the present disclosure, a training method for a video parsing model is provided, wherein the video parsing model includes a video segmentation network and a video classification network, and the training method includes: obtaining image features of a video sample and label information corresponding to the video sample; wherein the video sample includes at least one standard video clip, each of the standard video clip includes image frames with the same semantics, and the label information includes a standard video clip type corresponding to each standard video clip in the video sample; according to the image features of the video sample, performing video clip segmentation processing using the video segmentation network to obtain at least one first video clip; according to the image features corresponding to each of the at least one first video clip, performing video clip classification processing using the video classification network to obtain an estimated video clip type corresponding to each of the first video clips; determining a value of a first loss function based on the estimated video clip type corresponding to each of the first video clips and the standard video clip type corresponding to the corresponding standard video clip; adjusting parameters of the video segmentation network and the video classification network based on the value of the first loss function, and continuing iterative training based on the adjusted parameters until a preset training end condition is met.
[0006] Optionally, the training method also includes: obtaining auxiliary modal features corresponding to each of the multiple image frames in the video sample; the auxiliary modal features include at least one of text features and audio features; wherein, based on the image features of the video sample, using the video segmentation network to perform video segmentation processing to obtain at least one first video segment, including: integrating the auxiliary modal features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; inputting the fused image features corresponding to each of the multiple image frames of the video sample into the video segmentation network to determine a first segmentation point image frame among the multiple image frames; segmenting the video sample according to the first segmentation point image frame to obtain the at least one first video segment.
[0007] Optionally, the training method further includes: integrating the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrating the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; integrating the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrating the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; fusing at least one of the fused text features and the fused audio features of each image frame with the fused image features of the corresponding image frame, to obtain a fused feature corresponding to each image frame; segmenting the fused features corresponding to the multiple image frames according to the first segmentation point image frame, to obtain the fused features corresponding to each of the at least one first video clip; wherein, performing video clip classification processing using the video classification network according to the image features corresponding to each of the at least one first video clip includes: inputting the fused features corresponding to each of the at least one first video clip into the video classification network.
[0008] Optionally, the video parsing model also includes a multimodal feature extraction network, wherein the at least one of the fused text features and the fused audio features and the fused image features are obtained by the following steps: inputting the text features and at least one of the audio features and the image features corresponding to each of a plurality of image frames into the multimodal feature extraction network to obtain the fused text features and at least one of the fused audio features and the fused image features corresponding to each of a plurality of image frames, wherein adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: adjusting the parameters of the multimodal feature extraction network, the video segmentation network and the video classification network according to the value of the first loss function.
[0009] Optionally, the video parsing model also includes a feature fusion network, wherein the fusing of at least one of the fused text features and the fused audio features of each image frame with the fused image features of the corresponding image frame to obtain the fused features corresponding to each image frame includes: inputting the fused text features and at least one of the fused audio features and the fused image features corresponding to each of the multiple image frames into the feature fusion network to obtain the fused features corresponding to each of the multiple image frames; wherein adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: adjusting the parameters of the video segmentation network, the feature fusion network and the video classification network according to the value of the first loss function.
[0010] Optionally, the label information also includes standard segmentation point information characterizing whether the image frame in the video sample is a standard segmentation point image frame, and the training method also includes: inputting the fusion features corresponding to each of the multiple image frames of the video sample into the video segmentation network, determining whether each of the multiple image frames is a second segmentation point image frame, and obtaining estimated segmentation point information of the multiple image frames; wherein the estimated segmentation point information is used to obtain at least one second video segment; determining the value of the second loss function of the video parsing model based on the estimated segmentation point information and the standard segmentation point information of the corresponding image frame; wherein, adjusting the parameters of the video segmentation network and the video classification network based on the value of the first loss function includes: adjusting the parameters of the video segmentation network and the video classification network based on the value of the first loss function and the value of the second loss function.
[0011] Optionally, the video parsing model also includes an image feature extraction network for extracting the image features; wherein, adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: adjusting the parameters of the image feature extraction network, the video segmentation network and the video classification network according to the value of the first loss function.
[0012] Optionally, when obtaining the text features, the video parsing model also includes an image feature extraction network for extracting image features and a text feature extraction network for extracting text features, wherein adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: adjusting the parameters of the image feature extraction network, the text feature extraction network, the video segmentation network and the video classification network according to the value of the first loss function.
[0013] According to a second aspect of the present disclosure, a video parsing method is provided, which includes: obtaining image features of a target video; performing video segmentation processing using a video segmentation network in a video parsing model based on the image features to obtain at least one first video segment; performing video segment classification processing using a video classification network in the video parsing model based on image features corresponding to each of the at least one first video segment to obtain an estimated video segment type corresponding to each of the first video segments; wherein the video parsing model is trained using the above-mentioned training method.
[0014] Optionally, the video parsing method also includes: obtaining auxiliary modal features corresponding to each of the multiple image frames of the target video; the auxiliary modal features include at least one of text features and audio features; wherein, based on the image features, using the video segmentation network in the video parsing model to perform video segmentation processing to obtain at least one first video segment, including: integrating the auxiliary modal features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; inputting the fused image features corresponding to each of the multiple image frames into the video segmentation network to determine a first segmentation point image frame among the multiple image frames; segmenting the target video according to the first segmentation point image frame to obtain the at least one first video segment.
[0015] Optionally, the video parsing method further includes: integrating the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrating the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; integrating the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrating the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; fusing at least one of the fused text features and the fused audio features of each image frame with the fused image features of the corresponding image frame, to obtain a fused feature corresponding to each image frame; segmenting the fused features corresponding to the multiple image frames according to the first segmentation point image frame, to obtain the fused features corresponding to each of the at least one first video clip; wherein, performing video clip classification processing using a video classification network in a video parsing model according to the image features corresponding to each of the at least one first video clip includes: inputting the fused features corresponding to each of the at least one first video clip into the video classification network.
[0016] Optionally, the video parsing method also includes: inputting the fusion features corresponding to each of the multiple image frames of the target video into the video segmentation network to determine a second segmentation point image frame among the multiple image frames; segmenting the target video according to the second segmentation point image frame to obtain at least one second video segment.
[0017] According to a third aspect of the present disclosure, a training device for a video parsing model is provided, wherein the video parsing model includes a video segmentation network and a video classification network, and the training device includes: an acquisition unit, configured to acquire image features of a video sample and label information corresponding to the video sample; wherein the video sample includes at least one standard video clip, each of the standard video clip includes image frames with the same semantics, and the label information includes a standard video clip type corresponding to each standard video clip in the video sample; a first estimation unit, configured to perform video clip segmentation processing using the video segmentation network according to the image features of the video sample to obtain at least one first video clip; a second estimation unit, configured to perform video clip classification processing using the video classification network according to the image features corresponding to each of the at least one first video clip to obtain an estimated video clip type corresponding to each first video clip; a calculation unit, configured to determine a value of a first loss function according to the estimated video clip type corresponding to each first video clip and the standard video clip type corresponding to the corresponding standard video clip; and a parameter adjustment unit, configured to adjust parameters of the video segmentation network and the video classification network according to the value of the first loss function, and continue iterative training according to the adjusted parameters until a preset training end condition is met.
[0018] Optionally, the acquisition unit is further configured to: acquire auxiliary modal features corresponding to each of the multiple image frames in the video sample; the auxiliary modal features include at least one of text features and audio features; the first estimation unit is further configured to: integrate the auxiliary modal features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; input the fused image features corresponding to each of the multiple image frames of the video sample into the video segmentation network to determine a first segmentation point image frame among the multiple image frames; segment the video sample according to the first segmentation point image frame to obtain the at least one first video segment.
[0019] Optionally, the first estimation unit is further configured to: integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrate the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrate the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; fuse at least one of the fused text features and the fused audio features of each image frame with the fused image features of the corresponding image frame, to obtain a fused feature corresponding to each image frame; segment the fused features corresponding to the multiple image frames according to the first segmentation point image frame, to obtain the fused features corresponding to each of the at least one first video clip; the second estimation unit is further configured to: input the fused features corresponding to each of the at least one first video clip into the video classification network.
[0020] Optionally, the video parsing model also includes a multimodal feature extraction network, and the first estimation unit is further configured to: input the text features and at least one of the audio features and the image features corresponding to each of the multiple image frames into the multimodal feature extraction network to obtain the fused text features and at least one of the fused audio features and the fused image features corresponding to each of the multiple image frames, and the parameter adjustment unit is further configured to: adjust the parameters of the multimodal feature extraction network, the video segmentation network and the video classification network according to the value of the first loss function.
[0021] Optionally, the video parsing model also includes a feature fusion network, and the first estimation unit is further configured to: input the fused text features and at least one of the fused audio features corresponding to each of the multiple image frames and the fused image features into the feature fusion network to obtain the fused features corresponding to each of the multiple image frames; the parameter adjustment unit is further configured to: adjust the parameters of the video segmentation network, the feature fusion network and the video classification network according to the value of the first loss function.
[0022] Optionally, the label information also includes standard segmentation point information characterizing whether the image frame in the video sample is a standard segmentation point image frame, and the first estimation unit is further configured to: input the fusion features corresponding to each of the multiple image frames of the video sample into the video segmentation network, determine whether each of the multiple image frames is a second segmentation point image frame, and obtain estimated segmentation point information of the multiple image frames; wherein the estimated segmentation point information is used to obtain at least one second video segment; the calculation unit is further configured to: determine the value of the second loss function of the video parsing model based on the estimated segmentation point information and the standard segmentation point information of the corresponding image frame; the parameter adjustment unit is further configured to: adjust the parameters of the video segmentation network and the video classification network according to the value of the first loss function and the value of the second loss function.
[0023] Optionally, the video parsing model also includes an image feature extraction network for extracting the image features, and the parameter adjustment unit is further configured to adjust the parameters of the image feature extraction network, the video segmentation network and the video classification network according to the value of the first loss function.
[0024] Optionally, when obtaining the text features, the video parsing model also includes an image feature extraction network for extracting image features and a text feature extraction network for extracting text features, and the parameter adjustment unit is further configured to adjust the parameters of the image feature extraction network, the text feature extraction network, the video segmentation network and the video classification network according to the value of the first loss function.
[0025] According to a fourth aspect of the present disclosure, a video parsing device is provided, comprising: an acquisition unit, configured to: acquire image features of a target video; a first estimation unit, configured to: perform video segmentation processing using a video segmentation network in a video parsing model according to the image features, to obtain at least one first video segment; a second estimation unit, configured to: perform video segment classification processing using a video classification network in the video parsing model according to image features corresponding to each of the at least one first video segment, to obtain an estimated video segment type corresponding to each of the first video segments; wherein the video parsing model is trained using the above-mentioned training method.
[0026] Optionally, the acquisition unit is further configured to: acquire auxiliary modal features corresponding to each of the multiple image frames of the target video; the auxiliary modal features include at least one of text features and audio features; the first estimation unit is further configured to: integrate the auxiliary modal features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; input the fused image features corresponding to each of the multiple image frames into the video segmentation network to determine a first segmentation point image frame among the multiple image frames; segment the target video according to the first segmentation point image frame to obtain the at least one first video segment.
[0027] Optionally, the first estimation unit is further configured to: integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrate the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrate the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; fuse at least one of the fused text features and the fused audio features of each image frame with the fused image features of the corresponding image frame, to obtain a fused feature corresponding to each image frame; segment the fused features corresponding to the multiple image frames according to the first segmentation point image frame, to obtain the fused features corresponding to each of the at least one first video clip; the second estimation unit is further configured to: input the fused features corresponding to each of the at least one first video clip into the video classification network.
[0028] Optionally, the first estimation unit is further configured to: input the fusion features corresponding to each of the multiple image frames of the target video into the video segmentation network, determine a second segmentation point image frame among the multiple image frames; segment the target video according to the second segmentation point image frame to obtain at least one second video segment.
[0029] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein the computer executable instructions, when executed by the at least one processor, cause the at least one processor to execute a video parsing model training method or a video parsing method according to the present disclosure.
[0030] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute a video parsing model training method or a video parsing method according to the present disclosure.
[0031] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by at least one processor, implement the video parsing model training method or video parsing method according to the present disclosure.
[0032] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0033] According to the training method, device, video parsing method and device of the video parsing model of the embodiments of the present disclosure, the video parsing model includes a video segmentation network and a video classification network, forming an end-to-end video parsing algorithm, unifying the video segmentation task and the video classification task, and making full use of the connection between the two tasks, so that the model can learn according to the correlation between the two tasks. Specifically, video classification is based on the results of video segmentation. If the segmentation is inaccurate, the classification will also be inaccurate, so that from the perspective of back propagation, a video classification learning goal can be added to the video segmentation task, which is equivalent to the video segmentation task having a segmentation learning goal and a learning goal for the accuracy of the results after segmentation for classification. Therefore, video classification can be used to further improve the effect of video segmentation, which helps to greatly optimize the video parsing effect.
[0034] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0036] Figure 1 is a flowchart illustrating a method for training a video parsing model according to an exemplary embodiment of the present disclosure.
[0037] Figure 2 is a schematic diagram showing a framework of a video segmentation network according to an exemplary embodiment of the present disclosure.
[0038] Figure 3 is a schematic diagram showing a framework of a video classification network according to an exemplary embodiment of the present disclosure.
[0039] Figure 4is a schematic diagram showing a framework of a video parsing model according to an exemplary embodiment of the present disclosure.
[0040] Figure 5 is a flowchart illustrating a method for training a video parsing model according to a specific embodiment of the present disclosure.
[0041] Figure 6 is a flowchart illustrating a video parsing method according to an exemplary embodiment of the present disclosure.
[0042] Figure 7 is a block diagram illustrating a training apparatus for a video parsing model according to an exemplary embodiment of the present disclosure.
[0043] Figure 8 is a flowchart illustrating a video parsing method according to a specific embodiment of the present disclosure.
[0044] Fig. 9 is a block diagram illustrating a video parsing apparatus according to an exemplary embodiment of the present disclosure.
[0045] Fig.10 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0046] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.
[0048] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.
[0049] The video parsing task usually consists of two parts. One part is to analyze the semantics of each image frame and group the image frames with the same semantics into one video segment, thereby segmenting the video into one or more video segments according to the voice. The other part is to classify each segmented video segment and find out the video type to which it belongs. The application of video parsing technology helps to conveniently analyze whether the overall content of the video is unified, and thus can effectively identify low-quality videos that are randomly spliced together from multiple unrelated video segments. For video distribution platforms, the application of video parsing technology can quickly analyze the quality of videos to be released in batches, thereby reducing the release of low-quality videos.
[0050] The exemplary embodiments of the present disclosure propose a training method and an application method for a video parsing model. Different from the non-end-to-end approach in the related art that treats video segmentation and video classification as two independent tasks, the video parsing model proposed in the exemplary embodiments of the present disclosure includes a video segmentation network and a video classification network, forming an end-to-end video parsing algorithm, unifying the video segmentation task and the video classification task, and making full use of the connection between the two tasks, so that the model can learn according to the correlation between the two tasks. Specifically, video classification is based on the results of video segmentation. If the segmentation is inaccurate, the classification will also be inaccurate. Therefore, from the perspective of back propagation, a learning goal of video classification can be added to the video segmentation task, which is equivalent to a learning goal of segmentation for the video segmentation task, and a learning goal of the accuracy of the results after segmentation for classification. Therefore, video classification can be used to further improve the effect of video segmentation, which helps to greatly optimize the video parsing effect.
[0051] Next, exemplary embodiments of the present disclosure are described from the perspectives of training and application of a video parsing model.
[0052] Figure 1 is a flowchart illustrating a method for training a video parsing model according to an exemplary embodiment of the present disclosure.
[0053] Reference Figure 1In step 101, image features of a video sample and label information corresponding to the video sample are obtained, wherein the video sample includes at least one standard video clip, each standard video clip includes image frames with the same semantics, and the label information includes the standard video clip type corresponding to each standard video clip in the video sample. From the perspective of human understanding, image frames with the same semantics are image frames that describe the same event. From the perspective of the algorithm, image frames with the same semantics are image frames with similar video features (such as image features). In addition, it can be understood that image frames within a video clip are continuously distributed and cannot be interrupted, otherwise they belong to different video clips. In practice, in order to prepare a video sample including multiple standard video clips, multiple standard video clips can be spliced to obtain a video sample.
[0054] The standard video clip type is the video type of each standard video clip in the video sample. The standard video clip type can be marked according to the video analysis requirements in different scenarios. The present disclosure does not make any restrictions here. As an example, it can include film and television highlights, popular science, advertising, game promotion, etc. For example, for the scene of film and television highlights videos, it can be further subdivided. It can be classified according to the title of the film and television drama, the type of film and television drama, and the protagonist of the film and television drama.
[0055] In step 102, according to the image features of the video sample, a video segmentation network is used to perform video segmentation processing to obtain at least one first video segment. Image features can most intuitively reflect the semantics of the image frame. By inputting the image features of the video sample into the video segmentation network, it is helpful to obtain the segmentation result of the video sample. It can be understood that a video is composed of multiple image frames, each of which can extract image features and other features (such as text features, audio features). The features of each image frame are summarized together to obtain the features of the video. Using image features to segment the video sample into at least one first video segment is to calculate the similarity between the image features of each image frame of the video sample, and then classify similar and continuous image frames as a first video segment. If the image features of all image frames of the video sample are similar, the video sample only includes one first video segment.
[0056] Specifically, when performing video segmentation processing using a video segmentation network, a first segmentation point image frame among multiple image frames of a video sample may be determined; and then the video sample may be segmented according to the first segmentation point image frame to obtain at least one first video segment. The first segmentation point image frame may be the last image frame of each first video segment (the last first video segment does not need to determine the corresponding first segmentation point image frame), or the first image frame of each first video segment (the first first video segment does not need to determine the corresponding first segmentation point image frame). When outputting the video segment segmentation processing result, only the information of the first segmentation point image frame may be output, such as the identifier of the first segmentation point image frame. A small amount of information may be used to represent the specific content of at least one first video segment.
[0057] Optionally, in step 101, auxiliary modal features corresponding to each of the multiple image frames in the video sample may be obtained; the auxiliary modal features include at least one of text features and audio features, and then in step 102, the auxiliary modal features corresponding to each of the multiple image frames are integrated into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames. At this time, the fused image features of the video sample may be input into the video segmentation network. Since the fused image features incorporate information of text features and / or audio features, they can better reflect the semantics of the image frames, which helps to improve the accuracy of video segmentation.
[0058] Optionally, the video segmentation network may adopt SCNet (Sliding Clip Network), which first uniformly extracts n image frames from the video sample to reduce the amount of data processing, for example, n=256. Figure 2 is a schematic diagram showing a framework of a video segmentation network according to an exemplary embodiment of the present disclosure. Figure 2 , each image feature can be upgraded to obtain a 2048-dimensional feature, a total of 256*2048, and feature selection is performed through a sliding window. A sliding window can select image features of 8 image frames, for example, and then pass through the MLP (Multi-layer Perceptron) network and Max Pooling to obtain the image features of a candidate image frame, and then output a 512-dimensional feature through the Bi-LSTM (Bi-Long Short-Term Memory) network, and finally predict whether the image frame is a segmentation point image frame.
[0059] In step 103, according to the image features corresponding to each of the at least one first video clip, a video classification network is used to perform video clip classification processing to obtain an estimated video clip type corresponding to each first video clip. As mentioned above, a video is composed of multiple image frames, and the image features of a video sample are a set of image features of each image frame therein, and the image features corresponding to the first video clip are a set of image features of all image frames contained in the first video clip. In other words, combined with the segmentation result of the video sample in step 102, step 103 can segment the image features corresponding to the multiple image frames according to the first segmentation point image frame to obtain the image features corresponding to each of the at least one first video clip, and then use the video classification network to perform video clip classification processing on the image features corresponding to each of the first video clips. Specifically, the fusion features corresponding to each of the at least one first video clip can be input into the video classification network to obtain the estimated video clip type corresponding to each first video clip, so as to achieve video clip classification.
[0060] Optionally, the video classification network may adopt a NextVlad (Vector of Local Aggregated Descriptors) network. Figure 3 is a schematic diagram showing a framework of a video classification network according to an exemplary embodiment of the present disclosure. Figure 3 , the image feature x extracted from the video sample is transformed from N dimensions to λN through the FC (Fully Connected Layer) and becomes Then it is divided into G groups and sent to three parallel branches. The first branch calculates the cluster center of the image features, where the wavy line represents the grouping operation. represents the image features after being divided into G groups, c represents the cluster center, and the horizontal line represents the difference operation, which can obtain the difference between the image features and the cluster center; the second branch passes through FC and uses the softmax function to calculate the similarity α between the G group and the K cluster centers gk (·); The third branch passes through FC and uses the sigmoid function to calculate the weight α of the G group feature g (·). Finally, the three are multiplied and aggregated into a feature v. The sum is first obtained to obtain y, and then the l2 norm is normalized. The normalized feature is sent to FC, and finally reaches the video classifier for classification. The video classification network can also first perform Max Pooling on the image features corresponding to the first video clip in the dimension of the image frame, and then connect to FC for classification.
[0061] Specifically, as for the features selected at each stage, optionally, when the input video segmentation network uses fused image features, the input video classification network may also use fused image features accordingly.
[0062] Furthermore, in the case where text features of multiple video samples are also obtained in step 101, according to an exemplary embodiment of the present disclosure, the image features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain fused text features corresponding to each of the multiple image frames. In the case where audio features of multiple video samples are also obtained in step 101, according to an exemplary embodiment of the present disclosure, the image features corresponding to each of the multiple image frames can be integrated into the audio features of the corresponding image frames to obtain fused audio features corresponding to each of the multiple image frames. In the case where the text features and audio features of multiple video samples are also obtained at the same time in step 101, according to the exemplary embodiment of the present disclosure, the image features and audio features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames; the image features and text features corresponding to each of the multiple image frames can also be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Thereafter, at least one of the fused text features and fused audio features of each image frame can be further fused with the fused image features of the corresponding image frame to obtain the fused features corresponding to each image frame. The features input to the video classification network can be selected as fused features. Since the features of each modality are used, the classification accuracy can be improved. At the same time, since the features are compressed, it helps to reduce the amount of calculation, so the classification accuracy and the amount of calculation can be balanced, and the video parsing efficiency can be improved. In addition, because the video classification network uses fused features, it can already optimize the video parsing effect to a high degree, and the classification does not require very high accuracy of segmentation. As long as the segmentation result is not too far-fetched, a little deviation will not have a big impact on the classification effect. In the previous video segmentation stage, only fused image features can be used instead of fused features, which helps to control the amount of calculation.
[0063] Figure 4 is a schematic diagram showing a framework of a video parsing model according to an exemplary embodiment of the present disclosure.
[0064] Reference Figure 4For the above-mentioned feature fusion scheme, specifically, firstly, according to the modality of the features to be extracted from the video sample, an image feature extraction network for extracting image features (for example, Resnet and ViT can be used) can be configured in the video parsing model, and a text feature extraction network for extracting text features (for example, BERT (Bidirectional Encoder Representations from Transformers) can be used. Considering the consumption of computing resources, multi-dimensional features can also be extracted offline first, and then MLP can be used to extract text features) and at least one of the audio feature extraction networks for extracting audio features (for example, MLP can be used), wherein the features extracted from each modality can be specifically 768-dimensional multi-dimensional features. To complete the above-mentioned feature fusion, the video parsing model may include a multi-modal feature extraction network, and the features to be fused can be spliced and input into the multi-modal feature extraction network to obtain fused features, such as fused image features, fused text features, and fused audio features. Among them, when splicing, the features of the same modality must be together. The multimodal feature extraction network can specifically use BERT. After the multimodal BERT, the features of each modality are integrated with the features of other modalities. However, due to the characteristics of the same input and output of BERT, the features of each modality output still maintain their original shapes. The video parsing model can further include a feature fusion network. The features of each modality output by the multimodal feature extraction network are input into the feature fusion network, and the total amount of features can be compressed to obtain fused features. The feature fusion network can specifically use the MSA (Multi-head Self-Attention) network.
[0065] Furthermore, the label information obtained in step 101 also includes standard segmentation point information that characterizes whether the image frame in the video sample is a standard segmentation point image frame. The training method according to the exemplary embodiment of the present disclosure may also include: inputting the fusion features corresponding to each of the multiple image frames of the video sample into the video segmentation network, determining whether each of the multiple image frames is a second segmentation point image frame, and obtaining estimated segmentation point information of the multiple image frames; wherein the estimated segmentation point information is used to obtain at least one second video clip. By using fusion features containing more information to achieve the second stage of video segmentation, it is helpful to further improve the video segmentation accuracy and obtain accurate segmentation results. It can be understood that this segmentation stage is not necessary for video classification, but if there are higher requirements for the segmentation results and high-precision segmentation results are needed for other scenarios, such as for an independent video classification model, this step can be added. The video segmentation network used at this time can be the same as step 102.
[0066] In step 104, the value of the first loss function is determined according to the estimated video segment type corresponding to each first video segment and the standard video segment type corresponding to the corresponding standard video segment. Since the determination of the video segment type is a typical classification problem, the first loss function can specifically be a cross entropy loss function.
[0067] Optionally, in the case where the fused features are also input into the video segmentation network to obtain at least one estimated second video segment, the value of the second loss function of the video parsing model is also determined based on the estimated segmentation point information and the standard segmentation point information of the corresponding image frame. Since the video segmentation network ultimately determines whether an image frame is a segmentation point, it still belongs to a classification problem, so the second loss function can also use a cross entropy loss function. In the case where both the value of the first loss function and the value of the second loss function are calculated, in order to facilitate the training of the model, the two can be statistically analyzed, such as directly summing or weighted summing, as the value of the loss function.
[0068] In step 105, the parameters of the video segmentation network and the video classification network are adjusted according to the value of the first loss function, and the iterative training is continued according to the adjusted parameters until the preset training end condition is met. The parameters in the video parsing model are iteratively calculated in combination with the value of the loss function until the preset training end condition is met, and the model training can be completed. The preset training end condition is, for example, that the value of the loss function is less than a set value, or the number of iterations reaches a set number, which is not limited in the present disclosure.
[0069] Optionally, in the case where the video parsing model also includes an image feature extraction network, the parameters of the image extraction network are also adjusted in step 105 .
[0070] Optionally, in the case where the video parsing model also includes at least one of a text feature extraction network and an audio feature extraction network, the parameters of the text extraction network are adjusted in step 105, and the audio feature extraction network can be trained offline.
[0071] Optionally, in the case where the video parsing model also includes a multimodal feature extraction network, the parameters of the multimodal feature extraction network are also adjusted in step 105 .
[0072] Optionally, in the case where the video parsing model also includes a feature fusion network, the parameters of the feature fusion network are also adjusted in step 105 .
[0073] Figure 5 is a flowchart illustrating a method for training a video parsing model according to a specific embodiment of the present disclosure.
[0074] Combination Figure 4 and Figure 5In step 501, image features of a video sample and label information corresponding to the video sample are obtained, wherein the video sample includes at least one standard video segment, each standard video segment includes image frames with the same semantics, and the label information includes a standard video segment type corresponding to each standard video segment in the video sample.
[0075] In step 502, the image information, text information, and audio information of the video sample are extracted. It is understandable that the information of the extracted video sample can also be directly obtained.
[0076] In step 503, the image features, text features, and audio features of the video sample are extracted using the image feature extraction network, the text feature extraction network, and the audio feature extraction network.
[0077] In step 504, the image features, text features, and audio features are input into the BERT network to obtain fused image features, fused text features, and fused audio features.
[0078] In step 505, the fused image features, the fused text features, and the fused audio features are input into the MSA network to obtain fused features.
[0079] In step 506, the fused image features and the fused features of the video sample are respectively input into SCNet to obtain at least one first video segment and at least one second video segment respectively.
[0080] In step 507, the fusion feature corresponding to at least one first video segment is input into the NextVlad network to obtain the estimated video segment type corresponding to each first video segment.
[0081] In step 508, the value of the first loss function is determined based on the estimated video segment type corresponding to each first video segment and the standard video segment type corresponding to the corresponding standard video segment, the value of the second loss function is determined based on at least one second video segment and at least one standard video segment, and the sum of the first loss function and the second loss function is calculated.
[0082] In step 509, the parameters of the image feature extraction network, the text feature extraction network, the multimodal feature extraction network, the feature fusion network, the video segmentation network and the video classification network are adjusted according to the sum of the first loss function and the second loss function, and iterative training is continued according to the adjusted parameters until the preset training end conditions are met.
[0083] Figure 6 1 is a flow chart showing a video parsing method according to an exemplary embodiment of the present disclosure. The video parsing method is performed based on a video parsing model, and the video parsing model is trained using the above training method.
[0084] Reference Figure 6 In step 601, image features of a target video are obtained, wherein the target video is a video that needs to be analyzed.
[0085] In step 602, based on the image features, the video segmentation network in the video parsing model is used to perform standard video segmentation processing to obtain at least one first video segment. Image features can most intuitively reflect the semantics of the image frame. By inputting the image features of the target video into the video segmentation network, it is helpful to obtain the segmentation result of the target video. It can be understood that a video is composed of multiple image frames, each of which can extract image features and other features (such as text features, audio features). The features of each image frame are summarized together to obtain the features of the video. Using image features to segment the target video into at least one first video segment is to calculate the similarity between the image features of each image frame of the target video, and then classify similar and continuous image frames as a first video segment. If the image features of all image frames of the target video are similar, the target video only includes one first video segment.
[0086] Specifically, when performing video segmentation processing using a video segmentation network, a first segmentation point image frame among multiple image frames of a target video may be determined; and then the target video may be segmented according to the first segmentation point image frame to obtain at least one first video segment. The first segmentation point image frame may be the last image frame of each first video segment (the last first video segment does not need to determine the corresponding first segmentation point image frame), or the first image frame of each first video segment (the first first video segment does not need to determine the corresponding first segmentation point image frame). When outputting the video segment segmentation processing result, only the information of the first segmentation point image frame may be output, such as the identifier of the first segmentation point image frame. A small amount of information may be used to represent the specific content of at least one first video segment.
[0087] Optionally, in step 601, auxiliary modal features corresponding to each of the multiple image frames in the target video may be obtained; the auxiliary modal features include at least one of text features and audio features, and then in step 602, the auxiliary modal features corresponding to each of the multiple image frames are integrated into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames. At this time, in step 602, the fused image features of the target video may be input into the video segmentation network. Since the fused image features incorporate information of text features and / or audio features, they can better reflect the semantics of the image frames, which helps to improve the accuracy of video segmentation.
[0088] Optionally, the video segmentation network may adopt SCNet, and firstly evenly extract n image frames from the video sample to reduce the amount of data processing, for example, n=256. Figure 2is a schematic diagram showing a framework of a video segmentation network according to an exemplary embodiment of the present disclosure. Figure 2 , we can first perform a dimensionality increase operation on each image feature to obtain a 2048-dimensional feature, a total of 256*2048, and use a sliding window to select features. For example, a sliding window can select image features of 8 image frames, and then obtain the image features of a candidate image frame through the MLP network and Max Pooling, and output a 512-dimensional feature through the Bi-LSTM network. Finally, we predict whether the image frame is an image frame segmentation point.
[0089] In step 603, based on the image features corresponding to at least one first video segment, a video classification network in the video parsing model is used to perform standard video segment classification processing to obtain an estimated video segment type corresponding to each first video segment. A video is composed of multiple image frames, and the image features of the target video are a set of image features of each image frame therein, and the image features corresponding to the first video segment are a set of image features of all image frames contained in the first video segment. In other words, combined with the segmentation result of the target video in step 602, step 603 can segment the image features corresponding to multiple image frames based on the first segmentation point image frame to obtain the image features corresponding to at least one first video segment, and then use the video classification network to perform video segment classification processing on the image features corresponding to each first video segment. Specifically, the fusion features corresponding to at least one first video segment can be input into the video classification network to obtain the estimated video segment type corresponding to each first video segment, thereby achieving video segment classification.
[0090] Optionally, the video classification network may adopt the NextVlad network. Figure 3 is a schematic diagram showing a framework of a video classification network according to an exemplary embodiment of the present disclosure. Figure 3 , the image features extracted from the video sample are transformed from N dimensions to λN through FC, and then divided into G groups and sent to three parallel branches. The first branch calculates the cluster center of the image features, the second branch calculates the similarity between the G group and the K cluster centers, and the third branch calculates the weight of the G group features. Finally, the three are multiplied and aggregated into one feature for classification. The video classification network can also first perform Max Pooling on the image features corresponding to the first video clip in the dimension of the image frame, and then connect FC for classification.
[0091] Specifically, as for the features selected at each stage, optionally, when the input video segmentation network uses fused image features, the input video classification network may also use fused image features accordingly.
[0092] Further, in the case where the text features of the target video are also obtained in step 601, according to an exemplary embodiment of the present disclosure, the image features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. In the case where the audio features of the target video are also obtained in step 601, according to an exemplary embodiment of the present disclosure, the image features corresponding to each of the multiple image frames can be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. In the case where the text features and audio features of the target video are also obtained in step 601 at the same time, according to an exemplary embodiment of the present disclosure, the image features and audio features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. The image features and text features corresponding to each of the multiple image frames can also be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Thereafter, at least one of the fused text features and fused audio features of each image frame can be further fused with the fused image features of the corresponding image frame to obtain the fused features corresponding to each image frame. The features input to the video classification network can be selected from fused features. Since the features of each modality are used, the classification accuracy can be improved. At the same time, since the features are compressed, it helps to reduce the amount of calculation, so the classification accuracy and the amount of calculation can be balanced to improve the efficiency of video parsing. In addition, since the video classification network uses fused features, the video parsing effect can be highly optimized, and the classification does not require very high accuracy of segmentation. As long as the segmentation result is not particularly outrageous, a little deviation will not have a big impact on the classification effect. By using only fused image features instead of fused features in the previous video segmentation stage, it helps to control the amount of calculation.
[0093] Figure 4 is a schematic diagram showing a framework of a video parsing model according to an exemplary embodiment of the present disclosure.
[0094] Reference Figure 4 For the above feature fusion scheme, specifically, firstly, according to the modality of the features to be extracted from the target video, an image feature extraction network ( Figure 4 Image Encoder in, for example, Resnet, ViT) can be used, and a text feature extraction network for extracting text features can also be configured ( Figure 4Tokenizer in, for example, BERT can be used. Considering the consumption of computing resources, it is also possible to extract multi-dimensional features offline first, and then use MLP to extract text features) and audio feature extraction network for extracting audio features ( Figure 4 In the AudioEncoder, for example, MLP can be used, wherein the features of each modality extracted can be specifically 768-dimensional multi-dimensional features. To complete the above-mentioned feature fusion, the video parsing model may include a multimodal feature extraction network, and the features to be fused can be spliced and input into the multimodal feature extraction network to obtain fused features, such as fused image features, fused text features, and fused audio features. Among them, when splicing, the features of the same modality must be together. Figure 4 As shown in the figure, the multimodal feature extraction network can specifically use BERT. After the multimodal BERT, the features of each modality are integrated with the features of other modalities. However, due to the characteristic that the input and output of BERT are the same, the features of each modality output still maintain their original shape. The video parsing model can further include a feature fusion network. The features of each modality output by the multimodal feature extraction network are input into the feature fusion network, which can compress the total amount of features to obtain fused features. Figure 4 As shown, the feature fusion network can specifically adopt the MSA network.
[0095] Furthermore, according to the exemplary embodiment of the present disclosure, the video parsing method may also include: inputting the fusion features corresponding to each of the multiple image frames of the target video into the video segmentation network, determining the second segmentation point image frame among the multiple image frames; segmenting the target video according to the second segmentation point image frame to obtain at least one second video segment. By utilizing the fusion features containing more information to implement the second stage of video segmentation, it is helpful to further improve the video segmentation accuracy and obtain accurate segmentation results. It can be understood that this segmentation stage is not necessary for video classification, but if there are higher requirements for the segmentation results and high-precision segmentation results are needed for other scenarios, such as for an independent video classification model, this step can be added. The video segmentation network used at this time can be the same as step 602.
[0096] Figure 7 is a flowchart illustrating a video parsing method according to a specific embodiment of the present disclosure.
[0097] Combination Figure 4 and Figure 7 , in step 701, a target video is obtained.
[0098] In step 702, the image information, text information, and audio information of the target video are extracted. It is understandable that the information of the target video that has been extracted can also be directly obtained.
[0099] In step 703, the image features, text features, and audio features of the target video are extracted using an image feature extraction network, a text feature extraction network, and an audio feature extraction network.
[0100] In step 704, the image features, text features, and audio features are input into the BERT network to obtain fused image features, fused text features, and fused audio features.
[0101] In step 705, the fused image features, the fused text features, and the fused audio features are input into the MSA network to obtain fused features.
[0102] In step 706, the fused image features and the fused features of the target video are respectively input into SCNet to obtain at least one first video segment and at least one second video segment.
[0103] In step 707, the fusion features corresponding to at least one first video segment are input into the NextVlad network to obtain the estimated video segment type corresponding to each first video segment.
[0104] Figure 8 is a block diagram illustrating a training apparatus for a video parsing model according to an exemplary embodiment of the present disclosure.
[0105] Reference Figure 8 The training device 800 of the video parsing model includes an acquisition unit 801, a first estimation unit 802, a second estimation unit 803, a calculation unit 804 and a parameter adjustment unit 805.
[0106] The acquisition unit 801 can acquire the image features of the video sample and the label information corresponding to the video sample, wherein the video sample includes at least one standard video segment, each standard video segment includes image frames with the same semantics, and the label information includes the standard video segment type corresponding to each standard video segment in the video sample. From the perspective of human understanding, image frames with the same semantics are image frames that describe the same event. From the perspective of the algorithm, image frames with the same semantics are image frames with similar video features (such as image features). In addition, it can be understood that the image frames within a video segment are continuously distributed and cannot be interrupted, otherwise they belong to different video segments. In practice, in order to prepare a video sample including multiple standard video segments, multiple standard video segments can be spliced to obtain a video sample.
[0107] The standard video clip type is the video type of each standard video clip in the video sample. The standard video clip type can be marked according to the video analysis requirements in different scenarios. The present disclosure does not make any restrictions here. As an example, it can include film and television highlights, popular science, advertising, game promotion, etc. For example, for the scene of film and television highlights videos, it can be further subdivided. It can be classified according to the title of the film and television drama, the type of film and television drama, and the protagonist of the film and television drama.
[0108] The first estimation unit 802 can perform video segmentation processing using a video segmentation network according to the image features of the video sample to obtain at least one first video segment. Image features can most intuitively reflect the semantics of the image frame. By inputting the image features of the video sample into the video segmentation network, it is helpful to obtain the segmentation result of the video sample. It can be understood that a video is composed of multiple image frames, each of which can extract image features and other features (such as text features, audio features). The features of each image frame are summarized together to obtain the features of the video. Using image features to segment the video sample into at least one first video segment is to calculate the similarity between the image features of each image frame of the video sample, and then classify similar and continuous image frames as a first video segment. If the image features of all image frames of the video sample are similar, the video sample only includes one first video segment.
[0109] Specifically, when performing video segmentation processing using a video segmentation network, a first segmentation point image frame among multiple image frames of a video sample may be determined; and then the video sample may be segmented according to the first segmentation point image frame to obtain at least one first video segment. The first segmentation point image frame may be the last image frame of each first video segment (the last first video segment does not need to determine the corresponding first segmentation point image frame), or the first image frame of each first video segment (the first first video segment does not need to determine the corresponding first segmentation point image frame). When outputting the video segment segmentation processing result, only the information of the first segmentation point image frame may be output, such as the identifier of the first segmentation point image frame. A small amount of information may be used to represent the specific content of at least one first video segment.
[0110] Optionally, the acquisition unit 801 may also acquire auxiliary modal features corresponding to each of the multiple image frames in the video sample; the auxiliary modal features include at least one of text features and audio features, and then the first estimation unit 802 integrates the auxiliary modal features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames. At this time, the fused image features of the video sample can be input into the video segmentation network. Since the fused image features incorporate information of text features and / or audio features, they can better reflect the semantics of the image frame and help improve the accuracy of video segmentation.
[0111] The second estimation unit 803 can use the video classification network to perform video segment classification processing according to the image features corresponding to each of the at least one first video segment, and obtain the estimated video segment type corresponding to each first video segment. As mentioned above, a video is composed of multiple image frames, and the image features of a video sample are the set of image features of each image frame therein, and the image features corresponding to the first video segment are the set of image features of all image frames contained in the first video segment. In other words, combined with the segmentation result of the video sample by the first estimation unit 802, the second estimation unit 803 can segment the image features corresponding to the multiple image frames according to the first segmentation point image frame, obtain the image features corresponding to each of the at least one first video segment, and then use the video classification network to perform video segment classification processing on the image features corresponding to each of the first video segments, which can be specifically inputting the fusion features corresponding to each of the at least one first video segment into the video classification network to obtain the estimated video segment type corresponding to each of the first video segments, so as to achieve video segment classification.
[0112] Specifically, as for the features selected at each stage, optionally, when the input video segmentation network uses fused image features, the input video classification network may also use fused image features accordingly.
[0113] Furthermore, in the case where the acquisition unit 801 also acquires text features of multiple video samples, the first estimation unit 802 may integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames to obtain fused text features corresponding to each of the multiple image frames. In the case where the acquisition unit 801 also acquires audio features of multiple video samples, the first estimation unit 802 may integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames to obtain fused audio features corresponding to each of the multiple image frames. In the case where the acquisition unit 801 also acquires text features and audio features of multiple video samples at the same time, the first estimation unit 802 can integrate the image features and audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. The image features and text features corresponding to each of the multiple image frames can also be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Thereafter, at least one of the fused text features and fused audio features of each image frame can be further fused with the fused image features of the corresponding image frame to obtain the fused features corresponding to each image frame. The features input to the video classification network can be selected as fused features. Since the features of each modality are used, the classification accuracy can be improved. At the same time, since the features are compressed, it helps to reduce the amount of calculation, so the classification accuracy and the amount of calculation can be balanced, and the video parsing efficiency can be improved. In addition, because the video classification network uses fused features, it can already optimize the video parsing effect to a high degree, and the classification does not require very high accuracy of segmentation. As long as the segmentation result is not too far-fetched, a little deviation will not have a big impact on the classification effect. In the previous video segmentation stage, only fused image features can be used instead of fused features, which helps to control the amount of calculation.
[0114] Figure 4 is a schematic diagram showing a framework of a video parsing model according to an exemplary embodiment of the present disclosure.
[0115] Reference Figure 4 For the above feature fusion scheme, specifically, firstly, according to the modality of the features to be extracted from the video sample, an image feature extraction network ( Figure 4 Image Encoder in, for example, Resnet, ViT) can be used, and a text feature extraction network for extracting text features can also be configured ( Figure 4Tokenizer in, for example, BERT can be used. Considering the consumption of computing resources, it is also possible to extract multi-dimensional features offline first, and then use MLP to extract text features) and audio feature extraction network for extracting audio features ( Figure 4 In the AudioEncoder, for example, MLP can be used, wherein the features of each modality extracted can be specifically 768-dimensional multi-dimensional features. To complete the above-mentioned feature fusion, the video parsing model may include a multimodal feature extraction network, and the features to be fused can be spliced and input into the multimodal feature extraction network to obtain fused features, such as fused image features, fused text features, and fused audio features. Among them, when splicing, the features of the same modality must be together. Figure 4 As shown in the figure, the multimodal feature extraction network can specifically use BERT. After the multimodal BERT, the features of each modality are integrated with the features of other modalities. However, due to the characteristic that the input and output of BERT are the same, the features of each modality output still maintain their original shape. The video parsing model can further include a feature fusion network. The features of each modality output by the multimodal feature extraction network are input into the feature fusion network, which can compress the total amount of features to obtain fused features. Figure 4 As shown, the feature fusion network can specifically adopt an MSA (Multi-head Self-Attention) network.
[0116] Furthermore, the label information acquired by the acquisition unit 801 also includes standard segmentation point information that characterizes whether the image frame in the video sample is a standard segmentation point image frame. The first estimation unit 802 can also input the fusion features corresponding to each of the multiple image frames of the video sample into the video segmentation network to determine whether each of the multiple image frames is a second segmentation point image frame, and obtain the estimated segmentation point information of the multiple image frames; wherein the estimated segmentation point information is used to obtain at least one second video clip. By using the fusion features containing more information to realize the second stage of video segmentation, it is helpful to further improve the video segmentation accuracy and obtain accurate segmentation results. It can be understood that this segmentation stage is not necessary for video classification, but if there are higher requirements for the segmentation results, and high-precision segmentation results are needed for other scenarios, such as for an independent video classification model, this step can be added. The video segmentation network used at this time can be the same as the video segmentation in the first stage.
[0117] The calculation unit 804 may determine the value of the first loss function according to the estimated video segment type corresponding to each first video segment and the standard video segment type corresponding to the corresponding standard video segment. Since the determination of the video segment type is a typical classification problem, the first loss function may specifically select a cross entropy loss function.
[0118] Optionally, in the case where the fusion feature is also input into the video segmentation network to obtain at least one estimated second video segment, the calculation unit 804 can also determine the value of the second loss function of the video parsing model based on the estimated segmentation point information and the standard segmentation point information of the corresponding image frame. Since the video segmentation network ultimately determines whether an image frame is a segmentation point, it still belongs to the classification problem, so the second loss function can also use the cross entropy loss function. In the case where both the value of the first loss function and the value of the second loss function are calculated, in order to facilitate the training of the model, the calculation unit 804 can perform statistics on the two, such as direct summation or weighted summation, as the value of the loss function.
[0119] The parameter adjustment unit 805 can adjust the parameters of the video segmentation network and the video classification network according to the value of the first loss function, and continue iterative training according to the adjusted parameters until the preset training end condition is met. The parameters in the video parsing model are iteratively calculated in combination with the value of the loss function until the preset training end condition is met, and the model training can be completed. The preset training end condition is, for example, that the value of the loss function is less than a set value, or the number of iterations reaches a set number, which is not limited in the present disclosure.
[0120] Optionally, in the case where the video parsing model also includes an image feature extraction network, the parameter adjustment unit 805 can adjust the parameters of the image extraction network at the same time.
[0121] Optionally, in the case where the video parsing model also includes at least one of a text feature extraction network and an audio feature extraction network, the parameter adjustment unit 805 can adjust the parameters of the text extraction network at the same time, and the audio feature extraction network can be trained offline.
[0122] Optionally, in the case where the video parsing model also includes a multimodal feature extraction network, the parameter adjustment unit 805 may adjust the parameters of the multimodal feature extraction network at the same time.
[0123] Optionally, in the case where the video parsing model also includes a feature fusion network, the parameter adjustment unit 805 may adjust the parameters of the feature fusion network at the same time.
[0124] Fig. 9 is a block diagram showing a video parsing apparatus according to an exemplary embodiment of the present disclosure. The video parsing apparatus is executed based on a video parsing model, and the video parsing model is trained using the above training method.
[0125] Reference Fig. 9 The video parsing device 900 includes an acquisition unit 901, a first estimation unit 902 and a second estimation unit 903.
[0126] The acquisition unit 901 can acquire the image features of the target video, wherein the target video is the video that needs to be analyzed.
[0127] The first estimation unit 902 can input the image features into the video segmentation network to obtain at least one estimated first video segment. The image features can most intuitively reflect the semantics of the image frame. By inputting the image features of the target video into the video segmentation network, it is helpful to obtain the segmentation result of the target video. It can be understood that a video is composed of multiple image frames, each of which can extract image features and other features (such as text features, audio features). The features of each image frame are summarized together to obtain the features of the video. Using the image features to segment the target video into at least one first video segment is to calculate the similarity between the image features of each image frame of the target video, and then classify similar and continuous image frames into a first video segment. If the image features of all the image frames of the target video are similar, the target video only includes one first video segment.
[0128] Specifically, when performing video segmentation processing using a video segmentation network, a first segmentation point image frame among multiple image frames of a target video may be determined; and then the target video may be segmented according to the first segmentation point image frame to obtain at least one first video segment. The first segmentation point image frame may be the last image frame of each first video segment (the last first video segment does not need to determine the corresponding first segmentation point image frame), or the first image frame of each first video segment (the first first video segment does not need to determine the corresponding first segmentation point image frame). When outputting the video segment segmentation processing result, only the information of the first segmentation point image frame may be output, such as the identifier of the first segmentation point image frame. A small amount of information may be used to represent the specific content of at least one first video segment.
[0129] Optionally, the acquisition unit 901 may also acquire auxiliary modal features corresponding to each of the multiple image frames in the target video; the auxiliary modal features include at least one of text features and audio features, and then the first estimation unit 902 integrates the auxiliary modal features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames. At this time, the fused image features of the video sample can be input into the video segmentation network. Since the fused image features incorporate information of text features and / or audio features, they can better reflect the semantics of the image frame and help improve the accuracy of video segmentation.
[0130] The second estimation unit 903 can perform standard video segment classification processing using the video classification network in the video parsing model according to the image features corresponding to each of the at least one first video segment, and obtain the estimated video segment type corresponding to each first video segment. A video is composed of multiple image frames, and the image features of the target video are the set of image features of each image frame therein, and the image features corresponding to the first video segment are the set of image features of all image frames contained in the first video segment. In other words, combined with the segmentation result of the target video by the first estimation unit 902, the second estimation unit 903 can segment the image features corresponding to the multiple image frames according to the first segmentation point image frame, obtain the image features corresponding to each of the at least one first video segment, and then use the video classification network to perform video segment classification processing on the image features corresponding to each of the first video segments, which can be specifically inputting the fusion features corresponding to each of the at least one first video segment into the video classification network to obtain the estimated video segment type corresponding to each of the first video segments, so as to achieve video segment classification.
[0131] Specifically, as for the features selected at each stage, optionally, when the input video segmentation network uses fused image features, the input video classification network may also use fused image features accordingly.
[0132] Furthermore, when the acquisition unit 901 also acquires text features of the target video, the first estimation unit 902 may integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames to obtain fused text features corresponding to each of the multiple image frames. When the acquisition unit 901 also acquires audio features of the target video, the first estimation unit 902 may integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames to obtain fused audio features corresponding to each of the multiple image frames. In the case where the acquisition unit 901 also acquires the text features and audio features of the target video at the same time, the first estimation unit 902 can integrate the image features and audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the text features of the corresponding image frames to obtain the fused text features corresponding to each of the multiple image frames. The image features and text features corresponding to each of the multiple image frames can also be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Of course, only the image features corresponding to each of the multiple image frames can be integrated into the audio features of the corresponding image frames to obtain the fused audio features corresponding to each of the multiple image frames. Thereafter, at least one of the fused text features and fused audio features of each image frame can be further fused with the fused image features of the corresponding image frame to obtain the fused features corresponding to each image frame. The features of the input video classification network can be selected as fused features. Since the features of each modality are used, the classification accuracy can be improved. At the same time, since the features are compressed, it helps to reduce the amount of calculation, so the classification accuracy and the amount of calculation can be balanced, and the video parsing efficiency can be improved. In addition, because the video classification network uses fused features, it can already optimize the video parsing effect to a high degree, and the classification does not require very high accuracy of segmentation. As long as the segmentation result is not too far-fetched, a little deviation will not have a big impact on the classification effect. In the previous video segmentation stage, only fused image features can be used instead of fused features, which helps to control the amount of calculation.
[0133] Figure 4 is a schematic diagram showing a framework of a video parsing model according to an exemplary embodiment of the present disclosure.
[0134] Reference Figure 4 For the above feature fusion scheme, specifically, firstly, according to the modality of the features to be extracted from the target video, an image feature extraction network ( Figure 4 Image Encoder in, for example, Resnet, ViT) can be used, and a text feature extraction network for extracting text features can also be configured ( Figure 4Tokenizer in, for example, BERT can be used. Considering the consumption of computing resources, it is also possible to extract multi-dimensional features offline first, and then use MLP to extract text features) and audio feature extraction network for extracting audio features ( Figure 4 In the AudioEncoder, for example, MLP can be used, wherein the features of each modality extracted can be specifically 768-dimensional multi-dimensional features. To complete the above-mentioned feature fusion, the video parsing model may include a multimodal feature extraction network, and the features to be fused can be spliced and input into the multimodal feature extraction network to obtain fused features, such as fused image features, fused text features, and fused audio features. Among them, when splicing, the features of the same modality must be together. Figure 4 As shown in the figure, the multimodal feature extraction network can specifically use BERT. After the multimodal BERT, the features of each modality are integrated with the features of other modalities. However, due to the characteristic that the input and output of BERT are the same, the features of each modality output still maintain their original shape. The video parsing model can further include a feature fusion network. The features of each modality output by the multimodal feature extraction network are input into the feature fusion network, which can compress the total amount of features to obtain fused features. Figure 4 As shown, the feature fusion network can specifically adopt the MSA network.
[0135] Furthermore, the first estimation unit 902 may input the fusion features corresponding to each of the multiple image frames of the target video into the video segmentation network to determine the second segmentation point image frame among the multiple image frames; segment the target video according to the second segmentation point image frame to obtain at least one second video segment. By utilizing the fusion features containing more information to implement the second stage of video segmentation, it is helpful to further improve the video segmentation accuracy and obtain accurate segmentation results. It can be understood that this segmentation stage is not necessary for video classification, but if there are higher requirements for the segmentation results and high-precision segmentation results are needed for other scenarios, such as for an independent video classification model, this step can be added. The video segmentation network used at this time can be the same as the video segmentation in the first stage.
[0136] Fig.10 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
[0137] Reference Fig.10 The electronic device 1000 includes at least one memory 1001 and at least one processor 1002, wherein the at least one memory 1001 stores a set of computer executable instructions. When the computer executable instruction set is executed by the at least one processor 1002, a training method for a video parsing model or a video parsing method according to an exemplary embodiment of the present disclosure is executed.
[0138] As an example, the electronic device 1000 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 1000 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 1000 may also be part of an integrated control system or a system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.
[0139] In the electronic device 1000, the processor 1002 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.
[0140] The processor 1002 may execute instructions or codes stored in the memory 1001, wherein the memory 1001 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.
[0141] The memory 1001 may be integrated with the processor 1002, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 1001 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 1001 and the processor 1002 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 1002 can read files stored in the memory.
[0142] In addition, the electronic device 1000 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 1000 may be connected to each other via a bus and / or a network.
[0143] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium may also be provided, and when the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the training method of the video parsing model or the video parsing method according to the exemplary embodiment of the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0144] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided, which includes computer instructions. When the computer instructions are executed by at least one processor, the at least one processor is prompted to execute a video parsing model training method or a video parsing method according to an exemplary embodiment of the present disclosure.
[0145] According to the training method and device of the video parsing model and the video parsing method and device of the exemplary embodiment of the present disclosure, the video parsing model includes a video segmentation network and a video classification network, forming an end-to-end video parsing algorithm, unifying the video segmentation task and the video classification task, and making full use of the connection between the two tasks, so that the model can learn according to the correlation between the two tasks. Specifically, video classification is based on the results of video segmentation. If the segmentation is inaccurate, the classification will also be inaccurate, so that from the perspective of back propagation, a video classification learning goal can be added to the video segmentation task, which is equivalent to the video segmentation task having a segmentation learning goal and a learning goal for the accuracy of the results after segmentation for classification. Therefore, video classification can be used to further improve the effect of video segmentation, which helps to greatly optimize the video parsing effect.
[0146] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0147] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A video parsing model training method, characterized in that: The video parsing model includes a video segmentation network and a video classification network, and the training method includes: Acquire image features of a video sample and label information corresponding to the video sample; wherein the video sample includes at least one standard video segment, each of the standard video segments includes image frames with the same semantics, and the label information includes a standard video segment type corresponding to each standard video segment in the video sample; According to the image features of the video sample, using the video segmentation network to perform video segmentation processing to obtain at least one first video segment; According to the image features corresponding to each of the at least one first video segment, using the video classification network to perform video segment classification processing to obtain an estimated video segment type corresponding to each of the first video segments; determining a value of a first loss function according to the estimated video segment type corresponding to each of the first video segments and the standard video segment type corresponding to the corresponding standard video segment; The parameters of the video segmentation network and the video classification network are adjusted according to the value of the first loss function, and the iterative training is continued according to the adjusted parameters until a preset training end condition is met.
2. The training method according to claim 1, characterized in that: The training method further comprises: Acquire auxiliary modal features corresponding to each of the plurality of image frames in the video sample; the auxiliary modal features include at least one of a text feature and an audio feature; The step of performing video segmentation processing using the video segmentation network according to the image features of the video sample to obtain at least one first video segment includes: Integrate the auxiliary modality features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; Inputting the fused image features corresponding to each of the multiple image frames of the video sample into the video segmentation network, and determining a first segmentation point image frame among the multiple image frames; The video sample is segmented according to the first segmentation point image frame to obtain the at least one first video segment.
3. The training method according to claim 2, characterized in that: The training method further comprises: Integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrate the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; Integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrate the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; Fusing at least one of the fused text feature and the fused audio feature of each image frame with the fused image feature of the corresponding image frame to obtain a fused feature corresponding to each image frame; Segmenting the fusion features corresponding to a plurality of image frames according to the first segmentation point image frame to obtain the fusion features corresponding to each of the at least one first video segment; The step of performing video segment classification processing by using the video classification network according to the image features corresponding to each of the at least one first video segment includes: The fused features corresponding to each of the at least one first video clip are input into the video classification network.
4. The training method according to claim 3, characterized in that: The video parsing model also includes a multimodal feature extraction network, The fused text feature, at least one of the fused audio feature and the fused image feature are obtained by the following steps: Inputting the text features and at least one of the audio features and the image features corresponding to each of the plurality of image frames into the multimodal feature extraction network to obtain the fused text features and at least one of the fused audio features and the fused image features corresponding to each of the plurality of image frames, Wherein, adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: The parameters of the multimodal feature extraction network, the video segmentation network, and the video classification network are adjusted according to the value of the first loss function.
5. The training method according to claim 3, characterized in that: The video parsing model also includes a feature fusion network. The step of fusing at least one of the fused text feature and the fused audio feature of each image frame with the fused image feature of the corresponding image frame to obtain a fused feature corresponding to each image frame includes: Inputting at least one of the fused text features and the fused audio features corresponding to each of the plurality of image frames and the fused image features into the feature fusion network to obtain the fused features corresponding to each of the plurality of image frames; Wherein, adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: The parameters of the video segmentation network, the feature fusion network and the video classification network are adjusted according to the value of the first loss function.
6. The training method according to claim 3, characterized in that: The label information also includes standard segmentation point information indicating whether the image frame in the video sample is a standard segmentation point image frame, and the training method further includes: Inputting the fusion features corresponding to each of the multiple image frames of the video sample into the video segmentation network, determining whether each of the multiple image frames is a second segmentation point image frame, and obtaining estimated segmentation point information of the multiple image frames; wherein the estimated segmentation point information is used to obtain at least one second video segment; Determining a value of a second loss function of the video parsing model according to the estimated segmentation point information and the standard segmentation point information of the corresponding image frame; Wherein, adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: The parameters of the video segmentation network and the video classification network are adjusted according to the value of the first loss function and the value of the second loss function.
7. The training method according to claim 1, characterized in that: The video parsing model also includes an image feature extraction network for extracting the image features; Wherein, adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: The parameters of the image feature extraction network, the video segmentation network and the video classification network are adjusted according to the value of the first loss function.
8. The training method according to claim 2, characterized in that: In the case of acquiring the text features, the video parsing model further includes an image feature extraction network for extracting image features and a text feature extraction network for extracting text features. Wherein, adjusting the parameters of the video segmentation network and the video classification network according to the value of the first loss function includes: The parameters of the image feature extraction network, the text feature extraction network, the video segmentation network and the video classification network are adjusted according to the value of the first loss function.
9. A video analysis method, characterized in that: The video parsing method comprises: Obtain image features of the target video; According to the image features, using a video segmentation network in a video parsing model to perform video segmentation processing to obtain at least one first video segment; According to the image features corresponding to each of the at least one first video segment, a video segment classification process is performed using a video classification network in a video parsing model to obtain an estimated video segment type corresponding to each of the first video segments; The video parsing model is trained using the training method described in any one of claims 1 to 8.
10. The video analysis method according to claim 9, characterized in that: The video parsing method further includes: Acquire auxiliary modal features corresponding to each of the plurality of image frames of the target video; the auxiliary modal features include at least one of a text feature and an audio feature; The step of performing video segmentation processing using a video segmentation network in a video parsing model according to the image features to obtain at least one first video segment includes: Integrate the auxiliary modality features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; Inputting the fused image features corresponding to each of the multiple image frames into the video segmentation network to determine a first segmentation point image frame among the multiple image frames; The target video is segmented according to the first segmentation point image frame to obtain the at least one first video segment.
11. The video analysis method according to claim 10, characterized in that: The video parsing method further includes: Integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrate the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; Integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrate the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; Fusing at least one of the fused text feature and the fused audio feature of each image frame with the fused image feature of the corresponding image frame to obtain a fused feature corresponding to each image frame; Segmenting the fusion features corresponding to a plurality of image frames according to the first segmentation point image frame to obtain the fusion features corresponding to each of the at least one first video segment; The step of performing video segment classification processing by using a video classification network in a video parsing model according to the image features corresponding to each of the at least one first video segment includes: The fused features corresponding to each of the at least one first video clip are input into the video classification network.
12. The video analysis method according to claim 11, characterized in that: The video parsing method further includes: Inputting the fusion features corresponding to each of the multiple image frames of the target video into the video segmentation network, and determining a second segmentation point image frame among the multiple image frames; The target video is segmented according to the second segmentation point image frame to obtain at least one second video segment.
13. A training device for a video parsing model, characterized in that: The video parsing model includes a video segmentation network and a video classification network, and the training device includes: An acquisition unit is configured to: acquire image features of a video sample and label information corresponding to the video sample; wherein the video sample includes at least one standard video segment, each of the standard video segments includes image frames with the same semantics, and the label information includes a standard video segment type corresponding to each standard video segment in the video sample; A first estimation unit is configured to: perform video segmentation processing using the video segmentation network according to the image features of the video sample to obtain at least one first video segment; The second estimation unit is configured to: perform video segment classification processing using the video classification network according to the image features corresponding to each of the at least one first video segment, to obtain an estimated video segment type corresponding to each of the first video segments; a calculation unit configured to: determine a value of a first loss function according to the estimated video segment type corresponding to each of the first video segments and the standard video segment type corresponding to the corresponding standard video segment; The parameter adjustment unit is configured to: adjust the parameters of the video segmentation network and the video classification network according to the value of the first loss function, and continue iterative training according to the adjusted parameters until a preset training end condition is met.
14. The training device according to claim 13, characterized in that The acquisition unit is further configured to: acquire auxiliary modal features corresponding to each of the plurality of image frames in the video sample; the auxiliary modal features include at least one of a text feature and an audio feature; The first estimation unit is further configured to: Integrate the auxiliary modality features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; Inputting the fused image features corresponding to each of the multiple image frames of the video sample into the video segmentation network, and determining a first segmentation point image frame among the multiple image frames; The video sample is segmented according to the first segmentation point image frame to obtain the at least one first video segment.
15. The training device according to claim 14, characterized in that The first estimation unit is further configured to: Integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrate the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; Integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrate the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; Fusing at least one of the fused text feature and the fused audio feature of each image frame with the fused image feature of the corresponding image frame to obtain a fused feature corresponding to each image frame; Segmenting the fusion features corresponding to a plurality of image frames according to the first segmentation point image frame to obtain the fusion features corresponding to each of the at least one first video segment; The second estimation unit is further configured to: The fused features corresponding to each of the at least one first video clip are input into the video classification network.
16. The training device according to claim 15, characterized in that The video parsing model also includes a multimodal feature extraction network, The first estimation unit is further configured to: input the text features and at least one of the audio features and the image features corresponding to each of the multiple image frames into the multimodal feature extraction network to obtain the fused text features and at least one of the fused audio features and the fused image features corresponding to each of the multiple image frames, The parameter adjustment unit is also configured to adjust the parameters of the multimodal feature extraction network, the video segmentation network and the video classification network according to the value of the first loss function.
17. The training device according to claim 15, characterized in that The video parsing model also includes a feature fusion network. The first estimation unit is further configured to: input at least one of the fused text features and the fused audio features corresponding to each of the plurality of image frames and the fused image features into the feature fusion network to obtain the fused features corresponding to each of the plurality of image frames; The parameter adjustment unit is also configured to adjust the parameters of the video segmentation network, the feature fusion network and the video classification network according to the value of the first loss function.
18. The training device according to claim 15, characterized in that The label information also includes standard segmentation point information indicating whether the image frame in the video sample is a standard segmentation point image frame. The first estimation unit is further configured to: input the fusion features corresponding to each of the multiple image frames of the video sample into the video segmentation network, determine whether each of the multiple image frames is a second segmentation point image frame, and obtain estimated segmentation point information of the multiple image frames; wherein the estimated segmentation point information is used to obtain at least one second video segment; The calculation unit is further configured to: determine a value of a second loss function of the video parsing model according to the estimated segmentation point information and the standard segmentation point information of the corresponding image frame; The parameter adjustment unit is also configured to adjust the parameters of the video segmentation network and the video classification network according to the value of the first loss function and the value of the second loss function.
19. The training device according to claim 13, characterized in that The video parsing model further includes an image feature extraction network for extracting the image features, and the parameter adjustment unit is further configured as follows: The parameters of the image feature extraction network, the video segmentation network and the video classification network are adjusted according to the value of the first loss function.
20. The training device according to claim 14, characterized in that In the case of acquiring the text features, the video parsing model further includes an image feature extraction network for extracting image features and a text feature extraction network for extracting text features, and the parameter adjustment unit is further configured as follows: The parameters of the image feature extraction network, the text feature extraction network, the video segmentation network and the video classification network are adjusted according to the value of the first loss function.
21. A video analysis device, characterized in that: The video analysis device comprises: The acquisition unit is configured to: acquire image features of a target video; The first estimation unit is configured to: perform video segmentation processing using a video segmentation network in a video parsing model according to the image features to obtain at least one first video segment; The second estimation unit is configured to: perform video segment classification processing using a video classification network in a video parsing model according to image features corresponding to each of the at least one first video segment, to obtain an estimated video segment type corresponding to each of the first video segments; The video parsing model is trained using the training method described in any one of claims 1 to 8.
22. The video analysis device according to claim 21, characterized in that: The acquisition unit is further configured to: acquire auxiliary modal features corresponding to each of the plurality of image frames of the target video; the auxiliary modal features include at least one of text features and audio features; The first estimation unit is further configured to: Integrate the auxiliary modality features corresponding to each of the multiple image frames into the image features of the corresponding image frames to obtain fused image features corresponding to each of the multiple image frames; Inputting the fused image features corresponding to each of the multiple image frames into the video segmentation network to determine a first segmentation point image frame among the multiple image frames; The target video is segmented according to the first segmentation point image frame to obtain the at least one first video segment.
23. The video analysis device according to claim 22, characterized in that: The first estimation unit is further configured to: Integrate the image features corresponding to each of the multiple image frames into the text features of the corresponding image frames, or integrate the image features and the audio features corresponding to each of the multiple image frames into the text features of the corresponding image frames, to obtain fused text features corresponding to each of the multiple image frames; Integrate the image features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, or integrate the image features and the text features corresponding to each of the multiple image frames into the audio features of the corresponding image frames, to obtain fused audio features corresponding to each of the multiple image frames; Fusing at least one of the fused text feature and the fused audio feature of each image frame with the fused image feature of the corresponding image frame to obtain a fused feature corresponding to each image frame; Segmenting the fusion features corresponding to a plurality of image frames according to the first segmentation point image frame to obtain the fusion features corresponding to each of the at least one first video segment; The second estimation unit is further configured to: The fused features corresponding to each of the at least one first video clip are input into the video classification network.
24. The video analysis device according to claim 23, characterized in that: The first estimation unit is further configured to: Inputting the fusion features corresponding to each of the multiple image frames of the target video into the video segmentation network, and determining a second segmentation point image frame among the multiple image frames; The target video is segmented according to the second segmentation point image frame to obtain at least one second video segment.
25. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer executable instructions, Wherein, when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to execute the video parsing model training method as described in any one of claims 1 to 8 or the video parsing method as described in any one of claims 9 to 12.
26. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the video parsing model training method as described in any one of claims 1 to 8 or the video parsing method as described in any one of claims 9 to 12.
27. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by at least one processor, the training method of the video parsing model as described in any one of claims 1 to 8 or the video parsing method as described in any one of claims 9 to 12 is implemented.
Citation Information
Patent Citations
Single-stage video behavior detection method
CN108805083A
Video semantic segmentation method based on active learning
CN112669325A
Deep learning for dense semantic segmentation in video with automated interactivity and improved temporal coherence
US20200026928A1
Method and apparatus for training semantic segmentation network, image processing method and apparatus based on semantic segmentation network, and device and storage medium
WO2020156303A1
Video classification method and model training method and apparatus thereof, and electronic device
WO2020221278A1
