Model Training Method, Device, Storage Medium, and Computer Equipment

By processing the classification learning model of industrially collected data in real time, filtering probability and weights, and adjusting classifier parameters, the high cost and time-consuming problems caused by data imbalance are solved, and the model training efficiency and adaptability are improved.

CN120067696BActive Publication Date: 2025-07-22PENG CHENG LAB
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510478996.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2025-07-22
Estimated Expiration
2045-04-16

AI Technical Summary

Technical Problem

When facing rare and sudden abnormal events in industrial production, the prior art leads to unbalanced data and changes in prior distribution, resulting in high cost and time-consuming model training, making it difficult to adapt to industrial scenarios with high real-time requirements.

Method used

By obtaining the currently collected data, using the classifier in the classification learning model for real-time prediction, filtering out the target prediction probability and balance weight with the highest probability, determining whether to query the data, and adjusting the target classifier parameters when the loss value exceeds the threshold, avoiding batch learning strategies.

Benefits of technology

It realizes real-time processing of single collected data in industrial scenarios, reducing training costs, reducing time-consuming, improving training efficiency, and adapting to the changing needs of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067696B_ABST
    Figure CN120067696B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a model training method, device, storage medium, and computer device. By obtaining current acquisition data; inputting the acquisition data into a classification learning model, and predicting the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type; screening out the target prediction probability with the largest probability from each prediction probability, and obtaining the current target balance weight of the first type corresponding to the target classifier of the target prediction probability; determining whether to query the acquisition data based on the target prediction probability and the target balance weight; when it is determined not to query the acquisition data, determining a loss value based on the target prediction probability and the preset label value of the type label of the first type; when the loss value is greater than a preset loss threshold, adjusting the parameters of the target classifier to obtain a classification learning model with adjusted parameters, thereby improving the training efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of model training, and particularly to a model training method, apparatus, storage medium, and computer device. Background Art

[0002] Due to the high reliability and stability in the industrial production process, some abnormal events are often rare and sudden, resulting in unbalanced data of different categories and the ratio changing over time, causing the prior distribution of abnormal data to change over time, resulting in the phenomenon of prior drift.

[0003] In related technologies, some methods have been studied to try to solve the challenges brought by the prior drift phenomenon. However, some methods focus on the dynamic imbalance problem and adopt a batch learning strategy, lacking the ability of continuous learning. As a result, when dealing with new abnormal data, full-scale training is required to update the model, which is difficult to adapt to the industrial scenario with high real-time requirements and continuous data arrival, resulting in a large training cost and a long training time for the model. Therefore, related technologies urgently need to propose a model training method to solve the above technical problems. Summary of the Invention

[0004] The main purpose of this application is to provide a model training method, apparatus, storage medium, and computer device, which can avoid adopting a batch learning strategy, thereby reducing the training cost of the model, reducing the training time, and improving the training efficiency.

[0005] In a first aspect, an embodiment of this application provides a model training method, including:

[0006] Obtain current collected data;

[0007] Input the collected data into a classification learning model, and predict the collected data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the type includes multiple abnormal types and a normal type;

[0008] Select the target prediction probability with the largest probability from each of the prediction probabilities, and obtain the current target balance weight of the first type corresponding to the target prediction probability of the target classifier;

[0009] Based on the target prediction probability and the target balance weight, determine whether to query the collected data;

[0010] When it is determined not to query the collected data, determine a loss value based on the target prediction probability and the preset label value of the type label of the first type;

[0011] When the loss value is greater than a preset loss threshold, adjust the parameters of the target classifier to obtain a classification learning model with adjusted parameters.

[0012] In a second aspect, an embodiment of the present application provides a model training device, including:

[0013] A first acquisition unit, configured to acquire current acquisition data;

[0014] A prediction unit, configured to input the acquisition data into a classification learning model, and perform prediction on the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type;

[0015] A second acquisition unit, configured to screen out the target prediction probability with the largest probability from each of the prediction probabilities, and acquire the current target balance weight of the first type corresponding to the target prediction probability of the target classifier;

[0016] A first determination unit, configured to determine whether to query the acquisition data based on the target prediction probability and the target balance weight;

[0017] A second determination unit, configured to, when it is determined not to query the acquisition data, determine a loss value based on the target prediction probability and a preset label value of the type label of the first type;

[0018] An adjustment unit, configured to, when the loss value is greater than a preset loss threshold, perform parameter adjustment on the target classifier to obtain a classification learning model with adjusted parameters.

[0019] In a third aspect, an embodiment of the present application provides a storage medium. The computer-readable storage medium stores multiple instructions, and these instructions are suitable for being loaded by a processor to execute the model training method as described in any one of the above.

[0020] In a fourth aspect, an embodiment of the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the model training method as described in any one of the above is implemented.

[0021] In an embodiment of the present application, by obtaining current acquisition data; inputting the acquisition data into a classification learning model, and predicting the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type; screening out the target prediction probability with the largest probability from each of the prediction probabilities, and obtaining the current target balance weight of the first type corresponding to the target classifier of the target prediction probability; determining whether to query the acquisition data based on the target prediction probability and the target balance weight; when it is determined not to query the acquisition data, determining a loss value based on the target prediction probability and a preset label value of the type label of the first type; when the loss value is greater than a preset loss threshold, adjusting the parameters of the target classifier to obtain a classification learning model with adjusted parameters. Compared with the related art where the batch learning strategy results in a large training cost and time consumption, the embodiment of the present application operates based on obtaining current acquisition data, which means it can accept newly arrived data at any time and immediately input it into the classification learning model for prediction and subsequent processing. Unlike the batch learning strategy that requires accumulating a certain amount of data to form a batch before learning, this real-time processing method for individual acquisition data is more suitable for the industrial scenario where data continuously arrives, has the basis for continuous learning, can respond to and analyze new data in a timely manner, rather than waiting until all the data is collected before training, thereby avoiding the batch learning strategy, reducing the training cost of the model, reducing the training time consumption, and improving the training efficiency.

[0022] Other features and advantages of the present disclosure will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present disclosure. The objectives and other advantages of the present disclosure can be realized and obtained by the structures specifically pointed out in the specification, the claims, and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0024] Figure 1 It is a schematic diagram of the scenario of the model training system provided by the embodiment of the present application.

[0025] Figure 2 It is a schematic flowchart of the model training method provided by the embodiment of the present application.

[0026] Figure 3A schematic structural diagram of the model training device provided by an embodiment of the present application.

[0027] Figure 4 A schematic structural diagram of the computer device provided by an embodiment of the present application. Detailed implementation manners

[0028] In order to enable those skilled in the art of the present technology to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present application.

[0029] It should be noted that in some processes described in the specification, the claims and the above-mentioned drawings, there are multiple steps that appear in a specific order. However, it should be clearly understood that these steps may not be executed in the order in which they appear in this document or may be executed in parallel. The step numbers are only used to distinguish different steps, and the numbers themselves do not represent any execution order. In addition, descriptions such as "first", "second" or "target" in this document are used to distinguish similar objects and do not necessarily describe a specific order or sequence.

[0030] Before further elaborating on the embodiments of the present disclosure, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are applicable to the following explanations:

[0031] The kernel function is a function used to measure the similarity between two samples. Given two input data x_1 and x_2, the kernel function returns a scalar value indicating the similarity degree of these two data. From a mathematical perspective, the kernel function actually defines an implicit mapping from the original input space to the feature space. It does not need to explicitly calculate this mapping, but obtains the inner product in the feature space by calculating a certain combination of samples in the original space.

[0032] In many machine learning algorithms (such as support vector machines, SVMs), the main role of the kernel function is to map the original data from a low-dimensional space that may be linearly inseparable to a high-dimensional feature space, so that the data becomes linearly separable in this high-dimensional space.

[0033] For example, in a two-dimensional plane, there are two types of data points (such as circles and squares), which can be separated by a complex curve (non-linear boundary). After mapping these data points to a high-dimensional space through the kernel function, they may be separable by a hyperplane (linear boundary).

[0034] Since the kernel function does not need to explicitly calculate the mapping from the original space to the high-dimensional space, but directly calculates the similarity measure in the original space, this greatly reduces the computational amount. If the mapping is to be carried out explicitly, calculating vector operations in the high-dimensional space would be very complex and time-consuming.

[0035] For example, assume that the data is mapped from a three-dimensional space to a ten-dimensional space. If the inner product of the vectors after the mapping is calculated explicitly, the computational amount will increase significantly. While using the kernel function, the inner product operation in the ten-dimensional space can be simulated through simple calculations in the three-dimensional space.

[0036] The Poisson distribution is a discrete probability distribution used to describe the probability of the number of rare events occurring within a fixed time interval, spatial range, or other specific observation ranges.

[0037] For example, the number of calls received by a telephone switchboard within a certain period of time, the number of a certain rare plant found on a certain area of land, the number of particles emitted by a radioactive substance within a certain time, etc. These events occur with a relatively low frequency, and under the given observation conditions, the occurrence of the events is random. The Poisson distribution can model the probability of the number of occurrences of such events.

[0038] Support vector: In a support vector machine (SVM), a support vector is a sample point that plays a key role in determining the classification hyperplane. For a linearly separable data set, the support vectors are the sample points located on the boundaries of the two classes, and these points have the minimum distance to the classification hyperplane. For a linearly inseparable data set, after mapping the data to a high-dimensional space through the kernel function and determining the classification hyperplane in the high-dimensional space, the support vectors at this time are the sample points near the classification hyperplane in the high-dimensional space.

[0039] For example, there is a binary classification problem on a two-dimensional plane, and the data points are divided into two classes (represented by circles and crosses). An optimal classification line (hyperplane) is found through SVM to distinguish these two classes of data.

[0040] In this process, the data points represented by the circles and crosses that are closest to the classification line are the support vectors. These support vectors determine the position and direction of the classification line. If other non-support vector data points are removed, the position of the classification line may not change, but if the support vectors are removed, the position of the classification line will change.

[0041] Support vectors determine the decision boundary of the classifier. When predicting the class of a new sample, only the relative position of the new sample to the hyperplane determined by the support vectors needs to be calculated to determine its class. The objective function and the final classification model of SVM are closely related to the support vectors, which is also the reason why this algorithm is called the support vector machine.

[0042] In order to solve the above problems, the embodiments of the present application operate by obtaining current acquisition data; inputting the acquisition data into a classification learning model, and predicting the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type; screening out the target prediction probability with the largest probability from each of the prediction probabilities, and obtaining the current target balance weight of the first type corresponding to the target classifier of the target prediction probability; determining whether to query the acquisition data based on the target prediction probability and the target balance weight; when it is determined not to query the acquisition data, determining a loss value based on the target prediction probability and the preset label value of the type label of the first type; when the loss value is greater than a preset loss threshold, adjusting the parameters of the target classifier to obtain a classification learning model with adjusted parameters. Compared with the related art where the batch learning strategy results in relatively high training costs and long training time, the embodiments of the present application operate based on obtaining current acquisition data, which means it can accept newly arrived data at any time and immediately input it into the classification learning model for prediction and subsequent processing. Unlike the batch learning strategy that requires accumulating a certain amount of data to form a batch before learning, this real-time processing method for individual acquisition data is more suitable for industrial scenarios where data arrives continuously, provides a basis for continuous learning, can respond to and analyze new data in a timely manner, rather than waiting until all data is collected before training. Thus, it avoids using the batch learning strategy, reduces the training cost of the model, shortens the training time, and improves the training efficiency. For specific details, please continue to refer to the following specific embodiments.

[0043] Please refer to Figure 1 , Figure 1 which is a schematic diagram of the scenario of the model training system provided by the embodiments of the present application. It includes a terminal 140, the Internet 130, a gateway 120, a computer device 110, etc.

[0044] The terminal 140 includes, but is not limited to, pre-configured sensors, cameras, or electronic devices such as mobile phones and tablets with information acquisition functions. Additionally, it can be a single device or a collection of multiple devices. The terminal 140 can communicate with the Internet 130 in a wired or wireless manner to exchange data. The sensors include, but are not limited to, pressure sensors, visual sensors, voltage and current sensors, and are not limited herein.

[0045] A computer device refers to a computer system that can provide certain services to the terminal 140. Compared with ordinary terminals 140, the computer device 110 has higher requirements in terms of stability, security, performance, etc. The computer device 110 can be a high-performance computer in a network platform, a cluster of multiple high-performance computers, a part (such as a virtual machine) allocated from a high-performance computer, a combination of parts (such as virtual machines) allocated from multiple high-performance computers, etc.

[0046] The gateway 120 is also called an internetwork connector and protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. Between two systems that use different communication protocols, data formats, or languages, and even have completely different architectures, the gateway is a translator. At the same time, the gateway can also provide filtering and security functions. Messages sent from the terminal 140 to the computer device 110 need to be sent to the corresponding computer device 110 through the gateway 120. Messages sent from the computer device 110 to the terminal 140 also need to be sent to the corresponding terminal 140 through the gateway 120.

[0047] Among them, when applied to industrial scenarios, the computer device 110 can also be directly connected to the terminal 140 without passing through the gateway 120 to achieve real-time synchronization of data collected by the terminal 140.

[0048] The model training method of the embodiments of the present disclosure can be implemented on the computer device 110.

[0049] It should be noted that Figure 1 The schematic diagram of the scenario of the model training system shown is only an example. The model training system and scenario described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided by the embodiments of the present application. Those of ordinary skill in the art know that with the evolution of model training technology and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.

[0050] In this embodiment, the description will be made from the perspective of the model training device, which can be specifically integrated in a computer device with a storage unit and installed with a microprocessor and having computing capabilities.

[0051] Please refer to Figure 2 , Figure 2 which is the flowchart of the model training method provided by the embodiments of the present application. The model training method includes:

[0052] In step 201, obtain the current collected data.

[0053] Among them, the collected data refers to the raw data collected from actual application scenarios (such as industrial production environments, network monitoring systems, etc.) through various sensors, monitoring devices, or data collection tools. These data contain relevant characteristic information of the object of concern. For example, in the scenario of industrial equipment fault monitoring, the collected data may be data records of multiple dimensions such as the temperature, pressure, and vibration frequency of the equipment during operation.

[0054] Specifically, the pre-deployed collection devices (such as temperature sensors, flow sensors, etc.) are used to obtain data in real time according to the set time interval or trigger conditions (such as collecting once every minute or once every second), and these data are transmitted to the subsequent processing system so that they can be further analyzed and utilized.

[0055] It provides the basic materials for subsequent model analysis and processing. Only by obtaining accurate and real-time collected data can we judge the state of the system or object based on the actual situation, discover possible abnormal situations, and then drive the entire classification learning model to perform corresponding operations to ensure the normal operation of the system or make correct decisions.

[0056] In step 202, the collected data is input into the classification learning model, and each type of classifier included in the classification learning model is used to predict the collected data to obtain the prediction probability of each classifier. The types include multiple abnormal types and normal types.

[0057] Among them, the classification learning model is a machine learning model that has been trained to classify and judge input data, such as support vector machines, neural networks, etc. It contains multiple classifiers constructed for different types, and each classifier is responsible for judging the possibility that the input data belongs to a certain specific type.

[0058] The specific form of the classification learning model can be , where is the classifier of each type, , where is the set as the basis, is the set of all abnormal types and normal types collected up to time point t, is the total number of all types in the type set. For example, if there are 4 abnormal types and 1 normal type, then is 5, .

[0059] A classifier is a component in a classification learning model that makes classification judgments for a specific type (such as a certain abnormal type or normal type). For example, in equipment fault detection, there may be a classifier dedicated to determining whether there is an "overheating abnormality" in the equipment, and another classifier for judging whether there is a "vibration abnormality", etc. The prediction probability represents the likelihood that the classifier determines the input collected data belongs to its corresponding type according to the collected data, and it is a value between 0 and 1. The larger the value, the more likely it is to belong to that type.

[0060] Among them, the collected raw data is sorted and preprocessed according to the format required by the model (such as operations like normalization and standardization to keep the data features within an appropriate numerical range), and then it is sequentially input into each classifier included in the classification learning model. Each classifier calculates and analyzes the input data based on its own learned feature patterns and classification rules, and finally outputs a prediction probability value indicating that the data belongs to the type corresponding to this classifier. By analyzing and predicting the collected data in parallel through multiple classifiers, it is possible to consider the potential state represented by the data from different perspectives (i.e., different type dimensions) and obtain the likelihood of each type. This provides a basis for subsequent operations such as screening out the most likely type and further judging the impact of the data on the model, and helps to comprehensively and accurately grasp the feature performance of the collected data in the entire classification system.

[0061] In step 203, the target prediction probability with the largest probability is selected from each prediction probability, and the current target balance weight of the first type corresponding to the target classifier of the target prediction probability is obtained.

[0062] Among them, the target prediction probability is the probability value with the largest numerical value among the prediction probabilities output by all classifiers, which means that from the perspective of the model, the currently collected data is most likely to belong to the type corresponding to this probability. The target classifier is the classifier corresponding to the target prediction probability, that is, the classifier that believes the collected data is most likely to belong to the type it is responsible for classifying. The first type refers to the specific type that the target classifier is responsible for classifying, such as the "overheating abnormality" type or the "normal" type, etc. The target balance weight is a weight value related to the type corresponding to the target classifier, and it is usually used to adjust the classification importance of different types in the scenario of an imbalanced dataset (where the normal type data is large and the abnormal type data is small), so that the model can pay more attention to each category more reasonably and avoid overlearning the category with more samples and ignoring the category with fewer samples.

[0063] Specifically, compare the prediction probabilities output by each classifier, and find the largest probability value as the target prediction probability through a numerical comparison operation. , and determine the classifier that outputs the probability value as the target classifier. At the same time, obtain the currently set target balance weight of the first type corresponding to the target classifier (which can be obtained from the corresponding weight configuration file or the model parameter storage area).

[0064] Specifically, the target prediction probability can be calculated with reference to the following formula:

[0065] ;

[0066] where is any type in the type set , is the classifier corresponding to any type. This formula is used to screen out the target prediction probability with the largest prediction probability from the prediction probabilities of the classifiers corresponding to each type in the type set . .

[0067] In step 204, based on the target prediction probability and the target balance weight, determine whether to query the collected data.

[0068] Among them, querying is to further search for and obtain the collected data so as to retrieve the collected data for manual annotation. The purpose is to more accurately confirm the true type corresponding to the collected data. Especially when the model is not very sure about data classification or the type of this data is relatively critical (reflected by the target balance weight), operations such as manual annotation are required to clarify.

[0069] Decide whether to invest additional resources (such as manpower for annotation, etc.) to further determine the true type corresponding to the collected data. Reasonably controlling the query operation can, while ensuring the accuracy of data classification, avoid unnecessary resource waste and improve the efficiency of the entire data processing process. Especially when facing a large amount of continuously incoming data, it can screen out the key data that really needs to be further confirmed.

[0070] In some embodiments, the determining whether to query the collected data based on the target prediction probability and the target balance weight includes:

[0071] (1) Based on the target balance weight, the target prediction probability, and a preset control parameter, determine a calculation parameter;

[0072] (2) Perform a Poisson distribution calculation on the calculation parameter, and determine any random number that follows the Poisson distribution as the query decision value;

[0073] (3) When the query decision value is less than one, determine not to query the collected data;

[0074] (4) When the query decision value is greater than or equal to one, it is determined to query the collected data.

[0075] Among them, the active query method designed in the embodiments of the present application realizes the query of minority class samples and the query of the most informative samples, and realizes the discovery of new abnormal categories. Specifically, it is assumed that at the moment when the sample is received, the designed adaptive active query strategy is expressed as follows:

[0076] ;

[0077] Among them, is an operation representation for determining whether to perform a query. When , the collected data is actively queried; when , the collected data is not actively queried. is a random number obeying any Poisson distribution (i.e., the query decision value). Specifically, it is expressed in the following form:

[0078] ;

[0079] Among them, is the target balance weight of the target classifier at the time point , is a control parameter, which mainly adjusts the sensitivity of the query strategy. A smaller will have a more sensitive query, that is, more samples need to be manually labeled. When is small, the larger the parameter of the Poisson distribution, the is more likely to be greater than or equal to 1. This situation shows that when the confidence of the model in the collected data is small, the query strategy is more inclined to obtain the sample label, that is, to select uncertain samples. When the target balance weight is large, the larger the parameter of the Poisson distribution, the is more likely to be greater than or equal to 1. This situation shows that when the type corresponding to the collected data is a minority class, the query strategy is more inclined to obtain the sample label, that is, to select minority class samples. is the calculation parameter determined according to the target balance weight, the target prediction probability, and the preset control parameter.

[0080] Thus, by calculating the value at the current time point , when is 1, the collected data is actively queried, and it is possible to actively select uncertain samples for learning, detect new faults early and continuously update, greatly reducing the dependence on manual data selection and annotation.

[0081] In some embodiments, the method further includes:

[0082] (1) When the query decision value is greater than or equal to one, query the second type corresponding to the type label of the collected data;

[0083] (2) When the second type is different from each type, construct a classifier corresponding to the second type in the classification learning model;

[0084] (3) Use the data feature vector corresponding to the data feature vector of the collected data as the support vector in the support vector set of the classifier corresponding to the second type.

[0085] Among them, since there are two aspects to the factor that makes greater than or equal to 1. The first aspect factor is that the true type corresponding to the collected data is not the type in the type set that has not been collected currently, resulting in being smaller and the confidence of the model in the collected data being smaller, being more likely to be greater than or equal to 1; the second aspect factor is that the target balance weight is larger, that is, when the type corresponding to the collected data is a minority class, the query strategy is more inclined to obtain the sample label. Therefore, to determine which of these two aspects of factors causes the active query, a type comparison strategy is adopted, that is, query the second type corresponding to the type label of the collected data after manual annotation; if the second type is different from each type, it means that the active query is caused by the first aspect factor; then construct a classifier corresponding to the second type in the existing classification learning model as the number of types at the next time point that is, . That is the type collected at the next time point , obtained by taking the union of the total type set at the current time point and the second type , that is, . And use the data feature vector corresponding to the data feature vector of the collected data as the support vector in the support vector set of the classifier corresponding to the second type, that is, . Finally, the classifier corresponding to the second type can be expressed in the following form:

[0086] ;

[0087] Among them, is the classifier corresponding to the second type at the next time point .

[0088] In this way, by constructing a classifier corresponding to the new type under specific conditions (the query decision value is greater than or equal to 1 and the second type is different from the existing types), it is possible to effectively process new type data that has not appeared during the model training process. This enables the model to dynamically adapt to changes in the data distribution, avoiding the problem of model failure caused by the emergence of new type data, thereby improving the adaptability and generalization ability of the model.

[0089] For example, in the industrial fault detection scenario, if a new fault type (new type data) appears, this method can timely construct a classifier for this new fault, so as to accurately detect and classify it, ensuring the normal progress of production.

[0090] Moreover, the construction of the classifier is optimized. The data feature vectors of the collected data are used as the support vectors of the new type classifier, which helps to more accurately determine the classification boundary. Support vectors are data points that play a key role in classification. The classifier constructed based on these points can more accurately divide different types of data, thereby improving the accuracy of classification. For example, in the field of image recognition, when encountering a new image category, using the newly collected representative data feature vectors (support vectors) to construct a classifier can better identify this type of image and reduce the situation of misclassification.

[0091] In some embodiments, the method further includes:

[0092] (1) When the second type is in the currently collected type set, obtain the query times of the collected data of each type in the type set from the start of training to the current time;

[0093] (2) Calculate the sum value of the query times of each type to obtain the total query times;

[0094] (3) Based on the query times of each type and the total query times, determine the balance weight of each type.

[0095] Among them, if the second type is in the currently collected type set, it means that the target balance weight is larger. That is, when the type corresponding to the collected data is a minority class, the query strategy is more inclined to obtain the sample label, so it is necessary to readjust the balance weight of each type. The specific balance weight is determined by the query times of each type and the total query times.

[0096] Specifically, the calculation formula of the total query times can refer to the following form:

[0097] ;

[0098] This formula is the time point t from the start of training to the current time for each time point The total number of active queries The sum of which is the total number of queries.

[0099] The calculation formula for the number of queries of each type can refer to the following form:

[0100] ;

[0101] Among them, is an indicator function. When it is the case, its value is 1; otherwise its value is 0. Thus, for any type, when an active query is made at a certain time point, the number of queries is incremented by one through summation, thereby obtaining the number of queries of each type.

[0102] Thus, in an actual data scenario, there is often an imbalance in categories, that is, there are significant differences in the number of data samples of different types. When the type corresponding to the collected data is a minority class, the query strategy tends to obtain its sample labels, resulting in a relatively large number of queries for this type, reflecting the need for more attention in the model training and optimization process. By determining the balance weights based on the number of queries of each type and the total number of queries, the weights of the minority classes can be reasonably increased, enabling the model to pay more attention to the minority classes in subsequent training, classification, etc. operations, avoiding being ignored due to the small number of samples, and thus improving the model's recognition ability and classification accuracy for the minority classes.

[0103] For example, in an industrial fault detection scenario, the data of abnormal types (minority classes) is much less than that of normal types (majority classes). After determining the balance weights in this way, the model can better focus on abnormal types and improve the classification determination accuracy of abnormal types.

[0104] And the classification decision boundary is optimized. Due to the adjustment of the balance weights, the model will re-evaluate the importance of different types of data, thereby affecting the determination of the classification hyperplane (for linear classification cases) or the classification decision boundary (for non-linear classification cases). This helps to find a more appropriate boundary, enabling each category, especially the minority classes, to be more accurately divided, reducing the classification bias caused by category imbalance, and improving the overall classification effect. For example, in a network intrusion detection scenario, newly emerging niche types of network attacks (minority classes) can, through reasonable adjustment of the balance weights, enable the model to better define the boundary between normal network behavior and such attack behaviors, enhancing the detection ability.

[0105] In some embodiments, determining the balance weight of each type based on the number of queries of each type and the total number of queries includes:

[0106] (1.1) Calculate the ratio of the total number of queries to the number of queries of each type to obtain the query multiple of each type;

[0107] (1.2) Determine the target query multiple with the largest query multiple, and calculate the ratio of the query multiple of each type to the target query multiple respectively to obtain the balance weight of each type.

[0108] Among them, the specific method for determining the balance weight of each type based on the query times of each type and the total query times is as follows: First, calculate the ratio of the total query times to the query times of each type to obtain the query multiple of each type; then calculate and determine the target query multiple with the largest query multiple through normalization, and calculate the ratio of the query multiple of each type to the target query multiple respectively to obtain the balance weight of each type.

[0109] The query multiple of each type can be calculated by the following formula:

[0110] ;

[0111] Among them, is the query multiple of each type.

[0112] The target query multiple can be expressed as , , is the type corresponding to the target query multiple.

[0113] The balance weight of each type can be calculated by the following formula:

[0114] ;

[0115] Among them, by calculating the ratio of the query multiple of each type to the largest target query multiple, normalization is realized, and the balance weight of each type is obtained. Furthermore, the problem of dynamic imbalance in related technologies is solved. Dynamic imbalance means that the classification learning model needs to adapt to the continuously changing unbalanced abnormal data distribution in a timely manner, otherwise the performance of the anomaly detection model will be biased towards the majority class and perform poorly on the minority class. By actively selecting minority class samples for learning, the training data distribution tends to be balanced, preventing the performance of the fault diagnosis model from being biased towards the majority class.

[0116] In step 205, when it is determined not to query the collected data, determine the loss value based on the target prediction probability and the preset label value of the type label of the first type.

[0117] Among them, the preset label value of the type label It refers to the standard values set in advance for each type (each abnormal type and normal type) to represent its true situation. It is a reference standard for measuring the difference between the model prediction result and the true situation. For example, the value for the "overheat anomaly" type is 1. The loss value is used to quantify the gap between the model prediction result and the true situation. The smaller the loss value, the more accurate the model prediction. It is an important basis for model optimization and adjustment. Different prediction situations correspond to different loss calculation methods.

[0118] In some embodiments, determining the loss value based on the target prediction probability and the preset label value of the type label includes:

[0119] (1) Calculate the product of the target prediction probability and the preset label value of the type label of the first type to obtain a first calculation result;

[0120] (2) Calculate the difference between 1 and the first calculation result to obtain a second calculation result;

[0121] (3) Compare the second calculation result with a preset loss threshold;

[0122] (4) When the second calculation result is less than the preset loss threshold, determine the preset loss threshold as the loss value;

[0123] (5) When the second calculation result is greater than the preset loss threshold, determine the second calculation result as the loss value.

[0124] Among them, the loss value can be calculated through hinge loss. The specific formula can refer to the following form:

[0125] ;

[0126] Among them, when it is determined not to query the acquisition data, it means that the acquisition data is not a type that the model is uncertain about or a newly added type. The first type is the type corresponding to the acquisition data, and the first calculation result is the target prediction probability (that is ) multiplied by the preset label value of the type label of the first type ; The second calculation result is , refers to determining the larger value as the calculated value from and . Then is essentially comparing the preset loss threshold 0 with the second calculation result , when the second calculation result is less than the preset loss threshold, it indicates that the performance of the current model is acceptable, and the preset loss threshold 0 is determined as the loss value; when the second calculation result is greater than the preset loss threshold, the current classification effect of the model does not meet the expected standard, and the model needs to be improved and adjusted, then the second calculation result is determined as the loss value.

[0127] In step 206, when the loss value is greater than the preset loss threshold, the parameters of the target classifier are adjusted to obtain a classification learning model with adjusted parameters.

[0128] Among them, the preset loss threshold is a preset loss value limit (for example, 0). When the loss value generated by the model prediction exceeds this limit, it is considered that the current classification effect of the model does not meet the expected standard, and the model needs to be improved and adjusted; if the loss value is less than or equal to the threshold, it is considered that the performance of the current model is acceptable. Therefore, when the loss value is greater than the preset loss threshold, the parameters of the target classifier are adjusted to obtain a classification learning model with adjusted parameters.

[0129] Thus, the self-optimization and improvement of the model are realized, enabling it to continuously adapt to new data characteristics and improve the classification accuracy. By specifically adjusting the parameters of the target classifier according to the actual predicted loss situation, large-scale retraining of the entire model is avoided, the efficiency of model update is improved, and at the same time, it is ensured that the model can always maintain good classification performance when facing continuously changing data, better meeting the requirements of actual application scenarios.

[0130] In some embodiments, each of the classifiers consists of a kernel function and a corresponding support vector set. Each support vector in the support vector set serves as a calculation parameter for the corresponding kernel function. The adjusting the parameters of the target classifier to obtain a classification learning model with adjusted parameters includes:

[0131] (1) Obtain the target number of support vectors in the target support vector set corresponding to the target classifier;

[0132] (2) When the target number is less than the preset number corresponding to the target classifier, use the feature vector corresponding to the collected data as the support vector in the target support vector set;

[0133] (3) When the target number is greater than or equal to the preset number corresponding to the target classifier, remove one support vector from the target support vector set, and use the feature vector corresponding to the collected data as the support vector in the target support vector set.

[0134] Among them, each classifier consists of a kernel function and a corresponding support vector set. Each support vector in the support vector set serves as a calculation parameter for the corresponding kernel function. The formula representation of each classifier can be referred to in the following form:

[0135] ;

[0136] Among them, is the kernel function, is the time point the support vector set corresponding to the classifier of the type, is any support vector in and is a learning parameter greater than zero. Thus, adjusting the parameters of the classifier is essentially adjusting the support vectors in the support vector set corresponding to the classifier.

[0137] Specifically, since there is a loss when the target classifier predicts the collected data, for the classification learning model, only the support vectors in the support vector set of the target classifier are adjusted, and the support vectors in the support vector sets of other types of classifiers are not adjusted. The specific adjustment method for the support vectors in the support vector set of the target classifier can be referred to the following formula:

[0138] = ;

[0139] Among them, is the support vector set of the target classifier at the next time point after adjustment, is the support vector set of the target classifier at the current time point A maximum value is set for the support vector set of each category , when it indicates that at the current time point when, the support vector set of the target classifier has not overflowed, then the feature vector corresponding to the collected data will be used as the support vector in the target support vector set through this method of taking the union; when it indicates that at the current time point when, the support vector set of the target classifier is full, to prevent memory overflow and accelerate the learning of the model, the feature vector corresponding to the collected data will be used as the support vector in the target support vector set through this method of taking the union, and any support vector that is not at the current time point (that is ) will be removed from the support vector set. As for the support vector sets corresponding to other types of classifiers (that is No adjustment is made.

[0140] Finally, at the next time point The representations of the target classifier and other types of classifiers can refer to the following formula:

[0141] ;

[0142] where is the target classifier at time point At time point its corresponding support vector set is ; is the other type of classifier at time point At time point its corresponding support vector set is .

[0143] Thus, when the training of the classification learning model is completed, when the collected data is received, the collected data is input into the classification learning model after the training is completed, and the type predicted by the classification learning model is obtained.

[0144] As can be seen from the above, in the embodiment of the present application, the current collected data is obtained; the collected data is input into the classification learning model, and each type of classifier included in the classification learning model is used to predict the collected data to obtain the prediction probability of each classifier, where the types include multiple abnormal types and normal types; the target prediction probability with the largest probability is selected from each prediction probability, and the current target balance weight of the target classifier corresponding to the target prediction probability is obtained; based on the target prediction probability and the target balance weight, it is determined whether to query the collected data; when it is determined not to query the collected data, the loss value is determined based on the target prediction probability and the preset label value of the type label of the first type; when the loss value is greater than the preset loss threshold, the parameters of the target classifier are adjusted to obtain a classification learning model with adjusted parameters. Compared with the related art where the batch learning strategy results in a large training cost and time consumption, the embodiment of the present application operates based on obtaining the current collected data, which means it can accept new incoming data at any time and immediately input it into the classification learning model for prediction and subsequent processing. Unlike the batch learning strategy that requires accumulating a certain amount of data to form a batch before learning, this real-time processing method for individual collected data is more suitable for the industrial scenario where data continuously arrives, has the basis for continuous learning, can respond and analyze new data in a timely manner, rather than waiting for all the data to be collected before training, thus avoiding the batch learning strategy, reducing the training cost of the model, reducing the training time consumption, and improving the training efficiency.

[0145] For the specific implementation of each of the above steps, reference may be made to the previous embodiments, which will not be elaborated here.

[0146] To facilitate better implementation of the model training method provided in the embodiments of the present application, the embodiments of the present application further provide a device based on the above model training method. The meanings of the nouns are the same as those in the above model training method, and the specific implementation details can be referred to the description in the method embodiments.

[0147] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of the model training device provided in the embodiments of the present application. The model training device is applied to a computer device. The model training device may include a first acquisition unit 601, a prediction unit 602, a second acquisition unit 603, a first determination unit 604, a second determination unit 605, an adjustment unit 606, etc.

[0148] The first acquisition unit 601 is configured to acquire current acquisition data;

[0149] The prediction unit 602 is configured to input the acquisition data into a classification learning model, and perform prediction on the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the type includes multiple abnormal types and a normal type;

[0150] The second acquisition unit 603 is configured to screen out the target prediction probability with the largest probability from each of the prediction probabilities, and acquire the current target balance weight of the target classifier corresponding to the target prediction probability;

[0151] The first determination unit 604 is configured to determine whether to query the acquisition data based on the target prediction probability and the target balance weight;

[0152] The second determination unit 605 is configured to, when it is determined not to query the acquisition data, determine a loss value based on the target prediction probability and a preset label value of the type label of the first type;

[0153] The adjustment unit 606 is configured to, when the loss value is greater than a preset loss threshold, perform parameter adjustment on the target classifier to obtain a classification learning model with adjusted parameters.

[0154] In some embodiments, the second determination unit 605 includes:

[0155] A first acquisition subunit, configured to acquire the amount of matching data of the data reported by each data source in the preset database and the amount of false alarm data not in the preset database;

[0156] A first calculation subunit, configured to calculate a product of the target prediction probability and a preset label value of a type label of the first type, to obtain a first calculation result;

[0157] A second calculation subunit, configured to calculate a difference between one and the first calculation result, to obtain a second calculation result;

[0158] A comparison subunit, configured to compare the second calculation result with a preset loss threshold;

[0159] A first determination subunit, configured to, when the second calculation result is less than the preset loss threshold, determine the preset loss threshold as the loss value;

[0160] A second determination subunit, configured to, when the second calculation result is greater than the preset loss threshold, determine the second calculation result as the loss value.

[0161] In some embodiments, each of the classifiers is composed of a kernel function and a corresponding support vector set, and each support vector in the support vector set serves as a calculation parameter of the corresponding kernel function. The adjustment unit 606 includes:

[0162] A second acquisition subunit, configured to acquire a target number of support vectors in a target support vector set corresponding to the target classifier;

[0163] A first support vector determination subunit, configured to, when the target number is less than a preset number corresponding to the target classifier, use the feature vector corresponding to the acquisition data as the support vector in the target support vector set;

[0164] A second support vector determination subunit, configured to, when the target number is greater than or equal to the preset number corresponding to the target classifier, remove one support vector from the target support vector set, and use the feature vector corresponding to the acquisition data as the support vector in the target support vector set.

[0165] In some embodiments, the first determination unit 604 includes:

[0166] A third determination subunit, configured to determine a calculation parameter based on the target balance weight, the target prediction probability, and a preset control parameter;

[0167] A fourth determination subunit, configured to perform a Poisson distribution calculation on the calculation parameter, and determine any random number that follows the Poisson distribution as the query decision value;

[0168] A fifth determination subunit, configured to, when the query decision value is less than one, determine not to query the acquisition data;

[0169] A sixth determination subunit, configured to determine to query the collected data when the query decision value is greater than or equal to one.

[0170] In some embodiments, the apparatus further includes:

[0171] A query unit, configured to query a second type corresponding to a type tag of the collected data when the query decision value is greater than or equal to one;

[0172] A construction unit, configured to construct a classifier corresponding to the second type in the classification learning model when the second type is different from each type;

[0173] A third determination unit, configured to use a data feature vector corresponding to the data feature vector of the collected data as a support vector in a support vector set of the classifier corresponding to the second type.

[0174] In some embodiments, the apparatus further includes:

[0175] A third acquisition unit, configured to, when the second type is in a currently collected type set, acquire the number of query times from the start of training to the current for the collected data of each type in the type set;

[0176] A first calculation unit, configured to calculate a sum value of the number of query times of each type to obtain a total number of query times;

[0177] A fourth determination unit, configured to determine a balance weight of each type based on the number of query times of each type and the total number of query times.

[0178] In some embodiments, the fourth determination unit is configured to:

[0179] A second calculation unit, configured to calculate a ratio of the total number of query times to the number of query times of each type to obtain a query multiple of each type;

[0180] A fifth determination unit, configured to determine a target query multiple with the largest query multiple, and calculate a ratio of the query multiple of each type to the target query multiple respectively to obtain a balance weight of each type.

[0181] For the specific implementation of each of the above units, reference may be made to the previous embodiments and will not be elaborated here.

[0182] As can be seen from the above, in the embodiment of the present application, the first acquisition unit 601 acquires the current acquisition data; the prediction unit 602 inputs the acquisition data into the classification learning model, and predicts the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type; the second acquisition unit 603 screens out the target prediction probability with the largest probability from each of the prediction probabilities, and acquires the current target balance weight of the first type corresponding to the target classifier of the target prediction probability; the first determination unit 604 determines whether to query the acquisition data based on the target prediction probability and the target balance weight; when the second determination unit 605 determines not to query the acquisition data, it determines the loss value based on the target prediction probability and the preset label value of the type label of the first type; when the loss value is greater than the preset loss threshold, the adjustment unit 606 adjusts the parameters of the target classifier to obtain a classification learning model with adjusted parameters. Compared with the problem in the related art that the batch learning strategy results in high training costs and long time consumption, the embodiment of the present application operates based on the acquisition of the current acquisition data, which means that it can accept newly arrived data at any time and immediately input it into the classification learning model for prediction and subsequent processing. Different from the batch learning strategy that requires accumulating a certain amount of data to form a batch before learning, this real-time processing method for individual acquisition data is more suitable for the industrial scenario where data continuously arrives, has the basis for continuous learning, can respond and analyze new data in a timely manner, rather than waiting for all the data to be collected before training, thus avoiding the batch learning strategy, reducing the training cost of the model, reducing the training time, and improving the training efficiency.

[0183] For the specific implementation of each of the above units, reference may be made to the previous embodiments and will not be elaborated here.

[0184] Refer to Figure 4 , Figure 4Block diagram of a part of the computer device 110 for implementing the embodiments of the present disclosure. The computer device 110 may vary greatly due to configuration or performance differences, and may include one or more central processing units (CPUs) 622 (e.g., one or more processors) and a memory 632, and one or more storage media 630 (e.g., one or more mass storage devices) for storing application programs 642 or data 644. Among them, the memory 632 and the storage media 630 may be transient storage or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server 600. Further, the central processing unit 622 may be configured to communicate with the storage media 630 and execute a series of instruction operations in the storage media 630 on the server 600.

[0185] The computer device 110 may further include one or more power supplies 626, one or more wired or wireless network interfaces 650, one or more input / output interfaces 658, and / or one or more operating systems 641, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0186] The central processing unit 622 in the computer device 110 may be used to execute the model training method of the embodiments of the present disclosure, for example:

[0187] Obtain the current acquisition data;

[0188] Input the acquisition data into the classification learning model, and predict the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type;

[0189] Select the target prediction probability with the largest probability from each of the prediction probabilities, and obtain the current target balance weight of the first type of the target classifier corresponding to the target prediction probability;

[0190] Based on the target prediction probability and the target balance weight, determine whether to query the acquisition data;

[0191] When it is determined not to query the acquisition data, determine the loss value based on the target prediction probability and the preset label value of the type label of the first type;

[0192] When the loss value is greater than the preset loss threshold, adjust the parameters of the target classifier to obtain a classification learning model with adjusted parameters.

[0193] An embodiment of the present disclosure also provides a computer-readable storage medium, which is used to store program codes for executing the model training method of each of the foregoing embodiments.

[0194] An embodiment of the present disclosure also provides a computer program product, which includes a computer program. The processor of the computer device reads and executes the computer program, so that the computer device executes to implement the above model training method. For example:

[0195] Obtain the current acquisition data;

[0196] Input the acquisition data into the classification learning model, and predict the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type;

[0197] Screen out the target prediction probability with the largest probability from each of the prediction probabilities, and obtain the current target balance weight of the first type of the target classifier corresponding to the target prediction probability;

[0198] Based on the target prediction probability and the target balance weight, determine whether to query the acquisition data;

[0199] When it is determined not to query the acquisition data, determine the loss value based on the target prediction probability and the preset label value of the type label of the first type;

[0200] When the loss value is greater than the preset loss threshold, adjust the parameters of the target classifier to obtain a classification learning model with adjusted parameters.

[0201] In addition, the terms "include" and "comprise" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0202] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expressions refer to any combination of these items, including any combination of single items (ones) or plural items (ones). For example, at least one (one) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0203] It should be understood that in the description of the embodiments of this application, the meaning of "a plurality (or multiple items)" is more than two. Understandings such as "greater than", "less than", and "exceeding" do not include the present number, and understandings such as "above", "below", and "within" include the present number.

[0204] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms.

[0205] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0206] In addition, the functional units in each embodiment of this application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0207] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM for short), random access memories (RAM for short), magnetic disks, or optical discs.

[0208] It should also be understood that the various embodiments provided in the embodiments of this application can be combined arbitrarily to achieve different technical effects.

[0209] In the embodiments of this application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of this module or unit.

[0210] The above is a specific description of the embodiments of this application, but this application is not limited to the above embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of this application, and these equivalent deformations or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A model training method, characterized in that, Including: Obtain the current collected data; Input the collected data into the classification learning model, and use each type of classifier included in the classification learning model to predict the collected data to obtain the prediction probability of each classifier, where the types include multiple abnormal types and normal types; Screen out the target prediction probability with the largest probability from each of the prediction probabilities, and obtain the current target balance weight of the first type of the target classifier corresponding to the target prediction probability; Determine the calculation parameter based on the target balance weight, the target prediction probability, and a preset control parameter; Perform a Poisson distribution calculation on the calculation parameter, and determine any random number that follows the Poisson distribution as the query decision value; When the query decision value is less than one, determine not to query the collected data; When the query decision value is greater than or equal to one, determine to query the collected data; When it is determined not to query the collected data, calculate the product of the target prediction probability and the preset label value of the type label of the first type to obtain the first calculation result; Calculate the difference between one and the first calculation result to obtain the second calculation result; Compare the second calculation result with a preset loss threshold; When the second calculation result is less than the preset loss threshold, determine the preset loss threshold as the loss value; When the second calculation result is greater than the preset loss threshold, determine the second calculation result as the loss value; When the loss value is greater than the preset loss threshold, adjust the parameters of the target classifier to obtain a classification learning model with adjusted parameters.

2. The model training method according to claim 1, wherein Each classifier consists of a kernel function and a corresponding support vector set, and each support vector in the support vector set is used as the calculation parameter of the corresponding kernel function. The adjusting the parameters of the target classifier to obtain a classification learning model with adjusted parameters includes: Obtain the target number of support vectors in the target support vector set corresponding to the target classifier; When the target number is less than the preset number corresponding to the target classifier, use the feature vector corresponding to the collected data as the support vector in the target support vector set; When the target number is greater than or equal to the preset number corresponding to the target classifier, remove one support vector from the target support vector set, and use the feature vector corresponding to the collected data as the support vector in the target support vector set.

3. The model training method according to claim 1, wherein The method further includes: When the query decision value is greater than or equal to one, query the second type corresponding to the type label of the collected data; When the second type is different from each type, construct a classifier corresponding to the second type in the classification learning model; Use the data feature vector corresponding to the data feature vector of the collected data as the support vector in the support vector set of the classifier corresponding to the second type.

4. The model training method according to claim 3, wherein The method further includes: When the second type is in the currently collected type set, obtain the query times of the collected data of each type in the type set from the start of training to the current; Calculate the sum value of the query times of each type to obtain the total query times; Determine the balance weight for each type based on the number of queries of each type and the total number of queries.

5. The model training method according to claim 4, wherein The determining the balance weight for each type based on the number of queries of each type and the total number of queries includes: Calculate the ratio of the total number of queries to the number of queries of each type to obtain the query multiple for each type. Determine the target query multiple with the largest query multiple, and calculate the ratio of the query multiple of each type to the target query multiple respectively to obtain the balance weight for each type.

6. A model training device, characterized in that Includes: A first acquisition unit for acquiring current acquisition data. A prediction unit for inputting the acquisition data into a classification learning model, and predicting the acquisition data through each type of classifier included in the classification learning model to obtain the prediction probability of each classifier, where the types include multiple abnormal types and normal types. A second acquisition unit for screening out the target prediction probability with the largest probability from each of the prediction probabilities, and acquiring the current target balance weight of the target classifier corresponding to the target prediction probability. A first determination unit includes: A third determination subunit for determining calculation parameters based on the target balance weight, the target prediction probability, and a preset control parameter. A fourth determination subunit for performing a Poisson distribution calculation on the calculation parameters and determining any random number subject to the Poisson distribution as the query decision value. A fifth determination subunit for determining not to query the acquisition data when the query decision value is less than one. A sixth determination subunit for determining to query the acquisition data when the query decision value is greater than or equal to one. A second determination unit includes: A first calculation subunit for calculating the product of the target prediction probability and the preset label value of the type label of the first type when it is determined not to query the acquisition data to obtain a first calculation result. A second calculation subunit for calculating the difference between one and the first calculation result to obtain a second calculation result. A comparison subunit for comparing the second calculation result with a preset loss threshold. A first determination subunit for determining the preset loss threshold as the loss value when the second calculation result is less than the preset loss threshold. A second determination subunit for determining the second calculation result as the loss value when the second calculation result is greater than the preset loss threshold. An adjustment unit for adjusting the parameters of the target classifier when the loss value is greater than the preset loss threshold to obtain a classification learning model with adjusted parameters.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the model training method according to any one of claims 1 to 5.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the model training method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Classification model training method and device, equipment, storage medium and program product

    CN114330499A