Image optimization method and system based on diffusion model

Through pre-training diffusion model and convolutional layer adjustment, the fidelity and cost problems of diffusion model in image optimization are solved, and efficient and flexible image optimization effects are achieved.

CN120355598APending Publication Date: 2025-07-22BEIJING NORMAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510426915.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The existing diffusion models have the limitations of low fidelity and artifact distortion in image optimization, which are high in training costs and cannot flexibly control resolution.

Method used

The pre-trained diffusion model is used to generate parameter graphs, and the image parameters are adjusted through convolutional layers. Combined with upsampling and downsampling techniques, the resolution of the parameter graph is consistent with the image to be optimized, and the image parameters are directly adjusted to optimize the results.

Benefits of technology

Improves fidelity of image optimization results, reduces illusion and distortion, reduces training costs, and supports image optimization at any resolution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355598A_ABST
    Figure CN120355598A_ABST
Patent Text Reader

Abstract

The invention discloses an image optimization method and system based on a diffusion model, and relates to the technical field of image processing. The method comprises the steps of training an image optimization model based on a pre-trained diffusion model; inputting a to-be-optimized image into the image optimization model to obtain a parameter graph; judging whether the resolution of the parameter graph is consistent with the resolution of the to-be-optimized image or not, and generating a judgment result; performing sampling adjustment on the parameter diagram according to a judgment result to enable the resolution of the parameter diagram to be consistent with the resolution of the to-be-optimized image so as to obtain a target parameter diagram; and adjusting the to-be-optimized image according to the target parameter diagram to obtain an optimization result. According to the method, the pre-trained diffusion model is used for generating the parameter graph, and the parameters of the to-be-optimized image are directly adjusted, so that the fidelity of the result is ensured to the greatest extent, and the illusion or distortion problem of the optimization result is reduced; and the training cost is effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and more specifically, to an image optimization method and system based on a diffusion model. Background Art

[0002] With the wide application of diffusion models in the field of computer vision, image optimization methods based on diffusion models have been continuously updated. However, problems such as artifacts, distortions, and unreasonable content may occur in the generation results of diffusion models. Although the above problems can be alleviated to a certain extent through enhanced feedback and detailed prompts, for image optimization tasks with high requirements for fidelity, diffusion models still cannot provide ideal results. Moreover, different diffusion models generally need to be trained for different image optimization tasks, which will consume a large amount of computing resources. In addition, limited by the design of diffusion models, currently pre-trained diffusion models cannot flexibly control the resolution of the generated results. Although some improved image optimization methods based on diffusion models have been successively proposed, there are still certain limitations.

[0003] Currently, the image optimization method based on diffusion models mainly has the following defects: (1) The fidelity of the generated optimization results is not high, and problems such as artifacts and distortions exist, resulting in results that do not conform to common sense. (2) The training cost is too high. Training a separate diffusion model for each image optimization task will cause waste of computing resources. (3) Limited by the design of diffusion models, the resolution of the generated results cannot be flexibly controlled. Summary of the Invention

[0004] In order to overcome the above problems or at least partially solve the above problems, the present invention provides an image optimization method and system based on a diffusion model, which uses a diffusion model to generate a parameter map and directly adjusts the parameters of the image to be optimized, ensuring the fidelity of the results to the greatest extent, reducing the hallucination or distortion problems of the optimization results, and effectively reducing the training cost; at the same time, the parameter map is upsampled so that it can be applied to images to be optimized with any resolution.

[0005] To solve the above technical problems, the technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present invention provides an image optimization method based on a diffusion model, including the following steps:

[0007] Train an image optimization model based on a pre-trained diffusion model;

[0008] Input the image to be optimized into the image optimization model to obtain a parameter map;

[0009] Judge whether the resolution of the parameter map is consistent with the resolution of the image to be optimized, and generate a judgment result;

[0010] Sample and adjust the parameter map according to the judgment result to make the resolution of the parameter map consistent with that of the image to be optimized, and obtain the target parameter map;

[0011] Adjust the image to be optimized according to the target parameter map to obtain the optimization result.

[0012] First of all, the present invention relies on a diffusion model to generate a parameter map and directly adjusts the parameters of the image to be optimized, which maximally ensures the fidelity of the result and reduces the hallucination or distortion problems of the optimization result; secondly, the present invention uses a pre-trained diffusion model and only trains lightweight convolutional layers for each task to generate parameter maps, effectively reducing the training cost; finally, the present invention samples and adjusts the parameter map so that it can be applied to images to be optimized with arbitrary resolutions.

[0013] Based on the first aspect, further, the method for training an image optimization model based on the pre-trained diffusion model includes the following steps:

[0014] Use the pre-trained stable diffusion v3 as the diffusion model and add a convolutional layer after the diffusion model;

[0015] Weight the inference result of the diffusion model through the convolutional layer to obtain a parameter map of a preset size;

[0016] Train corresponding convolutional layers for low-light images, collage composite images, and foggy images respectively to obtain the final image optimization model.

[0017] Based on the first aspect, further, the method for training corresponding convolutional layers for low-light images, collage composite images, and foggy images respectively includes the following steps:

[0018] For low-light images, train on the LOL dataset;

[0019] For collage composite images, train on the iHarmony4 dataset;

[0020] For foggy images, train on the RESIDE dataset.

[0021] Based on the first aspect, further, the convolutional kernel size of the above convolutional layer is 1*1.

[0022] Based on the first aspect, further, the method for sampling and adjusting the parameter map according to the judgment result to make the resolution of the parameter map consistent with that of the image to be optimized includes the following steps:

[0023] If the judgment result is that the resolution of the parameter map is greater than the preset resolution of the image to be optimized, downsample the parameter map to make the resolution of the parameter map consistent with that of the image to be optimized;

[0024] If the judgment result is that the resolution of the parameter map is less than the resolution of the preset image to be optimized, then upsample the parameter map to make the resolution of the parameter map consistent with the resolution of the image to be optimized;

[0025] If the judgment result is that the resolution of the parameter map is consistent with the resolution of the preset image to be optimized, then do not adjust the parameter map.

[0026] Based on the first aspect, further, the method for adjusting the image to be optimized according to the target parameter map to obtain the optimization result includes the following steps:

[0027] Adjust the brightness of the image to be optimized according to the first 9 channels of the target parameter map;

[0028] Adjust the saturation of the image to be optimized according to the 10th channel of the target parameter map;

[0029] Adjust the hue of the image to be optimized according to the 11th to 22nd channels of the target parameter map.

[0030] Based on the first aspect, further, the formula for adjusting the brightness of the image to be optimized is where x is the brightness value of the current coordinate, y is the output brightness value, k = 8, i is the number of segments of the mapping curve, and the value is a natural number from 1 to 8; the first 9 channels of the parameter map correspond to V min and σ i (i = 1, 2,..., 8).

[0031] Based on the first aspect, further, the formula for adjusting the saturation of the image to be optimized is y = x + (x - C med ) * clip(σ), where x is the saturation of the current coordinate, y is the output saturation, C med is a constant, and its value is the average of the highest value and the lowest value of the R, G, and B channels of the image to be optimized at the current coordinate; the 10th channel of the parameter map corresponds to the value of σ.

[0032] Based on the first aspect, further, the formula for adjusting the hue of the image to be optimized is y = Rx + b, where x is the pixel value of the current coordinate, which is composed of the pixel values of the R, G, and B channels; y is the output pixel value; R is a 3x3 matrix, and b is a 3x1 bias vector; the 11th to 22nd channels of the parameter map correspond to the 12 elements in R and b.

[0033] In a second aspect, the present invention provides an image optimization system based on a diffusion model, including a model training module, a parameter map generation module, a resolution judgment module, a parameter map adjustment module, and an image optimization module, where:

[0034] A model training module for training an image optimization model based on a pre-trained diffusion model;

[0035] A parameter map generation module for inputting an image to be optimized into the image optimization model to obtain a parameter map;

[0036] A resolution judgment module for judging whether the resolution of the parameter map is consistent with the resolution of the image to be optimized and generating a judgment result;

[0037] A parameter map adjustment module for sampling and adjusting the parameter map according to the judgment result to make the resolution of the parameter map consistent with the resolution of the image to be optimized and obtaining a target parameter map;

[0038] An image optimization module for adjusting the image to be optimized according to the target parameter map to obtain an optimization result.

[0039] Through the cooperation of multiple modules such as the model training module, the parameter map generation module, the resolution judgment module, the parameter map adjustment module, and the image optimization module, this system relies on the diffusion model to generate a parameter map and directly adjusts the parameters of the image to be optimized, ensuring the fidelity of the result to the greatest extent and reducing the hallucination or distortion problems of the optimization result; using a pre-trained diffusion model, only lightweight convolutional layers are trained for each task to generate parameter maps, effectively reducing the training cost; sampling and adjusting the parameter map so that it can be applied to images to be optimized with arbitrary resolutions.

[0040] The present invention has at least the following advantages or beneficial effects:

[0041] 1. The present invention relies on the diffusion model to generate a parameter map and directly adjusts the parameters of the image to be optimized, ensuring the fidelity of the result to the greatest extent and reducing the hallucination or distortion problems of the optimization result;

[0042] 2. The present invention uses a pre-trained diffusion model, and only lightweight convolutional layers are trained for each task to generate parameter maps, effectively reducing the training cost;

[0043] 3. The present invention samples and adjusts the parameter map so that it can be applied to images to be optimized with arbitrary resolutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0045] Figure 1Flowchart of an image optimization method based on a diffusion model according to an embodiment of the present invention;

[0046] Figure 2 Principle block diagram of an image optimization system based on a diffusion model according to an embodiment of the present invention;

[0047] Figure 3 Block diagram of a structure of an electronic device provided by an embodiment of the present invention.

[0048] Explanation of reference numerals: 100, model training module; 200, parameter map generation module; 300, resolution determination module; 400, parameter map adjustment module; 500, image optimization module; 101, memory; 102, processor; 103, communication interface. Detailed implementation manners

[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0050] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.

[0051] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0052] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising the element.

[0053] In the description of the embodiments of the present invention, "a plurality of" means at least two.

[0054] Embodiment:

[0055] As Figure 1 shown, in a first aspect, an embodiment of the present invention provides an image optimization method based on a diffusion model, including the following steps:

[0056] S1. Train an image optimization model based on a pre-trained diffusion model;

[0057] Further, it includes: using the pre-trained stable diffusion v3 as the diffusion model, and adding a convolutional layer after the diffusion model; weighting the inference result of the diffusion model through the convolutional layer to obtain a parameter map of a preset size; training corresponding convolutional layers for low-light images, collage composite images, and foggy images respectively to obtain the final image optimization model. The convolutional kernel size of the above convolutional layer is 1*1.

[0058] Further, it also includes: for low-light images, training on the LOL dataset; for collage composite images, training on the iHarmony4 dataset; for foggy images, training on the RESIDE dataset.

[0059] In some embodiments of the present invention, the pre-trained stable diffusion v3 is used as the diffusion model, and two convolutional layers with a convolutional kernel size of 1*1 are connected after the diffusion model; stable diffusion v3 is a deep learning model based on the Diffusion Model, mainly used for generating images. The inference result of the diffusion model is weighted through the 1*1 convolutional layer to obtain a parameter map of size 512*512*22; then, corresponding convolutional layers are trained for low-light images, collage composite images, and foggy images respectively. For low-light images, training is carried out on the LOL dataset; for collage composite images, training is carried out on the iHarmony4 dataset; for foggy images, training is carried out on the RESIDE dataset.

[0060] S2. Input the image to be optimized into the image optimization model to obtain a parameter map;

[0061] S3. Judge whether the resolution of the parameter map is consistent with the resolution of the image to be optimized, and generate a judgment result;

[0062] S4. Sample and adjust the parameter map according to the judgment result to make the resolution of the parameter map consistent with the resolution of the image to be optimized, and obtain a target parameter map;

[0063] Further, it includes: if the judgment result is that the resolution of the parameter map is greater than the resolution of the preset image to be optimized, downsample the parameter map so that the resolution of the parameter map is the same as the resolution of the image to be optimized; if the judgment result is that the resolution of the parameter map is less than the resolution of the preset image to be optimized, upsample the parameter map so that the resolution of the parameter map is the same as the resolution of the image to be optimized; if the judgment result is that the resolution of the parameter map is the same as the resolution of the preset image to be optimized, do not adjust the parameter map.

[0064] In some embodiments of the present invention, an image to be optimized is input, and through a diffusion model and a convolutional layer, a parameter map of size 512*512*22 is generated. If the resolution of the image to be optimized is lower than 512*512, downsample the parameter map to be the same as the resolution of the image to be optimized; if the resolution of the image to be optimized is higher than 512*512, upsample the parameter map by bilinear interpolation so that the resolution of the parameter map is the same as that of the image to be optimized.

[0065] S5. Adjust the image to be optimized according to the target parameter map to obtain an optimization result.

[0066] Further, it includes: adjusting the brightness of the image to be optimized according to the first 9 channels of the target parameter map; adjusting the saturation of the image to be optimized according to the 10th channel of the target parameter map; adjusting the hue of the image to be optimized according to the 11th to 22nd channels of the target parameter map. When adjusting the brightness of the image, a total of 9 parameters are required in the formula; when adjusting the saturation of the image, a total of 1 parameter is required in the formula; when adjusting the hue of the image, a total of 12 parameters are required in the formula. Therefore, information from 9, 1, and 12 channels is respectively required to correspond to these parameters. Any numbered channels can be selected to represent these parameters, but regardless of the order of the selected numbers, the final required number of channels will not change, and the result is not affected by the channel numbers. Therefore, it is convenient to represent and calculate by selecting channels in ascending order.

[0067] Further, the formula for adjusting the brightness of the image to be optimized is where x is the brightness value of the current coordinate, y is the output brightness value, k = 8, V min and σ i are learnable parameters, i is the number of segments of the mapping curve, taking natural numbers from 1 to 8; the first 9 channels of the parameter map correspond to the values of V min and σ i (i = 1, 2,..., 8). Based on the above formula, a mapping curve composed of eight straight lines is generated according to the parameters to fit the mapping changes of different brightness values.

[0068] Further, the formula for adjusting the saturation of the image to be optimized is y = x + (x - Cmed ) * clip(σ), where x is the saturation of the current coordinate, y is the output saturation, and C med is a constant, whose value is the average of the highest and lowest values among the R, G, and B channels of the image to be optimized at the current coordinate; σ is a learnable parameter, and the 10th channel of the parameter map corresponds to the value of σ; clip(σ) is a slicing function that can constrain the value of σ within a certain range. When the value of σ does not exceed the specified range of clip(), the value of clip(σ) is equal to σ; when the value of σ is less than (greater than) the specified range of the clip() function, the value of clip(σ) is equal to the lower (upper) limit value specified by the function.

[0069] Furthermore, the formula for adjusting the hue of the image to be optimized is y = Rx + b, where x is the pixel value of the current coordinate, which is composed of the pixel values of the R, G, and B channels and can be represented by a 3 * 1 vector; y is the output pixel value; R is a 3 * 3 matrix; b is a 3 * 1 bias vector; both R and b are learnable parameters, and the 11th to 22nd channels of the parameter map correspond to the 12 elements in R and b.

[0070] First, the present invention relies on a diffusion model to generate a parameter map and directly adjusts the parameters of the image to be optimized, ensuring the fidelity of the result to the greatest extent and reducing the hallucination or distortion problems of the optimization result; second, the present invention uses a pre-trained diffusion model and only trains lightweight convolutional layers for each task to generate the parameter map, effectively reducing the training cost; finally, the present invention samples and adjusts the parameter map so that it can be applied to images to be optimized with arbitrary resolutions.

[0071] As Figure 2 shown, in the second aspect, the embodiment of the present invention provides an image optimization system based on a diffusion model, including a model training module 100, a parameter map generation module 200, a resolution determination module 300, a parameter map adjustment module 400, and an image optimization module 500, where:

[0072] The model training module 100 is used to train an image optimization model based on a pre-trained diffusion model;

[0073] The parameter map generation module 200 is used to input the image to be optimized into the image optimization model to obtain a parameter map;

[0074] The resolution determination module 300 is used to determine whether the resolution of the parameter map is consistent with the resolution of the image to be optimized and generate a determination result;

[0075] The parameter map adjustment module 400 is used to sample and adjust the parameter map according to the determination result so that the resolution of the parameter map is consistent with the resolution of the image to be optimized, obtaining a target parameter map;

[0076] The image optimization module 500 is configured to adjust the image to be optimized according to the target parameter map to obtain an optimized result.

[0077] Through the cooperation of multiple modules such as the model training module 100, the parameter map generation module 200, the resolution judgment module 300, the parameter map adjustment module 400, and the image optimization module 500, this system relies on a diffusion model to generate a parameter map and directly adjusts the parameters of the image to be optimized, ensuring the fidelity of the result to the greatest extent and reducing the hallucination or distortion problems of the optimized result; using a pre-trained diffusion model, only lightweight convolutional layers are trained for each task to generate the parameter map, effectively reducing the training cost; sampling and adjusting the parameter map so that it can be applied to images to be optimized with any resolution.

[0078] As Figure 3 shown, in a third aspect, an embodiment of the present application provides an electronic device, which includes a memory 101 for storing one or more programs; a processor 102. When the one or more programs are executed by the processor 102, the method according to any one of the above first aspects is implemented.

[0079] It further includes a communication interface 103, and the memory 101, the processor 102, and the communication interface 103 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 101 can be used to store software programs and modules, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 101. The communication interface 103 can be used to communicate signaling or data with other node devices.

[0080] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0081] The processor 102 may be an integrated circuit chip with signal processing capabilities. The processor 102 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0082] In the embodiments provided in this application, it should be understood that the disclosed methods and systems may also be implemented in other ways. The method and system embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the methods and systems, methods, and computer program products according to multiple embodiments of this application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

[0083] In addition, in each embodiment of this application, the various functional modules may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.

[0084] Fourthly, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor 102, the method according to any one of the above first aspects is implemented. If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0085] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

[0086] For those skilled in the art, it is obvious that the present application is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or basic characteristics of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present application is defined by the appended claims rather than the above description. Therefore, it is intended to cover all changes falling within the meaning and scope of the equivalent elements of the claims in the present application. Any reference signs in the claims should not be regarded as limiting the claimed rights.

Claims

1. An image optimization method based on a diffusion model, characterized in that It includes the following steps: Based on a pre-trained diffusion model, train an image optimization model; Input the image to be optimized into the image optimization model to obtain a parameter map; Judge whether the resolution of the parameter map is consistent with the resolution of the image to be optimized, and generate a judgment result; According to the judgment result, sample and adjust the parameter map to make the resolution of the parameter map consistent with the resolution of the image to be optimized, and obtain a target parameter map; According to the target parameter map, adjust the image to be optimized to obtain an optimization result.

2. The image optimization method based on a diffusion model according to claim 1, wherein The method for training an image optimization model based on a pre-trained diffusion model includes the following steps: Use the pre-trained stable diffusion v3 as the diffusion model, and add a convolutional layer after the diffusion model; Weight the inference result of the diffusion model through the convolutional layer to obtain a parameter map of a preset size; Train corresponding convolutional layers for low-light images, collage composite images, and foggy images respectively to obtain the final image optimization model.

3. The image optimization method based on a diffusion model according to claim 2, wherein The method for training corresponding convolutional layers for low-light images, collage composite images, and foggy images respectively includes the following steps: For low-light images, train on the LOL dataset; For collage composite images, train on the iHarmony4 dataset; For foggy images, train on the RESIDE dataset.

4. The image optimization method based on a diffusion model according to claim 2, wherein The convolutional kernel size of the convolutional layer is 1*1.

5. The image optimization method based on a diffusion model according to claim 1, wherein The method for sampling and adjusting the parameter map according to the judgment result to make the resolution of the parameter map consistent with the resolution of the image to be optimized includes the following steps: If the judgment result is that the resolution of the parameter map is greater than the preset resolution of the image to be optimized, downsample the parameter map to make the resolution of the parameter map consistent with the resolution of the image to be optimized; If the judgment result is that the resolution of the parameter map is less than the preset resolution of the image to be optimized, upsample the parameter map to make the resolution of the parameter map consistent with the resolution of the image to be optimized; If the judgment result is that the resolution of the parameter map is consistent with the preset resolution of the image to be optimized, do not adjust the parameter map.

6. The image optimization method based on a diffusion model according to claim 1, characterized in that, The method for adjusting the image to be optimized according to the target parameter map to obtain an optimization result includes the following steps: Adjust the brightness of the image to be optimized according to the first 9 channels of the target parameter map; Adjust the saturation of the image to be optimized according to the 10th channel of the target parameter map; Adjust the hue of the image to be optimized according to the 11th to 22nd channels of the target parameter map.

7. The image optimization method based on a diffusion model according to claim 6, wherein The formula for adjusting the brightness of the image to be optimized is where x is the brightness value of the current coordinate, y is the output brightness value, k = 8, i is the number of segments of the mapping curve, and i takes natural numbers from 1 to 8; the first 9 channels of the parameter map correspond to V min and σ i (i = 1, 2, …, 8).

8. The image optimization method based on a diffusion model according to claim 6, wherein The formula for adjusting the saturation of the image to be optimized is y = x + (x - C med ) * clip(σ), where x is the saturation of the current coordinate, y is the output saturation, and C med is a constant, whose value is the average of the highest and lowest values among the R, G, and B channels of the image to be optimized at the current coordinate; the 10th channel of the parameter map corresponds to the value of σ.

9. The image optimization method based on a diffusion model according to claim 6, wherein, The formula for adjusting the hue of the image to be optimized is y = Rx + b, where x is the pixel value of the current coordinate, which is composed of the pixel values of the R, G, and B channels; y is the output pixel value; R is a 3x3 matrix, and b is a 3x1 bias vector; the 11th to 22nd channels of the parameter map correspond to the 12 elements in R and b.

10. An image optimization system based on a diffusion model, characterized in that, It includes a model training module, a parameter map generation module, a resolution judgment module, a parameter map adjustment module, and an image optimization module, where: The model training module is used to train an image optimization model based on a pre-trained diffusion model; The parameter map generation module is used to input the image to be optimized into the image optimization model to obtain a parameter map; A resolution judgment module, which is used to judge whether the resolution of the parameter map is consistent with the resolution of the image to be optimized, and generate a judgment result; A parameter map adjustment module, which is used to sample and adjust the parameter map according to the judgment result, so that the resolution of the parameter map is consistent with the resolution of the image to be optimized, and obtain a target parameter map; An image optimization module, which is used to adjust the image to be optimized according to the target parameter map to obtain an optimization result.