Image processing method and system based on quantum generative adversarial network

By adopting a method based on quantum generative adversarial networks in image processing, utilizing the characteristics of quantum states and multi-layer quantum gate operations, the problems of model collapse and low efficiency of traditional generative adversarial networks are solved, and high-quality and efficient image reconstruction is achieved. Effect.

CN118799425APending Publication Date: 2024-10-18MIANYANG CENT HOSPITAL
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410777849.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Traditional generative adversarial networks have problems such as model collapse, low convergence, inability to effectively handle discrete data, and vanishing gradients in image processing. They are especially inefficient and costly in medical image reconstruction.

Method used

Using a method based on quantum generative adversarial networks, image information is encoded into quantum states through angle coding, and the entanglement and superposition properties of qubits are used to build a classical generator and quantum discriminator, and the quantum state representation is enhanced through multi-layer quantum gate operations. Optimize parameters to produce high quality images.

Benefits of technology

The quality and efficiency of image generation are significantly improved, and the same effect of multiple cycles can be reconstructed with a small number of CTA images, solving the efficiency and cost problems of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799425A_ABST
    Figure CN118799425A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to an image processing method and system based on a quantum generative adversarial network, and the method comprises the steps: constructing a training sample set which comprises a plurality of sample images, coding the image information of the sample images into a quantum state in an angle coding manner, and obtaining an image feature quantum state; according to the image feature quantum state, training the built classic generator and quantum discriminator to obtain a trained quantum generative adversarial network; and generating an image by using the quantum generative adversarial network. Image information is coded to a quantum state by adopting an angle coding mode, a quantum generative adversarial network composed of a classic generator and a quantum discriminator is trained based on the obtained image feature quantum state, and the quantum state of the classic generator and the quantum discriminator is obtained by utilizing the entanglement characteristic and the superposition characteristic of quantum bits and the parallelism of quantum calculation. The problems of model collapse, low convergence, incapability of effectively processing discrete data, gradient disappearance and the like of a traditional generative adversarial network are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image processing method and system based on a quantum generative adversarial network. Background Art

[0002] Generative adversarial networks are currently a major method for image generation. Since the generative adversarial network (GAN) was proposed by Ian Goodfellow and others in 2014, it has received increasing attention from academia and industry. With the rapid development of the theory and model of generative adversarial networks, it has been increasingly applied in computer vision, natural language processing, human-computer interaction and other fields, and continues to extend to other fields. Among them, generative adversarial networks have achieved great success in image generation, which depends on the generative adversarial network's continuous improvement of modeling capabilities under the game, and ultimately achieves the generation of realistic images.

[0003] The basic idea of ​​traditional generative adversarial networks is to achieve data generation tasks by letting two neural networks compete with each other. One of the networks is called the generator, and its goal is to generate false data similar to real data. The other network is called the discriminator, and its goal is to distinguish between real data and false data. The two networks compete with each other and constantly adjust parameters, so as to eventually generate false data with high quality and diversity. Inspired by GAN, the quantum version of quantum generative adversarial network (QGAN) was proposed, hoping to use the entanglement and superposition characteristics of quantum bits, as well as the parallelism of quantum computing, to solve the problems of model collapse, low convergence, inability to effectively process discrete data and gradient disappearance of traditional generative adversarial networks, and achieve better results in the field of image generation.

[0004] However, the technology of quantum generative adversarial networks is not yet mature. For example, in the field of medical imaging, it is often necessary to take multi-cycle CTA images and reconstruct them for doctors to evaluate, which is time-consuming, labor-intensive, and costly. Based on this, the present invention intends to propose a new image processing technology based on quantum generative adversarial networks, which can reconstruct the same effect of multiple cycles through CTA images with as few cycles as possible. Summary of the invention

[0005] The purpose of the present invention is to provide an image processing method and system based on quantum generative adversarial networks to solve the problems of model collapse, low convergence, inability to effectively process discrete data and gradient disappearance of traditional generative adversarial networks in image processing.

[0006] To achieve the above object, the present invention provides an image processing method based on quantum generative adversarial network, comprising the following steps:

[0007] Constructing a training sample set, wherein the training sample set includes a plurality of sample images, encoding image information of the sample images into quantum states by using angle encoding to obtain image feature quantum states;

[0008] According to the image feature quantum state, the constructed classical generator and quantum discriminator are trained to obtain a trained quantum generative adversarial network;

[0009] An image is generated using the quantum generative adversarial network.

[0010] Optionally, the step of constructing a training sample set further includes:

[0011] Import the original image data and perform data augmentation operations.

[0012] Optionally, the method of using angle encoding further includes:

[0013] The image information is mapped to a quantum state and encoded through multi-layer quantum gate operations to obtain the image feature quantum state.

[0014] Optionally, the step of mapping the image information to a quantum state and encoding it through multi-layer quantum gate operations to obtain the image feature quantum state further includes:

[0015] Convert the sample image into a grayscale image and normalize the grayscale value of each pixel;

[0016] Providing a plurality of quantum bits, wherein the quantum bits correspond one-to-one to pixels of the grayscale image, and initializing all the quantum bits to a ground state;

[0017] For each normalized grayscale value, calculate the corresponding rotation angle;

[0018] Based on the corresponding rotation angle, the grayscale value of each pixel is converted into a quantum state for each quantum bit through multi-layer quantum gate operations, and the image feature quantum state is a collection of quantum states corresponding to all pixels.

[0019] Optionally, the classic generator is built using the method of building a classic generator in a deep convolutional generative adversarial network, and the convolutional layer therein is replaced with a transposed convolutional layer.

[0020] Optionally, the step of training the constructed classical generator and quantum discriminator according to the image feature quantum state to obtain a trained quantum generative adversarial network specifically includes:

[0021] Inputting randomly generated noise data into the classical generator to obtain classical data;

[0022] Encoding the classical data into a quantum state by using angle encoding to obtain a generated quantum state;

[0023] Using the quantum discriminator to discriminate the generated quantum state and the image feature quantum state to obtain a discrimination result;

[0024] According to the discrimination result, the loss function of the classical generator and the loss function of the quantum discriminator, the parameters of the classical generator and the quantum discriminator are optimized to obtain a trained quantum generative adversarial network.

[0025] Optionally, a back-propagation algorithm and a gradient descent method are used to optimize the parameters of the classical generator and the quantum discriminator.

[0026] Based on the same technical concept, the present invention also provides an image processing system based on a quantum generative adversarial network, comprising:

[0027] The encoding module is configured to construct a training sample set, wherein the training sample set includes a plurality of sample images, and encode the image information of the sample images into quantum states by using angle encoding to obtain image feature quantum states;

[0028] A training module is configured to train the constructed classical generator and quantum discriminator according to the image feature quantum state to obtain a trained quantum generative adversarial network;

[0029] A generation module is configured to generate an image using the quantum generative adversarial network.

[0030] Optionally, the encoding module is further configured to:

[0031] Convert the sample image into a grayscale image and normalize the grayscale value of each pixel;

[0032] Providing a plurality of quantum bits, wherein the quantum bits correspond one-to-one to pixels of the grayscale image, and initializing all the quantum bits to a ground state;

[0033] For each normalized grayscale value, calculate the corresponding rotation angle;

[0034] Based on the corresponding rotation angle, the grayscale value of each pixel is converted into a quantum state for each quantum bit through multi-layer quantum gate operations, and the image feature quantum state is a collection of quantum states corresponding to all pixels.

[0035] Based on the same technical concept, the present invention also provides a readable storage medium on which a computer program is stored. When the computer program is executed, it can implement the image processing method based on the quantum generative adversarial network as described above.

[0036] In the image processing method and system based on quantum generative adversarial network provided by the present invention, at least one of the following beneficial effects is achieved:

[0037] 1) By using angle coding to encode the image information of the sample image into a quantum state, the quantum generative adversarial network composed of the classical generator and the quantum discriminator is trained based on the obtained image feature quantum state, and the entanglement and superposition characteristics of quantum bits and the parallelism of quantum computing are utilized to solve the problems of model collapse, low convergence, inability to effectively process discrete data and gradient disappearance of the traditional generative adversarial network, so as to achieve better results in image generation;

[0038] 2) A multi-layer angle encoding strategy is adopted to enhance the richness of quantum state representation through multi-layer quantum gate operations, improve the expressiveness of quantum states, enhance the capture of image details, and help generate and discriminate higher quality images;

[0039] 3) Compared with the full quantum generative adversarial network and quantum generator + classical discriminator structure, the present invention adopts the classical generator + quantum discriminator structure. The classical generator has greater flexibility and expressiveness in generating classical samples and is efficient in processing classical data and tasks. The quantum discriminator specifically discriminates quantum states and is sensitive to the characteristics of quantum states. It can more accurately evaluate the difference between the generated quantum state and the target state, thereby providing a more reliable discrimination result. In addition, the classical generator runs on a classical computer, while the quantum discriminator runs on a quantum computer, so that the respective computing resources are fully utilized, thereby improving the overall performance and efficiency;

[0040] 4) The CTA cycle can be significantly reduced, and only one cycle or fewer cycles of CTA images are needed to reconstruct the same effect as multiple cycles. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Those skilled in the art will appreciate that the accompanying drawings are provided for a better understanding of the present invention and do not constitute any limitation on the scope of the present invention.

[0042] Figure 1 A flowchart of an image processing method based on a quantum generative adversarial network provided by one embodiment of the present invention;

[0043] Figure 2 A schematic diagram of a classic generator deconvolution process provided by an embodiment of the present invention;

[0044] Figure 3 A schematic diagram of a transposed convolution provided by an embodiment of the present invention;

[0045] Figure 4A schematic diagram of a quantum circuit of a quantum discriminator provided by an embodiment of the present invention;

[0046] Figure 5 This is a rendering of a single-phase CTA image provided by an embodiment of the present invention;

[0047] Figure 6 A diagram showing the generation effect of a multi-cycle CTA image provided by an embodiment of the present invention;

[0048] Figure 7 A structural block diagram of an image processing system based on a quantum generative adversarial network provided by one embodiment of the present invention.

[0049] In the attached figure:

[0050] 100- encoding module; 200- training module; 300- generation module. DETAILED DESCRIPTION

[0051] In order to make the purpose, advantages and features of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the accompanying drawings are in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, please refer to the accompanying drawings. It should be noted that the structure, proportion, size, etc. illustrated in the drawings of this specification are only used to match the content disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention. Any modification of the structure, change in the proportional relationship or adjustment of the size, under the same or similar conditions as the effects that can be produced by the present invention and the purposes that can be achieved, should still fall within the scope of the technical content disclosed by the present invention.

[0052] As used in the present invention, the singular forms "one", "an", and "the" include plural objects, unless the content clearly indicates otherwise. As used in the present invention, the term "or" is generally used in a sense that includes "and / or", unless the content clearly indicates otherwise. As used in the present invention, the term "several" is generally used in a sense that includes "at least one", unless the content clearly indicates otherwise. As used in the present invention, the term "at least two" is generally used in a sense that includes "two or more", unless the content clearly indicates otherwise. In addition, the terms "first", "second", and "third" are used only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first", "second", and "third" may explicitly or implicitly include one or at least two of the features.

[0053] In the description of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", and "fixed" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0054] Please refer to Figure 1 , an embodiment of the present invention provides an image processing method based on a quantum generative adversarial network, comprising the following steps:

[0055] S1. Construct a training sample set, wherein the training sample set includes a number of sample images, and encode the image information of the sample images into quantum states by using angle encoding to obtain image feature quantum states;

[0056] S2. According to the image feature quantum state, the constructed classical generator and quantum discriminator are trained to obtain a trained quantum generative adversarial network;

[0057] S3. Generate an image using the quantum generative adversarial network.

[0058] The image information of the sample image is encoded into a quantum state by adopting angle encoding, and the quantum generative adversarial network composed of the classical generator and the quantum discriminator is trained based on the obtained image feature quantum state. The entanglement and superposition characteristics of quantum bits and the parallelism of quantum computing are utilized to solve the problems of model collapse, low convergence, inability to effectively process discrete data and gradient vanishing of traditional generative adversarial networks, thereby achieving better results in image generation.

[0059] First, S1 is executed to construct a training sample set, wherein the training sample set includes a number of sample images, and image information of the sample images is encoded into a quantum state by using angle encoding to obtain an image feature quantum state.

[0060] In a preferred embodiment, the step of constructing a training sample set further includes:

[0061] Import the original image data and perform data augmentation operations.

