A video question answering method and system with global and local complementary bidirectional attention

Through the global and local complementary bidirectional attention mechanism, combined with the graph attention mechanism, it solves the problem of insufficient local context information refinement and global information reasoning in video question and answer technology, improves the accuracy and application scenarios of video content understanding, and achieves a more comprehensive Feature extraction and task expansion.

CN114911930BActive Publication Date: 2024-09-13SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210393827.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-15
Publication Date
2024-09-13
Estimated Expiration
2042-04-15

AI Technical Summary

Technical Problem

Existing video question and answer technology lacks refinement of local context information and multi-step reasoning steps between global information and local information, resulting in low accuracy of computer understanding of video content and limited application scenarios.

Method used

A video question answering method with global and local complementary bidirectional attention is proposed. Through the global and local bidirectional attention module composed of a multi-head attention layer and a one-dimensional convolution layer stack, combined with the graph attention mechanism, the global and local context information of the video is obtained. And build an answer prediction module for model training and prediction.

Benefits of technology

It achieves more complete and accurate feature extraction, expands the application scenarios of video question and answer tasks, and improves the accuracy of video content understanding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911930B
    Figure CN114911930B
Patent Text Reader

Abstract

The present invention discloses a video question-answering method and system with global and local complementary bidirectional attention. The method comprises: firstly preprocessing the data set, using a multi-head self-attention layer and a convolution layer to obtain features with global and local context information, then aggregating using a graph attention mechanism, and finally inputting the obtained features into an answer prediction module for model training and prediction. The present invention utilizes a multi-head self-attention mechanism to extract complete global context information, and utilizes a one-dimensional convolutional neural network to extract accurate local context information, thereby achieving more complete and accurate feature extraction. At the same time, the present invention stacks multi-head self-attention layers and one-dimensional convolution layers in different orders, so that global information and local information complement and fuse each other, thereby realizing a multi-step reasoning process of feature representation. By modifying the answer prediction module, the present invention can play a role in multiple video question-answering tasks, improve accuracy, and expand application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video question answering, and in particular to a video question answering method and system with global and local complementary two-way attention. Background Art

[0002] Video question answering (VideoQA) is a fine-grained video understanding task after video description. Compared with the general description in the video description task, video question answering not only needs to understand visual content, text information and voice information, but also needs to establish the connection between the three modal data and perform reasoning, which makes the video question answering process require more detailed description information and complex reasoning process than the video description process. Therefore, it is particularly important to study how to extract effective information from the growing number of videos. Video question answering methods are divided into rule-based video question answering methods and deep learning-based video question answering methods. Among them, rule-based video question answering methods first began in 2003. Early video question answering methods used it as query content and questions as query sub-queries to locate relevant video content information in a retrieved manner. The research objects were mainly concentrated in the field of news videos, and video content structured methods were used to model video content, and HMM was used to construct reasoning mechanisms. It is important and valuable for video question answering to obtain information from videos, especially because a large number of videos are now produced. The current video question answering method started as early as 2016, and the research objects mainly focused on the corresponding data sets. However, due to the spatiotemporal characteristics of video question answering, building a video question answering data set has become a challenging task, which has slowed down the progress of the video question answering field. The main research method is to use deep learning methods to actively learn the video content related to the question. In recent years, with the gradual improvement of data sets, video question answering research has also made new progress. Some work has explored spatial attention and temporal attention, some have made breakthroughs in the fusion of static features and dynamic features, and some have expanded the dynamic memory network model in visual question answering. These networks can better extract useful video information and interact, and have achieved good performance. However, due to the complexity of the task, the overall performance still has room for substantial improvement. At present, more work in the field of video question answering is still focused on integrating video dynamic temporal information and fusion of video multimodal features.

[0003] One of the current existing technologies is a video story question answering technology based on a multi-head self-attention mechanism proposed by Kyung-Min Kim et al. The key idea is to use a dual attention mechanism with late fusion. This technology uses self-attention to learn latent concepts in scene frames and subtitles. For a given text question, the attention mechanism is used again for these latent concepts. Multimodal fusion is a multimodal fusion after the dual attention process to learn to infer high-level visual language joint representations from the abstraction of the complete video content. Its disadvantages are: this technology is based on a multi-head self-attention mechanism, which can obtain complete global context information between features, but lacks refinement of local context information. At the same time, this technology is only targeted at video story question answering tasks and has not been applied to other rich video question answering tasks.

[0004] The second existing technology is a video question-answering technology constructed by Liang Peng et al. that jointly explores multiple visual relationships at the object level, frame level, and clip level. It designs two complementary graphs in object-level relationship encoding, one for learning the spatial and semantic relationships between objects from the same frame, and the other for modeling the temporal relationship between the same object from different frames. The frame-level graph explores the interaction between different frames to record fine-grained appearance changes, while the clip-level graph models the temporal and semantic relationships between various actions in the clip. These different levels of graphs are connected in a progressive manner to learn visual relationships from low to high levels. Its disadvantages are: the technology uses the attention mechanism to process the video content step by step in the order of object level, frame level, clip level, and video level, and gradually expands from the local information of the video to the global information. It lacks the refinement step from the global information of the video to the local information, and also lacks the multi-step reasoning step between the global information and the local information. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the existing methods and propose a video question-answering method with global and local complementary bidirectional attention. The main problems solved by the present invention are: first, the existing technology lacks the refinement of local context information, has low applicability, and is limited in application scenarios; second, the existing technology lacks multi-step reasoning steps between global information and local information, and the computer's understanding of video content is low in accuracy.

[0006] In order to solve the above problems, the present invention proposes a video question answering method with global and local complementary bidirectional attention, the method comprising:

[0007] The video question-answering dataset is divided into a training set and a test set, and the original video, the corresponding text question and the answer identifier are obtained from the training set;

[0008] Preprocessing the original video and the text question to obtain appearance feature representation, motion feature representation and question representation of the video;

[0009] Flattening the problem representation to obtain a flattened tensor, and aligning the flattened tensor with the appearance feature representation and the motion feature representation to form a feature representation combination;

[0010] The feature representation combination is processed using a global and local bidirectional attention module composed of a stack of multi-head attention layers and one-dimensional convolutional layers to obtain appearance features and motion features with global and local context information, respectively;

[0011] The feature representation combinations are processed separately to construct an undirected fully connected appearance graph and motion graph, and an aggregation operation is performed using a graph attention mechanism to obtain appearance features and motion features with global context information;

[0012] Constructing an answer prediction module, connecting the appearance features and motion features with global and local context information, and the appearance features and motion features with global context information, obtaining a final feature, and using the final feature and the question representation as inputs of the prediction module, performing a model training operation, and obtaining a trained answer prediction model;

[0013] Obtain target videos and questions from the test set, repeat the preprocessing operation, input the processing results into the trained answer prediction model according to the question type, and output the video question and answer answer to be obtained.

[0014] Preferably, the video question-answering dataset is divided into a training set and a test set, and the original video, the corresponding text question and the answer identifier are obtained from the training set, specifically:

[0015] The large dataset TGIF-QA is used as the video question answering dataset and divided into a training set and a test set;

[0016] The dataset consists of 165,000 question-answer pairs collected from 72,000 animated GIFs, including four types of tasks: counting, action, state transition, and frame question answering;

[0017] Extract original videos, corresponding textual questions, and answer tokens from the partitioned training set.

[0018] Preferably, the preprocessing operation is performed on the original video and the text question to obtain the appearance feature representation, motion feature representation and question representation of the video, specifically:

[0019] The original video is uniformly sampled into 128 frames and uniformly divided into 8 segments, each segment containing 16 frames;

[0020] Each obtained segment is input into the pre-trained feature extractor ResNeXt, which outputs the segment-level motion vector F m , each frame obtained is input into the pre-trained feature extractor ResNet, and the frame-level appearance feature vector F is output a ;

[0021] The motion vector F m and appearance feature vector F a Input the bidirectional recurrent network BiLSTM, connect the output hidden states of the forward and reverse long short word memory models LSTM, and align the two features in the time dimension to obtain the motion feature representation V m And the appearance characteristics represent V a ;

