WO2025001797A1 - 模型确定方法、图像生成方法、装置、设备、介质 - Google Patents

模型确定方法、图像生成方法、装置、设备、介质 Download PDF

Info

Publication number
WO2025001797A1
WO2025001797A1 PCT/CN2024/097705 CN2024097705W WO2025001797A1 WO 2025001797 A1 WO2025001797 A1 WO 2025001797A1 CN 2024097705 W CN2024097705 W CN 2024097705W WO 2025001797 A1 WO2025001797 A1 WO 2025001797A1
Authority
WO
WIPO (PCT)
Prior art keywords
time step
model
preset
step sequence
search
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2024/097705
Other languages
English (en)
French (fr)
Inventor
李慧霞
李漓江
郑侠武
吴捷
肖学锋
晁飞
纪荣嵘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2025001797A1 publication Critical patent/WO2025001797A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the diffusion model is an image generation model, and the diffusion model can be applied in many fields (for example, image generation, image super-resolution reconstruction, text image generation, etc.).
  • the diffusion model divides the image generation process into multiple time steps, and each time step requires calling a denoising neural network, the image generation speed of the diffusion model is relatively slow, resulting in a relatively long image generation time.
  • the present disclosure provides a model determination method, an image generation method, an apparatus, a device, and a medium.
  • the process of determining the search result includes:
  • the fitness of the individual is determined according to the performance characterization data of the model constructed based on the individual;
  • the population is evolved, and the step of determining the individual ranking results corresponding to the population according to the fitness of each individual in the population is continued, until the search stop condition is reached, and the search result is determined from the population according to the preset performance condition.
  • the evolution process includes:
  • the time steps within at least one pair of individuals in the population are randomly exchanged, and/or the time steps within the individuals in the population are modified according to a preset probability.
  • the search space is further used to provide at least one candidate network structure corresponding to each time step in the reference time step sequence;
  • the randomly exchanging time steps of at least one pair of individuals in the population comprises:
  • the time steps and/or network structures within individuals in the population are modified according to a preset probability.
  • the diffusion model is constructed based on a training image;
  • the reference image includes the training image;
  • the present disclosure provides an image generation method, the method comprising:
  • a construction unit configured to construct a search space according to a pre-constructed diffusion model, wherein the search space is configured to provide at least one candidate time step sequence, wherein the candidate time step sequence includes at least one time step in a reference time step sequence corresponding to the diffusion model;
  • a determination unit is used to determine an image generation model using the model constructed based on the search results.
  • the present disclosure provides an electronic device, the device comprising: a processor and a memory;
  • the present disclosure provides a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, wherein the computer program contains program codes for executing the model determination method or image generation method provided by the present disclosure.
  • FIG. 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
  • the present disclosure does not limit the sampling method for the candidate time step sequence above.
  • the time step in the candidate time step sequence may refer to the time step from the above. At least one time step arbitrarily sampled from the reference time step sequence.
  • the preset performance condition refers to the constraint required in terms of image generation performance when searching the above search space; and the preset performance condition can be set in advance according to the application scenario.
  • the preset performance condition can specifically be: the image generation performance reaches the maximum, or the image generation performance reaches a preset threshold.
  • the present disclosure is not limited to the above search results.
  • the search results may include a target time step sequence.
  • the target time step sequence refers to a candidate time step sequence obtained by searching in the above search space and satisfying the above preset step number constraint and the above preset performance condition.
  • performance characterization data of the model constructed based on the search results is used to characterize the image generation performance of the above “model constructed based on the search results”; and the present disclosure does not limit the determination method of the performance characterization data.
  • it can be implemented by using any existing or future method that can evaluate the image generation performance of a diffusion model, such as the FID (Fréchet Inception Distance) scoring indicator.
  • FID Frechet Inception Distance
  • the determination process of the above “performance characterization data of the model constructed based on the search results” may specifically include the following steps 11 to 13.
  • Step 11 Get a reference image.
  • Case 2 In some application scenarios, in order to ensure that the image generation performance of the compressed model is as close as possible to the image generation performance of the diffusion model mentioned above, the image generation performance of a compressed model can also be evaluated with the help of image data generated by the diffusion model. Based on this, the present disclosure provides a possible implementation of the reference image mentioned above, in which the reference image may include a second generated image generated by the diffusion model. The second generated image refers to the image data generated by the diffusion model.
  • the present disclosure does not limit the number of reference images, for example, it can be determined according to the actual application scenario.
  • the number of reference images can be 50,000.
  • the present disclosure can speed up the search by reducing the number of reference images. It can be seen that in a possible implementation, when the present disclosure uses the FID scoring indicator to characterize the image generation performance of a model, the number of reference images can be 5,000.
  • Step 12 Obtain a first generated image generated by the model constructed above based on the search results.
  • the first generated image refers to image data obtained by performing image generation processing on input data (eg, noise data) of the model constructed based on the search results above.
  • the present disclosure does not limit the number of the first generated images mentioned above.
  • the relevant content of the “number of the first generated images” is similar to the relevant content of the “number of reference images” mentioned above.
  • the present disclosure does not limit the association relationship between the first generated image and the second generated image.
  • the two images are generated based on different noise data.
  • the first generated image and the second generated image can be generated based on the same noise data.
  • the reference image includes Q second generated images, and the number of the first generated images is Q
  • the qth second generated image is obtained by performing image generation processing on the qth noise data using the diffusion model above
  • the qth first generated image is obtained by performing image generation processing on the qth noise data using the model constructed based on the search results above;
  • q is a positive integer
  • q ⁇ Q and Q is a positive integer. It should be noted that any two of the Q noise data are different.
  • Step 13 According to the above reference image and the above first generated image, determine the performance characterization data of the model constructed based on the search results above.
  • step 13 does not limit the implementation method of step 13.
  • it can be implemented by any existing or future method that can determine the performance characterization data of a model by comparing two image data (for example, the FID evaluation index calculation formula shown in formula (2) below).
  • the image feature of an image data is used to represent the image information carried by the image data; and the present disclosure does not limit the method for determining the image feature. For example, it can be implemented by any existing or future method for extracting image features, such as the VGG (Visual Geometry Group) model.
  • VGG Visual Geometry Group
  • the performance characterization data of the model constructed based on the search results above is determined based on a reference image and a first generated image generated by the model constructed based on the search results, so that the performance characterization data can represent the image generation performance of the model constructed based on the search results.
  • the present disclosure does not limit the determination process of the above search results.
  • it can adopt the existing It is implemented by any method that is currently available or will appear in the future (for example, evolutionary algorithm, etc.) that can search for objects that satisfy certain constraints from a search space.
  • the present disclosure also provides a possible implementation method of the process of determining the above search results.
  • the process of determining the search results can specifically include the following steps 21-24.
  • Step 21 Randomly sample a number of individuals from the search space, where the individuals include a sampling time step sequence that satisfies a preset step number constraint.
  • the sampled time step sequence refers to a candidate time step sequence randomly sampled from the above search space and satisfying the above preset step number constraint.
  • step 21 Based on the relevant content of step 21 above, it can be known that if the above search space is determined based on the above reference time step sequence, then after obtaining the search space, some individuals can be randomly sampled from the search space according to the above preset step number constraint, so that the time step sequence within each individual satisfies the preset step number constraint, so that the initial population can be constructed based on these individuals later.
  • Step 22 Initialize the population based on the individuals above.
  • these individuals after randomly sampling some individuals that meet the preset step number constraint from the above search space, these individuals can be used to form a population, so that the search process for the search space can be implemented through the evolution process for the population.
  • Step 23 According to the fitness of each individual in the population, determine the individual ranking result corresponding to the population; the fitness of the individual is determined based on the performance characterization data of the model constructed based on the individual.
  • the fitness of an individual is used to characterize the possibility of the individual being retained (or deleted); and the determination process of the fitness of the individual can be: determining the fitness of the individual according to the performance characterization data of the model constructed based on the individual.
  • the "performance characterization data of the model constructed based on the individual” is used to characterize the image generation performance of the model constructed based on the individual, and the determination process of the "performance characterization data of the model constructed based on the individual” is similar to the determination process of the "performance characterization data of the model constructed based on the search results" above.
  • the present disclosure does not limit the implementation of the step of "determining the fitness of the individual according to the performance characterization data of the model constructed based on the individual" in the above paragraph.
  • it can be specifically: directly converting the base
  • the performance characterization data of the model constructed based on the individual is determined as the fitness of the individual.
  • it can also be: the performance characterization data of the model constructed based on the individual is processed in some way (for example, multiplied by a certain coefficient) to obtain the fitness of the individual.
  • the above “individual sorting result corresponding to a population” is used to indicate the order in which the individuals in the population are deleted (or, the order in which the individuals are retained); and the present disclosure does not limit the “individual sorting result corresponding to a population”.
  • Step 24 According to the individual ranking results corresponding to the above population, the population is evolved, and the process returns to step 23 and subsequent steps until the search stop condition is reached, and the search results are determined from the population according to the preset performance conditions.
  • the evolution process is used to update a population; and the present disclosure does not limit the implementation method of the evolution process, for example, it may include one or more of individual deletion process, mutation process and crossover process.
  • the present disclosure also provides a possible implementation of the above evolutionary processing, which may specifically include one or more steps in the following steps 241 to 243.
  • Step 241 According to the individual sorting result corresponding to the above population, individuals that meet the preset deletion conditions are deleted from the population to implement individual deletion processing for the population.
  • the preset deletion condition refers to the condition that the individual in the population needs to be deleted meets; and the present disclosure does not limit the preset deletion condition. For example, the closer an individual is to the front in the individual ranking result, the less likely the individual is to be deleted.
  • the preset deletion condition can specifically be: the position in the individual ranking result is later than the preset position.
  • the present disclosure also provides a possible implementation of the above-mentioned preset deletion condition.
  • the preset deletion condition can be determined based on the above-mentioned preset performance condition, so that the population individual screening process achieved based on the preset deletion condition is similar to the screening process achieved based on the preset performance condition.
  • Step 242 randomly exchange the time steps within at least one pair of individuals in the population to achieve crossover processing for the population.
  • the random exchange process may refer to exchanging some time steps involved in one individual with other time steps involved in another individual to obtain a new individual. For example, when one individual includes the time step sequence [t 74 ,t 53 ,t 21 ,t 6 ] and the other individual includes the time step sequence [t 100 ,t 87 ,t 39 ,t 10 ]
  • the time step t 74 in the time step sequence [t 74 , t 53 , t 21 , t 6 ] can be exchanged with the time step t 87 in the time step sequence [t 100 , t 87 , t 39 , t 10 ] to obtain a new individual including the time step sequence [t 87 , t 53 , t 21 , t 6 ] and/or a new individual including the time step sequence [t 100 , t 74 , t 39 , t 10 ].
  • the present disclosure does not limit the implementation method of the above random exchange processing.
  • the population includes a first individual (for example, a time step sequence of [t 74 , t 53 , t 21 , t 6 ]) and a second individual (for example, a time step sequence of [t 100 , t 87 , t 39 , t 10 ])
  • all time steps involved in the first individual and all time steps involved in the second individual can be combined (for example, the set of ⁇ t 100 , t 87 , t 74 , t 53 , t 39 , t 21 , t 10 , t 6 ⁇ )
  • some time steps are extracted from the set (for example, the four time steps of t 87 , t 53 , t 21 , t 6 ) to construct a new time step sequence (for example, [t 87 , t 53 , t 21 , t 6 ⁇ ).
  • this time step sequence so that some time steps in the new time step sequence (for example, the three time steps t 53 , t 21 , and t 6 ) belong to the first individual, and the other time steps (for example, the time step t 87 ) belong to the second individual; finally, based on the new time step sequence, a new individual is determined.
  • step 242 it can be known that for a population (for example, a population after some individuals have been deleted), the time steps within at least one pair of individuals in the population can be randomly exchanged to obtain new individuals, and the new individuals can be added to the population to enrich the individuals in the population, thereby achieving cross processing for the population.
  • the present disclosure does not limit the execution time of the above step 242.
  • the execution time of the above step 242 is later than the execution time of the above step 241.
  • Step 243 modify the time steps within individuals in the population according to a preset probability to achieve mutation processing for the population.
  • the preset probability refers to the probability of occurrence of a mutation required for performing individual mutations; and the preset probability can be set in advance according to the application scenario.
  • the present disclosure is not limited to the implementation method of step 243 above.
  • the third individual includes the time step sequence of [t 88 , t 80 , t 60 , t 53 ]
  • the time step t 80 in the time step sequence of [t 88 , t 80 , t 60 , t 53 ] can be modified to t 70 to obtain a new individual including the time step sequence of [t 88 , t 70 , t 60 , t 53 ], thereby completing a mutation processing for the third individual.
  • the present disclosure does not limit the execution time of the above step 243.
  • the execution time of the above step 243 is later than the execution time of the above step 241.
  • steps 241 to 243 it can be known that, in a possible implementation mode, after obtaining a population, individuals corresponding to some models with poor image generation performance can be deleted from the population based on the individual sorting results corresponding to the population, so that the retained individuals in the population can be used as parents; then crossover processing and/or mutation processing are performed on the individuals in the parent generation to obtain an updated population, so that the updated population includes not only the parent generation, but also new individuals obtained by crossover processing and/or mutation processing on the parent generation, so that step 23 and its subsequent steps can be continued to be executed based on the updated population to achieve the next round of processing for the population.
  • search stop condition refers to the condition that needs to be met when the search process for the search space is stopped; and the present disclosure does not limit the search stop condition.
  • the search stop condition may specifically be: traversing all time step sequences in the search space that meet the preset step number constraint.
  • the search stop condition may specifically be: the number of iterations reaches a preset number threshold.
  • the present disclosure does not limit the timing of determining the above “search stop condition”.
  • the step of “determining whether the search stop condition is reached” may be performed after executing the above step 23.
  • the step of “determining whether the search stop condition is reached” may be performed after executing the above step of “performing evolution processing on the population according to the above individual sorting result”.
  • the present disclosure does not limit the implementation method of "determining search results from the population based on preset performance conditions" in the above step 24.
  • it can specifically be: based on the individual sorting results corresponding to the population, determine the individuals that meet the preset performance conditions from the population as search results.
  • an evolutionary algorithm can be used to search the search space to obtain search results that meet certain constraints (for example, preset step constraints, preset performance conditions, etc.).
  • the search space can be searched according to the preset step number constraint and the preset performance condition to obtain search results, so that the performance characterization data of the model constructed based on the search results meets the preset performance conditions, and the target time step sequence in the search results meets the preset step number constraint, so that the compression result corresponding to the diffusion model can be determined based on the search results later.
  • the image generation model refers to the compression result of the above diffusion model;
  • the image generation model is used to perform image generation processing on the input data (for example, noise data) of the image generation model.
  • the image generation speed of the image generation model is faster than that of the diffusion model.
  • the present disclosure does not limit the implementation of S103.
  • it may specifically be: directly determining the model constructed based on the search results as the image generation model.
  • a search space is first constructed based on the diffusion model, so that the search space is used to provide at least one candidate time step sequence, and the candidate time step sequence includes at least one time step in the reference time step sequence corresponding to the diffusion model; then, based on a preset step number constraint (for example, the constraint of 10 time steps) and a preset performance condition (for example, the image generation performance reaches a preset threshold, or the image generation performance reaches the best, etc.), the search space is searched to obtain search results, so that the performance characterization data of the model constructed based on the search result meets the preset performance condition, and the target time step sequence in the search result meets the preset step number constraint.
  • a preset step number constraint for example, the constraint of 10 time steps
  • a preset performance condition for example, the image generation performance reaches a preset threshold, or the image generation performance reaches the best, etc.
  • the preset step number constraint is limited.
  • the number of steps is smaller than the number of time steps of the reference time step sequence, so that the number of steps of the target time step sequence in the search result is smaller than the number of time steps of the reference time step sequence, thereby making the number of time steps in the model constructed based on the search result smaller than the number of time steps in the diffusion model; then, using the model constructed based on the search result, an image generation model is determined, so that the number of time steps in the image generation model is smaller than the number of time steps in the diffusion model, and the image generation performance of the image generation model is almost close to the image generation performance of the diffusion model, so that compression processing can be performed on the diffusion model under the premise of ensuring the image generation performance as much as possible, so that the compressed model (that is, the image generation model) can generate image data at a faster speed, thereby effectively reducing the image generation time consumption.
  • the network structure of the diffusion model can be further compressed, so that the network structure corresponding to one or more time steps in the compressed diffusion model is different from the network structure corresponding to the corresponding time step in the diffusion model before compression, and the size of the network structure corresponding to the one or more time steps in the compressed diffusion model (for example, the size in depth and/or width, etc.) is smaller than the size of the network structure corresponding to the corresponding time step in the diffusion model before compression, so that the overall size of the network structure of the compressed diffusion model is better.
  • the size is smaller than the total size presented by the diffusion model before compression in terms of network structure.
  • the optimal network structures corresponding to different time steps in the time step sequence may be the same or different (for example, there are differences in depth and/or width, etc.).
  • the present disclosure also provides a possible implementation of the model determination method, which may specifically include the following steps 31 to 33.
  • Step 31 Based on the pre-constructed diffusion model, a search space is constructed, where the search space is used to provide at least one candidate time step sequence and at least one candidate network structure corresponding to each time step in the internal time step sequence in the diffusion model, where the candidate time step sequence includes at least one time step in the reference time step sequence, and the candidate network structure includes at least one feature channel of at least one network layer in the denoising neural network in the diffusion model.
  • the search space can be used to provide at least one candidate time step sequence and at least one candidate network structure corresponding to each time step in the reference time step sequence corresponding to the diffusion model above.
  • at least one candidate network structure corresponding to a time step refers to a network structure that can be selected when executing the data processing stage corresponding to the time step; and the present disclosure does not limit the implementation of the "at least one candidate network structure".
  • it can include the denoising neural network in the diffusion model above and the sampling results for the denoising neural network (for example, sampling results based on depth, sampling results based on width, or sampling results based on depth + width).
  • the “sampling results based on depth” in the above paragraph refers to sampling by selecting one or more network layers from the above denoising neural network, so that the “sampling results based on depth” include at least one network layer in the denoising neural network, so that model compression processing based on depth can be achieved;
  • the “sampling results based on width” in the above paragraph refers to sampling by selecting one or more feature channels from the denoising neural network, so that some network layers in the “sampling results based on depth” include at least one feature channel of the corresponding network layer in the denoising neural network, so that model compression processing based on width can be achieved;
  • the “sampling results based on depth + width” in the above paragraph refers to sampling by selecting one or more network layers from the denoising neural network.
  • the network layers and only one or more feature channels are selected from these selected network layers for sampling, so that the number of network layers in the "sampling result based on depth + width" does not exceed the number of network layers in the denoising neural network, and each network layer in the "sampling result based on depth + width" includes at least one feature channel of the corresponding network layer in the denoising neural network, so that model compression processing based on depth + width can be achieved.
  • the above search space can be determined based on the above reference time step sequence and the denoising neural network (for example, the search space can include the reference time step sequence and the denoising neural network), so that the search space can not only provide the time step sequence and the sampling results for the time step sequence, but also provide the denoising neural network and the sampling results for the denoising neural network for each time step, so that the time step sequence to be used and the network structure finally selected for each time step in the time step sequence can be determined by sampling and searching the search space.
  • the search space can be implemented using the search space shown in Figure 2.
  • Step 32 Search the search space according to the preset step number constraint, the preset structure constraint and the preset performance condition to obtain search results, which include a target time step sequence and a target network structure corresponding to each time step in the target time step sequence, the target time step sequence satisfies the preset step number constraint, the target network structure satisfies the preset structure constraint, and the performance characterization data of the model constructed based on the search results satisfies the preset performance condition.
  • the preset structural constraint refers to the constraint required when compressing the network structure of the diffusion model mentioned above; and the preset structural constraint can be determined in advance based on the application scenario.
  • the preset structural constraint can specifically be: the sum of the number of network layers of the target network structure corresponding to all time steps in a time step sequence does not exceed the preset layer number threshold (such as the constraint shown in formula (3) below).
  • the preset structural constraint can be specifically: the target network structure corresponding to all time steps in a time step sequence The sum of the number of feature channels of each network layer does not exceed a preset channel number threshold (e.g., the constraint shown in formula (4) below).
  • a preset channel number threshold e.g., the constraint shown in formula (4) below.
  • the preset structural constraint can be specifically: the sum of the number of network layers of the target network structure corresponding to all time steps in a time step sequence does not exceed the preset layer threshold, and the sum of the number of feature channels of each network layer in the target network structure corresponding to all time steps in the time step sequence does not exceed the preset channel threshold.
  • network structure compression can be achieved by constraining runtime.
  • the above preset structural constraint can be specifically: the sum of the runtimes of the target network structure corresponding to all time steps in a time step sequence does not exceed the preset runtime threshold.
  • search results in step 32 above are used to represent objects obtained from the search space above that satisfy the three constraints of the preset step number constraint above, the preset structure constraint above, and the preset performance condition above (for example, the time step sequence + the network structure corresponding to each time step in the time sequence).
  • the search results may include a target time step sequence and a target network structure corresponding to each time step in the target time step sequence.
  • the target network structure refers to the candidate network structure finally selected for a time step in the target time step sequence above; and the target network structure corresponding to all time steps in the target time step sequence satisfies the preset structural constraints above (for example, the sum of the number of network layers of the target network structure corresponding to all time steps in the target time step sequence does not exceed the preset layer number threshold).
  • the target time step sequence in the search results satisfies the preset step number constraint
  • the target network structure corresponding to all time steps in the target time step sequence satisfies the preset structure constraint above
  • the network structure constructed based on the search results The performance characterization data of the model meets the preset performance conditions.
  • the "model constructed based on the search results” is used to perform image generation processing on the input data of the model (for example, a noise data); and the present disclosure does not limit the construction method of the "model constructed based on the search results", for example, it can be specifically: according to the target time step sequence and the target network structure corresponding to each time step in the target time step sequence, the "model constructed based on the search results” is constructed, so that the constructed "model constructed based on the search results" includes the target time step sequence and the target network structure corresponding to each time step in the target time step sequence, so that the working principle of the "model constructed based on the search results” is specifically: the "model constructed based on the search results” divides the image generation process into data processing stages corresponding to each time step according to the target time step sequence, and the data processing stage corresponding to each time step in the target time step sequence is realized by calling the target network structure corresponding to the corresponding time step.
  • the present disclosure does not limit the process of determining the search results in step 32 above.
  • it can be implemented using any existing or future method that can search for objects that meet certain constraints from a search space (for example, an evolutionary search algorithm, etc.).
  • the present disclosure also provides a possible implementation method of the process of determining the above search results.
  • the process of determining the search results can specifically include the following steps 321-324.
  • Step 321 randomly sample a number of individuals from the search space, the individuals comprising a sampling time step sequence and a sampling network structure corresponding to each time step in the sampling time step sequence, the sampling time step sequence satisfies a preset step number constraint, and the sampling network structure satisfies a preset structure constraint.
  • the sampling network structure refers to the candidate network structure obtained by sampling a time step in the above sampling time step sequence; and the sampling network structures corresponding to all time steps in the sampling time step sequence satisfy the above preset structural constraints (for example, the sum of the number of network layers of the sampling network structures corresponding to all time steps in the sampling time step sequence does not exceed the preset layer threshold).
  • the present disclosure does not limit the individual implementation methods in the above step 321.
  • it can be expressed using the following formulas (5)-(7). 0 ⁇ t′ i+1 -t′ i ⁇ t T -t 1 ;t′ i ⁇ [t T ,t T-1 ,...,t 1 ] (6)
  • cand represents an individual sampled from the search space; represents the sampling time step sequence in the individual cand; t′ i is used to represent any time step in the sampling time step sequence, time step t′ i+1 is adjacent to time step t′ i , and the arrangement position corresponding to time step t′ i+1 is earlier than the arrangement position corresponding to time step t′ i ; represents the set of sampling network structures corresponding to each time step in the sampling time step sequence within the individual cand; Lk represents the sampling network structure corresponding to time step t′K in the sampling time step sequence; Lk -1 represents the sampling network structure corresponding to time step t′K-1 in the sampling time step sequence; ...; L1 represents the sampling network structure corresponding to time step t′1 in the sampling time step sequence; Li represents the sampling network structure corresponding to time step t′i in the sampling time step sequence within the individual cand; Represents the network layer located at the first arrangement position in the sampled network structure Li ; Represents the network layer located at the second arrangement
  • step 321 Based on the relevant content of step 321 above, it can be known that after constructing the search space based on the pre-constructed diffusion model, some individuals can be sampled from the search space according to the preset step number constraint and the preset structure constraint, so that the sampling time step sequence within the individual satisfies the preset step number constraint, and the sampling network structure corresponding to all time steps in the sampling time step sequence within the individual satisfies the preset structure constraint, so that the image generation speed of the model constructed based on the individual is faster than the image generation speed of the diffusion model.
  • Step 322 Initialize the population based on the above individuals.
  • step 322 the relevant content of step 322 can be found in the above step 22, and for the sake of brevity, it will not be repeated here.
  • Step 323 Determine the individual ranking result corresponding to the population according to the fitness of each individual in the population; the fitness of the individual is determined according to the performance characterization data of the model constructed based on the individual.
  • step 323 the relevant content of step 323 can be found in the above step 23, and for the sake of brevity, it will not be repeated here.
  • Step 324 According to the individual ranking results corresponding to the above population, the population is evolved, and the process returns to continue executing step 323 and subsequent steps until the search stop condition is reached, and the search results are determined from the population according to the preset performance conditions.
  • step 324 is similar to the implementation method of the "evolution processing” in step 24 above. For ease of understanding, it is explained below with examples.
  • the “evolution process” in step 324 above may include one or more steps of steps 3241 to 3243 below.
  • Step 3241 Based on the individual sorting result corresponding to the above population, individuals that meet the preset deletion conditions are deleted from the population to implement individual deletion processing for the population.
  • step 3241 can be found in the above step 241, and for the sake of brevity, it will not be repeated here.
  • Step 3242 Randomly exchange information combinations within at least one pair of individuals in the population to achieve crossover processing for the population.
  • the information combination refers to an object that can be exchanged within an individual (e.g., a time step and the network structure corresponding to the time step); and the information combination may include the time step and the network structure that have a corresponding relationship within the individual. That is, an information combination may include a time step and the network structure corresponding to the time step.
  • step 3242 refers to exchanging some information combinations involved in one individual (for example, a time step and its corresponding network structure) with other information combinations involved in another individual to obtain a new individual (for example, the result after cross processing shown in Figure 2).
  • step 3242 is similar to the implementation of the "random exchange process" in step 242 above.
  • step 3242 it can be known that for a population (for example, a population after some individuals have been deleted), the information combination within at least one pair of individuals in the population can be randomly exchanged to obtain a new individual, and the new individual can be added to the population to enrich the individuals in the population, thereby achieving cross-processing for the population.
  • the present disclosure does not limit the execution time of the above step 3242.
  • the execution time of the above step 3242 is later than the execution time of the above step 3241.
  • Step 3243 Modify the time steps and/or network structures within individuals in the population according to a preset probability to achieve variation processing for the population.
  • a modification may only modify the time step without modifying the network structure.
  • a modification may only modify the network structure without modifying the time step.
  • a modification may modify both the time step and the network structure.
  • the present disclosure does not limit the execution time of the above step 3243.
  • the execution time of the above step 3243 is later than the execution time of the above step 3241.
  • steps 3241 to 3243 it can be known that, in a possible implementation mode, after obtaining a population, individuals corresponding to some models with poor image generation performance can be deleted from the population based on the individual sorting results corresponding to the population, so that the retained individuals in the population can be used as parents; then crossover processing and/or mutation processing are performed on the individuals in the parent generation to obtain an updated population, so that the updated population includes not only the parent generation, but also new individuals obtained by crossover processing and/or mutation processing on the parent generation, so that step 323 and its subsequent steps can be continued to be executed based on the updated population to achieve the next round of processing for the population.
  • an evolutionary algorithm can be used to search the search space to obtain search results that meet certain constraints (for example, preset step constraints, preset structural constraints, and preset performance conditions, etc.).
  • the search space can be searched according to the preset step number constraint, the preset structural constraint and the preset performance condition to obtain the search result, so that the performance characterization data of the model constructed based on the search result satisfies the preset performance condition, and the target time step sequence in the search result satisfies the preset step number constraint, and the target network structure corresponding to each time step in the target time step sequence satisfies the preset structural constraint, so that the compression result corresponding to the diffusion model can be determined based on the search result later.
  • the above search space can be used to perform compression processing on the diffusion model from the two dimensions of time and space.
  • the compression processing on the time dimension is achieved by searching the time step sequence from the search space
  • the compression processing on the space dimension is achieved by searching the network structure corresponding to each time step from the search space.
  • the time step sequence and the time step sequence can be compressed by the same search process.
  • the search process of the network structure corresponding to each time step in the two dimensions can be avoided, thereby avoiding the problems caused by separately performing the search process in these two dimensions, which is beneficial to improving the model compression effect.
  • Step 33 Determine the image generation model using the model built based on the search results.
  • step 33 can be found in S103 above, and for the sake of brevity, it will not be repeated here.
  • a search space is first constructed based on the diffusion model, so that the search space includes the reference time step sequence and the denoising neural network, so that the search space can be used to provide at least one candidate time step sequence and at least one candidate network structure corresponding to each time step involved in these candidate time step sequences; then, based on the preset step number constraint, the preset structure constraint and the preset performance condition, the search space is searched to obtain the search result, so that the performance characterization data of the model constructed based on the search result satisfies the preset performance condition, and the target time step sequence in the search result satisfies the preset step number constraint, and the target time step sequence satisfies the preset step number constraint.
  • the target network structure corresponding to each time step in the sequence satisfies the preset structural constraint; then, the image generation model is determined by using the model constructed based on the search result, so that the number of time steps in the image generation model is smaller than the number of time steps in the diffusion model, and the scale of the network structure required to be called at each time step in the image generation model is smaller than the scale of the denoising neural network, and the image generation performance of the image generation model is almost close to the image generation performance of the diffusion model.
  • the compressed model that is, the image generation model
  • the present disclosure also provides an image generation method, which is described below in conjunction with the accompanying drawings for ease of understanding.
  • the image generation method provided by the embodiment of the present disclosure includes the following S301-S302.
  • Figure 3 is a flowchart of an image generation method provided by an embodiment of the present disclosure.
  • the noise data is used to generate image data; and the present disclosure does not limit the noise data.
  • S302 Perform image generation processing on the noise data using an image generation model to obtain a third generated image; the image generation model is determined using any implementation of the model determination method provided in the embodiments of the present disclosure.
  • the image generation model is used to perform image data generation processing on the input data of the image generation model (for example, noise data); and the relevant content of the image generation model can be found above.
  • the third generated image refers to image data obtained by processing the above noise data by the image generation model.
  • a predetermined image generation model can be used to perform image generation processing on any noise data to obtain a generated image corresponding to the noise data.
  • the image generation model can generate image data with relatively high quality at a relatively fast speed, which is conducive to reducing the image generation time consumption while ensuring the image generation quality.
  • the present disclosure does not limit the execution subject of the image generation method.
  • the image generation method provided in the embodiment of the present disclosure can be applied to a device with data processing function such as a terminal device or a server.
  • the image generation method provided in the embodiment of the present disclosure can also be implemented by means of a data communication process between different devices (for example, a terminal device and a server, two terminal devices, or two servers).
  • the embodiment of the present disclosure also provides a model determination device, which is explained and illustrated in conjunction with Figure 4.
  • Figure 4 is a schematic diagram of the structure of a model determination device provided in the embodiment of the present disclosure. It should be noted that for the technical details of the model determination device provided in the embodiment of the present disclosure, please refer to the relevant content of the model determination method above.
  • the model determination device 400 provided in the embodiment of the present disclosure includes:
  • a construction unit 401 is used to construct a search space according to a pre-constructed diffusion model, wherein the search space is used to provide at least one candidate time step sequence, wherein the candidate time step sequence includes at least one time step in a reference time step sequence corresponding to the diffusion model;
  • a search unit 402 is used to search the search space according to a preset step number constraint and a preset performance condition to obtain a search result, wherein the search result includes a target time step sequence, the target time step sequence satisfies the preset step number constraint, the performance characterization data of the model constructed based on the search result satisfies the preset performance condition, and the number of steps defined by the preset step number constraint is less than the number of time steps of the reference time step sequence;
  • the determining unit 403 is used to determine the image using the model constructed based on the search results. Generate the model.
  • the search space is further used to provide at least one candidate network structure corresponding to each time step in the reference time step sequence, wherein the candidate network structure includes at least one feature channel of at least one network layer in the denoising neural network in the diffusion model;
  • the search unit 402 is specifically used to search the search space according to a preset step number constraint, a preset structure constraint and a preset performance condition to obtain search results, wherein the search results also include a target network structure corresponding to each time step in the target time step sequence, and the target network structure satisfies the preset structure constraint.
  • the search unit 402 includes:
  • An individual sampling subunit used for randomly sampling a number of individuals from the search space, wherein the individuals include a sampling time step sequence, and the sampling time step sequence satisfies the preset step number constraint;
  • a population initialization subunit used for initializing the population according to the plurality of individuals
  • a ranking determination subunit used to determine the individual ranking result corresponding to the population according to the fitness of each individual in the population; the fitness of the individual is determined according to the performance characterization data of the model constructed based on the individual;
  • the population evolution subunit is used to perform evolution processing on the population according to the individual sorting result, and return to the sorting determination subunit to continue to execute the step of determining the individual sorting result corresponding to the population according to the fitness of each individual in the population.
  • the result determination subunit is used to determine the search result from the population according to the preset performance condition until the search stop condition is reached.
  • the population evolution subunit includes:
  • An individual deletion subunit used to delete individuals that meet a preset deletion condition from the population according to the individual sorting result
  • the crossover mutation subunit is used to randomly exchange the time steps within at least one pair of individuals in the population, and/or to modify the time steps within the individuals in the population according to a preset probability.
  • the search space is further used to provide at least one candidate network structure corresponding to each time step in the reference time step sequence;
  • the individual also includes a sampling network structure corresponding to each time step in the sampling time step sequence, and the sampling network structure satisfies the preset structural constraint;
  • the crossover mutation subunit is specifically used to:
  • the combination is randomly exchanged, wherein the information combination includes the time steps and network structures with corresponding relationships existing in the individuals; and/or the time steps and/or network structures in the individuals in the population are modified according to a preset probability.
  • the performance characterization data is determined based on a reference image and a first generated image generated by a model constructed based on the search results.
  • the diffusion model is constructed based on a training image; the reference image includes the training image; and/or the reference image includes a second generated image generated by the diffusion model.
  • a search space is first constructed based on a pre-constructed diffusion model, so that the search space is used to provide at least one candidate time step sequence, and the candidate time step sequence includes at least one time step in the reference time step sequence corresponding to the diffusion model; then, based on a preset step number constraint (for example, the constraint of 10 time steps) and a preset performance condition (for example, the image generation performance reaches a preset threshold, or the image generation performance reaches the best, etc.), the search space is searched to obtain a search result, so that the performance characterization data of the model constructed based on the search result satisfies the preset performance condition, and the target time step sequence in the search result satisfies the preset step number constraint.
  • a preset step number constraint for example, the constraint of 10 time steps
  • a preset performance condition for example, the image generation performance reaches a preset threshold, or the image generation performance reaches the best, etc.
  • the limited number of steps is smaller than the number of time steps of the reference time step sequence, so that the number of steps of the target time step sequence in the search result is smaller than the number of time steps of the reference time step sequence, thereby making the number of time steps in the model constructed based on the search result smaller than the number of time steps in the diffusion model; then, using the model constructed based on the search result, an image generation model is determined, so that the number of time steps in the image generation model is smaller than the number of time steps in the diffusion model, and the image generation performance of the image generation model is almost close to the image generation performance of the diffusion model, so that compression processing can be performed on the diffusion model while ensuring the image generation performance as much as possible, so that the compressed model (that is, the image generation model) can generate image data at a faster speed, thereby effectively reducing the image generation time consumption.
  • the embodiment of the present disclosure also provides an image generation device, which is explained and illustrated in conjunction with Figure 5.
  • Figure 5 is a schematic diagram of the structure of an image generation device provided by the embodiment of the present disclosure. It should be noted that for the technical details of the image generation device provided by the embodiment of the present disclosure, please refer to the relevant content of the image generation method above.
  • an image generating device 500 provided in an embodiment of the present disclosure includes:
  • An acquisition unit 501 is used to acquire noise data
  • the generating unit 502 is used to perform image generation processing on the noise data by using an image generation model to obtain a third generated image; the image generation model is determined by using the model determination method according to any one of claims 1 to 7.
  • a predetermined image generation model can be used to perform image generation processing on any noise data to obtain a generated image corresponding to the noise data.
  • the image generation model can generate image data with relatively high quality at a relatively fast speed, which is conducive to reducing the image generation time consumption while ensuring the image generation quality.
  • an embodiment of the present disclosure also provides an electronic device, which includes a processor and a memory: the memory is used to store instructions or computer programs; the processor is used to execute the instructions or computer programs in the memory, so that the electronic device executes any implementation of the model determination method provided by the embodiment of the present disclosure or executes any implementation of the image generation method provided by the embodiment of the present disclosure.
  • the terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.
  • mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.
  • PDAs personal digital assistants
  • PADs tablet computers
  • PMPs portable multimedia players
  • vehicle-mounted terminals such as vehicle-mounted navigation terminals
  • fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG6 is only an example and should not bring any limitation to the functions and scope of use of
  • the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603.
  • a processing device e.g., a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 600 are also stored.
  • the processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604.
  • An input/output (I/O) interface 605 is also connected to the bus 604.
  • input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.
  • output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.
  • audio devices 608 including, for example, a magnetic tape, a hard disk, etc. 6 shows an electronic device 600 with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or provided instead.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602.
  • the processing device 601 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the embodiments of the present disclosure also provide a computer-readable medium, in which instructions or computer programs are stored.
  • the device executes any implementation of the model determination method provided by the embodiments of the present disclosure or executes any implementation of the image generation method provided by the embodiments of the present disclosure.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code.
  • This propagated data signal may take a variety of forms, including but Not limited to electromagnetic signals, optical signals, or any suitable combination thereof.
  • Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • the program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
  • the client and server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network).
  • HTTP Hyper Text Transfer Protocol
  • Examples of communication networks include a local area network ("LAN”), a wide area network ("WAN”), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
  • the computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
  • the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can execute the method.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages.
  • the program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
  • the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
  • LAN local area network
  • WAN wide area network
  • Internet service provider e.g., AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
  • each box in the flowchart or block diagram may represent a module, a program segment, or a portion of code, which contains one or more executable instructions for implementing the specified logical functions.
  • the functions marked in the boxes may also be The blocks shown in the figure may occur in a different order than that indicated in the figure. For example, two blocks shown in succession may actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved.
  • each block in the block diagram and/or flow chart, and combinations of blocks in the block diagram and/or flow chart may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit/module does not, in some cases, constitute a limitation on the unit itself.
  • exemplary types of hardware logic components include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs systems on chips
  • CPLDs complex programmable logic devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing.
  • a more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage device or any suitable combination of the foregoing.
  • At least one (item) means one or more, and “more” means two or more.
  • “And/or” is used to describe the association relationship of associated objects, indicating that three relationships may exist.
  • a and/or B can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural.
  • the character “/” generally indicates that the associated objects before and after are in an “or” relationship.
  • “At least one of the following” or similar expressions means that among these items Any combination of, including any combination of single or plural items.
  • At least one of a, b or c can be represented by: a, b, c, "a and b", “a and c", “b and c", or "a and b and c", where a, b, c can be single or plural.
  • the steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two.
  • the software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本公开公开了一种模型确定方法、图像生成方法、装置、设备、介质,该方法包括:先依据预先构建的扩散模型构建搜索空间,以使搜索空间用于提供至少一个候选时间步序列;再依据预设步数约束以及预设性能条件对搜索空间进行搜索,得到搜索结果,以使基于搜索结果构建的模型的性能表征数据满足预设性能条件,并且使得搜索结果中目标时间步序列满足预设步数约束;然后,利用基于搜索结果构建的模型,确定图像生成模型。

