Preference training based on deep autoencoder to resist generative adversarial samples

By using a bias training method based on deep autoencoders, the problem of poor generalization ability of network intrusion detection algorithms when facing generative adversarial attacks is solved, achieving more efficient network intrusion detection and enhancing the robustness and detection accuracy of the model.

CN116090510BActive Publication Date: 2025-11-07HENAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310101802.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-10
Publication Date
2025-11-07
Estimated Expiration
2043-02-10

AI Technical Summary

Technical Problem

Existing machine learning-based network intrusion detection algorithms suffer from poor generalization ability and insufficient robustness when facing generative adversarial attacks. This is especially true in scenarios where speed and effectiveness are critical in network channels, where existing methods have failed to effectively address the generalization and robustness issues of the models.

Method used

A bias training method based on deep autoencoders is adopted. By preprocessing the dataset, training the deep autoencoder, calculating the minimum and maximum loss of traffic data, obtaining anomaly scores, constructing the objective function, training the basic classifier, and obtaining the network model, the generalization ability and robustness of the model are enhanced.

Benefits of technology

It improves the generalization ability and robustness of the network model, enabling it to more effectively identify and resist generative adversarial example attacks, and ensuring the accuracy and timeliness of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116090510B_ABST
    Figure CN116090510B_ABST
Patent Text Reader

Abstract

The application relates to the field of network security intrusion detection, and particularly relates to a preference training resistance to generated adversarial sample method based on a deep autoencoder, which comprises the following steps: preprocessing a data set to obtain an alternative set; training a deep autoencoder based on the alternative set to obtain a trained deep autoencoder; calculating the minimum loss and the maximum loss of the traffic in the data set based on the trained deep autoencoder; obtaining the abnormal score of each traffic data in the data set based on the minimum loss and the maximum loss; constructing a target function according to the abnormal score, training a basic classifier based on the target function to obtain an alternative classifier, and obtaining a trained network model. The application can guarantee the accuracy and timeliness, improve the generalization ability of the model, and has stronger robustness.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of network security intrusion detection, and particularly relates to a method for resisting generative adversarial samples based on preference training of a deep autoencoder. BACKGROUND

[0002] Existing machine learning-based methods have great prospects in deploying intrusion detection, but in the field of deep learning, a branch of machine learning, it has been gradually found that there are defects in deep neural networks, one of which is that in the image field, generative adversarial samples can make the human eye indistinguishable under slight addition of some differences, but the accuracy of the deep neural network classifier is greatly reduced. It was later found that this danger could also occur in traditional machine learning and non-image fields, and there has been extensive research on the problem of generative adversarial samples in network security. However, most methods focus on how to resist attacks alone, making the model more robust, ignoring the fact that the defense method also needs to consider the problem of model generalization; or there are resistance methods suitable for image field problems, which are not suitable for end-to-end problems that require fast speed and high effectiveness in network channels. SUMMARY

[0003] In order to solve the problem of poor generalization ability of existing network intrusion detection algorithms based on machine learning, the purpose of the present application is to provide a method for resisting generative adversarial samples based on preference training of a deep autoencoder, and the technical solution adopted is as follows:

[0004] One embodiment of the present application provides a method for resisting generative adversarial samples based on preference training of a deep autoencoder, comprising the following steps:

[0005] Preprocessing the data set to obtain a candidate set;

[0006] Training a deep autoencoder based on the candidate set to obtain a trained deep autoencoder;

[0007] Calculating the minimum loss and the maximum loss of the traffic in the data set based on the trained deep autoencoder; and obtaining an anomaly score of each traffic data in the data set based on the minimum loss and the maximum loss;

[0008] Constructing an objective function according to the anomaly score, and training a basic classifier based on the objective function to obtain a candidate classifier, so as to obtain a trained network model.

[0009] Preferably, the step of preprocessing the data set comprises:

[0010] Extracting traffic data from unstructured network traffic based on the data set, removing unusable data in the traffic data, and converting non-numerical data in the traffic data into numerical values;

[0011] The normal samples in the traffic data are selected to form a candidate set.

[0012] Preferably, the step of calculating the minimum loss and the maximum loss of the traffic in the data set based on the trained deep autoencoder comprises:

[0013] The deep autoencoder is trained based on the traffic data in the candidate set, and the loss value of each traffic data in the data set is obtained based on the trained deep autoencoder to obtain the minimum loss and the maximum loss.

[0014] Preferably, the step of obtaining the anomaly score of each traffic data in the data set based on the minimum loss and the maximum loss comprises:

[0015] For any traffic data, the difference between the loss value corresponding to the traffic data and the minimum loss is calculated as the numerator, and the difference between the maximum loss and the minimum loss is calculated as the denominator, and the ratio of the numerator to the denominator is the anomaly score of the traffic data.

[0016] Preferably, the step of constructing the objective function according to the anomaly score comprises:

[0017] The frequency of the anomaly score corresponding to each traffic data in the anomaly scores corresponding to all training samples in the data set is obtained, and the formula of the objective function is obtained based on the frequency corresponding to each traffic data.

[0018]

[0019] wherein, represents the minimum value; represents the number of all training samples; represents the anomaly score corresponding to the training sample the proportion of the anomaly score of all training samples in the entire test set ; represents the regularization term; represents the regularization term coefficient; represents the natural constant; represents the loss function.

[0020] Preferably, after the step of obtaining the trained network model, the method further comprises:

[0021] The most correct traffic is selected in each set batch and put into the training set of the deep autoencoder, and after a predetermined period of time, the oldest traffic data is removed and the deep autoencoder is retrained.

[0022] Preferably, the screening of the most correct flow is represented as: ; representing the normal flow marked as 0, representing the minimum abnormal score; the longest flow data is represented as: , using method to delete the flow data with date from the data set, for returning the longest time date in the training set .

[0023] The present application has the following beneficial effects: in the embodiment of the present application, the abnormal score corresponding to each flow data is obtained by training the deep autoencoder, and subsequent analysis is carried out based on the abnormal score, that is, the abnormal score corresponding to each flow data is used as a reference weight to construct a target function, which can effectively make the network model pay more attention to a part of the sample idea, so that the disturbance attack similar to the normal sample characteristics is trained more, thereby reducing its harm; at the same time, considering the abnormal score of different flow data, the applicability is stronger, the generalization ability and robustness of the network model are improved while ensuring the accuracy and timeliness. BRIEF DESCRIPTION OF DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art and the advantages thereof, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0025] Figure 1 A flowchart of a method for resisting generated adversarial samples based on preference training of a deep autoencoder provided by an embodiment of the present application;

[0026] Figure 2 An architecture diagram of an abnormal score acquisition provided by an embodiment of the present application;

[0027] Figure 3 A schematic diagram of a method for ensuring timeliness provided by an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to further illustrate the technical means and effects taken by the present application to achieve the predetermined object of the application, the specific implementation, structure, features and effects of a preference training based on a deep autoencoder to resist generated adversarial samples method according to the present application are described in detail as follows in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0030] The specific scheme of the preference training based on a deep autoencoder to resist generated adversarial samples method provided by the present application is specifically described below in combination with the accompanying drawings.

[0031] Please refer to Figure 1 , which shows a flowchart of a preference training based on a deep autoencoder to resist generated adversarial samples method according to an embodiment of the present application, including the following steps:

[0032] Step S100, pre-processing the data set.

[0033] In the field of network intrusion detection, there are various public basic data sets, such as NSL-KDD data set and UNSW-NB15 data set. Generally, before training or verification based on the data set, the data set needs to be pre-processed. The traffic data is extracted from the unstructured network traffic based on the data set, the unusable data in the traffic data is removed, and the non-numerical data in the traffic data is converted into numerical values. All traffic data is standardized and normalized, and the normal samples in all traffic data are selected to form a candidate set. The specific pre-processing process is as follows:

[0034] Firstly, remove invalid data such as illegal values, null values, inf and Nan in the data set, and directly remove the row where the data is located when removing data; then, convert all non-numerical data into numerical data by using discrete values 1, 2, 3 and other numerical values instead; secondly, standardize all data remaining in the data set, and normalize some extremely unbalanced columns of these data; the label column can be processed by different classification requirements, and the processing method of binary classification and multi-classification; in the NSL-KDD data set, the label column can be divided into normal traffic and abnormal traffic, and the normal traffic is marked as 0, and the abnormal traffic is subdivided into 39 categories, that is, marked with numbers 1-39; whether the traffic is normal or abnormal can be determined by verifying whether it is correct, which is binary classification; whether the traffic is one of the 40 categories can also be determined by verifying whether it is correct, which is multi-classification. Similarly, the same preprocessing operation is performed on the data in the UNSW-NB15 data set.

[0035] The formula for standardizing the data sample is:

[0036]

[0037] In the formula, represents the standardized sample; represents the sample before standardization; represents the mean of all data; represents the variance of all data.

[0038] The formula for normalizing the data sample is:

[0039]

[0040] In the formula, represents the normalized sample; represents the sample before normalization; represents the minimum value of the column data sample, represents the maximum value of the column data sample.

[0041] Step S200, based on the trained deep autoencoder, respectively obtain the minimum loss and the maximum loss; based on the minimum loss and the maximum loss, obtain the abnormal score of each traffic data in the data set.

[0042] The evaluation network model is constructed by using a deep autoencoder. The deep autoencoder is trained by using the training samples in the preprocessed candidate set in step S100 to obtain a characteristic model of normal traffic in the fitting channel. Then, the trained deep autoencoder is used to obtain an anomaly score of each traffic data for subsequent analysis. The anomaly score is mainly used to evaluate the difference of each traffic data in the current network. On one hand, the anomaly score is used to distinguish abnormal traffic and construct an outlier degree. On the other hand, the anomaly score is used to calculate the subtle difference of the traffic attacked by the generated adversarial sample, so that the traffic can be paid attention to in subsequent work. The deep autoencoder is trained based on the traffic data in the candidate set. The loss value of each traffic data in the data set is obtained based on the trained deep autoencoder, so as to obtain the minimum loss and the maximum loss.

[0043] Specifically, referring to Figure 2 which shows an architecture diagram of an anomaly score acquisition. First, the deep autoencoder is trained by using a part of normal traffic in the data set and the candidate set. After training, the evaluation network records the minimum loss in the global data set and takes the minimum loss as an observed minimum loss The loss is obtained by a loss function. Since the deep autoencoder is trained by unsupervised learning, the loss value is calculated by a mean square error distance function between the original traffic data and the output traffic data. In other embodiments, other loss functions can also be used to train the deep autoencoder.

[0044] Then, the trained deep autoencoder (that is, the evaluation network) records the maximum loss in the global data set and takes the maximum loss as an observed minimum loss The maximum loss The acquisition method is the same as the method of obtaining the minimum loss by using normal traffic.

[0045] Further, all traffic data in the data set is input into the trained deep autoencoder to obtain the loss value corresponding to each traffic data. The anomaly score corresponding to the traffic data is obtained based on the loss value corresponding to each traffic data. For any traffic data, the difference between the loss value corresponding to the traffic data and the minimum loss is taken as the numerator. The difference between the maximum loss and the minimum loss is taken as the denominator. The ratio of the numerator and the denominator is the anomaly score of the traffic data. The specific calculation method of the anomaly score is as follows:

[0046]

[0047] Wherein, represents the anomaly score corresponding to the traffic data; represents the loss value corresponding to the traffic data; represents the minimum loss corresponding to the normal traffic; represents the maximum loss corresponding to the abnormal traffic.