[0022] The question representation is embedded into a 300-dimensional vector using a pre-trained GloVe model, the context-independent embedding vector is input into a bidirectional recurrent network BiLSTM, and then the output hidden states of the forward and reverse LSTMs are connected to obtain the question representation q.

[0023] Preferably, the problem representation is flattened to obtain a flattened tensor, which is aligned with the appearance feature representation and the motion feature representation to form a feature representation combination, specifically:

[0024] The problem representation q is copied into 128 copies and concatenated to obtain a flattened tensor q tile ;

[0025] The flattened tensor q tile The dimension and appearance characteristics of V a And the motion characteristics represent V m Align to form a feature representation combination (V a ,q tile ) and (V m ,q tile ).

[0026] Preferably, the global and local bidirectional attention module composed of a stack of multi-head attention layers and one-dimensional convolutional layers processes the feature representation combination to obtain appearance features and motion features with global and local context information, respectively, specifically:

[0027] Using a multi-head self-attention layer to obtain global context information of the feature representation combination, and using a one-dimensional convolutional layer to obtain local context information of the feature representation combination;

[0028] Multi-head self-attention layers and one-dimensional convolutional layers are stacked in different orders to construct two context information acquisition submodules: global first then local and local first then global. The outputs of the submodules are connected to form a global and local bidirectional attention module.

[0029] The feature representation combination (V a ,q tile ) and (V m ,q tile ) Input global and local bidirectional attention modules, output appearance features with global and local context information and motion characteristics

[0030] Preferably, the feature representation combinations are processed separately to construct an undirected fully connected appearance graph and motion graph, and an aggregation operation is performed using a graph attention mechanism to obtain appearance features and motion features with global context information, specifically:

[0031] The feature representation combination (V a ,q tile ) and (V m ,q tile ) are spliced ​​into [V a ,q tile ] and [V m ,q tile ], as an undirected fully connected appearance graph and motion diagram Nodes;

[0032] Calculating vertices and The correlation between i,j , as the weight of the edge connecting two nodes, the calculation formula is as follows:

[0033]

[0034] Where σ(·) is a nonlinear function such as LeakyReLU, a is a learnable parameter of the feedforward neural network, and W k is a shared learnable matrix, Is a node The set of adjacent nodes of , [·||·] represents the connection operation;

[0035] Using the weighted aggregation operation of adjacent nodes and edges, the node features are updated to obtain the appearance features with global context information. and motion characteristics

[0036] Preferably, the answer prediction module is constructed by connecting the appearance features and motion features with global and local context information, and the appearance features and motion features with global context information to obtain the final features, and using the final features and the question representation as inputs of the prediction module to perform a model training operation to obtain a trained answer prediction model, specifically:

[0037] The appearance features with global and local context information and motion characteristics and appearance features with global context information and motion characteristics Connect and get the final feature V f , taking it and the question representation q as the input of the answer prediction module;

[0038] For the frame question answering task, the label probability p is calculated according to the method of multi-classification problem, and the cross entropy loss is used to complete the task;

[0039] For the counting task, a linear regression function is used and then rounded, and the mean square error loss is used to complete the task;

[0040] For action tasks and state transition tasks, a real-value score is obtained based on the joint representation of each set of questions and candidate answers, and the correct answer score s p and wrong answer score n The hinge loss max(0, 1+s n -s p ) for optimization.

[0041] Accordingly, the present invention also provides a video question-answering system with global and local complementary two-way attention, comprising:

[0042] A data set processing unit, used to divide the video question-answering data set into a training set and a test set, obtain the original video, the corresponding text questions and answer identifiers from the training set, and perform preprocessing operations;

[0043] A feature acquisition unit is used to flatten and align the preprocessed data to obtain a feature representation combination, input the global and local bidirectional attention modules, and perform aggregation operations using the graph attention mechanism to obtain relevant features;

[0044] The model training and prediction unit is used to connect the obtained features to obtain the final features as the input of the prediction module, and perform model training and final prediction.

[0045] The implementation of the present invention has the following beneficial effects:

