Video description method based on visual context sparse regularization and implicit attention

By combining visual context sparse regularization and hidden attention mechanisms with a visual-language dual-branch network, the problem of learning visual and linguistic features in video description generation models is solved, achieving higher quality video description generation.

CN118397509BActive Publication Date: 2026-11-24JINGGANGSHAN UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410575636.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-10
Publication Date
2026-11-24
Estimated Expiration
2044-05-10

AI Technical Summary

Technical Problem

Existing video description generation models struggle to effectively learn visual and linguistic features during training and testing, resulting in insufficient fluency and accuracy in the generated descriptions.

Method used

We employ visual contextual sparse regularization and implicit attention mechanisms, and use a visual-language dual-branch network to perform sparse regularization and semantic alignment of multimodal features. We then use a visual implicit attention branch network and a language implicit attention branch network to fuse features and generate video descriptions.

Benefits of technology

It improves the accuracy and fluency of video descriptions, generating more accurate and semantically rich descriptions, and exhibiting better performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397509B_ABST
    Figure CN118397509B_ABST
Patent Text Reader

Abstract

This invention relates to a video description method based on visual context sparse regularization and latent attention, comprising the following steps: extracting visual features of the video to be described and linguistic features of all manually annotated text statements in the current video; generating a blank-filling sequence, encoding the extracted visual features and the blank-filling sequence to obtain visual context features and pseudo-text context features; concatenating the pseudo-text context features and visual context features along the sequence length to obtain sparse regularized context features; feeding the sparse regularized visual context features, visual features, and linguistic features as input into a video description generation model to obtain the word probability output at each current time step, merging all generated words in time step order to obtain the final description statement for the current video to be described. Compared with existing technologies, the linguistic description generated by this invention has advantages such as high accuracy and rich semantics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of video description generation, and in particular to a video description method based on visual context sparse regularization and latent attention. Background Technology

[0002] Video description generation is a complex process that aims to automatically generate natural language descriptions of video content using computer algorithms. Currently, most popular works combine visual and linguistic features and represent them in a dense multimodal feature space, such as the video commonsense knowledge reasoning implementation method based on multimodal fusion disclosed in patent application CN113869324A. This means the model can only learn general, coarse-grained category features rather than unique, fine-grained features specific to different samples. Furthermore, the model is prone to overfitting during training, impairing its generalization ability. On the other hand, learning directly from a complex and dense multimodal feature space leads to a focus on modeling the relationship between visual and linguistic features, relatively weakening the model's ability to generate final text during the decoding stage. This significantly impacts the accuracy of the generated descriptions in terms of vocabulary and the overall fluency of the sentences. Summary of the Invention

[0003] The purpose of this invention is to overcome the shortcomings of existing models in the training and testing process, which are difficult to learn complex multimodal features composed of visual information and linguistic semantics. Instead, it provides a video description method based on visual context sparse regularization and latent attention to improve the fluency and accuracy of the final generated video title sentences.

[0004] The objective of this invention can be achieved through the following technical solutions:

[0005] A video description method based on visual context sparse regularization and latent attention includes the following steps:

[0006] Extract the visual features of the video to be described and the linguistic features of all manually annotated text statements in the current video;

[0007] Generate a blanking sequence aligned with the length of the manually annotated text statement in the current video to be described, and encode the extracted visual features and blanking sequence to obtain visual context features and pseudo-text context features;

[0008] The pseudo-text context features and visual context features are concatenated along the sequence length method to obtain sparse regularized context features.

[0009] The sparse regularized visual context features, visual features, and linguistic features are fed into the video description generation model as input. The video description generation model obtains the word probability output at each current time step. Finally, all generated words are merged in time step order to obtain the final description of the video to be described. The video description generation model is a visual-language hidden attention dual-branch network decoding structure.

[0010] Furthermore, the visual features are extracted using a visual converter network pre-trained on a large-scale image and text dataset.

[0011] Furthermore, the language features are obtained based on the embedded feature vectors obtained after encoding each labeled word in all manually labeled text sentences.

[0012] Furthermore, the video description generation model includes a visual hidden attention branch network and a language hidden attention branch network, both of which have a hidden attention mechanism. The hidden attention mechanism refers to combining the sparse regularized context features with the preceding hidden states in each branch network and performing multimodal semantic alignment.

[0013] Furthermore, the visual latent attention branch network takes the output processed by the latent attention mechanism and the spliced ​​features of video features as input, and the language latent attention branch network takes the output processed by the latent attention mechanism and the spliced ​​features of language features as input.

[0014] Furthermore, both the visual latent attention branch network and the language latent attention branch network are constructed based on long short-term memory networks.

[0015] Furthermore, the video description generation model is optimized and trained using a joint training method involving factorization structure and non-factorization structure.

[0016] Furthermore, at each time step, the visual latent attention branch network and the language latent attention branch network output their respective word probability distributions, and the final word probability output is obtained by weighted fusion.

[0017] Furthermore, the visual features are generated by a visual spatiotemporal correlation encoder to produce the visual context features, and the blanking sequence is generated by a pseudo-visual feature encoder to produce the pseudo-text context features.

[0018] Furthermore, both the visual spatiotemporal correlation encoder and the pseudo-visual feature encoder are encoders with a multi-head self-attention mechanism.

[0019] Compared with the prior art, the present invention has the following beneficial effects:

[0020] I. Compared with other popular video description methods, the method of this invention avoids learning from dense modal features by using sparse regularization, and performs semantic attention and alignment on multimodal features through hidden attention mechanism to achieve semantic compensation and improve the accuracy of video description.

[0021] Second, this invention designs a visual-language latent attention dual-branch network for video description generation tasks. It successfully models the relationships between feature information from different modalities and can extract important features at the current time step, reducing interference from redundant information and enabling the model to bridge the gap between visual and linguistic modalities. This invention fuses the output probabilities of the two branches using a weighted average, utilizing more comprehensive information to further improve the accuracy and semantics of the generated sentences.

[0022] Third, multiple experiments have demonstrated that the present invention achieves better performance than other similar models, specifically in that it can generate more accurate, fluent, and semantically richer video description statements. Attached Figure Description

[0023] Figure 1 This is a schematic diagram of the main steps of the present invention;

[0024] Figure 2 A schematic diagram of the sparse regularized context feature generation process;

[0025] Figure 3 A schematic diagram of the visual latent attention feature generation process;

[0026] Figure 4 A schematic diagram illustrating the principle of the hidden attention mechanism in the video description generation model;

[0027] Figure 5 This is a schematic diagram of the video description generation model during the decoding stage. Detailed Implementation

[0028] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.

[0029] This embodiment provides a video description method based on visual context and latent attention (SRVC-LA), comprising: extracting visual features of the current video to be described and linguistic features of all manually annotated text statements in the current video; creating a blanking sequence aligned with the length of the manually annotated statements in the current video; encoding the extracted visual features and blanking sequence using an encoder to obtain visual context features and pseudo-text context features; concatenating the pseudo-text context features and visual context features along the sequence length to obtain sparsely regularized context features; and feeding the sparsely regularized visual context features, visual features, and linguistic features as input to a video description generation model; obtaining the word probability output at each current time step through the video description generation model; and finally merging all generated words in time step order to obtain the final description statement of the current video to be described. The video description generation model includes a visual-linguistic dual-branch latent attention network, which combines the sparsely regularized context features with the preceding hidden states through a latent attention mechanism for multimodal semantic alignment.

[0030] like Figure 1 As shown, the specific process of the above video description method includes:

[0031] Step 1: Extract features from the current input video, extract features from the manual annotation language description corresponding to the current video, and create the corresponding blank filling sequence.

[0032] In this embodiment, the specific process includes:

[0033] 11) Edit the current video to be described to obtain a certain number of video frames, and create a blank fill sequence with corresponding shapes and zero elements as fill;

[0034] 12) The video frames are used as input and fed into a visual converter network (Contrastive Language-Image Pre-Training, CLIP) pre-trained on a large-scale image and text dataset for feature extraction to obtain visual features. All words in the manually annotated description sentences are encoded to obtain embedded language feature vectors as language features.

[0035] Step 2: Construct a visual spatiotemporal correlation encoder and a pseudo-visual feature encoder to encode visual features and blank-filling sequences respectively, in order to obtain sparse regularized context features.

[0036] In this embodiment, the visual spatiotemporal correlation encoder (encoding network) takes the visual features of the extracted video frames as input, and the pseudo-visual feature encoder takes the linguistic features of the manually annotated sentences as input, and encodes them respectively to obtain visual context features and pseudo-text context features.

[0037] Both the visual spatiotemporal correlation encoder and the pseudo-visual feature encoder are encoders with multi-head self-attention mechanisms, and their structures are referenced from... Figure 2 As shown, each includes a feature embedding unit, a multi-head self-attention unit, a first point addition and regularization unit, a feedforward propagation unit, and a second point addition and regularization unit arranged sequentially.

[0038] Taking visual information encoding as an example, the specific calculation formula for the encoding process is as follows:

[0039]

[0040] in W is a learnable weight matrix used to transform the query vector (Q), key vector (K), and value vector (V) in the input, respectively. o This is another learnable weight matrix used for output vector transformation. FFN() and Con() represent the feedforward neural network and connection operation functions, respectively. Att i () represents the i-th attention head (1≤i≤8), and its formula is as follows:

[0041]

[0042] Among them, VR q VR k and VR v d represents the visual feature vectors of the query, key, and value, respectively, where d is the feature dimension.

[0043] like Figure 2 As shown, visual features are generated into visual context features through a visual spatiotemporal association encoder; simultaneously, a whitespace-padded sequence of the same length as the corresponding sentence is passed through a pseudo-visual feature encoder to generate pseudo-textual context features. Then, the two are connected using a deep connection to obtain sparse regularized visual context features (SRVC).

[0044] Step 3: Based on sparse regularized visual context features, visual features, and linguistic features, video description generation is achieved through a video description generation model.

[0045] In this embodiment, the video description generation model includes a visual-language latent attention dual-branch decoding network, specifically comprising a visual latent attention branch network and a language latent attention branch network, both equipped with a latent attention mechanism. The latent attention mechanism refers to combining the sparse regularized context features with the preceding hidden states in each branch network and performing multimodal semantic alignment. Both the visual and language latent attention branch networks are constructed based on Long Short-Term Memory (LSTM) networks; that is, each branch network includes an attention mechanism module and an LSTM network, denoted as LSTM1 and LSTM2, respectively. The visual latent attention branch network takes as input the sparse regularized context features (concatenated from visual and pseudo-context features obtained during the encoding stage) and the video features of the original video frames. The language latent attention network takes as input the sparse regularized context features and the language features obtained based on the embedding vectors of manually annotated sentences in the current video.

[0046] In this embodiment, the visual latent attention branch network and the language latent attention branch network are respectively constructed with a visual latent attention mechanism module and a language latent attention mechanism module, and the hidden layer state output h of the language decoding branch is... l With the hidden state output h in the visual decoding branch v The sparse regularized context features are concatenated together and fed into the constructed hidden attention mechanism module to obtain aligned multimodal context features. The multimodal context features are concatenated with the extracted visual features and language features to obtain the word probability distribution of each branch network. The final word probability output is obtained by weighted fusion.

[0047] During the training and testing phases of the video description generation model, at time step t, the sparse regularized context features are concatenated with the hidden state of the LSTM network to form the hidden state LSTM. t This is to provide attention within the attention mechanism, and to calculate the attention weights, such as... Figure 3 As shown.

[0048] The specific formula for this stage is as follows:

[0049] LS t =Con(SRVC,Com(H) 0:t-1 H pseudo )

[0050] Where SRVC is sparse regularized context features, the Com() function is used for feature combination, and H 0:t-1 It is the hidden state from time step 0 to the previous time step t-1, which remembers the previous high-level visual and linguistic information, while H pseudo It is a pseudo-hidden state used for alignment with SRVC.

[0051] Suppose a video has n visual features, H pseudo The size is nt. For LS t The combined tensor has a dimension of n×2d. Then, two linear layers are used to reduce the tensor dimension, resulting in an attention weight vector of dimension n×1. After transposing and performing a cross-dot product with SRVC, a latent attention feature of dimension 1×d is generated. The latent attention feature is generated at time step t. The formula is:

[0052]

[0053] Among them AW t These are the calculated attention weights.

[0054] Specifically, the process of video description using a visual-language dual-branch hidden attention network based on a hidden attention module includes:

[0055] 41) Visual hidden attention networks combine sparse regularized contextual features of the input with the preceding hidden states of LSTM1. The inputs are fed into the visual latent attention mechanism module, and then the output of the visual latent attention mechanism module is concatenated with the video features of the original video frames and fed into the current time step of LSTM1 as input; the language latent attention network combines the sparse regularized context features of the input with the preceding latent states of LSTM2. The inputs are fed into the language latent attention mechanism module, and then the output of the language latent attention mechanism module is concatenated with the embedded vector features of the manually annotated sentences in the video and fed into the current time step in LSTM2.

[0056] 42) The probability output O1 of the visual hidden attention network is obtained by passing the output of LSTM1 through a fully connected network F1; the probability output O2 of the language hidden attention network is obtained by passing the output of LSTM2 through a fully connected network F2; the probability output of the model's final prediction of the next word is obtained by weighted fusion of O1 and O2. Finally, all predicted words are combined in chronological order to generate a descriptive sentence.

[0057] like Figure 4 As shown, in the visual branch, the pseudo-hidden state (H) of the first time step is used. pseudo The sparse attention weight vector is generated by taking the true hidden state of the LSTM or LSTM at the previous time step. Based on these sparse attention weights and SRVC (Sparse Regularized Visual Context), a sparsely regularized visual attention context can be obtained to form an attentional representation of the visual context features. Then, the attention context and visual features are concatenated line by line to fully utilize global and local visual information (for convenience, the concatenated output is labeled as...). Then, the words predicted using LSTM1 are... For the language branch, the processing flow of the language attention context is similar to the branches described above, but the attention weight vector is calculated from the pseudo-hidden state of LSTM2 or the hidden state of LSTM. Next, the language attention context and features of individual words in the sentence are concatenated and combined at each time step. At that time step, the output of the branch using LSTM2 is...

[0058] like Figure 5 As shown, the output probabilities of the two branches are fused using a weighted average method, utilizing more comprehensive information to further improve the accuracy and semantics of the generated sentences. At each time step, the probability outputs of the two LSTM layers are weighted and fused to predict the current word output.

[0059] In this embodiment, the visual and linguistic hidden attention networks in the aforementioned visual-linguistic dual-branch hidden attention network employ a joint optimization strategy using factorization and non-factorization structures for joint training. This updates the entire model parameters and generates the final description. The joint optimization process involves adding a factorization structure loss function E1 and a non-factorization structure loss function E2 to the visual and linguistic branches of the video description generation model, respectively. The outputs of these two loss functions at each time step are then fused, and the probability outputs are weighted and summed. Finally, the two loss functions, E1 and E2, are used to jointly optimize the description generation part composed of the visual and linguistic branches.

[0060] In this embodiment, the training and optimization steps of the video description generation model include:

[0061] 51) Add a factorization loss function and a non-factorization loss function to the visual latent attention network and the linguistic latent attention network respectively, and use cross-entropy to calculate the error between the predicted words and the given manually labeled reference words.

[0062] For visual latent attention networks, at each time step, the loss error is calculated using the loss function E1 with the following factorization structure:

[0063]

[0064] Where |U| represents the batch size in one iteration, p vis () represents the probability output of the visual hidden attention network at this time step. It represents the j-th word output by the network branch in this iteration of training. Let V represent the input word sequence of length 1 to j, and let l represent the visual features of the input video frames. i This indicates the length of the entire sentence. θ vis =(θ v-enc ,θ v-ls ,θ lstm1 ), where θ v-enc θ represents the parameters used for visual temporal semantic representation in the encoder of the Visual Transformer network. v-ls This represents the parameters in the hidden attention mechanism module, while θ lstm1 These are parameters in LSTM1.

[0065] For language latent attention networks, at each time step, the loss error is calculated using the following non-factored loss function E2:

[0066]

[0067] Where, p lang () indicates the probability output of the language's hidden attention network at this time step. It represents the j-th word output by the network branch in this iteration of training, θ lang =(θ l-enc ,θ v-ls ,θ lstm2 ), where θ l-enc θ represents the parameters used for temporal semantic representation of language in the Transformer network encoder. v-ls This represents the parameters in the hidden attention mechanism module of this network branch, while θ lstm2 These are parameters in LSTM2.

[0068] 52) In the decoding stage, in the video description generation model, the parameters of the LSTM network and the hidden attention mechanism module in each hidden attention network are updated and optimized through the objective loss function on their respective branches. In the encoding stage, the parameters of the visual spatiotemporal association coding network and the pseudo-visual feature coding network are jointly optimized through the visual hidden attention network and the language hidden attention network, i.e., the loss E all =E1+E2.

[0069] If the above methods are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0070] To verify the performance of the method of the present invention, the following comparative experiment was designed.

[0071] In this embodiment, five models are used as comparison models, and the specific details are as follows:

[0072] (1)MC1(SRVC-LA(vi w / o Visual features are not fed as additional input into subsequent LSTM networks (e.g., LSTM1) and are not concatenated with hidden attention features for subsequent decoding steps.

[0073] (2) MC2(SRVC) w / o +LA w / o Remove the module used to generate sparse regularized visual context, as well as the hidden attention module, and replace the LSTM network (i.e., LSTM1 and LSTM2) with a converter network decoder for decoding.

[0074] (3) MC3(SRVC) w / o +LA w ): Remove the module used to generate sparse regularized visual contexts separately.

[0075] (4) MC4(SEVC) w +LA w / o Instead of using hidden attention mechanisms, the LSTM networks (i.e., LSTM1 and LSTM2) are replaced with converter network decoders for decoding.

[0076] (5)SRVC-LA: The model proposed in this invention.

[0077] The specific experimental results on the MSVD and MSR-VTT datasets are shown in Tables 1 and 2. The results demonstrate that the RMGT-MI2S model designed in this invention performs better, and also prove the important roles of the hidden attention mechanism, sparse regularization mechanism, and visual branch decoding network in the model.

[0078] Table 1. Performance (%) of each model on the MSVD dataset

[0079]

[0080]

[0081] Table 2. Performance (%) of each model on the MSR-VTT dataset

[0082] Model B-4 METEOR ROUGE_L CIDEr <![CDATA[MC1(SRVC-LA(vi w / o ))]]> 39.8 28.5 60.9 47.4 <![CDATA[MC2(SRVC w / o +LA w / o )]]> 27.2 23.5 51.4 36.6 <![CDATA[MC3(SRVC w / o +LA w )]]> 41.6 28.4 62.4 50.0 <![CDATA[MC4(SRVC w +LA w / o )]]> 30.6 24.6 54.0 38.8 SRVC-LA (This invention) 42.6 28.4 62.6 52.1

[0083] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A video description method based on visual context sparse regularization and implicit attention, characterized in that, Includes the following steps: Extract the visual features of the video to be described and the linguistic features of all manually annotated text statements in the current video; Generate a blanking sequence aligned with the length of the manually annotated text statement in the current video to be described, and encode the extracted visual features and blanking sequence to obtain visual context features and pseudo-text context features; The pseudo-text context features and visual context features are concatenated along the sequence length method to obtain sparse regularized context features. The sparse regularized visual context features, visual features, and linguistic features are fed into the video description generation model as input. The video description generation model obtains the word probability output at each current time step. Finally, all generated words are merged in time step order to obtain the final description of the current video to be described. The video description generation model is a visual-language hidden attention dual-branch network decoding structure. The video description generation model includes a visual hidden attention branch network and a language hidden attention branch network, both of which have hidden attention mechanisms. The hidden attention mechanism refers to combining the sparse regularized context features with the preceding hidden states in each branch network and performing multimodal semantic alignment. 2.The method of claim 1, wherein, The visual features are extracted using a visual converter network pre-trained on a large-scale image and text dataset. 3.The method of claim 1, wherein, The language features are obtained by encoding each labeled word in all manually annotated text sentences using embedded feature vectors. 4.The method of claim 1, wherein, The visual latent attention branch network takes the output processed by the latent attention mechanism and the spliced ​​features of video features as input, and the language latent attention branch network takes the output processed by the latent attention mechanism and the spliced ​​features of language features as input.

5. The method of claim 1, wherein, Both the visual latent attention branch network and the language latent attention branch network are based on long short-term memory networks.

6. The method of claim 1, wherein, The video description generation model is optimized and trained using a joint training method that combines factorization structure and non-factorization structure.

7. The method of claim 1, wherein, At each time step, the visual latent attention branch network and the language latent attention branch network output their respective word probability distributions, and the final word probability output is obtained by weighted fusion. 8.The method of claim 1, wherein, The visual features are generated by a visual spatiotemporal correlation encoder to produce the visual context features, and the blanking sequence is generated by a pseudo-visual feature encoder to produce the pseudo-text context features.

9. The method of claim 8, wherein, Both the visual spatiotemporal correlation encoder and the pseudo-visual feature encoder are encoders with multi-head self-attention mechanisms.

Citation Information

Patent Citations

  • Video common knowledge reasoning implementation method based on multi-modal fusion

    CN113869324A

  • Video dense description generation method based on time sequence feature pyramid

    CN113392717A

  • Multi-mode dense video description method based on video context information fusion

    CN114627162A