Network traffic detection method, device and equipment based on open semi-supervised learning

By adopting an open semi-supervised learning method in network traffic detection, using labeled and unlabeled data to generate auxiliary labels, and training unknown traffic detection models, the problem of failure to identify unknown types of traffic in the existing technology is solved, and network traffic is realized. accurate identification and detection.

CN118590418APending Publication Date: 2024-09-03NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410737649.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

Existing semi-supervised learning methods assume that the label spaces of labeled and unlabeled data are the same in network traffic detection, and cannot effectively identify unknown traffic data, resulting in a decrease in detection accuracy.

Method used

Using a method based on open semi-supervised learning, the original traffic data is divided into labeled and unlabeled sample sets, and auxiliary labels are generated through the known traffic detection model and the multi-binary traffic detection model, which are used to train the unknown traffic detection model to achieve Identification of unknown traffic classes.

Benefits of technology

This method can accurately identify known types of traffic and detect unknown types of traffic at the same time, which improves the accuracy of network traffic detection and is suitable for the needs of large amounts of unlabeled data in real scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118590418A
    Figure CN118590418A
Patent Text Reader

Abstract

The invention relates to a network flow detection method, device and equipment based on open semi-supervised learning. According to the method, a network flow detection model composed of a known flow detection model, a multi-binary flow detection module and an unknown flow detection model is constructed; a small amount of marked data and a large amount of unmarked data are utilized to train the model, so that the ability of accurately identifying known classes and simultaneously detecting unknown classes is realized. In order to utilize new unmarked traffic, the method adopts an open type semi-supervised technology to select known class data from unmarked data so as to optimize a known traffic detection model; in order to detect unknown traffic, the method combines output probabilities of a known traffic detection module and a multi-binary traffic detection model to generate auxiliary labels for all unmarked data, and the auxiliary labels are used for supervising and training an unknown traffic detection model. According to the method, known class traffic can be accurately identified, and unknown classes can be detected, so that the requirements of a real scene can be better met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of network traffic detection, and in particular to a network traffic detection method, device and equipment based on open semi-supervised learning. Background Art

[0002] Traffic classification, as an important solution to network management problems, plays a vital role in network security and network quality of service (QoS). It enables network administrators to better monitor the behavior and performance of network traffic, which helps to formulate appropriate QoS policies to optimize network performance. At the same time, traffic classification is an important part of detecting malicious traffic, which is used to identify malicious attacks and protect system security. With the continuous increase in network traffic and network attack types, there is an increasing demand for methods that can accurately detect complex real traffic.

[0003] Although existing deep learning-based methods have achieved success in known class traffic detection tasks, they rely on a large amount of labeled traffic data to capture effective features. However, in the real world, new incoming traffic data is unlabeled, which makes it challenging to collect and manually label enough real traffic samples. On the other hand, semi-supervised learning (SSL) can utilize unlabeled data to train models, thus avoiding the need for manual labeling. However, existing semi-supervised methods usually assume that the label space of labeled and unlabeled data is the same (i.e., they only contain known class traffic), and therefore cannot identify unknown class traffic data.

[0004] Semi-supervised learning (SSL) can utilize unlabeled data to assist deep neural network models to improve performance, thereby reducing dependence on labeled data. Therefore, many researchers have begun to apply SSL to network traffic classification to utilize unlabeled traffic data, which is more in line with practical scenarios. Aouedi et al. proposed a semi-supervised method based on stacked sparse autoencoders to utilize labeled and unlabeled data for traffic classification tasks. Iliyasu et al. applied deep convolutional generative adversarial networks (DCGAN) to build a semi-supervised model and trained the classifier using samples generated by the generator and unlabeled data. Fahad et al. used multi-view representation and clustering to build a semi-supervised model for traffic classification. Zhao et al. proposed a semi-supervised framework based on MeanTeacher to utilize unlabeled traffic data and designed a classifier with an attention mechanism to extract features from flow sequences.

[0005] The emergence of semi-supervised methods has broadened the perspective of traffic classification. However, these semi-supervised methods usually assume that labeled and unlabeled data share the same label space. In fact, the incoming unlabeled traffic data includes not only known categories but also unknown categories. The existence of unknown categories may lead to a decrease in traffic classification accuracy. Summary of the invention

[0006] Based on this, it is necessary to provide a network traffic detection method, device and equipment based on open semi-supervised learning to address the above technical problems.

[0007] A network traffic detection method based on open semi-supervised learning, the method comprising:

[0008] The acquired original traffic data is divided into a first sample set and a second sample set; the first sample set includes all marked traffic samples, and the second sample set includes all unmarked traffic samples.

[0009] The first sample set is used to train a known traffic detection model.

[0010] The first sample set is used to train a multi-binary traffic detection model; wherein the multi-binary traffic detection model includes a plurality of sub-classifiers, and each sub-classifier is a One-Vs-All binary classifier.

[0011] An auxiliary label for each unlabeled traffic sample is generated according to the probability obtained by inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model respectively.

[0012] With auxiliary labels as supervision, the second sample set is used to train the unknown traffic detection model.

[0013] According to the auxiliary labels, known class traffic samples are selected from the second sample set as samples for model optimization, and the known traffic detection model is optimized using the model optimization samples.

[0014] A known traffic detection model or an unknown traffic detection model in a trained network traffic detection model is used to detect the traffic data to be detected to obtain a network traffic detection result; the network traffic detection model includes: a known traffic detection model, a multi-binary traffic detection model and an unknown traffic detection model.

[0015] A network traffic detection device based on open semi-supervised learning, the device comprising:

[0016] The training sample determination module is used to divide the acquired original traffic data into a first sample set and a second sample set; the first sample set includes all marked traffic samples, and the second sample set includes all unmarked traffic samples.

[0017] The known traffic detection model training module is used to train the known traffic detection model using the first sample set.

[0018] The multi-binary traffic detection model training module is used to train the multi-binary traffic detection model using the first sample set; wherein the multi-binary traffic detection model includes multiple sub-classifiers, each sub-classifier is a One-Vs-All binary classifier.

[0019] The unknown traffic detection model training module is used to generate an auxiliary label for each unlabeled traffic sample based on the probability obtained by inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model respectively; with the auxiliary label as supervision, the second sample set is used to train the unknown traffic detection model.

[0020] The known traffic detection model optimization module is used to select known class traffic samples from the second sample set as samples for model optimization according to the auxiliary labels, and optimize the known traffic detection model using the samples for model optimization.

[0021] The network traffic detection module is used to detect the traffic data to be detected using a known traffic detection model or an unknown traffic detection model in the trained network traffic detection model to obtain the network traffic detection result; the network traffic detection model includes: a known traffic detection model, a multi-binary traffic detection model and an unknown traffic detection model.

[0022] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above methods when executing the computer program.

[0023] The above-mentioned network traffic detection method, device and equipment based on open semi-supervised learning, the method constructs a network traffic detection model composed of a known traffic detection model, a multi-binary traffic detection module and an unknown traffic detection model; a small amount of labeled data and a large amount of unlabeled data are used to train the model, so as to achieve the ability to accurately identify known classes and detect unknown classes at the same time. In order to utilize the newly arrived unlabeled traffic, the method adopts open semi-supervised technology to select known class data from unlabeled data to optimize the known traffic detection model; in order to detect unknown traffic, the method generates auxiliary labels for all unlabeled data based on the output probability obtained by inputting unlabeled data into the known traffic detection module and the multi-binary traffic detection model, and uses the auxiliary labels as supervision to train the unknown traffic detection model using unlabeled traffic data. The method can accurately identify known class traffic and detect unknown class traffic at the same time, so as to better meet the needs of real scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A schematic diagram of a flow chart of a network traffic detection method based on open semi-supervised learning in one embodiment;

[0025] Figure 2is a framework diagram of a network traffic detection model in another embodiment;

[0026] Figure 3 is the training accuracy of two data sets in another embodiment, wherein (a) is the training accuracy on data set D1, and (b) is the training accuracy on data set D2;

[0027] Figure 4 is a confusion matrix diagram of known categories on two data sets in another embodiment, wherein (a) is a confusion matrix diagram of known categories on data set D1, and (b) is a confusion matrix diagram of known categories on data set D2;

[0028] Figure 5 It is a feature visualization of known classes on two data sets in another embodiment, wherein (a) is a feature visualization of known classes on data set D1, and (b) is a feature visualization of known classes on data set D2;

[0029] Figure 6 is a structural block diagram of a network traffic detection device based on open semi-supervised learning in one embodiment;

[0030] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

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

[0032] A network traffic detection method based on open semi-supervised learning, referred to as DivinEye.

[0033] The network traffic detection method based on open semi-supervised learning proposed in this application uses a small amount of labeled data and a large amount of unlabeled data to train the model, thereby achieving the ability to accurately identify known classes and detect unknown classes at the same time. In order to take advantage of the newly arrived unlabeled traffic, DivinEye uses open semi-supervised technology to select known class data from unlabeled data to optimize the known traffic detection model. In order to detect unknown traffic, DivinEye combines known traffic classifiers with multivariate classifiers to construct an unknown traffic detection model, and generates auxiliary labels for all unlabeled data as supervision to train the model. This method uses a small amount of labeled data and a large amount of incoming unlabeled data to train the model, accurately identifying known categories of traffic while detecting unknown categories of traffic.

[0034] In one embodiment, Figure 1As shown, a network traffic detection method based on open semi-supervised learning is provided, and the method includes the following steps:

[0035] Step 100: Divide the acquired original traffic data into a first sample set and a second sample set; the first sample set includes all marked traffic samples, and the second sample set includes all unmarked traffic samples.

[0036] Specifically, the original traffic data includes a small amount of labeled traffic data and a large amount of newly emerged unlabeled traffic data.

[0037] The raw traffic data is divided into two initial sets: It contains all labeled traffic samples (i.e. samples of known classes), as well as the set It contains all unlabeled traffic samples (i.e., samples of known and unknown categories). Combining these two groups together forms a complete raw traffic dataset.

[0038] The first sample set is: The second sample set

[0039] Step 102: Use the first sample set to train a known traffic detection model.

[0040] Specifically, the known traffic detection model is used to classify K known classes.

[0041] A known traffic detection model is used to classify K known classes; specifically, a small amount of labeled traffic data is used to train the known traffic detection model. Subsequently, the known traffic detection model is optimized by using known class traffic selected from the newly emerged unlabeled traffic data.

[0042] Step 104: Use the first sample set to train a multi-binary traffic detection model; wherein the multi-binary traffic detection model includes a plurality of sub-classifiers, each of which is a One-Vs-All binary classifier.

[0043] Specifically, the multi-binary traffic detection model utilizes labeled traffic data to train each sub-classifier to detect unknown traffic samples.

[0044] Step 106: Generate an auxiliary label for each unlabeled traffic sample according to the probability obtained by inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model respectively.

[0045] Specifically, the classification results of the known traffic detection model and the multi-binary traffic detection model on the unlabeled traffic samples are combined to generate auxiliary labels for all unlabeled samples.

[0046] Step 108: Using the auxiliary label as supervision, the second sample set is used to train the unknown traffic detection model.

[0047] Specifically, semi-supervised learning (SSL) can use unlabeled data to assist deep neural network models to improve performance, thereby reducing dependence on labeled data.

[0048] The auxiliary labels are used as supervision to train an unknown traffic detection model, which aims to detect known and unknown traffic using limited labeled samples.

[0049] Step 110: According to the auxiliary labels, select known class traffic samples from the second sample set as samples for model optimization, and use the model optimization samples to optimize the known traffic detection model.

[0050] Step 112: Use a known traffic detection model or an unknown traffic detection model in the trained network traffic detection model to detect the traffic data to be detected to obtain a network traffic detection result; the network traffic detection model includes: a known traffic detection model, a multi-binary traffic detection model and an unknown traffic detection model.

[0051] The framework diagram of the network traffic detection model is as follows: Figure 2 shown.

[0052] In the above-mentioned network traffic detection method based on open semi-supervised learning, the method constructs a network traffic detection model composed of a known traffic detection model, a multi-binary traffic detection module and an unknown traffic detection model; a small amount of labeled data and a large amount of unlabeled data are used to train the model, thereby realizing the ability to accurately identify known classes and detect unknown classes at the same time. In order to utilize the newly arrived unlabeled traffic, the method adopts open semi-supervised technology to select known class data from unlabeled data to optimize the known traffic detection model; in order to detect unknown traffic, the method generates auxiliary labels for all unlabeled data based on the output probability obtained by inputting unlabeled data into the known traffic detection module and the multi-binary traffic detection model, and uses the auxiliary labels as supervision to train the unknown traffic detection model using unlabeled traffic data. The method can accurately identify known class traffic and detect unknown classes at the same time, thereby better meeting the needs of real scenarios.

[0053] In one embodiment, the known traffic detection model includes a backbone network and a first classifier; step 102 includes: extracting features from the first sample set using the backbone network, and then mapping the extracted features to K-class probability distributions of known classes using the first classifier; training the known traffic detection model using standard cross entropy loss according to the probability distribution of each marked traffic and the corresponding label to obtain a trained known traffic detection model.

[0054] Specifically, existing DL-based traffic classification methods rely heavily on labeled traffic data. However, in actual scenarios, newly emerging traffic data is unlabeled. On the one hand, manually labeling traffic data is usually difficult and time-consuming, which poses a challenge to completely labeling all unlabeled traffic. On the other hand, unlabeled data contains a lot of information, and using the information contained in unlabeled data can improve performance. In addition, supervised training based solely on labeled data is not enough to handle unseen traffic types, resulting in poor detection accuracy. Therefore, in response to the above problems, the present application constructs a known traffic detection model based on open set SSL. It uses a small amount of labeled traffic data for training, and uses newly incoming unlabeled traffic data to optimize the model (using a large number of known class samples selected from unlabeled data to optimize the known traffic detection model).

[0055] The specific steps for building and training known traffic detection models are as follows:

[0056] The known traffic detection model is used for K-class classification of known traffic data. The known traffic detection model is established using the labeled traffic set X. Given a batch of labeled samples X, the backbone network f(·) is used to extract features, i.e., h i =f(x i ). Then, the known traffic detection model converts the feature h i Mapped to the K-class probability distribution of known classes, i.e., p i =Q(h i ). It is known that the flow detection model is in the labeled batch The standard cross entropy loss H(·,·) is used for training:

[0057]

[0058] in, is the known traffic detection module loss function, and B is the number of labeled samples in the first sample set.

[0059] In one embodiment, step 110 includes: selecting a known class of traffic samples from the second sample set according to the auxiliary label to obtain a sample for model optimization; using the sample for model optimization, optimizing the trained known traffic detection model according to the optimization loss; wherein the optimization loss is:

[0060]

[0061] in, To optimize the loss, τ q is the confidence threshold, For auxiliary labels, Output unlabeled samples u for the optimized known traffic detection model iThe probability of belonging to a known class j, is the unlabeled sample u output by the trained multi-binary traffic detection model i The probability of not belonging to a known class j, is the indicator function and H(·) is the standard cross entropy loss.

[0062] Specifically, since the predictions of the known traffic detection model will be used to predict unknown traffic in the future, further optimization is needed to obtain better performance. This application uses auxiliary labels to help select known class traffic samples from the unlabeled traffic set U. These selected samples are used in the training process to optimize the known traffic classifier. Then, L kt Loss on unlabeled samples The known class samples selected in are optimized. i Filter out samples of unknown classes and keep samples of known classes to optimize the known traffic detection model. In addition, τ q It is used to ignore the incorrect pseudo-labeling of known class samples. In this way, samples belonging to known classes can be selected from unlabeled samples and used to optimize the known model.

[0063] In one embodiment, step 104 includes: inputting the first sample set into the corresponding sub-classifier in the multi-binary traffic detection model, outputting a two-dimensional vector, wherein the two dimensions of the two-dimensional vector represent the probabilities of belonging to a known class and an unknown class respectively; and calculating the loss of the multi-binary traffic detection model according to the two-dimensional vector as:

[0064]

[0065] in, is the multi-binary traffic detection model loss, For x i The probability of belonging to a known class, Represents x i The probability of belonging to the unknown class; B is the number of labeled samples in the first sample set.

[0066] The multi-binary traffic detection model is trained by minimizing the loss of the multi-binary traffic detection model to obtain a trained multi-binary traffic detection model.

[0067] Specifically, in many real traffic detection scenarios, newly incoming unlabeled traffic data may contain unknown class traffic that is not seen in the labeled data, such as newly emerging malicious unknown classes. The emergence of these new unknown classes may lead to a decrease in traffic classification accuracy. This introduces the problem of identifying unknown class traffic. Although the known traffic classifier is a traffic detection model, it is not suitable for detecting newly emerging unknown traffic data. For example, after training on traffic data from known category 1 and known category 2, the known traffic classifier can only assign a label of category 1 or category 2 to each traffic sample. However, since the unknown class belongs to neither category 1 nor category 2, the known traffic classifier cannot assign the correct label to the newly incoming unlabeled unknown traffic. In order to solve this problem, the present application uses multiple binary classifiers to construct a multi-binary traffic detection model, which is a method that can detect unknown traffic samples. The steps for building a multi-binary traffic detection model are as follows:

[0068] (1) Establish a multi-binary traffic detection model. The multi-binary traffic detection model consists of K sub-classifiers, that is, D = {D j :j∈(1,...,K)}. Each sub-classifier operates as a One-Vs-All binary classifier, aiming to learn the boundary between known and unknown traffic. The goal of each sub-classifier is to distinguish whether a sample belongs to the corresponding known class. For example, the sub-classifier D of class j j Output a 2D vector Each dimension represents the score of samples belonging to known class j and unknown class. former Represents x i The probability of belonging to class j, the latter Represents x i The probability of not belonging to class j (i.e., belonging to an unknown class) is given by Calculate (where ).

[0069] (2) Multi-binary traffic detection model training. Use the previously divided initial dataset and X (the first sample set) to train each sub-classifier. The sub-classifier will continue to train so that data from class j is considered positive data and data from all other classes is considered negative data. In the optimization process of training the multi-binary traffic detection model, the given batch is minimized. The following are the multi-binary traffic detection models loss.

[0070] (3) Unknown traffic identification. By combining the known traffic detection model with the multi-binary traffic detection model, it is possible to determine whether the test sample belongs to an unknown sample. Specifically, by inputting the unlabeled test sample into the known traffic detection model, the sample is assigned to the known class j among the K known classes. Then, the test sample is input into the subclassifier corresponding to class j to obtain the output probability. The binary probability is used to determine whether the unlabeled sample is the jth known class or the unknown class, with a natural threshold of 0.5. If the probability that the test sample belongs to class j is greater than the probability that it belongs to the unknown class, it is considered to be a known class j. Otherwise, it is considered to be an unknown class sample.

[0071] In one embodiment, step 106 includes: inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model for prediction, and generating an auxiliary label according to the output probability; the auxiliary label is:

[0072]

[0073] in, is the unlabeled sample u i Auxiliary labels, K is the number of known classes, Output unlabeled samples u for the optimized known traffic detection model i The probability of belonging to a known class j; are the unlabeled samples u output by the trained multi-binary traffic detection model. i The probability and u of belonging to a known class j i The probability of not belonging to a known class j.

[0074] In one embodiment, step 108 includes: inputting the second sample set into the unknown traffic detection model to obtain a predicted label; using the auxiliary label as supervision, calculating the loss of the unknown traffic detection model according to the auxiliary label and the predicted label; the loss of the unknown traffic detection model is:

[0075]

[0076] where τ q is the confidence threshold, is the indicator function, is the unlabeled sample u i Auxiliary tags, is the unlabeled sample u i The predicted label of is the standard cross entropy loss. In practice, it is usually τ q Choose a low value so that most of the unlabeled samples are utilized.

[0077] The unknown traffic detection model is reversely trained according to the unknown traffic detection model loss to obtain a trained unknown traffic detection model.

[0078] Specifically, in most cases, the amount of labeled traffic data is usually limited, while the available unlabeled traffic data is more. When the labeled data is sufficient, unknown samples can be identified by training a multi-binary traffic detection model. However, when the amount of labeled traffic data is limited, the prediction results of the multi-binary traffic detection model for unknown samples trained with limited labeled data are often unreliable.

[0079] To overcome this limitation, this application designs an unknown traffic detection model, which combines the known traffic detection model and the multi-binary traffic detection model to generate auxiliary labels. It uses limited labeled samples to achieve traffic detection for known and unknown traffic. Specifically, the unknown traffic detection model is trained in multiple steps using a small amount of labeled data and a large amount of unlabeled data, as described below.

[0080] (1) Auxiliary label generation. For all unlabeled samples Auxiliary labels are generated by combining the output probabilities of the known traffic detection model and the multi-binary traffic detection model. Specifically, for each unlabeled sample u i , the probability of belonging to a known class j is predicted by the known traffic detection model, that is, Probability Prediction by the multi-binary traffic detection model, i.e.

[0081] Since the known flow detection model and the multi-binary flow detection model are independent of parameters, and are two different and complementary predictions for predicting u i The probability that a class belongs to the jth known class. Therefore, for 1≤j≤K, the generated To estimate u i The probability of belonging to the jth known class:

[0082]

[0083] Therefore, u i The probability of not belonging to any of the K known classes (i.e., belonging to an unknown class) is estimated by the following equation:

[0084]

[0085] Combining the above two probabilities, we will get a (K+1)-way class probability distribution The main idea is to regard all unknown traffic samples as the (K+1)th unknown class:

[0086]

[0087] In this way, auxiliary labels will be generated for all unlabeled traffic samples Indicates whether they belong to the K known classes or the (K+1)th unknown class. This lays the foundation for the subsequent training of the unknown traffic detection model.

[0088] (2) Unknown model training. Generate auxiliary labels using unlabeled samples As supervision, and its prediction To train the unknown traffic detection model G(·). It uses L ut The loss is on all unlabeled samples Training on.

[0089] In one embodiment, step 112 includes: if the traffic data to be detected only includes traffic data of known classes, a known traffic detection model in a trained network traffic detection model is used for detection to determine the known class to which the traffic data to be detected belongs; if the traffic data to be detected includes traffic data of known classes and unknown classes, an unknown traffic detection model in a trained network traffic detection model is used for detection to determine the category to which the traffic data to be detected belongs.

[0090] Specifically, after training the unknown traffic detection model, it can be used to determine the test sample x m Is it K known classes or (K+1)th unknown class? For closed set classification tasks (the test set contains only traffic of known classes), we use the known traffic detection model to get p t =Q(f(x t )),and Then the test samples are assigned to For open set classification tasks (the test set contains traffic from known and unknown classes), the unknown traffic detection model is used to obtain A t =G(f(x t )),and The test sample is then assigned to the jth known class (j∈{1,...,K}) or the (K+1)th unknown class.

[0091] In one embodiment, before step 112, the method further includes: constructing a total loss function of the network traffic detection model; the total loss function is:

[0092]

[0093] in, is the total loss function, is the loss of the known flow detection model, is the optimization loss of the known traffic detection model, is the multi-binary traffic detection model loss, is the unknown traffic detection model loss, λ kt , mb and λ ut are the weights of each learning objective. Since these learning objectives all use cross entropy loss, we set λ kt =λ mb =λ ut =1.

[0094] The parameters of the network traffic detection model are reversely trained according to the total loss function to obtain a trained network traffic detection model.

[0095] Specifically, the total training loss includes three parts: the loss of the known traffic detection model, the loss of the multi-binary traffic detection model, and the loss of the unknown traffic detection model, as shown in the following formula (9).

[0096] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0097] In a verification example, two public datasets, USTC-TFC20162 (D1) and ISCXVPN20163 (D2), are used. Each dataset is randomly divided into a training set and a test set at a ratio of 80% and 20%. Table 1 summarizes the details of the two datasets.

[0098] Table 1 Overview of the datasets used for evaluation

[0099]

[0100] USTC-TFC20162 (D1): The dataset consists of two categories - normal software and abnormal software traffic. For normal, there are ten categories (BitTorrent, FTP, etc.). For abnormal, there are ten categories (Cridex, Geodo, etc.).

[0101] ISCXVPN20163 (D2): The dataset consists of non-VPN traffic data and VPN traffic data. For non-VPN traffic, there are five categories. For VPN traffic, there are five more categories. In addition, all packets routed through VPN are encrypted. In the following experiments, this embodiment uses the original traffic data of 5 non-VPNs and 5 VPNs.

[0102] (1) Implementation details: All evaluations are performed in Python 3.10 and PyTorch 1.13. The experiments are trained on a computer equipped with an AMD R9-7950X CPU, 124GB RAM, and two NVIDIA GeForce RTX4090 GPUs. We use WideResnet

[29] as the backbone network and use the same set of hyperparameters in all tasks: λ kt =λ mb =λ ut =1,τ p =0.95,τ q =0.5,μ=7,N e =256,N i =1024. N e Indicates the total number of training epochs, N i Indicates the number of iterations per epoch.

[0103] (2) Comparison Methods: DivinEye is compared with eight baseline models, including a fully supervised method (convolutional neural network, i.e., CNN model), six semi-supervised methods, and an open set SSL method. The details of these comparison baseline methods are as follows:

[0104] Fully supervised approach: The model is trained using only labeled traffic data (label-only).

[0105] MeanTeacher: This is a semi-supervised student-teacher method that generates a teacher model by averaging the weights of the student models instead of label predictions. In addition, it also uses the mean squared error as the consistency loss between the student model and the teacher model predictions.

[0106] FixMatch: It combines two common semi-supervised learning techniques, pseudo-labeling and consistency regularization, to simplify the semi-supervised learning process. The algorithm demonstrates state-of-the-art performance on various semi-supervised learning benchmarks.

[0107] CoMatch: This method combines consistency regularization and graph-based contrastive learning. It jointly learns two representations of the training data, namely class probabilities and low-dimensional embeddings, as well as the interaction between these two representations.

[0108] FlexMatch: Leverages informative unlabeled data and their pseudo-labels to flexibly adjust the thresholds for different categories at each time step.

[0109] SimMatch: It applies consistency regularization at the semantic and instance levels, computes semantic and instance similarities, and finally produces pseudo labels.

[0110] FreeMatch: This method introduces an adaptive regularization penalty term that dynamically adjusts the confidence threshold of the pseudo-label according to the learning state, aiming to better utilize unlabeled data.

[0111] OpenDetection: This method uses consistency regularization and a one-to-all classifier to identify unknown class data.

[0112] (3) Performance of this method

[0113] This example evaluates the performance of DivinEye on the USTCTFC2016 dataset (D1) and the ISCXVPN2016 dataset (D2). For D1, 10 normal classes are used as known classes and 10 abnormal classes are used as unknown classes, thus achieving a 10 / 10 known / unknown class split. For D2, the first six classes are used as known classes, thus forming a 6 / 4 split. In addition, 25 traffic samples are randomly selected from the training set of each known class as labeled data, and the remaining samples of the training set are used as unlabeled data. These data are then used to train the entire model.

[0114] 1) Training accuracy: The training accuracy of DivinEye on the two datasets is as follows Figure 3 As shown, (a) is the training accuracy on dataset D1, and (b) is the training accuracy on dataset D2. It can be seen that the model proposed by this method effectively learns the feature information of the training dataset during the training process and shows a higher accuracy. As the number of iterations increases, the training accuracy gradually stabilizes. It is worth noting that the model can guarantee high performance even with only 25 labeled samples per class. To be precise, the model achieves 98% accuracy on dataset D1 and 63% accuracy on D2. Since the number of some classes in the original D2 dataset is small (for example, the VPN data for emails has less than 300 instances), the data distribution is unbalanced. In this unbalanced data distribution scenario, training the model with only 25 labels is part of the reason for the relatively low accuracy on D2.

[0115] 2) Confusion Matrix: In order to comprehensively evaluate the classification performance of DivinEye, the confusion matrix of the known class classification results was analyzed on the test datasets of the two datasets. Figure 4As shown, (a) is a confusion matrix diagram of known categories on dataset D1, and (b) is a confusion matrix diagram of known categories on dataset D2. The method of the present application effectively identifies different types of traffic. The D1 dataset accurately distinguishes different types of traffic, and the classification accuracy of each category is close to 100%. On the D2 dataset, some misclassifications were observed between Streaming and VOIP traffic data. According to the official description of D2 and the original data provided, we found that Streaming includes video traffic generated by Facebook, and VOIP includes audio traffic generated by Facebook. These two types of traffic from Facebook are very similar, which is the main reason for the misclassification.

[0116] 3) Feature visualization: In addition, T-SNE visualization is used to show the feature distribution of the known class classification results of the two data sets (different colors represent different classes). Figure 5 As shown in the figure, (a) is a feature visualization of known classes on dataset D1, and (b) is a feature visualization of known classes on dataset D2. Even with only 25 labeled samples, DivinEye can still learn high-quality representations in both datasets, thereby effectively distinguishing different types of traffic data. This shows that when labeled data is scarce, the performance of the known traffic detection model can be further optimized by selectively filtering known class traffic data from unlabeled data.

[0117] 4) Unknown traffic performance: To further evaluate the classification performance of DivinEye on unknown class traffic, the classification performance of DivinEye was tested on the full test sets of the two datasets (including known and unknown classes). The evaluation results are shown in Table 2, indicating that DivinEye can identify both unknown and known traffic.

[0118] Table 2 Classification accuracy of the complete test data of the two datasets

[0119] Dataset USTC-TFC2016 ISCXVPN2016 Class split (known / unknown) 10 / 10 6 / 4 The number of labels for each class 25 25 DivinEye classification accuracy 89.38 57.96

[0120] (4) Comparison of this method with other methods

[0121] In order to comprehensively evaluate the method of the present application, this embodiment compares DivinEye with a series of baseline methods and state-of-the-art models on the USTCTFC2016 dataset and the ISCXVPN dataset. For the USTCTFC2016 dataset, we considered three types of known / unknown class splits: 8 / 12, 10 / 10, and 12 / 8. For the ISCXVPN2016 dataset, we set a 6 / 4 split for the known / unknown classes. In addition, we randomly selected 4 or 25 samples from the training set of each known class as labeled traffic data, and the rest of the training set as unlabeled traffic data. Then a small amount of labeled data and a large amount of unlabeled data are used to train the entire model during the training process. The closed set classification accuracy (%) of the known class test data of the two datasets is shown in Table 3.

[0122] Table 3 Closed set classification accuracy of known class test data of two datasets (%)

[0123]

[0124]

[0125] 1) Closed set performance: Table 3 shows the closed set classification performance comparison of DivinEye with 8 baselines on the known class test data of the two datasets. It can be seen that DivinEye outperforms all baselines with significant improvement, with D1 flow detection accuracy of 93.56% (8 / 12, 4 labels) and 98.92% (8 / 12, 25 labels), and D2 flow detection accuracy of 54.23% (6 / 4, 4 labels) and 63.64% (6 / 4, 25 labels).

[0126] DivinEye achieves significant performance improvements over supervised methods (see Improvement 1 in Table II). For D1 traffic detection, the accuracy is improved by 9.52% (8 / 12, 4 labels), 6.55% (8 / 12, 25 labels), 10.6% (10 / 10, 4 labels), and 5.1% (10 / 10, 25 labels), respectively. For D2 traffic detection, the accuracy is improved by 4.15% (6 / 4, 4 labels) and 9.54% (6 / 4, 25 labels). The reasons why DivinEye outperforms supervised methods are as follows. Supervised methods only use a small amount of labeled data to train the model. In contrast, DivinEye trains the model with a small amount of labeled data and optimizes the known traffic detection model by selecting data of known categories from a large amount of unlabeled data. The rich information contained in these unlabeled data improves performance.

[0127] As can be seen from Table 3, DivinEye achieves better performance than the best baseline (marked with *) among the six semi-supervised methods. DivinEye still achieves significant performance improvement, with the accuracy of D1 traffic detection increased by 4.83% (8 / 12, 4 labels) and 3.57% (8 / 12, 25 labels), and the accuracy of D2 traffic detection increased by 0.33% (6 / 4, 4 labels) and 3.23% (6 / 4, 25 labels). These semi-supervised methods use different methods to utilize all incoming unlabeled data to enhance the performance of known traffic detection models. However, unlabeled traffic data may also contain unknown traffic, which can degrade the performance of known class traffic. In contrast, DivinEye selects known class traffic from unlabeled data, thereby using known class traffic to optimize the known traffic detection model and enhance its performance.

[0128] Compared to the OpenDetection method, DivinEye improves the performance by 3.1% (6 / 4, 4 labels) and 2.64% (6 / 4, 25 labels) on the D2 dataset. Although the OpenDetection method performs well, it still lags behind DivinEye. This is because OpenDetection excludes unknown traffic from unlabeled data and selects known class data to optimize the model. However, when labeled data is limited, its predictions for unknown samples may be unreliable. Unlike this method, our method combines the predictions of two classifiers to generate auxiliary labels for all unlabeled traffic, thereby selecting known traffic to optimize the model.

[0129] 2) Open set performance: Table 4 describes the open set classification accuracy (%) on the full test data of the two traffic datasets, which includes traffic samples of all known and unknown categories. Since semi-supervised methods cannot detect unknown traffic, we only compare DivinEye with the open set SSL method.

[0130] Table 4 Open set classification accuracy (%) of the complete test data of the two datasets,

[0131]

[0132] Note: These datasets consist of samples from all known classes and unknown classes.

[0133] As shown in Table 4, DivinEye outperforms the open-set SSL method, with D1 traffic detection accuracy improved by 3.78% (12 / 8, 4 labels) and 1.82% (12 / 8, 25 labels), and D2 traffic detection accuracy improved by 3.76% (6 / 4, 4 labels) and 4.65% (6 / 4, 25 labels), respectively. The OpenDetection method uses a multi-binary classifier to classify the unlabeled traffic data into known and unknown categories to detect unknown traffic. However, it discards the filtered unknown traffic data and only uses the known traffic to optimize the model. In contrast, DivinEye combines the results of the known classifier and the multi-binary classifier to generate auxiliary labels for all unlabeled traffic. We then use these generated labels as supervision to train the overall unknown traffic detection model using all unlabeled data. This allows us to fully utilize the information in the unlabeled data, thereby improving model performance. In addition, the known category traffic detected from the unlabeled data is used to optimize the known classifier. In this way, DivinEye can not only train models using unlabeled traffic data without manual annotation, but also effectively identify known and unknown traffic from newly emerging unlabeled data, thus satisfying two design principles.

[0134] (5) Ablation experiment

[0135] We conduct an ablation study on the learning objectives of DivinEye to further evaluate the benefits brought by each module. Table 5 shows the ablation results on the D1 dataset (10 / 10 class split, 25 labels per known class) and the D2 dataset (6 / 4 class split, 25 labels per known class). Baseline1 (B1) represents the use of The optimized framework, Baseline2 (B2) represents the use of The optimized framework, Baseline3 (B3) means using Optimized framework.

[0136] First, comparing Baseline1 and Baseline3, it is obvious that using The performance can be improved because it selects known class samples from unlabeled data for model optimization. Next, comparing Baseline2 and Baseline3, the performance of Baseline3 is significantly better than Baseline2. This shows the effectiveness of the multi-binary traffic detection model, which helps to select more accurate pseudo labels for unlabeled samples. In addition, this embodiment also compares baseline3 and the method of the present application DivinEye. It can be seen that DivinEye achieves excellent performance. This shows that building an unknown traffic detection model helps to identify unknown samples and further improve the overall performance. In summary, these results verify that the designed module can effectively improve the performance of the framework.

[0137] Table 5 Ablation experiment results on two datasets

[0138]

[0139] In one embodiment, Figure 6 As shown, a network traffic detection device based on open semi-supervised learning is provided, including: a training sample determination module, a known traffic detection model training module, a multi-binary traffic detection model training module, an unknown traffic detection model training module, a known traffic detection model optimization module and a network traffic detection module, wherein:

[0140] The training sample determination module is used to divide the acquired original traffic data into a first sample set and a second sample set; the first sample set includes all labeled traffic samples, and the second sample set includes all unlabeled traffic samples.

[0141] The known traffic detection model training module is used to train the known traffic detection model using the first sample set.

[0142] The multi-binary traffic detection model training module is used to train the multi-binary traffic detection model using the first sample set; wherein the multi-binary traffic detection model includes multiple sub-classifiers, each sub-classifier is a One-Vs-All binary classifier.

[0143] The unknown traffic detection model training module is used to generate an auxiliary label for each unlabeled traffic sample based on the probability obtained by inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model respectively; with the auxiliary label as supervision, the second sample set is used to train the unknown traffic detection model.

[0144] The known traffic detection model optimization module is used to select known class traffic samples from the second sample set as samples for model optimization according to the auxiliary labels, and optimize the known traffic detection model using the samples for model optimization.

[0145] The network traffic detection module is used to detect the traffic data to be detected using a known traffic detection model or an unknown traffic detection model in the trained network traffic detection model to obtain the network traffic detection result; the network traffic detection model includes: a known traffic detection model, a multi-binary traffic detection model and an unknown traffic detection model.

[0146] In one of the embodiments, the known traffic detection model includes a backbone network and a first classifier; the known traffic detection model training module is also used to extract features from the first sample set using the backbone network, and then map the extracted features to K-class probability distributions of the known class using the first classifier; the known traffic detection model is trained using standard cross entropy loss based on the probability distribution of each marked traffic and the corresponding label to obtain a trained known traffic detection model.

[0147] In one of the embodiments, the unknown traffic detection model training module is also used to select known class traffic samples from the second sample set according to the auxiliary label to obtain preliminary samples; optimize the preliminary samples using optimization loss to obtain samples for model optimization; and use the model optimization samples to optimize the trained known traffic detection model; wherein the optimization loss is shown in formula (2).

[0148] In one of the embodiments, the multi-binary traffic detection model training module is further used to input the first sample set into the corresponding sub-classifier in the multi-binary traffic detection model, output a two-dimensional vector, wherein the two dimensions of the two-dimensional vector respectively represent the probabilities of belonging to a known class and belonging to an unknown class; calculate the loss of the multi-binary traffic detection model according to the two-dimensional vector; train the multi-binary traffic detection model by minimizing the loss of the multi-binary traffic detection model to obtain a trained multi-binary traffic detection model; wherein the loss of the multi-binary traffic detection model is as shown in formula (3).

[0149] In one of the embodiments, the unknown traffic detection model training module is further used to input each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model for prediction, and generate an auxiliary label according to the output probability; the auxiliary label is shown in formula (4).

[0150] In one of the embodiments, the unknown traffic detection model training module is further used to input the second sample set into the unknown traffic detection model to obtain a predicted label; using the auxiliary label as supervision, the unknown traffic detection model loss is calculated according to the auxiliary label and the predicted label; the unknown traffic detection model is reversely trained according to the unknown traffic detection model loss to obtain a trained unknown traffic detection model; wherein the unknown traffic detection model loss is shown in formula (5).

[0151] In one of the embodiments, the network traffic detection module is also used to, if the traffic data to be detected only includes traffic data of known classes, use a known traffic detection model in a trained network traffic detection model to perform detection, so as to determine the known class to which the traffic data to be detected belongs; if the traffic data to be detected includes traffic data of known classes and unknown classes, use an unknown traffic detection model in a trained network traffic detection model to perform detection, so as to determine the category to which the traffic data to be detected belongs.

[0152] In one embodiment, the network traffic detection module also includes a network traffic detection model total loss function construction module before the network traffic detection module, which is used to construct the total loss function of the network traffic detection model; the parameters of the network traffic detection model are reversely trained according to the total loss function to obtain a trained network traffic detection model. The total loss function is shown in formula (9).

[0153] For the specific definition of the network traffic detection device based on open semi-supervised learning, please refer to the definition of the network traffic detection method based on open semi-supervised learning above, which will not be repeated here. Each module in the above-mentioned network traffic detection device based on open semi-supervised learning can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0154] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a network traffic detection method based on open semi-supervised learning is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0155] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0156] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above method embodiment when executing the computer program.

[0157] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0158] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A network traffic detection method based on open semi-supervised learning, It is characterized in that The method comprises: Dividing the acquired raw traffic data into a first sample set and a second sample set; the first sample set includes all marked traffic samples, and the second sample set includes all unmarked traffic samples; Using the first sample set to train a known flow detection model; The first sample set is used to train a multi-binary traffic detection model; wherein the multi-binary traffic detection model includes a plurality of sub-classifiers, each of which is a One-Vs-All binary classifier; Generate an auxiliary label for each unlabeled traffic sample according to the probability obtained by inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model respectively; Using the auxiliary label as supervision, and using the second sample set to train an unknown traffic detection model; According to the auxiliary label, select a known class of traffic samples from the second sample set as a sample for model optimization, and use the sample for model optimization to optimize the known traffic detection model; A known traffic detection model or an unknown traffic detection model in a trained network traffic detection model is used to detect the traffic data to be detected to obtain a network traffic detection result; the network traffic detection model includes: a known traffic detection model, a multi-binary traffic detection model and an unknown traffic detection model.

2. The method according to claim 1, It is characterized in that The known traffic detection model includes a backbone network and a first classifier; Using the first sample set to train a known traffic detection model includes: Extract features from the first sample set using the backbone network, and then map the extracted features to K-class probability distributions of known classes using a first classifier; The known traffic detection model is trained using standard cross entropy loss according to the probability distribution of each marked traffic and the corresponding label to obtain the trained known traffic detection model.

3. The method according to claim 1, It is characterized in that According to the auxiliary label, a known class of traffic samples are selected from the second sample set as samples for model optimization, and the known traffic detection model is optimized by using the samples for model optimization, including: Selecting a known class of traffic samples from the second sample set according to the auxiliary label to obtain a sample for model optimization; The model optimization sample is used to optimize the known traffic detection model after training according to the optimization loss; wherein the optimization loss is: in, To optimize the loss, τ q is the confidence threshold, For auxiliary labels, Output unlabeled samples u for the optimized known traffic detection model i The probability of belonging to a known class j, is the unlabeled sample u output by the trained multi-binary traffic detection model i The probability of not belonging to a known class j, is the indicator function, H(·) is the standard cross entropy loss, is the true label of the traffic sample, is the predicted label of the traffic sample.

4. The method according to claim 1, It is characterized in that The first sample set is used to train a multi-binary traffic detection model, including: Inputting the first sample set into a corresponding sub-classifier in a multi-binary traffic detection model, and outputting a two-dimensional vector, wherein two dimensions of the two-dimensional vector represent probabilities of belonging to a known class and an unknown class respectively; The loss of the multi-binary flow detection model is calculated based on the two-dimensional vector: in, is the multi-binary traffic detection model loss, For x i The probability of belonging to a known class, Represents x i The probability of belonging to the unknown class; B is the number of labeled samples in the first sample set; The multi-binary flow detection model is trained by minimizing the loss of the multi-binary flow detection model to obtain a trained multi-binary flow detection model.

5. The method according to claim 1, It is characterized in that According to the probability obtained by inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model, an auxiliary label for each unlabeled traffic sample is generated, including: Each unlabeled traffic sample is input into the trained known traffic detection model and the trained multi-binary traffic detection model for prediction, and an auxiliary label is generated according to the output probability; the auxiliary label is: in, is the unlabeled sample u i Auxiliary labels, K is the number of known classes, Output unlabeled samples u for the optimized known traffic detection model i The probability of belonging to a known class j; are the unlabeled samples u output by the trained multi-binary traffic detection model. i The probability of belonging to a known class j and the probability of not belonging to a known class j.

6. The method according to claim 1, It is characterized in that The second sample set is used to train the unknown traffic detection model using the auxiliary label as supervision. Inputting the second sample set into an unknown traffic detection model to obtain a predicted label; Taking the auxiliary label as supervision, the unknown flow detection model loss is calculated according to the auxiliary label and the predicted label; the unknown flow detection model loss is: in, is the unknown traffic detection model loss, τ q is the confidence threshold, is the indicator function, is the unlabeled sample u i Auxiliary tags, is the unlabeled sample u i The predicted label of is the standard cross entropy loss; The unknown flow detection model is reversely trained according to the unknown flow detection model loss to obtain a trained unknown flow detection model.

7. The method according to claim 1, It is characterized in that Use the known traffic detection model or unknown traffic detection model in the trained network traffic detection model to detect the traffic data to be detected, and obtain the network traffic detection results, including: If the traffic data to be detected only contains traffic data of known classes, a known traffic detection model in the trained network traffic detection model is used for detection to determine the known class to which the traffic data to be detected belongs; If the traffic data to be detected contains traffic data of known classes and unknown classes, the unknown traffic detection model in the trained network traffic detection model is used for detection to determine the category to which the traffic data to be detected belongs.

8. The method according to claim 1, It is characterized in that The known traffic detection model or the unknown traffic detection model in the trained network traffic detection model is used to detect the traffic data to be detected, and a network traffic detection result is obtained. The step also includes: Construct a total loss function for the network traffic detection model; the total loss function is: in, is the total loss function, is the known flow detection model loss, is the optimization loss of the known traffic detection model, is the multi-binary traffic detection model loss, is the unknown traffic detection model loss, λ kt , mb and λ ut are the weights of each learning objective. The parameters of the network traffic detection model are reversely trained according to the total loss function to obtain a trained network traffic detection model.

9. A network traffic detection device based on open semi-supervised learning, It is characterized in that The device comprises: A training sample determination module, used to divide the acquired original traffic data into a first sample set and a second sample set; the first sample set includes all labeled traffic samples, and the second sample set includes all unlabeled traffic samples; A known flow detection model training module, used for training a known flow detection model using the first sample set; A multi-binary traffic detection model training module, used for training a multi-binary traffic detection model using the first sample set; wherein the multi-binary traffic detection model includes a plurality of sub-classifiers, each of which is a One-Vs-All binary classifier; The unknown traffic detection model training module is used to generate an auxiliary label for each unlabeled traffic sample according to the probability obtained by inputting each unlabeled traffic sample into the trained known traffic detection model and the trained multi-binary traffic detection model respectively; and train the unknown traffic detection model using the second sample set with the auxiliary label as supervision; A known traffic detection model optimization module, configured to select a known class of traffic samples from the second sample set as a sample for model optimization according to the auxiliary label, and optimize the known traffic detection model using the sample for model optimization; The network traffic detection module is used to detect the traffic data to be detected using a known traffic detection model or an unknown traffic detection model in a trained network traffic detection model to obtain a network traffic detection result; the network traffic detection model includes: a known traffic detection model, a multi-binary traffic detection model and an unknown traffic detection model.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Unknown encrypted traffic fine granularity identification method and system based on semi-supervised learning, and storage medium

    CN122112779A

  • A semi-supervised learning-based unknown encrypted traffic fine-grained identification method and system and storage medium

    CN122112779B

  • Network intrusion detection method and system based on dual-model collaborative positive-unmarked learning

    CN122339860A