A method for video summarization using memory networks and gated recurrent units
By combining the memory network and gated recurrent unit with the bidirectional GRU and backpack algorithm, the problem of insufficient long-term memory capacity of video summary in the existing technology is solved, more efficient video summary generation is achieved, and the F1 score and user experience are significantly improved.
Patent Information
- Application Number
- CN202111346288.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-15
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-11-15
AI Technical Summary
Existing video summarization technology has shortcomings in acquiring long-term memory capabilities and reducing key frame redundancy and information distortion. Especially when processing massive video data, it is difficult to effectively extract the important content of the video.
It uses a memory network and gated recurrent unit to repeatedly retrieve stored information through a multi-hops structure, combines bidirectional GRU to fuse forward and backward information, and uses a knapsack algorithm to select key shots to generate a dynamic video summary.
It improves the overall effectiveness of video summary, retains useful information to the maximum extent, improves the F1 score of the model, can effectively handle long-term memory and reduce redundancy, and experimental verification shows excellent performance on TVSum and SumMe data sets.
Smart Images

Figure CN114020964B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video summarization, and in particular to a method for realizing video summarization by using a memory network and a gated recurrent unit. Background Art
[0002] With the development of the Internet and the emergence of various mobile portable shooting devices, people can shoot videos anytime and anywhere to record people and things around them, and upload them to the Internet, resulting in an explosive growth in the number of videos. Massive video data will inevitably bring pressure on video storage and management. At the same time, when users are looking for the information they need in a large number of related videos, they often need to browse all the contents of each video to filter out unnecessary information; although users can use double-speed playback to speed up video browsing, users still need to spend a lot of time and energy. Therefore, humans urgently need a means to extract important content from videos, and video summarization came into being.
[0003] Video summarization technology extracts meaningful frames or meaningful shots from videos to summarize and generalize video content, providing humans with an efficient way to access and manage massive video data, alleviating the pressure on video storage, transmission, archiving and retrieval caused by the explosive growth of online videos in recent years. At the same time, as a means for users to quickly browse and obtain important content of videos, video summarization can greatly improve user experience.
[0004] The hierarchical structure of a video can generally be divided into video streams, scenes, shots and frames from top to bottom. Based on the hierarchical structure of a video, a video summary can be divided into a static video summary and a dynamic video summary. A static video summary is a video summary composed of meaningful frames, while a dynamic video summary is composed of meaningful shots. For a static video summary, that is, a video summary in the form of key frames, the summary process can be divided into the following three steps: feature extraction, video content importance calculation and video summary generation. First, the features of the video frames are extracted, then the content importance of the video frames is calculated, and finally, important video frames are selected according to the importance to form a static video summary. For a dynamic video summary, that is, a video summary in the form of key shots, the summary process can generally be divided into four steps: feature extraction, video shot segmentation, video content importance calculation and video summary generation. First, the features of the video frames are extracted, then the video shots are segmented according to the extracted frame features to generate several shots, then the content importance of the video shots is calculated, and finally, a certain number of shots are selected according to the importance to form a summary.
[0005] Early, traditional video summarization methods mostly used hand-crafted features or clustering methods to decide whether to select video frames or video shots to form a video summary, such as Gygli M, Grabner H, Riemenschneider H, et al.: Creating Summaries from User Videos, Fleet D, Pajdla T, Schiele B, Tuytelaars T, editor, Computer Vision-Eccv 2014, Pt Vii, Cham: Springer Int Publishing Ag, 2014: 505-520. First, the video is segmented into "superframes" to generate superframe segments, and then criteria are established to evaluate the interest of each superframe, and finally the optimal subset is selected to form a video summary.
[0006] With the excellent performance of deep learning in various application fields, the first article Zhang K, Chao WL, Sha F, et al. Video Summarization with Long Short-Term Memory[C]. Computer Vision–ECCV 2016, 2016:766-782 appeared in 2016, which applied deep learning models to video summarization. The authors first used the long short-term memory (LSTM) network in deep learning to model the variable range temporal dependency between video frames, and then used a multilayer perceptron (MLP) to estimate the importance of the frame, and based on the determinantal point process (DPP) to increase the diversity of the visual content of the generated summary.
[0007] According to whether the summary algorithm requires supervision information and the strength of the supervision information, deep learning-based video summarization can be divided into unsupervised video summarization, supervised video summarization and weakly supervised video summarization. Unsupervised video summarization methods use specific criteria to evaluate the importance, representativeness, and interestingness of video content, and then generate video summaries based on the evaluation results. Hu M, Hu R, Wang X, et al. Unsupervised Temporal Attention Summarization Model for User Created Videos [C]. MultiMedia Modeling, 2021: 519-530. A temporal attention-based summary model TASM is proposed. In TASM, more comprehensive information is obtained by combining the outputs of the encoder and decoder. At the same time, a feedforward attribute reward is designed to enhance the diversity of the selected key frames, and the deep deterministic policy gradient (DDPG) is used to train TASM. This network structure solves the problems of high redundancy and information distortion between key frames in existing user video summaries. Supervised video summarization methods use human-annotated data to train neural networks, which usually enables the model to capture video content with more semantic information, and the resulting summary results are generally better than unsupervised video summarization methods. Zhao B, Li X, Lu X. TTH-RNN: Tensor-Train Hierarchical Recurrent Neural Network for Video Summarization [J]. IEEE Transactions on Industrial Electronics, 2021, 68 (4): 3629-3637. A TTH-RNN network is proposed, which contains a tensor-train embedding layer to avoid the mapping matrix from feature to hidden being too large due to high-dimensional video features, thereby reducing the difficulty of training; at the same time, a hierarchical RNN is used to explore the long-term temporal correlation between video frames. Although supervised video summarization methods generally outperform unsupervised methods, the current video summarization datasets are small in number and size, and establishing new large-scale datasets is a time-consuming and laborious task. In this case, a number of weakly supervised video summarization methods have been spawned. Weakly supervised methods use existing labels (such as video categories) as supervisory information to train the network.Cai S, Zuo W, Davis LS, et al. Weakly-Supervised Video Summarization Using Variational Encoder-Decoder and Web Prior [C]. Computer Vision–ECCV 2018, 2018: 193-210. A VESD (Variational Encoder-Summarizer-Decoder) model is proposed, which consists of a variational autoencoder and an encoder-attention-decoder. The variational autoencoder learns latent semantics from online videos, and the encoder-attention-decoder is used for saliency evaluation and summary generation. Most of the above methods use convolutional neural networks or recurrent neural networks to obtain the spatiotemporal information of the video, and have poor ability to obtain long-term memory. Summary of the invention
[0008] In view of the defects in the prior art, the object of the present invention is to provide a method for implementing video summarization using a memory network and a gated recurrent unit.
[0009] According to one aspect of the present invention, a method for implementing video summarization using a memory network and a gated recurrent unit is provided, comprising:
[0010] Preprocess the data set to obtain the video frame features of the video;
[0011] Designing an overall network model that takes the video frame features as input and takes the frame importance score as output;
[0012] Training the overall network model;
[0013] Convert the frame importance scores output from the trained overall network model into key shots;
[0014] The key shots are combined into a dynamic video summary.
[0015] Preferably, the preprocessing data set to obtain video frame features of the video includes:
[0016] Sampling the video into a sequence of video frames;
[0017] The features of the video frame sequence are extracted using a pre-trained GoogLeNet model to obtain video frame features corresponding to each video.
[0018] Preferably, the overall network model that takes video frame features as input and frame importance scores as output includes:
[0019] An input module, the input module is used to fuse the forward and backward information of the input video frame features;
[0020] A memory module, wherein the fused result output by the input module is used as the input of the memory module, and the memory module uses a multi-hop structure to repeatedly retrieve the information stored in the memory and output a memory output that maximizes the retention of useful information;
[0021] An output module, wherein the memory output of the memory module is used as an input of the output module, and the output module regresses the memory output into the frame importance score;
[0022] Preferably, the input module is constructed to process the input video frame feature sequence using a one-layer bidirectional GRU, including:
[0023] The forward output of the GRU contains the past information of the current moment;
[0024] The backward output of the GRU contains future information at the current moment;
[0025] The bidirectional GRU fuses and adds the forward output and the backward output element by element to obtain complete past and future information at the current moment.
[0026] Preferably, constructing the memory module includes:
[0027] The encoding vector obtained by passing the fusion sequence output by the bidirectional GRU through a fully connected layer is input into the first hop as the original question vector;
[0028] Inputting the fused sequence output by the bidirectional GRU into two different fully connected layers of the first hop respectively to obtain input memory and output memory;
[0029] The inner product of the question vector and the input memory is performed and the self-attention weight is obtained through Softmax;
[0030] The self-attention weight is weighted and summed with the output memory and multiplied element-by-element with the question vector, and then passes through a fully connected layer with a normalization layer and an activation function to obtain a memory output;
[0031] The memory output is used as a new question vector to input into the next hop to calculate the self-attention weight and memory output; until the memory output of the last hop is used as the input of the output module.
[0032] Preferably, the fully connected matrix of the output memory between adjacent hop layers is equal to the fully connected matrix of the input memory; the fully connected matrix of the original problem vector is equal to the fully connected matrix of the input memory of the bottom layer.
[0033] Preferably, constructing the output module includes:
[0034] A residual connection is made between the memory output and the fused sequence of the bidirectional GRU output;
[0035] The output of the residual connection passes through the LN layer and the Dropout layer in sequence;
[0036] The output result of the Dropout layer is input into a two-layer fully connected network, wherein the number of output layer nodes of the last fully connected layer is 1, and the frame importance score corresponding to each video frame is obtained.
[0037] Preferably, the training of the overall network model comprises:
[0038] The network model is trained using mean square error as the loss function and Adam optimizer.
[0039] Preferably, converting the frame importance scores obtained from the trained overall network model into key shots comprises:
[0040] The KTS algorithm is used to detect scene change points. The video segment between two scene change points is regarded as a video shot, and the video is divided into several video shots.
[0041] For each video shot, the average importance score of all frames in the video shot is calculated as the shot score;
[0042] A knapsack algorithm is executed on the segmented shots and the shot scores to select key shots.
[0043] Preferably, the knapsack algorithm maximizes the total score of key shots, and the length of key shots needs to be limited to 15% of the length of the original video.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] The present invention discloses a method for realizing video summarization by using a memory network and a gated recurrent unit. The overall network model processes the features of an input video and obtains a dynamic video summary by using a frame importance score, thereby improving the overall effectiveness of the model.
[0046] The present invention uses a memory network and a gated recurrent unit to implement a video summarization method. In view of the drawback that convolutional neural networks and recurrent neural networks cannot obtain long-term memory, a memory network is used to repeatedly retrieve information from the storage memory, thereby retaining useful information to the maximum extent. At the same time, a bidirectional GRU is used in the input module to fuse the forward and backward information of the video, thereby improving the F1 score of the model. Experiments on two benchmark datasets, TVSum and SumMe, verify the effectiveness of the invented method. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0048] Figure 1 A flow chart of a method for implementing video summarization using a memory network and a gated recurrent unit according to an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of the structure of an overall network model of a preferred embodiment provided by the present invention;
[0050] Figure 3 A schematic diagram of the structure of an input module of a preferred embodiment provided by the present invention;
[0051] Figure 4 A schematic diagram of the structure of a memory module according to a preferred embodiment of the present invention;
[0052] Figure 5 A schematic structural diagram of an output module according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0053] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0054] like Figure 1 FIG. 1 is a flow chart of a method for implementing video summarization using a memory network and a gated recurrent unit according to an embodiment of the present invention, comprising:
[0055] S1, preprocessing data set to obtain video frame features of the video;
[0056] S2, design an overall network model that takes video frame features as input and frame importance scores as output;
[0057] S3, model training is performed in the overall network model;
[0058] S4, converting the frame importance scores obtained from the trained overall network model into key shots;
[0059] S5, combines key shots into a dynamic video summary and tests the video summary results.
[0060] In order to better process data, the present invention provides a preferred embodiment to perform S1. First, the video is sampled into a video frame sequence at a sampling rate of 2fps, and then the features of the video frame sequence are extracted using the pool5 layer of the GoogLeNet model pre-trained on the large-scale image dataset ImageNet. The feature dimension of each video frame is 1024, so as to obtain {X k} vector. {X k} has a length of N, where N represents the number of video frames sampled in the video; each vector X k The dimension of is D, where D represents the feature dimension of the video frame.
[0061] A preferred embodiment of the present invention is provided to perform S2. This embodiment aims to use a memory network to retain useful information to the maximum extent, and at the same time use a bidirectional gated recurrent unit (BiGRU) in the input module to fuse the forward and backward video information at each moment. Figure 2 As shown in FIG. 1 , it is a schematic diagram of the overall network model structure of this embodiment. As can be seen from the figure, the network model is divided into three modules: input module, memory module and output module. The specific construction process of the three modules is as follows:
[0062] S21, construct the input module, such as Figure 3 The figure shows the structure of the input module. The function of the input module is to fuse the forward and backward information of the input video frame.
[0063] Select a one-layer bidirectional GRU to process the input sequence, and the output feature dimension is still 1024, as shown in formula (1):
[0064]
[0065] in represents the hidden state of the forward GRU at time step k, represents the hidden state of the backward GRU at time step k; and The sum V k As the output of the input module, it contains both the past and future information of the current video frame.
[0066] S22, constructs memory modules, such as Figure 4 The figure shows the structure of the memory module. The function of the memory module is to use a multi-hop structure to repeatedly retrieve the information stored in the memory to obtain the output memory {o k}. The storage memory here refers to Figure 4 The input memory in {a k} and output memory {b k}, the forward and backward information of the fused video frame features are mapped through different fully connected layers respectively.
[0067] In the bidirectional GRU output {V k} respectively pass through 3 different fully connected layers to obtain the question vector {Q k}、Enter memory {a k} and output memory {b k}, add a Dropout layer after each fully connected layer; for input memory {a k} and output memory {b k}, and then add a time series information encoding matrix T A and T B The role of the Dropout layer is to alleviate overfitting, and the reason for adding the temporal information encoding matrix is that the video frame sequence is a time series, and temporal encoding can improve the model performance, namely:
[0068] Q k = dropout(linear Q (V k )) (2)
[0069] a k = dropout(linear A (V k ))+T A (k) (3)
[0070] b k = dropout(linear B (V k ))+T B (k) (4)
[0071] Question vector {Q k} and input memory {a k}Do the inner product and pass it through the Softmax layer to get the self-attention weight {p k}, as shown below:
[0072] p k =Softmax(Q T a k ) (5)
[0073] Among them, Q represents N Q k The matrix composed of.
[0074] Self-attention weight {p k} and output memory {b k} weighted sum and add it to the problem vector {Q k} Element-wise multiplication, and then a fully connected layer with LN layer and ReLU activation function to get the memory output {o k}, as shown below:
[0075] o k =relu(layernorm(linear(p k b k *Q k ))) (6)
[0076] The result of the memory output is used as the new question vector to calculate the weight:
[0077] Q k =o k (7)
[0078] Formula (3)-(7) is a hop.
[0079] In order to reduce the number of parameters, the present invention provides a preferred embodiment. The fully connected matrix of the output memory between adjacent hop layers is equal to the fully connected matrix of the input memory, that is:
[0080] linear A (k+1)=linear B (k) (8)
[0081] Furthermore, the fully connected matrix of the original question vector is equal to the fully connected matrix of the underlying input memory.
[0082] The number of neurons in the output layer of the fully connected layer in the memory module is embed_size=512, so the output memory {o k The size of} is embed_size×N.
[0083] S23, construct output modules, such as Figure 5 The output module is used to regress the memory output into the frame importance score {s k}.
[0084] First, the memory output {o k} and the output of the bidirectional GRU {V k} make residual connection, because {o k} and {V k} has different dimensions, so we need to give {V k}Perform a linear mapping to match the dimensions. The output of the residual connection is passed through the LN layer and the Dropout layer in sequence and then input into a two-layer fully connected network. The first layer of the fully connected network consists of a fully connected layer, an LN layer, a ReLU layer, and a Dropout layer. The output dimension of the fully connected layer is embed_size. The second layer of the fully connected network consists of a fully connected layer and a SigMoid layer. The output dimension of the fully connected layer is 1. The role of SigMoid is to limit the output between 0 and 1, thereby obtaining the frame importance score {s k}.
[0085] The present invention provides an embodiment to perform S3. In this embodiment, the mean square error is used as the loss function. Specifically, the mean square error loss function is as follows:
[0086] loss(s i ,s i ′)=(s i -s i ′) 2 (9)
[0087] where s i and i ′ represents the importance score of the frame output by the network and the importance score of the ground-truth frame respectively. Mean square error loss is the most commonly used loss function in regression problems.
[0088] In this embodiment, the batch size is set to batchsize=1, and the network is trained using the Adam optimizer. The learning rate of the Adam optimizer is 0.0001, and the weight decay coefficient is 0.00001.
[0089] Based on the above embodiments, the present invention provides a preferred embodiment to perform S4, where frame importance scores are converted into key shots. The conversion of frame importance scores into key shots requires two steps.
[0090] In the first step, the KTS algorithm is used to detect scene change points. The video segment between two scene change points is regarded as a video shot, thereby dividing the video into several video shots. For each shot, the average importance score of all frames in the shot is calculated as the shot score.
[0091] In the second step, based on the segmented shots and shot scores, a knapsack algorithm is performed to select key shots to maximize the total score of key shots, and the total duration of key shots is limited to 15% of the original video duration.
[0092] Specifically, the knapsack algorithm is shown as follows:
[0093]
[0094] where y i represents the shot score of the i-th shot, u i Indicates whether it is selected as a key shot, l i is the length of the i-th shot, L is equal to 15% of the original video duration, and K is the number of video shots.
[0095] Based on S4 in the above embodiment, S5 is executed to combine the key shots into a dynamic summary, and the F1 score between the key shots and the ground-truth summary result is calculated.
[0096] In order to verify the effectiveness of the above embodiments, the present invention applies them to practice and compares them with other methods. Specifically, the data set consists of 4 data sets, namely TVSum and SumMe, and auxiliary data sets YouTube and OVP. Canonical and Augmented represent two different data set settings. Canonical means that 80% of the current data set is used as a training set and 20% is used as a test set; Augmented means that 80% of the current data set and the remaining 3 data sets are used as training sets, and 20% of the current data set is used as a test set. For example, when the current data set is SumMe, the training set consists of YouTube, OVP, TVSum and 80% of SumMe, and the test set consists of 20% of SumMe. The comparison results of the summary results with other algorithms are shown in Table 1. The results in Table 1 represent the F1 score (unit: %). The larger the F1 score, the better the algorithm performance. The last column is the average performance of each algorithm. The effectiveness of the method of the present invention can be seen from Table 1.
[0097]
[0098] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art can make various modifications or variations within the scope of the claims, which does not affect the essence of the present invention. The above preferred features can be used in any combination without conflicting with each other.
Claims
1. A method for implementing video summarization using a memory network and a gated recurrent unit, characterized in that: include: Preprocess the data set to obtain the video frame features of the video; Designing an overall network model that takes the video frame features as input and takes the frame importance score as output; Training the overall network model; Convert the frame importance scores output from the trained overall network model into key shots; Combining the key shots into a dynamic video summary; The overall network model that takes video frame features as input and frame importance scores as output includes: An input module, the input module is used to fuse the forward and backward information of the input video frame features, and use a one-layer bidirectional GRU to process the input video frame feature sequence; A memory module, wherein the fused result output by the input module is used as the input of the memory module to obtain storage memory; the memory module uses a multi-hop structure to repeatedly retrieve information in the storage memory and outputs a memory output that retains useful information; An output module, wherein the memory output of the memory module is used as an input of the output module, and the output module regresses the memory output into the frame importance score; Constructing the output module includes: A residual connection is made between the memory output and the fused sequence of the bidirectional GRU output; The output of the residual connection passes through the LN layer and the Dropout layer in sequence; The output result of the Dropout layer is input into a two-layer fully connected network, wherein the number of output layer nodes of the last fully connected layer is 1, and the frame importance score corresponding to each video frame is obtained.
2. The method for implementing video summarization using a memory network and a gated recurrent unit according to claim 1, characterized in that: The preprocessing data set obtains video frame features of the video, including: Sampling the video into a sequence of video frames; The features of the video frame sequence are extracted using a pre-trained GoogLeNet model to obtain video frame features corresponding to each video.
3. The method for implementing video summarization using a memory network and a gated recurrent unit according to claim 1, characterized in that: The input module is constructed, and a one-layer bidirectional GRU is used to process the input video frame feature sequence, including: The forward output of the GRU contains the past information of the current moment; The backward output of the GRU contains future information at the current moment; The bidirectional GRU fuses and adds the forward output and the backward output element by element to obtain complete past and future information at the current moment.
4. The method for implementing video summarization using a memory network and a gated recurrent unit according to claim 3, characterized in that: Constructing the memory module includes: The encoding vector obtained by passing the fusion sequence output by the bidirectional GRU through a fully connected layer is input into the first hop as the original question vector; Inputting the fused sequence output by the bidirectional GRU into two different fully connected layers of the first hop respectively to obtain input memory and output memory; The inner product of the question vector and the input memory is performed and the self-attention weight is obtained through Softmax; The self-attention weight is weighted and summed with the output memory and multiplied element-by-element with the question vector, and then passes through a fully connected layer with a normalization layer and an activation function to obtain a memory output; The memory output is used as a new question vector to input into the next hop to calculate the self-attention weight and memory output; until the memory output of the last hop is used as the input of the output module.
5. The method for implementing video summarization using a memory network and a gated recurrent unit according to claim 4, characterized in that: The fully connected matrix of the output memory between adjacent hop layers is equal to the fully connected matrix of the input memory; the fully connected matrix of the original problem vector is equal to the fully connected matrix of the input memory of the bottom layer.
6. The method for implementing video summarization using a memory network and a gated recurrent unit according to claim 1, characterized in that: The training of the overall network model comprises: The network model is trained using mean square error as the loss function and Adam optimizer.
7. The method for implementing video summarization using a memory network and a gated recurrent unit according to claim 1, characterized in that: The conversion from the frame importance scores output by the trained overall network model to key shots includes: The KTS algorithm is used to detect scene change points. The video segment between two scene change points is regarded as a video shot, and the video is divided into several video shots. For each video shot, the average importance score of all frames in the video shot is calculated as the shot score; A knapsack algorithm is executed on the segmented shots and the shot scores to select key shots.
8. The method for implementing video summarization using a memory network and a gated recurrent unit according to claim 7, characterized in that: The knapsack algorithm aims to maximize the total shot score of key shots and limits the length of the key shots to 15% of the original video length.
