A video description method and system based on motion perception
By extracting the action semantic features of the video and fusing them with the visual features, and using a non-autoregressive decoder to generate the video description text, the problem of ignoring action semantic information in the existing technology is solved, and the accuracy and consistency of the video description are improved.
Patent Information
- Application Number
- CN202410262500.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-07
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-03-07
AI Technical Summary
Existing video description methods ignore the action semantic information in the video, resulting in the generated description being easily misled by erroneous visual action information, and non-autoregressive methods have duplication or errors when generating subtitles.
Using a video description method based on action perception, by extracting the two-dimensional image features and three-dimensional motion features of the video, input the encoder for feature encoding and splicing, obtain the action semantic features, and fuse them with visual features, using a non-autoregressive decoder Generate video description text, construct a multi-scale semantic skeleton loss function for optimization, and improve the accuracy of description.
It effectively reduces the impact of low-level erroneous action information on description, improves the semantic connection between visual words, improves the accuracy of generated descriptions and language skeleton words, optimizes action prediction losses, and reduces inconsistencies in generated sentences. sex.
Smart Images

Figure CN118172829B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of video description, and in particular relates to a video description method and system based on motion perception. Background Art
[0002] Video description generation has become a vibrant and thriving research area in recent years. This cross-modal task involves generating coherent natural language representations from videos, usually in the form of sentences that concisely describe the visual content depicted in a given video. The applications of video description span across multiple fields, including but not limited to helping the visually impaired and facilitating human-computer interaction.
[0003] Autoregressive methods for generating descriptions word by word have been widely used in various applications. These methods usually adopt an encoder-decoder architecture to establish visual and textual consistency in the description generation process. However, due to their sequential nature, these methods often encounter speed bottlenecks in some applications. Therefore, non-autoregressive methods that can generate all words simultaneously have become a promising alternative. Although non-autoregressive methods have the advantage of low latency, they also bring an important problem, that is, the dependencies between words generated in parallel are weak, which makes it easy for repeated or wrong words to appear in the captions. At present, the combination of local autoregressive and global non-autoregressive methods has become a representative compromise method. Although non-autoregressive methods have made significant progress in various tasks, research in video captioning is relatively limited. Although some studies have achieved exciting results in video description tasks, they ignore the role of action information in the video on video description, and the accuracy of video description still needs to be improved.
[0004] Therefore, a new video description method is needed that can accurately capture the action semantic information in the video, reduce the misleading of video description by low-level erroneous action information, and optimize the generated description sentences. Summary of the invention
[0005] In view of this, the present invention proposes a video description method and system based on motion perception, which are used to solve the problem that existing video description methods ignore the importance of motion semantic information and the generated description text is easily misled by erroneous visual motion information in some frames.
[0006] In a first aspect, the present invention discloses a video description method based on motion perception, the method comprising:
[0007] Acquire multiple videos to be described, extract the two-dimensional image features and three-dimensional motion features of each video to be described respectively, and input them into an encoder for feature encoding and feature splicing to obtain the original visual features of each video to be described;
[0008] Inputting the original visual features into an action recognition predictor to predict the main action behavior information of each video to be described, and obtaining action semantic features;
[0009] Performing feature fusion of the original visual features and the action semantic information to obtain action fused visual features of each video to be described;
[0010] Inputting the action fused visual features into a length predictor, predicting the length distribution probability of the video description text to be generated, and generating the video description text through a non-autoregressive decoder;
[0011] Inputting the action-fused visual features into a visual word decoder to generate visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described;
[0012] A multi-scale semantic skeleton loss function is constructed to supervise the generation of language skeleton labels for each video to be described, and the video description text is optimized at the language skeleton level.
[0013] On the basis of the above technical solution, preferably, the prediction principle of the action recognition predictor is:
[0014] Build an action corpus A * , A * It includes multiple sample videos and associated action types;
[0015] Construct a linear predictor to predict the multi-label prediction probability of action behaviors in sample videos;
[0016] Based on the action corpus A * Designing a loss function for action recognition predictor To improve the confidence of the positive sample labels of the sample video:
[0017]
[0018] in, c=1,2,…,M, M is the number of actions in the corpus; Indicates that the sample video is related to action c, Indicates irrelevant, a c represents the predicted value;
[0019] The original visual features are input into the linear predictor to predict the corresponding main action behavior information A. The linear predictor formula is expressed as follows:
[0020] A = Sigmoid(ReLU(MP(R υ )W υ1 )W v2 )
[0021]
[0022] Among them, R υ represents the original visual features, f AP (·) represents the function of the linear predictor, W υ1 , W v2 , W v3 are the network weights of the linear predictor, MP(·) represents the average pooling operation, N represents the preset maximum sentence length; ReLU(·) is the activation function, Sigmoid(·) is the Sigmoid function; Concat(·) is the feature concatenation function, It is the result of splicing the main action behavior information;
[0023] Use linear mapping to constrain the output length of the main action behavior information A to obtain the corresponding action semantic features
[0024] On the basis of the above technical solution, preferably, the prediction principle of the length predictor is:
[0025] Build a length predictor to learn the original visual features R generated by the encoder v The length of , the length predictor is expressed as:
[0026]
[0027] in, is the predicted length distribution, Represents the addition of matrix and vector, W l1 , W l2 are the network weights of the length predictor, Softmax(·) is the Softmax function;
[0028] Given a true length distribution L * , L * The tth value of Represents the probability of a sentence of length t and constructs the loss function of the length predictor To minimize L and L * The difference in KLD length between:
[0029]
[0030] Among them, l t is the probability of a sentence of length t in L, and N represents the preset maximum length of the language;
[0031] Using the length loss function Constrained length predictor predicts the length distribution probability of the video description text to be generated.
[0032] On the basis of the above technical solution, preferably, the non-autoregressive decoder includes a self-attention layer, a cross-attention layer and a feedforward layer, wherein the self-attention layer adopts a masked multi-head self-attention mechanism, and the cross-attention layer adopts a multi-head attention mechanism;
[0033] The generating of the video description text by the non-autoregressive decoder specifically includes:
[0034] The non-autoregressive decoder generates the mask sequence Y using a non-autoregressive method mask The probability of using noise parallel decoding strategy to generate video description text;
[0035] The non-autoregressive decoder generates the mask sequence Y using a non-autoregressive method mask Probability The formula is:
[0036]
[0037] Among them, f dec (·) represents the decoding function of the non-autoregressive decoder; Y mask is the mask sequence, Y mask =Y * \Y obs , Y * is a true value sequence, Y obs is the observation sequence, y m is the mask sequence Y mask words in;
[0038] The loss function of the non-autoregressive decoder is to minimize the negative log-likelihood loss function
[0039]
[0040] Stands for action fusion visual features.
[0041] Based on the above technical solution, preferably, the step of inputting the action fusion visual features into a visual word decoder to generate visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described specifically includes:
[0042] Given a length of N g The true value sequence Y * ,use <mask>Replace the true value sequence Y * The special words in get the target sequence
[0043] Construct a file with the same special tag <vis>empty sequence of Will Fusion of visual features and motion The two are input together into the visual word decoder to generate a visual word sequence, which includes nouns and verbs.
[0044] Constructing the loss function for the visual word decoder as follows:
[0045]
[0046] in, Generate target sequence Y for the visual word decoder vis The probability of
[0047] Given a complete truth-value language skeleton The true value language skeleton Y is transformed into vis Mapped to a fixed-length visual phrase Convert visual phrase G into ground-truth language skeleton label S;
[0048] The generated visual word sequence is mapped to a fixed-length language skeleton label through the attention mechanism to obtain the predicted language skeleton label S pre ;
[0049] Constructing skeleton label loss function Constrain the predicted language skeleton label S pre The difference between the true language skeleton label S is:
[0050]
[0051] in, K is the number of representative frames extracted from the video to be described, d m is the dimension after feature encoding.
[0052] On the basis of the above technical solution, preferably, the formula of the multi-scale semantic skeleton loss function is:
[0053]
[0054] in, is the multi-scale semantic skeleton loss function; is the loss function of the length predictor; is the loss function of the non-autoregressive decoder; is the loss function of the visual word decoder; is the skeleton label loss function; is the loss function of the action recognition predictor; is a dual-scale bidirectional loss function used to perform visual-linguistic alignment constraints within the language skeleton labels of the same video to be described and between the language skeleton labels of different videos to be described; λ 1 , 2 , 3 is the weight coefficient.
[0055] Based on the above technical solution, preferably, the dual-scale bidirectional loss function The calculation formula is:
[0056]
[0057]
[0058]
[0059]
[0060]
[0061] in, is the alignment loss within the language skeleton label of the same video to be described, is the alignment loss between skeleton labels of different videos to be described, G is the visual phrase corresponding to the current video to be described, G k , G m represent the visual phrases corresponding to the kth and mth videos to be described, respectively, B is the total number of videos to be described, (R v ) k , (R v ) m Represents the original visual features of the k-th video to be described.
[0062] In a second aspect, the present invention discloses a video description system based on motion perception, the system comprising:
[0063] Encoder module: used to obtain multiple videos to be described, extract the two-dimensional image features and three-dimensional motion features of each video to be described, and input them into the encoder for feature encoding and feature splicing to obtain the original visual features of each video to be described;
[0064] Action recognition predictor module: used for inputting the original visual features into the action recognition predictor, predicting the main action behavior information of each video to be described, and obtaining action semantic features;
[0065] Feature fusion module: used for fusing the original visual features with the action semantic information to obtain the action fusion visual features of each video to be described;
[0066] A description text generation module: used for inputting the action fusion visual features into a length predictor, predicting the length distribution probability of the video description text to be generated, and generating the video description text through a non-autoregressive decoder;
[0067] Skeleton label generation module: used for inputting the action fusion visual features into a visual word decoder, generating visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described;
[0068] Skeleton-level optimization module: used to construct a multi-scale semantic skeleton loss function, supervise the generation of language skeleton labels for each video to be described, and perform language skeleton-level optimization on the video description text.
[0069] In a third aspect of the present invention, an electronic device is disclosed, comprising: at least one processor, at least one memory, a communication interface and a bus;
[0070] Wherein, the processor, memory, and communication interface communicate with each other via the bus;
[0071] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the method according to the first aspect of the present invention.
[0072] According to a fourth aspect of the present invention, a computer-readable storage medium is disclosed, wherein the computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to implement the method described in the first aspect of the present invention.
[0073] Compared with the prior art, the present invention has the following beneficial effects:
[0074] 1) The present invention introduces a video action recognition predictor branch to extract high-level action information from the input video frames, dynamically utilizes the multi-classification results of the action information, reduces the impact of low-level erroneous action information on description generation, and strengthens the semantic connection between visual words by injecting robust control signals, solving the problem of limited understanding of video actions with complex context dependencies, and helps to improve the understanding of video behavior action information, thereby improving the accuracy of the generated description on the language skeleton words.
[0075] 2) The present invention designs a non-autoregressive text decoding framework, which can effectively optimize the action prediction loss and reduce the inconsistency in the generated sentences by acquiring multi-level visual representations of different granularities and associating them with language counterparts. The present invention has conducted extensive experiments on the MSVD and MSR-VTT datasets, verifying that the model proposed by the present invention has high reasoning efficiency, and the integration strategy of multi-level visual representations at different granularities has reliable and coherent subtitle generation capabilities. The present invention is the first non-autoregressive video word description to pay attention to the important connection between high-level action information and visual objects.
[0076] 3) The present invention designs a dual-scale bidirectional video-text alignment method, which constructs language skeleton labels by generating visual words. By collaboratively supervising the generated language skeleton labels, the interdependence of visual words within the label group and the independence between different label groups are improved, and the video description sentences are optimized from the skeleton level, so that the model has a better ability to perceive visual objects and action information. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0078] Figure 1 A flow chart of a method for describing a video based on motion perception according to the present invention;
[0079] Figure 2 This is a schematic diagram of the network model structure adopted by the motion-aware video description method of the present invention. DETAILED DESCRIPTION
[0080] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0081] Traditional video description ignores the impact of action information in the video on description generation. For videos with complex content, there are multiple completely unrelated events, and the visual information of a single frame cannot represent the cohesive information of the entire video. The single-frame semantic information construction method may cause errors when semantically modeling the visual word sequence in the target language. Therefore, the present invention proposes a non-autoregressive language skeleton optimization video description method based on action perception with the ability to perceive high-level action information, reduces the misleading of low-level action information to the video description, and uses this method to optimize the generated video description from the language skeleton level.
[0082] See also Figure 1 , Figure 2 , Figure 1 This is a flow chart of a video description method based on motion perception proposed by the present invention. Figure 2 Shown is a schematic diagram of the network model structure adopted by the video description method of the present invention.
[0083] like Figure 1 As shown, the present invention proposes a video description method based on action perception, comprising:
[0084] S1. Obtain multiple videos to be described, extract the two-dimensional image features and three-dimensional motion features of each video to be described respectively, and input them into the encoder for feature encoding and feature splicing to obtain the original visual features of each video to be described.
[0085] like Figure 2 As shown, step S1 specifically includes the following sub-steps:
[0086] S11. Take multiple videos to be described, and extract K video frames as representative frames from each video to be described according to the average sampling principle.
[0087] S12, sort the K video frames in time, input the convolutional neural network to extract the 2D and 3D features of the video to be described, and set v k represents the feature of the kth frame, then the 2D feature of the video to be described is expressed as The 3D feature representation is
[0088] S13, the 2D and 3D features are sent to the encoder for encoding and then concatenated. The encoder calculation process is as follows:
[0089]
[0090] in, V v =V a or V m , BN is the batch normalization operation, σ is the sigmoid function, d v and d m is the dimension before and after encoding, W e1 ,W e2 ,W e3 are the corresponding weights.
[0091] Finally, the original visual features are obtained by splicing
[0092] S2. Input the original visual features into an action recognition predictor to predict the main action behavior information of each video to be described, and obtain action semantic features.
[0093] In order to correct the shortcoming of using erroneous semantic information of a single frame of video to construct semantic associations between visual words of the target language, and referring to the method of directly compressing complete visual information as a supplement to the visual domain information of the decoder, the present invention proposes a new action recognition predictor, which compresses the complete video, predicts the semantics of its main behavior, and serves as a length predictor and a supplement to the text domain information of the decoder.
[0094] Step S2 specifically includes the following sub-steps:
[0095] S21. First, build an action corpus A based on the complete data set corpus * , which contains all possible action types of multiple sample videos, each video is associated with at least one of the action types. * It is expressed as:
[0096]
[0097] M represents the number of verbs in the corpus, c = 1, 2, ..., M. If the sample video is related to action c, then If not relevant,
[0098] S22. Construct a linear predictor to output the multi-label prediction probability of the action in the video to obtain higher-level action semantic information A. The linear predictor formula is expressed as follows:
[0099] A=f AP (R v )=Sigmoid(ReLU(MP(R v )W v1 )W v2 ),
[0100]
[0101] Among them, R v represents the original visual features, f AP (·) represents the function of the linear predictor, W v1 , W v2 , W v3 are the network weights of the linear predictor, MP(·) represents the average pooling operation, and N represents the preset maximum sentence length; ReLU(·) is the activation function, Sigmoid(·) is the Sigmoid function; Concat(·) is the feature concatenation function, which is used to repeat A multiple times and concatenate it to align the dimensions. It is the result of splicing the main action behavior information.
[0102] S23. Action Corpus A * There is a serious long-tail problem. The loss function of the action recognition predictor is designed by increasing the confidence of the positive sample labels of the sample video instead of reducing the confidence of the negative samples in the word sampling. To improve the confidence of the positive sample label:
[0103]
[0104] Among them, a c Represents the action type prediction value.
[0105] S24, use linear mapping to constrain the output length of the main action behavior information A, keep the output of the action recognition predictor consistent with the input dimension of the decoder, and repeat the conversion dimension N m Second, we get the corresponding action semantic features. It is expressed as:
[0106]
[0107]
[0108] N m Indicates the maximum length of the text encoding, W a3 is the weight parameter of the linear mapping, They are The N elements represent different action semantic features.
[0109] The present invention introduces an action recognition predictor to extract high-level action information from input video frames, dynamically utilizes the multi-classification results of action information, reduces the impact of low-level erroneous action information on description generation, and strengthens the semantic connection between visual words by injecting robust control signals, solves the problem of limited understanding of video actions with complex context dependencies, helps to improve the understanding of video behavior action information, and thus improves the accuracy of the generated description on language skeleton words (i.e., visual objects and action predicates).
[0110] S3. Fusing the original visual features with the action semantic features output by the action recognition predictor to obtain the action fused visual features of each video to be described.
[0111] Represents the feature fusion between matrices or vectors, and the original visual feature is R v , the high-level action semantic features are Then the action fusion visual features can be expressed as
[0112] S4. Input the action-fused visual features into the length predictor to predict the length distribution probability of the video description text to be generated, and generate the video description text through a non-autoregressive decoder.
[0113] Unlike autoregressive methods, non-autoregressive methods generate terminal symbols. <eos>Therefore, a length predictor (LP) is introduced to predict the length distribution.
[0114] S41. Build a length predictor to solve the problem that the non-autoregressive method cannot stop automatically when encountering the terminator, and constrain the original visual feature R generated by the encoder v The length of , the length predictor is expressed as:
[0115]
[0116] in, is the predicted length distribution, W l1 , W l2 are the network weights of the length predictor, and Softmax(·) is the Softmax function.
[0117] S42. Given a true value length distribution L * , L * The tth value of Represents the probability of a sentence of length t and constructs the loss function of the length predictor To minimize L and L * The difference in KLD length between:
[0118]
[0119] Among them, l t is the probability of a sentence of length t in L.
[0120] S43. Using length loss function Constrained length predictor predicts the length distribution probability of the video description text to be generated.
[0121] S44, inputting the action fusion visual feature and the text feature sequence encoded by the text encoder into the non-autoregressive decoder, and generating the video description text through the non-autoregressive decoder.
[0122] The non-autoregressive decoder of the present invention comprises a self-attention layer, a cross-attention layer and a feedforward layer, wherein the self-attention layer adopts a masked multi-head self-attention mechanism, and the cross-attention layer adopts a multi-head attention mechanism. The present invention uses a non-autoregressive decoder to perform information interaction between visual and language modalities and outputs the probability of generating a word.
[0123] Specifically, the standard BERT network is used as the text encoder, given a true value sequence Y * , randomly replace some words with <mask>Mark (α follows a uniform distribution, ranging from β 1 To β 2 , so that the network is trained with examples of varying difficulty), we obtain an observation sequence Y obs and an unobserved mask sequence Y mask =Y * \Y obs , the observation sequence Y obs That is, the text feature sequence corresponding to the sample video in the data set is encoded by the text encoder. The fused visual feature R v and text feature sequence Y obs Input non-autoregressive decoder, non-autoregressive decoder generates mask sequence Y mask Probability The formula is:
[0124]
[0125] Among them, f dec (·) represents the decoding function of the non-autoregressive decoder; y m is the mask sequence Y mask The words in .
[0126] The non-autoregressive decoder of the present invention adopts a noise parallel decoding strategy: first, the first B lengths are selected from the model prediction length L as candidates, and then B candidate sentences are generated in parallel; then, an autoregressive model AR-B with the same function is used to re-score the B candidate sentences, and AR-B is an independently trained autoregressive baseline model with the same structure as the original model; finally, the sentence with the highest confidence score among the B candidate sentences is selected as the final hypothesis.
[0127] The loss function of the non-autoregressive decoder is to minimize the negative log-likelihood loss function
[0128]
[0129] in, Stands for action fusion visual features.
[0130] The present invention uses a non-autoregressive decoder to perform information interaction in language and visual modalities on the input text features and action-fused visual features, learn and limit the length of the output text sequence, predict other sentence components outside the language skeleton, and generate a complete video description text. This non-autoregressive text decoding framework can effectively optimize the action prediction loss and reduce the inconsistency in the generated sentences by obtaining multi-level visual representations of different granularities and associating them with their language counterparts.
[0131] S5, fusing the action with visual feature input and a specially marked empty sequence visual word decoder to generate visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described.
[0132] Step S5 specifically includes the following sub-steps:
[0133] S51. Given a length of N g The true value sequence Y * ,use <mask>Replace the true value sequence Y * special words in the string, and get a corresponding target sequence The formula is as follows:
[0134]
[0135] Among them, POS(·) represents the part of speech of a word. The special words here are all words except nouns and verbs.
[0136] S52. Build a special tag with the same <vis>empty sequence of Will Fusion of visual features and motion They are input together into the visual word decoder to generate a visual word sequence, which includes nouns and verbs.
[0137] S53. Constructing the loss function of the visual word decoder as follows:
[0138]
[0139] in, Generate target sequence Y for the visual word decoder vis probability.
[0140] S54. Given a complete truth-value language skeleton The true value language skeleton Y is transformed into vis Mapped to a fixed-length visual phrase Convert visual phrases G to ground-truth language skeleton labels S.
[0141] The calculation formula of the visual phrase G is as follows:
[0142]
[0143]
[0144] Where Q = R v W q , PE means position encoding, d k is the matrix K 0 The dimension, M 0 is a 2K×N g The matrix is designed to ease <mask>The effect of alignment is that each row vector for:
[0145]
[0146] Through the above processing, a fixed-length visual phrase G is obtained. The visual phrase G is converted into a true-value language skeleton label S. For example, the vector g in G i Make splicing Get a fixed-length visual word sequence label as the true value language skeleton label S, and convert the variable-length predicted language skeleton label to the same dimensional space.
[0147] S55: Use the same method as step S54 to obtain the predicted language skeleton label S pre .
[0148] S56. Construct skeleton label loss function Constrain the predicted language skeleton label S pre The difference between the true language skeleton label S is:
[0149]
[0150] in, K is the number of representative frames extracted from the video to be described, d m is the dimension after feature encoding.
[0151] S6. Construct a multi-scale semantic skeleton loss function to supervise the generation of language skeleton labels for each video to be described, and optimize the video description text at the language skeleton level.
[0152] The multi-scale semantic skeleton loss function of the present invention integrates multiple scales including language grammar, language skeleton, text length, visual semantics, action semantics and modality alignment, and optimizes the predicted video description text from multiple directions and scales.
[0153] Skeleton-level labels focus on the distribution within the label. Although S provides the uniqueness required for the true value label, it still cannot introduce the relationship between visual words in different positions. In order to make S have rich internal dependencies, certain constraints need to be imposed on the label generation process. Artificially give the label generated in the previous step a physical meaning, that is, a visual phrase G represents a video frame, specifically g i Represents v i ∈R v Therefore, vision-language alignment is a reasonable constraint to ensure the interdependence between skeleton labels. The present invention proposes a dual-scale bidirectional video-text alignment method, where "dual scale" refers to two different scales within a skeleton label group and between skeleton label groups, and "bidirectional" refers to two different directions: text-video and video-text.
[0154] Step S6 specifically includes the following sub-steps:
[0155] S61, Alignment within skeleton tags.
[0156] S611, shorten g using cosine similarity i and v i The distance between them realizes the alignment of positive sample frames and visual phrases. The formula is as follows:
[0157]
[0158] S612: Although the redundant continuous frame problem of the video is alleviated by the frame sampling method, the problem still exists after alignment due to a large number of similar visual phrases. i ∈G, g j ∈G is regarded as a negative sample, and the skeleton label alignment loss function for video-to-text and text-to-video is constructed.
[0159] The loss function formula for alignment within the skeleton label is as follows:
[0160]
[0161]
[0162] in, They are the text-to-video and video-to-text alignment losses within the language skeleton label of the same video to be described.
[0163] S62. Alignment between skeleton labels.
[0164] S621, in order to distinguish the difference between similar descriptions and corresponding similar videos, first calculate the positive sample pairs (G k ,(R v ) k ) k and (R v ) k They correspond to each other.
[0165]
[0166] S622, then (G k ,(R v ) m ) is regarded as a negative sample pair, G k and (R v ) m The optimization goal of the loss function for aligning skeleton labels is to increase cos(G k ,(R v ) k ), reduce cos(G k ,(R v ) m ), the larger the cosine similarity value is, the more similar the two are.
[0167] The loss function formula for alignment between skeleton labels is as follows:
[0168]
[0169]
[0170] are the text-to-video and video-to-text alignment losses between skeleton labels of different videos to be described, v i ∈R v , g i ∈G; G is the visual phrase corresponding to the current video to be described, G k , G m represent the visual phrases corresponding to the kth and mth videos to be described, respectively, B is the total number of videos to be described, (R v ) k , (R v ) m Represents the original visual features of the k-th video to be described.
[0171] S63. Combining the above two loss functions, we get a dual-scale bidirectional loss function
[0172]
[0173] S64. Sum up all the loss functions to obtain a multi-scale semantic skeleton loss function that integrates language grammar, language skeleton, text length, visual semantics, action semantics and modality alignment.
[0174] The formula of the multi-scale semantic skeleton loss function is:
[0175]
[0176] in, is the multi-scale semantic skeleton loss function; is the loss function of the length predictor; is the loss function of the non-autoregressive decoder; is the loss function of the visual word decoder; is the skeleton label loss function; is the loss function of the action recognition predictor; is a dual-scale bidirectional loss function used to perform visual-linguistic alignment constraints within the language skeleton labels of the same video to be described and between the language skeleton labels of different videos to be described; λ 1 , 2 , 3 is the weight coefficient.
[0177] The present invention adds a branch design of behavior prediction in the video description task to extract high-level action semantic information in the complete video, and accumulates the prediction results to the input of the length predictor and decoder respectively, limits the length of the description text generated by the non-autoregressive method, and corrects the erroneous constraints on the decoder caused by the low-level action information extracted from the skeleton tag generator. This improves the video description text to contain more video action information.
[0178] Through the additional optimization of the method, the present invention completes the whole process of semantic optimization of visual word sequences. The present invention introduces an action guidance branch to determine the appropriate action, thereby reducing the impact of the wrong action that may be indicated by some frames on the video description. The present invention can obtain higher-level action information in the video description task, optimize the selection of predicate verbs in the generated text, and thus obtain a more accurate video description.
[0179] The present invention optimizes the description text at the language skeleton level by generating visual words and language skeleton tags. The method proposed in the invention combines a skeleton tag generator to refine the semantic correlation between visual words and a video action recognition predictor to correct verb errors, which helps to generate fine-grained descriptive subtitles.
[0180] The method proposed in the present invention has the ability of motion perception, can more fully learn and understand high-level motion information in the video, and reduce the impact of low-level erroneous motion information in the video. Visual words help to improve the understanding of key object information and motion information in the video to be described. The combination of language skeleton labels and dual-scale bidirectional alignment methods helps to capture more intra-video dependencies and inter-video differences, and optimizes the description text sentences from the language skeleton level, thereby improving the precision of the generated video description.
[0181] Corresponding to the above method embodiment, the present invention further proposes a video description system based on action perception, the system comprising:
[0182] Encoder module: used to obtain multiple videos to be described, extract the two-dimensional image features and three-dimensional motion features of each video to be described, and input them into the encoder for feature encoding and feature splicing to obtain the original visual features of each video to be described;
[0183] Action recognition predictor module: used for inputting the original visual features into the action recognition predictor, predicting the main action behavior information of each video to be described, and obtaining action semantic features;
[0184] Feature fusion module: used for fusing the original visual features with the action semantic information to obtain the action fusion visual features of each video to be described;
[0185] Description text generation module: inputting the action fusion visual features into a length predictor, predicting the length distribution probability of the video description text to be generated, and generating the video description text through a non-autoregressive decoder;
[0186] Skeleton label generation module: used for inputting the action fusion visual features into a visual word decoder, generating visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described;
[0187] Skeleton-level optimization module: used to construct a multi-scale semantic skeleton loss function, supervise the generation of language skeleton labels for each video to be described, and perform language skeleton-level optimization on the video description text.
[0188] The above system embodiments and method embodiments correspond one to one, and for a brief description of the system embodiments, please refer to the method embodiments.
[0189] The present invention adopts an iterative method when training the model, and uses a sentence-level iterative optimization algorithm to improve the quality of the generated expression. The main iterative method includes the following steps:
[0190] 1) Keep high confidence words and use <mask>Tokenize and replace relatively low-confidence words, and use this method to create a new sequence;
[0191] 2) Using the newly generated sequence as the input of the decoder head layer in the second decoding pass, the effective information from the secondary decoding input is expected to produce more accurate decoding results;
[0192] 3) Repeat the above two steps multiple times until a predetermined number of iterations is reached.
[0193] The method of the present invention is verified below in combination with specific experimental data.
[0194] In order to verify the effectiveness of the method proposed in this paper, the ablation experiment in Table 1 is used to compare the performance of the two video language alignment methods at different scales, where "Skeleton", "Intra", "Inter" and "AP" represent skeleton labels, intra-label alignment, inter-label alignment and action recognition predictor, respectively, and B-4, M and C represent BLEU-4, METHOR and CIDEr, respectively, which are evaluation indicators. MSVD and MSR-VTT are two different video datasets.
[0195] Table 1
[0196]
[0197] As can be seen from the first three rows of Table 1, both intra-label alignment and inter-label alignment help to enhance the dependencies between visual words. In addition, the semantic information embedded in the skeleton labels, rather than more direct language grammatical rules, is shown to be beneficial to non-autoregressive methods. Comparing the fourth row with the second and third rows, solving the redundancy problem within the skeleton labels and distinguishing similar skeleton labels can improve the results at different scales while maintaining efficiency. The last row in the table shows the significant effectiveness of the method. The proposed method combines the skeleton label generation module to refine the semantic correlation between visual words and action recognition predictors to correct verb errors, which helps to generate fine-grained descriptive captions.
[0198] The present invention Figure 2 The network model shown is named ALSO-Net. In order to further evaluate the importance of the network model ALSO-Net method proposed in the present invention, several ablation experiments in Table 2 are used to demonstrate the importance of each component in the model.
[0199] Table 2
[0200]
[0201] The evaluation results are shown in Table 2, where "appearance" indicates that the corresponding component is an appearance feature, and "motion" indicates that the component is a motion feature. The ALSO-Net method reports four types of results: "w / o AP", obtained by using only the action recognition predictor; "w appearance" and "w motion", obtained by using image features and motion features respectively; "w both" is obtained by using both visual features and action recognition predictors.
[0202] Experimental results show that using a single feature, either appearance or motion, combined with an action recognition predictor can limit the expressiveness of the model and degrade the overall performance. However, when both features are used together for action prediction, the model shows a more significant improvement in performance.
[0203] The present invention also discloses an electronic device, comprising: at least one processor, at least one memory, a communication interface and a bus; wherein the processor, memory, and communication interface communicate with each other through the bus; the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the aforementioned method of the present invention.
[0204] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to implement all or part of the steps of the method described in the embodiment of the present invention. The storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk, and other media that can store program codes.
[0205] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be distributed to multiple network units. A person skilled in the art may select some or all of the modules according to actual needs to achieve the purpose of the solution of this embodiment without creative effort.
[0206] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.< / mask> < / mask> < / vis> < / mask> < / mask> < / eos> < / vis> < / mask>
Claims
1. A video description method based on motion perception, characterized in that: The method comprises: Acquire multiple videos to be described, extract the two-dimensional image features and three-dimensional motion features of each video to be described respectively, and input them into an encoder for feature encoding and feature splicing to obtain the original visual features of each video to be described; Inputting the original visual features into an action recognition predictor to predict the main action behavior information of each video to be described, and obtaining action semantic features; Performing feature fusion of the original visual features and the action semantic information to obtain action fused visual features of each video to be described; Inputting the action fused visual features into a length predictor, predicting the length distribution probability of the video description text to be generated, and generating the video description text through a non-autoregressive decoder; Inputting the action-fused visual features into a visual word decoder to generate visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described; A multi-scale semantic skeleton loss function is constructed to supervise the generation of language skeleton labels for each video to be described, and the video description text is optimized at the language skeleton level.
2. The method for describing a video based on motion perception according to claim 1, characterized in that: The prediction principle of the action recognition predictor is: Build an action corpus A * , A * It includes multiple sample videos and associated action types; Construct a linear predictor to predict the multi-label prediction probability of action behaviors in sample videos; Based on the action corpus A * Designing a loss function for action recognition predictor To improve the confidence of the positive sample labels of the sample video: in, c=1,2,…,M, M is the number of actions in the corpus; Indicates that the sample video is related to action c, Indicates irrelevant, a c represents the predicted value of the action recognition predictor; The original visual features are input into the linear predictor to predict the corresponding main action behavior information A. The linear predictor formula is expressed as follows: A=Sigmoid(ReLU(MP(R υ )W υ1 )W v2 ) Among them, R υ represents the original visual features, f AP (·) represents the function of the linear predictor, W υ1 , W v2 , W v3 are the network weights of the linear predictor, MP(·) represents the average pooling operation, N represents the preset maximum sentence length, and d m is the dimension after feature encoding; ReLU(·) is the activation function, Sigmoid(·) is the Sigmoid function; Concat(·) is the feature concatenation function, It is the result of splicing the main action behavior information; Use linear mapping to constrain the output length of the main action behavior information A to obtain the corresponding action semantic features 3. The method for describing a video based on motion perception according to claim 2, characterized in that: The prediction principle of the length predictor is: Build a length predictor to learn the original visual features R generated by the encoder v The length of , the length predictor is expressed as: in, is the predicted length distribution, represents matrix or vector addition, represents the action fusion visual feature, W l1 , W l2 are the network weights of the length predictor, Softmax(·) is the Softmax function; Given a true length distribution L * , L * The tth value of Represents the probability of a sentence of length t and constructs the loss function of the length predictor To minimize L and L * The KLD length difference between: Among them, l t is the probability of a sentence of length t in L; Using the length loss function Constrained length predictor predicts the length distribution probability of the video description text to be generated.
4. The method for describing a video based on motion perception according to claim 2, characterized in that: The non-autoregressive decoder comprises a self-attention layer, a cross-attention layer and a feedforward layer, wherein the self-attention layer adopts a masked multi-head self-attention mechanism, and the cross-attention layer adopts a multi-head attention mechanism; The generating of the video description text by the non-autoregressive decoder specifically includes: The non-autoregressive decoder generates the mask sequence Y using a non-autoregressive method mask The probability of using noise parallel decoding strategy to generate video description text; The non-autoregressive decoder generates the mask sequence Y using a non-autoregressive method mask Probability The formula is: Among them, f dec (·) represents the decoding function of the non-autoregressive decoder; Y mask is the mask sequence, Y mask =Y * \Y obs , Y * is a true value sequence, Y obs is the observation sequence, y m is the mask sequence Y mask words in; The loss function of the non-autoregressive decoder is to minimize the negative log-likelihood loss function Stands for action fusion visual features.
5. The method for describing a video based on motion perception according to claim 3, characterized in that: The step of inputting the action fused visual features into a visual word decoder to generate visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described specifically includes: Given a length of N g The true value sequence Y * ,use <mask>Replace the true value sequence Y * The special words in get the target sequence The special words refer to all words except nouns and verbs;< / mask> Construct a file with the same special tag <vis>empty sequence of Will Fusion of visual features and motion The two are input together into the visual word decoder to generate a visual word sequence, which includes nouns and verbs.< / vis> Constructing the loss function for the visual word decoder as follows: in, Generate target sequence Y for the visual word decoder vis The probability of Given a complete truth-value language skeleton The true value language skeleton Y is transformed into vis Mapped to a fixed-length visual phrase Convert visual phrase G into ground-truth language skeleton label S; The generated visual word sequence is mapped to a fixed-length language skeleton label through the attention mechanism to obtain the predicted language skeleton label S pre ; Constructing skeleton label loss function Constrain the predicted language skeleton label S pre The difference between the true language skeleton label S is: in, K is the number of representative frames extracted from the video to be described, d m is the dimension after feature encoding.
6. The method for describing a video based on motion perception according to claim 5, characterized in that: The formula of the multi-scale semantic skeleton loss function is: in, is the multi-scale semantic skeleton loss function; is the loss function of the length predictor; is the loss function of the non-autoregressive decoder; is the loss function of the visual word decoder; is the skeleton label loss function; is the loss function of the action recognition predictor; is a dual-scale bidirectional loss function, which is used to perform visual-linguistic alignment constraints within the language skeleton labels of the same video to be described and between the language skeleton labels of different videos to be described; λ1, λ2, and λ3 are weight coefficients.
7. The method for describing a video based on motion perception according to claim 6, characterized in that: The dual-scale bidirectional loss function The calculation formula is: in, is the alignment loss within the language skeleton label of the same video to be described, is the alignment loss between skeleton labels of different videos to be described, v i ∈R v , g i ∈G; G is the visual phrase corresponding to the current video to be described, G k , G m represent the visual phrases corresponding to the kth and mth videos to be described, respectively, B is the total number of videos to be described, (R v ) k , (R v ) m Represents the original visual features of the k-th video to be described.
8. A video description system based on motion perception, characterized in that: The system comprises: Encoder module: used to obtain multiple videos to be described, extract the two-dimensional image features and three-dimensional motion features of each video to be described, and input them into the encoder for feature encoding and feature splicing to obtain the original visual features of each video to be described; Action recognition predictor module: used for inputting the original visual features into the action recognition predictor, predicting the main action behavior information of each video to be described, and obtaining action semantic features; Feature fusion module: used for fusing the original visual features with the action semantic information to obtain the action fusion visual features of each video to be described; A description text generation module: used for inputting the action fusion visual features into a length predictor, predicting the length distribution probability of the video description text to be generated, and generating the video description text through a non-autoregressive decoder; Skeleton label generation module: used for inputting the action fusion visual features into a visual word decoder, generating visual words, and mapping the visual words into language skeleton labels corresponding to the video to be described; Skeleton-level optimization module: used to construct a multi-scale semantic skeleton loss function, supervise the generation of language skeleton labels for each video to be described, and perform language skeleton-level optimization on the video description text.
9. An electronic device, characterized in that: include: at least one processor, at least one memory, a communication interface, and a bus; Wherein, the processor, memory, and communication interface communicate with each other via the bus; The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions enable a computer to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-feature fusion and time-space attention mechanism combination-based video description method
CN108388900A
A video description method and system based on an information loss function
CN109684912A
Model training method and related equipment
CN114676234A
Video description method and device based on sentence semantics and storage medium
CN114817637A
Concept-conditioned and pretrained language models based on time series to free-form text description generation
US20240061998A1
