Image generation method and device based on quantum generative adversarial network
The method based on quantum generative adversarial networks solves the problems of traditional generative adversarial networks in image generation, such as insufficient feature retention and data set flexibility, and achieves stability and flexibility in image generation, which is suitable for a variety of computer environments.
Patent Information
- Application Number
- CN202211473728.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-22
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-11-22
AI Technical Summary
Traditional generative adversarial networks are difficult to effectively maintain image features in image generation, and are not flexible enough for data sets, resulting in poor results in multi-attribute generation tasks.
Using a method based on quantum generative adversarial networks, a quantum generative adversarial network with stable performance is obtained by extracting the feature vectors of training samples and converting them into quantum states, and training the generator and discriminator.
It breaks through the problems of many parameters and difficult training convergence in traditional generative adversarial networks, achieves the stability and flexibility of image generation, is suitable for both classical computers and quantum computers, and provides a fast and high-quality image generation solution.
Smart Images

Figure CN116263972B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing technology, and specifically to an image generation method, apparatus, computing device, and computer storage medium based on a quantum generative adversarial network. Background Art
[0002] As one of the methods to obtain data information from the objective world, image information is rich in information and intuitive and easy to understand, and is an important source of information for people to acquire knowledge. With the rapid development of traditional computer systems, people's accumulation of image processing technology has continued to mature, and intelligent image processing methods have continued to emerge. Among them, the use of generative adversarial networks has brought significant performance improvements in multiple directions such as image segmentation, enhancement, restoration, and image generation.
[0003] Among them, generative adversarial networks are a major method for image generation. The traditional generative adversarial network is mainly composed of two parts: the generator and the discriminator. In the data flow, it can be understood that the front end is the generator and the back end is the discriminator. The generator mainly imitates the probability distribution of the real data set, and the corresponding discriminator distinguishes the real data from the artificial data generated in the generator as much as possible. According to the above ideas, it can be summarized into two technical solutions. The first is to generate the expected image through unconditional data input, that is, the generative adversarial network uses an unsupervised method to continuously learn from the low-dimensional latent space to achieve the mapping of high-dimensional images, and then continuously debugs the parameters through the mapping relationship model. In multiple different mapping relationship models between the low-dimensional latent space and the high-dimensional image, the best way is selected to obtain the ideal image; the second is to generate the expected image through conditional data input, usually by giving one or more conditions to continuously guide the model to generate the expected image. This method can put the label information of the input image as input into the generator and the discriminator, and import the vector with prior distribution into the neural network to enable the neural network to have multiple attribute capabilities.
[0004] However, the above-mentioned generative adversarial network method has two shortcomings. The first is that the generated model does not correctly learn a specific feature between a certain attribute of the input image and the corresponding attribute of the generated image. Therefore, when controlling the attribute of the input image to generate the image, it is unable to effectively maintain the characteristics of the image, and other irrelevant features in the image will also change during the continuous input image stage. The second is that the existing model is not flexible enough in the application of the data set, so when adjusting the model parameters, it is impossible to adjust the distribution of the data set in a targeted manner, resulting in an imbalance in the attributes of the input samples, and significantly reducing the mapping ability of multiple attributes in the image, resulting in poor results in multi-attribute generation tasks. Summary of the invention
[0005] In view of the above problems, the present invention is proposed to provide an image generation method, apparatus, computing device and computer storage medium based on a quantum generative adversarial network that overcome the above problems or at least partially solve the above problems.
[0006] According to one aspect of an embodiment of the present application, a method for generating an image based on a quantum generative adversarial network is provided, comprising:
[0007] Extract the feature vector of the sample image in the training sample set, convert the feature vector into a quantum state using a quantum encoder, and obtain the image feature quantum state;
[0008] According to the quantum state of the image features, the generator and the discriminator are trained to obtain the trained quantum generative adversarial network;
[0009] Generating images using quantum generative adversarial networks.
[0010] According to another aspect of an embodiment of the present application, there is provided an image generation device based on a quantum generative adversarial network, comprising:
[0011] An encoding module is adapted to extract feature vectors of sample images in a training sample set, and convert the feature vectors into quantum states using a quantum encoder to obtain image feature quantum states;
[0012] A training module, suitable for training the generator and the discriminator according to the quantum state of the image features to obtain a trained quantum generative adversarial network;
[0013] A generation module suitable for generating images using quantum generative adversarial networks.
[0014] According to another aspect of the embodiment of the present application, there is provided a computing device, including: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0015] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the above-mentioned image generation method based on quantum generative adversarial network.
[0016] According to another aspect of an embodiment of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned image generation method based on quantum generative adversarial network.
[0017] According to the image generation method, device, computing device and computer storage medium based on quantum generative adversarial network provided by the embodiments of the present application, the quantum generative adversarial network is implemented by training the characteristic quantum state of the image, and the generator and discriminator in the quantum generative adversarial network are trained and adjusted to obtain a quantum generative adversarial network with stable performance; the training mode is simple, and the quantum state used only requires a small number of quantum bits to express, which can break through the pain point of the traditional generative adversarial network with a large number of parameters, and solve the problems that the traditional generative adversarial network does not require pre-modeling, is too free, and leads to difficulty in training convergence, instability, and too small gradients. It has the advantage of achieving the stabilization effect of the discriminator and the generator in a unified manner; the scheme can quickly and conveniently generate the expected image through the quantum generative adversarial network, provides a new image generation scheme, and is different from the traditional method running in classical computers. The scheme can be adapted to run in electronic computers and quantum computer mode forms, has a wide range of usage scenarios, and is conducive to faster and better generation of expected images in quantum computing systems.
[0018] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation method of the embodiment of the present application is listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only used for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the embodiments of the present application. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0020] Figure 1 A schematic diagram of a process of an image generation method based on a quantum generative adversarial network according to an embodiment of the present application is shown;
[0021] Figure 2a A schematic diagram of a quantum state electronic circuit of a target is shown;
[0022] Figure 2b A circuit diagram of a generator is shown;
[0023] Figure 2c A circuit diagram of a discriminator is shown;
[0024] Figure 2d A schematic diagram of the image of the generated number 2 is shown;
[0025] Figure 2e A schematic diagram of an image of the generated number 6 is shown;
[0026] Figure 3 A structural block diagram of an image generation device based on a quantum generative adversarial network according to an embodiment of the present application is shown;
[0027] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0029] Figure 1 A schematic diagram of a process of an image generation method based on a quantum generative adversarial network according to an embodiment of the present application is shown. Figure 1 As shown, the method comprises the following steps:
[0030] Step S101, extracting feature vectors of sample images in a training sample set, and converting the feature vectors into quantum states using a quantum encoder to obtain image feature quantum states.
[0031] In this embodiment, quantum coding is used to convert classical data into quantum state form, and the target quantum state (i.e., image feature quantum state), generated quantum state and discriminated quantum state are defined in the form of quantum state. In the process of defining the model, a quantum generative adversarial network is used as the main model of the neural network. Since the quantum computing process has a natural probabilistic characteristic, the defined generated quantum state is exactly the probability distribution data required by the generative adversarial network.
[0032] Among them, the training sample set contains a large number of sample images, and the sample images may include images of numbers 1, 2, etc., or other images, such as images of letters, images of text, etc., which are not limited here; select a sample image from the training sample set, then extract the feature vector of the sample image, and use a quantum encoder to convert the extracted feature vector of the sample image into a quantum state, thereby obtaining the image feature quantum state. Since a quantum state is generated in the actual physical world, it will collapse into a certain eigenstate due to quantum characteristics after observation, which is different from the actually generated quantum state. Therefore, in this step, the quantum state generated by the feature vector of the sample image is defined as a mixed state, and its density operator is set to β.
[0033] Specifically, a quantum encoder can be used to calculate the distance between the feature vector of the sample image and each standard feature vector in the standard database, and the image feature quantum state can be determined according to the distance between the feature vector and each standard feature vector in the standard database, wherein each standard feature vector corresponds to a standard image.
[0034] Step S102: training the generator and the discriminator according to the image feature quantum state to obtain a trained quantum generative adversarial network.
[0035] Among them, the randomly generated noise data is input into the generator to obtain the generated quantum state; the discriminator is used to discriminate the image feature quantum state and the generated quantum state to obtain the discrimination result; according to the discrimination result, the loss function of the generator and the loss function of the discriminator, the parameters of the generator and the discriminator are adjusted to obtain the trained quantum generative adversarial network. The generator is used to generate the generated quantum state, and the discriminator is used to determine whether the input data is the generated quantum state generated by the generator or the real data (i.e., the image feature quantum state).
[0036] Use noise data at the input of the generator G and define the ensemble as ρ z =∑ i p i | i > <z i |, at this time, the random noise of each input is |z i >, so the quantum state after input to the generator G is |x>=G|z i >.
[0037] The implementation method of generator G is shown in the following example: Assume that the input of generator G is a pure quantum state |0>, then the quantum state electronic circuit of the generated target can be Figure 2a In addition, the schematic diagram of the generator G circuit can be as shown Figure 2b As shown, the schematic diagram of the discriminator D circuit can be as follows Figure 2c As shown in the figure, ω0, ω1, θ0~θ8, φ0~φ8 are all parameters.
[0038] Measure the quantum state output by the discriminator D. At this time, the probability of generating the target quantum state is P D , the target’s discriminant quantum state probability is P G , which is the output result of the generator and the discriminator.
[0039] Next, we can perform quantum generative adversarial network on the image data. Let the image feature quantum state be |ψ>, and the generated quantum state of generator D be |x>=G|0...0>, where the number of 0s represents the number of quantum bit circuits, and the 0th quantum bit is the generated quantum state.
[0040] Among them, when the discriminator is used to discriminate the image feature quantum state, the image feature quantum state is input into the discriminator, and the Pauli Z gate is used to measure the quantum bit to obtain the discriminator's discrimination result for the image feature quantum state. The Pauli Z gate is a quantum logic gate, which is the basis of quantum circuits. Quantum logic gates also include Hadamard gates (H gates, Hadamard gates), Pauli X gates (X gates), Pauli Y gates (Y gates), RX gates, RY gates, RZ gates, etc.
[0041] For example, the input data of the discriminator D is defined as the quantum state |φ>. When the image feature quantum state is input, At this time, the generated state of the image feature is expressed as Using the Pauli Z gate to measure the last quantum bit of |0...0>, we can get the discriminant result of the image feature quantum state, that is, the generation probability of the image feature quantum state output by the discriminator. The above process can be defined by mathematical formula as The measurement result is defined as UM_out == <φ|M z |φ>, the probability of the image feature quantum state is P = (UM _out +1) / 2.
[0042] Define the loss function of the generator G as loss G =-P G (θ, φ), the loss function of the discriminator D is loss D =P G (θ,φ)-P T (φ), where θ and φ are the specific parameters of the generator and discriminator circuits respectively. The discriminator and generator can be trained alternately by continuously optimizing the loss function of the input image feature quantum state.
[0043] The distance between the matrix density of the image feature quantum state and the matrix density of the generated quantum state is calculated, and the fidelity of the quantum state is determined; whether the convergence condition is met is determined based on the distance and the fidelity; if the convergence condition is met, the trained quantum generative adversarial network is obtained. For example, the convergence condition may include that the distance is less than a preset distance threshold and the fidelity is greater than a preset fidelity threshold.
[0044] Assume that the matrix density of the image feature quantum state is ρ T , the matrix density of the generated quantum state is ρ G , calculate the distance tr[(ρ T -ρ G ) 2By measuring the fidelity of the quantum state and discriminating the fidelity of the quantum state, we can know whether the generated quantum state generated by the generator is similar to the image feature quantum state of the input sample image, and then judge whether the features of the final generated image and the input sample image are strongly similar. After adjusting the parameters between the generator and the discriminator, the performance is becoming more and more stable, the convergence effect is very good, and the convergence conditions are met. The feature vector of the final generated image can be very similar to the feature vector of the real image.
[0045] Step S103, generating an image using a quantum generative adversarial network.
[0046] The trained quantum generative adversarial network obtained after training and parameter tuning can generate very clear images. Figure 2d and Figure 2e Schematic diagrams of the generated images of the numbers 2 and 6 are shown respectively, as shown in Figure 2d and Figure 2e As shown, the generated images of the numbers 2 and 6 are clear and can be distinguished clearly and conveniently, which is helpful for use in fields such as verification codes.
[0047] According to the image generation method based on quantum generative adversarial network provided by the embodiment of the present application, the quantum generative adversarial network is implemented by training the characteristic quantum state of the image, and the generator and discriminator in the quantum generative adversarial network are trained and adjusted to obtain a quantum generative adversarial network with stable performance; the training mode is simple, and the quantum state used only requires a small number of quantum bits to express, which can break through the pain point of the traditional generative adversarial network with a large number of parameters, and solve the problems that the traditional generative adversarial network does not require pre-modeling, is too free, and leads to difficulty in training convergence, instability, and too small gradients. It has the advantage of achieving the stabilization effect of the discriminator and the generator in a unified manner; the scheme can quickly and conveniently generate the expected image through the quantum generative adversarial network, provides a new image generation scheme, and is different from the traditional method running in classical computers. The scheme can be adapted to run in electronic computers and quantum computer modes, has a wide range of usage scenarios, and is conducive to faster and better generation of expected images in quantum computing systems.
[0048] Figure 3 FIG. 1 shows a structural block diagram of an image generation device based on a quantum generative adversarial network according to an embodiment of the present application. Figure 3 As shown, the device includes: an encoding module 301, a training module 302 and a generating module 303.
[0049] The encoding module 301 is adapted to extract feature vectors of sample images in the training sample set, and convert the feature vectors into quantum states using a quantum encoder to obtain image feature quantum states.
[0050] The training module 302 is suitable for: training the generator and the discriminator according to the quantum state of the image features to obtain a trained quantum generative adversarial network.
[0051] The generation module 303 is adapted to generate an image using a quantum generative adversarial network.
[0052] Optionally, the encoding module 301 is further adapted to: calculate the distance between the feature vector and each standard feature vector in the standard database using a quantum encoder; and determine the image feature quantum state according to the distance between the feature vector and each standard feature vector in the standard database.
[0053] Each of the standard feature vectors corresponds to a standard image.
[0054] Optionally, the training module 302 is further adapted to: input randomly generated noise data into the generator to obtain a generated quantum state; use a discriminator to discriminate between the image feature quantum state and the generated quantum state to obtain a discrimination result; and adjust the parameters of the generator and the discriminator according to the discrimination result, the loss function of the generator, and the loss function of the discriminator to obtain a trained quantum generative adversarial network.
[0055] Optionally, the training module 302 is further adapted to: when using the discriminator to discriminate the image feature quantum state, the image feature quantum state is input into the discriminator, and the qubit is measured using the Pauli Z gate to obtain the discriminator's discrimination result for the image feature quantum state.
[0056] Optionally, the training module 302 is further adapted to: calculate the distance between the matrix density of the image feature quantum state and the matrix density of the generated quantum state and determine the fidelity of the quantum state; determine whether the convergence condition is met based on the distance and the fidelity; if the convergence condition is met, obtain a trained quantum generative adversarial network.
[0057] The description of each module above refers to the corresponding description in the method embodiment and will not be repeated here.
[0058] According to the image generation device based on quantum generative adversarial network provided by the embodiment of the present application, the quantum generative adversarial network is implemented by training the characteristic quantum state of the image, and the generator and discriminator in the quantum generative adversarial network are trained and adjusted to obtain a quantum generative adversarial network with stable performance; the training mode is simple, and the quantum state used only requires a small number of quantum bits to express, which can break through the pain point of the traditional generative adversarial network with a large number of parameters, and solve the problems that the traditional generative adversarial network does not require pre-modeling, is too free, and leads to difficulties in training convergence, instability, and too small gradients. It has the advantage of achieving the stabilization effect of the discriminator and the generator in a unified manner; the scheme can quickly and conveniently generate the expected image through the quantum generative adversarial network, provides a new image generation scheme, and is different from the traditional method running in classical computers. The scheme can be adapted to run in electronic computers and quantum computer modes, has a wide range of usage scenarios, and is conducive to faster and better generation of expected images in quantum computing systems.
[0059] An embodiment of the present application also provides a non-volatile computer storage medium, which stores at least one executable instruction, and the executable instruction can execute the image generation method based on quantum generative adversarial network in any of the above method embodiments.
[0060] Figure 4 A schematic diagram of the structure of a computing device according to an embodiment of the present application is shown, and the specific implementation of the embodiment of the present application does not limit the specific implementation of the computing device.
[0061] like Figure 4 As shown, the computing device may include: a processor (processor) 402 , a communications interface (Communications Interface) 404 , a memory (memory) 406 , and a communication bus 408 .
[0062] in:
[0063] The processor 402 , the communication interface 404 , and the memory 406 communicate with each other via a communication bus 408 .
[0064] The communication interface 404 is used to communicate with other devices such as clients or other servers.
[0065] The processor 402 is used to execute the program 410, and specifically can execute the relevant steps in the above-mentioned embodiment of the image generation method based on quantum generative adversarial network.
[0066] Specifically, the program 410 may include program codes, which include computer operation instructions.
[0067] The processor 402 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0068] The memory 406 is used to store the program 410. The memory 406 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0069] Program 410 can be specifically used to enable processor 402 to execute the image generation method based on quantum generative adversarial network in any of the above-mentioned method embodiments. The specific implementation of each step in program 410 can refer to the corresponding description in the corresponding steps and units in the above-mentioned image generation embodiment based on quantum generative adversarial network, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the aforementioned method embodiment, which will not be repeated here.
[0070] The algorithm and display provided herein are not inherently related to any specific computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present application embodiment described herein, and the above description of specific languages is to disclose the best mode of implementation of the present application embodiment.
[0071] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0072] Similarly, it should be understood that in order to streamline the present disclosure and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed embodiments of the present application require more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the embodiment of the present application.
[0073] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0074] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the embodiments of the present application and to form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0075] The various component embodiments of the embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The embodiments of the present application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the embodiments of the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0076] It should be noted that the above embodiments illustrate rather than limit the embodiments of the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The embodiments of the present application may be implemented by means of hardware including several different elements and by means of appropriately programmed computers. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names.
Claims
1. An image generation method based on quantum generative adversarial network, It is characterized in that include: Extracting feature vectors of sample images in a training sample set, converting the feature vectors into quantum states using a quantum encoder, and obtaining image feature quantum states; According to the image feature quantum state, the generator and the discriminator are trained to obtain a trained quantum generative adversarial network; Generate an image using the quantum generative adversarial network; Wherein, the step of converting the feature vector into a quantum state by using a quantum encoder to obtain an image feature quantum state further comprises: Using a quantum encoder, calculating the distance between the feature vector and each standard feature vector in a standard database; Determining the image feature quantum state according to the distance between the feature vector and each standard feature vector in a standard database; The step of training the generator and the discriminator according to the image feature quantum state to obtain the trained quantum generative adversarial network further comprises: Inputting randomly generated noise data into the generator to obtain a generated quantum state; Using the discriminator to discriminate the image feature quantum state and the generated quantum state to obtain a discrimination result; According to the discrimination result, the loss function of the generator and the loss function of the discriminator, the parameters of the generator and the discriminator are adjusted to obtain a trained quantum generative adversarial network; Before obtaining the trained quantum generative adversarial network, the method further includes: Calculating the distance between the matrix density of the image feature quantum state and the matrix density of the generated quantum state and determining the fidelity of the quantum state; Determining whether a convergence condition is satisfied according to the distance and the fidelity; The step of obtaining a trained quantum generative adversarial network further includes: if a convergence condition is met, obtaining a trained quantum generative adversarial network.
2. The method according to claim 1, It is characterized in that Each of the standard feature vectors corresponds to a standard image.
3. The method according to claim 1, It is characterized in that The using the discriminator to discriminate the image feature quantum state and the generated quantum state to obtain a discrimination result further comprises: When the discriminator is used to discriminate the image feature quantum state, the image feature quantum state is input into the discriminator, and the Pauli Z gate is used to measure the quantum bit to obtain the discriminator's discrimination result for the image feature quantum state.
4. An image generation device based on quantum generative adversarial network, It is characterized in that include: An encoding module, adapted to extract a feature vector of a sample image in a training sample set, and convert the feature vector into a quantum state using a quantum encoder to obtain an image feature quantum state; A training module, adapted to train the generator and the discriminator according to the image feature quantum state to obtain a trained quantum generative adversarial network; A generation module, adapted to generate an image using the quantum generative adversarial network; The encoding module is further adapted to: calculate the distance between the feature vector and each standard feature vector in the standard database using a quantum encoder; determine the image feature quantum state according to the distance between the feature vector and each standard feature vector in the standard database; The training module is further adapted to: input randomly generated noise data into the generator to obtain a generated quantum state; use the discriminator to discriminate the image feature quantum state and the generated quantum state to obtain a discrimination result; According to the discrimination result, the loss function of the generator and the loss function of the discriminator, the parameters of the generator and the discriminator are adjusted to obtain a trained quantum generative adversarial network; The training module is further suitable for: calculating the distance between the matrix density of the image feature quantum state and the matrix density of the generated quantum state and determining the fidelity of the quantum state; judging whether the convergence condition is met according to the distance and the fidelity; if the convergence condition is met, obtaining a trained quantum generative adversarial network.
5. A computing device, include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the image generation method based on quantum generative adversarial network as described in any one of claims 1 to 3.
6. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the image generation method based on a quantum generative adversarial network as described in any one of claims 1 to 3.
