Classification method and device based on quantum wavelet KAN network, medium and equipment

Through the method based on quantum wavelet KAN network, the problem of slow speed and insufficient feature extraction when processing high-dimensional complex data is solved, and more efficient data processing and feature extraction are achieved, improving accuracy and interpretability.

CN119807862AActive Publication Date: 2025-04-11BEIJING INST OF TECH
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When processing complex data with high-dimensional data, existing deep learning models have problems such as slow data processing speed, large parameters, strong dependence on high-quality labeled data, and difficulty in effectively extracting multi-scale information.

Method used

The classification method based on quantum wavelet KAN network is adopted to construct an L-layer quantum wavelet KAN network through quantum state representation and wavelet basis function to improve data processing speed and efficiently extract multi-scale features.

Benefits of technology

Faster data processing speed and more efficient multi-scale feature extraction are achieved, with higher accuracy than traditional neural networks, and the number of parameters is reduced by 80%, which improves the interpretability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807862A_ABST
    Figure CN119807862A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of quantum computing, and discloses a classification method and device based on a quantum wavelet KAN network, a medium and equipment. The method comprises the following steps: acquiring a normalized vector of to-be-classified data; performing quantum state representation on the normalized vector by adopting a plurality of quantum bits to obtain a quantum initial state; a continuous wavelet basis function is determined, an L-level wavelet basis function quantum circuit is constructed based on the wavelet basis function, L layers of quantum wavelet KAN networks which are cascaded front and back are formed, the input of the first layer of wavelet basis function quantum circuit is a quantum initial state, and the output of the Lth layer of quantum wavelet KAN network is a quantum final state; and obtaining an output probability value according to the quantum end state, and obtaining a classification result of the to-be-classified data according to the output probability value. By applying the method, the data processing speed can be increased, and the multi-scale features can be efficiently extracted.
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 significant progress in the field of data processing. For example, convolutional neural networks (CNNs) and Transformer models have performed well in tasks such as image recognition, speech processing, and natural language processing. However, these models have some obvious limitations when processing high-dimensional complex data. For example, deep learning models usually require a large number of parameters, the training process takes a long time, and they are highly dependent on high-quality labeled data. In addition, traditional models are not good at 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 that needs to be solved. Summary of the invention

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

[0005] To achieve the above object, the present invention provides the following technical solutions: According to one aspect of the present invention, a classification method based on a quantum wavelet KAN network is provided, comprising: Get the normalized vector of the data to be classified; 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; An output probability value is obtained according to the quantum final state, and a classification result of the data to be classified is obtained according to the output probability value.

[0006] According to one 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: ,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 the input variable.

[0007] According to one 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 the basis function quantum state.

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

[0009] According to one embodiment of the present invention, 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.

[0010] According to one embodiment of the present invention, obtaining an output probability value according to a quantum final state and obtaining a 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 an average value based on multiple measurement results to obtain a final expected value; obtaining a classification output probability value according to the final expected value; and selecting a classification label with the largest probability from the output probability values.

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

[0012] On the other hand, the present invention also provides a classification device based on quantum wavelet KAN network, comprising: A normalization unit, configured to obtain a normalized vector of the data to be classified; 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; The output unit is 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.

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

[0014] On the other hand, the present invention also provides a computing device, characterized in that it includes 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.

[0015] The present invention provides a classification method, device, medium and equipment based on quantum wavelet KAN network, which is used to improve data processing speed and efficiently extract multi-scale feature performance by combining quantum computing with wavelet KAN network. The nodes of KAN network are its core constituent units, and quantum wavelet basis functions constitute the nodes of quantum wavelet KAN network. Nodes of different layers are connected by activation functions to realize quantum wavelet KAN network with quantum wavelet basis functions as nodes. Based on the quantum wavelet KAN neural network architecture replaced by quantum gate basis functions, 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 instead of constant nodes, so that fewer parameters drive the neural network and the stacking of different nodes enhances interpretability.

