Abnormal traffic detection model training method and device based on semi-supervised learning

Through the training method of abnormal traffic detection model based on semi-supervised learning, the combination of labeled and label-free sample sets is solved, and the problem that the existing technology is difficult to prevent diversified abnormal traffic attacks is achieved, and efficient abnormal traffic detection and data privacy protection is achieved.

CN114039794BActive Publication Date: 2024-12-03ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111412298.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-11
Publication Date
2024-12-03
Estimated Expiration
2039-12-11

AI Technical Summary

Technical Problem

The existing technology is difficult to fully cover diversified abnormal traffic attacks, which makes it difficult for operators to prevent security protection strategies and lacks effective abnormal traffic detection solutions.

Method used

Using the abnormal traffic detection model training method based on semi-supervised learning, the model is trained by obtaining the marked and unlabeled training sample sets, and the training end conditions are determined based on the change rate of the abnormal prediction rate, and the label is not marked when necessary. Samples are annotated to enrich the marked sample set and improve model performance.

Benefits of technology

In the case of minimizing the application of labeled training samples, the performance of the abnormal traffic detection model is guaranteed, the abnormal traffic is effectively detected, and data privacy is protected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114039794B_ABST
    Figure CN114039794B_ABST
Patent Text Reader

Abstract

The embodiments of the present specification provide a method and device for training an abnormal traffic detection model based on semi-supervised learning. In this method, a training sample set of the abnormal traffic detection model is obtained, and the training sample set includes a labeled training sample set and an unlabeled training sample set; the current abnormal traffic detection model is trained by semi-supervised learning by using the current training sample set until the training end condition is met, and the training end condition includes: the change rate of the abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to the abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold. Using this method, model training can be achieved while protecting data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of Internet, and specifically, to a method and device for training an abnormal traffic detection model based on semi-supervised learning. Background Art

[0002] With the rapid development of network technology, network technology has been integrated into all aspects of people's lives, such as online taxi-hailing, online ticket purchase, etc. However, while the network brings many conveniences to people, it also brings some risks to people's lives, such as the risk of user privacy information leakage.

[0003] At present, hackers can constantly adjust their attack methods against the operator's server to bypass security facilities such as firewalls and invade the server. However, due to the diversity of attack risk types, the operator's security protection strategy is generally difficult to cover comprehensively and cannot prevent diverse abnormal traffic.

[0004] There is currently no better solution to the above problems in the industry. Summary of the invention

[0005] In view of the above problems, the embodiments of this specification provide a method and device for training an abnormal traffic detection model based on semi-supervised learning. Using this method and device, the abnormal traffic detection model is trained by semi-supervised learning, and the labeled training sample set is enriched in the continuous model training process, and the change rate of the abnormal prediction rate is used to determine whether to end the training process. It can achieve the performance of the abnormal traffic detection model while minimizing the use of labeled training samples, effectively detect abnormal traffic, and help protect data privacy.

[0006] According to one aspect of an embodiment of the present specification, a method for training an abnormal traffic detection model based on semi-supervised learning is provided, comprising: obtaining a training sample set of the abnormal traffic detection model, the training sample set comprising a labeled training sample set and an unlabeled training sample set, each training sample in the labeled training sample set having access traffic feature data and label data, and each training sample in the unlabeled training sample set having access traffic feature data; performing semi-supervised learning training on the current abnormal traffic detection model based on the current training sample set until a training end condition is met, wherein, when the training end condition is not met, marking at least one to-be-labeled training sample in the current unlabeled training sample set with a label to be added to the current labeled training sample set to carry out the next model training process, and the training end condition comprises: a change rate of the abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to the abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold.

[0007] Optionally, in an example of the above aspect, the method may further include: when the training end condition is not met, clustering the training samples in the training sample set; and determining the at least one to-be-labeled training sample from the current unlabeled training sample set according to the clustering result.

[0008] Optionally, in an example of the above aspect, determining the at least one to-be-labeled training sample from the current unlabeled training sample set according to the clustering result may include: determining the training sample whose clustering result is an outlier in the current unlabeled training sample set as the at least one to-be-labeled training sample.

[0009] Optionally, in an example of the above aspect, determining the at least one to-be-labeled training sample from the current unlabeled training sample set according to the clustering result may include: selecting at least one target cluster from each cluster in the clustering result; and determining the unlabeled training samples in the at least one target cluster as the at least one to-be-labeled training sample.

[0010] Optionally, in an example of the above aspect, selecting at least one target cluster from each cluster in the clustering results includes: determining, for each cluster in the clustering results, the proportion of labeled training samples in the cluster in the total labeled training samples; and determining the at least one target cluster based on the proportion of labeled samples in each cluster.

[0011] Optionally, in an example of the above aspect, it may also include: when the training end condition is not met, determining the training samples in the current unlabeled sample set that are within a predetermined classification probability interval as the at least one training sample to be labeled.

[0012] Optionally, in an example of the above aspect, when the training end condition is not met, an active learning method is used to label at least one training sample in the current unlabeled training sample set to add it to the current labeled training sample set for the next model training process.

[0013] According to another aspect of an embodiment of the present specification, a device for training an abnormal traffic detection model based on semi-supervised learning is provided, comprising: a training sample set acquisition unit, which acquires a training sample set of an abnormal traffic detection model, wherein the training sample set comprises a labeled training sample set and an unlabeled training sample set, wherein each training sample in the labeled training sample has access traffic feature data and label data, and each training sample in the unlabeled training sample set has access traffic feature data; a model training unit, which performs semi-supervised learning training on a current abnormal traffic detection model based on a current training sample set until a training end condition is met, wherein, when the training end condition is not met, at least one to-be-labeled training sample in the current unlabeled training sample set is labeled to be added to the current labeled training sample set to carry out the next model training process, wherein the training end condition comprises: a change rate of an abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to an abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold.

[0014] Optionally, in an example of the above aspect, the model training unit may include: a model prediction module, which provides the current training sample set to the current abnormal traffic detection model for abnormal prediction to determine the current abnormal prediction rate of each current unlabeled training sample in the current unlabeled training sample set; a change rate determination module, which determines the change rate of the current abnormal prediction rate of each current unlabeled training sample relative to the previous abnormal prediction rate of each current unlabeled training sample in the previous model training process; and a sample marking module, which, when the determined change rate is greater than a predetermined threshold, marks at least one to-be-marked training sample in the current unlabeled training sample set to add it to the current labeled training sample set to carry out the next model training process, wherein the model prediction module, the change rate determination module and the sample marking module operate cyclically until the training end condition is met.

[0015] Optionally, in an example of the above aspect, the sample labeling module may include: a to-be-labeled sample determination submodule, which determines at least one to-be-labeled training sample from the current unlabeled training sample set; and a sample labeling submodule, which labels the determined at least one to-be-labeled training sample to add it to the current labeled training sample set.

[0016] Optionally, in an example of the above aspect, the to-be-labeled sample determination submodule clusters the training samples in the training sample set, and determines the at least one to-be-labeled training sample from the current unlabeled training sample set according to the clustering result.

[0017] Optionally, in an example of the above aspect, the to-be-labeled sample determination submodule determines the training sample whose clustering result is an outlier in the current unlabeled training sample set as the at least one to-be-labeled training sample.

[0018] Optionally, in an example of the above aspect, the to-be-labeled sample determination submodule selects at least one target cluster from each cluster in the clustering result, and determines an unlabeled training sample in the at least one target cluster as the at least one to-be-labeled training sample.

[0019] Optionally, in an example of the above aspect, the submodule for determining the samples to be labeled determines the proportion of labeled training samples in the cluster in the total labeled training samples for each cluster in the clustering results, and determines the at least one target cluster based on the proportion of labeled samples in each cluster.

[0020] Optionally, in an example of the above aspect, the to-be-labeled sample determination submodule may determine a training sample in the current unlabeled sample set that is within a predetermined classification probability interval as the at least one to-be-labeled training sample.

[0021] According to another aspect of an embodiment of the present specification, there is also provided an electronic device, comprising: at least one processor; and a memory, wherein the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes the abnormal traffic detection model training method based on semi-supervised learning as described above.

[0022] According to another aspect of an embodiment of the present specification, a machine-readable storage medium is also provided, which stores executable instructions, and when the instructions are executed, the machine executes the abnormal traffic detection model training method based on semi-supervised learning as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] By referring to the following drawings, a further understanding of the nature and advantages of the embodiments of the present specification can be achieved. In the drawings, similar components or features may have the same reference numerals. The drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present specification, but do not constitute a limitation on the embodiments of the present specification. In the drawings:

[0024] Figure 1 A flowchart of an example of a method for training an abnormal traffic detection model based on semi-supervised learning according to an embodiment of this specification is shown;

[0025] Figure 2A flowchart showing an example of a process of marking training samples to be marked when a training end condition is not met according to an embodiment of the present specification;

[0026] Figure 3 A flowchart showing an example of a process of determining a training sample to be labeled from a current unlabeled training sample set according to an embodiment of the present specification;

[0027] Figure 4 A flowchart of an example of determining a training sample to be labeled according to a clustering result according to an embodiment of this specification is shown;

[0028] Figure 5 A flowchart showing an example of selecting at least one target cluster from each cluster in the clustering result according to an embodiment of the present specification;

[0029] Figure 6 A structural block diagram of an example of an abnormal traffic detection model training device based on semi-supervised learning according to an embodiment of this specification is shown;

[0030] Figure 7 A structural block diagram of an example of a model training unit according to an embodiment of this specification is shown;

[0031] Figure 8 A structural block diagram of an example of a sample marking module according to an embodiment of this specification is shown;

[0032] Fig. 9 A hardware structure diagram showing an example of an electronic device for abnormal traffic detection model training based on semi-supervised learning according to an embodiment of this specification; and

[0033] Fig.10 A schematic diagram of the architecture of an example of an abnormal traffic flow detection device based on an abnormal traffic flow detection model suitable for applying the embodiments of this specification is shown. DETAILED DESCRIPTION

[0034] The subject matter described herein will be discussed below with reference to example implementations. It should be understood that the discussion of these implementations is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not a limitation of the scope of protection, applicability or examples set forth in the claims. The functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the embodiment content of this specification. Various processes or components may be omitted, substituted or added to each example as needed. In addition, the features described relative to some examples may also be combined in other examples.

[0035] As used herein, the term "including" and its variations represent open terms, meaning "including but not limited to". The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other definitions may be included below, whether explicit or implicit. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout the specification.

[0036] The term "active learning" can mean that the algorithm actively proposes which samples need to be labeled. After these samples are manually labeled, they are added to the training sample set for training. The term "clustering" refers to the analytical process of grouping a collection of physical or abstract objects into multiple classes consisting of similar objects. It can be used to measure the similarity between different data in the data source and classify the data source into different clusters.

[0037] In addition, the term "abnormal traffic" can refer to abnormal access requests to the server, such as malicious attack requests or black market access requests, etc.

[0038] Figure 1 A flowchart of an example of a method for training an abnormal traffic detection model based on semi-supervised learning according to an embodiment of the present specification is shown.

[0039] like Figure 1 In the process 100 shown, in block 110, a training sample set of an abnormal traffic detection model is obtained, and the training sample set includes a labeled training sample set and an unlabeled training sample set. Specifically, each training sample in the labeled training sample has access traffic feature data and label data, and each training sample in the unlabeled training sample set has access traffic feature data but does not have corresponding label data. Here, the access traffic feature data can be feature data of information such as URL, HTTP request and user attributes, such as URL length, URL content information, URL information entropy, HTTP request header and HTTP request body information, etc.

[0040] In addition, the labeling data for the training samples in the labeled training sample set includes a positive label for indicating the presence of an abnormal traffic risk and a negative label for indicating the absence of an abnormal traffic risk, that is, the labeled training sample set includes positive label training samples and negative label training samples. In some embodiments, when the positive label training samples and the negative label training samples differ greatly, a sample balancing method can be used to balance the number of positive label samples and negative label samples. Exemplarily, when the proportion of positive label training samples in the labeled training sample set relative to the number of negative label training samples is lower than a set ratio threshold, upsampling is performed on the positive label training samples to achieve an expansion of the number of positive label training samples.

[0041] Next, the current abnormal traffic detection model can be trained by semi-supervised learning based on the current training sample set, that is, the operations of blocks 120 to 150 are executed in a loop until the training end condition is met, and the training end condition includes: the change rate of the abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to the abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold. Here, in different rounds of model training, the training sample sets used by the abnormal traffic detection model are different, so that the trained abnormal traffic detection models are different, and then for each unlabeled training sample in the current unlabeled training sample set, the abnormal prediction rates of the current abnormal traffic detection model and the previous abnormal traffic detection model may also change.

[0042] Specifically, in block 120, the current training sample set is provided to the current abnormal traffic detection model for abnormal prediction to determine the current abnormal prediction rate for each current unlabeled training sample in the current unlabeled training sample set. Here, the current abnormal prediction rate can be an abnormal prediction rate obtained by using the current abnormal traffic detection model to perform abnormal prediction on each unlabeled training sample in the current unlabeled training sample set.

[0043] Next, in block 130, the rate of change of the current abnormal prediction rate of each current unlabeled training sample relative to the previous abnormal prediction rate for each current unlabeled training sample in the previous model training process is determined. Here, as the model training process continues, the unlabeled training sample sets used in different model training processes are different. Exemplarily, if there are 80 unlabeled training samples in the current unlabeled training sample set, and there may be 100 unlabeled training samples in the previous unlabeled training sample set, the current abnormal traffic detection model and the previous abnormal traffic detection model can be used to determine the abnormal prediction rate of each of the 80 unlabeled training samples in the current unlabeled training sample set, and the difference between the two abnormal prediction rates of each unlabeled training sample is calculated, and the rate of change of the abnormal rate is calculated based on the difference in the abnormal prediction rate of each unlabeled training sample (i.e., 80 unlabeled training samples) in the current unlabeled training sample set. For example, the average value of the difference in the abnormal prediction rate of each unlabeled training sample can be calculated as the rate of change of the abnormal rate.

[0044] Next, in block 140, it is determined whether the determined rate of change is greater than a predetermined threshold. Here, the predetermined threshold may be predetermined through experience or multiple experiments. If the rate of change is greater than the predetermined threshold in block 140, the operation of block 150 is performed. In addition, when performing the first round of iterative training operations, there is no rate of change of the abnormal prediction rate, and the subsequent operations such as block 150 can be directly performed at this time.

[0045] In block 150, at least one to-be-labeled training sample in the current unlabeled training sample set may be labeled to be added to the current labeled training sample set to obtain an adjusted training sample set, and then the process returns to block 120, with the adjusted training sample set used as the current training sample set for the next model training process.

[0046] If the rate of change is not greater than the predetermined threshold in block 140 , then the training ends.

[0047] As described above, the labeled training sample set corresponding to the next round of model training process will be richer than the labeled training sample set corresponding to the previous round of model training process. Therefore, if a richer labeled training sample set is used in the current round of model training process, and no obvious change or optimization effect is achieved in the prediction results compared with the previous model training process (that is, the rate of change of the abnormal prediction rate corresponding to the current unlabeled training sample set is low), it can be determined that the model has basically converged. On the contrary, if the newly added labeled training samples cause a large fluctuation in the prediction results corresponding to two consecutive rounds of model training processes, it means that the model may need further optimization, for example, more new labeled training samples may need to be added.

[0048] Figure 2 A flowchart of an example of a process of labeling training samples to be labeled when a training end condition is not met according to an embodiment of the present specification is shown.

[0049] like Figure 2 In the process 200 shown, at block 210, at least one to-be-labeled training sample is determined from the current unlabeled training sample set. For example, the to-be-labeled training sample can be determined from the current unlabeled training sample set in a random manner or a specific manner.

[0050] Next, in block 220, the at least one determined training sample to be labeled is labeled to be added to the current labeled training sample set. Accordingly, the at least one labeled unlabeled training sample is removed from the current unlabeled training sample set, thereby obtaining a new current unlabeled training sample set and a new current labeled training sample set.

[0051] In an example of an embodiment of the present specification, when the training end condition is not met, an active learning method can be used to label at least one training sample in the current unlabeled training sample set to add it to the current labeled training sample set for the next model training process. Exemplarily, at least one training sample to be labeled can be determined in the current unlabeled training sample set based on various sample selection algorithms (for example, clustering algorithms or other selection algorithms), and the determined at least one training sample to be labeled can be provided to experts or R&D personnel so that the experts or R&D personnel can label the corresponding labels and update the labeled training sample set and the unlabeled training sample set. Therefore, in each round of model training, the unlabeled training samples are selected and labeled by active learning to enrich the labeled training sample set until the model converges, which can ensure that the abnormal traffic detection model has high performance.

[0052] Figure 3 A flowchart of an example of a process of determining a to-be-labeled training sample from a current unlabeled training sample set when a training end condition is not met according to an embodiment of the present specification is shown.

[0053] like Figure 3 In the process 300 shown, in block 310, clustering is performed on the training samples in the training sample set. For example, various types of clustering algorithms such as K-means algorithm, density clustering algorithm, etc. may be used for clustering.

[0054] Next, in block 320, at least one to-be-labeled training sample is determined from the current unlabeled training sample set according to the clustering result. Here, the clustering result may be a cluster and / or outlier determined by a clustering algorithm.

[0055] In an example of an embodiment of the present specification, a training sample whose clustering result is an outlier in the current unlabeled training sample set can be determined as at least one training sample to be labeled. Here, the training sample corresponding to the outlier is significantly different from the training sample group corresponding to each other cluster, and it is easier to find samples of previously ignored or unknown abnormal traffic types from the current unlabeled training samples corresponding to the outlier. Furthermore, by labeling the current unlabeled training samples corresponding to the discrete points, the recognition ability of the abnormal traffic detection model for more previously ignored or unknown abnormal type samples can be improved, thereby improving the performance of the model.

[0056] Figure 4 A flowchart of an example of determining training samples to be labeled according to clustering results according to an embodiment of the present specification is shown.

[0057] like Figure 4 In the process 400 shown, at block 410, at least one target cluster is selected from each cluster in the clustering result. For example, a sufficiently large cluster (e.g., exceeding a threshold) can be selected as the target cluster according to the size of the cluster. It should be understood that the target cluster can also be selected in other ways, and more details will be expanded below.

[0058] Next, in block 420, the unlabeled training samples in at least one target cluster are determined as at least one training sample to be labeled. Thus, there are commonalities between the training samples to be labeled determined based on the target cluster, so that R&D personnel or experts can more easily mark the corresponding label data on each training sample, which can effectively reduce the burden of manual labeling.

[0059] Figure 5 A flowchart showing an example of selecting at least one target cluster from clusters in a clustering result according to an embodiment of the present specification.

[0060] like Figure 5 In the process 500 shown, in block 510, for each cluster in the clustering result, the proportion of labeled training samples in the cluster to the total labeled training samples is determined. Here, the number of labeled training samples contained in each cluster in the clustering result may be different. For example, there are 100 labeled samples in the first cluster, and 2 labeled samples in the second cluster (that is, the proportion of labeled samples is too low), resulting in an unbalanced distribution of labeled samples in different clusters.

[0061] Next, in block 520, at least one target cluster is determined based on the proportion of labeled samples in each cluster. For example, a cluster whose proportion of labeled samples is lower than a set ratio threshold can be determined as a target cluster. Thus, it can be ensured that the proportion of labeled samples in the target cluster is low, and selecting the cluster as the target cluster can help balance the number of labeled training samples in different clusters, thereby improving the generalization ability of the model.

[0062] It should be noted that, in the embodiments of this specification, except for Figure 3-5 In addition to determining the training samples to be labeled by clustering, other methods can also be used to determine the training samples to be labeled.

[0063] In one example of an embodiment of the present specification, when the training end condition is not met, the training samples in the current unlabeled sample set that are within the predetermined classification probability interval are determined as at least one training sample to be labeled. Here, the predetermined classification probability interval can be used to distinguish abnormal traffic samples from normal traffic samples based on the abnormal rate of the sample. For example, when the abnormal rate predicted for the sample can be a value selected from 0 to 1, the predetermined classification probability interval can be 0.45 to 0.55 near 0.5. Therefore, by selecting at least one unlabeled training sample corresponding to the predetermined classification probability interval for labeling, the labeled training samples are enriched, and the recognition ability of the abnormal traffic detection model for normal data samples and abnormal data samples can be improved.

[0064] Figure 6 A structural block diagram of an example of an abnormal traffic detection model training device based on semi-supervised learning according to an embodiment of the present specification is shown.

[0065] like Figure 6 As shown, the model training device 600 includes a training sample set acquisition unit 610 and a model training unit 620.

[0066] The training sample set acquisition unit 610 is configured to acquire a training sample set of an abnormal traffic detection model, wherein the training sample set includes a labeled training sample set and an unlabeled training sample set, wherein each training sample in the labeled training sample set has access traffic feature data and label data, and each training sample in the unlabeled training sample set has access traffic feature data. The operation of the training sample set acquisition unit 610 may refer to the above reference Figure 1 The operations described in block 110 in FIG.

[0067] The model training unit 620 is configured to perform semi-supervised learning training on the current abnormal traffic detection model based on the current training sample set until the training end condition is met, wherein, when the training end condition is not met, at least one unlabeled training sample in the current unlabeled training sample set is labeled to be added to the current labeled training sample set for the next model training process, and the training end condition includes: the change rate of the abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to the abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold. The operation of the model training unit 620 can refer to the above reference Figure 1 The operations described in blocks 120-150 in FIG.

[0068] Figure 7 A structural block diagram of an example of a model training unit according to an embodiment of the present specification is shown.

[0069] like Figure 7 As shown, the model training unit 620 includes a model prediction module 710 , a change rate determination module 720 and a sample labeling module 730 .

[0070] The model prediction module 710 is configured to provide the current training sample set to the current abnormal traffic detection model for abnormal prediction to determine the current abnormal prediction rate for each current unlabeled training sample in the current unlabeled training sample set. The operation of the model prediction module 710 can refer to the above reference Figure 1 The operations described in block 120 in FIG.

[0071] The change rate determination module 720 is configured to determine the change rate of the current abnormal prediction rate of each current unlabeled training sample relative to the previous abnormal prediction rate for each current unlabeled training sample in the previous model training process. The operation of the change rate determination module 720 can refer to the above reference Figure 1 The operation of block 130 in FIG.

[0072] The sample marking module 730 is configured to mark at least one unlabeled training sample in the current unlabeled training sample set when the determined change rate is greater than a predetermined threshold value to add the mark to the current labeled training sample set for the next model training process, wherein the model prediction module 710, the change rate determination module 720 and the sample marking module operate cyclically until the training end condition is met. The operation of the sample marking module 730 can refer to the above reference Figure 1 The operations of blocks 140 and 150 in FIG.

[0073] Figure 8 A structural block diagram of an example of a sample marking module according to an embodiment of this specification is shown.

[0074] like Figure 8 As shown, the sample marking module 730 includes a to-be-marked sample determination submodule 731 and a sample marking submodule 732 .

[0075] The to-be-labeled sample determination submodule 731 is configured to determine at least one to-be-labeled training sample from the current unlabeled training sample set. The operation of the to-be-labeled sample determination submodule 731 may refer to the above reference Figure 2 The operation of block 210 described in .

[0076] The sample marking submodule 732 is configured to mark the at least one determined training sample to be marked so as to add it to the current marked training sample set. The operation of the sample marking submodule 732 can refer to the above reference Figure 2 The operation of block 220 described in .

[0077] In an example of an embodiment of the present specification, the to-be-labeled sample determination submodule 731 clusters the training samples in the training sample set, and determines the at least one to-be-labeled training sample from the current unlabeled training sample set according to the clustering result. For more details of the example of the embodiment of the present specification, please refer to the above reference Figure 3 The operations of flow 300 are described.

[0078] Furthermore, in one example, the to-be-labeled sample determination submodule 731 may determine the training sample whose clustering result is an outlier in the current unlabeled training sample set as the at least one to-be-labeled training sample.

[0079] In another example, the to-be-labeled sample determination submodule 731 may select at least one target cluster from each cluster in the clustering result, and determine the unlabeled training sample in the at least one target cluster as the at least one to-be-labeled training sample. Figure 4 The operations of flow 400 are described.

[0080] Optionally, the to-be-labeled sample determination submodule 731 may determine the proportion of labeled training samples in the cluster to the total labeled training samples for each cluster in the clustering result, and determine the at least one target cluster according to the proportion of labeled samples in each cluster. For more details, please refer to the above reference Figure 5 The operations of flow 500 are described.

[0081] In addition, optionally, in one example, the to-be-labeled sample determination submodule 731 may also determine a training sample in the current unlabeled sample set that is within a predetermined classification probability interval as at least one to-be-labeled training sample.

[0082] As above Figures 1 to 8 , describes an embodiment of an abnormal traffic detection model training method and device based on semi-supervised learning according to an embodiment of this specification. The details mentioned in the above description of the method embodiment are also applicable to the embodiment of the device of this specification. The above abnormal traffic detection model training method based on semi-supervised learning can be implemented by hardware, or by software, or a combination of hardware and software.

[0083] Fig. 9 FIG. 1 shows a hardware structure diagram of an example of an electronic device 900 for training an abnormal traffic detection model based on semi-supervised learning according to an embodiment of the present specification. Fig. 9 As shown, the electronic device 900 may include at least one processor 910, a memory (e.g., a non-volatile memory) 920, a storage 930, and a communication interface 940, and the at least one processor 910, the storage 920, the storage 930, and the communication interface 940 are connected together via a bus 960. At least one processor 910 executes at least one computer-readable instruction stored or encoded in the memory (i.e., the above-mentioned element implemented in the form of software).

[0084] In one embodiment, computer executable instructions are stored in a memory, which, when executed, enable at least one processor 910 to: obtain a training sample set of an abnormal traffic detection model, the training sample set including a labeled training sample set and an unlabeled training sample set, each training sample in the labeled training samples having access traffic feature data and label data, and each training sample in the unlabeled training sample set having access traffic feature data; perform semi-supervised learning training on the current abnormal traffic detection model based on the current training sample set until a training end condition is met, wherein, when the training end condition is not met, at least one to-be-labeled training sample in the current unlabeled training sample set is labeled to be added to the current labeled training sample set to perform the next model training process, and the training end condition includes: a change rate of the abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to the abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold.

[0085] It should be understood that the computer executable instructions stored in the memory 920, when executed, cause at least one processor 910 to perform the above combined operations in various embodiments of the present specification. Figure 1-8 Describes the various operations and functions.

[0086] In this specification, the electronic device 900 may include, but is not limited to: a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile electronic device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable electronic device, a consumer electronic device, and the like.

[0087] According to one embodiment, a program product such as a machine-readable medium is provided. The machine-readable medium may have instructions (i.e., the above-mentioned elements implemented in the form of software), which, when executed by a machine, causes the machine to perform the above-mentioned combination of various embodiments of this specification. Figure 1-8 Specifically, a system or device equipped with a readable storage medium may be provided, on which a software program code implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system or device reads and executes the instructions stored in the readable storage medium.

[0088] In this case, the program code itself read from the machine-readable medium can realize the function of any one of the above-mentioned embodiments, and thus the machine-readable code and the machine-readable storage medium storing the machine-readable code constitute a part of the present invention.

[0089] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.

[0090] Fig.10 A schematic diagram of the architecture of an example of an abnormal traffic flow detection device based on an abnormal traffic flow detection model suitable for applying the embodiments of this specification is shown.

[0091] like Fig.10 As shown, in the architecture 1000, at least one client can send an access request to the server 1020 through the network 1010 to request access to the data in the server. Here, the client can be a terminal device such as a desktop 1032, a laptop 1034, and a mobile phone 1036. In addition, the server 1020 provides services through a private data set. In one example of this specification, the private data set is stored on the server 1020, and in another example of this specification, the server 1020 can remotely call the private data set. In some application scenarios, hackers will use the client and use a variety of attack methods to steal private information through the server 1020, which poses a great challenge to the security of data privacy.

[0092] In the embodiment of the present specification, the abnormal traffic detection device 1040 can identify whether the access request belongs to abnormal traffic by calling the abnormal traffic detection model locally or remotely, and can perform corresponding security policy operations on the abnormal traffic (such as not executing a response or issuing an alarm). Figure 1 The abnormal traffic detection model trained by the method described above.

[0093] Those skilled in the art should understand that the various embodiments described above can be modified and altered in various ways without departing from the essence of the invention. Therefore, the protection scope of the present invention should be defined by the appended claims.

[0094] It should be noted that not all steps and units in the above-mentioned processes and system structure diagrams are necessary, and some steps or units can be ignored according to actual needs. The execution order of each step is not fixed and can be determined as needed. The device structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.

[0095] In the above embodiments, the hardware unit or module can be realized by mechanical or electrical means. For example, a hardware unit, module or processor can include permanent dedicated circuit or logic (such as special processor, FPGA or ASIC) to complete the corresponding operation. The hardware unit or processor can also include programmable logic or circuit (such as general-purpose processor or other programmable processor), which can be temporarily set by software to complete the corresponding operation. Specific implementation (mechanical method or dedicated permanent circuit or temporary circuit) can be determined based on cost and time consideration.

[0096] The specific embodiments described above in conjunction with the accompanying drawings describe exemplary embodiments, but do not represent all embodiments that can be implemented or fall within the scope of protection of the claims. The term "exemplary" used throughout this specification means "used as an example, instance or illustration" and does not mean "preferred" or "having advantages" over other embodiments. For the purpose of providing an understanding of the described technology, the specific embodiments include specific details. However, these technologies can be implemented without these specific details. In some instances, in order to avoid making the concepts of the described embodiments difficult to understand, well-known structures and devices are shown in block diagram form.

[0097] The above description of the present disclosure is provided to enable any person of ordinary skill in the art to implement or use the present disclosure. Various modifications to the present disclosure will be apparent to those of ordinary skill in the art, and the general principles defined herein may be applied to other variations without departing from the scope of protection of the present disclosure. Therefore, the present disclosure is not limited to the examples and designs described herein, but is consistent with the widest range of principles and novel features disclosed herein.

Claims

1. A method for training an abnormal traffic detection model based on semi-supervised learning, comprising: Obtaining a training sample set of an abnormal traffic detection model, the training sample set comprising a labeled training sample set and an unlabeled training sample set, each training sample in the labeled training sample set having access traffic feature data and labeled data, and each training sample in the unlabeled training sample set having access traffic feature data; The current abnormal traffic detection model is trained by semi-supervised learning using the current training sample set until the training end condition is met, wherein when the training end condition is not met, at least one unlabeled training sample in the current unlabeled training sample set is labeled to be added to the current labeled training sample set to obtain an adjusted training sample set, and the adjusted training sample set is used as the current training sample set to carry out the next model training process, The training end condition includes: the change rate of the abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to the abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold, Also includes: If the training end condition is not met, Clustering the training samples in the training sample set; determining the at least one to-be-labeled training sample from the current unlabeled training sample set according to a clustering result, wherein the clustering result includes outliers and each cluster, Wherein, according to the clustering result, determining the at least one to-be-labeled training sample from the current unlabeled training sample set comprises: The training samples whose clustering results are outliers in the current unlabeled training sample set are determined as the at least one training sample to be labeled.

2. The abnormal flow detection model training method according to claim 1, wherein: According to the clustering result, determining the at least one to-be-labeled training sample from the current unlabeled training sample set further comprises: Selecting at least one target cluster from each cluster in the clustering result; and The unlabeled training samples in the at least one target cluster are determined as the at least one training sample to be labeled.

3. The abnormal flow detection model training method according to claim 2, wherein: Selecting at least one target cluster from each cluster in the clustering result includes: For each cluster in the clustering result, determining the proportion of labeled training samples in the cluster to the total labeled training samples; The at least one target cluster is determined according to the proportion of labeled samples in each cluster.

4. The abnormal traffic detection model training method according to claim 1, further comprising: When the training end condition is not met, the training samples in the current unlabeled training sample set that are within a predetermined classification probability interval are determined as the at least one training sample to be labeled.

5. The abnormal traffic detection model training method according to any one of claims 1 to 4, wherein: When the training end condition is not met, an active learning method is used to label at least one training sample in the current unlabeled training sample set to add it to the current labeled training sample set for the next model training process.

6. A training device for an abnormal traffic detection model based on semi-supervised learning, comprising: A training sample set acquisition unit is used to acquire a training sample set of an abnormal traffic detection model, wherein the training sample set includes a labeled training sample set and an unlabeled training sample set, wherein each training sample in the labeled training sample set has access traffic feature data and label data, and each training sample in the unlabeled training sample set has access traffic feature data; The model training unit uses the current training sample set to perform semi-supervised learning training on the current abnormal traffic detection model until the training end condition is met, wherein, when the training end condition is not met, at least one to-be-labeled training sample in the current unlabeled training sample set is labeled to be added to the current labeled training sample set to obtain an adjusted training sample set, and the adjusted training sample set is used as the current training sample set to perform the next model training process, The training end condition includes: the change rate of the abnormal prediction rate for the current unlabeled training sample set in the current model training process relative to the abnormal prediction rate for the current unlabeled training sample set in the previous model training process is not greater than a predetermined threshold, The model training unit includes a sample marking module, which marks at least one to-be-marked training sample in the current unmarked training sample set to add it to the current marked training sample set when the training end condition is not met. The sample marking module comprises: a to-be-labeled sample determination submodule, clustering the training samples in the training sample set, and determining the training samples whose clustering results are outliers in the current unlabeled training sample set as the at least one to-be-labeled training sample; and The sample labeling submodule labels the determined at least one to-be-labeled training sample to add it into the current labeled training sample set.

7. The abnormal flow detection model training device according to claim 6, wherein: The model training unit also includes: A model prediction module provides the current training sample set to the current abnormal traffic detection model for abnormal prediction to determine a current abnormal prediction rate for each current unlabeled training sample in the current unlabeled training sample set; a change rate determination module, which determines a change rate of a current abnormal prediction rate of each current unlabeled training sample relative to a previous abnormal prediction rate for each current unlabeled training sample in a previous model training process, When the determined change rate is greater than a predetermined threshold, the sample marking module marks at least one to-be-marked training sample in the current unmarked training sample set to add it to the current marked training sample set for the next model training process. The model prediction module, the change rate determination module and the sample marking module operate in a loop until the training end condition is met.

8. The abnormal flow detection model training device according to claim 6, wherein: The to-be-marked sample determination submodule further: Selecting at least one target cluster from each cluster in the clustering result; as well as The unlabeled training samples in the at least one target cluster are determined as the at least one training sample to be labeled.

9. The abnormal flow detection model training device according to claim 8, wherein: The sample to be marked determination submodule: For each cluster in the clustering result, determining the proportion of labeled training samples in the cluster to the total labeled training samples; The at least one target cluster is determined according to the proportion of labeled samples in each cluster.

10. The abnormal flow detection model training device according to claim 6, wherein: The to-be-marked sample determination submodule further: The training samples in the current unlabeled sample set that are within a predetermined classification probability interval are determined as the at least one training sample to be labeled.

11. An electronic device, comprising: at least one processor; as well as A memory storing instructions, which, when executed by the at least one processor, causes the at least one processor to perform the method according to any one of claims 1 to 5.

12. A machine-readable storage medium storing executable instructions, which, when executed, cause the machine to perform the method according to any one of claims 1 to 5.