An image generation method and system based on diffusion model time step pruning

By employing a representation-aware structured pruning framework in the diffusion model, key time steps are selected in stages and importance scores are calculated, which solves the problem of insufficient estimation of the contribution of key time steps in the prior art, and achieves efficient compression and preservation of generation quality.

CN120976358BActive Publication Date: 2026-02-10NANJING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511508301.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-02-10
Estimated Expiration
2045-10-22

AI Technical Summary

Technical Problem

The asymmetric nature of existing diffusion models in the time dimension makes it difficult for existing uniform sampling or uniformly weighted time step evaluation methods to accurately capture the differentiated contributions of different stages to the generation quality. This results in insufficient measurement of the importance of key time steps during pruning, which in turn leads to a decrease in the model's image generation performance.

Method used

A representation-aware structured pruning framework is adopted. By calculating the denoising loss difference and loss change of each image time step and combining temperature-scaled Gaussian kernel and spatial average pooling, key time steps are selected in stages, and the importance score is calculated by the first-order Taylor expansion method based on cumulative gradient for pruning.

Benefits of technology

It achieves efficient compression of the diffusion model while maintaining generation quality, can more accurately capture information-rich time steps, reduces redundancy, improves efficiency, and maintains the model's representational ability while reducing computational redundancy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976358B_ABST
    Figure CN120976358B_ABST
Patent Text Reader

Abstract

The application discloses an image generation method and system based on diffusion model time step pruning, first calculates the denoising loss of each image time step and obtains the diffusion loss difference, then calculates the continuous time step loss change by using the diffusion loss difference, and then performs spatial average pooling on the predicted noise map of a batch of image samples to obtain image feature representation; the application realizes efficient compression of the diffusion model by using the representation perception structured pruning framework while maintaining the generation quality, and also realizes the function of dynamically adjusting the time step screening strategy according to the phased characteristics of the diffusion process by using the phased time step selection mechanism, which not only enables focusing on the most representative key time step within the stage, but also reduces redundancy and improves efficiency, and the importance score of pruning calculated by using the first-order Taylor expansion method based on the cumulative gradient after the information-rich time step is selected can accumulate the gradient information under the key signal, so that the application is suitable for being widely promoted and used.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image generation, and particularly relates to an image generation method and system based on diffusion model time step pruning. BACKGROUND

[0002] In recent years, diffusion models have made significant breakthroughs in image, speech and cross-modal generation tasks, and have shown excellent ability to generate high-fidelity data. However, such models are usually accompanied by a large parameter size and extremely high computational overhead, which poses strict requirements on storage space and computing resources in actual deployment. This problem is particularly prominent in resource-constrained application scenarios, such as mobile end inference, embedded devices or real-time generation systems. To alleviate the above challenges, structured pruning, as a classic model compression and acceleration method, is widely used in convolutional neural networks and Transformer architectures, which can effectively reduce the model size and inference delay while trying to maintain the original performance. Therefore, it is of great significance to introduce structured pruning into diffusion models.

[0003] At present, the diffusion process of the existing diffusion model has significant heterogeneity in the time dimension, and the early time steps mainly determine the construction of overall semantic and structural information, while the later time steps are responsible for the modification and improvement of local texture and fine details. The asymmetric characteristics of the early structure-driven and later detail-oriented make it difficult for the existing uniform sampling or uniform weighting time step evaluation methods to accurately capture the differentiated contributions of different stages to the generation quality, leading to the underestimation of the importance of key time steps in the pruning process, thereby causing the decline of the model image generation performance. Therefore, it is necessary to design an image generation method and system based on diffusion model time step pruning. SUMMARY

[0004] The purpose of this invention is to overcome the shortcomings of existing technologies. To better and more effectively address the asymmetric characteristics of the diffusion process in existing diffusion models—namely, the early-stage structure-driven and later-stage detail-oriented nature—existing uniform sampling or uniformly weighted time-step evaluation methods struggle to accurately capture the differentiated contributions of different stages to the generation quality. This leads to insufficient assessment of the importance of key time steps during pruning, resulting in decreased model image generation performance. This invention provides an image generation method and system based on time-step pruning of a diffusion model. It achieves efficient compression of the diffusion model while maintaining generation quality using a representation-aware structured pruning framework. Furthermore, it employs a phased time-step selection mechanism to dynamically adjust the time-step selection strategy based on the stage-specific characteristics of the diffusion process. This not only allows focusing on the most representative key time steps within a stage but also reduces redundancy and improves efficiency. Moreover, after selecting information-rich time steps, it uses a first-order Taylor expansion method based on accumulated gradients to calculate the pruning importance score, accumulating gradient information under key signals.

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

[0006] An image generation method based on diffusion model time-step pruning includes the following steps:

[0007] Step A: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, then use the diffusion loss difference to calculate the loss change for consecutive time steps;

[0008] Step B involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain image feature representations, and then using the image feature representations to calculate the pairwise distances between the features of the image samples.

[0009] Step C: Use a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between features of all image samples and obtain discrete loss;

[0010] Step D combines the continuous time step loss variation and discrete loss into a unified scoring function;

[0011] Step E: Divide the diffusion time step into non-overlapping phases of the same size;

[0012] Step F involves using a scoring function to introduce a phased selection mechanism for time steps in the obtained non-overlapping stages, and then using different strategies to select the corresponding time steps in the early and late stages of the non-overlapping stages to obtain a set of time steps.

[0013] Step G involves performing backpropagation on the time steps in the obtained time step set and calculating importance scores. Then, the weights of parameters with importance scores below a threshold are removed from the image samples and pruned images are generated.

[0014] The image generation method based on diffusion model time step pruning of the preceding, step A, calculates the denoising loss of each image time step and obtains the diffusion loss difference, and then uses the diffusion loss difference to calculate the loss change of consecutive time steps, the specific steps are as follows,

[0015] Step A1, calculate the denoising loss of each image time step and obtain the diffusion loss difference, as shown in formula (1),

[0016] (1)

[0017] Wherein, is the diffusion loss difference of the time step, is the predicted noise, is the true noise; Step A2, use the diffusion loss difference to calculate the loss change of consecutive time steps, as shown in formula (2),

[0018]

[0019] (2) Wherein,

[0020] is the loss change of consecutive time steps, is the diffusion loss difference of the time step. The image generation method based on diffusion model time step pruning of the preceding, step B, performs spatial average pooling on the predicted noise map of the batch image sample and obtains the image feature representation, and then uses the image feature representation to calculate the pairwise distance between image sample features, the specific steps are as follows,

[0021] Step B1, perform spatial average pooling on the predicted noise map of the batch image sample and obtain the image feature representation, which is to perform spatial average pooling on the predicted noise map of the i-th image sample in each batch of size B, as shown in formula (3),

[0022]

[0023] (3)

[0024] Wherein, is the image feature representation of the i-th image sample, is the feature map height, is the feature map width, is all channel vectors of the i-th image sample at position (x, y), Step B2, use the image feature representation to calculate the pairwise distance between image sample features, as shown in formula (4),

[0025]

[0026] ​​​​ (4)

[0027] in, For the i-th image sample and the i-th... The pairwise distance between image samples For the first Image feature representation of an image sample.

[0028] In the aforementioned image generation method based on diffusion model time-step pruning, step C involves using a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between features of all image samples and obtain a discrete loss, as shown in formula (5).

[0029] (5)

[0030] in, For discrete loss, This refers to temperature hyperparameters.

[0031] In the aforementioned image generation method based on diffusion model time-step pruning, step D combines the continuous time-step loss variation and discrete loss into a unified scoring function, as shown in formula (6).

[0032] (6)

[0033] in, The overall score for time step t. This is the balance coefficient.

[0034] In the aforementioned image generation method based on diffusion model time step pruning, step E involves dividing the diffusion time step into non-overlapping stages of the same size, as shown in formula (7).

[0035] (7)

[0036] in, For the first The set of time steps contained in each window The size of the non-overlapping stages.

[0037] The aforementioned image generation method based on diffusion model time-step pruning, in step F, introduces a phased time-step selection mechanism in the obtained non-overlapping stages using a scoring function. Then, different strategies are employed in the early and late stages of the non-overlapping stages to select corresponding time steps and obtain a set of time steps. The specific steps are as follows.

