Method and device for generating video enhancement model
By using the DCT domain-aware classification loss function in the video enhancement model to distinguish texture types and optimizing the video enhancement model, the problem of an increase in bit rate caused by the improvement of video quality is solved, and the effect of reducing the video bit rate and improving image quality is achieved.
Patent Information
- Application Number
- CN202410686461.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-17
AI Technical Summary
Existing video quality improvement methods such as super-resolution, super-frame rate and image quality enhancement lead to an increase in video bit rate and increased bandwidth costs, and the image quality enhancement algorithm is difficult to trade off between the enhancement effect and the bit rate.
The perceptual classification loss function based on the DCT domain is used to distinguish the texture type of the video area in the frequency domain space, guide the optimization direction of the video enhancement model, retain the texture and edge area information that the human eye is more sensitive to, and reduce the amount of information in the flat area to reduce the video Code rate.
It achieves the reduction of video bit rate while retaining video texture details, improving subjective image quality, and due to its stronger anti-noise ability for frequency domain analysis, it can more effectively remove noise in flat areas.
Smart Images

Figure CN118660183A
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and in particular, to a method, device, computer equipment, and computer-readable storage medium for generating a video enhancement model. Background Art
[0002] In order to improve the video quality, common methods for improving video quality include super-resolution, super-frame rate, and image quality enhancement. Among them, super-resolution and super-frame rate improve video quality in terms of frame size and number of frames respectively. Larger or more frames will undoubtedly bring a larger amount of transmission data, resulting in an increase in video bit rate, which leads to higher bandwidth costs for higher video quality in network video applications. Compared with the first two methods, image quality enhancement only performs denoising, deblurring, sharpening and other operations on each frame based on the original frame size and number to improve video clarity. Although the frame size and number of frames have not changed, the details of each frame are richer after image quality enhancement, so the video needs to spend more bit rate to retain this information during the encoding process, resulting in the current image quality enhancement algorithm needing to make a trade-off between enhancement effect and bit rate in actual application scenarios. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method, device, computer equipment and computer-readable storage medium for generating a video enhancement model, which is used to solve the following problem: enhancing video quality through operations such as super-resolution, super-frame rate, and image quality enhancement will lead to an increase in the video bit rate, resulting in an increase in the bandwidth cost required to be consumed.
[0004] One aspect of an embodiment of the present application provides a method for generating a video enhancement model, including:
[0005] Obtain training images and an initial video processing model;
[0006] Obtaining a perceptual classification loss function based on the DCT domain, wherein the perceptual classification loss function based on the DCT domain is used to distinguish the texture type of each region based on the frequency domain space, and guide the optimization direction of the initial video processing model according to the texture type;
[0007] The initial video processing model is trained according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model.
[0008] Optionally, the method for generating a video enhancement model according to claim 1 is characterized in that the initial video processing model is trained according to the training image and the perceptual classification loss function based on the DCT domain to obtain the video enhancement model, comprising:
[0009] When the training image is input into the initial video processing model for training, a pixel reconstruction loss between a predicted image output by the initial video processing model and the input training image is determined according to an L1 loss function, and a perceptual classification loss of the predicted image is determined according to the perceptual classification loss function based on the DCT domain;
[0010] According to the pixel reconstruction loss and the perceptual classification loss, the parameters of the initial video processing model are updated until the prediction effect of the initial video processing model reaches the expected value, and then the video enhancement model is output.
[0011] Optionally, determining the perceptual classification loss of the predicted image according to the perceptual classification loss function based on the DCT domain includes:
[0012] Cutting the predicted image to obtain a plurality of image blocks of preset sizes, and converting each image block into a frequency domain space to obtain a frequency domain block;
[0013] Pre-classifying each frequency domain block to obtain a plurality of frequency domain components, and determining a value corresponding to each frequency domain component in each of the frequency domain blocks;
[0014] Determining a texture type corresponding to the frequency domain block according to a value corresponding to each frequency domain component in the frequency domain block;
[0015] According to the DCT domain-based perceptual classification loss function and the texture type corresponding to the frequency domain block, the frequency domain components in the frequency domain block are filtered, and the perceptual classification loss of the predicted image is determined according to the filtered frequency domain components.
[0016] Optionally, the frequency domain components include a direct current component DC, a low frequency component L, an edge component E and a high frequency component H; and the texture type includes a flat area type, an edge area type and a texture area type.
[0017] Optionally, filtering the frequency domain components in the frequency domain block according to the DCT domain-based perceptual classification loss function and the texture type corresponding to the frequency domain block includes:
[0018] When the texture type corresponding to the frequency domain block is a flat area, filtering out the edge component E and the high frequency component H in the frequency domain block;
[0019] When the texture type corresponding to the frequency domain block is an edge area, filtering out a high frequency component H in the frequency domain block;
[0020] When the texture type corresponding to the frequency domain block is a high frequency region, all frequency domain components in the frequency domain block are retained.
[0021] Optionally, filtering the frequency domain components in the frequency domain block according to the DCT domain-based perceptual classification loss function and the texture type corresponding to the frequency domain block includes:
[0022] According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is a flat area, determining the total number of all frequency domain components in the frequency domain block, summing the edge component E and the high-frequency component H in the frequency domain block to obtain a first value, and filtering the edge component E and the high-frequency component H in the frequency domain block according to the first value and the total number of frequency domain components;
[0023] According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is an edge area, the total number of all frequency domain components in the frequency domain block is determined, and the high-frequency components H in the frequency domain block are summed to obtain a second value, and the high-frequency components H in the frequency domain block are filtered according to the second value and the total number of all frequency domain components.
[0024] Optionally, determining the pixel reconstruction loss between the predicted image output by the initial video processing model and the input training image according to the L1 loss function includes:
[0025] According to the L1 loss function, the sum of the absolute value differences of pixels between the predicted image output by the initial video processing model and the input training image is determined to obtain the pixel reconstruction loss between the predicted image and the training image.
[0026] Optionally, the method further comprises:
[0027] Obtaining video data to be processed;
[0028] Each frame of the video data to be processed is input into the video enhancement model for processing to obtain a target image.
[0029] One aspect of an embodiment of the present application further provides a device for generating a video enhancement model, including:
[0030] A training image acquisition module, used to acquire training images and an initial video processing model;
[0031] A loss function acquisition module, used to acquire a perceptual classification loss function based on the DCT domain, wherein the perceptual classification loss function based on the DCT domain is used to distinguish the texture type of each region based on the frequency domain space, and guide the optimization direction of the initial video processing model according to the texture type;
[0032] The model training module is used to train the initial video processing model according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model.
[0033] One aspect of an embodiment of the present application further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for generating a video enhancement model as described above.
[0034] One aspect of an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for generating a video enhancement model as described above when executing the computer program.
[0035] One aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by at least one processor so that the at least one processor implements the steps of the method for generating a video enhancement model as described above when executing the computer program.
[0036] The generation method, apparatus, device and computer-readable storage medium of the video enhancement model provided in the embodiments of the present application guide the optimization direction of the enhancement model by adaptively distinguishing the texture type of the region in the frequency domain space based on the perceptual classification loss function in the DCT domain, thereby retaining the amount of information in the areas where the human eye is more sensitive and erasing more information in the areas where the human eye is insensitive, ensuring that the video has sufficient bit rate to encode detail information during the encoding process, thereby achieving a reduction in the bit rate of the video after processing by the video enhancement model while retaining the texture details of the video and improving the subjective picture quality of the video. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A diagram schematically shows an application environment of a method for generating a video enhancement model according to an embodiment of the present application;
[0038] Figure 2 The flowchart of the method for generating a video enhancement model according to the first embodiment of the present application is schematically shown;
[0039] Figure 3 A pre-classified frequency domain block according to the first embodiment of the present application is schematically shown;
[0040] Figure 4 A flowchart schematically shows the steps of determining the texture type corresponding to the frequency domain block according to the first embodiment of the present application;
[0041] Figure 5 A block diagram schematically shows a device for generating a video enhancement model according to Embodiment 2 of the present application; and
[0042] Figure 6The schematic diagram shows a hardware architecture of a computer device suitable for implementing a method for generating a video enhancement model according to the third embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0044] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0045] In the prior art, in order to improve video quality, common methods for improving video quality include super-resolution, super-frame rate, image quality enhancement and other operations. Among them, super-resolution and super-frame rate improve video quality in terms of frame size and number of frames respectively, and larger or more frames will undoubtedly bring a larger amount of transmission data, resulting in an increase in video bit rate, which leads to higher bandwidth costs for higher video quality in network video applications. Compared with the first two methods, image quality enhancement only performs denoising, deblurring, sharpening and other operations on each frame based on the original frame size and number to improve video clarity. Although the frame size and number of frames have not changed, the details of each frame are richer after image quality enhancement, so that the video needs to spend more bit rate to retain this information during the encoding process, resulting in the current image quality enhancement algorithm needing to make a trade-off between enhancement effect and bit rate in actual application scenarios.
[0046] In view of this, the present application aims to propose a generation of a video enhancement model based on frequency domain perceptual classification, including: obtaining a training image and an initial video processing model; obtaining a perceptual classification loss function based on the DCT domain, wherein the perceptual classification loss function based on the DCT domain is used to distinguish the texture type of each region based on the frequency domain space, and guide the optimization direction of the initial video processing model according to the texture type; training the initial video processing model according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model. By adaptively distinguishing the texture type of the region in the frequency domain space based on the perceptual classification loss function of the DCT domain, the optimization direction of the enhancement model is guided, wherein the texture type includes a flat area type, an edge area type, and a texture area type, so that the texture area and edge area to which the human eye is more sensitive can be retained, and more information in the flat area can be erased to ensure that the video has enough bit rate to encode detail information during the encoding process. However, since the area of the flat area in the video is larger than the texture area and the edge area, the erasure of the flat area will reduce the overall bit rate of the video. The final result is that while the video bit rate is reduced, the texture details of the video are retained, so that the subjective image quality of the video is improved. Compared with the frequency domain, it is more difficult to distinguish noise in the pixel domain, so the frequency domain analysis of the entire block by the perceptual classification model has a stronger ability to resist noise interference. The flat area is mainly composed of low-frequency information, so the high-frequency information that exists is basically composed of noise. Letting the components of this area except the DC component and low-frequency component approach 0 as much as possible is conducive to removing noise in the flat area.
[0047] This application provides multiple embodiments to further introduce the generation scheme of the video enhancement model, please refer to the following for details.
[0048] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.
[0049] The following is an explanation of the terms used in this application:
[0050] Video bitrate: refers to the rate at which video data is transmitted over a period of time, usually measured in bits per second (bps). Video bitrate determines the size and quality of the video file. The higher the bitrate, the better the video quality, but the larger the file size.
[0051] DCT: Discrete Cosine Transform, discrete cosine transform, can be used to convert spatial domain data into frequency domain data.
[0052] Figure 1 The following schematic diagram shows an environmental application diagram according to an embodiment of the present application. Figure 1 As shown:
[0053] The computer device 10000 can be connected to the client 30000 via the network 20000 .
[0054] The computer device 10000 can provide services, such as network debugging, or return the generation result data of the video enhancement model to the client 30000, etc.
[0055] Computer device 10000 may be located in a data center such as a single location, or distributed in different geographical locations (e.g., in multiple locations). Computer device 10000 may provide services via one or more networks 20000. Network 20000 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. Network 20000 may include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and the like. Network 20000 may include wireless links, such as cellular links, satellite links, Wi-Fi links, and the like.
[0056] Computer device 10000 can be implemented by one or more computing nodes. One or more computing nodes may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing nodes may load virtual machines based on virtual images and / or other data defining specific software (e.g., operating systems, dedicated applications, servers) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing nodes. A hypervisor may be implemented to manage the use of different virtual machines on the same computing node.
[0057] The client 30000 may be configured to access the content and services of the computer device 10000. The client 30000 may include any type of electronic device, such as a mobile device, a tablet device, a laptop computer, a workstation, a virtual reality device, a gaming device, a set-top box, a digital streaming device, a vehicle terminal, a smart TV, a set-top box, and the like.
[0058] The client 30000 may output (eg, display, render, present) the generated result data of the video enhancement model and the like to the user.
[0059] The network debugging solution will be introduced below through multiple embodiments. The solution can be implemented by the computer device 10000.
[0060] Embodiment 1
[0061] Figure 2The flowchart of the method for generating a video enhancement model according to the first embodiment of the present application is schematically shown. The method comprises steps S202-S206, wherein:
[0062] Step S202, obtaining a training image and an initial video processing model;
[0063] The training images may be image datasets extracted from video data. The initial video processing model is a pre-constructed convolutional neural network model for enhancing video quality, and the initial video processing model may be constructed based on networks such as LeNet-5, AlexNet, and VGG.
[0064] Step S204, obtaining a perceptual classification loss function based on the DCT domain, wherein the perceptual classification loss function based on the DCT domain is used to distinguish the texture type of each region based on the frequency domain space, and guide the optimization direction of the initial video processing model according to the texture type;
[0065] Among them, the texture types include flat area type, edge area type and texture area type.
[0066] Since the human eye has different sensitivities to brightness changes in different areas, in flat areas, there are usually smaller brightness changes, and the human eye is not sensitive to small brightness changes in this area; the texture area contains high-frequency brightness changes, and the human eye is more sensitive to such changes, and information should be retained as much as possible; the edge area contains larger brightness changes, but such changes are relatively smooth, but the human eye is also sensitive. For this reason, the video enhancement model should put more enhancement effects on the edges and texture areas that are sensitive to the human eye, and also needs to have the ability to erase high-frequency information in flat areas to prevent the video from spending too many bits to encode this area. The DCT domain perceptual classification used in this embodiment is combined with the DCT encoding process of video encoding. During the model training process, it adaptively distinguishes between flat areas, texture areas, and edge areas, uses different loss weights for different areas, and ultimately guides the optimization direction of model training.
[0067] Step S206: training the initial video processing model according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model.
[0068] Specifically, the training image can be input into the initial video processing model to obtain a predicted image, and then the loss of the predicted image can be calculated based on the perceptual classification loss function in the DCT domain to guide the optimization of the parameters of the initial video processing model. The process is repeated until the convergence effect of the initial video processing model reaches the expected level, and the optimized initial video processing model is output as a video enhancement model.
[0069] Several optional embodiments are provided below to optimize the generation method of the video enhancement model, as follows:
[0070] In a preferred embodiment of the present application, step S206 may include the following steps:
[0071] When the training image is input into the initial video processing model for training, a pixel reconstruction loss between a predicted image output by the initial video processing model and the input training image is determined according to an L1 loss function, and a perceptual classification loss of the predicted image is determined according to the perceptual classification loss function based on the DCT domain;
[0072] According to the pixel reconstruction loss and the perceptual classification loss, the parameters of the initial video processing model are updated until the prediction effect of the initial video processing model reaches the expected value, and then the video enhancement model is output.
[0073] In this embodiment, when training the initial video processing model, the training image is input into the initial video processing model for prediction and outputting the predicted image, wherein the training image input into the initial video processing model is an RGB three-channel image (height*width*3), and the output predicted image is a three-channel image of the same size as the input (height*width*3).
[0074] Then, the pixel reconstruction loss between the predicted image output by the initial video processing model and the input training image is determined according to the L1 loss function, and the perceptual classification loss of the predicted image is determined according to the perceptual classification loss function based on the DCT domain. Thus, the parameters of the initial video processing model are updated according to the pixel reconstruction loss and the perceptual classification loss until the prediction effect of the initial video processing model reaches the expected value, and the video enhancement model is output.
[0075] In a preferred embodiment of the present application, determining the perceptual classification loss of the predicted image according to the perceptual classification loss function based on the DCT domain may include the following steps:
[0076] Step S1, cutting the predicted image into a plurality of image blocks of a preset size, and converting each image block into a frequency domain space to obtain a frequency domain block;
[0077] The preset size is a preset image size, such as 8*8, and the predicted image is cut into multiple 8*8 image blocks.
[0078] Step S2, pre-classifying each frequency domain block to obtain multiple frequency domain components, and determining a value corresponding to each frequency domain component in the frequency domain block;
[0079] The frequency domain components include DC component, low frequency component L, edge component E and high frequency component H. Figure 3 A schematic diagram of a pre-classified frequency domain block is shown.
[0080] Step S3, determining the texture type corresponding to each frequency domain block according to the value corresponding to each frequency domain component in the frequency domain block;
[0081] The texture types include flat area type, edge area type and texture area type.
[0082] As an example, Figure 4 A flowchart of the steps for determining the texture type corresponding to a frequency domain block is shown, which is used to classify each 8x8 frequency domain block. Among them, L represents the sum of the values of the pre-classification points corresponding to the low-frequency component, E represents the sum of the values of the pre-classification points corresponding to the edge component, H represents the sum of the values of the pre-classification points corresponding to the high-frequency component, α, β, γ, μ, κ, etc. are all empirical values, EDGE represents the edge area, PLAIN represents the flat area, and TEXTURE represents the texture area. The details are as follows:
[0083] Step A, determine whether the sum of the values of the E+H pre-classification points is greater than μ1, if not, determine it as a flat area, if so, execute step B;
[0084] Step B, determine whether the sum of the values of the E+H pre-classification points is greater than μ2, if not, execute step C1, if yes, execute step C2;
[0085] Step C1, determine whether L / E is greater than or equal to α1 and determine whether (L+E) / H is greater than or equal to β1, or, determine whether L / E is greater than or equal to β1 and determine whether (L+E) / H is greater than or equal to α1, or, determine whether (L+E) / H is greater than or equal to γ; if so, determine it as an edge area, if not, execute step D;
[0086] Step C2, judging whether L / E is greater than or equal to α2 and judging whether (L+E) / H is greater than or equal to β2, or judging whether L / E is greater than or equal to β2 and judging whether (L+E) / H is greater than or equal to α2, or judging whether (L+E) / H is greater than or equal to γ; if so, it is determined to be an edge area, otherwise it is determined to be a texture area;
[0087] Step D, determine whether E+H is greater than κ, if so, determine it as a texture area, otherwise determine it as a flat area.
[0088] Step S4, filtering the frequency domain components in the frequency domain block according to the DCT domain-based perceptual classification loss function and the texture type corresponding to the frequency domain block, and determining the perceptual classification loss of the predicted image according to the filtered frequency domain components;
[0089] In order to preserve the details of the video image as much as possible and reduce the overall information volume of the model output, when calculating the perceptual classification loss, all E and H component coefficients in the 8x8 frequency domain blocks judged as flat areas are set to 0, all H component coefficients in the 8x8 frequency domain blocks in the edge areas are set to 0, and all component coefficients in the 8x8 frequency domain blocks in the high-frequency areas are retained.
[0090] In this embodiment, the parameters of the initial video processing model are updated according to the filtered frequency domain components, and then through multiple rounds of training iterations, the initial video processing model converges and achieves the expected bit rate saving effect.
[0091] In a preferred embodiment of the present application, step S4 may include the following steps:
[0092] When the texture type corresponding to the frequency domain block is a flat area, filtering out the edge component E and the high frequency component H in the frequency domain block;
[0093] When the texture type corresponding to the frequency domain block is an edge area, filtering out a high frequency component H in the frequency domain block;
[0094] When the texture type corresponding to the frequency domain block is a high frequency region, all frequency domain components in the frequency domain block are retained.
[0095] Specifically, the human eye has different sensitivities to brightness changes in different areas. In flat areas, there are usually small brightness changes, and the human eye is not sensitive to small brightness changes in this area; texture areas contain high-frequency brightness changes, and the human eye is more sensitive to such changes, so information should be retained as much as possible; edge areas contain large brightness changes, but such changes are relatively smooth, but the human eye is also sensitive. To this end, the model should put more enhancement effects on the edges and texture areas that are sensitive to the human eye, and also have the ability to erase high-frequency information in flat areas to prevent the video from spending too many bits to encode this area.
[0096] In a preferred embodiment of the present application, the DCT domain-based perceptual classification loss function is expressed as follows:
[0097] L total =a*L1+b*L plain +c*L edge
[0098] Among them, L1 represents the pixel reconstruction loss function; L plain The loss function is used to make the edge component E and high-frequency component H of the flat area approach 0 to achieve the minimum loss; L edge The loss is used to make the high-frequency component H of the edge area approach 0 to achieve the minimum loss; a, b, and c represent the proportional coefficients of each loss function in the total loss.
[0099] That is, the L1 loss function is used to calculate the reconstruction loss of the predicted image output by the convolutional neural network and the input image, and the loss of the predicted image is calculated based on the perceptual classification loss function in the DCT domain, which jointly participate in the optimization of the convolutional neural network.
[0100] in,
[0101]
[0102]
[0103]
[0104] in, n p are the predicted values and totals of E and H components in the flat area, n e are the predicted value and total number of H components in the edge area, respectively.
[0105] In a preferred embodiment of the present application, the S4 may include the following steps:
[0106] According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is a flat area, determining the total number of all frequency domain components in the frequency domain block, summing the edge component E and the high-frequency component H in the frequency domain block to obtain a first value, and filtering the edge component E and the high-frequency component H in the frequency domain block according to the first value and the total number of frequency domain components;
[0107] According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is an edge area, the total number of all frequency domain components in the frequency domain block is determined, and the high-frequency components H in the frequency domain block are summed to obtain a second value, and the high-frequency components H in the frequency domain block are filtered according to the second value and the total number of all frequency domain components.
[0108] In this embodiment, for a flat area, the E and H components in the area are made close to 0; for an edge area, the H in the area is made close to 0, so as to achieve the minimum loss.
[0109] By analyzing the loss of the model according to the filtered frequency domain components and guiding the optimization of the model parameters, different filtering methods are used for different types of texture areas. Therefore, the amount of information stored in different texture areas is different. This information is used to guide the optimization direction of the enhanced model, so that the texture areas and edge areas that the human eye is more sensitive to can be retained, and more information in the flat areas can be erased, ensuring that the video has enough bit rate to encode detail information during the encoding process.
[0110] In a preferred embodiment of the present application, determining the pixel reconstruction loss between the predicted image output by the initial video processing model and the input training image according to the L1 loss function includes:
[0111] According to the L1 loss function, the sum of the absolute value differences of pixels between the predicted image output by the initial video processing model and the input training image is determined to obtain the pixel reconstruction loss between the predicted image and the training image.
[0112] In a preferred embodiment of the present application, the method may further include the following steps:
[0113] Obtaining the video data to be processed; inputting each frame of the video data to be processed into the video enhancement model for processing to obtain a target image.
[0114] In this embodiment, when it is necessary to enhance the image quality of the video data to be processed, each frame of the video data to be processed can be input into the video enhancement model for processing to obtain a target image.
[0115] The reconstruction loss of the predicted image output by the convolutional neural network and the input picture is calculated through the L1 loss function, and the perceptual classification loss of the predicted image is calculated based on the perceptual classification loss function in the DCT domain, which jointly participate in the optimization of the convolutional neural network.
[0116] In this embodiment, in order to solve the problem of increased bit rate after the video is processed by the enhancement model, a video enhancement model training method based on the perceptual classification loss function of the DCT domain is proposed. The optimization direction of the enhancement model is guided by the adaptive distinction of the flat area, texture area, and edge area in the frequency domain through perceptual classification, so as to retain the texture area and edge area to which the human eye is more sensitive, and more information in the flat area is erased to ensure that the video has enough bit rate to encode detail information during the encoding process. However, since the area of the flat area in the video is larger than the texture area and the edge area, the erasure of the flat area will reduce the overall bit rate of the video. The final result is that while the video bit rate is reduced, the texture details of the video are retained, so that the subjective picture quality of the video is improved. Compared with the frequency domain, the pixel domain is more difficult to distinguish noise, so the perceptual classification model has a stronger ability to resist noise interference in the frequency domain analysis of the entire block. The flat area is mainly composed of low-frequency information, so the high-frequency information that exists is basically composed of noise. Letting the other components of this area except the DC component and the low-frequency component tend to 0 as much as possible is conducive to removing the noise in the flat area.
[0117] The human eye has different sensitivities to brightness changes in different areas. In flat areas, there are usually smaller brightness changes, and the human eye is not sensitive to small brightness changes in this area; the texture area contains high-frequency brightness changes, and the human eye is more sensitive to such changes, so the information should be retained as much as possible; the edge area contains larger brightness changes, but such changes are relatively smooth, but the human eye is also sensitive. For this reason, the enhancement model should put more enhancement effects on the edge and texture areas that are sensitive to the human eye. At the same time, it also needs to have the ability to erase high-frequency information in flat areas to prevent the video from spending too many bits to encode this area. The DCT domain perceptual classification loss function used in this embodiment is combined with the DCT encoding process of video encoding. During the model training process, it adaptively distinguishes between flat areas, texture areas, and edge areas, uses different loss weights for different areas, and ultimately guides the optimization direction of model training.
[0118] Embodiment 2
[0119] Figure 5 A block diagram of a device for generating a video enhancement model according to Embodiment 2 of the present application is schematically shown. The device for generating a video enhancement model can be divided into one or more program modules, and one or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can perform specific functions. The following description will specifically introduce the functions of each program module in the embodiment of the present application.
[0120] like Figure 5 As shown, the video enhancement model generation device 500 may include the following modules:
[0121] A training image acquisition module 510, used to acquire a training image and an initial video processing model;
[0122] A loss function acquisition module 520, used to acquire a perceptual classification loss function based on the DCT domain, wherein the perceptual classification loss function based on the DCT domain is used to distinguish the texture type of each region based on the frequency domain space, and guide the optimization direction of the initial video processing model according to the texture type;
[0123] The model training module 530 is used to train the initial video processing model according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model.
[0124] In a preferred embodiment of the present application, the model training module 530 includes:
[0125] a loss determination submodule, configured to determine, when the training image is input into the initial video processing model for training, a pixel reconstruction loss between a predicted image output by the initial video processing model and the input training image according to an L1 loss function, and to determine a perceptual classification loss of the predicted image according to the perceptual classification loss function based on the DCT domain;
[0126] The parameter updating submodule of the model is used to update the parameters of the initial video processing model according to the pixel reconstruction loss and the perceptual classification loss until the prediction effect of the initial video processing model reaches the expected value, and then output the video enhancement model.
[0127] In a preferred embodiment of the present application, the loss determination submodule includes:
[0128] A conversion submodule, used for cutting the predicted image into a plurality of image blocks of preset sizes, and converting each image block into a frequency domain space to obtain a frequency domain block;
[0129] A pre-classification submodule, used to pre-classify each frequency domain block to obtain multiple frequency domain components, and determine a value corresponding to each frequency domain component in the frequency domain block;
[0130] A texture type determination submodule, used to determine the texture type corresponding to the frequency domain block according to the value corresponding to each frequency domain component in the frequency domain block;
[0131] The perceptual classification loss determination submodule is used to filter the frequency domain components in the frequency domain block according to the perceptual classification loss function based on the DCT domain and the texture type corresponding to the frequency domain block, and determine the perceptual classification loss of the predicted image according to the filtered frequency domain components.
[0132] In a preferred embodiment of the present application, the frequency domain components include a direct current component DC, a low frequency component L, an edge component E and a high frequency component H; and the texture type includes a flat area type, an edge area type and a texture area type.
[0133] In a preferred embodiment of the present application, the perceptual classification loss determination submodule includes:
[0134] A first frequency domain component filtering unit, configured to filter out edge components E and high frequency components H in the frequency domain block when the texture type corresponding to the frequency domain block is a flat area;
[0135] A second frequency domain component filtering unit, configured to filter out a high frequency component H in the frequency domain block when the texture type corresponding to the frequency domain block is an edge region;
[0136] The frequency domain component retaining unit is used to retain all frequency domain components in the frequency domain block when the texture type corresponding to the frequency domain block is a high frequency area.
[0137] In a preferred embodiment of the present application, the perceptual classification loss determination submodule specifically includes:
[0138] According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is a flat area, determining the total number of all frequency domain components in the frequency domain block, summing the edge component E and the high-frequency component H in the frequency domain block to obtain a first value, and filtering the edge component E and the high-frequency component H in the frequency domain block according to the first value and the total number of frequency domain components;
[0139] According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is an edge area, the total number of all frequency domain components in the frequency domain block is determined, and the high-frequency components H in the frequency domain block are summed to obtain a second value, and the high-frequency components H in the frequency domain block are filtered according to the second value and the total number of all frequency domain components.
[0140] In a preferred embodiment of the present application, the loss determination submodule includes:
[0141] The pixel reconstruction loss determination submodule is used to determine the sum of the pixel absolute value differences between the predicted image output by the initial video processing model and the input training image according to the L1 loss function, so as to obtain the pixel reconstruction loss between the predicted image and the training image.
[0142] In a preferred embodiment of the present application, the device further comprises:
[0143] A video data acquisition module, used to acquire video data to be processed;
[0144] The image processing module is used to input each frame of the video data to be processed into the video enhancement model for processing to obtain a target image.
[0145] Embodiment 3
[0146] Figure 6The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing the method for generating a video enhancement model according to the third embodiment of the present application is shown schematically. In this embodiment, the computer device 10000 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. For example, it can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including a FEN independent server, or a server cluster composed of multiple servers), etc. Figure 6 As shown, the computer device 10000 includes at least but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them:
[0147] The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of the computer device 10000, such as a hard disk or a memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the memory 10010 may also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed in the computer device 10000, such as the program code of the method for generating the video enhancement model, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.
[0148] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.
[0149] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.
[0150] It should be pointed out that Figure 6 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may be implemented instead.
[0151] In this embodiment, the method for generating the video enhancement model stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (processor 10020 in this embodiment) to complete the embodiment of the present application.
[0152] Embodiment 4
[0153] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a video enhancement model in the embodiment are implemented.
[0154] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, referred to as SMC), a secure digital (Secure Digital, referred to as SD) card, a flash card, etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the method for generating a video enhancement model in the embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0155] Embodiment 5
[0156] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0157] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0158] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for generating a video enhancement model, characterized in that: include: Obtain training images and an initial video processing model; Obtaining a perceptual classification loss function based on the DCT domain, wherein the perceptual classification loss function based on the DCT domain is used to distinguish the texture type of each region based on the frequency domain space, and guide the optimization direction of the initial video processing model according to the texture type; The initial video processing model is trained according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model.
2. The method for generating a video enhancement model according to claim 1, characterized in that: The initial video processing model is trained according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model, including: When the training image is input into the initial video processing model for training, a pixel reconstruction loss between a predicted image output by the initial video processing model and the input training image is determined according to an L1 loss function, and a perceptual classification loss of the predicted image is determined according to the perceptual classification loss function based on the DCT domain; According to the pixel reconstruction loss and the perceptual classification loss, the parameters of the initial video processing model are updated until the prediction effect of the initial video processing model reaches the expected value, and then the video enhancement model is output.
3. The method for generating a video enhancement model according to claim 2, characterized in that: The determining the perceptual classification loss of the predicted image according to the perceptual classification loss function based on the DCT domain comprises: Cutting the predicted image to obtain a plurality of image blocks of preset sizes, and converting each image block into a frequency domain space to obtain a frequency domain block; Pre-classifying each frequency domain block to obtain a plurality of frequency domain components, and determining a value corresponding to each frequency domain component in each of the frequency domain blocks; Determining a texture type corresponding to the frequency domain block according to a value corresponding to each frequency domain component in the frequency domain block; According to the DCT domain-based perceptual classification loss function and the texture type corresponding to the frequency domain block, the frequency domain components in the frequency domain block are filtered, and the perceptual classification loss of the predicted image is determined according to the filtered frequency domain components.
4. The method for generating a video enhancement model according to claim 3, characterized in that: The frequency domain components include a direct current component DC, a low frequency component L, an edge component E and a high frequency component H; the texture type includes a flat area type, an edge area type and a texture area type.
5. The method for generating a video enhancement model according to claim 4, characterized in that: The filtering of the frequency domain components in the frequency domain block according to the DCT domain-based perceptual classification loss function and the texture type corresponding to the frequency domain block comprises: When the texture type corresponding to the frequency domain block is a flat area, filtering out the edge component E and the high frequency component H in the frequency domain block; When the texture type corresponding to the frequency domain block is an edge area, filtering out a high frequency component H in the frequency domain block; When the texture type corresponding to the frequency domain block is a high frequency region, all frequency domain components in the frequency domain block are retained.
6. The method for generating a video enhancement model according to claim 4, characterized in that: The filtering of the frequency domain components in the frequency domain block according to the DCT domain-based perceptual classification loss function and the texture type corresponding to the frequency domain block comprises: According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is a flat area, determining the total number of all frequency domain components in the frequency domain block, summing the edge component E and the high-frequency component H in the frequency domain block to obtain a first value, and filtering the edge component E and the high-frequency component H in the frequency domain block according to the first value and the total number of frequency domain components; According to the DCT domain-based perceptual classification loss function, when the texture type corresponding to the frequency domain block is an edge area, the total number of all frequency domain components in the frequency domain block is determined, and the high-frequency components H in the frequency domain block are summed to obtain a second value, and the high-frequency components H in the frequency domain block are filtered according to the second value and the total number of all frequency domain components.
7. The method for generating a video enhancement model according to claim 2, characterized in that: The step of determining the pixel reconstruction loss between the predicted image output by the initial video processing model and the input training image according to the L1 loss function includes: According to the L1 loss function, the sum of the absolute value differences of pixels between the predicted image output by the initial video processing model and the input training image is determined to obtain the pixel reconstruction loss between the predicted image and the training image.
8. The method for generating a video enhancement model according to claim 1, characterized in that: The method further comprises: Obtaining video data to be processed; Each frame of the video data to be processed is input into the video enhancement model for processing to obtain a target image.
9. A device for generating a video enhancement model, characterized in that: include: A training image acquisition module, used to acquire training images and an initial video processing model; A loss function acquisition module, used to acquire a perceptual classification loss function based on the DCT domain, wherein the perceptual classification loss function based on the DCT domain is used to distinguish the texture type of each region based on the frequency domain space, and guide the optimization direction of the initial video processing model according to the texture type; The model training module is used to train the initial video processing model according to the training image and the perceptual classification loss function based on the DCT domain to obtain a video enhancement model.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, it is used to implement the steps of the method for generating a video enhancement model as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which can be executed by at least one processor so that the at least one processor performs the steps of the method for generating a video enhancement model as described in any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for generating a video enhancement model described in claims 1 to 8 are implemented.
Citation Information
Cited By
Large model enabled image data real-time analysis and intelligent decision-making method and system
CN122155950A
Image data real-time analysis and intelligent decision method and system empowered by large model
CN122155950B