[0062] Before performing the image generation task, it is necessary to first import the training sample set and pre-process the training sample set. At present, there are many training sample sets that can be used for image generation tasks, such as MINIST, FMINIST, CIFAR-10, CELEBA, etc., and the present invention is not limited to this. In this embodiment, the training sample set is preferably a CTA data set. CTA (Computed Tomography Angiography) refers to a non-invasive vascular imaging technology. It is a reconstruction method performed after enhanced CT scanning. Simply put, a certain amount of contrast agent is injected into the blood vessel during scanning to fill the vascular cavity and collect its data. Then, after computer reconstruction processing, the content of the non-interest area is deleted, only the image of the blood vessel is retained, and the overall and multi-angle reconstruction is performed.

[0063] In this embodiment, the preprocessing of the CTA dataset can be divided into two steps: one is to construct a training sample set; the other is a data loader. The training sample set is constructed to import the original image data and perform a series of data enhancement operations, including image resizing, center cropping, conversion to tensor, and normalization. The data loader is to load data in batches for subsequent model training or reasoning.

[0064] Then, the image information of the sample image is encoded into a quantum state by using angle coding to obtain an image feature quantum state. The angle coding is a method of encoding image information using the phase of a quantum bit, and is a method of mapping image information to a quantum state, in which the pixel value is encoded by calculating the rotation angle. In angle coding, different phases represent different image information, and by changing the phase angle, the image information can be encoded and stored in the quantum state.

[0065] The method of adopting angle coding further includes:

[0066] The image information is mapped to a quantum state, and encoded through multi-layer quantum gate operations to obtain the image feature quantum state. For example, the H gate is used to create a quantum superposition state, and then the image data is encoded through quantum gates such as RY and RZ gates to convert the image information into a quantum rotation angle. Compared with traditional angle coding, the present invention adopts a multi-layer angle coding strategy, which enhances the richness of quantum state representation through multi-layer quantum gate operations, improves the expressive power of quantum states, enhances the capture of image details, and helps to generate and discern higher quality images.

[0067] In this embodiment, the step of mapping the image information to a quantum state and encoding it through multi-layer quantum gate operations to obtain the image feature quantum state further includes:

[0068] Convert the sample image into a grayscale image and normalize the grayscale value of each pixel;

[0069] Providing a plurality of quantum bits, wherein the quantum bits correspond one-to-one to pixels of the grayscale image, and initializing all the quantum bits to a ground state;

[0070] For each normalized grayscale value, calculate the corresponding rotation angle;

[0071] Based on the corresponding rotation angle, the grayscale value of each pixel is converted into a quantum state for each quantum bit through multi-layer quantum gate operations, and the image feature quantum state is a collection of quantum states corresponding to all pixels.

[0072] In a specific embodiment, assuming that the sample image size is M×N, there are M×N pixels in total, and the grayscale value range of each pixel is 0 to 255, then M×N quantum bits are required. The grayscale value of each pixel is normalized, and the grayscale value p of each pixel is ij Standardized to the interval [0,1], denoted as p′ ij , for each normalized pixel value p′ ij , calculate the corresponding rotation angle θ ij , then θ ij =π·p′ ij After initializing all quantum bits to the ground state |0>, for each quantum bit q ij , apply a revolving door R y (θ ij ). The revolving door R y (θ ij ) is a rotation about the y-axis, which rotates the quantum state from |0> to cos(θ ij / 2)|0>+sin(θ ij / 2)|1>, thus completing the encoding of the quantum state.

[0073] Then execute S2 to train the constructed classical generator and quantum discriminator according to the image feature quantum state to obtain a trained quantum generative adversarial network.

[0074] Furthermore, the step of training the constructed classical generator and quantum discriminator according to the image feature quantum state to obtain the trained quantum generative adversarial network specifically includes:

[0075] Inputting randomly generated noise data into the classical generator to obtain classical data;

[0076] Encoding the classical data into a quantum state by using angle encoding to obtain a generated quantum state;

[0077] Using the quantum discriminator to discriminate the generated quantum state and the image feature quantum state to obtain a discrimination result;

[0078] According to the discrimination result, the loss function of the classical generator and the loss function of the quantum discriminator, the parameters of the classical generator and the quantum discriminator are optimized to obtain a trained quantum generative adversarial network.

