Classification model training method, device and computer readable medium

By balancing the device's historical operation data, a balanced training data set is generated, which solves the problem of high false alarm rate of the classification model caused by unbalanced device operation data, and improves the classification accuracy and model reliability.

CN113692589BActive Publication Date: 2025-01-17SIEMENS (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201980095070.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-29
Publication Date
2025-01-17
Estimated Expiration
2039-04-29

AI Technical Summary

Technical Problem

In the prior art, the classification model training false alarm rate caused by unbalanced equipment operation data is high and the classification accuracy is low, so it is impossible to accurately determine whether the equipment has a failure.

Method used

By obtaining the historical operation data of the device, we can determine whether the data is balanced. If it is unbalanced, we will send an interactive request to the user, obtain an equalization processing instruction, perform equalization processing on the data, generate an unbalanced data set identifier, and determine the corresponding sixth data set , the samples are combined to form an equalized second training data for training the classification model.

Benefits of technology

The classification accuracy of the classification model is improved, the false alarm rate is reduced, and the data during normal operation of the equipment does not lead to imbalance, which enhances the reliability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113692589B_ABST
    Figure CN113692589B_ABST
Patent Text Reader

Abstract

A classification model training method, device and computer-readable medium, the classification model training method comprising: obtaining first training data (101); determining whether the first training data is balanced (102); if the first training data is unbalanced, sending an interaction request to a user (103); receiving an equalization processing instruction from the user in response to the interaction request (104), wherein the equalization processing instruction comprises at least one data set identifier, each data set identifier being used to identify a first data set in the first training data that causes the first training data to be unbalanced; according to the equalization processing instruction, performing equalization processing on the first training data for each first data set identified by the data set identifier to obtain second training data (105); and using the second training data to train a classification model corresponding to a target device (106). The method can improve the classification accuracy of the trained classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing, and in particular to a classification model training method, device and computer-readable medium. Background Art

[0002] During the normal operation of the equipment, the value of the equipment operation data will remain within a normal range. If the value of the operation data exceeds the normal range, it may be caused by a failure of the equipment. Therefore, the classification model can be trained through the historical operation data of the equipment during normal operation, and then the equipment operation data can be input into the classification model in real time, and the classification model can be used to determine whether there is a failure during the operation of the equipment. For example, the refining equipment includes a pipeline for transmitting liquids. By monitoring the flow rate, pressure, and temperature of the liquid in the pipeline, the working condition of the pipeline can be determined. For example, when the pipeline is blocked, the flow rate data will decrease, and when the pipeline leaks, the pressure data will decrease.

[0003] When the historical operation data of the device is used as training data to train the classification model, the device may have multiple different operation modes, and the training data may be the historical operation data of the device in multiple operation modes. Since the operation data generated by the device in different operation modes are different, the training data may be unbalanced. For example, the training data consists of a first data set and a second data set, wherein the first data set includes the historical operation data of the device when it is operating in the first operation mode, and the second data set includes the historical operation data of the device when it is operating in the second operation mode. In one possible case, the number of samples in the first data set is much smaller than that in the second data set. In this case, the training data is unbalanced. Among them, the judgment conditions used for data imbalance judgment can be determined according to the actual situation. For example, when the ratio of the number of samples in the first data set to the number of samples in the second data set is less than the preset threshold value, it is determined that the training data is unbalanced.

[0004] At present, the classification model is trained directly using the acquired training data. Since the training data may be unbalanced, if the classification model is trained using unbalanced training data, a situation may occur where, when the trained classification model is used to analyze the operation data of the equipment in real time, the equipment abnormality may be incorrectly concluded based on the operation data falling within the numerical range corresponding to the aforementioned first data set, thereby generating a large number of false alarms when the classification model is used to judge the equipment operation status, and the classification accuracy of the classification model is low. Summary of the invention

[0005] In view of this, the classification model training method, device and computer-readable medium provided by the present invention can improve the classification accuracy of the trained classification model.

[0006] In a first aspect, an embodiment of the present invention provides a classification model training method, comprising:

[0007] Acquire first training data, wherein the first training data includes historical operation data of the target device;

[0008] Determining whether the first training data is balanced;

[0009] If the first training data is unbalanced, sending an interaction request to the user, wherein the interaction request is used to request the user to determine a method for processing the first training data;

[0010] receiving an equalization processing instruction from a user in response to an interaction request, wherein the equalization processing instruction includes at least one data set identifier, each of the at least one data set identifier is used to identify a first data set in the first training data that causes the first training data to be unbalanced, and different data set identifiers identify different first data sets;

[0011] According to the equalization processing instruction, the first training data is equalized for each first data set identified by the data set identifier to obtain second training data, wherein each second data set corresponding to each data set identifier in the second training data does not cause the second training data to be unbalanced;

[0012] The classification model corresponding to the target device is trained using the second training data.

[0013] After obtaining the first training data, it is determined whether the first training data is balanced. If the first training data is unbalanced, an interaction request is sent to the user, requesting the user to determine the method for processing the first training data. After receiving the equalization processing instruction from the user in response to the interaction request, the first training data is equalized according to the equalization processing instruction to obtain the second training data, so that the historical operation data of the target device in the second training data when it is operating normally will not cause the second training data to be unbalanced, and then the second training data is used to train the classification model. It can be seen that the unbalanced first training data is converted into the second training data, so that the historical operation data of the target device in the second training data when it is operating normally will not cause the second training data to be unbalanced, so that the classification model trained using the second training data will not erroneously give the analysis result of the abnormality of the target device based on the operation data of the target device when it is operating normally, and it is ensured that the trained classification model has a high classification accuracy.

[0014] Optionally, when determining whether the first training data is balanced, first cluster processing is performed on the first training data to obtain at least one third data set, wherein each third data set includes at least one sample, the values ​​of each sample in the same third data set are in the same value range, and the values ​​of samples in different third data sets are in different value ranges, and then it is determined whether only one third data set is obtained by clustering processing. If only one third data set is obtained, it is determined that the first training data is balanced. If at least two third data sets are obtained, a fourth data set including the least number of samples and a fifth data set including the largest number of samples are determined from each of the third data sets, and then it is determined whether the ratio of the number of samples in the fourth data set to the fifth data set is less than a preset proportion threshold. If the ratio of the number of samples in the fourth data set to the fifth data set is less than the proportion threshold, it is determined that the first training data is unbalanced. If the ratio of the number of samples in the fourth data set to the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced.

[0015] By clustering the first training data, the samples included in the first training data are clustered into one or more third data sets, that is, the samples with values ​​in the same numerical range are classified into the same third data set. If the clustering process only obtains one third data set, it means that the values ​​of the samples in the first training data are in the same numerical range, that is, the first training data is balanced. If the clustering process obtains multiple third data sets, the ratio of the number of samples in the third data set with the least number of samples to the number of samples in the third data set with the largest number of samples is calculated. If the calculated ratio is less than the preset ratio threshold, it means that the number of samples in different third data sets is quite different, and the distribution of samples in the first training data is uneven. It is determined that the first training data is unbalanced, otherwise it is determined that the first training data is balanced. Whether the first training data is balanced is judged in two stages according to the number of third data sets and the number of samples in the third data set, so as to ensure that the balance of the first training data can be accurately judged.

[0016] Optionally, when performing equalization processing on the first training data to obtain the second training data, for each data set identifier included in the equalization processing instruction, a sixth data set corresponding to the data set identifier is determined, so that the values ​​of the samples in the sixth data set and the values ​​of the samples in the first data set identified by the data set identifier are within the same numerical range, and it is necessary to ensure that the ratio of the total number of samples in the first data set identified by the data set identifier and the sixth data set corresponding to the data set identifier to the number of samples in the fifth data set is greater than or equal to a proportion threshold. After determining the sixth data set corresponding to each data set identifier, the samples in each determined sixth data set are combined with the first training data to obtain the second training data.

[0017] The first data set is determined by the user to cause the first training data to be unbalanced, and the samples included therein are historical operating data of the target device when it is operating normally. Since the number of samples included in the first data set is small, the first training data is unbalanced. Therefore, a corresponding sixth data set is determined for each first data set, so that the values ​​of the samples in the sixth data set and the values ​​of the samples in the corresponding first data set are within the same numerical range. In this way, when the samples in the sixth data set are combined with the first training data, the samples in the first data set are essentially expanded, so that the historical operating data of the target device when it is operating normally in the second training data will not cause the second training data to be unbalanced.

[0018] Optionally, when determining a sixth data set corresponding to a data set identifier, at least one sample may be collected from the first data set identified by the data set identifier, and then a combination of the collected samples may be used as the sixth data set corresponding to the data set identifier.

[0019] When determining the sixth data set corresponding to the data set identifier, it is required that the values ​​of the samples in the determined sixth data set and the values ​​of the samples in the first data set identified by the data set identifier are within the same numerical range. To this end, samples can be directly collected from the first data set identified by the data set identifier as the sixth data set corresponding to the data set identifier. This makes it more convenient to balance the first training data. Since there is no need to look for other historical operating data, the efficiency of separate model training can be improved.

[0020] Optionally, after determining that the first training data is unbalanced and sending an interaction request to the user, if a data reselection instruction is received from the user in response to the interaction request, the third training data is read from the corresponding storage space according to the data read address included in the data reselection instruction, and then the third training data is used as the first training data to restart the judgment of the balance of the first training data.

[0021] After determining that the first training data is unbalanced, if the user sends a data reselection instruction to instruct to reselect the training data, the first training data previously acquired is discarded, and the first training data is acquired again according to the data reselection instruction. In this way, when the imbalance of the acquired first training data causes the trained classification model to be inaccurate, the first training data with a more balanced sample distribution can be reselected to train the classification model, which can meet the usage needs of different users and improve the applicability of the classification model training method.

[0022] In a second aspect, the present invention further provides a classification model training device, comprising:

[0023] a data acquisition module, configured to acquire first training data, wherein the first training data includes historical operation data of the target device;

[0024] a data judgment module, used to judge whether the first training data acquired by the data acquisition module is balanced;

[0025] a request sending module, configured to send an interaction request to a user according to a judgment result of the data judgment module if the first training data is unbalanced, wherein the interaction request is used to request the user to determine a method for processing the first training data;

[0026] an instruction receiving module, configured to receive an equalization processing instruction from a user in response to an interactive request sent by the request sending module, wherein the equalization processing instruction includes at least one data set identifier, each of the at least one data set identifier is used to identify a first data set in the first training data that causes the first training data to be unbalanced, and different data set identifiers identify different first data sets;

[0027] a data processing module, configured to perform equalization processing on the first training data for each first data set identified by the data set identifier according to the equalization processing instruction received by the instruction receiving module, to obtain second training data, wherein each second data set corresponding to each data set identifier in the second training data will not cause the second training data to be unbalanced;

[0028] A model training module is used to train a classification model corresponding to the target device using the second training data obtained by the data processing module.

[0029] After the data acquisition module acquires the first training data, the data judgment module determines whether the first training data is balanced. The request sending module sends an interaction request to the user according to the judgment result of the data judgment module after the data judgment module determines that the first training data is unbalanced. When the instruction receiving module receives the equalization processing instruction of the user in response to the interaction request sent by the request sending module, the data processing module performs equalization processing on the first training data for the first data set identified by each data set identifier in the equalization processing instruction, and obtains the second training data that does not cause imbalance in the second data set corresponding to the data set identifier. The model training module uses the second training data acquired by the data processing module to train the classification model corresponding to the target device. Before the model training module trains the classification model, if the first training data is unbalanced due to the small number of samples of historical operation data when the corresponding target device is operating normally, the first training data is converted into the second training data, so that the historical operation data when the target device is operating normally will not cause the second training data to be unbalanced. Then, the second training data is used to train the classification model corresponding to the target device, ensuring that the trained classification model will not determine that the target device is abnormal based on the operation data when the target device is operating normally, thereby improving the classification accuracy of the trained classification model.

[0030] Optionally, the data judgment module includes:

[0031] a cluster processing unit, configured to perform cluster processing on the first training data to obtain at least one third data set, wherein each third data set includes at least one sample, the values ​​of the samples in the same third data set are within the same value range, and the values ​​of the samples in different third data sets are within different value ranges;

[0032] a first judgment unit, configured to determine whether the first training data is balanced when the cluster processing unit performs cluster processing on the first training data to obtain a third data set;

[0033] A second judgment unit is used to determine, when the clustering processing unit performs clustering processing on the first training data to obtain at least two third data sets, a fourth data set including the least number of samples and a fifth data set including the largest number of samples from the at least two third data sets; if the ratio of the number of samples in the fourth data set to the fifth data set is less than a preset proportion threshold, it is determined that the first training data is unbalanced; if the ratio of the number of samples in the fourth data set to the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced.

[0034] The cluster processing unit can cluster the first training data into one or more third data sets, so that the values ​​of the samples in each third data set have the same numerical range, and the first judgment unit and the second judgment unit perform subsequent processing based on the number of third data sets obtained by the cluster processing unit. If the cluster processing unit obtains only one third data set, the first judgment unit determines that the first training data is balanced. If the cluster processing unit obtains at least two third data sets, the second judgment unit first determines from each third data set a fourth data set including the least number of samples and a fifth data set including the largest number of samples, and then determines whether the ratio of the number of samples in the fourth data set to the fifth data set is less than a preset proportion threshold, if so, it is determined that the first training data is unbalanced, otherwise it is determined that the first training data is balanced. The first judgment unit and the second judgment unit determine whether the first training data is balanced in two stages based on the result of clustering processing performed by the cluster processing unit, and the judgment process combines the number of third data sets and the number of samples in the third data sets to ensure the accuracy of the balance judgment of the first training data.

[0035] Optionally, the data processing module includes:

[0036] A data acquisition unit, configured to determine, for each data set identifier included in the equalization processing instruction, a sixth data set corresponding to the data set identifier, wherein the values ​​of samples in the sixth data set and the values ​​of samples in the first data set identified by the data set identifier are in the same value range, and the ratio of the total number of samples in the first data set identified by the data set identifier and the sixth data set to the number of samples in the fifth data set is greater than or equal to a proportion threshold;

[0037] A data combining unit is used to combine the samples in each sixth data set determined by the data acquisition unit with the first training data to obtain second training data.

[0038] For each data set identifier included in the equalization processing instruction, the data acquisition unit can determine a sixth data set corresponding to the data set identifier, so that the values ​​of the samples in the sixth data set and the values ​​of the samples in the first data set identified by the data set identifier are within the same numerical range, and ensure that the ratio of the total number of samples in the sixth data set and the first data set identified by the data set identifier to the number of samples in the fifth data set is greater than or equal to the proportion threshold. The data combination unit can combine the samples in each sixth data set determined by the data acquisition unit with the first training data to obtain the combined second training data.

[0039] For each data set identifier, the data acquisition unit determines a sixth data set including at least one sample to expand the first data set identified by the data set identifier based on the numerical range of the sample values ​​in the first data set identified by the data set identifier. After the data combination unit combines the samples in each sixth data set with the first training data, the samples in the second data set corresponding to the data set identifier in the second training data set are the sum of the samples in the sixth data set corresponding to the data set identifier and the first data set identified by the data set identifier, so that the second data set corresponding to each data set identifier will not cause imbalance in the second training data, thereby realizing the conversion of the unbalanced first training data into the second training data through equalization processing.

[0040] Optionally, for each data set identifier, the data collection unit may collect samples from the first data set identified by the data set identifier, and then use the set of collected samples as the sixth data set corresponding to the data set identifier.

[0041] The data collection unit directly collects samples from the first data set identified by the data set identifier, and then uses the set of collected samples as the sixth data set corresponding to the data set identifier. Since the combination of samples in the first data set and the sixth data set corresponding to the same data set identifier forms the second data set corresponding to the data set identifier in the second training data, it can be ensured that the values ​​of the samples in the sixth data set are in the same numerical range as the values ​​of the samples in the corresponding first data set, thereby ensuring the effectiveness and accuracy of the equalization processing of the first training data.

[0042] Optionally, the classification model training device may further include a data reselection module. When the instruction receiving module receives the data reselection instruction of the user in response to the interaction request, the data reselection module may read the third training data from the corresponding storage space according to the data reading address included in the data reselection instruction, and then use the third training data as the first training data to trigger the data judgment module to verify the balance of the new first training data.

[0043] The data reselection module can reselect training data according to the user's instructions to meet the user's needs to abandon the previous first training data and reselect training data for training the classification model, thereby meeting the usage needs of different users and helping to improve the applicability of the classification model training.

[0044] In a third aspect, an embodiment of the present invention further provides a classification model training device, comprising: at least one memory and at least one processor;

[0045] at least one memory for storing a machine-readable program;

[0046] At least one processor is used to call a machine-readable program to execute the method provided by the first aspect or any possible implementation of the first aspect.

[0047] Among them, a machine-readable program is stored in the memory, and the processor can execute the method provided by the first aspect or any implementable method of the first aspect by calling the machine-readable program stored in the memory. After obtaining the first training data, it is determined whether the first training data is balanced. If the first training data is unbalanced, an interaction request is sent to the user, requesting the user to determine the method for processing the first training data. After receiving the equalization processing instruction of the user in response to the interaction request, the first training data is equalized according to the equalization processing instruction to obtain the second training data, so that the historical operation data of the target device in the second training data when it is operating normally will not cause the second training data to be unbalanced, and then the classification model is trained using the second training data. It can be seen that the unbalanced first training data is converted into the second training data, so that the historical operation data of the target device in the second training data when it is operating normally will not cause the second training data to be unbalanced, so that the classification model trained using the second training data will not erroneously give the analysis result of the abnormality of the target device based on the operation data of the target device when it is operating normally, and the trained classification model is guaranteed to have a high classification accuracy.

[0048] In a fourth aspect, an embodiment of the present invention further provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided by the first aspect or any possible implementation of the first aspect.

[0049] Among them, the machine-readable medium stores computer instructions, and when the computer instructions are executed by the processor, the processor will execute the distribution model training method provided by the first aspect and any possible implementation of the first aspect, after obtaining the first training data, determine whether the first training data is balanced, if the first training data is unbalanced, send an interactive request to the user, requesting the user to determine the method for processing the first training data, and after receiving the equalization processing instruction of the user in response to the interactive request, perform equalization processing on the first training data according to the equalization processing instruction to obtain the second training data, so that the historical operation data of the target device in the second training data when it is operating normally will not cause the second training data to be unbalanced, and then use the second training data to train the classification model. It can be seen that the unbalanced first training data is converted into the second training data, so that the historical operation data of the target device in the second training data when it is operating normally will not cause the second training data to be unbalanced, so that the classification model trained by using the second training data will not erroneously give the analysis result of the abnormality of the target device based on the operation data of the target device when it is operating normally, and ensure that the trained classification model has a high classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Other features, characteristics, advantages and benefits of the present invention will become more apparent from the following detailed description taken in conjunction with the accompanying drawings.

[0051] Figure 1 is a flow chart of a classification model training method provided by an embodiment of the present invention;

[0052] Figure 2 is a flow chart of a first training data balance determination method provided by an embodiment of the present invention;

[0053] Figure 3 is a flowchart of a method for equalizing first training data provided by an embodiment of the present invention;

[0054] Figure 4 is a flowchart of a sixth data set determination method provided by an embodiment of the present invention;

[0055] Figure 5 is a flow chart of a training data reselection method provided by an embodiment of the present invention;

[0056] Figure 6 is a flow chart of another classification model training method provided by one embodiment of the present invention;

[0057] Figure 7 is a schematic diagram of a classification model training device provided by an embodiment of the present invention;

[0058] Figure 8 is a schematic diagram of another classification model training device provided by an embodiment of the present invention;

[0059] Fig. 9 is a schematic diagram of another classification model training device provided by an embodiment of the present invention;

[0060] Fig.10 is a schematic diagram of a classification model training device including a data retraining module provided by an embodiment of the present invention;

[0061] Fig.11 It is a schematic diagram of another classification model training device provided by an embodiment of the present invention.

[0062] List of reference numerals:

[0063] 101: Get the first training data

[0064] 102: Determine whether the first training data is balanced

[0065] 103: Sending an interaction request to the user when the first training data is unbalanced

[0066] 104: receiving an equalization processing instruction from a user in response to an interaction request

[0067] 105: Perform equalization processing on the first training data according to the equalization processing instruction to obtain second training data

[0068] 106: Train the classification model using the second training data

[0069] 201: Perform clustering processing on the first training data to obtain at least one third data set

[0070] 202: Determine whether the clustering process obtains only one third data set

[0071] 203: Determine the first training data balance

[0072] 204: Determine a fourth data set and a fifth data set from each third data set

[0073] 205: Determine whether the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is less than the proportion threshold

[0074] 206: Determine the first training data imbalance

[0075] 301: Determine the sixth data set corresponding to each data set identifier

[0076] 302: Combine the samples in each sixth data set with the first training data to obtain second training data

[0077] 401: Collect at least one sample from the first data set identified by the data set identifier

[0078] 402: taking the sample set including each collected sample as the sixth data set corresponding to the data set identifier

[0079] 501: Receive a data reselection instruction from the user in response to an interactive request

[0080] 502: Read the third training data according to the data reselection instruction

[0081] 503: Use the third training data as the first training data and execute step 102

[0082] 601: Get the first training data

[0083] 602: Perform clustering processing on the first training data to obtain at least one third data set

[0084] 603: Determine whether only one third data set is obtained

[0085] 604: Training a classification model using the first training data

[0086] 605: Determine a fourth data set and a fifth data set from each third data set

[0087] 606: Determine whether the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is less than the proportion threshold

[0088] 607: Send an interaction request to the user

[0089] 608: Determine whether a model training instruction in response to the interaction request from the user is received

[0090] 609: Determine whether a data reselection instruction in response to the interaction request is received

[0091] 610: Re-acquire the first training data according to the data reselection instruction

[0092] 611: Determine whether a balancing processing instruction in response to an interaction request from the user is received

[0093] 612: Determine the sixth data set corresponding to each data set identifier in the equalization processing instruction

[0094] 613: Combine the samples in each sixth data set with the first training data to obtain second training data

[0095] 614: Training the classification model using the second training data

[0096] 615: End the current process

[0097] 701: Data acquisition module 702: Data judgment module 703: Request sending module

[0098] 704: instruction receiving module 705: data processing module 706: model training module

[0099] 707: data reselection module 7021: clustering processing unit 7022: first judgment unit

[0100] 7023: second judgment unit 7051: data collection unit 7052: data combination unit

[0101] 1101: Memory 1102: Processor DETAILED DESCRIPTION

[0102] As mentioned above, the historical operation data of the equipment is directly used as training data to train the classification model. When the training data is unbalanced, if all the training data are historical operation data when the equipment is operating normally, the trained classification model will believe that the samples in the first data set that includes a small number of samples in the training data are operation data generated when the equipment is abnormal. When such a classification model is used to analyze the operation data of the equipment in real time, based on the normal operation data whose values ​​fall within the numerical range corresponding to the first data set, the classification model will conclude that the equipment is abnormal, so that the classification model will generate a large number of false alarms, resulting in a low classification accuracy of the classification model.

[0103] In an embodiment of the present invention, after obtaining the first training data for training the classification model, it is first determined whether the first training data is balanced. When it is determined that the first training data is unbalanced, an interaction request is sent to the user, and the user determines the method for processing the first training data. If a balancing processing instruction is received from the user in response to the interaction request, the first training data is balanced and processed into the second training data according to the balancing processing instruction, so that the historical operation data of the target device during normal operation will not cause the second training data to be unbalanced, and then the second training data is used to train the classification model corresponding to the target device. It can be seen that when there is historical operation data when the device is operating normally, which causes the first training data to be unbalanced, the second training data is obtained by performing balancing processing on the first training data, so that the historical operation data when the device is operating normally will not cause the second training data to be unbalanced, thereby reducing the false alarm probability of the classification model trained using the second training data and improving the classification accuracy of the trained classification model.

[0104] The classification model training method and device provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0105] like Figure 1 As shown, an embodiment of the present invention provides a classification model training method, which may include the following steps:

