Method for classifying a data item, quantum convolutional neural network, and quantum electronic device therefor
The proposed quantum convolutional neural network architecture efficiently processes multiple features by progressive encoding across layers, addressing resource and complexity issues in conventional networks, enhancing accuracy and reducing processing time.
Patent Information
- Application Number
- PCT/EP2025/059181
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-05
- Filing Date
- 2025-04-03
- Publication Date
- 2025-10-09
AI Technical Summary
Conventional quantum convolutional neural networks require significant resources and complexity to process data with multiple features, necessitating large network sizes and numerous parameters, which increases processing time and complexity.
A method and architecture for a quantum convolutional neural network that progressively encodes input features across multiple encoding layers without increasing the network's size, allowing more features to be processed efficiently by limiting the number of qubits and layers.
This approach enhances the neural network's accuracy and reduces processing time by enabling it to handle more features without expanding its physical size, thus improving classification performance.
Smart Images

Figure EP2025059181_09102025_PF_FP_ABST
Abstract
Description
Description Title of the invention: Method for classifying data, quantum convolutional neural network, and associated quantum electronic device Technical Field
[0001] The present invention belongs to the general field of quantum computing. It relates more particularly to a method for classifying data. It also relates to a quantum electronic device configured to implement such a method, and a quantum convolutional neural network. Prior art
[0002] Quantum machine learning (QML) is a growing field of study that combines machine learning techniques with the principles of quantum computing to solve complex problems more efficiently than conventional computing. Quantum machine learning refers to the analysis of data encoded in bits (hereinafter referred to as "classical data") or quantum data by quantum computers.
[0003] The motivation behind quantum machine learning is to integrate the concepts of quantum computing and classical machine learning to pave the way for new learning programs. Quantum neural networks apply this principle by combining neural networks and parameterized quantum circuits. Quantum neural networks offer the advantage of exponentially increasing the computing power and degrees of freedom of a computer, compared to conventional techniques, and have computational capabilities that reduce the number of steps and computation times.These models are configured to take classical data encoded in a quantum state as input, and to perform processing using quantum gates dependent on parameters whose values are determined during a training phase.
[0004] Quantum Convolutional Neural Networks (QCNN) are quantum neural networks that have the ability to determine particular characteristics and patterns of an input data such as an image. More precisely, the input data is used (in an encoding layer) to encode a feature map into a quantum circuit, and then alternative convolution and pooling layers are applied, until a single qubit is obtained. A qubit is generally defined as a two-level quantum system, which represents the smallest unit of quantum information storage. This single qubit is then measured, in order to determine the class to associate with the input data.
[0005] The fact remains that when we want to process data with many characteristics, at a rate of one characteristic per input of the neural network, it is necessary to use a quantum convolutional neural network of significant size (e.g., comprising a large number of sets of convolution and pooling layers), and which consequently also includes a significant number of parameters to be optimized. This complexity requires the use of significant resources in terms of data processing, whether during the training or inference phase of the quantum neural network.
[0006] Generally, to process data having 2 ^^ features a conventional quantum convolutional neural network must include ^^ convolution layers and ^^ pooling layers. Disclosure of the invention
[0007] The present invention aims to remedy all or part of the drawbacks of the prior art, in particular those set out above, by proposing a solution which makes it possible to increase the number of characteristics at the input of a quantum convolutional neural network, without increasing the size of said network.
[0008] To this end, and according to a first aspect, the invention relates to a method for classifying data implemented by a quantum electronic device and comprising: – obtaining a set of characteristics describing the data to be classified; and, – classifying the data by a quantum convolutional neural network comprising a plurality of successive processing layers, said classification comprising progressive encoding of at least part of the characteristics of the set by several encoding layers of said network.
[0009] Encoding the input features of the neural network in multiple encoding layers allows more features to be used in the neural network without increasing the number of qubits used by the network (and therefore the number of layers of the network) and therefore limiting the associated complexity and processing time.
[0010] Depending on the embodiments, different training criteria may be considered during the training phase of the neural network, such as the least squares method and / or cross-entropy minimization.
[0011] Furthermore, no limitation is attached to the type or modality of the data processed by the neural network. Thus, in a particular example implementation, the input samples of the neural network include images (or features extracted from raw images), sound data (or features extracted from raw sound data) synchronized with images, or physiological signals (or features extracted from physiological signals) that may also be synchronized with other input data.
[0012] Generally speaking, it is considered that the steps of a process should not be interpreted as being linked to a notion of temporal succession.
[0013] In particular embodiments, the classification method may further comprise one or more of the following characteristics, taken individually or in any technically possible combination.
[0014] In particular embodiments, the progressive encoding comprises: – encoding a first subset of the feature set via a first encoding layer of the quantum convolutional neural network; and, – an encoding of at least a second subset of the set of characteristics via at least a second layer of said network located downstream of the first layer in said network.
[0015] In particular embodiments, said at least one second subset includes a characteristic present in said first subset.
[0016] In particular embodiments, the method further comprises: – a weighting of at least part of the characteristics of the set; and, – an association of at least one weighted characteristic with the first and / or the second subset, as a function of said weighting.
[0017] In particular embodiments, said data corresponds to a file, the method further comprises converting the file into an image; obtaining a set of characteristics comprising a determination of characteristics of said image; and the classification aims to determine whether said file is a benign or malicious file.
[0018] In this case, a classification of the file is for example implemented in one of the following classes: "benign", "malicious" depending on a search result of specific pattern(s) in the data provided as input.
[0019] When a file is considered to have benign behavior (which can still be called "normal behavior" in the literature), it refers to the fact that the file is not considered likely to be used to carry out a computer attack. We therefore understand that the notion of "benign behavior" is defined in contrast to that of "malicious behavior".
[0020] In particular implementations, the input file is in "portable executable" format.
[0021] In particular implementation modes, the image resulting from the file conversion is in grayscale and of predetermined dimension.
[0022] In particular embodiments, the characteristics of the image are determined by applying a principal component analysis to said image.
[0023] Principal component analysis is a method in the data analysis family that consists of transforming variables that are linked together – and called "correlated" in statistics – into new variables that are decorrelated from each other. These new variables are called "principal components" or "principal axes". Such an analysis allows information to be summarized by reducing the number of variables.
[0024] According to a second aspect, the invention relates to a quantum convolutional neural network comprising a first set of layers and at least one second set of layers linked to the first set, each of the first and second sets including an encoding layer, wherein the encoding layers of the first and second sets progressively encode at least a portion of input features of said network.
[0025] Thus, when a conventional quantum convolutional neural network takes n features as input, the quantum convolutional neural network according to the invention can take up to 2 (^^ − 1) features as input for the same number of qubits (and a similar number of layers).
[0026] Also, this quantum convolutional neural network architecture is advantageous since it allows to provide more features as input to the neural network, thus helping to improve the accuracy of the neural network, without significantly increasing its size.
[0027] In particular implementations, the encoding layer of the second set takes a number of inputs less than the number of inputs of the encoding layer of the first set.
[0028] In particular embodiments, each of the first and second sets further includes a quantum convolutional layer linked to the encoding layer and a quantum pooling layer linked to the quantum convolutional layer.
[0029] In particular modes of implementation, the network makes it possible to classify data (for example a file according to whether it has benign or malicious behavior) in order to improve the security of a computer system.
[0030] According to a third aspect, the invention relates to a quantum electronic device configured to implement the classification method previously mentioned.
[0031] According to a fourth aspect, the invention relates to a computer program comprising instructions for implementing a classification method, when said program is executed by a processor.
[0032] This program may use any programming language, and may be in the form of source code, object code, or code intermediate between source code and object code, such as in a partially compiled form, or in any other desirable form.
[0033] According to a fifth aspect, the invention relates to a computer-readable recording medium on which the computer program according to the invention is recorded.
[0034] The information or recording medium may be any entity or device capable of storing the program. For example, the medium may include a storage medium, such as a ROM, for example a CD ROM or a microelectronic circuit ROM, or a magnetic recording medium, for example a hard disk.
[0035] On the other hand, the information or recording medium may be a transmissible medium such as an electrical or optical signal, which may be conveyed via an electrical or optical cable, by radio or by other means. The program according to the invention may in particular be downloaded from a network such as the Internet.
[0036] Alternatively, the information or recording medium may be an integrated circuit in which the program is incorporated, the circuit being adapted to carry out or to be used in carrying out the method in question. Brief description of the drawings
[0037] Other characteristics and advantages of the present invention will emerge from the description given below, with reference to the appended drawings which illustrate an exemplary embodiment thereof without any limiting character. In the figures: - Figure 1 is a representation of a conventional quantum convolutional neural network; - Figure 2A is a representation of a quantum convolutional neural network as proposed, according to a first exemplary implementation of the invention; - Figure 2B is a representation of a quantum convolutional neural network as proposed, according to a second exemplary implementation of the invention; - Figure 3A schematically represents a quantum architecture of a quantum pooling layer taking two qubits as input, according to an exemplary implementation; - Figure 3B schematically represents a quantum architecture of a quantum convolution layer taking two qubits as input, according to an exemplary implementation; - Figure 3C schematically represents a quantum architecture of a quantum convolution layer taking four qubits as input, according to an exemplary implementation;- Figure 4 represents modules embedded in a quantum electronic device according to an exemplary implementation of the invention; - Figure 5 schematically represents an example of hardware architecture of a quantum electronic device; and, - Figure 6 represents, in the form of a flowchart, a particular mode of implementation of a classification method, for example executed by the quantum electronic device of Figure 4. Description of the embodiments;
[0038] Figure 1 is a representation of a conventional quantum convolutional neural network.
[0039] In the field of machine learning, neural networks are architectures that consist of layers of nodes (or neurons), and more precisely of an input layer, one or more intermediate layers and an output layer.
[0040] Convolutional neural networks are a type of artificial neural network particularly suited to image processing, and in particular to pattern recognition within an image. A convolutional neural network consists of convolution layers, pooling layers, and a so-called "fully connected" layer corresponding to the output layer of the network. Each convolution layer is based on a kernel and determines the characteristics and patterns of a particular input data. Each pooling layer focuses on reducing the dimension of the data it takes as input (for example, dividing it by 2), so as to limit the number of learning parameters to be optimized, and a fortiori the cost in terms of processing.
[0041] Quantum convolutional neural networks have an architecture close to that of conventional convolutional neural networks. Figure 1 illustrates an example of a quantum convolutional neural network 100 taking as input four features referenced ^^0, ^^1, ^^2 and ^^3. These features ^^0, ^^1, ^^2 and ^^3 are for example derived from processing an image and are provided in an input layer of the quantum convolutional neural network 100 corresponding to an encoding layer ^^ ^^ . This encoding layer ^^ ^^ is configured to encode the features ^^0, ^^1, ^^2, and ^^3 into a quantum circuit using a feature map. Different feature maps exist that can be used, such as the "PauliFeatureMap", "ZFeatureMap", or "ZZFeatureMap" maps offered by the Qiskit (registered trademark) development environment.
[0042] The result of the encoding provides four qubits referenced ^^0, ^^1, ^^ and ^^3. It is important at this point to recall that the qubit, by analogy with the classical bit, is the basic unit of quantum computing. While a classical bit is in a "0" or "1" state, the state of a qubit corresponds to a unit vector in a two-dimensional Hilbert space. In the remainder of this description, the Dirac notation "ket" |^ and "bra" ^| is used to represent the state of a qubit.
[0043] In the illustrated example, the quantum convolutional neural network 100 further comprises a first convolution layer ^^^^1, a first pooling layer ^^^^1 connected to the first convolution layer ^^^^1, a second convolution layer ^^^^2connected to the first pooling layer ^^^^1, and a second pooling layer ^^^^2connected to the second convolution layer ^^^^2. Each of the previously mentioned layers contains parameter-dependent quantum gates. As discussed in more detail below, this quantum convolutional neural network is trained before it can be used operationally (inference), so as to determine optimal values of these parameters that minimize a cost function.
[0044] Generally speaking, a quantum gate is formally defined as a linear transformation that can act on a qubit or a register of qubits. Thus, a quantum gate allows, in particular, the state of a qubit or a register of qubits to be modified by changing its amplitudes.
[0045] As illustrated in Figure 1, the first convolution layer ^^^^1consists of two quantum gates ^^^^^^10 and ^^^^^^ 11 of arity 2, which recognize and / or determine the relationships between its input qubits. The outputs of the convolution layer ^^^^1 are then provided as input to the first pooling layer ^^^^1. This first pooling layer ^^^^1 consists of two quantum gates ^^^^^^ 10 and ^^^^^^ 11 of arity 2, and allows to reduce the dimensionality of the network, here from 4 to 2 qubits.
[0046] As illustrated in Figure 1, the outputs of the first pooling layer ^^^^1are provided as input to the second convolution layer ^^^^2which consists of a single quantum gate ^^^^^^2 of arity 2. Then the outputs of this second convolution layer ^^^^2are provided as input to the second pooling layer ^^^^2which also consists of only a single quantum gate ^^^^^^2 of arity 2. This second pooling layer ^^^^2generates as output a single qubit ^^ ^^^^^^. which is then "measured". This measurement is represented, in this figure 1, by a pointer dial.
[0047] Generally speaking, a measurement converts quantum information into information that can be processed by a conventional computer, e.g., into bits. In the remainder of this document, the probabilistic expectation of a measurement, that is, the weighted average of the measurement results, is denoted ^·^.
[0048] The output qubit ^^ ^^^^^^ . is for example measured using the matrix ^^ ^^ of Pauli. In a Hilbert space of dimension 2, the matrix ^^ ^^ de Pauli is expressed as ^ ^^^ = 0 −1 ). The matrix ^^ ^^ Pauli then defines the basis in which the measurement is made. More precisely, the output qubit ^^ ^^^^^^ is measured by evaluating the probabilistic expectation of the product between the output qubit and the matrix ^^ ^^Pauli's theory. This involves determining the average number of times the qubit ^^ ^^^^^^ . is in the eigenstate of the matrix ^^ ^^ , based on the coefficients of the qubit state vector ^^ ^^^^^^ .
[0049] This measurement makes it possible to obtain a value (eg, "0", "1") representative of a result of using this quantum convolutional neural network 100. Thus, if this quantum convolutional neural network 100 is used to determine the presence or absence of a cat in an image (provided as input to said network), this value makes it possible to determine whether this image includes a cat or not (eg "0" indicates the presence of a cat, "1" the absence of a cat).
[0050] Through this example of a conventional quantum convolutional neural network 100, it can therefore be observed that a conventional quantum convolutional neural network, such as the quantum convolutional neural network 100, comprising two convolution layers and two pooling layers can process data comprising four characteristics, at a rate of one characteristic per network input. And a fortiori, a conventional quantum convolutional neural network comprising three convolution layers and three pooling layers can process data comprising eight characteristics.
[0051] Figure 2A is a representation of a quantum convolutional neural network as proposed, according to a first example. This quantum convolutional neural network 200A comprises a first set of layers ^^1 including a layer a quantum convolutional layer ^^^^1 linked to the encoding layer and a quantum pooling layer ^^^^1 linked to the quantum convolutional layer ^^^^1.
[0052] It also includes a second set of layers ^^2 connected to the first set ^^1 and including an encoding layer , a quantum convolutional layer ^^^^2 linked to the layer and a quantum pooling layer ^^^^2 linked to the quantum convolutional layer ^^^^2.
[0053] The characteristics ^^0, and ^^5mentioned below are for example derived from processing of image-type data, such as a principal component analysis ("Principal Component Analysis", PCA, according to the Anglo-Saxon terminology). These characteristics correspond for example to gray level measurements. They are provided as input to the quantum convolutional neural network 200A.
[0054] In this example, the layer takes as input a first subset of four characteristics referenced ^^0, ^^1, ^^2 and ^^3. This layer is configured to encode the features ^^0, ^^1, ^^2, and ^^3 into a quantum circuit using a feature map, and generate four qubits referenced ^^0, ^^1, ^^2, and ^^3.
[0055] These four qubits ^^0, ^^1, ^^2 and ^^3 are provided as input to the quantum convolutional layer ^^^^1 which modifies the state of these four qubits. In the rest of the description, we note ^^ ′ 0 , ^^ ′ 1 , ^^2 ′ , and ^^3 ′ the result of applying the quantum convolutional layer ^^^^1 on the qubits ^^0, ^^1, ^^ and ^^3. These four qubits ^^ ′ 0 , ^^ ′ 1 , ^^2 ′ , and ^^3 ′ are then provided as input to the pooling layer ^^^^1, which modifies the state of two of the four qubits ^^ ′0 , ^^ ′ 1 , ^^2 ′ , and ^^3 ′ provided as input to this pooling layer ^^^^1. In the rest of the description, we note ^^0 ′′ and ^^1 ′′ the result of applying the pooling layer ^^^^ ′ 1 on qubits ^^ 0 , ^^ ′ 1 , ^^2 ′ , and ^^3 ′ .
[0056] As illustrated in Figure 2A, the qubits ^^0 ′′ and ^^1 ′′ , are encoded in the layer using a second subset of two features ^^4 and ^^5 of the image. In this example, the feature subsets used in the two encoding layers perform a partition of the features of the input data (i.e., they are disjoint subsets whose union corresponds to the set of features of the input data). In other embodiments (for example, when some features are more important than others as explained below), the feature subsets of the encoding layers may include common features.
[0057] The results ^^0 ′′′ and ^^1 ′′′ of the encoding, by the encoding layer ^^ ^^2 , are provided as input to the quantum convolutional layer ^^^^2. In the rest of the description, we note ^^0 ′′′′ and ^^1 ′′′′the result of applying the quantum convolutional layer ^^^^2 on the qubits ^^0 ′′′ and ^^1 ′′′ .
[0058] These qubits ^^0 ′′′′ and ^^1 ′′′′ are provided as input to the quantum pooling layer ^^^^2, which then generates a single qubit as output ^^ ^^^^^^ which is then "measured".
[0059] Encoding layers ^^ ^^1 And
[0060] Dans des modes particuliers de mise en œuvre, les données d'entrée ^^ ∈ ℝ^^ sont ^^ ^^ [0, 2] , and the encoding layers implement a feature map that is expressed as follows: (cos (^^^^)|0^ + sin (^^^^)|1^) has vec ^^^ ^^=1 the tensor product repeated ^^ times, with ^^ here the number of characteristics used by the encoding layer considered (therefore ^^ = 4 for the layer ^^^^1 and ^^ =2 for the layer in the examples above).
[0061] It is important at this point to remember that Dirac notation is equivalent to vector notation. Thus, cos (^^^^)|0^ + sin (^^^^)|1^ = cos(^^) ( ^^ sin(^^ ^^ ) ) .
[0062] In other words, the probability that the qubit representing the characteristic ^^ ^^ either in a state |0^ is encoded by cos ( ^^ ^^ ) and the probability that the qubit representing the characteristic ^^ ^^ either in a state |1^ is encoded by sin ( ^^ ^^ )
[0063] The features ^^4 and ^^5 of the second subset can be encoded in the same way that the features ^^0, ^^1, ^^2 and ^^3 are encoded on the qubits ^^0, ^^1, ^^2 and ^^3 at the start of the algorithm. Encoding a feature ^^ ^^on a qubit can be achieved by applying a unitary transformation on this qubit. Mathematically, the vector representing the qubit is multiplied by a matrix parameterized by the characteristic ^^ ^^ . So the way to encode the data can be the same in the encoding layer ^^ ^^1 and the encoding layer ^^ ^^2 .
[0064] Quantum pooling layers
[0065] As mentioned above, quantum pooling layers focus on reducing the dimension of the data they take as input (eg, the number of qubits), so as to reduce the number of learning parameters to be optimized, and a fortiori the cost in terms of processing. To do this, the quantum pooling layers entangle the input qubits – this is called quantum entanglement – and calculate a measurement or partial trace ("trace out" in English terminology) of a state.
[0066] Figure 3A schematically represents an example of quantum architecture of a quantum pooling layer taking as input two qubits ^^1 and ^^2, according to an example implementation of the invention.
[0067] A quantum architecture can be represented by a two-dimensional "grid," which is composed of "horizontal wires" through which qubits circulate, and "vertical portions" containing quantum gates that act on the qubits in the horizontal wires.
[0068] As illustrated in Figure 3A, the quantum pooling layer PL takes as input two qubits ^^1 and ^^2, and includes two quantum gates ^^ ^^ and ^^ ^^ corresponding to one-parameter rotation quantum gates. The ^^ gate ^^ depends on parameters ^^1 and the gate ^^ ^^of parameters ^^2, with ^^1a first t-tuple of parameters, and ^^2a second t-tuple of parameters. These gates are called "parameterized", and the values of these parameters are determined during a training phase of the quantum convolutional neural network to which they belong.
[0069] The symbol ● links the wire through which the qubit ^^1 circulates to the gate ^^ ^^ ( ^^1 ) means that this door ^^ ^^ ( ^^1 ) is activated only if qubit ^^1 is in a |1^ state. The symbol ○ links the wire through which qubit ^^1 circulates to gate ^^ ^^ ( ^^2 ) means that this door ^^ ^^ (^^2) is activated only if the qubit ^^1 is in a |0^ state. A partial trace of the qubit state at the output of this quantum architecture is then calculated, so as to reduce the dimensionality of the circuit.
[0070] Quantum convolution layers
[0071] Convolution layers entangle the qubits they take as input, and use parameterized quantum gates to do this. As mentioned previously, the values of these parameters (e.g., ^^1 and ^^2, with ^^1 a first t-tuple of parameters, and ^^2 a second t-tuple of parameters) are determined during a training phase of the quantum convolutional neural network to which they belong.
[0072] Figure 3B schematically represents an example of quantum architecture of a quantum convolution layer ^^^^ taking as input two qubits ^^1 and ^^2, according to an example of implementation of the invention.
[0073] As illustrated in Figure 3B, the quantum convolution layer ^^^^ comprises three quantum gates ^^ ^^ , ^^ ^^ , and NOT. A first qubit ^^1 is provided as input to a first parameterized quantum gate ^^^^ (^^1) which generates a qubit ^^1 ′ , and a second qubit ^^2 is provided as input to a second parameterized quantum gate ^^ ^^ ( ^^2 ) which generates a qubit ^^2 ′ . Then a NOT gate (also called CNOT or cX) taking as input the two qubits ^^1 ′ and ^^2 ′ is applied. More precisely, the NOT operation is applied on the qubit ^^2 ′ when the qubit ^^1 ′ is in state |1^, and otherwise leaves it unchanged.
[0074] Figure 3C schematically represents an example of quantum architecture of a quantum convolution layer taking four qubits as input, according to an example implementation of the invention.
[0075] As illustrated in Figure 3B, the quantum convolution layer ^^^^ ′ takes as input four qubits ^^1, ^^2, ^^3 and ^^4, and includes three quantum gates ^^^^^^ 30 , ^^^^^^ 31 and ^^^^^^32 which can for example correspond to doors ^^ ^^ , ^^ ^^ , and NOT discussed with reference to Figure 3B.
[0076] Measure
[0077] As mentioned previously, the qubit ^^ ^^^^^^ at the output of the quantum convolutional neural network is measured.
[0078] In particular modes of implementation, this qubit ^^ ^^^^^^ is measured in the basis Z, in order to obtain the expectation ^Ψ|^^^^|Ψ^ , with ^^^^ the Pauli matrix in basis Z (also sometimes referenced ^^3 in the literature), and |Ψ^ a quantum state of this qubit ^^ ^^^^^^ .
[0079] More formally, either ^^ ^^ the representative matrix of the quantum convolutional neural network, and ^^ = ^^ the observable, then^^^(^^)|^^ ^ † ^^^^^ ^^ |^^(^^) ^ with | ^^(^^) ^ an arbitrary quantum state on a qubit, ^^ ^ †^ the transposed and conjugate matrix of ^^ ^^ , and ^^ an input data.
[0080] This expectation value is equivalent to the probability of the qubit ^^ ^^^^^^ to be in a state |0^ or in a state |1^. It is then used to calculate a cost function which, during a training phase of this quantum convolutional neural network, is for example minimized. In particular modes of implementation, this cost function ^^(^^) corresponds to a cross-entropy cost function, and is expressed as follows: log (ℙ(Ψ^^(^^) = 0))] with ^^ ^^ the class associated with the "i-th" entry ^^ ^^ , ^^ the number of inputs to the convolutional neural network, ℙ(Ψ^^(^^) = 1) a probability that the state |Ψ^^(^^)^ = ^^^^|^^(^^^^)^ is measured as equal to 1 and ℙ(Ψ^^(^^) = 0) a probability that the state |Ψ^^(^^)^ = be measured as equal to 0.
[0081] A gradient descent-based optimization method can be applied to determine the optimal values of the parameters ^^ by adjusting them in the opposite direction of the gradient of the cost function. In quantum machine learning, different optimization methods can be used. For example, in some embodiments, the parameter shifting method described in the article "Evaluating analytic gradients on quantum hardware", Schuld & Al., published in March 2019 in Physical Review A, 99(3) can be used; or the "Simultaneous Perturbation for Stochastic Backpropagation" (SPSB) method described in more detail in the article "Gradient estimation with constant scaling for hybrid quantum machine learning", Hoffmann & Al., published in November 2022.
[0082] It is important to note that depending on the embodiments, different training criteria can be used during the training phase of the neural network, such as for example the least squares method or the minimization of cross entropy.
[0083] Furthermore, the invention has so far been described without making any assumptions about the values of the characteristics ^^0, ^^1, ^^2, ^^3, ^^4, and ^^5 (which may, for example, all be distinct from one another). But the invention nonetheless remains applicable in the case where at least one same characteristic is provided to several inputs of the neural network. This variant proves to be particularly advantageous in the case where this characteristic proves to be more important than other characteristics of the input data in the classification task for which the quantum convolutional neural network is used.
[0084] Also, in the event that it is determined that at least one feature is found to be more important than other features of the input data, this more important feature may be provided, in some embodiments, to multiple inputs of the neural network, so as to be further considered in the classification task. As discussed in more detail below with reference to FIG. 6, this relative importance of the input features is for example determined during a specific step of weighting the features of the input data.
[0085] The invention has also been described so far in the case where the quantum convolutional neural network considers six features as input to the network. But the invention remains nonetheless applicable in the case where the quantum convolutional neural network considers a different number of features as input to the network (e.g., greater or less than six).
[0086] Figure 2B is a representation of a quantum convolutional neural network as proposed, according to a second example. This quantum convolutional neural network 200B comprises a first set of layers ^^1, a second set of layers ^^2, and a third set of layers ^^3. Each of these sets includes an encoding layer ^^ ^^3, a quantum convolutional layer ^^^^1, ^^^^2, ^^^^3 linked to the encoding layer that precedes it, and a quantum pooling layer ^^^^1, ^^^^1 and ^^^^1 linked to the quantum convolutional layer that precedes it. As illustrated in this figure 2B, the neural network 200B has 14 inputs, each of which can be associated with a feature ^^0, … ^^ 13 of the input data.
[0087] Of course, as mentioned previously, the same characteristic can be provided to several inputs of the neural network 200B.
[0088] It is also important to note that the previously discussed quantum convolution and pooling layer architectures are only non-limiting examples, and other configurations could be considered by someone specialized in the field of quantum machine learning.
[0089] Figure 4 represents modules embedded in a quantum electronic device according to an exemplary implementation of the invention.
[0090] This quantum electronic device referenced 20 can correspond to a quantum computer or an imperfect intermediate-scale quantum computer ("Noisy Intermediate-Scale Quantum", NISQ, according to the Anglo-Saxon terminology). The latter is less efficient than a quantum computer since it is subject to quantum noise which limits its capacities, and is not capable of correcting quantum errors continuously. In addition, its quantum processor is only capable of processing a limited number of qubits (a few tens to hundreds).
[0091] As illustrated by Figure 4, the quantum electronic device 20 notably comprises a MOD_OBT module for obtaining a set of characteristics describing data to be classified; and a MOD_CLASS module for classifying the data by the quantum convolutional neural network according to the invention.
[0092] Figure 5 schematically represents an example of the hardware architecture of a quantum electronic device.
[0093] As illustrated in Figure 5, the quantum electronic device 20 has the hardware architecture of a computer. Thus, the quantum electronic device 20 comprises, in particular, a quantum processor 1, a random access memory 2, a read-only memory 3 and a non-volatile memory 4. In particular embodiments, the quantum electronic device 20 also has communication means 5.
[0094] The read-only memory 3 of the quantum electronic device 20 constitutes a recording medium in accordance with the invention, readable by the quantum processor 1 and on which is recorded a computer program PROG in accordance with the invention, comprising instructions for the execution of steps of the classification method. The program PROG defines functional modules of the quantum electronic device 20, which rely on or control the hardware elements 1 to 5 of the quantum electronic device 20 mentioned above. These functional modules are illustrated in Figure 4 in a non-limiting manner, and are described in more detail below with reference to different implementation modes.
[0095] In particular embodiments, the communication means 5 allow in particular the quantum electronic device 20 to exchange data with any other electronic device. For this purpose, the communication means 5 comprise a communication interface, wired or wireless, capable of implementing any communication protocol.
[0096] Figure 6 represents, in the form of a flowchart, a particular mode of implementation of a classification process, for example executed by the quantum electronic device of Figure 4.
[0097] In this particular mode of implementation, the classification consists of a classification of a file according to whether it is benign or malicious. As illustrated by FIG. 6, the method comprises a first step S10 during which the file to be classified is obtained, for example using the communication means 5.
[0098] This file is, for example, of the "portable executable" (PE) type. This type of file allows you to efficiently encapsulate all the information needed by the Windows boot manager (registered trademark) to load executable code.
[0099] The classification method further comprises a step S20 during which the obtained file is converted into an image. This file is for example converted into a grayscale image using the conversion method described in the article "Malware images: Visualization and automatic classification", Nataraj & Al., published in 2011 in "Proceedings of the 8th International Symposium on Visualization for Cyber Security". During this step S20, the obtained image is also resized into a fixed (for example predetermined) dimension (for example into an image of 64 × 64 pixels), depending on the QCNN used.
[0100] Then, during a step S30, characteristics of the image obtained during step S20 are determined. This step is for example implemented by the module MOD_OBT of the quantum electronic device 20. In particular embodiments, these characteristics are obtained by applying a principal component analysis. Other techniques may also be envisaged, which aim for example to detect contours, lines, objects or patterns, a sudden and local change in intensity, a change in texture, etc.
[0101] In particular implementation modes, these characteristics can be weighted, so as to select for example only the most relevant characteristics in the context of the classification of the file, or to use in several encoding layers of the QCNN the most relevant characteristics (the same characteristic can be used in several encoding layers for example).
[0102] As illustrated by FIG. 6, the method further comprises a step S40 during which the characteristics determined during step S30 are provided as input to a quantum convolutional neural network, such as the network 200A or 200B of FIGS. 2A or 2B. This step is for example implemented by the module MOD_IN of the quantum electronic device 20.
[0103] In particular embodiments, where the characteristics determined in step S30 are weighted, those having the greatest weights can for example be provided to several inputs of the neural network 200A, 200B.
[0104] Finally, the method comprises a step S50 during which a classification of said file is carried out, which characterizes the fact that this file is considered benign or malicious. This step is for example implemented by the MOD_CLASS module of the quantum electronic device 20.
[0105] In the embodiment described above, the classification consists of a classification for the purpose of improving the security of a computer system. Of course, the classification carried out within the framework of the invention is not limited to improving the security of a computer system. Other applications may be envisaged, such as the classification of medical images, for example to detect diseases or identify genetic mutations; the classification of elements (objects, individuals) in images or image streams, for example within of video surveillance systems; or the classification of texts or documents (for example the classification of legal, medical, etc. documents).
[0106] Results
[0107] The inventive quantum convolutional neural network architecture ("INV") and a conventional quantum convolutional neural network architecture ("CONV") were compared, in the context of a classification of images comprising "0" and "1" and derived from the MNIST (acronym for "Modified / Mixed National Institute of Standards and Technology) dataset.
[0108] Cinq cycles de traitement ^^1, .. , ^^5 – également nommés "epoques" ("epochs" in English terminology) – were considered for training the neural network, on 10,000 samples. Then the precision measures ("prec") and the "F-score" ("F1") were calculated considering 4,000 samples.
[0109] Table 1 below summarizes these results.
[0110] [Table 1] Table 1: results of the classification of images of "0" and "1" by a neural network according to the invention (INV) and by a conventional neural network (CONV) Number Results e1 e2 e3 e4 e5 of sets (prec / F1) 0.9837 INV 0.9695 0.98 0.9819 0.9774 0.9808 / 0.9848 2 0.9742 CONV 0.9549 0.9795 0.9786 0.9787 0.9783 / 0.9762 0.983 INV 0.9292 0.9701 0.9645 0.97 0.9652 / 0.9841 3 0.97275 CONV 0.8908 0.968 0.9661 0.9757 0.9685 / 0.9746 0.9795 INV 0.7102 0.9558 0.96 0.9607 0.9577 / 0.9809 4 0.97725 CONV 0.7821 0.96 0.9709 0.9737 0.9706 / 0.9789
[0111] The results in this Table 1 show that the QCNN architecture according to the invention provides, in this experiment, better classification results, both in terms of accuracy and F1 score. It also illustrates that the performance of the QCNN seems to decrease when the number of layer sets increases, which tends to confirm that the information included in the input data can be "lost" when the QCNN includes too many parameters.
[0112] Table 2 below illustrates the results of a classification of images of "0" and "8" by a neural network according to the invention (INV) and by a conventional neural network (CONV).
[0113] [Table 2] Table 2: results of the classification of images of "0" and "8" by a neural network according to the invention (INV) and by a conventional neural network (CONV) Number Results e1 e2 e3 e4 e5 of sets (prec / F1) 0.9547 INV 0.945 0.938 0.953 0.965 0.963 / 0.9548 2 0.9512 CONV 0.946 0.960 0.934 0.961 0.965 / 0.9518 0.958 INV 0.8992 0.9548 0.9578 0.947 0.9499 / 0.9579 3 0.9495 CONV 0.9138 0.9544 0.9499 0.9469 0.9328 / 0.9500 0.926 INV 0.5265 0.5198 0.7798 0.9454 0.9454 / 0.928 4 0.944 CONV 0.8264 0.9517 0.9447 0.9596 0.9530 / 0.9449
[0114] The results in this table 2 show that the QCNN architecture according to the invention provides in this experiment, better results in terms of classification, whether in terms of precision or F1 score.
[0115] The scores for this image classification of "0" and "8" are lower than those for the classification of "0" and "1". As mentioned earlier, this is partly because "0" and "8" are graphically closer than "0" and "1", but also because a low-dimensional principal component analysis (as in this example) tends to blur the image.
[0116] It can be seen that in the experiment, according to Table 2, the QCNN according to the invention comprising four sets of layers is not more efficient than the conventional QCNN. This is explained by the fact that the random initialization of the hyperparameters of the QCNN (those optimized by gradient descent) is not optimal. However, a number of cycles greater than 5 could improve the performance of the QCNN according to the invention, as confirmed by the results in Table 3. Furthermore, this result is explained by the fact that, in this experiment, the number of features considered is not sufficiently large compared to the number of parameters of the QCNN. This assertion is further confirmed by the results in Table 4.
[0117] More specifically, Table 3 shows that the performance of the neural network according to the invention (INV) is much better than that of the conventional neural network (CONV), with a difference (in this example) of 4% in terms of accuracy and F1 score.
[0118] [Table 3] Table 3: Image classification results of "0" and "8" from the MNIST set, using two neural network architectures having 4 sets of layers. e1 e2 e3 e4 e5 INV 0.6596 0.9450 0.9427 0.9385 0.9385 CONV 0.7693 0.9218 0.9407 0.9390 0.9480 e6 e7 e8 e9 e10 Results (prev / F1) INV 0.9356 0.9259 0.9356 0.9405 0.9347 0.9625 / 0.9605 CONV 0.9466 0.9387 0.9439 0.9276 0.9478 0.924 / 0.9267
[0119] Table 4 summarizes the results of the classification of images of "0" and "8" from the MNIST set by a conventional neural network having 5 sets of layers, and which takes as input a number of characteristics similar to that considered to obtain the results of the neural network according to the invention (INV) of Table 3, but with a significant number (eg, 114 parameters for the conventional neural network with 5 sets of layers against 60 parameters for the neural network according to the invention with 4 layers) of free parameters. This Table 4 shows that the performances of the conventional neural network are low, which therefore confirms that the performance of the architecture of the neural network according to the invention is linked to the number of characteristics that this neural network can take as input.
[0120] [Table 4] Table 4: Image classification results of "0" and "8" from the MNIST set by a conventional neural network having 5 sets of layers. e1 e2 e3 e4 e5 Results (prec / F1) CONV 0.5055 0.5087 0.4984 0.5152 0.4935 0.4817 / 0.6138
[0121] The neural network architecture according to the invention was also tested with sets of images representative of benign and / or malicious files. To do this, two labeled datasets including "portable executable" type files were considered, "BODMAS Malware Dataset" provided by the University of Illinois at Urbana-Champaign (UIUC) and "PE Malware Machine Learning Dataset".
[0122] A principal component analysis, PCA, was then applied to these files, in order to obtain a set of images. The dimension of this analysis was 14 (PCA-14) in order to be able to obtain a relatively fine analysis of the images, without significantly increasing the number of characteristics to be considered as input to the neural network. Table 5 shows the results of the classification of images representative of benign and malicious files by a neural network according to the invention (INV) and a conventional neural network (CONV) having 2 and 3 sets of layers.
[0123] [Table 5] Table 5: results of the classification of representative images of benign and malicious files by a neural network according to the invention (INV) and by a conventional neural network (CONV) Number Score e1 e2 e3 e4 e5 of sets F1 INV 0.6464 0.6798 0.6940 0.7174 0.7036 0.780 2 CONV 0.6409 0.7063 0.7042 0.6998 0.6996 0.7698 INV 0.6195 0.6784 0.6835 0.6528 0.6547 0.785 3 CONV 0.4525 0.4665 0.5933 0.5294 0.5049 0.5897
[0124] Table 5 shows that the neural network according to the invention offers better results in terms of F1 score: 1% with two sets of layers, and 33% with three sets of layers.
[0125] For the conventional neural network comprising three sets of layers, the values are relatively low. This is due to the excessive number of parameters compared to the number of features provided as input to the neural network, which are themselves not sufficient. This example therefore illustrates well the technical effect and the interest of the neural network architecture as proposed, which improves the efficiency of the training phase, even with a limited number of sets (eg, 3).
Claims
Claims
1. Method for classifying data implemented by a quantum electronic device (20) and comprising: − obtaining (S30) a set of characteristics describing the data to be classified; and, − classifying (S50) the data by a quantum convolutional neural network comprising a plurality of successive processing layers, said classification comprising a progressive encoding of at least part of the characteristics of the set by several encoding layers of said network.
2. A classification method according to claim 1, wherein the progressive encoding comprises: − an encoding of a first subset of the set of characteristics via a first encoding layer of the quantum convolutional neural network; and, − an encoding of at least a second subset of the set of characteristics via at least a second layer of said network located downstream of the first layer in said network.
3. A classification method according to claim 2, wherein said at least a second subset includes a characteristic present in said first subset.
4. A classification method according to claim 2 or 3, further comprising: − a weighting of at least a part of the characteristics of the set; and, − an association of at least one weighted characteristic with the first and / or the second subset, according to said weighting.
5. Classification method according to one of claims 1 to 4, wherein said data corresponds to a file, the method further comprising a conversion (S20) of the file into an image; obtaining (S30) a set of characteristics comprising a determination of characteristics of said image; and the classification (S50) aims to determine whether said file is a benign or malicious file.
6. Quantum convolutional neural network (200A, 200B) comprising a first set (E1) of layers and at least one second set (E2) of layers linked to the first set, each of the first and second sets including an encoding layer (^^ ^^1, ^^ ^^2 ), in which the encoding layers ) of the first and second sets (E1, E2) progressively encode at least a portion of input features of said network.
7. A quantum convolutional neural network (200A, 200B) according to claim 6, wherein the encoding layer (^^ ^^2 ) of the second set (E2) has a number of inputs less than the number of inputs of the layer first set (E1).
8. Quantum convolutional neural network (200A, 200B) according to claim 6 or 7, wherein each of the first and second sets further includes a quantum convolutional layer (^^^^1, ^^^^2) linked to the encoding layer and a quantum pooling layer (^^^^1, ^^^^2) linked to the quantum convolutional layer.
9. Quantum convolutional neural network (200A, 200B) according to one of claims 6 to 8, wherein said network makes it possible to classify data in order to improve the security of a computer system.
10. Quantum electronic device (20) configured to implement the classification method according to one of claims 1 to 5.
11. A computer program (PROG) comprising instructions for implementing a classification method according to any one of claims 1 to 5, when said program is executed by a processor.
12. A computer-readable recording medium on which a computer program according to claim 11 is recorded.
Citation Information
Patent Citations
A system and method for selecting an optimal action with a quantum computer
EP4488888A1