Metalearning framework-based small sample abnormal traffic detection method and system

Through the small sample abnormal traffic detection method based on the meta-learning framework, the problem of sparse sample number and insufficient generalization ability is solved, efficient abnormal traffic detection is achieved, the recognition rate and accuracy, adaptability and robustness are improved, and the filling It fills the gap of small sample learning in the field of abnormal traffic detection.

CN118734134APending Publication Date: 2024-10-01SHIHEZI UNIVERSITY

Patent Information

Application Number
CN202410896092.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The recognition rate of existing abnormal traffic detection models decreases when the number of samples is sparse. It is difficult to learn new network attack characteristics, has insufficient generalization capabilities, and lacks an effective small-sample learning mechanism, resulting in a failure to significantly improve the recognition rate and accuracy.

Method used

Using a small sample abnormal traffic detection method based on the meta-learning framework, through feature extraction and formatting, N-way and K-shot tasks are formed, the meta-training set and the meta-test set are divided, and the support set and query set are used for inner looping During training and testing, model parameters are updated to adapt the model to the overall task and improve the generalization ability and detection accuracy in small sample scenarios.

Benefits of technology

Significantly improve the detection accuracy, reduce the false alarm rate, enhance the adaptability of the model, reduce the cost of data annotation, improve the competitiveness and revenue source of network security products, and fill the gap of small sample learning in the field of abnormal traffic detection. , providing new technical solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118734134A_ABST
    Figure CN118734134A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of small sample abnormal traffic detection, discloses a small sample abnormal traffic detection method and system based on a meta-learning framework, and aims to distinguish novel unknown abnormal traffic with a small number of samples from normal traffic by learning the difference between known abnormal traffic and normal traffic. According to the model provided by the invention, data of different tasks are introduced in a training process, and the tasks are optimized, so that the model can adapt to new tasks more quickly and improve the performance when encountering the new tasks, and the problem that a traditional deep learning model is difficult to identify data of small samples is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of small sample abnormal flow detection, and in particular, relates to a small sample abnormal flow detection method and system based on a meta-learning framework. Background Art

[0002] Chowdhury et al. combined traditional oversampling and undersampling techniques with small sample learning techniques to improve the detection rate of abnormal samples. They first trained a deep CNN to extract intermediate features, and then input the extracted features into SVM and 1-NN classifiers as new datasets. The method achieved good performance through testing on KDD and NSL-KDD datasets. When using 13 layers of extracted features, the test accuracy of the SVM classifier reached 94.62%, and the average classification accuracy on 9 oversampled U2R was the highest. Xu et al. developed an end-to-end DNN based on meta-learning, called FC Net, for small sample network traffic classification tasks. The network consists of two parts, F-Net and C-Net, which are used to extract and compare features, respectively. Since FC-Net obtains sufficient classification prior knowledge from the original dataset, only a small number of labeled samples are needed to achieve better performance in the task of detecting new types of attacks. Hindy et al. proposed a Siamese network model based on a single-sample learning method, which uses similarity comparison to identify new attack categories that have not appeared before. The accuracy on the CICIDS2017 dataset is over 80%, while for KDD Cup'99 and NSL-KDD, the accuracy reaches over 72%. This shows that one-shot learning can identify new types of attacks without retraining and can achieve acceptable accuracy.

[0003] According to analysis, a large part of the samples that the abnormal traffic detection model misidentifies are because the number of samples is small and the deep learning model cannot fully learn their features. New network attacks also have a small number of samples, which leads to a decrease in the model recognition rate. In recent years, meta-learning has achieved remarkable results in the field of small sample learning.

[0004] The existing technology has the following technical problems and defects in the abnormal traffic detection model:

[0005] 1) Scarcity of samples leads to decreased recognition rate: A large part of the samples that the abnormal traffic detection model misidentifies are due to the small number of samples. Deep learning models usually require a large number of samples for training to effectively learn and identify the characteristics of abnormal traffic. However, in actual scenarios, new network attacks and abnormal traffic often have the characteristics of a small number of samples, which makes it impossible for deep learning models to fully learn their characteristics, thus affecting the recognition rate of the model.

[0006] 2) The characteristics of new network attacks are difficult to learn: New network attacks often have unique characteristics that do not exist in existing training data. Therefore, traditional deep learning models have difficulty identifying and detecting these new attacks. This is because the model has not been exposed to these new attack samples during the training process and lacks the corresponding experience and knowledge, resulting in a low recognition rate for new attacks.

[0007] 3) Insufficient generalization ability: Traditional deep learning models have poor generalization ability. Even if they are trained on a large amount of data, it is difficult to achieve good performance on new tasks with a small number of samples. Models often perform well on training data, but when faced with new network attacks that have never been seen before, the recognition rate drops significantly. This problem of insufficient generalization ability is very prominent in practical applications, affecting the reliability and practicality of abnormal traffic detection systems.

[0008] 4) Lack of effective small sample learning mechanism: Existing abnormal traffic detection models lack effective mechanisms to quickly adapt and learn new abnormal traffic features when dealing with small sample learning tasks. Although meta-learning has made some progress in the field of small sample learning, traditional abnormal traffic detection models still fail to fully utilize the advantages of meta-learning, resulting in a failure to significantly improve the recognition rate and accuracy on new tasks.

[0009] From the above analysis, it can be seen that the existing technology has significant technical problems and defects when dealing with abnormal traffic detection tasks with a small number of samples. It is urgent to improve the model's learning and recognition capabilities on small sample tasks by introducing advanced technical means such as meta-learning. Summary of the invention

[0010] In view of the problems existing in the prior art, the present invention provides a small sample abnormal traffic detection method based on a meta-learning framework.

[0011] The present invention is implemented as follows: a small sample abnormal traffic detection method based on a meta-learning framework includes:

[0012] Step 1: Extract features and format the data;

[0013] Step 2: Extract a proper amount of data from the preprocessed data set according to each category, form tasks according to the N-way and K-shot methods, form as many tasks as possible according to the traffic categories, and divide the tasks into meta-training sets and meta-test sets according to the proportion; for each task, divide it into support set and query set;

[0014] Step 3: Use the meta-training set to train the meta-learner. For each task, use the support set to perform an inner loop once or multiple times to adapt it to the current task. After each task is trained, use the query set combined from this group of tasks to test the model. At the same time, use the loss to update the model parameters to make the model more adaptable to the overall task.

[0015] Step 4: Use the meta-test set to evaluate the trained model. For each task, use the support set for one or more inner loops to adapt it to the current task; then use the query set to test the performance of the model.

[0016] Another object of the present invention is to provide a small sample abnormal traffic detection system based on a meta-learning framework, comprising:

[0017] Data preprocessing module, used to extract features and format data;

[0018] The meta-task establishment module is used to extract an appropriate amount of data from the pre-processed data set according to each category, form tasks according to the N-way and K-shot methods, form as many tasks as possible according to the mastered traffic categories, and divide the tasks into meta-training sets and meta-test sets according to the proportion; for each task, it is divided into support sets and query sets;

[0019] The meta-learning model training module is used to train the meta-learner using the meta-training set. For each task, the support set is used for one or more inner loops to adapt it to the current task. After each task is trained, the model is tested using the query set merged from this group of tasks, and the loss is used to update the model parameters to make the model more adaptable to the overall task.

[0020] The meta-learning test module is used to evaluate the trained model using the meta-test set. For each task, the support set is used for inner loop one or more times to adapt it to the current task; then the query set is used to detect the performance of the model.

[0021] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the small sample abnormal traffic detection method based on the meta-learning framework.

[0022] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the small sample abnormal traffic detection method based on a meta-learning framework.

[0023] Another object of the present invention is to provide an information data processing terminal, which is used to implement the small sample abnormal traffic detection system based on the meta-learning framework.

[0024] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0025] First, the present invention uses the advantages of meta-learning in small sample tasks, proposes a meta-learning abnormal traffic detection model based on optimization, and uses the IoTID20 dataset and CICIDS-2017 dataset to construct a meta-learning dataset to train and test the model. By learning the difference between known abnormal traffic and normal traffic, it is possible to distinguish new unknown abnormal traffic with a small number of samples from normal traffic.

[0026] The model proposed in the present invention introduces data from different tasks during the training process and optimizes these tasks. It can adapt more quickly and improve performance when encountering new tasks, thus solving the problem that traditional deep learning models have difficulty recognizing small sample data.

[0027] Second, the expected benefits and commercial value of the technical solution of the present invention after transformation are:

[0028] 1. Improve detection accuracy

[0029] Through small sample learning technology, the model can be effectively trained with only a small amount of labeled data, accurately identifying abnormal traffic in the network. This increase in accuracy is crucial for timely detection and prevention of potential network attacks.

[0030] 2. Reduce false alarm rate

[0031] Compared with traditional methods, models based on small sample learning can more accurately distinguish normal traffic from abnormal traffic, thereby significantly reducing false alarm rates. This helps reduce unnecessary alarms and response costs and improves the overall efficiency of the system.

[0032] 3. Enhance adaptability

[0033] As the network environment and attack methods continue to change, the model can quickly adapt to new threat types through small sample learning. This rapid adaptability allows the model to remain efficient and effective in complex and changing network environments.

[0034] 4. Reduce data annotation costs

[0035] Small sample learning technology reduces the need for a large amount of labeled data, thereby reducing the cost and time of data annotation. This is especially important in scenarios where it is difficult to obtain a large amount of labeled data.

[0036] Commercial value:

[0037] 1. Improve product competitiveness

[0038] Integrating the network abnormal traffic detection model based on small sample learning into network security products can significantly improve the detection capability and accuracy of the products, thereby enhancing the market competitiveness of the products.

[0039] 2. Increase income sources

[0040] By providing network anomaly traffic detection services or products based on small sample learning, enterprises can open up new sources of revenue. This can not only increase sales, but also increase customer stickiness and loyalty.

[0041] 3. Promote technological innovation

[0042] As an emerging machine learning method, the application of small sample learning in the field of network security is still in the stage of continuous exploration and improvement. Therefore, continuous investment in R&D and technological innovation can bring long-term technological and competitive advantages to enterprises.

[0043] The present invention introduces the meta-learning method into the field of abnormal traffic detection, filling a small gap in the domestic field of abnormal traffic detection for small sample learning.

[0044] Third, the present invention proposes a detection method based on a meta-learning framework to address the problem of detecting abnormal traffic with small samples in the prior art. Through the carefully designed meta-learning task construction and training strategy, the present invention effectively improves the generalization ability and detection accuracy of the model in small sample scenarios.

[0045] Existing technologies often perform poorly in small sample scenarios because it is difficult for the model to learn enough features from limited data to represent and distinguish different traffic categories. However, this invention introduces a meta-learning framework, which enables the model to be trained on multiple different tasks, thereby learning a universal feature extraction and classification method that has good generalization capabilities for new and unseen tasks.

[0046] The significant technical progress of the present invention is reflected in many aspects. First, through feature extraction and formatting processing, the present invention can more effectively utilize limited data resources. Second, by constructing a variety of meta-learning tasks, the present invention enables the model to be trained in different task scenarios, thereby improving its adaptability and robustness. Finally, through the inner loop and query set testing, the present invention can update the model parameters in real time, making it more adaptable to the overall task and further improving the detection accuracy.

[0047] In summary, the present invention proposes a novel and effective small sample abnormal traffic detection method by introducing a meta-learning framework. This method not only solves the problems existing in the prior art, but also achieves significant technological progress and provides new ideas and solutions for the field of network traffic detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a flow chart of a small sample abnormal traffic detection method based on a meta-learning framework provided in an embodiment of the present invention.

[0049] Figure 2 It is a structural block diagram of a small sample abnormal traffic detection model based on a meta-learning framework provided in an embodiment of the present invention.

[0050] Figure 3 It is a flow chart of the optimization-based meta-learning method provided by an embodiment of the present invention.

[0051] Figure 4 It is a flow chart of an algorithm provided by an embodiment of the present invention.

[0052] Figure 5 It is an outer loop update mode diagram of the experimental design provided by an embodiment of the present invention.

[0053] Figure 6 It is a diagram of the classification results of each specific task of the IoTID20FS data set grouping experiment provided by an embodiment of the present invention.

[0054] Figure 7 It is a diagram of the classification results of each specific task of the CICIDS-2017FS data set grouping experiment provided by an embodiment of the present invention.

[0055] Figure 8 It is a diagram showing the effect of use provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0057] Example 1: Enterprise Network Security Monitoring System

[0058] A large enterprise faces cybersecurity threats and needs to detect and defend against abnormal network traffic to protect internal network security. Traditional traffic detection methods rely on a large amount of training data and predefined rules, which makes it difficult to effectively respond to new and unknown network attacks.

[0059] 1. Data preprocessing: The traffic data in the enterprise network is first processed by the data preprocessing module for feature extraction and formatting. For example, the source IP, destination IP, port number, protocol type, packet size, traffic rate and other features of the network packet are extracted.

[0060] 2. Meta-task establishment: According to the category of network traffic (such as normal traffic, DDoS attack, malware propagation, data leakage, etc.), extract a proper amount of data from the pre-processed data set to form N-way, K-shot tasks. For example, select 5 traffic types (5-way), select 5 samples (5-shot) for each type, and form multiple tasks.

[0061] 3. Model training: Use the meta-training set generated by the meta-task building module to train the meta-learner. Each task is divided into a support set and a query set. The support set is used for inner loop training to adapt the model to the current task. Then the query set is used to test the model and update the model parameters.

[0062] 4. Model evaluation: Use the meta-test set to evaluate the trained model and test the performance of the model under different tasks to ensure that the model can accurately detect abnormal traffic.

[0063] Through the meta-learning framework, the small sample abnormal traffic detection model can quickly adapt to new and unknown network attacks with only a small number of training samples, significantly improving the detection effect and response speed of the enterprise network security monitoring system and reducing the occurrence of network security incidents.

[0064] Example 2: Anomaly detection in intelligent industrial control systems

[0065] In intelligent industrial control systems, various sensors and control devices generate a large amount of data streams, which need to be monitored in real time to detect and prevent abnormal situations. Traditional methods have difficulty in accurately identifying abnormal traffic due to the limited number of samples and complex environment.

[0066] 1. Data preprocessing: Extract features and format the sensor data and control command data in the intelligent industrial control system. For example, extract features such as sensor readings, timestamps, device IDs, and operating status.

[0067] 2. Meta-task establishment: According to the categories of sensor and control data (such as normal operation, equipment failure, data loss, network delay, etc.), extract an appropriate amount of data from the preprocessed data set to form N-way, K-shot tasks. For example, select 4 data types (4-way) and select 10 samples (10-shot) for each type to form multiple tasks.

[0068] 3. Model training: Use the meta-training set generated by the meta-task building module to train the meta-learner. Each task is divided into a support set and a query set. The support set is used for inner loop training to adapt the model to the current task. Then the query set is used to test the model and update the model parameters.

[0069] 4. Model evaluation: Use the meta-test set to evaluate the trained model and test the performance of the model under different tasks to ensure that the model can accurately detect abnormal traffic in industrial control systems.

[0070] Through the meta-learning framework, the small sample abnormal traffic detection model can quickly adapt to and identify various abnormal situations in intelligent industrial control systems, ensure the safe and stable operation of the system, improve the efficiency and accuracy of anomaly detection, and reduce downtime and losses caused by abnormal situations.

[0071] like Figure 1 As shown, a small sample abnormal traffic detection method based on a meta-learning framework provided by an embodiment of the present invention includes the following steps:

[0072] S101, extracting features and formatting the data;

[0073] S102, extract appropriate amount of data from the pre-processed data set according to each category, form tasks according to the N-way, K-shot method, form as many tasks as possible according to the mastered traffic categories, divide the tasks into meta-training set and meta-test set according to the proportion; for each task, divide it into support set and query set;

[0074] S103, using the meta-training set to train the meta-learner, for each task, use the support set to perform an inner loop once or multiple times to adapt it to the current task; after each task is trained, the model is tested using the query set merged from this group of tasks, and the model parameters are updated using the loss to make the model more adaptable to the overall task;

[0075] S104, use the meta-test set to evaluate the trained model. For each task, use the support set to perform an inner loop once or multiple times to adapt it to the current task; then use the query set to detect the performance of the model.

[0076] like Figure 2 As shown, a small sample abnormal traffic detection system based on a meta-learning framework provided by an embodiment of the present invention includes:

[0077] Data preprocessing module, used to extract features and format data;

[0078] The meta-task establishment module is used to extract an appropriate amount of data from the pre-processed data set according to each category, form tasks according to the N-way and K-shot methods, form as many tasks as possible according to the mastered traffic categories, and divide the tasks into meta-training sets and meta-test sets according to the proportion; for each task, it is divided into support sets and query sets;

[0079] The meta-learning model training module is used to train the meta-learner using the meta-training set. For each task, the support set is used for one or more inner loops to adapt it to the current task. After each task is trained, the model is tested using the query set merged from this group of tasks, and the loss is used to update the model parameters to make the model more adaptable to the overall task.

[0080] The meta-learning test module is used to evaluate the trained model using the meta-test set. For each task, the support set is used for inner loop one or more times to adapt it to the current task; then the query set is used to detect the performance of the model.

[0081] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the small sample abnormal traffic detection method based on the meta-learning framework.

[0082] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to perform the steps of the small sample abnormal traffic detection method based on a meta-learning framework.

[0083] Another object of the present invention is to provide an information data processing terminal, which is used to implement the small sample abnormal traffic detection system based on the meta-learning framework.

[0084] The present invention is specifically implemented:

[0085] 1.1 Meta-learning abnormal traffic detection model based on optimization

[0086] 1.1.1 Overall Model Architecture

[0087] The problem of identifying new types of abnormal traffic with small samples can be summarized as follows: a large number of known types of abnormal traffic and normal traffic have been mastered, and a model has been trained to recognize the difference between abnormal traffic and normal traffic. When a new type of abnormal traffic appears, the abnormal traffic characteristics of this category can be quickly learned through this accumulated experience, so as to correctly identify the abnormal traffic of this category. In recent years, optimization-based meta-learning has achieved remarkable results on small sample tasks. Optimization-based meta-learning aims to accelerate the learning process on new tasks by gaining experience and knowledge from past learning tasks. Therefore, the network abnormal traffic detection model that uses this concept to construct a meta-learning framework is very suitable for the problem scenario. The present invention uses the advantages of meta-learning in small sample tasks, proposes an optimization-based meta-learning abnormal traffic detection model, and uses the IoTID20 dataset and the CICIDS-2017 dataset to construct a meta-learning dataset to train and test the model. Figure 2 Shown is the basic framework of the abnormal traffic detection model based on the meta-learning framework.

[0088] (1) Data preprocessing module: extract features and format data.

[0089] (2) Meta-task establishment module: First, extract an appropriate amount of data from the pre-processed data set according to each category, then form tasks according to the N-way and K-shot methods, form as many tasks as possible according to the mastered traffic categories, and then divide the tasks into meta-training sets and meta-test sets according to the proportion. For each task, it also needs to be divided into a support set and a query set.

[0090] (3) Meta-learning model training module: Use the meta-training set to train the meta-learner (the dual-backbone abnormal traffic detection network proposed in Chapter 3 is used as the meta-learner in this invention). For each task, use the support set to perform an inner loop once or multiple times to adapt it to the current task. After each task is trained, the model is tested using the query set merged from this group of tasks, and the loss is used to update the model parameters to make the model more adaptable to the overall task.

[0091] (4) Meta-learning test module: Use the meta-test set to evaluate the trained model. For each task, use the support set for one or more inner loops to adapt it to the current task. Then use the query set to test the performance of the model.

[0092] 1.1.2 Meta-learning dataset establishment module

[0093] First, in order to obtain more categories to generate more diverse tasks, this paper re-preprocesses the pcap package according to the subcategory labels of the IoTID20 dataset, and the obtained data categories are shown in Table 4-1.

[0094] Table 4-1 Datasets processed based on subcategories

[0095]

[0096] The goal of the present invention is to train a model that can distinguish between abnormal network traffic and normal traffic of a small sample, so the task can be set to 2way, that is, normal and abnormal (each task consists of normal class traffic and some abnormal traffic). Therefore, some data is extracted from the data set according to the type, and the normal traffic is encoded as 0, and the abnormal traffic is encoded as 1. The IoTID20FS data set is reconstructed. The number and encoding of each sample are shown in Table 4-2. According to the same rules, the CICIDS-2017 data set is reconstructed to obtain the CICIDS-2017FS data set as shown in Table 4-3. For the reconstructed data set, the support set and the query set are divided into 8:2.

[0097] Table 4-2 Composition of IoTID20FS dataset

[0098]

[0099] Table 4-3 CICIDS-2017FS dataset

[0100]

[0101]

[0102] 1.1.3 Optimization-based Meta-Learning Process

[0103] like Figure 3 Shown is an optimization-based meta-learning method process designed by the present invention.

[0104] In the first step, the dataset is first divided into a training task and a test task. The training task is then further subdivided into a support set and a query set to support the experimental paradigm of few-shot learning. The support set is used to learn specific knowledge for each task, while the query set is used to evaluate how this knowledge generalizes to new data. Then the network structure is defined (the network structure used here is the model proposed in Chapter 3, which is modified to binary classification in the classification module) and the network parameters are initialized.

[0105] The second step is to optimize the original parameters on the support set of task 1, calculate the loss of task 1, and find the gradient of . Based on the learning rate of task 1, multiply it by the gradient update to get , which can be performed once or multiple times for each task.

[0106] In the third step, the second step is repeated until all tasks in the batch are trained.

[0107] Step 4: Combine the query sets of all tasks in the batch into a set. Use this set to calculate the overall task loss value and the gradient. Use this gradient to multiply by the meta-step size to update.

[0108] In the fifth step, repeat the process from step 2 to step 4 until a batch of task training is completed.

[0109] The sixth step is to apply the obtained network parameters to the support set of the test task for further training. The key is to use the support set of these test tasks to make detailed adjustments to the network parameters, that is, fine-tuning.

[0110] In the seventh step, the fine-tuned meta-learning model is evaluated using the query set of the test task.

[0111] 1.1.4 Algorithm Framework

[0112] For a function that sets the initial model parameters to , when the model is fine-tuned for a new task, the model parameters are updated from , where the updated parameters are calculated based on the gradient descent of the task. When performing a gradient update:

[0113]

[0114] The parameters of the model are updated through optimization, and the goal of meta-learning is:

[0115]

[0116] In this scenario, meta-optimization is performed by updating the model parameters, and the meta-objective is calculated based on these updated parameters. The strategy of meta-learning is to continuously adjust the initial model parameters on different tasks so that the model can effectively adapt to new unknown tasks with only a few gradient update steps.

[0117] The implementation of meta-optimization across different tasks relies on the stochastic gradient descent (SGD) method. The specific update process is as follows:

[0118]

[0119] Where, is the meta-step length.

[0120] The whole algorithm process is as follows Figure 4 shown.

[0121] The relevant parameters of the experimental training model are shown in Tables 4-4 and 4-5.

[0122] Table 4-4 Relevant parameters involved in training

[0123]

[0124] Table 4-5 Hyperparameter settings

[0125]

[0126] 1.2 Experiment and analysis

[0127] 1.2.1 Determination of the external loop parameter update method

[0128] The experiment designed three ways to update the outer loop parameters, namely immediate update, global overall update, and global random update. The specific update forms are as follows: Figure 5 shown.

[0129] The immediate update mode means that every time the model calculates the loss value through the support set of a task and updates the parameters through the base learning rate, it immediately uses the query set of the task to calculate the loss value and updates the parameters again through the meta-learning rate. The global overall update mode means that after each batch of tasks (each task will use its support set to update the model parameters), the query set of the set of the batch task group is used to calculate the loss value and update the parameters through the meta-learning rate. The difference between the global random update mode and the global overall update mode is that only one query set in this group of tasks is used for parameter update. This paper trains and tests the three networks with different structures while keeping other parameters unchanged, and compares the detection accuracy under different structures, as shown in Table 4-6.

[0130] Table 4-6 Accuracy of different modes

[0131]

[0132] According to the experimental data, the update effect of the outer loop using the global overall update mode is better. The immediate update mode emphasizes the optimization of the current task, which makes the overall generalization ability of the model for new tasks poor. Compared with the global random update method, the global overall update can learn the difference between normal traffic and abnormal traffic, rather than normal traffic and a certain type of abnormal traffic. Therefore, the model adopts the global overall update mode to update the parameters of the outer loop.

[0133] 1.2.2 Determination of the number of inner loop steps

[0134] The number of inner loop steps refers to the number of times the model updates parameters on the support set of each task. The number of inner loop steps can be 1 or more, but too many steps will cause the model to overfit the current task, making the model less effective on new tasks. Too few steps will cause the model to fail to fully learn the characteristics of the traffic. Therefore, a comparative test was set up for the number of inner loop steps to compare the detection accuracy under different structures, as shown in Table 4-7.

[0135] Table 4-7 Accuracy of different synchronization numbers

[0136]

[0137] It can be seen from the experiment that the inner loop works better when the number of steps is 3. When the number of steps in the inner loop is small (for example, 1 step), the model is not fully learned and cannot effectively adapt to or learn new knowledge from the small number of samples provided, which leads to underfitting. When the number of steps is too many (for example, 5 steps), the model over-adapts to these samples, resulting in overfitting and a decrease in generalization ability. The key goal of meta-learning is to enable the model to quickly adapt to new tasks using as little data and iterative steps as possible. In some cases, too many iterative steps will cause the model to be overly dependent on a small amount of training data, thereby reducing the flexibility of the model when facing new samples. In this experiment, setting it to 3 steps just provides a balance so that the model is neither underfitting nor overfitting. Therefore, the present invention selects 3 steps as the number of inner loop steps of the model.

[0138] 1.2.3 Classification Experiment

[0139] In the experiment of using meta-learning to classify abnormal traffic, the small sample task is divided into three cases: 2way-1shot, 2way-5shot and 2way-10shot. The relevant test accuracy (Accuracy) and detection rate (DR) results are shown in Table 4-8.

[0140] Table 4-8 Experimental accuracy under different sample sizes

[0141]

[0142] As can be seen from Table 4-8, 2way-10shot has higher accuracy and detection rate than 2way-1shot and 2way-5shot, which means that when the number of samples in a task increases, the model can learn features better, especially when entering the meta-test phase, more test samples in the new task can make the model further fit the new task, thus achieving better results.

[0143] In order to determine whether the model learns the difference between normal traffic and abnormal traffic rather than a specific type, the experiment changed the types of meta-training tasks and meta-testing tasks, and formed four groups of control experiments in the two data sets to verify the effectiveness of the model, as shown in Tables 4-9 and 4-10.

[0144] Table 4-9 IoTID20FS dataset grouping experimental parameters

[0145]

[0146] Table 4-10 CICIDS-2017FS dataset grouping experimental parameters

[0147]

[0148] The classification results of each specific task in the group experiment are as follows: Figure 6 , Figure 7 shown.

[0149] analyze Figure 6 , Figure 7 We can see that when changing the training task group and the test task group, the overall accuracy is not greatly affected, which will change the order of parameter updates, but because the meta-learning model aims to learn the mode of parameter updates, the model will try to adjust the parameters on the test task to adapt to the new task. Therefore, the meta-learning framework gives the model a strong generalization ability for the differences between tasks, so that when the training task group and the test task group are exchanged, the model can still effectively learn how to quickly adapt to new tasks.

[0150] The overall results of the group experiments are shown in Table 4-11 and Table 4-12:

[0151] Table 4-11 Overall results of CICIDS-2017FS dataset grouping experiments

[0152]

[0153] Table 4-12 Overall results of IoTID20FS dataset grouping experiment

[0154]

[0155]

[0156] From the analysis of Table 4-11, it can be concluded that the accuracy of the results obtained by Experiments I, III, and IV is generally similar, but the effect of Experiment II is obviously lower than that of the other three groups. This is because Experiment II set an extreme situation when setting the meta-training task group. All tasks used for training are Mirai categories, which leads to the overall overfitting of the model to the Mirai category for abnormal recognition, while the test task group does not contain any abnormal traffic in the Mirai category, resulting in slightly lower classification accuracy. At the same time, as a control, Experiment I exchanged the training task group and the test task group of Experiment II, and the trained model can better identify the Mirai-class abnormal traffic that has never appeared. Combined with Table 4-12, we can see that when the abnormal types of the task group used for training are more diverse, the accuracy of the test task will tend to be stable. This further illustrates that the model learns the difference between the overall abnormal and normal traffic, rather than the characteristics of a specific type of abnormal traffic.

[0157] In order to demonstrate the effectiveness of the proposed model in abnormal traffic detection, this paper conducted a comparative experimental study and selected the IoTID20FS dataset and CICIDS-2017FS dataset as evaluation platforms. It also conducted comparative experiments with several classic models. The experimental results are shown in Tables 4-13 and 4-14.

[0158] Table 4-13 Experimental results of each model of IoTID20FS dataset

[0159]

[0160] Table 4-14 Experimental results of various models of CICIDS-2017FS dataset

[0161]

[0162] The data provided in Tables 4-13 and 4-14 show that the meta-learning model exceeds the mainstream machine learning and deep learning models in terms of performance indicators. This shows that when the number of samples is limited, the meta-learning model can not only effectively perform classification tasks, but also achieve higher values ​​in classification accuracy. Because deep learning models usually rely on a large number of data samples for effective training, and when data is limited, this dependence becomes an obvious shortcoming. The model proposed in the present invention introduces data from different tasks during the training process and optimizes these tasks. It can adapt faster and improve performance when encountering new tasks, solving the problem that traditional deep learning models are difficult to recognize data from small samples.

[0163] 1. Specific application fields or related products of the present invention.

[0164] 1. Industrial safety monitoring system

[0165] Function: Integrate meta-learning algorithms to monitor network traffic in industrial CPS in real time, identify and respond to abnormal behaviors, and protect system security.

[0166] Features: high accuracy, low false alarm rate, able to handle complex and changing industrial environments.

[0167] 2. Server security solutions

[0168] Function: Provide comprehensive network traffic monitoring and anomaly detection services for servers to detect and prevent potential network attacks in a timely manner.

[0169] Features: Supports small sample learning, can extract key features from small amounts of data, and improve detection efficiency.

[0170] 3. Network security equipment (such as firewalls, intrusion detection equipment, etc.)

[0171] Function: Built-in meta-learning-based anomaly detection module to perform in-depth analysis of data packets entering and leaving the network to identify and block malicious traffic.

[0172] Features: Intelligent, automated, and able to respond to ever-changing network threats.

[0173] 2. Relevant evidence of the technical effects obtained by the embodiments of the present invention.

[0174] The present invention proposes a meta-learning abnormal traffic detection model based on optimization. In order to simulate the characteristics of small sample tasks, the specific categories of abnormal traffic in the IoTID20 dataset were obtained, and the small sample datasets IoTID20FS and CICIDS-2017FS were reconstructed. Various parameters were established through experiments, and the reliability of the model was verified by grouping experiments by replacing the training task group and the test task group. Experiments show that the model constructed using this method has a good effect on the identification of new abnormal traffic. On the IoTID20FS dataset, the accuracy of 2way-5shot reached 91.25%, and the accuracy of 2way-10shot reached 93.75%. It is superior to traditional machine learning algorithms and deep learning algorithms.

[0175] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0176] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A small sample abnormal traffic detection method based on a meta-learning framework, characterized in that: The following steps are involved: Data preprocessing: extract features and format the original network traffic data to form a preprocessed data set; Meta-task establishment: Extract appropriate amount of data from the preprocessed dataset, and form multiple tasks according to the N-way and K-shot methods. Each task includes a support set and a query set, and the task is divided into a meta-training set and a meta-test set. Meta-learning model training: Use the meta-training set to train the meta-learning model. For each task, use the support set for multiple inner loops to adapt it to the current task. Then use the query set to test the model, calculate the loss and update the model parameters to make the model more adaptable to the overall task. Meta-learning model testing: Use the meta-test set to evaluate the trained model. For each task, use the support set for multiple inner loops to adapt it to the current task, and then use the query set to detect model performance.

2. The method according to claim 1, characterized in that The meta-task establishment step further comprises: Classify the preprocessed data, extract appropriate amount of data from each category, and build multiple tasks. Each task includes normal traffic and abnormal traffic. Normal traffic is coded as 0 and abnormal traffic is coded as 1. The task is divided into a support set and a query set. The support set is used for inner loop training of the model, and the query set is used for testing the model.

3. The method according to claim 1, characterized in that The meta-learning model training step further includes: Perform multiple inner loop training on the support set of each task, calculate the loss value of the task, and update the model parameters; After completing the task training of a batch, the query sets of all tasks in the batch are combined to calculate the overall task loss value, and the model parameters are updated based on the loss value.

4. The method according to claim 1, characterized in that The meta-learning model testing step further includes: Use the meta-test set to evaluate the trained model. For each task, use the support set to perform an inner loop multiple times to adapt the model to the current task. Use the query set to test the model performance and evaluate the generalization ability and detection accuracy of the model on new tasks.

5. A small sample abnormal traffic detection system based on a meta-learning framework for implementing the abnormal traffic detection method according to claim 1, characterized in that: The small sample abnormal traffic detection system based on the meta-learning framework includes: Data preprocessing module, used to extract features and format the input traffic data; The meta-task establishment module is used to extract an appropriate amount of data from the preprocessed data set according to classification, and to form meta-learning tasks according to the N-way and K-shot methods. Each task includes a support set and a query set. The meta-learning model training module uses the support set to perform inner loop training on the meta-learner, and uses the query set to test the model, and updates the model parameters through the loss value; The meta-learning test module is used to fine-tune the trained model using the support set of the test task and evaluate the performance of the model using the query set; Among them, the meta-learner adopts a dual-backbone abnormal traffic detection network structure and improves the accuracy of abnormal traffic detection on small sample tasks through an optimized meta-learning method.

6. The system according to claim 5, characterized in that The data preprocessing module further includes sub-classifying the data set to generate more diverse meta-learning tasks and constructing a meta-learning data set including normal traffic and multiple abnormal traffic.

7. The system according to claim 5, characterized in that The meta-learning model training module updates the model parameters in the outer loop in a global overall update manner, that is, after completing the training of each batch of tasks, the loss value is calculated using the query set of the batch of task groups and the model parameters are updated using the meta-learning rate.

8. The system according to any one of claims 5 to 7, characterized in that The system also includes a classification experiment module, which is used to set meta-learning tasks with different sample numbers and evaluate the model's abnormal traffic detection accuracy and detection rate under different task settings, so as to verify the model's effective identification ability for small sample abnormal traffic.

9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the small sample abnormal traffic detection method based on the meta-learning framework as claimed in claim 1.

10. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the small sample abnormal traffic detection system based on the meta-learning framework as described in claim 5.

Citation Information

Patent Citations

  • Meta-learning-based network intrusion detection method in small sample scene

    CN110808945A

  • Metalearning-based small sample Wi-Fi camouflage attack detection method and system

    CN113938889A

  • Collaborative filtering recommendation algorithm based on improved user similarity

    CN114722289A

  • Metalearning-based small sample malicious network traffic detection method

    CN115174272A

  • Network intrusion detection method based on meta learning

    CN115577746A

Cited By

  • Metalearning anomaly detection method and system under data full life cycle

    CN120579100A