[0106] Step 101: Acquire first training data, wherein the first training data includes historical operation data of a target device;

[0107] Step 102: Determine whether the first training data is balanced;

[0108] Step 103: If the first training data is unbalanced, sending an interaction request to the user, wherein the interaction request is used to request the user to determine a method for processing the first training data;

[0109] Step 104: receiving an equalization processing instruction from the user in response to the interactive request, wherein the equalization processing instruction includes at least one data set identifier, each of the at least one data set identifier is used to identify a first data set in the first training data that causes the first training data to be unbalanced, and different data set identifiers identify different first data sets;

[0110] Step 105: performing equalization processing on the first training data for each first data set identified by each data set identifier according to the equalization processing instruction to obtain second training data, wherein each second data set corresponding to each data set identifier in the second training data will not cause the second training data to be unbalanced;

[0111] Step 106: Use the second training data to train a classification model corresponding to the target device.

[0112] The classification model training method provided by the embodiment of the present invention determines whether the first training data is balanced after acquiring first training data including historical operation data of a target device. When it is determined that the first training data is unbalanced, an interaction request is sent to a user so that the user can determine the manner of processing the first training data. After receiving an equalization processing instruction from the user in response to the interaction request, the first training data is respectively equalized for each first data set identified by each data set identifier included in the equalization processing instruction. In the second training data obtained by the equalization processing, the second data sets corresponding to each data set identifier will not cause the second training data to be unbalanced. The obtained second training data is then used to train a classification model corresponding to the target device. It can be seen that after it is determined that the first training data is unbalanced, the user determines whether it is necessary to perform equalization processing on the first training data and the first data set for the equalization processing. When the user determines to perform equalization processing on the first training data, the second training data is obtained by performing equalization processing on the first training data, so that the historical operation data of the target device during normal operation in the second training data will not cause the second training data to be unbalanced, so that the classification model trained using the second training data will not make misjudgments due to the imbalance of the training data, thereby ensuring that the trained classification model has a higher classification accuracy.

