An Image Brightness Enhancement Method, Terminal and Storage Medium Based on Adversarial Network

By converting the image into Lab space and building an adversarial network model, the discriminant network model is used to automatically find the brightness enhancement factor, which solves the color distortion problem caused by image brightness enhancement in the prior art, and achieves accurate image brightness improvement.

CN114140339BActive Publication Date: 2025-07-29SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111229916.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-21
Publication Date
2025-07-29
Estimated Expiration
2041-10-21

AI Technical Summary

Technical Problem

Existing image brightness enhancement technologies cannot accurately improve brightness without affecting color changes, which can easily lead to highlighting the edges of the image's light and darkness and distortion.

Method used

The image is converted from RGB space to Lab space, an adversarial network model is built and trained, and the discriminant network model is used to distinguish the results, and the brightness enhancement factor is automatically found, and the image brightness is adjusted through the adversarial network model.

Benefits of technology

It realizes the accuracy of image brightness without changing the color, avoiding highlights of light and dark edges and color distortion, and is suitable for automatic brightness improvement of a large number of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114140339B_ABST
    Figure CN114140339B_ABST
Patent Text Reader

Abstract

The present invention discloses an image brightness enhancement method, a terminal and a storage medium based on a confrontation network. The method includes: converting an image to be processed from the RGB space to the Lab space to obtain preprocessed data; inputting the preprocessed data into the confrontation network model; inputting the output image data into the discriminant network model to obtain a discriminant result; training the confrontation network model according to the discriminant result to obtain a trained confrontation network model; adjusting the brightness of the image to be processed based on the trained confrontation network model. By converting the image to the Lab space, the present invention can avoid the phenomenon of color distortion; and by inputting the converted data into the confrontation network model and using the discriminant network model to discriminate the output result, the brightness enhancement factor can be automatically found, improving the accuracy of image brightness enhancement and avoiding the phenomena of prominent light and dark edges and color distortion of the image caused by too high or too low brightness values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image brightness applications, and particularly to an image brightness enhancement method, a terminal, and a storage medium based on a confrontation network. Background Art

[0002] With the continuous in - depth research in the fields of digital images and computer vision, image enhancement technology has been continuously improved. Among them, the enhancement of image brightness value is one of the most common ways of image enhancement. And the brightness value parameter of an image is often represented by the L parameter in the Lab color space.

[0003] The Lab color space is a color system based on physiological characteristics. The L component represents the brightness of pixels, that is, the range from pure black to pure white. The a represents the range from red to green, and the b represents the range from yellow to blue. Its color gamut is wide and can represent all colors that the human eye can perceive. In addition to including all colors in the CMYK and RGB color spaces, it can also make up for the deficiencies of the RGB color model: there are too many transitional colors between blue and green, while there are too few transitional colors between green and red.

[0004] Since the brightness component L and the color components a and b in the Lab color space are independent of each other, only processing the brightness component L will not affect the color of the image, avoiding the color distortion caused by the later image fusion due to directly processing the three component channels of the RGB image without distinguishing color and brightness. Therefore, the Lab color mode image is often used for image processing work. And for image brightness enhancement, that is, to increase the L value, how to accurately obtain the target brightness value image without affecting color change is the main problem faced currently.

[0005] Classic image brightness enhancement techniques are divided into frequency - domain methods and spatial - domain methods. The frequency - domain methods are mainly used to remove or weaken noise and effectively enhance details, with low algorithm complexity and high efficiency; the spatial - domain methods mainly establish a mathematical model based on image pixels, and the algorithm realizes image brightness enhancement by operating on pixels with different attributes. However, traditional enhancement methods, although they can enhance brightness to a certain extent, ignore color parameters and image contrast, and cannot make the enhanced - brightness image reach the target brightness value.

[0006] Currently, the Retinex theory and related improved methods are often used to enhance the brightness of images. In 1971, Land et al. proposed the Retinex algorithm, pointing out that the reflection of objects determines the perception result of the visual system on the colors of objects. In 2014, Li et al. proposed a Retinex algorithm based on weighted guided filtering, setting the weight as an adaptive factor to reduce noise and improve the clarity and brightness of images. However, in terms of the effect, the contrast of image details is not high, and the brightness enhancement effect is not obvious either. In 2017, Guo et al. used weighted L1-norm regularization to replace the estimation of the illumination component in the original Retinex algorithm in order to effectively improve the image quality of low-brightness images, and this method has a greater improvement on the image brightness. In 2018, Jie et al. combined guided filtering with the Retinex algorithm and used an iterative multi-scale method to enhance images with illumination defects. Hu Feng et al. designed a low-light image enhancement method based on simulated multi-exposure fusion, combined the Retinex algorithm model with morphology, adjusted image details by constructing a new compensation function, solved phenomena such as image halos, and reduced the distortion rate of images. In 2020, Li et al. proposed a method of combining convolutional neural network and quadtree decomposition to perform noise reduction processing on images in specific scenarios, and then enhance the brightness of the images.

