Apparatus and method for data processing
By injecting layout information into the diffusion model, it solves the problem that the text-to-image model cannot adjust the spatial information of image objects, improves the generation accuracy of the layout-to-image model, and achieves high-quality image generation with low data volume.
Patent Information
- Application Number
- CN202310325781.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-29
- Publication Date
- 2024-10-01
AI Technical Summary
The existing text-to-image model cannot adjust the spatial information of objects in the image. Although the layout-to-image model considers spatial information, the accuracy of the generated image is not high and the accuracy rate is low.
On the basis of the diffusion model, layout information is injected for spatial modulation to generate a trained data generation model. Layout information is injected through the reverse process to more accurately control the spatial information of the object and improve the accuracy of the generated image.
By injecting layout information into the diffusion model, the spatial information of the object can be more accurately controlled, the layout-to-image generation model can be improved, and the accuracy of data generation can be improved, especially in the case of low data volume, high-quality and diverse images can still be generated.
Smart Images

Figure CN118734987A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure generally relate to the field of computers, and more particularly, to an apparatus, a method, a computer-readable storage medium, and a computer program product for data processing. Background Art
[0002] With the development of technology, artificial intelligence (AI) can be used to generate models for various application fields. For example, there are already a large number of text-to-image models that can generate corresponding images based on given text. However, text-to-image models cannot adjust the spatial information of objects in the image.
[0003] In order to consider spatial information, a layout-to-image (L2I) model has been proposed to generate a corresponding image based on given layout information. Although the current layout-to-image model can consider the spatial information of the object, the resulting image is not accurate and there is still a problem of low generation accuracy. Summary of the invention
[0004] According to an exemplary embodiment of the present disclosure, a device and method for data processing are provided, which can generate data more accurately, for example, an image can be generated based on a layout.
[0005] In a first aspect of the present disclosure, a device for data processing is provided, comprising: at least one processor; and at least one memory, wherein the at least one memory stores computer instructions, and when the instructions are executed by the at least one processor, the device: obtains a trained data generation model, wherein the trained data generation model is generated by injecting layout information for spatial modulation based on a diffusion model; and inputs layout data into the trained data generation model to obtain generated data corresponding to the layout data.
[0006] In a second aspect of the present disclosure, a method for data processing is provided, comprising: obtaining a trained data generation model, wherein the trained data generation model is generated by injecting layout information for spatial modulation based on a diffusion model; and inputting layout data into the trained data generation model to obtain generated data corresponding to the layout data.
[0007] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, which has machine-executable instructions stored thereon, and when the machine-executable instructions are executed by a device, the device causes the device to: obtain a trained data generation model, wherein the trained data generation model is generated by injecting layout information for spatial modulation based on a diffusion model; and input layout data into the trained data generation model to obtain generated data corresponding to the layout data.
[0008] According to a fourth aspect of the present disclosure, a computer program product is provided, comprising computer executable instructions, wherein the computer executable instructions implement the method described according to the second aspect of the present disclosure when executed by a processor.
[0009] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processing circuit or a processing circuit device configured to execute the method described according to the second aspect of the present disclosure.
[0010] The invention summary is provided to introduce a series of concepts in a simplified form, which will be further described in the specific embodiments below. The invention summary is not intended to identify the key features or essential features of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easy to understand through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0012] Figure 1 A block diagram illustrating an example environment according to an embodiment of the present disclosure is shown;
[0013] Figure 2 A schematic flow chart of an example training process according to some embodiments of the present disclosure is shown;
[0014] Figure 3 A schematic diagram showing a plurality of noise samples according to some embodiments of the present disclosure;
[0015] Figure 4 A schematic diagram showing injection layout information according to some embodiments of the present disclosure is shown;
[0016] Figure 5 A schematic diagram showing a process of determining weight parameters and bias parameters according to some embodiments of the present disclosure is shown;
[0017] Figure 6 A schematic flow chart showing an example usage process according to some embodiments of the present disclosure;
[0018] Figure 7 A schematic diagram showing generation of data according to some embodiments of the present disclosure; and
[0019] Figure 8 A block diagram of an example device that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0021] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0022] The various methods and processes described in the embodiments of the present disclosure may be applied to various electronic devices, such as terminal devices, network devices, etc. The embodiments of the present disclosure may also be performed in test devices, such as signal generators, signal analyzers, spectrum analyzers, network analyzers, test terminal devices, test network devices, channel emulators, etc.
[0023] In the description of the embodiments of the present disclosure, the term "circuit" may refer to a combination of hardware circuits and / or hardware circuits and software. For example, a circuit may be a combination of analog and / or digital hardware circuits and software / firmware. As another example, a circuit may be any part of a hardware processor with software, including (multiple) digital signal processors, software, and (multiple) memories, which work together to enable devices such as computing devices to work to perform various functions. In another example, a circuit may be a hardware circuit and / or a processor, such as a microprocessor or a part of a microprocessor, which requires software / firmware to operate, but the software may not exist when the software is not required to operate. As used herein, the term "circuit" also encompasses the implementation of only a hardware circuit or (multiple) processors or a part of a hardware circuit or (multiple) processors and its (or their) accompanying software and / or firmware.
[0024] The text-to-image model can synthesize high-quality and diverse images from given text, but the text-to-image model cannot adjust the corresponding spatial information in the synthesized image, such as the position and size of the object in the image.
[0025] In comparison, layout-to-image models can take into account spatial information and achieve good fidelity and diversity, so they have been widely studied and applied. For example, models based on Generative Adversarial Network (GAN) use an additional box-to-mask generation network to convert bounding boxes into masks, and then obtain synthetic images based on masks. For example, Transformer with FocalAttention (TwFA) can be used for complex scene generation to model image synthesis. TwFA uses a focused attention mechanism to inject layout information into the transformer via autoregressive sampling, thereby enabling L2I generation. For example, Latent Diffusion Model (LDM) can use query-key-value (QKV) cross-attention to inject layout information into the diffusion model to ensure that the synthesized image has good fidelity.
[0026] However, the GAN-based model increases the complexity and number of parameters of the model due to the use of an additional box-to-mask generation network, resulting in low generation efficiency. TwFA is generated for transformers, and the quality and fidelity of the generated images are low. Although LDM has good fidelity, it cannot accurately reflect the layout in the generated images.
[0027] In order to solve one or more of the above problems and / or other potential problems, an embodiment of the present disclosure provides a scheme for data processing to obtain generated data (e.g., an image) based on layout data. In this scheme, a trained data generation model can be generated by injecting layout information for spatial modulation based on a diffusion model, which can more accurately control the spatial information of an object. Therefore, generation models such as layout to image can be improved, thereby improving the accuracy of data generation.
[0028] Figure 1 1 is a block diagram of an example environment 100 according to an embodiment of the present disclosure. It should be understood that Figure 1 The environment 100 shown is only an example in which the embodiments of the present disclosure may be implemented, and is not intended to limit the scope of the present disclosure. The embodiments of the present disclosure are also applicable to other systems or architectures.
[0029] like Figure 1As shown, the environment 100 may include a computing device 110. The computing device 110 may be any device with computing capabilities. The computing device 110 may include, but is not limited to, a personal computer, a server computer, a handheld or laptop device, a mobile device (such as a mobile phone, a personal digital assistant PDA, a media player, etc.), a wearable device, a consumer electronic product, a minicomputer, a mainframe computer, a distributed computing system, a cloud computing resource, etc. It should be understood that based on considerations such as cost, the computing device 110 may or may not have sufficient computing resources for model training.
[0030] The computing device 110 may be configured to obtain the layout data 120 and output the generated data 140 corresponding to the layout data 120. The determination regarding the generated data 140 may be implemented by the trained data generation model 130.
[0031] The layout data 120 may be input by a user, or may be obtained from a storage device, which is not limited in the present disclosure. The layout data 120 may be determined based on actual needs, and the layout data 120 and the generated data 140 may have the same type. For example, the layout data 120 may specify one or more of the category, size, position, etc. of at least one target object.
[0032] The layout data 120 and the corresponding generated data 140 may be of various types, which are not limited by the present disclosure. Exemplarily, these types may include: audio data, electrocardiogram (ECG) data, electroencephalogram (EEG) data, image data, video data, point cloud data, or volume (volume or volumetric) data. Optionally, the volume data may be, for example, computer tomography (CT) data or optical coherence tomography (OCT) data.
[0033] As another understanding, the layout data 120 and the corresponding generated data 140 can be 1-dimensional data, such as bioelectric signals such as audio, ECG data, or EEG data. The layout data 120 and the corresponding generated data 140 can be 2-dimensional data, such as images. The layout data 120 and the corresponding generated data 140 can be 2.5-dimensional data, such as videos. The layout data 120 and the corresponding generated data 140 can be 3-dimensional data, such as videos, volume data such as CT, OCT data, etc. It can be understood that the description of the types in this disclosure is only for illustration. In actual scenarios, it can also be other types, and this disclosure is not limited to this.
[0034] For ease of description, the type is an image as an example for explanation. In some examples, the generated data 140 is an image, which can also be referred to as a generated image, a synthetic image, or other names. The layout data 120 can represent information such as the category, size, and position of at least one target object. For example, at least one target object is a pedestrian, an animal, a vehicle, etc. For example, the categories are women, children, cats, fire trucks, etc. For example, the size and / or position can be a bounding box, such as represented by the coordinate positions of the two diagonal vertices of the bounding box. It should be understood that the scenes listed here are for illustrative purposes only and are not intended to limit the scope of the present invention in any way. The embodiments of the present disclosure can be applied to various fields where similar problems exist, which are not listed here one by one.
[0035] In some embodiments, before implementing the above process, the data generation model 130 may be trained. It should be understood that the data generation model 130 may be trained by the computing device 110 or by any other suitable device outside the computing device 110. The trained data generation model 130 may be deployed in the computing device 110 or may be deployed outside the computing device 110. Figure 2 The example training process is described by taking the computing device 110 training the data generation model 130 as an example.
[0036] Figure 2 2 shows a flow chart of an example training process 200 according to an embodiment of the present disclosure. For example, the method 200 may be performed as follows: Figure 1 The method 200 is performed by the computing device 110 shown. It should be understood that the method 200 may also include additional blocks not shown and / or some of the blocks shown may be omitted. The scope of the present disclosure is not limited in this respect.
[0037] In block 210, a pre-trained diffusion model is obtained, the diffusion model including a forward process and a reverse process. In block 220, training is performed based on the diffusion model using data items in the data set to generate a trained data generation model.
[0038] In some example embodiments, the pre-trained diffusion model may be a diffusion model that has been generated in other training tasks, for example, it may be generated by pre-training for a text-to-image training task. In this way, the existing model can be fully utilized, the training time for the data generation model can be shortened, and the training efficiency can be improved.
[0039] The data set may be a training data set for training, which includes a plurality of data items. Each data item includes a layout sample and a corresponding image sample. In other words, the plurality of data items may be understood as a plurality of data sample pairs, each data sample pair including a layout sample and a corresponding image sample. Optionally, the layout sample and the image sample have the same size, for example, the image width is W and the height is H.
[0040] It can be understood that the diffusion model includes a forward process and a reverse process. During the training process, based on the image sample, a noise sample corresponding to the image sample can be obtained through the forward process. Based on the noise sample, a reverse image sample can be obtained through the reverse process, and the training goal is to expect the restored reverse image sample to be as consistent as possible with the image sample.
[0041] In some embodiments, during the training process, a trained data generation model can be generated by injecting layout information for spatial modulation based on a pre-trained diffusion model. Specifically, based on the image samples in the data item, a noise sample corresponding to the image sample can be obtained through a forward process; in the reverse process, the layout sample in the data item is injected into the noise sample to obtain a reverse image sample; and the trained data generation model is generated through training based on a loss function, wherein the loss function is constructed based on the image sample and the reverse image sample.
[0042] Assume that the forward process and the reverse process respectively perform a plurality of steps, for example, T steps, where T is a positive integer. In the forward process, noise samples can be obtained by gradually adding noise based on the image samples, for example, the noise samples after T steps can be pure noise.
[0043] For example, the image sample can be represented as x0, and the noise can be gradually added to each step in the forward process to obtain x t (t=1,2,…,T), where x T represents the noise sample (i.e. pure noise) after T steps. The forward process can also be called the forward noise process, etc., denoted as q, and the forward process can be represented by the following equations (1) and (2).
[0044]
[0045]
[0046] In formulas (1) and (2), represents the noise function (e.g. Gaussian distribution), β t represents the amplitude of the noise applied in step t, for example, the amount of noise added step by step, which is a known quantity set in advance and satisfies 0<β1<β2<…<β t <1, I represents the unit tensor.
[0047] The reverse process can also be called a reverse denoising process, etc., and can be expressed as: The reverse process can be expressed by the following formula (3).
[0048]
[0049] In formula (3), θ represents the hyperparameter in the reverse process, μ θ () and ∑ θ () are predetermined functions for the inverse denoising process, such as the mean and variance functions on the noise level, respectively.
[0050] In an embodiment of the present disclosure, in each step of the reverse process: weight parameters and bias parameters can be determined based on the layout samples and the intermediate noise samples obtained in the previous step of the reverse process; and the intermediate noise samples obtained in the previous step are spatially modulated using the weight parameters and bias parameters to obtain intermediate noise samples for the next step of the reverse process.
[0051] For the first step of the reverse process (i.e., t=T), the weight parameters and bias parameters can be determined based on the layout samples and the noise samples (i.e., pure noise) obtained in the Tth step of the forward process; and the noise samples are spatially modulated using the weight parameters and bias parameters to obtain intermediate noise samples for the next step of the reverse process. For the last step of the reverse process (i.e., t=1), the weight parameters and bias parameters can be determined based on the layout samples and the intermediate noise samples obtained in the previous step of the reverse process; and the intermediate noise samples obtained in the previous step are spatially modulated using the weight parameters and bias parameters to obtain reverse image samples.
[0052] For any step (t-th step) of the reverse process, the weight parameter and bias parameter for the step can be obtained. Exemplarily, a first feature vector corresponding to the intermediate noise sample obtained in the previous step (for the t=T-th step, it is a noise sample) can be generated by a first encoder; a second feature vector corresponding to the layout sample can be generated by a second encoder; the first feature vector and the second feature vector are fused to obtain a fused feature vector; and based on the fused feature vector, a weight parameter and a bias parameter are obtained, wherein the weight parameter represents a scaling factor and the bias parameter represents an offset factor.
[0053] In some examples, the intermediate noise samples obtained in the previous step (for the t=T step, the noise samples) can be scaled using the weight parameters to obtain scaled intermediate noise samples; and the scaled intermediate noise samples can be offset using the bias parameters to obtain intermediate noise samples for the next step of the reverse process (for the t=1 step, the reverse image samples).
[0054] Assuming that the layout sample indicates the location information and category information of m (m is a positive integer) target objects, the layout sample can be represented as l = {(b1, y1), ... (b m ,y m )}, where b i (i=1,…,m) represents the location information (such as bounding box) of the i-th target object, yi It is assumed that the reverse process (denoted as ε) in the embodiment of the present disclosure is defined as a denoising autoencoder (denoted as ∈ or ∈ θ ) sequence.
[0055] For any step in the reverse process, the input of this step can be expressed as The output can be expressed as
[0056] In some example embodiments of the present disclosure, the ∈ θ (z t+1 ,t) to obtain the intermediate noise sample, for example, represented as feature z t . Layout information (including bounding box information, etc.) can be injected through layout injection (for example, represented as ∈′) to obtain z′ t =∈′(z t ,l,t).
[0057] Exemplarily, information injection can be performed based on weight parameters and bias parameters. Optionally, in the intermediate noise sample (expressed as feature z t ) to calculate the corresponding weight parameters (e.g., denoted as γ t ) and the bias parameter (e.g., β t ).
[0058] Optionally, a weight parameter (e.g., denoted as γ t ) and the bias parameter (e.g., β t ) can be obtained by further considering the foreground feature attention operation. For example, the foreground area and background area of the layout sample can be determined, for example, the area where the position information of the target object is located is the foreground area, and the rest of the area is the background area. A mask matrix (for example, represented as M) can be determined based on the foreground area and background area of the layout sample, and the elements in the mask matrix are 0 and 1, where the elements in the mask matrix corresponding to the foreground area are 1, and the elements in the mask matrix corresponding to the background area are 0. Then the weight parameters and bias parameters can be updated by the following formula (4):
[0059] γ t =γ t ·M+(1-M),β t =β t ·M (4)
[0060] In this way, the weight parameters and bias parameters can be targeted at the foreground area represented by the layout sample, which can increase the attention to the layout information, thereby ensuring that the layout information is more accurately represented in the corresponding reverse image sample.
[0061] Furthermore, we can target the intermediate noise samples (expressed as feature z t ) performs a linear projection operation to obtain z′ t , which can be expressed as the following formula (5):
[0062] z′ t =γ t ·z t +β t (5)
[0063] It can be understood that γ in formula (5) t ·z t Indicates z t Scaling is performed, while +β t Indicates further offset.
[0064] In this way, the spatial information in the layout sample can be injected into the noise sample at each step of the reverse process, so that the image sample can be restored more advantageously. For example, the loss function in the training process can be expressed as the following formula (6):
[0065]
[0066] In formula (6), ||·|| represents a modulo operation.
[0067] Figure 3 FIG. 3 is a schematic diagram showing a noise sample 300 according to some embodiments of the present disclosure. Figure 3 As shown, for the audio signal 310, multiple noise samples 320-1, ..., 320-t, ..., 320-T can be generated by gradually adding noise, wherein the noise sample 320-T is pure noise. For example, the noise samples 320-1, ..., 320-t, ..., 320-T can be obtained in sequence by T steps of the forward process of the diffusion model.
[0068] Figure 4 FIG. 4 is a schematic diagram showing an injection layout information 400 according to some embodiments of the present disclosure. Figure 4 As shown, a noise sample 420 can be obtained based on an image sample 410 through a forward process of a diffusion model 450. In a reverse process, the image sample 410 is restored based on the noise sample 420 and by injecting a layout sample 430 at each step of the reverse process, wherein the layout sample 430 specifies layout information through a bounding box 432. Exemplarily, the image sample 410, the noise sample 420, and the layout sample 430 have the same size, such as the same width and height.
[0069] Figure 5FIG. 5 is a schematic diagram of a process 500 for determining weight parameters and bias parameters according to some embodiments of the present disclosure. Figure 5 As shown, the first encoder 510 can t The first feature vector of the embedding space is mapped to the first feature vector of the embedding space, and the second encoder 520 can map the layout sample l to the second feature vector of the embedding space. After the first and second feature vectors are fused 525, weighted projection 530 and bias projection 540, the weight parameters γ are obtained respectively. t and the bias parameter β t Further, based on the operation shown in equation (5), z′ can be obtained t Optionally, the first encoder 510 may be referred to as a latent encoder, and accordingly, the first feature vector may be referred to as a latent feature. Optionally, the second encoder 520 may be referred to as a layout encoder. The present disclosure is not limited thereto.
[0070] In this way, the embodiments of the present disclosure can impose spatial constraints on potential features by injecting layout information in each step of the reverse process of the diffusion model. Exemplarily, the injection process can be called diffusion layout injector (DLI).
[0071] In addition, the training process of the embodiments of the present disclosure can be implemented when there are limited data items in the data set. Specifically, for low data volume (low shot or low data), the model obtained by the solution of the embodiments of the present disclosure can still achieve high-quality and diversified image generation.
[0072] References Figures 2 to 5 The exemplary training process of the data generation model 130 is described. Through the trained data generation model 130, it is possible to more accurately obtain generated data, such as an image, based on the layout data. Figure 6 An exemplary use process of the model 130 is described.
[0073] Figure 6 600 according to an example use process of the present disclosure. For example, the method 600 may be performed by: Figure 1 The method 600 is performed by the computing device 110 shown. It should be understood that the method 600 may also include additional blocks not shown and / or some of the blocks shown may be omitted. The scope of the present disclosure is not limited in this respect.
[0074] At block 610, a trained data generation model is obtained, where the trained data generation model is generated by injecting layout information for spatial modulation based on the diffusion model. At block 620, the layout data is input into the trained data generation model to obtain generated data corresponding to the layout data.
[0075] It is understood that the trained data generation model can be obtained by Figures 2 to 5 The training process shown is obtained by training.
[0076] In an embodiment of the present disclosure, the layout data may be input by a user, or may be obtained from a storage device. The layout data may include at least one of the following items of at least one target object: category, size, and position. Exemplarily, information such as category, size, and position is layout information.
[0077] In some embodiments, at block 620, noise data obtained by noise sampling may be obtained, and the layout data and the noise data may be input into a trained data generation model, and the generated data may be obtained through a multi-step reverse process. For example, the data generation model is an L2I model, and the corresponding generated data is an image.
[0078] Optionally, Gaussian noise can be obtained by noise sampling as noise data, and it can be understood that the input of the trained data generation model includes layout data and noise data, and the output of the trained data generation model includes generated data (such as an image).
[0079] Specifically, in the intermediate step of the multi-step reverse process: based on the layout data and the intermediate noise data obtained in the previous step of the intermediate step, the weight parameter and the bias parameter corresponding to the intermediate step can be determined; and the intermediate noise data obtained in the previous step can be spatially modulated using the weight parameter and the bias parameter corresponding to the intermediate step to obtain the intermediate noise data for the next step of the intermediate step. Optionally, a first feature vector corresponding to the intermediate noise data obtained in the previous step can be generated by a first encoder; a second feature vector corresponding to the layout data can be generated by a second encoder; the first feature vector and the second feature vector are fused to obtain a fused feature vector; and based on the fused feature vector, a weight parameter and a bias parameter are obtained, wherein the weight parameter represents a scaling factor and the bias parameter represents an offset factor. Optionally, the weight parameter and the bias parameter have the same spatial dimension as the intermediate noise data obtained in the previous step. Optionally, the weight parameter and the bias parameter are for the foreground area represented by the layout data.
[0080] Exemplarily, the intermediate noise data obtained in the previous step may be scaled using a weight parameter to obtain scaled intermediate noise data; and the scaled intermediate noise data may be offset using a bias parameter to obtain intermediate noise data for the next step.
[0081] It is understandable that the process of generating data based on the layout data and the noise data in the use process 600 is similar to the reverse process in the aforementioned training process, and in order to avoid repetition, it will not be described again here.
[0082] Figure 7 FIG. 7 is a schematic diagram showing a method of generating data 700 according to some embodiments of the present disclosure. Figure 7 As shown, the input 710 of the model includes noise data and layout data. For example, the noise data may be Gaussian noise obtained by noise sampling. For example, the layout data includes the category information of the object represented by text and the location information of the object represented by a bounding box. Figure 7 The categories of the objects are represented by the texts "pothole", "polyp" and "chardonnay", which are pothole, polyp and chardonnay grapes respectively.
[0083] Input 710 is input into the trained data generation model, and output 720 can be obtained through the reverse process. In this process, layout information is injected into each step of the reverse process through DLI 750. For example, Figure 7 , the intermediate noises at t=981, t=801, t=601, t=401 and t=201 are shown, and the output 720 corresponds to t=1.
[0084] In this way, the embodiments of the present disclosure provide a data generation model that can be generated by injecting layout information for spatial modulation based on the diffusion model, which can more accurately control the spatial information of the object. Therefore, it is possible to improve generation models such as layout to image, thereby improving the accuracy of data generation.
[0085] In some embodiments, a computing device includes a circuit configured to perform the following operations: obtain a trained data generation model, where the trained data generation model is generated by injecting layout information for spatial modulation based on a diffusion model; and input layout data into the trained data generation model to obtain generated data corresponding to the layout data.
[0086] In some embodiments, a computing device includes a circuit configured to perform the following operations: obtain noise data obtained by noise sampling; and input layout data and noise data into a trained data generation model to obtain generated data through a multi-step reverse process.
[0087] In some embodiments, the computing device includes a circuit configured to perform the following operations: in an intermediate step in a multi-step reverse process: determining weight parameters and bias parameters corresponding to the intermediate step based on layout data and intermediate noise data obtained in a previous step of the intermediate step; and spatially modulating the intermediate noise data obtained in the previous step using the weight parameters and bias parameters corresponding to the intermediate step to obtain intermediate noise data for the next step of the intermediate step.
[0088] In some embodiments, the computing device includes a circuit configured to perform the following operations: generate a first feature vector corresponding to the intermediate noise data obtained in the previous step through a first encoder; generate a second feature vector corresponding to the layout data through a second encoder; fuse the first feature vector with the second feature vector to obtain a fused feature vector; and obtain a weight parameter and a bias parameter based on the fused feature vector, wherein the weight parameter represents a scaling factor and the bias parameter represents an offset factor.
[0089] In some embodiments, the weight parameters and bias parameters have the same spatial dimension as the intermediate noise data obtained in the previous step.
[0090] In some embodiments, the weight parameters and bias parameters are for a foreground region represented by the layout data.
[0091] In some embodiments, the computing device includes a circuit configured to perform the following operations: scaling the intermediate noise data obtained in the previous step using a weight parameter to obtain scaled intermediate noise data; and offsetting the scaled intermediate noise data using a bias parameter to obtain intermediate noise data for the next step.
[0092] In some embodiments, a computing device includes a circuit configured to perform the following operations: obtain a pre-trained diffusion model, the diffusion model including a forward process and a reverse process; and use data items in a data set to train based on the diffusion model to generate a trained data generation model.
[0093] In some embodiments, a computing device includes a circuit configured to perform the following operations: based on an image sample in a data item, obtaining a noise sample corresponding to the image sample through a forward process; in a reverse process, obtaining a reverse image sample by injecting a layout sample in the data item into the noise sample; and generating a trained data generation model through training based on a loss function, wherein the loss function is constructed based on the image sample and the reverse image sample.
[0094] In some embodiments, the diffusion model is generated by pre-training for a text-to-image training task.
[0095] In some embodiments, the generated data includes at least one of: audio data, electrocardiogram data, images, video data, computed tomography data, or optical coherence tomography data.
[0096] In some embodiments, the layout data includes at least one of the following information of the at least one target object: category, size, and position.
[0097] Figure 8 8 is a schematic block diagram of an example device 800 that can be used to implement an embodiment of the present disclosure. Figure 1 The computing device 110 shown can be implemented by a device 800. As shown, the device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 802 or loaded from a storage unit 808 to a random access memory (RAM) 803. In RAM 803, various programs and data required for the operation of the device 800 can also be stored. CPU 801, ROM 802 and RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0098] Multiple components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks. It should be understood that the present disclosure can use the output unit 807 to display real-time dynamic change information of user satisfaction, key factor identification information of group users or individual users of satisfaction, optimization strategy information, and strategy implementation effect evaluation information, etc.
[0099] The processing unit 801 may be implemented by one or more processing circuits. The processing unit 801 may be configured to perform the various processes and processes described above. For example, in some embodiments, the aforementioned processes may be implemented as computer software programs, which are tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the CPU 801, one or more steps in the process described above may be performed.
[0100] The present disclosure may be implemented as a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0101] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. The computer-readable storage medium used herein is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., light pulses through a fiber optic cable), or an electrical signal transmitted through wires.
[0102] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0103] The computer program instructions for performing the disclosed operation may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via 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., using an Internet service provider to connect via the Internet). In some embodiments, by utilizing the state information of computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of the present disclosure.
[0104] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0105] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0106] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0107] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0108] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A device for data processing, comprising: at least one processor; as well as at least one memory storing computer program instructions, which, when executed by the at least one processor, cause the apparatus to: Acquire a trained data generation model, where the trained data generation model is generated by injecting layout information for spatial modulation based on a diffusion model; as well as The layout data is input into the trained data generation model to obtain generated data corresponding to the layout data.
2. The device according to claim 1, wherein the computer program instructions, when executed by the at least one processor, further cause the device to obtain the generated data by: Acquiring noise data obtained by noise sampling; and The layout data and the noise data are input into the trained data generation model, and the generated data is obtained through a multi-step reverse process.
3. The device according to claim 2, wherein the computer program instructions, when executed by the at least one processor, further cause the device to obtain the generated data by: An intermediate step in the multi-step reverse process: Determining a weight parameter and a bias parameter corresponding to the intermediate step based on the layout data and the intermediate noise data obtained in a step before the intermediate step; and The intermediate noise data obtained in the previous step is spatially modulated using the weight parameter and the bias parameter corresponding to the intermediate step to obtain intermediate noise data for the next step of the intermediate step.
4. The apparatus of claim 3, wherein the computer program instructions, when executed by the at least one processor, cause the apparatus to determine the weight parameters and the bias parameters by: Generate a first feature vector corresponding to the intermediate noise data obtained in the previous step by a first encoder; generating, by a second encoder, a second feature vector corresponding to the layout data; Fusing the first feature vector with the second feature vector to obtain a fused feature vector; as well as Based on the fused feature vector, the weight parameter and the bias parameter are obtained, wherein the weight parameter represents a scaling factor, and the bias parameter represents an offset factor.
5. The apparatus according to claim 3, wherein the weight parameters and the bias parameters have the same spatial dimension as the intermediate noise data obtained in the previous step. The apparatus according to claim 3 , wherein the weight parameter and the bias parameter are for a foreground area represented by the layout data.
7. The apparatus of claim 3, wherein the computer program instructions, when executed by the at least one processor, cause the apparatus to obtain intermediate noise data for a next step of the multi-step reverse process by: Scaling the intermediate noise data obtained in the previous step using the weight parameter to obtain scaled intermediate noise data; and The scaled intermediate noise data is offset using the offset parameter to obtain intermediate noise data for the next step.
8. The apparatus of claim 1, wherein the computer program instructions, when executed by the at least one processor, further cause the apparatus to generate the trained data generation model by: Acquire the pre-trained diffusion model, wherein the diffusion model includes a forward process and a reverse process; and The trained data generation model is generated by performing training based on the diffusion model using the data items in the data set.
9. The apparatus of claim 8, wherein the computer program instructions, when executed by the at least one processor, cause the apparatus to generate the trained data generation model by: Based on the image samples in the data items, obtaining noise samples corresponding to the image samples through the forward process; In the reverse process, a reverse image sample is obtained by injecting the layout sample in the data item into the noise sample; as well as The trained data generation model is generated by training based on a loss function, wherein the loss function is constructed based on the image samples and the inverse image samples.
10. The apparatus according to claim 1, wherein the diffusion model is generated by pre-training for a text-to-image training task.
11. The apparatus of claim 1, wherein the generated data comprises at least one of: audio data, electrocardiogram data, images, video data, computed tomography data, or optical coherence tomography data. 12 . The apparatus according to claim 1 , wherein the layout data comprises at least one of the following information of at least one target object: category, size, and position.
13. A method for data processing, comprising: Acquire a trained data generation model, wherein the trained data generation model is generated by injecting layout information to perform spatial modulation based on a diffusion model; as well as The layout data is input into the trained data generation model to obtain generated data corresponding to the layout data.
14. An electronic device comprising a processing circuit configured to perform: Acquire a trained data generation model, wherein the trained data generation model is generated by injecting layout information to perform spatial modulation based on a diffusion model; and The layout data is input into the trained data generation model to obtain generated data corresponding to the layout data.
Citation Information
Patent Citations
Image restoration method and device, electronic equipment and storage medium
CN115239593A
Training and generating method of head portrait generation model with animation style and electronic equipment
CN115393181A
Systems and methods for image generation
US20200327662A1
Systems and methods for generating and using visual datasets for training computer vision models
US20220414928A1