[0113] In the embodiment of the present invention, when obtaining the first training data in step 101, historical operation data including a certain number of samples can be selected from the historical operation data of the target device as the first training data. Specifically, the historical operation data of the target device in a continuous time period can be used as the first training data, or the historical operation data of the target device in multiple non-continuous time periods can be used as the first training data. In addition, since the operating environments of different devices are not exactly the same, when it is necessary to train a classification model for a device to monitor whether the device is abnormal through the classification model, in order to ensure that the trained classification model has a high classification accuracy, the historical operation data of the device needs to be used as training data to train the classification model.

[0114] In an embodiment of the present invention, when it is determined that the first training data is unbalanced and an interaction request is sent to the user, the interaction request may include multiple options to facilitate the user to select a method for processing the first training data from each option. The interaction request may include the following three options: training a classification model based on existing training data, reselecting training data, and performing equalization processing on the training data. The following describes the processing methods after the user selects the above three options:

[0115] When the user chooses to train the classification model based on the existing training data, the first training data is directly used to train the classification model corresponding to the target device. In this case, at least one of the first training data includes a first data set with a small number of samples, which causes the first training data to be unbalanced, and the samples included in each first data set are historical operating data when the target device is operating abnormally. At this time, the first training data is directly used to train the classification model. When the trained classification model is used to analyze the operating data of the target device in real time, if there is operating data that falls into the numerical range corresponding to any of the first data sets, the classification model will give a conclusion that the target device is abnormal.

[0116] When the user chooses to reselect training data, the training data is reread according to the data storage address provided by the user, and the reread training data is used as the first training data to start executing step 102. In this case, the user confirms that the first training data selected for training the classification model is incorrect, and the training data is reselected according to the user's instructions, and it is further determined whether the reselected training data is balanced.

[0117] When the user chooses to perform equalization processing on the training data, the user is shown various data sets that cause the first training data to be unbalanced, and the user selects the first data set from the various data sets shown, and then the user can generate an equalization processing instruction including various data set identifiers for identifying various first data sets. In this case, when judging whether the first training data is balanced, at least one data set that causes the first training data to be unbalanced can be determined, but a small number of samples included in the data set may be historical operation data when the target device is operating abnormally, or may be historical operation data when the target device is operating normally. At this time, the user needs to distinguish and determine the data set including a small number of samples as historical operation data when the target device is operating normally as the first data set, and then the first training data can be equalized for the first data set. In this way, in the second training data obtained by performing equalization processing on the first training data, the historical operation data when the target device is operating normally will not cause the second training data to be unbalanced, while the historical operation data when the target device is operating abnormally may cause the second training data to be unbalanced. At this time, the classification model trained using the second training data can more accurately identify whether the target device is abnormal.

[0118] In addition, when sending an interaction request to the user, the above three options may be displayed to the user in the form of a prompt box, and then further interaction is performed with the user according to the option selected by the user, or the first training data is directly processed according to the option selected by the user.

[0119] In the embodiment of the present invention, when step 102 determines whether the first training data is balanced, if the determination result is that the first training data is balanced, the first training data is directly used to train the classification model corresponding to the target device.

[0120] In an embodiment of the present invention, when step 106 uses the second training data to train the classification model corresponding to the target device, the second training data can be used as input to train the classification model through various types of machine algorithms. The specific machine algorithm can be an artificial neural network algorithm, a deep learning algorithm, a kernel-based algorithm, an integrated algorithm, a genetic algorithm, etc.

[0121] Optionally, in Figure 1 Based on the classification model training method shown, when determining whether the first training data is balanced in step 102, clustering can be performed on the first training data to cluster the first training data into one or more data sets, and then determining whether the first training data is balanced based on the number of data sets obtained by clustering and the ratio of the number of samples in the data sets. Specifically, Figure 2 As shown, determining whether the first training data is balanced can be achieved by the following steps:

[0122] Step 201: performing clustering processing on the first training data to obtain at least one third data set, wherein each third data set includes at least one sample, the values ​​of each sample in the same third data set are within the same value range, and the values ​​of samples in different third data sets are within different value ranges;

[0123] Step 202: Determine whether only one third data set is obtained by clustering the first training data. If yes, execute step 203; otherwise, execute step 204;

[0124] Step 203: Determine that the first training data is balanced, and end the current process;

[0125] Step 204: determining a fourth data set including the least number of samples and a fifth data set including the greatest number of samples from at least two third data sets;

[0126] Step 205: determine whether the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is less than a preset ratio threshold, if yes, execute step 206, otherwise execute step 203;

[0127] Step 206: Determine whether the first training data is imbalanced.

[0128] In an embodiment of the present invention, by clustering the first training data, the first training data can be clustered into at least one third data set, so that each third data set includes at least one sample, and the values ​​of each sample in the same third data set are within the same numerical range, and the values ​​of samples in different third data sets are within different numerical ranges. The first training data is composed of historical operating data of the target device. Since the values ​​of the operating data when the target device operates normally in the same operating mode are within the same numerical range, one or more third data sets can be obtained by clustering the first training data, and the values ​​of each sample in the same third data set are within the same numerical range. For example, the target device has two operating modes. When the target device operates normally in the first operating mode, the numerical range of the operating data is 50-80, and when the target device operates normally in the second operating mode, the numerical range of the operating data is 120-150. By clustering the first training data, three third data sets, namely the third data set 1, the third data set 2 and the third data set 3, are obtained. Among them, the values ​​of each sample in the third data set 1 are all in the range of 50-80, the values ​​of each sample in the third data set 2 are all in the range of 120-150, and the values ​​of each sample in the third data set 3 are all in the range of 200-240.