[0046] The present invention proposes a video question-answering method with global and local complementary bidirectional attention. First, the present invention uses a multi-head self-attention mechanism to extract complete global context information, and uses a one-dimensional convolutional neural network to extract accurate local context information, thereby achieving more complete and accurate feature extraction; second, the present invention stacks multi-head self-attention layers and one-dimensional convolutional layers in different orders, so that global information and local information complement and fuse each other, thereby achieving a multi-step reasoning process of feature representation; third, by modifying the answer prediction module, the present invention can play a role in multiple video question-answering tasks, thus expanding the application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 This is an overall flow chart of a video question-answering method with global and local complementary bidirectional attention according to an embodiment of the present invention;

[0048] Figure 2 It is a structural diagram of a video question-answering system with global and local complementary bidirectional attention according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical invention 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.

[0050] Figure 1 is an overall flow chart of a video question answering method with global and local complementary two-way attention according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0051] S1, divide the video question answering dataset into a training set and a test set, and obtain the original video, the corresponding text question and the answer identifier from the training set;

[0052] S2, performing a preprocessing operation on the original video and the text question to obtain an appearance feature representation, a motion feature representation, and a question representation of the video;

[0053] S3, flattening the problem representation to obtain a flattened tensor, and aligning the flattened tensor with the appearance feature representation and the motion feature representation to form a feature representation combination;

[0054] S4, using a global and local bidirectional attention module composed of a stack of multi-head attention layers and one-dimensional convolutional layers to process the feature representation combination to obtain appearance features and motion features with global and local context information, respectively;

[0055] S5, processing the feature representation combinations separately, constructing an undirected fully connected appearance graph and motion graph, performing aggregation operations using a graph attention mechanism, and obtaining appearance features and motion features with global context information;

[0056] S6, constructing an answer prediction module, connecting the appearance features and motion features with global and local context information, and the appearance features and motion features with global context information, obtaining a final feature, and using the final feature and the question representation as inputs of the prediction module, performing a model training operation, and obtaining a trained answer prediction model;

[0057] S7, obtaining the target video and question from the test set, repeating the preprocessing operation, inputting the processing result into the trained answer prediction model according to the question type, and outputting the video question and answer answer to be obtained.

[0058] Step S1 is as follows:

[0059] S1-1: Extract original videos and corresponding text questions from the video question answering database. The data comes from the large-scale video question answering dataset TGIF-QA, which consists of 165,000 question-answer pairs collected from 72,000 animated GIFs, and contains four types of tasks: counting, action, state transition, and frame question answering.

[0060] Step S2 is as follows:

[0061] S2-1: The video obtained in S1-1 is uniformly sampled into 128 frames and evenly divided into 8 segments, each containing 16 frames. Each frame is processed by the pre-trained feature extractor ResNet to obtain the frame-level appearance feature vector F a Each segment is processed by the pre-trained feature extractor ResNeXt to obtain the segment-level motion vector F m .

[0062] S2-2: Use BiLSTM to further process the F obtained in S2-1 a and F m , connect the output hidden states of the forward and reverse LSTMs, and align the two features in the time dimension to obtain the appearance feature representation V a and motion feature representation V m .

[0063] S2-3: Use the pre-trained GloVe model to embed the questions obtained in S1-1 into 300-dimensional vectors. Input these context-independent embedding vectors into the BiLSTM. Concatenate the output hidden states of the forward and backward LSTMs to form the question representation q.

[0064] Step S3 is as follows:

[0065] S3-1: Copy the problem representation q generated by S2 into 128 copies and concatenate them to obtain the flattened tensor q tile , so that its dimension is the same as V obtained in S2-2 a and V m Align, combine into (V a ,q tile ) and (V m ,q tile ).

[0066] Step S4 is as follows:

[0067] S4-1: Use a multi-head self-attention layer to obtain the global context information of the feature, and use a one-dimensional convolutional layer to obtain the local context information of the feature.

[0068] S4-2: The multi-head self-attention layer and one-dimensional convolutional layer constructed in S4-1 are stacked in different orders to construct two context information acquisition sub-modules: global first then local and local first then global. The outputs of the sub-modules are connected to form a global and local bidirectional attention module.

[0069] S4-3: The (V generated by S3-1 a ,q tile ) and (V m ,q tile ) is input into the module constructed by S4-2, and the output is the appearance feature that integrates global and local context information. and motion characteristics

[0070] Step S5 is as follows:

[0071] S5-1: The (V generated by S3-1 a ,q tile ) and (V m ,q tile ) are spliced ​​into [V a ,q tile ] and [V m ,q tile ], as an undirected fully connected appearance graph and motion diagram Node.

[0072] S5-2: Calculate the vertex according to formula (1) and The correlation between i,j , as the weight of the edge connecting two nodes.

[0073]

[0074] Where σ(·) is a nonlinear function such as LeakyReLU, a is a learnable parameter of the feedforward neural network, and W k is a shared learnable matrix, Is a node is the set of adjacent nodes of , and [·||·] represents the connection operation.

[0075] S5-3: Use the weighted aggregation operation of adjacent nodes and edges to update the features of the nodes and obtain the appearance features with global context information respectively and motion characteristics

[0076] Step S6 is as follows:

[0077] S6-1: Connect the generated by S4-3 and S5-3 generated Get V f . The final feature V f and question features q as input to the answer prediction module.

[0078] S6-2: For the frame question answering task, the label probability p is calculated according to the method of multi-classification problem, and the task is completed using cross entropy loss.

[0079] S6-3: For the counting task, a linear regression function is used and then rounded, and the mean square error loss (MSE) is used to complete the task.

[0080] S6-4: For action tasks and state transition tasks, a real-value score is obtained based on the joint representation of each set of questions and candidate answers, and the correct answer score s p and wrong answer score n The hinge loss max(0, 1+s n -s p ) for optimization.

[0081] Step S7 is as follows:

[0082] S7-1: Obtain the video and questions to be processed from the test set of the video question-answering dataset, encode the video and questions using the processing of S2-1, S2-2, and S2-3, input them into the corresponding model according to the question type, and output the answer to the question after understanding the video content.

[0083] Accordingly, the present invention also provides a video question-answering system with global and local complementary two-way attention, such as Figure 2 As shown, including:

[0084] The data set processing unit 1 is used to divide the video question-answering data set into a training set and a test set, obtain the original video, the corresponding text questions and answer labels from the training set, and perform preprocessing operations.

[0085] Specifically, the video question-answering dataset is divided into a training set and a test set. The original video, the corresponding text questions and answer labels are obtained from the training set, and preprocessing operations are performed to obtain the appearance feature representation, motion feature representation and question representation of the video. Then, tile processing is performed to obtain a tiled tensor, which is aligned with the appearance feature representation and the motion feature representation to form a feature representation combination.

[0086] The feature acquisition unit 2 is used to flatten and align the preprocessed data to obtain a feature representation combination, input the global and local bidirectional attention modules, and use the graph attention mechanism to perform aggregation operations to obtain relevant features.

[0087] Specifically, a global and local bidirectional attention module consisting of a stack of multi-head attention layers and one-dimensional convolutional layers is used to process the feature representation combination to obtain appearance features and motion features with global and local contextual information, respectively. The feature representation combination is processed separately to construct undirected fully connected appearance graph and motion graph, and the graph attention mechanism is used to perform aggregation operations to obtain appearance features and motion features with global contextual information.

[0088] The model training and prediction unit 3 is used to connect the obtained features to obtain the final features as the input of the prediction module, and perform model training and final prediction.

[0089] Specifically, an answer prediction module is constructed, and the appearance features and motion features with global and local context information, as well as the appearance features and motion features with global context information, are connected to obtain the final features, and the final features are used together with the question representation as the input of the prediction module. A model training operation is performed to obtain a trained answer prediction model, and the target video and question are obtained from the test set. The preprocessing operation is repeated, and the processing results are input into the trained answer prediction model according to the question type, and the video question and answer answer required is output.