[0038] Step F1 involves using a scoring function to introduce a phased selection time step mechanism within the obtained non-overlapping phases, specifically by setting a dividing point. The dividing point to distinguish early stage and late stage;

[0039] Step F2, different strategies are used to select corresponding time steps and obtain time step set in early stage and late stage in non-overlapping stage, specific steps are as follows,

[0040] Step F21, if the demarcation point is early stage, and all time steps with scores exceeding stage-specific threshold value in the stage are selected to form selection set, as shown in formula (8),

[0041] (8)

[0042] wherein, is the set of time steps meeting threshold value in the window, is a hyperparameter for controlling threshold value;

[0043] Step F22, if the demarcation point is late stage, and top-k strategy is used to retain time steps with most information in the stage, as shown in formula (9),

[0044] ;

[0045] (9)

[0046] wherein, is selection ratio, is the sparsity of selected time steps in each stage, is the maximum value of comprehensive score of the first time steps t;

[0047] Step F23, time step set is obtained, as shown in formula (10),

[0048] ;

[0049] (10)

[0050] wherein, is the number of division windows, is the number of diffusion time steps, is time step set, and U is union set.

[0051] The foregoing image generation method based on diffusion model time step pruning, step G, performs back propagation on time steps in the obtained time step set and calculates importance score, and then removes parameter weight with importance score lower than threshold value from image sample and generates pruned image, wherein the importance score calculation process is shown in formula (11),​

[0052] (11)

[0053] wherein, is the parameter set corresponding to the c-th channel in the model network, is the gradient of the diffusion loss on the parameter at time step is the first-order derivative.

[0054] An image generation system based on diffusion model time step pruning, comprising a diffusion loss calculation module, a distance calculation module, a discrete loss acquisition module, a score function construction module, a stage division module, a time step set acquisition module and an importance score calculation module, the diffusion loss calculation module is used to calculate the denoising loss of each image time step and obtain the diffusion loss difference, and then the diffusion loss difference is used to calculate the continuous time step loss change;The distance calculation module is used to perform spatial average pooling on the predicted noise map of the batch image sample and obtain the image feature representation, and then the image feature representation is used to calculate the pairwise distance between the image sample features;The discrete loss acquisition module is used to use the temperature scaled Gaussian kernel to soft aggregate the pairwise distance between all image sample features and obtain the discrete loss;The score function construction module is used to combine the continuous time step loss change and the discrete loss into a unified score function;The stage division module is used to divide the diffusion time step into non-overlapping stages of the same size;The time step set acquisition module is used to introduce a time step selection mechanism of phased selection in the obtained non-overlapping stages by using the score function, and then different strategies are used to select the corresponding time steps in the early stage and the late stage in the non-overlapping stages and obtain the time step set;The importance score calculation module is used to perform back propagation on the time steps in the obtained time step set and calculate the importance score, and then the parameter weight whose importance score is lower than the threshold is removed from the image sample and a pruned image is generated.

[0055] The beneficial effects of the present application are:

[0056] ​(1), the image generation method and system have the functions of efficiently compressing the diffusion model by using the representation perception structured pruning framework while maintaining the generation quality, the disturbance amplitude of the loss function at a specific time step when predicting can reflect the importance of the time step to the overall denoising process by measuring the diffusion loss difference, the dispersion degree of the model prediction feature in the small batch sample can depict the semantic difference provided by the time step in the representation space by the dispersion loss, and the combination of the diffusion loss difference and the dispersion loss makes the scoring mechanism not only consider the strength of the optimization signal, but also consider the richness of the semantic representation, so that the information-rich time steps can be more accurately captured, which can more comprehensively measure the importance of different time steps in the diffusion process, and avoid the situation that the traditional method estimates the contribution of the key time step insufficiently,

[0057] (2), the image generation method and system have the function of dynamically adjusting the time step screening strategy according to the phased characteristics of the diffusion process by using the staged time step selection mechanism, and in the early stage and the late stage of the non-overlapping stage, the corresponding time step is selected by using different strategies and the time step set is obtained, then the reverse propagation is performed on the time step in the obtained time step set and the importance score is calculated, then the parameter weight whose importance score is lower than the threshold is removed from the image sample and the pruned image is generated, which effectively realizes the function of the image generation method and system. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1This is an overall flowchart of an image generation method based on diffusion model time-step pruning according to the present invention;

[0059] Figure 2 This is a comparison chart of the model generation effects of various pruning methods with a pruning rate of 5% in the embodiments of the present invention, without fine-tuning. Detailed Implementation

[0060] The present invention will now be further described with reference to the accompanying drawings.

[0061] like Figure 1 As shown, an image generation method based on diffusion model time-step pruning according to the present invention includes the following steps:

[0062] Step A: Calculate the denoising loss for each image time step and obtain the diffusion loss difference. Then, use the diffusion loss difference to calculate the loss change at consecutive time steps. The specific steps are as follows.

[0063] Step A1: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, as shown in formula (1).

[0064] (1)

[0065] in, for Diffusion loss difference at time step To predict noise, Real noise;

[0066] Step A2: Calculate the change in loss over consecutive time steps using the difference in diffusion loss, as shown in formula (2).

[0067] (2)

[0068] in, Loss changes over consecutive time steps for Diffusion loss at time step is poor.

[0069] Step B involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain image feature representations, and then using these image feature representations to calculate pairwise distances between image sample features. The specific steps are as follows.

[0070] Step B1 involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain the image feature representation. Specifically, this involves performing spatial average pooling on the predicted noise map of the i-th image sample in each batch of size B. Spatial average pooling is performed, as shown in formula (3).

[0071] (3)

[0072] wherein, is the image feature representation of the i-th image sample, is the feature map height, is the feature map width, is to take out all channel vectors of the i-th image sample at position ;

[0073] Step B2, calculate the pairwise distance between image sample features using the image feature representation, specifically as shown in equation (4),

[0074] (4)

[0075] wherein, is the pairwise distance between the i-th image sample and the j-th image sample, is the image feature representation of the j-th image sample.

[0076] Step C, use the temperature scaled Gaussian kernel to soft aggregate the pairwise distance between all image sample features and obtain the discrete loss, specifically as shown in equation (5),

[0077] (5)

[0078] wherein, is the discrete loss, is the temperature hyperparameter.

[0079] Step D, combine the continuous time step loss change and the discrete loss into a unified scoring function, specifically as shown in equation (6),

[0080] (6)

[0081] wherein, is the comprehensive score of time step t, is the balance coefficient.

[0082] Step E, divide the diffusion time step into non-overlapping stages of the same size, specifically as shown in equation (7),

[0083] (7)

[0084] wherein, is the set of time steps contained in the i-th window, is the size of the non-overlapping stage.

[0085] ​​​Step F involves introducing a phased selection mechanism for time steps within the obtained non-overlapping stages using a scoring function. Different strategies are then employed to select appropriate time steps in the early and late stages of the non-overlapping stages, resulting in a set of time steps. The specific steps are as follows.

[0086] Step F1 involves using a scoring function to introduce a phased selection time step mechanism within the obtained non-overlapping phases, specifically by setting a dividing point. The dividing point Used to distinguish between early and late stages;

[0087] Step F2 involves selecting appropriate time steps and obtaining a set of time steps using different strategies in the early and late stages of the non-overlapping stages. The specific steps are as follows.

[0088] Step F21, if the dividing point Then, the selection set is formed by selecting all time steps within the early stage whose scores exceed a specific threshold of the stage, as shown in formula (8).

[0089] (8)

[0090] in, for The set of time steps within the window that meet the threshold condition. It is a hyperparameter that controls the threshold;

[0091] Step F22, if the dividing point Then, the time step with the most information content in the late stage is retained using the top-k strategy, as shown in formula (9).

[0092] ;

[0093] (9)

[0094] in, To select the proportion, Choose the sparsity of time steps within each stage. To take the front The maximum comprehensive score at time step t;

[0095] Step F23: Obtain the set of time steps, as shown in formula (10).

[0096] ;

[0097] (10)

[0098] in, To divide the number of windows, for the number of diffusion time steps, for the set of time steps, U is the union set.

[0099] Step G, perform back propagation on the time steps in the obtained set of time steps and calculate the importance score, then remove the parameter weights with importance scores below the threshold from the image samples and generate pruned images, wherein the importance score calculation process is shown in formula (11),

[0100] (11)

[0101] wherein, is the parameter set corresponding to the cth channel in the model network, is the gradient of the diffusion loss on the parameter at time step is the first-order derivative.

[0102] An image generation system based on diffusion model time step pruning, comprising a diffusion loss calculation module, a distance calculation module, a discrete loss acquisition module, a scoring function construction module, a stage division module, a time step set acquisition module and an importance score calculation module, the diffusion loss calculation module is used for calculating the denoising loss of each image time step and obtaining the diffusion loss difference, and then calculating the continuous time step loss change by using the diffusion loss difference; the distance calculation module is used for performing spatial average pooling on the predicted noise map of the batch image samples and obtaining the image feature representation, and then calculating the pairwise distance between the image sample features by using the image feature representation; the discrete loss acquisition module is used for soft aggregation of the pairwise distance between all image sample features by using the temperature scaled Gaussian kernel and obtaining the discrete loss; the scoring function construction module is used for combining the continuous time step loss change and the discrete loss into a unified scoring function; the stage division module is used for dividing the diffusion time steps into non-overlapping stages of the same size; the time step set acquisition module is used for introducing a time step selection mechanism of phased selection in the obtained non-overlapping stages by using the scoring function, and then selecting the corresponding time steps in the early stage and the late stage in the non-overlapping stages by using different strategies and obtaining the set of time steps; the importance score calculation module is used for performing back propagation on the time steps in the obtained set of time steps and calculating the importance score, then removing the parameter weights with importance scores below the threshold from the image samples and generating pruned images.

[0103] In order to better illustrate the use effect of the present application, one embodiment of comparing the image generation method and system of the present application with the existing diffusion model pruning method is introduced as follows.

[0104] ​Table 1, Table 2 and Table 3 are respectively the performance comparison results of each pruning method on the CIFAR10 dataset, the LSUN-bedroom dataset and the LSUN-church dataset. From the results of Table 1, Table 2 and Table 3, it can be seen that no matter on low resolution images (CIFAR-10 dataset) or high resolution images (LSUN dataset), the pruning method proposed in the present application can maintain excellent performance after model compression. On the CIFAR-10 dataset, except for the pruning rate of 16% which failed to achieve SOTA, the rest of the pruning rates all achieved SOTA performance, and with the increase of the pruning rate, the advantage of the method is more obvious, even in the case of 70% model compression, it can still maintain good generation effect. On the LSUN-bedroom and LSUN-church datasets, the method of the present application is also superior to other comparative methods, among which the improvement on the LSUN-bedroom is particularly outstanding.

[0105] Table , performance comparison results of each pruning method on the CIFAR10 dataset;

[0106]

[0107] Table , performance comparison results of each pruning method on the LSUN-bedroom dataset;

[0108]

[0109] Table 3, performance comparison results of each pruning method on the LSUN-church dataset;

[0110]

[0111] Figure 2 shows the comparison results of each method under the condition of 5% pruning rate without fine-tuning, the method of the present application can still maintain higher image quality, further verifying the effectiveness of the method of the present application. The present application can accurately select the most representative diffusion time step to provide accurate guidance for structured pruning, thereby significantly compressing the model while maximizing the performance.

