Internal user abnormal behavior detection method based on quantum convolutional neural network
Through the internal user anomaly behavior detection method based on quantum convolutional neural network, the parallelism and superposition characteristics of quantum computing are used and parameter optimization is combined with the PennyLane framework, which solves the high computational cost and parameters of traditional deep learning models when processing high-dimensional data. The problem of low parameter adjustment efficiency achieves efficient and accurate detection of abnormal behavior of internal users.
Patent Information
- Application Number
- CN202310483264.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-04-28
AI Technical Summary
In the NISQ era of quantum computing, internal user abnormal behavior detection has not been effectively explored in the quantum field. Traditional deep learning models have problems such as high computing costs, low parameter adjustment efficiency and information loss when processing high-dimensional data, making it difficult to accurately detect internal data. threaten.
Using internal user anomaly behavior detection method based on quantum convolutional neural network (QCNN), through data preprocessing, quantum convolution operation and fully connected neural network, the parallelism and superposition characteristics of quantum computing are used, and the parameters are optimized in combination with the PennyLane framework. Implement hybrid quantum classical computing to reduce computing costs and improve detection efficiency.
Improve the efficiency and accuracy of detection of abnormal behavior of internal users, reduce data processing time and calculation costs, can process massive data in a shorter time, extract hidden features and relationships, avoid information loss and error introduction, significantly Improves detection efficiency and accuracy.
Smart Images

Figure CN116541829B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of quantum computing, artificial intelligence and information security, and specifically to a method for detecting abnormal behavior of internal users based on a quantum convolutional neural network. Background Art
[0002] Quantum computing uses the characteristics of quantum parallelism and coherence generated by the superposition of quantum states, and shows special advantages in processing high-dimensional data. At present, quantum computing is in the era of Noisy Intermediate-Scale Quantum (NISQ), that is, quantum computers at the current stage have limited quantum bits and cannot maintain a stable state for a long time, while having a low fault tolerance rate. In addition, there are certain limitations on the depth of quantum circuits running on current devices. Exploring possible applications in the context of quantum computing NISQ is a research hotspot. Among them, quantum machine learning is considered to be one of the most promising applications in the field of quantum computing in the future, and it has been proven that quantum machine learning can partially alleviate the problem of computational complexity and the growing computational cost of classical neural networks.
[0003] At present, in terms of network security, an important threat is problems from within the organization. In recent years, security incidents caused by malicious operations of internal personnel have continued to occur, and this threat is more serious than the losses caused by external attacks. These internal users usually have access to the internal systems of the organization, understand system vulnerabilities, and have access to confidential information. With the continuous development of technology, the malicious behavior of these users has become more and more hidden and diverse. Therefore, how to accurately detect internal threats has become a research hotspot in the current field of network security. Although this field has achieved certain research results in classical computing, the exploration in the quantum field is still insufficient. With the development of quantum computing, quantum neural networks are becoming more and more popular. How to explore internal abnormal behavior detection in the quantum field will provide new ideas and thoughts for this field.
[0004] Quantum Convolutional Neural Network (QCNN) is a neural network model that uses quantum computing. It combines the advantages of quantum computing and deep learning, and aims to solve the problems existing in traditional deep learning methods, such as being limited to processing low-dimensional data or being easily trapped in local optimal solutions. The basic structure of QCNN is similar to that of traditional convolutional neural networks, but quantum gates are used to replace the convolution operations in traditional convolutional neural networks. Compared with traditional convolutional neural networks, QCNN has higher computing efficiency and stronger processing capabilities, especially QCNN has strong advantages in processing high-dimensional data and complex tasks. At present, although QCNN is still in the research and exploration stage, its application in certain fields is slowly being discovered. Summary of the invention
[0005] The purpose of this invention is to provide an internal user abnormal behavior detection method based on quantum convolutional neural network to realize the detection of user abnormal behavior, and demonstrate its feasibility and effectiveness through simulation and comparative experiments.
[0006] The technical solution for achieving the purpose of the present invention is:
[0007] A method for detecting abnormal behavior of internal users based on quantum convolutional neural network, comprising the following steps:
[0008] (1) Data preprocessing: Obtain data sources from the original user data set, extract features from it, filter out quantitative and qualitative indicator data based on the indicator system of the behavior domain, and normalize the filtered indicator data to obtain training samples;
[0009] (2) Constructing internal user abnormal behavior detection model based on quantum convolutional neural network: Using QCCNN, classical data usually represented as multidimensional arrays are converted into quantum states, and each element in the array is mapped to a single quantum bit state using a kernel function as quantum coding, where the kernel function is:
[0010] θ j →cos(θ j )|0>+sin(θ j )|1> (1)
[0011] Input a matrix A of size v×h, and set the window size to m×n. The first window is located in the upper left corner of A, that is, A 1:m,1:n ; The mapping is done by a linear function
[0012]
[0013] Then the next window slides to the right by a stride value s, usually s is selected as 1, until it reaches the right edge; then, it jumps down to the beginning of the left sample with the same stride value s, and repeats this process until the entire sample is traversed; after the convolution operation is completed, the output will be a size of After the convolutional layer, the output will become narrower and longer;
[0014] The quantum convolution kernel uses formula (1) to map a window of shape m×n to a quantum state consisting of N=m×n quantum bits |ψ i >(A p:(p+m-1),q:(q+n-1) ), and then use the parameterized quantum circuit Evolve the quantum state so that the output quantum state |ψ o >For:
[0015]
[0016] After calculation, use the observable The expected value of , the feature map is:
[0017]
[0018] Formula (4) is nonlinear, so in the quantum convolution layer, no additional nonlinear function such as the ReLU function is required to explicitly introduce nonlinearity; it can also be clearly seen from formula (4) that the minimum number of quantum bits required is equal to the window size; these quantum bits can be reused for the next window of the quantum convolution layer; therefore, only a few quantum bits are needed to implement the quantum convolution operation;
[0019] The parameterized quantum circuit used contains interlaced single-qubit layers and double-qubit layers. The total number of gate operations of the parameterized quantum circuit is recorded as L, which is only polynomially related to the number of qubits N, that is, L~poly(N) gate operations; the double-qubit layer is composed of CNOT gates, while the single-qubit layer is composed of rotating Y gates R Y Composition, which is defined as:
[0020]
[0021] Using R Y Gates,Real numbers are used to represent quantum states and parameterized quantum circuits to simplify,computation. Each rotation gate layer is considered as one depth, so the total number of,parameters in a parameterized quantum circuit will be the window size multiplied by,the circuit depth;
[0022] (3) Parameter optimization: The PennyLane framework is used to continuously adjust the model parameter variables so that the output of the model and the actual data can achieve the best fit. The gradient of the hybrid quantum-classical loss function is automatically derived using a hybrid quantum-classical computer.
[0023] Furthermore,
[0024] The data in the original user data set in step (1) includes multiple different log files.
[0025] The quantitative indicator data in step (1) is numerical data, which is calculated and counted on a daily basis, such as login activities during working hours / outside working hours, email traffic, web browsing tracking, file access logs, and USB drive usage.
[0026] The qualitative indicator data in step (1) is non-numerical data, such as whether it is a weekday, whether spam text messages are received, etc.
[0027] The QCCNN in step (2) comprises:
[0028] First, perform quantum convolution on the sample data and save the calculation results; then divide the data after quantum convolution into training set and test set:
[0029] 1) Training set: Assume there is a sample set S = {(x1,y1),...,(x N ,y N )} contains N labels, where the sample data is represented by x, y i ∈{1,...,K} represents the labels of K classes corresponding to the sample data, S K Represents a dataset with k-class samples. This dataset is called a K-way N-shot dataset, that is, a dataset containing K classes and N samples, a total of K×N samples.
[0030] 2) Test set: The data volume corresponding to the training set is also K-way N-shot. The test set is used to test the performance of the final optimal model.
[0031] After dividing the data set into training set and test set, it passes through a fully connected network; then through an activation function, the final classification result is output; the Sigmoid function is used as the final activation function, and the expression of the Sigmoid function is:
[0032]
[0033] The value range of S(z) is (0,1). The Sigmoid activation function should be the first activation function used in deep neural networks, mainly used for logistic regression to achieve binary classification.
[0034] The advantages of the present invention are:
[0035] (1) In the case of massive internal anomaly data sets, as the depth and data volume of deep neural network models increase, the model parameters will also show an exponential growth, resulting in excessive model calculation costs and low parameter adjustment efficiency. By utilizing the outstanding parallel computing capabilities of QCNN, it uses characteristics such as quantum entanglement and superposition to improve the execution efficiency of classical neural networks and can process and analyze large amounts of data in a shorter time.
[0036] (2) Due to the limitations of classical computing power, in the face of massive data, traditional algorithms often need to perform operations such as preprocessing and dimensionality reduction on the data to reduce the amount of calculation and improve efficiency. However, these processes may lead to information loss and the introduction of errors, which in turn affects the extraction of hidden features and relationships from the data. To address the above problems, when using QCNN to process data in parallel, there is no need for preprocessing or dimensionality reduction operations, which can reduce the time and computing cost of processing data. At the same time, since anomalies are usually uncommon and irregular, subtle features need to be extracted from a large data set in order to be accurately detected. Using QCNN, hidden features and relationships can be extracted from a large data set, which is also particularly important for anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a schematic diagram of the framework of the embodiment method;
[0038] Figure 2 Schematic diagram of quantum convolutional neural network for implementation method;
[0039] Figure 3 A schematic diagram of convolution operation in a quantum convolutional neural network according to an embodiment of the method;
[0040] Figure 4 A schematic diagram of a fully connected neural network of an embodiment method;
[0041] Figure 5 This is a schematic diagram of the performance test of user 1 of the embodiment method;
[0042] Figure 6 This is a schematic diagram of the performance test of user 2 of the embodiment method;
[0043] Figure 7 This is a schematic diagram of the performance test of user 3 in the embodiment method. DETAILED DESCRIPTION
[0044] The content of the present invention is further described below in conjunction with the drawings and embodiments, but the present invention is not limited thereto.
[0045] Example:
[0046] Reference Figure 1 , a method for detecting abnormal behavior of internal users based on quantum convolutional neural network, including data preprocessing, quantum convolution operation, fully connected neural network and final parameter optimization. The specific implementation steps are as follows:
[0047] (1) Data preprocessing
[0048] First, the data source contains different raw user data sets, which come from multiple different log files. Secondly, in the feature extraction stage, quantitative and qualitative indicator data are screened out according to the indicator system of the behavior domain. Quantitative indicator data is mainly numerical, and frequency features are calculated and counted in days, such as login activities during / outside working hours, email traffic, web browsing tracking, file access logs, and USB drive usage. Qualitative indicators are non-numerical, such as whether it is a working day, whether spam text messages are received, etc. According to the characteristics of different users, the data is divided into different user data sets. Finally, the screened indicator data is normalized to obtain the final training samples.
[0049] (2) Constructing internal user abnormal behavior detection model based on quantum convolutional neural network
[0050] As the amount of log data within the organization increases, classical neural networks have difficulty processing it. In order to utilize the natural parallelism of quantum computing, this paper proposes to use a quantum-classical hybrid convolutional neural network model to process internal user behavior data, and designs an abnormal behavior detection algorithm based on quantum convolutional neural network (Quantum Convolutional Neural Network Algorithm for Abnormal Behavior Detection, QCNN-ABD) for internal abnormal behavior detection.
[0051] Inspired by the classical convolutional neural network (CNN), and in order to adapt to quantum computing and strengthen the feature mapping process, our QCNN-ABD algorithm will be implemented using QCCNN, namely the quantum-classical hybrid convolutional neural network (QCCNN), whose network architecture is as follows: Figure 2 As shown in Figure 2, QCCNN not only performs well on medium-sized quantum computers, but also retains important features of classical CNN, such as nonlinearity and scalability.
[0052] To solve practical problems, quantum machine learning first needs to convert classical data, usually represented as multidimensional arrays, into quantum states. A standard approach is to use a kernel function to map each element of the array into a single qubit state, which is often called quantum encoding. For example, the kernel function can be chosen as:
[0053] θ j →cos(θ j )|0>+sin(θ j )|1> (1)
[0054] It maps real numbers into single-qubit states.
[0055] The core idea of QCCNN is to use parameter quantum circuits to implement the feature map of the convolution layer, and accordingly, the output of this feature map is the relevant measurement of the output quantum state of the parameter quantum circuit. Next, we call this structure a quantum convolution layer. Therefore, the number of quantum bits required for this method is only related to the window size of the feature map. Usually we choose a 2×2 or 3×3 convolution window, which is within the range of the number of quantum bits supported by current quantum computers. In addition, since the output of our quantum convolution layer is a classical data, it can adapt to a multi-layer structure like CNN. Therefore, our QCCNN can take advantage of all the characteristics of the classical CNN.
[0056] The working principle of QCCNN is similar to that of CNN, mainly including convolutional layers and pooling layers, which are repeatedly used alternately to deepen the network depth, and finally end with a fully connected layer. The convolution kernel maps the input window to the output neuron and is parameterized by a matrix P with the same shape as the window. Assuming that a matrix A of size v×h is input and the window size is set to m×n, the first window is located in the upper left corner of A, that is, A 1:m,1:n . The mapping is done by a linear function
[0057]
[0058] The next window then slides to the right by a stride value s, usually chosen to be 1, until it reaches the right edge. It then jumps down to the beginning of the sample (on the left) with the same stride value s, and repeats this process until it has traversed the entire sample. Therefore, after the convolution operation is completed, the output will be of size . Usually, after a convolutional layer, the output becomes narrower and longer. In some cases, one wants to prevent the data from becoming narrower, which is achieved by adding zeros to the edges of the input, a process called padding.
[0059] The quantum circuit of the convolution kernel is as follows Figure 3 The quantum convolution kernel uses formula (1) to map a window of shape m×n to a quantum state consisting of N=m×n quantum bits |ψ i >(A p:(p+m-1),q:(q+n-1) ), and then use the parameterized quantum circuit Evolve the quantum state so that the output quantum state |ψ o >For:
[0060]
[0061] After calculation, use the observable The expected value of , so the feature map can be written as:
[0062]
[0063] Formula (4) is nonlinear, so in our quantum convolution layer, no additional nonlinear functions such as ReLU functions are needed to explicitly introduce nonlinearity. It can also be clearly seen from formula (4) that in our method, the minimum number of qubits required is equal to the window size. These qubits can be reused for the next window of our quantum convolution layer. Therefore, only a few qubits are needed to implement the quantum convolution operation, so in the current NISQ scenario, the quantum convolution layer is experimentally feasible.
[0064] The parameterized quantum circuit we use consists of interleaved single-qubit layers and double-qubit layers. The total number of gate operations in the parameterized quantum circuit is denoted by L, which is only polynomially related to the number of qubits N, that is, L ~ poly(N) gate operations. In our setup, the double-qubit layer consists of CNOT gates, while the single-qubit layer consists of rotating Y gates R Y Composition, which is defined as:
[0065]
[0066] Here, we use R Y The reason for using the gate instead of other single-qubit rotation gates is that we can use real numbers to represent quantum states and parameterize quantum circuits to simplify computations. Each rotation gate layer is considered a depth, so the total number of parameters in a parameterized quantum circuit will be the window size multiplied by the circuit depth.
[0067] The specific implementation idea of QCCNN is to first perform quantum convolution on the sample data and save the calculation results. Then divide the data after quantum convolution into training set and test set:
[0068] 1) Training set: Assume there is a sample set S = {(x1,y1),...,(x N ,y N )} contains N labels, where the sample data is represented by x, y i ∈{1,...,K} represents the labels of K classes corresponding to the sample data, S K Represents a dataset with k-class samples. This dataset is called a K-way N-shot dataset, that is, a dataset containing K classes and N samples, a total of K×N samples.
[0069] 2) Test set: The data volume corresponding to the training set is also K-way N-shot. The test set is used to test the performance of the final optimal model.
[0070] After dividing the data set into training set and test set, it passes through a fully connected network, such as Figure 4 As shown, an activation function is then used to output the final classification result. We use the Sigmoid function as the final activation function, and the expression of the Sigmoid function is:
[0071]
[0072] The value range of S(z) is (0,1). The Sigmoid activation function should be the first activation function used in deep neural networks, mainly used for logistic regression to achieve binary classification.
[0073] (3) Parameter Optimization
[0074] Parameter optimization is an optimization method used to achieve the design goal. By constantly adjusting the model parameter variables, the output of the model and the actual data can achieve the best fit. There are many optimization methods that can be used. Integrating parameterized quantum circuits into the automatic differentiation framework is currently a common parameter optimization method. The PennyLane framework is used in the present invention. PennyLane is a differentiable programming software framework for quantum computing based on Python 3.0. The software framework provides a unified architecture for classical computing and quantum computing. In terms of classics, PennyLane provides classic machine learning libraries such as TensorFlow, PyTorch and other interfaces; in terms of quantum, PennyLane can be used for many applications such as optimization of variational quantum eigenvalue solvers, quantum approximate optimization, and quantum machine learning models. The core feature of PennyLane is that it can calculate the gradient of variational quantum circuits in a way that is compatible with classical techniques such as backpropagation. Therefore, PennyLane extends the common automatic differentiation algorithms for optimization and machine learning, and is compatible with hybrid quantum and classical computing. Using this framework, the gradient of the hybrid quantum-classical loss function can be automatically derived using a hybrid quantum-classical computer.
[0075] In order to demonstrate the performance of this algorithm, three user behaviors with different sample sizes were tested and compared with the classic neural network. The number of user samples increased successively. The results of the test data are shown in the figure below. Figure 5-Figure 7 shown. Figure 5-Figure 7 Here, with quantum layer means the QCNN-ABD algorithm with quantum convolution kernel operation, and without quantum layer means the classic neural network internal user abnormal behavior detection algorithm. Figure 5-Figure 7From these data, we can conclude that the QCNN-ABD algorithm can achieve higher accuracy faster. At the beginning, the experimental results were not particularly ideal due to insufficient data samples, and the accuracy curve was step-shaped. As the amount of data increases, we can see that the accuracy rate has steadily increased, and the accuracy curve is similar to a smooth curve. The QCNN-ABD algorithm can achieve the expected effect and can achieve higher accuracy with fewer training times. It has higher training efficiency than the classical network. This shows that quantum computing has potential application prospects in the field of anomaly detection in the current NISQ era.
Claims
1. A method for detecting abnormal behavior of internal users based on quantum convolutional neural network, characterized by: The steps include: (1) Data preprocessing: Obtain data sources from the original user data set, perform feature extraction on it, filter out quantitative and qualitative indicator data based on the indicator system of the behavior domain, and normalize the filtered indicator data to obtain training samples; (2) Constructing internal user abnormal behavior detection model based on quantum convolutional neural network: Using QCCNN, classical data usually represented as multidimensional arrays are converted into quantum states, and each element in the array is mapped to a single quantum bit state using a kernel function as quantum coding, where the kernel function is: i j →cos(θ j )|0>+sin(θ j )|1> (1) Input a matrix A of size v×h, and set the window size to m×n. The first window is located in the upper left corner of A, that is, A 1:m,1:n ; The mapping is done by a linear function Then the next window slides to the right by a stride value s, usually s is selected as 1, until it reaches the right edge; then, it jumps down to the beginning of the left sample with the same stride value s, and repeats this process until the entire sample is traversed; after the convolution operation is completed, the output will be of size After the convolutional layer, the output will become narrower and longer; The quantum convolution kernel uses formula (1) to map a window of shape m×n to a quantum state consisting of N=m×n quantum bits |ψ i >(A p:(p+m-1),q:(q+n-1) ), and then use the parameterized quantum circuit Evolve the quantum state so that the output quantum state |ψ o >For: After calculation, use the observable The expected value of , the feature map is: Formula (4) is nonlinear, so in the quantum convolution layer, no additional nonlinear function such as the ReLU function is required to explicitly introduce nonlinearity; It is also clear from formula (4) that the minimum number of qubits required is equal to the window size; these qubits can be reused for the next window of the quantum convolution layer; therefore, only a few qubits are needed to implement the quantum convolution operation; The parameterized quantum circuit used contains interlaced single-qubit layers and double-qubit layers. The total number of gate operations of the parameterized quantum circuit is recorded as L, which is only polynomially related to the number of qubits N, that is, L~poly(N) gate operations; the double-qubit layer is composed of CNOT gates, while the single-qubit layer is composed of rotating Y gates R Y Composition, which is defined as: Using R Y Gates,Real numbers are used to represent quantum states and parameterized quantum circuits to simplify,computation. Each rotation gate layer is considered as one depth, so the total number of,parameters in a parameterized quantum circuit will be the window size multiplied by,the circuit depth; (3) Parameter optimization: The PennyLane framework is used to continuously adjust the model parameter variables so that the output of the model and the actual data can achieve the best fit. The gradient of the hybrid quantum-classical loss function is automatically derived using a hybrid quantum-classical computer.
2. The method for detecting abnormal behavior of internal users based on quantum convolutional neural network according to claim 1 is characterized in that: The data in the original user data set in step (1) includes multiple different log files.
3. The method for detecting abnormal behavior of internal users based on quantum convolutional neural network according to claim 1 is characterized in that: The quantitative indicator data in step (1) is numerical data, and the frequency characteristics are calculated and counted with days as the time unit.
4. The method for detecting abnormal behavior of internal users based on quantum convolutional neural network according to claim 1 is characterized in that: The qualitative indicator data in step (1) is non-numerical data.
5. The method for detecting abnormal behavior of internal users based on quantum convolutional neural network according to claim 1 is characterized in that: In step (2), the QCCNN first performs a quantum convolution operation on the sample data and saves the calculation results; then the data after quantum convolution is divided into a training set and a test set: 1) Training set: Assume there is a sample set S = {(x1,y1),…,(x N ,y N )} contains N labels, where the sample data is represented by x, y i ∈{1,…,K} represents the labels of K classes corresponding to the sample data, S K Represents a dataset with k-class samples; this dataset is called a K-way N-shot dataset, that is, a dataset containing K classes and N samples, a total of K×N samples; 2) Test set: The data volume corresponding to the training set is also K-way N-shot. The test set is used to test the performance of the final optimal model; After dividing the data set into training set and test set, it passes through a fully connected network and then an activation function to output the final classification result; the Sigmoid function is used as the final activation function, and the expression of the Sigmoid function is: Among them, the value range of S(z) is (0,1).
Citation Information
Patent Citations
Adversarial sample detection method and system based on quantum fuzzy convolutional neural network
CN115688883A
Quantum convolutional neural network construction method and system based on quantum state amplitude transformation
CN115828999A
