A video summary generation method based on LSTM model with spatial attention constraints

By introducing spatial attention constraints and knapsack algorithm to select key frames in the LSTM model, the problem of video summary in complex scenes of self-media videos is solved, higher-quality video summary generation is achieved, and users' needs for quick understanding of video content are achieved.

CN113553471BActive Publication Date: 2024-10-22SHENZHEN RES INST OF WUHAN UNIVERSITY +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110292441.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-19
Publication Date
2024-10-22
Estimated Expiration
2041-03-19

AI Technical Summary

Technical Problem

Existing video summarization technology is difficult to effectively process complex scenes and high semantic information in self-media videos, resulting in low quality video summarization and inability to meet users' needs for quick understanding of video content.

Method used

The LSTM model based on spatial attention constraints is used to extract the spatial geometric features and depth features of the video frame, combined with the knapsack algorithm to select key frames, generate video summaries, and use spatial attention constraints to improve the accuracy of key frame selection.

Benefits of technology

Significantly improves the quality of video summary generation, can more accurately extract the main content of the video, meets the user's need to quickly understand video information, and improves the effect of self-media video summary.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113553471B_ABST
    Figure CN113553471B_ABST
Patent Text Reader

Abstract

The invention discloses a video summary generation method based on an LSTM model with spatial attention constraint. The method is based on a general reality rule that a lens will focus on and follow key information. On the basis of a long short-term memory model (LSTM) predicting the importance of a video frame, the method further proposes that spatial attention is used to constrain the long short-term memory model (LSTM), and selects key frames according to a backpack algorithm. The method decomposes a video file into a frame sequence, and sequentially uses a deep neural network to extract spatial domain geometric features and depth features of the video frame in chronological order. The spatial domain geometric features are used to determine an area in an image that can attract the attention of an audience, and to predict the attention that can be obtained by the area. The depth features are used as an input of the LSTM model, and implicit information of the LSTM model formed by calculation can be used to predict a relevance score between a current image and a context. The spatial attention score is used to constrain the calculation of a relevance score of the LSTM model, and the generation result of the video summary is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video summarization, and in particular relates to a video summary generation method for self-media videos based on an LSTM model with spatial attention constraints. Background Art

[0002] The rise of short videos has reduced Internet users' tolerance for video length. When watching long videos, users hope to quickly understand the theme of the video and the essence of the video in a short time. Data shows that most users can accept a video length of less than five minutes, and up to 70.5% of users hope that entertainment short videos are limited to one minute. The large amount of videos on the Internet has brought great inconvenience to users who want to understand the content of the video. Generally speaking, users need to spend almost the same amount of time watching the video as the video itself. In this way, within the effective time, users can only understand a small part of the video content by watching the video, which does not meet the current users' pursuit of short videos. Therefore, there is an urgent need for a method to help people quickly understand the main content of these massive videos in a short time.

[0003] The purpose of video summarization is to represent the original video content through a short video. This technology can automatically analyze the content of the original video and extract key segments to form a shorter video. It is convenient for self-media platforms to quickly retrieve, browse, store, and disseminate video information, which is of great significance to the circulation of information.

[0004] Existing video summarization methods have certain limitations in their application areas, such as streamlining sports videos and surveillance videos. Such technologies can only process relatively simple content or measure the criticality of video frames with additional auxiliary information. However, in self-media videos, scenes change frequently in a short period of time, which greatly increases the complexity of semantic information and also contains more interfering information. Therefore, traditional methods cannot solve the problem of summarization of self-media videos very well. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a video summary generation method based on an LSTM model with spatial attention constraints.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A video summary generation method based on an LSTM model with spatial attention constraints, comprising the following methods:

[0008] ① Generate video summary: Given a long video sequence In the video, a key frame sequence is extracted to form a short video. w, h, c are the length, width, and number of channels of the video frame, t is the sequence number of the video frame, and T is the total number of video frames. y t ∈[0,1] indicates whether the tth frame is selected as a key frame, "1" means true, "0" means false, and the generated video summary is expressed as

[0009] X sub ={x t |t∈E},E={t∈[1,T]|y t =1};

[0010] ② Based on the spatial geometric feature information z t , deep features v t Two types of information describe the video summary;

[0011] The specific implementation includes the following steps:

[0012] Step 1: Given a video frame image, the spatial geometric feature expression and depth feature expression are respectively

[0013] Step 2: Spatial Attention Constraint Model: Spatial Geometric Features is the input of the spatial attention constraint model, which is the set of grayscale values ​​of the pixel block z t ={o(i,j):i∈[1,w],j∈[1,h]}, reflects the salient and non-salient areas of an image through the size of the grayscale value; if the grayscale value of the pixel block is greater than the preset threshold Then the area is marked as a salient domain, otherwise it is a non-salient domain; therefore, the size of the salient domain of an image is recorded as Then the spatial attention score of the image is recorded as l t , is the proportion of the salient domain of the current image to the sum of the salient domain areas of all video sequences

[0014] Step 3, LSTM model: the entire deep feature As the input of the LSTM model, the hidden state after LSTM model processing is The hidden state encapsulates the semantic information of the forward frame information and the current information, and finally connects the multi-layer perception network to output the relevance score m of each frame to the context t , the calculation formula is m t =p(p t |p1,p2,...,p t-1 ,V), where the LSTM model predicts the probability value for each frame of the image p(·) represents the context relevance score function of the multi-layer perception network to calculate the video image;

[0015] Step 4, importance score under spatial attention constraint: The importance score under spatial attention constraint is denoted as β t =m t +λ·l t , where λ is the influencing factor of the spatial attention score;

[0016] Step 5, the selection of key frame sequence, the event of "whether each frame is selected as a key frame" conforms to the knapsack problem, which is not greater than the maximum capacity N, the number of selected key frames is the least, and the value of the selected key frames is the greatest, that is, the length of the video summary is not greater than 15% of the length of the original video, and the sum of importance scores is maximized under the minimum number of frames.

[0017] Preferably: in step 5, the importance score β t The value of each frame is considered as the maximum allowed number of video frames. N , the number of selected key frames is recorded as the penalty term The value of the keyframe and the target item Complete objective function writing where y t It is 0 or 1, 0 represents non-key frame, 1 represents key frame; Y represents the number of selected video frames; C is the penalty parameter.

[0018] Preferably: spatial geometric feature information z t , z t ∈R w*h Using deep network extraction, the input of the deep network is the key frame sequence x t The input and output of each layer of the convolutional network is a set of arrays, called feature maps, with sizes w, h, c, which represent the length, width and number of channels of the layer respectively; the calculation of each layer of convolution is g s (x; W, b) = W* s x+b,* s represents a convolution operation with a step size of s, W, b represents the weight and bias of the convolution kernel; the convolution network outputs a coarse-grained, low-resolution feature map, so a multi-layer deconvolution network is superimposed after the convolution network to sample and process the feature map, and the pixel-level salient area prediction result z is output. t =D S (F S (x; Θ F );Θ D ), x represents the input image; F S (·) represents the feature map output by the convolutional layer; D S (·) represents the output result of upsampling of the deconvolution layer; Θ F ,Θ D Represent the parameters of the convolution layer and the deconvolution layer respectively; finally, a set of arrays is output to represent the spatial geometric feature information zt .

[0019] Preferably: a deep convolutional neural network VGGNet with a depth of 16 layers is used to extract deep features v t .

[0020] The present invention is based on the general law of reality - the lens will focus on and follow key information. On the basis of the long short-term memory model (LSTM) predicting the importance of video frames, it further proposes that spatial attention is used to constrain the long short-term memory model (LSTM), and selects key frames according to the backpack algorithm. Specifically, it includes: decomposing the video file into a frame sequence, and using a deep neural network to extract the spatial domain geometric features and depth features of the video frames in chronological order; the spatial domain geometric features are used to determine the area in the image that can attract the audience's attention, and predict the attention that the area can obtain; the deep features are used as the input of the LSTM model, and the implicit information of the LSTM model is calculated and can be used to predict the correlation score between the current image and the context; the spatial attention score is used to constrain the calculation of the correlation score of the LSTM model, which effectively improves the generation result of the video summary. See the system framework diagram of the present invention. Figure 1 The test results on two major video summarization datasets demonstrate the effectiveness of the LSTM model based on spatial attention constraints.

[0021] The method of the present invention is based on a general law of reality: a photographer will focus on and follow key information when taking a photo.