[0112] In summary, the image generation method and system based on diffusion model time step pruning provided by the present application first calculates the denoising loss of each image time step and obtains a diffusion loss difference, then calculates the loss change of consecutive time steps using the diffusion loss difference, then performs spatial average pooling on the predicted noise map of the batch image sample and obtains an image feature representation, then calculates the pairwise distance between image sample features using the image feature representation, then performs soft aggregation on the pairwise distance between all image sample features using a temperature-scaled Gaussian kernel and obtains a discrete loss, then combines the loss change of consecutive time steps and the discrete loss into a unified scoring function, which effectively realizes that the image generation method and system can efficiently compress the diffusion model while maintaining the generation quality using the representation perception structured pruning framework, and the disturbance amplitude of the loss function when predicting at a specific time step can reflect the importance of the time step to the overall denoising process by measuring the diffusion loss difference, while the dispersion degree of the model prediction feature in the small batch sample can depict the semantic difference provided by the time step in the representation space by evaluating the discrete loss, and the combination of the diffusion loss difference and the discrete loss makes the scoring mechanism not only consider the strength of the optimization signal, but also take into account the richness of the semantic representation, so that the information-rich time steps can be more accurately captured, which can more comprehensively measure the importance of different time steps in the diffusion process and avoid the underestimation of the contribution of key time steps by traditional methods, then the diffusion time steps are divided into non-overlapping stages of the same size, then the time step selection mechanism of the stage selection is introduced in the obtained non-overlapping stages using the scoring function, then different strategies are used to select the corresponding time steps in the early stage and the late stage of the non-overlapping stage and obtain a time step set, and finally the reverse propagation is performed on the time steps in the obtained time step set and the importance score is calculated, then the parameter weights with an importance score lower than a threshold value are removed from the image sample and a pruned image is generated, which effectively realizes that the image generation method and system has the function of dynamically adjusting the time step selection strategy according to the phased characteristics of the diffusion process using the stage-based time step selection mechanism, and in the early stage of generation, the threshold-based selection method can overcome the problem of large gradient signal noise, while in the later stage of generation, the top-k selection mechanism can ensure the efficiency and accuracy of the pruning decision, which not only focuses on the most representative key time steps within the stage, but also reduces redundancy and improves efficiency, and after selecting the information-rich time steps, the first-order Taylor expansion method based on cumulative gradient is used to calculate the importance score of pruning, which can accumulate gradient information under key signals, which not only efficiently and reasonably structures the pruning, but also maintains the representation ability of the model while reducing redundant calculations.

[0113] The above shows and describes the basic principles, main features and advantages of the present application. Those skilled in the art should understand that the present application is not limited to the above-mentioned embodiments, and the above-mentioned embodiments and descriptions in the specification are only to illustrate the principles of the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the claimed present application. The scope of protection of the present application is defined by the appended claims and their equivalents.

Claims

1. An image generation method based on time-step pruning using a diffusion model, characterized in that: Includes the following steps, Step A: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, then use the diffusion loss difference to calculate the loss change for consecutive time steps; Step B involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain image feature representations, and then using the image feature representations to calculate the pairwise distances between the features of the image samples. Step C involves using a temperature-scaled Gaussian kernel to perform soft aggregation on the pairwise distances between all image sample features and obtain the discrete loss, as shown in formula (5). (5) in, For discrete loss, This refers to temperature hyperparameters. Step D combines the continuous time step loss variation and discrete loss into a unified scoring function; Step E: Divide the diffusion time step into non-overlapping phases of the same size; Step F involves introducing a phased selection mechanism for time steps within the obtained non-overlapping stages using a scoring function. Different strategies are then employed to select appropriate time steps in the early and late stages of the non-overlapping stages, resulting in a set of time steps. The specific steps are as follows. Step F1 involves using a scoring function to introduce a phased selection time step mechanism within the obtained non-overlapping phases, specifically by setting a dividing point. The dividing point Used to distinguish between early and late stages; Step F2 involves selecting appropriate time steps and obtaining a set of time steps using different strategies in the early and late stages of the non-overlapping stages. The specific steps are as follows. Step F21, if the dividing point Then, the selection set is formed by selecting all time steps within the early stage whose scores exceed a specific threshold of the stage, as shown in formula (8). (8) in, for The set of time steps within the window that meet the threshold condition. It is a hyperparameter that controls the threshold; Step F22, if the dividing point Then, the time step with the most information content in the late stage is retained using the top-k strategy, as shown in formula (9). ; (9) in, To select the proportion, Choose the sparsity of time steps within each stage. To take the front The maximum comprehensive score at time step t; Step F23: Obtain the set of time steps, as shown in formula (10). ; (10) in, To divide the number of windows, The number of diffusion time steps. Let U be the set of time steps, and U be the union of the sets. Step G involves performing backpropagation on the time steps in the obtained time step set and calculating importance scores. Then, the weights of parameters with importance scores below a threshold are removed from the image samples and pruned images are generated.

2. The image generation method based on diffusion model time-step pruning according to claim 1, characterized in that: Step A: Calculate the denoising loss for each image time step and obtain the diffusion loss difference. Then, use the diffusion loss difference to calculate the loss change at consecutive time steps. The specific steps are as follows. Step A1: Calculate the denoising loss for each image time step and obtain the diffusion loss difference, as shown in formula (1). (1) in, for Diffusion loss difference at time step To predict noise, Real noise; Step A2: Calculate the change in loss over consecutive time steps using the difference in diffusion loss, as shown in formula (2). (2) in, For continuous time step loss changes, for Diffusion loss at time step is poor.

3. The image generation method based on diffusion model time-step pruning according to claim 2, characterized in that: Step B involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain image feature representations, and then using these image feature representations to calculate pairwise distances between image sample features. The specific steps are as follows. Step B1 involves performing spatial average pooling on the predicted noise map of the batch of image samples to obtain the image feature representation. Specifically, this involves performing spatial average pooling on the predicted noise map of the i-th image sample in each batch of size B. Spatial average pooling is performed, as shown in formula (3). (3) in, Let i be the image feature representation of the i-th image sample. For feature map height, The width of the feature map. To extract the i-th image sample at position ( All channel vectors of ) Step B2 involves calculating the pairwise distances between image sample features using image feature representation, as shown in formula (4). (4) in, For the i-th image sample and the i-th... The pairwise distance between image samples For the first Image feature representation of an image sample.

4. The image generation method based on diffusion model time-step pruning according to claim 3, characterized in that: Step D combines the continuous-time step loss variation and discrete loss into a unified scoring function, as shown in formula (6). (6) in, The overall score for time step t. This is the balance coefficient.

5. The image generation method based on diffusion model time-step pruning according to claim 4, characterized in that: Step E involves dividing the diffusion time step into non-overlapping stages of the same size, as shown in formula (7). (7) in, For the first The set of time steps contained in each window The size of the non-overlapping stages.

6. The image generation method based on diffusion model time-step pruning according to claim 5, characterized in that: Step G involves performing backpropagation on the time steps in the obtained time step set and calculating their importance scores. Then, the weights of parameters with importance scores below a threshold are removed from the image samples to generate pruned images. The importance score calculation process is shown in formula (11). (11) in, This is the parameter set corresponding to the c-th channel in the model network. In time step Updiffusion loss versus parameters gradient, It is the first derivative.

7. An image generation system based on diffusion model time-step pruning, wherein the specific generation process of the image generation system is based on the image generation method according to any one of claims 1-6, characterized in that: It includes a diffusion loss calculation module, a distance calculation module, a discrete loss acquisition module, a scoring function construction module, a stage division module, a time step set acquisition module, and an importance score calculation module. The diffusion loss calculation module is used to calculate the denoising loss of each image time step and obtain the diffusion loss difference, and then use the diffusion loss difference to calculate the loss change of consecutive time steps. The distance calculation module is used to perform spatial average pooling on the predicted noise map of batch image samples to obtain image feature representation, and then use the image feature representation to calculate the pairwise distance between image sample features; The discrete loss acquisition module is used to perform soft aggregation on the pairwise distances between features of all image samples using a temperature-scaled Gaussian kernel to obtain discrete loss. The scoring function construction module is used to combine the continuous time step loss variation and discrete loss into a unified scoring function; The stage division module is used to divide the diffusion time step into non-overlapping stages of the same size; The time step set acquisition module is used to introduce a phased selection mechanism for time steps in the obtained non-overlapping stages using a scoring function, and then use different strategies to select the corresponding time steps in the early and late stages of the non-overlapping stages to obtain the time step set. The importance score calculation module is used to perform backpropagation on the time steps in the obtained time step set and calculate the importance score. Then, the parameter weights with importance scores below the threshold are removed from the image samples and pruned images are generated.

Citation Information

Patent Citations

  • Image super-resolution reconstruction method and system based on mixed experts and stable diffusion

    CN119444578A

  • Diffusion model LoRA fine tuning optimization method and system based on CLIP loss and perception loss

    CN119478587A