[0016] Beneficial effects: The classification method, device, medium and equipment based on quantum wavelet KAN network provided by the present invention have the following beneficial effects compared with the prior art: 1. Optimize feature extraction capability: The classification method and device are based on the quantum wavelet KAN network, which combines wavelet transform with KAN network. Through the multi-scale analysis capability of wavelet transform, combined with the powerful fitting ability of KAN network for nonlinear relationships, quantum superposition and entanglement are used to effectively capture the local and global characteristics of data, and achieve more accurate feature extraction with higher accuracy than the classical neural network with the same number of parameters. Experiments show that on the MNIST handwritten digit data set, the accuracy of quantum wavelet KAN reaches 95.1% with the same number of parameters, which is 4% higher than the traditional neural network MLP; 2. Reduce parameter consumption: The classification method and device are based on the quantum wavelet KAN network to avoid the fully connected weight matrix of the traditional MLP, fundamentally reducing the parameter complexity. Compared with the traditional deep learning model, 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 KAN parameter formula is: ,in is the input dimension, is the parameter of the quantum wavelet basis function, and the parameter quantity varies with the input dimension Linear growth ( ). The traditional MLP parameter formula is: ,in is the input dimension, is the width of the hidden layer, and the number of parameters varies with and Secondary growth ( ). If the input dimension is 100, the number of parameters of the traditional MLP is , the number of KAN parameters is only The number of parameters in KAN is only 20% of that in MLP. Each node function can approximate complex nonlinear relationships with a small number of parameters, saving the number of parameters. 3. Improve interpretability: The classification method and device are based on the quantum wavelet KAN network. By using the multi-scale quantum wavelet basis as the node of the network, the behavior of the model is made more transparent, which helps to understand the data characteristics and decision-making process in practical applications. The quantum wavelet KAN network uses quantum wavelet basis function nodes instead of constant nodes. By decomposing the input variables layer by layer, each node is a learnable quantum wavelet basis function, and the nodes in different layers are connected by activation functions. This design makes the mapping path from input to output clearer, and the impact of each feature can be directly tracked through the quantum wavelet basis function on the path, thereby improving interpretability. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part 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 an improper limitation of the present invention. In the drawings: Figure 1 is a flow chart of a classification method based on a quantum wavelet KAN network according to the present invention and exemplary embodiments; 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; Figure 3 is a schematic diagram of a wavelet basis function quantum circuit according to an exemplary embodiment of the present invention; Figure 4 is a schematic diagram of a quantum wavelet KAN network according to an exemplary embodiment of the present invention; Figure 5 is a schematic diagram of a loss function for classification based on a quantum wavelet KAN network according to an exemplary embodiment of the present invention; Figure 6 is a schematic diagram of the accuracy of classification based on the quantum wavelet KAN network according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0018] 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.

[0019] 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.

[0020] 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.

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

[0022] 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.

[0023] 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: Step S1: Obtain a normalized vector of the data to be classified; Step S2: using a plurality of quantum bits to represent the normalized vector in a quantum state to obtain a quantum initial state; Step S3: Determine the 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, where the input of the first layer of 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; Step S4: 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.

[0024] 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 KAN network parameters; the initial parameters of the quantum KAN network parameters are randomized parameters.

[0025] like Figure 2 As shown, a schematic diagram of a classification device based on a quantum wavelet KAN network is given, including: A normalization unit, configured to obtain a normalized vector of the data to be classified; 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; The output unit is 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.

[0026] like Figure 3 As shown, a schematic diagram of the wavelet basis function quantum circuit is given. The wavelet basis function quantum circuit includes an amplitude embedding gate after Amplitude Embedding and an RX gate. The 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 the basis function quantum state, and finally the measurement is performed.

[0027] like Figure 4 As shown, a schematic diagram of a quantum wavelet KAN network is given. The quantum wavelet KAN network includes: In the quantum input layer, classical data X is encoded into quantum states.

[0028] Quantum KAN network layer, using quantum wavelet transform basis to construct transformation basis function .

[0029] The input data of the quantum wavelet KAN network first passes through the quantum input layer to map the classical data to the quantum state; then the quantum wavelet KAN network is composed of multiple KAN network layers, and the output of each layer is used as the input of each node in the next layer. Starting from the quantum input layer, the data is processed by the quantum KAN network layer of each layer, and the features are gradually transformed and extracted.

[0030] The quantum wavelet KAN network circumvents the fully connected weight matrix of the traditional MLP and fundamentally reduces the parameter complexity. Compared with the traditional deep learning model, 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 KAN parameter formula is: ,in is the input dimension, is the parameter of the quantum wavelet basis function, and the parameter quantity varies with the input dimension Linear growth ( ). The traditional MLP parameter formula is: ,in is the input dimension, is the width of the hidden layer, and the number of parameters varies with and Secondary growth ( ). If the input dimension is 100, the number of parameters of the traditional MLP is , the number of KAN parameters is only The number of parameters in KAN is only 20% of that in MLP. Each node function can approximate complex nonlinear relationships with a small number of parameters, saving the number of parameters.

[0031] The wavelet basis function is a continuous wavelet basis function, which can be summarized as a 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, thereby realizing the construction of a continuous wavelet based on a quantum circuit.

[0032] The constructed quantum continuous wavelet basis is: ,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 wavelet basis function constructed by the product of the above two parts.

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

[0034] According to one embodiment of the present invention, the Gaussian envelope part of the continuous wavelet basis is Input the amplitude embedding gate to obtain the quantum Gaussian envelope function for amplitude encoding , the Gaussian envelope quantum state is expressed as: ; in, represents input variables; The specific value is the standard deviation, which determines the width or spread of the Gaussian function.

[0035] The frequency variable of the continuous wavelet basis The RX quantum gate obtains a complex sine wave for rotating the complex sine wave with an angle-encoded quantum complex sine wave. , the complex sine wave quantum state is expressed as: , is the RX quantum gate, It represents the angular frequency, which determines the oscillation frequency of the sine wave.

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

[0037] The following uses Morlet continuous wavelet as an example to explain the construction of quantum wavelet circuit. Morlet continuous wavelet is expressed as: ; The Gaussian envelope part is expressed as: ; The complex sine wave part is expressed as: ; in, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents input variables; Represents the standard deviation, which determines the width or spread of the Gaussian function.

[0038] The Morlet continuous wavelet can enhance the ability of the KAN network basis function to fit the overall function. Therefore, the Morlet wavelet basis function is replaced by quantum circuits to complete the construction of the KAN network basis function by quantum circuits, thus forming a quantum KAN network. For the Morlet wavelet basis function, the complex sine wave ( ) modulates a Gaussian function ( ) to replace the quantum gates and finally form a wavelet basis function quantum circuit.

[0039] The embedded quantum state is expressed as: ; in, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents input variables; represents the standard deviation, which determines the width or spread of the Gaussian function; The basis function quantum state is expressed as: , It is the RX quantum gate.

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

[0041] The function 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 , apply After that, the quantum state becomes: .

[0042] For modulated Gaussian functions, the amplitude can be encoded using an amplitude embedding gate. The Gaussian function to be modulated is , where t is the input variable, is the amplitude modulation parameter used for Gaussian function morphology modulation. The input variable can be encoded into the amplitude of a single quantum bit. Since the quantum bit state must be normalized, the quantum state representation is constructed as follows: , where the amplitude satisfies . ,but .

[0043] The initial quantum bit state after embedding is: .

[0044] Furthermore, the wavelet basis function is fitted to construct the wavelet basis function quantum circuit. In order to derive the function obtained by the quantum circuit of the wavelet basis function. Figure 3 First, The amplitude is embedded and then passed through a Rotate and finally measure. The initial quantum bit state after embedding is: ; The door represents the rotation angle around the X axis . Its matrix representation is: ; Will Application to quantum states , and the output quantum state is obtained : .

[0045] Calculate the output quantum state Serving size: Ground state component: .

[0046] Excited state components: .

[0047] Furthermore, a quantum wavelet KAN network is constructed using wavelet basis function quantum circuits. The plurality of wavelet basis function quantum circuits are stacked to form a quantum wavelet KAN network. Figure 4 As shown in the figure, the input vector X is input to the quantum wavelet KAN network. The input data of the quantum wavelet KAN network first passes through the quantum input layer to map the classical data to the quantum state; then the quantum wavelet KAN network is composed of multiple KAN network layers, and the output of each layer is used as the input of each node in the next layer. Starting from the quantum input layer, the data is processed by the quantum KAN network layer of each layer, and the features are gradually transformed and extracted.

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

[0049] The input vector X of the data to be classified enters the quantum wavelet KAN network and the output KAN (X) is obtained.

[0050] Perform quantum circuit measurement. In quantum mechanics, a measurement does not directly give the expected value of an operator. The result of a measurement is an eigenvalue of the operator. For example, , the measurement result can only be or .to get Expected value , it is necessary to measure a large number of samples and then calculate the average value, or obtain it by calculating the probability distribution. The classification label is determined by the output probability value, so as to obtain the category of the data to be classified. The output probability value is obtained according to the quantum final state, and the classification result of the data to be classified is obtained according to the output probability value, including: 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; and selecting the classification label with the largest probability from the output probability value.

[0051] Example 1: Handwritten digit recognition based on quantum wavelet KAN neural network Step 1: Extract handwritten image features.

[0052] 60,000 pictures are randomly selected from the handwritten picture database, and the size of each handwritten picture is 28×28 pixels. From each handwritten picture, the pixels in each row are combined into a vector, and all vectors are combined into the features of the handwritten picture. The 60,000 handwritten picture features are divided into a training set and a test set, with sizes of 50,000 and 10,000 respectively.

[0053] Step 2: Determine the basis functions.

[0054] The wavelet basis function is a continuous wavelet basis function, which can be summarized as a 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, thereby realizing the construction of a continuous wavelet based on a quantum circuit.

[0055] The quantization framework of continuous wavelet basis covers mainstream continuous wavelets such as Morlet, Gabor, Mexican Hat, Gaussian, etc. These are continuous wavelet basis functions with complex sine waves and Gaussian envelopes as the core.

[0056] The constructed quantum continuous wavelet basis is

[0057] 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 wavelet basis function constructed by the product of the above two parts.

[0058] According to one embodiment of the present invention, the Gaussian envelope part of the continuous wavelet basis is Input the amplitude embedding gate to obtain the quantum Gaussian envelope function for amplitude encoding , the Gaussian envelope quantum state is expressed as: ; in, represents input variables; Represents the standard deviation, which determines the width or spread of the Gaussian function.

[0059] The frequency variable of the continuous wavelet basis The RX quantum gate obtains a complex sine wave for rotating the complex sine wave with an angle-encoded quantum complex sine wave. , the complex sine wave quantum state is expressed as: , It is the RX quantum gate.

[0060] in, It represents the angular frequency, which determines the oscillation frequency of the sine wave.

[0061] The following uses the Morlet wavelet in the continuous wavelet basis function as an example to illustrate the construction of quantum wavelet circuits. The Morlet wavelet is expressed as , where the Gaussian envelope part is expressed as: , the complex sine wave part is expressed as: ,in, represents the angular frequency, which determines the oscillation frequency of the sine wave; represents input variables; Represents the standard deviation, which determines the width or spread of the Gaussian function.

[0062] The Morlet wavelet consists of a complex sine wave ( ) modulates a Gaussian function ( ). The Morlet wavelet can enhance the ability of the KAN neural network basis function to fit the overall function. Therefore, the quantum circuit is used to simulate the Morlet wavelet basis function to complete the construction of the KAN network basis function by the quantum circuit. For the Morlet wavelet basis function, the complex sine wave Modulate a Gaussian function The quantum gates are replaced to finally form a wavelet basis function quantum circuit.

[0063] Step 3: The quantum gate circuit is fitted with the complex sine wave of the wavelet basis function.

[0064] For complex sine waves, the rotation angle can be encoded using the RX quantum gate. The matrix transformation of the RX quantum gate is as follows ; The function of the Rx gate is to rotate the quantum state around the X axis, and its operation is defined as: Therefore, let , apply After that, the quantum state becomes: .

[0065] Step 4: The quantum gate circuit is fitted with the wavelet basis function modulated Gaussian function.

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

[0067] First, the Gaussian function to be modulated is , where t is the input variable, is the amplitude modulation parameter used for function shape modulation. Since the quantum bit state must be normalized, the quantum state constructed according to the Gaussian function is expressed as: . The amplitude meets , , .

[0068] Therefore, the initial quantum bit state after embedding is: .

[0069] Step 5: Construction of quantum gate circuit fitting wavelet basis function.

[0070] In order to derive the function obtained by the quantum circuit of the wavelet basis function, we first The amplitude is embedded and then passed through a Rotate, and finally perform multiple measurements to obtain the N The quantum state output by the quantum circuit of the wavelet basis function; N The value range is 1 to L , No. L The quantum state output by the quantum circuit of the wavelet basis function is the final quantum state; the initial quantum bit state after embedding is: .

[0071] The door represents the rotation angle around the X axis . Its matrix representation is: ; Will Application : ; calculate Serving size: ; .

[0072] Step 6: Quantum circuit measurement of quantum gate circuit fitting wavelet basis function.

[0073] In quantum mechanics, a measurement does not directly give the expected value of an operator. The result of a measurement is an eigenvalue of the operator. For example, for a quantum state , the measurement result can only be or .to get Expected value , it is necessary to measure a large number of samples and then calculate the average value, or obtain it by calculating the probability distribution. Specifically: one measurement can only obtain or One of the measurement results.

[0074] Expected value: It needs to be measured multiple times, and the measurement results are statistically obtained as follows: and Probability and , and then calculate the expected value : ; Assumption measurement The expected value of and Probability: ; calculate : ; Similarly, calculate : ; Simplify the expected value and compute the difference:

[0075] Simplifying further: ; Using trigonometric identities : ; because and ,so: ; get Expected value : ; Therefore, the measured The function is: . This completes the construction of the quantum wavelet basis function.