[0022] The present invention solves the problem of video summarization for self-media videos, making full use of the attention of geometric features in the spatial domain of video frames to constrain the calculation of the importance of video frames. In addition, the present invention proposes a new video summarization framework based on the LSTM model with spatial attention constraints to solve the above problem.

[0023] Compared with the existing video summarization technology and system, the present invention has the following advantages and beneficial effects:

[0024] 1) Compared with the prior art, the present invention solves a new problem, namely, the problem of video summarization under user self-media videos.

[0025] 2) Compared with the prior art, the present invention proposes a new video summary generation technology based on the LSTM model with spatial attention constraints.

[0026] 3) Compared with the prior art, the present invention utilizes the geometric spatial information of video frames, quantifies the spatial attention obtained by video frames, and its correlation to carry out video summarization work under casually shot videos.

[0027] 4) The video summarization method of the LSTM model based on spatial attention constraints combines deep features and spatial geometric characteristic features, which improves the ability to filter redundant key frames when selecting key frames, so the accuracy of the model in selecting key frames is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 : is a schematic diagram of the overall framework of the method of the present invention;

[0029] Figure 2 : is a flow chart of the method of the present invention;

[0030] Figure 3 : It is a convolutional layer parameter map of the spatial geometric feature extraction model of the present invention;

[0031] Figure 4 : is the overall structure diagram of the spatial geometric feature extraction model of the present invention;

[0032] Figure 5 : It is the semantic feature extraction model diagram of the present invention. DETAILED DESCRIPTION

[0033] In order to facilitate ordinary technicians in the field to understand and implement the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0034] like Figure 1 As shown, in view of the shortcomings of the prior art, the present invention provides a method for generating video summaries based on an LSTM model with spatial attention constraints. This method is based on the general law of reality—the lens will focus on and follow key information. On the basis of the long short-term memory model (LSTM) predicting the importance of video frames, it further proposes that spatial attention is used to constrain the long short-term memory model (LSTM), and selects key frames according to the backpack algorithm. Specifically, it includes: decomposing the video file into a frame sequence, and using a deep neural network to extract the spatial domain geometric features and depth features of the video frame in chronological order; the spatial domain geometric features are used to determine the area in the image that can attract the audience's attention, and predict the attention that the area can obtain; the depth features are used as the input of the LSTM model, and the implicit information of the LSTM model formed by calculation can be used to predict the correlation score between the current image and the context; the spatial attention score is used to constrain the calculation of the correlation score of the LSTM model, which effectively improves the generation result of the video summary.

[0035] See the flowchart Figure 2This embodiment uses vs2013 as a simulation experiment platform and uses the public new media video data sets SumMe and TVSum for testing. The SumMe data set contains 25 videos with a video length of 1 to 10 minutes. The TVSum data set contains 50 long videos with a video length of 1-10 minutes. The following further describes the present invention with respect to the above examples. The process of the present invention includes:

[0036] 1. Several definitions

[0037] ① Video summary: In a given long video sequence, extract important video frame sequences to form a short video. w, h, c are the video sizes, t is the video frame number, y t ∈[0,1] represents t th Whether the frame is selected as a keyframe, "1" means true and "0" means false. The generated summary is represented by X sub ={x t |t∈E},E={t∈[1,T]|y t =1}.

[0038] ② Method for obtaining spatial geometric features of video frames: spatial geometric feature information z t , z t ∈R w*h Using deep network extraction, the specific network parameters are as follows Figure 3 shown.

[0039] The input of the deep network is a key frame sequence x t The input and output of each layer of the convolutional network is a set of arrays, called feature maps, with sizes w, h, c, which represent the length, width and number of channels of the layer respectively. The calculation of each convolution layer is g s (x; W, b) = W* s x+b.* s The convolution network outputs a coarse-grained, low-resolution feature map, so a multi-layer deconvolution network is superimposed after the convolution network to upsample the feature map and output the pixel-level salient region prediction result z. t =D S (F S (x; Θ F );Θ D ). x represents the input image; F S (·) represents the feature map output by the convolutional layer; D S (·) represents the output result of upsampling of the deconvolution layer; Θ F ,Θ DRepresent the parameters of the convolution layer and the deconvolution layer respectively; finally, a set of arrays is output to represent the spatial geometric feature information z t .