Description

模型确定方法、图像生成方法、装置、设备、介质
本申请要求于2023年6月29日递交的中国专利申请第202310786950.0号的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。
技术领域
本公开涉及一种模型确定方法、图像生成方法、装置、设备、介质。
背景技术
扩散模型是一种图像生成模型,而且该扩散模型可以应用在很多领域(比如,图像生成领域、图像超分辨率重建领域、文本图像生成领域等)。
然而,因扩散模型将图像生成过程划分为多个时间步(time step),而且每个time step都需要调用一次去噪神经网络,如此导致扩散模型的图像生成速度比较慢,从而导致图像生成时耗比较大。
发明内容
本公开提供了一种模型确定方法、图像生成方法、装置、设备、介质。
本公开提供的技术方案如下:
本公开提供一种模型确定方法,所述方法包括:
依据预先构建的扩散模型,构建搜索空间,所述搜索空间用于提供至少一个候选时间步序列,所述候选时间步序列包括所述扩散模型对应的参考时间步序列中的至少一个时间步;
依据预设步数约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,所述搜索结果包括目标时间步序列,所述目标时间步序列满足所述预设步数约束,基于所述搜索结果构建的模型的性能表征数据满足所述预设性能条件,所述预设步数约束所限定的步数小于所述参考时间步序列的时间步个数;
利用所述基于所述搜索结果构建的模型,确定图像生成模型。
在一种可能的实施方式下,所述搜索空间还用于提供所述参考时间步序列中每个时间步对应的至少一个候选网络结构,所述候选网络结构包括所述扩散模型内去噪神经网络中至少一个网络层的至少一个特征通道;
所述依据预设步数约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,包括:
依据预设步数约束、预设结构约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,所述搜索结果还包括所述目标时间步序列中各时间步对应的目标网络结构,所述目标网络结构满足所述预设结构约束。
在一种可能的实施方式下,所述搜索结果的确定过程,包括:
从所述搜索空间中随机采样若干个体,所述个体包括采样时间步序列,所述采样时间步序列满足所述预设步数约束;
依据所述若干个体,初始化种群;
依据所述种群中每个个体的适应度,确定所述种群对应的个体排序结果;所述个体的适应度是根据基于所述个体构建的模型的性能表征数据所确定的;
依据所述个体排序结果,对所述种群进行进化处理,并继续执行所述依据所述种群中每个个体的适应度,确定所述种群对应的个体排序结果的步骤,直至在达到搜索停止条件时,依据所述预设性能条件,从所述种群中确定所述搜索结果。
在一种可能的实施方式下,所述进化处理,包括:
依据所述个体排序结果,从所述种群中删除满足预设删除条件的个体;
将所述种群中至少一对个体内的时间步进行随机交换处理,和/或,按照预设概率对所述种群中个体内的时间步进行修改。
在一种可能的实施方式下,所述搜索空间还用于提供所述参考时间步序列中每个时间步对应的至少一个候选网络结构;
所述个体还包括所述采样时间步序列中各时间步对应的采样网络结构,所述采样网络结构满足所述预设结构约束;
所述将所述种群中至少一对个体内的时间步进行随机交换处理,包括:
将所述种群中至少一对个体内的信息组合进行随机交换处理,所述信息组合包括所述个体内存在的具有对应关系的时间步和网络结构;
所述按照预设概率对所述种群中个体内的时间步进行修改,包括:
按照预设概率对所述种群中个体内的时间步和/或网络结构进行修改。
在一种可能的实施方式下,所述性能表征数据是根据参考图像以及由基于所述搜索结果构建的模型所生成的第一生成图像所确定。
在一种可能的实施方式下,所述扩散模型是依据训练图像所构建的;所述参考图像包括所述训练图像;
和/或,
所述参考图像包括由所述扩散模型生成的第二生成图像。
本公开提供了一种图像生成方法,所述方法包括:
获取噪声数据;
利用图像生成模型对所述噪声数据进行图像生成处理,得到第三生成图像;所述图像生成模型是利用本公开提供的模型确定方法所确定的。
本公开提供了一种模型确定装置,包括:
构建单元,用于依据预先构建的扩散模型,构建搜索空间,所述搜索空间用于提供至少一个候选时间步序列,所述候选时间步序列包括所述扩散模型对应的参考时间步序列中的至少一个时间步;
搜索单元,用于依据预设步数约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,所述搜索结果包括目标时间步序列,所述目标时间步序列满足所述预设步数约束,基于所述搜索结果构建的模型的性能表征数据满足所述预设性能条件,所述预设步数约束所限定的步数小于所述参考时间步序列的时间步个数;
确定单元,用于利用所述基于所述搜索结果构建的模型,确定图像生成模型。
本公开提供了一种图像生成装置,包括:
获取单元,用于获取噪声数据;
生成单元,用于利用图像生成模型对所述噪声数据进行图像生成处理,得到第三生成图像;所述图像生成模型是利用本公开提供的模型确定方法所确定的。
本公开提供了一种电子设备,所述设备包括:处理器和存储器;
所述存储器,用于存储指令或计算机程序;
所述处理器,用于执行所述存储器中的所述指令或计算机程序,以使得所述电子设备执行本公开提供的模型确定方法或者图像生成方法。
本公开提供了一种计算机可读介质,所述计算机可读介质中存储有指令或计算机程序,当所述指令或计算机程序在设备上运行时,使得所述设备执行本公开提供的模型确定方法或者图像生成方法。
本公开提供了一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行本公开提供的模型确定方法或者图像生成方法的程序代码。
附图说明
述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为本公开实施例提供的一种模型确定方法的流程图;
图2为本公开实施例提供的一种模型确定过程的示意图;
图3为本公开实施例提供的一种图像生成方法的流程图;
图4为本公开实施例提供的一种模型确定装置的结构示意图;
图5为本公开实施例提供的一种图像生成装置的结构示意图;以及
图6为本公开实施例提供的一种电子设备的结构示意图。
具体实施方式
经研究发现,因扩散模型将图像生成过程划分为多个时间步(time step),而且每个time step都需要调用一次去噪神经网络,如此导致扩散模型的图像生成速度比较慢,从而导致图像生成时耗比较大。因此,对于扩散模型来说,该扩散模型的图像生成速度与该扩散模型中生成过程所涉及的时间步个数相关,其具体为:如果该扩散模型中生成过程所涉及的时间步个数越大,则该扩散模型的图像生成速度越慢;如果该扩散模型中生成过程所涉及的时间步个数越小,则该扩散模型的图像生成速度越快。基于此可知,本公开可以通过减少时间步的方式提高图像生成速度,从而降低图像生成时耗。
基于上段研究可知,为了更好地降低图像生成时耗,本公开提供了一种模型确定方法(也就是,一种模型压缩方案),其具体可以包括:对于任意一个预先构建的扩散模型来说,先依据该扩散模型,构建搜索空间,以使该搜索空间用于提供至少一个候选时间步序列,而且该候选时间步序列包括该扩散模型对应的参考时间步序列中的至少一个时间步;再依据预设步数约束(比如,10个时间步这一约束)以及预设性能条件(比如,图像生成性能达到预设阈值,或者图像生成性能达到最好等),对该搜索空间进行搜索,得到搜索结果,以使基于该搜索结果构建的模型的性能表征数据满足该预设性能条件,并且使得该搜索结果中目标时间步序列满足该预设步数约束,此时因该预设步数约束所限定的步数小于该参考时间步序列的时间步个数,以使该搜索结果中目标时间步序列的步数小于该参考时间步序列的时间步个数,从而使得基于该搜索结果构建的模型中时间步个数小于该扩散模型中时间步个数;然后,利用基于该搜索结果构建的模型,确定图像生成模型,以使该图像生成模型中时间步个数小于该扩散模型中时间步个数,并且使得该图像生成模型的图像生成性能几乎接近于该扩散模型的图像生成性能,如此能够实现在尽可能确保图像生成性能的前提下针对扩散模型进行压缩处理,从而使得压缩后的模型(也就是,图像生成模型)能够以较快的速度生成图像数据,进而能够有效地降低图像生成时耗。
另外,本公开不限定模型确定方法的执行主体,例如,本公开实施例提供的模型确定方法可以应用于终端设备或服务器等具有数据处理功能的设备。又如,本公开实施例提供的模型确定方法也可以借助不同设备(例如,终端设备与服务器、两个终端设备、或者两个服务器)之间的数据通信过程进行实现。其中,终端设备可以为智能手机、计算机、个人数字助理(Personal Digital Assitant,PDA)或平板电脑等。服务器可以为独立服务器、集群服务器或云服务器。
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
为了更好地理解本公开所提供的技术方案,下面先结合一些附图对本公开提供的模型确定方法进行说明。如图1所示,本公开实施例提供的模型确定方法,包括下文S101-S103。其中,该图1为本公开实施例提供的一种模型确定方法的流程图。
S101:依据预先构建的扩散模型,构建搜索空间,该搜索空间用于提供至少一个候选时间步序列,该候选时间步序列包括该扩散模型对应的参考时间步序列中的至少一个时间步。
其中,扩散模型用于针对该扩散模型的输入数据(比如,一个噪声数据)进行图像生成处理;而且本公开不限定该扩散模型,例如,其可以采用现有的或者未来出现的任意一种已经训练好的具有图像生成功能的扩散模型(比如,预训练的扩散模型等)进行实施。
另外,对于上文扩散模型来说,该扩散模型可以包括图像生成过程所需使用的时间步序列(例如,[tT,tT-1,…,t1]这一时间步序列)以及去噪神经网络,以使该扩散模型可以按照该时间步序列将图像生成过程划分成各个时间步对应的数据处理阶段,而且该时间步序列中每个时间步对应的数据处理阶段均是通过调用该去噪神经网络进行实现的。可见,当该扩散模型包括[tT,tT-1,…,t1]这一时间步序列时,该扩散模型可以通过调用T次去噪神经网络的方式实现图像生成过程。其中,该去噪神经网络用于针对该去噪神经网络的输入数据进行去噪处理,而且本公开不限定该去噪神经网络的实施方式,例如,其可以采用现有的或者未来出现的任意一种扩散模型内存在的具有去噪功能的神经网络进行实施。T为正整数,T表示该参考时间步序列的长度(也就是,时间步的个数)。
参考时间步序列用于表示当上文扩散模型进行图像生成过程所需使用的时间步序列(例如,[tT,tT-1,…,t1]这一时间步序列)。
搜索空间是指在针对上文扩散模型进行压缩处理时所需依据的搜索空间(比如,图2所示的搜索空间)。
另外,对于上文搜索空间来说,该搜索空间可以依据需要进行压缩处理的扩散模型进行确定,以使该搜索空间用于提供出该扩散模型的一些压缩结果(比如,从时间步和/或网络结构方面所呈现压缩结果),以便后续能够从这些压缩结果中筛选出图像生成性能比较好的压缩模型,如此能够实现针对 该扩散模型的压缩处理。
此外,本公开不限定上文搜索空间的实施方式,例如,在一些应用场景下(比如,当通过减少时间步方式实现压缩处理时),该搜索空间可以用于提供至少一个候选时间步序列。其中,该候选时间步序列用于代表能够从该搜索空间中采样所得的一个时间步序列;而且本公开不限定该候选时间步序列,例如,该候选时间步序列可以是指从上文参考时间步序列采样所得的一个时间步序列,以使该候选时间步序列可以包括该参考时间步序列中的至少一个时间步。又如,该候选时间步序列可以是指按照预设步数阈值从上文参考时间步序列采样所得的一个时间步序列,以使该候选时间步序列的时间步个数不超过该预设步数阈值。其中,该预设步数阈值可以预先设定,比如,该预设步数阈值可以为任意一个小于该参考时间步序列的时间步个数的数值。可见,当该参考时间步序列为[tT,tT-1,…,t1]这一时间步序列时,该“至少一个候选时间步序列”可以至少包括下文公式(1)所示的候选时间步序列。
式中,表示一个长度为K的候选时间步序列;t′K表示从上文参考时间步序列中采样所得的K个时间步中排列位置最靠前的时间步,t′K-1表示从该参考时间步序列中采样所得的K个时间步中排列位置第二靠前的时间步,……,t′1表示从该参考时间步序列中采样所得的K个时间步中排列位置最靠后的时间步,t′i用于表示从该参考时间步序列中采样所得的K个时间步中任意一个时间步;时间步t′i+1与时间步t′i相邻,而且时间步t′i+1对应的排列位置比时间步t′i对应的排列位置靠前;[tT,tT-1,…,t1]表示该参考时间步序列,K为正整数,K<T。
基于上段内容可知,在一种可能的实施方式下,上文搜索空间可以依据上文参考时间步序列(例如,[tT,tT-1,…,t1]这一时间步序列)进行确定(比如,该搜索空间包括该参考时间步序列),以使该搜索空间能够提供出该时间步序列以及针对该时间步序列的采样结果(例如,图2所示的[t′K,t′K-1,…,t′1]这一时间步序列),以便后续能够通过针对该搜索空间进行采样搜索的方式,确定出最终所需使用的时间步序列。
需要说明的是,本公开不限定针对上文候选时间步序列的采样方式,比如,为了更好地提高采样效果,该候选时间步序列中的时间步可以是指从上 文参考时间步序列中任意采样的至少一个时间步。例如,当该参考时间步序列为[t100,t99,…,t1]这一时间步序列时,可以从该[t100,t99,…,t1]中任意采样一些时间步(比如,t74、t53、t21、t6等),以构建一个候选时间步序列(比如,[t74,t53,t21,t6]这一时间步序列)。
S102:依据预设步数约束以及预设性能条件,对搜索空间进行搜索,得到搜索结果,该搜索结果包括目标时间步序列,该目标时间步序列满足该预设步数约束,基于搜索结果构建的模型的性能表征数据满足该预设性能条件,该预设步数约束所限定的步数小于所述参考时间步序列的时间步个数。
其中,预设步数约束是指在针对上文扩散模型进行时间步方面的压缩处理时所需依据的约束;而且该预设步数约束所限定的步数小于上文参考时间步序列的时间步个数。另外,该预设步数约束可以预先依据应用场景进行设定,例如,当该参考时间步序列的时间步个数为T时,该预设步数约束可以为:最终压缩所得的模型内时间步序列的时间步个数为K(也就是,最终压缩所得的模型内时间步序列的长度为K),K为正整数,K<T。
预设性能条件是指在针对上文搜索空间进行搜索时在图像生成性能方面所需依据的约束;而且该预设性能条件可以预先依据应用场景进行设定,例如,该预设性能条件具体可以为:图像生成性能达到最大,或者,图像生成性能达到预设阈值。
搜索结果用于表示从上文搜索空间内搜索所得的、满足上文预设步数约束和上文预设性能条件这两个约束条件的对象(比如,时间步序列)。
另外,本公开不限定上文搜索结果,例如,在一些应用场景下(比如,当通过减少时间步方式实现压缩处理时),该搜索结果可以包括目标时间步序列。其中,该目标时间步序列是指从上文搜索空间内搜索所得的、满足上文预设步数约束和上文预设性能条件这两个约束条件的候选时间步序列。其中,因该搜索空间所提供的各个候选时间步序列均是从上文参考时间步序列中任意采样时间步所得到的,以使该搜索空间能够尽可能全面地表示出针对该参考时间步序列的时间步采样结果,从而使得该搜索空间能够尽可能全面地表示出在针对上文扩散模型进行时间步压缩时可以选用的时间步压缩方案,进而使得从该搜索空间中最终搜索所得的目标时间步序列能够更好地表示出在满足预设步数约束的前提下搜索出最优的序列,如此有利于提高针对 该扩散模型的压缩效果。
基于上段内容可知,在一些应用场景下(比如,当通过减少时间步方式实现压缩处理时),上文目标时间步序列不仅满足预设步数约束,而且基于目标时间步序列构建的模型的性能表征数据满足预设性能条件。其中,该“基于目标时间步序列构建的模型”可以用于针对该模型的输入数据(比如,一个噪声数据)进行图像生成处理。需要说明的是,该“基于目标时间步序列构建的模型的性能表征数据”的确定过程类似于下文“基于搜索结果构建的模型的性能表征数据”的确定过程,为了简要起见,在此不再赘述。
另外,本公开不限定上段中“基于目标时间步序列构建的模型”的构建方法,例如,其具体可以为:依据该目标时间步序列以及上文扩散模型内的去噪神经网络,构建该“基于目标时间步序列构建的模型”,以使构建好的该“基于目标时间步序列构建的模型”包括该目标时间步序列以及该去噪神经网络,从而使得该“基于目标时间步序列构建的模型”的工作原理具体为:该“基于目标时间步序列构建的模型”按照该目标时间步序列将图像生成过程划分成各个时间步对应的数据处理阶段,而且该目标时间步序列中每个时间步对应的数据处理阶段均是通过调用该去噪神经网络进行实现的。
基于上述两段内容可知,在一种可能的实施方式下,上文S102中“基于搜索结果构建的模型”可以采用上述两段所示的“基于目标时间步序列构建的模型”进行实施。
上文“基于搜索结果构建的模型的性能表征数据”用于表征上文“基于搜索结果构建的模型”的图像生成性能;而且本公开不限定该性能表征数据的确定方式,例如,其可以采用现有的或者未来出现的任意一种能够评估一个扩散模型的图像生成性能的方法,如FID(Fréchet Inception Distance)评分指标等,进行实施。为了便于理解,下面结合示例进行说明。
作为示例,上文“基于搜索结果构建的模型的性能表征数据”的确定过程,具体可以包括下文步骤11-步骤13。
步骤11:获取参考图像。
其中,参考图像是指在针对一个模型进行图像生成性能确定处理时所需参考的图像数据(例如,图2所示的参考图像)。
另外,本公开不限定上文参考图像的实施方式,为了便于理解,下面结 合一些情况进行说明。
情况1,在一些应用场景下,可以借助真实图像评估一个模型的图像生成性能。基于此,本公开提供了上文参考图像的一种可能的实施方式,在该实施方式中,当上文扩散模型是依据训练图像所构建的时,该参考图像可以包括该训练图像。
情况2,在一些应用场景下,为了确保压缩所得的模型的图像生成性能尽可能地接近于上文扩散模型的图像生成性能,也可以借助由该扩散模型所生成的图像数据评估一个压缩所得的模型的图像生成性能。基于此,本公开提供了上文参考图像的一种可能的实施方式,在该实施方式中,该参考图像可以包括由该扩散模型生成的第二生成图像。其中,该第二生成图像是指由该扩散模型所生成的图像数据。
情况3,在一些应用场景下,可以同时借助真实图像、以及由该扩散模型所生成的图像数据评估一个压缩所得的模型的图像生成性能。基于此,本公开提供了上文参考图像的一种可能的实施方式,在该实施方式中,当上文扩散模型是依据训练图像所构建的时,该参考图像可以包括该训练图像、以及由该扩散模型生成的第二生成图像。
此外,本公开不限定上文参考图像的个数,例如,其可以依据实际应用场景进行确定。比如,当本公开采用FID评分指标表征一个模型的图像生成性能时,该参考图像的个数可以为五万。
经研究发现,因在搜索过程中只需判断出两个模型的图像生成性能之间的相对大小,无需准确地确定出每个模型的图像生成性能,故为了提高搜索效率,可以采用粗略估计方式评估一个模型的图像生成性能。基于此可知,本公开可以通过减少参考图像的个数的方式进行搜索提速。可见,在一种可能的实施方式下,当本公开采用FID评分指标表征一个模型的图像生成性能时,该参考图像的个数可以为5千。
步骤12:获取由上文基于搜索结果构建的模型所生成的第一生成图像。
其中,第一生成图像是指由上文基于搜索结果构建的模型针对该模型的输入数据(比如,一个噪声数据)进行图像生成处理所得到的图像数据。
另外,本公开不限定上文第一生成图像的个数,例如,该“第一生成图像的个数”的相关内容类似于上文“参考图像的个数”的相关内容,为了简要起见, 在此不再赘述。
此外,本公开不限定上文第一生成图像与上文第二生成图像之间的关联关系,例如,两者分别是基于不同的噪声数据所生成的。
又如,为了更好地提高性能评估效果,上文第一生成图像与上文第二生成图像可以是基于同一个噪声数据所生成的。可见,在一种可能的实施方式下,当上文参考图像包括Q个第二生成图像,而且该第一生成图像的个数为Q时,第q个第二生成图像是由上文扩散模型针对第q个噪声数据进行图像生成处理所得到的,而且第q个第一生成图像是由上文基于搜索结果构建的模型针对该第q个噪声数据进行图像生成处理所得到的;q为正整数,q≤Q,Q为正整数。需要说明的是,这Q个噪声数据中任意两个噪声数据均不相同。
步骤13:根据上文参考图像以及上文第一生成图像,确定上文基于搜索结果构建的模型的性能表征数据。
需要说明的是,本公开不限定步骤13的实施方式,例如,其可以采用现有的或者未来出现的任意一种能够通过比较两种图像数据的方式确定出一个模型的性能表征数据的方法(例如,下文公式(2)所示的FID评估指标计算公式)进行实施。
式中,Score表示上文基于搜索结果构建的模型的性能表征数据;mr表示依据所有参考图像的图像特征所确定的均值;mg表示依据所有第一生成图像的图像特征所确定的均值;Cr表示依据所有参考图像的图像特征所确定的方差;Cg表示依据所有第一生成图像的图像特征所确定的方差;Tr()表示一个矩阵的迹。其中,一个图像数据的图像特征用于表示该图像数据所携带的图像信息;而且本公开不限定该图像特征的确定方法,例如,其可以采用现有的或者未来出现的任意一种能够进行图像特征提取的方法,如VGG(Visual Geometry Group)模型,进行实施。
基于上文步骤11至步骤13的相关内容可知,在一种可能的实施方式下,上文基于搜索结果构建的模型的性能表征数据是根据参考图像以及由基于搜索结果构建的模型所生成的第一生成图像所确定的,以使该性能表征数据能够表示出该基于搜索结果构建的模型的图像生成性能。
另外,本公开不限定上文搜索结果的确定过程,例如,其可以采用现有 的或者未来出现的任意一种能够从一个搜索空间中搜索出满足某种约束的对象的方法(例如,进化算法等)进行实施。
实际上,为了更好地提高搜索效果,本公开还提供了上文搜索结果的确定过程的一种可能的实施方式,在该实施方式中,当上文搜索空间用于提供至少一个候选时间步序列时,该搜索结果的确定过程具体可以包括下文步骤21-步骤24。
步骤21:从搜索空间中随机采样若干个体,该个体包括采样时间步序列,该采样时间步序列满足预设步数约束。
其中,采样时间步序列是指从上文搜索空间中随机采样到的、满足上文预设步数约束的候选时间步序列。
基于上文步骤21的相关内容可知,如果上文搜索空间是依据上文参考时间步序列所确定的,则在获取到搜索空间之后,可以依据上文预设步数约束从该搜索空间中随机采样一些个体,以使每个个体内的时间步序列均满足该预设步数约束,以便后续能够基于这些个体构建初始的种群。
需要说明的是,本公开不限定“若干”的具体含义,比如,其可以表示至少两个。
步骤22:依据上文若干个体,初始化种群。
本公开中,在从上文搜索空间中随机采样到一些满足预设步数约束的个体之后,可以利用这些个体构成一个种群,以便后续能够通过针对该种群的进化处理,实现针对搜索空间的搜索处理。
步骤23:依据种群中每个个体的适应度,确定该种群对应的个体排序结果;该个体的适应度是根据基于个体构建的模型的性能表征数据所确定的。
其中,一个个体的适应度用于表征该个体被保留的可能性(或者被删除的可能性);而且该个体的适应度的确定过程可以为:根据基于该个体构建的模型的性能表征数据,确定该个体的适应度。其中,该“基于该个体构建的模型的性能表征数据”用于表征基于该个体构建的模型的图像生成性能,而且该“基于该个体构建的模型的性能表征数据”的确定过程类似于上文“基于搜索结果构建的模型的性能表征数据”的确定过程。
另外,本公开不限定上段中步骤“根据基于该个体构建的模型的性能表征数据,确定该个体的适应度”的实施方式,例如,其具体可以为:直接将基 于该个体构建的模型的性能表征数据,确定为该个体的适应度。又如,其也可以为:对基于该个体构建的模型的性能表征数据进行某种处理(比如,乘以某个系数等处理),得到该个体的适应度。
上文“种群对应的个体排序结果”用于表示该种群中各个个体被删除的顺序(或者,各个个体被保留的顺序);而且本公开不限定该“种群对应的个体排序结果”。
步骤24:依据上文种群对应的个体排序结果,对该种群进行进化处理,并返回继续执行步骤23及其后续步骤,直至在达到搜索停止条件时,依据预设性能条件,从种群中确定搜索结果。
其中,进化处理用于更新一个种群;而且本公开不限定该进化处理的实施方式,例如,其可以包括个体删除处理、变异处理以及交叉处理中的一个或者多个。
实际上,为了更好地提高搜索效果,本公开还提供了上文进化处理的一种可能的实施方式,其具体可以包括下文步骤241-步骤243中的一个或者多个步骤。
步骤241:依据上文种群对应的个体排序结果,从该种群中删除满足预设删除条件的个体,以实现针对该种群的个体删除处理。
其中,预设删除条件是指种群中需要删除的个体所满足的条件;而且本公开不限定该预设删除条件,例如,当一个个体在个体排序结果中所处位置越靠前,则表示该个体被删除的可能性越小时,该预设删除条件具体可以为:在该个体排序结果中所处位置比预设位置靠后。
实际上,为了提高个体删除处理的灵活性,本公开还提供了上文预设删除条件的一种可能的实施方式,在该实施方式下,该预设删除条件可以依据上文预设性能条件进行确定,以使基于该预设删除条件所达到的种群个体筛选过程类似于基于该预设性能条件所实现的筛选过程。
步骤242:将种群中至少一对个体内的时间步进行随机交换处理,以实现针对该种群的交叉处理。
其中,随机交换处理可以是指将一个个体所涉及的一些时间步与另一个个体所涉及的另一些时间步进行交换,以得到新个体。比如,当一个个体包括[t74,t53,t21,t6]这一时间步序列,而且另一个个体包括[t100,t87,t39,t10]这 一时间步序列时,可以将该[t74,t53,t21,t6]这一时间步序列中的时间步t74与该[t100,t87,t39,t10]这一时间步序列中的时间步t87进行交换,得到包括[t87,t53,t21,t6]这一时间步序列的新个体和/或包括[t100,t74,t39,t10]这一时间步序列的新个体。
另外,本公开不限定上文随机交换处理的实施方式,例如,当该种群包括第一个体(比如,[t74,t53,t21,t6]这一时间步序列)和第二个体(比如,[t100,t87,t39,t10]这一时间步序列)时,可以将该第一个体所涉及的所有时间步与该第二个体所涉及的所有时间步进行集合(比如,{t100,t87,t74,t53,t39,t21,t10,t6}这一集合),再从集合中抽取一些时间步(比如,t87、t53、t21、t6这四个时间步)构建一个新时间步序列(比如,[t87,t53,t21,t6]这一时间步序列),以使该新时间步序列中部分时间步(比如,t53、t21、t6这三个时间步)属于该第一个体,另一部分时间步(比如,t87这个时间步)属于该第二个体;最后,基于该新时间步序列,确定一个新个体。
基于上文步骤242的相关内容可知,对于一个种群(比如,删除了一些个体后的种群)来说,可以将该种群中至少一对个体内的时间步进行随机交换处理,以得到新个体,并将该新个体添加至该种群,以丰富该种群中的个体,如此能够实现针对种群的交叉处理。
需要说明的是,本公开不限定上文步骤242的执行时间,例如,该步骤242的执行时间晚于上文步骤241的执行时间。
步骤243:按照预设概率对种群中个体内的时间步进行修改,以实现针对该种群的变异处理。
其中,预设概率是指在进行个体变异时所需依据的变异发生概率;而且该预设概率可以预先依据应用场景进行设定。
需要说明的是,本公开不限定上文步骤243的实施方式,例如,当上文种群包括第三个体,而且该第三个体包括[t88,t80,t60,t53]这一时间步序列时,可以将该[t88,t80,t60,t53]这一时间步序列中的时间步t80修改为t70,以得到包括[t88,t70,t60,t53]这一时间步序列的新个体,如此能够完成针对该第三个体的一种变异处理。
还需要说明的是,本公开不限定上文步骤243的执行时间,例如,该步骤243的执行时间晚于上文步骤241的执行时间。
基于上文步骤241至步骤243的相关内容可知,在一种可能的实施方式下,在获取到一个种群之后,可以先依据种群对应的个体排序结果,从该种群中删除一些图像生成性能不好的模型所对应的个体,以使该种群中被保留的个体作为父代;再针对该父代中个体进行交叉处理和/或变异处理,以得到更新后的种群,以使更新后的种群不仅包括该父代,还包括针对该父代进行交叉处理和/或变异处理所得到的新个体,以便后续能够基于更新后的种群继续执行上文步骤23及其后续步骤,以实现针对种群的下一轮处理。
上文“搜索停止条件”是指停止针对搜索空间的搜索过程时所需达到的条件;而且本公开不限定该搜索停止条件,例如,该搜索停止条件具体可以为:遍历完搜索空间中所有满足预设步数约束的时间步序列。又如,该搜索停止条件具体可以为:迭代次数达到预设次数阈值。
另外,本公开不限定上文“搜索停止条件”的判断时机,例如,在一些应用场景下,可以在执行完上文步骤23之后执行“判断是否达到搜索停止条件”这一步骤。又如,在另一些应用场景下,可以在执行完上文步骤“依据上文个体排序结果,对种群进行进化处理”之后执行“判断是否达到搜索停止条件”这一步骤。
此外,本公开不限定上文步骤24中“依据预设性能条件,从种群中确定搜索结果”的实施方式,例如,其具体可以为:依据该种群对应的个体排序结果,从该种群中确定出满足该预设性能条件的个体,作为搜索结果。
基于上文步骤21至步骤24的相关内容可知,在一些应用场景下,对于一个搜索空间来说,在获取到该搜索空间之后,可以利用进化算法针对搜索空间进行搜索处理,以得到满足某些约束(例如,预设步数约束、预设性能条件等)的搜索结果。
基于上文S102的相关内容可知,在依据预先构建的扩散模型构建出搜索空间之后,可以依据预设步数约束以及预设性能条件,对该搜索空间进行搜索,得到搜索结果,以使基于该搜索结果构建的模型的性能表征数据满足该预设性能条件,并且使得该搜索结果中目标时间步序列满足该预设步数约束,以便后续能够基于该搜索结果,确定出该扩散模型对应的压缩结果。
S103:利用基于搜索结果构建的模型,确定图像生成模型。
其中,图像生成模型是指针对上文扩散模型的压缩结果;而且该图像生 成模型用于针对该图像生成模型的输入数据(比如,一个噪声数据)进行图像生成处理。
另外,因图像生成模型内时间步序列的时间步个数小于上文参考时间步序列的时间步个数,以使该图像生成模型的图像生成速度快于该扩散模型的图像生成速度。
此外,本公开不限定S103的实施方式,例如,其具体可以为:直接将该基于搜索结果构建的模型,确定为图像生成模型。
基于上文S101至S103的相关内容可知,对于任意一个预先构建的扩散模型来说,先依据该扩散模型,构建搜索空间,以使该搜索空间用于提供至少一个候选时间步序列,而且该候选时间步序列包括该扩散模型对应的参考时间步序列中的至少一个时间步;再依据预设步数约束(比如,10个时间步这一约束)以及预设性能条件(比如,图像生成性能达到预设阈值,或者图像生成性能达到最好等),对该搜索空间进行搜索,得到搜索结果,以使基于该搜索结果构建的模型的性能表征数据满足该预设性能条件,并且使得该搜索结果中目标时间步序列满足该预设步数约束,此时因该预设步数约束所限定的步数小于该参考时间步序列的时间步个数,以使该搜索结果中目标时间步序列的步数小于该参考时间步序列的时间步个数,从而使得基于该搜索结果构建的模型中时间步个数小于该扩散模型中时间步个数;然后,利用基于该搜索结果构建的模型,确定图像生成模型,以使该图像生成模型中时间步个数小于该扩散模型中时间步个数,并且使得该图像生成模型的图像生成性能几乎接近于该扩散模型的图像生成性能,如此能够实现在尽可能确保图像生成性能的前提下针对扩散模型进行压缩处理,从而使得压缩后的模型(也就是,图像生成模型)能够以较快的速度生成图像数据,进而能够有效地降低图像生成时耗。
经研究发现,为了更好地提高图像生成速度,可以进一步针对扩散模型进行网络结构方面的压缩,以使压缩后的扩散模型中一个或者多个时间步对应的网络结构不同于压缩前的扩散模型中相应时间步对应的网络结构,并使得压缩后的扩散模型中该一个或者多个时间步对应的网络结构的尺寸(比如,深度和/或宽度等方面的尺寸)小于压缩前的扩散模型中相应时间步对应的网络结构的尺寸,从而使得该压缩后的扩散模型在网络结构方面所呈现的总尺 寸小于该压缩前的扩散模型在网络结构方面所呈现的总尺寸。
经研究还发现,对于一个时间步序列来说,该时间步序列中不同时间步对应的最优网络结构可能相同,也可能不同(比如,深度和/或宽度方面存在不同等)。
基于上述两段内容可知,为了更好地提高图像生成速度,本公开还提供了模型确定方法的一种可能的实施方式,其具体可以包括下文步骤31-步骤33。
步骤31:依据预先构建的扩散模型,构建搜索空间,该搜索空间用于提供至少一个候选时间步序列、以及该扩散模型中内时间步序列中每个时间步对应的至少一个候选网络结构,该候选时间步序列包括该参考时间步序列中的至少一个时间步,该候选网络结构包括该扩散模型内去噪神经网络中至少一个网络层的至少一个特征通道。
其中,扩散模型的相关内容请参见上文S101中扩散模型的相关内容。
另外,搜索空间的相关定义请参见上文。
此外,本公开不限定上文步骤31中搜索空间的实施方式,例如,该搜索空间可以用于提供至少一个候选时间步序列、以及上文扩散模型对应的参考时间步序列中每个时间步对应的至少一个候选网络结构。其中,一个时间步对应的至少一个候选网络结构是指在执行该时间步对应的数据处理阶段时可以选用的网络结构;而且本公开不限定该“至少一个候选网络结构”的实施方式,例如,其可以包括上文扩散模型内的去噪神经网络以及针对该去噪神经网络的采样结果(比如,基于深度方面的采样结果、基于宽度方面的采样结果、或者基于深度+宽度方面的采样结果)。
需要说明的是,上段中“基于深度方面的采样结果”是指通过从上文去噪神经网络中选择一个或者多个网络层的方式进行采样,以使“基于深度方面的采样结果”包括该去噪神经网络中至少一个网络层,如此能够实现基于深度方面的模型压缩处理;上段中“基于宽度方面的采样结果”是指通过从该去噪神经网络中选择一个或者多个特征通道的方式进行采样,以使“基于深度方面的采样结果”中某些网络层包括该去噪神经网络中相应网络层的至少一个特征通道,如此能够实现基于宽度方面的模型压缩处理;上段中“基于深度+宽度方面的采样结果”是指通过从该去噪神经网络中选择一个或者多个网 络层以及从这些被选择的网络层中只选用一个或者多个特征通道的方式进行采样,以使“基于深度+宽度方面的采样结果”中网络层个数不超过该去噪神经网络中网络层个数,而且该“基于深度+宽度方面的采样结果”中各个网络层包括该去噪神经网络中相应网络层的至少一个特征通道,如此能够实现基于深度+宽度方面的模型压缩处理。
基于上段内容可知,在一种可能的实施方式下,上文搜索空间可以依据上文参考时间步序列以及去噪神经网络进行确定(比如,该搜索空间可以包括该参考时间步序列和去噪神经网络),以使该搜索空间不仅能够提供出该时间步序列以及针对该时间步序列的采样结果,还能够针对每一个时间步提供出该去噪神经网络以及针对该去噪神经网络的采样结果,以便后续能够通过针对该搜索空间进行采样搜索的方式,确定出最终所需使用的时间步序列以及针对该时间步序列中各个时间步最终选中的网络结构。可见,在一些应用场景下,该搜索空间可以采用图2所示的搜索空间进行实施。
步骤32:依据预设步数约束、预设结构约束以及预设性能条件,对搜索空间进行搜索,得到搜索结果,该搜索结果包括目标时间步序列以及目标时间步序列中各时间步对应的目标网络结构,该目标时间步序列满足该预设步数约束,该目标网络结构满足该预设结构约束,基于搜索结果构建的模型的性能表征数据满足该预设性能条件。
其中,预设步数约束以及预设性能条件的相关内容请参见上文。
预设结构约束是指在针对上文扩散模型进行网络结构方面的压缩处理时所需依据的约束;而且该预设结构约束可以预先依据应用场景进行确定,例如,在一些应用场景(如,基于深度方面的模型压缩处理)下,该预设结构约束具体可以为:一个时间步序列中所有时间步对应的目标网络结构的网络层数之和不超过预设层数阈值(如,下文公式(3)所示的约束)。
式中,K表示时间序列[t′K,t′K-1,…,t′1]的长度;ni用于代表该时间序列中时间步t′i对应的目标网络结构的网络层数;t′i用于表示该时间步序列[t′K,t′K-1,…,t′1]中存在的任意一个时间步;Nmax表示预设层数阈值。
又如,在一些应用场景(如,基于宽度方面的模型压缩处理)下,该预设结构约束具体可以为:一个时间步序列中所有时间步对应的目标网络结构 内各个网络层的特征通道个数之和不超过预设通道数阈值(如,下文公式(4)所示的约束)。
式中,K表示时间序列[t′K,t′K-1,…,t′1]的长度;ni用于代表该时间序列中时间步t′i对应的目标网络结构的网络层数;t′i用于表示该时间步序列[t′K,t′K-1,…,t′1]中存在的任意一个时间步;表示该时间步t′i对应的目标网络结构内第j个网络层的特征通道个数;Mmax表示预设通道数阈值。
还如,在一些应用场景(如,基于深度+宽度方面的模型压缩处理)下,该预设结构约束具体可以为:一个时间步序列中所有时间步对应的目标网络结构的网络层数之和不超过预设层数阈值,而且该时间步序列中所有时间步对应的目标网络结构内各个网络层的特征通道个数之和不超过预设通道数阈值。
实际上,在一些应用场景(比如,着重关注模型运行时长等场景)下,可以通过约束运行时间的方式实现网络结构的压缩。基于此可知,在一种可能的实施方式下,上文预设结构约束具体可以为:一个时间步序列中所有时间步对应的目标网络结构的运行时长之和不超过预设时长阈值。
上文步骤32中“搜索结果”用于表示从上文搜索空间内搜索所得的、满足上文预设步数约束、上文预设结构约束、以及上文预设性能条件这三个约束条件的对象(比如,时间步序列+该时间序列中各个时间步对应的网络结构)。
另外,本公开不限定上段搜索结果的实施方式,例如,在一种可能的实施方式下,该搜索结果可以包括目标时间步序列以及该目标时间步序列中各时间步对应的目标网络结构。其中,该目标网络结构是指针对上文目标时间步序列中一个时间步最终选用的候选网络结构;而且该目标时间步序列中所有时间步对应的目标网络结构满足上文预设结构约束(比如,该目标时间步序列中所有时间步对应的目标网络结构的网络层数之和不超过预设层数阈值)。
基于上段内容可知,对于上段搜索结果来说,在一种可能的实施方式下,该搜索结果中目标时间步序列满足预设步数约束,该目标时间步序列中所有时间步对应的目标网络结构满足上文预设结构约束,而且基于搜索结果构建 的模型的性能表征数据满足预设性能条件。其中,该“基于搜索结果构建的模型”用于针对该模型的输入数据(比如,一个噪声数据)进行图像生成处理;而且本公开不限定该“基于搜索结果构建的模型”的构建方法,例如,其具体可以为:依据该目标时间步序列以及该目标时间步序列中各时间步对应的目标网络结构,构建该“基于搜索结果构建的模型”,以使构建好的该“基于搜索结果构建的模型”包括该目标时间步序列以及该目标时间步序列中各时间步对应的目标网络结构,从而使得该“基于搜索结果构建的模型”的工作原理具体为:该“基于搜索结果构建的模型”按照该目标时间步序列将图像生成过程划分成各个时间步对应的数据处理阶段,而且该目标时间步序列中每个时间步对应的数据处理阶段均是通过调用相应时间步对应的目标网络结构进行实现的。
此外,本公开不限定上文步骤32中搜索结果的确定过程,例如,其可以采用现有的或者未来出现的任意一种能够从一个搜索空间中搜索出满足某种约束的对象的方法(例如,进化搜索算法等)进行实施。
实际上,为了更好地提高搜索效果,本公开还提供了上文搜索结果的确定过程的一种可能的实施方式,在该实施方式下,当上文搜索空间用于提供至少一个候选时间步序列以及上文参考时间步序列中每个时间步对应的至少一个候选网络结构时,该搜索结果的确定过程具体可以包括下文步骤321-步骤324。
步骤321:从搜索空间中随机采样若干个体,该个体包括采样时间步序列以及该采样时间步序列中各时间步对应的采样网络结构,该采样时间步序列满足预设步数约束,该采样网络结构满足预设结构约束。
其中,采样时间步序列的相关内容请参见上文。
采样网络结构是指针对上文采样时间步序列中一个时间步采样所得的候选网络结构;而且该采样时间步序列中所有时间步对应的采样网络结构满足上文预设结构约束(比如,该采样时间步序列中所有时间步对应的采样网络结构的网络层数之和不超过预设层数阈值)。
另外,本公开不限定上文步骤321中个体的实施方式,例如,其可以采用下文公式(5)-(7)进行表示。

0<t′i+1-t′i<tT-t1;t′i∈[tT,tT-1,…,t1]              (6)
式中,cand表示从搜索空间中采样所得一个个体;表示该个体cand内的采样时间步序列;t′i用于表示该采样时间步序列中存在的任意一个时间步,时间步t′i+1与时间步t′i相邻,而且时间步t′i+1对应的排列位置比时间步t′i对应的排列位置靠前;表示该个体cand内的采样时间步序列中各时间步对应的采样网络结构的集合;Lk表示该采样时间步序列中时间步t′K对应的采样网络结构;Lk-1表示该采样时间步序列中时间步t′K-1对应的采样网络结构;……;L1表示该采样时间步序列中时间步t′1对应的采样网络结构;Li表示该个体cand内的采样时间步序列中时间步t′i对应的采样网络结构;表示采样网络结构Li中位于第1个排列位置上的网络层;表示采样网络结构Li中位于第2个排列位置上的网络层;表示采样网络结构Li中位于第ni个排列位置上的网络层;ni表示采样网络结构Li中的网络层个数,ni≤上文去噪神经网络中的网络层个数。
基于上文步骤321的相关内容可知,在依据预先构建的扩散模型构建出搜索空间之后,可以按照预设步数约束以及预设结构约束,从该搜索空间中采样一些个体,以使该个体内的采样时间步序列满足该预设步数约束,并且使得该个体内的采样时间步序列中所有时间步对应的采样网络结构满足该预设结构约束,以便使得基于该个体构建的模型的图像生成速度快于该扩散模型的图像生成速度。
步骤322:依据上文若干个体,初始化种群。
需要说明的是,步骤322的相关内容请参见上文步骤22,为了简要起见,在此不再赘述。
步骤323:依据种群中每个个体的适应度,确定该种群对应的个体排序结果;该个体的适应度是根据基于个体构建的模型的性能表征数据所确定的。
需要说明的是,步骤323的相关内容请参见上文步骤23,为了简要起见,在此不再赘述。
步骤324:依据上文种群对应的个体排序结果,对该种群进行进化处理,并返回继续执行步骤323及其后续步骤,直至在达到搜索停止条件时,依据预设性能条件,从种群中确定搜索结果。
需要说明的是,步骤324中“进化处理”的实施方式类似于上文步骤24中“进化处理”的实施方式,为了便于理解,下面结合示例进行说明。
作为示例,上文步骤324中“进化处理”可以包括下文步骤3241-步骤3243中的一个或者多个步骤。
步骤3241:依据上文种群对应的个体排序结果,从该种群中删除满足预设删除条件的个体,以实现针对该种群的个体删除处理。
需要说明的是,步骤3241的相关内容请参见上文步骤241,为了简要起见,在此不再赘述。
步骤3242:将种群中至少一对个体内的信息组合进行随机交换处理,以实现针对该种群的交叉处理。
其中,信息组合是指个体内存在的能够进行交换处理的对象(比如,一个时间步以及该时间步对应的网络结构);而且该信息组合可以包括该个体内存在的具有对应关系的时间步和网络结构。也就是,一个信息组合可以包括一个时间步以及该时间步对应的网络结构。
另外,上文步骤3242中“随机交换处理”是指将一个个体所涉及的一些信息组合(比如,一个时间步及其对应的网络结构)与另一个个体所涉及的另一些信息组合进行交换,以得到新个体(例如,图2所示的交叉处理后的结果)。
此外,步骤3242中“随机交换处理”的实施方式类似于上文步骤242中“随机交换处理”的实施方式。
基于上文步骤3242的相关内容可知,对于一个种群(比如,删除了一些个体后的种群)来说,可以将该种群中至少一对个体内的信息组合进行随机交换处理,以得到新个体,并将该新个体添加至该种群,以丰富该种群中的个体,如此能够实现针对种群的交叉处理。
需要说明的是,本公开不限定上文步骤3242的执行时间,例如,该步骤3242的执行时间晚于上文步骤3241的执行时间。
步骤3243:按照预设概率对种群中个体内的时间步和/或网络结构进行修改,以实现针对该种群的变异处理。
其中,预设概率的相关内容请参见上文。
需要说明的是,本公开不限定上文步骤3243中修改的实施方式,比如, 一次修改可以只是修改时间步,不修改网络结构。又如,一次修改可以不修改时间步,只修改网络结构。还如,一次修改可以既修改时间步,又修改网络结构。
还需要说明的是,本公开不限定上文步骤3243的执行时间,例如,该步骤3243的执行时间晚于上文步骤3241的执行时间。
基于上文步骤3241至步骤3243的相关内容可知,在一种可能的实施方式下,在获取到一个种群之后,可以先依据种群对应的个体排序结果,从该种群中删除一些图像生成性能不好的模型所对应的个体,以使该种群中被保留的个体作为父代;再针对该父代中个体进行交叉处理和/或变异处理,以得到更新后的种群,以使更新后的种群不仅包括该父代,还包括针对该父代进行交叉处理和/或变异处理所得到的新个体,以便后续能够基于更新后的种群继续执行上文步骤323及其后续步骤,以实现针对种群的下一轮处理。
上文步骤324中“搜索停止条件”的相关内容请参见上文步骤24中“搜索停止条件”的相关内容。
基于上文步骤321至步骤324的相关内容可知,在一些应用场景下,对于一个搜索空间来说,在获取到该搜索空间之后,可以利用进化算法针对搜索空间进行搜索处理,以得到满足某些约束(例如,预设步数约束、预设结构约束以及预设性能条件等)的搜索结果。
基于上文步骤32的相关内容可知,在依据预先构建的扩散模型构建出搜索空间之后,可以依据预设步数约束、预设结构约束以及预设性能条件,对该搜索空间进行搜索,得到搜索结果,以使基于该搜索结果构建的模型的性能表征数据满足该预设性能条件,并且使得该搜索结果中目标时间步序列满足该预设步数约束,还使得该目标时间步序列中各个时间步对应的目标网络结构满足该预设结构约束,以便后续能够基于该搜索结果,确定出该扩散模型对应的压缩结果。
可见,在一种可能的实施方式下,上文搜索空间可以用于从时间和空间这两个维度上针对扩散模型进行压缩处理,其具体为:时间维度上的压缩处理是通过从该搜索空间中搜索时间步序列进行实现的,而且空间维度上的压缩处理是通过从该搜索空间中搜索每个时间步对应的网络结构进行实现的,如此能够实现借助同一个搜索过程完成针对时间步序列以及该时间步序列 中各个时间步对应的网络结构的搜索处理,从而能够避免因分开执行这两个维度上的搜索处理而导致的问题,进而有利于提高模型压缩效果。
步骤33:利用基于搜索结果构建的模型,确定图像生成模型。
需要说明的是,步骤33的相关内容请参见上文S103,为了简要起见,在此不再赘述。
基于上文步骤31至步骤33的相关内容可知,对于任意一个预先构建的扩散模型来说,先依据该扩散模型,构建搜索空间,以使该搜索空间包括该参考时间步序列以及去噪神经网络,从而使得该搜索空间可以用于提供至少一个候选时间步序列以及这些候选时间步序列所涉及的每个时间步对应的至少一个候选网络结构;再依据预设步数约束、预设结构约束以及预设性能条件,对该搜索空间进行搜索,得到搜索结果,以使基于该搜索结果构建的模型的性能表征数据满足该预设性能条件,并且使得该搜索结果中目标时间步序列满足该预设步数约束,还使得该目标时间步序列中各个时间步对应的目标网络结构满足该预设结构约束;然后,利用基于该搜索结果构建的模型,确定图像生成模型,以使该图像生成模型中时间步个数小于该扩散模型中时间步个数,并且使得该图像生成模型中各个时间步所需调用的网络结构的规模小于该去噪神经网络的规模,还使得该图像生成模型的图像生成性能几乎接近于该扩散模型的图像生成性能,如此能够实现在尽可能确保图像生成性能的前提下针对扩散模型进行多方面压缩处理,从而使得压缩后的模型(也就是,图像生成模型)能够以较快的速度生成图像数据,进而能够有效地降低图像生成时耗。
基于上文模型确定方法的相关内容,本公开还提供了一种图像生成方法,为了便于理解,下面结合附图进行说明。如图3所示,本公开实施例提供的图像生成方法,包括下文S301-S302。其中,该图3为本公开实施例提供的一种图像生成方法的流程图。
S301:获取噪声数据。
其中,噪声数据用于生成一个图像数据;而且本公开不限定该噪声数据。
S302:利用图像生成模型对噪声数据进行图像生成处理,得到第三生成图像;该图像生成模型是利用本公开实施例提供的模型确定方法的任一实施方式所确定的。
其中,图像生成模型用于针对该图像生成模型的输入数据(比如,一个噪声数据)进行图像数据生成处理;而且该图像生成模型的相关内容请参见上文。
第三生成图像是指由图像生成模型针对上文噪声数据进行处理所得到的图像数据。
基于上文S301至S302的相关内容可知,对于本公开实施例提供的图像生成方法来说,可以利用预先确定的图像生成模型针对任意一个噪声数据进行图像生成处理,以得到该噪声数据对应的生成图像。其中,因该图像生成模型的图像生成耗时比较低而且该图像生成模型的图像生成性能比较好,以使该图像生成模型能够以较快地速度生成质量比较高的图像数据,如此有利于实现在确保图像生成质量的前提下降低图像生成时耗。
另外,本公开不限定图像生成方法的执行主体,例如,本公开实施例提供的图像生成方法可以应用于终端设备或服务器等具有数据处理功能的设备。又如,本公开实施例提供的图像生成方法也可以借助不同设备(例如,终端设备与服务器、两个终端设备、或者两个服务器)之间的数据通信过程进行实现。
基于本公开实施例提供的模型确定方法,本公开实施例还提供了一种模型确定装置,下面结合图4进行解释和说明。其中,图4为本公开实施例提供的一种模型确定装置的结构示意图。需要说明的是,本公开实施例提供的模型确定装置的技术详情,请参照上文模型确定方法的相关内容。
如图4所示,本公开实施例提供的模型确定装置400,包括:
构建单元401,用于依据预先构建的扩散模型,构建搜索空间,所述搜索空间用于提供至少一个候选时间步序列,所述候选时间步序列包括所述扩散模型对应的参考时间步序列中的至少一个时间步;
搜索单元402,用于依据预设步数约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,所述搜索结果包括目标时间步序列,所述目标时间步序列满足所述预设步数约束,基于所述搜索结果构建的模型的性能表征数据满足所述预设性能条件,所述预设步数约束所限定的步数小于所述参考时间步序列的时间步个数;
确定单元403,用于利用所述基于所述搜索结果构建的模型,确定图像 生成模型。
在一种可能的实施方式下,所述搜索空间还用于提供所述参考时间步序列中每个时间步对应的至少一个候选网络结构,所述候选网络结构包括所述扩散模型内去噪神经网络中至少一个网络层的至少一个特征通道;
所述搜索单元402,具体用于:依据预设步数约束、预设结构约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,所述搜索结果还包括所述目标时间步序列中各时间步对应的目标网络结构,所述目标网络结构满足所述预设结构约束。
在一种可能的实施方式下,所述搜索单元402,包括:
个体采样子单元,用于从所述搜索空间中随机采样若干个体,所述个体包括采样时间步序列,所述采样时间步序列满足所述预设步数约束;
种群初始化子单元,用于依据所述若干个体,初始化种群;
排序确定子单元,用于依据所述种群中每个个体的适应度,确定所述种群对应的个体排序结果;所述个体的适应度是根据基于所述个体构建的模型的性能表征数据所确定的;
种群进化子单元,用于依据所述个体排序结果,对所述种群进行进化处理,并返回所述排序确定子单元继续执行所述依据所述种群中每个个体的适应度,确定所述种群对应的个体排序结果的步骤。
结果确定子单元,用于直至在达到搜索停止条件时,依据所述预设性能条件,从所述种群中确定所述搜索结果。
在一种可能的实施方式下,所述种群进化子单元,包括:
个体删除子单元,用于依据所述个体排序结果,从所述种群中删除满足预设删除条件的个体;
交叉变异子单元,用于将所述种群中至少一对个体内的时间步进行随机交换处理,和/或,按照预设概率对所述种群中个体内的时间步进行修改。
在一种可能的实施方式下,所述搜索空间还用于提供所述参考时间步序列中每个时间步对应的至少一个候选网络结构;
所述个体还包括所述采样时间步序列中各时间步对应的采样网络结构,所述采样网络结构满足所述预设结构约束;
所述交叉变异子单元,具体用于:将所述种群中至少一对个体内的信息 组合进行随机交换处理,所述信息组合包括所述个体内存在的具有对应关系的时间步和网络结构;和/或,按照预设概率对所述种群中个体内的时间步和/或网络结构进行修改。
在一种可能的实施方式下,所述性能表征数据是根据参考图像以及由基于所述搜索结果构建的模型所生成的第一生成图像所确定。
在一种可能的实施方式下,所述扩散模型是依据训练图像所构建的;所述参考图像包括所述训练图像;和/或,所述参考图像包括由所述扩散模型生成的第二生成图像。
基于上述模型确定装置400的相关内容可知,对于本公开实施例提供的模型确定装置400来说,先依据预先构建的扩散模型,构建搜索空间,以使该搜索空间用于提供至少一个候选时间步序列,而且该候选时间步序列包括该扩散模型对应的参考时间步序列中的至少一个时间步;再依据预设步数约束(比如,10个时间步这一约束)以及预设性能条件(比如,图像生成性能达到预设阈值,或者图像生成性能达到最好等),对该搜索空间进行搜索,得到搜索结果,以使基于该搜索结果构建的模型的性能表征数据满足该预设性能条件,并且使得该搜索结果中目标时间步序列满足该预设步数约束,此时因该预设步数约束所限定的步数小于该参考时间步序列的时间步个数,以使该搜索结果中目标时间步序列的步数小于该参考时间步序列的时间步个数,从而使得基于该搜索结果构建的模型中时间步个数小于该扩散模型中时间步个数;然后,利用基于该搜索结果构建的模型,确定图像生成模型,以使该图像生成模型中时间步个数小于该扩散模型中时间步个数,并且使得该图像生成模型的图像生成性能几乎接近于该扩散模型的图像生成性能,如此能够实现在尽可能确保图像生成性能的前提下针对扩散模型进行压缩处理,从而使得压缩后的模型(也就是,图像生成模型)能够以较快的速度生成图像数据,进而能够有效地降低图像生成时耗。
基于本公开实施例提供的图像生成方法,本公开实施例还提供了一种图像生成装置,下面结合图5进行解释和说明。其中,图5为本公开实施例提供的一种图像生成装置的结构示意图。需要说明的是,本公开实施例提供的图像生成装置的技术详情,请参照上文图像生成方法的相关内容。
如图5所示,本公开实施例提供的图像生成装置500,包括:
获取单元501,用于获取噪声数据;
生成单元502,用于利用图像生成模型对所述噪声数据进行图像生成处理,得到第三生成图像;所述图像生成模型是利用权利要求1-7任一项所述的模型确定方法所确定的。
基于上述图像生成装置500的相关内容可知,对于本公开实施例提供的图像生成装置500来说,可以利用预先确定的图像生成模型针对任意一个噪声数据进行图像生成处理,以得到该噪声数据对应的生成图像。其中,因该图像生成模型的图像生成耗时比较低而且该图像生成模型的图像生成性能比较好,以使该图像生成模型能够以较快地速度生成质量比较高的图像数据,如此有利于实现在确保图像生成质量的前提下降低图像生成时耗。
另外,本公开实施例还提供了一种电子设备,所述设备包括处理器以及存储器:所述存储器,用于存储指令或计算机程序;所述处理器,用于执行所述存储器中的所述指令或计算机程序,以使得所述电子设备执行本公开实施例提供的模型确定方法的任一实施方式或者执行本公开实施例提供的图像生成方法的任一实施方式。
参见图6,其示出了适于用来实现本公开实施例的电子设备600的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图6示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600可以包括处理装置(例如中央处理器、图形处理器等)601,其可以根据存储在只读存储器(ROM)602中的程序或者从存储装置608加载到随机访问存储器(RAM)603中的程序而执行各种适当的动作和处理。在RAM603中,还存储有电子设备600操作所需的各种程序和数据。处理装置601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。
通常,以下装置可以连接至I/O接口605:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置606;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置607;包括例如磁带、硬 盘等的存储装置608;以及通信装置609。通信装置609可以允许电子设备600与其他设备进行无线或有线通信以交换数据。虽然图6示出了具有各种装置的电子设备600,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置609从网络上被下载和安装,或者从存储装置608被安装,或者从ROM602被安装。在该计算机程序被处理装置601执行时,执行本公开实施例的方法中限定的上述功能。
本公开实施例提供的电子设备与上述实施例提供的方法属于同一发明构思,未在本实施例中详尽描述的技术细节可参见上述实施例,并且本实施例与上述实施例具有相同的有益效果。
本公开实施例还提供了一种计算机可读介质,所述计算机可读介质中存储有指令或计算机程序,当所述指令或计算机程序在设备上运行时,使得所述设备执行本公开实施例提供的模型确定方法的任一实施方式或者执行本公开实施例提供的图像生成方法的任一实施方式。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但 不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(Hyper Text Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备可以执行上述方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以 以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元/模块的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
需要说明的是,本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的系统或装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
应当理解,在本公开中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中 的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。
还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本公开。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (12)

  1. 一种模型确定方法,包括:
    依据预先构建的扩散模型,构建搜索空间,其中,所述搜索空间用于提供至少一个候选时间步序列,所述候选时间步序列包括所述扩散模型对应的参考时间步序列中的至少一个时间步;
    依据预设步数约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,其中,所述搜索结果包括目标时间步序列,所述目标时间步序列满足所述预设步数约束,基于所述搜索结果构建的模型的性能表征数据满足所述预设性能条件,所述预设步数约束所限定的步数小于所述参考时间步序列的时间步个数;以及
    利用所述基于所述搜索结果构建的模型,确定图像生成模型。
  2. 根据权利要求1所述的方法,其中,所述搜索空间还用于提供所述参考时间步序列中每个时间步对应的至少一个候选网络结构,其中,所述候选网络结构包括所述扩散模型内去噪神经网络中至少一个网络层的至少一个特征通道;
    所述依据预设步数约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,包括:
    依据所述预设步数约束、预设结构约束以及所述预设性能条件,对所述搜索空间进行搜索,得到所述搜索结果,其中,所述搜索结果还包括所述目标时间步序列中各时间步对应的目标网络结构,所述目标网络结构满足所述预设结构约束。
  3. 根据权利要求1所述的方法,其中,所述搜索结果的确定过程,包括:
    从所述搜索空间中随机采样若干个体,其中,所述个体包括采样时间步序列,所述采样时间步序列满足所述预设步数约束;
    依据所述若干个体,初始化种群;
    依据所述种群中每个个体的适应度,确定所述种群对应的个体排序结果;所述个体的适应度是根据基于所述个体构建的模型的性能表征数据所确定的;
    依据所述个体排序结果,对所述种群进行进化处理,并继续执行所述依 据所述种群中每个个体的适应度,确定所述种群对应的个体排序结果的步骤,直至在达到搜索停止条件时,依据所述预设性能条件,从所述种群中确定所述搜索结果。
  4. 根据权利要求3所述的方法,其中,所述进化处理,包括:
    依据所述个体排序结果,从所述种群中删除满足预设删除条件的个体;
    将所述种群中至少一对个体内的时间步进行随机交换处理,和/或,按照预设概率对所述种群中个体内的时间步进行修改。
  5. 根据权利要求4所述的方法,其中,所述搜索空间还用于提供所述参考时间步序列中每个时间步对应的至少一个候选网络结构;
    所述个体还包括所述采样时间步序列中各时间步对应的采样网络结构,所述采样网络结构满足所述预设结构约束;
    所述将所述种群中至少一对个体内的时间步进行随机交换处理,包括:
    将所述种群中所述至少一对个体内的信息组合进行随机交换处理,其中,所述信息组合包括所述个体内存在的具有对应关系的时间步和网络结构;
    所述按照预设概率对所述种群中个体内的时间步进行修改,包括:
    按照所述预设概率对所述种群中个体内的时间步和/或网络结构进行修改。
  6. 根据权利要求1所述的方法,其中,所述性能表征数据是根据参考图像以及由所述基于所述搜索结果构建的模型所生成的第一生成图像所确定。
  7. 根据权利要求6所述的方法,其中,所述扩散模型是依据训练图像所构建的;所述参考图像包括所述训练图像;
    和/或,
    所述参考图像包括由所述扩散模型生成的第二生成图像。
  8. 一种图像生成方法,其中,所述方法包括:
    获取噪声数据;以及
    利用图像生成模型对所述噪声数据进行图像生成处理,得到第三生成图像;所述图像生成模型是利用权利要求1-7中任一项所述的模型确定方法所确定的。
  9. 一种模型确定装置,包括:
    构建单元,配置为依据预先构建的扩散模型,构建搜索空间,所述搜索 空间用于提供至少一个候选时间步序列,所述候选时间步序列包括所述扩散模型对应的参考时间步序列中的至少一个时间步;
    搜索单元,配置为依据预设步数约束以及预设性能条件,对所述搜索空间进行搜索,得到搜索结果,其中,所述搜索结果包括目标时间步序列,所述目标时间步序列满足所述预设步数约束,基于所述搜索结果构建的模型的性能表征数据满足所述预设性能条件,所述预设步数约束所限定的步数小于所述参考时间步序列的时间步个数;以及
    确定单元,配置为利用所述基于所述搜索结果构建的模型,确定图像生成模型。
  10. 一种图像生成装置,包括:
    获取单元,配置为获取噪声数据;以及
    生成单元,配置为利用图像生成模型对所述噪声数据进行图像生成处理,得到第三生成图像;所述图像生成模型是利用权利要求1-7中任一项所述的模型确定方法所确定的。
  11. 一种电子设备,包括:处理器和存储器;
    所述存储器,用于存储指令或计算机程序;
    所述处理器,用于执行所述存储器中的所述指令或所述计算机程序,以使得所述电子设备执行权利要求1-8中任一项所述的方法。
  12. 一种计算机可读介质,其中,所述计算机可读介质中存储有指令或计算机程序,当所述指令或所述计算机程序在设备上运行时,使得所述设备执行权利要求1-8中任一项所述的方法。
PCT/CN2024/097705 2023-06-29 2024-06-06 模型确定方法、图像生成方法、装置、设备、介质 Ceased WO2025001797A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310786950.0 2023-06-29
CN202310786950.0A CN119228922A (zh) 2023-06-29 2023-06-29 一种模型确定方法、图像生成方法、装置、设备、介质

Publications (1)

Publication Number Publication Date
WO2025001797A1 true WO2025001797A1 (zh) 2025-01-02

Family

ID=93937507

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/097705 Ceased WO2025001797A1 (zh) 2023-06-29 2024-06-06 模型确定方法、图像生成方法、装置、设备、介质

Country Status (2)

Country Link
CN (1) CN119228922A (zh)
WO (1) WO2025001797A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115935817A (zh) * 2022-12-05 2023-04-07 浙江工业大学 一种基于扩散模型的快速模型生成方法
US20230154069A1 (en) * 2021-11-12 2023-05-18 Korea Advanced Institute Of Science And Technology Magnetic Resource Imaging Method Using Score-based Diffusion Model And Apparatus thereof
CN116258651A (zh) * 2023-02-28 2023-06-13 华为技术有限公司 一种图像处理方法及相关装置
CN116309890A (zh) * 2023-01-17 2023-06-23 北京达佳互联信息技术有限公司 模型生成方法、风格化图像生成方法、装置及电子设备
CN116309135A (zh) * 2023-02-16 2023-06-23 阿里巴巴达摩院(杭州)科技有限公司 扩散模型处理方法及装置、图片处理方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230154069A1 (en) * 2021-11-12 2023-05-18 Korea Advanced Institute Of Science And Technology Magnetic Resource Imaging Method Using Score-based Diffusion Model And Apparatus thereof
CN115935817A (zh) * 2022-12-05 2023-04-07 浙江工业大学 一种基于扩散模型的快速模型生成方法
CN116309890A (zh) * 2023-01-17 2023-06-23 北京达佳互联信息技术有限公司 模型生成方法、风格化图像生成方法、装置及电子设备
CN116309135A (zh) * 2023-02-16 2023-06-23 阿里巴巴达摩院(杭州)科技有限公司 扩散模型处理方法及装置、图片处理方法及装置
CN116258651A (zh) * 2023-02-28 2023-06-13 华为技术有限公司 一种图像处理方法及相关装置

Also Published As

Publication number Publication date
CN119228922A (zh) 2024-12-31

Similar Documents

Publication Publication Date Title
CN114187177B (zh) 特效视频的生成方法、装置、设备及存储介质
CN114494709B (zh) 特征提取模型的生成方法、图像特征提取方法和装置
CN113240108B (zh) 模型训练方法、装置和电子设备
CN118053123B (zh) 报警信息生成方法、装置、电子设备与计算机介质
WO2023000782A1 (zh) 获取视频热点的方法、装置、可读介质和电子设备
CN115221957A (zh) 数据处理方法、数据处理装置、介质及电子设备
CN112418233B (zh) 图像处理方法、装置、可读介质及电子设备
CN113780534B (zh) 网络模型的压缩方法、图像生成方法、装置、设备及介质
CN111666449B (zh) 视频检索方法、装置、电子设备和计算机可读介质
CN111933122B (zh) 语音识别方法、装置、电子设备和计算机可读介质
CN111915689B (zh) 用于生成目标函数的方法、装置、电子设备和计算机可读介质
CN111626044B (zh) 文本生成方法、装置、电子设备及计算机可读存储介质
WO2025001797A1 (zh) 模型确定方法、图像生成方法、装置、设备、介质
WO2025055658A1 (zh) 图像生成方法、装置、系统、电子设备、计算机可读介质
CN116628049B (zh) 一种基于大数据的信息系统维护管理系统及方法
WO2025067187A1 (zh) 文件下载方法、装置、电子设备以及存储介质
CN116340364A (zh) 一种数据的处理方法、装置、设备及存储介质
CN118193182A (zh) 神经网络搜索方法、图像处理方法、装置、设备、介质
CN112149542A (zh) 训练样本生成方法、图像分类方法、装置、设备和介质
CN111932323B (zh) 物品信息界面显示方法、装置、设备和计算机可读介质
WO2025007739A1 (zh) 一种数据处理方法、装置、电子设备、计算机可读介质
CN118521849A (zh) 一种图像生成方法、模型训练方法、装置、设备、介质
WO2024183592A1 (zh) 一种图像处理方法、装置、电子设备及存储介质
CN107730055A (zh) 符号网络链接预测方法及终端设备
WO2025001765A1 (zh) 模型构建方法、图像生成方法、装置、设备、介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24830443

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE