Classification Method, Device, Medium and Equipment Based on Quantum Wavelet KAN Network

By introducing quantum wavelet KAN network into deep learning models, quantum computing and wavelet analysis technology are used to solve the problems of slow speed and insufficient feature extraction when processing high-dimensional complex data, and achieve faster and more accurate feature extraction and classification effects.

CN119807862BActive Publication Date: 2025-06-24BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510297778.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-06-24
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

Existing deep learning models have problems such as slow speed, large parameters, strong dependence on high-quality labeled data, and difficulty in capturing multi-scale information when processing high-dimensional complex data.

Method used

A classification method based on quantum wavelet KAN network is adopted to represent data through qubits, and a multi-layer quantum wavelet KAN network is constructed, multi-scale features are extracted using quantum wavelet basis functions, and network parameters are optimized by quantum gradient descent method.

Benefits of technology

It improves data processing speed, reduces parameter consumption, improves the accuracy and interpretability of feature extraction, and achieves higher classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807862B_ABST
    Figure CN119807862B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of quantum computing technology, and discloses a classification method, device, medium and equipment based on a quantum wavelet KAN network. The method includes: obtaining a normalized vector of data to be classified; representing the normalized vector in a quantum state using multiple qubits to obtain an initial quantum state; determining a continuous wavelet basis function, constructing an L-level wavelet basis function quantum circuit based on the wavelet basis function to form an L-layer quantum wavelet KAN network with cascaded front and back, the input of the first-layer wavelet basis function quantum circuit being the initial quantum state, and the output of the L-layer quantum wavelet KAN network being the final quantum state; obtaining an output probability value according to the final quantum state, and obtaining a classification result of the data to be classified according to the output probability value. Applying the present invention can improve the data processing speed and efficiently extract multi-scale features.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of quantum computing technology, and in particular, to a classification method, device, medium and equipment based on a quantum wavelet KAN network. Background Art

[0002] Existing deep learning models have made remarkable progress in the field of data processing. For example, convolutional neural network CNN and Transformer models perform excellently in tasks such as image recognition, speech processing, and natural language processing. However, these models have some obvious limitations when dealing with high-dimensional complex data. For example, deep learning models usually require a large number of parameters, the training process is time-consuming, and they are highly dependent on high-quality labeled data. In addition, traditional models are insufficient in capturing local features and multi-scale information of data, and it is difficult to effectively extract subtle patterns in complex data.

[0003] Therefore, how to improve the data processing speed of the model and efficiently extract multi-scale features has become a technical problem to be solved currently. Summary of the Invention

[0004] The purpose of the present invention is to provide a classification method, device, medium and equipment based on a quantum wavelet KAN network, which is used to improve the data processing speed of the model and efficiently extract multi-scale features.

[0005] To achieve the above purpose, the present invention provides the following technical solutions:

[0006] According to one aspect of the present invention, there is provided a classification method based on a quantum wavelet KAN network, including:

[0007] Obtain a normalized vector of the data to be classified;

[0008] Represent the normalized vector in a quantum state using multiple qubits to obtain an initial quantum state;

[0009] Determine a wavelet basis function, and based on the wavelet basis function, construct an L-level wavelet basis function quantum circuit to form an L-layer quantum wavelet KAN network with cascaded front and back. The input of the first-layer wavelet basis function quantum circuit is the initial quantum state, and the output of the L-layer quantum wavelet KAN network is the final quantum state;

[0010] Obtain an output probability value according to the final quantum state, and obtain a classification result of the data to be classified according to the output probability value.

[0011] According to an embodiment of the present invention, the wavelet basis function is a continuous wavelet basis function formed by combining or deforming a complex sine wave and a Gaussian envelope, and the continuous wavelet basis function is expressed as: , where:

[0012] represents the Gaussian envelope part, is the scale parameter that controls the time domain width of the wavelet; represents the complex sine wave part, is the parameter that controls the center frequency of the wavelet; is the continuous wavelet basis function constructed by the product of the Gaussian envelope and the complex sine wave, represents the input variable.

[0013] According to an embodiment of the present invention, a wavelet basis function quantum circuit constructed based on the continuous wavelet basis function includes an amplitude embedding gate and an RX quantum gate connected in sequence. The amplitude embedding gate is used to simulate the Gaussian envelope of the continuous wavelet basis function to obtain an embedded quantum state, and the RX gate is used to simulate the complex sine wave of the continuous wavelet basis function to obtain a basis function quantum state.

[0014] According to an embodiment of the present invention, the amplitude embedding gate is used to perform amplitude encoding to simulate the Gaussian function to obtain an embedded quantum state; the RX quantum gate is used to perform rotation angle encoding on the embedded quantum state to simulate the complex sine wave to obtain a basis function quantum state.

[0015] According to an embodiment of the present invention, the output of the previous-stage wavelet basis function quantum circuit in the quantum wavelet KAN network is used as the input of the next-stage wavelet basis function quantum circuit, and the quantum wavelet KAN network is expressed as:

