Semi-supervised iterative training method and system for anomaly detection classifier, medium and equipment

By using a pre-trained autoencoder to filter negative samples and dynamically adjust class weights in anomaly detection, the problems of pseudo-label noise and training instability in semi-supervised learning are solved, achieving an efficient and stable iterative training process and model performance.

CN121524632APending Publication Date: 2026-02-13YUNNAN POWER GRID CO LTD ELECTRIC POWER RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511721991.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing semi-supervised learning methods in the field of anomaly detection suffer from problems such as noise generated by pseudo-labels, fixed model bias, static adjustment of class weights, and instability in iterative training, making it difficult to guarantee model performance.

Method used

A pre-trained autoencoder is used to select initial negative samples, which are then combined with positive sample data to construct an initial training set. Pseudo-labeled samples are selected by dynamically adjusting class weights and confidence thresholds during iterative training. An independent validation dataset is used to monitor the iterative process, and a clear convergence condition is set to terminate the training.

Benefits of technology

It enables efficient mining of high-quality pseudo-labels from unlabeled data, ensuring the quality and representativeness of the training set, avoiding overfitting or insufficient training, and ensuring the stability and performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121524632A_ABST
    Figure CN121524632A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a semi-supervised iterative training method and system for an anomaly detection classifier, a medium and equipment. A semi-supervised iterative training method for an anomaly detection classifier comprises the following steps: receiving a positive sample data set with labels and a non-label data set, and dividing a training set and a verification set from positive samples; analyzing label-free data by using a pre-training auto-encoder, screening an initial negative sample according to a reconstruction error, and constructing an initial training set with the positive sample training set; in iterative training, using a current classifier to predict residual non-label data, and screening high-confidence pseudo-label samples according to a confidence threshold to expand a training set; after each round of iteration, the classifier performance is evaluated on the positive sample verification set, and whether training is terminated or not is judged according to convergence conditions, so that automation, stability and controllability of the training process are realized, the problem of overfitting or insufficient training is effectively avoided, and the performance of a final output model is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning model training technology, and in particular to a semi-supervised iterative training method, system, medium, and device for anomaly detection classifiers. Background Technology

[0002] In real-world machine learning applications, labeling high-quality training data is often costly and time-consuming. This is especially true in anomaly detection, where the rarity and complexity of anomalous events lead to an extreme scarcity of positive samples (anomaly samples), while a vast amount of unlabeled data remains unutilized. To effectively utilize this massive amount of unlabeled data, semi-supervised learning methods have been introduced into the field of anomaly detection.

[0003] Currently, most semi-supervised learning methods attempt to utilize some unlabeled data, such as traditional co-training and self-training methods. However, firstly, these methods often generate pseudo-labels through simple confidence thresholds, which easily introduce noise and lead to a decline in model performance. Especially in high-dimensional and complex feature spaces, simple confidence thresholds often fail to accurately identify high-quality pseudo-label samples. Existing technologies generally neglect how to intelligently construct the initial training set, particularly how to identify high-quality negative samples from massive amounts of unlabeled data. Furthermore, traditional self-training methods rely entirely on the classifier's own predictions to generate pseudo-labels, creating a self-reinforcing closed loop. If the initial model is biased, subsequent iterations will continuously re-incorporate incorrect predictions that conform to this bias as "high-confidence" pseudo-labels, causing errors to be continuously amplified and solidified, i.e., confirmation bias. Moreover, although some methods consider the problem of class imbalance in positive and negative samples, they usually employ fixed class weights or static sampling strategies, failing to adaptively adjust according to the dynamic changes in data distribution during training. Finally, many iterative training methods lack clear and objective stopping criteria, which can easily lead to overfitting or insufficient training, resulting in an unstable training process and making it difficult to guarantee the performance of the final model. Summary of the Invention

[0004] Based on this, it is necessary to propose a semi-supervised iterative training method, system, medium, and device for anomaly detection classifiers to address the above problems.

[0005] A semi-supervised iterative training method for anomaly detection classifiers, the method comprising: Receive a labeled positive sample dataset and an unlabeled dataset, and divide the positive sample dataset into a positive sample training dataset and a positive sample validation dataset.

[0006] The unlabeled dataset is analyzed using a pre-trained autoencoder. Initial negative samples are selected from the unlabeled dataset based on the reconstruction error output by the autoencoder, and these negative samples are used together with the positive sample training dataset to construct an initial training set.

[0007] In the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data, outputting the confidence score of the samples predicted as positive, and selecting pseudo-labeled samples with high confidence scores according to a preset confidence score threshold to expand the current training set. The current training set includes the training set used in the previous round of training and the training set of the high-confidence pseudo-labeled samples selected in the previous round.

[0008] After each iteration, the performance of the classifier trained in the current round is evaluated on the positive sample validation dataset, and the iterative training process is terminated based on the preset convergence condition.

[0009] The method further includes: Before the next round of training iterations begins, the class weight parameters of the classifier are adjusted based on the number of positive and negative samples in the expanded training set to obtain the updated classifier.

[0010] Specifically, adjusting the class weight parameters of the classifier based on the number of positive and negative samples in the expanded training set to obtain the updated classifier includes: according to Calculate the number of classes of negative samples in the current training set, where, The number of classes representing negative samples. For the i-th sample, Let i be the sample label of the i-th sample. =0 indicates a negative sample. This is the updated training set after the k-th iteration.

[0011] according to Calculate the number of classes of positive samples in the current training set, where, The number of positive samples in each category. The i-th sample, Let i be the sample label of the i-th sample. =1 indicates a positive sample. This is the updated training set after the k-th iteration.

[0012] according to By dynamically adjusting the class weight parameters in the classifier, we obtain a classifier with updated parameters. For category weight parameters, The number of classes representing negative samples. This represents the number of positive samples across different categories.

[0013] Specifically, the step of analyzing the unlabeled dataset using a pre-trained autoencoder, filtering negative samples based on the reconstruction error output by the autoencoder, and constructing an initial training set together with the positive sample training dataset includes: For each sample in the unlabeled dataset, the reconstruction error of the sample is calculated using a pre-trained autoencoder.

[0014] Based on the statistical distribution of the reconstruction error of each sample, a percentile value threshold is determined, and samples below the percentile value threshold are selected as initial negative samples. The initial negative samples are combined with the positive sample training dataset to construct an initial training set.

[0015] The autoencoder includes an encoder and a decoder, and the reconstruction error of the sample is calculated using the following formula:

[0016] in, Let be the reconstruction error of the i-th sample. For decoder, For the i-th sample, For encoder.

[0017] Specifically, in the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data, outputting the confidence score of samples predicted as positive, and selecting high-confidence pseudo-label samples according to a preset confidence threshold to expand the current training set. The current training set includes the initial training set and the training set of high-confidence pseudo-label samples selected in the previous round, specifically including: In the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data and output the confidence score of the samples predicted as positive. The remaining unlabeled data is the part of the unlabeled dataset that was not selected as pseudo-labeled samples in the previous round of iterative training. The current training set includes the initial training set and the training set of high-confidence pseudo-labeled samples selected in the previous round.

[0018] Set a two-sample confidence threshold, which includes a positive sample confidence threshold and a negative sample confidence threshold.

[0019] Samples whose confidence level is higher than the positive sample confidence threshold and lower than the negative sample confidence threshold are added to the current training set as pseudo-labeled samples, and these samples are removed from the unlabeled dataset. The pseudo-labeled samples include pseudo-positive samples and pseudo-negative samples.

[0020] The determination based on preset convergence conditions includes at least one of the following: The number of iterations has reached the preset maximum value.

[0021] The classifier's performance metrics on the positive sample validation dataset show an improvement value that is lower than a preset minimum improvement threshold for a predetermined number of consecutive rounds.

[0022] The classifier's performance metrics on the positive sample validation dataset decreased for a predetermined number of consecutive rounds.

[0023] A semi-supervised iterative training system for anomaly detection classifiers, the system comprising: The data receiving module is used to receive labeled positive sample datasets and unlabeled datasets to be detected for anomalies, and to divide the positive sample datasets into positive sample training datasets and positive sample validation datasets.

[0024] The initial training module is used to analyze the unlabeled dataset using a pre-trained autoencoder, filter initial negative samples based on the reconstruction error output by the autoencoder, and construct an initial training set together with the positive sample training dataset.

[0025] The pseudo-label generation and expansion module is used to predict the remaining unlabeled data using a classifier trained on the current training set in the current round of iterative training, output the confidence score of the sample predicted as positive, and select high-confidence pseudo-label samples to expand the current training set according to a preset confidence threshold. The current training set includes the initial training set and the training set of high-confidence pseudo-label samples selected in the previous round.

[0026] The convergence judgment module is used to evaluate the performance of the classifier trained in the current round on the positive sample validation dataset after each iteration, and to determine whether to terminate the iterative training process based on the preset convergence conditions.

[0027] A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method described above.

[0028] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method described above.

[0029] The embodiments of the present invention have the following beneficial effects: This invention first receives a small dataset of labeled positive samples and an unlabeled dataset to be detected for anomaly detection. It then divides the positive sample dataset into a positive sample training dataset and a positive sample validation dataset. By using an independent, pre-trained autoencoder to objectively select initial negative samples from the unlabeled dataset and combining them with the positive sample training dataset to construct the initial training set, the quality and representativeness of the initial training set are ensured. This lays a solid foundation for subsequent iterative training and guarantees the stability of the iterative process. Finally, through independent positive sample validation datasets and explicit convergence conditions for monitoring and control, the training process is automated, stable, and controllable, effectively avoiding overfitting or insufficient training and ensuring the performance of the final output model. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] in: Figure 1 This is a flowchart illustrating an embodiment of a semi-supervised iterative training method for an anomaly detection classifier provided by the present invention. Figure 2 This is a flowchart illustrating another embodiment of a semi-supervised iterative training method for an anomaly detection classifier provided by the present invention; Figure 3 This is a schematic diagram of an embodiment of a semi-supervised iterative training system for an anomaly detection classifier provided by the present invention; Figure 4 A schematic diagram of the structure of an embodiment of the device provided by the present invention; Figure 5 A schematic diagram of the structure of an embodiment of the medium provided by the present invention. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] like Figure 1 The above, Figure 1This is a flowchart illustrating an embodiment of a semi-supervised iterative training method for an anomaly detection classifier provided by the present invention. The method includes: S101: Receives a labeled positive sample dataset and an unlabeled dataset, and splits the positive sample dataset into a positive sample training dataset and a positive sample validation dataset.

[0034] For example, the data preparation is first carried out, which includes three datasets: the first is a small number of manually labeled initial positive sample sets P, which contain confirmed anomalous event data; the second is a large number of completely unlabeled unlabeled datasets U; and the third is a positive sample validation dataset that is pre-divided from the positive sample dataset and does not participate in any training process. This validation set is used to objectively evaluate the model performance during the iteration process and as the basis for convergence judgment.

[0035] S102: Analyze the unlabeled dataset using a pre-trained autoencoder, select initial negative samples from the unlabeled dataset based on the reconstruction error output by the autoencoder, and construct the initial training set together with the positive sample training dataset.

[0036] For example, all data samples in the unlabeled dataset U are fed one by one into a pre-trained autoencoder. This autoencoder consists of an encoder and a decoder, which, for each sample x in the unlabeled dataset U... i The reconstruction error is calculated using a pre-trained autoencoder: ; in, Let be the reconstruction error of the i-th sample. For decoder, For the i-th sample, For encoder.

[0037] Reconstruction error reflects the degree to which a sample deviates from the "normal pattern". The smaller the reconstruction error, the more the sample conforms to the normal distribution pattern learned during pre-training. By introducing an autoencoder, the normal pattern, i.e., negative samples, can be identified.

[0038] Furthermore, based on the statistical distribution of the reconstruction error for each sample, a percentile threshold is determined. This threshold is typically selected within the 5%-10% range. Samples below this threshold are chosen as the initial negative samples. The negative sample set RN is shown below: ; in, For the i-th sample, Let be the reconstruction error of the i-th sample. Let be the reconstruction error of the i-th sample.

[0039] Furthermore, the initial negative samples are combined with the positive sample training dataset P to construct the initial training set. As shown below: .

[0040] S103: In the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data, output the confidence of the samples predicted as positive, and select high-confidence pseudo-label samples according to the preset confidence threshold to expand the current training set. The current training set includes the training set used in the previous round of training and the training set of high-confidence pseudo-label samples selected in the previous round.

[0041] For example, high-quality pseudo-labeled samples are gradually mined from the unlabeled data pool through iterative self-training loops. Specifically, in the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data, and the confidence score of the samples predicted as positive samples is output. The remaining unlabeled data is the portion of the unlabeled dataset that was not selected as pseudo-labeled samples in the previous round of iterative training. The current training set includes the training set used in the previous round of training and the training set of high-confidence pseudo-labeled samples selected in the previous round. A confidence threshold for positive samples and a confidence threshold for negative samples are set. Samples with confidence scores higher than the positive sample confidence threshold and lower than the negative sample confidence threshold are added to the current training set as pseudo-labeled samples and removed from the unlabeled dataset. Pseudo-labeled samples include pseudo-positive samples and pseudo-negative samples.

[0042] S104: After each iteration, evaluate the performance of the classifier trained in the current round on the positive sample validation dataset, and determine whether to terminate the iterative training process based on the preset convergence condition.

[0043] For example, after each iteration, the performance of the classifier trained in the current iteration is evaluated on the positive sample validation dataset, and a decision is made on whether to terminate the iterative training process based on preset convergence conditions. Specifically, a minimum performance improvement threshold is set, for example, 0.005. When the performance improvement is lower than this threshold for three consecutive iterations, the model is considered to have converged; the performance metric of the classifier on the positive sample validation dataset improves for a predetermined number of consecutive iterations but is lower than the preset minimum improvement threshold; or a maximum number of iterations is set, usually 3-5 iterations, to prevent the training process from continuing indefinitely; or an early stopping mechanism is triggered when the performance metric of the classifier on the positive sample validation dataset decreases for two consecutive iterations.

[0044] As described above, this invention first receives a small dataset of labeled positive samples and an unlabeled dataset to be detected for anomaly detection. It then divides the positive sample dataset into a positive sample training dataset and a positive sample validation dataset. By using an independent, pre-trained autoencoder to objectively select initial negative samples from the unlabeled dataset and constructing an initial training set together with the positive sample training dataset, the quality and representativeness of the initial training set are ensured, laying a solid foundation for subsequent iterative training and guaranteeing the stability of the iterative process. Finally, through independent positive sample validation datasets and explicit convergence conditions for monitoring and control, the training process is automated, stable, and controllable, effectively avoiding overfitting or insufficient training and ensuring the performance of the final output model.

[0045] like Figure 2 The above, Figure 2 This is a flowchart illustrating another embodiment of a semi-supervised iterative training method for an anomaly detection classifier provided by the present invention. A semi-supervised iterative training method for an anomaly detection classifier includes: S201: Receives a labeled positive sample dataset and an unlabeled dataset, and splits the positive sample dataset into a positive sample training dataset and a positive sample validation dataset.

[0046] For example, the data preparation is first carried out, which includes three datasets: the first is a small number of manually labeled initial positive sample sets P, which contain confirmed anomalous event data; the second is a large number of completely unlabeled unlabeled datasets U; and the third is a positive sample validation dataset that is pre-divided from the positive sample dataset and does not participate in any training process. This validation set is used to objectively evaluate the model performance during the iteration process and as the basis for convergence judgment.

[0047] S202: For each sample in the unlabeled dataset, the reconstruction error of the sample is calculated using a pre-trained autoencoder.

[0048] For example, all data samples in the unlabeled dataset U are fed one by one into a pre-trained autoencoder. This autoencoder consists of an encoder and a decoder. For each sample xi in the unlabeled dataset U, its reconstruction error is calculated using the pre-trained autoencoder: ; in, Let be the reconstruction error of the i-th sample. For decoder, For the i-th sample, For encoder.

