Attack resisting method of hypergraph neural network
By training the adversarial attack detection network and loss function in the hypergraph neural network, the problem of perturbation attacks by the hypergraph neural network in the image feature data classification task is solved, the recognition accuracy is improved, and the quality of the recognition results is ensured when there is an attack.
Patent Information
- Application Number
- CN202410734620.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-15
AI Technical Summary
Hypergraph neural networks are susceptible to perturbation attacks in image feature data classification tasks, leading to errors in recognition results. It is difficult for existing technologies to effectively detect and handle adversarial attacks.
The adversarial attack detection network is trained to detect whether there is a perturbation attack before the hypergraph neural network is recognized, and the attack status of the input sample is considered during the training process of the hypergraph neural network. The hypergraph neural network is trained through the adversarial sample generation algorithm and loss function to improve Recognition accuracy.
It effectively reduces the impact of perturbation attacks on the recognition results, improves the recognition accuracy of the hypergraph neural network, and ensures that better recognition results can be obtained even in the presence of attacks.
Smart Images

Figure CN118780345A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of hypergraph neural network technology, and more specifically to a hypergraph neural network counterattack method. Background Art
[0002] Graph neural network is a framework that uses deep learning to directly learn graph structured data. By formulating certain strategies on the nodes and edges in the graph, the graph neural network converts the graph structured data into a standardized and standard representation, and inputs it into a variety of different neural networks for training, achieving excellent results in tasks such as node classification, edge information propagation, and graph clustering. Traditional graph convolutional networks use pairwise connections and are difficult to represent multimodal data. Compared with graph neural networks, hypergraph neural networks have the ability to describe complex high-order relationships between vertices and can be used to model complex networks and systems with high-order interactions. However, for the classification task of image feature data, the hypergraph neural network needs to extract features from the image. For example, to classify the posture of a person in an image, it is necessary to first extract the feature data of the human body posture in the image, and then perform hypergraph modeling on the feature data before the posture can be recognized. If the input image to be recognized is subjected to a disturbance attack, it will cause errors in the feature data extraction, resulting in errors in the final recognition result of the hypergraph neural network. Therefore, how to provide a hypergraph neural network adversarial attack method is a problem that technicians in this field need to solve urgently. Summary of the invention
[0003] In view of this, the present invention provides a hypergraph neural network adversarial attack method, which trains an adversarial attack detection network to detect whether there is a disturbance attack before the hypergraph neural network recognizes it, and considers the attack situation of the input sample when training the hypergraph neural network to improve the recognition accuracy of the hypergraph neural network.
[0004] In order to achieve the above object, the present invention provides the following technical solutions:
[0005] A method for countering an attack on a hypergraph neural network comprises the following steps:
[0006] S1. Divide the original data set into hypergraph neural network training samples and adversarial attack detection network training samples, construct a hypergraph neural network, use the adversarial sample generation algorithm to attack 50% of the adversarial attack detection network training samples, and use the attacked ones as the adversarial sample image set and the unattacked ones as the original image set;
[0007] S2, training the adversarial attack detection network based on the adversarial sample image collection and the original image sample collection;
[0008] S3, training a hypergraph neural network based on hypergraph neural network training samples and adversarial attack detection network training samples;
[0009] S4, input the image to be detected into the adversarial attack detection network, and the adversarial attack detection network detects whether there is an attack in the image to be detected. If there is an attack, enter S5, and if there is no attack, enter S6;
[0010] S5, after pre-processing the image to be detected, enter S6;
[0011] S6. Input the image to be detected into the hypergraph neural network, and the hypergraph neural network classifies and recognizes the image to be detected.
[0012] Optionally, in S1, a fast gradient descent algorithm is used to generate adversarial attack detection network training samples based on the constructed hypergraph neural network.
[0013] Optionally, S2 specifically includes: constructing an adversarial attack detection network, respectively inputting the adversarial sample image collection and the original image sample set and the corresponding sample labels to construct the adversarial attack detection network, wherein the label corresponding to the adversarial sample image collection is attacked, and the label corresponding to the original image sample set is not attacked, and the adversarial attack detection network is trained by minimizing the loss function to complete the training.
[0014] Optionally, the hypergraph neural network includes a feature extraction module, a hypergraph construction module, a hypergraph convolution module and a prediction module.
[0015] Optional, S3 is:
[0016] S31, inputting the hypergraph neural network training samples and the adversarial attack detection network training samples as input samples into the hypergraph neural network, and the feature extraction module extracts the feature vector of the input sample;
[0017] S32, a hypergraph construction module constructs a feature hypergraph based on the feature vector of the input sample;
[0018] S33, the hypergraph convolution module convolves the feature hypergraph to obtain a feature embedding vector;
[0019] S34, the prediction module performs prediction based on the feature embedding vector to obtain a prediction result;
[0020] S35. Compare the prediction results with the original labels of the input samples and train the hypergraph neural network through the loss function.
[0021] Optionally, the preprocessing method in S5 is to perform denoising on the image to be detected.
[0022] It can be seen from the above technical solution that compared with the prior art, the present invention provides a method for countering attacks of a hypergraph neural network, which has the following beneficial effects: the present invention trains a counter-attack detection network for attacks on the image to be detected, detects whether there is a disturbance attack before the hypergraph neural network recognizes it, processes the image to be detected with the disturbance attack to reduce the impact of the attack on the recognition result, and improves the accuracy of the hypergraph neural network; the present invention takes into account the attack situation of the training samples in the process of training the hypergraph neural network, and better recognition results can be obtained even if the attacked image to be detected is directly input into the hypergraph neural network. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0024] Figure 1 This is a flow chart of the anti-attack method of the hypergraph neural network of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] The embodiment of the present invention discloses a method for countering attacks on a hypergraph neural network. Figure 1 As shown, the following steps are included:
[0027] S1. Divide the original data set into hypergraph neural network training samples and adversarial attack detection network training samples, construct a hypergraph neural network, use the adversarial sample generation algorithm to attack 50% of the adversarial attack detection network training samples, and use the attacked ones as the adversarial sample image set and the unattacked ones as the original image set;
[0028] S2, training the adversarial attack detection network based on the adversarial sample image collection and the original image sample collection;
[0029] S3, training a hypergraph neural network based on hypergraph neural network training samples and adversarial attack detection network training samples;
[0030] S4, input the image to be detected into the adversarial attack detection network, and the adversarial attack detection network detects whether there is an attack in the image to be detected. If there is an attack, enter S5, and if there is no attack, enter S6;
[0031] S5, after pre-processing the image to be detected, enter S6;
[0032] S6. Input the image to be detected into the hypergraph neural network, and the hypergraph neural network classifies and recognizes the image to be detected.
[0033] Furthermore, in S1, a fast gradient descent algorithm is used to generate adversarial attack detection network training samples based on the constructed hypergraph neural network.
[0034] Furthermore, in an embodiment of the present invention, when a hypergraph neural network is constructed first, the model information of the attack on the hypergraph neural network is known, and the adversarial sample image collection after the attack is obtained by calculating the derivative of the model with respect to the input:
[0035]
[0036] Where x' is the collection of adversarial sample images after the attack, x is the adversarial attack detection network training sample before the attack, ε is the perturbation value parameter, represents the partial derivative, L is the loss of the hypergraph neural network, y is the label, and θ represents the parameters of the hypergraph neural network.
[0037] Furthermore, S2 is specifically as follows: constructing an adversarial attack detection network, respectively inputting the adversarial sample image collection and the original image sample set and the corresponding sample labels to complete the construction of the adversarial attack detection network, wherein the label corresponding to the adversarial sample image collection is attacked, and the label corresponding to the original image sample set is not attacked, and the adversarial attack detection network is trained by minimizing the loss function to complete the training.
[0038] Furthermore, in an embodiment of the present invention, the adversarial attack detection network is a binary classification convolutional neural network.
[0039] Furthermore, the hypergraph neural network includes a feature extraction module, a hypergraph construction module, a hypergraph convolution module and a prediction module.
[0040] Furthermore, S3 is specifically:
[0041] S31, inputting the hypergraph neural network training samples and the adversarial attack detection network training samples as input samples into the hypergraph neural network, and the feature extraction module extracts the feature vector of the input sample;
[0042] S32, a hypergraph construction module constructs a feature hypergraph based on the feature vector of the input sample;
[0043] S33, the hypergraph convolution module convolves the feature hypergraph to obtain a feature embedding vector;
[0044] S34, the prediction module performs prediction based on the feature embedding vector to obtain a prediction result;
[0045] S35. Compare the prediction results with the original labels of the input samples and train the hypergraph neural network through the loss function.
[0046] Furthermore, in an embodiment of the present invention, S31 extracts a feature vector of the behavior in the graph, and in S32, a KNN algorithm is used to calculate the feature distance between each feature node in the feature vector to obtain a feature hypergraph G=(V, E, W); wherein V represents a node set, E represents a hyperedge set, and W represents a hyperedge weight matrix. In S33, an association matrix H is obtained based on the feature hypergraph.
[0047]
[0048] For any element in the incidence matrix H, if a hyperedge e∈E exists in a node v∈V, the element value of the corresponding position in the incidence matrix H is 1;
[0049] The convolution in S33 is:
[0050]
[0051] In the formula, l is the number of convolutions, l∈L, L represents the number of convolution layers, X l represents the embedding vector after the lth convolution, X l-1 represents the embedding vector before the lth convolution, D v is the node matrix, D e is the hyperedge matrix, W is the hyperedge weight matrix, Θ is the parameter matrix, σ is the activation function, and is the number of convolution layers. After L convolution iterations, the final feature embedding vector can be obtained. In S35, the cross entropy loss function is used to train the hypergraph neural network and update the hyperedge weight matrix W and the parameter matrix Θ.
[0052] Furthermore, the preprocessing method in S5 is to perform denoising on the image to be detected.
[0053] Furthermore, in an embodiment of the present invention, a wavelet denoising algorithm is used to denoise the image to be detected, and then a super-resolution algorithm is used to reconstruct the image;
[0054] In another embodiment of the present invention, the preprocessing method in S5 is: first input the image to be detected into the hypergraph neural network, and after extracting the feature vector, enhance the feature vector, specifically:
[0055]
[0056] Where b i is the i-th randomly generated binary enhancement code, which conforms to the Bernoulli distribution. i is the i-th row in the feature vector, δ is the scaling parameter, is the i-th row in the enhanced feature vector. Through the above processing, the feature vector ignores the characteristics of some nodes, which can reduce the dependence of nodes on adjacent nodes when constructing the hypergraph, thereby improving the overall detection ability of the model.
[0057] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0058] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for countering an attack on a hypergraph neural network, characterized in that: The following steps are involved: S1. Divide the original data set into hypergraph neural network training samples and adversarial attack detection network training samples, construct a hypergraph neural network, use the adversarial sample generation algorithm to attack 50% of the adversarial attack detection network training samples, and use the attacked ones as the adversarial sample image set and the unattacked ones as the original image set; S2, training the adversarial attack detection network based on the adversarial sample image collection and the original image sample collection; S3, training a hypergraph neural network based on hypergraph neural network training samples and adversarial attack detection network training samples; S4, input the image to be detected into the adversarial attack detection network, and the adversarial attack detection network detects whether there is an attack in the image to be detected. If there is an attack, enter S5, and if there is no attack, enter S6; S5, after pre-processing the image to be detected, enter S6; S6. Input the image to be detected into the hypergraph neural network, and the hypergraph neural network classifies and recognizes the image to be detected.
2. A method for countering attacks on a hypergraph neural network according to claim 1, characterized in that: In S1, a fast gradient descent algorithm is used to generate adversarial attack detection network training samples based on the constructed hypergraph neural network.
3. The method for countering an attack on a hypergraph neural network according to claim 1, characterized in that: S2 is specifically as follows: construct an adversarial attack detection network, input the adversarial sample image collection and the original image sample collection and the corresponding sample labels respectively to complete the construction of the adversarial attack detection network, wherein the label corresponding to the adversarial sample image collection is attacked, and the label corresponding to the original image sample collection is not attacked, and the adversarial attack detection network is trained by minimizing the loss function to complete the training.
4. The method for countering an attack on a hypergraph neural network according to claim 1, characterized in that: The hypergraph neural network includes a feature extraction module, a hypergraph construction module, a hypergraph convolution module and a prediction module.
5. The method for countering an attack on a hypergraph neural network according to claim 4, characterized in that: S3 is specifically: S31, inputting the hypergraph neural network training samples and the adversarial attack detection network training samples as input samples into the hypergraph neural network, and the feature extraction module extracts the feature vector of the input sample; S32, a hypergraph construction module constructs a feature hypergraph based on the feature vector of the input sample; S33, the hypergraph convolution module convolves the feature hypergraph to obtain a feature embedding vector; S34, the prediction module performs prediction based on the feature embedding vector to obtain a prediction result; S35. Compare the prediction results with the original labels of the input samples and train the hypergraph neural network through the loss function.
6. A method for countering attacks on a hypergraph neural network according to claim 1, characterized in that: The preprocessing method in S5 is to perform denoising on the image to be detected.