[0016] ;

[0017] wherein, is regarded as a matrix including only the input vector, representing the initial quantum state; L represents the number of layers of the wavelet basis function quantum circuit, represents the previous-stage connection layer and the next-stage connection layer 's activation function, represents the quantum continuous wavelet basis function, and the expression is: ; represents the Gaussian envelope part, represents the complex sine wave part, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents the input variable; is the scale parameter that controls the time domain width of the wavelet and is used to determine the width or diffusion degree of the Gaussian function.

[0018] According to an embodiment of the present invention, obtaining an output probability value according to the quantum final state and obtaining a classification result of the data to be classified according to the output probability value includes: performing multiple measurements on the quantum final state of the quantum wavelet KAN network; calculating an average value according to multiple measurement results to obtain a final expected value; obtaining a classification output probability value according to the final expected value; and selecting the classification label with the largest probability from the output probability values.

[0019] According to an embodiment of the present invention, the method further includes: training the quantum KAN network with the data to be classified in the training set, and using the quantum gradient descent method and the hybrid quantum-classical optimization algorithm during the training process to minimize the error function and gradually optimize the quantum gate parameters in the quantum KAN network, where the quantum gates include the amplitude embedding gate and the RX quantum gate; the initial parameters of the quantum gate parameters of the quantum KAN network are randomized parameters.

[0020] On the other hand, the present invention also provides a classification device based on a quantum wavelet KAN network, including:

[0021] A normalization unit configured to obtain a normalized vector of the data to be classified;

[0022] A quantum encoding unit configured to represent the normalized vector in a quantum state using multiple qubits to obtain a quantum initial state;

[0023] A network construction unit configured to determine a wavelet basis function, construct an L-level wavelet basis function quantum circuit based on the wavelet basis function, form an L-layer quantum wavelet KAN network with cascaded front and back, the input of the first-layer wavelet basis function quantum circuit is the quantum initial state, and the output of the L-layer quantum wavelet KAN network is the quantum final state;

[0024] An output unit configured to obtain an output probability value according to the quantum final state and obtain a classification result of the data to be classified according to the output probability value.

[0025] On the other hand, the present invention also provides a computer storage medium, in which instructions are stored, and when the instructions are run, the classification method based on the quantum wavelet KAN network is implemented.

[0026] On the other hand, the present invention also provides a computing device, characterized by including a processor and a communication interface coupled to the processor; the processor is used to run a computer program or instructions to implement the classification method based on the quantum wavelet KAN network.

[0027] A classification method, device, medium and equipment based on a quantum wavelet KAN network provided by the present invention, by combining quantum computing and the wavelet KAN network, is used to improve the data processing speed and efficiently extract multi-scale feature representations. The nodes of the KAN network are its core constituent units, and the quantum wavelet basis functions constitute the nodes of the quantum wavelet KAN network. The nodes of different layers are connected through activation functions to implement the quantum wavelet KAN network with quantum wavelet basis functions as nodes. Based on the quantum gate basis function replacement quantum wavelet KAN neural network architecture, starting from the properties of the unitary matrix of the quantum gate itself, the similarity between it and the wavelet basis function of the KAN neural network is explored. The quantum wavelet KAN network uses quantum wavelet basis function nodes to replace constant nodes, enabling fewer parameters to drive the neural network and the stacking of different nodes to enhance interpretability.

[0028] Beneficial effects:

[0029] A classification method, device, medium and equipment based on a quantum wavelet KAN network provided by the present invention, compared with the prior art, has the following beneficial effects:

[0030] 1. Optimize feature extraction ability: The classification method and device are based on the quantum wavelet KAN network. This quantum network combines wavelet transform and the KAN network. Through the multi-scale analysis ability of wavelet transform and the strong fitting ability of the KAN network for non-linear relationships, using quantum superposition states and entanglement states, it effectively captures the local features and global characteristics of data, realizes more accurate feature extraction, and has a higher accuracy than classical neural networks with the same number of parameters. Experiments show that on the MNIST handwritten digit dataset, the accuracy of the quantum wavelet KAN reaches 95.1% with the same number of parameters, a 4% improvement compared to the traditional neural network MLP;

[0031] 2. Reduce parameter consumption: The classification method and device based on the quantum wavelet KAN network avoid the fully connected weight matrix of the traditional MLP, fundamentally reducing the parameter complexity. Compared with traditional deep learning models, the quantum wavelet KAN network uses quantum wavelet basis function nodes to replace constant nodes. The traditional MLP requires multiple layers of neurons to be stacked, and each neuron contains multiple weight parameters. The parameter number formula of the KAN is: , where is the input dimension, is the parameter of the quantum wavelet basis function, and the number of parameters grows linearly with the input dimension ( ). The parameter number formula of the traditional MLP is: , where is the input dimension, is the hidden layer width, and the number of parameters grows quadratically with and ( ). If the input dimension is 100, the parameter quantity of the traditional MLP reaches , and the parameter quantity of KAN is only The parameter quantity of KAN is only 20% of that of the MLP. Each node function can approximate complex non-linear relationships with a small number of parameters, saving the parameter quantity;

[0032] 3. Improve interpretability: The classification method and device are based on the quantum wavelet KAN network. By using multi-scale quantum wavelet bases as the nodes of the network, the behavior of the model becomes more transparent, which helps to understand data features and decision-making processes in practical applications. The quantum wavelet KAN network uses quantum wavelet basis function nodes to replace constant nodes. By decomposing input variables layer by layer, each node is a learnable quantum wavelet basis function, and different layers of nodes are connected through activation functions. This design makes the mapping path from input to output clearer, and the influence of each feature can be directly traced through the quantum wavelet basis functions on the path, thereby improving interpretability. Description of the Drawings

[0033] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0034] Figure 1 is a flowchart of a classification method based on a quantum wavelet KAN network according to the present invention and an exemplary embodiment;

[0035] Figure 2 is a schematic diagram of a classification device based on a quantum wavelet KAN network according to an exemplary embodiment of the present invention;

[0036] Figure 3 is a schematic diagram of a quantum circuit of a wavelet basis function according to an exemplary embodiment of the present invention;

[0037] Figure 4 is a schematic diagram of a quantum wavelet KAN network according to an exemplary embodiment of the present invention;

[0038] Figure 5 is a schematic diagram of a loss function of classification based on a quantum wavelet KAN network according to an exemplary embodiment of the present invention;

[0039] Figure 6 is a schematic diagram of the accuracy of classification based on a quantum wavelet KAN network according to an exemplary embodiment of the present invention. Detailed Embodiments

[0040] In order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, words such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and effects. For example, the first threshold and the second threshold are only used to distinguish different thresholds, and their order is not limited. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0041] It should be noted that, in the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0042] In the present invention, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The following at least one item (items) or similar expressions thereof refer to any combination of these items, including any combination of single items (items) or plural items (items). For example, at least one item (items) of a, b or c can mean: a, b, c, the combination of a and b, the combination of a and c, the combination of b and c, or the combination of a, b and c, where a, b, c can be single or multiple.

[0043] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0044] This invention innovatively combines quantum computing into the KAN neural network based on the wavelet KAN neural network architecture replaced by the quantum gate basis function. Starting from the properties of the unitary matrix of the quantum gate itself, it explores its similarity with the wavelet basis function of the KAN neural network, so that the use of quantum as a training node function is different from the constant node, so that fewer parameters drive the neural network and the stacking of different nodes enhances interpretability. In the quantum computing framework, combining the KAN neural network with the quantum state can not only significantly improve the data processing speed, but also more efficiently extract multi-scale features through characteristics such as quantum entanglement, which is superior to the existing technology in both computing performance and task adaptability.

[0045] like Figure 1 As shown, a flow chart of a classification method based on a quantum wavelet KAN network is given, and the method comprises the following steps:

[0046] Step S1: Obtain the normalized vector of the data to be classified;

[0047] Step S2: Represent the normalized vector in a quantum state using multiple qubits to obtain the initial quantum state;

[0048] Step S3: Determine the wavelet basis function, construct an L-level wavelet basis function quantum circuit based on the wavelet basis function to form an L-layer quantum wavelet KAN network with cascaded front and back. The input of the first-layer wavelet basis function quantum circuit is the initial quantum state, and the output of the L-layer quantum wavelet KAN network is the final quantum state;

[0049] Step S4: Obtain the output probability value according to the final quantum state, and obtain the classification result of the data to be classified according to the output probability value.

[0050] The method further includes: training the quantum KAN network using the data to be classified in the training set, and using the quantum gradient descent method and the hybrid quantum-classical optimization algorithm during the training process to minimize the error function and gradually optimize the parameters of the quantum KAN network; the initial parameters of the quantum KAN network parameters are randomized parameters.

[0051] As Figure 2 shown, a schematic diagram of a classification device based on a quantum wavelet KAN network is given, including:

[0052] A normalization unit configured to obtain the normalized vector of the data to be classified;

[0053] A quantum encoding unit configured to represent the normalized vector in a quantum state using multiple qubits to obtain the initial quantum state;

[0054] A network construction unit configured to determine the wavelet basis function, construct an L-level wavelet basis function quantum circuit based on the wavelet basis function to form an L-layer quantum wavelet KAN network with cascaded front and back. The input of the first-layer wavelet basis function quantum circuit is the initial quantum state, and the output of the L-layer quantum wavelet KAN network is the final quantum state;

[0055] An output unit configured to obtain the output probability value according to the final quantum state, and obtain the classification result of the data to be classified according to the output probability value.

[0056] As Figure 3As shown, a schematic diagram of a quantum circuit for wavelet basis functions is given. The quantum circuit for wavelet basis functions includes an Amplitude Embedding gate and also includes an RX gate. The quantum circuit for wavelet basis functions constructed based on the continuous wavelet basis functions includes an amplitude embedding gate and an RX quantum gate connected in sequence. The amplitude embedding gate is used to simulate the Gaussian envelope of the continuous wavelet basis function to obtain an embedded quantum state, and the RX gate is used to simulate the complex sine wave of the continuous wavelet basis function to obtain the basis function quantum state, and finally measurement is performed.

[0057] As Figure 4 shown, a schematic diagram of a quantum wavelet KAN network is given. The quantum wavelet KAN network includes:

[0058] A quantum input layer where classical data X is encoded into a quantum state.

[0059] A quantum KAN network layer that constructs transformation basis functions using quantum wavelet transform bases .

[0060] The input data of the quantum wavelet KAN network first passes through the quantum input layer to map the classical data to a quantum state; then the quantum wavelet KAN network consists of multiple KAN network layers, and the output of each layer is used as the input of each node in the next layer. The data starts from the quantum input layer and is processed through the quantum KAN network layers of each layer, gradually transforming and extracting features.

[0061] Based on the quantum wavelet KAN network, the fully connected weight matrix of the traditional MLP is avoided, fundamentally reducing the parameter complexity. Compared with traditional deep learning models, the quantum wavelet KAN network uses quantum wavelet basis function nodes instead of constant nodes. The traditional MLP requires multiple layers of neurons to be stacked, and each neuron contains multiple weight parameters. The formula for the number of parameters of KAN is: , where is the input dimension, is the parameter of the quantum wavelet basis function, and the number of parameters grows linearly with the input dimension ( ). The formula for the number of parameters of the traditional MLP is: , where is the input dimension, is the width of the hidden layer, and the number of parameters grows quadratically with and ( ). If the input dimension is 100, then the number of parameters of the traditional MLP reaches , and the number of parameters of KAN is only The number of parameters of KAN is only 20% of that of MLP. Each node function can approximate complex non-linear relationships with a small number of parameters, saving the number of parameters.

[0062] The wavelet basis function is a continuous wavelet basis function, which can be generally composed of the combination or deformation of a complex sine wave and a Gaussian envelope. The complex sine wave of the continuous wavelet basis function is simulated by an RX gate, and the Gaussian envelope of the wavelet basis function is simulated by an amplitude embedding gate, realizing the construction of a continuous wavelet based on a quantum circuit.

[0063] The constructed quantum continuous wavelet basis is: , where:

[0064] represents the Gaussian envelope part, is the scale parameter that controls the time domain width of the wavelet;

[0065] represents the complex sine wave part, is the parameter that controls the center frequency of the wavelet;

[0066] is the wavelet basis function constructed by the product of the above two parts.

[0067] The continuous wavelet basis function with a complex sine wave and a Gaussian envelope as the core is specifically Morlet continuous wavelet, Gabor continuous wavelet, Mexican Hat continuous wavelet or Gaussian continuous wavelet in implementation.

[0068] According to an embodiment of the present invention, the Gaussian envelope part of the continuous wavelet basis is input into the amplitude embedding gate to obtain a quantum Gaussian envelope function for amplitude encoding , and the Gaussian envelope quantum state is expressed as:

[0069] ;

[0070] where, represents the input variable; The specific value is the standard deviation, which determines the width or diffusion degree of the Gaussian function.

[0071] The frequency variable of the continuous wavelet basis is input into the RX quantum gate to obtain a quantum complex sine wave for encoding the rotation angle of the complex sine wave , and the complex sine wave quantum state is expressed as: is the RX quantum gate, represents the angular frequency, which determines the oscillation frequency of the sine wave.

[0072] The complex sine waves and Gaussian envelopes of different continuous wavelet basis functions are shown in Table 1:

[0073] Table 1: Comparison table of different continuous wavelet basis functions

[0074]

[0075] Taking the Morlet continuous wavelet as an example, the construction of the quantum wavelet circuit will be described below. The Morlet continuous wavelet is expressed as:

[0076] ;

[0077] The Gaussian envelope part is expressed as: ; The complex sine wave part is expressed as: ;

[0078] Among them, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents the input variable; represents the standard deviation, which determines the width or spread of the Gaussian function.

[0079] Through the Morlet continuous wavelet, the fitting ability of the basis function of the KAN network to the overall function can be enhanced. Therefore, the quantum circuit is used to replace the Morlet wavelet basis function, complete the construction of the basis function of the KAN network by the quantum circuit, and form a quantum KAN network. For the Morlet wavelet basis function, a Gaussian function ( ) is modulated on the complex sine wave ( ) respectively for quantum gate replacement, and finally a wavelet basis function quantum circuit is formed.

[0080] The embedded quantum state is expressed as:

[0081] ;

[0082] Among them, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents the input variable; represents the standard deviation, which determines the width or spread of the Gaussian function;

[0083] The basis function quantum state is expressed as:

[0084] , is the RX quantum gate.

[0085] For the complex sine wave, the rotation angle can be encoded with the RX quantum gate. The matrix transformation of the RX quantum gate is expressed as:

[0086] .