[0129] In the embodiment of the present invention, after obtaining at least one third data set by clustering the first training data, a preliminary judgment is first made on whether the first training data is balanced according to the number of the third data sets. If the clustering process obtains only one third data set, that is, the values ​​of all samples included in the first training data are within the same value range, it can be determined that the first training data is balanced; if the clustering process obtains at least two third data sets, it is necessary to further judge whether the first training data is balanced according to the number of samples in each third data set.

[0130] In an embodiment of the present invention, after clustering the first training data to obtain at least two third data sets, a fourth data set including the least number of samples and a fifth data set including the largest number of samples are determined from the at least two third data sets obtained, and then the number of samples in the fourth data set is compared with the number of samples in the fifth data set. If the ratio of the number of samples in the fourth data set to the fifth data set is less than a preset proportion threshold, it is determined that the first training data is unbalanced, and if the ratio of the number of samples in the fourth data set to the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced. Since the fourth data set is the data set with the least number of samples among all the third data sets, and the fifth data set is the data set with the largest number of samples among all the third data sets, that is, the difference in the number of samples between the fourth data set and the fifth data set is the largest, if the ratio of the number of samples in the fourth data set to the fifth data set is less than the preset proportion threshold, it means that there is a large difference between the number of samples in at least one third data set in the first training data and the number of samples in other third data sets, that is, data imbalance occurs in the first training data.

[0131] In an embodiment of the present invention, according to the actual business scenario, the proportion threshold can be flexibly set in the range of 0.5 to 1.0. The larger the proportion threshold, the higher the sensitivity of the balanced detection of the first training data. The proportion threshold can specifically be 0.6, 0.7, 0.85 or 0.9.

[0132] In the embodiment of the present invention, when performing clustering processing on the first training data in step 201, the first training data may be clustered by using a K-means clustering algorithm, a spectral clustering algorithm, a Gaussian mixture model clustering algorithm, or the like.

[0133] One or more third data sets are obtained by clustering the first training data. Whether the first training data is balanced is determined in two stages according to the number of third data sets and the number of samples included in the third data sets, thereby ensuring that the balance of the first training data can be accurately judged, and further ensuring that the classification model trained using the first training data or the second training data has high classification accuracy.

[0134] It should be noted that in Figure 1 On the basis of the classification model training method shown, when judging whether the first training data is balanced in step 102, in addition to determining whether the first training data is balanced by clustering processing in the above embodiment, other methods can also be used to determine whether the first training data is balanced, such as determining whether the first training data is balanced by fitting a histogram curve to the first training data, or determining whether the first training data is balanced by estimating the distribution of the first training data.

[0135] Optionally, in Figure 2 Based on the method for determining the balance of the first training data, when it is determined that the first training data is unbalanced and the first training data is equalized according to the equalization processing instruction from the user, the problem of the imbalance of the first training data can be solved by adding samples to the first training data. Specifically, Figure 3 As shown, the first training data can be equalized in the following manner:

[0136] Step 301: for each data set identifier included in the equalization processing instruction, determine a sixth data set corresponding to the data set identifier, wherein the values ​​of samples in the sixth data set and the samples in the first data set identified by the data set identifier are in the same value range, and the ratio of the total number of samples in the first data set identified by the data set identifier and the sixth data set to the number of samples in the fifth data set is greater than or equal to a proportion threshold;

[0137] Step 302: Combine the determined samples in each sixth data set corresponding to each data set identifier with the first training data to obtain second training data.

[0138] In an embodiment of the present invention, for each data set identifier included in the equalization processing instruction, the data set identifier is used to identify a corresponding first data set, and the first data set is a data set selected by the user from each third data set. Since the number of samples in the first data set is small, the first training data is unbalanced. Therefore, a corresponding sixth data set can be determined for the data set identifier, and the sixth data set includes at least one sample. The value of each sample in the sixth data set is in the same value range as the value of the sample in the first data set, and the ratio of the total number of samples in the sixth data set and the first data set to the number of samples in the fifth data set is greater than or equal to the proportion threshold. The samples in the sixth data set corresponding to each data set identifier are combined with the first training data to obtain the second training data. In the second training data, for each first data set that causes the first training data to be unbalanced, since the total number of samples in the first data set and the corresponding sixth data set is greater than or equal to the proportion threshold, the first data set and the corresponding sixth data set are considered as a whole, so that the second training data will not be unbalanced.

[0139] For example, following the example in the above embodiment, the equalization processing instruction includes a data set identifier 1, which is used to identify the first data set 1 obtained by processing the first training data, and the first data set 1 is the third data set 2 in the above embodiment. Since the first data set 1 includes fewer samples than the third data set 1, the first training data is unbalanced. Therefore, a sixth data set is determined for the data set identifier 1, and the values ​​of the samples included in the sixth data set are all within the range of 120 to 150 (the same as the numerical range of the samples in the first data set 1), and the ratio of the total number of samples in the sixth data set and the first data set 1 to the number of samples in the fifth data set (here, the third data set 1) is greater than or equal to the proportion threshold. In this way, since the samples in the first data set 1 and the sixth data set have the same numerical range, the first data set 1 and the sixth data set are samples of the same type, and the first data set 1 and the sixth data set combined together will not cause the second training data to be unbalanced.

[0140] Optionally, in Figure 3 Based on the method of equalizing the first training data shown in FIG. 1 , when determining the corresponding sixth data set for each data set identifier in step 301, samples can be collected from the first data set identified by the data set identifier as the sixth data set corresponding to the data set identifier. For each data set identifier, the method of determining the sixth data set corresponding to the data set identifier is as follows: Figure 4 As shown, the following steps may be specifically included:

[0141] Step 401: Collect at least one sample from a first data set identified by the data set identifier;

[0142] Step 402: taking a sample set including at least one collected sample as a sixth data set corresponding to the data set identifier.

[0143] In an embodiment of the present invention, for each data set identifier, in order to obtain samples that are in the same numerical range as the samples in the first data set identified by the data set identifier, samples can be directly collected from the first data set identified by the data set identifier, and then the data set including the collected samples is used as the sixth data set corresponding to the data set identifier. For example, for the data set identifier 1 included in the equalization processing instruction, since the data set identifier 1 is used to identify the first data set 1, a corresponding number of samples can be collected from the first data set 1, and the data set consisting of the collected samples is used as the sixth data set corresponding to the data set identifier 1.

[0144] Because it is ultimately necessary to combine the determined samples in each sixth data set with the first training data to obtain the second training data, and the samples in the sixth data set are collected from the first data set, it is essentially to copy part or all of the samples in the first data set once or multiple times to obtain the sixth data set. This ensures that the samples in the sixth data set have the same numerical range as the corresponding samples in the first data set, and can also ensure the convenience of determining the sixth data set.

[0145] In the embodiment of the present invention, when collecting samples from the first data set, all samples in the first data set may be copied once or multiple times, and samples may be randomly collected from the first data set by random sampling.

[0146] In addition, when determining the sixth data set corresponding to the data set identifier, in addition to Figure 4 In addition to the method shown of collecting samples from the corresponding first data set to obtain the sixth data set, other methods can also be used to obtain the sixth data set. For example, samples can be collected from historical operating data of the target device, and new samples can be directly generated based on samples in the first data set.

[0147] Optionally, based on the classification model training methods provided in the above embodiments, after step 103 sends an interaction request to the user, if the user instructs to reselect training data, the training data can be reselected according to the user's instructions, thereby solving the problem of imbalance of the first training data. Figure 5 As shown, the method for reselecting training data may include the following steps:

[0148] Step 501: receiving a data reselection instruction from a user in response to an interaction request, wherein the data reselection instruction includes a data reading address;