[0040] ③ Method for obtaining deep features of video frames: deep features vt , The deep convolutional neural network VGGNet is used. VGGNet has a total of 16 layers and a 5-segment convolution structure. Each convolution segment contains at least one convolution layer, and each segment is followed by a maximum pooling layer at the end to reduce the image size. The number of convolution kernels in each segment is the same, and the number of convolution kernels at the end is greater. We use the ImageNet image database with tens of millions of images to pre-train VGGNet, so that VGGNet learns to classify 1,000 semantic data. Secondly, the trained VGGNet is used to detect the deep feature vector in the video image, which has a dimension of 1,000.

[0041] ④ Determination of key frames: The present invention uses a knapsack algorithm to select key frames. According to the importance score of each frame, the minimum number of key frames and the maximum total importance score are selected as much as possible without exceeding the maximum number of frames of the video summary.

[0042] 2. LSTM model based on spatial attention constraints

[0043] 1. The spatial geometric features and depth features of a given video frame image are described as

[0044] 2. Spatial Attention Constraint Model: Spatial Geometric Features is the input of the spatial attention constraint model. This feature is a collection of grayscale values ​​of pixel blocks. zt ={o(i,j):i∈[1,w],j∈[1,h]}, reflects the salient and non-salient areas of an image through the size of the grayscale value. If the grayscale value of the pixel block is greater than the preset threshold Then the area is marked as a salient domain, otherwise it is a non-salient domain. Therefore, the size of the salient domain of an image is recorded as Then the spatial attention score of the image is recorded as l t , is the proportion of the salient domain of the current image to the sum of the salient domain areas of all video sequences

[0045] 3.LSTM model: the entire depth feature As the input of the LSTM model. The LSTM model processes the hidden state The hidden state encapsulates the semantic information of the forward frame information and the current information. Finally, the multi-layer perception network is connected to output the score m of the relevance between each frame and the context t , the calculation formula is m t=p(p t |p1,p2,...,p t-1 ,V).

[0046] 4. Importance score under spatial attention constraint: In the video summarization method based on the LSTM model of spatial attention constraint, the deep features and spatial geometric characteristics are combined to improve the ability to filter redundant key frames when selecting key frames. Therefore, the accuracy of the model in selecting key frames is significantly improved. The importance score under the constraint is expressed as β t =m t +λ·l t , where the parameter λ is set to 0.5.

[0047] 3. Selection of key frame sequence

[0048] The importance score β t The maximum number of video frames allowed to be selected for the video summary is considered as the maximum capacity N = 1800. The event of "whether each frame is selected as a key frame" conforms to the knapsack problem, that is, when the number of selected key frames is not greater than the maximum capacity, the value of the selected key frames is the minimum and the value of the selected key frames is the maximum. The number of selected key frames is recorded as the penalty item The value of the keyframe and the target item Complete objective function writing where y t It is 0 or 1, 0 represents non-key frame and 1 represents key frame; Y represents the number of selected video frames; C is the penalty parameter set to 1.

[0049] The method of the present invention is based on a general law of reality: a photographer will focus on and follow key information when taking photos and recording.

[0050] Video summary effect evaluation

[0051] F-score evaluation index: In order to compare fairly with other methods, we use the most commonly used evaluation standard F-score as the test index of our method. A represents the length of the automatically generated summary, B represents the length of the true summary, P represents precision, and R represents recall.

[0052]

[0053] F-score calculates the similarity between the automatically generated summary and the true summary:

[0054]

[0055] The F-SCORE results of this method and other cutting-edge methods on TVSum and SumMe are shown in Table 1. From Table 1, it can be found that the performance of the video summarization method of the present invention is significantly improved, which also proves the effectiveness of this technology.

[0056] Table 1 Comparison with other cutting-edge methods

[0057]

[0058]

[0059] It should be understood that parts not elaborated in detail in this specification belong to the prior art.

[0060] It should be understood that the above description of the preferred embodiment is relatively detailed and cannot be regarded as limiting the scope of patent protection of the present invention. Under the enlightenment of the present invention, ordinary technicians in this field can also make substitutions or modifications without departing from the scope of protection of the claims of the present invention, which all fall within the scope of protection of the present invention. The scope of protection requested for the present invention shall be based on the attached claims.

Claims

