Video repair method, device and medium
The video degradation representation is extracted through the feature extraction network and combined with the super-resolution network, which solves the distortion problem caused by the compression encoding method in the existing technology, significantly improves the video repair effect, and achieves better video quality and resolution.
Patent Information
- Application Number
- CN202111039056.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-06
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-09-06
AI Technical Summary
Existing video repair technology ignores the distortion problem caused by compression and encoding methods, resulting in poor video repair results.
The feature extraction network is used to extract the degraded representation of the video, and combined with the super-resolution network for training and repair, it can adapt to the noise caused by different compression encoding methods and improve the video repair effect.
By combining degradation representation and super-resolution network, the video repair effect is significantly improved, the noise of different compression encoding methods is adapted, and the video quality and resolution are improved.
Smart Images

Figure CN113724136B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a video repair method, device, and medium. Background Art
[0002] Existing video quality improvement mainly uses algorithms such as noise reduction, deblurring and super-resolution to improve the image quality and resolution of video files. Among them, noise reduction and deblurring algorithms mainly use low-pass filtering and other methods to filter and reduce noise and Gaussian sharpening of the picture. The super-resolution method mainly calculates optical flow, aligns multiple video frames, and extracts features by using redundant information of adjacent video frames. The blurred areas in the current frame can be borrowed from adjacent frames and used to restore high-resolution images.
[0003] The above-mentioned prior art ignores the various possible distortions of real video data caused by compression encoding methods, such as MPEG-2 and HEVC compression noise, which leads to poor video restoration effects. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a video repair method, device and medium, which can repair the video correspondingly according to the noise caused by different compression encoding methods, and improve the video repair effect. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a video repair method, comprising:
[0006] Acquire a first training data set, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos;
[0007] Extracting a first degradation representation of each first low-resolution video in the first training data set using a trained feature extraction network, wherein the first degradation representation is used to represent a compression encoding method of the corresponding first low-resolution video;
[0008] Inputting the first degradation representation and the first low-resolution video into a pre-constructed super-resolution network to obtain a predicted high-resolution video;
[0009] Determining a first error between the predicted high-resolution video and the high-resolution video, and updating the super-resolution network based on the first error until the super-resolution network converges to obtain a trained super-resolution network;
[0010] When the video to be repaired is obtained, the trained feature extraction network is used to extract a second degradation representation of the video to be repaired, and the second degradation representation and the video to be repaired are input into the trained super-resolution network to obtain a repaired high-resolution video.
[0011] Optionally, before extracting the first degradation representation of each first low-resolution video in the first training data set using the trained feature extraction network, the method further includes:
[0012] Acquire second training set data, wherein the second training set data includes a plurality of second low-resolution videos and corresponding degradation representation labels, and the degradation representation label represents an actual compression encoding method of the second low-resolution video manually marked;
[0013] Inputting each of the second low-resolution videos into a pre-built feature extraction network to obtain a predicted degradation representation of each of the second low-resolution videos;
[0014] A second error is determined based on the predicted degradation representation and the degradation representation label, and the feature extraction network is updated based on the second error until the feature extraction network converges to obtain the trained feature extraction network.
[0015] Optionally, inputting each of the second low-resolution videos into a pre-built feature extraction network to obtain a predicted degradation representation of each of the second low-resolution videos includes:
[0016] Decoding each of the second low-resolution videos in the second training data set;
[0017] Saving each second low-resolution video frame in each decoded second low-resolution video in a lossless picture format to obtain different second low-resolution video frame sequences, wherein one decoded second low-resolution video corresponds to one second low-resolution video frame sequence;
[0018] Inputting each of the second low-resolution video frames in each of the second low-resolution video frame sequences into a pre-constructed feature extraction network to obtain a predicted degradation representation of each of the second low-resolution video frames, so as to obtain a predicted degradation representation of each of the second low-resolution videos;
[0019] Accordingly, determining a second error based on the predicted degradation characterization and the degradation characterization label includes:
[0020] A corresponding second error is determined based on the predicted degradation representation of each of the second low-resolution video frames and the corresponding degradation representation label.
[0021] Optionally, determining a corresponding second error based on the predicted degradation representation of any second low-resolution video frame and the degradation representation label of the second low-resolution video frame includes:
[0022] When the feature extraction network is a feature extraction network based on Triplet Loss, determining a first parameter and a second parameter according to a degradation representation label corresponding to the second low-resolution video frame, wherein the first parameter is a degradation representation of a video frame in the feature extraction network that has the same compression encoding method as the second low-resolution video frame, and the second parameter represents a degradation representation of a video frame in the feature extraction network that has a different compression encoding method from the second low-resolution video frame;
[0023] A triplet loss of the second low-resolution video frame is determined based on the predicted degradation representation of the second low-resolution video frame, the first parameter, and the second parameter.
[0024] Optionally, the convolution layer in the feature extraction network adopts depth-wise separable convolution, and when data passes through the convolution layer in the feature extraction network, point-by-point convolution is first performed, and after the point-by-point convolution is completed, channel-by-channel convolution is performed.
[0025] Optionally, the step of inputting the first degradation representation and the first low-resolution video into a pre-built super-resolution network to obtain a predicted high-resolution video comprises:
[0026] Dividing each first low-resolution video frame sequence included in the first training data set into different first low-resolution video frame subsequences using a sliding window and a preset step size, wherein the number of video frames included in each of the first low-resolution video frame subsequences is an odd number;
[0027] Each of the first low-resolution video frame subsequences and the corresponding first degradation representation is sequentially input into a pre-constructed super-resolution network to obtain a predicted high-resolution video frame corresponding to each of the first low-resolution video frames.
[0028] Optionally, sequentially inputting each of the first low-resolution video frame subsequences and the corresponding first degradation representations into a pre-constructed super-resolution network to obtain a predicted high-resolution video frame corresponding to each of the first low-resolution video frames includes:
[0029] Inputting a currently input first low-resolution video frame subsequence into the super-resolution network;
[0030] Performing implicit feature alignment on the currently input first low-resolution video frame subsequence through the feature alignment layer in the super-resolution network to obtain a corresponding aligned feature map;
[0031] Splicing the aligned feature maps to obtain a spliced feature map;
[0032] Inputting the spliced feature map and the target degradation representation into the super-resolution layer in the super-resolution network to obtain a first target high-resolution video frame corresponding to the target low-resolution video frame, wherein the target low-resolution video frame is the middle low-resolution video frame of the first low-resolution video frame subsequence currently input, and the target degradation representation is the first degradation representation of the target low-resolution video frame;
[0033] Performing bicubic interpolation on the target low-resolution video frame to obtain a second target high-resolution video frame;
[0034] The first target high-resolution video frame and the second target high-resolution video frame are added together to obtain a predicted high-resolution video frame corresponding to the target low-resolution video frame.
[0035] Optionally, inputting the spliced feature map and the target degradation representation into a super-resolution layer in the super-resolution network to obtain a first target high-resolution video frame corresponding to the target low-resolution video frame includes:
[0036] Inputting the concatenated feature map and the target degradation representation into a super-resolution layer in the super-resolution network;
[0037] Pooling the spliced feature map through a pooling layer in the super-resolution layer to obtain a pooling result of the spliced feature map;
[0038] Multiplying the pooling result by the target degradation representation and inputting the result into the fully connected network in the super-resolution layer to obtain a weight factor;
[0039] Multiplying the weight factor by the pooling result to obtain an adjusted pooling result;
[0040] The adjusted pooling result is deconvolved by a deconvolution layer in the super-resolution layer to obtain the first target high-resolution video frame.
[0041] Optionally, obtaining a first training data set includes:
[0042] Acquiring the high-resolution video;
[0043] Performing bicubic downsampling on the high-resolution video to obtain the first low-resolution video;
[0044] The first low-resolution video is processed using different compression encoding methods, and the processed first low-resolution video and the high-resolution video are used as the first training data set.
[0045] In a second aspect, the present application discloses a video repair device, comprising:
[0046] A data acquisition module, configured to acquire a first training data set, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos;
[0047] a degradation feature extraction module, configured to extract a first degradation representation of each first low-resolution video in the first training data set using a trained feature extraction network, wherein the first degradation representation is used to represent a compression encoding method of the corresponding first low-resolution video;
[0048] A training module is used to input the first degradation representation and the first low-resolution video into a pre-constructed super-resolution network to obtain a predicted high-resolution video; determine a first error between the predicted high-resolution video and the high-resolution video, and update the super-resolution network based on the first error until the super-resolution network converges to obtain a trained super-resolution network;
[0049] The video restoration module is used to extract a second degradation representation of the video to be restored by using the trained feature extraction network when the video to be restored is acquired, and input the second degradation representation and the video to be restored into the trained super-resolution network to obtain a restored high-resolution video.
[0050] In a third aspect, the present application discloses an electronic device, comprising:
[0051] Memory and processor;
[0052] Wherein, the memory is used to store computer programs;
[0053] The processor is used to execute the computer program to implement the aforementioned disclosed video repair method.
[0054] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned disclosed video repair method when executed by a processor.
[0055] It can be seen that in the present application, a first training data set is first obtained, wherein the first training data set includes multiple first low-resolution videos and corresponding high-resolution videos. Then, the first degradation representation of each first low-resolution video in the first training data set is extracted using the trained feature extraction network, wherein the first degradation representation is used to represent the compression encoding method of the corresponding first low-resolution video. Then, the first degradation representation and the first low-resolution video are input into a pre-constructed super-resolution network to obtain a predicted high-resolution video; the first error between the predicted high-resolution video and the high-resolution video is determined, and the super-resolution network is updated based on the first error until the super-resolution network converges to obtain a trained super-resolution network. When the video to be repaired is obtained, the second degradation representation of the video to be repaired is extracted using the trained feature extraction network, and the second degradation representation and the video to be repaired are input into the trained super-resolution network to obtain a repaired high-resolution video. It can be seen from this that when the super-resolution network in the present application performs super-resolution processing on a low-resolution video, it is necessary to combine the degradation representation of the compression encoding method representing the low-resolution video for processing, so that the super-resolution network can adapt to the noise caused by different compression encoding methods, thereby performing corresponding repair on the video and improving the video repair effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0057] Figure 1 A schematic diagram of the system framework applicable to the video restoration solution provided in this application;
[0058] Figure 2 A flow chart of a video repair method disclosed in this application;
[0059] Figure 3 Generate a flow chart for a training data set disclosed in this application;
[0060] Figure 4 A specific video repair flow chart disclosed in this application;
[0061] Figure 5 A partial flow chart of a specific video repair method disclosed in this application;
[0062] Figure 6 A depth-separable convolution flow chart disclosed in this application;
[0063] Figure 7 A partial flow chart of a specific video repair method disclosed in this application;
[0064] Figure 8 A specific super-resolution network schematic diagram disclosed in this application;
[0065] Fig. 9 A schematic diagram of a specific super-resolution network disclosed in this application;
[0066] Fig.10 A video restoration effect diagram disclosed in this application;
[0067] Fig.11 This is a schematic diagram of the structure of a video repair device disclosed in this application;
[0068] Fig.12 This is a schematic diagram of the structure of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0069] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0070] At present, the video quality improvement mainly uses algorithms such as noise reduction, deblurring and super-resolution to improve the image quality and resolution of video files. Among them, the noise reduction and deblurring algorithms mainly use low-pass filtering and other methods to filter and reduce noise and Gaussian sharpening of the picture. The super-resolution method mainly aligns multiple video frames by calculating the optical flow, and extracts features by using the redundant information of adjacent video frames. The blurred areas in the current frame can be borrowed from adjacent frames and used to restore high-resolution images. However, the above-mentioned prior art ignores the various distortions that may exist in real video data due to compression and encoding methods, such as MPEG-2, HEVC compression noise, etc., resulting in poor video repair effects. In view of this, the present application proposes a video repair method, which repairs the video accordingly according to the noise caused by different compression and encoding methods, thereby improving the video repair effect.
[0071] The system framework used in the video repair solution of this application can be found in Figure 1 As shown, it may specifically include: a backend server and a number of user terminals that establish communication connections with the backend server. The user terminals include but are not limited to tablet computers, laptop computers, smart phones, and personal computers (PCs), which are not limited here.
[0072] In the present application, the backend server performs the steps of the video restoration method, including obtaining a first training data set, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos; using a trained feature extraction network to extract a first degradation representation of each first low-resolution video in the first training data set, wherein the first degradation representation is used to represent the compression encoding method of the corresponding first low-resolution video; inputting the first degradation representation and the first low-resolution video into a pre-constructed super-resolution network to obtain a predicted high-resolution video; determining a first error between the predicted high-resolution video and the high-resolution video, and updating the super-resolution network based on the first error until the super-resolution network converges to obtain a trained super-resolution network. When the backend server completes the super-resolution network training and obtains the trained super-resolution network, the trained feature extraction network and the trained super-resolution network can be sent to each user terminal. When each user terminal obtains the video to be restored, it uses the trained feature extraction network to extract a second degradation representation of the video to be restored, and inputs the second degradation representation and the video to be restored into the trained super-resolution network to obtain a restored high-resolution video.
[0073] See also Figure 2 As shown, the embodiment of the present application discloses a video repair method, which includes:
[0074] Step S11: Acquire a first training data set, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos.
[0075] In the actual implementation process, it is necessary to first obtain a first training data set, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos.
[0076] Among them, the obtaining of the first training data set may specifically include: obtaining the high-resolution video; performing bicubic downsampling on the high-resolution video to obtain the first low-resolution video; processing the first low-resolution video using different compression encoding methods, and using the processed first low-resolution video and the high-resolution video as the first training data set.
[0077] That is, in actual application, a high-resolution video can be obtained first, and then the high-resolution video can be bicubic down-sampled to obtain a first low-resolution video. The first low-resolution video obtained is processed using different compression encoding methods, and the processed first low-resolution video and the high-resolution video are used as the first training data set, wherein the compression encoding method includes but is not limited to MPEG (Moving Picture Experts Group), H.264, and H.265.
[0078] The current computer can directly obtain the first training data set processed by other computers. Other computers can obtain the first training data set through the aforementioned steps, or can obtain it sent by other computers, which is not specifically limited here. Of course, the current computer can also directly obtain a high-resolution video, and then perform bicubic downsampling on the obtained high-resolution video to obtain a first low-resolution video, and then use different compression encoding methods to process the obtained first low-resolution video, and use the processed first low-resolution video and the high-resolution video as the first training data set.
[0079] See also Figure 3 As shown, it is a flow chart for generating the first training data set. First, a high-resolution video is obtained, and then the obtained high-resolution video is bicubic down-sampled to obtain a first low-resolution video, and then the obtained first low-resolution video is compressed by video encoding using different compression encoding methods, so that the processed first low-resolution video and the high-resolution video are used as the first training data set.
[0080] Step S12: extracting a first degradation representation of each first low-resolution video in the first training data set using a trained feature extraction network, wherein the first degradation representation is used to represent a compression encoding method of the corresponding first low-resolution video.
[0081] After obtaining the first training data set, it is also necessary to use a trained feature extraction network to extract a first degradation representation of each first low-resolution video in the first training data set, wherein the first degradation representation is used to represent a compression encoding method of the corresponding first low-resolution video.
[0082] That is, a first degradation representation of the first low-resolution video is extracted using a pre-trained feature extraction network, thereby determining a compression encoding method for the first low-resolution video.
[0083] Step S13: input the first degradation representation and the first low-resolution video into a pre-constructed super-resolution network to obtain a predicted high-resolution video.
[0084] After obtaining the first degradation representation, the first degradation representation and the first low-resolution video can be input into a pre-constructed super-resolution network to obtain a predicted high-resolution video so as to train the super-resolution network, wherein the convolution layer in the super-resolution network can adopt depthwise separable convolution.
[0085] In this way, when the super-resolution network in the present application performs super-resolution operation on the video frames in the first training data set, it will also perform specific operations according to the degradation representations that represent different compression coding methods, so as to process the noise caused by different compression coding methods and reduce the impact of noise. And the convolution layer in the super-resolution network can use deep separable convolution. Compared with general convolution operations, deep separable convolution operations can greatly reduce the amount of calculation in the convolution process, making the super-resolution network lightweight, saving computing resources, improving the efficiency of video restoration, and also saving costs.
[0086] Step S14: determining a first error between the predicted high-resolution video and the high-resolution video, and updating the super-resolution network based on the first error until the super-resolution network converges to obtain a trained super-resolution network.
[0087] After the super-resolution network obtains the predicted high-resolution video, it is also necessary to determine a first error between the predicted high-resolution video and the high-resolution video corresponding to the first low-resolution video, and to update the super-resolution network based on the first error until the super-resolution network converges to obtain a trained super-resolution network.
[0088] Step S15: when the video to be repaired is obtained, the second degradation representation of the video to be repaired is extracted using the trained feature extraction network, and the second degradation representation and the video to be repaired are input into the trained super-resolution network to obtain a repaired high-resolution video.
[0089] After obtaining the trained feature extraction network and the trained super-resolution network, when the video to be restored is obtained, the trained feature extraction network can be used to extract the second degradation representation of the video to be restored, and then the second degradation representation and the video to be restored are input into the trained super-resolution network, and the trained super-resolution network can output a restored high-resolution video.
[0090] For details, see Figure 4The video sequence to be repaired is input into the trained feature extraction network, which will output the degradation representation corresponding to each video frame in the video. The degradation representation and the corresponding video are then input into the trained super-resolution network, which can then output the repaired high-resolution video.
[0091] It can be seen that in the present application, a first training data set is first obtained, wherein the first training data set includes multiple first low-resolution videos and corresponding high-resolution videos. Then, the first degradation representation of each first low-resolution video in the first training data set is extracted using the trained feature extraction network, wherein the first degradation representation is used to represent the compression encoding method of the corresponding first low-resolution video. Then, the first degradation representation and the first low-resolution video are input into a pre-constructed super-resolution network to obtain a predicted high-resolution video; the first error between the predicted high-resolution video and the high-resolution video is determined, and the super-resolution network is updated based on the first error until the super-resolution network converges to obtain a trained super-resolution network. When the video to be repaired is obtained, the second degradation representation of the video to be repaired is extracted using the trained feature extraction network, and the second degradation representation and the video to be repaired are input into the trained super-resolution network to obtain a repaired high-resolution video. It can be seen from this that when the super-resolution network in the present application performs super-resolution processing on a low-resolution video, it is necessary to combine the degradation representation of the compression encoding method representing the low-resolution video for processing, so that the super-resolution network can adapt to the noise caused by different compression encoding methods, thereby performing corresponding repair on the video and improving the video repair effect.
[0092] See also Figure 5 As shown, before extracting the first degradation representation of each low-resolution video in the training data set using the trained feature extraction network, it also includes:
[0093] Step S21: obtaining second training set data, wherein the second training set data includes a plurality of second low-resolution videos and corresponding degradation representation labels, and the degradation representation labels represent actual compression encoding methods of the manually labeled second low-resolution videos.
[0094] That is, before using the trained feature extraction network to extract the first degradation representation of each low-resolution video in the training data set, it is necessary to first use the corresponding data training to obtain the trained feature extraction network, so it is necessary to first obtain the second training data set, wherein the second training data set includes multiple second low-resolution videos and corresponding degradation representation labels, and the degradation representation label represents the actual compression encoding method of the manually marked second low-resolution video, and the second low-resolution video can be a video processed using different compression encoding methods.
[0095] In actual application, the first training data set and the second training data set may be different or the same. When the first training data set and the second training data set are the same, the training data set includes a low-resolution video, a high-resolution video corresponding to the low-resolution video, and a degradation representation label corresponding to the low-resolution video. The degradation representation label is a label indicating the compression coding method that is marked on the second low-resolution video when constructing the second training data set. For example, if the compression coding method of the second low-resolution video is method 1, the degradation representation label is 1, and the degradation representation is a vector extracted from the low-resolution video through a feature extraction network that can represent the compression coding method of the low-resolution video. The degradation representation labels of two low-resolution video frames are the same, and the degradation representations extracted from the two low-resolution video frames may be different and slightly different.
[0096] Step S22: input each of the second low-resolution videos into a pre-constructed feature extraction network to obtain a predicted degradation representation of each of the second low-resolution videos.
[0097] After obtaining the second training data set, each of the second low-resolution videos can be input into a pre-constructed feature extraction network to obtain a predicted degradation representation of each of the second low-resolution videos.
[0098] Specifically, each second low-resolution video is input into a pre-constructed feature extraction network to obtain a predicted degradation representation of each second low-resolution video, including: decoding each second low-resolution video in the second training data set; saving each second low-resolution video frame in each decoded second low-resolution video as a lossless picture format to obtain different second low-resolution video frame sequences, wherein one decoded second low-resolution video corresponds to one second low-resolution video frame sequence; and inputting each second low-resolution video frame in each second low-resolution video frame sequence into a pre-constructed feature extraction network for training to obtain a predicted degradation representation of each second low-resolution video frame, so as to obtain a predicted degradation representation of each second low-resolution video.
[0099] Since the second low-resolution video in the second training data set may be a low-resolution video processed by different compression encoding methods, it is necessary to first decode each low-resolution video in the second training data set to obtain a decoded second low-resolution video.
[0100] After obtaining the decoded second low-resolution video, it is also necessary to save each second low-resolution video frame in each decrypted second low-resolution video as a lossless picture format to obtain different second low-resolution video frame sequences, wherein one decoded second low-resolution video corresponds to one second low-resolution video frame sequence.
[0101] Since the second training data set includes different segments of compressed and encoded second low-resolution videos, different segments of decoded second low-resolution videos will be obtained after decoding. The second low-resolution video frames in each segment of decoded second low-resolution video are saved in a lossless image format, so as to obtain different second low-resolution video frame sequences.
[0102] After obtaining each second low-resolution video frame sequence, each second low-resolution video frame in each second low-resolution video frame sequence is respectively input into a pre-constructed feature extraction network to obtain a predicted degradation representation of each second low-resolution video frame, so as to obtain a predicted degradation representation of each second low-resolution video.
[0103] Among them, the convolution layer in the feature extraction network adopts depth-separable convolution, and when the data passes through the convolution layer in the feature extraction network, point-by-point convolution is first performed, and after the point-by-point convolution is completed, channel-by-channel convolution is performed.
[0104] In the actual implementation process, when the convolution layer in the feature extraction network adopts depthwise separable convolution, it can be convolved channel by channel first, then convolved point by point, and then activated. Figure 6 As shown, it is also possible to use a method of first performing point-by-point convolution, then performing channel-by-channel convolution, and then activating. This can further reduce the amount of computation compared to first performing channel-by-channel convolution, then performing point-by-point convolution, and then activating.
[0105] The convolution layer in the feature extraction network is replaced by a general convolution operation with a depthwise separable convolution. Compared with the general convolution operation, the depthwise separable convolution operation can greatly reduce the amount of calculation in the convolution process, making the feature extraction network lightweight, saving computing resources, improving the efficiency of video restoration, and saving costs.
[0106] Step S23: determining a second error based on the predicted degradation representation and the degradation representation label, and updating the feature extraction network based on the second error until the feature extraction network converges to obtain the trained feature extraction network.
[0107] After obtaining the predicted degradation representation, it is necessary to determine a second error between the predicted degradation representation and the degradation representation label, and update the feature extraction network based on the second error until the feature extraction network converges to obtain the trained feature extraction network.
[0108] Specifically, the corresponding second errors are determined based on the predicted degradation representations of each of the second low-resolution video frames and the corresponding degradation representation labels, and the feature extraction network is updated based on the second errors until the feature extraction network converges to obtain the trained feature extraction network.
[0109] When the feature extraction network is a feature extraction network based on Triplet Loss, determining a corresponding second error based on a predicted degradation representation of any second low-resolution video frame and a degradation representation label of the second low-resolution video frame includes: determining a first parameter and a second parameter based on the degradation representation label corresponding to the second low-resolution video frame, wherein the first parameter is a degradation representation of a video frame in the feature extraction network that has the same compression encoding method as the second low-resolution video frame, and the second parameter represents a degradation representation of a video frame in the feature extraction network that has a different compression encoding method from the second low-resolution video frame; determining the triplet loss of the second low-resolution video frame based on the predicted degradation representation of the second low-resolution video frame, the first parameter, and the second parameter.
[0110] Among them, the calculation formula of triplet loss Triplet Loss is as follows:
[0111]
[0112] Where x is the second lowest resolution video frame of the input, d is a one-dimensional vector, which is used to represent the predicted degradation representation of x output by the feature extraction network. p is the same compression method as the second lowest resolution of the current input, n is a different compression method from the second lowest resolution of the input, and d is p is the first parameter, representing the degradation representation of the video frame in the feature extraction network that is compressed and encoded in the same manner as the second low-resolution video frame, d n is the second parameter, which represents the degradation representation of the video frame in the feature extraction network that is different from the degradation mode of the current video frame, and α is a constant. tri The purpose is to minimize the Euclidean distance of the degradation representation of videos using similar coding methods or similar compression strengths, and to maximize the Euclidean distance of the degradation representation of other video data using different coding methods.
[0113] That is, first determine the degradation representation of the low-resolution video frame whose degradation representation label extracted by the feature extraction network is the same as the degradation representation label corresponding to the second low-resolution video frame, and use the degradation representation of this part of the low-resolution video frame to determine the first parameter d p .
[0114] Then, the degradation representations of the low-resolution video frames whose degradation representation labels extracted by the feature extraction network are different from the degradation representation labels corresponding to the second low-resolution video frame are determined, and the second parameter d is determined using the degradation representations of these low-resolution video frames. n .
[0115] Then, based on the predicted degradation representation of the second low-resolution video frame and the first parameter d p The second parameter d n And the calculation formula of the triplet loss Triplet Loss is used to determine the triplet loss Triplet Loss of the second low-resolution video frame.
[0116] See also Figure 7 As shown, the first degradation representation and the first low-resolution video are input into a pre-built super-resolution network to obtain a predicted high-resolution video, including:
[0117] Step S31: using a sliding window and a preset step size to divide each first low-resolution video frame sequence included in the first training data set into different first low-resolution video frame subsequences, wherein the number of video frames included in each of the first low-resolution video frame subsequences is an odd number.
[0118] When the pre-constructed super-resolution network is trained using the first degradation representation and the first training data set, it is first necessary to divide each first low-resolution video frame sequence included in the first training data set into different first low-resolution video frame subsequences using a sliding window and a preset step size, wherein the number of video frames included in each first low-resolution video frame subsequence is an odd number, and the preset step size can be determined according to actual conditions, and can generally be 1. Since after a first low-resolution video frame subsequence is input into the super-resolution network, the output is a high-resolution video frame of the middlemost video frame, so the first low-resolution video frame subsequence of a first low-resolution video sequence can be the first low-resolution video frame, the first low-resolution video frame, and the second low-resolution video frame, the second low-resolution video frame subsequence can be the first low-resolution video frame, the second low-resolution video frame, and the third low-resolution video frame, and the last low-resolution video frame subsequence can be the last low-resolution video frame, the last low-resolution video frame, and the last low-resolution video frame.
[0119] The process of obtaining the first low-resolution video frame sequence may be: decoding each of the first low-resolution videos in the first training data set; saving each of the first low-resolution video frames in each decoded first low-resolution video as a lossless picture format, to obtain different first low-resolution video frame sequences, wherein one of the decoded first low-resolution videos corresponds to one of the first low-resolution video frame sequences.
[0120] In practical applications, the first low-resolution video frames with excessively large motion amplitudes and the first low-resolution video frames with unclear images in the first low-resolution video frame sequence may be excluded and used for training.
[0121] Step S32: sequentially inputting each of the first low-resolution video frame subsequences and the corresponding first degradation representations into a pre-constructed super-resolution network to obtain predicted high-resolution video frames corresponding to each of the first low-resolution video frames.
[0122] Then, each of the first low-resolution video frame subsequences and the corresponding first degradation representations need to be input into a pre-constructed super-resolution network in turn to obtain a predicted high-resolution video frame corresponding to each of the first low-resolution video frames.
[0123] Specifically, the first low-resolution video frame subsequence currently input is input into the super-resolution network; implicit feature alignment is performed on the first low-resolution video frame subsequence currently input through the feature alignment layer in the super-resolution network to obtain a corresponding aligned feature map; the aligned feature map is spliced to obtain a spliced feature map; the spliced feature map and the target degradation representation are input into the super-resolution layer in the super-resolution network to obtain a first target high-resolution video frame corresponding to the target low-resolution video frame, wherein the target low-resolution video frame is the middle low-resolution video frame of the first low-resolution video frame subsequence currently input, and the target degradation representation is the first degradation representation of the target low-resolution video frame; bicubic interpolation is performed on the target low-resolution video frame to obtain a second target high-resolution video frame; the first target high-resolution video frame and the second target high-resolution video frame are added to obtain a predicted high-resolution video frame corresponding to the target low-resolution video frame.
[0124] That is, see Figure 8 As shown, after a first low-resolution video frame subsequence is input into the super-resolution network, the feature alignment layer (Feature Alignment) in the super-resolution network performs implicit feature alignment on the first low-resolution video frame subsequence currently input. For example, the low-resolution video frame subsequence currently input is l t-1 , l t , lt+1 , then l t-1 , l t Perform implicit feature alignment to obtain the corresponding aligned feature map h t-1 ; will l t , l t Perform implicit feature alignment to obtain the corresponding aligned feature map h t ; will l t+1 , l t Perform implicit feature alignment to obtain the corresponding aligned feature map h t+1 Then, the aligned feature maps are concatenated, that is, the aligned feature maps are superimposed on the channels to obtain a concatenated feature map, and then the concatenated feature map and the target degradation representation (for example, the low-resolution video frame subsequence above is l t-1 , l t , l t+1 When t The degradation representation of the super-resolution network is input into the super-resolution layer to obtain the target low-resolution video frame (for example, the above low-resolution video frame subsequence is l t-1 , l t , l t+1 When t ) corresponding to the first target high-resolution video frame, and then the target low-resolution video frame (for example, the above low-resolution video frame subsequence is l t-1 , l t , l t+1 When t ) to obtain a second target high-resolution video frame. Then, the pixel values at corresponding positions of the first target high-resolution video frame and the second target high-resolution video frame are added to obtain a predicted high-resolution video frame corresponding to the target low-resolution video frame. A first error between the high-resolution video frame corresponding to the target low-resolution video frame and the predicted high-resolution video frame is determined according to a preset formula, and the parameters of the feature alignment layer and the super-resolution layer are updated according to the first error until the super-resolution network converges to obtain the trained super-resolution network. Wherein, the preset formula is:
[0125]
[0126] Among them, F is the defined super-resolution network, θ is the parameter of the super-resolution network, is the output of the super-resolution network, that is, the predicted high-resolution video frame, I represents the high-resolution video frame corresponding to the input low-resolution video frame x, i represents the pixel position in the image, and N represents the total number of pixels.
[0127] Among them, the step of inputting the spliced feature map and the target degradation representation into the super-resolution layer in the super-resolution network to obtain a first target high-resolution video frame corresponding to the target low-resolution video frame includes: inputting the spliced feature map and the target degradation representation into the super-resolution layer in the super-resolution network; pooling the spliced feature map through the pooling layer in the super-resolution layer to obtain a pooling result of the spliced feature map; multiplying the pooling result with the target degradation representation and inputting the result into the fully connected network in the super-resolution layer to obtain a weight factor; multiplying the weight factor with the pooling result to obtain an adjusted pooling result; and deconvolving the adjusted pooling result through the deconvolution layer in the super-resolution layer to obtain the first target high-resolution video frame.
[0128] See also Fig. 9 As shown, after the spliced feature map and the target degradation representation are input into the super-resolution layer in the super-resolution network, the spliced feature map is first pooled through the pooling layer, wherein the number of pooling can be determined according to the actual situation, and the figure shows 3 poolings to obtain the pooling result of the spliced feature map, and the pooling result is 1*1*W, and then the pooling result is multiplied by the target degradation representation (also 1*1*W) and input into the fully connected network in the super-resolution layer, wherein the number of layers of the fully connected network can be determined according to the actual situation to obtain the weight factor. Specifically, the pooling result is multiplied by the target degradation representation and then input into the fully connected network in the super-resolution layer, and the fully connected network performs corresponding processing on the result after the multiplication of the pooling result and the target degradation representation, and outputs it after excitation to obtain the weight factor (also 1*1*W). Then the weight factor is multiplied by the pooling result to obtain the adjusted pooling result (also 1*1*W). Then the deconvolution layer deconvolves the adjusted pooling result to obtain the first target high-resolution video frame. The part before the deconvolution arrow in the figure is built based on the U-net network. In order to ensure that the resolution of the first target high-resolution video frame is higher than that of the input image, a subsequent deconvolution operation is added.
[0129] Among them, the convolution layer in the super-resolution network adopts depth-separable convolution, and when the data passes through the convolution layer in the feature extraction network, point-by-point convolution is first performed, and after the point-by-point convolution is completed, channel-by-channel convolution is performed.
[0130] See also Fig.10 As shown, from left to right are RBPN (Recurrent Back-Projection Network), SRFlow and the aforementioned video restoration method in this application for processing effects on MPEG compressed video. It can be seen that the image restored by the aforementioned video restoration method in this application is clearer.
[0131] A first training data set may be obtained first, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos; a first degradation representation of each first low-resolution video in the first training data set is extracted using a trained feature extraction network, wherein the first degradation representation is used to represent the compression encoding method of the corresponding first low-resolution video; the first degradation representation and the first low-resolution video are input into a pre-constructed super-resolution network to obtain a predicted high-resolution video; a first error between the predicted high-resolution video and the high-resolution video is determined, and the super-resolution network is updated based on the first error until the super-resolution network converges to obtain a trained super-resolution network. Then the trained feature extraction network and the trained super-resolution network are saved to a video processing APP, so that when the video processing APP obtains a video to be repaired, the trained feature extraction network is used to extract a second degradation representation of the video to be repaired, and the second degradation representation and the video to be repaired are input into the trained super-resolution network to obtain a repaired high-resolution video, and the repaired high-resolution video is presented to a user.
[0132] See also Fig.11 As shown, the embodiment of the present application discloses a video repair device, including:
[0133] The data acquisition module 11 is used to acquire a training data set, wherein the training data set includes low-resolution videos processed by using different compression encoding methods;
[0134] A degradation feature extraction module 12, configured to extract a first degradation representation of each first low-resolution video in the first training data set using a trained feature extraction network, wherein the first degradation representation is used to represent a compression encoding method of the corresponding first low-resolution video;
[0135] The training module 13 is used to input the first degradation representation and the first low-resolution video into a pre-constructed super-resolution network to obtain a predicted high-resolution video; determine a first error between the predicted high-resolution video and the high-resolution video, and update the super-resolution network based on the first error until the super-resolution network converges to obtain a trained super-resolution network;
[0136] The video restoration module 14 is used to extract a second degradation representation of the video to be restored using the trained feature extraction network when the video to be restored is acquired, and input the second degradation representation and the video to be restored into the trained super-resolution network to obtain a restored high-resolution video.
[0137] It can be seen that in the present application, a first training data set is first obtained, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos. Then, the first degradation representation of each low-resolution video in the first training data set is extracted using the trained feature extraction network, wherein the first degradation representation is used to represent the compression encoding method of the corresponding first low-resolution video. Then, the first degradation representation and the first low-resolution video are input into the pre-constructed super-resolution network to obtain a predicted high-resolution video; the first error between the predicted high-resolution video and the high-resolution video is determined, and the super-resolution network is updated based on the first error until the super-resolution network converges to obtain a trained super-resolution network. When the video to be repaired is obtained, the second degradation representation of the video to be repaired is extracted using the trained feature extraction network, and the second degradation representation and the video to be repaired are input into the trained super-resolution network to obtain a repaired high-resolution video. It can be seen that in the present application, when the super-resolution network performs super-resolution processing on the low-resolution video, it is necessary to combine the degradation representation representing the compression encoding method of the low-resolution video for processing, so that the super-resolution network can adapt to the noise caused by different compression encoding methods, thereby performing corresponding repair on the video and improving the video repair effect.
[0138] In a specific implementation process, the data acquisition module 11 is further used to: acquire second training set data, wherein the second training set data includes a plurality of second low-resolution videos and corresponding degradation representation labels, and the degradation representation label represents an actual compression encoding method of the second low-resolution video manually marked;
[0139] Correspondingly, the training module 13 is also used to: input each of the second low-resolution videos into a pre-constructed feature extraction network to obtain a predicted degradation representation of each of the second low-resolution videos; determine a second error based on the predicted degradation representation and the degradation representation label, and update the feature extraction network based on the second error until the feature extraction network converges to obtain the trained feature extraction network.
[0140] In a specific implementation process, the training module 13 is used to:
[0141] Decoding each of the second low-resolution videos in the second training data set;
[0142] Saving each second low-resolution video frame in each decoded second low-resolution video in a lossless picture format to obtain different second low-resolution video frame sequences, wherein one decoded second low-resolution video corresponds to one second low-resolution video frame sequence;
[0143] Inputting each of the second low-resolution video frames in each of the second low-resolution video frame sequences into a pre-constructed feature extraction network for training, to obtain a predicted degradation representation of each of the second low-resolution video frames, so as to obtain a predicted degradation representation of each of the second low-resolution videos;
[0144] Accordingly, determining a second error based on the predicted degradation characterization and the degradation characterization label includes:
[0145] A corresponding second error is determined based on the predicted degradation representation of each of the second low-resolution video frames and the corresponding degradation representation label.
[0146] In a specific implementation process, the training module 13 is used to:
[0147] When the feature extraction network is a feature extraction network based on Triplet Loss, determining a first parameter and a second parameter according to a degradation representation label corresponding to the second low-resolution video frame, wherein the first parameter is a degradation representation of a video frame in the feature extraction network that has the same compression encoding method as the second low-resolution video frame, and the second parameter represents a degradation representation of a video frame in the feature extraction network that has a different compression encoding method from the second low-resolution video frame;
[0148] A triplet loss of the second low-resolution video frame is determined based on the predicted degradation representation of the second low-resolution video frame, the first parameter, and the second parameter.
[0149] In a specific implementation process, the convolution layer in the feature extraction network adopts depth-wise separable convolution, and when data passes through the convolution layer in the feature extraction network, point-by-point convolution is first performed, and after the point-by-point convolution is completed, channel-by-channel convolution is performed.
[0150] In a specific implementation process, the training module 13 is used to:
[0151] Dividing each first low-resolution video frame sequence included in the first training data set into different first low-resolution video frame subsequences using a sliding window and a preset step size, wherein the number of video frames included in each of the first low-resolution video frame subsequences is an odd number;
[0152] Each of the first low-resolution video frame subsequences and the corresponding first degradation representation is sequentially input into a pre-constructed super-resolution network to obtain a predicted high-resolution video frame corresponding to each of the first low-resolution video frames.
[0153] In a specific implementation process, the training module 13 is used to:
[0154] Inputting a currently input first low-resolution video frame subsequence into the super-resolution network;
[0155] Performing implicit feature alignment on the currently input first low-resolution video frame subsequence through the feature alignment layer in the super-resolution network to obtain a corresponding aligned feature map;
[0156] Splicing the aligned feature maps to obtain a spliced feature map;
[0157] Inputting the spliced feature map and the target degradation representation into the super-resolution layer in the super-resolution network to obtain a first target high-resolution video frame corresponding to the target low-resolution video frame, wherein the target low-resolution video frame is the middle low-resolution video frame of the first low-resolution video frame subsequence currently input, and the target degradation representation is the first degradation representation of the target low-resolution video frame;
[0158] Performing bicubic interpolation on the target low-resolution video frame to obtain a second target high-resolution video frame;
[0159] The first target high-resolution video frame and the second target high-resolution video frame are added together to obtain a predicted high-resolution video frame corresponding to the target low-resolution video frame.
[0160] In a specific implementation process, the training module 13 is used to:
[0161] Inputting the concatenated feature map and the target degradation representation into a super-resolution layer in the super-resolution network;
[0162] Pooling the spliced feature map through a pooling layer in the super-resolution layer to obtain a pooling result of the spliced feature map;
[0163] Multiplying the pooling result by the target degradation representation and inputting the result into the fully connected network in the super-resolution layer to obtain a weight factor;
[0164] Multiplying the weight factor by the pooling result to obtain an adjusted pooling result;
[0165] The adjusted pooling result is deconvolved by a deconvolution layer in the super-resolution layer to obtain the first target high-resolution video frame.
[0166] In a specific implementation process, the data acquisition module 11 is used to:
[0167] Acquiring the high-resolution video;
[0168] Performing bicubic downsampling on the high-resolution video to obtain the first low-resolution video;
[0169] The first low-resolution video is processed using different compression encoding methods, and the processed first low-resolution video and the high-resolution video are used as the first training data set.
[0170] Fig.12 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include but is not limited to a laptop computer, a desktop computer, a server, etc.
[0171] Generally, the electronic device 20 in this embodiment includes: a processor 21 and a memory 22 .
[0172] Among them, the processor 21 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. The processor 21 may be implemented using at least one of DSP (digital signal processing), FPGA (field-programmable gate array), and PLA (programmable logic array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (central processing unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (graphics processing unit), which is responsible for rendering and drawing images that need to be displayed on the display screen. In some embodiments, the processor 21 may include an AI (artificial intelligence) processor, which is used to process computing operations related to machine learning.
[0173] The memory 22 may include one or more computer-readable storage media, which may be non-transitory. The memory 22 may also include a high-speed random access memory and a non-volatile memory, such as one or more disk storage devices and flash memory storage devices. In this embodiment, the memory 22 is at least used to store the following computer program 221, wherein after the computer program is loaded and executed by the processor 21, the steps of the video repair method disclosed in any of the aforementioned embodiments can be implemented.
[0174] In some embodiments, the electronic device 20 may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a sensor 26 , a power source 27 , and a communication bus 28 .
[0175] Those skilled in the art will understand that Fig.12 The structure shown in the figure does not constitute a limitation on the electronic device 20, and may include more or fewer components than shown in the figure.
[0176] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the video repair method disclosed in any of the aforementioned embodiments.
[0177] Among them, the specific process of the above-mentioned video repair method can refer to the corresponding content disclosed in the aforementioned embodiment, and will not be repeated here.
[0178] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0179] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0180] Finally, it should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a series of processes, methods, articles or equipment containing other elements include not only those elements, but also other elements not explicitly listed, or also include elements inherent to such processes, methods, articles or equipment. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or equipment that includes the elements.
[0181] The above is a detailed introduction to a video repair method, device and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, 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 application.
Claims
1. A video repair method, characterized in that: include: Acquire a first training data set, wherein the first training data set includes a plurality of first low-resolution videos and corresponding high-resolution videos; Extracting a first degradation representation of each first low-resolution video in the first training data set using a trained feature extraction network, wherein the first degradation representation is used to represent a compression encoding method of the corresponding first low-resolution video; Inputting the first degradation representation and the first low-resolution video into a pre-constructed super-resolution network to obtain a predicted high-resolution video; Determining a first error between the predicted high-resolution video and the high-resolution video, and updating the super-resolution network based on the first error until the super-resolution network converges to obtain a trained super-resolution network; When the video to be repaired is obtained, the second degradation representation of the video to be repaired is extracted using the trained feature extraction network, and the second degradation representation and the video to be repaired are input into the trained super-resolution network to obtain a repaired high-resolution video; The step of inputting the first degradation representation and the first low-resolution video into a pre-built super-resolution network to obtain a predicted high-resolution video includes: The first low-resolution video frame subsequences obtained by dividing the first low-resolution video based on a sliding window and a preset step size and the corresponding first degradation representations are sequentially input into a super-resolution network for implicit feature alignment and splicing, and a corresponding first target high-resolution video frame is determined based on a spliced feature map and a first degradation representation of a middle target low-resolution video frame of a currently input first low-resolution video frame subsequence, and the first target high-resolution video frame and a second target high-resolution video frame obtained by performing bicubic interpolation on the target low-resolution video frame are added to obtain a predicted high-resolution video frame corresponding to the target low-resolution video frame.
2. The video repair method according to claim 1, characterized in that: Before extracting the first degradation representation of each first low-resolution video in the training data set using the trained feature extraction network, the method further includes: Acquire a second training data set, wherein the second training data set includes a plurality of second low-resolution videos and corresponding degradation representation labels, and the degradation representation label represents an actual compression encoding method of the manually labeled second low-resolution video; Inputting each of the second low-resolution videos into a pre-built feature extraction network to obtain a predicted degradation representation of each of the second low-resolution videos; A second error is determined based on the predicted degradation representation and the degradation representation label, and the feature extraction network is updated based on the second error until the feature extraction network converges to obtain the trained feature extraction network.
3. The video repair method according to claim 2, characterized in that: The step of inputting each of the second low-resolution videos into a pre-built feature extraction network to obtain a predicted degradation representation of each of the second low-resolution videos includes: Decoding each of the second low-resolution videos in the second training data set; Saving each second low-resolution video frame in each decoded second low-resolution video in a lossless picture format to obtain different second low-resolution video frame sequences, wherein one decoded second low-resolution video corresponds to one second low-resolution video frame sequence; Inputting each of the second low-resolution video frames in each of the second low-resolution video frame sequences into a pre-constructed feature extraction network to obtain a predicted degradation representation of each of the second low-resolution video frames, so as to obtain a predicted degradation representation of each of the second low-resolution videos; Accordingly, determining a second error based on the predicted degradation characterization and the degradation characterization label includes: A corresponding second error is determined based on the predicted degradation representation of each of the second low-resolution video frames and the corresponding degradation representation label.
4. The video repair method according to claim 3, characterized in that: Determining a corresponding second error based on the predicted degradation representation of any second low-resolution video frame and the degradation representation label of the second low-resolution video frame includes: When the feature extraction network is a feature extraction network based on Triplet Loss, determining a first parameter and a second parameter according to a degradation representation label corresponding to the second low-resolution video frame, wherein the first parameter is a degradation representation of a video frame in the feature extraction network that has the same compression encoding method as the second low-resolution video frame, and the second parameter represents a degradation representation of a video frame in the feature extraction network that has a different compression encoding method from the second low-resolution video frame; A triplet loss of the second low-resolution video frame is determined based on the predicted degradation representation of the second low-resolution video frame, the first parameter, and the second parameter.
5. The video repair method according to claim 2, characterized in that: The convolution layer in the feature extraction network adopts depth-wise separable convolution, and when data passes through the convolution layer in the feature extraction network, point-by-point convolution is first performed, and after the point-by-point convolution is completed, channel-by-channel convolution is performed.
6. The video repair method according to claim 1, characterized in that: The step of inputting the first degradation representation and the first low-resolution video into a pre-built super-resolution network to obtain a predicted high-resolution video includes: Dividing each first low-resolution video frame sequence included in the first training data set into different first low-resolution video frame subsequences using a sliding window and a preset step size, wherein the number of video frames included in each of the first low-resolution video frame subsequences is an odd number; Each of the first low-resolution video frame subsequences and the corresponding first degradation representation is sequentially input into a pre-constructed super-resolution network to obtain a predicted high-resolution video frame corresponding to each of the first low-resolution video frames.
7. The video repair method according to claim 6, characterized in that: The step of sequentially inputting each of the first low-resolution video frame subsequences and the corresponding first degradation representation into a pre-constructed super-resolution network to obtain a predicted high-resolution video frame corresponding to each of the first low-resolution video frames includes: Inputting a currently input first low-resolution video frame subsequence into the super-resolution network; Performing implicit feature alignment on the currently input first low-resolution video frame subsequence through the feature alignment layer in the super-resolution network to obtain a corresponding aligned feature map; Splicing the aligned feature maps to obtain a spliced feature map; Inputting the spliced feature map and the target degradation representation into the super-resolution layer in the super-resolution network to obtain a first target high-resolution video frame corresponding to the target low-resolution video frame, wherein the target low-resolution video frame is the middle low-resolution video frame of the first low-resolution video frame subsequence currently input, and the target degradation representation is the first degradation representation of the target low-resolution video frame; Performing bicubic interpolation on the target low-resolution video frame to obtain a second target high-resolution video frame; The first target high-resolution video frame and the second target high-resolution video frame are added together to obtain a predicted high-resolution video frame corresponding to the target low-resolution video frame.
8. The video repair method according to claim 7, characterized in that: The step of inputting the spliced feature map and the target degradation representation into a super-resolution layer in the super-resolution network to obtain a first target high-resolution video frame corresponding to the target low-resolution video frame includes: Inputting the concatenated feature map and the target degradation representation into a super-resolution layer in the super-resolution network; Pooling the spliced feature map through a pooling layer in the super-resolution layer to obtain a pooling result of the spliced feature map; Multiplying the pooling result by the target degradation representation and inputting the result into the fully connected network in the super-resolution layer to obtain a weight factor; Multiplying the weight factor by the pooling result to obtain an adjusted pooling result; The adjusted pooling result is deconvolved by a deconvolution layer in the super-resolution layer to obtain the first target high-resolution video frame.
9. The video repair method according to any one of claims 1 to 8, characterized in that: The obtaining of a first training data set includes: Acquiring the high-resolution video; Performing bicubic downsampling on the high-resolution video to obtain the first low-resolution video; The first low-resolution video is processed using different compression encoding methods, and the processed first low-resolution video and the high-resolution video are used as the first training data set.
10. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store computer programs; The processor is used to execute the computer program to implement the video repair method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the video repair method according to any one of claims 1 to 9 is implemented.