[0048] Step S300, constructing a target function according to the abnormal score, training a basic classifier based on the target function to obtain a candidate classifier, and obtaining a trained network model.

[0049] In order to utilize the difference between the traffic data in the channel and the expected correct traffic, a suitable target function is constructed for training and prediction, so that the normal traffic and the traffic data attacked by the adversarial samples can participate in the training more, so as to improve the recognition of the adversarial samples; the construction of the target function mainly depends on the abnormal score of each training sample obtained in step S200, the target function is obtained by obtaining the proportion of the abnormal score of each training sample in all training samples, and the formula of the target function is:

[0050]

[0051] wherein, represents taking the minimum value; represents the number of all training samples; represents the abnormal score corresponding to the training sample the proportion of the abnormal score of all training samples in the entire data set represents the regularization term; represents the regularization term coefficient; represents a natural constant; represents the loss function.

[0052] The weight coefficient is constructed by the frequency proportion of the abnormal score corresponding to the training sample , which can give a lower weight to the training sample with a high abnormal score, weaken the ability of the parameter, and at the same time retain the data with a low abnormal score, pay more attention to the normal sample and the adversarial sample, so that the model training plays a role of adversarial training; and through the negative correlation mapping of the natural constant, the frequency proportion can be mapped to a smaller range, so as not to appear a large gap between the training samples, and to a certain extent, the network model has a non-linear, which greatly improves the security of the model.

[0053] The formula is used as a target function combined with a machine learning classification algorithm for training, which is faster than a deep neural network, and the candidate classifier is a traditional machine learning classifier, including: decision tree, random forest, K-nearest neighbor, support vector machine and naive Bayes, etc.; after training and testing of each model, the classification speed, accuracy and recall rate and other evaluation indexes of each classifier are obtained, so as to select the best classifier as the candidate classifier.

[0054] ​Further, in order to ensure that the prediction has timeliness, so that the evaluation network model is more adaptive to the current network environment, it is necessary to continuously update the abnormal score corresponding to the sample data , to ensure the recognition degree of correct traffic in the network channel; see Figure 3 , a schematic diagram of a timeliness guarantee method, the specific method is: training the evaluation network model through the classified correct traffic, so that it continuously adapts to the current network environment, specifically: continuously selecting the smallest, correct and corresponding abnormal score of each batch, putting it into the training set of the evaluation network, training the current network every period of time, and discarding part of the traffic with the longest time in the evaluation network training set, the screening principle of the most correct traffic is expressed by the formula: ; represents the normal traffic labeled as 0, represents the smallest abnormal score.

[0055] In addition to the above-mentioned most correct traffic screening, this part also includes a longest traffic elimination module; the principle of the longest traffic elimination module is to discard the longest according to the record date; considering the sample capacity adaptation problem, the elimination operation can be extended for a long time or shortened in time, so as to dynamically ensure that the capacity of the data set of the evaluation network is appropriate; the principle of the longest traffic elimination is expressed by the formula: , using method to delete the traffic with date t from the data set, is used to return the date with the longest time in the training set x.

[0056] In summary, the embodiment of the application preprocesses the data set; trains a deep autoencoder based on the alternative set to obtain a trained deep autoencoder; calculates the minimum loss and the maximum loss of the preprocessed data set based on the trained deep autoencoder; obtains the abnormal score of each traffic data in the data set based on the minimum loss and the maximum loss; constructs a target function according to the abnormal score, trains a basic classifier based on the target function to obtain an alternative classifier, and obtains a trained network model. While ensuring accuracy and timeliness, the generalization ability of the network is improved, and the robustness is stronger.

[0057] It should be noted that: the above-mentioned embodiment order of the application is only for description, not representing the pros and cons of the embodiment. In addition, the process depicted in the drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0058] The various embodiments in the specification are described in progressive manner, and the same or similar parts between the various embodiments can be mutually referred to, and each embodiment focuses on the difference from other embodiments.

[0059] The above description is merely preferred embodiments of the present application, and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A bias-based training method for generating adversarial examples based on deep autoencoders, characterized in that, The method comprises the following steps: Preprocessing the data set to obtain a candidate set; Training a deep autoencoder based on the candidate set to obtain a trained deep autoencoder; Calculating the minimum loss and the maximum loss of the traffic in the data set based on the trained deep autoencoder; obtaining the anomaly score of each traffic data in the data set based on the minimum loss and the maximum loss; Building a target function according to the anomaly score, training a basic classifier based on the target function to obtain a candidate classifier, and obtaining a trained network model for network intrusion detection; The preprocessing process is: removing invalid data in the data set, removing the row where the data is located when the data is removed; converting all non-numeric data into numeric data by using discrete values; standardizing all data remaining in the data set, and normalizing the extremely unbalanced columns; the label column is processed by different classification requirements, and the processing method of binary classification and multi-classification is adopted; In the NSL-KDD data set, the data set is divided into normal traffic and abnormal traffic through the label column, the normal traffic is marked as 0, and the abnormal traffic is subdivided into 39 categories, and the numbers 1-39 are used for marking; whether the traffic is normal or abnormal is determined by verifying whether it is correct, which is binary classification; whether the traffic is one of the 40 categories is determined by verifying whether it is correct, which is multi-classification; The step of building a target function according to the anomaly score comprises: Obtaining the frequency of the anomaly score corresponding to each traffic data in the anomaly scores of all training samples in the data set, and obtaining the formula representation of the target function based on the frequency of each traffic data as: wherein, denotes taking the minimum value; denotes the number of all training samples; denotes the abnormal score corresponding to the training sample abnormal score of all training samples in the entire dataset the proportion in; denotes the regularization term; denotes the regularization term coefficient; denotes the natural constant; denotes the loss function. 2.The method of claim 1, wherein, The step of preprocessing the data set comprises: Extracting traffic data from unstructured network traffic based on the data set, removing unusable data in the traffic data, and converting non-numeric data in the traffic data into numeric data; Standardizing and normalizing all traffic data, and selecting normal samples in the traffic data to form a candidate set. 3.The method of claim 2, wherein, The step of calculating the minimum loss and the maximum loss of the traffic in the data set based on the trained deep autoencoder comprises: Training the deep autoencoder based on the traffic data in the candidate set, obtaining the loss value of each traffic data in the data set based on the trained deep autoencoder, and obtaining the minimum loss and the maximum loss. 4.The method of claim 1, wherein, The step of obtaining the anomaly score of each traffic data in the data set based on the minimum loss and the maximum loss comprises: For any traffic data, the difference between the loss value corresponding to the traffic data and the minimum loss is calculated as the numerator; the difference between the maximum loss and the minimum loss is calculated as the denominator, and the ratio of the numerator to the denominator is the anomaly score of the traffic data.

5. The method of claim 1, wherein the method is based on a deep autoencoder-based adversarial training to resist generated adversarial samples. The step of obtaining the trained network model further comprises: The most correct flow is selected in each set batch and put into the training set of the deep auto-encoder, and after a preset time period, the oldest flow data is removed and the deep auto-encoder is retrained.

6. The method of claim 5, wherein the method is based on a deep autoencoder-based adversarial training against generated adversarial samples. The filtering of the most correct flow is represented as: ; The normal flow marked as 0 is represented, The minimum anomaly score is represented; the filtering of the oldest flow data is represented as: The removal of the flow with date is represented using the method, for returning the oldest date in the training set .

Citation Information

Patent Citations

  • Thoracic image anomaly detection method based on support vector data description

    CN111242906A

  • Aero-engine gas path performance anomaly detection system based on depth auto-encoder

    CN114742165A