1. A video summary generation method based on a LSTM model with spatial attention constraints, characterized by: The following methods are included: ① Generate video summary: Given a long video sequence In the video, a key frame sequence is extracted to form a short video. w, h, c are the length, width, and number of channels of the video frame, t is the sequence number of the video frame, and T is the total number of video frames. Indicates whether the tth frame is selected as a key frame, "1" means true, "0" means false, and the generated video summary is expressed as X sub ={x t |t∈E},E={t∈[1,T]|y t =1}; ② Based on the spatial geometric characteristics z t , deep features v t Two types of information describe the video summary; The specific implementation includes the following steps: Step 1: Given a video frame image, the spatial geometric feature expression and depth feature expression are respectively Step 2: Spatial Attention Constraint Model: Spatial Geometric Features is the input of the spatial attention constraint model, which is the set of grayscale values ​​of the pixel block z t ={o(i,j):i∈[1,w],j∈[1,h]}, reflects the salient and non-salient areas of an image through the size of the grayscale value; if the grayscale value of the pixel block is greater than the preset threshold Then the area is marked as a salient domain, otherwise it is a non-salient domain; therefore, the size of the salient domain of an image is recorded as Then the spatial attention score of the image is recorded as l t , is the proportion of the salient domain of the current image in the sum of the salient domain areas of all video sequences Step 3, LSTM model: the entire deep feature As the input of the LSTM model, the hidden state after LSTM model processing is The hidden state encapsulates the semantic information of the forward frame information and the current information, and finally connects the multi-layer perception network to output the relevance score m of each frame to the context t The calculation formula is, m t =p(p t |p1,p2,...,p t-1 ,V), where the LSTM model predicts the probability value for each frame of the image p(·) represents the context relevance score function of the multi-layer perception network to calculate the video image; Step 4, importance score under spatial attention constraint: The importance score under spatial attention constraint is denoted as β t =m t +λ·l t , where λ is the influencing factor of the spatial attention score; Step 5, the selection of key frame sequence, the event of "whether each frame is selected as a key frame" conforms to the knapsack problem, which is not greater than the maximum capacity N, the number of selected key frames is the least, and the value of the selected key frames is the greatest, that is, the length of the video summary is not greater than 15% of the length of the original video, and the sum of importance scores is maximized under the minimum number of frames.

2. The video summary generation method based on the LSTM model of spatial attention constraint as claimed in claim 1, characterized in that: In step 5, the importance score β t The value of each frame is considered as the maximum allowed number of video frames. N , the number of selected key frames is recorded as the penalty term The value of the keyframe and the target item Complete objective function writing where y t It is 0 or 1, 0 represents non-key frame, 1 represents key frame; Y represents the number of selected video frames; C is the penalty parameter.

3. The video summary generation method based on the LSTM model of spatial attention constraint as claimed in claim 1, characterized in that: Spatial geometric feature information z t , z t ∈R w*h Using deep network extraction, The input of the deep network is a key frame sequence x t The input and output of each layer of the convolutional network is a set of arrays, called feature maps, with sizes w, h, c, which represent the length, width and number of channels of the layer respectively; the calculation of each layer of convolution is g s (x; W, b) = W* s x+b,* s represents a convolution operation with a step size of s, W, b represents the weight and bias of the convolution kernel; the convolution network outputs a coarse-grained, low-resolution feature map, so a multi-layer deconvolution network is superimposed after the convolution network to sample and process the feature map, and the pixel-level salient area prediction result z is output. t =D S (F S (x; Θ F );Θ D ), x represents the input image; F S (·) represents the feature map output by the convolutional layer; D S (·) represents the output result of upsampling of the deconvolution layer; Θ F ,Θ D Represent the parameters of the convolution layer and the deconvolution layer respectively; finally, a set of arrays is output to represent the spatial geometric feature information z t .

4. The video summary generation method based on the LSTM model of spatial attention constraint as claimed in claim 1, characterized in that: A 16-layer deep convolutional neural network VGGNet is used to extract deep features v t .

Citation Information

Patent Citations

  • Video abstraction method based on attention expansion coding and decoding network

    CN110110140A

  • Training method of video abstract generation model and video abstract generation method and device

    CN112231516A

  • Video abstract generation method based on space-time attention model

    CN112418012A