Robust traffic classification method and device combining anomaly detection and random smoothing
By using a three-level cascaded classifier to process network traffic, it effectively identifies and classifies both strong and covert adversarial traffic, solving the problem of insufficient defense capabilities in existing technologies, reducing computational overhead, and improving classification accuracy and robustness.
Patent Information
- Application Number
- CN202511023885.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies cannot effectively defend against strong and covert adversarial traffic, and suffer from low traffic classification accuracy and high computational overhead.
A first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing are constructed to perform three-level cascaded classification of network traffic. Strong adversarial traffic is filtered out by the anomaly score model, hidden adversarial traffic is identified by multi-model classification consistency, and traffic that is difficult to identify is processed by random smoothing.
It achieves robust filtering of strong adversarial traffic and robust classification of covert adversarial traffic, reducing computational and time overhead and improving network security and defense capabilities.
Smart Images

Figure CN120929908A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network traffic classification technology, and in particular to a robust traffic classification method and apparatus that combines anomaly detection and random smoothing. Background Technology
[0002] With the rapid development of internet technology, the security and reliability of network services have received increasing attention. Intrusion detection and timely blocking mechanisms, as important means of ensuring network security, can effectively improve the stability of network services and prevent data leaks and property losses caused by attacks. As adversarial traffic perturbation technology in artificial intelligence continues to evolve, attackers can significantly reduce the accuracy of traffic classifiers by injecting carefully designed adversarial perturbations into raw network traffic, whether explicit or implicit, thereby bypassing security detection mechanisms and creating security vulnerabilities.
[0003] In related technologies, defense against adversarial traffic mainly relies on two types of methods: anomaly detection and random smoothing. Anomaly detection methods are typically used to identify and filter strong adversarial traffic containing obvious disturbances, but they struggle to effectively distinguish between covert adversarial traffic and normal traffic without adversarial disturbances, resulting in a high false negative rate. Random smoothing methods, on the other hand, improve robustness against covert adversarial disturbances by randomizing the input traffic, but they still suffer from classification errors when facing strong adversarial disturbances, and they also introduce significant computational and time overhead for traffic classification. Summary of the Invention
[0004] This application provides a robust traffic classification method, apparatus, electronic device, and storage medium that combines anomaly detection and random smoothing to solve the problems in related technologies that cannot simultaneously defend against strong adversarial traffic and covert adversarial traffic, and that have low traffic classification accuracy and high overhead.
[0005] The first aspect of this application provides a robust traffic classification method combining anomaly detection and stochastic smoothing, comprising the following steps: constructing a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on stochastic smoothing to obtain network traffic requiring robust traffic classification; inputting the network traffic into the first anomaly detection classifier, which outputs a first-level traffic classification result, wherein the first anomaly detection classifier processes the network traffic based on the anomaly score detection result of the anomaly score model; inputting the undetermined traffic in the first-level traffic classification result into the second anomaly detection classifier, which outputs a second-level traffic classification result, wherein the second anomaly detection classifier processes the undetermined traffic in the first-level traffic classification result based on the consistency of classification results from multiple traffic classification models; inputting the covert adversarial traffic in the second-level traffic classification result into the robust classifier, which outputs a robust classification of the network traffic, wherein the robust classifier processes the covert adversarial traffic in the second-level traffic classification result based on the base traffic classifier.
[0006] Optionally, the processing flow of the first anomaly detection classifier includes: inputting network traffic into the anomaly score model, the anomaly score model outputting anomaly scores; filtering out strong adversarial traffic in the network traffic whose anomaly scores are higher than the score threshold; and treating network traffic whose anomaly scores are lower than the score threshold as pending traffic.
[0007] Optionally, before inputting network traffic into the first anomaly detection classifier, the method further includes: obtaining a training dataset, which includes traffic samples without adversarial perturbations; and training anomaly score models using the traffic samples from the training dataset.
[0008] Optionally, the processing flow of the second anomaly detection classifier includes: inputting the undetermined traffic from the first-level traffic classification results into multiple traffic classification models; identifying normal traffic with consistent classification results, and using the classification results as the final classification result of the normal traffic, while treating the other part of the undetermined traffic with inconsistent classification results as covert countermeasure traffic.
[0009] Optionally, before inputting the first-level traffic classification result into the second anomaly detection classifier, the method further includes: obtaining a training dataset, which includes traffic samples without adversarial perturbations; and training multiple traffic classification models using the traffic samples in the training dataset, wherein the multiple traffic classification models are traffic classification models with different model architectures and / or traffic representations.
[0010] Optionally, the robust classifier's processing flow includes: for each traffic in the adversarial traffic of the second-level traffic classification result, multiple smooth samples are generated by adding random covert adversarial perturbations; each smooth sample is input into the base traffic classifier, the base traffic classifier outputs the classification result, and the classification result that appears most frequently among all smooth sample classification results is taken as the final classification result of the traffic.
[0011] Optionally, before inputting the covert adversarial traffic from the second-level traffic classification results into the robust classifier, the method further includes: obtaining a training dataset, which includes traffic samples containing covert adversarial perturbations; and training a base traffic classifier using the traffic samples from the training dataset.
[0012] A second aspect of this application provides a robust traffic classification device combining anomaly detection and random smoothing, comprising: an acquisition module for constructing a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing, to acquire network traffic requiring robust traffic classification; a first classification module for inputting network traffic into the first anomaly detection classifier, which outputs a first-level traffic classification result, wherein the first anomaly detection classifier processes the network traffic based on the anomaly score detection result of the anomaly score model; a second classification module for inputting undetermined traffic from the first-level traffic classification result into the second anomaly detection classifier, which outputs a second-level traffic classification result, wherein the second anomaly detection classifier processes the undetermined traffic from the first-level traffic classification result based on the consistency of classification results from multiple traffic classification models; and a third classification module for inputting covert adversarial traffic from the second-level traffic classification result into the robust classifier, which outputs a robust classification of the network traffic, wherein the robust classifier processes the covert adversarial traffic from the second-level traffic classification result based on a base traffic classifier.
[0013] Optionally, the processing flow of the first anomaly detection classifier includes: inputting network traffic into the anomaly score model, the anomaly score model outputting anomaly scores; filtering out strong adversarial traffic in the network traffic whose anomaly scores are higher than the score threshold; and treating network traffic whose anomaly scores are lower than the score threshold as pending traffic.
[0014] Optionally, the robust traffic classification device combining anomaly detection and random smoothing further includes: a first training module for acquiring a training dataset before inputting network traffic into the first anomaly detection classifier, the training dataset including traffic samples without adversarial perturbations; and training an anomaly score model using the traffic samples from the training dataset.
[0015] Optionally, the processing flow of the second anomaly detection classifier includes: inputting the traffic to be determined into multiple traffic classification models; detecting the classification results of the multiple traffic classification models, identifying normal traffic with consistent classification results, and using the classification results as the final classification result of the normal traffic, while treating the other part of the traffic to be determined with inconsistent classification results as covert countermeasure traffic.
[0016] Optionally, the robust traffic classification device combining anomaly detection and random smoothing further includes: a second training module, used to acquire a training dataset before inputting the first-level traffic classification result into the second anomaly detection classifier, the training dataset including traffic samples without adversarial perturbations; and to train multiple traffic classification models using the traffic samples in the training dataset, wherein the multiple traffic classification models are traffic classification models with different model architectures and / or traffic representations.
[0017] Optionally, the robust classifier's processing flow includes: for each traffic in the adversarial traffic of the second-level traffic classification result, multiple smooth samples are generated by adding random covert adversarial perturbations; each smooth sample is input into the base traffic classifier, the base traffic classifier outputs the classification result, and the classification result that appears most frequently among all smooth sample classification results is taken as the final classification result of the traffic.
[0018] Optionally, the robust traffic classification device combining anomaly detection and random smoothing further includes: a third training module for acquiring a training dataset, which includes traffic samples containing covert adversarial perturbations, before inputting the covert adversarial traffic from the second-level traffic classification results into the robust classifier; and training a base traffic classifier using the traffic samples from the training dataset.
[0019] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the robust traffic classification method of joint anomaly detection and random smoothing as described in the above embodiments.
[0020] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the robust traffic classification method of joint anomaly detection and random smoothing as described in the above embodiments.
[0021] Therefore, this application has the following beneficial effects:
[0022] This application embodiment constructs a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to perform three-level cascaded classification of network traffic. This achieves effective identification and classification of strong adversarial and covert adversarial traffic in network traffic. Compared with a single anomaly detection method, this application can simultaneously achieve filtering of strong adversarial traffic and robust classification of covert adversarial traffic. Moreover, the first two levels of anomaly detection significantly reduce the amount of data that needs to be processed by random smoothing, thereby reducing the computational and time overhead of traffic classification.
[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0025] Figure 1 This is a flowchart of a robust traffic classification method combining joint anomaly detection and random smoothing, provided according to an embodiment of this application.
[0026] Figure 2 This is a schematic diagram illustrating the process of a first-level traffic classification using an anomaly detection classifier based on anomaly scores according to an embodiment of this application.
[0027] Figure 3 This is a schematic diagram illustrating the process of a multi-model classification consistency-based anomaly detection classifier completing a second-level traffic classification according to an embodiment of this application.
[0028] Figure 4 This is a schematic diagram illustrating the process of completing the third-level traffic classification using a robust classifier based on random smoothing according to an embodiment of this application.
[0029] Figure 5 This is an overall example diagram of a robust traffic classification method combining joint anomaly detection and random smoothing according to an embodiment of this application;
[0030] Figure 6 This is a block diagram of a robust flow classification device with joint anomaly detection and random smoothing provided according to an embodiment of this application;
[0031] Figure 7 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0032] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.
[0033] The following description, with reference to the accompanying drawings, outlines a robust traffic classification method, apparatus, electronic device, and storage medium based on joint anomaly detection and random smoothing, according to embodiments of this application. Addressing the problems mentioned in the background section, this application provides a robust traffic classification method based on joint anomaly detection and random smoothing. This method constructs a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to perform a three-level cascaded classification of network traffic. This achieves effective identification and classification of both strong and covert adversarial traffic within the network traffic. Compared to a single anomaly detection method, this application can simultaneously filter strong adversarial traffic and robustly classify covert adversarial traffic. Furthermore, the first two levels of anomaly detection significantly reduce the amount of data requiring random smoothing, thereby reducing the computational and time overhead of traffic classification.
[0034] Specifically, Figure 1 This is a flowchart illustrating a robust traffic classification method combining joint anomaly detection and random smoothing, as provided in an embodiment of this application.
[0035] like Figure 1 As shown, the robust flow classification method combining joint anomaly detection and stochastic smoothing includes the following steps:
[0036] In step S101, a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing are constructed to obtain the network traffic that needs robust traffic classification.
[0037] It is understood that the embodiments of this application use an anomaly detection classifier based on anomaly scores, an anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to perform a three-level cascaded classification of network traffic requiring robust traffic classification. This effectively filters out highly adversarial traffic from network traffic and robustly classifies covert adversarial traffic, thereby improving overall network security and defense capabilities. Compared to single methods in related technologies, the three-stage approach in the embodiments of this application can more comprehensively address adversarial attacks of different types and intensities while reducing unnecessary computational overhead. Therefore, the embodiments of this application first need to construct a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to improve the accuracy and robustness of subsequent network traffic classification.
[0038] In step S102, network traffic is input into the first anomaly detection classifier, and the first anomaly detection classifier outputs the first-level traffic classification result. The first anomaly detection classifier processes the network traffic based on the anomaly score detection result of the anomaly score model.
[0039] It is understood that in the embodiments of this application, network traffic can be input into a first anomaly detection classifier. Based on the anomaly score, the first anomaly detection classifier can effectively filter out strong adversarial traffic containing obvious adversarial disturbances, ensuring that only relatively normal traffic enters the next level of classification, thereby improving the efficiency and accuracy of classification.
[0040] Specifically, the processing flow of the first anomaly detection classifier includes: inputting network traffic into the anomaly score model, and the anomaly score model outputting anomaly scores; filtering out strong adversarial traffic in the network traffic whose anomaly scores are higher than the score threshold; and treating network traffic whose anomaly scores are lower than the score threshold as pending traffic.
[0041] like Figure 2 As shown, this embodiment of the application can perform a first-level traffic classification on all traffic inputs based on an anomaly score model, filtering out highly adversarial traffic with anomaly scores higher than a preset anomaly score threshold due to significant adversarial disturbances, and retaining pending traffic with anomaly scores lower than the preset anomaly score threshold for a second-level traffic classification. The anomaly score threshold can be set by those skilled in the art according to specific circumstances and needs, and can distinguish between pending traffic and highly adversarial traffic containing significant adversarial disturbances.
[0042] In one embodiment of this application, before inputting network traffic into the first anomaly detection classifier, the method further includes: acquiring a training dataset, which includes traffic samples without adversarial perturbations; and training an anomaly score model using the traffic samples from the training dataset.
[0043] It is understandable that, before inputting network traffic into the first anomaly detection classifier, embodiments of this application may obtain traffic samples without adversarial perturbations and train anomaly score models to ensure that the trained anomaly score models can effectively identify strong adversarial traffic containing adversarial perturbations.
[0044] Specifically, anomaly score models can include clustering distance models and reconstruction loss models. The clustering distance model calculates the distance to the nearest cluster center as the anomaly score. A larger distance indicates that the sample deviates more from the normal pattern and may contain significant adversarial perturbations. The reconstruction loss model calculates the reconstruction error as the anomaly score. A larger reconstruction error indicates that the sample is more difficult for the model to accurately reconstruct and may contain significant adversarial perturbations.
[0045] In actual implementation, this application requires collecting a large number of traffic samples without adversarial disturbances, training the clustering distance model and reconstruction loss model respectively, and continuously adjusting the model parameters to optimize the model performance so that it can effectively identify strong adversarial traffic containing obvious adversarial disturbances, thereby improving the security and robustness of the network system.
[0046] In step S103, the undetermined traffic in the first-level traffic classification result is input into the second anomaly detection classifier, and the second anomaly detection classifier outputs the second-level traffic classification result. The second anomaly detection classifier processes the undetermined traffic in the first-level traffic classification result based on the consistency of the classification results of multiple traffic classification models.
[0047] Based on the above embodiments, after filtering out abnormal traffic with strong adversarial disturbances by the first anomaly detection classifier based on anomaly scores, the embodiments of this application can input the undetermined traffic after the first-level traffic classification and filtering into the second anomaly detection classifier based on multi-model classification consistency for the second-level traffic classification, and obtain normal traffic with consistent classification results and hidden adversarial traffic with inconsistent classification results due to the presence of hidden adversarial disturbances.
[0048] Specifically, such as Figure 3 As shown, the processing flow of the second anomaly detection classifier includes: inputting the undetermined traffic from the first-level traffic classification results into multiple traffic classification models; detecting the classification results of multiple traffic classification models, identifying normal traffic with consistent classification results, and using the classification results as the final classification result of normal traffic, while treating the other part of the undetermined traffic with inconsistent classification results as covert countermeasure traffic.
[0049] In actual implementation, the embodiments of this application can input the undetermined traffic obtained from the first-level traffic classification results into all selected heterogeneous traffic classification models to obtain the classification results of each traffic under each model. The classification results given by each model for the same traffic are compared. If multiple traffic classification models give the same classification result for a certain traffic, then this traffic is considered to be normal traffic; conversely, if there is a significant discrepancy, then the traffic is considered to potentially contain hidden adversarial disturbances and is marked as an object requiring further analysis, i.e., as hidden adversarial traffic, entering the third stage of detailed analysis.
[0050] In one embodiment of this application, before inputting the undetermined traffic from the first-level traffic classification result into the second anomaly detection classifier, the method further includes: obtaining a training dataset, which includes traffic samples without adversarial perturbations; and training multiple traffic classification models using the traffic samples from the training dataset, wherein the multiple traffic classification models are traffic classification models with different model architectures and / or traffic representations.
[0051] The traffic classification model can be a machine learning model, a deep learning model, etc. Each traffic classification model should be trained independently using the same traffic samples without adversarial perturbations. For example, for a deep learning model, the original traffic data can be used directly as input in this embodiment; while for a machine learning model, it may be necessary to extract specific statistical features first.
[0052] In practical implementation, this application requires collecting a large number of traffic samples free from adversarial disturbances to train clustering distance and reconstruction loss models. The model performance is evaluated using key metrics such as accuracy, recall, and F1 score. Based on the evaluation results, the model structure and parameter configuration are continuously optimized to effectively distinguish covert adversarial traffic and improve the security and robustness of the network system.
[0053] In step S104, the covert adversarial traffic in the second-level traffic classification result is input into the robust classifier, and the robust classifier outputs the robust classification of network traffic. The robust classifier processes the covert adversarial traffic in the second-level traffic classification result based on the base traffic classifier.
[0054] It is understandable that in the third-level traffic classification, the embodiments of this application use a robust classification method based on random smoothing to further process those traffic that still has covert adversarial disturbances after passing the first two levels of filtering (i.e., covert adversarial traffic in the above embodiments). There is no need to classify the first and second parts of traffic. Compared with the single random smoothing method, it effectively reduces the computation and time overhead of traffic classification and improves the classification accuracy of such difficult-to-detect adversarial traffic.
[0055] Specifically, such as Figure 4 As shown, the processing flow of the robust classifier includes: for each traffic in the adversarial traffic of the second-level traffic classification result, multiple smooth samples are generated by adding random covert adversarial perturbations; each smooth sample is input into the base traffic classifier, the base traffic classifier outputs the classification result, and the classification result that appears most frequently among all smooth sample classification results is taken as the final classification result of the traffic.
[0056] Understandably, for each traffic in the adversarial traffic, this embodiment generates several smoothed samples by adding random covert adversarial perturbations, and inputs each smoothed sample into the base traffic classifier to obtain the classification result; the classification result that appears most frequently among all smoothed sample classification results is taken as the final classification result of the traffic, thereby achieving robust classification of the third part of covert adversarial traffic. Thus, random smoothing technology is used to reduce the impact of a single adversarial perturbation on the classification decision, thereby enhancing the robustness of the robust classifier against covert adversarial perturbations.
[0057] In one embodiment of this application, before inputting the second-level traffic classification result into the base traffic classifier, the method further includes: obtaining a training dataset, which includes traffic samples containing covert adversarial perturbations; and training the base traffic classifier using the traffic samples in the training dataset.
[0058] The robust classifier can be a machine learning model, a deep learning model, etc. In this embodiment, before inputting the second-level traffic classification results into the robust classifier based on random smoothing, traffic samples containing covert adversarial perturbations can be obtained, and these samples can be used to train the base traffic classifier, ensuring that the robust classifier can effectively identify and handle adversarial traffic that is difficult to detect.
[0059] According to the robust traffic classification method combining joint anomaly detection and random smoothing proposed in the embodiments of this application, a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing are constructed to perform three-level cascaded classification of network traffic. This achieves effective identification and classification of strong adversarial and covert adversarial traffic in network traffic. Compared with a single anomaly detection method, this application can simultaneously achieve filtering of strong adversarial traffic and robust classification of covert adversarial traffic. Moreover, the first two levels of anomaly detection significantly reduce the amount of data that needs to be processed by random smoothing, thereby reducing the computational and time overhead of traffic classification.
[0060] The following is combined with Figure 5 The overall workflow of the robust traffic classification method combining joint anomaly detection and random smoothing according to embodiments of this application is described in detail, including the following steps:
[0061] Step 110: Input all traffic into the anomaly detection module M1 based on anomaly score for the first level of traffic classification. Filter out strong adversarial traffic with anomaly scores higher than the preset anomaly score threshold due to the presence of obvious adversarial disturbances, and retain the remaining traffic with anomaly scores lower than the preset anomaly score threshold as pending traffic for the second level of traffic classification.
[0062] Step 120: Input the undetermined traffic after the first-level traffic classification and filtering into the anomaly detection module M2 based on multi-model classification consistency for the second-level traffic classification, and obtain normal traffic with consistent classification results and hidden adversarial traffic with inconsistent classification results due to the presence of hidden adversarial disturbances.
[0063] Step 130: Input some of the covert adversarial traffic into the robust classification module M3 based on random smoothing for third-level traffic classification, and obtain robust classification results for these traffic.
[0064] In actual implementation, the anomaly detection classifier based on anomaly scores uses traffic without adversarial perturbations to train anomaly score models such as clustering distance and reconstruction loss, filtering out the first part of strongly adversarial traffic with high anomaly scores due to obvious adversarial perturbations from all traffic. The anomaly detection classifier based on multi-model classification consistency uses traffic without adversarial perturbations to train multiple heterogeneous traffic classification models, inputs the filtered traffic into each heterogeneous traffic classification model and checks the consistency of their classification results, obtaining the second part of normal traffic with consistent classification results and the third part of hidden adversarial traffic with inconsistent classification results due to the presence of covert adversarial perturbations. The robust classifier based on random smoothing uses traffic containing covert adversarial perturbations to train the base traffic classifier, randomly generates several smoothed samples containing covert adversarial perturbations for each traffic in the third part of covert adversarial traffic, and counts the classification result with the most occurrences of these smoothed samples by the base traffic classifier as the final classification result of the traffic, thereby achieving robust classification of the third part of covert adversarial traffic. Compared to existing single anomaly detection methods that can only effectively filter strong adversarial traffic and single random smoothing methods that can only robustly classify covert adversarial traffic, this application has the advantage of being able to simultaneously filter strong adversarial traffic and robustly classify covert adversarial traffic. At the same time, thanks to the filtering of the first two levels of anomaly detection, the robust classifier based on random smoothing in this application only needs to classify the third part of covert adversarial traffic, without having to classify the first and second parts of traffic, which effectively reduces the computational and time overhead of traffic classification compared to the single random smoothing method.
[0065] Next, referring to the accompanying drawings, a robust flow classification device combining joint anomaly detection and random smoothing according to an embodiment of this application is described.
[0066] Figure 6 This is a block diagram of a robust flow classification device combining joint anomaly detection and random smoothing according to an embodiment of this application.
[0067] like Figure 6 As shown, the robust flow classification device 10 with joint anomaly detection and random smoothing includes: an acquisition module 100, a first classification module 200, a second classification module 300, and a third classification module 400.
[0068] The acquisition module 100 is used to construct a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to acquire network traffic that needs robust traffic classification. The first classification module 200 is used to input network traffic into the first anomaly detection classifier, which outputs a first-level traffic classification result. The first anomaly detection classifier processes the network traffic based on the anomaly score detection result of the anomaly score model. The second classification module 300 is used to input the undetermined traffic in the first-level traffic classification result into the second anomaly detection classifier, which outputs a second-level traffic classification result. The second anomaly detection classifier processes the undetermined traffic in the first-level traffic classification result based on the consistency of classification results from multiple traffic classification models. The third classification module 400 is used to input the covert adversarial traffic in the second-level traffic classification result into the robust classifier, which outputs a robust classification of the network traffic. The robust classifier processes the covert adversarial traffic in the second-level traffic classification result based on the base traffic classifier.
[0069] In one embodiment of this application, the processing flow of the first anomaly detection classifier includes: inputting network traffic into an anomaly score model, and the anomaly score model outputting anomaly scores; filtering out strong adversarial traffic in the network traffic whose anomaly scores are higher than the score threshold; and treating traffic in the network traffic whose anomaly scores are lower than the score threshold as pending traffic.
[0070] In one embodiment of this application, the robust traffic classification device 10 combining anomaly detection and random smoothing further includes: a first training module, configured to acquire a training dataset before inputting network traffic into a first anomaly detection classifier, the training dataset including traffic samples without adversarial perturbations; and to train an anomaly score model using the traffic samples in the training dataset.
[0071] In one embodiment of this application, the processing flow of the second anomaly detection classifier includes: inputting the undetermined traffic in the first-level traffic classification result into multiple traffic classification models; detecting the classification results of the multiple traffic classification models, identifying normal traffic with consistent classification results, and using the classification results as the final classification result of the normal traffic, while treating the other part of the undetermined traffic with inconsistent classification results as covert countermeasure traffic.
[0072] In one embodiment of this application, the robust traffic classification device 10 combining anomaly detection and random smoothing further includes: a second training module, configured to acquire a training dataset before inputting the undetermined traffic from the first-level traffic classification result into the second anomaly detection classifier, the training dataset including traffic samples without adversarial perturbations; and to train multiple traffic classification models using the traffic samples from the training dataset, wherein the multiple traffic classification models are traffic classification models with different model architectures and / or traffic representations.
[0073] In one embodiment of this application, the processing flow of the robust classifier includes: for each traffic in the adversarial traffic of the second-level traffic classification result, multiple smooth samples are generated by adding random covert adversarial perturbations; each smooth sample is input into the base traffic classifier, the base traffic classifier outputs the classification result, and the classification result that appears most frequently among all smooth sample classification results is taken as the final classification result of the traffic.
[0074] In one embodiment of this application, the robust traffic classification device 10 combining anomaly detection and random smoothing further includes: a third training module, configured to acquire a training dataset before inputting the covert adversarial traffic from the second-level traffic classification result into the robust classifier, the training dataset including traffic samples containing covert adversarial perturbations; and to train a base traffic classifier using the traffic samples from the training dataset.
[0075] It should be noted that the foregoing explanation of the robust flow classification method embodiment of joint anomaly detection and random smoothing also applies to the robust flow classification device of joint anomaly detection and random smoothing in this embodiment, and will not be repeated here.
[0076] The robust traffic classification device combining joint anomaly detection and random smoothing proposed in this application constructs a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to perform three-level cascaded classification of network traffic. This achieves effective identification and classification of strong adversarial and covert adversarial traffic in network traffic. Compared with a single anomaly detection method and a single random smoothing method, this application can simultaneously achieve filtering of strong adversarial traffic and robust classification of covert adversarial traffic. Furthermore, the first two levels of anomaly detection significantly reduce the amount of data that needs to be processed by random smoothing, thereby reducing the computational and time overhead of traffic classification.
[0077] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include:
[0078] The memory 701, the processor 702, and the computer program stored on the memory 701 and executable on the processor 702.
[0079] When the processor 702 executes the program, it implements the robust traffic classification method with joint anomaly detection and random smoothing provided in the above embodiments.
[0080] Furthermore, electronic devices also include:
[0081] Communication interface 703 is used for communication between memory 701 and processor 702.
[0082] The memory 701 is used to store computer programs that can run on the processor 702.
[0083] The memory 701 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.
[0084] If the memory 701, processor 702, and communication interface 703 are implemented independently, then the communication interface 703, memory 701, and processor 702 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0085] Optionally, in a specific implementation, if the memory 701, processor 702, and communication interface 703 are integrated on a single chip, then the memory 701, processor 702, and communication interface 703 can communicate with each other through an internal interface.
[0086] The processor 702 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.
[0087] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described robust traffic classification method with joint anomaly detection and random smoothing.
[0088] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0089] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0090] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0091] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.
[0092] Those skilled in the art will understand that all or part of the steps of the methods implementing the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0093] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. A robust flow classification method combining anomaly detection and stochastic smoothing, characterized in that, Includes the following steps: Construct a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to obtain network traffic that requires robust traffic classification; The network traffic is input into the first anomaly detection classifier, and the first anomaly detection classifier outputs a first-level traffic classification result, wherein the first anomaly detection classifier processes the network traffic based on the anomaly score detection result of the anomaly score model. The undetermined traffic in the first-level traffic classification result is input into the second anomaly detection classifier, and the second anomaly detection classifier outputs the second-level traffic classification result. The second anomaly detection classifier processes the undetermined traffic in the first-level traffic classification result based on the consistency of the classification results of multiple traffic classification models. The covert adversarial traffic in the second-level traffic classification result is input into the robust classifier, and the robust classifier outputs the robust classification of the network traffic. The robust classifier processes the covert adversarial traffic in the second-level traffic classification result based on the base traffic classifier.
2. The robust flow classification method combining joint anomaly detection and random smoothing according to claim 1, characterized in that, The processing flow of the first anomaly detection classifier includes: The network traffic is input into the anomaly score model, and the anomaly score model outputs anomaly scores. Filter out strong adversarial traffic from the network traffic whose abnormal scores exceed the score threshold; Traffic with an abnormal score lower than the score threshold in the network traffic is designated as the pending traffic.
3. The robust flow classification method based on joint anomaly detection and random smoothing according to claim 2, characterized in that, Before inputting the network traffic into the first anomaly detection classifier, the method further includes: Obtain a training dataset, which includes traffic samples without adversarial perturbations; The anomaly score model is trained using traffic samples from the training dataset.
4. The robust flow classification method based on joint anomaly detection and random smoothing according to claim 1, characterized in that, The processing flow of the second anomaly detection classifier includes: The undetermined traffic is input into multiple traffic classification models; The classification results of the multiple traffic classification models are detected, normal traffic with consistent classification results is identified, and the classification result is taken as the final classification result of the normal traffic. The other part of the undetermined traffic with inconsistent classification results is taken as covert countermeasure traffic.
5. The robust flow classification method combining joint anomaly detection and random smoothing according to claim 4, characterized in that, Before inputting the undetermined traffic from the first-level traffic classification results into the second anomaly detection classifier, the following steps are also included: Obtain a training dataset, which includes traffic samples without adversarial perturbations; The multiple traffic classification models are trained using traffic samples from the training dataset, wherein the multiple traffic classification models are traffic classification models with different model architectures and / or traffic representations.
6. The robust flow classification method based on joint anomaly detection and random smoothing according to claim 1, characterized in that, The processing flow of the robust classifier includes: For each traffic in the covert adversarial traffic of the second-level traffic classification result, multiple smooth samples are generated by adding random covert adversarial perturbations. Each smoothed sample is input into the base flow classifier, which outputs a classification result. The classification result that appears most frequently among all the smoothed sample classification results is taken as the final classification result of the flow.
7. The robust flow classification method combining joint anomaly detection and random smoothing according to claim 6, characterized in that, Before inputting the covert adversarial traffic from the second-level traffic classification results into the robust classifier, the method further includes: Obtain a training dataset, which includes traffic samples containing covert adversarial perturbations; The base traffic classifier is trained using traffic samples from the training dataset.
8. A robust flow classification device combining anomaly detection and random smoothing, characterized in that, include: The acquisition module is used to construct a first anomaly detection classifier based on anomaly scores, a second anomaly detection classifier based on multi-model classification consistency, and a robust classifier based on random smoothing to acquire network traffic that requires robust traffic classification. The first classification module is used to input the network traffic into the first anomaly detection classifier, and the first anomaly detection classifier outputs a first-level traffic classification result, wherein the first anomaly detection classifier processes the network traffic based on the anomaly score detection result of the anomaly score model. The second classification module is used to input the undetermined traffic in the first-level traffic classification result into the second anomaly detection classifier. The second anomaly detection classifier outputs the second-level traffic classification result. The second anomaly detection classifier processes the undetermined traffic in the first-level traffic classification result based on the consistency of the classification results of multiple traffic classification models. The third classification module is used to input the covert adversarial traffic in the second-level traffic classification result into the robust classifier, and the robust classifier outputs the robust classification of the network traffic. The robust classifier processes the covert adversarial traffic in the second-level traffic classification result based on the base traffic classifier.
9. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the robust traffic classification method of combined anomaly detection and random smoothing as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they implement the robust traffic classification method of joint anomaly detection and random smoothing as described in any one of claims 1-7.