Model training method and device, electronic device, and computer-readable storage medium
By retraining the basic classification model and generating the final classification model using the label samples from the first region, the model adaptability problem is solved, and efficient model training and accuracy improvement are achieved in different regions.
Patent Information
- Application Number
- CN202011259760.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-11
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2040-11-11
AI Technical Summary
In the field of communications, existing model training techniques are difficult to adapt to changes in factors such as geographical location, user habits, networking methods and equipment structure. This leads to the problem that a model may be applicable in one place but not in another. In addition, it is difficult to obtain labeled samples and retrain the model.
By obtaining the first label sample of the first region and its category, the basic classification model is retrained to generate the final classification model. A small number of label samples are then used to adjust the basic model to adapt to the new region.
This enables model training in different regions without requiring a large number of labeled samples, simplifying the model training process, improving model adaptability and training accuracy, and saving the workload of manual labeling.
Smart Images

Figure CN114501515B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of communication, and in particular to a model training method and device, an electronic device, and a computer readable storage medium. BACKGROUND
[0002] With the rapid development of communication technology, the requirements of users are also constantly improving. As a highly complex and integrated system, if a part of the communication system fails, it will have a serious impact on the normal operation of the entire system. Therefore, for problem cells, how to quickly detect and identify them to ensure the stability of the system is an urgent problem in the industry.
[0003] Current fault detection techniques often analyze through real-time detection of equipment and the experience of experts, which usually requires a large amount of manpower and is extremely demanding on wireless network operation and maintenance. In some related technologies, big data is also used for analysis, combined with an artificial intelligence (AI) method to train a related model. However, in the field of communication, a model is often applicable in a certain place, but when it is switched to another place, due to changes in geographical location, user habits, networking methods, device structure, weather, and many other factors, the model applicable in a certain place cannot be applied in another place. Since it is difficult to obtain labeled samples, it is difficult to collect labeled samples in another place, and therefore it is also difficult to retrain the model. SUMMARY
[0004] Embodiments of the present application provide a model training method and device, an electronic device, and a computer readable storage medium.
[0005] In a first aspect, embodiments of the present application provide a model training method, comprising:
[0006] obtaining a first labeled sample of a first region and a category to which the first labeled sample belongs;
[0007] using the first labeled sample to perform retraining of a base classification model to obtain a final classification model according to the category to which the first labeled sample belongs; wherein the base classification model is a classification model applicable to a second region, and the final classification model is a classification model applicable to the first region.
[0008] In a second aspect, embodiments of the present application provide an electronic device, comprising:
[0009] at least one processor;
[0010] a memory, the memory having at least one program stored thereon, the at least one program, when executed by the at least one processor, implementing any of the model training methods described above.
[0011] In a third aspect, the embodiments of the present application provide a computer readable storage medium, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement any of the model training methods described above.
[0012] The model training method provided by the embodiments of the present application first acquires a first label sample of a first region and a category to which the first label sample belongs, and then performs model retraining on a basic classification model using the first label sample based on the category to which the first label sample belongs to obtain a final classification model. Since the final classification model is obtained by model retraining on the basic classification model, instead of model retraining, it is not necessary to acquire too many label samples of the first region to train the classification model suitable for the first region, that is, a small amount of first label samples is used to perform model retraining on the basic classification model to obtain the final classification model, thereby simply realizing model training of different regions. BRIEF DESCRIPTION OF DRAWINGS
[0013] Figure 1 A flowchart of the model training method provided by an embodiment of the present application is shown in FIG. 1.
[0014] Figure 2 A schematic diagram of the model training method of the embodiments of the present application is shown in FIG. 2.
[0015] Figure 3 A block diagram of the composition of the model training device provided by another embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION
[0016] In order to enable those skilled in the art to better understand the technical solutions of the present application, the model training method and device, the electronic device, and the computer readable storage medium provided by the present application are described in detail below with reference to the accompanying drawings.
[0017] In the following, the example embodiments will be described more fully with reference to the accompanying drawings, in which example embodiments can be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and fully convey the scope of the application to those skilled in the art.
[0018] In the case of no conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0019] As used herein, the term "and / or" includes any and all combinations of at least one of the associated listed items.
[0020] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0021] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present application, and will not be interpreted in an overly literal or overly formal sense unless expressly so defined herein.
[0022] Figure 1 A flowchart of a model training method provided by an embodiment of the present application.
[0023] In a first aspect, referring to Figure 1 An embodiment of the present application provides a model training method, comprising:
[0024] Step 100, obtaining a first label sample of a first region and a class to which the first label sample belongs.
[0025] In some example embodiments, the first region can be any region, which can be pre-set.
[0026] In some example embodiments, any method known to those skilled in the art can be used to obtain the first label sample of the first region and the class to which the first label sample belongs. The specific acquisition method does not limit the protection scope of the embodiments of the present application.
[0027] In some example embodiments, since the class to which the first label sample belongs is usually determined manually, in order to save the workload of manual marking (i.e., marking the class to which the label sample belongs), automation of marking can be realized, specifically: obtaining a second label sample of the first region, selecting part or all of the second label sample as the first label sample according to a third label sample of a second region and a class to which the third label sample belongs, and determining the class to which the first label sample belongs. That is, as shown in Figure 2 Obtaining the first label sample of the first region and the class to which the first label sample belongs includes:
[0028] Obtaining a second label sample of the first region;
[0029] According to the third label sample of the second region and the category to which the third label sample belongs, some or all of the second label samples are selected as first label samples, and the category to which the first label sample belongs is determined.
[0030] In some example embodiments, according to the third label sample of the second region and the category to which the third label sample belongs, some or all of the second label samples are selected as first label samples, and the category to which the first label sample belongs is determined, including:
[0031] K third label samples with the highest similarity to the second label sample are determined; wherein K is an integer greater than or equal to 2.
[0032] In the case that the categories to which N third label samples in the K third label samples belong are the same, and N is greater than or equal to rK, the second label sample is selected as a first label sample, and the category to which the first label sample belongs is determined as the category to which the N third label samples belong; wherein r is an integer greater than or equal to 0 and less than or equal to 1.
[0033] In some example embodiments, in the case that the categories to which N third label samples in the K third label samples belong are the same, and N is less than rK, the method further includes discarding the second label sample.
[0034] In some example embodiments, the similarity between a certain second label sample and a certain third label sample can be represented by the distance between the second label sample and the third label sample. Of course, the similarity between a certain second label sample and a certain third label sample can also be represented by other parameters, and the specific representation parameters do not limit the protection scope of the embodiments of the present application.
[0035] In some example embodiments, the distance between a certain second label sample and a certain third label sample is calculated according to the formula
[0036] wherein Dis is the distance between a certain second label sample and a certain third label sample, p is a constant, n is the dimension of the label sample, x 1j (j=1, 2, 3, …, n) is the kth dimension variable of a certain second label sample, x 2j (j=1, 2, 3, …, n) is the kth dimension variable of a certain third label sample.
[0037] Of course, other ways can also be used to calculate the distance between a certain second label sample and a certain third label sample, and the specific calculation method does not limit the protection scope of the embodiments of the present application.
[0038] In some example embodiments, a minimum number of first label samples required for each category can be preset, and the acquisition of the first label samples of a certain category can be stopped when the number of first label samples of the category reaches the corresponding minimum number.
[0039] It should be noted that the third label samples of the second region can be part or all of the label samples used when the basic classification model is obtained by model training (i.e., the sixth label samples mentioned below), can be part or all of the label samples whose categories are determined according to the basic classification model, or can be label samples including the above two kinds of label samples. The specific label samples used to determine the first label samples and the categories to which the first label samples belong do not limit the protection scope of the embodiments of the present application.
[0040] It should be noted that when determining whether the second label sample is the first label sample, each label sample should be calculated and determined respectively.
[0041] Step 101, according to the category to which the first label sample belongs and the first label sample, the basic classification model is retrained to obtain a final classification model; wherein the basic classification model is a classification model applicable to the second region, and the final classification model is a classification model applicable to the first region.
[0042] In some example embodiments, the second region can be any region, which can be preset.
[0043] It should be noted that the first region and the second region are different regions, and the first region and the second region can be two regions without overlapping regions, or can be two regions with overlapping regions, and the proportion of the overlapping regions is less than or equal to a preset threshold.
[0044] It should be noted that when the first region and the second region are set, the basic classification model applicable to the second region should not be applicable to the first region.
[0045] In some example embodiments, the basic classification model is a classification model obtained by model training according to the sixth label sample and the category to which the sixth label sample belongs.
[0046] In some example embodiments, retraining the basic classification model according to the category to which the first label sample belongs and the first label sample to obtain a final classification model includes at least one of the following:
[0047] In the case that the basic classification model is a serialized model (such as xgboost, AdaBoost, neural network, etc.) generated in series, a new layer is added behind the basic classification model, the structural parameters of the basic classification model are kept unchanged, and the final classification model is obtained by training the new layer according to the category to which the first label sample belongs and the first label sample.
[0048] In the case that the basic classification model is a parallel model (such as random forest, etc.), a new classifier is generated, and the final classification model is obtained by training the new classifier according to the category to which the first label sample belongs and the first label sample.
[0049] In some example embodiments, the specific type of the classifier is not limited, which can be a weak classifier, a strong classifier, or other classifiers, and the specific type does not limit the protection scope of the embodiments of the present application.
[0050] In some example embodiments, since each variable in the label sample has a different unit, in order to prevent different dimensions from causing errors between data magnitudes, each first label sample can be standardized, and then the final classification model is obtained by retraining the basic classification model based on the standardized first label sample and the category to which the first label sample belongs.
[0051] In some example embodiments, in the case that the dimension of the original sample is relatively high and the dimension of the problem space is large, the calculation ability of the model is greatly affected, each first label sample can be processed by dimension reduction, and then the final classification model is obtained by retraining the basic classification model based on the dimension-reduced first label sample and the category to which the first label sample belongs.
[0052] In some example embodiments, the first label sample can also be standardized and processed by dimension reduction at the same time, that is, before the final classification model is obtained by retraining the basic classification model based on the category to which the first label sample belongs and the first label sample, the method further includes:
[0053] The first label sample is standardized to obtain a fourth label sample;
[0054] The fourth label sample is processed by dimension reduction to obtain a fifth label sample;
[0055] The final classification model is obtained by retraining the basic classification model based on the category to which the first label sample belongs and the first label sample, including: the final classification model is obtained by retraining the basic classification model based on the category to which the first label sample belongs and the fifth label sample.
[0056] In some example embodiments, the standardization of the first label samples comprises:
[0057] According to the formula The j-th dimensional variable in the i-th first label sample is standardized;
[0058] wherein, is the j-th dimensional variable in the i-th fourth label sample, xi ij is the j-th dimensional variable in the i-th first label sample, mean1(S) is the average of the j-th dimensional variable in all label samples, and std1(S) is the standard deviation of the j-th dimensional variable in all label samples.
[0059] In some example embodiments, since the number of the first label samples is generally small, it is not meaningful to calculate the average and the standard deviation of the j-th dimensional variable in all first label samples, and the number of the sixth label samples used for training the basic classification model is generally large, therefore, mean1(S) can be the average of the j-th dimensional variable in all sixth label samples, and std1(S) can be the standard deviation of the j-th dimensional variable in all sixth label samples; or, mean1(S) can also be the average of the j-th dimensional variable in all first label samples and all sixth label samples, and std1(S) can also be the standard deviation of the j-th dimensional variable in all first label samples and all sixth label samples.
[0060] In some example embodiments, a dimension reduction processing algorithm well known to those skilled in the art (for example, a principal component analysis (PCA) algorithm, a T-distributed stochastic neighbor embedding (TSNE) algorithm, a locally linear embedding (LLE) algorithm, a multi-dimensional scaling (MDS) algorithm, etc.) can be used for dimension reduction processing, and the specific dimension reduction processing algorithm is not used to limit the protection scope of the embodiments of the present application, which will not be described here.
[0061] The dimension of the label samples after the dimension reduction processing can be pre-set. For example, if PCA is used for dimension reduction processing, 85% of the principal components can be reserved; if TSNE, LLE or MDS is used, the dimension can be reduced to 2 dimensions. The dimension of the label samples after the dimension reduction processing is not used to limit the protection scope of the embodiments of the present application.
[0062] It should be noted that the standardization and dimensionality reduction of the label sample do not change the class to which the label sample belongs, that is, the class to which the first label sample belongs, the class to which the first label sample after standardization (i.e., the fourth label sample) belongs, the class to which the first label sample after dimensionality reduction belongs, and the class to which the fifth label sample belongs are all the same.
[0063] In some example embodiments, the retraining of the base classification model according to the class to which the first label sample belongs and the fifth label sample obtains a final classification model, including at least one of the following:
[0064] In the case where the base classification model is a serial generated serialized model (such as xgboost, AdaBoost, neural network, etc.), a new layer is added behind the base classification model, the structure parameters of the base classification model are kept unchanged, and the new layer is trained according to the class to which the first label sample belongs and the fifth label sample to obtain the final classification model.
[0065] In the case where the base classification model is a parallel model (such as random forest, etc.), the structure parameters of the classifier in the base classification model are kept unchanged, a new classifier is generated, and the new classifier is trained according to the class to which the first label sample belongs and the fifth label sample to obtain the final classification model.
[0066] In some example embodiments, as shown in FIG. 1, before the first label sample of the first region and the class to which the first label sample belongs are obtained, the method further includes: Figure 2
[0067] According to the class to which the sixth label sample of the second region belongs and the sixth label sample, the base classification model is trained.
[0068] In some example embodiments, the classification model can be a classification model familiar to those skilled in the art, for example, random forest, gradient boosting decision tree (GBDT, Gradient Boosting Decision Tree), xgboost (ExtremeGBoosted), neural network, etc.
[0069] In some example embodiments, the model training method well known to those skilled in the art can be used to train the base classification model. For example, according to stratified sampling, all sixth label samples are divided into a training set and a test set according to a pre-set proportion (for example, training set: test set = 0.75:0.25), and the L-fold cross-validation method is used to ensure the accuracy of the model, that is, the training set is divided into L parts again, of which (L-1) parts are used for model training and the other 1 part is used for model verification; L cycles can obtain L first classification models; the first classification model with the highest precision is selected from the L first classification models as the base classification model; and the base classification model is applied to the test set to obtain the category to which each sixth label sample in the test set belongs.
[0070] It should be noted that (L-1) parts of the label data are used for model training to obtain one classification model in each cycle, and the one part of the label sample used for model verification in L cycles is different.
[0071] For example, assuming that there are 1000 sixth label samples, the 1000 label samples are divided into a training set and a test set according to a proportion of 0.75:0.25, the training set includes 750 sixth label samples, and the test set includes 250 sixth label samples; then the 750 sixth label samples are divided into K=10 parts, each part including 75 sixth label samples, so that in the first cycle, the first-ninth parts of the sixth label samples can be used for model training, and the tenth part of the sixth label samples can be used for model verification; in the second cycle, the first-eighth and tenth parts of the sixth label samples can be used for model training, and the ninth part of the sixth label samples can be used for model verification; in the third cycle, the first-seventh and ninth-tenth parts of the sixth label samples can be used for model training, and the eighth part of the sixth label samples can be used for model verification; in the fourth cycle, the first-sixth and eighth-tenth parts of the sixth label samples can be used for model training, and the seventh part of the sixth label samples can be used for model verification; in the fifth cycle, the first-fifth and seventh-tenth parts of the sixth label samples can be used for model training, and the sixth part of the sixth label samples can be used for model verification; in the sixth cycle, the first-fourth and sixth-tenth parts of the sixth label samples can be used for model training, and the fifth part of the sixth label samples can be used for model verification; in the seventh cycle, the first-third and fifth-tenth parts of the sixth label samples can be used for model training, and the fourth part of the sixth label samples can be used for model verification; in the eighth cycle, the first-second and fourth-tenth parts of the sixth label samples can be used for model training, and the third part of the sixth label samples can be used for model verification; in the ninth cycle, the first and third-tenth parts of the sixth label samples can be used for model training, and the second part of the sixth label samples can be used for model verification; in the tenth cycle, the second-tenth parts of the sixth label samples can be used for model training, and the first part of the sixth label samples can be used for model verification; in this way, 10 classification models are obtained by cycling 10 times.
[0072] In some example embodiments, for each first classification model, the first classification model is applied to the corresponding one of the sixth label samples for model verification to obtain a class to which each sixth label sample belongs, and then the accuracy of the first classification model is determined according to the obtained class to which each sixth label sample belongs and the real class.
[0073] In some example embodiments, the score of the first classification model can be used to represent the accuracy of the first classification model. For example, in the case of the classification model being a random forest, a confusion matrix can be used to represent the good or bad of the first classification model, as shown in Table 1.
[0074] Table 1
[0075]
[0076] It should be noted that in the calculation of the score of the first classification model, the real value refers to the real class to which the sixth label sample is obtained by other means, and the predicted value refers to the class to which each sixth label sample belongs obtained by applying the first classification model to the corresponding sixth label sample for verification.
[0077] Then, the score of the first classification model is the average of the scores of all classes.
[0078] The score of the a-th class of the first classification model is calculated;
[0079] Wherein, N bb N is the number of sixth label samples in the sixth label samples for verification, the real value of which is b and the predicted value of which is b, N cb N is the number of sixth label samples in the sixth label samples for verification, the real value of which is c and the predicted value of which is b, N bc N is the number of sixth label samples in the sixth label samples for verification, the real value of which is b and the predicted value of which is c, and (m-1) is the number of classes.
[0080] In some example embodiments, in order to improve the accuracy of the basic classification model, the input parameters of the classification model can be adjusted by using a grid method, that is, the input parameters of the classification model are set to enumerated values, and for each value, a second classification model is obtained by using a model training method, and the second classification model with the highest accuracy is selected from all second classification models as the basic classification model.
[0081] In some example embodiments, the second classification model can be obtained by using a model training method well known to those skilled in the art. For example, for each input parameter, all sixth label samples are divided into a training set and a test set according to stratified sampling in a preset proportion (for example, training set: test set = 0.75:0.25), and a L-fold cross-validation method is used to ensure the accuracy of the model, that is, the training set is divided into L parts again, of which (L-1) parts are used for model training and the other 1 part is used for model verification; L first classification models can be obtained by repeating the above process L times; the first classification model with the highest accuracy is selected from the L first classification models as the second classification model; and the second classification model with the highest accuracy is selected from all second classification models as the basic classification model.
[0082] It should be noted that (L-1) parts of the label data are used for model training to obtain one classification model in each cycle, and the one part of the label samples used for model verification corresponding to L cycles are all different.
[0083] In some example embodiments, for each second classification model, the second classification model is applied to the corresponding test set to obtain the category to which each sixth label sample belongs, and then the accuracy of the second classification model is determined according to the category to which each sixth label sample belongs and the true category.
[0084] In some example embodiments, the score of the second classification model can be used to represent the accuracy of the second classification model. For example, in the case of a random forest classification model, a confusion matrix can be used to represent the good or bad of the second classification model, as shown in Table 1.
[0085] It should be noted that when calculating the score of the second classification model, the true value refers to the true category of the sixth label sample obtained by other means, and the predicted value refers to the category of each sixth label sample obtained by applying the first classification model to the corresponding sixth label sample for verification.
[0086] Therefore, the score of the second classification model is the average value of the scores of all categories.
[0087] The score of the a-th category of the first classification model is calculated.
[0088] Wherein, N bb is the number of sixth label samples in the test set whose true value is b and predicted value is b, N cb is the number of sixth label samples in the test set whose true value is c and predicted value is b, N bcFor testing the number of sixth label samples in the test set, the true value of which is b, and the predicted value of which is c, (m-1) is the number of categories.
[0089] In some example embodiments, since each variable in the label sample has different units, in order to prevent different dimensions from causing errors between the magnitudes of the data, each sixth label sample can be standardized respectively, and then a basic classification model is trained based on the standardized sixth label sample and the category to which the sixth label sample belongs.
[0090] In some example embodiments, in the case of high dimension of the original sample and large dimension of the problem space, the computing power of the model is greatly affected, and each sixth label sample can be processed for dimension reduction, and then a basic classification model is trained based on the dimension-reduced sixth label sample and the category to which the sixth label sample belongs.
[0091] In some example embodiments, the sixth label sample can also be standardized and processed for dimension reduction at the same time, that is, before the basic classification model is trained based on the category to which the sixth label sample belongs in the second region and the sixth label sample, the method further includes:
[0092] standardizing the sixth label sample to obtain a seventh label sample;
[0093] processing the seventh label sample for dimension reduction to obtain an eighth label sample;
[0094] Training the basic classification model based on the category to which the sixth label sample belongs in the second region and the sixth label sample includes training the basic classification model based on the category to which the sixth label sample belongs and the eighth label sample.
[0095] In some example embodiments, the standardization of the sixth label sample includes:
[0096] According to the formula standardizing the jth variable in the ith sixth label sample;
[0097] wherein, is the jth variable in the ith seventh label sample, x2 ij is the jth variable in the ith sixth label sample, mean2(S) is the average of the jth variable in all sixth label samples, and std2(S) is the standard deviation of the jth variable in all sixth label samples.
[0098] In some example embodiments, a dimension reduction processing algorithm well known to those skilled in the art (for example, a PCA algorithm, a TSNE algorithm, a LLE algorithm, a MDS algorithm, etc.) can be employed to perform the dimension reduction processing, and the specific dimension reduction processing algorithm is not used to limit the protection scope of the embodiments of the present application, and will not be described here.
[0099] The dimension of the label sample after the dimension reduction processing can be pre-set. For example, if PCA is employed for the dimension reduction processing, 85% of the principal components can be reserved; if TSNE, LLE, or MDS is employed, the dimension can be reduced to 2 dimensions. The dimension of the label sample after the dimension reduction processing is not used to limit the protection scope of the embodiments of the present application.
[0100] It should be noted that the standardization processing and the dimension reduction processing of the label sample do not change the class to which the label sample belongs, that is, the class to which the sixth label sample belongs, the class to which the sixth label sample after the standardization processing (i.e., the seventh label sample) belongs, the class to which the sixth label sample after the dimension reduction processing belongs, and the class to which the eighth label sample belongs are all the same.
[0101] The model training method provided by the embodiments of the present application first acquires a first label sample of a first region and a class to which the first label sample belongs, and then performs model retraining of a basic classification model using the first label sample based on the class to which the first label sample belongs to obtain a final classification model. Since the final classification model is obtained by performing model retraining of the basic classification model, rather than by performing model retraining, it is not necessary to acquire too many label samples of the first region to train the classification model applicable to the first region, that is, a small amount of first label samples can be used to perform model retraining of the basic classification model to obtain the final classification model, thereby simply realizing model training of different regions.
[0102] In some example embodiments, the class to which the first label sample belongs is automatically labeled based on the third label sample of the second region, thereby saving a large amount of manual labeling work and improving the accuracy of model training.
[0103] The following will describe the specific implementation process of the model training method of the above embodiments by two examples. It should be noted that the examples listed are only for convenience of description, and cannot be considered as the only implementation manner of the model training method of the embodiments of the present application, and are not used to limit the protection scope of the embodiments of the present application.
[0104] Example 1
[0105] This example describes a training method of a fault classification model applied to a sleep cell. As shown in Table 2, the faults of the sleep cell are mainly divided into 5 types, plus a normal cell, a total of 6 classes.
[0106] Table 2 Fault category table of sleep cell
[0107]
[0108]
[0109] As shown in the following, Figure 2 the model training method comprises:
[0110] 1. Obtain a sixth label sample of the second area.
[0111] In this example, in the time dimension, data of the current time and 4 historical same period times are obtained, for example, the current time is Monday 18:00, data of Monday 18:00, last Monday 18:00, the week before last Monday 18:00, the week before last week Monday 18:00, and the week before last week Monday 18:00, a total of 5 times, and each time index variable includes 15 index variables in Table 3, therefore, the dimension variable of one sixth label sample is 15*5=75 dimension variables.
[0112] Table 3
[0113]
[0114] 2. Standardize each dimension variable of each sixth label sample to obtain a seventh label sample.
[0115] According to the formula , the jth dimension variable in the ith sixth label sample is standardized;
[0116] wherein, is the jth dimension variable in the ith seventh label sample, x2 ij is the jth dimension variable in the ith sixth label sample, mean2(S) is the average value of the jth dimension variable in all sixth label samples, and std2(S) is the standard deviation of the jth dimension variable in all sixth label samples.
[0117] 3. Reduce each seventh label sample to obtain an eighth label sample.
[0118] The example adopts PCA for dimension reduction processing. The main idea of PCA is to map n-dimensional variables to d-dimensional variables. The d-dimensional variables are new orthogonal characteristics, also known as principal components, which are d-dimensional variables reconstructed on the basis of the original n-dimensional variables. The work of PCA is to sequentially find a set of mutually orthogonal coordinate axes in the original n-dimensional space. The selection of the new coordinate axes is closely related to the seventh label sample. The first new coordinate axis is selected as the direction with the maximum variance of the seventh label sample. The second new coordinate axis is selected as the direction with the maximum variance of the seventh label sample in the plane orthogonal to the first new coordinate axis. The third new coordinate axis is the direction with the maximum variance of the seventh label sample in the plane orthogonal to the first and second new coordinate axes. In this way, d new coordinate axes can be obtained. Then, each seventh label sample is converted and mapped to the new coordinate axes.
[0119] The principal component analysis is used to ensure that the complexity of the model training method is reduced without reducing the accuracy of the model training method, and 85% of the contribution rate is retained.
[0120] 4. According to the category to which the sixth label sample belongs and the eighth label sample, a basic classification model suitable for the second region is obtained by model training.
[0121] The example adopts a random forest model as a classification model, and the random forest model is trained by using a cross-validation method.
[0122] According to stratified sampling, the eighth label sample is divided into a training set: test set = 0.75:0.25. At the same time, L-layer cross-validation is used to ensure the accuracy of the model. Let L = 10, that is, all the eighth label samples in the training set are divided into 10 parts, 9 parts are selected for model training, and the remaining 1 part is used for model verification to obtain a first classification model. The cycle is repeated 10 times to obtain 10 first classification models. The first classification model with the highest accuracy is selected as the second classification model. The second classification model is applied to the eighth label sample for verification to obtain the category to which all the eighth label samples in the test set belong.
[0123] The score of the first classification model can be used to represent the accuracy of the first classification model.
[0124] The score of the first classification model is the average of the scores of all categories.
[0125] The score of the a-th category of the first classification model is calculated.
[0126] wherein, N bb N cbN represents the number of sixth-label samples used for validation where the true value is c and the predicted value is b. bc Let (m-1) be the number of sixth-label samples used for validation where the true value is b and the predicted value is c, and (m-1) be the number of categories.
[0127] To improve the model's accuracy, this example uses a grid method to adjust the model's input parameters. The adjusted input parameters for the random forest include the number of base classifiers n_estimators, the maximum depth of the base classifiers max_depth, the maximum number of features selected by the base classifiers max_features, and the evaluation criterion function, for a total of four parameters.
[0128] Set an enumeration variable for each input parameter:
[0129] n_estimators=[50,100,150,200]
[0130] max_depth = [6, 8, 10, 12]
[0131] max_features=[sqrt,0.7,0.9,1]
[0132] Criterion = [gini, entropy]
[0133] Therefore, a total of 4*4*4*2=128 iterations are required, resulting in 128 secondary classification models. The secondary classification model with the highest accuracy is then selected as the base classification model from these 128 models.
[0134] The accuracy of the second classification model can be represented by the score of the second classification model.
[0135] The score for the second classification model is the average of the scores for all categories.
[0136] Calculate the score for the a-th category in the first classification model;
[0137] in, N bb N represents the number of sixth-label samples in the test set with a true value of b and a predicted value of b. cb N represents the number of sixth-label samples in the test set with a true value of c and a predicted value of b. bc Let (m-1) be the number of sixth-label samples in the test set with a true value of b and a predicted value of c, where (m-1) is the number of categories.
[0138] 5. Obtain a second label sample of the first region.
[0139] The second label sample is collected in the first region as shown in Table 3.
[0140] 6. Select part or all of the second label sample as the first label sample according to the sixth label sample and the category to which the sixth label sample belongs, and determine the category to which the first label sample belongs.
[0141] In this example, for each second label sample, in the sixth label sample, find the K=20 sixth label samples closest to the second label sample, and if there are more than or equal to 0.8*20=16 sixth label samples belonging to the same category, select the second label sample as the first label sample, and the category to which the first label sample belongs is the category to which the 16 sixth label samples belong.
[0142] If the number of sixth label samples belonging to the same category is less than 16, discard the second label sample.
[0143] This cycle continues until the number of first label samples of each category is greater than or equal to the minimum number of label samples corresponding to the category set by the user, and Table 4 shows the minimum number of label samples corresponding to different categories.
[0144] Table 4
[0145] Category Code Category Name Minimum number of tag samples required in other areas 0 Normal cell 100 1 No user access sleep cell 200 2 Random access sleep cell 200 3 RRC access or hand-in request sleep cell 200 4 RRC no ERAB sleep cell 100 5 PDCP traffic anomaly sleep cell 200
[0146] 7. Standardize each dimension variable of each first label sample to obtain a fourth label sample.
[0147] According to the formula Standardize the jth dimension variable in the ith first label sample;
[0148] wherein, is the jth dimension variable in the ith fourth label sample, xi ij is the jth dimension variable in the ith first label sample, mean1(S) is the average value of the jth dimension variable in all label samples, and std1(S) is the standard deviation of the jth dimension variable in all label samples.
[0149] 8. Reduce the dimension of each fourth label sample to obtain a fifth label sample.
[0150] The example adopts PCA for dimensionality reduction. The main idea of PCA is to map n-dimensional variables to d-dimensional variables. The d-dimensional variables are new orthogonal features, also known as principal components, which are reconstructed from the original n-dimensional variables. The work of PCA is to sequentially find a set of mutually orthogonal coordinate axes in the original n-dimensional space. The selection of the new coordinate axes is closely related to the fourth label samples. The first new coordinate axis is selected as the direction with the maximum variance of the fourth label samples. The second new coordinate axis is selected as the direction with the maximum variance of the fourth label samples in the plane orthogonal to the first new coordinate axis. The third new coordinate axis is the direction with the maximum variance of the fourth label samples in the plane orthogonal to the first and second new coordinate axes. In this way, d new coordinate axes can be obtained. Then, each fourth label sample is mapped to the new coordinate axes through coordinate axis conversion.
[0151] The principal component analysis is used to reduce the complexity of the model training method without reducing the accuracy of the model training method, and to retain 85% of the contribution rate.
[0152] 9. According to the category to which the first label sample belongs and the fifth label sample, the basic classification model is retrained to obtain a final classification model.
[0153] After migrating the basic random forest model suitable for the second region (i.e., the above-mentioned basic classification model) to the first region, the first region is trained with a small number of fifth label samples to generate a new weak classifier. By default, the number of new weak classifiers is 30% of the number of weak classifiers of the basic classification model. If the number of weak classifiers of the basic classification model is 100, 30 new weak classifiers need to be trained.
[0154] Under the condition that the structure parameters of the original 100 weak classifiers of the basic classification model remain unchanged, 30 new weak classifiers are generated, and a random forest model with 130 weak classifiers is finally obtained. The model is applied to the first region for diagnosis.
[0155] 30 new weak classifiers are trained using the model input parameters (such as max_depth=6, max_features=0.7, and Criterion=gini) corresponding to the basic classification model.
[0156] For each new weak classifier, first, 15*0.7≈10 features are randomly selected from all features (as shown in Table 3) of the new weak classifier as the features of the new weak classifier.
[0157] First, the split feature and split value of the first node need to be determined.
[0158] The purity of the sample set D including the fifth label samples can be measured by the following formula:
[0159] Gini(D) is the probability that two fifth label samples randomly drawn from sample set D belong to different classes, the smaller Gini(D) is, the higher the purity of sample set D is, p k is the proportion of the number of fifth label samples of the kth class, y is the total number of classes.
[0160] Suppose the feature e is a continuous attribute, the value of e is divided according to a certain interval, and suppose the division points are {e 1 ,e 2 ,...,e V}, if e is used to divide sample set D, V branches will be generated, wherein the vth branch node contains all fifth label samples in sample set D that are greater than e v-1 and less than e v , denoted as D v .
[0161] Among the 10 features of the new weak classifier, for each feature e, the Gini coefficient of feature e is calculated:
[0162]
[0163] wherein Gini_index(D, e) is the Gini coefficient.
[0164] Among the 10 features, the feature with the smallest Gini_index(D, e) is selected as the feature of the classification node of the first node of the new weak classifier.
[0165] Then traverse all the division points {e 1 ,e 2 ,...,e V}, divide sample set D into D1 and D2 according to the division points. Calculate the following formula: Gini(D, e v ) = Gini(D1) + Gini(D2);
[0166] Calculate Gini(D, e v ) of each division point, and select the smallest division point as the best split value of the first node, thereby obtaining the optimal split attribute and the optimal split value of the first node of the new weak classifier.
[0167] Such a cycle is repeated to calculate the optimal split attribute and the optimal split value for the left and right child nodes of each node, and the depth of the new weak classifier does not exceed max_depth = 6.
[0168] Thus, a new weak classifier can be trained, and all new weak classifiers can be learned according to the above method.
[0169] Example 2
[0170] This example describes a training method of a fault classification model applied to an interference cell. As shown in Table 5, the faults of the interference cell are mainly divided into 5 categories, plus a normal cell, a total of 6 categories.
[0171] Table 5
[0172]
[0173]
[0174] The model training method includes:
[0175] 1. Obtain a sixth label sample of the second area.
[0176] In this example, each time point corresponds to a sixth label sample in the time dimension. In the spatial dimension, a sixth label sample includes 71 variables shown in Table 6.
[0177] Table 6
[0178]
[0179]
[0180] 2. Standardize each dimension variable of each sixth label sample to obtain a seventh label sample.
[0181] According to the formula The jth dimension variable in the ith sixth label sample is standardized;
[0182] wherein, is the jth dimension variable in the ith seventh label sample, x2 ij is the jth dimension variable in the ith sixth label sample, mean2(S) is the average of the jth dimension variable in all sixth label samples, and std2(S) is the standard deviation of the jth dimension variable in all sixth label samples.
[0183] 3. Dimension reduction is performed on each seventh label sample to obtain an eighth label sample.
[0184] The TSNE algorithm is used for dimension reduction in this example. The TSNE algorithm models the distribution of the neighbors of each seventh label sample, where the neighbors refer to a set of label samples that are close to the seventh label sample. In the high-dimensional space of the seventh label sample, the high-dimensional space is modeled as a Gaussian distribution, while in the low-dimensional output space (i.e., the eighth label sample), it can be modeled as a t-distribution. The goal of this process is to find a transformation that maps the high-dimensional space to the low-dimensional space and minimizes the difference between all label samples in these two distributions.
[0185] The TSNE algorithm can be set to reduce the dimension to several dimensions. In this example, the dimension is reduced from 71 to 5.
[0186] 4. The base classification model suitable for the second region is obtained by training the model according to the category to which the sixth label sample belongs and the eighth label sample.
[0187] In this example, GBDT is used as the classification model, and cross-validation is used to train the GBDT.
[0188] According to stratified sampling, the eighth label sample is divided into a training set: test set = 0.75:0.25. At the same time, L-layer cross-validation is used to ensure the accuracy of the model. Let L = 10, that is, all eighth label samples in the training set are divided into 10 parts, 9 parts are selected for model training, and the remaining 1 part is used for model validation to obtain a first classification model. The cycle is repeated 10 times to obtain 10 first classification models. The first classification model with the highest accuracy is selected as the second classification model. The second classification model is applied to the eighth label sample used for validation to obtain the category to which all eighth label samples in the test set belong.
[0189] The score of the first classification model can be used to represent the accuracy of the first classification model.
[0190] The score of the first classification model is the average of the scores of all categories.
[0191] The score of the a-th category of the first classification model is calculated.
[0192] wherein, N bb N is the number of sixth label samples in the validation set whose true value is b and predicted value is b, N cb N is the number of sixth label samples in the validation set whose true value is c and predicted value is b, N bc N is the number of sixth label samples in the validation set whose true value is b and predicted value is c, and (m-1) is the number of categories.
[0193] In order to improve the accuracy of the model, the grid method is used to adjust the input parameters of the model in this example, and the input parameters include the number of GBDT base classifiers n_estimators, the maximum depth of the base classifier max_depth, the maximum number of features selected by the base classifier max_features, the learning depth learning_rate, and a total of 4 parameters.
[0194] Set enumeration variables for each parameter:
[0195] n_estimators = [50, 100, 150, 200]
[0196] max_depth = [6, 8, 10, 12]
[0197] max_features = [sqrt, 0.7, 0.9, 1]
[0198] learning_rate = [0.1, 0.2, 0.4, 0.8]
[0199] Therefore, a total of 4*4*4*4 = 256 times of loops are required, and finally 256 second classification models are obtained from 256 times, and the second classification model with the highest accuracy is selected from the 256 second classification models as the base classification model.
[0200] The score of the second classification model can be used to represent the accuracy of the second classification model.
[0201] The score of the second classification model is the average of the scores of all classes.
[0202] Calculate the score of the a-th class of the first classification model;
[0203] Wherein, N bb is the number of sixth label samples in the test set, the real value of which is b and the predicted value of which is b, N cb is the number of sixth label samples in the test set, the real value of which is c and the predicted value of which is b, N bc is the number of sixth label samples in the test set, the real value of which is b and the predicted value of which is c, and (m-1) is the number of classes.
[0204] 5. Obtain the second label sample of the first region.
[0205] As shown in Table 6, the second label sample is collected in the first region.
[0206] 6. Selecting part or all of the second label samples as the first label samples according to the sixth label samples and the category to which the sixth label samples belong, and determining the category to which the first label samples belong.
[0207] In this example, for each second label sample, in the sixth label samples, find the K=20 sixth label samples closest to the second label sample, and if there are more than or equal to 0.8*20=16 sixth label samples belonging to the same category, then the second label sample is selected as the first label sample, and the category to which the first label sample belongs is the category to which the 16 sixth label samples belong.
[0208] If the number of sixth label samples belonging to the same category is less than 16, discard the second label sample.
[0209] This cycle continues until the number of first label samples of each category is greater than or equal to the minimum number of label samples corresponding to the category set by the user, as shown in Table 7.
[0210] Table 7
[0211] Category Code Category Name Minimum number of tag samples required in other areas 0 Normal cell 100 1 Weak coverage cell 300 2 Overlapping coverage cell 200 3 Cross-zone coverage cell 200 4 Uplink interference cell 300 5 Downlink interference cell 400
[0212] 7. Standardizing each dimension variable of each first label sample to obtain a fourth label sample.
[0213] According to the formula Standardize the jth dimension variable in the ith first label sample;
[0214] wherein, is the jth dimension variable in the ith fourth label sample, xi ij is the jth dimension variable in the ith first label sample, mean1(S) is the average of the jth dimension variable in all label samples, and std1(S) is the standard deviation of the jth dimension variable in all label samples.
[0215] 8. Dimension reduction processing is performed on each fourth label sample to obtain a fifth label sample.
[0216] In this example, TSNE algorithm is used for dimension reduction processing. The TSNE algorithm models the distribution of the neighbors of each fourth label sample, wherein the neighbors refer to a set of label samples close to the fourth label sample. In the high-dimensional space of the fourth label sample, the high-dimensional space is modeled as a Gaussian distribution, while in the low-dimensional output space (i.e., the fifth label sample), it can be modeled as a t-distribution. The goal of this process is to find a transformation that maps the high-dimensional space to the low-dimensional space and minimizes the difference between all label samples in these two distributions.
[0217] The dimension reduction to several dimensions by the TSNE algorithm can be set by oneself. In this example, 71 dimensions are reduced to 5 dimensions.
[0218] 9. According to the category to which the first label sample belongs and the fifth label sample, the basic classification model is retrained to obtain a final classification model.
[0219] After the basic GBDT model suitable for the second region (i.e., the above-mentioned basic classification model) is migrated to the first region, the new weak classifiers are trained using the small number of fifth label samples of the first region. By default, the number of new weak classifiers is 30% of the number of weak classifiers of the basic classification model. If the number of weak classifiers of the basic classification model is 100, 30 new weak classifiers need to be trained.
[0220] Under the condition that the structure parameters of the original 100 weak classifiers of the basic classification model remain unchanged, 30 new weak classifiers are generated, and a random forest model of 130 weak classifiers is finally obtained. The model is applied to the field of the first region for diagnosis.
[0221] The 30 new weak classifiers are trained using the model input parameters (such as max_depth=6 and max_features=0.5) corresponding to the basic classification model.
[0222] For each new weak classifier, first, 71*0.5≈35 features are randomly selected from all features (as shown in Table 6) of the new weak classifier as the features of the new weak classifier.
[0223] First, the split feature and split value of the first node need to be determined.
[0224] The information gain is calculated according to the following formula:
[0225]
[0226] G represents the first-order derivative of the loss function, H represents the second-order derivative of the loss function, the loss function is defined as: L=1 / 2*(y-y*) 2 , wherein y represents the true value, y* represents the predicted value (the classification result obtained by dividing the sample set D according to each candidate split point), L represents the left tree after the classification node is split, R represents the right tree after the classification node is split, and γ and λ are input parameters, which are set to 0 by default.
[0227] The Gain value is calculated in parallel according to each candidate split point of each feature, and the candidate split point of the candidate feature with the maximum Gain value is selected as the split feature and split value of the first node.
[0228] So the cycle, for each node of the left child node and the right child node to calculate the optimal split feature and the optimal split value, and the depth of the new weak classifier does not exceed max_depth = 6.
[0229] Thus a new weak classifier can be trained, and all new weak classifiers are learned according to the above method.
[0230] In a second aspect, another embodiment of the present application provides an electronic device, comprising:
[0231] At least one processor;
[0232] A memory, the memory storing at least one program, when the at least one program is executed by the at least one processor, realizing any one of the above model training methods.
[0233] The processor is a device with data processing capability, including but not limited to central processing unit (CPU) and the like; the memory is a device with data storage capability, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH).
[0234] In some embodiments, the processor and the memory are connected with each other through a bus, and further connected with other components of the computing device.
[0235] In a third aspect, another embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being executed by a processor to realize any one of the above model training methods.
[0236] Figure 3 The component block diagram of the model training device provided by another embodiment of the present application is shown.
[0237] In a fourth aspect, with reference to Figure 3 another embodiment of the present application provides a model training device, comprising:
[0238] The acquisition module 301 is configured to acquire a first label sample of a first region and a category to which the first label sample belongs.
[0239] The model retraining module 302 is configured to perform model retraining on a basic classification model according to the category to which the first label sample belongs and the first label sample to obtain a final classification model; wherein the basic classification model is a classification model suitable for a second region, and the final classification model is a classification model suitable for the first region.
[0240] In some exemplary embodiments, the acquisition module 301 is specifically configured to:
[0241] obtaining a second label sample of the first region;
[0242] selecting part or all of the second label sample as the first label sample according to the third label sample of the second region and a category to which the third label sample belongs, and determining a category to which the first label sample belongs.
[0243] In some example embodiments, the obtaining module 301 is specifically configured to implement the selecting part or all of the second label sample as the first label sample according to the third label sample of the second region and a category to which the third label sample belongs, and the determining a category to which the first label sample belongs in the following manner:
[0244] determining K third label samples with the highest similarity to the second label sample; wherein K is an integer greater than or equal to 2;
[0245] in a case where N third label samples among the K third label samples belong to the same category and N is greater than or equal to rK, taking the second label sample as the first label sample, and determining the category to which the first label sample belongs as the category to which the N third label samples belong; wherein r is an integer greater than or equal to 0 and less than or equal to 1.
[0246] In some example embodiments, the obtaining module 302 is further configured to:
[0247] in a case where N third label samples among the K third label samples belong to the same category and N is less than rK, discarding the second label sample.
[0248] In some example embodiments, the obtaining module 301 is further configured to:
[0249] performing standardization processing on the first label sample to obtain a fourth label sample;
[0250] performing dimension reduction processing on the fourth label sample to obtain a fifth label sample;
[0251] The model retraining module 302 is specifically configured to perform retraining of the model of the basic classification model according to the category to which the first label sample belongs and the fifth label sample to obtain the final classification model.
[0252] In some example embodiments, the model retraining module 302 is specifically configured to perform at least one of the following:
[0253] in a case where the basic classification model is a serially generated serialized model, adding a new layer behind the basic classification model, keeping the structure parameters of the basic classification model unchanged, and training the new layer according to the category to which the first label sample belongs and the fifth label sample to obtain the final classification model;
[0254] In a case where the base classification model is a parallelization model, the structure parameters of the classifier in the base classification model are kept unchanged, a new classifier is generated, and the new classifier is trained according to the category to which the first label sample belongs and the fifth label sample to obtain the final classification model.
[0255] In some example embodiments, further comprising:
[0256] The model training module 303 is configured to perform model training according to the category to which the sixth label sample belongs and the sixth label sample to obtain the base classification model.
[0257] In some example embodiments, the acquisition module 301 is further configured to:
[0258] The sixth label sample is standardized to obtain a seventh label sample;
[0259] The seventh label sample is processed by dimension reduction to obtain an eighth label sample;
[0260] The model training module 303 is specifically configured to perform model training according to the category to which the sixth label sample belongs and the eighth label sample to obtain the base classification model.
[0261] Those of ordinary skill in the art will realize and understand that all or some of the steps in the methods disclosed above and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component can have multiple functions, or one function or step can be performed by several physical components in cooperation. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on computer-readable media, which can include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, it is common knowledge to those of ordinary skill in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
[0262] Example embodiments have been disclosed herein and, although the use of specific terms is expressly used herein, they are intended in a generic sense only and are not intended to limit the scope of the present application. In some instances, it will be apparent to those of ordinary skill in the art that features, components, and / or elements described with a specific embodiment can be utilized singularly or in combination with other embodiments unless otherwise specifically noted. Therefore, it will be understood that various changes can be made in the form, details, and / or proportions of what is specifically set forth without departing from the scope of the application set forth in the following claims.
Claims
1. A model training method applied in the field of communications, the method comprising: Obtain the first label sample of the first region and the category to which the first label sample belongs; The first tag sample is a sample obtained based on cell data; The category to which the first labeled sample belongs is based on the attribute category of the data annotation of the cell; The basic fault classification model is retrained based on the category of the first labeled sample and the first labeled sample to obtain the final fault classification model; wherein, the basic fault classification model is a classification model applicable to the second region, and the final fault classification model is a fault classification model applicable to the first region; the second region and the first region are geographically different regions, and the final fault classification model is used to classify faults in the first region; Before obtaining the first label sample of the first region and the category to which the first label sample belongs, the method further includes: The basic fault classification model is obtained by training the model based on the category to which the sixth label sample belongs in the second region and the sixth label sample. The sixth label sample is a sample obtained based on the data of the cell. The category to which the sixth label sample belongs is an attribute category labeled based on the data of the cell.
2. The model training method according to claim 1, wherein, The acquisition of the first label sample of the first region and the category to which the first label sample belongs includes: Obtain a second label sample from the first region, wherein the second label sample is a sample obtained based on cell data; Select some or all of the second label samples as the first label samples based on the third label samples of the second region and the category to which the third label samples belong, and determine the category to which the first label samples belong. The third label samples are samples obtained based on cell data, and the category to which the third label samples belong is an attribute category labeled based on the cell data.
3. The model training method according to claim 2, wherein, The step of selecting some or all of the second label samples as the first label samples based on the third label samples in the second region and the category to which the third label samples belong, and determining the category to which the first label samples belong, includes: Identify the K third-label samples that have the highest similarity to the second-label sample; where K is an integer greater than or equal to 2; If N out of K third-label samples belong to the same category, and N is greater than or equal to rK, then the second-label sample is taken as the first-label sample, and the category to which the first-label sample belongs is determined to be the category to which the N third-label samples belong; where r is an integer greater than or equal to 0 and less than or equal to 1.
4. The model training method according to claim 3, wherein, If N out of K third-label samples belong to the same category, and N is less than rK, the method further includes discarding the second-label sample.
5. The model training method according to any one of claims 1-4, wherein, Before retraining the basic fault classification model based on the category and the first label sample to obtain the final fault classification model, the method further includes: The first tag sample is standardized to obtain a fourth tag sample, which is a sample obtained based on cell data. The fourth label sample is subjected to dimensionality reduction processing to obtain the fifth label sample, which is a sample obtained based on cell data; The step of retraining the basic fault classification model based on the category to which the first label sample belongs and the first label sample to obtain the final fault classification model includes: retraining the basic fault classification model based on the category to which the first label sample belongs and the fifth label sample to obtain the final fault classification model.
6. The model training method according to claim 5, wherein, The process of retraining the basic fault classification model based on the category of the first labeled sample and the fifth labeled sample to obtain the final fault classification model includes at least one of the following: In the case where the basic fault classification model is a serialized model generated serially, a new layer is added after the basic fault classification model, while keeping the structural parameters of the basic fault classification model unchanged. The new layer is trained according to the category to which the first label sample belongs and the fifth label sample to obtain the final fault classification model. When the basic fault classification model is a parallel model, the structural parameters of the classifier in the basic fault classification model remain unchanged, a new classifier is generated, and the new classifier is trained according to the category to which the first label sample belongs and the fifth label sample to obtain the final fault classification model.
7. The model training method according to claim 6, wherein, Before training the model to obtain the basic fault classification model based on the category of the sixth label sample in the second region and the sixth label sample, the method further includes: The sixth label sample is standardized to obtain the seventh label sample, which is a sample obtained based on cell data; The seventh-label sample is subjected to dimensionality reduction to obtain the eighth-label sample, which is a sample obtained based on cell data; The step of training the model to obtain the basic fault classification model based on the category to which the sixth label sample belongs in the second region and the sixth label sample includes: training the model to obtain the basic fault classification model based on the category to which the sixth label sample belongs and the eighth label sample.
8. An electronic device, comprising: At least one processor; A memory, wherein at least one program is stored, which, when executed by the at least one processor, implements the model training method according to any one of claims 1-7.
9. A computer-readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implementing the model training method according to any one of claims 1-7.
Citation Information
Patent Citations
A vibration data fault classification method based on depth domain adaptation
CN109766921A
Data classification method and device, terminal equipment and readable storage medium
CN110929785A