[0079] In this embodiment, the construction of the classic generator adopts the method of building a classic generator in a deep convolutional generative adversarial network (DCGAN) network, and the classic generator replaces the convolution layer with a deconvolution layer (or transposed convolution layer). Figure 2 As shown, in the classic generator, the BN layer (Batch Normalization) is used, the fully connected layer is removed, the input is a latent vector z, which is a normal distribution derived from the standard, and can output images of custom sizes. The transposed convolution layer is used to upsample the latent vector z to the required image size. The convolution kernels (Kernels) can be of various sizes to capture features of different scales. Except for the output layer using Tanh, other activation functions use ReLU to introduce nonlinearity. The generated image uses the Tanh activation function to map the output to the range of [-1,1].

[0080] For example, Figure 3 As shown in the figure, for the transposed convolution, the input is a 2×2 feature map, but some 0 elements are filled around it, the convolution kernel size is also 3×3, and the output is a 4×4 feature map, thus achieving upsampling of the feature map.

[0081] In this embodiment, the quantum discriminator is used to determine whether the input data is false data (generated quantum state) generated by the classical generator or real data (i.e., image feature quantum state). Figure 4 As shown, the quantum discriminator adopts a four-layer quantum circuit, using H gates, RY gates and CNOT gates, and superimposing multiple layers of parameterized gate operations to allow the circuit to obtain better representation capabilities. Each layer is composed of a series of H gates, RY gates and CNOT gates. The image features are extracted through the entanglement and superposition characteristics of the quantum state to improve the accuracy of image discrimination. Preferably, the quantum circuit can dynamically adjust the type and parameters of the quantum gate according to the input data, such as selecting different rotation angles or quantum gate combinations according to the data characteristics, thereby improving the flexibility and adaptability of the quantum circuit and ensuring the optimization effect on different training sample sets.

[0082] Furthermore, a multi-scale quantum convolution kernel is introduced into the quantum discriminator, and different levels of image features are captured through convolution kernels of different scales. The quantum convolution layer is composed of quantum convolution kernels of different sizes. The details and global features of the image are extracted through multi-layer convolution. The multi-scale quantum convolution enhances the feature extraction capability of the quantum discriminator, improves the sensitivity to image features of different scales, and enhances the accuracy of the discrimination results.

[0083] In this embodiment, the quantum generative adversarial network follows the idea of ​​two-party game in the traditional generative adversarial network, and the network model is composed of the classical generator and the quantum discriminator. Its training process is similar to that of the traditional generative adversarial network, which can be expressed by the following formula:

[0084]

[0085] Where x represents real data, z represents the latent vector, D(x) represents the probability of classifying real data as real data, G(z) represents generated data, and D(G(z)) represents the probability of classifying generated data as real data.

[0086] The loss function of the classic generator is recorded as:

[0087] LGG=H(1,D(G(z))

[0088] In the formula, G represents the classical generator, D represents the quantum discriminator, H represents the cross entropy, and z represents the random input noise data. D(G(z)) is the judgment probability of the generated data, 1 represents real data, and 0 represents false data. H(1, D(G(z)) represents the distance between the judgment structure and 1. The smaller the distance between D(G(z)) and 1, the better the generation effect.

[0089] The loss function of the quantum discriminator is recorded as:

[0090] Lp=H(1,D(x))+H(0,D(G(z)))

[0091] In the formula, x is the real data. It should be noted that H(1, D(x)) represents the distance between the real data and 1, and H(0, D(G(z))) represents the distance between the generated data and 0. The smaller the distance between D(x) and 1 and the smaller the distance between D(G(z)) and 0, the better the discrimination effect.

[0092] The training process of the quantum generative adversarial network is a process of parameter optimization. The classical generator and the quantum discriminator can adjust and optimize the parameters based on their respective loss functions using an error back propagation algorithm and an optimization method (such as a gradient descent method) to continuously improve the performance of the generator network and the discriminator network.

[0093] Specifically, the training process includes:

[0094] S31. Initialization parameters: Use a random initialization method to set initial parameters for the classical generator and the quantum discriminator, such as Gaussian distribution or uniform distribution.

[0095] S32, iterative training: in each iteration, the classical generator and the quantum discriminator are optimized alternately.

[0096] Specifically, first fix the classical generator and optimize the quantum discriminator:

[0097] (1) Randomly extract a small batch of real images from the training sample set;

[0098] (2) Generate a small batch of fake images using the classic generator;

[0099] (3) Mixing the real image and the generated image and inputting the mixed image into the quantum discriminator;

[0100] (4) Calculate the loss function of the quantum discriminator and back-propagate to update the parameters of the quantum discriminator.

[0101] Then fix the quantum discriminator and optimize the classical generator:

[0102] (1) Randomly extract a small batch of noise vectors from the latent space;

[0103] (2) Generate a small batch of fake images using the classic generator;

[0104] (3) inputting the generated false image into the quantum discriminator to obtain a discrimination result;

[0105] (4) Calculate the loss function of the classic generator and back-propagate to update the parameters of the classic generator.

[0106] S33, loss function calculation: calculate the loss function according to the discrimination results of the generated image and the real image.

[0107] S34. Parameter update: Use gradient descent method (Adam optimizer) to update the parameters of the classical generator and quantum discriminator.

[0108] S35: When the image generated by the classical generator is realistic enough and the quantum discriminator cannot accurately distinguish the generated image from the real image, the training ends. The entire training process is iterated repeatedly until the image generated by the classical generator is realistic enough and the quantum discriminator cannot accurately distinguish the generated image from the real image. The criterion for the end of training can be that the loss function of the classical generator and the loss function of the quantum discriminator both reach a stable state, or reach a preset number of iterations.

[0109] The following is the basic design idea of ​​quantization of the present invention:

[0110] 1. Image quantization: First, the real image is converted into a grayscale image and quantized, the grayscale value of each pixel is mapped to a suitable range and represented as the state of the quantum bit;

[0111] 2. Quantum convolution kernel design: Design a quantum convolution kernel, which contains a series of quantum gate operations. The design of the quantum convolution kernel needs to take into account the characteristics of the image and the required convolution operation. The quantum convolution kernel uses angle coding to encode the digitized image information into the quantum state of the quantum bit;

[0112] 3. Quantum gate operation: Based on the designed quantum convolution kernel, it is applied to the quantum image. In quantum computing, quantum gate operation is a basic tool for operating and transforming quantum bits. Hadamard gates, control gates, etc. can be used to implement image convolution operations.

[0113] 4. Quantum state measurement: After the convolution operation is completed, the quantum image can be measured to obtain the result of the generated image.

[0114] Compared with the full quantum generative adversarial network and the quantum generator + classical discriminator structure, the present invention adopts the classical generator + quantum discriminator structure, which has at least one of the following advantages:

[0115] 1) Flexibility: The classical generator is built based on the classical computing model, which has greater flexibility and expressiveness in generating classical samples, which enables the classical generator to process more complex data types, such as images, text, etc., rather than being limited to the generation of quantum states;

[0116] 2) Efficiency: The classical generator is usually run on a classical computer, which is efficient in processing classical data and tasks. Compared with a quantum computer, the training and inference of the classical generator can be completed more quickly, thereby improving the efficiency of generating samples.

[0117] 3) Sensitivity to quantum states: The quantum discriminator specifically discriminates quantum states and is sensitive to the characteristics of quantum states. It can more accurately evaluate the difference between the generated quantum state and the target state, thereby providing a more reliable discrimination result.

[0118] 4) Scalability: The classical generator + quantum discriminator structure can be more easily combined with existing classical generator and quantum discriminator technologies, which makes the structure more scalable and can utilize the latest research results in the field of classical generators and quantum discriminators.

[0119] 5) Resource utilization efficiency: Compared with the full quantum generative adversarial network, the classical generator + quantum discriminator structure can better utilize the advantages of classical computers and quantum computers. The classical generator runs on a classical computer, while the quantum discriminator runs on a quantum computer, so that their respective computing resources are fully utilized, thereby improving overall performance and efficiency.

[0120] like Figure 5-Figure 6 As shown, Figure 5 For single-phase CTA images, Figure 6 The effect of multi-cycle CTA images obtained by applying the image processing method based on quantum generative adversarial network proposed in the present invention to generate images. It can be seen that the present invention can significantly reduce the CTA cycle, and only one cycle or fewer cycles of CTA images are needed to reconstruct the same effect as multiple cycles.

[0121] Based on the same invention concept, please refer to Figure 7 The embodiment of the present invention further proposes an image processing system based on a quantum generative adversarial network, comprising:

[0122] The encoding module 100 is configured to construct a training sample set, wherein the training sample set includes a plurality of sample images, and encode the image information of the sample images into quantum states by using angle encoding to obtain image feature quantum states;

[0123] The training module 200 is configured to train the constructed classical generator and quantum discriminator according to the image feature quantum state to obtain a trained quantum generative adversarial network;

[0124] The generation module 300 is configured to generate an image using the quantum generative adversarial network.

[0125] Preferably, the step of constructing a training sample set further includes:

[0126] Import the original image data and perform data augmentation operations.

[0127] Preferably, the method of adopting angle encoding further includes:

[0128] The image information is mapped to a quantum state and encoded through multi-layer quantum gate operations to obtain the image feature quantum state.

[0129] Preferably, the encoding module 100 is further configured as follows:

[0130] Convert the sample image into a grayscale image and normalize the grayscale value of each pixel;

[0131] Providing a plurality of quantum bits, wherein the quantum bits correspond one-to-one to pixels of the grayscale image, and initializing all the quantum bits to a ground state;

[0132] For each normalized grayscale value, calculate the corresponding rotation angle;

[0133] Based on the corresponding rotation angle, the grayscale value of each pixel is converted into a quantum state for each quantum bit through multi-layer quantum gate operations, and the image feature quantum state is a collection of quantum states corresponding to all pixels.

[0134] Preferably, the classic generator is constructed using the method of constructing a classic generator in a deep convolutional generative adversarial network, and the convolutional layer therein is replaced with a transposed convolutional layer.

[0135] The training module 200 is further configured to:

[0136] Inputting randomly generated noise data into the classical generator to obtain classical data;

[0137] Encoding the classical data into a quantum state by using angle encoding to obtain a generated quantum state;

[0138] Using the quantum discriminator to discriminate the generated quantum state and the image feature quantum state to obtain a discrimination result;

[0139] According to the discrimination result, the loss function of the classical generator and the loss function of the quantum discriminator, the parameters of the classical generator and the quantum discriminator are optimized to obtain a trained quantum generative adversarial network.

[0140] Preferably, the back propagation algorithm and the gradient descent method are used to optimize the parameters of the classical generator and the quantum discriminator.

[0141] Based on the same inventive concept, an embodiment of the present invention also proposes a readable storage medium on which a computer program is stored. When the computer program is executed, it can implement the image processing method based on the quantum generative adversarial network as described above.

[0142] The readable storage medium can be a tangible device that can keep and store the instructions used by the instruction execution device, such as but not limited to an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device or any suitable combination thereof. The more specific example (non-exhaustive list) of the readable storage medium includes: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a convex structure in a groove on which instructions are stored, and any suitable combination thereof. The computer program described herein can be downloaded from the readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer program from the network and forwards the computer program for storage in the readable storage medium in each computing / processing device. The computer program for performing the operation of the present invention can be an assembly instruction, an instruction set architecture (ISA) instruction, a machine instruction, a machine-related instruction, a microcode, a firmware instruction, a state setting data, or a source code or object code written in any combination of one or more programming languages, including object-oriented programming languages-such as Smalltalk, C++, Python, etc., and conventional procedural programming languages-such as "C" language or similar programming languages. The computer program can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). In some embodiments, by utilizing the state information of a computer program to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute computer-readable program instructions to implement various aspects of the present invention.

[0143] Here, various aspects of the present invention are described with reference to the flowchart and / or block diagram of the method, system and computer program product according to the embodiment of the present invention. It should be understood that each square frame of the flowchart and / or block diagram and the combination of the square frames in the flowchart and / or block diagram can be realized by a computer program. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so as to produce a machine, so that these programs, when executed by the processor of a computer or other programmable data processing device, produce a device for realizing the function / action specified in one or more square frames in the flowchart and / or block diagram. These computer programs can also be stored in a readable storage medium, and these computer programs make the computer, programmable data processing device and / or other equipment work in a specific way, so that the readable storage medium storing the computer program includes a manufactured product, which includes instructions for realizing various aspects of the function / action specified in one or more square frames in the flowchart and / or block diagram.

[0144] The computer program may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are executed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the computer program executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0145] In summary, the embodiments of the present invention provide an image processing method and system based on a quantum generative adversarial network, which follows the idea of ​​two-party game in traditional generative adversarial networks and utilizes the entanglement and superposition characteristics of quantum bits and the parallelism of quantum computing to solve the problems of model collapse, low convergence, inability to effectively process discrete data and gradient disappearance of traditional generative adversarial networks, and achieves better results in image generation.

[0146] The above description is only a description of the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any changes and modifications made by a person skilled in the art in the field of the present invention based on the above disclosure are within the scope of protection of the present invention. Obviously, a person skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations fall within the scope of the present invention and its equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. An image processing method based on quantum generative adversarial network, characterized in that: The following steps are involved: Constructing a training sample set, wherein the training sample set includes a plurality of sample images, encoding image information of the sample images into quantum states by using angle encoding to obtain image feature quantum states; According to the image feature quantum state, the constructed classical generator and quantum discriminator are trained to obtain a trained quantum generative adversarial network; An image is generated using the quantum generative adversarial network.

2. The image processing method based on quantum generative adversarial network according to claim 1 is characterized in that: The steps of constructing a training sample set further include: Import the original image data and perform data augmentation operations.

3. The image processing method based on quantum generative adversarial network according to claim 1 is characterized in that: The method of adopting angle coding further includes: The image information is mapped to a quantum state and encoded through multi-layer quantum gate operations to obtain the image feature quantum state.

4. The image processing method based on quantum generative adversarial network according to claim 3 is characterized in that: The step of mapping the image information to a quantum state and encoding it through multi-layer quantum gate operations to obtain the image feature quantum state further includes: Convert the sample image into a grayscale image and normalize the grayscale value of each pixel; Providing a plurality of quantum bits, wherein the quantum bits correspond one-to-one to pixels of the grayscale image, and initializing all the quantum bits to a ground state; For each normalized grayscale value, calculate the corresponding rotation angle; Based on the corresponding rotation angle, the grayscale value of each pixel is converted into a quantum state for each quantum bit through multi-layer quantum gate operations, and the image feature quantum state is a collection of quantum states corresponding to all pixels.

5. The image processing method based on quantum generative adversarial network according to claim 1 is characterized in that: The classic generator is built using the method of building a classic generator in a deep convolutional generative adversarial network, and the convolutional layer therein is replaced with a transposed convolutional layer.

6. The image processing method based on quantum generative adversarial network according to claim 1 is characterized in that: The step of training the constructed classical generator and quantum discriminator according to the image feature quantum state to obtain the trained quantum generative adversarial network specifically includes: Inputting randomly generated noise data into the classical generator to obtain classical data; Encoding the classical data into a quantum state by using angle encoding to obtain a generated quantum state; Using the quantum discriminator to discriminate the generated quantum state and the image feature quantum state to obtain a discrimination result; According to the discrimination result, the loss function of the classical generator and the loss function of the quantum discriminator, the parameters of the classical generator and the quantum discriminator are optimized to obtain a trained quantum generative adversarial network.

7. The image processing method based on quantum generative adversarial network according to claim 1 is characterized in that: The back propagation algorithm and the gradient descent method are used to optimize the parameters of the classical generator and the quantum discriminator.

8. An image processing system based on quantum generative adversarial network, characterized in that: include: The encoding module is configured to construct a training sample set, wherein the training sample set includes a plurality of sample images, and encode the image information of the sample images into quantum states by using angle encoding to obtain image feature quantum states; A training module is configured to train the constructed classical generator and quantum discriminator according to the image feature quantum state to obtain a trained quantum generative adversarial network; A generation module is configured to generate an image using the quantum generative adversarial network.

9. The image processing system based on quantum generative adversarial network according to claim 8, characterized in that: The encoding module is further configured to: Convert the sample image into a grayscale image and normalize the grayscale value of each pixel; Providing a plurality of quantum bits, wherein the quantum bits correspond one-to-one to pixels of the grayscale image, and initializing all the quantum bits to a ground state; For each normalized grayscale value, calculate the corresponding rotation angle; Based on the corresponding rotation angle, the grayscale value of each pixel is converted into a quantum state for each quantum bit through multi-layer quantum gate operations, and the image feature quantum state is a collection of quantum states corresponding to all pixels.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, it can implement the image processing method based on quantum generative adversarial network according to any one of claims 1 to 7.

Citation Information

Cited By

  • Creative material automatic generation system and method based on AI

    CN120562493A