[0007] The above methods have enhanced the brightness of images from different angles. However, due to the uneven distribution of image illumination, the highlight areas are less affected by the algorithm processing, which easily leads to problems such as prominent bright-dark edges and color distortion in the images, and the details in the highlight areas have not been significantly improved. At the same time, the required brightness value image cannot be accurately obtained. In addition, for some software such as PS, manual methods are often used to increase the image brightness. Although this type of method can accurately obtain the brightness value of the image, this method is too inefficient to meet the large number of image brightness enhancements.

[0008] Therefore, the existing technology still needs to be improved. Summary of the Invention

[0009] The technical problem to be solved by the present invention is that, aiming at the defects of the existing technology, the present invention provides an image brightness enhancement method, a terminal and a storage medium based on an adversarial network, which can accurately increase the brightness value of an image without affecting the color change of the image, so as to solve the technical problems of prominent bright-dark edges and color distortion in the existing image brightness enhancement methods.

[0010] The technical solutions adopted by the present invention to solve the technical problems are as follows:

[0011] In the first aspect, the present invention provides an image brightness enhancement method based on an adversarial network. The image brightness enhancement method based on an adversarial network includes the following steps:

[0012] Convert the image to be processed from the RGB color space to the Lab color space to obtain the preprocessed data of the image to be processed;

[0013] Build an adversarial network model, and input the preprocessed data into the adversarial network model to obtain output image data;

[0014] Input the output image data into a discriminative network model to obtain the discrimination result of the output image data;

[0015] Train the adversarial network model according to the discrimination result to obtain a trained adversarial network model;

[0016] Adjust the brightness of the image to be processed based on the trained adversarial network model.

[0017] In one implementation, the step of converting the image to be processed from the RGB color space to the Lab color space to obtain the preprocessed data of the image to be processed includes:

[0018] Convert the image to be processed from the RGB color space to the XYZ color space;

[0019] Convert the XYZ color space to the Lab color space to obtain the channel data of the Lab color space;

[0020] Obtain the images to be processed with brightness values lower than a preset brightness according to the channel data, and name the obtained images to be processed.

[0021] In one implementation, the step of building an adversarial network model, and inputting the preprocessed data into the adversarial network model to obtain output image data includes:

[0022] Build the adversarial network model;

[0023] Input the named images to be processed into the adversarial network model, and extract and determine the interval parameters of the brightness enhancement factor through the adversarial network model;

[0024] Determine the operation interval of the brightness enhancement factor according to the interval parameters, and calculate the new brightness value of the output image according to the operation interval;

[0025] Convert the image with the increased brightness value from the Lab color space to the RGB color space, and output the converted RGB image.

[0026] In one implementation, the operation interval of the brightness enhancement factor is calculated using the following formula:

[0027]

[0028] Among them, m is the image brightness value before enhancement;

[0029] a and b are the brightness enhancement ranges;

[0030] p and q are the brightness enhancement amplitudes;

[0031] k1, k2, and k3 are bias parameters;

[0032] T θ L(m) is the brightness enhancement piecewise function.

[0033] In one implementation, inputting the output image data into the discriminative network model to obtain the discrimination result of the output image data includes:

[0034] Inputting the output RGB image and the RGB image of the target brightness into the discriminative network model;

[0035] Comparing the parameters of the output RGB image with the parameters of the RGB image of the target brightness through the discriminative network model;

[0036] Determining the error between the output RGB image and the RGB image of the target brightness according to the parameter comparison result.

[0037] In one implementation, training the adversarial network model according to the discrimination result to obtain the trained adversarial network model includes:

[0038] Determining the weighted sum of the adversarial loss components and the regularization loss component;

[0039] Constructing a loss function according to the weighted sum of the adversarial loss components and the regularization loss component;

[0040] Recording the error through the loss function and determining whether the error is less than a preset value;

[0041] If the error is greater than or equal to the preset value, feedback the error to the adversarial network model for the next round of training;

[0042] If the error is less than the preset value, end the training to obtain the trained adversarial network model.

[0043] In one implementation, the weighted sum of the adversarial loss components is calculated using the following formula:

[0044]

[0045] Among them, L gan is the weighted sum of the adversarial loss components;

[0046] fw is the cross-entropy loss function;

[0047] is the eigenvalue of the output image;

[0048] The regularization loss component is calculated using the following formula:

[0049]

[0050] where L reg is the regularization loss component;

[0051] f vyy is the output feature quantity;

[0052] I i is the eigenvalue of the image.

[0053] In one implementation, adjusting the brightness of the image to be processed based on the trained adversarial network model includes:

[0054] Determining a corresponding brightness enhancement factor according to the trained adversarial network model;

[0055] Boosting the image to be processed from the current brightness to the target brightness through the corresponding brightness enhancement factor to obtain an image with enhanced brightness;

[0056] Outputting the image with enhanced brightness to the corresponding display device.

[0057] In a second aspect, the present invention provides a terminal, including: a processor and a memory, where the memory stores an image brightness enhancement program based on an adversarial network, and when the image brightness enhancement program based on the adversarial network is executed by the processor, it is used to implement the image brightness enhancement method based on the adversarial network as described in the first aspect.

[0058] In a third aspect, the present invention provides a storage medium, where the storage medium stores an image brightness enhancement program based on an adversarial network, and when the image brightness enhancement program based on the adversarial network is executed by a processor, it is used to implement the image brightness enhancement method based on the adversarial network as described in the first aspect.

[0059] The present invention adopts the above technical solutions and has the following effects:

[0060] By converting an image into the Lab color space, the present invention can avoid color distortion when enhancing the image brightness subsequently. Moreover, by inputting the converted data into an adversarial network model and using a discriminative network model to discriminate the output results, the process of automatically finding a brightness enhancement factor is realized, avoiding the operations of manually searching for and enhancing the image brightness. The present invention can not only improve the accuracy of image brightness enhancement, but also implement a large number of image brightness enhancement tasks. By accurately enhancing images with different brightness levels to the target image brightness, the phenomena of prominent image light and dark edges and color distortion caused by excessively high or low brightness values are avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on the structures shown in these drawings.

[0062] Figure 1 FIG. is a flowchart of a method for enhancing image brightness based on an adversarial network in an implementation manner of the present invention.

[0063] Figure 2 FIG. is a schematic diagram of an adversarial network model in an implementation manner of the present invention.

[0064] Figure 3 FIG. is a schematic diagram of a discriminative network model in an implementation manner of the present invention.

[0065] Figure 4 FIG. is a functional schematic diagram of a terminal in an implementation manner of the present invention.

[0066] The realization, functional features, and advantages of the objectives of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0067] To make the objectives, technical solutions, and advantages of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0068] EXEMPLARY METHOD

[0069] As Figure 1 shown, an embodiment of the present invention provides a method for enhancing image brightness based on an adversarial network. The method for enhancing image brightness based on an adversarial network includes the following steps:

[0070] Step S100, convert the image to be processed from the RGB color space to the Lab color space to obtain the preprocessed data of the image to be processed.

[0071] In this embodiment, the method for enhancing the image brightness based on the adversarial network is applied to a terminal, which includes but is not limited to devices such as a television (smart TV), a computer, and a mobile terminal; specifically, the terminal is a device with image processing and image display functions.

[0072] In this embodiment, set the image whose brightness needs to be enhanced as the image to be processed, and preprocess the image to be processed by means of format conversion so that the preprocessed image meets the format requirements for brightness enhancement.

[0073] Specifically, when preprocessing the image to be processed, it is necessary to convert the image to be processed from the RGB color space to the Lab color space; where the RGB color space is a color space composed of a red channel (R channel), a green channel (G channel), and a blue channel (B channel), and the Lab color space is a color space composed of a lightness channel (L channel), an a channel (representing the range from magenta to dark green), and a b channel (representing the range from bright yellow to owl blue).

[0074] It is worth mentioning that the RGB color space cannot be directly converted to the Lab color space, and the conversion process needs to be achieved by means of the XYZ color space; that is, convert the image to be processed from the RGB color space to the XYZ color space, and then convert the XYZ color space to the Lab color space to obtain the channel data of the Lab color space.

[0075] In the process of converting the RGB color space to the XYZ color space, the corresponding relationship between the XYZ color space and the RGB color space is:

[0076]

[0077] In the process of converting the XYZ color space to the Lab color space, the corresponding relationship between the Lab color space and the XYZ color space is:

[0078]

[0079]

[0080]

[0081]

[0082] After obtaining the Lab space through conversion, rename the image with a lower brightness value (i.e., L-channel value); for example: compare the brightness value (i.e., L-channel value) with a preset value (e.g., the preset value is 10), obtain the image with a brightness value less than the preset value, and name the image L 暗 ab.

[0083] That is, in one implementation of this embodiment, step S100 specifically includes the following steps:

[0084] Step S110, convert the image to be processed from the RGB space to the XYZ space;

[0085] Step S120, convert the XYZ space to the Lab space to obtain the channel data of the Lab space;

[0086] Step S130, obtain the image to be processed with a brightness value lower than the preset brightness according to the channel data, and name the obtained image to be processed.

[0087] In this embodiment, by converting the image from the RGB space to the Lab space, it is possible to avoid color distortion during subsequent brightness enhancement, and at the same time, it is convenient to extract the brightness value parameter of the image to enhance the brightness of the image according to the extracted brightness value parameter.

[0088] As Figure 1 shown, in one implementation of the embodiment of the present invention, the method for enhancing the brightness of an image based on an adversarial network further includes the following steps:

[0089] Step S200, construct an adversarial network model, and input the preprocessed data into the adversarial network model to obtain output image data.

[0090] In this embodiment, after preprocessing the image to be processed, it is necessary to construct an adversarial network model, where the adversarial network model is an initial network model that has not been trained; by training the adversarial network model, the brightness enhancement accuracy of the adversarial network model for the image to be processed is improved, so as to obtain the trained adversarial network model to enhance the brightness of the image and make the brightness of the image reach the target brightness from a low brightness.

[0091] Specifically, when constructing the adversarial network model, it is necessary to determine the network model parameters. In this embodiment, the adversarial network model is composed of two CNN network (convolutional neural network) models, and its network parameters are the convolutional parameters of the two CNN networks; among them, the convolutional parameters of each CNN network include: convolutional kernel, convolutional layer connection parameters (e.g., input of each layer, feature output), and convolutional channel layer parameters (e.g., channel weighted value calculation), etc.

[0092] Further, after the network model parameters are set, the L 暗 ab image is used as input data and input into the set adversarial network model; first, enter the generated network model, and then perform operations on the brightness parameter (i.e., the L-channel value) of the L 暗 ab image based on deep learning. The specific operation is as follows:

[0093] Use the converted L 暗 ab image as input data, and through the operation method of the generated adversarial network model, extract and determine the operation interval of the brightness enhancement factor θ of the L 暗 ab image; among them, the operation interval parameters of θ are a, b, p, and q; the parameters a, b, p, and q are variable ranges determined from a parameter set for finding the brightness enhancement factor θ; by extracting the parameters a, b, p, and q, determine the operation interval where the brightness enhancement factor θ of this L 暗 ab image is located; furthermore, using the determined operation interval, the subsequent calculation process of partition brightness enhancement can be completed, thereby obtaining the new brightness value L of the output image.

[0094] Further, in the process of extracting the above operation interval, the operation interval of the brightness enhancement factor θ is calculated using the following formula:

[0095]

[0096] Among them, m is the image brightness value before enhancement and is also the independent variable of the function;

[0097] a and b are the brightness enhancement ranges;

[0098] p and q are the brightness enhancement amplitudes;

[0099] k1, k2, and k3 are bias parameters;

[0100] T θ L(m) is a brightness enhancement piecewise function.

[0101] In the above operation process, in order to accurately find the brightness enhancement factor θ and accurately enhance the brightness of the L 暗 ab image, the above operation process is implemented by a CNN network model. The structure of this CNN network model is as Figure 2 shown, consisting of an input layer, a convolutional layer, and a pooling layer; when the input is L 暗When dealing with the ab image, it enters the convolutional layer to complete the convolutional operation and parameter extraction of the parameters related to the brightness value L (i.e., the set parameters a, b, p, q of the brightness enhancement factor θ), and then enters the pooling layer to complete the parameter output process; during the output process of the pooling layer, it mainly searches for the operation interval of the brightness enhancement factor θ, that is, determines the brightness improvement range and the brightness improvement amplitude.

[0102] Further, after completing the interval operation, it enters the softmax classifier for interval classification. The division of the operation interval is mainly to improve the accuracy of the brightness enhancement factor θ, so that images with different brightnesses have different improvement effects; after obtaining the interval classification, according to the corresponding interval after classification, calculate the new brightness value, and thus output the image with the increased brightness value, and name this image L 亮 ab, and automatically convert the L 亮 ab image into a new RGB image to obtain RGB new image.

[0103] Among them, the process of converting the L 亮 ab image to the RGB image is the reverse process of the above-mentioned conversion of the RGB image to the Lab image, that is, first convert the L 亮 ab image from the Lab space to the XYZ space, and then convert the XYZ space to the RGB space to obtain the channel data of the RGB space; specifically, it will not be elaborated here.

[0104] Since, during the above operation process, the brightness improvement is divided into multiple intervals. In this way, the brightness improvement interval can be automatically divided according to the brightness value of the input image, so as to more accurately find the brightness enhancement factor θ according to the corresponding improvement interval.

[0105] That is, in one implementation manner of this embodiment, step S200 specifically includes the following steps:

[0106] Step S210, construct the adversarial network model;

[0107] Step S220, input the named image to be processed into the adversarial network model, and extract and determine the interval parameters where the brightness enhancement factor is located through the adversarial network model;

[0108] Step S230, determine the operation interval of the brightness enhancement factor according to the interval parameters, and calculate the new brightness value of the output image according to the operation interval;

[0109] Step S240, convert the image with the increased brightness value output from the Lab space to the RGB space, and output the converted RGB image.

[0110] In this embodiment, by constructing an adversarial network model, the L-value parameter of the image to be processed is specifically calculated using the adversarial network model, while the remaining parameters are not extracted or calculated, which can greatly ensure that the color of the image output by the adversarial network model does not change. Moreover, in the adversarial network model, by setting different operation intervals of the brightness enhancement factor θ, images with different brightness values can be effectively adjusted, thereby completing the brightness enhancement process of images with different brightness values and avoiding the phenomenon of excessive or insufficient brightness value enhancement.

[0111] As Figure 1 shown, in an implementation manner of the embodiment of the present invention, the method for enhancing the brightness of an image based on an adversarial network further includes the following steps:

[0112] Step S300, inputting the output image data into a discriminant network model to obtain a discriminant result of the output image data.

[0113] In this embodiment, after the operation of the adversarial network model, a discriminant network model needs to be constructed to determine whether the operation of the adversarial network model meets the accuracy requirements for brightness enhancement; that is, the discriminant network model is used to check whether the data output by the adversarial network model meets the expected requirements. If the expected requirements are met, the training process of the adversarial network model is stopped, and the adversarial network model trained at this stage is used as the trained adversarial network model to enhance the brightness of images with lower brightness values. If the expected requirements are not met, the output data of the adversarial network model is used as feedback data to further train the adversarial network model until the training output data meets the expected requirements.

[0114] Specifically, the RGB new image output by the adversarial network model and the target brightness image RGB d are input into the constructed discriminant network model as inputs, so as to compare the RGB new image with the RGB d image in this discriminant network model, which is a binary classification process, and determine whether the two are the same according to the feature vectors of the two images; in each judgment process, the result of each judgment will record the error between the two images through a loss function and backpropagate the error to the adversarial network model, thereby improving the operation accuracy of the entire adversarial network model.

[0115] In the above judgment process, the discriminant network model used is to replace the last layer of 1000-class classification in ResNet-101 with a fully connected layer of 2 neurons; as Figure 3 shown, through the ResNet module in this network, the RGB new image can be compared with the target brightness image RGB dFor the parameter comparison, after the output data enters the fully connected layer, the classification changes from 1000 classes in the original ResNet-101 to 2 classes, that is, to determine whether the feature vectors of two images are the same, and the judgment result is recorded in the form of a loss function and fed back to the adversarial network model at the same time.

[0116] It can be understood that this discrimination stage is for the accuracy training process of the entire adversarial network model, using the RGB new image output by the adversarial network model and the target brightness image RGB d as the training set to train the entire adversarial network model, so that the accuracy of the entire adversarial network model is continuously improved, and finally the RGB new image output and the target brightness image RGB d are consistent.

[0117] That is, in one implementation manner of this embodiment, step S300 specifically includes the following steps:

[0118] Step S310, input the output RGB image and the RGB image of the target brightness into the discrimination network model;

[0119] Step S320, compare the parameters of the output RGB image with the parameters of the RGB image of the target brightness through the discrimination network model;

[0120] Step S330, determine the error between the output RGB image and the RGB image of the target brightness according to the parameter comparison result.

[0121] In this embodiment, by comparing and judging the parameters of the target brightness image and the generated image, and backpropagating the training result to the adversarial network model, as the training amount increases, the error gradually decreases, and finally the brightness of the original image can be accurately increased to the brightness of the target image.

[0122] As Figure 1 shown, in one implementation manner of the embodiment of the present invention, the method for improving the image brightness based on the adversarial network further includes the following steps:

[0123] Step S400, train the adversarial network model according to the discrimination result to obtain a trained adversarial network model.

[0124] In this embodiment, in order to effectively improve the accuracy of the entire adversarial network model, it is necessary to effectively train the adversarial network model. The training process is the working process of the discrimination network model; and in order to complete the above training process, a loss function needs to be added to the judgment network model to record the error and feedback it to the adversarial network model, thereby improving the accuracy of the entire adversarial network model; among them, the loss function is the weighted sum L of the adversarial loss componentsgan It is determined to ensure that the training process of the adversarial network model is more accurate and to ensure that the overall adversarial network model is more stable.

[0125] Furthermore, when setting the loss function, the weighted sum of the adversarial loss components is calculated using the following formula:

[0126]

[0127] where L gan is the weighted sum of the adversarial loss components;

[0128] f w is the cross-entropy loss function;

[0129] is the eigenvalue of the output image;

[0130] The regularization loss component is calculated using the following formula:

[0131]

[0132] where L reg is the regularization loss component;

[0133] f vyy is the output feature quantity;

[0134] I i is the eigenvalue of the image.

[0135] Through the above loss function, the training process of the adversarial network model can be very intuitively described, providing an intuitive loss information, which can be further used for regular training; as the input quantity of the image to be processed increases and the training process continues to increase, by using the repeated iteration of the loss function and judging the continuous feedback of the model, the accuracy of the operation of the entire adversarial network model is continuously improved; therefore, for the adversarial network model, the accuracy of finding the brightness enhancement factor θ can be improved, and finally the brightness value can be accurately increased.

[0136] It is worth mentioning that in this embodiment, the error value recorded by the loss function needs to be less than a preset value (for example: the preset value is 0.6%) to stop the training of the adversarial network model; that is, the similarity between the output RGB new image and the target brightness image RGB d reaches 99.4%; that is, in the training stage of this embodiment, after 1500 iterations, the loss function converges, and at this time, the iteration is terminated, and the training of the adversarial network model is completed, and the recognition accuracy according to the output value reaches 99.4%.

[0137] That is, in one implementation manner of this embodiment, step S400 specifically includes the following steps:

[0138] Step S410, determine the weighted sum of the adversarial loss components and the regularization loss components;

[0139] Step S420, construct a loss function according to the weighted sum of the adversarial loss components and the regularization loss components;

[0140] Step S430, record the error through the loss function and determine whether the error is less than a preset value;

[0141] Step S440, if the error is greater than or equal to the preset value, feedback the error to the adversarial network model for the next round of training;

[0142] Step S450, if the error is less than the preset value, end the training and obtain the trained adversarial network model.

[0143] In this embodiment, after obtaining the comparison result, record the error between the output image and the target image in the form of a loss function, and backpropagate the error as the training result to the adversarial network model. As the amount of training increases, the error gradually decreases, and finally the brightness of the original image can be accurately increased to the brightness of the target image.

[0144] Such as Figure 1 shown, in an implementation manner of the embodiment of the present invention, the method for enhancing the image brightness based on the adversarial network further includes the following steps:

[0145] Step S500, adjust the brightness of the image to be processed based on the trained adversarial network model.

[0146] In this embodiment, after continuous training, the operation result of the adversarial network model meets the expected accuracy requirements. At this time, the brightness of the image to be processed can be enhanced through the trained adversarial network model; specifically, first determine the brightness enhancement factor that meets the accuracy requirements, then use this brightness enhancement factor to increase the image from a low brightness value to the target brightness value, and output it to the corresponding display device according to the output path; in the actual usage scenario, the brightness value range of the image is between 0 - 100, and according to the actual needs of the image, the brightness value of the low-brightness image can be increased to between 80 - 90.

[0147] It should be noted that, in another implementation manner of this embodiment, the brightness of the high-brightness image can be adjusted downward through the adversarial network model and the discriminant network model of this embodiment, so as to reduce the high-brightness image to the target brightness. The method for reducing the brightness value is similar to the method for increasing the brightness value, and will not be elaborated here.

[0148] That is, in an implementation manner of this embodiment, step S500 specifically includes the following steps:

[0149] Step S510: Determine the corresponding brightness enhancement factor according to the trained adversarial network model;

[0150] Step S520: Lift the image to be processed from the current brightness to the target brightness through the corresponding brightness enhancement factor, and obtain the image with enhanced brightness;

[0151] Step S530: Output the image with enhanced brightness to the corresponding display device.

[0152] In this embodiment, since the entire enhancement process is implemented in the adversarial network model, the entire process is an automatic recognition process, avoiding manual operations and enabling the brightness enhancement process to be completed for a large number of images. Moreover, in the generative adversarial network model, the automatically selected brightness enhancement factor θ can accurately complete the brightness enhancement process for images with different brightness levels, avoiding the problem of difficult processing for images with too high or too low brightness values in traditional methods. Since only the brightness parameters are extracted for calculation in this embodiment, the color will not change.

[0153] In another implementation manner of this embodiment, other network models can be used to replace the adversarial network model, and more parameter ranges can also be extracted for the operation parameters during the generation of the network model, so as to more detailedly divide the operation channels for brightness enhancement and more accurately enhance the brightness value of the image. In addition, the loss function for recording errors can also be replaced by other functions to record and feedback the output results with the optimized loss function.

[0154] In this embodiment, by converting the image to the Lab color space, the phenomenon of color distortion during subsequent brightness enhancement of the image can be avoided; and by inputting the converted data into the adversarial network model and using the discriminative network model to discriminate the output results, the process of automatically finding the brightness enhancement factor is realized, avoiding the operations of manually searching for and enhancing the image brightness. The present invention can not only improve the accuracy of image brightness enhancement, but also accurately enhance images with different brightness levels to the target image brightness, avoiding the phenomena of prominent light and dark edges and color distortion of the image caused by too high or too low brightness values.

[0155] Exemplary Device

[0156] Based on the above embodiments, the present invention also provides a terminal, and its principle block diagram can be as Figure 4 shown.

[0157] The terminal includes: a processor, a memory, an interface, a display screen, and a communication module connected via a system bus; wherein, the processor of the terminal is used to provide computing and control capabilities; the memory of the terminal includes a storage medium and an internal memory; the storage medium stores an operating system and a computer program; the internal memory provides an environment for the operation of the operating system and the computer program in the storage medium; the interface is used to connect to external terminal devices, such as mobile terminals and computers, etc.; the display screen is used to display corresponding image brightness enhancement information based on the adversarial network; the communication module is used to communicate with a cloud server or a mobile terminal.

[0158] When the computer program is executed by the processor, it is used to implement an image brightness enhancement method based on an adversarial network.

[0159] Those skilled in the art can understand that Figure 4 the principle block diagram shown in is only a block diagram of some structures related to the solution of the present invention, and does not constitute a limitation on the terminal to which the solution of the present invention is applied. The specific terminal may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0160] In one embodiment, a terminal is provided, which includes: a processor and a memory. The memory stores an image brightness enhancement program based on an adversarial network. When the image brightness enhancement program based on the adversarial network is executed by the processor, it is used to implement the above-mentioned image brightness enhancement method based on the adversarial network.

[0161] In one embodiment, a storage medium is provided, which stores an image brightness enhancement program based on an adversarial network. When the image brightness enhancement program based on the adversarial network is executed by the processor, it is used to implement the above-mentioned image brightness enhancement method based on the adversarial network.

[0162] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned method embodiments. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided by the present invention can include non-volatile and / or volatile memories.

[0163] In summary, the present invention provides an image brightness enhancement method, a terminal, and a storage medium based on a confrontation network. The method includes: converting an image to be processed from the RGB space to the Lab space to obtain preprocessed data; inputting the preprocessed data into the confrontation network model; inputting the output image data into the discrimination network model to obtain a discrimination result; training the confrontation network model according to the discrimination result to obtain a trained confrontation network model; and adjusting the brightness of the image to be processed based on the trained confrontation network model. By converting the image to the Lab space, the present invention can avoid the phenomenon of color distortion. Moreover, by inputting the converted data into the confrontation network model and using the discrimination network model to discriminate the output result, the brightness enhancement factor can be automatically found, improving the accuracy of image brightness enhancement and avoiding the phenomena of prominent bright and dark edges and color distortion of the image caused by too high or too low brightness values.

[0164] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.

Claims

1. An image brightness enhancement method based on an adversarial network, characterized in that, The image brightness enhancement method based on the adversarial network includes the following steps: Convert the image to be processed from the RGB space to the Lab space to obtain the preprocessed data of the image to be processed; Construct an adversarial network model, and input the preprocessed data into the adversarial network model to obtain output image data; Input the output image data into a discriminant network model to obtain the discrimination result of the output image data; Train the adversarial network model according to the discrimination result to obtain a trained adversarial network model; Adjust the brightness of the image to be processed based on the trained adversarial network model; The constructing an adversarial network model and inputting the preprocessed data into the adversarial network model to obtain output image data includes: Construct the adversarial network model; Input the named image to be processed into the adversarial network model, and extract and determine the interval parameters where the brightness enhancement factor is located through the adversarial network model; Determine the operation interval of the brightness enhancement factor according to the interval parameters, and calculate the new brightness value of the output image according to the operation interval; Convert the image with the increased brightness value output from the Lab space to the RGB space, and output the converted RGB image; The operation interval of the brightness enhancement factor is calculated using the following formula: ; Among them, is the image brightness value before enhancement; , is the brightness improvement range; , is the brightness improvement amplitude; , , is the offset parameter; It is a piecewise function for brightness enhancement.

2. The method for enhancing image brightness based on a confrontation network according to claim 1, wherein The converting the image to be processed from the RGB space to the Lab space to obtain the preprocessed data of the image to be processed includes: Convert the image to be processed from the RGB space to the XYZ space; Convert the XYZ space to the Lab space to obtain the channel data of the Lab space; Obtain the image to be processed with a brightness value lower than the preset brightness according to the channel data, and name the obtained image to be processed.

3. The method for enhancing image brightness based on an adversarial network according to claim 1, characterized in that The inputting the output image data into a discriminant network model to obtain the discrimination result of the output image data includes: Input the output RGB image and the RGB image with the target brightness into the discriminant network model; Compare the parameters of the output RGB image with the parameters of the RGB image with the target brightness through the discriminant network model; Determine the error between the output RGB image and the RGB image with the target brightness according to the parameter comparison result.

4. The method for enhancing image brightness based on an adversarial network according to claim 3, wherein The training the adversarial network model according to the discrimination result to obtain a trained adversarial network model includes: Determine the weighted sum of the adversarial loss components and the regularization loss components; Construct a loss function according to the weighted sum of the adversarial loss components and the regularization loss components; Record the error through the loss function and determine whether the error is less than a preset value; If the error is greater than or equal to the preset value, feedback the error to the adversarial network model for the next round of training; If the error is less than the preset value, end the training to obtain the trained adversarial network model.

5. The method for enhancing image brightness based on an adversarial network according to claim 4, wherein The weighted sum of the adversarial loss components is calculated using the following formula: ; Among them, is the weighted sum of the adversarial loss components; is the cross-entropy loss function; is the eigenvalue of the output image; The regularization loss components are calculated using the following formula: ; Among them, is the regularization loss component; is the output feature quantity; is the eigenvalue of the image.

6. The method for enhancing image brightness based on a confrontation network according to claim 1, wherein, The adjusting the brightness of the image to be processed based on the trained adversarial network model includes: Determine the corresponding brightness enhancement factor according to the trained adversarial network model; Lift the image to be processed from the current brightness to the target brightness through the corresponding brightness enhancement factor to obtain the image with enhanced brightness; Output the image with enhanced brightness to the corresponding display device.

7. A terminal, characterized in that, Comprising: A processor and a memory, the memory stores an image brightness enhancement program based on an adversarial network, and when the image brightness enhancement program based on the adversarial network is executed by the processor, it is used to implement the image brightness enhancement method based on an adversarial network according to any one of claims 1-6.

8. A storage medium, characterized in that, The storage medium stores an image brightness enhancement program based on an adversarial network, and when the image brightness enhancement program based on the adversarial network is executed by a processor, it is used to implement the image brightness enhancement method based on an adversarial network according to any one of claims 1-6.

Citation Information

Patent Citations

  • Unsupervised learning method and system for low-illumination image enhancement

    CN113313657A

  • Image recognition method and apparatus, and non-volatile readable storage medium and computer device

    WO2020258667A1