[0090] Therefore, the present invention first preprocesses the data set, uses a multi-head self-attention layer to obtain the global context information of the feature, and uses a one-dimensional convolution layer to obtain the local context information of the feature. The multi-head self-attention layer and the one-dimensional convolution layer are stacked in different orders, and two context information acquisition submodules of global first and local second and local first and global first are constructed respectively, and the outputs of the submodules are connected to form a global and local bidirectional attention module. The module is used to process the initially extracted appearance features and motion features, and the appearance features and motion features that fuse the global and local context information are output. Then, the appearance features, motion features and question representations are spliced ​​respectively as nodes in the undirected fully connected appearance graph and motion graph, and the correlation between the nodes is calculated as the weight of the edge connecting the two nodes. Using the weighted aggregation operation of adjacent nodes and edges, the features of the nodes are updated, and the appearance features and motion features with global context information are obtained respectively. Finally, the answer prediction module is constructed, and the acquired features are input for model training and prediction.

[0091] The above is a detailed introduction to a video question-answering method and system with global and local complementary two-way attention provided by an embodiment of the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A video question answering method with global and local complementary bidirectional attention, It is characterized in that The method comprises: The video question-answering dataset is divided into a training set and a test set, and the original video, the corresponding text question and the answer identifier are obtained from the training set; Preprocessing the original video and the text question to obtain appearance feature representation, motion feature representation and question representation of the video; Flattening the problem representation to obtain a flattened tensor, and aligning the flattened tensor with the appearance feature representation and the motion feature representation to form a feature representation combination; The feature representation combination is processed using a global and local bidirectional attention module composed of a stack of multi-head attention layers and one-dimensional convolutional layers to obtain appearance features and motion features with global and local context information, respectively; The feature representation combinations are processed separately to construct an undirected fully connected appearance graph and motion graph, and an aggregation operation is performed using a graph attention mechanism to obtain appearance features and motion features with global context information; Constructing an answer prediction module, connecting the appearance features and motion features with global and local context information, and the appearance features and motion features with global context information, obtaining a final feature, and using the final feature and the question representation as inputs of the prediction module, performing a model training operation, and obtaining a trained answer prediction model; Obtain target videos and questions from the test set, repeat the preprocessing operation, input the processing results into the trained answer prediction model according to the question type, and output the video question and answer answer to be obtained.

2. A video question answering method with global and local complementary bidirectional attention as claimed in claim 1, It is characterized in that The video question-answering dataset is divided into a training set and a test set, and the original video, the corresponding text question and the answer identifier are obtained from the training set, specifically: The large dataset TGIF-QA is used as the video question answering dataset and divided into a training set and a test set; The dataset consists of 165,000 question-answer pairs collected from 72,000 animated gifs, including four types of tasks: counting, action, state transition, and frame question answering; Extract original videos, corresponding textual questions, and answer tokens from the partitioned training set.

3. A video question answering method with global and local complementary bidirectional attention as claimed in claim 2, It is characterized in that The preprocessing operation is performed on the original video and the text question to obtain the appearance feature representation, motion feature representation and question representation of the video, specifically: The original video is uniformly sampled into 128 frames and uniformly divided into 8 segments, each segment containing 16 frames; Each obtained segment is input into the pre-trained feature extractor ResNeXt, which outputs the segment-level motion vector F m , each frame obtained is input into the pre-trained feature extractor ResNet, and the frame-level appearance feature vector F is output a ; The motion vector F m and appearance feature vector F a Input the bidirectional recurrent network BiLSTM, connect the output hidden states of the forward and reverse long short word memory models LSTM, and align the two features in the time dimension to obtain the motion feature representation V m And the appearance characteristics represent V a ; The question representation is embedded into a 300-dimensional vector using a pre-trained GloVe model, the context-independent embedding vector is input into a bidirectional recurrent network BiLSTM, and then the output hidden states of the forward and reverse LSTMs are connected to obtain the question representation q.

4. A video question answering method with global and local complementary bidirectional attention as claimed in claim 3, It is characterized in that The problem representation is flattened to obtain a flattened tensor, which is aligned with the appearance feature representation and the motion feature representation to form a feature representation combination, specifically: The problem representation q is copied into 128 copies and concatenated to obtain a flattened tensor q tile ; The flattened tensor q tile The dimension and appearance characteristics of V a And the motion characteristics represent V m Align to form a feature representation combination (V a ,q tile ) and (V m ,q tile ).

