Machine learning-based image printing method, device, terminal device and storage medium
Through the machine learning-based image printing repair method, using adversarial generation model and U-Net network to process images, the problem of insufficient robustness of traditional methods when dealing with noise and distortion is solved, and higher image printing quality is achieved.
Patent Information
- Application Number
- CN202411136777.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2044-08-19
AI Technical Summary
Traditional image repair methods have limited robustness in dealing with complex noise and distortion, resulting in low image printing quality.
Using machine learning-based image printing and repair method, simulated imaging renderings are generated and spliced by combining the generation model and U-Net backbone network, pixel difference values are calculated to generate target pixel repair values, and the real printed color gamut images of the printer are repaired.
Without increasing hardware costs, the image printing quality is significantly improved, effectively handling and repairing defects such as printer inherent color shifts and random noise.
Smart Images

Figure CN118710527B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image printing, and particularly to an image printing repair method, device, terminal device, and storage medium based on machine learning. Background Art
[0002] In modern printing processes, problems such as noise, color deviation, and distortion can affect the visual effect of the final image. Traditional image repair methods have limited robustness in dealing with complex noise and distortion, and the image printing quality is not high. Summary of the Invention
[0003] In view of this, this application provides an image printing repair method, device, terminal device, and storage medium based on machine learning, which can specifically simulate defects such as the inherent color deviation and random noise of printers, and improve the image printing quality without increasing hardware costs.
[0004] An image printing repair method based on machine learning includes:
[0005] Obtain a target printing color gamut image.
[0006] Input the target printing color gamut image into a preset adversarial generation model to generate N simulated imaging effect diagrams containing color deviation, noise, and color loss, where N is a positive integer greater than 1.
[0007] Stitch the N simulated imaging effect diagrams and the target printing color gamut image into a target channel input image.
[0008] Input the target channel input image into a preset repair network model to generate a first predicted repair image, and the preset repair network model is a backbone network based on U-Net.
[0009] Calculate the first pixel difference between the first predicted repair image and the target printing color gamut image.
[0010] Generate a target pixel repair value based on the first pixel difference, the preset adversarial generation model, and the preset repair network model, and repair the real printing color gamut image of the printer according to the target pixel repair value.
[0011] In one embodiment, the preset adversarial generation model adopts the convolutional structure of PatchGAN, and the preset adversarial generation model is trained through the following steps:
[0012] Input the preset color gamut image into the generator network to obtain a generated color gamut
[0013] image with printing characteristics.
[0014] Input both the generated color gamut image and the real printer color gamut image into the discriminator network to train the discriminator network.
[0015] The loss function of the generator includes an adversarial loss unit, a noise loss unit, a color deviation loss unit, and a color missing loss unit.
[0016] The adversarial loss unit is used to encourage the generator to generate an image whose similarity to the real printer color gamut image is less than a preset threshold.
[0017] The noise loss unit is used to simulate the noise generated during the printing process.
[0018] The color deviation loss unit is used to simulate the color deviation generated during the printing process.
[0019] The color missing loss unit is used to simulate the color missing generated during the printing process.
[0020] In one embodiment, the adversarial loss is calculated using the following formula:
[0021]
[0022] L 1 (G) represents the adversarial loss unit, E represents the mathematical expectation, log represents the logarithmic function, D represents the discriminator, G represents the generator, and x is the real data sampled from the data distribution.
[0023] In one embodiment, the noise loss unit is calculated using the following formula:
[0024]
[0025] represents the noise loss unit, E represents the expectation operation, represents the real color gamut image data distribution, x is the sample, is the high-pass filter function, represents the high-frequency component of the generated color gamut image, represents the high-frequency component of the real printer color gamut image, (||_1) represents the L1 norm.
[0026] In one embodiment, the color deviation loss unit is calculated using the following formula:
[0027]
[0028]
[0029] Among them, represents the color deviation loss unit, E represents the expectation operation, represents the real color gamut image data distribution, x is the sample, is the color deviation calculation function, Represents the color deviation value for generating a gamut image, Represents the color deviation value of the actual printer gamut image, 、 、 and Represent four different gamuts of the printer gamut image, m is the mean operation, W 1 、W 2 、W 3 and W 4 Are intermediate variable values.
[0030] In one embodiment, the color missing loss unit is calculated using the following formula:
[0031]
[0032] Represents the color missing loss unit, E represents the expectation operation, Represents true
[0033] Actual gamut image data distribution, x is the sample, (||_1) represents the L1 norm, Represents the generated gamut image, Represents the color information loss difference between the generated gamut image and the sample of the actual printer gamut image.
[0034] In one embodiment, the steps of repairing the actual printed gamut image of the printer based on the first pixel difference, a preset adversarial generation model, and a preset repair network model include:
[0035] Input the first pixel difference into the preset generative adversarial model to generate N simulated imaging effect diagrams corresponding to the first repair defect generated by the first repair printing.
[0036] Stitch the N simulated imaging effect diagrams corresponding to the first repair defect and the pixel map corresponding to the first pixel difference into the corresponding target channel input image, and input the corresponding target channel input image into the preset repair network model to generate a second predicted repair image.
[0037] Calculate the second pixel difference between the second predicted repair image and the pixel map corresponding to the first pixel difference.
[0038] Calculate the target pixel repair value based on the first pixel difference and the second pixel difference, and repair the actual printed gamut image of the printer according to the target pixel repair value.
[0039] In addition, an image printing repair device based on machine learning is also provided, including:
[0040] An image acquisition unit for acquiring a target printed gamut image.
[0041] An analog imaging unit, configured to input a target printed color gamut image into a preset adversarial generation model to generate N simulated imaging effect diagrams including color deviation, noise, and color loss, where N is a positive integer greater than 1.
[0042] A splicing unit, configured to splice N simulated imaging effect diagrams and the target printed color gamut image into a target channel input image.
[0043] A first repair prediction unit, configured to input the target channel input image into a preset repair network model to generate a first predicted repair image, where the preset repair network model is a backbone network based on U-Net.
[0044] A first difference calculation unit, configured to calculate a first pixel difference between the first predicted repair image and the target printed color gamut image.
[0045] A repair unit, configured to generate a target pixel repair value based on the first pixel difference, the preset adversarial generation model, and the preset repair network model, and repair the real printed color gamut image of the printer according to the target pixel repair value.
[0046] In addition, a terminal device is provided. The terminal device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the above-mentioned image printing repair method based on machine learning are implemented.
[0047] In addition, a storage medium is provided. A computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the above-mentioned image printing repair method based on machine learning are implemented.
[0048] The above-mentioned image printing repair method based on machine learning includes: obtaining a target printed color gamut image;
[0049] Input the target printed color gamut image into a preset adversarial generation model to generate N simulated imaging effect diagrams containing color deviation, noise, and color loss, where N is a positive integer greater than 1; splice the N simulated imaging effect diagrams and the target printed color gamut image into a target channel input image; input the target channel input image into a preset repair network model to generate a first predicted repaired image, and the preset repair network model is a backbone network based on U-Net; calculate the first pixel difference between the first predicted repaired image and the target printed color gamut image; generate a target pixel repair value based on the first pixel difference, the preset adversarial generation model, and the preset repair network model, and repair the true printed color gamut image of the printer according to the target pixel repair value. This image printing repair method generates N simulated imaging effect diagrams through a preset adversarial generation model, and then, on this basis, measures the difference between the N simulated imaging effect diagrams and the target printed color gamut image through the neural network of the preset repair network model, so as to smooth the random printing deviation (such as defect deviations such as color deviation, noise, and color distortion), and finally generate a target pixel repair value. Compared with the existing image repair technology, it can assist the printer to perform image printing repair without additionally using integrated hardware devices such as high-definition cameras, improving the image printing quality. Description of the Drawings
[0050] Figure 1 Schematic flowchart of an image printing repair method based on machine learning provided by an embodiment of the present application;
[0051] Figure 2 Schematic flowchart of a method for repairing the true printed color gamut image of a printer provided by an embodiment of the present application;
[0052] Figure 3 Schematic flowchart of a method for repairing the true printed color gamut image of a printer provided by another embodiment of the present application;
[0053] Figure 4 Schematic diagram of an image printing repair device based on machine learning provided by an embodiment of the present application;
[0054] Figure 5 Schematic block diagram of the internal structure of a terminal device provided by an embodiment of the present application.
[0055] The realization, functional characteristics, and advantages of the purpose of the present application will be further described with reference to the embodiments and the accompanying drawings. Detailed Embodiments
[0056] Embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the present application and should not be construed as limiting the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts fall within the scope of protection of the present application.
[0057] In addition, if the description in the present application involves "first", "second", etc., it is only for descriptive purposes (such as for distinguishing the same or similar elements), and cannot be understood as indicating or implying its relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0058] As Figure 1 shown, a method for image printing repair based on machine learning is provided, including:
[0059] Step S110, obtaining a target printing color gamut image.
[0060] Step S120, inputting the target printing color gamut image into a preset adversarial generation model to generate N simulated imaging effect pictures including color deviation, noise, and color loss, where N is a positive integer greater than 1.
[0061] Step S130, splicing the N simulated imaging effect pictures and the target printing color gamut image into a target channel input image.
[0062] Step S140, inputting the target channel input image into a preset repair network model to generate a first predicted repair image, and the preset repair network model is a backbone network based on U-Net.
[0063] Step S150, calculating a first pixel difference between the first predicted repair image and the target printing color gamut image.
[0064] Step S160, generating a target pixel repair value based on the first pixel difference, the preset adversarial generation model, and the preset repair network model, and repairing the real printing color gamut image of the printer according to the target pixel repair value.
[0065] In general, printing defects come from two aspects: the first is the inherent color deviation of the printer; the second is the noise-like defects of the printer. Since the generation of the second type of defect is random, we cannot use the method of single simulation defect generation to directly determine which random noises are generated during the printing process. Therefore, it is impossible to deterministically simulate the defects of real printing with a single generated image.
[0066] Therefore, the above-mentioned image printing repair method based on machine learning generates N simulated imaging effect diagrams through a preset adversarial generation model. Then, on this basis, each simulated imaging diagram fed into the preset repair network has different randomness. The neural network of the preset repair network model is used to measure the difference between the N simulated imaging effect diagrams and the target printing color gamut image. Furthermore, the random characteristics can be smoothed out by using the parameters of the algorithm through the preset repair network model. Thus, no matter what random noise is generated, the image after secondary printing will be close to the target printing color gamut image. The traditional difference method cannot well predict and repair this randomly generated error.
[0067] The above-mentioned image printing repair method based on machine learning obtains the target printing color gamut image.
[0068] The target printing color gamut image is input into the preset adversarial generation model to generate N simulated imaging effect diagrams including color deviation, noise, and color loss, where N is a positive integer greater than 1. The N simulated imaging effect diagrams and the target printing color gamut image are stitched into a target channel input image. The target channel input image is input into the preset repair network model to generate a first predicted repair image. The preset repair network model is a backbone network based on U-Net. Calculate the first pixel difference between the first predicted repair image and the target printing color gamut image. Generate a target pixel repair value based on the first pixel difference, the preset adversarial generation model, and the preset repair network model. Repair the real printing color gamut image of the printer according to the target pixel repair value. This image printing repair method generates N simulated imaging effect diagrams through the preset adversarial generation model. Then, on this basis, the neural network of the preset repair network model is used to measure the difference between the N simulated imaging effect diagrams and the target printing color gamut image, so as to smooth out the inherent random deviation. Finally, a target pixel repair value is generated. Compared with the existing image repair technology, it does not need to additionally use an integrated hardware device such as a high-definition camera to assist the printer in printing repair, thus improving the printing quality.
[0069] In one embodiment, the preset adversarial generation model adopts the convolutional structure of PatchGAN, and the preset adversarial generation model is trained through the following steps:
[0070] Input the preset color gamut image into the generator network to obtain a generated color gamut image with printing characteristics.
[0071] In this embodiment, the RGB image is converted to the CMYK color gamut through a color mapping table, and the image in the CMYK color gamut is used as the preset color gamut image and input into the generator network.
[0072] Among them, the CMYK color gamut is the main color gamut format in the printing industry.
[0073] In this embodiment, the PatchGAN structure is used as the main structure of the preset adversarial generation model.
[0074] Both the generated color gamut image and the real printer color gamut image are input into the discriminator network to train the discriminator network.
[0075] In order to enable the generator network to better represent the deviation between the printed image and the original input image, so that the generated color gamut image is more realistic, we redesigned the loss function for measuring the generated color gamut image and the real printer color gamut image: the loss function of the generator includes an adversarial loss unit, a noise loss unit, a color deviation loss unit, and a color loss loss unit. The adversarial loss unit is used to encourage the generator to generate an image with a similarity less than a preset threshold to the real printer color gamut image. The noise loss unit is used to simulate the noise generated during the printing process. The color deviation loss unit is used to simulate the color deviation generated during the printing process; the color loss loss unit is used to simulate the color loss generated during the printing process.
[0076] In one embodiment, the adversarial loss is calculated using the following formula:
[0077]
[0078] L 1 (G) represents the adversarial loss unit, E represents the mathematical expectation, log represents the logarithmic function, D represents the discriminator, G represents the generator, and x is the real data sampled from the data distribution.
[0079] In one embodiment, the noise loss unit is calculated using the following formula:
[0080]
[0081] represents the noise loss unit, E represents the expectation operation, represents the real color gamut image data distribution, x is the sample, is the high-pass filter function, represents the high-frequency component of the generated color gamut image, represents the high-frequency component of the real printer color gamut image, (||_1) represents the L1 norm.
[0082] In this embodiment, Indicates the operation of calculating the expected value for the sample (x) in , and the noise loss unit is used to simulate the noise generated during the printing process, which can be achieved by comparing the differences in the high-frequency components of the generated color gamut image and the real color gamut image.
[0083] In one embodiment, the color deviation loss unit is calculated using the following formula:
[0084]
[0085]
[0086] Wherein, represents the color deviation loss unit, E represents the expectation operation, represents the data distribution of the real color gamut image, x is the sample, is the color deviation calculation function, represents the color deviation value of the generated color gamut image, represents the color deviation value of the real printer color gamut image, , , and represent four different color gamuts of the printer color gamut image, m is the mean operation, W 1 , W 2 , W 3 and W 4 are intermediate variable values.
[0087] In one embodiment, the color missing loss unit is calculated using the following formula:
[0088]
[0089] represents the color missing loss unit, E represents the expectation operation, represents the data distribution of the real color gamut image, x is the sample, (||_1) represents the L1 norm, represents the generated color gamut image, represents the difference in color information loss between the generated color gamut image and the sample of the real printer color gamut image.
[0090] In one embodiment, the loss function L is calculated using the following formula:
[0091] L == T 1* + T 2* + T 3* + T 4*
[0092] Among them, T 1、 、T 2 、T 3 and T 4 are all weight hyperparameters of each loss term.
[0093] In one embodiment, as Figure 2 shown, step S160 includes:
[0094] Step S161, input the first pixel difference into a preset generative adversarial model to generate N simulated imaging effect diagrams corresponding to the first repair defect generated by the first repair printing.
[0095] Step S162, splice the N simulated imaging effect diagrams corresponding to the first repair defect and the pixel map corresponding to the first pixel difference into a corresponding target channel input image, and input the corresponding target channel input image into a preset repair network model to generate a second predicted repair image.
[0096] Step S163, calculate the second pixel difference between the second predicted repair image and the pixel map corresponding to the first pixel difference.
[0097] Step S164, calculate the target pixel repair value according to the first pixel difference and the second pixel difference, and repair the true printing color gamut image of the printer according to the target pixel repair value.
[0098] Among them, when the printer obtains the first pixel difference and performs the first repair printing according to the first pixel difference, defects will still be generated (due to the inherent noise of the printer). At this time, the above-mentioned preset generative adversarial model and preset repair network model are used to repair the repair defects generated by the first repair printing, that is, by splicing the N simulated imaging effect diagrams corresponding to the first repair defect and the pixel map corresponding to the first pixel difference into a corresponding target channel input image, and then inputting it into the preset repair network model to generate a second predicted repair image, and then calculating the second pixel difference between the second predicted repair image and the pixel map corresponding to the first pixel difference. Finally, calculate the target pixel repair value according to the first pixel difference and the second pixel difference, and repair the true printing color gamut image of the printer according to the target pixel repair value.
[0099] In this example, a nested repair method is used to make the print repair more accurate and improve the image printing quality as a whole.
[0100] In one embodiment, calculate the mean value of the first pixel difference and the second pixel difference to obtain the target pixel repair value.
[0101] In one embodiment, as Figure 3As shown, after calculating the second pixel difference through step S163, the above step S160 may further include:
[0102] S165, input the second pixel difference into a preset generative adversarial model to generate N simulated imaging effect diagrams corresponding to the second repair defect generated by the second repair printing.
[0103] S166, splice the N simulated imaging effect diagrams corresponding to the second repair defect and the pixel map corresponding to the second pixel difference into a corresponding target channel input image, and input it into a preset repair network model to generate a third predicted repair image.
[0104] S167, calculate the third pixel difference between the third predicted repair image and the pixel map corresponding to the second pixel difference.
[0105] S168, calculate the target pixel repair value according to the first pixel difference, the second pixel difference and the third pixel difference, and repair the true printing color gamut image of the printer according to the target pixel repair value.
[0106] In this embodiment, on the basis of the embodiment shown in Figure 2 further calculate the printing defect generated by the second repair printing through a preset generative adversarial model and a preset repair network model to obtain the third pixel difference, that is, further reduce the defect generated by the repair through the nested repair method, and then calculate the target pixel repair value according to the first pixel difference, the second pixel difference and the third pixel difference, and repair the true printing color gamut image of the printer according to the target pixel repair value, further eliminating the inherent noise defect of the printer during image printing as a whole, and improving the image printing quality as a whole.
[0107] In addition, as shown in Figure 4 a machine learning-based image printing repair device 200 is also provided, including:
[0108] An image acquisition unit 210, configured to acquire a target printing color gamut image;
[0109] A simulated imaging unit 220, configured to input the target printing color gamut image into a preset adversarial generative model to generate N simulated imaging effect diagrams including color deviation, noise and color loss, where N is a positive integer greater than 1;
[0110] A splicing unit 230, configured to splice the N simulated imaging effect diagrams and the target printing color gamut image into a target channel input image;
[0111] A first repair prediction unit 240, configured to input the target channel input image into a preset repair network model to generate a first predicted repair image, and the preset repair network model is a backbone network based on U-Net;
[0112] A first difference calculation unit 250 is configured to calculate a first pixel difference between a first predicted repaired image and a target printing color gamut image.
[0113] A repair unit 260 is configured to generate a target pixel repair value based on the first pixel difference, a preset adversarial generation model, and a preset repair network model, and repair the true printing color gamut image of the printer according to the target pixel repair value.
[0114] In addition, an embodiment of the present application further provides a terminal device, and the internal structure of the terminal device may be as Figure 5 shown. The terminal device includes a processor, a memory, a communication interface, and a database connected through a system bus. Among them, the processor is configured to provide computing and control capabilities. The memory of the terminal device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the terminal device is used to store data called by the computer program. The communication interface of the terminal device is used to communicate with an external terminal for data. The input device of the terminal device is used to receive signals input by an external device. When the computer program is executed by the processor, it implements an image printing repair method based on machine learning as in the above embodiments.
[0115] Those skilled in the art can understand that Figure 5 the structure shown in
[0116] 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 terminal device to which the solution of the present application is applied.
[0117] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments 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 embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium provided in this application and used in the embodiments can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0118] It should be noted that in this document, the terms "including", "comprising", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements that are inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, apparatus, article, or method that includes such element.
[0119] The above are only the preferred embodiments of this application, and do not limit the patent scope of this application. Any equivalent structure or equivalent process transformation made using the specification and drawings of this application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of this application.
Claims
1. A method for image printing repair based on machine learning, characterized in that: include: Obtaining a target printing color gamut image; Inputting the target printing color gamut image into a preset adversarial generation model to generate N simulated imaging effect images containing color cast, noise and color loss, where N is a positive integer greater than 1; Splicing the N simulated imaging effect images and the target printing color gamut image into a target channel input image; Inputting the target channel input image into a preset restoration network model to generate a first predicted restoration image, wherein the preset restoration network model is a backbone network based on U-Net; Calculating a first pixel difference between the first predicted restoration image and the target printing color gamut image; Generate a target pixel restoration value based on the first pixel difference, the preset adversarial generation model and the preset restoration network model, and restore the real printer color gamut image according to the target pixel restoration value, specifically including the following steps: Inputting the first pixel difference value into the preset adversarial generation model to generate N simulated imaging effect images corresponding to the first repair defect generated by the first repair printing; splicing N simulated imaging effect images corresponding to the first repair defect and the pixel image corresponding to the first pixel difference into a corresponding target channel input image, and inputting the corresponding target channel input image into the preset repair network model to generate a second predicted repair image; Calculating a second pixel difference between the second predicted inpainted image and the pixel map corresponding to the first pixel difference; A target pixel restoration value is calculated according to the first pixel difference value and the second pixel difference value, and the real printer color gamut image is restored according to the target pixel restoration value.
2. The image printing repair method according to claim 1, characterized in that: The preset adversarial generation model adopts the convolution structure of PatchGAN, and the preset adversarial generation model is trained by the following steps: Inputting the preset color gamut image into the generator network to obtain a generated color gamut image with printing characteristics; Inputting the generated color gamut image and the real printer color gamut image into a discriminator network to train the discriminator network; The loss function of the generator includes an adversarial loss unit, a noise loss unit, a color deviation loss unit, and a color loss loss unit; The adversarial loss unit is used to encourage the generator to generate an image whose similarity to the real printer gamut image is less than a preset threshold; The noise loss unit is used to simulate the noise generated during the printing process; The color deviation loss unit is used to simulate the color deviation generated during the printing process; The color loss unit is used to simulate the color loss generated during the printing process.
3. The image printing repair method according to claim 2, characterized in that: The adversarial loss is calculated using the following formula: L1(G)=-E[log D(G(x))] L1(G) represents the adversarial loss unit, E represents mathematical expectation, log represents logarithmic function, D represents discriminator, G represents generator, and x represents real data sampled from the data distribution.
4. The image printing repair method according to claim 2, characterized in that: The noise loss unit is calculated using the following formula: L2(G)=E[x~p_d(x)][|h_p(G(x))-h_p(x)|_1] L2(G) represents the noise loss unit, E represents the expected operation, p_d(x) represents the real color gamut image data distribution, x is a sample, h_p is a high-pass filter function, h_p(G(x)) represents the high-frequency component of the generated color gamut image, h_p(x) represents the high-frequency component of the real printer color gamut image, and (||_1) represents the L1 norm.
5. The image printing repair method according to claim 2, characterized in that: The color shift loss unit is calculated using the following formula: L3(G)=E_{x~p_d(x)}[|c_s(G(x))-c_s(x)|_2^2] c_s(x)=sqrt(W1+W2+W3+W4) W1=(C(x)-m(C(x)))^2 W2=(M(x)-m(M(x)))^2 W3=(Y(x)-m(Y(x)))^2 W4=(K(x)-m(K(x)))^2 Among them, L3(G) represents the color deviation loss unit, E represents the expected operation, p_d(x) represents the real color gamut image data distribution, x is the sample, c_s is the color deviation calculation function, c_s(G(x)) represents the color deviation value of the generated color gamut image, c_s(x) represents the color deviation value of the real printer color gamut image, C(x), M(x), Y(x) and K(x) represent four different color gamuts of the real printer color gamut image, m is the mean operation, W1, W2, W3 and W4 are the intermediate variable values.
6. The image printing repair method according to claim 2, characterized in that: The color loss unit is calculated using the following formula: L4(G)=E_{x~p_d(x)}[|G(x)-x|_1] L4(G) represents the color missing loss unit, E represents the expected operation, p_d(x) represents the real color gamut image data distribution, x is a sample, (||_1) represents the L1 norm, G(x) represents the generated color gamut image, and G(x)-x represents the color information loss difference between the generated color gamut image and the real printer color gamut image sample.
7. An image printing and repairing device based on machine learning, characterized in that: include: An image acquisition unit, used for acquiring a target printing color gamut image; A simulation imaging unit, used for inputting the target printing color gamut image into a preset adversarial generation model to generate N simulated imaging effect images containing color cast, noise and color loss, where N is a positive integer greater than 1; A splicing unit, used for splicing the N simulated imaging effect images and the target printing color gamut image into a target channel input image; A first restoration prediction unit, used for inputting the target channel input image into a preset restoration network model to generate a first predicted restoration image, wherein the preset restoration network model is a backbone network based on U-Net; A first difference calculation unit, used for calculating a first pixel difference between the first predicted restoration image and the target printing color gamut image; A restoration unit, configured to generate a target pixel restoration value based on the first pixel difference value, the preset adversarial generation model and the preset restoration network model, and to restore the real printer color gamut image according to the target pixel restoration value; The repair unit comprises: A simulation imaging subunit, configured to input the first pixel difference into the preset adversarial generation model to generate N simulated imaging effect images corresponding to the first repair defect generated by the first repair printing; A repair image generation subunit, used for splicing the N simulated imaging effect images corresponding to the first repair defect and the pixel image corresponding to the first pixel difference into a corresponding target channel input image, and inputting the corresponding target channel input image into the preset repair network model to generate a second predicted repair image; a pixel difference calculation subunit, configured to calculate a second pixel difference between the second predicted inpainted image and a pixel map corresponding to the first pixel difference; The image restoration subunit is used to calculate a target pixel restoration value according to the first pixel difference value and the second pixel difference value, and to restore the real printer color gamut image according to the target pixel restoration value.
8. A terminal device, characterized in that: The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the steps of the image printing repair method based on machine learning are implemented as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the image printing repair method based on machine learning as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Underwater image restoration method based on improved generative adversarial network model
CN117058037A
Image restoration method and device based on SRGAN-GAN, equipment and storage medium
CN117830148A