CN112633344A - Quality inspection model training method, quality inspection model training device, quality inspection model training equipment and readable storage medium - Google Patents

Quality inspection model training method, quality inspection model training device, quality inspection model training equipment and readable storage medium Download PDF

Info

Publication number
CN112633344A
CN112633344A CN202011488573.5A CN202011488573A CN112633344A CN 112633344 A CN112633344 A CN 112633344A CN 202011488573 A CN202011488573 A CN 202011488573A CN 112633344 A CN112633344 A CN 112633344A
Authority
CN
China
Prior art keywords
sample set
quality inspection
trained
training
inspection model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011488573.5A
Other languages
Chinese (zh)
Other versions
CN112633344B (en
Inventor
罗伟昂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202011488573.5A priority Critical patent/CN112633344B/en
Priority claimed from CN202011488573.5A external-priority patent/CN112633344B/en
Publication of CN112633344A publication Critical patent/CN112633344A/en
Application granted granted Critical
Publication of CN112633344B publication Critical patent/CN112633344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/217Validation; Performance evaluation; Active pattern learning techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to the technical field of artificial intelligence, and discloses a quality inspection model training method based on sample learning, which comprises the following steps: loading a quality inspection model to be trained; acquiring a first sample set with a label and a mixed sample set without the label, and processing the first sample set and the mixed sample set to obtain a feature tag corresponding to the first sample set; labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set; training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged; and if the trained quality inspection model is determined to be converged, storing the trained quality inspection model. The application also provides a device, computer equipment and a storage medium. The robustness of the model is improved.

Description

Quality inspection model training method, quality inspection model training device, quality inspection model training equipment and readable storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for training a quality inspection model based on sample learning, a computer device, and a computer-readable storage medium.
Background
At present, most of quality inspection systems actually use a quality inspection technology based on 'keywords + regular expressions', and the method has the main advantages of relatively fast development and deployment and high accuracy, but also has certain problems, such as serious omission condition, namely low recall rate.
In recent years, with the development of deep learning technology, intelligent quality inspection based on a deep learning model is a new trend, and good effects are often obtained in practice. When obtaining the quality inspection model, the model needs to be trained by using the positive and negative sample with the label to obtain the intelligent quality inspection model which can be used. In practical application, in order to obtain a better intelligent quality inspection model, the training sample set used has more strict requirements, such as sample abundance, sample quantity and the like.
Therefore, a method for training a quality control model based on sample learning, which improves the robustness of the model, is needed.
Disclosure of Invention
The application provides a training method and device of a quality inspection model based on sample learning, a computer device and a storage medium, so as to improve the robustness of the quality inspection model.
In a first aspect, the present application provides a method for training a quality inspection model based on sample learning, where the method includes:
loading a quality inspection model to be trained;
acquiring a first sample set with a label and a mixed sample set without the label, and processing the first sample set and the mixed sample set to obtain a feature tag corresponding to the first sample set;
labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set;
training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged;
and if the trained quality inspection model is determined to be converged, storing the trained quality inspection model.
In a second aspect, the present application further provides a training apparatus for a quality inspection model based on sample learning, the apparatus including:
the model loading module is used for loading a quality inspection model to be trained;
the label determining module is used for acquiring a first sample set with labels and a mixed sample set without labels, and processing the first sample set and the mixed sample set to obtain a feature label corresponding to the first sample set;
the sample generation module is used for labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set;
the model training module is used for training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set and determining whether the trained quality inspection model is converged;
and the data storage module is used for storing the trained quality inspection model if the trained quality inspection model is determined to be converged.
In a third aspect, the present application further provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is configured to execute the computer program and implement the training method of the quality inspection model based on sample learning when executing the computer program.
In a fourth aspect, the present application further provides a computer readable storage medium storing a computer program, which when executed by a processor causes the processor to implement the method for training a quality inspection model based on sample learning as described above.
The application discloses a training method, a device, a computer device and a storage medium of a quality inspection model based on sample learning, when a first sample set with labels and sample categories belonging to the same category is obtained, the first sample set is correspondingly analyzed and processed to obtain characteristic labels corresponding to the first sample set, specifically, the samples contained in the first sample set are subjected to word segmentation to obtain the characteristic labels, then a second sample set corresponding to the category of the first sample set is obtained from a mixed model by using the obtained characteristic labels, so that the quality inspection model to be trained is pre-trained by using the first sample set and the second sample set, an intermediate quality inspection model is obtained when the pre-training is completed, then the second sample set is filtered by using the intermediate quality inspection model, noise samples (the samples of which the category belongs to the first sample set) in the second sample set are deleted, and finally, further training the intermediate quality inspection model by using the first sample set and the third sample set, and realizing continuous optimization of relevant parameters in the model through continuous confrontation and defense training so as to obtain a final quality inspection model. The method has the advantages that when the model is trained, the unlabelled sample can be rapidly labeled by utilizing the characteristic labels, cost improvement caused by labeling of the sample is reduced, and the problem of inaccurate training caused by inaccurate labeling of the model is reduced through pre-training and further training of the model, so that the finally obtained quality inspection model has better quality inspection effect and robustness.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating a method for training a quality inspection model based on sample learning according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps provided in an embodiment of the present application to obtain feature labels for a first sample set;
FIG. 3 is a flowchart illustrating a step of obtaining labeled hybrid samples according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating the steps of training a model to be trained according to an embodiment of the present application;
FIG. 5 is a schematic block diagram of a training apparatus for a quality inspection model based on sample learning according to an embodiment of the present application;
FIG. 6 is a block diagram illustrating a computer device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it should be understood that the described embodiments are some, but not all embodiments of the present application. All other embodiments that can be derived by a person skilled in the art from the embodiments given herein without making any inventive effort fall within the scope of protection of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims is intended to refer to, and includes, any and all possible combinations of one or more of the associated listed items.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a method for training a quality inspection model based on sample learning according to an embodiment of the present disclosure.
As shown in fig. 1, the method for training a quality control model based on sample learning includes steps S101 to S105.
And S101, loading a quality inspection model to be trained.
The quality inspection model to be trained is obtained based on the neural network model and is used for quality inspection of conversations meeting different quality inspection requirements in different scenes, such as customer service conversations, so that defects in the conversations are found and improved. Therefore, when a quality inspection model for quality inspection needs to be obtained, an initial network model which needs to be trained, namely the quality inspection model to be trained, is determined, and then the quality inspection model meeting the actual requirement is obtained through corresponding training.
Step S102, a first sample set with a label and a mixed sample set without the label are obtained, and the first sample set and the mixed sample set are processed to obtain a feature tag corresponding to the first sample set.
Before a quality inspection model to be trained is trained, data input for training needs to be determined, and in practical application, for training data needed by training the model, corresponding labels need to be provided so as to adjust relevant parameters in the model and complete training of the model.
Generally, training data required during model training is huge, so that accuracy of a model after training can be improved to a certain extent, and therefore, the training data to be trained needs to be labeled correspondingly, and if labeling of the training data is achieved manually, a large amount of manual labor is required, so in an embodiment, a PU-learning (positive unlabeled learning) mode is adopted to achieve labeling of unlabeled samples. That is, the first sample set with labels is obtained by PU-learning.
In practical applications, the first sample set is obtained from a plurality of positive samples with labels, where the positive samples and the negative samples are for a currently applied scene, for example, for a face recognition application in a certain environment, face recognition of students in a classroom, a face belongs to a domain of the positive samples, and walls, windows, bodies, clothes, and the like of the classroom belong to a domain of the negative samples.
In practical applications, a first sample set with labels is obtained first, and the samples included in the first sample set are samples of the same type, such as positive example samples or negative example samples, and for better illustration, the first sample set is set as the positive example samples.
When a first sample set with labels is obtained, a large number of unlabelled mixed sample sets are obtained, the first sample set represents positive samples and the mixed sample set is a mixed set of the positive samples and the negative samples, and after the first sample set and the mixed sample set are obtained, the first sample set and the mixed sample set are respectively processed correspondingly to determine the feature labels corresponding to the first sample set according to the obtained processing results.
Further, referring to fig. 2, fig. 2 is a flowchart illustrating a step of obtaining a feature tag of a first sample set according to an embodiment of the present application.
Wherein, step S102 includes:
step S201, performing word segmentation processing on samples contained in the first sample set to obtain a first word segmentation set;
step S202, performing word segmentation processing on the samples contained in the mixed sample set to obtain a second word segmentation set;
step S203, counting the word frequency of each participle in the first participle set, counting the word frequency of each participle in the second participle set, and selecting a plurality of participles in the first participle set as the feature labels corresponding to the first sample set through word frequency comparison.
When the feature label corresponding to the first sample set is determined, the feature label corresponding to the first sample set is obtained by analyzing and processing the first sample set and the mixed sample set and analyzing each sample in the first sample set and the mixed sample set.
Specifically, when the first sample set is obtained, word segmentation processing is performed on each sample in the first sample set, so that after word segmentation processing on all samples is completed, a first word segmentation set corresponding to the first sample set is obtained, and word segmentation processing is performed on each sample in the mixed sample set, so that after word segmentation processing on all samples is completed, a second word segmentation set corresponding to the mixed sample set is obtained. Then, all the participles in the first participle set and the second participle set are counted to finally determine the characteristic label corresponding to the first sample set.
In practical application, after a first word segmentation set and a second word segmentation set are obtained, the word segmentation included in the first word segmentation set and the word segmentation included in the second word segmentation set are counted, the word frequency corresponding to each word is determined, and then a plurality of word segmentation are selected as feature labels corresponding to the first sample set through corresponding comparison.
In an embodiment, the first sample set is samples of the same category, that is, positive samples, and the mixed sample set includes positive samples and negative samples, so that when determining the feature tag corresponding to the first sample set, corresponding comparison is required to determine, and since the mixed sample set includes negative samples, the word frequency of the feature tag of the first sample set occurring in the mixed sample is low, so that the feature tag corresponding to the first sample set can be determined by word frequency comparison.
In actual application, after a participle set corresponding to a labeled first sample set (a positive example sample set) and a participle set corresponding to an unlabeled mixed sample set are obtained, word frequencies of the same participle in the two participle sets are counted to obtain a word frequency A1 corresponding to the first sample set and a word frequency A2 corresponding to the mixed sample set, and then a currently corresponding feature tag is determined through a ratio A1/A2 of A1 to A2.
When the feature label is determined, the obtained ratio is compared with a preset ratio threshold, and when the obtained ratio is greater than or equal to the ratio threshold, the word is determined as the feature label. For example, when the ratio corresponding to the participle "hello" is 4, it is determined that "hello" is a feature label because it is greater than 3 (ratio threshold). In this manner, the feature labels corresponding to the first set of samples (positive examples) are determined.
In practical applications, taking a conversation between an operator and a client as an example, in a general conversation process, polite communication of the operator can better promote communication with the client, so that in the conversation process, more words with characteristics of customers appear in the conversation, and positive effects such as please or you can be played. Through word segmentation processing on all samples in the first sample set (the positive example sample set), feature labels of the positive example samples are determined through counting statistics, and for example, "please" and "you" in the dialog can be partial feature labels.
It should be noted that, in the actual application process, there is no certain order between step S201 and step S202, and both steps may be performed simultaneously or may be performed at a time, which is not limited herein.
And S103, labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set.
During model training, in order to improve the robustness and the training accuracy of the model, a certain countermeasure training is required. Therefore, after the first sample set representing the positive example samples is obtained, corresponding negative example samples need to be obtained, so that the model needing to be trained is trained correspondingly by using the positive example samples and the negative example samples, and a more accurate model with better robustness is obtained.
Therefore, when the first sample set is obtained, an unlabeled mixed sample set is obtained, where samples included in the mixed sample set may be negative samples or sets of positive samples and negative samples, but in an actual use process, when the mixed samples are sets of positive samples and negative samples, training of the model may be facilitated, so that the mixed samples are selected as the sets of positive samples and negative samples, labeling of samples included in the unlabeled mixed sample set is realized by using the feature labels corresponding to the first sample set obtained in advance, and then after the labeling is completed, the labeled mixed sample set is obtained.
And for the labeled mixed sample set, labeling and classifying the mixed sample set, labeling the mixed sample set through the feature tags corresponding to the first sample set, and determining samples of the same type as the first sample set and samples of different types from the first sample set in the mixed sample set, wherein the samples of the same type belong to the same sample of the true case.
Further, referring to fig. 3, fig. 3 is a schematic flowchart illustrating a step of obtaining a labeled mixed sample according to an embodiment of the present application.
Wherein, step S103 includes:
step S301, determining a sub-participle set corresponding to each sample in the unmarked mixed sample set based on the second participle set;
and S302, labeling each sample according to the sub-word segmentation set and the feature labels to obtain a labeled mixed sample.
And after the characteristic label is obtained, labeling the samples in the pre-obtained unlabeled mixed sample set by using the characteristic label to obtain a mixed sample set after the labeling is finished.
Specifically, when an unlabeled mixed sample set is labeled, a sub-word segmentation set corresponding to each sample is obtained for labeling each sample, and then each sample is labeled by using the obtained sub-word segmentation set and the obtained feature label.
When each sample is labeled, the sub-word segmentation set is compared with the feature labels, and the samples are labeled according to the comparison result. For example, when the number of feature labels included in the sub-segmented word set of the sample is greater than the set number, the sample is labeled, that is, labeled with the same label as the first sample set, and otherwise, the sample is not labeled.
Further, when the labeling of the unlabeled mixed sample set is completed, not all samples may be used for training the model, and therefore, after the labeling of the mixed sample set is completed, the method further includes: and screening the marked mixed sample set to delete the marked samples in the marked mixed sample set to obtain a second sample set.
In an embodiment, after the labeling of the mixed sample set is completed, the mixed sample is screened according to the labeling result to obtain a second sample set, and during the screening, the samples with the same category as the first sample set are deleted to obtain a second sample set with a different category from the first sample set in the mixed sample set.
In an embodiment, when the labeled mixed sample set is obtained, the labeled mixed sample set can be classified to obtain two sub-sample sets, one is a sample set with the same category as the first sample set, and the other is a sample set with a different category from the first sample set.
For example, when the samples included in the first sample set are positive samples, the samples included in the second sample set are negative samples, and then the two different sample sets are combined to obtain a training sample for training the model to be trained.
In practical application, when an unlabeled sample is classified, a word segmentation process is performed on each sample contained in the unlabeled mixed sample, and then a phrase obtained by the word segmentation is compared with a feature tag (feature word) obtained in advance, for example, when the phrase contains a certain number of feature tags, a category corresponding to the feature tag is determined, for example, when there are 5 words belonging to the feature tag in the phrase, it is determined that the sample corresponding to the phrase is the same as the category of the first sample set, otherwise, the sample is different.
And step S104, training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged.
After the labeling of the mixed sample set is completed, the quality control model to be trained is trained by using the first sample set acquired in advance and the mixed sample set after the labeling is completed at this time. The mixed sample set is classified when the mixed sample set is labeled, and then one sample set which is different from the first sample set is selected from the labeled mixed sample set to serve as the currently used sample set after the labeling is completed so as to complete the training of the quality inspection model to be trained, and then the quality inspection model after the training is judged to determine whether the quality inspection model is converged.
In an embodiment, referring to fig. 4, fig. 4 is a flowchart illustrating a step of training a model to be trained according to an embodiment of the present application. Specifically, when the quality inspection model to be trained is trained, the method includes:
step S401, merging the first sample set and the second sample set to obtain a training sample set.
Due to the fact that the requirement for the samples of the countertraining is large, more samples with labels need to be obtained, the countertraining of the quality inspection model to be trained is achieved, and the robustness of the obtained target detection model is further improved.
Therefore, after the second sample set is obtained, the quality control model to be trained is trained by using the first sample set and the second sample set, so that the first sample set and the second sample set are combined to obtain a training sample set for training, and the quality control model to be trained is trained according to the obtained training sample set to obtain the desired quality control model.
Step S402, pre-training the quality inspection model to be trained according to the training sample set, and determining whether the pre-trained quality inspection model is pre-converged.
When the model is trained, a quality inspection model to be trained is trained in a biased SVM (biased SVM) mode, so that when a first sample set and a second sample set are obtained, samples contained in the first sample set and the second sample set are marked after the first sample set and the second sample set, and a training sample set for pre-training is obtained.
In one embodiment, when the quality inspection model to be trained is pre-trained by using the training sample set, the method includes: labeling each sample in the first set of samples with a first label and labeling each sample in the second set of samples with a second label; inputting the marked training sample set into a quality inspection model to be trained to obtain a minimum numerical value corresponding to the quality inspection model to be trained; and determining the model parameters currently corresponding to the quality inspection model to be trained according to the minimized numerical value so as to pre-train the quality inspection model to be trained.
Specifically, each sample in the training sample set is labeled prior to training, and when labeling is performed, 1 may be used to represent positive examples samples (first sample set), -1 represents negative examples samples (second sample set), and (x) is usedi,yi) Represents a sample, wherein xiRepresents a sample, yiAnd representing a label corresponding to the sample, and inputting the labeled sample into the quality inspection model to be trained after the labeling of the sample is finished so as to realize the pre-training of the quality inspection model to be trained.
In the pre-training process, model parameters in the quality inspection model to be trained are continuously adjusted and optimized, so that the trained model meets the current requirements. In performing model optimization, the following optimization problem can be formalized:
and (3) minimizing:
Figure BDA0002840052990000091
satisfies the following conditions: y isi(WTxi+b)≥1-ξii≥0,i=1,2,...,n
Where W is the parameter that the model is to learn. In optimizing the target
Figure BDA0002840052990000092
And
Figure BDA0002840052990000093
we can see that we give different weights to the penalties of the positive and negative examples being wrongly scored, respectively, because the positive examples are selected according to the chosen label, we have greater confidence in the label of the positive example, considering less noise in the positive example, and therefore greater penalties to the wrongly scored positive example. Thus, by adjusting the parameter C+And C-The optimization objective of the model can be made to take the noise of the sample into account.
And determining whether the current trained quality control model converges or not by the minimized numerical value during training, for example, determining to converge when the obtained minimized numerical value is smaller than the set threshold value by numerical value comparison, and determining not to converge by anti-regularization. For example, when determining whether the pre-trained quality inspection model converges, the method includes: acquiring a preset minimization threshold, and comparing the minimization value with the minimization threshold; if the minimization value is smaller than or equal to the minimization threshold, determining that the pre-trained quality inspection model is converged; and if the minimization value is larger than the minimization threshold, determining that the quality inspection model after the pre-training is finished does not converge.
And S403, if the trained quality inspection model is determined to be pre-converged, obtaining an intermediate quality inspection model.
When the pre-training is carried out on the quality inspection model to be trained based on the first sample set and the second sample set, when the model convergence after the pre-training is determined, an intermediate model corresponding to the training completion is obtained, wherein the intermediate quality inspection model is not the finally obtained quality inspection model for use, but an intermediate quality inspection model needing further training is also obtained, and then the finally used quality inspection model is obtained through the training of the intermediate quality inspection model.
And S404, filtering the second sample set according to the intermediate quality inspection model to obtain a third sample set.
In practical application, when the mixed sample set is labeled according to the obtained feature labels to obtain a second sample set, some noise, namely classification errors inevitably exist, for example, the sample labels belonging to the first sample set are attributed to the second sample set, and then the training effect of the model is influenced in the training process. Therefore, in order to ensure the robustness and the accuracy of the model after training, the second sample set is screened accordingly, so as to delete the noise samples in the second sample set.
And after the intermediate quality inspection model is obtained, inputting the second sample set into the intermediate quality inspection model so as to re-label the labels of the samples in the second sample set, then filtering the re-labeled second sample set, and removing the noise samples in the re-labeled second sample set so as to obtain a third sample set.
Because the samples in the first sample set are positive samples and the samples in the second sample set are negative samples, the re-labeled positive samples in the second sample set are removed during filtering, and only the samples with the confidence level higher than a set threshold value are kept, so that a third sample set only containing the negative samples is obtained.
Step S405, training the intermediate quality inspection model according to the first sample set and the third sample set, and determining whether the trained intermediate quality inspection model is converged.
And after the third sample set is obtained, combining the first sample set and the third sample set to obtain a new training sample for training, further training the intermediate quality inspection model according to the obtained new training sample, obtaining a finally trained quality inspection model when the trained intermediate quality inspection model is converged, and storing the obtained quality inspection model.
It should be noted that, when determining whether the model converges, the determination of whether the model converges may be implemented according to the method described in step S403, and therefore, will not be described in detail herein.
And step S105, if the trained quality inspection model is determined to be converged, storing the trained quality inspection model.
By judging the model parameters in the trained quality inspection model, when the model parameters meet the set conditions, the quality inspection model obtained by training at the moment is determined to be converged, namely the actual requirements of the model are met, so that the target detection model obtained by training at the moment is recorded and stored for subsequent use.
In one embodiment, in addition to determining convergence, the trained quality control model may not converge, i.e., still not meet the actual requirements of the model, and thus the training of the quality control model is continued.
Therefore, when determining whether the quality control model converges, if it is determined that the trained quality control model does not converge, the step S104 is executed: and training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged. And recording and storing the quality inspection model corresponding to convergence until the quality inspection model obtained by training converges.
In the above-described training method of quality inspection model based on sample learning, when a first sample set with labeled sample classes belonging to the same class is obtained, the first sample set is analyzed and processed correspondingly to obtain feature labels corresponding to the first sample set, specifically, the samples contained in the first sample set are subjected to word segmentation to obtain feature labels, then a second sample set opposite to the class of the first sample set is obtained from the mixed model by using the obtained feature labels, so that the quality inspection model to be trained is pre-trained by using the first sample set and the second sample set, an intermediate quality inspection model is obtained when the pre-training is completed, then the second sample set is filtered by using the intermediate quality inspection model, and noise samples (samples with the class of the second sample set belonging to the first sample set) in the second sample set are deleted, and finally, further training the intermediate quality inspection model by using the first sample set and the third sample set, and realizing continuous optimization of relevant parameters in the model through continuous confrontation and defense training so as to obtain a final quality inspection model. The method has the advantages that when the model is trained, the characteristic labels can be used for marking unmarked samples quickly, cost improvement caused by sample marking is reduced, pre-training and further training of the model are achieved, the problem that training is inaccurate caused by inaccurate marking is reduced, and finally obtained quality inspection models have better quality inspection effect and robustness.
Referring to fig. 5, fig. 5 is a schematic block diagram of a sample learning-based quality inspection model training apparatus according to an embodiment of the present application, which is used for executing the aforementioned sample learning-based quality inspection model training method.
As shown in fig. 5, the training apparatus 500 for the quality control model based on sample learning includes:
the model loading module 501 is used for loading a quality inspection model to be trained;
a label determining module 502, configured to obtain a first sample set with a label and a mixed sample set without the label, and process the first sample set and the mixed sample set to obtain a feature label corresponding to the first sample set;
a sample generation module 503, configured to label the mixed sample set according to the feature tag, so as to obtain a labeled mixed sample set;
a model training module 504, configured to train the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determine whether the trained quality inspection model converges;
and the data storage module 505 is configured to store the trained quality inspection model if it is determined that the trained quality inspection model converges.
Further, in an embodiment, the tag determining module 502 is further specifically configured to:
performing word segmentation on the samples contained in the first sample set to obtain a first word segmentation set;
performing word segmentation on the samples contained in the mixed sample set to obtain a second word segmentation set;
counting the word frequency of each participle in the first participle set, counting the word frequency of each participle in the second participle set, and selecting a plurality of participles in the first participle set as feature labels corresponding to the first sample set through word frequency comparison;
and the word frequency corresponding to the plurality of participles is greater than or equal to a preset threshold value.
Further, in an embodiment, the sample generating module 503 is further specifically configured to:
labeling each sample in the mixed sample set based on the feature label;
and screening the mixed sample according to the marked result to obtain a second sample set.
Further, in an embodiment, the model training module 504 is further specifically configured to:
merging the first sample set and the second sample set to obtain a training sample set;
pre-training the quality inspection model to be trained according to the training sample set, and determining whether the pre-trained quality inspection model is pre-converged;
if the trained quality inspection model is determined to be pre-converged, obtaining an intermediate quality inspection model;
filtering the second sample set according to the intermediate quality inspection model to obtain a third sample set;
and training the intermediate quality inspection model according to the first sample set and the third sample set, and determining whether the trained intermediate quality inspection model converges.
Further, in an embodiment, the model training module 504 is further specifically configured to:
labeling each sample in the first set of samples with a first label and labeling each sample in the second set of samples with a second label;
inputting the marked training sample set into a quality inspection model to be trained to obtain a minimum numerical value corresponding to the quality inspection model to be trained;
and determining the current corresponding model parameters of the quality inspection model to be trained according to the minimized numerical value so as to pre-train the quality inspection model to be trained.
Further, in an embodiment, the model training module 504 is further specifically configured to:
acquiring a preset minimization threshold, and comparing the minimization value with the minimization threshold;
if the minimization value is smaller than or equal to the minimization threshold, determining that the pre-trained quality inspection model is converged;
and if the minimized numerical value is larger than the minimized threshold value, determining that the quality inspection model after the pre-training is finished is not converged.
Further, in an embodiment, the data storage module 505 is further specifically configured to:
if the trained target detection model is determined not to be converged, executing the following steps: and training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 6.
Referring to fig. 6, fig. 6 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server.
Referring to fig. 6, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any one of the methods of training a sample learning-based quality control model.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by the processor, causes the processor to perform any one of the methods for training a sample learning-based quality control model.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the configuration shown in fig. 6 is a block diagram of only a portion of the configuration relevant to the present teachings and does not constitute a limitation on the computing device to which the present teachings may be applied, and that a particular computing device may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
loading a quality inspection model to be trained;
acquiring a first sample set with a label and a mixed sample set without the label, and processing the first sample set and the mixed sample set to obtain a feature tag corresponding to the first sample set;
labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set;
training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged;
and if the trained quality inspection model is determined to be converged, storing the trained quality inspection model.
In an embodiment, when implementing the processing on the first sample set to obtain the feature tag corresponding to the first sample set, the processor is further configured to implement:
performing word segmentation on the samples contained in the first sample set to obtain a first word segmentation set;
performing word segmentation on the samples contained in the mixed sample set to obtain a second word segmentation set;
counting the word frequency of each participle in the first participle set, counting the word frequency of each participle in the second participle set, and selecting a plurality of participles in the first participle set as feature labels corresponding to the first sample set through word frequency comparison;
and the word frequency corresponding to the plurality of participles is greater than or equal to a preset threshold value.
In an embodiment, when the processor labels the mixed sample set according to the feature tag to obtain a labeled mixed sample set, the processor is further configured to:
labeling each sample in the mixed sample set based on the feature label;
and screening the mixed sample according to the marked result to obtain a second sample set.
In one embodiment, when the training of the quality control model to be trained according to the first sample set and the annotated mixed sample set and the determination of whether the trained quality control model converges are implemented, the processor is further configured to:
merging the first sample set and the second sample set to obtain a training sample set;
pre-training the quality inspection model to be trained according to the training sample set, and determining whether the pre-trained quality inspection model is pre-converged;
if the trained quality inspection model is determined to be pre-converged, obtaining an intermediate quality inspection model;
filtering the second sample set according to the intermediate quality inspection model to obtain a third sample set;
and training the intermediate quality inspection model according to the first sample set and the third sample set, and determining whether the trained intermediate quality inspection model converges.
In one embodiment, the processor, when implementing the pre-training of the quality control model to be trained according to the training sample set, is further configured to implement:
labeling each sample in the first set of samples with a first label and labeling each sample in the second set of samples with a second label;
inputting the marked training sample set into a quality inspection model to be trained to obtain a minimum numerical value corresponding to the quality inspection model to be trained;
and determining the current corresponding model parameters of the quality inspection model to be trained according to the minimized numerical value so as to pre-train the quality inspection model to be trained.
In one embodiment, the processor, when performing the determining whether the pre-trained quality control model is pre-converged, is further configured to perform:
acquiring a preset minimization threshold, and comparing the minimization value with the minimization threshold;
if the minimization value is smaller than or equal to the minimization threshold, determining that the pre-trained quality inspection model is converged;
and if the minimized numerical value is larger than the minimized threshold value, determining that the quality inspection model after the pre-training is finished is not converged.
In one embodiment, the processor, after performing the determining whether the trained quality control model converges, is further configured to perform:
if the trained target detection model is determined not to be converged, executing the following steps: and training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged.
The embodiment of the application also provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, the computer program comprises program instructions, and the processor executes the program instructions to implement any one of the methods for training the quality inspection model based on sample learning provided by the embodiment of the application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the blockchain node, and the like.
In addition, the block chain referred to in the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, and these modifications or substitutions should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for training a quality inspection model based on sample learning is characterized by comprising the following steps:
loading a quality inspection model to be trained;
acquiring a first sample set with a label and a mixed sample set without the label, and processing the first sample set and the mixed sample set to obtain a feature tag corresponding to the first sample set;
labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set;
training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality inspection model is converged;
and if the trained quality inspection model is determined to be converged, storing the trained quality inspection model.
2. The method of claim 1, wherein the processing the first sample set to obtain the feature label corresponding to the first sample set comprises:
performing word segmentation on the samples contained in the first sample set to obtain a first word segmentation set;
performing word segmentation on the samples contained in the mixed sample set to obtain a second word segmentation set;
counting the word frequency of each participle in the first participle set, counting the word frequency of each participle in the second participle set, and selecting a plurality of participles in the first participle set as feature labels corresponding to the first sample set through word frequency comparison;
and the word frequency corresponding to the plurality of participles is greater than or equal to a preset threshold value.
3. The method of claim 2, wherein the labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set comprises:
determining a sub-word segmentation set corresponding to each sample in the unlabeled mixed sample set based on the second word segmentation set;
and labeling each sample according to the sub-word segmentation set and the feature labels to obtain a labeled mixed sample.
4. The method of claim 3, wherein labeling the mixed sample set according to the feature tag, and after obtaining a labeled mixed sample set, further comprises:
and screening the labeled mixed sample set to delete the labeled samples in the labeled mixed sample set to obtain a second sample set.
5. The method of claim 3, wherein the training the quality control model to be trained according to the first sample set and the labeled mixed sample set, and determining whether the trained quality control model converges comprises:
merging the first sample set and the second sample set to obtain a training sample set;
pre-training the quality inspection model to be trained according to the training sample set, and determining whether the quality inspection model after the pre-training is pre-converged;
if the trained quality inspection model is determined to be pre-converged, obtaining an intermediate quality inspection model;
filtering the second sample set according to the intermediate quality inspection model to obtain a third sample set;
and training the intermediate quality inspection model according to the first sample set and the third sample set, and determining whether the trained intermediate quality inspection model converges.
6. The method of claim 5, wherein the pre-training the quality control model to be trained according to the training sample set comprises:
labeling each sample in the first set of samples with a first label and labeling each sample in the second set of samples with a second label;
inputting the marked training sample set into a quality inspection model to be trained to obtain a minimum numerical value corresponding to the quality inspection model to be trained;
and determining the current corresponding model parameters of the quality inspection model to be trained according to the minimized numerical value so as to pre-train the quality inspection model to be trained.
7. The method of claim 6, wherein the determining whether the quality control model after the pre-training is pre-converged comprises:
acquiring a preset minimization threshold, and comparing the minimization value with the minimization threshold;
if the minimization value is smaller than or equal to the minimization threshold, determining that the pre-trained quality inspection model is converged;
and if the minimized numerical value is larger than the minimized threshold value, determining that the quality inspection model after the pre-training is finished is not converged.
8. A training device for a quality control model based on sample learning, the device comprising:
the model loading module is used for loading a quality inspection model to be trained;
the label determining module is used for acquiring a first sample set with labels and an unlabeled mixed sample set, and processing the first sample set and the mixed sample set to obtain a feature label corresponding to the first sample set;
the sample generation module is used for labeling the mixed sample set according to the feature tag to obtain a labeled mixed sample set;
the model training module is used for training the quality inspection model to be trained according to the first sample set and the labeled mixed sample set and determining whether the trained quality inspection model is converged;
and the data storage module is used for storing the trained quality inspection model if the trained quality inspection model is determined to be converged.
9. A computer device, comprising a memory and a processor:
the memory has stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the method of training a sample learning based quality control model according to any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, which, when executed by the processors, causes the one or more processors to perform the steps of the method of training a sample learning-based quality control model according to any one of claims 1 to 7.
CN202011488573.5A 2020-12-16 Quality inspection model training method, device, equipment and readable storage medium Active CN112633344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011488573.5A CN112633344B (en) 2020-12-16 Quality inspection model training method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011488573.5A CN112633344B (en) 2020-12-16 Quality inspection model training method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN112633344A true CN112633344A (en) 2021-04-09
CN112633344B CN112633344B (en) 2024-10-22

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804512A (en) * 2018-04-20 2018-11-13 平安科技(深圳)有限公司 Generating means, method and the computer readable storage medium of textual classification model
CN110110080A (en) * 2019-03-29 2019-08-09 平安科技(深圳)有限公司 Textual classification model training method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804512A (en) * 2018-04-20 2018-11-13 平安科技(深圳)有限公司 Generating means, method and the computer readable storage medium of textual classification model
CN110110080A (en) * 2019-03-29 2019-08-09 平安科技(深圳)有限公司 Textual classification model training method, device, computer equipment and storage medium
WO2020199591A1 (en) * 2019-03-29 2020-10-08 平安科技(深圳)有限公司 Text categorization model training method, apparatus, computer device, and storage medium

Similar Documents

Publication Publication Date Title
CN109189767B (en) Data processing method and device, electronic equipment and storage medium
CN112070138B (en) Construction method of multi-label mixed classification model, news classification method and system
WO2019051941A1 (en) Method, apparatus and device for identifying vehicle type, and computer-readable storage medium
CN112685324B (en) Method and system for generating test scheme
CN111523421A (en) Multi-user behavior detection method and system based on deep learning and fusion of various interaction information
CN113344079B (en) Image tag semi-automatic labeling method, system, terminal and medium
CN111177390A (en) Accident vehicle identification method and device based on hybrid model
CN110458600A (en) Portrait model training method, device, computer equipment and storage medium
CN117523218A (en) Label generation, training of image classification model and image classification method and device
CN113900935A (en) Automatic defect identification method and device, computer equipment and storage medium
CN116432835A (en) Customer loss early warning and attributing method, device, computer equipment and storage medium
CN112633344A (en) Quality inspection model training method, quality inspection model training device, quality inspection model training equipment and readable storage medium
CN115620083A (en) Model training method, face image quality evaluation method, device and medium
CN115439079A (en) Item classification method and device
CN111709479B (en) Image classification method and device
CN112633344B (en) Quality inspection model training method, device, equipment and readable storage medium
CN112632284A (en) Information extraction method and system for unlabeled text data set
CN112434471A (en) Method, system, electronic device and storage medium for improving model generalization capability
CN111242449A (en) Enterprise information loss prediction method
CN118196567B (en) Data evaluation method, device, equipment and storage medium based on large language model
Ackerman et al. Theory and Practice of Quality Assurance for Machine Learning Systems
CN118363932B (en) Unmanned aerial vehicle-based intelligent patrol method and system
CN117708759B (en) Method and device for positioning industry link of enterprise
Ackerman et al. Theory and Practice of Quality Assurance for Machine Learning Systems An Experiment Driven Approach
CN117271764A (en) Model training method, data processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant