Video-oriented controllable text abstract generation method
Through a video-oriented controllable text summary generation method, feature extraction and reinforcement learning optimization are used to solve the problem of information loss and uncontrollability in the video summary generation process in the existing technology, and achieve highly logical and controllable video summary generation. , which improves the accuracy and applicability of video summarization.
Patent Information
- Application Number
- CN202310174847.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2024-08-30
AI Technical Summary
Existing video summarization methods are prone to losing intermediate hidden information during the encoding stage, and the generated summary content is uncontrollable, making it difficult to meet the sensitivity requirements of high-frequency information in videos.
A video-oriented controllable text summary generation method is adopted to ensure the generated summary through data set collection, control signal extraction, video segmentation, feature extraction, fusion encoding, control object detection, generator construction, multi-layer LSTM decoding and reinforcement learning optimization. The content is highly logical and controllable.
It effectively improves the accuracy of video summary. The generated summary content is highly logical, the text content is controllable, and the readability is high, which improves the application implementation.
Smart Images

Figure CN118570689A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision, and in particular to a video-oriented controllable text summary generation method. Background Art
[0003] Most existing video summarization tasks use a summary generation framework based on encoding and decoding. Usually, the encoder is composed of a convolutional neural network (CNN), and the feature decoder is composed of an LSTM long short-term memory neural network. This type of method directly uses the input result of the feature encoder as the input of the feature decoder. Although the above method can achieve some video summarization tasks, it is very easy to cause the loss of hidden information of video features in the hybrid encoding stage; in addition, it is highly sensitive to high-frequency information in the video and is not controllable for the generated summary content. Summary of the invention
[0004] In order to overcome the problems that existing video summarization methods are very likely to lose a large amount of intermediate hidden information during the encoding stage and the generated summary content is uncontrollable, the present invention proposes a controllable text summary generation method for video to effectively improve the accuracy of video summarization and generate an effective summary with controllable content.
[0005] The technical solution of the present invention is achieved in this way:
[0006] A controllable text summary generation method for video, comprising the steps of
[0007] S1: Dataset collection, scene video collection, and text summary calibration;
[0008] S2: Control signal extraction, extracting corresponding control signals based on manually calibrated text summary dataset;
[0009] S3: Video data segmentation, using OpenCV library functions to cut the video into multiple video frames in seconds;
[0010] S4: Feature extraction, extracting static and dynamic features of the video based on CLIP network and I3D network, and using fusion encoder to unify different video feature dimensions;
[0011] S5: Feature encoding, encoding the fused features into video vectors based on the Encoder block of Vision Transformer;
[0012] S6: Build a control object detector. The control signal extracted by S2 is used in the training phase, and the detector is used to predict the control object in the inference phase.
[0013] S7: Build a control object generator to generate all control objects at once based on a single-layer Transformer decoder;
[0014] S8: Feature decoding, using a multi-layer LSTM network to perform temporal decoding on the fused encoded features, and generate a video summary in combination with the control object; S9: Reinforcement learning optimization, during the model training process, the reinforcement learning Policy Gradient method is used to optimize the model parameters.
[0015] Furthermore, the data set collection in step S1 is carried out in cooperation with a security monitoring unit to collect and organize videos and perform manual summary calibration.
[0016] Furthermore, the control signal extraction described in step S2 is based on the manually calibrated text summary in the data set collected in S1 to extract the control signal of the corresponding video.
[0017] Furthermore, the video segmentation described in step S3 is to implement a video cutting method based on the OpenCV library function, and the input video is divided into multiple frames in seconds. The number of frames after cutting is different for different video lengths.
[0018] Furthermore, the feature extraction described in step S4 is based on the CLIP network and the I3D network to extract static and dynamic features of the video, and use a fusion encoder to unify different video feature dimensions.
[0019] Furthermore, the feature encoding in step S5 is based on the Encoder block of the Vision Transformer to encode the fused features into a video vector. Furthermore, the construction of the control object detector in step S6 is to realize the control object detection by using two linear layers combined with ReLU and sigmoid.
[0020] Furthermore, the construction of the control object generator described in step S7 is based on a single-layer Transformer decoder to generate all control objects at one time. Furthermore, the feature decoding described in step S8 is to use a multi-layer LSTM network to decode the encoding results one by one, and generate a controllable video summary according to the encoding results.
[0021] Furthermore, the reinforcement learning optimization described in step S9 includes the steps of
[0022] S91: When step S8 generates an end identifier <end>When , the Policy Gradient reinforcement learning algorithm is used to calculate the CIDEr value based on the generated summary and the manually calibrated summary, and the result calculated by formula (1) is fed back to the encoder as the reward value.
[0023]
[0024] Where c is the candidate summary, s is the reference summary set, n is the value of n-gram, M is the number of reference summaries, g is the n (·) indicates the TF-IDF value based on n-gram;
[0025] S92: Calculate the minimum loss value L(θ) according to the reward value, optimize the model, and calculate the minimum loss value as shown in formula (2).
[0026] Among them, ω s is the word sequence sampled by the model, r is the reward function, p θ is the policy function, θ is the model parameter;
[0027] S93: Repeat steps S91 and S92 until the model reaches a saturated state.
[0028] Further or further, the feature vector encoder in step S5 is implemented by combining 12 VisionTransformer Encoder blocks, including the steps
[0029] S51: After normalizing the static features of the video frame and the I3D dynamic features extracted by the CLIP network, the output of the multi-head attention is calculated using formula (3).
[0030] z′ l =MSA(LN(z l-1 ))+z l-1 ,l=1,2,...,L (3)
[0031] Among them, z′ l is the calculation result of multi-head attention; L is the number of frames corresponding to each video;
[0032] S52: The calculation results of the multi-head attention are normalized again and used as the input of the multi-layer perceptron. The calculation is shown in formula (4).
[0033] z l =MLP(LN(z′ l ))+z′ l ,l=1,2,...,L (4)
[0034] Among them, z l is the output value of the multi-layer perceptron; L is the number of frames corresponding to each video.
[0035] Further or even further, the controllable summary is generated by calculating 20 groups of predicted probability values corresponding to each video, and taking out the word corresponding to the maximum value in each group of probability values to form a final controllable summary text.
[0036] The beneficial effect of the present invention is that, compared with the prior art, a new method is provided for video summarization, which effectively ensures the controllability of summary generation and enhances the application feasibility. The video summary generated by the present invention has the advantages of strong logic, controllable text content and high readability. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flow chart of a controllable text summary generation method for video according to the present invention;
[0038] Figure 2 A schematic diagram of the system structure of a controllable video-oriented text summary generation method of the present invention;
[0039] Figure 3 A detailed flow chart of a controllable text summary generation method for video according to the present invention;
[0040] Figure 4 The present invention is a detailed implementation flow chart of a method for generating controllable text summaries for videos. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] The overall principle of the controllable text summary generation method for video of the present invention is shown in the attached figure. Figure 1 and attached Figure 2 As shown, the technical solution of the present invention is as follows: first, a data set is constructed by collecting videos and calibrating text summary data for the videos; then data segmentation is performed, the videos are cut into multiple frames in seconds using OpenCV, and a control object table is constructed based on the calibrated text; secondly, feature extraction is performed, static and dynamic features of the video are extracted based on the CLIP network and the I3D network, different video feature dimensions are unified using a fusion encoder, and the fusion features are encoded based on the Encoder block of the Vision Transformer; a control object detector is constructed again, the real calibrated control objects are used in the training phase, the predicted objects are used in the testing phase, and a control object generator is constructed separately, all objects are generated at one time based on a single-layer Transformer decoder; finally, feature decoding is performed, the encoded features are decoded using a multi-layer LSTM network, a controllable video text summary is generated, and during the training process, model parameters are optimized using reinforcement learning for model parameters.
[0043] like Figure 3 As shown, a controllable text summary generation method for video of the present invention comprises the following steps
[0044] S1: Dataset collection, scene video collection, and text summary calibration;
[0045] S2: Control signal extraction, extracting corresponding control signals based on manually calibrated text summary dataset;
[0046] S3: Video data segmentation, using OpenCV library functions to cut the video into multiple video frames in seconds;
[0047] S4: Feature extraction, extracting static and dynamic features of the video based on CLIP network and I3D network, and using fusion encoder to unify different video feature dimensions;
[0048] S5: Feature encoding, encoding the fused features into video vectors based on the Encoder block of Vision Transformer;
[0049] S6: Build a control object detector. The control signal extracted by S2 is used in the training phase, and the detector is used to predict the control object in the inference phase.
[0050] S7: Build a control object generator to generate all control objects at once based on a single-layer Transformer decoder.
[0051] The main process for the above steps of generating control objects is as follows:
[0052] S71: After step S5 generates the video feature encoding vector V, the final summary inclusion object is generated by combining the vector O generated by the control object detector and the input sequence S0, and the calculation is shown in formula (1).
[0053]
[0054] in, is the input sequence, is the video fusion coding vector, O∈R M To control the object detector output, is the linear transformation matrix.
[0055] S8: Feature decoding, using a multi-layer LSTM network to perform temporal decoding on the fused encoded features, and generate a video summary in combination with the control object; S9: Reinforcement learning optimization, during the model training process, the reinforcement learning Policy Gradient method is used to optimize the model parameters.
[0056] The main process for the aforementioned reinforcement learning optimization steps is:
[0057] S91: When step S8 generates a text end identifier <end>When , the Policy Gradient reinforcement learning algorithm is used to calculate the CIDEr value based on the generated summary and the reference summary, and the calculation result is fed back to the feature encoder as the reward value. The calculation is shown in formula (2).
[0058]
[0059] Where c is the candidate summary, s is the reference summary set, n is the value of n-gram, M is the number of reference summaries, g is the n (·) indicates the TF-IDF value based on n-gram;
[0060] S92: Calculate the minimum loss value L(θ) according to the reward value, optimize the model, and calculate the minimum loss value as shown in formula (3).
[0061]
[0062] Among them, ω s is the word sequence sampled by the model, r is the reward function, p θ is the policy function, θ is the model parameter;
[0063] S93: Repeat steps S91 and S92 until the model reaches a saturated state.
[0064] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.< / end> < / end>
Claims
1. A controllable text summary generation method for video, characterized in that: Includes steps: S1: Dataset collection, scene video collection, and text summary calibration; S2: Control signal extraction, extracting corresponding control signals based on manually calibrated text summary dataset; S3: Video data segmentation, using OpenCV library functions to cut the video into multiple video frames in seconds; S4: Feature extraction, extracting static and dynamic features of the video based on CLIP network and I3D network, and using fusion encoder to unify different video feature dimensions; S5: Feature encoding, encoding the fused features into video vectors based on the Encoder block of Vision Transformer; S6: Build a control object detector. The control signal extracted by S2 is used in the training phase, and the detector is used to predict the control object in the inference phase. S7: Build a control object generator to generate all control objects at once based on a single-layer Transformer decoder; S8: Feature decoding, using a multi-layer LSTM network to perform temporal decoding on the fused encoded features and generate a video summary in combination with the control object; S9: Reinforcement learning optimization. During model training, the reinforcement learning Policy Gradient method is used to optimize model parameters.
2. A controllable text summary generation method for video according to claim 1, characterized in that: The scene video collection described in step S1 and the manual calibration of the text summary of the corresponding video.
3. A controllable text summary generation method for video according to claim 1, characterized in that: The control signal extraction described in step S2 extracts the control signal corresponding to the video based on the manually calibrated text summary constructed in step S1.
4. The method for generating a controllable text summary for a video according to claim 1, characterized in that: The video data segmentation described in step S3 is to segment the input video into multiple frames in seconds through the OpenCV library function. The number of frames after segmentation varies depending on the length of the video.
5. A method for generating a controllable text summary for a video as claimed in claim 1, characterized in that: The feature extraction described in step S4 is based on the CLIP network and the I3D network to extract the static and dynamic features of the video, and use a fusion encoder to unify the video features of different dimensions.
6. A method for generating a controllable text summary for a video as claimed in claim 1, characterized in that: The feature encoding described in step S5 is to send the fused video feature vector to the Vision Transformer encoder for feature encoding.
7. A video-oriented controllable text summary generation method as claimed in claim 1, characterized in that: The control object detector constructed in step S6 uses the control signal extracted in step S2 in the model training phase and the predicted control signal in the inference phase.
8. A method for generating a controllable text summary for a video as claimed in claim 1, characterized in that: The control object generator based on the single-layer Transformer described in step S7 includes the steps of: S81: After the video feature encoding vector V is generated in step S5, the final summary inclusion object is generated by combining the vector O generated by the control object detector and the input sequence S0.
9. A method for generating a controllable text summary for a video as claimed in claim 1, characterized in that: The feature decoding described in step S8 uses a multi-layer LSTM network to perform temporal decoding on the feature vector after fusion encoding, and generates a video summary in combination with the control signal.
10. The method for generating a controllable text summary for a video according to claim 1, characterized in that: The reinforcement learning optimization described in step S9 includes the steps of S91: When step S8 generates a text end identifier <end> When the CIDEr value is calculated based on the generated summary and the reference summary, the Policy Gradient reinforcement learning algorithm is used, and the calculation result is fed back to the feature encoder as a reward value.< / end> S92: Calculate the minimum loss value L(θ) based on the reward value and optimize the model. S93: Repeat steps S91 and S92 until the model reaches a saturated state.
11. A method for generating a controllable text summary for a video according to claim 1, characterized in that: The encoder in step S5 is formed by stacking 12 Vision Transformer Encoder blocks, and the implementation includes the following steps: S51: After normalizing the static features of the video frame and the I3D dynamic features extracted by the CLIP network, a multi-head attention mechanism is used. S52: The calculation results of the multi-head attention are normalized again and used as the input of the multi-layer perceptron.
12. A method for generating a controllable text summary for a video according to claim 1, characterized in that: The summary is generated under the guidance of the control signal by calculating 20 groups of predicted probability values corresponding to each video, and taking out the word corresponding to the maximum value in each group of probability values to form the final summary text.
Citation Information
Patent Citations
Video content description method based on Vision Transform and reinforcement learning
CN115249275A