[0049] S203: Based on the statistical distribution of the reconstruction error of each sample, determine the percentile value threshold, select samples below the percentile value threshold as initial negative samples, and combine the initial negative samples with the positive sample training dataset to construct the initial training set.

[0050] For example, based on the statistical distribution of the reconstruction error of each sample, a percentile threshold is determined. The percentile threshold is typically selected in the range of 5%-10%. Samples below the percentile threshold are selected as the initial negative samples. The negative sample set RN is shown below: ; in, For the i-th sample, Let be the reconstruction error of the i-th sample. Let be the reconstruction error of the i-th sample.

[0051] Furthermore, the initial negative samples are combined with the positive sample training dataset P to construct the initial training set. As shown below: .

[0052] S204: In the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data and output the confidence of the samples predicted as positive. The remaining unlabeled data is the part of the unlabeled dataset that was not selected as pseudo-labeled samples in the previous round of iterative training. The current training set includes the initial training set and the training set of high-confidence pseudo-labeled samples selected in the previous round.

[0053] For example, high-quality pseudo-labeled samples are gradually mined from the unlabeled data pool through an iterative self-training loop. The loop is identified by an index k (k=0,1,2,...). Each loop aims to train a better classifier using the existing training set and use the classifier to mine new and reliable pseudo-labeled samples from the remaining unlabeled data to expand the training set.

[0054] It should be noted that in the iterative framework, the ratio of positive to negative samples in the training set changes dynamically with each round of spurious negative samples being added.

[0055] In the k-th iteration, the classifier is trained using the current training set Dk (Dk is D0, i.e., the initial training set, when k=0 in the first round; when k≥2, the current training set includes the current training set of the (k-1)-th round and the high-confidence pseudo-label samples selected in the (k-1)-th round). The trained classifier is used to predict the remaining unlabeled data Uk, and the confidence of the samples predicted as positive samples is output. The remaining unlabeled data Uk in the k-th round is the part of the initial unlabeled dataset U that was not selected as pseudo-label samples in the first k-1 iterations (Uk = unlabeled dataset - pseudo-label samples selected from the 1st to the (k-1)th rounds).

[0056] S205: Set the confidence threshold for positive samples and the confidence threshold for negative samples.

[0057] S206: Samples with confidence scores higher than the positive sample confidence threshold and lower than the negative sample confidence threshold are added to the current training set as pseudo-labeled samples, and these samples are removed from the unlabeled dataset. Pseudo-labeled samples include pseudo-positive samples and pseudo-negative samples.

[0058] For example, set a confidence threshold for positive samples and a confidence threshold for negative samples: the confidence threshold for positive samples is 0.985 and the confidence threshold for negative samples is 0.0150; samples with confidence higher than the confidence threshold for positive samples are considered pseudo-positive samples, samples with confidence lower than the confidence threshold for negative samples are considered pseudo-negative samples, and pseudo-positive and pseudo-negative samples are considered pseudo-labeled samples and added to the current training set, while the sample is removed from the unlabeled dataset U.

[0059] S207: Before the next round of training iterations begins, adjust the class weight parameters of the classifier based on the number of positive and negative samples in the current expanded training set to obtain the updated classifier.

[0060] For example, before the next iteration of training begins, the class proportions in the training set are recalculated. Specifically, the current training set Dk is first analyzed to count the number of positive and negative samples. The number of negative samples in the current training set is then calculated using the formula shown below: ; in, The number of classes representing negative samples. For the i-th sample, Let i be the sample label of the i-th sample. =0 indicates a negative sample. This is the updated training set after the k-th iteration.

[0061] The number of positive samples in the current training set is calculated using the formula shown below: ; in, The number of positive samples in each category. The i-th sample, Let i be the sample label of the i-th sample. =1 indicates a positive sample. This is the training set updated after the k-th iteration; Furthermore, based on the statistical results, the class weight parameters in the classifier are dynamically adjusted according to the formula shown below, resulting in the updated classifier: ; in, For category weight parameters, The number of classes representing negative samples. This represents the number of positive samples across different categories.

[0062] In this embodiment, an efficient implementation of the gradient boosting decision tree model, namely the XGBoost classifier, is selected as the anomaly detection classifier to be trained. The XGBoost classifier provides a hyperparameter called `scale_pos_weight` specifically designed to handle class imbalance. Its function is to assign higher weights to the loss term for positive samples when calculating the loss function. By setting the value of the `scale_pos_weight` parameter to the newly calculated class weights, the updated classifier is obtained. This allows the model to focus more on the scarce positive samples during training, effectively mitigating the negative impact of class imbalance. This dynamic adjustment ensures that in each iteration, regardless of changes in the training set, the classifier optimizes for the most realistic sample distribution, especially ensuring that the focus on the persistently scarce positive samples is not diluted by the increase in negative samples.

[0063] S208: After each iteration, evaluate the performance of the classifier trained in the current round on the positive sample validation dataset, and determine whether to terminate the iterative training process based on the preset convergence condition.

[0064] For example, after each iteration, the performance of the classifier trained in the current iteration is evaluated on the positive sample validation dataset, and a decision is made whether to terminate the iterative training process based on a preset convergence condition. The preset convergence condition includes at least one of the following: the number of iterations reaches a preset maximum value; the improvement value of the classifier's performance metric on the positive sample validation dataset is lower than a preset minimum improvement threshold for a predetermined number of consecutive iterations; or the classifier's performance metric on the positive sample validation dataset decreases for a predetermined number of consecutive iterations.

[0065] As described above, this invention dynamically adjusts the class weight parameters based on the changes in the ratio of positive and negative samples in each iteration, ensuring that the model always maintains sensitivity to the minority class (abnormal class), thus avoiding the limitations of traditional static weight methods.

[0066] like Figure 3 As shown, Figure 3 This is a schematic diagram illustrating an embodiment of a semi-supervised iterative training system for an anomaly detection classifier provided by the present invention. A semi-supervised iterative training system 10 for an anomaly detection classifier includes: The data receiving module 11 is used to receive the labeled positive sample dataset and the unlabeled dataset to be detected for anomalies, and to divide the positive sample dataset into a positive sample training dataset and a positive sample validation dataset.

[0067] The initial training module 12 is used to analyze the unlabeled dataset using a pre-trained autoencoder, filter initial negative samples based on the reconstruction error output by the autoencoder, and construct the initial training set together with the positive sample training dataset.

[0068] The pseudo-label generation and expansion module 13 is used to predict the remaining unlabeled data using the classifier trained on the current training set in the current round of iterative training, output the confidence of the sample predicted as positive, and select pseudo-label samples with high confidence according to the preset confidence threshold to expand the current training set. The current training set includes the initial training set and the training set of the high-confidence pseudo-label samples selected in the previous round.

[0069] The convergence judgment module 14 is used to evaluate the performance of the classifier trained in the current round on the positive sample validation dataset after each iteration, and to determine whether to terminate the iterative training process based on the preset convergence conditions.

[0070] For example, in the data receiving module 11, a labeled positive sample dataset and an unlabeled dataset to be detected are received, and the positive sample dataset is divided into a positive sample training dataset and a positive sample validation dataset. In the initial training dataset construction module 12, for each sample in the unlabeled dataset, the reconstruction error of the sample is calculated using a pre-trained autoencoder; based on the statistical distribution of the reconstruction error of each sample, a percentile value threshold is determined, and samples below the percentile value threshold are selected as initial negative samples. The initial negative samples are combined with the positive sample training dataset to construct the initial training set. In the pseudo-label generation and expansion module 13, in the current round of iterative training, the classifier trained based on the current training set is used to predict the remaining unlabeled data, outputting the confidence score of the predicted positive samples. The remaining unlabeled data is the portion of the unlabeled dataset that was not selected as pseudo-labeled samples in the previous round of iterative training. The current training set includes the initial training set and the training set of high-confidence pseudo-labeled samples selected in the previous round. A two-sample confidence threshold is set, including a positive sample confidence threshold and a negative sample confidence threshold. Samples with confidence scores higher than the positive sample confidence threshold or lower than the negative sample confidence threshold are added to the current training set as pseudo-labeled samples and removed from the unlabeled dataset. Pseudo-labeled samples include pseudo-positive samples and pseudo-negative samples. In the convergence judgment module 14, after each round of iteration, the performance of the classifier trained in the current round is evaluated on the positive sample validation dataset, and a decision is made on whether to terminate the iterative training process based on preset convergence conditions. The convergence criteria are determined based on at least one of the following: the number of iterations reaches a preset maximum value; the improvement value of the classifier's performance index on the positive sample validation dataset for a predetermined number of consecutive iterations is lower than a preset minimum improvement threshold; or the classifier's performance index on the positive sample validation dataset decreases for a predetermined number of consecutive iterations.

[0071] like Figure 4 As shown, Figure 4 This is a schematic diagram of an embodiment of the device provided by the present invention. The device 20 includes a memory 21 and a processor 22. The memory 21 stores a computer program, and the processor 22 executes the computer program during operation to achieve, for example... Figure 1 and Figure 2 The method shown.

[0072] The specific technical details of the semi-supervised iterative training method for anomaly detection classifier implemented by the aforementioned device 20 when executing the computer program have been discussed in detail in the above method steps, and therefore will not be repeated here.

[0073] like Figure 5 As shown, Figure 5This is a schematic diagram of the structure of an embodiment of the medium provided by the present invention. The medium 30 stores at least one computer program 31, which is executed by the processor 22 to perform the following... Figure 1 and Figure 2 The method shown is detailed above and will not be repeated here. In one embodiment, the medium 30 can be a storage chip, hard disk, portable hard disk, USB flash drive, optical disk, or other read / write storage device, or even a server, etc.

[0074] Furthermore, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific or sequential order shown to achieve the desired result. In some implementations, multitasking and parallel processing are possible or may be advantageous.

[0075] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, devices, and non-volatile computer-readable storage media are basically similar to the method embodiments, and therefore described more simply; relevant parts can be referred to the descriptions of the method embodiments.

[0076] The apparatus, device, non-volatile computer-readable storage medium and method provided in the embodiments of this specification are corresponding. Therefore, the apparatus, device and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding apparatus, device and non-volatile computer storage medium will not be repeated here.

[0077] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0078] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components. Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0079] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0080] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0081] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0082] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0083] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0084] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0085] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0086] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0087] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0088] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A semi-supervised iterative training method for anomaly detection classifiers, characterized in that, The method includes: Receive a labeled positive sample dataset and an unlabeled dataset, and divide the positive sample dataset into a positive sample training dataset and a positive sample validation dataset; The unlabeled dataset is analyzed using a pre-trained autoencoder. Initial negative samples are selected from the unlabeled dataset based on the reconstruction error output by the autoencoder, and these negative samples are then used together with the positive sample training dataset to construct an initial training set. In the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data, output the confidence of the samples predicted as positive, and select pseudo-label samples with high confidence according to the preset confidence threshold to expand the current training set. The current training set includes the training set used in the previous round of training and the training set of the high-confidence pseudo-label samples selected in the previous round. After each iteration, the performance of the classifier trained in the current round is evaluated on the positive sample validation dataset, and the iterative training process is terminated based on the preset convergence condition.

2. The semi-supervised iterative training method for anomaly detection classifiers according to claim 1, characterized in that, The method further includes: Before the next round of training iterations begins, the class weight parameters of the classifier are adjusted based on the number of positive and negative samples in the expanded training set to obtain the updated classifier.

3. The semi-supervised iterative training method for anomaly detection classifiers according to claim 2, characterized in that, The step of adjusting the class weight parameters of the classifier based on the number of positive and negative samples in the expanded training set to obtain the updated classifier specifically includes: according to Calculate the number of classes of negative samples in the current training set, where, The number of classes representing negative samples. For the i-th sample, Let i be the sample label of the i-th sample. =0 indicates a negative sample. This is the training set updated after the k-th iteration; according to Calculate the number of classes of positive samples in the current training set, where, The number of positive samples in each category. For the i-th sample, Let i be the sample label of the i-th sample. =1 indicates a positive sample. This is the training set updated after the k-th iteration; according to By dynamically adjusting the class weight parameters in the classifier, we obtain a classifier with updated parameters. For category weight parameters, The number of classes representing negative samples. This represents the number of positive samples across different categories.

4. The semi-supervised iterative training method for anomaly detection classifiers according to claim 1, characterized in that, The process of analyzing the unlabeled dataset using a pre-trained autoencoder, filtering negative samples based on the reconstruction error output by the autoencoder, and constructing an initial training set together with the positive sample training dataset specifically includes: For each sample in the unlabeled dataset, the reconstruction error of the sample is calculated using a pre-trained autoencoder; Based on the statistical distribution of the reconstruction error of each sample, a percentile value threshold is determined, and samples below the percentile value threshold are selected as initial negative samples. The initial negative samples are combined with the positive sample training dataset to construct an initial training set.

5. The semi-supervised iterative training method for anomaly detection classifiers according to claim 4, characterized in that, The autoencoder includes an encoder and a decoder, and the reconstruction error of the sample is calculated using the following formula: in, Let be the reconstruction error of the i-th sample. For decoder, For the i-th sample, For encoder.

6. The semi-supervised iterative training method for anomaly detection classifiers according to claim 1, characterized in that, In the current round of iterative training, the classifier trained on the current training set is used to predict the remaining unlabeled data, outputting the confidence score of samples predicted as positive, and selecting high-confidence pseudo-label samples according to a preset confidence threshold to expand the current training set. The current training set includes the initial training set and the training set of high-confidence pseudo-label samples selected in the previous round, specifically including: In the current round of iterative training, the classifier trained based on the current training set is used to predict the remaining unlabeled data and output the confidence of the samples predicted as positive samples. The remaining unlabeled data is the part of the unlabeled dataset that was not selected as pseudo-labeled samples in the previous round of iterative training. The current training set includes the initial training set and the training set of high-confidence pseudo-labeled samples selected in the previous round. Set a two-sample confidence threshold, which includes a positive sample confidence threshold and a negative sample confidence threshold; Samples whose confidence level is higher than the positive sample confidence threshold and lower than the negative sample confidence threshold are added to the current training set as pseudo-labeled samples, and these samples are removed from the unlabeled dataset. The pseudo-labeled samples include pseudo-positive samples and pseudo-negative samples.

7. The semi-supervised iterative training method for anomaly detection classifiers according to claim 1, characterized in that, The determination based on the preset convergence condition includes at least one of the following: The number of iterations has reached the preset maximum value; The classifier's performance metrics on the positive sample validation dataset improve by less than a preset minimum improvement threshold for a predetermined number of consecutive rounds. The classifier's performance metrics on the positive sample validation dataset decreased for a predetermined number of consecutive rounds.

8. A semi-supervised iterative training system for anomaly detection classifiers, characterized in that, The system includes: The data receiving module is used to receive the labeled positive sample dataset and the unlabeled dataset to be detected for anomalies, and to divide the positive sample dataset into a positive sample training dataset and a positive sample validation dataset. The initial training module is used to analyze the unlabeled dataset using a pre-trained autoencoder, filter initial negative samples based on the reconstruction error output by the autoencoder, and construct an initial training set together with the positive sample training dataset. The pseudo-label generation and expansion module is used to predict the remaining unlabeled data using a classifier trained on the current training set in the current round of iterative training, output the confidence of the samples predicted as positive, and select pseudo-label samples with high confidence according to a preset confidence threshold to expand the current training set. The current training set includes the initial training set and the training set of high-confidence pseudo-label samples selected in the previous round. The convergence judgment module is used to evaluate the performance of the classifier trained in the current round on the positive sample validation dataset after each iteration, and to determine whether to terminate the iterative training process based on the preset convergence conditions.

9. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method as claimed in any one of claims 1 to 7.

10. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as claimed in any one of claims 1 to 7.