Image generation method and related equipment

By combining quantum variational autoencoders and quantum diffusion models, the problem of redundant information learning in existing image generation models is solved, and high-quality and diverse image generation is achieved.

CN120672892AActive Publication Date: 2025-09-19SHANGHAI JIAOTONG UNIV +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510820259.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-19
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

Existing image generation models are easily confused by redundant information during the image learning process, resulting in local distortion, missing details and lack of diversity in the generated images, which cannot meet high-quality requirements.

Method used

Using quantum variational autoencoders and quantum diffusion models, the quantum encoder neural network extracts high-level semantic features of the original image, and uses the quantum diffusion model to perform diffusion generation in the Hilbert space, combined with the quantum decoder neural network for reconstruction to generate high-quality and diverse images.

Benefits of technology

It effectively captures the global information of the image, makes the generated image more coherent and accurate, avoids distortion and loss of details, and improves the diversity and quality of image generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120672892A_ABST
    Figure CN120672892A_ABST
Patent Text Reader

Abstract

The invention discloses an image generation method and related equipment, and relates to the field of quantum computing. The original image data is converted into the quantum state, and the original quantum state information is obtained. Calling a quantum encoder neural network of a quantum variational auto-encoder, and performing feature extraction on the original quantum state information to obtain hidden space quantum state features; calling a quantum diffusion model, and processing the hidden space quantum state features input into the quantum diffusion model according to the probability distribution corresponding to the Hilbert space to obtain at least one piece of output hidden space quantum state extension information; a quantum decoder neural network of the quantum variational auto-encoder is called, each piece of hidden space quantum state expansion information is reconstructed, quantum state information corresponding to each piece of hidden space quantum state expansion information is obtained, the quantum state information is quantum state representation of the new image, the quantum state information is used for generating image data of the new image, and the new image is obtained. And the image quality and diversity of the generated image corresponding to the original image data are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of quantum computing and artificial intelligence technology, and in particular to an image generation method and related equipment. Background Art

[0002] An image generation model refers to a machine learning model that can learn the data distribution of input images and generate new images, such as autoregressive models, generative adversarial models, diffusion models, etc. The model can capture the patterns, features, and structures in the image by learning from a large amount of image data, thereby creating images that are similar to the training data but novel.

[0003] However, existing image generation models usually capture local features in the pixel space of the image. Because high-frequency details in the image (such as noise and texture) occupy a large amount of information in the pixel space, the extracted image features contain a large amount of redundant information, which makes the image generation model waste time on learning redundant information and fail to capture the effective information of the image. As a result, the generated images have problems such as local distortion, missing details, image duplication or lack of diversity. The quality of the generated images is low and cannot meet higher requirements. Summary of the Invention

[0004] In view of the above problems, this application provides an image generation method and related equipment to achieve the purpose of improving the quality of generated images. The specific solution is as follows:

[0005] The first aspect of the present application provides an image generation method, comprising:

[0006] Get original image data;

[0007] Converting the original image data into a quantum state to obtain original quantum state information;

[0008] Inputting the original quantum state information into a quantum variational autoencoder, causing the quantum encoder neural network of the quantum variational autoencoder to extract features of the original quantum state information to obtain latent space quantum state features;

[0009] Invoking a quantum diffusion model, processing the latent space quantum state characteristics input into the quantum diffusion model according to the probability distribution corresponding to the Hilbert space, and obtaining at least one latent space quantum state extension information as output;

[0010] The at least one latent space quantum state extension information is respectively input into the quantum variational autoencoder, so that the quantum decoder neural network of the quantum variational autoencoder reconstructs each of the latent space quantum state extension information respectively, and obtains the quantum state information corresponding to each of the latent space quantum state extension information. The quantum state information is the quantum state representation of the new image, so as to use the quantum state information to generate image data of the new image.

[0011] In one possible implementation, the process of training the quantum variational autoencoder includes:

[0012] Obtaining a plurality of quantum state information for training, recorded as quantum state training information;

[0013] Constructing an initial quantum variational autoencoder, wherein the initial quantum variational autoencoder includes: a quantum encoder neural network and a quantum decoder neural network;

[0014] Inputting the plurality of quantum state training information into the quantum encoder neural network for feature extraction, respectively, to obtain latent space quantum state feature output results corresponding to each of the quantum state training information;

[0015] Inputting each of the latent space quantum state feature output results into the quantum decoder neural network for reconstruction, thereby obtaining quantum state reconstruction information corresponding to each of the latent space quantum state feature output results;

[0016] Determine a quantum variational loss and a quantum reconstruction loss based on the latent space quantum state feature output result and the quantum state reconstruction information corresponding to each of the quantum state training information, wherein the quantum variational loss is used to characterize the difference between the latent space quantum state feature output result and the preset variational constrained quantum state, and the quantum reconstruction loss is used to characterize the difference between the quantum state training information and the corresponding quantum state reconstruction information;

[0017] When the quantum variational loss and the quantum reconstruction loss meet preset conditions, the initial quantum variational autoencoder of this training is determined as the quantum variational autoencoder;

[0018] When the quantum variational loss and the quantum reconstruction loss do not meet the preset conditions, the quantum parameters of the initial quantum variational autoencoder are updated according to the quantum variational loss and the quantum reconstruction loss to obtain an updated initial quantum variational autoencoder, and the steps of inputting the multiple quantum state training information into the quantum encoder neural network for feature extraction are performed to obtain the latent space quantum state feature output results corresponding to each quantum state training information, and subsequent steps until the quantum variational loss and the quantum reconstruction loss meet the preset conditions.

[0019] In one possible implementation, constructing an initial quantum variational autoencoder includes:

[0020] Constructing multiple quantum encoder layers and multiple quantum decoder layers, each of the quantum encoder layer and the quantum decoder layer includes: a quantum entanglement layer and a single quantum bit variable layer, and the quantum entanglement layer and the single quantum bit variable layer are in a convolution relationship;

[0021] Initializing the quantum parameters of each of the quantum encoder layers and the quantum parameters of each of the quantum decoder layers to obtain a plurality of initialized quantum encoder layers and a plurality of initialized quantum decoder layers;

[0022] generating a quantum encoder neural network and a quantum decoder neural network based on the multiple initialized quantum encoder layers, the multiple initialized quantum decoder layers, a first preset relationship between the quantum encoder layers, and a second preset relationship between the quantum decoder layers, wherein the first preset relationship is a product relationship between any two adjacent quantum encoder layers, and the second preset relationship is a product relationship between any two adjacent quantum decoder layers;

[0023] A quantum variational autoencoder is generated based on the quantum decoder neural network and the quantum encoder neural network.

[0024] In one possible implementation, the process of training the quantum diffusion model includes:

[0025] Obtaining latent space quantum state feature output results corresponding to multiple quantum state training information used for training;

[0026] Constructing an initial quantum diffusion model, the initial quantum diffusion model at least comprising: a quantum noise-adding neural network for implementing a diffusion process and a quantum noise-removing neural network for implementing a generation process;

[0027] Inputting the plurality of latent space quantum state feature output results into the initial quantum diffusion model for processing, respectively, to obtain denoised latent space quantum state information corresponding to each of the latent space quantum state feature output results;

[0028] Determining a loss function value of the initial quantum diffusion model based on the plurality of latent space quantum state feature output results and the denoised latent space quantum state information corresponding to each of the latent space quantum state feature output results;

[0029] When the loss function value does not meet the preset threshold, the model parameters of the initial quantum diffusion model are updated according to the multiple latent space quantum state feature outputs and the denoised latent space quantum state information corresponding to each latent space quantum state feature output, to obtain an updated initial quantum diffusion model, and the steps of inputting the multiple latent space quantum state feature output results into the initial quantum diffusion model for processing, obtaining the denoised latent space quantum state information corresponding to each latent space quantum state feature output result, and subsequent steps are performed until the loss function value meets the preset threshold;

[0030] When the loss function value does not meet the preset threshold, the initial quantum diffusion model of this training is determined as the quantum diffusion model.

[0031] In one possible implementation, the calling of the quantum diffusion model processes the latent space quantum state characteristics input to the quantum diffusion model according to the probability distribution corresponding to the Hilbert space to obtain output of at least one latent space quantum state extension information, including:

[0032] Inputting the latent space quantum state characteristics into a diffusion process of a quantum diffusion model, and in the diffusion process, gradually adding noise to the latent space quantum state characteristics according to the probability distribution of the Hilbert space to obtain at least one noisy latent space quantum state information;

[0033] The at least one noisy hidden space quantum state information is input into the generation process of the quantum diffusion model. During the generation process, each of the noisy hidden space quantum state information is denoised to obtain the hidden space quantum state extension information corresponding to each of the noisy hidden space quantum state information.

[0034] In one possible implementation, inputting the original quantum state information into a quantum variational autoencoder, causing the quantum encoder neural network of the quantum variational autoencoder to extract features of the original quantum state information to obtain latent space quantum state features, includes:

[0035] Inputting the original quantum state information into the quantum encoder neural network to obtain encoded quantum state information;

[0036] The quantum state information of a preset number of quantum bits is extracted from the quantum state information of the encoding transformation to obtain the quantum state characteristics of the hidden space.

[0037] In a possible implementation, converting the original image data into a quantum state to obtain original quantum state information includes:

[0038] The quantum register is called to convert the original image data into a quantum state, and the original quantum state information output by the quantum register is obtained.

[0039] A second aspect of the present application provides a computer program product comprising computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the image generation method of the first aspect or any implementation of the first aspect.

[0040] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0041] The memory is used to store computer programs;

[0042] The processor is configured to execute the computer program so that the electronic device can implement the image generation method of the first aspect or any implementation of the first aspect.

[0043] According to a fourth aspect of the present application, a computer storage medium is provided, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can generate an image according to the first aspect or any implementation method of the first aspect.

[0044] By means of the above technical solution, the image generation method provided by the present application utilizes the quantum encoder neural network of the quantum variational autoencoder to extract features from the original quantum state information converted from the original image data. Due to the superposition and entanglement characteristics of the quantum state information, the extracted latent space quantum state features can capture the high-level semantic features that characterize the global information of the image data compared to the pixel features of the pixel space of the prior art. Furthermore, the quantum diffusion model diffuses and generates at least one latent space quantum state extended information based on the latent space quantum state features. Since the diffusion of the quantum diffusion model focuses on the global structure and semantics represented by the latent space quantum state features, the quantum diffusion model can focus on learning the potential structure of the image data distribution, thereby making the latent space quantum state extended information obtained by diffusion more coherent and accurate, avoiding the problems of distortion and missing details of the generated new image. In addition, the Hilbert space where the latent space quantum state features are located has a larger probability distribution space than the classical probability distribution, which makes the data expansion dimension of the quantum diffusion model higher, thereby improving the diversity of the output latent space quantum state extended information.

[0045] Furthermore, the quantum decoder neural network of the quantum variational autoencoder is used to reconstruct the extended information of at least one latent space quantum state to obtain the quantum state representation of at least one new image. Based on this, high-quality and diverse images corresponding to the original image data can be generated. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.

[0047] Figure 1 A schematic diagram of a flow chart of an image generation method provided in an embodiment of the present application;

[0048] Figure 2 An optional system architecture diagram for implementing the image generation method provided in an embodiment of the present application;

[0049] Figure 3 Schematic diagram of the structure of the quantum diffusion model provided in the embodiment of the present application

[0050] Figure 4 A schematic diagram of the process of training a quantum variational autoencoder according to an embodiment of the present application;

[0051] Figure 5 A schematic diagram of the structure of the quantum variational autoencoder provided in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of the process of training a quantum diffusion model provided in an embodiment of the present application;

[0053] Figure 7 A schematic diagram of the structure of the shallow Clifford line provided in an embodiment of the present application;

[0054] Figure 8 A schematic diagram of the structure of a parameterized denoising quantum neural network provided in an embodiment of the present application;

[0055] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The following describes the embodiments of the present application in conjunction with the accompanying drawings. The terms used in the implementation methods of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application.

[0057] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0058] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0059] This application can be applied to quantum computing, artificial intelligence and other related technical fields. Taking image generation as an example, the following introduces multiple application scenarios of products.

[0060] First, an optional application scenario of the present application is introduced. Existing image generation models are usually trained using raw image data. Raw image data is usually pixel space data stored in the form of a two-dimensional or three-dimensional matrix, and each pixel independently records color information. This method results in extremely high dimensionality of image data, but the actual effective information ratio is low, and there is a lot of redundancy. On this basis, because traditional image generation models (such as GAN and VAE) rely on convolutional neural networks (CNN) to extract image features, but CNN uses local convolution kernel operations, it is difficult to capture the global structural information of the image from the pixel space data, and the extracted features contain a lot of redundant information. On this basis, the image generation model is forced to model data from all frequency bands, resulting in model resources being wasted on learning redundant information and failing to capture effective information of the image, resulting in the generated image having local optimality or local distortion, generating repeated or lacking in diversity new image samples, and the quality of the generated image is low, which cannot meet higher requirements.

[0061] In order to solve the above problems, the present invention provides an image generation method and related devices. The image generation method and related devices of the present invention are described in detail below with reference to the accompanying drawings.

[0062] Reference Figure 1 , Figure 1 A flow chart of an image generation method provided in an embodiment of the present application is shown as follows: Figure 1 As shown, an image generation method provided by an embodiment of the present application may include steps S110 to S150, and these steps are described in detail below.

[0063] It should be noted that the image generation method can be applied to, but is not limited to, applications with classical data processing functions and quantum computing functions or cloud services provided by cloud-side servers. Figure 2 , an embodiment of the present application provides an optional system architecture diagram for implementing an image generation method, the image generation method can be applied to the system, and the system may include: a quantum register, a quantum variational autoencoder and a quantum diffusion model, and the quantum register, quantum variational autoencoder and quantum diffusion model cooperate with each other to implement the image generation method.

[0064] Quantum registers are used to store and process quantum information. The quantum variational autoencoder is a hybrid quantum-classical model that combines quantum computing with classical machine learning. It aims to leverage the parallel computing capabilities of quantum computing and the optimization capabilities of classical deep learning to achieve efficient data compression, feature extraction, and data reconstruction. It includes at least a quantum encoder neural network and a quantum decoder neural network, respectively used to extract and reconstruct features of quantum state information. The quantum diffusion model aims to leverage quantum computing features such as superposition, entanglement, and quantum parallelism to accelerate or enhance the performance of the diffusion model. It includes at least a quantum denoising neural network and a quantum denoising neural network, which simulate the diffusion process of quantum state information from clarity to noise and learn its denoising process to generate new image samples with a distribution similar to the original image data.

[0065] Step S110: acquiring original image data.

[0066] Step S120 , converting the original image data into a quantum state to obtain original quantum state information.

[0067] In one optional scenario, a user will need to generate raw image data for a new image sample and input it into a system configured with an image generation method, which then uses the image generation method to generate a corresponding new image. The raw image data typically input by users is classical data, such as an RGB image, a pixel matrix, or a depth image. Therefore, the acquired raw image data in classical form must first be converted into a quantum state to obtain the original quantum state information.

[0068] Callable Figure 2 The quantum register in the quantum computer converts the original image data into a quantum state, obtaining the original quantum state information output by the quantum register. Alternatively, the original image data can be encoded into quantum state information using encoding methods such as amplitude encoding or phase encoding. Alternatively, a quantum random access memory (QRAM) can be used to efficiently load the original image data in classical form into the quantum state through quantum operations and auxiliary qubits, obtaining the original quantum state information.

[0069] Step S130: inputting the original quantum state information into the quantum variational autoencoder, so that the quantum encoder neural network of the quantum variational autoencoder extracts features from the original quantum state information to obtain latent space quantum state features.

[0070] After an image is input into the variational autoencoder, the encoder extracts the possible value ranges of potential features in the image, such as portraits, backgrounds, and colors, obtains the value probability distribution of each feature, and determines the feature vector X of the image. The decoder then reconstructs the original input image based on the feature vector X.

[0071] It can be understood that the quantum variational autoencoder used in the embodiment of the present application extracts features from the original quantum state information, and the quantum state information is represented by a vector in the Hilbert space, and the probability distribution space of the Hilbert space is larger than the classical probability distribution. On this basis, the classical feature information is extracted in the Hilbert space, and the resulting latent space quantum state features, compared to the image features extracted by the variational autoencoder of the classical probability distribution, can capture more complex feature relationships in the original image data, as well as richer feature representations, thereby extracting high-level semantic features of the original image data. Moreover, a larger probability distribution space can better adapt to noise and outliers in the data, thereby filtering out redundant information in the original image data, so that the generated latent space quantum state features can accurately represent the image features of the original image data, and enable the subsequent quantum diffusion model to focus more on learning the potential structure of the data distribution.

[0072] In one possible implementation, the original quantum state information is input into a quantum variational autoencoder, and the quantum encoder neural network of the quantum variational autoencoder performs feature extraction on the original quantum state information to obtain latent space quantum state characteristics, including: inputting the original quantum state information into the quantum encoder neural network to obtain encoded quantum state information; extracting quantum state information of a preset number of quantum bits from the encoded quantum state information to obtain latent space quantum state characteristics.

[0073] In the embodiment of the present application, the quantum encoder neural network first processes the original quantum state information to obtain encoded quantum state information, discards some quantum bits in the quantum state information obtained by the quantum encoder neural network, and uses the remaining quantum state information after discarding as the quantum state characteristics of the latent space, or extracts some quantum bits from the quantum state information as the quantum state characteristics of the latent space. Based on this, the effect of effectively compressing the quantum state space information is achieved.

[0074] Specifically, the process of discarding some quantum bits can refer to the following formula (1):

[0075] (1)

[0076] in, represents the deviation operation of the quantum variational autoencoder, A is the set of discarded quantum bits, and its size is , is the quantum state information processed by the quantum encoder neural network, It is the quantum state characteristic of the hidden space.

[0077] In the embodiments of this application, there are no specific requirements for discarding some qubits. This can be determined based on the amount of redundant qubits in the quantum state information generated by the previous quantum variational autoencoder. For example, discarding less than or equal to half of the total number of qubits is sufficient. It is understood that the more qubits discarded, the greater the redundancy in the quantum state information, indicating a larger compressibility space.

[0078] Step S140 , calling the quantum diffusion model, processing the latent space quantum state characteristics input to the quantum diffusion model according to the probability distribution corresponding to the Hilbert space, and obtaining at least one latent space quantum state extension information as output.

[0079] The quantum diffusion model is a method for modeling, learning, and sampling the probability of complex data through a reversible probability transformation process (diffusion and generation, or noise addition and denoising). The quantum diffusion model is implemented in Hilbert space, which has a larger probability distribution space than traditional diffusion models. For quantum diffusion models used to generate images, this larger probability distribution space means greater expressive power, greater flexibility, and the potential to capture and generate more complex and diverse real-world image distributions. For example, with a diffusion model under a classical probability distribution, a blurred patch in an image can only be reconstructed as a dog's nose. However, with the larger Hilbert space, a quantum diffusion model can reconstruct a blurred patch into a wider range of possible representations, such as a cat's nose or a bear's nose.

[0080] It is understandable that quantum diffusion models can leverage the properties of quantum computing (such as superposition, entanglement, and quantum parallelism) to overcome potential bottlenecks in computational efficiency, expressiveness, and sampling quality in classical diffusion models, particularly when processing high-dimensional data, complex distributions, or quantum data. Furthermore, quantum diffusion models utilize natural quantum noise processes for forward diffusion, rather than the Gaussian noise processes employed in classical diffusion models, resulting in a more natural approach to specific diversity.

[0081] Specifically, the quantum diffusion model is called, and the latent space quantum state characteristics input into the quantum diffusion model are processed according to the probability distribution corresponding to the Hilbert space to obtain at least one latent space quantum state extension information as output, including: inputting the latent space quantum state characteristics into the diffusion process of the quantum diffusion model, and during the diffusion process, gradually adding noise to the latent space quantum state characteristics according to the probability distribution of the Hilbert space to obtain at least one noisy latent space quantum state information; inputting at least one noisy latent space quantum state information into the generation process of the quantum diffusion model, and during the generation process, denoising each noisy latent space quantum state information respectively to obtain the latent space quantum state extension information corresponding to each noisy latent space quantum state information.

[0082] Reference Figure 3 , a schematic diagram of the structure of the quantum diffusion model provided in the embodiment of the present application. Among them, QNA U1, QNAU2, ..., QNA U t 、QNA U T , respectively used to characterize the quantum state of the latent space Perform the first step, the second step, ..., the tth step and the Tth step to add noise, and the quantum state characteristics of the latent space Input to QNA U1, and use QNA U1 to QNA U T The quantum state characteristics of the hidden space The process of gradually adding noise is the forward noise adding process or diffusion process of the quantum diffusion model.

[0083] The quantum diffusion model destroys the input latent space quantum state characteristics by gradually adding noise, so as to achieve the purpose of gradually disturbing the data distribution of the latent space quantum state characteristics, thereby obtaining at least one different latent space quantum state characteristic after noise addition. It can be understood that each time noise addition is performed, a new latent space quantum state characteristic can be obtained, that is, the noise latent space quantum state information. After T times / step noise addition, the latent space quantum state characteristic is obtained. .

[0084] In the noise addition process, the addition of noise at each step must satisfy the probabilistic rules rather than being added randomly. The probability distribution space of the Hilbert space is larger than the probability distribution space of classical data. Even if the intensity of the noise at each step is the same, more noise latent space quantum state information can be diffused in the Hilbert space, thereby improving the diversity of the new image finally generated.

[0085] Furthermore, multiple noisy latent space quantum state information generated by the diffusion process is input into the generation process of the quantum diffusion model, and each noisy latent space quantum state information is denoised to obtain the noise-free latent space quantum state extended information obtained by diffusion. Figure 3 ,QNS V1(θ p )、QNS V2(θp ),……,QNS Vt(θ p )、QNS V T (θ p ), which are used to denoise the quantum state information of the latent space in the first, second, ..., t-th and T-th steps respectively, and the quantum state information of the latent space to be denoised is converted into Input to QNS V1(θ p ), and using QNS V1(θ p ) to QNS V T (θ p ),right The process of achieving gradual denoising is the backward denoising process or generation process of the quantum diffusion model.

[0086] The quantum diffusion model uses the quantum state information of the hidden space to Step by step denoising, recovering quantum state information from noise. It can be understood that each time denoising is performed, a new latent space quantum state information can be obtained, that is, latent space quantum state extended information. After T times / step denoising, the latent space quantum state extended information is obtained. .

[0087] It is understandable that the denoising network of the present application, based on parameterized quantum circuits, utilizes the superposition and entanglement properties of quantum bits to more effectively learn and represent the complex conditional probability distribution of high-dimensional data after the introduction of noise during the diffusion process, thereby achieving more accurate noise estimation and removal than traditional denoising methods based on classical neural networks. Compared with the problems of gradient vanishing or insufficient expression power faced by denoising networks in classical diffusion models when processing features with long-range dependencies (such as the global structure of natural images), the quantum denoising module of the present invention utilizes the quantum entanglement mechanism to more naturally capture these long-range dependencies, thereby showing significant advantages in restoring global consistency and detail fidelity.

[0088] Moreover, the results of practical application of the technical solution of the present application show that, in a standard image denoising benchmark test, the quantum denoising process described in the present application has a significant decrease in the Fréchet Inception Distance (FID) index of the generated samples compared with the typical classical diffusion model while maintaining or reducing the number of model parameters, indicating that the closer the distribution of the image generated by the diffusion model of the present application is to the real image, the higher the generation quality.

[0089] Step S150: Input at least one latent space quantum state extension information into the quantum variational autoencoder, so that the quantum decoder neural network of the quantum variational autoencoder reconstructs each latent space quantum state extension information respectively, and obtains the quantum state information corresponding to each latent space quantum state extension information.

[0090] The quantum decoder neural network of the quantum variational autoencoder is used to reconstruct the extended quantum state information of at least one latent space generated by the quantum diffusion model to obtain the quantum state representation of the new image data that can correspond to the original image data, thereby achieving the purpose of generating a new image.

[0091] It's understandable that in a quantum computing system, the quantum state information obtained by the quantum decoder neural network is already capable of representing a new image. That is, the quantum state information can be used as new image data for subsequent applications. However, in a classical data processing system, the quantum state information still needs to be converted into image data in the form of classical data to facilitate its use within the classical data processing system.

[0092] In summary, the image generation method provided by the embodiment of the present application utilizes the quantum encoder neural network of the quantum variational autoencoder to extract features from the original quantum state information converted from the original image data. Due to the superposition and entanglement characteristics of the quantum state information, the extracted latent space quantum state features can capture the high-level semantic features of the global information representing the image data compared to the pixel features of the pixel space of the prior art. Furthermore, the quantum diffusion model diffuses and generates at least one latent space quantum state extended information based on the latent space quantum state features. Since the diffusion of the quantum diffusion model focuses on the global structure and semantics represented by the latent space quantum state features, the quantum diffusion model can focus on learning the potential structure of the image data distribution, thereby making the latent space quantum state extended information obtained by diffusion more coherent and accurate, avoiding the problems of distortion and missing details of the generated new image. In addition, the Hilbert space where the latent space quantum state features are located has a larger probability distribution space than the classical probability distribution, which makes the data expansion dimension of the quantum diffusion model higher, thereby improving the diversity of the output latent space quantum state extended information.

[0093] Furthermore, the quantum decoder neural network of the quantum variational autoencoder is used to reconstruct the extended information of at least one latent space quantum state to obtain the quantum state representation of at least one new image. Based on this, high-quality and diverse images corresponding to the original image data can be generated.

[0094] Next, other possible implementations of an image generation method provided in an embodiment of the present application are described in detail through the following embodiments.

[0095] In one possible implementation, the process of training a quantum variational autoencoder includes: obtaining multiple quantum state information for training, recorded as quantum state training information; constructing an initial quantum variational autoencoder, the initial quantum variational autoencoder including: a quantum encoder neural network and a quantum decoder neural network; inputting multiple quantum state training information into the quantum encoder neural network for feature extraction, and obtaining the latent space quantum state feature output results corresponding to each quantum state training information; inputting each latent space quantum state feature output result into the quantum decoder neural network for reconstruction, and obtaining the quantum state reconstruction information corresponding to each latent space quantum state feature output result; based on the latent space quantum state feature output results corresponding to each quantum state training information and the quantum state reconstruction information, determining the quantum variational loss and the quantum reconstruction loss, and the quantum variational loss is used to characterize the latent space quantum state. The difference between the sub-state feature output result and the preset variational constrained quantum state, the quantum reconstruction loss is used to characterize the difference between the quantum state training information and its corresponding quantum state reconstruction information; when the quantum variational loss and the quantum reconstruction loss meet the preset conditions, the initial quantum variational autoencoder of this training is determined as the quantum variational autoencoder; when the quantum variational loss and the quantum reconstruction loss do not meet the preset conditions, the quantum parameters of the initial quantum variational autoencoder are updated according to the quantum variational loss and the quantum reconstruction loss to obtain the updated initial quantum variational autoencoder, and the multiple quantum state training information are respectively input into the quantum encoder neural network for feature extraction to obtain the latent space quantum state feature output results corresponding to each quantum state training information and the subsequent steps until the quantum variational loss and the quantum reconstruction loss meet the preset conditions.

[0096] Reference Figure 4 , a flow chart of training a quantum variational autoencoder provided in an embodiment of the present application illustrates the process of training the quantum variational autoencoder.

[0097] Construct a quantum variational autoencoder. Figure 5 , a schematic diagram of the structure of a quantum variational autoencoder provided in an embodiment of the present application, wherein the quantum variational autoencoder comprises: a quantum encoder neural network ε(θ e ) and the quantum decoder neural network D(θ d ). ρ is the original quantum state information input to the quantum variational autoencoder, ρ latent is the latent space quantum state feature obtained after the quantum encoder neural network processes ρ, d is the quantum encoder neural network pair ρ latent The quantum state information obtained after reconstruction.

[0098] Construct a quantum encoder neural network and a quantum decoder neural network. Mathematically, both the quantum encoder neural network and the quantum decoder neural network are arbitrary parameterizable quantum unitary transformations. The quantum encoder neural network can use a hardware-efficient variational quantum circuit as the quantum encoder neural network, while the quantum decoder neural network can use a hardware-efficient parameterized quantum circuit.

[0099] In one possible implementation, constructing an initial quantum variational autoencoder includes: constructing multiple quantum encoder layers and multiple quantum decoder layers, each of the quantum encoder layer and the quantum decoder layer includes: a quantum entangled layer and a single quantum bit variation layer, and the quantum entangled layer and the single quantum bit variation layer are in a convolution relationship; initializing the quantum parameters of each quantum encoder layer and the quantum parameters of each quantum decoder layer to obtain multiple initialized quantum encoder layers and multiple initialized quantum decoder layers; generating a quantum encoder neural network and a quantum decoder neural network based on the multiple initialized quantum encoder layers, the multiple initialized quantum decoder layers, a first preset relationship between the quantum encoder layers, and a second preset relationship between the quantum decoder layers, wherein the first preset relationship is a product relationship between any two adjacent quantum encoder layers, and the second preset relationship is a product relationship between any two adjacent quantum decoder layers; and generating a quantum variational autoencoder based on the quantum decoder neural network and the quantum encoder neural network.

[0100] The construction of the quantum encoder neural network is similar to that of the quantum decoder neural network. The following is an example of the construction of the quantum encoder neural network. Specifically, according to a predetermined number of layers, a number of quantum encoder layers equal to the number of layers is constructed, wherein the quantum encoder layer includes a quantum entanglement layer and a single quantum bit variable layer. Furthermore, each quantum encoder layer is connected according to a predetermined inter-layer relationship that can realize the function of the quantum decoder, that is, a first preset relationship. In the embodiment of the present application, the inter-layer relationship between the quantum encoder layers is: any two adjacent layers are in a product relationship. Based on this, the mathematical representation of the constructed quantum encoder neural network layer can refer to the following formula (2):

[0101] (2)

[0102] Where K is the total number of quantum encoder layers, is the quantum entanglement layer of the k-th quantum encoder layer, is the single quantum bit variable layer of the quantum encoder layer of the kth layer, and the parameter 、 、 They represent the parameters of different parameter-containing quantum gates in the quantum encoder neural network, N is the total number of quantum bits, and i represents the i-th quantum bit.

[0103] Referring to the above quantum encoder neural network, the mathematical representation of the constructed quantum decoder neural network can be referred to the following formula (3):

[0104] (3)

[0105] Where K is the total number of quantum decoder layers, is the quantum entanglement layer of the k-th quantum decoder layer, is the single qubit variable layer of the quantum decoder layer at the kth layer, and the parameter 、 、 They represent the parameters of different parametric quantum gates in the quantum encoder neural network.

[0106] Reference Figure 5 , associate the quantum decoder neural network with the quantum decoder neural network, so that the latent space quantum state feature ρ output by the quantum decoder neural network latent , which can serve as the input of the quantum decoder neural network, enabling the quantum decoder neural network to reconstruct and output the characteristics of the latent space quantum state, thereby obtaining a quantum variational autoencoder. On this basis, the quantum parameters of the quantum encoder neural network and the quantum decoder neural network in the quantum variational autoencoder are initialized to obtain the initial quantum variational autoencoder, and the following training is performed.

[0107] First, the quantum state information for training is loaded. Optionally, the pre-stored quantum state training information is loaded from the quantum register, where the quantum state training information can be expressed as , the number of quantum bits is N=n s +n A It is understandable that if the acquired training data is classical data, it needs to be converted into quantum state information before it can be used in the subsequent training process.

[0108] The quantum state training information Input into the quantum variational encoder in sequence to obtain the training information ρ of each quantum state output by the quantum decoder neural network i Quantum state reconstruction information Specifically, each quantum state training information ρ i The quantum state after the forward calculation of the quantum encoder neural network is shown in Equation 4 below:

[0109] (4)

[0110] in, The quantum changes characterized by the quantum encoder neural network, is the quantum parameter, is the inverse transformation of the quantum change, which is mathematically the conjugate transpose of the unitary matrix. is the training information ρ of the i-th quantum state i The quantum state after processing by the quantum encoder neural network.

[0111] Further, referring to the above formula (1), discard the quantum state Some of the quantum bits in the hidden space are retained as the output result of the quantum state characteristics. .

[0112] Output the results of the latent space quantum state characteristics Input into the quantum decoder neural network, and after the forward calculation of the quantum decoding neural network, the quantum state reconstruction information is obtained. , the specific reconstruction process can refer to the following formula (5).

[0113] (5)

[0114] in, In the quantum encoder neural network The density matrix characterized by the discarded quantum bits.

[0115] Furthermore, based on the quantum state training information , output results of latent space quantum state characteristics and quantum state reconstruction information , calculate the quantum variational loss and quantum reconstruction loss of the initial quantum variational autoencoder. Based on the quantum variational loss and quantum reconstruction loss calculated for this training, determine whether the loss has converged or whether the number of training times for this training has reached the number of iterations to determine whether the training of the quantum variational autoencoder is complete.

[0116] Among them, the quantum reconstruction loss characterizes the error between the reconstructed quantum state reconstruction information and the original input quantum state training information. The quantum reconstruction loss can evaluate whether the quantum variational autoencoder can accurately reconstruct the original input from the compressed latent space quantum state characteristics. Based on this, during the training process, by minimizing the quantum reconstruction loss, the quantum variational autoencoder is adjusted so that it learns how to effectively compress and reconstruct quantum state information, thereby retaining the key characteristics of the input quantum state information.

[0117] Specifically, the quantum reconstruction loss function can also be called the quantum state distance function, which calculates the distance / error between the input quantum state training information and its corresponding quantum state reconstruction information. Its calculation method can refer to the following formula (6).

[0118] (6)

[0119] in, Represents the training information of the i-th quantum state The corresponding quantum state reconstruction information The quantum reconstruction loss between them, Tr represents the matrix trace operation.

[0120] Optionally, the quantum reconstruction loss function can also be calculated using quantum relative entropy, as shown in the following formula (7).

[0121] (7)

[0122] in, is the quantum state information, Represents the i-th quantum state training information The corresponding quantum state reconstruction information The quantum reconstruction loss between .

[0123] In another possibility, the quantum reconstruction loss function can also use Wasserstein distance loss, refer to the following formula (8).

[0124] (8)

[0125] Where T is a quantum operation, Reconstructing information for quantum states A set of orthogonal bases, so, , C is defined as a diagonal matrix.

[0126] In the embodiments of the present application, other functions used to characterize the quantum state distance can be used as quantum reconstruction loss functions, and this application does not make any sole limitation.

[0127] Quantum variational loss is used to measure the difference between the output results of the latent space quantum state characteristics and the preset variational constrained quantum state. During the training process, by minimizing the quantum variational loss, the quantum variational autoencoder is adjusted so that it learns how to map the input quantum state information into a structured latent space and ensures that the representation in the latent space follows a preset distribution, thereby improving the generalization ability of the quantum variational autoencoder and its ability to generate new samples.

[0128] In the embodiment of the present application, the quantum variation loss function L v It can be determined by referring to the above quantum state distance functions such as fidelity loss, quantum relative entropy loss, and quantum Wasserstein distance. In addition, the size of the Hilbert space considering the quantum state characteristics of the hidden space is , select the maximum mixed state of the same Hilbert space size as the preset variational constrained quantum state, expressed as , where I is the size of The identity matrix of .

[0129] Quantum reconstruction loss Lf and quantum variational loss L v The weighted summation of is the total loss L of the quantum variational autoencoder, refer to the following formula (9). The quantum reconstruction loss can ensure that the quantum variational autoencoder can accurately reconstruct the input data, while the quantum variational loss can ensure the structuring of the latent space. By adjusting the weights of the two losses, the trade-off between the reconstruction accuracy and the structuring of the latent space can be controlled.

[0130] (9)

[0131] Where β is the quantum variational loss function L v The weight parameter of .

[0132] If either the quantum variational loss or the quantum reconstruction loss fails to converge, the total loss will fail to converge, and the quantum variational autoencoder will not achieve the desired effect. Therefore, the parameters of the quantum variational autoencoder must be updated based on the quantum variational loss and the quantum reconstruction loss. Optionally, this embodiment of the application uses the finite difference rule to calculate the gradient of the total loss L with respect to the parameters of the quantum variational autoencoder, as shown in the following equation (10).

[0133] (10)

[0134] Among them, ∆ is a small quantity for calculating the gradient, and θ is the parameter of the quantum variational autoencoder, including the parameters in the quantum encoder neural network and the quantum decoder neural network.

[0135] Referring to the following equation (11), the parameters of the quantum encoder are updated according to stochastic gradient descent.

[0136] (11)

[0137] Among them, t and t+1 represent the number of iterations, θ t represents the parameters of the quantum variational autoencoder at the tth iteration, θ t+1 represents the parameters of the quantum variational autoencoder at the t+1th iteration.

[0138] According to the above parameter update method, the parameters of the initial quantum variational autoencoder are updated, and the quantum state training information is input into the updated initial quantum variational autoencoder. Based on the latent space quantum state characteristics and quantum state re-information output by the updated initial quantum variational autoencoder, the loss of the updated initial quantum variational autoencoder is calculated to determine whether it has converged. If it has converged and the loss no longer continues to decrease, the update of the initial quantum variational autoencoder is stopped, and the updated initial quantum variational autoencoder is used as the final quantum variational autoencoder applied in steps S120 and S150. On the contrary, if it has not converged, it is determined whether the number of updates has reached the number of iterations. If not, the above process is repeated until the loss converges. If the number of iterations has been reached, the iteration is stopped, and the initial quantum variational autoencoder updated by the last iteration is used as the final quantum variational autoencoder applied in steps S120 and S150.

[0139] In one possible implementation, the process of training the quantum diffusion model includes: obtaining a plurality of latent space quantum state feature output results corresponding to quantum state training information for training; constructing an initial quantum diffusion model, the initial quantum diffusion model at least including: a quantum noisy neural network for implementing a diffusion process and a quantum denoising neural network for implementing a generation process; inputting a plurality of latent space quantum state feature output results into the initial quantum diffusion model for processing, respectively, to obtain denoised latent space quantum state information corresponding to each latent space quantum state feature output result; determining an initial quantum diffusion model based on the plurality of latent space quantum state feature output results and the denoised latent space quantum state information corresponding to each latent space quantum state feature output result. The loss function value of the quantum diffusion model; when the loss function value does not meet the preset threshold, the model parameters of the initial quantum diffusion model are updated according to the multiple latent space quantum state feature outputs and the denoised latent space quantum state information corresponding to each latent space quantum state feature output, to obtain an updated initial quantum diffusion model, and the multiple latent space quantum state feature output results are respectively input into the initial quantum diffusion model for processing, to obtain the denoised latent space quantum state information corresponding to each latent space quantum state feature output result and subsequent steps, until the loss function value meets the preset threshold; when the loss function value does not meet the preset threshold, the initial quantum diffusion model of this training is determined as the quantum diffusion model.

[0140] Reference Figure 6 , a flow chart of training a quantum diffusion model provided in an embodiment of the present application illustrates the process of training the quantum diffusion model.

[0141] First, load the latent space quantum state data, and optionally, convert the above quantum state training information Input into the trained quantum variational autoencoder to obtain the output result of the latent space quantum state feature , which is used as the latent space quantum state data for training the quantum diffusion model.

[0142] Furthermore, a quantum diffusion model is constructed. In the embodiment of the present application, a shallow depth quantum Clifford circuit (mathematically represented as U) is selected to construct the forward noise addition process in the quantum diffusion model, that is, the generation process. Figure 7 , a structural diagram of a shallow Clifford circuit provided in an embodiment of the present application, wherein the quantum Clifford circuit is composed of quantum Clifford gates, whose set is {H, S, CNOT}, where S is a phase gate, H is a Hadamard gate, and the CNOT gate is a controlled NOT gate.

[0143] Based on this, the output results of the latent space quantum state characteristics are Add noise. The noise adding process can refer to the following formula (12).

[0144] (12)

[0145] Where, T = 1, 2, ..., N, represents the number of times noise is added; represents the characteristic output of the latent space quantum state after the quantum diffusion model is noised T steps, represents the characteristic output of the latent space quantum state after the quantum diffusion model is noised T-1 steps, represents the noise addition operation of the T-th step quantum diffusion model, Indicates the noise addition operation The conjugate transpose transformation of .

[0146] Furthermore, a parameterized quantum neural network is selected for inverse entropy learning to realize the denoising process of the quantum diffusion model, that is, the generation process. A hardware-efficient variational quantum circuit can be selected as the denoising quantum neural network model. Figure 8 , a schematic diagram of the structure of a parameterized denoising quantum neural network provided in an embodiment of the present application, which can be used for denoising at every moment of the denoising process. Figure 8 The denoising quantum neural network is composed of several variational layers and entanglement layers alternating with each other. The dotted boxes correspond to the operations of the three single-qubit gates Ry, RZ, and Rz. Uent represents the quantum entanglement operation. The denoising quantum neural network model The mathematical representation of can be referred to the following formula (13).

[0147] (13)

[0148] in, , represents the parameters of the denoising quantum neural network, K represents the number of network layers in the denoising quantum neural network model, N represents the total number of quantum bits, and i represents the i-th quantum bit.

[0149] The denoising quantum neural network model is used to De-noising is performed, wherein the denoising process of the Tth step can refer to the following formula (14).

[0150] (14)

[0151] in, It represents the denoised latent space quantum state information after the T-th step denoising, B is the auxiliary quantum bit set, and its size is n A In order to ensure the consistency of the Hilbert space of the latent space quantum state information before and after denoising, it is necessary to Perform post-selection. Assuming that the post-selected structure is 0, the denoised latent space quantum state information actually obtained after the T-th step denoising is , please refer to the following formula (15).

[0152] (15)

[0153] After t steps of quantum denoising, the denoised latent space quantum state information can be obtained as shown in the following formula (16).

[0154] (16)

[0155] According to the quantum diffusion model constructed above, the latent space quantum state information before and after each step of noise addition and denoising is obtained. Based on this, the loss function value of each step is calculated. Among them, the loss function can be selected as the fidelity distance function. Referring to the following formula (17), the loss function value L corresponding to the noise addition and denoising in the tth step is calculated p .

[0156] (17)

[0157] Determine the loss function value L p Whether the preset conditions are met, such as L p Whether it is less than a preset threshold, optionally, the loss function can also be selected as quantum Wasserstein distance, quantum relative entropy distance and symmetric quantum relative entropy distance, etc., which is not limited here.

[0158] If the loss function value does not meet the preset conditions, the loss function value L is calculated according to the finite difference rule or other gradient methods. p Map of the denoising quantum neural network parameters and use the stochastic gradient descent method to update the parameters of the denoising quantum neural network to obtain the updated quantum diffusion model. Then, the latent space quantum state feature output results are re- The updated quantum diffusion model is inputted, and the loss function value of the updated quantum diffusion model is calculated based on the latent space quantum state information obtained before and after noise addition at each step. If the loss function value satisfies the preset conditions, training ends, and the updated quantum diffusion model is used as the final quantum diffusion model in step S140. If the loss function value still does not meet the preset conditions, the above update process is repeated until the loss function value meets the preset conditions, or the number of updates reaches the set maximum number of iterations. At this time, training is terminated, and the last updated quantum diffusion model is used as the final quantum diffusion model in step S140.

[0159] An electronic device is also provided in an embodiment of the present application. Figure 9 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, etc. Figure 9 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0160] like Figure 9 As shown, the electronic device 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 based on programs stored in a read-only memory (ROM) 602 or programs loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing device 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0161] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Figure 9 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0162] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any one of the image generation methods provided in the embodiments of the present application.

[0163] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any image generation method provided in the embodiment of the present application.

[0164] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.

[0165] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.

[0166] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0167] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

Claims

1. An image generation method, characterized in that: include: Get original image data; Converting the original image data into a quantum state to obtain original quantum state information; Inputting the original quantum state information into a quantum variational autoencoder, causing the quantum encoder neural network of the quantum variational autoencoder to extract features of the original quantum state information to obtain latent space quantum state features; Invoking a quantum diffusion model, processing the latent space quantum state characteristics input into the quantum diffusion model according to the probability distribution corresponding to the Hilbert space, and obtaining at least one latent space quantum state extension information as output; The at least one latent space quantum state extension information is respectively input into the quantum variational autoencoder, so that the quantum decoder neural network of the quantum variational autoencoder reconstructs each of the latent space quantum state extension information respectively, and obtains the quantum state information corresponding to each of the latent space quantum state extension information. The quantum state information is the quantum state representation of the new image, so as to use the quantum state information to generate image data of the new image.

2. The image generation method according to claim 1, wherein: The process of training the quantum variational autoencoder includes: Obtaining a plurality of quantum state information for training, recorded as quantum state training information; Constructing an initial quantum variational autoencoder, wherein the initial quantum variational autoencoder includes: a quantum encoder neural network and a quantum decoder neural network; Inputting the plurality of quantum state training information into the quantum encoder neural network for feature extraction, respectively, to obtain latent space quantum state feature output results corresponding to each of the quantum state training information; Inputting each of the latent space quantum state feature output results into the quantum decoder neural network for reconstruction, thereby obtaining quantum state reconstruction information corresponding to each of the latent space quantum state feature output results; Determine a quantum variational loss and a quantum reconstruction loss based on the latent space quantum state feature output result and the quantum state reconstruction information corresponding to each of the quantum state training information, wherein the quantum variational loss is used to characterize the difference between the latent space quantum state feature output result and the preset variational constrained quantum state, and the quantum reconstruction loss is used to characterize the difference between the quantum state training information and the corresponding quantum state reconstruction information; When the quantum variational loss and the quantum reconstruction loss meet preset conditions, the initial quantum variational autoencoder of this training is determined as the quantum variational autoencoder; When the quantum variational loss and the quantum reconstruction loss do not meet the preset conditions, the quantum parameters of the initial quantum variational autoencoder are updated according to the quantum variational loss and the quantum reconstruction loss to obtain an updated initial quantum variational autoencoder, and the steps of inputting the multiple quantum state training information into the quantum encoder neural network for feature extraction are performed to obtain the latent space quantum state feature output results corresponding to each quantum state training information, and subsequent steps until the quantum variational loss and the quantum reconstruction loss meet the preset conditions.

3. The image generation method according to claim 2, wherein: The constructing of the initial quantum variational autoencoder comprises: Constructing multiple quantum encoder layers and multiple quantum decoder layers, each of the quantum encoder layer and the quantum decoder layer includes: a quantum entanglement layer and a single quantum bit variable layer, and the quantum entanglement layer and the single quantum bit variable layer are in a convolution relationship; Initializing the quantum parameters of each of the quantum encoder layers and the quantum parameters of each of the quantum decoder layers to obtain a plurality of initialized quantum encoder layers and a plurality of initialized quantum decoder layers; generating a quantum encoder neural network and a quantum decoder neural network based on the multiple initialized quantum encoder layers, the multiple initialized quantum decoder layers, a first preset relationship between the quantum encoder layers, and a second preset relationship between the quantum decoder layers, wherein the first preset relationship is a product relationship between any two adjacent quantum encoder layers, and the second preset relationship is a product relationship between any two adjacent quantum decoder layers; A quantum variational autoencoder is generated based on the quantum decoder neural network and the quantum encoder neural network.

4. The image generation method according to claim 1, wherein: The process of training the quantum diffusion model includes: Obtaining latent space quantum state feature output results corresponding to multiple quantum state training information for training; Constructing an initial quantum diffusion model, the initial quantum diffusion model at least comprising: a quantum noise adding neural network for realizing a diffusion process and a quantum noise removing neural network for realizing a generation process; Inputting the plurality of latent space quantum state feature output results into the initial quantum diffusion model for processing, respectively, to obtain denoised latent space quantum state information corresponding to each of the latent space quantum state feature output results; Determining a loss function value of the initial quantum diffusion model based on the plurality of latent space quantum state feature output results and the denoised latent space quantum state information corresponding to each of the latent space quantum state feature output results; When the loss function value does not meet the preset threshold, the model parameters of the initial quantum diffusion model are updated according to the multiple latent space quantum state feature outputs and the denoised latent space quantum state information corresponding to each latent space quantum state feature output, to obtain an updated initial quantum diffusion model, and the steps of inputting the multiple latent space quantum state feature output results into the initial quantum diffusion model for processing, obtaining the denoised latent space quantum state information corresponding to each latent space quantum state feature output result, and subsequent steps are performed until the loss function value meets the preset threshold; When the loss function value does not meet the preset threshold, the initial quantum diffusion model of this training is determined as the quantum diffusion model.

5. The image generation method according to claim 1, wherein: The calling of the quantum diffusion model processes the latent space quantum state characteristics input to the quantum diffusion model according to the probability distribution corresponding to the Hilbert space to obtain output at least one latent space quantum state extension information, including: Inputting the latent space quantum state characteristics into a diffusion process of a quantum diffusion model, and in the diffusion process, gradually adding noise to the latent space quantum state characteristics according to the probability distribution of the Hilbert space to obtain at least one noisy latent space quantum state information; The at least one noisy hidden space quantum state information is input into the generation process of the quantum diffusion model. During the generation process, each of the noisy hidden space quantum state information is denoised to obtain the hidden space quantum state extension information corresponding to each of the noisy hidden space quantum state information.

6. The image generation method according to claim 1, wherein: The step of inputting the original quantum state information into a quantum variational autoencoder, and causing the quantum encoder neural network of the quantum variational autoencoder to extract features from the original quantum state information to obtain latent space quantum state features, comprises: Inputting the original quantum state information into the quantum encoder neural network to obtain encoded quantum state information; The quantum state information of a preset number of quantum bits is extracted from the quantum state information of the encoding transformation to obtain the quantum state characteristics of the hidden space.

7. The image generation method according to claim 1, wherein: The converting the original image data into a quantum state to obtain original quantum state information includes: The quantum register is called to convert the original image data into a quantum state, and the original quantum state information output by the quantum register is obtained.

8. A computer program product, characterized in that The method comprises computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the image generation method according to any one of claims 1 to 7.

9. An electronic device, characterized in that: comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program so as to enable the electronic device to implement the image generating method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the image generation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image classification method and device, electronic equipment and storage medium

    CN115761384A

  • Method and model for generating quantum state set

    CN119670909A

  • Machine learning network for screening quantum devices

    US20220092388A1