Image processing method and system based on pure quantum pulse neural network model
Through the image processing method based on pure quantum pulse neural network model, pulse rate encoding and quantum state feature signals are used to solve the problem of high computing requirements and inability to mine deep correlation in image processing in traditional deep learning networks, achieving low energy consumption, Efficient image processing and mining of depth association relationships.
Patent Information
- Application Number
- CN202410754327.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-06-12
AI Technical Summary
Traditional deep learning networks have problems such as high computing requirements, high hardware requirements and high model complexity in image processing, and pulsed neural networks cannot mine the deep correlation between image processing and image features.
The image processing method based on pure quantum pulse neural network model is adopted to encode the image through the pulse rate encoding method, and the relationship between the quantum state feature signal and the image category results are used to realize image classification, and the quantum is reduced through the maximum value measurement strategy. The energy consumption and operation times of the line.
On the premise of ensuring the accuracy of image processing results, reduce hardware energy consumption, process images quickly and efficiently, and dig out the depth correlation between image processing and image features.
Smart Images

Figure CN118628814B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and in particular relates to an image processing method and system based on a pure quantum pulse neural network model. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In the process of image processing (such as image classification tasks), traditional deep learning networks are generally used for image processing (such as image classification tasks). However, traditional deep learning networks generally have the following problems in the image processing process: due to the large amount of image sample data, the computing requirements are large, especially in the training process; the hardware requirements are high. In order to meet the computing requirements of deep learning, high-performance hardware devices such as graphics processing units (GPUs) or dedicated deep learning processors are often required; the model complexity is high. In order to improve the performance of deep learning models, researchers usually design more complex structures, which leads to more parameters and higher computational complexity.
[0004] Due to the above-mentioned problems of traditional deep learning networks, the Spiking Neural Network (SNN) solves the energy consumption problem of traditional deep learning networks, but it cannot explore the deep correlation between image processing and image features. Summary of the invention
[0005] In order to solve the above problems, the present invention provides an image processing method and system based on a pure quantum pulse neural network model, which can reduce hardware energy consumption and process images quickly and efficiently during the entire image processing process while ensuring the accuracy of the image processing results, and can also explore the deep correlation between image processing and image features.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] The first aspect of the present invention provides an image processing method based on a pure quantum pulse neural network model.
[0008] In one or more embodiments, an image processing method based on a pure quantum pulse neural network model is provided, comprising:
[0009] receiving an image to be processed;
[0010] Processing the image to be processed by using a pure quantum pulse neural network model to obtain a category of the image to be processed;
[0011] The step of processing the image to be processed using a pure quantum pulse neural network model includes:
[0012] The image to be processed is encoded using a pulse rate coding method that conforms to Poisson's theorem to obtain a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group with N time steps; wherein N is a positive integer greater than or equal to 2;
[0013] Encode the discrete pulse signal of the N*(2^number of quantum bits)-dimensional vector group of N time steps into the set quantum circuit to obtain the preliminary quantum state signal;
[0014] Selecting a set number of quantum state signals with maximum amplitude from the preliminary quantum state signals, and continuing to encode them into subsequent preset quantum circuits to obtain quantum state characteristic signals;
[0015] According to the known relationship between the quantum state characteristic signal and the image category result, the image category corresponding to the current quantum state characteristic signal is obtained.
[0016] As an implementation method, a zero-filled amplitude coding method is used to encode a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group of N time steps into a set quantum circuit.
[0017] The advantage of the above technical solution is that by stretching the image into a one-dimensional vector and filling it with 0, the vector dimension is kept consistent with the number of quantum amplitudes, thereby improving the accuracy of subsequent quantum state characteristic signals and thus improving the accuracy of image classification.
[0018] As an implementation method, the number of quantum state signals with maximum amplitude is selected from the preliminary quantum state signals to match the subsequent preset quantum circuit.
[0019] The advantage of the above technical solution is that it can better reduce the number of quantum bits used, significantly reduce the large number of running times consumed in quantum circuits due to measurements, and improve the model's ability to resist noise.
[0020] As an implementation method, the number of quantum state signals with the largest amplitude is selected from the preliminary quantum state signals as the hyperparameter of the subsequent preset quantum circuit; the learning process of the hyperparameter is:
[0021] Treat each subsequent quantum circuit as a whole for gradient calculation;
[0022] The gradient of the vanishing part is directly set to zero, so that the gradient calculation ends at the part where the gradient disappears; the remaining part where the gradient still exists continues to participate in the calculation;
[0023] Finally, the difference method is used to replace the partial derivative calculation to perform hyperparameter learning until the preset stopping condition is reached to obtain the final hyperparameters.
[0024] The advantage of the above technical solution is that it avoids the gradient vanishing problem in the back propagation process, which leads to the problem of training difficulties, improves the accuracy of hyperparameters, and thus improves the accuracy of image classification.
[0025] The second aspect of the present invention provides an image processing system based on a pure quantum pulse neural network model.
[0026] In one or more embodiments, an image processing system based on a pure quantum pulse neural network model is provided, comprising:
[0027] An image receiving module, which is used to receive an image to be processed;
[0028] An image processing module, which is used to process the image to be processed using a pure quantum pulse neural network model to obtain the category of the image to be processed;
[0029] Wherein, the image processing module further includes:
[0030] A pulse rate coding module, which is used to encode the image to be processed by a pulse rate coding method that conforms to Poisson's theorem to obtain a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group with N time steps; wherein N is a positive integer greater than or equal to 2;
[0031] A preliminary quantum state signal acquisition module is used to encode a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group of N time steps into a set quantum circuit to obtain a preliminary quantum state signal;
[0032] A quantum state characteristic signal encoding module is used to select a set number of quantum state signals with maximum amplitude from the preliminary quantum state signals, and continue to encode them into subsequent preset quantum circuits to obtain quantum state characteristic signals;
[0033] The image category determination module is used to obtain the image category corresponding to the current quantum state feature signal based on the known relationship between the quantum state feature signal and the image category result.
[0034] As an implementation mode, in the preliminary quantum state signal acquisition module, a zero-filled amplitude encoding method is used to encode a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group of N time steps into a set quantum circuit.
[0035] The advantage of the above technical solution is that by stretching the image into a one-dimensional vector and filling it with 0, the vector dimension is kept consistent with the number of quantum amplitudes, thereby improving the accuracy of subsequent quantum state characteristic signals and thus improving the accuracy of image classification.
[0036] As an implementation mode, in the quantum state characteristic signal encoding module, the number of quantum state signals with maximum amplitude is selected from the preliminary quantum state signal to match the subsequent preset quantum circuit.
[0037] The advantage of the above technical solution is that it can better reduce the number of quantum bits used, significantly reduce the large number of running times consumed in quantum circuits due to measurements, and improve the model's ability to resist noise.
[0038] As an implementation mode, in the quantum state characteristic signal encoding module, the number of quantum state signals with the maximum amplitude is selected from the preliminary quantum state signal as a hyperparameter of the subsequent preset quantum circuit; the learning process of the hyperparameter is:
[0039] Treat each subsequent quantum circuit as a whole for gradient calculation;
[0040] The gradient of the vanishing part is directly set to zero, so that the gradient calculation ends at the part where the gradient disappears; the remaining part where the gradient still exists continues to participate in the calculation;
[0041] Finally, the difference method is used to replace the partial derivative calculation to perform hyperparameter learning until the preset stopping condition is reached to obtain the final hyperparameters.
[0042] The advantage of the above technical solution is that it avoids the gradient vanishing problem in the back propagation process, which leads to the problem of training difficulties, improves the accuracy of hyperparameters, and thus improves the accuracy of image classification.
[0043] A third aspect of the present invention provides a computer-readable storage medium.
[0044] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the image processing method based on the pure quantum pulse neural network model as described above.
[0045] A fourth aspect of the present invention provides an electronic device.
[0046] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the image processing method based on the pure quantum pulse neural network model as described above are implemented.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] (1) The present invention uses a pulse rate coding method that conforms to Poisson's theorem to encode the image to be processed, and obtains the image to be processed encoded as multiple one-dimensional discrete pulse signals, and then encodes these discrete pulse signals into a set quantum circuit, and then selects a set number of quantum state signals with the maximum amplitude according to the output result, and continues to encode them into subsequent preset quantum circuits, and finally obtains a quantum state characteristic signal. The image category is determined by using the relationship between the quantum state characteristic signal and the image category result, and the quantum circuit design is completed with fewer bits, fewer logic gates and lower circuit depth. Under the premise of ensuring the accuracy of the image processing results, the hardware energy consumption can be reduced in the entire image processing process, and the image can be processed quickly and efficiently. In addition, the relationship between image processing and image features is deeply mined.
[0049] (2) The present invention selects a set number of quantum state signals with maximum amplitude from the preliminary quantum state signals to form a maximum value measurement strategy. This strategy can greatly reduce the loss problem during quantum circuit measurement, better reduce the number of quantum bits used, significantly reduce the large number of running times consumed in the quantum circuit due to measurement, and improve the model's anti-noise ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0051] Figure 1 is a schematic diagram of an electronic device according to an embodiment of the present invention;
[0052] Figure 2 It is a schematic diagram of a process of processing an image to be processed using a pure quantum pulse neural network model according to an embodiment of the present invention;
[0053] Figure 3 1 is a schematic diagram of the structure of a pure quantum parameterized pulse neural network model (Quantum spiking neural network, QSNN) of an embodiment of the present invention;
[0054] Figure 4 is a schematic diagram of the structure of a pulse neural network model in an embodiment of the present invention that does not use a maximum value measurement strategy;
[0055] Figure 5 is a schematic diagram of the structure of a pulse neural network model using a maximum value measurement strategy according to an embodiment of the present invention;
[0056] Figure 6 is a schematic diagram of the quantum circuit structure of an embodiment of the present invention;
[0057] FIG. 7( a ) is a loss curve of a quantum pulse neural network without using a maximum value measurement strategy according to an embodiment of the present invention;
[0058] FIG7( b ) is a diagram showing partial parameter changes of a quantum pulse neural network without using a maximum value measurement strategy according to an embodiment of the present invention;
[0059] FIG. 7( c ) is a diagram showing the image classification accuracy of a quantum pulse neural network without using a maximum value measurement strategy according to an embodiment of the present invention;
[0060] FIG7( d ) shows the running time proportions of different parts of the quantum pulse neural network without using the maximum value measurement strategy according to an embodiment of the present invention;
[0061] FIG8( a ) is a loss curve of a quantum pulse neural network using a maximum value measurement strategy according to an embodiment of the present invention;
[0062] FIG8( b ) is a diagram showing partial parameter changes of a quantum pulse neural network using a maximum value measurement strategy according to an embodiment of the present invention;
[0063] FIG8( c ) is a diagram showing the image classification accuracy of a quantum pulse neural network using a maximum measurement strategy according to an embodiment of the present invention;
[0064] FIG8( d ) shows the running time proportions of different parts of a quantum pulse neural network using a maximum measurement strategy according to an embodiment of the present invention. DETAILED DESCRIPTION
[0065] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0066] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0067] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0068] Terminology explanation:
[0069] Spiking Neural Networks:
[0070] A spiking neural network is a type of network in the field of deep learning. It is composed of spiking neurons. The input of a spiking neuron is a pulse, and the output is also a pulse. There is an electromotive force V inside the spiking neuron. When no input is received, V will decay exponentially over time to a certain stable electromotive force (equilibrium voltage). When an input pulse is received at a certain moment, the electromotive force will increase to a certain value. When the electromotive force increases faster than the decay rate (such as frequent pulse input), the electromotive force inside the neuron will become larger and larger until it reaches a certain emission threshold, at which time the spiking neuron will emit a pulse. After that, the electromotive force of the spiking neuron is quickly set to the resting electromotive force.
[0071] There are some obvious differences between the spiking neural network (SNN) and the artificial neural network (ANN) in terms of computing models, advantages and disadvantages, and applications. ANN uses a continuous-valued activation function to process and transmit information by passing real-valued signals. It uses a forward propagation model based on connection weights. Each neuron performs a weighted summation on the input and passes the result to the next layer. SNN uses discrete pulse signals for information processing and transmission. Neurons transmit information through the temporal encoding of pulses and only emit pulses when they receive enough stimulation. The computing process of SNN is closer to the working principle of biological nervous systems. The main difference between the two is that the input and output of SNN neurons are discrete binary signals, called pulse signals. 1 represents excitation and 0 represents non-excitation. The operations performed in the cell body are also similar to those of ANN. There are different forms, the most commonly used of which is achieved through a series of complex leakage integration and excitation modes LIF (Leaky Integrate-and-Fire).
[0072] Leaky Integrate-and-Fire:
[0073] The LIF model is inspired by biological neurons, and its working process is similar to the charging, leakage, and discharge processes of biological neurons. A more accurate model for describing biological neural dynamics is the Hodgkin-Huxley model, but the differential equations of this model are complex and difficult to understand intuitively. Although the Hodgkin-Huxley model more accurately describes the dynamic changes of biological neuron potentials, some people believe that the LIF model has a stronger ability to fit data.
[0074] Consider the neuron cell as a circuit, the cell's ability to store charge as the capacitor C, the resting potential as a battery, and the resistance to current outflow as R. The integral calculation process is as follows:
[0075] I=I R +IC
[0076]
[0077] The final derivation of (1) is as follows: m =RC is the introduced time constant, u(t) is the membrane potential of the neuron, u(rest) is the resting potential (initial value of the membrane potential), R is the membrane resistance, and I(t) is the input current. Thus, the change process of the membrane potential can be obtained:
[0078] u(t)=u(t)+{-[u(t)-u(rest)]+RI(t)} / τ m (2)
[0079] Quantum Neural Networks:
[0080] At present, there are three directions of mainstream algorithms in the field of quantum computing. They are related to a certain extent, but the goals and application scenarios are slightly different. They are VQE (Variational Quantum Eigensolver), QAOA (Quantum Approximate Optimization Algorithm), and QNN (Quantum Neural Networks). QNN is a method of introducing quantum computing into neural networks. It attempts to use the properties of quantum computing, such as superposition and parallelism, to improve the performance of neural networks. Its application areas mainly involve quantum deep learning, which attempts to perform classical machine learning tasks through quantum computing, and may achieve a more efficient learning process on certain problems. The present invention is based on the field of QNN.
[0081] The core idea of the QNN field is a pseudo-concept (Ansatz), which can be compared with the network model of classical deep learning. It defines quantum bits and quantum gates that operate quantum bits. By repeatedly placing Ansatz multiple times, a variational quantum circuit is formed. The word variation comes from the quantum gates in Ansatz that contain trainable parameters, such as RX, RY, and RZ gates.
[0082]
[0083] Among them, θ is the phase in the quantum gate; I is the input current; i is the transient current; X, Y, and Z are the number of quantum bits of the RX, RY, and RZ gates respectively.
[0084] The variational quantum circuit is similar to the idea of classical neural network, which can be compared to the feedforward God General network in the classical network and is based on the principles of quantum mechanics. First, by selecting a suitable encoding strategy to encode the data, the input encoding can be understood as a nonlinear layer in a single hidden layer neural network. Secondly, the hierarchical structure constructed by repeatedly superimposing trainable Ansatz can be interpreted as a deep linear neural network. At the same time, the final measurement of the variational quantum circuit also introduces nonlinearity to the model. Therefore, the variational quantum model can also be called a quantum neural network model.
[0085] Reference Figure 1 , a schematic diagram of an electronic device is given. It should be noted that, Figure 1 The electronic device 100 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0086] like Figure 1 As shown, the electronic device 100 includes a central processing unit (CPU) 101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 102 or a program loaded from a storage part 108 into a random access memory (RAM) 103. In the RAM 103, various programs and data required for system operation are also stored. The central processing unit 101, the ROM 102, and the RAM 103 are connected to each other via a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.
[0087] The following components are connected to the I / O interface 105: an input section 106 including a keyboard, a mouse, etc.; an output section 107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 108 including a hard disk, etc.; and a communication section 109 including a network interface card such as a local area network (LAN) card, a modem, etc. The communication section 109 performs communication processing via a network such as the Internet. A drive 110 is also connected to the I / O interface 105 as needed. A removable medium 111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 110 as needed, so that a computer program read therefrom is installed into the storage section 108 as needed.
[0088] When the central processing unit 101 in the electronic device of this embodiment executes the program, the following is achieved: Figure 2 The steps in the image processing method based on the pure quantum pulse neural network model are shown.
[0089] In one or more embodiments, an image processing method based on a pure quantum pulse neural network model is provided, comprising:
[0090] Step a: receiving an image to be processed.
[0091] It should be noted here that the image to be processed here can be specifically set according to the actual situation, such as a handwritten image, or other images, etc., which will not be described in detail here.
[0092] Step b: Processing the image to be processed using a pure quantum pulse neural network model to obtain the category of the image to be processed.
[0093] The pure quantum pulse neural network model of this embodiment is as follows Figure 3 As shown, Figure 4 A pure quantum pulse neural network model without using the maximum measurement strategy is given. Figure 5 A pure quantum pulse neural network model using the maximum measurement strategy is given.
[0094] The maximum value measurement strategy here refers to: selecting a set number of quantum state signals with maximum amplitude from the preliminary quantum state signals.
[0095] Its purpose is to better reduce the number of quantum bits used, significantly reduce the large number of running times consumed by measurements in quantum circuits, and improve the model's ability to resist noise.
[0096] Taking a 10-bit quantum circuit as an example, if full amplitude measurement is performed and its accuracy is guaranteed, the number of shots of the quantum circuit will require at least tens of thousands of times. If only 64 maximum amplitudes are required, it can be taken out in a few hundred shots. This idea not only greatly reduces the number of shots of the quantum circuit, but also greatly reduces the quantum training parameters in the subsequent circuits, greatly reducing the training cost. At the same time, the emergence of this strategy also provides a new optimization idea for the quantum model with intermediate measurements in the current field of quantum deep learning, so that it can better play the quantum advantage.
[0097] Figure 2 A flow chart of processing the image to be processed using a pure quantum pulse neural network model according to an embodiment of the present invention is given. Figure 2 As shown, the steps of processing the image to be processed using a pure quantum pulse neural network model specifically include:
[0098] S201: Encode the image to be processed using a pulse rate coding method that conforms to Poisson's theorem to obtain a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group with N time steps; wherein N is a positive integer greater than or equal to 2.
[0099] There are various encoding methods in spiking neural networks, such as rate coding, time series coding, and so on. Different data pre-coding methods have great differences in the network's ability to extract input data features. At the same time, the application fields of different encoding methods are also different. For example, rate coding is often used to process static information, such as image classification, speech recognition, etc. In these tasks, the firing rate of neurons can represent the intensity of the input, that is, the intensity of different inputs can be encoded by the frequency of neuronal pulse firing. Time series coding performs well in processing dynamic information and time series data. For example, in motion recognition, speech synthesis, and event-driven systems, time series coding can help capture and process the time series nature of input data.
[0100] In the present invention, a pulse rate coding method conforming to Poisson's theorem is adopted to encode the image to be processed, and the image to be processed is divided into N time steps. The probability value of each pixel is obtained after normalization, and the probability is used to determine whether each pixel point emits a pulse at each time step to form a discrete pulse signal input of N time steps.
[0101] For example, by scaling the pixel values from 0 to 255 to 0 to 1, each pixel value can be considered as the probability value of the pixel value. Since the pulse is a discrete binary value, that is, the pulse has only 0 and 1, representing whether the pulse is emitted. The probability value is used as the standard for judging whether the pulse is emitted at each pixel point at this time step, which means that the data contained in each time step are all 0 or 1 values.
[0102] The number of quantum bits here is one of the important indicators to measure the performance of quantum computers, and it is a known parameter.
[0103] S202: Encode the discrete pulse signal of the N*(2^number of quantum bits) dimensional vector group of N time steps into the set quantum circuit to obtain a preliminary quantum state signal.
[0104] The quantum circuit here evolves the encoded classical data into a quantum state, which passes through a parameterized quantum circuit (PQC), also known as Ansatz. Unlike the weight matrix of a classical neural network, PQC uses the phase θ in the quantum gate as a training parameter to evolve the quantum initial state to the desired quantum final state. PQC is unitary, and these unitary operations consist of parameterized quantum gates and two-bit CNOT gates. The main function of the CNOT gate is to entangle the two quantum bits it acts on to produce multi-qubit entanglement.
[0105] A schematic diagram of the structure of a quantum circuit, such as Figure 6 For example, in Figure 6In this paper, 10 qubits are used, including 60 quantum learning parameters. In each time step, 60 quantum gates are used, all of which are controlled single quantum gates. In each time step, the initial state of the qubit is |0>, and the real-time data is encoded into the quantum state through data encoding.
[0106] In some specific implementations, a zero-filled amplitude encoding method is used to encode discrete pulse signals of N*(2^number of quantum bits)-dimensional vector groups of N time steps into a set quantum circuit. In this way, by stretching the image into a one-dimensional vector and filling it with 0, the vector dimension is consistent with the number of quantum amplitudes, which improves the accuracy of subsequent quantum state feature signals and thus improves the accuracy of image classification.
[0107] S203: Selecting a set number of quantum state signals with maximum amplitude from the preliminary quantum state signals, and continuing to encode them into subsequent preset quantum circuits to obtain quantum state characteristic signals.
[0108] Here, selecting a set number of quantum state signals with maximum amplitude from the preliminary quantum state signals is the maximum value measurement strategy, which is similar to MaxPool (maximum pooling) of global data in classical neural networks.
[0109] Among them, the number of quantum state signals with the largest amplitude selected from the preliminary quantum state signals matches the subsequent preset quantum circuit. This can better reduce the number of quantum bits used, significantly reduce the large number of running times consumed by measurement in the quantum circuit, and improve the model's anti-noise ability.
[0110] Specifically, the number of quantum state signals with the largest amplitude is selected from the preliminary quantum state signals as the hyperparameter of the subsequent preset quantum circuit; the learning process of the hyperparameter is:
[0111] Treat each subsequent quantum circuit as a whole for gradient calculation;
[0112] The gradient of the vanishing part is directly set to zero, so that the gradient calculation ends at the part where the gradient disappears; the remaining part where the gradient still exists continues to participate in the calculation;
[0113] Finally, the differential method is used to replace the partial derivative calculation to perform hyperparameter learning until the preset stop condition is reached to obtain the final hyperparameter. This avoids the gradient vanishing problem in the back propagation process, which leads to the problem of difficult training, improves the accuracy of hyperparameters, and thus improves the accuracy of image classification.
[0114] S204: According to the known relationship between the quantum state characteristic signal and the image category result, the image category corresponding to the current quantum state characteristic signal is obtained.
[0115] Taking the image to be processed as a handwritten image and identifying numbers in the handwritten image as an example, the classification task accuracy of handwritten number recognition is used to measure the model effect. At the same time, the present invention compares the proposed quantum pulse neural network model without the maximum measurement strategy and the quantum pulse neural network model using the maximum measurement strategy. After multiple rounds of iterative training and optimization of the corresponding hyperparameters, the accuracy of the two models is shown in the figure below. Figure 7(a)-Figure 8(d) shown.
[0116] By comparing the results of the quantum pulse neural network model without using the maximum measurement strategy and the quantum pulse neural network model using the maximum measurement strategy, it can be concluded that: first, the accuracy of both models in the binary classification task can reach more than 95%; secondly, after using the maximum measurement strategy, while reducing the line measurement loss and the amount of quantum parameters, the model representativeness remains basically unchanged, and its prediction results increase by 3 percentage points, with a higher accuracy.
[0117] In one or more embodiments, an image processing system based on a pure quantum pulse neural network model is provided, comprising:
[0118] (1) an image receiving module, which is used to receive an image to be processed;
[0119] (2) An image processing module, which is used to process the image to be processed using a pure quantum pulse neural network model to obtain a category of the image to be processed.
[0120] Wherein, the image processing module further includes:
[0121] (2.1) A pulse rate coding module, which is used to encode the image to be processed using a pulse rate coding method that conforms to Poisson's theorem to obtain a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group with N time steps; wherein N is a positive integer greater than or equal to 2.
[0122] (2.2) A preliminary quantum state signal acquisition module, which is used to encode the discrete pulse signal of the N*(2^number of quantum bits)-dimensional vector group of N time steps into the set quantum circuit to obtain a preliminary quantum state signal.
[0123] Among them, in the preliminary quantum state signal acquisition module, a zero-filled amplitude encoding method is used to encode the discrete pulse signal of the N*(2^number of quantum bits)-dimensional vector group of N time steps into the set quantum circuit. By stretching the image into a one-dimensional vector and filling it with 0, the purpose is to keep the vector dimension consistent with the number of quantum amplitudes, thereby improving the accuracy of subsequent quantum state characteristic signals and thus improving the accuracy of image classification.
[0124] (2.3) A quantum state characteristic signal encoding module, which is used to select a set number of quantum state signals with maximum amplitude from the preliminary quantum state signal, and continue to encode them into the subsequent preset quantum circuit to obtain the quantum state characteristic signal.
[0125] Among them, in the quantum state characteristic signal encoding module, the number of quantum state signals with the largest amplitude is selected from the preliminary quantum state signals to match the subsequent preset quantum circuit. This can better reduce the number of quantum bits used, greatly reduce the large number of running times consumed by measurement in the quantum circuit, and improve the model's anti-noise ability.
[0126] Specifically, in the quantum state characteristic signal encoding module, the number of quantum state signals with the maximum amplitude is selected from the preliminary quantum state signal as a hyperparameter of the subsequent preset quantum circuit; the learning process of the hyperparameter is:
[0127] Treat each subsequent quantum circuit as a whole for gradient calculation;
[0128] The gradient of the vanishing part is directly set to zero, so that the gradient calculation ends at the part where the gradient disappears; the remaining part where the gradient still exists continues to participate in the calculation;
[0129] Finally, the differential method is used to replace the partial derivative calculation to perform hyperparameter learning until the preset stop condition is reached to obtain the final hyperparameter. This avoids the gradient vanishing problem in the back propagation process, which leads to the problem of difficult training, improves the accuracy of hyperparameters, and thus improves the accuracy of image classification.
[0130] (2.4) An image category determination module, which is used to obtain the image category corresponding to the current quantum state feature signal based on the known relationship between the quantum state feature signal and the image category result.
[0131] It should be noted here that the various modules in the image processing system based on the pure quantum pulse neural network model in the embodiment of the present invention correspond one-to-one to the various steps in the image processing method based on the pure quantum pulse neural network model, and the specific implementation process is the same, which will not be described in detail here.
[0132] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including a computer program for executing Figure 2In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 109, and / or installed from the removable medium 111. When the computer program is executed by the central processing unit 101, various functions defined in the apparatus of the present application are executed.
[0133] in, Figure 2 The computer program instructions corresponding to the method shown may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0135] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An image processing method based on a pure quantum pulse neural network model, characterized in that: include: receiving an image to be processed; Processing the image to be processed by using a pure quantum pulse neural network model to obtain a category of the image to be processed; The step of processing the image to be processed using a pure quantum pulse neural network model includes: The image to be processed is encoded by a pulse rate coding method that conforms to Poisson's theorem to obtain a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group with N time steps; wherein N is a positive integer greater than or equal to 2; the image to be processed is divided into N time steps, and the probability value of each pixel is obtained after normalization, and whether each pixel point emits a pulse in the time step is determined by probability, so as to form a discrete pulse signal input of N time steps; Encode a discrete pulse signal of an N*(2^quantum bit number)-dimensional vector group of N time steps into a set quantum circuit to obtain a preliminary quantum state signal; the quantum circuit evolves the encoded classical data into a quantum state, and the quantum state passes through a parameterized quantum circuit, using the phase in the quantum gate as a training parameter to evolve the quantum initial state to the desired quantum final state; A set number of quantum state signals with maximum amplitude are selected from the preliminary quantum state signals, and the signals are further encoded into a subsequent preset quantum circuit to obtain a quantum state characteristic signal; the number of quantum state signals with maximum amplitude is selected from the preliminary quantum state signals to match the subsequent preset quantum circuit; According to the known relationship between the quantum state characteristic signal and the image category result, the image category corresponding to the current quantum state characteristic signal is obtained.
2. The image processing method based on the pure quantum pulse neural network model according to claim 1, characterized in that: The zero-filled amplitude coding method is used to encode the discrete pulse signal of the N* (2^number of quantum bits) dimensional vector group with N time steps into the set quantum circuit.
3. The image processing method based on the pure quantum pulse neural network model as claimed in claim 1, characterized in that: The number of quantum state signals with the largest amplitude is selected from the preliminary quantum state signals as the hyperparameter of the subsequent preset quantum circuit; the learning process of the hyperparameter is: Treat each subsequent quantum circuit as a whole for gradient calculation; The gradient of the vanishing part is directly set to zero, so that the gradient calculation ends at the part where the gradient disappears; the remaining part where the gradient still exists continues to participate in the calculation; Finally, the difference method is used to replace the partial derivative calculation to perform hyperparameter learning until the preset stopping condition is reached to obtain the final hyperparameters.
4. An image processing system based on a pure quantum pulse neural network model, characterized in that: include: An image receiving module, which is used to receive an image to be processed; An image processing module, which is used to process the image to be processed using a pure quantum pulse neural network model to obtain the category of the image to be processed; Wherein, the image processing module further includes: A pulse rate coding module is used to encode the image to be processed by a pulse rate coding method that conforms to Poisson's theorem, and obtain a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group with N time steps; wherein N is a positive integer greater than or equal to 2; the image to be processed is divided into N time steps, and a probability value of each pixel is obtained after normalization, and whether each pixel point emits a pulse in the time step is determined by probability, so as to form a discrete pulse signal input of N time steps; A preliminary quantum state signal acquisition module is used to encode a discrete pulse signal of an N*(2^number of quantum bits)-dimensional vector group of N time steps into a set quantum circuit to obtain a preliminary quantum state signal; the quantum circuit evolves the encoded classical data into a quantum state, and the quantum state passes through a parameterized quantum circuit, using the phase in the quantum gate as a training parameter to evolve the quantum initial state to the desired quantum final state; A quantum state characteristic signal encoding module, which is used to select a set number of quantum state signals with maximum amplitude from the preliminary quantum state signal, and continue to encode them into a subsequent preset quantum circuit to obtain a quantum state characteristic signal; in the quantum state characteristic signal encoding module, the number of quantum state signals with maximum amplitude selected from the preliminary quantum state signal is matched with the subsequent preset quantum circuit; The image category determination module is used to obtain the image category corresponding to the current quantum state feature signal based on the known relationship between the quantum state feature signal and the image category result.
5. The image processing system based on the pure quantum pulse neural network model as claimed in claim 4, characterized in that: In the preliminary quantum state signal acquisition module, a zero-filled amplitude encoding method is used to encode a discrete pulse signal of an N* (2^number of quantum bits) dimensional vector group of N time steps into a set quantum circuit.
6. The image processing system based on the pure quantum pulse neural network model as claimed in claim 4, characterized in that: In the quantum state characteristic signal encoding module, the number of quantum state signals with the maximum amplitude is selected from the preliminary quantum state signals as the hyperparameter of the subsequent preset quantum circuit; the learning process of the hyperparameter is: Treat each subsequent quantum circuit as a whole for gradient calculation; The gradient of the vanishing part is directly set to zero, so that the gradient calculation ends at the part where the gradient disappears; the remaining part where the gradient still exists continues to participate in the calculation; Finally, the difference method is used to replace the partial derivative calculation to perform hyperparameter learning until the preset stopping condition is reached to obtain the final hyperparameters.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the image processing method based on a pure quantum pulse neural network model as described in any one of claims 1 to 3 are implemented.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the image processing method based on the pure quantum pulse neural network model as described in any one of claims 1-3 are implemented.
Citation Information
Patent Citations
Handwritten numeral recognition method, system and equipment and computer readable storage medium
CN114120336A
Pulse neural network and quantum circuit collaborative image classification method and system
CN117437481A