CN114663690A - Method for realizing breast cancer classification based on novel quantum framework - Google Patents

Method for realizing breast cancer classification based on novel quantum framework Download PDF

Info

Publication number
CN114663690A
CN114663690A CN202210411357.3A CN202210411357A CN114663690A CN 114663690 A CN114663690 A CN 114663690A CN 202210411357 A CN202210411357 A CN 202210411357A CN 114663690 A CN114663690 A CN 114663690A
Authority
CN
China
Prior art keywords
quantum
breast cancer
data
classification
coding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210411357.3A
Other languages
Chinese (zh)
Other versions
CN114663690B (en
Inventor
单征
丁晓东
郭佳郁
许瑾晨
侯一凡
连航
范智强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Information Engineering University of PLA Strategic Support Force
Original Assignee
Information Engineering University of PLA Strategic Support Force
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Information Engineering University of PLA Strategic Support Force filed Critical Information Engineering University of PLA Strategic Support Force
Priority to CN202210411357.3A priority Critical patent/CN114663690B/en
Publication of CN114663690A publication Critical patent/CN114663690A/en
Application granted granted Critical
Publication of CN114663690B publication Critical patent/CN114663690B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Medical Informatics (AREA)
  • Evolutionary Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Mathematics (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Investigating Or Analysing Biological Materials (AREA)
  • Apparatus For Radiation Diagnosis (AREA)

Abstract

The invention discloses a method for realizing breast cancer classification based on a novel quantum frame, which comprises the following steps: carrying out quantum coding according to the breast cancer data characteristics, and coding the sample characteristics onto a quantum wire; performing quantum nuclear entropy principal component analysis on the breast cancer data by combining a quantum nuclear estimation method to achieve the purpose of breast cancer data preprocessing; carrying out quantum coding successively according to the obtained preprocessed breast cancer data, and entering a variational quantum circuit, namely a quantum variational classifier; the parameters of the quantum variation classifier are optimized by using a quantum gradient descent algorithm; judging whether the loss function of the quantum variation classifier meets the actual requirement, and if so, ending the quantum variation classification process; and if the actual requirement is not met, carrying out quantum coding on the next preprocessed breast cancer data. Under the conditions of less characteristic values of the data set and low classification accuracy, the method can effectively improve the breast cancer classification accuracy.

Description

Method for realizing breast cancer classification based on novel quantum framework
Technical Field
The invention belongs to the technical field of breast cancer classification and identification, and particularly relates to a method for realizing breast cancer classification based on a novel quantum framework.
Background
The main technologies for realizing the breast cancer classification problem based on quantum machine learning include a method based on quantum kernel estimation and a method based on quantum variation classification.
The main drawbacks of these techniques are:
1. the preprocessing of the data is mainly realized by a traditional method, particularly, SVD (singular value decomposition) and PCA (principal component analysis) are mainly utilized during data dimension reduction processing, and the two methods have obvious defects that firstly, the actual data do not present a complex nonlinear relation, secondly, a certain amount of redundant information exists between the data, which is likely to over-strengthen the information of a certain attribute, and neglecting certain useful characteristics prevents searching for a real potential structure between the data.
2. In the model parameter optimization link, the traditional gradient descent algorithm is mainly adopted, and the time consumed for convergence is long.
Machine learning and quantum computing are two different approaches, both of which exhibit the potential to handle some previously difficult to solve problems [ document 1: vojt ě ch
Figure BDA0003604201730000011
Antonio D.Córcoles.Supervised learning with quantum-enhanced feature spaces.Nature 567,209-212,2019.]. Many experimental proposals for noisy mesoscale quantum devices involve training a parameterized quantum circuit with a classical optimization loop. The mixed quantum classical algorithm is applied to quantum simulation, optimization and optimizationThe application in learning is wide. The flexibility of these approaches to certain types of errors and the high flexibility of coherence time and gate requirements make them particularly attractive for implementations operating on noisy intermediate-scale quantum (NISQ) regimes. Because of its simplicity and hardware efficiency, random circuits are often proposed as initial guesses for exploring quantum state space. Wherein the classification problem belongs to the category of supervised machine learning from a given labeled data set
Figure BDA0003604201730000012
Randomly selecting a training sample set T and a testing sample set S from a data set to ensure that T ^ S ∈ C, obtaining an objective function f through learning, and setting each attribute set CiCan be correctly mapped into a predefined class label, and then the sample of an unknown class is classified by using an objective function f. Classification requires that the information for each class must be known explicitly in advance and is a supervised learning algorithm that models or predicts discrete random variables. Quantum machine learning is to use quantum states to represent the feature space of classification problems and to use the large dimension of quantum Hilbert space to obtain an enhanced solution. Among them, the theory of the classification method of variation and the structure of quantum lines are most typically proposed in document 1, and a quantum variation classifier is established in [ document 2: mitarai, k., Negoro, M., Kitagawa, M.&Fujii,K.Quantum circuit learning.arXiv preprint arXiv:1803.00745(2018).][ document 3: farhi, E.&Neven,H.Classifification with quantum neural networks on near term processors.arXiv preprint arXiv:1802.06002(2018).]On the basis of the training set, and classifying the training set by using a variational quantum circuit. However, the traditional machine learning method is still adopted to find the optimal parameters of some tasks when parameter optimization is carried out, and the training of quantum wires by using a gradient-based or gradient-free classical optimization method is seriously influenced by the barren plateau existing in the cost landscape. While Kernel Principal Component Analysis (KPCA) efficiently computes principal components in a high-dimensional feature space through an integral operator and a nonlinear kernel function. In contrast to other non-linear Principal Component Analysis (PCA) techniques, KPCA requires only a solution to the eigenvalue problem, without any non-linear optimization,however, KPCA is limited by the limitation that the core estimates cost significantly increases when the data set is too large.
Disclosure of Invention
The invention mainly adopts the traditional method to realize data preprocessing aiming at the existing breast cancer classification method based on quantum machine learning, and can not ensure that the useful characteristics of the original information are kept while the dimension is reduced; in the model optimization link, the traditional gradient descent algorithm is mainly adopted, the problem of long convergence time is solved, a method for realizing breast cancer classification based on a novel quantum framework is provided, relevant parameters of a cost function needing to be solved by the traditional method are converted and coded to the relative phase of a superposition state in a Hilbert space, the quantum optimization algorithm is used for searching the optimal parameters of certain tasks, and the lean plateau problem is hopefully relieved; meanwhile, the optimization and acceleration of Kernel Principal Component Analysis (KPCA) are realized by utilizing a quantum kernel estimation method, so that the purpose of rapidly carrying out principal component analysis is achieved; under the conditions of less characteristic values of the data set and low classification accuracy, the breast cancer classification accuracy can be effectively improved.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for realizing breast cancer classification based on a novel quantum framework comprises the following steps:
step 1: carrying out quantum coding according to the breast cancer data characteristics, and coding the sample characteristics onto a quantum wire;
step 2: performing quantum nuclear entropy principal component analysis on the breast cancer data by combining a quantum nuclear estimation method to achieve the aim of breast cancer data preprocessing;
and step 3: carrying out quantum encoding successively according to the preprocessed breast cancer data obtained in the step 2, and entering a variational quantum circuit, namely a quantum variational classifier;
and 4, step 4: the parameters of the quantum variation classifier are optimized by using a quantum gradient descent algorithm;
and 5: judging whether the loss function of the quantum variation classifier meets the actual requirement, and if so, ending the quantum variation classification process; and if the actual requirement is not met, carrying out quantum coding on the next preprocessed breast cancer data, and turning to the step 3.
Further, the quantum coding in step 1 is to code the breast cancer data characteristics onto the phase of the state.
Further, the step 2 comprises:
step 2.1: solving the characteristic value of the kernel function K and the characteristic vectors lam and vec;
Figure BDA0003604201730000031
in addition
Figure BDA0003604201730000039
Then
Figure BDA0003604201730000032
Wherein phi (x) is a mapping function, and N is the total number of breast cancer data processed;
step 2.2: calculating entropy corresponding to the characteristic value and the characteristic vector;
step 2.3: rearranging the eigenvalues and the eigenvectors according to the magnitude of the entropy;
step 2.4: selecting the first n characteristic values and the characteristic vectors lambda and u with the maximum entropy;
step 2.5: the first n eigenvalues and eigenvectors are matched according to
Figure BDA0003604201730000033
Merging into a proof;
step 2.6: calculating K' according to a quantum nuclear estimation method;
Figure BDA0003604201730000034
step 2.7: calculating out
Figure BDA0003604201730000035
Obtaining dimension reduction data
Figure BDA0003604201730000036
Wherein λ and u are respectively the eigenvalue and eigenvector of the kernel function K arranged according to the magnitude of the entropy.
Further, the step 3 comprises:
preprocessing breast cancer data XiEncoding to quantum state ∞
Figure BDA0003604201730000037
Upper, through belt parameters
Figure BDA0003604201730000038
A variational quantum line of, wherein
Figure BDA0003604201730000041
Is initially of
Figure BDA0003604201730000042
Further, the step 4 comprises:
step 4.1: setting XiA classification prediction result corresponding to the correctly classified bit string β;
step 4.2: measuring in z direction to obtain output bit string alpha and its probability
Figure BDA0003604201730000043
After each measurement, comparing the bit strings alpha and beta to obtain data XiClassification prediction result y ofi
Step 4.3: predicting the result y by classificationiWith the true classification result Y given in the training setiComparing and calculating the loss function
Figure BDA0003604201730000044
Step 4.4: returning to the step 3, inputting the residual preprocessed breast cancer data into a quantum line in sequence to obtain corresponding breast cancer data
Figure BDA0003604201730000045
And calculating a total cost function
Figure BDA0003604201730000046
Step 4.5: the total cost function is optimized by using a quantum gradient descent algorithm, and parameters in the quantum lines are repeatedly updated
Figure BDA0003604201730000047
N until a cut-off condition is optimized.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention adopts a quantum nuclear entropy principal component analysis method, which is a process of realizing dimension ascending and dimension descending, and can remove redundant information of data, obtain a more compact and economic data representation form and simultaneously more effectively express the potential structure of the data. Finally, a nonlinear divisible problem is converted into a linear divisible problem through the method, a better processing effect can be obtained on data with more complex structures, and the aim of data preprocessing is really fulfilled.
2. The gradient descent method is an optimization algorithm, which is usually called a steepest descent method, and is commonly used for recursion approximation of a minimum deviation model in machine learning and artificial intelligence, wherein the gradient descent direction is a negative gradient direction which is used as a search direction, and a minimum value is solved along the gradient descent direction. In the training process, each forward propagation can obtain a loss value of an output value and a true value, the smaller the loss value is, the better the model is represented, and then the gradient descent algorithm is used here to help find the smallest loss value, so that the corresponding learning parameters b and w can be reversely deduced, and the effect of optimizing the model is achieved. However, a lot of computing resources and time are consumed when the traditional optimization process is really adopted, the quantum gradient descent algorithm is adopted, the quantum computing advantages are fully utilized, and the computing resources and the computing time can be effectively reduced.
3. The invention adopts the method of encoding the preprocessed data to the quantum circuit and realizes classification by utilizing the variational quantum circuit, thereby effectively improving the accuracy and the calculation power on the classification problem of the breast cancer.
Drawings
Fig. 1 is a basic flowchart of a method for classifying breast cancer based on a novel quantum framework according to an embodiment of the present invention;
FIG. 2 is an exemplary diagram of linear segmentation according to an embodiment of the present invention;
FIG. 3 is a general flow chart of a quantum kernel estimation method according to an embodiment of the invention;
FIG. 4 is a diagram illustrating data encoding according to an embodiment of the present invention;
FIG. 5 is a representation of data encoding according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a spatial transformation relationship of a principal component analysis method of quantum nuclear entropy according to an embodiment of the present invention;
FIG. 7 is a general flowchart of a quantum variational classification method according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating an example of an encoding method according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating a second example of the encoding method according to the embodiment of the present invention;
FIG. 10 is a schematic diagram of a quantum variational classifier according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating a quantum circuit optimized based on a quantum gradient descent algorithm according to an embodiment of the present invention;
FIG. 12 is a sample feature correlation corresponding to breast cancer data selected for an experiment in accordance with an embodiment of the present invention;
FIG. 13 shows the results of an experiment according to an embodiment of the present invention.
Detailed Description
The invention is further illustrated by the following examples in conjunction with the accompanying drawings:
as shown in fig. 1, a method for classifying breast cancer based on a novel quantum framework includes:
step 1: carrying out quantum coding according to the breast cancer data characteristics, and coding the sample characteristics onto a quantum line;
step 2: performing quantum nuclear entropy principal component analysis on the breast cancer data by combining a quantum nuclear estimation method to achieve the purpose of breast cancer data preprocessing;
and step 3: carrying out quantum encoding successively according to the preprocessed breast cancer data obtained in the step 2, and entering a variational quantum circuit, namely a quantum variational classifier;
and 4, step 4: the parameters of the quantum variation classifier are optimized by using a quantum gradient descent algorithm;
and 5: judging whether the loss function of the quantum variation classifier meets the actual requirement, and if so, ending the quantum variation classification process; and if the actual requirement is not met, carrying out quantum coding on the next preprocessed breast cancer data, and turning to the step 3.
It is worth to be noted that the step 1 and the step 2 belong to the processing steps of the quantum nuclear entropy principal component analysis method specifically; step 3-step 5 belong to the processing steps of the quantum variational classification method.
The quantum nuclear entropy principal component analysis method is specifically as follows.
In machine learning algorithms, when faced with non-linear problems, we often use kernel functions, which are described in [ li navigation. The university of qinghua publisher, 2012.]The definition of the kernel function is given in: is provided with
Figure BDA0003604201730000061
Is a feature space (Hilbert space), if there is one slave
Figure BDA0003604201730000062
To
Figure BDA0003604201730000063
Phi (x):
Figure BDA0003604201730000064
so that for all x's,
Figure BDA0003604201730000065
if the function K (x, z) satisfies the condition K (x, z) ═ phi (x) · phi (z), then K (x, z) is referred to as a kernel function, phi (x) is a mapping function, and phi (x) · phi (z) is an inner product of phi (x) and phi (z).
For the problem that the training set is not linearly separable, we usually map the training set into a high-dimensional space for linear segmentation, and we need to calculate the classification function in the high-dimensional space as shown in fig. 2:
Figure BDA0003604201730000066
thus, we do not need to know the vector in the high-dimensional space, but only need to know the dot product of two vectors in the high-dimensional space, i.e. the kernel function K (x, z) is phi (x) phi (z), and the classification problem in the high-dimensional space becomes
Figure BDA0003604201730000067
And calculating the kernel function is equivalent to calculating the dot product in the high-dimensional space, so that the high-dimensional space is equivalent to dividing.
When the input space is an euclidean space or a discrete set and the feature space is a hilbert space, the kernel function represents an inner product between feature vectors obtained by mapping the input from the input space to the feature space. The nonlinear support vector machine can be learned by using a kernel function, which is equivalent to learning a linear support vector machine in a higher-dimensional feature space, and this method is called a kernel method. The general flow of the quantum core estimation method is shown in fig. 3.
In this framework, we estimate the kernel matrix of | T | × | T | using a quantum simulator
Figure BDA0003604201730000068
For all sample points in the training set
Figure BDA0003604201730000069
Use of feature mapping to derive a vector of classical data (in this application breast cancer data)
Figure BDA00036042017300000610
To quantum state | Φ (x)>By switching in an initial state |0>The upper-acting unitary transform realizes the coding of data, namely:
Figure BDA00036042017300000611
the specific process is shown in fig. 4.
The concrete expression is shown in fig. 5.
The spatial transformation relationship of the quantum nuclear entropy principal component analysis method based on quantum nuclear estimation is shown in fig. 6:
firstly, chi is mapped to a Feature Space (Feature Space) by a point in an Input Space (Input Space) through a nonlinear mapping function psi, then the point in the Feature Space is mapped to a Kernel Space (Kernel Space) through a Kernel (Kernel) function, and finally the Feature Space is mapped back through a certain mapping relation.
The quantum (linear) kernel estimation method is described as follows:
Figure BDA0003604201730000071
the mathematical format of the kernel function is expressed as follows:
Figure BDA0003604201730000072
wherein
Figure BDA0003604201730000074
And N is the total number of the processed breast cancer data, then:
Figure BDA0003604201730000073
and calculating the characteristic value lambda of the K and the corresponding characteristic vector u.
And solving the entropy of the corresponding characteristic value and the characteristic vector, and selecting the first kappa characteristic values lambda and the corresponding characteristic vectors u according to the magnitude of the entropy.
Figure BDA0003604201730000081
Equal above formula is multiplied by
Figure BDA0003604201730000088
Obtaining:
Figure BDA0003604201730000082
will be provided with
Figure BDA0003604201730000089
Obtaining after unitization:
Figure BDA0003604201730000083
both sides are multiplied by phi (x)j) Obtaining:
Figure BDA0003604201730000084
wherein
Figure BDA0003604201730000085
Figure BDA0003604201730000086
Namely the data after dimensionality reduction.
The quantum nuclear entropy principal component analysis method algorithm is described as follows:
Figure BDA0003604201730000087
Figure BDA0003604201730000091
specifically, the algorithm framework of the quantum variational classification method is shown in fig. 7.
Describing an algorithm:
1. preprocessing breast cancer data XiEncoding to a quantum state
Figure BDA0003604201730000092
Upper, through belt parameters
Figure BDA0003604201730000093
A quantum wire of, wherein
Figure BDA0003604201730000094
Is initially of
Figure BDA0003604201730000095
Setting a classification prediction result corresponding to the correctly classified bit string beta;
2. measuring in z direction to obtain output bit string alpha and its probability
Figure BDA0003604201730000096
After each measurement, comparing the bit strings alpha and beta to obtain the data XiClassified prediction result y classified into a certain resulti
3. Predicting the result y by classificationiWith the true classification result Y given in the training setiComparing and calculating the loss function
Figure BDA0003604201730000097
4. Returning to the first step, and collecting the rest of test data XiSequentially inputting the signals into a measuring line to obtain corresponding signals
Figure BDA0003604201730000098
And calculating a total cost function
Figure BDA0003604201730000099
5. The total cost function is optimized by using a quantum gradient descent algorithm, and parameters in the quantum lines are repeatedly updated
Figure BDA00036042017300000910
Until a cut-off condition is optimized.
Specifically, the quantum encoding is as follows:
two coding schemes are generally used: encoding data onto line parameters and encoding data onto phases of states. Specifically, in this embodiment, the second encoding method is adopted in step 1, and the first encoding method is adopted in step 3.
The first encoding method is shown in fig. 8, and the corresponding codes are:
cost_cir.rz(-2*math.pi*x[i][0],qubitlist[0])
cost_cir.rz(-2*math.pi*x[i][1],qubitlist[1])
cost_cir.rz(-2*math.pi*x[i][2],qubitlist[2])
cost_cir.rz(-2*math.pi*x[i][3],qubitlist[3])
the second encoding scheme is shown in fig. 9, and the corresponding codes are:
def convertDataToAngles(data):
prob1=data[2]**2+data[3]**2
prob0=1-prob1
angle1=2*np.arcsin(np.sqrt(prob1))
prob1=data[3]**2/prob1
angle2=2*np.arcsin(np.sqrt(prob1))
prob1=data[1]**2/prob0
angle3=2*np.arcsin(np.sqrt(prob1))
return np.array([angle1,angle2,angle3])
def encodeData(qc,qreg,angles):
qc.ry(angles[0],qreg[1])
qc.cry(angles[1],qreg[1],qreg[0])
qc.x(qreg[1])
qc.cry(angles[2],qreg[1],qreg[0])
qc.x(qreg[1])
specifically, the quantum variation classifier circuit configuration in the present application is shown in fig. 10.
Wherein, according to the structure of the feature mapping circuit, a classifier part of the variation algorithm is constructed by adding a single quantum bit unit layer and an entanglement gate diagram. Each subsequent layer or depth contains a set of additional entanglements for all the qubits of the algorithm. We use a coherent controllable quantum mechanical system, such as a superconducting chip with n transmission qubits, to fabricate short-depth quantum circuits
Figure BDA0003604201730000101
In the experiment, the control phase gate is added to each depth, and the control phase gate is composed of n-2 quantum bits. The single quantum bit cells used in the classifier are constrained to Y and Z rotations to simplify the number of parameters that classical optimizers need to handle. The control phase we use, rather than CNOT, entanglement of the gates is reasonable, our goal being to increase the popularity in our framework. The use of control phase gates does not require the elaboration of this part of the algorithm for different system topologies. Our compiler can then use a specific entanglement map for a given device to convert each controlled phase gate into a CNOT available in our system. The general circuit consists of the following single-qubit and multi-qubit gates:
Figure BDA0003604201730000111
wherein
Figure BDA0003604201730000112
Specifically, the principle of the quantum gradient descent algorithm is as follows:
we first define the loss function
Figure BDA0003604201730000113
Loss function
Figure BDA0003604201730000114
To thetaiPartial derivative calculation can be simplified to
Figure BDA0003604201730000115
To thetaiPartial derivatives are calculated, namely:
Figure BDA0003604201730000116
using the law of products, will
Figure BDA0003604201730000117
Unfolding to obtain:
Figure BDA0003604201730000118
by Hermitian conjugation, the following forms can be converted:
Figure BDA0003604201730000119
namely:
Figure BDA00036042017300001110
Figure BDA0003604201730000121
is provided with
Figure BDA0003604201730000122
And
Figure BDA0003604201730000123
the gate lines of (2) are as follows:
def GRYGate(theta):
u00=-1/2*math.cos(theta/2)
u01=-1/2*math.sin(theta/2)
u10=1/2*math.sin(theta/2)
u11=-1/2*math.cos(theta/2)
gateLabel="G({})".format(theta)
GRYGate=UnitaryGate(np.array([[u00,u01],[u10,u11]]),label=gateLabel)
return GRYGate
def GRZGate(theta):
u00=-i/2*math.exp(-i*theta/2)
u01=0
u10=0
u11=-i/2*math.exp(i*theta/2)
gateLabel="G({})".format(theta)
GRZGate=UnitaryGate(np.array([[u00,u01],[u10,u11]]),label=gateLabel)
return GRZGate
specifically, quantum line parameter optimization is performed based on a quantum gradient descent algorithm as follows:
we design a quantum wire to obtain the required inner product form as follows:
Figure BDA0003604201730000131
we use the Hadamard method to do this, first, we prepare the input quantum states and prepare the auxiliary states
Figure BDA0003604201730000132
Now in pairs
Figure BDA0003604201730000133
Using YkW(θ)V(xk) In state |1>To obtain:
Figure BDA0003604201730000134
by turning over the operation auxiliary state, to
Figure BDA0003604201730000135
Applications of
Figure BDA0003604201730000136
In state |0>The following are obtained:
Figure BDA0003604201730000137
applying a Hadamard gate operation to the auxiliary gate, yields:
Figure BDA0003604201730000138
now the probability of the auxiliary bit 0 is:
Figure BDA0003604201730000139
finally, the probability that the auxiliary quantum bit is 0 is utilized to calculate thetaiOf the gradient of (a).
Updating
Figure BDA00036042017300001310
(η is the step size).
The resulting quantum wire schematic is shown in fig. 11.
To verify the effect of the present invention, the following experiment was performed:
currently, global data production keeps increasing with an explosive situation of about 24% per year, computing technologies represented by machine learning are rapidly developed, and machine learning has developed a plurality of subdivided fields such as unsupervised learning, supervised learning, semi-supervised learning, reinforcement learning, deep learning, and the like. The machine learning aims at the existing data and combines different learning strategies to explore the implicit incidence relation and structure of the data, and then a learning model is obtained and analyzed and predicted according to the model. The breast cancer data set selected by the invention is specifically a scinit machine learning library breast cancer diagnosis standard data set (https:// scinit-lean. The data set consisted of 569 samples, each with 30 features, describing the mean, standard deviation and maximum of 10 dimensions of radius, texture, circumference, area, smoothness, etc. of a breast tumor, 212 malignant samples and 357 benign samples. The sample feature correlation is shown in fig. 12. The classification result obtained by the method is shown in fig. 13, and the experimental result shows that the method has higher classification prediction accuracy.
In summary, the present invention provides a novel quantum framework, i.e., a classical-quantum hybrid solution framework for solving classification problems, and is applied to breast cancer classification and identification, and improves the framework of the quantum variational classification method provided in document 1, in which the relevant parameters of the cost function to be solved by the conventional method are converted and encoded into the relative phase of the superposition state in hilbert space, and the optimal parameters of some tasks are found by using a quantum optimization algorithm, so as to hopefully alleviate the barren plateau problem. Meanwhile, the optimization and acceleration of Kernel Principal Component Analysis (KPCA) are realized by utilizing a quantum kernel estimation method, so that the purpose of rapidly carrying out principal component analysis is achieved; under the conditions of less characteristic values of the data set and low classification accuracy, the frame can be utilized to effectively improve the classification accuracy.
Specifically, the invention adopts a quantum nuclear entropy principal component analysis method, which is a process of realizing dimension ascending and dimension descending, and through the process, redundant information of data can be removed, a more compact and economic data representation form can be obtained, and a potential structure of the data can be more effectively expressed. Finally, a nonlinear divisible problem is converted into a linear divisible problem through the method, a better processing effect can be obtained on data with more complex structures, and the aim of data preprocessing is really fulfilled.
The gradient descent method is an optimization algorithm, which is usually called a steepest descent method, and is commonly used for recursion approximation of a minimum deviation model in machine learning and artificial intelligence, wherein the gradient descent direction is a negative gradient direction which is used as a search direction, and a minimum value is solved along the gradient descent direction. In the training process, each forward propagation can obtain a loss value of an output value and a true value, the smaller the loss value is, the better the model is represented, and then the gradient descent algorithm is used here to help find the smallest loss value, so that the corresponding learning parameters b and w can be reversely deduced, and the effect of optimizing the model is achieved. However, a lot of computing resources and time are consumed when the traditional optimization process is really adopted, the quantum gradient descent algorithm is adopted, the quantum computing advantages are fully utilized, and the computing resources and the computing time can be effectively reduced.
The invention adopts the method of encoding the preprocessed data to the quantum circuit and realizing classification by utilizing the variational quantum circuit, thereby effectively improving the accuracy and the calculation power on the classification problem of the breast cancer.
The above shows only the preferred embodiments of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

Claims (5)

1. A method for realizing breast cancer classification based on a novel quantum framework is characterized by comprising the following steps:
step 1: carrying out quantum coding according to the breast cancer data characteristics, and coding the sample characteristics onto a quantum wire;
and 2, step: performing quantum nuclear entropy principal component analysis on the breast cancer data by combining a quantum nuclear estimation method to achieve the purpose of breast cancer data preprocessing;
and step 3: carrying out quantum coding successively according to the preprocessed breast cancer data obtained in the step 2, and entering a variational quantum circuit, namely a quantum variational classifier;
and 4, step 4: the parameters of the quantum variation classifier are optimized by using a quantum gradient descent algorithm;
and 5: judging whether the loss function of the quantum variation classifier meets the actual requirement, and if so, ending the quantum variation classification process; and if the actual requirement is not met, carrying out quantum coding on the next preprocessed breast cancer data, and turning to the step 3.
2. The method for classifying breast cancer based on a novel quantum framework as claimed in claim 1, wherein the quantum coding in step 1 is to code the breast cancer data features onto the phase of the state.
3. The method for realizing breast cancer classification based on the novel quantum framework as claimed in claim 1, wherein the step 2 comprises:
step 2.1: solving the characteristic value of the kernel function K and the characteristic vectors lam and vec;
Figure FDA0003604201720000011
in addition
Figure FDA0003604201720000012
Then
Figure FDA0003604201720000013
Wherein phi (x) is a mapping function, and N is the total number of breast cancer data processed;
step 2.2: calculating entropy corresponding to the characteristic value and the characteristic vector;
step 2.3: rearranging the eigenvalues and the eigenvectors according to the magnitude of the entropy;
step 2.4: selecting the first n characteristic values and the characteristic vectors lambda and u with the maximum entropy;
step 2.5: the first n eigenvalues and eigenvectors are matched according to
Figure FDA0003604201720000014
Merging into a proof;
step 2.6: calculating K' according to a quantum kernel estimation method;
Figure FDA0003604201720000021
step 2.7: computing
Figure FDA0003604201720000022
Obtaining dimension reduction data
Figure FDA0003604201720000023
Wherein λ and u are respectively the eigenvalue and eigenvector of the kernel function K arranged according to the magnitude of entropy.
4. The method for realizing breast cancer classification based on the novel quantum framework as claimed in claim 1, wherein the step 3 comprises:
preprocessing breast cancer data XiEncoding to quantum states
Figure FDA00036042017200000212
Passing through belt parameters
Figure FDA0003604201720000024
Of a variable quantum wire, wherein
Figure FDA0003604201720000025
Is initially of
Figure FDA0003604201720000026
5. The method for realizing classification of breast cancer based on novel quantum framework as claimed in claim 4, wherein the step 4 comprises:
step 4.1: setting XiA classification prediction result corresponding to the correctly classified bit string beta;
step 4.2: measuring in z direction to obtain output bit string alpha and its probability
Figure FDA00036042017200000211
After each measurement, comparing the bit strings alpha and beta to obtain data XiClassification prediction result y ofi
Step 4.3: classifying the predicted result yiWith the true classification result Y given in the training setiComparing and calculating the loss function
Figure FDA0003604201720000027
Step 4.4: returning to the step 3, sequentially inputting the residual preprocessed breast cancer data into a quantum line to obtain corresponding breast cancer data
Figure FDA0003604201720000028
And calculating a total cost function
Figure FDA0003604201720000029
Step 4.5: the total cost function is optimized by using a quantum gradient descent algorithm, and parameters in the quantum lines are repeatedly updated
Figure FDA00036042017200000210
Until a cut-off condition is optimized.
CN202210411357.3A 2022-04-19 2022-04-19 System for realizing breast cancer classification based on novel quantum frame Active CN114663690B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210411357.3A CN114663690B (en) 2022-04-19 2022-04-19 System for realizing breast cancer classification based on novel quantum frame

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210411357.3A CN114663690B (en) 2022-04-19 2022-04-19 System for realizing breast cancer classification based on novel quantum frame

Publications (2)

Publication Number Publication Date
CN114663690A true CN114663690A (en) 2022-06-24
CN114663690B CN114663690B (en) 2023-04-28

Family

ID=82035882

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210411357.3A Active CN114663690B (en) 2022-04-19 2022-04-19 System for realizing breast cancer classification based on novel quantum frame

Country Status (1)

Country Link
CN (1) CN114663690B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107464250A (en) * 2017-07-03 2017-12-12 深圳市第二人民医院 Tumor of breast automatic division method based on three-dimensional MRI image
CN112101451A (en) * 2020-09-14 2020-12-18 北京联合大学 Breast cancer histopathology type classification method based on generation of confrontation network screening image blocks

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107464250A (en) * 2017-07-03 2017-12-12 深圳市第二人民医院 Tumor of breast automatic division method based on three-dimensional MRI image
CN112101451A (en) * 2020-09-14 2020-12-18 北京联合大学 Breast cancer histopathology type classification method based on generation of confrontation network screening image blocks

Also Published As

Publication number Publication date
CN114663690B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
Zhang et al. A deep convolutional neural network for topology optimization with strong generalization ability
Catak et al. CloudSVM: training an SVM classifier in cloud computing systems
US20210383238A1 (en) Knowledge distillation by utilizing backward pass knowledge in neural networks
Badrinarayanan et al. Understanding symmetries in deep networks
CN112270345B (en) Clustering algorithm based on self-supervision dictionary learning
Wang et al. Filter pruning with a feature map entropy importance criterion for convolution neural networks compressing
Li et al. Patch similarity aware data-free quantization for vision transformers
Li et al. Online low-rank representation learning for joint multi-subspace recovery and clustering
Badrinarayanan et al. Symmetry-invariant optimization in deep networks
Kong et al. Deep PLS: A lightweight deep learning model for interpretable and efficient data analytics
CN115661538A (en) Image classification method based on multi-granularity Transformer
Nguyen et al. InfoCNF: An efficient conditional continuous normalizing flow with adaptive solvers
Zhao et al. Multiple vision architectures-based hybrid network for hyperspectral image classification
Zhang et al. Many could be better than all: A novel instance-oriented algorithm for multi-modal multi-label problem
CN116342961B (en) Time sequence classification deep learning system based on mixed quantum neural network
Wang et al. Nonconvex generalization of alternating direction method of multipliers for nonlinear equality constrained problems
Li et al. Deep manifold transformation for nonlinear dimensionality reduction
CN114663690A (en) Method for realizing breast cancer classification based on novel quantum framework
Wang et al. Cpac-conv: Cp-decomposition to approximately compress convolutional layers in deep learning
Kaur et al. Survey on Computer Vision Techniques for Internet-of-Things Devices
Ko et al. Deep model compression and inference speedup of sum–product networks on tensor trains
Altares-López et al. AutoQML: Automatic generation and training of robust quantum-inspired classifiers by using evolutionary algorithms on grayscale images
US20220122594A1 (en) Sub-spectral normalization for neural audio data processing
Lagutin et al. Ex2MCMC: Sampling through Exploration Exploitation
Dong et al. A neural network pruning method by the sum of matrix similarity measures

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant