CN115222948A - Image classification method, device, server and system based on quantum kernel method - Google Patents

Image classification method, device, server and system based on quantum kernel method Download PDF

Info

Publication number
CN115222948A
CN115222948A CN202110334853.9A CN202110334853A CN115222948A CN 115222948 A CN115222948 A CN 115222948A CN 202110334853 A CN202110334853 A CN 202110334853A CN 115222948 A CN115222948 A CN 115222948A
Authority
CN
China
Prior art keywords
matrix
kernel
quantum
eigenvalue
image
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.)
Pending
Application number
CN202110334853.9A
Other languages
Chinese (zh)
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.)
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Wodong Tianjun Information Technology Co Ltd
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 Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Wodong Tianjun Information Technology Co Ltd
Priority to CN202110334853.9A priority Critical patent/CN115222948A/en
Priority to PCT/CN2022/070264 priority patent/WO2022206092A1/en
Publication of CN115222948A publication Critical patent/CN115222948A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the disclosure discloses an image classification method, an image classification device, a server and a medium based on a quantum kernel method. One embodiment of the method comprises: acquiring an indefinite kernel matrix obtained by processing an image set based on a quantum kernel method, wherein elements in the indefinite kernel matrix are used for representing the incidence relation between images in the image set; generating a corrected eigenvalue diagonal matrix based on the correction of the negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix, wherein the eigenvalue in the corrected eigenvalue diagonal matrix is a nonnegative value; generating a corrected positive definite matrix according to the eigenvector matrix corresponding to the indefinite kernel matrix and the corrected eigenvalue diagonal matrix; and generating the classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix. The embodiment reduces the adverse effect of noise of the quantum computer on the accuracy of the image classification result.

Description

Image classification method, device, server and system based on quantum kernel method
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to an image classification method, device, server and system based on a quantum kernel method.
Background
Kernel methods are an important class of algorithms in machine learning to deal with nonlinear classification problems. Its purpose is to correctly classify data having the same attribute. The core idea is to transform the original linear indivisible data into linear separable data in a high-dimensional space through some nonlinear mathematical transformation.
Quantum computers, by their very nature (superposition and entanglement), are able to produce non-linear transformations that classical computers cannot simulate. Thus, for a particular dataset, the quantum machine learning algorithm can achieve a better classification effect than the optimal classical machine learning algorithm. And the larger the amount of samples used, the better the classification of the algorithm will be.
However, the existing Quantum kernel method does not consider some limitations of the current real Quantum computer, for example, in the NISQ (noise Intermediate-Scale Quantum device) era, the Quantum computer is Noisy, and we obtain from the Quantum computer not one exact data but data obeying a certain probability distribution. This has a great influence on some properties of the quantum nuclear method, and further influences the data classification effect thereof.
Disclosure of Invention
The embodiment of the disclosure provides an image classification method, device, server and system based on a quantum nuclear method.
In a first aspect, an embodiment of the present disclosure provides an image classification method based on a quantum nuclear method, where the method includes: acquiring an indefinite kernel matrix obtained by processing an image set based on a quantum kernel method, wherein elements in the indefinite kernel matrix are used for representing the incidence relation between images in the image set; generating a corrected eigenvalue diagonal matrix based on correction of a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix, wherein the eigenvalue in the corrected eigenvalue diagonal matrix is a non-negative value; generating a corrected positive definite matrix according to the eigenvector matrix corresponding to the indeterminate kernel matrix and the corrected eigenvalue diagonal matrix; and generating the classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix.
In a second aspect, an embodiment of the present disclosure provides an image classification apparatus based on a quantum nuclear method, the apparatus including: the acquisition unit is configured to acquire an indefinite kernel matrix obtained by processing the image set based on a quantum kernel method, wherein elements in the indefinite kernel matrix are used for representing incidence relations between images in the image set; a correction unit configured to generate a corrected eigenvalue diagonal matrix based on correction of a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix, wherein eigenvalues in the corrected eigenvalue diagonal matrix are non-negative values; a generating unit configured to generate a corrected positive definite matrix according to the eigenvector matrix corresponding to the indefinite kernel matrix and the corrected eigenvalue diagonal matrix; and the classification unit is configured to generate classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix.
In a third aspect, an embodiment of the present application provides an image classification system based on a quantum core method, where the system includes: a quantum computing terminal configured to acquire a set of images; processing the image set by using a preset quantum kernel function to generate an indefinite kernel matrix, wherein elements in the indefinite kernel matrix are used for representing the incidence relation between the images in the image set; sending the adventitious kernel matrix to a classical calculation end; a classical computing side configured to perform a method as described in any of the implementations of the first aspect.
In a fourth aspect, an embodiment of the present application provides a server, where the server includes: one or more processors; a storage device having one or more programs stored thereon; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fifth aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the image classification method, the image classification device, the image classification server and the image classification system based on the quantum kernel method, negative values in the characteristic value diagonal matrix corresponding to the uncertain kernel matrix for image processing are corrected based on the quantum kernel method, so that the corrected positive definite matrix generated according to the corrected characteristic value diagonal matrix meets the kernel matrix requirement of the classical kernel method, the adverse effect of noise of a quantum computer on the accuracy of an image classification result is reduced, and the accuracy of an image classification model is improved by combining the quantum kernel method and the classical classification model.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method of image classification based on a quantum kernel method according to the present disclosure;
FIG. 3 is a schematic diagram of an application scenario of an image classification method based on a quantum kernel method according to an embodiment of the present disclosure;
FIG. 4 is a flow diagram of training an image classification model in an embodiment of a quantum-kernel-based method of image classification according to the present disclosure;
FIG. 5 is a schematic diagram of the structure of one embodiment of an image classification device based on the quantum kernel method according to the present disclosure;
FIG. 6 is a timing diagram of interactions between various devices in one embodiment of an image classification system based on a quantum kernel approach according to the present application.
FIG. 7 is a schematic block diagram of an electronic device suitable for use in implementing embodiments of the present application.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary architecture 100 to which the quantum-core method-based image classification method or the quantum-core method-based image classification apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, networks 104, 106, and servers 105, 107. Networks 104, 106 are the medium used to provide communication links between terminal devices 101, 102, 103 and server 105, and between server 105 and server 107, respectively. The networks 104, 106 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The terminal devices 101, 102, 103 interact with a server 105 via a network 104 to receive or send messages or the like. Various communication client applications, such as a search-type application, an image processing-type application, and the like, may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting human-computer interaction, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a quantum computer for providing various services, such as a background server providing support for image processing type applications on the terminal devices 101, 102, 103. The backend server may analyze the received image, generate a processing result (e.g., an indeterminate kernel matrix), and send the processing result to the server 107.
The server 107 may be a classical computer for providing various services, such as a background server providing support for image processing type applications on the terminal devices 101, 102, 103. The background server may analyze the received indeterminate kernel matrix to generate a processing result (e.g., classification information of each image corresponding to the indeterminate kernel matrix).
The image may be directly stored locally in the server 105, and the server 105 may directly extract and process the locally stored image, and in this case, the terminal apparatuses 101, 102, and 103 and the network 104 may not be present.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules for providing distributed services) or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the image classification method based on the quantum core method provided by the embodiment of the present disclosure is generally executed by the server 107, and accordingly, an image classification apparatus based on the quantum core method is generally disposed in the server 107.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow 200 of one embodiment of a quantum-kernel-method-based image classification method according to the present disclosure is shown. The image classification method based on the quantum nuclear method comprises the following steps:
step 201, an indefinite kernel matrix obtained by processing an image set based on a quantum kernel method is obtained.
In this embodiment, an executive body (such as the server 107 shown in fig. 1) of the image classification method based on the quantum core method may acquire the indefinite core matrix obtained by processing the image set based on the quantum core method through a wired connection manner or a wireless connection manner. The elements in the above-mentioned indefinite-kernel matrix can be used to characterize the association relationship between the images in the image set. As an example, the association relationship may be an inner product between data obtained after the image is mapped by the quantum kernel function.
In this embodiment, the execution subject may obtain an indeterminate kernel matrix that is pre-stored locally and obtained by processing the image set based on a quantum kernel method. The execution body may also acquire an indeterminate nucleus matrix obtained by processing the image set based on a quantum nucleus method from an electronic device (for example, the quantum computer 105 shown in fig. 1) in communication connection with the execution body.
It should be noted that, since the quantum computer itself has noise, it may disturb elements in the generated quantum core matrix. Thus, the actually generated kernel matrix is often an indeterminate matrix, i.e., a matrix in which the eigenvalues contain both positive and negative values.
In some optional implementations of this embodiment, the noise of the quantum computer on which the above-described quantum core method is based is less than a first preset threshold.
It should be noted that the inventors found that noise of a quantum computer for executing the above quantum kernel method has a great influence on image classification accuracy when reaching a certain degree. Based on the optional implementation manner, the noise of the quantum computer can be controlled within a first preset threshold value, so that the image classification performed by using the quantum kernel method has a remarkable effect in the aspect of accuracy improvement compared with the image classification of a classical computer.
Step 202, based on the correction of the negative value in the eigenvalue diagonal matrix corresponding to the adventitious kernel matrix, a corrected eigenvalue diagonal matrix is generated.
In this embodiment, based on the correction of the negative value in the eigenvalue diagonal matrix corresponding to the indefinite kernel matrix obtained in step 201, the execution subject may generate the corrected eigenvalue diagonal matrix in various ways. And the characteristic value in the corrected characteristic value diagonal matrix is a non-negative value.
In this embodiment, the executing entity may perform a feature decomposition (a = Q Σ Q) on the adventitious kernel matrix (e.g., matrix a) obtained in step 201 -1 ) A diagonal matrix (e.g., diagonal matrix Σ) and an eigenvector matrix (e.g., matrix Q) containing at least one eigenvalue are generated. Wherein the eigenvalues (e.g. λ) in the diagonal matrix i =Σ ii ) Both positive and negative values are included. For a negative-valued eigenvalue in the generated diagonal matrix, the execution body may correct the negative-valued eigenvalue to a non-negative eigenvalue in various ways. As an example, the execution body may correct the negative characteristic value to a corresponding non-negative characteristic value according to a preset correction value correspondence table. The corrected value correspondence table may be used to represent a correspondence between a negative value and a corrected non-negative characteristic value.
In some optional implementation manners of this embodiment, the executing body may correct a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate matrix obtained in step 201 to a preset value, and generate a corrected eigenvalue diagonal matrix.
In these implementations, the preset value may be a non-negative value. As an example, the execution subject may replace a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix with a preset value (e.g., 0.01), and keep the other eigenvalues unchanged, thereby generating a corrected eigenvalue diagonal matrix.
In some optional implementation manners of this embodiment, the executing entity may modify a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate matrix obtained in step 201 to an absolute value of the negative value, and generate a modified eigenvalue diagonal matrix.
In these implementations, as an example, the eigenvalue diagonal matrix corresponding to the above-mentioned indefinite kernel matrix may include "-0.3", "-0.8". The execution agent may generate a corrected eigenvalue diagonal matrix by correcting the "-0.3" to "0.3", correcting the "-0.8" to "0.8", and keeping the other eigenvalues unchanged.
In some optional implementations of this embodiment, the executing entity may generate the modified eigenvalue diagonal matrix according to the following steps:
firstly, determining the characteristic value with the minimum value in the angular matrix of the characteristic value corresponding to the indefinite kernel matrix as a target value.
In these implementations, as an example, the eigenvalue angular matrix corresponding to the above-described un-nucleated matrix may be diag (-0.3,0.6,0.1, -0.5). The execution body may determine "-0.5" as the target value.
And secondly, determining the sum of the eigenvalue and the absolute value of the target value as the corrected eigenvalue for the eigenvalue in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix.
In these implementations, as an example, for eigenvalues "-0.3,0.6,0.1, -0.5" in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix, the execution body may determine the sum of each eigenvalue and the absolute value "0.5" of the target value as the corrected eigenvalue corresponding to the original eigenvalue, that is, "0.2,1.1,0.6,0" as the corrected eigenvalue for "-0.3,0.6,0.1, -0.5".
And thirdly, generating a corrected eigenvalue diagonal matrix according to the determined corrected eigenvalue.
In these implementations, the execution body may form the modified eigenvalue diagonal matrix from the modified eigenvalues according to an eigenvalue arrangement manner in the original eigenvalue diagonal matrix. As an example, the execution agent may generate a corrected eigenvalue diagonal matrix diag (0.2,1.1,0.6,0).
And 203, generating a corrected positive definite matrix according to the eigenvector matrix corresponding to the indefinite kernel matrix and the corrected eigenvalue diagonal matrix.
In this embodiment, the execution subject may generate the corrected positive definite matrix in various ways according to the eigenvector matrix corresponding to the indefinite kernel matrix obtained in step 201 and the corrected eigenvalue diagonal matrix generated in step 202. The feature vector matrix corresponding to the above-mentioned adventitious kernel matrix is usually a feature vector matrix obtained by performing feature decomposition on the above-mentioned adventitious kernel matrix obtained in step 201. The executing entity may multiply the modified eigenvalue diagonal matrix generated in step 202 by the corresponding eigenvector matrix in a manner matching the eigen decomposition to obtain a modified matrix. Usually, the corrected matrix obtained as described above is a positive definite matrix.
And step 204, generating classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix.
In this embodiment, the executing entity may generate the classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix. The image classification model is used for representing the corresponding relation between the positive definite matrix and the classification information of the image. The image classification model may include various models obtained by training in a Machine learning manner, such as an SVM (Support Vector Machine). The classification information may include various forms, for example, two different categories are represented by "0" and "1".
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of an image classification method based on a quantum kernel method according to an embodiment of the present disclosure. In the application scenario of fig. 3, background server 306 may retrieve uncertainly checked matrix 305. The background server 306 may correct the negative value in the eigenvalue diagonal matrix obtained by performing the eigen decomposition on the above-mentioned adventitious kernel matrix 305, so as to obtain a corrected eigenvalue diagonal matrix. The backend server 306 may then generate a corrected positive definite matrix 307 from the eigenvector matrix obtained by performing eigen decomposition on the indefinite kernel matrix 305 and the corrected eigenvalue diagonal matrix. Then, the backend server 306 inputs the corrected positive definite matrix 307 to a pre-trained image classification model 308, and generates classification information 309 of each image.
Alternatively, the above-mentioned adventitious kernel matrix 305 may be obtained by the following procedure: the user can send an image to be processed (image x located in image space x as shown by 303 in fig. 3) to the vector computer 304 via the terminal device 301, 302 i 、x j ). Quantum computer 304 may convert the image of image space x to a higher dimension using a quantum kernel function, generating an infinite kernel matrix 305. The quantum computer may then send the generated adventitious kernel matrix 305 to the backend server 306 described above.
At present, one of the prior arts does not generally consider some limitations of the current real quantum computer, which causes the noise of the quantum computer to have adverse effect on the classification accuracy of the quantum-core-based method. In the method provided by the embodiment of the disclosure, the negative value in the eigenvalue diagonal matrix corresponding to the image processing indeterminate kernel matrix obtained based on the quantum kernel method is corrected, so that the corrected positive definite matrix generated according to the corrected eigenvalue diagonal matrix meets the kernel matrix requirement of the classical kernel method, the adverse effect of noise of a quantum computer on the accuracy of the image classification result is reduced, and the accuracy of the image classification model is further improved by combining the quantum kernel method and the classical classification model.
With further reference to FIG. 4, a flow 400 for training an image classification model in an embodiment of a quantum-kernel-based image classification method is illustrated. The process 400 for training to obtain an image classification model includes the following steps:
step 401, training samples are obtained.
In this embodiment, the performing agent for training the image classification model may obtain training samples from a local or communicatively connected electronic device. The training sample may include a sample indefinite kernel matrix obtained by processing a sample image set based on a quantum kernel method, and labeling information corresponding to each sample image in the sample image set. The elements in the sample adventitious kernel matrix may be used to characterize the association relationship between the sample images in the sample image set.
In this embodiment, as an example, the total number of sample images included in the sample image set is n, and the dimension of the sample indefinite kernel matrix may be n × n. The elements in the 1 st row and the 1 st column in the sample adventitious kernel matrix can be used for representing the inner product of the first sample image and the first sample image after being processed by the quantum kernel function.
In some optional implementations of the present embodiment, the sample image set generally belongs to a core subset (core-set) of the original sample image set. The number of sample images included in the sample image set is usually smaller than a second preset threshold.
It should be noted that the inventors found that the number of sample images included in the image set has a great influence on the accuracy of image classification when reaching a certain degree. In general, the more the number of samples, the better the learning effect, i.e., the higher the accuracy of the classification result. When the dimensionality of the indefinite kernel matrix obtained based on the quantum kernel method reaches a certain degree, the accuracy of the classification result is reduced compared with the classical machine learning.
Based on the optional implementation manner, the core subset can be extracted from the original sample image set through an actively-learned query strategy, so that the number of sample images contained in the sample image set is smaller than a second preset threshold, and the accuracy advantage of image classification by using a quantum core method compared with that of a classical computer is ensured.
Step 402, taking the sample indeterminate matrix of the training sample as input, taking the labeling information corresponding to each sample image corresponding to the input sample indeterminate matrix as expected output, and training to obtain an image classification model.
In this embodiment, the executing entity may obtain the image classification model by training through a machine learning method, with the sample indeterminate kernel matrix of the training samples obtained in step 401 as an input, and with the labeling information corresponding to each sample image corresponding to the input sample indeterminate kernel matrix as an expected output. The image classification model may include various classification models based on kernel methods, such as SVM, among others.
It should be noted that the execution subject for training the image classification model may be the same as or different from the execution subject for executing the image classification method based on the quantum kernel method, and is not limited herein.
As can be seen from fig. 4, the process of obtaining an image classification model by training in the image classification method based on the quantum kernel method in this embodiment represents a step of performing model training by using a training sample including a sample indefinite kernel matrix obtained by processing a sample image set based on the quantum kernel method and labeling information corresponding to each sample image in the sample image set. Therefore, the scheme described in the embodiment provides a training method of an image classification model based on a quantum kernel method, so that the accuracy of image classification is improved.
With further reference to fig. 5, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of an image classification apparatus based on the quantum core method, which corresponds to the method embodiment shown in fig. 2 or fig. 4, and which may be applied in various electronic devices in particular.
As shown in fig. 5, the image classification apparatus 500 based on the quantum core method provided by the present embodiment includes an acquisition unit 501, a modification unit 502, a generation unit 503, and a classification unit 504. The acquiring unit 501 is configured to acquire an indefinite kernel matrix obtained by processing an image set based on a quantum kernel method, where elements in the indefinite kernel matrix are used to represent an association relationship between images in the image set; a correction unit 502 configured to generate a corrected eigenvalue diagonal matrix based on a correction of a negative value in the eigenvalue diagonal matrix corresponding to the adventitious kernel matrix, wherein an eigenvalue in the corrected eigenvalue diagonal matrix is a non-negative value; a generating unit 503 configured to generate a corrected positive definite matrix according to the eigenvector matrix corresponding to the indefinite kernel matrix and the corrected eigenvalue diagonal matrix; a classification unit 504 configured to generate classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix.
In the present embodiment, in the image classification apparatus 500 based on the quantum kernel method: the specific processing of the obtaining unit 501, the modifying unit 502, the generating unit 503 and the classifying unit 504 and the technical effects thereof can refer to the related descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of the present embodiment, the modification unit 502 may be further configured to: and correcting a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix into a preset value, and generating a corrected eigenvalue diagonal matrix, wherein the preset value is a non-negative value.
In some optional implementations of the present embodiment, the modification unit 502 may be further configured to: and correcting the negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix into the absolute value of the negative value, and generating the corrected eigenvalue diagonal matrix.
In some optional implementations of the present embodiment, the modification unit 502 may be further configured to: determining the characteristic value with the minimum value in the angular matrix of the characteristic values corresponding to the indeterminate nuclear matrix as a target value; determining the sum of the eigenvalue and the absolute value of the target value as the corrected eigenvalue for the eigenvalue in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix; and generating a corrected eigenvalue diagonal matrix according to the determined corrected eigenvalue.
In some optional implementations of the present embodiment, noise of the quantum computer on which the above-described quantum core method is based may be less than a first preset threshold.
In some optional implementations of this embodiment, the pre-trained image classification model may be obtained by training through the following steps: acquiring a training sample, wherein the training sample comprises a sample non-definite core matrix obtained by processing a sample image set based on a quantum core method and labeling information corresponding to each sample image in the sample image set; and taking the sample indefinite-core matrix of the training sample as input, taking the labeling information corresponding to each sample image corresponding to the input sample indefinite-core matrix as expected output, and training to obtain the image classification model.
In some optional implementations of the present embodiment, the sample image set may belong to a core subset of the original sample image set. The number of sample images included in the sample image set may be smaller than a second preset threshold.
In the apparatus provided by the above embodiment of the present disclosure, the negative value in the eigenvalue diagonal matrix corresponding to the image processing indeterminate kernel matrix obtained based on the quantum kernel method and acquired by the acquiring unit 501 is corrected by the correcting unit 502, so that the corrected positive definite matrix generated by the generating unit 503 according to the corrected eigenvalue diagonal matrix meets the kernel matrix requirement of the classical kernel method, thereby reducing the adverse effect of noise of a quantum computer on the accuracy of the image classification result, and further improving the accuracy of the image classification model by combining the quantum kernel method and the classical classification model.
With further reference to FIG. 6, a timing sequence 600 of interactions between various devices in one embodiment of an image classification method based on a quantum kernel method is illustrated. The image classification system based on the quantum core method can comprise: a quantum computing side (e.g., server 105 shown in fig. 1) and a classical computing side (e.g., server 107 shown in fig. 1). The quantum computing terminal may be configured to acquire an image set; processing the image set by using a preset quantum kernel function to generate an indefinite kernel matrix; and sending the adventitious kernel matrix to a classical calculation end. The elements in the above-mentioned indefinite-kernel matrix can be used to characterize the association relationship between the images in the image set. The classical computing side described above may be configured to implement the image classification method based on the quantum kernel method as described in the foregoing embodiments.
As shown in fig. 6, in step 601, the quantum computing side acquires a set of images.
In this embodiment, the quantum computing terminal may obtain the image set from a local or communicatively connected electronic device (e.g., terminal devices 101, 102, 103 shown in fig. 1) by means of wired or wireless connection. The image set may generally include at least one image to be classified.
In step 602, the quantum computing end processes the image set by using a preset quantum kernel function to generate an indeterminate kernel matrix.
In this embodiment, the quantum computation end may process the image set acquired in step 601 by using a preset quantum kernel function, so as to generate an indeterminate kernel matrix. Wherein, the elements in the indefinite-kernel matrix can be used to characterize the association relationship between the images in the image set. The above association relationship may be consistent with the description in the foregoing embodiments, and is not described herein again.
In step 603, the quantum computation side sends the adventitious kernel matrix to the classical computation side.
In this embodiment, the quantum computation side may send the adventitious kernel matrix generated in step 602 to the classical computation side. The classical computing end is a conventional computer which is widely adopted at present and corresponds to a quantum computer.
In step 604, the classical computation side obtains an indeterminate kernel matrix obtained by processing the image set based on a quantum kernel method.
In step 605, based on the correction of the negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix, the classical calculation end generates a corrected eigenvalue diagonal matrix.
In step 606, the classical calculation end generates a corrected positive definite matrix according to the eigenvector matrix corresponding to the indefinite kernel matrix and the corrected eigenvalue diagonal matrix.
In step 607, according to the corrected positive definite matrix, the classical calculation end generates the classification information of each image in the image set by using the pre-trained image classification model.
The above steps 604 to 607 are respectively consistent with the steps 201 to 204 and their optional implementation manners in the foregoing embodiment, and the above descriptions for the steps 201 to 204 and their optional implementation manners also apply to the steps 604 to 607, which are not described again here.
In the image classification system based on the quantum kernel method provided in the above embodiment of the present application, the quantum-kernel-method-based mapping processing is performed on the image set through the quantum computing end to generate the indefinite kernel matrix, and the quantum-kernel-method-based negative value in the feature value diagonal matrix corresponding to the indefinite kernel matrix obtained through the classical computing end is corrected, so that the corrected positive definite matrix generated according to the corrected feature value diagonal matrix meets the kernel matrix requirement of the classical kernel method, thereby reducing the adverse effect of noise of the quantum computer on the accuracy of the image classification result, and further improving the accuracy of the image classification model through the combination of the quantum kernel method and the classical classification model.
Referring now to FIG. 7, shown is a schematic block diagram of an electronic device (e.g., server 107 of FIG. 1) 700 suitable for use in implementing embodiments of the present application. The server shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, etc.; an output device 707 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate with other devices, wireless or wired, to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 7 may represent one device or may represent multiple devices as desired.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated by the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present application.
It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately and not be assembled into the server. The computer readable medium carries one or more programs which, when executed by the server, cause the server to: acquiring an indefinite kernel matrix obtained by processing an image set based on a quantum kernel method, wherein elements in the indefinite kernel matrix are used for representing the incidence relation between images in the image set; generating a corrected eigenvalue diagonal matrix based on correction of a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix, wherein the eigenvalue in the corrected eigenvalue diagonal matrix is a non-negative value; generating a corrected positive definite matrix according to the eigenvector matrix corresponding to the indeterminate kernel matrix and the corrected eigenvalue diagonal matrix; and generating the classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as "C", python, or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises an acquisition unit, a correction unit, a generation unit and a classification unit. The names of the units do not form a limitation on the units themselves in some cases, for example, the obtaining unit may also be described as a unit that obtains an adventitious kernel matrix obtained by processing an image set based on a quantum kernel method, where elements in the adventitious kernel matrix are used to characterize an association relationship between images in the image set.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (11)

1. An image classification method based on a quantum nuclear method comprises the following steps:
obtaining an indefinite kernel matrix obtained by processing an image set based on a quantum kernel method, wherein elements in the indefinite kernel matrix are used for representing the incidence relation between images in the image set;
generating a corrected eigenvalue diagonal matrix based on correction of a negative value in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix, wherein the eigenvalue in the corrected eigenvalue diagonal matrix is a non-negative value;
generating a corrected positive definite matrix according to the eigenvector matrix corresponding to the indefinite kernel matrix and the corrected eigenvalue diagonal matrix;
and generating the classification information of each image in the image set by utilizing a pre-trained image classification model according to the corrected positive definite matrix.
2. The method of claim 1, wherein generating a modified eigenvalue diagonal matrix based on a modification of negative values in an eigenvalue diagonal matrix corresponding to the adventitious kernel matrix comprises:
and correcting a negative value in the eigenvalue diagonal matrix corresponding to the indefinite kernel matrix into a preset value, and generating a corrected eigenvalue diagonal matrix, wherein the preset value is a non-negative value.
3. The method of claim 1, wherein generating a modified eigenvalue diagonal matrix based on a modification of negative values in an eigenvalue diagonal matrix corresponding to the adventitious kernel matrix comprises:
and correcting a negative value in the eigenvalue diagonal matrix corresponding to the indefinite kernel matrix into an absolute value of the negative value, and generating a corrected eigenvalue diagonal matrix.
4. The method of claim 1, wherein generating a modified eigenvalue diagonal matrix based on a modification of negative values in an eigenvalue diagonal matrix corresponding to the adventitious kernel matrix comprises:
determining the characteristic value with the minimum value in the angular matrix of the characteristic value corresponding to the indefinite kernel matrix as a target value;
determining the sum of the eigenvalue and the absolute value of the target value as a corrected eigenvalue for the eigenvalue in the eigenvalue diagonal matrix corresponding to the indeterminate kernel matrix;
and generating a corrected eigenvalue diagonal matrix according to the determined corrected eigenvalue.
5. The method of claim 1, wherein the noise of a quantum computer upon which the quantum core method relies is less than a first preset threshold.
6. The method according to one of claims 1 to 5, wherein the pre-trained image classification model is trained by:
acquiring a training sample, wherein the training sample comprises a sample indefinite kernel matrix obtained by processing a sample image set based on a quantum kernel method and labeling information corresponding to each sample image in the sample image set;
and taking the sample indeterminate nuclear matrix of the training sample as input, taking the labeling information corresponding to each sample image corresponding to the input sample indeterminate nuclear matrix as expected output, and training to obtain the image classification model.
7. The method of claim 6, wherein the set of sample images belongs to a core subset of an original set of sample images, the number of sample images included in the set of sample images being less than a second preset threshold.
8. An image classification device based on a quantum nuclear method comprises the following steps:
the image processing device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire an indefinite nuclear matrix obtained by processing an image set based on a quantum nuclear method, and elements in the indefinite nuclear matrix are used for representing the incidence relation between images in the image set;
a correction unit configured to generate a corrected eigenvalue diagonal matrix based on correction of a negative value in an eigenvalue diagonal matrix corresponding to the uncertainly matrix, wherein an eigenvalue in the corrected eigenvalue diagonal matrix is a non-negative value;
a generating unit configured to generate a corrected positive definite matrix according to the eigenvector matrix corresponding to the indefinite kernel matrix and the corrected eigenvalue diagonal matrix;
and the classification unit is configured to generate classification information of each image in the image set by using a pre-trained image classification model according to the corrected positive definite matrix.
9. An image classification system based on a quantum nuclear method, comprising:
a quantum computing terminal configured to acquire a set of images; processing the image set by using a preset quantum kernel function to generate an indefinite kernel matrix, wherein elements in the indefinite kernel matrix are used for representing the incidence relation between the images in the image set; sending the indeterminate kernel matrix to a classical calculation end;
the classical computing end configured to perform implementing the method of any of claims 1-7.
10. A server, comprising:
one or more processors;
a storage device having one or more programs stored thereon;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110334853.9A 2021-03-29 2021-03-29 Image classification method, device, server and system based on quantum kernel method Pending CN115222948A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110334853.9A CN115222948A (en) 2021-03-29 2021-03-29 Image classification method, device, server and system based on quantum kernel method
PCT/CN2022/070264 WO2022206092A1 (en) 2021-03-29 2022-01-05 Quantum kernel method-based image classification method and apparatus, server, and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110334853.9A CN115222948A (en) 2021-03-29 2021-03-29 Image classification method, device, server and system based on quantum kernel method

Publications (1)

Publication Number Publication Date
CN115222948A true CN115222948A (en) 2022-10-21

Family

ID=83457888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110334853.9A Pending CN115222948A (en) 2021-03-29 2021-03-29 Image classification method, device, server and system based on quantum kernel method

Country Status (2)

Country Link
CN (1) CN115222948A (en)
WO (1) WO2022206092A1 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109978064A (en) * 2019-03-29 2019-07-05 苏州大学 Lie group dictionary learning classification method based on image set
CN110781766B (en) * 2019-09-30 2023-05-19 广州大学 Grassman manifold discriminant analysis image recognition method based on characteristic spectrum regularization

Also Published As

Publication number Publication date
WO2022206092A1 (en) 2022-10-06

Similar Documents

Publication Publication Date Title
CN108509915B (en) Method and device for generating face recognition model
CN107633218B (en) Method and apparatus for generating image
CN108197652B (en) Method and apparatus for generating information
CN108416310B (en) Method and apparatus for generating information
CN109564575A (en) Classified using machine learning model to image
CN109389072B (en) Data processing method and device
CN111783142B (en) Data protection method, device, server and medium
CN108121699B (en) Method and apparatus for outputting information
CN111311480A (en) Image fusion method and device
US20220027722A1 (en) Deep Relational Factorization Machine Techniques for Content Usage Prediction via Multiple Interaction Types
CN112966701A (en) Method and device for classifying objects
CN117894038A (en) Method and device for generating object gesture in image
CN109582854B (en) Method and apparatus for generating information
WO2020006962A1 (en) Method and device for processing picture
CN116911954B (en) Method and device for recommending items based on interests and popularity
CN110046670B (en) Feature vector dimension reduction method and device
CN116127925B (en) Text data enhancement method and device based on destruction processing of text
CN116843991A (en) Model training method, information generating method, device, equipment and medium
CN112348615A (en) Method and device for auditing information
CN110991661A (en) Method and apparatus for generating a model
CN115222948A (en) Image classification method, device, server and system based on quantum kernel method
CN111767710B (en) Indonesia emotion classification method, device, equipment and medium
CN114021565A (en) Training method and device for named entity recognition model
US20210326745A1 (en) Training robust machine learning models
CN114170479A (en) Training method and device of disturbance generation model

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