[0087] The role of the Rx gate is to rotate the quantum state around the X axis, and its operation is defined as: . Therefore, for the quantum state , applying After that, the quantum state becomes:

[0088] .

[0089] For the modulated Gaussian function, amplitude encoding can be performed using an amplitude embedding gate. The Gaussian function to be modulated is , where t is the input variable, is the amplitude modulation parameter for modulating the Gaussian function shape. The input variable can be encoded into the amplitude of a single qubit. Since the qubit state must be normalized, the constructed quantum state is represented as follows:

[0090] , where the amplitude satisfies . , then .

[0091] The initial qubit state after embedding is:

[0092] .

[0093] Furthermore, a wavelet basis function quantum circuit is constructed by fitting the wavelet basis function. To derive the function obtained from the quantum circuit of the wavelet basis function. As Figure 3 shown, first perform amplitude embedding on , then perform a rotation, and finally perform a measurement. The initial qubit state after embedding is:

[0094] ;

[0095] The gate represents a rotation by an angle

[0096] around the X-axis. Its matrix representation is:

[0097] Applying to the quantum state , the output quantum state is obtained:

[0098] .

[0099] Calculate the components of the output quantum state :

[0100] Ground state component: .

[0101] Excited state component: .

[0102] Furthermore, a quantum wavelet KAN network is constructed using quantum circuits of wavelet basis functions. The multiple quantum circuits of wavelet basis functions are stacked to form a quantum wavelet KAN network. As Figure 4 shown, the input vector X is input into the quantum wavelet KAN network. The input data of the quantum wavelet KAN network first passes through a quantum input layer, which maps classical data to a quantum state; then the quantum wavelet KAN network consists of multiple KAN network layers, and the output of each layer serves as the input of each node in the next layer. The data starts from the quantum input layer and is processed through each layer of the quantum KAN network layer, gradually transforming and extracting features.

[0103] By using multi-scale quantum wavelet bases as the nodes of the network, the behavior of the model becomes more transparent, which helps to understand data features and the decision-making process in practical applications. The quantum wavelet KAN network uses quantum wavelet basis function nodes to replace constant nodes. By decomposing the input variables layer by layer, each node is a learnable quantum wavelet basis function, and different layer nodes are connected through activation functions. This design makes the mapping path from input to output clearer, and the influence of each feature can be directly traced through the quantum wavelet basis functions on the path, thus improving interpretability.

[0104] The input vector X of the data to be classified enters the quantum wavelet KAN network to obtain the output KAN(X).

[0105] Perform quantum circuit measurement. In quantum mechanics, a single measurement cannot directly obtain the expected value of an operator. The result of a single measurement is an eigenvalue of the operator. For example, for , the measurement result can only be or . To obtain 's expected value , a large number of samples need to be measured, and then the average value is calculated, or the probability distribution is calculated to obtain it. The classification label is determined by outputting the probability value, thereby obtaining the category of the data to be classified. The obtaining of the output probability value according to the quantum final state and the obtaining of the classification result of the data to be classified according to the output probability value include: performing multiple measurements on the quantum final state of the quantum wavelet KAN network; calculating the average value according to multiple measurement results to obtain the final expected value; obtaining the classification output probability value according to the final expected value; selecting the classification label with the highest probability from the output probability values.

[0106] Example 1: Handwritten digit recognition based on a quantum wavelet KAN neural network

[0107] Step 1: Extract features of handwritten images.

[0108] Randomly select 60,000 images from the handwritten image database, with each handwritten image sized at 28×28 pixels; from each handwritten image, form a vector with the pixels in each row, and combine all the vectors to form the feature of the handwritten image; divide the features of 60,000 handwritten images into a training set and a test set, with sizes of 50,000 and 10,000 respectively.

[0109] Step 2: Determine the basis function.

[0110] The wavelet basis function is a continuous wavelet basis function, which can be generally composed of the combination or deformation of a complex sine wave and a Gaussian envelope. The complex sine wave of the continuous wavelet basis function is simulated by an RX gate, and the Gaussian envelope of the wavelet basis function is simulated by an amplitude embedding gate, realizing the construction of a continuous wavelet based on a quantum circuit.

[0111] The quantization framework of the continuous wavelet basis covers mainstream continuous wavelets such as Morlet, Gabor, Mexican Hat, Gaussian, etc., all of which are continuous wavelet basis functions centered on complex sine waves and Gaussian envelopes.

[0112] The constructed quantum continuous wavelet basis is

[0113] Where: represents the Gaussian envelope part, is the scale parameter that controls the time domain width of the wavelet; represents the complex sine wave part, is the parameter that controls the center frequency of the wavelet; is the wavelet basis function constructed by the product of the above two parts.

[0114] According to an embodiment of the present invention, the Gaussian envelope part of the continuous wavelet basis is input into the amplitude embedding gate to obtain a quantum Gaussian envelope function for amplitude encoding , and the Gaussian envelope quantum state is expressed as:

[0115] ;

[0116] Where, represents the input variable; represents the standard deviation, which determines the width or diffusion degree of the Gaussian function.

[0117] The frequency variable of the continuous wavelet basis is input into the RX quantum gate to obtain a quantum complex sine wave for encoding the rotation angle of the complex sine wave

[0118] , is an RX quantum gate.

[0119] Among them, represents the angular frequency, which determines the oscillation frequency of the sine wave.

[0120] Next, taking the Morlet wavelet in the continuous wavelet basis function as an example, the construction of the quantum wavelet circuit will be described. The Morlet wavelet is expressed as , among which, the Gaussian envelope part is expressed as: , and the complex sine wave part is expressed as: , among which, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents the input variable; represents the standard deviation, which determines the width or spread of the Gaussian function.

[0121] The Morlet wavelet is formed by modulating a Gaussian function ( ) with a complex sine wave ( ). Through the Morlet wavelet, the fitting ability of the basis function of the KAN neural network to the overall function can be enhanced. Therefore, the quantum circuit is used to simulate the Morlet wavelet basis function to complete the construction of the basis function of the KAN network by the quantum circuit. For the Morlet wavelet basis function, the complex sine wave modulates a Gaussian function respectively for quantum gate replacement, and finally a quantum circuit of the wavelet basis function is formed.

[0122] Step 3: The quantum gate circuit fits the complex sine wave of the wavelet basis function.

[0123] For the complex sine wave, the rotation angle can be encoded by the RX quantum gate. The matrix transformation of the RX quantum gate is as follows

[0124] ;

[0125] The role of the Rx gate is to rotate the quantum state around the X axis, and its operation is defined as: . Therefore, let , and after applying , the quantum state becomes:

[0126] .

[0127] Step 4: The quantum gate circuit fits the modulated Gaussian function of the wavelet basis function.

[0128] For the modulated Gaussian function, amplitude encoding can be performed using the Amplitude Embedding gate.

[0129] First, the Gaussian function to be modulated is , where \(t\) is the input variable, is the amplitude modulation parameter for function form modulation. Since the qubit state must be normalized, the quantum state constructed based on the Gaussian function is expressed as:

[0130] . Where the amplitude satisfies , , .

[0131] Therefore, the initial qubit state after embedding is: .

[0132] Step 5: Construction of the quantum gate circuit to fit the wavelet basis function.

[0133] To derive the function obtained from the quantum circuit of the wavelet basis function, first perform amplitude embedding on , then perform a rotation, and finally perform multiple measurements to obtain the quantum state output by the quantum circuit of the N -th level wavelet basis function; N ranges from 1 to L , and the quantum state output by the quantum circuit of the L -th level wavelet basis function is the quantum final state; the initial qubit state after embedding is:

[0134] .

[0135] The \(R_x(\theta)\) gate represents a rotation by an angle around the X-axis. Its matrix representation is:

[0136] ;

[0137] Apply to : ;

[0138] Calculate the component of :

[0139] ;

[0140] .

[0141] Step 6: Quantum circuit measurement of the quantum gate circuit to fit the wavelet basis function.

[0142] In quantum mechanics, a single measurement cannot directly obtain the expectation value of an operator. The result of a single measurement is an eigenvalue of the operator. For example, for the quantum state , the measurement result can only be or To obtain the expected value of , a large number of samples need to be measured, and then the average value is calculated, or it is obtained by calculating the probability distribution. Specifically: Only one of the measurement results of or can be obtained in one measurement.

[0143] Expected value: Multiple measurements are required, and the probabilities of the measurement results being and are statistically obtained and , and then the expected value is calculated:

[0144] ;

[0145] Assume the expected value of the measurement , which distinguishes the probabilities of obtaining and :

[0146] ;

[0147] Calculate :

[0148] ;

[0149] Similarly, calculate :

[0150] ;

[0151] Simplify the expected value and calculate the difference:

[0152]

[0153] Further simplify:

[0154] ;

[0155] Use the trigonometric identity :

[0156] ;

[0157] Since and , so:

[0158] ;

[0159] Obtain the expected value of :

[0160] ;

[0161] Therefore, the measured function with respect to is: . In this way, the construction of the quantum wavelet basis function is completed.

[0162] Step 7: Construct the quantum KAN network. In KAN, the relationship between layers is as follows: Let be a vector of size n. Transpose and put it into a matrix X with m rows and n columns:

[0163] ;

[0164] Construct the matrix as follows:

[0165] ;

[0166] Each row of the matrix is the transposed vector . Define the operator , which acts on the matrix . Different from the KAN network using the Spline function, the transformation basis uses the quantum wavelet transform basis obtained previously:

[0167] ;

[0168] Sum the elements of each row of the quantum wavelet transform basis matrix and output the result vector . Define as follows:

[0169]

[0170] The elements of the vector are defined as:

[0171]

[0172] In this definition, processes the matrix , sums the elements of each row, and outputs the result vector . acts on the input vector , generating an output, where each element of processes the corresponding element of , sums them, and generates an element of the output:

[0173] ;

[0174] wherein

[0175] ;

[0176] Here, represents the connection layer and the layer activation function. Each element represents the connection layer the th neuron of the th neuron of layer is regarded as a matrix containing only the input vector. For the entire network, the output after L layers is:

[0177] ;

[0178] Step 8: Node representation and training.

[0179] The nodes in the KAN network represent the learning ability of the model, and the values of the nodes are realized through the evolution and operation of quantum states. The training process uses quantum gradient descent and hybrid quantum-classical optimization algorithms to minimize the error function and gradually optimize the node values.

[0180] Step 9: To construct a complete neural network, the first layer of each neural network is uniformly set as the input layer, and the activation function is the ReLU function for inputting the picture vector;

[0181] The last layer is uniformly set as the output layer, the number of neurons is set to 10, and the activation function is the Softmax function to meet the probability output.

[0182] Step 10: Group the picture vectors of the training set according to the quantum KAN neural network.

[0183] Construct a quantum wavelet KAN network with 10 qubits and input the picture vector into the quantum wavelet KAN network.

[0184] Step 11: Node representation and training:

[0185] Set the weight values in each neural network to random values that follow a uniform distribution between 0 and 1;

[0186] The nodes in the KAN network represent the learning ability of the model, and the values of the nodes are realized through the evolution and operation of quantum states.

[0187] The training process uses quantum gradient descent and hybrid quantum-classical optimization algorithms to minimize the error function and gradually optimize the node values.

[0188] Step 12: Input the features of the handwritten images in the training set into each neural network respectively, and perform iterative training on each quantum KAN neural network. When the rate of decrease in the loss value slows down, such as the change in iterative loss < 1%, and the fluctuation range of the accuracy rate shrinks within the range of ±0.2%, it is considered that the model is close to convergence, and finally a trained neural network is obtained. The number of training rounds ranges from 30 to 100 rounds, and the preferred number of training times is 50 rounds.

[0189] Adopt the operation steps of the above-mentioned embodiment, and use the Pytorch and Pennylane function libraries for joint training during training to classify the MNIST handwritten image set, which is one of the most complex handwritten image sets at present. This image set has 10 classification labels and a total of 60,000 handwritten images, all of which are used in the simulation experiment of the present invention. It can be seen from the figure that the effective Loss value during training decreases, and the Loss value of the classical neural network with the same number of parameters is lower and the accuracy is higher. From Figure 6 the curve in it, it can be seen that the classification accuracy of the optimal neural network continues to improve, and the classification accuracy can reach 0.95 after 50 optimizations. This is because the quantum wavelet KAN network proposed by the present invention enables the basis functions of each KAN network to combine the characteristics of quantum gates and exert great fitting potential. It shows strong optimization ability during the construction process, making the classification accuracy of the overall neural network continuously improve.

[0190] In addition, according to an exemplary embodiment of the present invention, a computer-readable storage medium storing a computer program may also be provided. The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to execute the classification method based on the quantum wavelet KAN network according to the exemplary embodiment of the present invention. The computer-readable recording medium is any data storage device that can store data read by a computer system. Examples of computer-readable recording media include: read-only memory, random access memory, read-only optical discs, magnetic tapes, floppy disks, optical data storage devices, and carrier waves (such as data transmission via the Internet through wired or wireless transmission paths).

[0191] In addition, according to an exemplary embodiment of the present invention, a computing device may also be provided. The computing device includes a processor and a memory. The memory is used to store a computer program. The computer program is executed by the processor to cause the processor to execute the computer program of the classification method based on the quantum wavelet KAN network according to the exemplary embodiment of the present invention.

[0192] Although the present invention has been described in connection with various embodiments, those skilled in the art will recognize other variations of the disclosed embodiments while practicing the claimed invention, by viewing the drawings, the disclosure, and the like. In the specification, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude a plurality. A single processor or other unit may perform several functions recited in the specification. Certain measures are recited in mutually different embodiments, but this does not mean that these measures cannot be combined to produce good results.

[0193] Although the present invention has been described in connection with specific features and their embodiments, it will be apparent that various modifications and combinations can be made without departing from the spirit and scope of the invention. Accordingly, the specification and drawings are merely exemplary of the present invention and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of the invention. Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the invention. Thus, if these modifications and variations of the present invention fall within the scope of the present invention and its equivalent technologies, the present invention is also intended to include these changes and modifications.

Claims

