Model training method, device, equipment and medium based on image processing
Through the model training method based on image processing, the generator and discriminator models are used to generate matching image tuning parameters, which solves the problem of inconsistent imaging effects in the existing ISP scheme, and realizes the adaptive processing and quality assurance of image data.
Patent Information
- Application Number
- CN202010771696.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-04
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2040-08-04
AI Technical Summary
When the existing ISP solution uses the same ISP chip in different electronic devices, the uniformity of the imaging effect cannot be guaranteed, resulting in different imaging effects.
Through the model training method based on image processing, the image data is processed using the generator model and the discriminator model to generate adjustment parameters matching the image data to ensure the quality of each image. The method includes obtaining the training set sample image data, generating prediction data through the generator model, and reversing the model parameters based on the generator loss value and discriminator loss value, saving the model parameters after meeting the accuracy requirements, and using the image of the image processing device for the image processing device Adjust.
Adaptive processing of different image data is realized, the quality of each generated image is ensured, and it is suitable for image processing equipment with different parameters and specifications. It does not require professional technology and resources, saves costs and time, and ensures imaging effects.
Smart Images

Figure CN112132172B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image signal processing, and in particular to a model training method, device, equipment and medium based on image processing. Background Art
[0002] With the development of computer technology, electronic devices such as smart phones and related smart handheld terminal devices have become people's electronic necessities. Among them, the image signal processing technology in each electronic device determines the quality of the captured image. The existing ISP (image signal processing) solution is to integrate a general-purpose ISP chip in the electronic device, and perform post-processing on the signal output by the image sensor in the electronic device through the integrated ISP chip, such as noise reduction and HDR (High-Dynamic Range) correction, so as to generate the final image.
[0003] However, when using the existing ISP solution, different electronic devices will obtain imaging effects corresponding to their respective parameter specifications when using the same ISP chip. Since the parameter specifications of each electronic device are different, the imaging effects obtained by each are different. In other words, there is a problem that the imaging effect cannot be guaranteed. Summary of the invention
[0004] Based on this, it is necessary to provide a model training method, device, equipment and medium based on image processing that can ensure imaging effects in response to the above technical problems.
[0005] A model training method based on image processing, the method comprising:
[0006] Acquire training set sample image data, and process the training set sample image data through the generator model to be trained to generate prediction data corresponding to the training set sample image data;
[0007] Obtaining label data corresponding to the training set sample image data;
[0008] Calculating the generator loss value according to a generator loss function corresponding to the generator model to be trained;
[0009] Inputting the predicted data and the label data into a discriminator model to be trained, and calculating a discriminator loss value according to a discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data;
[0010] According to the generator loss value and the discriminator loss value, the generator model to be trained and the discriminator model to be trained are respectively optimized repeatedly and alternately by back propagation; when the accuracy requirement or the preset number of iterations is reached, the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained are saved to obtain the trained generator model and the discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data.
[0011] A model training device based on image processing, the device comprising:
[0012] A prediction data generation module, used to obtain training set sample image data, and process the training set sample image data through a generator model to be trained to generate prediction data corresponding to the training set sample image data;
[0013] An acquisition module, used to acquire label data corresponding to the training set sample image data;
[0014] A generator loss value calculation module, used to calculate the generator loss value according to the generator loss function corresponding to the generator model to be trained;
[0015] A discriminator loss value calculation module, used for inputting the predicted data and the label data into the discriminator model to be trained, and calculating the discriminator loss value according to the discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data;
[0016] A model optimization module is used to repeatedly and alternately optimize the generator model to be trained and the discriminator model to be trained by back propagation according to the generator loss value and the discriminator loss value, and when the accuracy requirement or the preset number of iterations is reached, save the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained to obtain the trained generator model and discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data.
[0017] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0018] Acquire training set sample image data, and process the training set sample image data through the generator model to be trained to generate prediction data corresponding to the training set sample image data;
[0019] Obtaining label data corresponding to the training set sample image data;
[0020] Calculating the generator loss value according to a generator loss function corresponding to the generator model to be trained;
[0021] Inputting the predicted data and the label data into a discriminator model to be trained, and calculating a discriminator loss value according to a discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data;
[0022] According to the generator loss value and the discriminator loss value, the generator model to be trained and the discriminator model to be trained are respectively optimized repeatedly and alternately by back propagation; when the accuracy requirement or the preset number of iterations is reached, the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained are saved to obtain the trained generator model and the discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data.
[0023] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0024] Acquire training set sample image data, and process the training set sample image data through the generator model to be trained to generate prediction data corresponding to the training set sample image data;
[0025] Obtaining label data corresponding to the training set sample image data;
[0026] Calculating the generator loss value according to a generator loss function corresponding to the generator model to be trained;
[0027] Inputting the predicted data and the label data into a discriminator model to be trained, and calculating a discriminator loss value according to a discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data;
[0028] According to the generator loss value and the discriminator loss value, the generator model to be trained and the discriminator model to be trained are respectively optimized repeatedly and alternately by back propagation; when the accuracy requirement or the preset number of iterations is reached, the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained are saved to obtain the trained generator model and the discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data.
[0029] The above-mentioned model training method, device, equipment and medium based on image processing processes the training set sample image data through the generator model to be trained to obtain the corresponding prediction data. Based on the prediction data, the label data corresponding to the training set sample image data, the generator loss function, and the discriminator loss function, the corresponding generator loss value and the discriminator loss value are calculated respectively, and the generator model to be trained and the discriminator model to be trained are repeatedly optimized alternately by back propagation. When the accuracy requirement or the preset number of iterations is met, the trained generator model and discriminator model are obtained. The generator model and discriminator model obtained in this way can process different image data adaptively, that is, the calibration parameters matching the image data can be calculated instead of obtaining universal calibration parameters. By generating images according to the calibration parameters matching the image data, the quality of each generated image can be guaranteed, thereby improving the imaging effect of the image. For different image processing devices with different parameter specifications, there is no need to rely on professional resources such as professional technical personnel and professional laboratories, nor is there any need to adopt complex adjustment technology. Images that match the actual shooting conditions can be adaptively generated, which greatly saves resource costs and time costs, while also ensuring imaging effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of a flow chart of a model training method based on image processing in one embodiment;
[0031] Figure 2 A schematic diagram of a flow chart of a model training method based on image processing in another embodiment;
[0032] Figure 3is a flowchart of a model training method based on image processing in yet another embodiment;
[0033] Figure 4 is a structural block diagram of a model training device based on image processing in one embodiment;
[0034] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution 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 used to limit the present application.
[0036] In one embodiment, Figure 1 As shown, a model training method based on image processing is provided. This embodiment uses the method applied to an image processing device as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including an image processing device and a server, and is implemented through the interaction between the image processing device and the server. In this embodiment, the model training method based on image processing includes the following steps:
[0037] S102, obtaining training set sample image data, and processing the training set sample image data through the generator model to be trained to generate prediction data corresponding to the training set sample image data.
[0038] The training set sample image data is a collection of image data used to train the model, which can be the original color image data collected by the image sensor, and can be recorded as RAW_RGB original image data. It can be understood that RAW means original data, and RGB can be specifically represented as a color image with three channels of R (Red), G (Green), and B (Blue).
[0039] The image sensor is a camera unit located on the image processing device. It is a device that uses the photoelectric conversion function of the photoelectric device to convert the light image on the photosensitive surface into an electrical signal that is proportional to the light image. Image sensors can be specifically divided into photoconductive camera tubes and solid-state image sensors. Compared with photoconductive camera tubes, solid-state image sensors have the characteristics of small size, light weight, high integration, high resolution, low power consumption, long life and low price.
[0040] The generator model is a model for generating images. The generator model may be composed of one or more models. For example, the generator model may be composed of a calibration parameter generation model and an image calibration model. The calibration parameter generation model is used to generate calibration parameters corresponding to the training set sample image data, and the image calibration model is used to generate images corresponding to the training set sample image data according to the calibration parameters corresponding to the training set sample image data. For another example, the generator model may be composed of an image generation model, which is used to directly generate images corresponding to the training set sample image data.
[0041] The prediction data is data generated by the generator model and corresponding to the sample image data of the training set. It can be understood that different generator models can generate different prediction data. For example, when the generator model is composed of a calibration parameter generation model and an image calibration model, the corresponding prediction data includes the prediction calibration parameters generated by the calibration parameter generation model and the sample test image generated by the image calibration model; when the generator model is composed of an image generation model, the corresponding prediction data is the sample test image generated by the image generation model. Among them, the prediction calibration parameters are calibration parameters used to adjust the image effect of the sample image data of the training set, which can be black balance correction parameters, white balance correction parameters, nonlinear GAMMA correction parameters, lens correction parameters, bad pixel correction parameters, brightness correction parameters or saturation correction parameters, etc., which are not limited in this embodiment of the present application. The sample test image is an image generated by the generator model. For example, an image corresponding to the sample image data of the training set generated by the image calibration model based on the prediction calibration parameters, or an image corresponding to the sample image data of the training set directly generated by the image generation model.
[0042] Specifically, the image processing device obtains training set sample image data, and processes the training set sample image data through the generator model to be trained to generate prediction data corresponding to the training set sample image data.
[0043] In one embodiment, when the generator model is composed of a calibration parameter generation model and an image calibration model, the image processing device collects RAW_RGB original image data through an image sensor, processes the RAW_RGB original image data through the calibration parameter generation model and the image calibration model to be trained, and generates predicted calibration parameters and sample test images corresponding to the RAW_RGB original image data.
[0044] In one embodiment, when the generator model is composed of an image generation model, the image processing device collects RAW_RGB original image data through an image sensor, processes the RAW_RGB original image data through the image generation model to be trained, and generates a sample test image corresponding to the RAW_RGB original image data.
[0045] In one embodiment, the generator model includes a calibration parameter generation model and an image calibration model, wherein the calibration parameter generation model is used to generate predicted calibration parameters, and the image calibration model is used to generate sample test images based on the predicted calibration parameters and the corresponding training set sample image data, and the predicted calibration parameters and / or the sample test images are used as predicted data; or, the generator model is an image generation model, which is used to directly generate sample test images; wherein the image generation model is composed of an image feature extraction network and an image reconstruction network, and the output of the last layer of the image feature extraction network is used as the input of the image reconstruction network, and some feature layers in the image feature extraction network and the image reconstruction network are connected through association layers to realize feature association, and the sample test images are used as predicted data.
[0046] In one embodiment, when the generator model is composed of a calibration parameter generation model and an image calibration model, the image processing device collects RAW_RGB raw image data through an image sensor, processes the RAW_RGB raw image data through the calibration parameter generation model to be trained, and generates predicted calibration parameters corresponding to the RAW_RGB raw image data. The image processing device then processes the RAW_RGB raw image data through the image calibration model and according to the predicted calibration parameters to generate a sample test image corresponding to the RAW_RGB raw image data. At this time, the image processing device uses the predicted calibration parameters and / or the sample test image as prediction data.
[0047] In one embodiment, the prediction and adjustment parameters include a plurality of sub-parameters having a preset order. Specifically, for the current sub-parameter to be processed, the image processing device determines a correction function corresponding to the current sub-parameter. The image processing device determines the pixel value corresponding to the current sub-parameter based on the correction function and based on the pixel value corresponding to the current sub-parameter and the previous sub-parameter of the current sub-parameter. The image processing device uses the sub-parameter after the current sub-parameter as the current sub-parameter to be calculated next time, returns to the current sub-parameter to be processed, determines the correction function corresponding to the current sub-parameter and continues to execute until the pixel value corresponding to the last sub-parameter is obtained. The image processing device determines the sample test image corresponding to the prediction and adjustment parameters based on the pixel value corresponding to the last sub-parameter.
[0048] In one embodiment, when the generator model is composed of an image generation model, it is composed of an image feature extraction network and an image reconstruction network. The image processing device collects RAW_RGB original image data through an image sensor, processes the RAW_RGB original image data through the image generation model to be trained, and generates a sample test image corresponding to the RAW_RGB original image data. In other words, the RAW_RGB original image data is subjected to feature extraction processing by the image feature extraction network in the image generation model to be trained, and the output of the last layer of the image feature extraction network is used as the input of the image reconstruction network, thereby obtaining a sample test image output by the image reconstruction network. Among them, some feature layers in the image feature extraction network and the image reconstruction network are connected through an association layer to realize feature association. At this time, the image processing device uses the sample test image as prediction data.
[0049] In the above embodiment, when the generator model includes a calibration parameter generation model and an image calibration model, the corresponding prediction data is at least one of the prediction calibration parameters and the sample test image; when the generator model is an image generation model, the corresponding prediction data is at least one of the sample test image. In this way, the type and quantity of the corresponding prediction data can be determined by determining the type and quantity in the generator model. It can be understood that the generator model can be trained from multiple dimensions, thereby greatly improving the efficiency of training the generator model.
[0050] S104, obtaining label data corresponding to the training set sample image data.
[0051] Among them, the label data is the standard data used to train the model, and the label data corresponds to the prediction data. In other words, the type and quantity of the prediction data are consistent with the type and quantity of the label data. It can be understood that when the prediction data is the prediction calibration parameters and the sample test image, the corresponding label data is the label calibration parameters and the label image; when the prediction data is the sample test image, the corresponding label data is the label image.
[0052] It can be understood that the label calibration parameters are standard calibration parameters corresponding to the sample image data. The calibration parameters can specifically be black balance correction parameters, white balance correction parameters, nonlinear GAMMA correction parameters, lens correction parameters, bad pixel correction parameters, brightness correction parameters, or saturation correction parameters, etc., which are not limited in the embodiments of the present application. The label image is a standard image obtained by adjusting the sample image data according to the label calibration parameters. In other words, the label image can be understood as a standard image used as a template.
[0053] Specifically, the image processing device obtains label data corresponding to the training set sample image data from a server or a local memory.
[0054] In one embodiment, when the prediction data is a sample test image, the image processing device obtains a label image corresponding to the sample image data of the training set from a server or a local storage.
[0055] In another embodiment, when the prediction data is prediction calibration parameters and sample test images, the image processing device obtains label calibration parameters and label images corresponding to the training set sample image data from a server or a local memory.
[0056] S106, calculating the generator loss value according to the generator loss function corresponding to the generator model to be trained.
[0057] Specifically, after the image processing device generates prediction data corresponding to the sample image data of the training set through the generator model to be trained, based on the difference between the prediction data and the label data, and the loss value obtained when the prediction data is input into the discriminator model, the loss value of the generator model is calculated through the generator loss function corresponding to the generator model to be trained, which is referred to as the generator loss value for short.
[0058] It can be understood that when calculating the generator loss value, not only the difference between the predicted data and the label data is considered, but also the loss value of the discriminator model, referred to as the discriminator loss value. In other words, the generator loss value needs to be reversely optimized through the discriminator loss value, that is, the generator model is reversely optimized. The specific calculation formula is described in the following embodiments.
[0059] S108, input the predicted data and the label data into the discriminator model to be trained, and calculate the discriminator loss value according to the discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data.
[0060] The discriminator model is a model used to discriminate the similarity between the prediction data and the label data. Among them, the number of discriminator models is at least one. It can be understood that there can be one or more discriminator models. When the number of discriminator models is more than one, they can be distinguished by names such as the first discriminator model, the second discriminator model, and the third discriminator model. Among them, the number of discriminators is related to the type and amount of the prediction data (or label data).
[0061] In one embodiment, the number of discriminator models is at least one, the label data includes a label image and a label calibration parameter; the discriminator loss value includes at least one of a first discriminator loss value and a second discriminator loss value; step 108, that is, the step of inputting the predicted data and the label data into the discriminator model to be trained, and calculating the discriminator loss value according to the discriminator loss function corresponding to the discriminator model to be trained, includes: inputting the sample test image and the corresponding label image into the first discriminator model, and calculating the first discriminator loss value according to the first discriminator loss function; and / or, inputting the predicted calibration parameters and the corresponding label calibration parameters into the second discriminator model, and calculating the second discriminator loss value according to the second discriminator loss function.
[0062] Among them, when the number of discriminator models is greater than or equal to one, for example, there is a first discriminator model and a second discriminator model, the first discriminator model can be used to judge the similarity between the sample test image and the corresponding label image, and the second discriminator model can be used to judge the similarity between the predicted tuning parameters and the corresponding label tuning parameters.
[0063] It can be understood that the loss value of each discriminator model can be determined by the discriminator corresponding to the discriminator model. That is, the loss value of the first discriminator model is calculated by the first discriminator loss function corresponding to the first discriminator model, referred to as the first discriminator loss value; the loss value of the second discriminator model is calculated by the second discriminator loss function corresponding to the second discriminator model, referred to as the second discriminator loss value.
[0064] Specifically, the image processing device inputs the acquired label image and the sample test image generated by the generator model into the first discriminator model, and calculates the first discriminator loss value according to the first discriminator loss function. And / or, the image processing device inputs the acquired label calibration parameters and the prediction calibration parameters generated by the generator model into the second discriminator model, and calculates the second discriminator loss value according to the second discriminator loss function.
[0065] In one embodiment, when the generator model includes a calibration parameter generation model and an image calibration model, the image processing device inputs the acquired label image and the sample test image generated by the image calibration model into the first discriminator model, and calculates the first discriminator loss value according to the first discriminator loss function. In addition, the image processing device inputs the acquired label calibration parameters and the predicted calibration parameters generated by the calibration parameter generation model into the second discriminator model, and calculates the second discriminator loss value according to the second discriminator loss function.
[0066] In another embodiment, when the generator model is an image generation model, the image processing device inputs the acquired label image and the sample test image generated by the image generation model into the first discriminator model, and calculates the first discriminator loss value according to the first discriminator loss function.
[0067] In the above embodiment, when the number of discriminator models is at least one, the first discriminator loss value may be calculated according to the first discriminator loss function corresponding to the first discriminator, and / or the second discriminator loss value may be calculated according to the second discriminator loss function corresponding to the second discriminator. In this way, different discriminator models may be used to discriminate different data in a targeted manner, thereby improving the accuracy of each discriminator model and greatly improving the efficiency of training each discriminator model.
[0068] S110, according to the generator loss value and the discriminator loss value, respectively, use back propagation to repeatedly and alternately optimize the generator model to be trained and the discriminator model to be trained. When the accuracy requirement or the preset number of iterations is reached, the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained are saved to obtain the trained generator model and the discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data.
[0069] Among them, the initial image data is the original color image data collected by the image processing device. It can be understood that the initial image data and the training set sample image data are the same type of data. It should be noted that the training set sample image data is a collection of image data used to train the model, while the initial image data is a collection of image data to be enhanced. The image calibration parameters are calibration parameters used to adjust the image effect of the initial image data. The target image is the image generated by the generator model. For example, an image corresponding to the initial image data is generated by the image calibration model based on the image calibration parameters, or an image corresponding to the initial image data is directly generated by the image generation model.
[0070] Specifically, the image processing device uses back propagation to repeatedly and alternately optimize the generator model to be trained and the discriminator model to be trained according to the generator loss value calculated by the generator loss function and the discriminator loss value calculated by the discriminator loss function. When the accuracy requirement or the preset number of iterations is reached, the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained are saved, thereby obtaining the trained generator model and discriminator model.
[0071] Furthermore, the trained generator model is used to process the initial image data collected by the image processing device, and the trained generator model is used to output image calibration parameters corresponding to the initial image data, wherein the image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data. Therefore, the trained generator model can also output a target image corresponding to the initial image data.
[0072] In one embodiment, when the generator model includes a calibration parameter generation model and an image calibration model, the calibration parameter generation model can output image calibration parameters corresponding to the initial image data, the image calibration model can adjust the initial image data based on the image calibration parameters, and the image calibration model can output the corresponding target image.
[0073] In another embodiment, when the generator model is an image generation model, the target image corresponding to the initial image data can be directly output by the image generation model.
[0074] In one embodiment, the generator model parameters and the discriminator model parameters in the image processing-based model training method are updated by the following steps: inputting the label data into the discriminator model to be trained, and updating the discriminator model parameters k times through the discriminator loss function; inputting the training set sample image data into the generator model to be trained, and updating the generator model parameters n times according to the generator loss function after being processed by the discriminator model; wherein the generator loss function is: δ G is the generator loss value, G(z) is the error value between the predicted data and the label data, and is the error weight; n is a non-zero natural number; the discriminator loss function is: δ D =D(y)+D(z),δ D is the discriminator loss value, z represents the predicted data generated by the generator model, and the corresponding D(z) is the loss value corresponding to the predicted data as the input of the discriminator model, y represents the label data, and D(y) is the loss value corresponding to the label data as the input of the discriminator model; k is a non-zero natural number.
[0075] Specifically, the image processing device first inputs the label data into the discriminator model to be trained and updates it k times. The updated discriminator model has the corresponding ability to distinguish between predicted data and label data. The image processing device inputs the sample image data of the training set into the generator model to be trained, and after being processed by the discriminator model, updates the parameters of the generator model n times according to the generator loss function. The image processing device then inputs the predicted data generated by the generator model to be trained into the discriminator model to be trained, and obtains the discriminator loss value corresponding to the predicted data as the input of the discriminator model, denoted as D(z). The image processing device is based on the error value between the predicted data and the label data, denoted as G(z), and the discriminator loss value corresponding to the predicted data as the input of the discriminator model, that is, D(z), according to the generator loss function Calculate the corresponding generator loss value, denoted as δ G , thereby updating the generator model parameters according to the generator loss value. Among them, and is the error weight; n and k are both non-zero natural numbers.
[0076] Furthermore, the image processing device inputs the label data into the discriminator model to obtain D(y k+1 ), based on the loss value corresponding to the input of the discriminator model based on the label data, that is, D(y k+1 ), and the discriminator loss value corresponding to the above-mentioned predicted data as the input of the discriminator model, that is, D(z), and the discriminator loss value δ is calculated by the discriminator loss function D It can be understood that the above mentioned δ D =D(y)+D(z) is just a general expression. When the image processing device inputs the label data into the discriminator model for the k+1th time, the corresponding discriminator loss value δ D =D(y k+1 )+D(z).
[0077] In one embodiment, reference Figure 2, when the generator model is composed of a calibration parameter generation model and an image calibration model, the image processing device inputs the label image into the discriminator model to be trained, and updates the discriminator model parameters through the discriminator loss function. The image processing device then inputs the RAW_RGB original image data into the calibration parameter generation model to be trained, processes the RAW_RGB original image data through the calibration parameter generation model to be trained, and generates predicted calibration parameters corresponding to the RAW_RGB original image data. The image processing device then processes the RAW_RGB original image data through the image calibration model and according to the predicted calibration parameters to generate a sample test image corresponding to the RAW_RGB original image data. After being processed by the discriminator model, the image calibration model parameters and the calibration parameter generation model parameters are reversely updated according to the generator loss function, that is, the generator model is trained.
[0078] It is worth noting that in the process of training the generator model and the discriminator model, the number of training times for each generator model and the discriminator model is not fixed. It is understandable that the generator model can be trained once, and then the discriminator model can be trained once, or the generator model can be trained several times, and then the discriminator model can be trained once. As long as the generator model and the discriminator model are trained crosswise, it will be fine.
[0079] In the above embodiment, the image processing device updates the parameters of the generator model and the discriminator model through the label data and the prediction data, thereby training the generator model and the discriminator model. In this way, the generator model and the discriminator model can be cross-trained, that is, the efficiency and accuracy of model training are improved.
[0080] In one embodiment, the image processing device includes an image sensor, an image signal processor, and an image AI (Artificial Intelligence) processor. Specifically, the calibration parameter generation model and the image calibration model are respectively configured on the image AI processor and the image signal processor. Therefore, after the image processing device acquires the initial image data, the calibration parameter generation model on the image AI processor can output the image calibration parameters corresponding to the initial image data, and then based on the image calibration parameters and the image calibration model running on the image signal processor, the target image corresponding to the initial image data is output.
[0081] The above-mentioned model training method based on image processing processes the training set sample image data through the generator model to be trained to obtain the corresponding prediction data. Based on the prediction data, the label data corresponding to the training set sample image data, the generator loss function, and the discriminator loss function, the corresponding generator loss value and the discriminator loss value are calculated respectively, and the generator model to be trained and the discriminator model to be trained are repeatedly optimized alternately by back propagation. When the accuracy requirement or the preset number of iterations is met, the trained generator model and discriminator model are obtained. The generator model and discriminator model obtained in this way can process different image data adaptively, that is, the calibration parameters matching the image data can be calculated instead of obtaining universal calibration parameters. By generating images according to the calibration parameters matching the image data, the quality of each generated image can be guaranteed, thereby improving the imaging effect of the image. For different image processing devices with different parameter specifications, there is no need to rely on professional resources such as professional technical personnel and professional laboratories, nor is there any need to adopt complex adjustment technology. Images that match the actual shooting conditions can be adaptively generated, which greatly saves resource costs and time costs, while also ensuring imaging effects.
[0082] In one embodiment, the generator model includes a tuning parameter generation model and an image tuning model, and the label data includes a label image, wherein the tuning parameter generation model is used to generate predicted tuning parameters, and the image tuning model is used to generate sample test images; the generator loss value includes an image tuning model loss value and a tuning parameter generation model loss value; step 106, that is, the step of calculating the generator loss value according to the generator loss function corresponding to the generator model to be trained, includes: calculating the image tuning model loss value according to the image tuning model loss function through the generated sample test image and the corresponding label image; optimizing the image tuning model parameters by back propagation, and outputting the optimized image tuning model parameters, generating predicted tuning parameters according to the optimized image tuning model parameters and the tuning parameter generation model; calculating the tuning parameter generation model loss value according to the predicted tuning parameters and the tuning parameter generation model loss function.
[0083] It can be understood that when the generator model includes a calibration parameter generation model and an image calibration model, the generator loss value may include an image calibration model loss value and a calibration parameter generation model loss value. The calibration parameter generation model is used to generate predicted calibration parameters, and the image calibration model is used to generate corresponding sample test images based on the predicted calibration parameters. Furthermore, when the predicted calibration parameters and the sample test images are used as predicted data, the corresponding label data are the label images and the label calibration parameters.
[0084] Specifically, the image processing device calculates the image calibration model loss value through the image calibration model loss function based on the sample test image generated by the image calibration model and the acquired label image corresponding to the sample image data of the training set. The image processing device optimizes the image calibration model parameters by back propagation and outputs the optimized image calibration model parameters. The image processing device generates predicted calibration parameters based on the optimized image calibration model parameters and the calibration parameter generation model, and then calculates the calibration parameter generation model loss value based on the predicted calibration parameters and the calibration parameter generation model loss function.
[0085] In one embodiment, the image calibration model loss value can be defined as the expression of the generator loss function mentioned above, that is, Then, the image calibration model parameters are adjusted accordingly based on the image calibration model loss value to obtain optimized image calibration model parameters.
[0086] In another embodiment, the image processing device can directly convert the expression of the generator loss function mentioned above, that is, As the loss function of the tuning parameter generation model, the corresponding loss value of the tuning parameter generation model is obtained, so the tuning parameter generation model can be directly optimized through the loss value of the tuning parameter generation model.
[0087] In the above embodiment, the image processing device calculates the image calibration model loss value, and optimizes the image calibration model parameters by back propagation. The image processing device generates predicted calibration parameters based on the optimized image calibration model parameters and the calibration parameter generation model, and then calculates the calibration parameter generation model loss value based on the predicted calibration parameters. In this way, the image processing device can reversely optimize the calibration parameter generation model loss value based on the image calibration model loss value, that is, optimize the training of the entire generator model, thereby not only improving the accuracy of model training, but also improving the efficiency of model training.
[0088] In one embodiment, the discriminator loss value also includes a discriminator total loss value, and the discriminator total loss value is determined by a first discriminator loss value and a second discriminator loss value. The method also includes: optimizing the first discriminator model and the second discriminator model respectively according to the first discriminator loss value and the second discriminator loss value; or, optimizing the first discriminator model and the second discriminator model according to the discriminator total loss value.
[0089] In one embodiment, the image processing device includes a first discriminator model and a second discriminator model, and the image processing device determines the corresponding first discriminator loss value according to a first discriminator loss function corresponding to the first discriminator model, and the image processing device determines the corresponding second discriminator loss value according to a second discriminator loss function corresponding to the second discriminator model. The image processing device optimizes the first discriminator model and the second discriminator model respectively according to the calculated first discriminator loss value and the second discriminator loss value.
[0090] In another embodiment, reference Figure 3 , the image processing device inputs the acquired label image and the sample test image generated by the generator model into the first discriminator model, and calculates the first discriminator loss value according to the first discriminator loss function. In addition, the image processing device inputs the acquired label calibration parameters and the prediction calibration parameters generated by the generator model into the second discriminator model, and calculates the second discriminator loss value according to the second discriminator loss function. The image processing device determines the total discriminator loss value based on the calculated first discriminator loss value and second discriminator loss value. The image processing device then optimizes the first discriminator model and the second discriminator model based on the total discriminator loss value.
[0091] In the above embodiment, the image processing device optimizes the first discriminator model and the second discriminator model according to the first discriminator loss value and the second discriminator loss value, respectively, or optimizes the first discriminator model and the second discriminator model according to the total discriminator loss value. In this way, the image processing device can have at least two ways to optimize the corresponding first discriminator model and second discriminator model, thereby not only improving the accuracy of model training, but also improving the efficiency of model training.
[0092] In one embodiment, the total loss value of the discriminator is determined by the total loss function of the discriminator, and the total loss function of the discriminator is determined by the following formula: L=λ1L1+λ2L2, wherein L is the total loss value of the discriminator, L1 and L2 are the first discriminator loss value and the second discriminator loss value, respectively, λ1 and λ2 are the weight of the first discriminator loss value and the weight of the second discriminator loss value, respectively, and the total loss function of the discriminator is used to adjust the influence of different discriminator loss values on the training of the discriminator model.
[0093] Specifically, the image processing device determines the total discriminator loss function by the formula L=λ1L1+λ2L2, where L is the total discriminator loss value, L1 and L2 are the first discriminator loss value and the second discriminator loss value, respectively, and λ1 and λ2 are the weight of the first discriminator loss value and the weight of the second discriminator loss value, respectively.
[0094] In one embodiment, the image processing device may optimize the first discriminator model and the second discriminator model according to the total discriminator loss value calculated by L=λ1L1+λ2L2, that is, the value of L.
[0095] In one embodiment, the total discriminator loss function, that is, L=λ1L1+λ2L2, is used to adjust the influence of different discriminator loss values on the discriminator model training. It can be understood that different discriminator loss values are multiplied by corresponding weight coefficients to obtain the total discriminator loss value.
[0096] In the above embodiment, the image processing device can obtain the corresponding total discriminator loss value by multiplying the corresponding weight according to different discriminator loss values. In this way, not only the accuracy of model training is improved, but also the efficiency of model training is improved.
[0097] It should be understood that although Figure 1-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-3 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0098] In one embodiment, Figure 4 As shown, a model training device 400 based on image processing is provided, comprising: a prediction data generation module 401, an acquisition module 402, a generator loss value calculation module 403, a discriminator loss value calculation module 404 and a model optimization module 405, wherein:
[0099] The prediction data generation module 401 is used to obtain the training set sample image data, and process the training set sample image data through the generator model to be trained to generate prediction data corresponding to the training set sample image data;
[0100] An acquisition module 402 is used to acquire label data corresponding to the training set sample image data;
[0101] A generator loss value calculation module 403, used to calculate the generator loss value according to the generator loss function corresponding to the generator model to be trained;
[0102] The discriminator loss value calculation module 404 is used to input the predicted data and the label data into the discriminator model to be trained, and calculate the discriminator loss value according to the discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data;
[0103] The model optimization module 405 is used to repeatedly and alternately optimize the generator model to be trained and the discriminator model to be trained by back propagation according to the generator loss value and the discriminator loss value, and when the accuracy requirement or the preset number of iterations is reached, the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained are saved to obtain the trained generator model and the discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data.
[0104] In one embodiment, the model optimization module 405 is further used to input the label data into the discriminator model to be trained, and update the discriminator model parameters k times through the discriminator loss function; input the training set sample image data into the generator model to be trained, and after being processed by the discriminator model, update the generator model parameters n times according to the generator loss function; wherein the generator loss function is: δ G is the generator loss value, G(z) is the error value between the predicted data and the label data, and is the error weight; n is a non-zero natural number; the discriminator loss function is: δ D =D(y)+D(z),δ D is the discriminator loss value, z represents the predicted data generated by the generator model, and the corresponding D(z) is the loss value corresponding to the predicted data as the input of the discriminator model, y represents the label data, and D(y) is the loss value corresponding to the label data as the input of the discriminator model; k is a non-zero natural number.
[0105] In one embodiment, the generator model includes a calibration parameter generation model and an image calibration model, wherein the calibration parameter generation model is used to generate predicted calibration parameters, and the image calibration model is used to generate sample test images based on the predicted calibration parameters and the corresponding training set sample image data, and the predicted calibration parameters and / or the sample test images are used as predicted data; or, the generator model is an image generation model, which is used to directly generate sample test images; wherein the image generation model is composed of an image feature extraction network and an image reconstruction network, and the output of the last layer of the image feature extraction network is used as the input of the image reconstruction network, and some feature layers in the image feature extraction network and the image reconstruction network are connected through association layers to realize feature association, and the sample test images are used as predicted data.
[0106] In one embodiment, the generator model includes a tuning parameter generation model and an image tuning model, and the label data includes a label image, wherein the tuning parameter generation model is used to generate predicted tuning parameters, and the image tuning model is used to generate sample test images; the generator loss value includes the image tuning model loss value and the tuning parameter generation model loss value; the generator loss value calculation module 403 is also used to calculate the image tuning model loss value according to the image tuning model loss function through the generated sample test image and the corresponding label image; use back propagation to optimize the image tuning model parameters, and output the optimized image tuning model parameters, generate predicted tuning parameters according to the optimized image tuning model parameters and the tuning parameter generation model; calculate the tuning parameter generation model loss value according to the predicted tuning parameters and the tuning parameter generation model loss function.
[0107] In one embodiment, the number of discriminator models is at least one, the label data includes a label image and a label calibration parameter; the discriminator loss value includes at least one of a first discriminator loss value and a second discriminator loss value; the discriminator loss value calculation module 404 is also used to input the sample test image and the corresponding label image into the first discriminator model, and calculate the first discriminator loss value according to the first discriminator loss function; and / or, input the predicted calibration parameters and the corresponding label calibration parameters into the second discriminator model, and calculate the second discriminator loss value according to the second discriminator loss function.
[0108] In one embodiment, the discriminator loss value also includes a total discriminator loss value, and the total discriminator loss value is determined by the first discriminator loss value and the second discriminator loss value. The model optimization module 405 is also used to optimize the first discriminator model and the second discriminator model according to the first discriminator loss value and the second discriminator loss value; or, according to the total discriminator loss value, optimize the first discriminator model and the second discriminator model.
[0109] In one embodiment, the total loss value of the discriminator is determined by the total loss function of the discriminator, and the total loss function of the discriminator is determined by the following formula: L=λ1L1+λ2L2, wherein L is the total loss value of the discriminator, L1 and L2 are the first discriminator loss value and the second discriminator loss value, respectively, λ1 and λ2 are the weight of the first discriminator loss value and the weight of the second discriminator loss value, respectively, and the total loss function of the discriminator is used to adjust the influence of different discriminator loss values on the training of the discriminator model.
[0110] For the specific definition of the model training device based on image processing, please refer to the definition of the model training method based on image processing above, which will not be repeated here. The various modules in the above-mentioned model training device based on image processing can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0111] In the above-mentioned model training device based on image processing, the training set sample image data is processed by the generator model to be trained to obtain the corresponding prediction data. Based on the prediction data, the label data corresponding to the training set sample image data, the generator loss function, and the discriminator loss function, the corresponding generator loss value and the discriminator loss value are calculated respectively, and the generator model to be trained and the discriminator model to be trained are repeatedly optimized alternately by back propagation. When the accuracy requirement or the preset number of iterations is reached, the trained generator model and discriminator model are obtained. The generator model and discriminator model obtained in this way can process different image data adaptively, that is, the calibration parameters matching the image data can be calculated instead of obtaining universal calibration parameters. By generating images according to the calibration parameters matching the image data, the quality of each generated image can be guaranteed, thereby improving the imaging effect of the image. For different image processing devices with different parameter specifications, there is no need to rely on professional resources such as professional technical personnel and professional laboratories, nor is there any need to adopt complex adjustment technology. Images that match the actual shooting conditions can be adaptively generated, which greatly saves resource costs and time costs, while also ensuring imaging effects.
[0112] In one embodiment, a computer device is provided. The computer device may be the image processing device mentioned above, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory, a communication interface, a display screen, an input device and a camera connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile 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 non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a model training method based on image processing is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse. The camera of the computer device is used to obtain image data.
[0113] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0114] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned model training method based on image processing. The steps of the model training method based on image processing here may be the steps of the model training method based on image processing in the above-mentioned various embodiments.
[0115] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned model training method based on image processing. The steps of the model training method based on image processing here can be the steps of the model training method based on image processing in each of the above-mentioned embodiments.
[0116] 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 the relevant hardware through a computer program, and 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 embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0117] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0118] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A model training method based on image processing, characterized in that: The method comprises: Acquire training set sample image data, and process the training set sample image data through a generator model to be trained to generate prediction data corresponding to the training set sample image data; the generator model includes a calibration parameter generation model and an image calibration model, wherein the calibration parameter generation model is used to generate prediction calibration parameters, and the image calibration model is used to generate sample test images; the prediction calibration parameters are calibration parameters used to adjust the image effect of the training set sample image data; Obtaining label data corresponding to the training set sample image data; the label data includes a label image; the generator loss value includes an image calibration model loss value and a calibration parameter generation model loss value; The image calibration model loss value is calculated based on the generated sample test image and the corresponding label image according to the image calibration model loss function; Optimizing the image calibration model parameters by back propagation, and outputting the optimized image calibration model parameters, and generating predicted calibration parameters according to the optimized image calibration model parameters and the calibration parameter generation model; Calculate the tuning parameter generation model loss value according to the predicted tuning parameter and the tuning parameter generation model loss function; Inputting the predicted data and the label data into a discriminator model to be trained, and calculating a discriminator loss value according to a discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data; According to the generator loss value and the discriminator loss value, the generator model to be trained and the discriminator model to be trained are respectively optimized repeatedly and alternately by back propagation; when the accuracy requirement or the preset number of iterations is reached, the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained are saved to obtain the trained generator model and the discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate a target image corresponding to the initial image data.
2. The method according to claim 1, characterized in that The generator model parameters and the discriminator model parameters are updated by the following steps: Inputting the label data into the discriminator model to be trained, and updating the discriminator model parameters k times through the discriminator loss function; Inputting the training set sample image data into the generator model to be trained, and updating the generator model parameters n times according to the generator loss function after being processed by the discriminator model; Among them, the generator loss function is: , is the generator loss value, is the error value between the predicted data and the label data, and is the error weight; n is a non-zero natural number; the discriminator loss function is: , is the discriminator loss value, z represents the predicted data generated by the generator model, The corresponding loss value is when the predicted data is used as the input of the discriminator model, and y represents the label data. is the loss value corresponding to the label data as the input of the discriminator model; and k is a non-zero natural number.
3. The method according to claim 1, characterized in that The image calibration model is used to generate a sample test image according to the predicted calibration parameters and the corresponding training set sample image data, and use the predicted calibration parameters and / or the sample test image as the predicted data.
4. The method according to claim 3, characterized in that The number of the discriminator models is at least one, the label data includes a label image and a label calibration parameter; the discriminator loss value includes at least one of a first discriminator loss value and a second discriminator loss value; the prediction data and the label data are input into the discriminator model to be trained, and the discriminator loss value is calculated according to the discriminator loss function corresponding to the discriminator model to be trained, including: Inputting the sample test image and the corresponding label image into the first discriminator model, and calculating the first discriminator loss value according to the first discriminator loss function; and / or, The prediction tuning parameters and the corresponding label tuning parameters are input into the second discriminator model, and the second discriminator loss value is calculated according to the second discriminator loss function.
5. The method according to claim 4, characterized in that The discriminator loss value further includes a discriminator total loss value, and the discriminator total loss value is determined by the first discriminator loss value and the second discriminator loss value. The method further includes: Optimizing the first discriminator model and the second discriminator model according to the first discriminator loss value and the second discriminator loss value respectively; or, According to the total loss value of the discriminator, the first discriminator model and the second discriminator model are optimized.
6. The method according to claim 5, characterized in that The total loss value of the discriminator is determined by the total loss function of the discriminator, and the total loss function of the discriminator is determined by the following formula: ,in, is the total loss value of the discriminator, and are the first discriminator loss value and the second discriminator loss value respectively, and are the weight of the first discriminator loss value and the weight of the second discriminator loss value, respectively. The discriminator total loss function is used to adjust the influence of different discriminator loss values on the discriminator model training.
7. A model training device based on image processing, characterized in that: The device comprises: A prediction data generation module, used to obtain training set sample image data, and process the training set sample image data through a generator model to be trained to generate prediction data corresponding to the training set sample image data; An acquisition module, used to acquire label data corresponding to the training set sample image data; A generator loss value calculation module, used to calculate the generator loss value according to the generator loss function corresponding to the generator model to be trained; A discriminator loss value calculation module, used for inputting the predicted data and the label data into the discriminator model to be trained, and calculating the discriminator loss value according to the discriminator loss function corresponding to the discriminator model to be trained; the discriminator model is used to determine the similarity between the predicted data and the label data; A model optimization module, used to optimize the generator model to be trained and the discriminator model to be trained by back propagation repeatedly and alternately according to the generator loss value and the discriminator loss value, and save the generator model parameters of the generator model to be trained and the discriminator model parameters of the discriminator model to be trained after reaching the accuracy requirement or the preset number of iterations, so as to obtain the trained generator model and the discriminator model; the trained generator model is used to process the initial image data collected by the image processing device to output the image calibration parameters corresponding to the initial image data or output the target image corresponding to the initial image data; the output image calibration parameters are used to instruct the image processing device to generate the target image corresponding to the initial image data; The generator model includes a calibration parameter generation model and an image calibration model, the label data includes a label image, wherein the calibration parameter generation model is used to generate prediction calibration parameters, and the image calibration model is used to generate sample test images; the generator loss value includes an image calibration model loss value and a calibration parameter generation model loss value; the prediction calibration parameter is a calibration parameter used to adjust the image effect of the training set sample image data; The generator loss value calculation module is also used to calculate the image calibration model loss value according to the image calibration model loss function through the generated sample test image and the corresponding label image; optimize the image calibration model parameters by back propagation, and output the optimized image calibration model parameters, generate predicted calibration parameters according to the optimized image calibration model parameters and the calibration parameter generation model; calculate the calibration parameter generation model loss value according to the predicted calibration parameters and the calibration parameter generation model loss function.
8. The device according to claim 7, characterized in that The model optimization module is further used to input the label data into the discriminator model to be trained, and update the discriminator model parameters k times through the discriminator loss function; input the training set sample image data into the generator model to be trained, and after being processed by the discriminator model, update the generator model parameters n times according to the generator loss function; wherein the generator loss function is: , is the generator loss value, is the error value between the predicted data and the label data, and is the error weight; n is a non-zero natural number; the discriminator loss function is: , is the discriminator loss value, z represents the predicted data generated by the generator model, and the corresponding is the loss value corresponding to the predicted data as the input of the discriminator model, y represents the label data, is the loss value corresponding to the label data as the input of the discriminator model; and k is a non-zero natural number.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Image restoration method, device and equipment
CN107945140A
Training method and training model for image enhancement network, and image enhancement method
CN109255769A
Image processing method, image processing apparatus, image processing program and image processing system
JP2006031440A