[0149] Step 502: Read third training data from a storage space corresponding to a data read address according to a data reselect instruction;

[0150] Step 503: Use the third training data as the first training data, and determine whether the first training data is balanced.

[0151] After sending an interaction request to the user, if the user sends a data reselection instruction in response to the interaction request, the third training data is read from the corresponding storage space according to the data read address included in the data reselection instruction, and then the read third training data is used as the first training data, and step 102 is restarted.

[0152] After determining that the first training data is unbalanced, an interaction request is sent to the user, and the user can send a data reselection instruction to reselect the training data for training the classification model, thereby solving the problem of imbalance in the first training data previously selected. This provides the user with another way to deal with data imbalance, which can improve the user's usage experience.

[0153] The following takes the training of a classification model for determining whether a motor is operating abnormally according to current data during the operation of the motor as an example to further describe the classification model training method provided by the embodiment of the present invention in detail. Figure 6 As shown, the method may include the following steps:

[0154] Step 601: Obtain first training data.

[0155] In the embodiment of the present invention, when training a classification model for analyzing whether motor A is abnormal, a certain amount of historical operation data is obtained from the historical operation data of motor A as the first training data, specifically, the current data of motor A. For example, the current data of motor A during the past three months is obtained as the first training data.

[0156] Step 602: Perform clustering processing on the first training data to obtain at least one third data set.

[0157] In the embodiment of the present invention, after the first training data is acquired, the first training data is clustered into at least one third data set, so that each third data set includes at least one sample, and the values ​​of each sample in the same third data set are within the same numerical range, and the values ​​of samples in different third data sets are within different numerical ranges. That is, each third data set corresponds to a numerical range, and the numerical ranges corresponding to different third data sets have no overlapping parts. In addition, each sample corresponds to a piece of current data.

[0158] For example, by clustering the first training data, three third data sets are obtained, namely third data set 1, third data set 2 and third data set 3. The third data set 1 includes 8000 samples, the third data set 2 includes 1000 samples, and the third data set 3 includes 2000 samples. The values ​​of each sample in the third data set 1 are all in the range of 50 to 80, the values ​​of each sample in the third data set 2 are all in the range of 120 to 150, and the values ​​of each sample in the third data set 3 are all in the range of 200-240.

[0159] Step 603: Determine whether only one third data set is obtained, if yes, execute step 604, otherwise execute step 605.

[0160] In an embodiment of the present invention, after clustering the first training data to obtain a third data set, it is determined whether the clustering process obtains only one third data set. If only one third data set is obtained, it indicates that the first training data is balanced, and step 604 is executed accordingly. If at least two third data sets are obtained, it is necessary to further determine whether the first training data is balanced, and step 605 is executed accordingly.

[0161] Step 604: Use the first training data to train the classification model and end the current process.

[0162] In the embodiment of the present invention, when only one third data set is obtained by clustering the first training data, it indicates that the first training data is balanced, and the classification model corresponding to motor A is trained directly using the first training data.

[0163] Step 605: Determine a fourth data set and a fifth data set from each third data set.

[0164] In the embodiment of the present invention, when at least two third data sets are obtained, a fourth data set including the least number of samples is determined from each of the third data sets, and a fifth data set including the largest number of samples is determined from each of the third data sets.

[0165] For example, since the number of samples in the third data set 1 is greater than the number of samples in the third data set 3, and the number of samples in the third data set 3 is greater than the number of samples in the third data set 2, the third data set 1 is determined as the fifth data set, and the third data set 2 is determined as the fourth data set.

[0166] Step 606: Determine whether the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is less than a percentage threshold; if so, execute step 607; otherwise, execute step 604.

[0167] In an embodiment of the present invention, after obtaining the fourth data set and the fifth data set, the ratio of the number of samples in the fourth data set to that in the fifth data set is compared with a preset proportion threshold. If the ratio of the number of samples in the fourth data set to that in the fifth data set is less than the proportion threshold, it is determined that the first training data is unbalanced, and step 607 is executed accordingly. If the ratio of the number of samples in the fourth data set to that in the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced, and step 604 is executed accordingly.

[0168] Step 607: Send an interaction request to the user.

[0169] In the embodiment of the present invention, after it is determined that the first training data is unbalanced, an interaction request is sent to the user, requesting the user to determine a method for processing the first training data.

[0170] Step 608: Determine whether a model training instruction is received from the user in response to the interaction request. If so, execute step 604; otherwise, execute step 609.

[0171] In an embodiment of the present invention, after sending an interaction request to the user, if a model training instruction is received from the user in response to the interaction request, wherein the model training instruction is used to instruct the classification model to be trained using the existing first training data, then step 604 is executed to train the classification model corresponding to motor A using the first training data.

[0172] Step 609: Determine whether a data reselection instruction in response to the interaction request from the user is received, if so, execute step 610, otherwise execute step 611.

[0173] In the embodiment of the present invention, after sending an interaction request to the user, if a data reselection instruction is received from the user in response to the interaction request, it is necessary to reselect the training data for training the classification model, and step 610 is executed accordingly.

[0174] Step 610: Reacquire the first training data according to the data reselection instruction, and execute step 602.

[0175] In the embodiment of the present invention, after receiving the data reselection instruction, the third training data is read from the corresponding storage space according to the data read address included in the data reselection instruction, and the read third training data is used as the first training data, and then step 602 is executed.

[0176] For example, the data reading address included in the data reselection instruction is the current data storage address of motor A, and then the current data of motor A is read from the current data storage address as new first training data, and then step 602 is restarted.

[0177] Step 611: Determine whether an equalization processing instruction in response to an interaction request from the user is received. If yes, execute step 612; otherwise, execute 615.

[0178] In an embodiment of the present invention, after sending an interaction request to the user, if an equalization processing instruction is received from the user in response to the interaction request, the first training data needs to be equalized, and step 612 is executed accordingly. Otherwise, it means that the user has not given a corresponding instruction, and the current process ends.

[0179] Step 612: Determine the sixth data set corresponding to each data set identifier included in the equalization processing instruction.

[0180] In an embodiment of the present invention, after receiving an equalization processing instruction, at least one data set identifier included in the equalization processing instruction is obtained, each data set identifier is used to identify a first data set, and different data set identifiers are used to identify different first data sets, and the first data set is a data set selected by a user from various third data sets that cause the first training data to be unbalanced. For each acquired data set identifier, a sixth data set corresponding to the data set identifier is determined, wherein the sixth data set includes at least one sample, the value of the sample in the sixth data set is in the same numerical range as the value of the sample in the first data set identified by the data set identifier, and the ratio of the total number of samples in the sixth data set and the first data set identified by the data set identifier to the number of samples in the fifth data set is greater than or equal to the proportion threshold. Specifically, for each data set identifier, samples can be collected from the first data set identified by the data set identifier, and the collected samples are combined into a sixth data set corresponding to the data set identifier. Further, for each data set identifier, the number of samples in the sixth data set corresponding to the data set identifier satisfies the following condition: the ratio of the total number of samples in the sixth data set corresponding to the data set identifier and the first data set identified by the data set identifier to the number of samples in the fifth data set is equal to the proportion threshold.

[0181] For example, the equalization processing instruction includes a data set identifier 1, which is used to identify the third data set 2. The preset percentage threshold is 0.8, and 5400 samples are collected from the third data set 2, and the set of the collected 5400 samples is used as the sixth data set corresponding to the data set identifier 1. It should be noted that, through user interaction, the user determines that the samples in the third data set 3 are current data when the motor A is operating abnormally, so there is no need to perform equalization processing on the first training data for the third data set 3.

[0182] Step 613: Combine the samples in each sixth data set with the first training data to obtain second training data.

[0183] In the embodiment of the present invention, after the sixth data set corresponding to each data set identifier is obtained, the samples in each of the obtained sixth data sets are combined with the first training data to obtain the second training data.

[0184] For example, 11,000 samples included in the first training data are combined with 5,400 samples included in the sixth data set corresponding to the data set identifier 1 to obtain second training data including 16,400 samples.

[0185] Step 614: Train the classification model using the second training data.

[0186] In the embodiment of the present invention, after the second training data is acquired, the classification model corresponding to motor A is trained using the acquired second training data.

[0187] Step 615: End the current process.

[0188] It should be noted that in Figure 6 In the model training method shown, the various steps are separated in order to more clearly illustrate the model training process. In the actual business display process, there is no absolute order between the steps. For example, step 609 and step 611 can be executed before step 608, and step 611 can be executed before step 609, etc.

[0189] like Figure 7 As shown, one embodiment of the present invention provides a classification model training device, comprising:

[0190] A data acquisition module 701, configured to acquire first training data, wherein the first training data includes historical operation data of a target device;

[0191] A data determination module 702, used to determine whether the first training data acquired by the data acquisition module 701 is balanced;

[0192] a request sending module 703, configured to send an interaction request to a user according to a determination result of the data determination module 702, if the first training data is unbalanced, wherein the interaction request is used to request the user to determine a method for processing the first training data;

[0193] an instruction receiving module 704, configured to receive an equalization processing instruction from a user in response to an interactive request sent by the request sending module 703, wherein the equalization processing instruction includes at least one data set identifier, each of the at least one data set identifier is used to identify a first data set in the first training data that causes the first training data to be unbalanced, and different data set identifiers identify different first data sets;

[0194] a data processing module 705, configured to perform equalization processing on the first training data for each first data set identified by the data set identifier according to the equalization processing instruction received by the instruction receiving module 704, to obtain second training data, wherein each second data set corresponding to each data set identifier in the second training data will not cause the second training data to be unbalanced;

[0195] A model training module 706 is used to train a classification model corresponding to the target device using the second training data acquired by the data processing module 705.

[0196] In an embodiment of the present invention, the data acquisition module 701 can be used to execute step 101 in the above method embodiment, the data judgment module 702 can be used to execute step 102 in the above method embodiment, the request sending module 703 can be used to execute step 103 in the above method embodiment, the instruction receiving module 704 can be used to execute step 104 in the above method embodiment, the data processing module 705 can be used to execute step 105 in the above method embodiment, and the model training module 706 can be used to execute step 106 in the above method embodiment.

[0197] Optionally, in Figure 7 Based on the classification model training device shown, Figure 8 As shown, the data judgment module 702 includes:

[0198] a cluster processing unit 7021, configured to perform cluster processing on the first training data to obtain at least one third data set, wherein each third data set includes at least one sample, the values ​​of each sample in the same third data set are within the same value range, and the values ​​of samples in different third data sets are within different value ranges;

[0199] A first judgment unit 7022, configured to determine whether the first training data is balanced when the clustering processing unit 7021 performs clustering processing on the first training data to obtain a third data set;

[0200] A second judgment unit 7023 is used to determine, when the clustering processing unit 7021 performs clustering processing on the first training data to obtain at least two third data sets, a fourth data set including the least number of samples and a fifth data set including the largest number of samples from the at least two third data sets; if the ratio of the number of samples in the fourth data set to that in the fifth data set is less than a preset proportion threshold, it is determined that the first training data is unbalanced; if the ratio of the number of samples in the fourth data set to that in the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced.

[0201] In an embodiment of the present invention, the clustering processing unit 7021 can be used to execute step 201 in the above method embodiment, the first judgment unit 7022 can be used to execute step 203 in the above method embodiment, and the second judgment unit 7023 can be used to execute steps 204 to 206 in the above method embodiment.

[0202] Optionally, in Figure 8 Based on the classification model training device shown, Fig. 9 As shown, the data processing module 705 includes:

[0203] A data acquisition unit 7051 is used to determine, for each data set identifier included in the equalization processing instruction, a sixth data set corresponding to the data set identifier, wherein the values ​​of the samples in the sixth data set and the samples in the first data set identified by the data set identifier are in the same value range, and the ratio of the total number of samples in the first data set identified by the data set identifier and the sixth data set to the number of samples in the fifth data set is greater than or equal to a proportion threshold;

[0204] A data combining unit 7052 is used to combine the samples in each sixth data set determined by the data collecting unit 7051 with the first training data to obtain second training data.

[0205] In the embodiment of the present invention, the data acquisition unit 7051 may be used to execute step 301 in the above method embodiment, and the data combination unit 7052 may be used to execute step 302 in the above method embodiment.

[0206] Optionally, in Fig. 9 Based on the classification model training device shown,

[0207] The data collection unit 7051 is used to collect at least one sample from the first data set identified by each data set identifier included in the equalization processing instruction, and use the sample set including the at least one collected sample as the sixth data set corresponding to the data set identifier.

[0208] In the embodiment of the present invention, the data acquisition unit 7051 may be used to execute step 401 and step 402 in the above method embodiment.

[0209] Optionally, in Figures 7 to 9 Based on the classification model training device shown in any of the accompanying drawings, Fig.10 As shown, the classification model training device may further include: a data reselection module 707;

[0210] The instruction receiving module 704 is further used to receive a data reselection instruction from a user in response to the interaction request sent by the request sending module 703, wherein the data reselection instruction includes a data reading address;

[0211] The data reselection module 707 is used to read the third training data from the storage space corresponding to the data reading address according to the data reselection instruction received by the instruction receiving module 704, and use the third training data as the first training data, and then trigger the data judgment module 702 to execute the judgment whether the first training data is balanced.

[0212] In the embodiment of the present invention, the instruction receiving module 704 may be used to execute step 501 in the above method embodiment, and the data reselection module 707 may be used to execute steps 502 and 503 in the above method embodiment.

[0213] like Fig.11 As shown, one embodiment of the present invention provides a classification model training device, comprising:

[0214] At least one memory 1101, configured to store executable instructions;

[0215] At least one processor 1102 is coupled to the at least one memory 1101, and when executing the executable instructions, is configured to:

[0216] Acquire first training data, wherein the first training data includes historical operation data of the target device;

[0217] Determining whether the first training data is balanced;

[0218] If the first training data is unbalanced, sending an interaction request to the user, wherein the interaction request is used to request the user to determine a method for processing the first training data;

[0219] receiving an equalization processing instruction from a user in response to the interaction request, wherein the equalization processing instruction includes at least one data set identifier, each of the at least one data set identifier is used to identify a first data set in the first training data that causes the first training data to be unbalanced, and different data set identifiers identify different first data sets;

[0220] According to the equalization processing instruction, the first training data is equalized for each of the first data sets identified by the data set identifiers to obtain second training data, wherein each second data set corresponding to each of the data set identifiers in the second training data does not cause the second training data to be unbalanced;

[0221] The second training data is used to train a classification model corresponding to the target device.

[0222] Optionally, in Fig.11 Based on the classification model training device shown, the at least one processor 1102 is further configured to:

[0223] Performing clustering processing on the first training data to obtain at least one third data set, wherein each of the third data sets includes at least one sample, the values ​​of the samples in the same third data set are within the same value range, and the values ​​of the samples in different third data sets are within different value ranges;

[0224] If the first training data is clustered to obtain the third data set, determining that the first training data is balanced;

[0225] If the first training data is clustered to obtain at least two third data sets, then

[0226] determining a fourth data set including the least number of samples and a fifth data set including the greatest number of samples from the at least two third data sets, and

[0227] If the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is less than a preset ratio threshold, it is determined that the first training data is unbalanced, and

[0228] If the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced.

[0229] Optionally, in Fig.11 Based on the classification model training device shown, the at least one processor 1102 is further configured to:

[0230] For each of the data set identifiers included in the equalization processing instruction, determine a sixth data set corresponding to the data set identifier, wherein the values ​​of samples in the sixth data set and the samples in the first data set identified by the data set identifier are in the same value range, and the ratio of the total number of samples in the first data set identified by the data set identifier and the sixth data set to the number of samples in the fifth data set is greater than or equal to the proportion threshold;

[0231] The samples in each of the sixth data sets corresponding to each of the data set identifiers are combined with the first training data to obtain the second training data.

[0232] Optionally, in Fig.11Based on the classification model training device shown, the at least one processor 1102 is further configured to:

[0233] Collect at least one sample from the first data set identified by the data set identifier;

[0234] A sample set including the at least one collected sample is used as the sixth data set corresponding to the data set identifier.

[0235] Optionally, in Fig.11 Based on the classification model training device shown, the at least one processor 1102 is further configured to:

[0236] receiving a data reselection instruction from the user in response to the interaction request, wherein the data reselection instruction includes a data reading address;

[0237] reading third training data from a storage space corresponding to the data read address according to the data reselection instruction;

[0238] The third training data is used as the first training data, and the step of determining whether the first training data is balanced is performed.

[0239] The present invention also provides a computer-readable medium storing instructions for causing a computer to execute the classification model training method as described herein. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code for implementing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.

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

[0241] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0242] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0243] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

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

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

[0246] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims

1. A classification model training method, characterized in that: include: Acquire first training data, wherein the first training data includes historical operation data of the target device; Determining whether the first training data is balanced; If the first training data is unbalanced, sending an interaction request to the user, wherein the interaction request is used to request the user to determine a method for processing the first training data; receiving an equalization processing instruction from a user in response to the interaction request, wherein the equalization processing instruction includes at least one data set identifier, each of the at least one data set identifier is used to identify a first data set in the first training data that causes the first training data to be unbalanced, and different data set identifiers identify different first data sets; According to the equalization processing instruction, the first training data is equalized for each of the first data sets identified by the data set identifiers to obtain second training data, wherein each second data set corresponding to each of the data set identifiers in the second training data does not cause the second training data to be unbalanced; Using the second training data to train a classification model corresponding to the target device; The step of performing equalization processing on the first training data for each of the first data sets identified by the data set identifiers according to the equalization processing instruction to obtain second training data includes: For each of the data set identifiers included in the equalization processing instruction, a sixth data set corresponding to the data set identifier is determined, wherein the values ​​of the samples in the sixth data set and the samples in the first data set identified by the data set identifier are in the same value range, and the ratio of the total number of samples in the first data set identified by the data set identifier and the sixth data set to the number of samples in the fifth data set is greater than or equal to the proportion threshold; wherein the fifth data set is the data set including the largest number of samples obtained by clustering the first training data; The samples in each of the sixth data sets corresponding to each of the data set identifiers are combined with the first training data to obtain the second training data.

2. The method according to claim 1, characterized in that The determining whether the first training data is balanced includes: Performing clustering processing on the first training data to obtain at least one third data set, wherein each of the third data sets includes at least one sample, the values ​​of the samples in the same third data set are within the same value range, and the values ​​of the samples in different third data sets are within different value ranges; If the first training data is clustered to obtain the third data set, determining that the first training data is balanced; If the first training data is clustered to obtain at least two third data sets, then determining, from the at least two third data sets, a fourth data set including the least number of samples and a fifth data set including the greatest number of samples, and If the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is less than a preset ratio threshold, it is determined that the first training data is unbalanced, and If the ratio of the number of samples in the fourth data set to the number of samples in the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced.

3. The method according to claim 1, characterized in that The determining a sixth data set corresponding to the data set identifier includes: Collect at least one sample from the first data set identified by the data set identifier; A sample set including the at least one collected sample is used as the sixth data set corresponding to the data set identifier.

4. The method according to any one of claims 1 to 3, characterized in that: After sending the interaction request to the user, the method further includes: receiving a data reselection instruction from the user in response to the interaction request, wherein the data reselection instruction includes a data reading address; reading third training data from a storage space corresponding to the data read address according to the data reselection instruction; The third training data is used as the first training data, and the step of determining whether the first training data is balanced is performed.

5. A classification model training device, characterized in that: include: A data acquisition module (701) is used to acquire first training data, wherein the first training data includes historical operation data of the target device; a data judgment module (702), used to judge whether the first training data acquired by the data acquisition module (701) is balanced; a request sending module (703), configured to send an interaction request to a user according to a judgment result of the data judgment module (702), if the first training data is unbalanced, wherein the interaction request is used to request the user to determine a method for processing the first training data; an instruction receiving module (704), configured to receive an equalization processing instruction from a user in response to the interaction request sent by the request sending module (703), wherein the equalization processing instruction comprises at least one data set identifier, each of the at least one data set identifier is used to identify a first data set in the first training data that causes the first training data to be unbalanced, and different data set identifiers identify different first data sets; a data processing module (705), configured to perform equalization processing on the first training data for each of the first data sets identified by the data set identifiers according to the equalization processing instruction received by the instruction receiving module (704), so as to obtain second training data, wherein each second data set corresponding to each of the data set identifiers in the second training data will not cause the second training data to be unbalanced; a model training module (706), configured to train a classification model corresponding to the target device using the second training data acquired by the data processing module (705); The data processing module (705) comprises: A data acquisition unit (7051) is used to determine a sixth data set corresponding to each data set identifier included in the equalization processing instruction, wherein the values ​​of samples in the sixth data set and the samples in the first data set identified by the data set identifier are in the same value range, and the ratio of the total number of samples in the first data set identified by the data set identifier and the sixth data set to the number of samples in the fifth data set is greater than or equal to the proportion threshold; wherein the fifth data set is the data set obtained by clustering the first training data and includes the largest number of samples; A data combining unit (7052) is used to combine the samples in each of the sixth data sets determined by the data acquisition unit (7051) with the first training data to obtain the second training data.

6. The device according to claim 5, characterized in that The data judgment module (702) includes: a cluster processing unit (7021), configured to perform cluster processing on the first training data to obtain at least one third data set, wherein each of the third data sets includes at least one sample, the values ​​of the samples in the same third data set are within the same value range, and the values ​​of the samples in different third data sets are within different value ranges; a first judgment unit (7022), configured to determine whether the first training data is balanced when the cluster processing unit (7021) performs cluster processing on the first training data to obtain the third data set; A second judgment unit (7023) is used to determine, when the cluster processing unit (7021) performs cluster processing on the first training data to obtain at least two third data sets, a fourth data set including the least number of samples and a fifth data set including the largest number of samples from the at least two third data sets; if the ratio of the number of samples in the fourth data set to that in the fifth data set is less than a preset proportion threshold, it is determined that the first training data is unbalanced; if the ratio of the number of samples in the fourth data set to that in the fifth data set is greater than or equal to the proportion threshold, it is determined that the first training data is balanced.

7. The device according to claim 5, characterized in that The data collection unit (7051) is used to collect at least one sample from the first data set identified by each data set identifier included in the equalization processing instruction, and use the sample set including the at least one collected sample as the sixth data set corresponding to the data set identifier.

8. The device according to any one of claims 5 to 7, characterized in that Further including: a data reselection module (707); The instruction receiving module (704) is further used to receive a data reselection instruction from the user in response to the interaction request sent by the request sending module (703), wherein the data reselection instruction includes a data reading address; The data reselection module (707) is used to read the third training data from the storage space corresponding to the data reading address according to the data reselection instruction received by the instruction receiving module (704), and use the third training data as the first training data, and then trigger the data judgment module (702) to execute the judgment whether the first training data is balanced.

9. A classification model training device, characterized in that: include: At least one memory (1101) and at least one processor (1102); The at least one memory (1101) is used to store a machine-readable program; The at least one processor (1102) is configured to call the machine-readable program to execute the method according to any one of claims 1 to 4.

10. A computer readable medium, characterized in that The computer readable medium stores computer instructions, which, when executed by a processor, cause the processor to perform any one of the methods of claims 1 to 4.

Citation Information

Patent Citations

  • Method and apparatus for model training

    CN109145937A

  • System and method for classification with effective use of manual data input

    US20140314311A1