1. A classification method based on quantum wavelet KAN network, characterized in that: The following steps are involved: Obtaining a normalized vector of data to be classified; the data to be classified is image data; The normalized vector is represented by a quantum state using a plurality of quantum bits to obtain a quantum initial state; Determine a wavelet basis function, and construct an L-level wavelet basis function quantum circuit based on the wavelet basis function to form a front-to-back cascaded L-layer quantum wavelet KAN network, wherein the input of the first-layer wavelet basis function quantum circuit is the quantum initial state, and the output of the L-layer quantum wavelet KAN network is the quantum final state; Obtaining an output probability value according to the quantum final state, and obtaining a classification result of the data to be classified according to the output probability value; The wavelet basis function is a continuous wavelet basis function formed by combining or deforming a complex sine wave and a Gaussian envelope. The continuous wavelet basis function is expressed as: ,in: represents the Gaussian envelope part, is the scale parameter that controls the width of the wavelet in the time domain; represents the complex sine wave part, is the parameter that controls the center frequency of the wavelet; It is a continuous wavelet basis function constructed by the product of Gaussian envelope and complex sine wave. represents input variables; A wavelet basis function quantum circuit constructed based on the continuous wavelet basis function comprises an amplitude embedding gate and an RX quantum gate connected in sequence, wherein the amplitude embedding gate is used to simulate the Gaussian envelope of the continuous wavelet basis function to obtain an embedded quantum state, and the RX gate is used to simulate the complex sine wave of the continuous wavelet basis function to obtain a basis function quantum state; The amplitude embedding gate is used to perform amplitude encoding to simulate the Gaussian function. , and get the embedded quantum state; The RX quantum gate is used to encode the rotation angle of the embedded quantum state to simulate a complex sine wave , and obtain the basis function quantum state.

2. The classification method based on quantum wavelet KAN network according to claim 1 is characterized in that: The output of the previous wavelet basis function quantum circuit in the quantum wavelet KAN network is used as the input of the next wavelet basis function quantum circuit. It is expressed as: , in, is regarded as a matrix that only includes the input vector, which represents the quantum initial state; L represents the number of quantum circuit layers of the wavelet basis function, Represents the previous connection layer And the next connection layer The activation function, represents the quantum continuous wavelet basis function, and the expression is: ; represents the Gaussian envelope part, represents the complex sine wave part, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents input variables; It is a scale parameter that controls the width of the wavelet in the time domain and is used to determine the width or diffusion of the Gaussian function.

3. The classification method based on quantum wavelet KAN network according to claim 1 is characterized in that: Obtaining an output probability value according to the quantum final state, and obtaining a classification result of the data to be classified according to the output probability value, including: Perform multiple measurements on the quantum final state of the quantum wavelet KAN network; Calculate the average value based on multiple measurement results to get the final expected value; Obtain the classification output probability value based on the final expected value; Select the class label with the highest probability from the output probability values.

4. The classification method based on quantum wavelet KAN network according to claim 1 is characterized in that: The method also includes: using the data to be classified in the training set to train the quantum KAN network, the training process uses the quantum gradient descent method and the hybrid quantum classical optimization algorithm to minimize the error function and gradually optimize the quantum gate parameters in the quantum KAN network, the quantum gate includes an amplitude embedding gate and an RX quantum gate; the initial parameters of the quantum gate parameters of the quantum KAN network are randomized parameters.

5. A classification device based on quantum wavelet KAN network, characterized in that: include: A normalization unit, configured to obtain a normalized vector of the data to be classified; the data to be classified is image data; A quantum encoding unit is configured to use a plurality of quantum bits to represent the normalized vector in a quantum state to obtain a quantum initial state; The network construction unit is configured to determine the wavelet basis function, construct an L-level wavelet basis function quantum circuit based on the wavelet basis function, and form a front-to-back cascaded L-layer quantum wavelet KAN network, wherein the input of the first layer of the wavelet basis function quantum circuit is the quantum initial state, and the output of the L-layer quantum wavelet KAN network is the quantum final state; an output unit, configured to obtain an output probability value according to the quantum final state, and obtain a classification result of the data to be classified according to the output probability value; The wavelet basis function is a continuous wavelet basis function formed by combining or deforming a complex sine wave and a Gaussian envelope. The continuous wavelet basis function is expressed as: ,in: represents the Gaussian envelope part, is the scale parameter that controls the width of the wavelet in the time domain; represents the complex sine wave part, is the parameter that controls the center frequency of the wavelet; It is a continuous wavelet basis function constructed by the product of Gaussian envelope and complex sine wave. represents input variables; A wavelet basis function quantum circuit constructed based on the continuous wavelet basis function comprises an amplitude embedding gate and an RX quantum gate connected in sequence, wherein the amplitude embedding gate is used to simulate the Gaussian envelope of the continuous wavelet basis function to obtain an embedded quantum state, and the RX gate is used to simulate the complex sine wave of the continuous wavelet basis function to obtain a basis function quantum state; The amplitude embedding gate is used to perform amplitude encoding to simulate the Gaussian function. , and get the embedded quantum state; The RX quantum gate is used to encode the rotation angle of the embedded quantum state to simulate a complex sine wave , and obtain the basis function quantum state.

6. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed, the classification method based on the quantum wavelet KAN network described in any one of claims 1 to 4 is implemented.

7. A computing device, characterized in that It comprises a processor and a communication interface coupled to the processor; the processor is used to run a computer program or instruction to implement the classification method based on the quantum wavelet KAN network as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Medical image classification method combining wavelet transform and tensor network

    CN113989576A

  • Quantum neural network training method and device

    WO2024046136A1