Model training method and device, storage medium and computer equipment

By processing data acquisition in real time and adjusting the model parameters, the problem of high cost and time-consuming model training in the existing technology is solved, and efficient and real-time model training is achieved to adapt to the needs of industrial scenarios.

CN120067696AActive Publication Date: 2025-05-30PENG CHENG LAB
View PDF 1 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when processing abnormal data in industrial production, there is a priori drift phenomenon, which leads to high cost, long time-consuming and difficult to adapt to industrial scenarios with high real-time requirements.

Method used

A model training method is adopted to obtain the current collected data, input it into the classification learning model for prediction, filter out the target prediction probability with the highest probability, and determine whether to query the data based on the target prediction probability and balance weight. When the loss value is greater than the preset threshold, the target classifier is adjusted to realize real-time model update.

Benefits of technology

It reduces the training cost of the model, reduces the training time, improves the training efficiency, and can respond and analyze new data in a timely manner to adapt to the industrial scenarios where data is constantly coming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067696A_ABST
    Figure CN120067696A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model training method and device, a storage medium and computer equipment. The method comprises the steps of obtaining current collection data; the collected data are input into a classification learning model, the collected data are predicted through each type of classifier included in the classification learning model, the prediction probability of each classifier is obtained, and the types comprise a plurality of abnormal types and normal types; screening out a target prediction probability with the maximum probability from each prediction probability, and obtaining a first type of current target balance weight of the target classifier corresponding to the target prediction probability; based on the target prediction probability and the target balance weight, determining whether to query the collected data; when it is determined that the collected data is not inquired, determining a loss value based on the target prediction probability and a preset tag value of the type tag of the first type; and when the loss value is greater than a preset loss threshold value, parameter adjustment is performed on the target classifier to obtain a parameter-adjusted classification learning model, so that the training efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of model training, and particularly relates to a model training method, device, 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 proportion 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, leading to a large training cost and long training time of 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 the present application is to provide a model training method, device, 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 the first aspect, an embodiment of the present application provides a model training method, including: Obtain current collected data; 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; Select the target prediction probability with the largest probability from each prediction probability, and obtain the current target balance weight of the first type of the target classifier corresponding to the target prediction probability; Based on the target prediction probability and the target balance weight, determine whether to query the collected data; 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; 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.

[0006] In the second aspect, an embodiment of the present application provides a model training device, including: A first acquisition unit, configured to acquire current acquisition data; A prediction unit, configured to input the acquisition data into a classification learning model, and predict the acquisition data through each type of classifier included in the classification learning model to obtain a prediction probability of each classifier, where the types include multiple abnormal types and a normal type; A second acquisition unit, configured to screen out a target prediction probability with the largest probability from each of the prediction probabilities, and acquire a current target balance weight of a first type corresponding to the target prediction probability of the target classifier; A first determination unit, configured to determine whether to query the acquisition data based on the target prediction probability and the target balance weight; 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 a type label of the first type; An adjustment unit, configured to, when the loss value is greater than a preset loss threshold, adjust parameters of the target classifier to obtain a classification learning model with adjusted parameters.

[0007] 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.

[0008] 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.

[0009] 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 causes relatively high training costs 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 industrial scenarios 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 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.

[0010] Other features and advantages of the present disclosure will be described in the following specification, and will, in part, 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 particularly pointed out in the specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] 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 drawings in the following description 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.

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

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

[0014] Figure 3Schematic structural diagram of the model training device provided by the embodiment of the present application.

[0015] Figure 4 Schematic structural diagram of the computer device provided by the embodiment of the present application. Detailed implementation manners

[0016] In order to enable those skilled in the art 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 with reference to 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 belong to the scope of protection of the present application.

[0017] It should be noted that in some processes described in the specification, claims and the above-mentioned drawings, there are multiple steps that appear in a specific order, but it should be clearly understood that these steps can be executed not in the order in which they appear in this text or 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 text are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence.

[0018] 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: 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.

[0019] In many machine learning algorithms (such as support vector machine, SVM), 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.

[0020] For example, in a two-dimensional plane, there are two types of data points (such as circles and squares), and they 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).

[0021] 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.

[0022] 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 by simple calculations in the three-dimensional space.

[0023] 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.

[0024] 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.

[0025] 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 boundary between 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.

[0026] 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.

[0027] 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.

[0028] 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 both closely related to the support vectors, which is also the reason why this algorithm is called the support vector machine.

[0029] In order to solve the above problems, 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 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 relatively high training costs and time consumption, 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.

[0030] 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.

[0031] The terminal 140 includes, but is not limited to, pre-configured sensors, cameras, or electronic devices such as mobile phones and tablets that have 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, which are not limited here.

[0032] A computer device refers to a computer system that can provide certain services to the terminal 140. Compared with ordinary terminals 140, computer devices 110 have 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.

[0033] 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 using different communication protocols, data formats, or languages, and even with 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.

[0034] 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.

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

[0036] 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 on the technical solutions provided by the embodiments of the present application. Those skilled 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.

[0037] In this embodiment, it will be described from the perspective of the model training device, which can be specifically integrated in a computer device with a storage unit and equipped with a microprocessor and having computing capabilities.

[0038] 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: In step 201, obtain the current collected data.

[0039] 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 interest. For example, in the scenario of industrial equipment fault monitoring, the collected data may be data records in multiple dimensions such as the temperature, pressure, and vibration frequency of the equipment during operation.

[0040] Specifically, the pre-deployed collection devices (such as temperature sensors, flow sensors, etc.) are used to obtain data in real time at set time intervals 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.

[0041] 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.

[0042] 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.

[0043] 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 built for different types, and each classifier is responsible for judging the possibility that the input data belongs to a certain specific type.

[0044] The specific form of the classification learning model can be , where is the classifier of each type, , where is the set 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, .

[0045] 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 input collected data. It is a value between 0 and 1, and the larger the value, the more likely it is to belong to that type.

[0046] Among them, the collected raw data is sorted and preprocessed in the format required by the model (such as operations like normalization and standardization to make the data features within a suitable 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 corresponding type of 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.

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

[0048] 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, usually used in the scenario of an imbalanced dataset (where there are more normal type data and fewer abnormal type data) to adjust the classification importance of different types, so that the model can pay more reasonable attention to each category and avoid overlearning the category with more samples while ignoring the category with fewer samples.

[0049] 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, and 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).

[0050] Specifically, the target prediction probability can be calculated with reference to the following formula: ; wherein, is any type in the type set , is the classifier corresponding to any type, and 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 . .

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

[0052] Among them, querying is to further search for and obtain the collected data, so as to obtain 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.

[0053] 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 ensure the accuracy of data classification while avoiding unnecessary resource waste and improving 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.

[0054] In some embodiments, the determining whether to query the collected data based on the target prediction probability and the target balance weight includes: (1) Based on the target balance weight, the target prediction probability, and a preset control parameter, determine a calculation parameter; (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; (3) When the query decision value is less than one, determine not to query the collected data; (4) When the query decision value is greater than or equal to one, determine to query the collected data.

[0055] 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, assuming that at the moment when the sample is received, the designed adaptive active query strategy is expressed as follows: ; Among them, is an operation representation for determining whether to perform a query. When , the active query is performed on the collected data; when , the active query is not performed on the collected data. is a random number (i.e., the query decision value) that follows any Poisson distribution. Specifically, it is expressed in the following form: ; 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 label of this sample, that is, 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 label of this sample, that is, select minority-class samples. is the calculation parameter determined according to the target balance weight, the target prediction probability, and the preset control parameter.

[0056] Thus, by calculating the value at the current time point , when is 1, the active query is performed on the collected data, and the learning can be carried out by actively selecting uncertain samples, new faults can be detected early and continuously updated, greatly reducing the dependence on manual data selection and annotation.

[0057] In some embodiments, the method further includes: (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; (2) When the second type is different from each type, construct a classifier corresponding to the second type in the classification learning model; (3) Use the data feature vector corresponding to the collected data as the support vector in the support vector set of the classifier corresponding to the second type.

[0058] Among them, since there are two aspects of factors that make greater than or equal to 1. The first aspect of the 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 is smaller, is more likely to be greater than or equal to 1; the second aspect of the 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 of the 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 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: ; Among them, is the classifier corresponding to the second type at the next time point .

[0059] In this way, by constructing a classifier corresponding to a 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), new type data that has not appeared during the model training process can be effectively processed. This enables the model to dynamically adapt to changes in the data distribution, avoids the problem of model failure caused by the appearance of new type data, and thus improves the adaptability and generalization ability of the model.

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

[0061] 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 build a classifier can better identify this type of image and reduce the situation of misclassification.

[0062] In some embodiments, the method further includes: (1) When the second type is in the currently collected type set, obtain the number of query times from the start of training to the current for the collected data of each type in the type set; (2) Calculate the sum value of the query times of each type to obtain the total query times; (3) Based on the query times of each type and the total query times, determine the balance weight of each type.

[0063] Among them, if the second type is in the currently collected type set, it means that the target balance weight is relatively large. 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.

[0064] Specifically, the calculation formula for the total query times can refer to the following form: ; This formula is the sum of the active query times at each time point t from the start of training to the current time point, that is, the total query times. of the active query times at each time point

[0065] The calculation formula for the query times of each type can refer to the following form: ; Among them, is an indicator function. When , its value is 1; otherwise its value is 0. In this way, for any type, when it is actively queried at a certain time point, the query times are incremented by one through summation, so as to obtain the query times of each type.

[0066] Therefore, in actual data scenarios, class imbalance often exists, that is, there are significant differences in the number of data samples of different types. When the type corresponding to the collected data is the 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 query times of each type and the total query times, 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., 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.

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

[0068] 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 class, especially the minority class, to be more accurately divided, reducing the classification bias caused by class imbalance, and improving the overall classification effect. For example, in the network intrusion detection scenario, the newly emerging small-scale network attacks (minority class) can, through reasonable adjustment of the balance weights, enable the model to better define the boundary between normal network behavior and this type of attack behavior, enhancing the detection ability.

[0069] In some embodiments, determining the balance weight of each type based on the query times of each type and the total query times includes: (1.1) Calculate the ratio of the total query times to the query times of each type to obtain the query multiple of each type; (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.

[0070] 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: 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.

[0071] The query multiple of each type can be calculated by the following formula: ; wherein, is the query multiple of each type.

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

[0073] The balance weight of each type can be calculated by the following formula: ; wherein, by calculating the ratio of the query multiple of each type to the maximum target query multiple, normalization processing is realized to obtain the balance weight of each type. 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 tend to the majority class and perform poorly on the minority class. By actively selecting minority class samples for learning, the distribution of training data is made to tend to be balanced, preventing the performance of the fault diagnosis model from tending to the majority class.

[0074] In step 205, when it is determined not to query the acquisition 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.

[0075] wherein, the preset label value of the type label refers to the standard value representing its true situation preset for each type (each abnormal type and normal type) in advance. 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.

[0076] In some embodiments, determining the loss value based on the target prediction probability and the preset label value of the type label includes: (1) Calculating 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; (2) Calculating the difference between 1 and the first calculation result to obtain a second calculation result; (3) Comparing the second calculation result with a preset loss threshold; (4) When the second calculation result is less than the preset loss threshold, determining the preset loss threshold as the loss value; (5) When the second calculation result is greater than the preset loss threshold, determine the second calculation result as the loss value.

[0077] Among them, the loss value can be calculated through the hinge loss, and the specific formula can refer to the following form: ; Among them, when it is determined not to query the acquisition data, it means that the acquisition data is not the type that the model is uncertain about or a new type. The first type is the type corresponding to the acquisition data, so 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 means that the performance of the current model is acceptable, so the preset loss threshold 0 is determined as the loss value; when the second calculation result is greater than the preset loss threshold, it means that the current classification effect of the model does not meet the expected standard, and the model needs to be improved and adjusted, so the second calculation result is determined as the loss value.

[0078] In step 206, 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.

[0079] Among them, the preset loss threshold is a preset loss value boundary (for example, 0). When the loss value generated by the model prediction exceeds this boundary, 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, adjust the parameters of the target classifier to obtain a classification learning model with adjusted parameters.

[0080] 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 adjusting the parameters of the target classifier specifically 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.

[0081] In some embodiments, each of the classifiers consists of a kernel function and a corresponding support vector set, and each support vector in the support vector set serves as a calculation parameter for the corresponding kernel function. Adjusting the parameters of the target classifier to obtain a classification learning model with adjusted parameters includes: (1) Obtaining the target number of support vectors in the target support vector set corresponding to the target classifier; (2) When the target number is less than the preset number corresponding to the target classifier, using the feature vector corresponding to the collected data as the support vector in the target support vector set; (3) When the target number is greater than or equal to the preset number corresponding to the target classifier, removing one support vector from the target support vector set and using the feature vector corresponding to the collected data as the support vector in the target support vector set.

[0082] Among them, each classifier consists of a kernel function and a corresponding support vector set, and each support vector in the support vector set serves as a calculation parameter for the corresponding kernel function. The specific formula representation of each classifier can refer to the following form: ; Among them, is the kernel function, is the support vector set corresponding to the classifier of the time point is any support vector in is a learning parameter greater than zero. It can be seen that adjusting the parameters of the classifier is essentially adjusting the support vectors in the support vector set corresponding to the classifier.

[0083] 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 refer to the following formula: = ; 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 If there is no overflow, it will pass through This way of finding the union takes the feature vector corresponding to the collected data as the support vector in the target support vector set; when At this time, it indicates the current time point At this time, the support vector set of the target classifier And when it is full, to prevent memory overflow and speed up the learning of the model, through This way of finding the union takes the feature vector corresponding to the collected data as the support vector in the target support vector set, and takes the support vector at a non-current time point (that is ) and removes it from the support vector set. As for the support vector sets corresponding to other types of classifiers (that is ), no adjustment is made.

[0084] Finally, at the next time point At this time, the representation forms of the target classifier and other types of classifiers can refer to the following formula: ; Among them, Is the target classifier at time point At time point Its corresponding support vector set is ; Is other types of classifiers at time point At time point Its corresponding support vector set is .

[0085] In this way, 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.

[0086] As can be seen from the above, in the embodiment of the present application, the current acquisition data is obtained; the acquisition data is input into a classification learning model, and each type of classifier included in the classification learning model is used to predict the acquisition data to obtain the prediction probability of each classifier, where the types include multiple abnormal types and a normal type; the target prediction probability with the largest probability is selected from each of the prediction probabilities, 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 acquisition data; when it is determined not to query the acquisition data, a 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 a 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 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 and analyze new data in a timely manner, rather than waiting for all the data to be 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.

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

[0088] To facilitate better implementation of the model training method provided by the embodiment of the present application, the embodiment of the present application also provides 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 refer to the description in the method embodiment.

[0089] Please refer to Figure 3 , Figure 3 FIG. is a schematic structural diagram of the model training device provided by the embodiment 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.

[0090] The first acquisition unit 601 is configured to acquire the current acquisition data; A prediction unit 602, configured to input the collected data into a classification learning model, and perform prediction on the collected 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; A second acquisition unit 603, 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; A first determination unit 604, configured to determine whether to query the collected data based on the target prediction probability and the target balance weight; A second determination unit 605, configured to, when it is determined not to query the collected data, determine a loss value based on the target prediction probability and a preset label value of the type label of the first type; An adjustment unit 606, 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.

[0091] In some embodiments, the second determination unit 605 includes: 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; A first calculation subunit, configured to 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; A second calculation subunit, configured to calculate the difference between 1 and the first calculation result to obtain a second calculation result; A comparison subunit, configured to compare the second calculation result with the preset loss threshold; 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; 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.

[0092] In some embodiments, each classifier consists 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: A second acquisition subunit, configured to acquire the target number of support vectors in the target support vector set corresponding to the target classifier; The first support vector determination subunit is configured to use the feature vector corresponding to the collected data as the support vector in the target support vector set when the target quantity is less than the preset quantity corresponding to the target classifier; The second support vector determination subunit is configured to remove a 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 when the target quantity is greater than or equal to the preset quantity corresponding to the target classifier.

[0093] In some embodiments, the first determination unit 604 includes: The third determination subunit is configured to determine a calculation parameter based on the target balance weight, the target prediction probability, and a preset control parameter; The fourth determination subunit is 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; The fifth determination subunit is configured to determine not to query the collected data when the query decision value is less than one; The sixth determination subunit is configured to determine to query the collected data when the query decision value is greater than or equal to one.

[0094] In some embodiments, the apparatus further includes: The query unit is configured to query the second type corresponding to the type label of the collected data when the query decision value is greater than or equal to one; The construction unit is configured to construct a classifier corresponding to the second type in the classification learning model when the second type is different from each type; The third determination unit is configured to 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.

[0095] In some embodiments, the apparatus further includes: The third acquisition unit is configured to acquire the query times from the start of training to the current for the collected data of each type in the type set when the second type is in the currently collected type set; The first calculation unit is configured to calculate the sum value of the query times of each type to obtain the total query times; The fourth determination unit is configured to determine the balance weight of each type based on the query times of each type and the total query times.

[0096] In some embodiments, the fourth determination unit is configured to: The second calculation unit is configured to calculate the ratio of the total query times to the query times of each type to obtain the query multiple of each type; 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, so as to obtain a balance weight of each type.

[0097] For the specific implementation of each of the above units, reference may be made to the foregoing embodiments, which will not be elaborated herein.

[0098] As can be seen from the above, in the embodiment of the present application, the first acquisition unit 601 acquires current acquisition data; the prediction unit 602 inputs the acquisition data into a classification learning model, and predicts the acquisition data through each type of classifier included in the classification learning model to obtain a prediction probability of each classifier, where the types include multiple abnormal types and a normal type; the second acquisition unit 603 filters out a target prediction probability with the largest probability from each of the prediction probabilities, and acquires a current target balance weight of a first type corresponding to 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; the second determination unit 605, when it is determined not to query the acquisition data, determines a loss value based on the target prediction probability and a preset label value of a type label of the first type; the adjustment unit 606, when the loss value is greater than a preset loss threshold, adjusts 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 causes relatively high training costs and time consumption, the embodiment of the present application operates based on acquiring 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 a single piece of 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 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.

[0099] For the specific implementation of each of the above units, reference may be made to the foregoing embodiments, which will not be elaborated herein.

[0100] Refer to Figure 4 , Figure 4A structural block 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 different configurations or performances, and may include one or more central processing units (CPUs) 622 (for example, one or more processors) and a memory 632, and one or more storage media 630 (for example, 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.

[0101] 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, and so on.

[0102] 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: Obtain the current acquisition data; 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. 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; Based on the target prediction probability and the target balance weight, determine whether to query the acquisition data; 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; 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.

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

[0104] 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 the above-mentioned model training method. For example: Obtain current acquisition data; Input the acquisition data into a 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; 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; Based on the target prediction probability and the target balance weight, determine whether to query the acquisition data; When it is determined not to query the acquisition data, determine 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, adjust the parameters of the target classifier to obtain a classification learning model with adjusted parameters.

[0105] In addition, the terms "including" and "comprising" 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 that are not clearly listed or are inherent to these processes, methods, products or devices.

[0106] It should be understood that in this application, "at least one (item)" means one or more, and "multiple" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist. 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 represents an "or" relationship between the associated objects before and after. "At least one (item) of the following" or a similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) 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.

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

[0108] In several embodiments provided by the present 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 merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may 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 couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.

[0109] 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 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.

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

[0111] If 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 such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the 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 to enable 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 in each embodiment of the present application. And the aforementioned storage medium includes: various media 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 that can store program codes.

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

[0113] In the embodiments of the present 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 implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one 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 that module or unit.

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

Claims

1. A model training method, characterized in that: include: Get the current collection data; Input the collected data into a classification learning model, and predict the collected data using each type of classifier included in the classification learning model to obtain a prediction probability of each classifier, wherein the types include multiple abnormal types and normal types; Filter 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; Based on the target prediction probability and the target balance weight, determining whether to query the collected data; When it is determined not to query the collected 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, the parameters of the target classifier are adjusted to obtain a classification learning model after the parameters are adjusted.

2. The model training method according to claim 1, characterized in that: The determining the loss value based on the target prediction probability and the preset label value of the type label of the first type includes: Calculate the product of the target prediction probability and the preset label value of the first type of type label to obtain a first calculation result; Calculate a difference between the first calculation result and the first calculation result to obtain a second calculation result; comparing the second calculation result with a preset loss threshold; When the second calculation result is less than the preset loss threshold, determining the preset loss threshold as the loss value; When the second calculation result is greater than the preset loss threshold, the second calculation result is determined as a loss value.

3. The model training method according to claim 1 or 2, characterized in that: Each of the classifiers is composed of a kernel function and a corresponding support vector set, each support vector in the support vector set is used as a calculation parameter of the corresponding kernel function, and the parameter adjustment of the target classifier is performed to obtain a classification learning model after the parameter adjustment, including: Obtaining the target number of support vectors in the target support vector set corresponding to the target classifier; When the number of targets is less than the preset number corresponding to the target classifier, the feature vector corresponding to the collected data is used as the support vector in the target support vector set; When the number of targets is greater than or equal to the preset number corresponding to the target classifier, a support vector is removed from the target support vector set, and the feature vector corresponding to the collected data is used as the support vector in the target support vector set.

4. The model training method according to claim 3, characterized in that: The determining whether to query the collected data based on the target prediction probability and the target balance weight includes: Determining calculation parameters based on the target balance weight, the target prediction probability and preset control parameters; Performing Poisson distribution calculation on the calculation parameter, and determining any random number that obeys the Poisson distribution as the query decision value; When the query decision value is less than one, determining not to query the collected data; When the query decision value is greater than or equal to one, it is determined to query the collected data.

5. The model training method according to claim 1, characterized in that: The method further comprises: When the query decision value is greater than or equal to one, querying a second type corresponding to the type tag of the collected data; When the second type is different from each type, constructing a classifier corresponding to the second type in the classification learning model; The data feature vector corresponding to the data feature vector of the collected data is used as a support vector in a support vector set of the classifier corresponding to the second type.

6. The model training method according to claim 5, characterized in that: The method further comprises: When the second type is in the currently collected type set, obtaining the query times of the collected data of each type in the type set from the start of training to the current time; Calculate the sum of the number of queries of each type to get the total number of queries; Based on the query count of each type and the total query count, a balancing weight of each type is determined.

7. The model training method according to claim 6, characterized in that: The determining the balancing weight of each type based on the query number of each type and the total query number includes: Calculate the ratio of the total query times to the query times of each type to obtain the query multiple of each type; A target query multiple with the largest query multiple is determined, and a ratio of the query multiple of each type to the target query multiple is calculated to obtain a balance weight of each type.

8. A model training device, characterized in that: include: A first acquisition unit, used to acquire current collected data; A prediction unit, used for inputting the collected data into a classification learning model, predicting the collected data by using each type of classifier included in the classification learning model to obtain a prediction probability of each classifier, wherein the types include a plurality of abnormal types and a normal type; A second acquisition unit is used to select a target prediction probability with the largest probability from each of the prediction probabilities, and obtain a current target balance weight of the first type of target classifier corresponding to the target prediction probability; A first determining unit, configured to determine whether to query the collected data based on the target prediction probability and the target balance weight; A second determining unit, configured to determine a loss value based on the target prediction probability and a preset label value of the type label of the first type when it is determined not to query the collected data; The adjustment unit is used to adjust the parameters of the target classifier when the loss value is greater than a preset loss threshold to obtain a classification learning model after the parameters are adjusted.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, which are suitable for loading by a processor to execute the model training method described in any one of claims 1 to 7.

10. 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, the model training method described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

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

    CN114330499A