Image generation method and related device
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.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2026-03-17
AI Technical Summary
Existing image generation models are easily misled by redundant information during the image learning process, resulting in generated images with local distortion, missing details, and lack of diversity, which cannot meet the requirements for high quality.
By employing a quantum variational autoencoder and a quantum diffusion model, the latent space quantum state features of the original image are extracted through a quantum encoder neural network, and the quantum diffusion model is used to perform diffusion processing in Hilbert space to generate high-quality and diverse new images.
It effectively captures global information and high-level semantic features of images, resulting in improved image quality, avoiding local distortion and loss of detail, and enhancing the diversity and coherence of images.
Smart Images

Figure CN120672892B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of quantum computing and artificial intelligence technology, and in particular to an image generation method and related equipment. Background Technology
[0002] Image generation models are machine learning models that can learn the data distribution of input images and generate new images, such as autoregressive models, generative adversarial models, and diffusion models. These models can learn from a large amount of image data, capture patterns, features, and structures in the images, and thus create images that are similar to the training data but also have novelty.
[0003] However, existing image generation models typically capture local features in the pixel space of an image. Because high-frequency details (such as noise and texture) occupy a lot of information in the pixel space, the extracted image features contain a lot of redundant information. This causes the image generation model to waste time learning redundant information and fail to capture effective information from the image. As a result, the generated images have problems such as local distortion, missing details, image repetition or lack of diversity, resulting in low quality images that 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 improve the quality of the generated image. The specific solution is as follows:
[0005] The first aspect of this application provides an image generation method, comprising:
[0006] Obtain the raw image data;
[0007] The original image data is converted into a quantum state to obtain the original quantum state information;
[0008] The original quantum state information is input into a quantum variational autoencoder, which enables the quantum encoder neural network of the quantum variational autoencoder to extract features from the original quantum state information to obtain the hidden space quantum state features.
[0009] By calling the quantum diffusion model and processing the hidden space quantum state features input to the quantum diffusion model according to the probability distribution corresponding to the Hilbert space, at least one hidden space quantum state extension information is obtained from the output.
[0010] The at least one hidden space quantum state extension information is input into the quantum variational autoencoder, so that the quantum decoder neural network of the quantum variational autoencoder reconstructs each of the hidden space quantum state extension information to obtain the quantum state information corresponding to each of the hidden space quantum state extension information. The quantum state information is the quantum state representation of the new image, so as to generate the image data of the new image using the quantum state information.
[0011] In one possible implementation, the process of training the quantum variational autoencoder includes:
[0012] Acquire multiple quantum state information for training, denoted as quantum state training information;
[0013] An initial quantum variational autoencoder is constructed, which includes a quantum encoder neural network and a quantum decoder neural network;
[0014] The training information of multiple quantum states is input into the quantum encoder neural network for feature extraction, and the hidden space quantum state feature output results corresponding to each training information of quantum states are obtained.
[0015] The output results of each hidden space quantum state feature are input into the quantum decoder neural network for reconstruction, thereby obtaining the quantum state reconstruction information corresponding to each hidden space quantum state feature output result;
[0016] Based on the latent space quantum state feature output results corresponding to each quantum state training information and the quantum state reconstruction information, quantum variational loss and quantum reconstruction loss are determined. The quantum variational loss is used to characterize the difference between the latent space quantum state feature output results and the preset variational constraint quantum state, and the quantum reconstruction loss is used to characterize the difference between the quantum state training information and its corresponding quantum state reconstruction information.
[0017] If the quantum variational loss and the quantum reconstruction loss meet the preset conditions, the initial quantum variational autoencoder trained in this exercise will be determined as a quantum variational autoencoder.
[0018] If 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. Then, the steps of inputting multiple quantum state training information into the quantum encoder neural network for feature extraction to obtain the hidden space quantum state feature output results corresponding to each quantum state training information and the subsequent steps are performed until the quantum variational loss and the quantum reconstruction loss meet the preset conditions.
[0019] In one possible implementation, constructing the initial quantum variational autoencoder includes:
[0020] Multiple quantum encoder layers and multiple quantum decoder layers are constructed. Each quantum encoder layer and each quantum decoder layer includes a quantum entanglement layer and a single-qubit variable layer. The quantum entanglement layer and the single-qubit variable layer are convolutionally related.
[0021] The quantum parameters of each quantum encoder layer and the quantum parameters of each quantum decoder layer are initialized to obtain multiple initialized quantum encoder layers and multiple initialized quantum decoder layers.
[0022] Based on the plurality of initialized quantum encoder layers, the plurality of initialized quantum decoder layers, the first preset relationship between the quantum encoder layers, and the second preset relationship between the quantum decoder layers, a quantum encoder neural network and a quantum decoder neural network are generated. The first preset relationship is that any two adjacent quantum encoder layers are in a product relationship, and the second preset relationship is that any two adjacent quantum decoder layers are in a product relationship.
[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] Obtain the hidden space quantum state feature output results corresponding to multiple quantum state training information used for training;
[0026] An initial quantum diffusion model is constructed, which includes at least: a quantum noise-adding neural network for realizing the diffusion process and a quantum noise-reducing neural network for realizing the generation process;
[0027] The output results of multiple hidden space quantum state features are respectively input into the initial quantum diffusion model for processing to obtain the denoised hidden space quantum state information corresponding to each output result of the hidden space quantum state features.
[0028] Based on the output results of multiple hidden space quantum state features, and the denoised hidden space quantum state information corresponding to each of the output results of the hidden space quantum state features, the loss function value of the initial quantum diffusion model is determined;
[0029] If the loss function value does not meet the preset threshold, the model parameters of the initial quantum diffusion model are updated based on the output of multiple latent quantum state features and the denoised latent quantum state information corresponding to each output of latent quantum state features, to obtain the updated initial quantum diffusion model. Then, the process of inputting the output results of multiple latent quantum state features into the initial quantum diffusion model for processing is performed to obtain the denoised latent quantum state information corresponding to each output result of latent quantum state features and subsequent steps, until the loss function value meets the preset threshold.
[0030] If the loss function value does not meet the preset threshold, the initial quantum diffusion model for this training will be determined as a quantum diffusion model.
[0031] In one possible implementation, the invocation of the quantum diffusion model, based on the probability distribution corresponding to the Hilbert space, processes the latent space quantum state features input to the quantum diffusion model to obtain at least one latent space quantum state extension information, including:
[0032] The hidden space quantum state features are input into the diffusion process of the quantum diffusion model. During the diffusion process, noise is gradually added to the hidden space quantum state features according to the probability distribution of Hilbert space to obtain at least one noisy hidden 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 noisy hidden space quantum state information is denoised to obtain the hidden space quantum state extension information corresponding to each noisy hidden space quantum state information.
[0034] In one possible implementation, the step of inputting the original quantum state information into a quantum variational autoencoder, enabling 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, includes:
[0035] The original quantum state information is input into the quantum encoder neural network to obtain the encoded quantum state information;
[0036] The quantum state information of a preset number of qubits is extracted from the quantum state information of the encoded transformation to obtain the hidden space quantum state characteristics.
[0037] In one possible implementation, converting the original image data into a quantum state to obtain the original quantum state information includes:
[0038] The original image data is converted into a quantum state by calling the quantum register, and the original quantum state information output by the quantum register is obtained.
[0039] A second aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the image generation method described in the first aspect or any implementation thereof.
[0040] A third aspect of this 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 used to execute the computer program so that the electronic device can implement the image generation method of the first aspect or any implementation thereof.
[0043] A fourth aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to perform the image generation method described in the first aspect or any implementation thereof.
[0044] By employing the aforementioned technical solution, the image generation method provided in this application utilizes a quantum encoder neural network of a quantum variational autoencoder to extract features from the original quantum state information transformed from the original image data. Due to the superposition and entanglement characteristics of quantum state information, the extracted latent space quantum state features, compared to the pixel features in the pixel space of existing technologies, can capture high-level semantic features representing the global information of the image data. Furthermore, the quantum diffusion model, based on the latent space quantum state features, diffuses to generate at least one latent space quantum state extension information. 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 latent structure of the image data distribution, thereby making the diffused latent space quantum state extension information more coherent and accurate, avoiding the problems of distortion and lack of detail in the generated new image. Moreover, the Hilbert space where the latent space quantum state features reside has a larger probability distribution space than the classical probability distribution, making the data extension dimension of the quantum diffusion model higher, thereby improving the diversity of the output latent space quantum state extension information.
[0045] Furthermore, by using a quantum decoder neural network of a quantum variational autoencoder to reconstruct the extended information of at least one hidden space quantum state generated, a quantum state representation of at least one new image is obtained. Based on this, high-quality and diverse images corresponding to the original image data can be generated. Attached Figure Description
[0046] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0047] Figure 1 A flowchart illustrating an image generation method provided in an embodiment of this application;
[0048] Figure 2 This is an optional system architecture diagram for implementing the image generation method provided in the embodiments of this application;
[0049] Figure 3 A schematic diagram of the structure of the quantum diffusion model provided in the embodiments of this application.
[0050] Figure 4 A schematic diagram of the process for training a quantum variational autoencoder provided in an embodiment of this application;
[0051] Figure 5 This is a schematic diagram of the structure of a quantum variational autoencoder provided in an embodiment of this application;
[0052] Figure 6 A schematic diagram illustrating the process of training a quantum diffusion model as provided in an embodiment of this application;
[0053] Figure 7 This is a schematic diagram of the structure of a shallow Clifford circuit provided in an embodiment of this application;
[0054] Figure 8 This is a schematic diagram of the structure of the parameterized denoising quantum neural network provided in the embodiments of this application;
[0055] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0056] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.
[0057] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0058] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0059] This application can be applied to related technical fields such as quantum computing and artificial intelligence. The following section uses image generation as an example to introduce several application scenarios that have been implemented in products.
[0060] First, we introduce one possible application scenario for this application. Existing image generation models are typically trained using raw image data, which is usually stored as pixel space data in the form of two-dimensional or three-dimensional matrices. Each pixel independently records color information, resulting in extremely high dimensionality of the image data, but a low proportion of actual effective information and a large amount of redundancy. Furthermore, traditional image generation models (such as GANs and VAEs) rely on convolutional neural networks (CNNs) to extract image features. However, CNNs, through local convolutional kernel operations, struggle to capture the global structural information of the image from the pixel space data, and the extracted features contain a large amount of redundant information. Consequently, image generation models are forced to model data across all frequency bands, wasting model resources on learning redundant information and failing to capture the effective information of the image. This leads to the generation of images exhibiting local optima or local distortion, generating repetitive or unsustainable new image samples, resulting in low-quality generated images that cannot meet higher requirements.
[0061] To address the aforementioned problems, embodiments of this application provide an image generation method and related equipment. The image generation method and related equipment of this application embodiments will be described in detail below with reference to the accompanying drawings.
[0062] Reference Figure 1 , Figure 1 This is a flowchart illustrating an image generation method provided in an embodiment of this application, as shown below. Figure 1 As shown in the embodiment of this application, an image generation method may include steps S110 to S150, which are described in detail below.
[0063] It should be noted that the image generation method can be applied, but is not limited to, to applications with classical data processing and quantum computing capabilities, or to cloud services provided by cloud-side servers. Optionally, refer to... Figure 2 The present application provides an optional system architecture diagram for implementing an image generation method. The image generation method can be applied to this system, which may include: a quantum register, a quantum variational autoencoder, and a quantum diffusion model. The image generation method is implemented by the cooperation of the quantum register, the quantum variational autoencoder, and the quantum diffusion model.
[0064] Among them, quantum registers are used to store and process quantum information. A quantum variational autoencoder is a hybrid quantum-classical model combining quantum computing and classical machine learning. It aims to leverage the parallel computing power 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, used for feature extraction and reconstruction of quantum state information, respectively. A quantum diffusion model aims to utilize the characteristics of quantum computing, such as superposition, entanglement, and quantum parallelism, to accelerate or enhance the performance of diffusion models. It includes at least a quantum noise-adding neural network and a quantum denoising neural network, used to simulate the diffusion process of quantum state information from clear to noisy and learn its denoising process, thereby generating new image samples similar to the original image data distribution.
[0065] Step S110: Obtain the raw image data.
[0066] Step S120: Convert the original image data into a quantum state to obtain the original quantum state information.
[0067] In one optional scenario, the user inputs the original image data for generating new image samples into a system configured with an image generation method, which then generates the corresponding new image. Since the original image data input by the user is typically classical data, such as RGB images, pixel matrices, or depth images, the first step is to convert the acquired classical data into a quantum state to obtain the original quantum state information.
[0068] Callable Figure 2 The quantum register in the image transforms the original image data into a quantum state, yielding the original quantum state information output by the quantum register. Optionally, 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 can be invoked, and through quantum gate operations and auxiliary qubits, the original image data in classical form can be efficiently loaded into a quantum state to obtain the original quantum state information.
[0069] Step S130: Input the original quantum state information into the quantum variational autoencoder, so that the quantum encoder neural network of the quantum variational autoencoder can extract features from the original quantum state information to obtain the hidden space quantum state features.
[0070] When an image is input into a variational autoencoder, the encoder extracts the possible value ranges of latent features such as human figures, backgrounds, and colors, obtains the probability distribution of each feature value, and determines the feature vector X of the image. Then, the decoder reconstructs the original input image based on the feature vector X.
[0071] It is understood that the quantum variational autoencoder used in this application extracts features from the original quantum state information. This quantum state information is represented by vectors in Hilbert space, and the probability distribution space of Hilbert space is larger than that of classical probability distribution. Based on this, extracting classical feature information in Hilbert space yields latent space quantum state features that, compared to image features extracted by the variational autoencoder using classical probability distribution, can capture more complex feature relationships and richer feature representations in the original image data, thus extracting high-level semantic features from the original image data. Furthermore, the larger probability distribution space can better accommodate noise and outliers in the data, thereby filtering redundant information in the original image data. This ensures that the generated latent space quantum state features accurately represent the image features of the original image data, allowing the subsequent quantum diffusion model to focus more on learning the latent 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 extracts features from the original quantum state information to obtain hidden space quantum state features. This includes: inputting the original quantum state information into the quantum encoder neural network to obtain encoded quantum state information; and extracting quantum state information of a predetermined number of qubits from the encoded quantum state information to obtain hidden space quantum state features.
[0073] In this embodiment, the original quantum state information is first processed by a quantum encoder neural network to obtain encoded quantum state information. Some qubits in the quantum state information obtained by the quantum encoder neural network are discarded, and the remaining quantum state information is used as the hidden space quantum state feature. Alternatively, some qubits can be extracted from the quantum state information as the hidden space quantum state feature. Based on this, the effect of effectively compressing quantum state space information is achieved.
[0074] Specifically, the process of discarding some qubits can be referred to in the following formula (1):
[0075] (1)
[0076] in, This represents the bias operation of a quantum variational autoencoder, where A is the set of discarded qubits of size . , The quantum state information after processing by the quantum encoder neural network. This is a characteristic of hidden space quantum states.
[0077] In the embodiments of this application, there are no special requirements for discarding a portion of the qubits. The amount of redundant qubits in the quantum state information generated by a conventional quantum variational autoencoder can be determined, for example, discarding less than or equal to half of the total number of qubits. It is understood that the more qubits discarded, the more redundant the quantum state information, indicating a larger compressible space.
[0078] Step S140: Call the quantum diffusion model, process the hidden space quantum state features input to the quantum diffusion model according to the probability distribution corresponding to the Hilbert space, and obtain at least one hidden space quantum state extension information of the output.
[0079] Quantum diffusion models are methods for modeling, learning, and sampling the probabilities of complex data through a reversible probabilistic transformation process (diffusion and generation processes, or noise addition and denoising processes). Quantum diffusion models are implemented based on Hilbert spaces, which have a larger probability distribution space compared to traditional diffusion models. This larger probability distribution space means that quantum diffusion models used for image generation possess stronger expressive power, greater flexibility, and the potential to capture and generate more complex and diverse real-world image distributions. For example, in a classical diffusion model with a lower probability distribution, a blurry patch in an image can only be reconstructed as a dog's nose, while a quantum diffusion model with a larger probability distribution space in Hilbert space can reconstruct a blurry patch into many more possibilities, such as a cat's nose or a bear's nose.
[0080] Understandably, quantum diffusion models can leverage the properties of quantum computing (such as superposition, entanglement, and quantum parallelism) to overcome the potential bottlenecks in computational efficiency, expressive power, and sampling quality of classical diffusion models, especially when dealing with high-dimensional data, complex distributions, or quantum data. Furthermore, quantum diffusion models can utilize natural quantum noise processes instead of the Gaussian noise processes employed in classical diffusion models for forward diffusion, resulting in a more natural distribution of particularities.
[0081] Specifically, the quantum diffusion model is invoked, and the latent space quantum state features input to 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. This includes: inputting the latent space quantum state features into the diffusion process of the quantum diffusion model; during the diffusion process, adding noise to the latent space quantum state features step by step 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; during the generation process, denoising each noisy latent space quantum state information to obtain the latent space quantum state extension information corresponding to each noisy latent space quantum state information.
[0082] Reference Figure 3 This application provides a schematic diagram of the quantum diffusion model. Wherein, QNA U1, QNA U2, ..., QNA U t QNA U T These are used to characterize the quantum states in hidden space. Noise is added in steps one through two, ..., steps t and T, while the hidden space quantum state features... Input to QNA U1, and use QNA U1 to QNA U T Features of hidden space quantum states The process of gradually adding noise is the forward noise-adding process or diffusion process in the quantum diffusion model.
[0083] The quantum diffusion model disrupts the latent quantum state features of the input by progressively adding noise, thereby gradually perturbing the data distribution of these features and obtaining at least one different noisy latent quantum state feature. In essence, each noise addition yields a new latent quantum state feature, i.e., the noisy latent quantum state information. After T noise additions per step, the latent quantum state features are obtained. .
[0084] During the noise addition process, each step of noise addition must satisfy probability rules, rather than being added randomly. The probability distribution space of Hilbert space is larger than that of classical data. Even if the intensity of noise is the same at each step, more noise hidden space quantum state information can be diffused in Hilbert space, thereby improving the diversity of the final generated new image.
[0085] Furthermore, the multiple noisy latent space quantum state information generated during the diffusion process is input into the generation process of the quantum diffusion model. Each noisy latent space quantum state information is then denoised to obtain the noise-free extended information of the latent space quantum states obtained through diffusion. (Refer to...) Figure 3 ,QNS V1(θ p ), QNS V2(θp ), ..., QNS Vt(θ p ), QNS V T (θ p These steps are used to perform denoising on noisy hidden space quantum state information in steps one, two, ..., t-th and T-th, respectively, to denoise the hidden space quantum state information to be denoised. Input to QNS V1(θ) p ), and utilize QNS V1(θ p ) to QNS V T (θ p ),right The process of achieving stepwise denoising is the backward denoising process or generation process of the quantum diffusion model.
[0086] The quantum diffusion model, through the information of hidden space quantum states Gradual denoising, recovering quantum state information from noise, can be understood as follows: each denoising step yields a new hidden space quantum state information, i.e., the extended hidden space quantum state information. After T denoising steps, the extended hidden space quantum state information is obtained. .
[0087] Understandably, the denoising network based on parameterized quantum circuits in this application, utilizing the superposition and entanglement properties of qubits, can more effectively learn and represent the complex conditional probability distribution of high-dimensional data after noise is introduced during the diffusion process. This achieves more accurate noise estimation and removal than traditional denoising methods based on classical neural networks. Compared to the gradient vanishing or insufficient expressive power problems faced by denoising networks in classical diffusion models when dealing with long-range dependent features (such as the global structure of natural images), the quantum denoising module of this invention utilizes quantum entanglement mechanisms to more naturally capture these long-range dependencies, thus exhibiting significant advantages in restoring global consistency and detail fidelity.
[0088] Furthermore, the results of the practical application of the technical solution of this application show that, in the benchmark test of standard image denoising, the quantum denoising process described in this application, compared with the typical classical diffusion model, significantly reduces the Fréchet Inception Distance (FID) index of the generated samples while maintaining or reducing the number of model parameters. This indicates that the distribution of the image generated by the diffusion model of this application is closer to the real image, and the generation quality is higher.
[0089] Step S150: Input at least one hidden space quantum state extension information into the quantum variational autoencoder, so that the quantum decoder neural network of the quantum variational autoencoder reconstructs each hidden space quantum state extension information to obtain the quantum state information corresponding to each hidden space quantum state extension information.
[0090] By using a quantum decoder neural network based on a quantum variational autoencoder, the extended information of at least one hidden space quantum state generated by the quantum diffusion model is reconstructed to obtain a quantum state representation of new image data that corresponds to the original image data, thereby achieving the purpose of generating a new image.
[0091] Understandably, in quantum computing systems, the quantum state information obtained by the quantum decoder neural network is sufficient to represent new images; that is, the quantum state information is used as subsequent new image data for application. However, in classical data processing systems, it is necessary to convert the quantum state information into image data in classical data form in order to enable the use of new image data within the classical data processing system.
[0092] In summary, the image generation method provided in this application utilizes a quantum encoder neural network of a quantum variational autoencoder to extract features from the original quantum state information transformed from the original image data. Due to the superposition and entanglement characteristics of quantum state information, the extracted latent space quantum state features, compared to the pixel features in the pixel space of existing technologies, can capture high-level semantic features that characterize the global information of the image data. Furthermore, the quantum diffusion model diffuses and generates at least one latent space quantum state extension 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 latent structure of the image data distribution, thereby making the latent space quantum state extension information obtained by diffusion more coherent and accurate, avoiding the problems of distortion and lack of detail in the generated new image. Moreover, the Hilbert space where the latent space quantum state features reside has a larger probability distribution space than the classical probability distribution, making the data expansion dimension of the quantum diffusion model higher, thereby improving the diversity of the output latent space quantum state extension information.
[0093] Furthermore, by using a quantum decoder neural network of a quantum variational autoencoder to reconstruct the extended information of at least one hidden space quantum state generated, a quantum state representation of at least one new image is obtained. Based on this, high-quality and diverse images corresponding to the original image data can be generated.
[0094] Next, through the following embodiments, other possible implementations of an image generation method provided in this application will be described in detail.
[0095] In one possible implementation, the process of training a quantum variational autoencoder includes: acquiring multiple quantum state information for training, denoted as quantum state training information; constructing an initial quantum variational autoencoder, which includes a quantum encoder neural network and a quantum decoder neural network; inputting the multiple quantum state training information into the quantum encoder neural network for feature extraction, obtaining the latent space quantum state feature output results corresponding to each quantum state training information; inputting the latent space quantum state feature output results into the quantum decoder neural network for reconstruction, obtaining the quantum state reconstruction information corresponding to each latent space quantum state feature output result; and determining the quantum variational loss and quantum reconstruction loss based on the latent space quantum state feature output results corresponding to each quantum state training information and the quantum state reconstruction information, wherein the quantum variational loss is used to characterize the latent space quantities. The difference between the sub-state feature output and the preset variational constraint quantum state is used to characterize the difference between the quantum state training information and its corresponding quantum state reconstruction information. If the quantum variational loss and quantum reconstruction loss meet the preset conditions, the initial quantum variational autoencoder for this training is determined as a quantum variational autoencoder. If the quantum variational loss and 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 quantum reconstruction loss to obtain the updated initial quantum variational autoencoder. Then, the training information of multiple quantum states is input into the quantum encoder neural network for feature extraction to obtain the hidden space quantum state feature output results corresponding to each quantum state training information and subsequent steps, until the quantum variational loss and quantum reconstruction loss meet the preset conditions.
[0096] Reference Figure 4 The flowchart of training a quantum variational autoencoder provided in this application embodiment illustrates the process of training a quantum variational autoencoder.
[0097] Construct a quantum variational autoencoder. (Refer to...) Figure 5 The schematic diagram of the quantum variational autoencoder provided in this application embodiment shows that the quantum variational autoencoder includes: a quantum encoder neural network ε(θ) e ) and quantum decoder neural network D(θ) d ρ represents the original quantum state information input to the quantum variational autoencoder. latent The hidden space quantum state features obtained after processing ρ by the quantum encoder neural network, ρ d For quantum encoder neural networks to ρ latent The quantum state information obtained after reconstruction.
[0098] The quantum encoder neural network and the quantum decoder neural network are constructed. Mathematically, both the quantum encoder neural network and the quantum decoder neural network are arbitrary parameterizable quantum unitary transformations. Among them, the quantum encoder neural network can be selected from hardware-efficient variable quantum circuits, and the quantum decoder neural network can be selected from hardware-efficient parameterized quantum circuits.
[0099] In one possible implementation, constructing an initial quantum variational autoencoder includes: constructing multiple quantum encoder layers and multiple quantum decoder layers, each of which includes a quantum entanglement layer and a single-qubit variational layer, with the quantum entanglement layer and the single-qubit variational layer being convolutionally related; initializing the quantum parameters of each quantum encoder layer and 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, where 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 a quantum encoder neural network is similar to that of a quantum decoder neural network. The following explanation will use the construction of a quantum encoder neural network as an example. Specifically, according to a predetermined number of layers, a quantum encoder layer is constructed with the same number of layers as the predetermined number of layers. The quantum encoder layer includes a quantum entanglement layer and a single-qubit variable layer. Further, each quantum encoder layer is connected according to a predetermined inter-layer relationship that enables the quantum decoder function, i.e., a first predetermined relationship. In this embodiment, the inter-layer relationship between quantum encoder layers is: any two adjacent layers are multiplicative. Based on this, the mathematical representation of the constructed quantum encoder neural network layer can be referred to as the following formula (2):
[0101] (2)
[0102] Where K is the total number of quantum encoder layers. For the k-th layer of the quantum encoder, the quantum entanglement layer is... For the single-qubit variable layer of the k-th quantum encoder layer, the parameters are... , , Let N and i represent the parameters of different parameterized quantum gates in the quantum encoder neural network, respectively. N is the total number of qubits, and i represents the i-th qubit.
[0103] Referring to the above quantum encoder neural network, the mathematical representation of the constructed quantum decoder neural network can be found in the following equation (3):
[0104] (3)
[0105] Where K is the total number of quantum decoder layers. For the quantum entanglement layer of the k-th quantum decoder layer, For the single-qubit variable layer of the k-th quantum decoder layer, the parameters are... , , These represent the parameters of different parameterized quantum gates in the quantum encoder neural network.
[0106] Reference Figure 5 By associating quantum decoder neural networks with each other, the hidden space quantum state feature ρ output by the quantum decoder neural network is made more visible. latent This can be used as input to a quantum decoder neural network, enabling the quantum decoder neural network to reconstruct the features of the hidden space quantum states and output them, thus obtaining a quantum variational autoencoder. Based on this, the quantum parameters in the quantum encoder neural network and the quantum decoder neural network of the quantum variational autoencoder are initialized to obtain the initial quantum variational autoencoder, and then trained as follows.
[0107] First, the quantum state information for training is loaded. Optionally, pre-stored quantum state training information is loaded from a quantum register, where the quantum state training information can be represented as... The number of qubits is N=n s +n A Understandably, 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] Quantum state training information The information is sequentially input into the quantum variational encoder to obtain the training information ρ of each quantum state output by the quantum decoder neural network. i Quantum state reconstruction information Specifically, the training information ρ for each quantum state i The quantum state after forward computation by the quantum encoder neural network is shown in Equation 4 below:
[0109] (4)
[0110] in, Quantum changes characterized by a quantum encoder neural network. For quantum parameters, This is the inverse transformation of quantum changes, mathematically represented as the conjugate transpose of a unitary matrix. Training information ρ for the i-th quantum state i The quantum state after being processed by the quantum encoder neural network.
[0111] Furthermore, referring to equation (1) above, discard the quantum state. A portion of the qubits are compressed, leaving the compressed qubits as the output result of the hidden space quantum state characteristics. .
[0112] Output the hidden space quantum state characteristics The information is input into the quantum decoder neural network, and after forward computation by the quantum decoder neural network, the quantum state reconstruction information is obtained. The specific reconstruction process can be referred to in the following formula (5).
[0113] (5)
[0114] in, In quantum encoder neural networks The density matrix characterized by the discarded qubits.
[0115] Furthermore, based on quantum state training information Hidden space quantum state characteristic output results and quantum state reconstruction information The quantum variational loss and quantum reconstruction loss of the initial quantum variational autoencoder are calculated. Based on the quantum variational loss and quantum reconstruction loss calculated in this training, it is determined whether the loss convergence has been achieved, or whether the number of training iterations has been reached, 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 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 hidden space quantum state features. 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 preserving the key features of the input quantum state information.
[0117] Specifically, the quantum reconstruction loss function can also be called the quantum state distance function. It calculates the distance / error between the input quantum state training information and its corresponding quantum state reconstruction information. The calculation method can be referred to in 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, where Tr represents the trace operation of the matrix.
[0120] Optionally, the quantum reconstruction loss function can also be calculated using quantum relative entropy, as shown in equation (7).
[0121] (7)
[0122] in, For quantum state information, Represents the training information of the i-th quantum state The corresponding quantum state reconstruction information The quantum reconstruction loss between them.
[0123] In another possibility, the quantum reconstruction loss function can also be the Wasserstein distance loss, as shown in equation (8).
[0124] (8)
[0125] Where T is a quantum operation. Reconstructing information for quantum states A set of orthogonal bases, therefore, C is defined as a diagonal matrix.
[0126] In the embodiments of this application, other functions used to characterize quantum state distance can also be used as quantum reconstruction loss functions, and this application does not limit them to a single one.
[0127] Quantum variational loss is used to measure the difference between the latent space quantum state feature output and the pre-defined variational constraint quantum state. During training, 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 pre-defined distribution, thereby improving the generalization ability and the ability to generate new samples of the quantum variational autoencoder.
[0128] In this embodiment of the application, the quantum variational loss function L v The quantum state distance function, such as fidelity loss, quantum relative entropy loss, and quantum Wasserstein distance, can be used as a reference. Furthermore, considering the characteristics of the hidden space quantum state, the size of the Hilbert space is... The largest mixed state of the same Hilbert space size is selected as the preset variational constraint quantum state, denoted as: Where I is a value of size The identity matrix.
[0129] Quantum reconstruction loss Lf and quantum variational loss L v The weighted summation result is the total loss L of the quantum variational autoencoder, as shown in equation (9). The quantum reconstruction loss ensures that the quantum variational autoencoder can accurately reconstruct the input data, while the quantum variational loss ensures the structuring of the latent space. By adjusting the weights of the two losses, the trade-off between reconstruction accuracy and latent space structuring in the quantum variational autoencoder can be controlled.
[0130] (9)
[0131] Where β is the quantum variational loss function L v The weight parameters.
[0132] If either the quantum variational loss or the quantum reconstruction loss fails to converge, the total loss will also fail to converge, and the quantum variational autoencoder will not achieve the expected results. Therefore, the parameters of the quantum variational autoencoder need to be updated based on the quantum variational loss and the quantum reconstruction loss. Optionally, in this embodiment, the finite difference rule is used 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] Where ∆ is a small quantity used to calculate the gradient, and θ is a parameter of the quantum variational autoencoder, which includes parameters from the quantum encoder neural network and the quantum decoder neural network.
[0135] Referring to Equation (11), the parameters of the quantum encoder are updated according to stochastic gradient descent.
[0136] (11)
[0137] Where t and t+1 represent the iteration number, θ t Let θ represent the parameters of the quantum variational autoencoder in the t-th iteration. t+1 This represents the parameters of the quantum variational autoencoder in the (t+1)th iteration.
[0138] Based on the parameter update method described above, 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 hidden 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 if it has converged. If it has converged, the loss no longer decreases, and the update of the initial quantum variational autoencoder is stopped. This updated initial quantum variational autoencoder is then used as the final quantum variational autoencoder applied in steps S120 and S150. Conversely, if it has not converged, it is determined whether the number of updates has reached the required number of iterations. If the required number of iterations has not been reached, the above process is repeated until the loss converges. If the required number of iterations has been reached, the iteration is stopped, and the initial quantum variational autoencoder updated in 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: acquiring the latent space quantum state feature outputs corresponding to multiple training quantum state information for training; constructing an initial quantum diffusion model, which at least includes a quantum noise-adding neural network for realizing the diffusion process and a quantum denoising neural network for realizing the generation process; inputting the multiple latent space quantum state feature outputs 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; and determining the initial quantum diffusion model based on 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. The loss function value of the quantum diffusion model is calculated. If the loss function value does not meet the preset threshold, the model parameters of the initial quantum diffusion model are updated based on the output features of multiple hidden space quantum states and the denoised hidden space quantum state information corresponding to each output feature. This results in an updated initial quantum diffusion model. The output results of multiple hidden space quantum states are then input into the initial quantum diffusion model for processing to obtain the denoised hidden space quantum state information corresponding to each output feature and subsequent steps. This process continues until the loss function value meets the preset threshold. If the loss function value does not meet the preset threshold, the initial quantum diffusion model trained in this instance is determined as the quantum diffusion model.
[0140] Reference Figure 6 The flowchart of training a quantum diffusion model provided in this application illustrates the process of training the quantum diffusion model.
[0141] First, load the hidden space quantum state data; optionally, use the aforementioned quantum state training information. The input is fed into a trained quantum variational autoencoder to obtain the hidden space quantum state feature output. This is used as hidden space quantum state data for training quantum diffusion models.
[0142] Furthermore, a quantum diffusion model is constructed. In this embodiment, a shallow-depth quantum Clifford circuit (mathematically represented as U) is selected to construct the forward noise addition process, i.e., the generation process, in the quantum diffusion model. (Refer to...) Figure 7 The schematic diagram of the shallow Clifford circuit provided in this application embodiment shows that the quantum Clifford circuit is composed of quantum Clifford gates, and its set is {H,S,CNOT}, where S is a phase gate, H is a Hadamard gate, and CNOT gate is a controlled NOT gate.
[0143] Based on this, the output results of the hidden space quantum state characteristics Noise is added, and the noise addition process can be referred to the following formula (12).
[0144] (12)
[0145] Where T = 1, 2, ..., N, represents the number of times noise is added; This represents the output of the hidden space quantum state characteristics after adding noise at step T in the quantum diffusion model. This represents the output of the hidden space quantum state characteristics after adding noise at step T-1 in the quantum diffusion model. This represents the noise-adding operation in the T-th step of the quantum diffusion model. Indicates noise addition operation The conjugate transpose transformation.
[0146] Furthermore, a parameterized quantum neural network is selected for inverse entropy learning to realize the denoising process, i.e., the generation process, of the quantum diffusion model. A hardware-efficient variable quantum circuit can be selected as the denoising quantum neural network model, referring to... Figure 8 The schematic diagram of the parameterized denoising quantum neural network provided in this application embodiment shows that the quantum neural network can be used for denoising at each moment of the denoising process. Figure 8 The denoising quantum neural network consists of several alternating layers of variable layers and entangled layers. The dashed boxes correspond to the operations of the three single-qubit gates Ry, RZ, and Rz, and Uent represents the quantum entanglement operation. (Noise-reducing quantum neural network model) The mathematical representation of can be found in the following formula (13).
[0147] (13)
[0148] in, , represents the parameters of the denoised quantum neural network, K represents the number of network layers in the denoised quantum neural network model, N represents the total number of qubits, and i represents the i-th qubit.
[0149] Using a denoising quantum neural network model to process the noise-added... The noise reduction process in step T can be referred to in equation (14).
[0150] (14)
[0151] in, Let B represent the denoised hidden space quantum state information after the T-th denoising step, and let B be the set of auxiliary qubits of size n. A To ensure the consistency of the Hilbert space of the hidden space quantum state information before and after denoising, it is necessary to modify the denoised hidden space quantum state information. After performing post-selection, assuming the post-selection structure is 0, the actual denoised hidden space quantum state information obtained after the T-th denoising step is... For reference, see formula (15).
[0152] (15)
[0153] After t-step quantum denoising, the denoised hidden space quantum state information can be obtained by referring to the following equation (16).
[0154] (16)
[0155] Based on the quantum diffusion model constructed above, the hidden 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. The loss function can be selected as the fidelity distance function. Referring to the following equation (17), the loss function value L corresponding to noise addition and denoising at step t is calculated. p .
[0156] (17)
[0157] Determine the value of the loss function L p Does it meet the preset conditions, such as L? p Whether it is less than a preset threshold is optional. The loss function can also be selected as quantum Wassstein distance, quantum relative entropy distance, and symmetric quantum relative entropy distance, etc., and is not limited to one.
[0158] If the loss function value does not meet the preset conditions, then the loss function value L is calculated according to the finite difference rule or other gradient retrieval methods. p A map of the parameters of the denoised quantum neural network is generated, and the parameters are updated using stochastic gradient descent to obtain the updated quantum diffusion model. Then, the hidden space quantum state features are re-output. The updated quantum diffusion model is input into the algorithm. Based on the latent space quantum state information obtained at each step before and after denoising, the loss function value of the updated quantum diffusion model is calculated. If the loss function value meets the preset condition, the training ends, and the updated quantum diffusion model is used as the final quantum diffusion model applied in step S140. If the loss function value still does not meet the preset condition, the update process is repeated until the loss function value meets the preset condition, or the number of updates reaches the set maximum number of iterations. At this point, training stops, and the last updated quantum diffusion model is used as the final quantum diffusion model applied in step S140.
[0159] This application also provides an electronic device in its embodiments. (See reference...) Figure 9 The diagram illustrates a structural schematic suitable for implementing the electronic device in the embodiments of this application. The electronic device in the embodiments of this 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 impose any limitation on the functionality and scope of use of the embodiments of this application.
[0160] like Figure 9 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 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 unit 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 can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, memory cards, hard drives, etc.; and communication devices 609. Communication device 609 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0162] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the image generation methods provided in this application.
[0163] This application also provides a computer-readable storage medium that 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 of the image generation methods provided in this application.
[0164] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0165] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0166] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as 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, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
Claims
1. An image generation method characterized by, The method comprises: obtaining 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, so that a quantum encoder neural network of the quantum variational autoencoder extracts features from the original quantum state information to obtain hidden space quantum state features; calling a quantum diffusion model, processing the hidden space quantum state features input into the quantum diffusion model according to a probability distribution corresponding to a Hilbert space to obtain at least one output hidden space quantum state expansion information; inputting the at least one hidden space quantum state expansion information into the quantum variational autoencoder respectively, so that a quantum decoder neural network of the quantum variational autoencoder reconstructs each of the hidden space quantum state expansion information respectively to obtain quantum state information corresponding to each of the hidden space quantum state expansion information respectively, the quantum state information being a quantum state representation of a new image, so as to generate image data of the new image by using the quantum state information; wherein the process of training the quantum diffusion model comprises: obtaining hidden space quantum state feature output results respectively corresponding to a plurality of 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 implementing a diffusion process and a quantum noise removing neural network for implementing a generation process; inputting the plurality of hidden space quantum state feature output results into the initial quantum diffusion model respectively for processing to obtain denoised hidden space quantum state information respectively corresponding to each of the hidden space quantum state feature output results; determining a loss function value of the initial quantum diffusion model according to the plurality of hidden space quantum state feature output results and the denoised hidden space quantum state information respectively corresponding to each of the hidden space quantum state feature output results; in a case where the loss function value does not satisfy a preset threshold, updating model parameters of the initial quantum diffusion model according to the plurality of hidden space quantum state feature outputs and the denoised hidden space quantum state information respectively corresponding to each of the hidden space quantum state feature outputs to obtain an updated initial quantum diffusion model, and performing the inputting the plurality of hidden space quantum state feature output results into the initial quantum diffusion model respectively for processing to obtain the denoised hidden space quantum state information respectively corresponding to each of the hidden space quantum state feature output results and the subsequent steps until the loss function value satisfies the preset threshold; in a case where the loss function value does not satisfy the preset threshold, determining the initial quantum diffusion model of this training as the quantum diffusion model.
2. The image generation method of claim 1, wherein, The process of training the quantum variational autoencoder comprises: obtaining a plurality of quantum state information for training, denoted as quantum state training information; constructing an initial quantum variational autoencoder, the initial quantum variational autoencoder comprising: 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 respectively for feature extraction to obtain hidden space quantum state feature output results respectively corresponding to each of the quantum state training information; inputting each of the hidden space quantum state feature output results into the quantum decoder neural network for reconstruction to obtain quantum state reconstruction information corresponding to each of the hidden space quantum state feature output results; determining a quantum variational loss and a quantum reconstruction loss based on the hidden space quantum state feature output result corresponding to each of the quantum state training information and the quantum state reconstruction information, the quantum variational loss being used to represent a difference between the hidden space quantum state feature output result and a preset variational constraint quantum state, and the quantum reconstruction loss being used to represent a difference between the quantum state training information and the quantum state reconstruction information corresponding thereto; in a case where the quantum variational loss and the quantum reconstruction loss satisfy a preset condition, determining the initial quantum variational autoencoder of this training as a quantum variational autoencoder; in a case where the quantum variational loss and the quantum reconstruction loss do not satisfy the preset condition, updating quantum parameters of the initial quantum variational autoencoder according to the quantum variational loss and the quantum reconstruction loss to obtain an updated initial quantum variational autoencoder, and performing the inputting of the plurality of quantum state training information into the quantum encoder neural network for feature extraction, the obtaining of the hidden space quantum state feature output result corresponding to each of the quantum state training information, and the subsequent steps until the quantum variational loss and the quantum reconstruction loss satisfy the preset condition.
3. The image generation method of claim 2, wherein, The constructing of the initial quantum variational autoencoder comprises: constructing a plurality of quantum encoder layers and a plurality of quantum decoder layers, each of the quantum encoder layer and the quantum decoder layer comprising a quantum entanglement layer and a single-qubit variational layer, and the quantum entanglement layer and the single-qubit variational layer being in a convolutional relationship; initializing quantum parameters of each of the quantum encoder layers and 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 according to the plurality of initialized quantum encoder layers, the plurality of initialized quantum decoder layers, a first preset relationship between the quantum encoder layers, and a second preset relationship between the quantum decoder layers, the first preset relationship being a product relationship between any two adjacent quantum encoder layers, and the second preset relationship being a product relationship between any two adjacent quantum decoder layers; generating a quantum variational autoencoder based on the quantum decoder neural network and the quantum encoder neural network.
4. The image generation method of claim 1, wherein, The calling of the quantum diffusion model comprises: inputting the hidden space quantum state feature into a diffusion process of the quantum diffusion model, and gradually adding noise to the hidden space quantum state feature according to a probability distribution of a Hilbert space in the diffusion process to obtain at least one noise hidden space quantum state information; The at least one noise latent space quantum state information is input into a generation process of the quantum diffusion model, and in the generation process, each noise latent space quantum state information is respectively denoised to obtain latent space quantum state extension information corresponding to each noise latent space quantum state information.
5. The image generation method of claim 1, wherein, The inputting of the original quantum state information into the quantum variational autoencoder enables a 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, including: The inputting of the original quantum state information into the quantum encoder neural network obtains encoded quantum state information; The extraction of quantum state information of a preset number of quantum bits from the encoded quantum state information obtains the latent space quantum state features.
6. The image generation method of claim 1, wherein, The inputting of the original image data into the quantum encoder neural network obtains encoded quantum state information; The inputting of the original image data into the quantum encoder neural network obtains encoded quantum state information; 7. A computer program product, characterised in that, The computer readable instructions, when executed on an electronic device, enable the electronic device to implement the image generation method of any one of claims 1 to 6.
8. An electronic device, comprising: The memory is configured to store computer programs; The processor is configured to execute the computer programs to enable the electronic device to implement the image generation method of any one of claims 1 to 6. 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 of any one of claims 1 to 6.
9. A computer storage medium, characterized in that
Citation Information
Patent Citations
Image classification method and device, electronic equipment and storage medium
CN115761384A
Method and model for generating quantum state set
CN119670909A