Image multi-classification method based on quantum support vector machine with directed acyclic graph
By using the quantum support vector machine method based on directed acyclic graphs in the image classification task and utilizing the superposition and entanglement properties of quantum computing, the time complexity problem of big data processing in image classification is solved and logarithmic complexity is achieved. Reduce and efficiently classify effects.
Patent Information
- Application Number
- CN202011522445.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-21
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-12-21
AI Technical Summary
In image classification tasks, when existing technology is difficult to effectively process a large number of sample data, the time complexity of the support vector machine method is high, especially because the number of samples and feature dimensions are linearly related, making the calculation unbearable.
The quantum support vector machine (DAG QSVM) method based on directed acyclic graph is used to reduce the time complexity through the superposition and entanglement properties of quantum computing, extract image features and build a DAG QSVM classifier to achieve multi-classification of images.
In the big data classification task, the DAG QSVM method significantly reduces the method complexity to the logarithmic level, improves the computational efficiency, and achieves the purpose of image classification with an accuracy rate close to that of the one-to-one QSVM multi-classification method.
Smart Images

Figure CN112580725B
Abstract
Description
[0001] The present invention relates to the fields of quantum computing and quantum machine learning, and in particular to an image multi-classification method of a quantum support vector machine based on a directed acyclic graph. Technical Background
[0002] The present invention relates to the high-tech discipline of quantum computing. The method we proposed and used: the quantum support vector machine method based on directed acyclic graph requires the foundation of quantum support vector machine method and support vector machine multi-classification method. The following introduces the foundation of quantum computing, quantum support vector machine method, and support vector machine multi-classification method respectively.
[0003] 1. Quantum computing basics
[0004] Quantum computing is a high-tech research direction that has emerged in recent years. It is based on the properties of quantum superposition and quantum entanglement, which makes the method highly parallel and greatly reduces the time complexity of the method.
[0005] Quantum superposition means that a qubit can be in a superposition state of 0 and 1, that is, it can be either 1 or 0. For quantum computing, we use |0> and |1> to represent it. α|0>+β|1> means that a qubit is in a superposition state of |0> and |1>. When the qubit is observed, it will collapse to the classical state of 0 or 1 with a probability of α 2 The probability of collapse to 0, β 2 The probability of collapse is 1, and the relationship between α and β is α 2 +β 2 =1.
[0006] Quantum entanglement means that when a qubit is in a certain state, the entangled qubit will also be in a certain state. For example, there are two qubits in the following quantum state: α|00>+β|11>, which means that when either of the two qubits is in the |1> state, the other will also be in the |1> state; when either is in the 0> state, the other will also be in the |0> state.
[0007] For example, we have three qubits with an initial state of 0 |000>, which we name Right now We make the first two qubits pass through the H gate in the quantum logic gate to obtain the quantum state At this time, the first two qubits are in a quantum superposition state. The probability of |00>, |01>, |10> and |11> appearing is any one of the cases, and there is no entanglement relationship with the third qubit. At this time, we use the first qubit as the control bit, the third qubit as the target bit, and use the controlled NOT gate in the quantum logic gate (when the control bit is |1>, the target bit takes the NOT operation). We can get the quantum state At this time, the first qubit and the third qubit are in a quantum entangled state. When collapsed, the first and third qubits will be in the same state.
[0008] 2. Quantum Support Vector Machine
[0009] In 2014, Patrick Rebentrost, Masoud Mohseni and Sel Lloyd proposed the quantum support vector machine method (QSVM). This method is based on the HHL method. After the HHL method was proposed as an important quantum method, it became possible to solve the equality constraint problem in the quantum environment. In the classical environment, the characteristic of the least squares support vector machine (LS-SVM) is to convert the inequality constraints in the support vector machine (SVM) into equality constraints and then solve them. Therefore, QSVM is the quantum version of LS-SVM. Next, the training and classification process of QSVM will be briefly introduced.
[0010] First, we use K to represent the kernel matrix of QSVM. The linear kernel can be expressed as K ij = <x i |x j >. The QSVM method solves the following problems:
[0011]
[0012] The kernel matrix Sample size M , sample label Lagrange coefficient Slack variables j = 1, 2, ..., M. F is an M+1 dimensional matrix, and Ι is the identity matrix. in is the hyperplane quantum state that needs to be solved.
[0013] like Figure 1 (This quantum circuit diagram is the circuit diagram of the QSVM method, not the original content of this patent), the input of the QSVM method is where u j yes The eigenstate of F is simulated by Completed, the quantum preparation of sample characteristics is in this part. After the three operations of phase estimation, controlled rotation, and inverse phase estimation, the hyperplane quantum state can be obtained:
[0014]
[0015] in In the hyperplane quantum state After that, we can use the following formula to judge the query sample Categories:
[0016]
[0017] The final classification result needs to be completed through the swap test method, for which two two-word states need to be constructed:
[0018]
[0019] in is the query sample. Through the swap test method, the probability P is measured. if Then |x> is classified as +1 class, otherwise it is classified as -1 class.
[0020] 3. Multi-classification of Support Vector Machine
[0021] There are many implementations of SVM multi-classification methods in the classic environment, such as one-to-one, one-to-many, directed acyclic graph, decision tree, etc. Here we only briefly introduce the SVM multi-classification method based on directed acyclic graph (DAG SVM).
[0022] The DAG SVM method is an extension of the one-to-one multi-classification method of SVM. Assume that the total number of categories is W. First of all, we need to know that DAG SVM refers to training all SVMs that are combined in pairs according to all categories, and using these SVM classifiers to build DAG. For each classification, the category that is closer to the query sample will be selected as the result, and the category that is farther away will no longer be used as a possible answer to the query sample. That is, each classification removes an incorrect answer from the entire answer set, and finally obtains the classification result through W-1 classification operations. That is, training classifiers, and W-1 classifiers are started during classification.
[0023] Unlike one-to-one multi-classification, which requires training all pairs of SVMs, and then voting after querying samples through all SVMs to get the classification result, DAG SVM only needs to start a small number of classifiers, and there is no final voting process. Therefore, DAG SVM has the same training cost as one-to-one multi-classification method, but the classification cost is much lower. At the same time, relevant experiments have shown that there is no significant difference in the classification accuracy between the two.
[0024] In recent years, quantum computing has been developing rapidly. Due to the characteristics of quantum superposition, quantum entanglement, quantum non-cloning, etc., quantum methods have the characteristics of being faster and safer. Quantum computers and quantum chips have been under the research and development efforts of various countries. For quantum computers, quantum methods are needed as related method support, which makes quantum methods extremely important. Summary of the invention
[0025] Image classification is a common problem in daily engineering, and many methods can be used to solve this problem. However, when the amount of sample data is too large, general computing methods will be difficult to handle because the support vector machine has a linear relationship with the number of samples and the feature dimension. Therefore, we propose the present invention: using the DAG QSVM method we proposed to classify images, the complexity of the method is reduced to the previous logarithmic level.
[0026] 1. Feature extraction and preparation of quantum states
[0027] The first step of the present invention is feature extraction. The present invention does not clearly limit the features extracted from the image, and the features that can be extracted include but are not limited to HGB color features, HSV color features, HOG features, gray level co-occurrence matrix, and FAST features. As for which feature to extract, it is determined by the characteristics of the image itself.
[0028] In the simulation experiment, the data set we used is Caltech101, and the extracted features are HSV color features and HOG features with a total of N dimensions.
[0029] We extract the above two features from samples in a classic environment and can convert the feature vector of the i-th sample into Expressed as The feature is then prepared as a quantum state |X>, which can be expanded to be expressed as Where |> is the Dirac symbol, representing the quantum state, M refers to the number of samples, i and j are the serial numbers of M and N respectively. The above quantum states are essential components for quantum simulation of matrix F in the QSVM method. Next, prepare the input required by QSVM The above completes the preparation for the QSVM method.
[0030] 2. Build DAG QSVM based on actual problems
[0031] For the W classification problem, construct classifiers, all classifiers are arranged according to the DAG construction method to form a DAG QSVM;
[0032] 3. Constructing the quantum circuit of DAG QSVM
[0033] The following will be divided into two points for introduction. The first point is black box construction, that is, the encapsulation of QSVM. QSVM is used directly here as an existing technology. The purpose of encapsulating QSVM is to highlight the associative interfaces that need to be used in various structures in subsequent construction, while ignoring the internal interfaces of QSVM itself. The second point is out-of-box construction, which is divided into three parts: classification operation, legal verification, and transfer results. The classification operation is the encapsulation part of QSVM, which is used to obtain the result of binary classification; legal verification is based on the characteristics of quantum methods, and is added in order to obtain meaningful classification results in the end; the transfer result reflects the path relationship in DAG.
[0034] 3.1. Black box construction - packaging of QSVM
[0035] Because our ultimate task is to classify W types of images, we need to build QSVM classifiers. Each QSVM classifier implements binary classification of images. QSVM is an existing technology that can perform binary classification on the feature values extracted from the image.
[0036] The relationship between black boxes is arranged according to the hierarchy of the completed DAG. For example, there will be a black box in the first layer, which will determine which of the black boxes (i.e. classifiers) in the second layer will be activated, and a black box in the second layer will determine which black box in the third layer will be activated. The so-called "determining which black box is activated" refers to determining which black box is activated according to the already constructed DAG.
[0037] For the QSVM method, there are many input and output interfaces. We are concerned with two of them, which are the qubits indicating whether the method outputs results and the qubits indicating the output results of the method, such as Figure 2 . Treat QSVM as a black box. The unmarked u qubits above are qubits we don't care about. Of the two qubits below, the upper qubit indicates whether the method outputs a result, that is, QSVM outputs a result only when the quantum state collapses to |1>. The qubit below represents the hyperplane quantum state, and the output is Next, the output results of QSVM are input into the Swap test method, which classifies the query samples and obtains the classification results in quantum superposition: Then, the probability P is proposed to the newly introduced auxiliary qubit by the AE method, and |P>=|P0P1P2...P v-1 >, where v is the number of auxiliary qubits introduced by the AE method. Since the result of the QSVM method depends on the probability P and , then as the highest bit of the ground state, we can express the relationship between P and That is, we take |P0> as the output |ans> representing the classification result. So far, we have encapsulated the above steps into a black box operation, which is named U Zn Module, where n represents the serial number of the black box.
[0038] 3.2. Black Box Build — Build outside the box
[0039] Next, in order to complete the DAG QSVM method, each black box needs to be constructed outside the box. This part of the construction is not available in the classic environment, which is one of the innovations of the patent. The reason for the following construction is that under the DAG construction idea, each activated classifier must decide which classifier to activate next. In order to complete this operation, I need to perform the following out-of-box construction.
[0040] like Figure 3 , at this point we introduce four quantum bits: qubit n-A , qubit n-B , qubit n-α , qubit n-β . where qubit n-A yes Figure 2 The qubit in the QSVM indicates whether it outputs the classification result, which is marked as ②; n-B It is the qubit that stores the classification results. Two new qubits are introduced, qubit n-α Indicates the corresponding U Zn Whether it needs to be started, initially |0>; qubit n-β Used to store verification qubit results, initially |0>.
[0041] Figure 3 There are three operations, namely classification operation, legal verification and result delivery. The first operation is classification operation: qubit n-α The quantum bit is used as the control bit, the black box U Zn As a target. n-α When the quantum bit is |1>, the corresponding U Zn Start, otherwise do not start. The second operation is legal verification. n-A With qubit n-α As a control bit, qubit n-β As the target position. n-A With qubit n-α When the state is |11>, it means that the U Zn The module is activated and in qubit n-B The classification result is output on the bit, which is a legal state; when the qubit n-AWith qubit n-α When the state is |00>, it means that the U Zn The module is not started, qubit n-A This is also a legal state. For the above two legal situations, qubit n-β Perform a negation operation. n-A With qubit n-α When the status is |01>, it means that the module U Zn is activated, but the qubit n-B No classification result is output on the qubit, which is an illegal state; n-A With qubit n-α The state |10> will not appear because in U Zn When the module is not started, the qubit n-A will not change, so this state is also an illegal state. In an illegal state, the qubit n-β The third operation is to transfer the result. This operation is for non-bottom-level U Zn The module does exist, the underlying U Zn Modules do not have this operation. We assume that after building the DAG, module U with number n Zn The classification result will determine the modules U numbered p and q. Zp with U Zq If it is started, then the operation will n-B With qubit n-α As a control bit, qubit p-α With qubit q-α As target positions respectively. n-B With qubit n-α When the state of is |01>, the qubit p-α Negate; when qubit n-B With qubit n-α When the state of is |11>, qubit q-α When qubit n-α When it is |0>, it means that U Zn If it is not started, it will naturally have no control effect on other modules.
[0042] The purpose of introducing the legal verification operation is to be able to intuitively see whether the current collapse result is what we need when the entire method is completed and observed. Because of the characteristics of quantum superposition, the output of quantum methods is probabilistic. Usually we need to introduce some auxiliary quantum bits. Their role is to use their own values to mark whether the method has successfully collapsed to the state we expect when the collapse finally occurs. Therefore, at the end of the method, we need to introduce the quantum bit qubit legal , its initial state is |0>, assuming that the U we use Zn The serial number is Then use As a control bit, qubit legal As a target bit, only when all control bits are |1>, the qubit legal For observation, only the qubit is observed. legal The method only makes sense when it collapses to |1>.
[0043] For the observation of the results, because qubit legal With the restriction of legal operation, when the qubit legal When it collapses to |1>, the states of all other qubits entangled with this state will satisfy the DAG construction. At this time, the classification result is composed of all the underlying qubits n-B With qubit p-α Joint decision. That is, all the underlying qubits n-B With qubit p-α As a control bit, introduce qubit res . This allows us to observe the qubit res , the classification result is read directly from the ground state. However, in actual operation, not all qubits are used. n-B With qubit p-α As a control bit, we only need to list the state table and use some of the qubits in it as control bits. legal When it collapses to |0>, no meaningful classification results can be obtained and the entire method needs to be re-executed until the qubit legal Collapses to |1>.
[0044] After completing the above construction of the DAG QSVM method, we can classify the image. After running the method, observe the qubit legal Quantum bit, if qubit legal Collapses to |1>, then read the qubit res The classification result of the query sample image can be obtained; if qubitlegal collapses to |0>, then the method needs to be repeated until the qubit is observed legal Collapses to |1>.
[0045] Beneficial Effects
[0046] DAG SVM in the classic environment needs to be trained in advance classifiers, and W-1 classifiers are used each time for actual classification. The training and classification of DAG QSVM are combined, so the method itself only trains W-1 classifiers at a time, and the training speed of each classifier is exponentially accelerated compared to the classic environment, thus greatly improving the computing efficiency. However, there are certain limitations, that is, the exponential acceleration effect of QSVM on SVM is only meaningful when facing big data classification, and the same applies to DAG SVM and DAG QSVM.
[0047] In terms of the effect of the method, DAG QSVM runs faster and has a similar accuracy rate compared to the existing one-to-one QSVM multi-classification method, and can achieve the purpose of image classification. Due to the characteristics of quantum methods, collapse will occur after observation, and quantum computing is non-clonable, making the calculated hyperplane quantum state one-time, so the QSVM modules called by DAG QSVM during actual operation are far less than the one-to-one QSVM multi-classification method, so it runs faster. The classification effects of the two are very close, and the accuracy of DAG QSVM is slightly lower than that of the one-to-one QSVM multi-classification method, but it can achieve the purpose of image classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 .Quantum circuit diagram of quantum support vector machine method (not original content of this invention)
[0049] Figure 2 .Black Box U Zn Module quantum circuit diagram
[0050] Figure 3 .Black Box U Zn Out-of-the-box construction roadmap
[0051] Figure 4 . Directed acyclic graph based on QSVM for four-classification problem (not original content of this invention)
[0052] Figure 5 . Quantum circuit implementation of DAG QSVM for four-classification problem
[0053] Figure 6 .Method flow chart
[0054] in, Figure 2:The second row of the dotted box above, "the quantum bit indicating whether to output the result", corresponds to the second quantum bit below, marked with ①; the bottom quantum bit of the dotted box above corresponds to the third quantum bit below, marked with ②.
[0055] Figure 5 : The quantum circuit diagram contains a large number of quantum logic symbols. ⊕ is a quantum NOT gate, i.e., a NOT operation; ○ is 0 control, i.e., when this bit is |0>, the operation is performed; ● is 1 control, i.e., when this bit is |1>, the operation is performed; Indicates measurement (observation). DETAILED DESCRIPTION
[0056] like Figure 4 , suppose we now need to solve a 4-category problem, the category names are A, B, C, D.
[0057] Step 1: Sample preprocessing
[0058] Feature extraction is performed on the training samples and query samples of the Caltech101 dataset. We extracted color features and HOG features. The color features are 26-dimensional and the HOG features are 150-dimensional. The present invention does not require specific features of the image.
[0059] Step 2: Arrange all classifiers according to the DAG construction method to form a DAG QSVM. The DAG construction method is a well-known technology.
[0060] To solve this problem, we built DAG. (Note: Figure 4 It shows the DAG constructed when solving the 4-classification problem. This is not the original content of this patent. It can be seen that the number of categories W = 4 at this time. Each module is written as QSVM (class1-class2, n), the first parameter indicates which two categories the QSVM performs classification, and n is the serial number of the QSVM, which is U in the above text. Zn The serial number of the module. Figure 4 What is revealed is the path relationship in each QSVM, that is, which classifier will be activated or get the classification result according to the classification result of each QSVM binary classifier. The construction method of DAG is not unique, and its order is related to the gap between samples. Usually, the larger the gap between samples, the earlier they are classified. The calculation method of the gap between samples is not limited here.
[0061] We can see that among the 6 QSVMs, there are 3 non-bottom layers, numbered 0, 1, and 2; and 3 bottom layers, numbered 3, 4, and 5. Z0 , U Z1 , U Z2There are complete classification operations, legal verification and classification results, and the U with serial numbers 3, 4, and 5 Z3 , U Z4 , U Z5 There are only two operations: classification and legal verification, because there is no need to pass the classification results to the next layer.
[0062] Step 3: Build DAG QSVM
[0063] First, the quantum state preparation of the training sample features is completed, that is, the quantum state preparation of each QSVM input is completed. Then the quantum state preparation of the query sample is completed, which will be used in the swap test part of each QSVM module. The penalty coefficient inside the QSVM is 1. The kernel function is a linear kernel.
[0064] Next, Figure 5 ,We have realized the construction of the quantum circuit diagram of the complete QSVM DAG. The specific construction method and process are as follows. Figure 5 Each module U Zn Corresponding to 4 qubits n-A ,qubit n-B ,qubit a-α ,qubit n-β and Figure 2 Correspondingly, each U Zn The subsequent quantum circuit and Figure 3 Correspondingly. To get qubit res With qubit legal The quantum circuit part will be related to the specific problem, and the design method of this part will be introduced below.
[0065] The first QSVM module U Z0 must be activated, so the corresponding qubit 0-α Directly through the quantum NOT gate, take the pure quantum state of |1>. The target position of his classification result operation is qubit 1-α and qubit 2-α ,from Figure 5 We can also see that the classification result of QSVM (AD, 0) determines whether QSVM (AC, 1) and QSVM (BD, 2) are started. Z1 with U Z2 As the second layer, U Z3 , U Z4 , U Z5 For the bottom layer. Z1 with U Z2 The classification results will affect the qubit 3-α , qubit 4-α and qubit5-α Produce a control effect. Thus determine U Z3 , U Z4 , U Z5 Whether the module will start.
[0066] Legally verified qubit legal By qubit 0-β ,qubit 1-β ,qubit 2-β ,qubit 3-β ,qubit 4-β ,qubit 5-β As a control bit. That is, when qubit 0-β ,qubit 1-β ,qubit 2-β ,qubit 3-β ,qubit 4-β ,qubit 5-β When all are at |1>, the qubit legal Taking the negation becomes |1>.
[0067] Because we are doing a 4-classification problem, a total of qubits to record the classification results, so qubit res Qubit res1 With qubit res2 Next we need to build a quantum circuit so that the qubit res Can output classification results. For this purpose, we constructed the following state table:
[0068] Table 1. Classification result status table
[0069]
[0070] According to the above table, we can construct this part of the quantum circuit. All the states in the above table are when the qubit legal The legal states that may appear when collapsing to |1>, and the illegal states are no longer considered. The "-" in the table is the corresponding U Zn Not started, so |0>.
[0071] The number of "1"s in the classification result indicates the number of control NOT gates we need to build, because for qubit res For , no operation is |0>. In the first line, we see that the classification result is 10, which is class C. At this time, we need qubit 5-α With qubit 5-B As a control bit, qubit res1 As a target bit to construct a quantum controlled NOT gate, when qubit5-α With qubit 5-B When the state of is |10>, the qubit res1 In the second row, we see that the classification result is 11, which is class D. At this point we need qubit 5-α With qubit 5-B As a control bit, qubit res1 With qubit res2 As target positions, qubit 5-α With qubit 5-B When the state is |11>, the qubit res1 With qubit res2 Take the negation respectively. Here we need to operate qubit res1 With qubit res2 The two qubits are because the classification result 11 represents the qubit representing the result. res1 With qubit res2 All should collapse to the |1> state. According to the above rules, we can complete the construction of all quantum circuits.
[0072] Step 4: Execute the constructed DAG QSVM quantum circuit diagram
[0073] During the operation of the method, when a QSVM module is started, it will read the corresponding input quantum state and complete its own classification work. When it is not started, the corresponding quantum state will not be read.
[0074] This is equivalent to executing the method according to DAG QSVM. During the execution of the method, the quantum state of the training data is prepared, the hyperplane quantum state is generated (training result), the query samples are classified (testing), and finally the preparation of the legal quantum bit and the preparation of the final result quantum bit are completed.
[0075] Step 5: Read the legal qubits
[0076] After the method is run, the qubit legal Observe, if it collapses to |1>, proceed to Step 6, otherwise return and execute Step 3.
[0077] The legal qubit and the qubit representing the result are read at the same time. This means that the result of the legal qubit is directly observed after reading the legal qubit. When the legal qubit is |0>, there is no need to care about the result of the result qubit reading, and directly return to step (3) (because collapse has occurred, the quantum circuit must be cleared and restarted); when the legal qubit is |1>, the result qubit is meaningful, and step (6) is executed.
[0078] Step 6: Read the classification results
[0079] Observing the qubit res1 , qubit res2 , and obtain the classification results.
[0080] According to the above steps, we drew a method flow chart, as shown in Figure 6 .
Claims
1. An image multi-classification method based on a quantum support vector machine with directed acyclic graph, characterized by The following steps are involved: Step (1) extracting image features; The features are prepared as quantum states, and the selection of image features is determined by the characteristics of the image itself; Step (2) construct DAG QSVM according to the actual problem; for the W classification problem, construct classifiers, all classifiers are arranged according to the DAG construction method to form a DAG QSVM; Step (3) constructing the quantum circuit of DAG QSVM; Step (4) executes the constructed DAG QSVM quantum circuit diagram; Step (5) reading the legal qubits; When the legal qubit is |0>, directly return to step (3); when the legal qubit is |1>, the result qubit is meaningful, and execute step (6); Step (6) reading the result qubit; Specifically, step (3) includes two parts: black-box construction and out-of-box construction; The black box construction, i.e. the encapsulation of QSVM, is as follows: To classify W images, we need to build QSVM classifiers, each QSVM classifier is used to realize the binary classification of images. The QSVM classifier consists of a QSVM algorithm module, a Swap test algorithm module, and an AE algorithm module; There are two interfaces in the output interface of the QSVM algorithm module, namely the qubit indicating whether the algorithm outputs a result and the qubit indicating the output result of the algorithm; The output result of the QSVM algorithm module is input into the Swap test algorithm module, which classifies the query samples and obtains the quantum superposition state of the classification result: Then the AE algorithm module puts the probability P on the newly introduced auxiliary qubit and obtains |P>=|P0P1P22P v-1 >, where v is the number of auxiliary qubits introduced by the AE algorithm, and |P0> is the output |ans> representing the classification result; The out-of-box construction is used to solve the problem of DAG construction. How does each activated classifier in the QSVM classifier decide which classifier to activate next? Among them, the nth QSVM classifier U Zn The outside-the-box construction introduces four quantum bits: qubit n-A , qubit n-B , qubit n-α , qubit n-β Implement three types of operations, where qubit n-A It is the qubit indicating whether the nth QSVM classifier outputs the classification result; qubit n-B It is the qubit where the nth QSVM classifier stores the classification result; qubit n-α Indicates the corresponding U Zn Whether it needs to be activated; qubit n-β Used to store and verify qubit results; The three types of operations are classification operations, legal verification and delivery results. in, The classification operation is as follows: qubit n-α The quantum bit is used as a control bit, U Zn As a target site; When qubit n-α When the qubit is |1>, the nth QSVM classifier U Zn Start, otherwise do not start; The legal verification is as follows: The qubit n-A With qubit n-α As a control bit, qubit n-β As a target position; When qubit n-A With qubit n-α When the state is |11>, it means that the U Zn is activated and in qubit n-B The classification result is output on the bit, which is a legal state; When qubit n-A With qubit n-α When the state is |00>, it means that the U Zn No startup, qubit n-A It has not been changed, which is also a legal state; For the above two legal situations, qubit n-β Perform the NOT operation through the NOT gate in the quantum logic gate; When qubit n-A With qubit n-α When the state is |01>, it means U Zn is activated, but the qubit n-B No classification results are output, which is an illegal state; The qubit n-A With qubit n-α The state |10> will not appear because in U Zn When not activated, the qubit n-A It will not change, so this state is also an illegal state; qubit in illegal state n-β will not be taken away; The transfer results are as follows: This operation is for non-bottom-level U Zn It does exist, the underlying U Zn There is no such operation; After constructing the DAG, the nth QSVM classifier U Zn The classification result will determine the p-th QSVM classifier U Zp With the qth QSVM classifier U Zq If it is started, the operation of transferring the result will be n-B With qubit n-α As a control bit, qubit p-α With qubit q-α As target sites, When qubit n-B With qubit n-α When the state of is |01>, the qubit p-α Take the non; When qubit n-B With qubit n-α When the state of is |11>, qubit q-α Take the non; When qubit n-α When it is |0>, it means that U Zn If it is not activated, it will not have a controlling effect on other classifiers.
2. The image multi-classification method based on a quantum support vector machine of a directed acyclic graph according to claim 1, characterized in that: The image features described in step (1) include but are not limited to HGB color features, HSV color features, HOG features, gray-level co-occurrence matrix, and FAST features.