[0076] Step 7: Construct the quantum KAN network. In KAN, the relationship between the layers is as follows: is a vector of size n. Transpose and put into a matrix X with m rows and n columns: ; Constructing the Matrix as follows: ; matrix Each row of is the transposed vector . Define the operator , which acts on the matrix Different from the KAN network using the Spline function, the transformation basis The previously obtained quantum wavelet transform basis is used: ; The elements of each row of the quantum wavelet transform basis matrix are summed and the resulting vector is output . It is defined as follows:

[0077] vector The elements of are defined as:

[0078] In this definition, Pair Matrix Process, find the sum of the elements in each row, and output the result vector . Acts on the input vector , produces an output where Each element of The corresponding elements of are processed, summed and an element of the output is generated: ; in ; Here, Represents the connection layer and Layer The activation function of each element Representation connection layer No. Neurons and layers No. The activation function of the neuron. Unlike multiplication, it computes a function of the input, which contains learnable parameters. Therefore, if Considered as a matrix containing only the input vector, for the entire network, the output after L layers is: ; Step 8: Node representation and training.

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

[0080] Step 9: To build a complete neural network, the first layer of each neural network is set as the input layer, and the activation function is the ReLU function to input the image vector; The last layer is 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.

[0081] Step 10: Group the training set image vectors according to the quantum KAN neural network.

[0082] Construct a 10-qubit quantum wavelet KAN network and input the image vector into the quantum wavelet KAN network.

[0083] Step 11: Node representation and training: Set the weight value in each neural network to a random value that follows a uniform distribution between 0 and 1; The nodes in the KAN network represent the learning ability of the model, and the value of the node is realized through the evolution and operation of the quantum state.

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

[0085] Step 12: Input the handwritten image features in the training set into each neural network, and iteratively train each quantum KAN neural network. When the rate of decrease of the loss value slows down, such as the iterative loss change <1%, and the accuracy fluctuation range is reduced to within ±0.2%, the model is considered to be close to convergence, and finally a trained neural network is obtained. The training round value range is 30-100 rounds, and the preferred number of training rounds is 50 rounds.

[0086] Using the operation steps of the above embodiment, Pytorch and Pennylane function libraries are used for joint training in training to classify the MNIST handwriting image set, which is one of the most complex handwriting image sets currently. The image set has 10 classification labels and a total of 60,000 handwriting 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 of training is reduced, and compared with the classic neural network with the same parameter value, the loss value is lower and the accuracy is higher. Figure 6It can be seen from the curve in that the classification accuracy of the optimal neural network is continuously improved, and the classification accuracy can reach 0.95 after 50 optimizations. This is because the quantum wavelet KAN network proposed in the present invention makes the basis function of each KAN network combined with the characteristics of the quantum gate, which exerts a huge fitting potential. It shows a strong optimization ability in the construction process, which continuously improves the classification accuracy of the overall neural network.

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

[0088] In addition, a computing device may also be provided according to an exemplary embodiment of the present invention. 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 so that the processor executes the computer program of the classification method based on the quantum wavelet KAN network according to the exemplary embodiment of the present invention.

[0089] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the drawings, etc. In the specification, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit can implement several functions listed in the specification. Certain measures are recorded in different embodiments, but this does not mean that these measures cannot be combined to produce good results.

[0090] Although the present invention has been described in conjunction with specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present invention. Accordingly, this specification and the accompanying drawings are merely exemplary illustrations of the present invention and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present invention. Obviously, those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, the present invention is intended to include such modifications and variations if they fall within the scope of the present invention and its equivalents.

Claims

1. A classification method based on quantum wavelet KAN network, characterized in that: The following steps are involved: Get the normalized vector of the data to be classified; 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; An output probability value is obtained according to the quantum final state, and a classification result of the data to be classified is obtained according to the output probability value.

2. The classification method based on quantum wavelet KAN network according to claim 1 is characterized in that: 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 the input variable.

3. The classification method based on quantum wavelet KAN network according to claim 2 is characterized in that: The 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, 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.

4. The classification method based on quantum wavelet KAN network according to claim 3 is characterized in that: 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.

5. 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.

6. The classification method based on quantum wavelet KAN network according to claim 1 is characterized in that: The step of 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: 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.

7. 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.

8. 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; 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; The output unit is 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.

9. 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 7 is implemented.

10. 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 7.

Citation Information

Patent Citations

  • ECG (electroencephalogram) emotion cognition method based on QWNN (quantum wavelet neural network) model

    CN106955112A

  • Method for predicting trend based on quantum weighted threshold repeat unit neural network

    CN108428023A

  • Medical image classification method combining wavelet transform and tensor network

    CN113989576A

  • Quantum computing based deep learning for detection, diagnosis and other applications

    US20230094389A1

  • Quantum neural network training method and device

    WO2024046136A1