5. A video question answering method with global and local complementary bidirectional attention as claimed in claim 4, It is characterized in that The global and local bidirectional attention module composed of a stack of multi-head attention layers and one-dimensional convolutional layers is used to process the feature representation combination to obtain appearance features and motion features with global and local context information, respectively, specifically: Using a multi-head self-attention layer to obtain global context information of the feature representation combination, and using a one-dimensional convolutional layer to obtain local context information of the feature representation combination; Multi-head self-attention layers and one-dimensional convolutional layers are stacked in different orders to construct two context information acquisition submodules: global first then local and local first then global. The outputs of the submodules are connected to form a global and local bidirectional attention module. The feature representation combination (V a ,q tile ) and (V m ,q tile ) Input global and local bidirectional attention modules, output appearance features with global and local context information and motion characteristics 6. A video question answering method with global and local complementary bidirectional attention as claimed in claim 4, It is characterized in that The feature representation combinations are processed separately to construct an undirected fully connected appearance graph and motion graph, and an aggregation operation is performed using a graph attention mechanism to obtain appearance features and motion features with global context information, specifically: The feature representation combination (V a ,q tile ) and (V m ,q tile ) are spliced ​​into [V a ,q tile ]and [V m ,q tile ], as an undirected fully connected appearance graph and motion diagram Nodes; Calculating vertices and The correlation between i,j , as the weight of the edge connecting two nodes, the calculation formula is as follows: Where σ(·) is a nonlinear function such as LeakyReLU, a is a learnable parameter of the feedforward neural network, and W k is a shared learnable matrix, Is a node The set of adjacent nodes of , [·||·] represents the connection operation; Using the weighted aggregation operation of adjacent nodes and edges, the node features are updated to obtain the appearance features with global context information. and motion characteristics 7. A video question answering method with global and local complementary bidirectional attention as claimed in claim 5 or 6, It is characterized in that The answer prediction module is constructed, the appearance features and motion features with global and local context information, and the appearance features and motion features with global context information are connected to obtain the final features, and the final features and the question representation are used as inputs of the prediction module to perform model training operations to obtain a trained answer prediction model, specifically: The appearance features with global and local context information and motion characteristics and appearance features with global context information and motion characteristics Connect and get the final feature V f , taking it and the question representation q as the input of the answer prediction module; For the frame question answering task, the label probability p is calculated according to the method of multi-classification problem, and the cross entropy loss is used to complete the task; For the counting task, a linear regression function is used and then rounded, and the mean square error loss is used to complete the task; For action tasks and state transition tasks, a real-value score is obtained based on the joint representation of each set of questions and candidate answers, and the correct answer score s p and wrong answer score n The hinge loss max(0, 1+s n -s p ) for optimization.

8. A video question answering system with global and local complementary bidirectional attention, It is characterized in that The system comprises: A data set processing unit is used to divide the video question-answering data set into a training set and a test set, obtain the original video, the corresponding text question and the answer identifier from the training set; perform preprocessing operations on the original video and the text question to obtain the appearance feature representation, motion feature representation and question representation of the video; perform tile processing on the question representation to obtain a tiled tensor, align it with the appearance feature representation and the motion feature representation, and form a feature representation combination; A feature acquisition unit is used to process the feature representation combination using a global and local bidirectional attention module composed of a stack of multi-head attention layers and one-dimensional convolutional layers to obtain appearance features and motion features with global and local context information respectively; the feature representation combination is processed separately to construct an undirected fully connected appearance graph and motion graph, and an aggregation operation is performed using a graph attention mechanism to obtain appearance features and motion features with global context information; The model training and prediction unit is used to construct an answer prediction module, connect the appearance features and motion features with global and local context information, and the appearance features and motion features with global context information to obtain the final features, and use them and the question representation as inputs of the prediction module to perform model training operations to obtain a trained answer prediction model; obtain the target video and question from the test set, repeat the preprocessing operation, input the processing results into the trained answer prediction model according to the question type, and output the video question and answer answer to be obtained.