CN116956105A - Classification model training method, defect identification method, device and electronic equipment - Google Patents

Classification model training method, defect identification method, device and electronic equipment Download PDF

Info

Publication number
CN116956105A
CN116956105A CN202310033452.9A CN202310033452A CN116956105A CN 116956105 A CN116956105 A CN 116956105A CN 202310033452 A CN202310033452 A CN 202310033452A CN 116956105 A CN116956105 A CN 116956105A
Authority
CN
China
Prior art keywords
data
model
classification
sample
sample data
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.)
Pending
Application number
CN202310033452.9A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202310033452.9A priority Critical patent/CN116956105A/en
Publication of CN116956105A publication Critical patent/CN116956105A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a classification model training method, a defect identification method, a device and electronic equipment, wherein the method comprises the following steps: acquiring positive sample data and first label-free data, inputting the positive sample data and the first label-free data into a classifier model for classification processing to obtain negative sample data and second label-free data, and obtaining first model parameters of the classifier model; combining the positive sample data and the negative sample data to obtain a labeled training set, and inputting the labeled training set and the second unlabeled data into the semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model; performing parameter optimization on the first model parameters according to the second model parameters to obtain updated first model parameters and constructing a target classification model; the method and the device can improve the accuracy of classification and identification, quicken the convergence speed of the target classification model, and can be widely applied to the technical field of machine learning and be derivative applied to the other technical fields related to machine learning such as the Internet of things and the Internet of vehicles.

Description

Classification model training method, defect identification method, device and electronic equipment
Technical Field
The invention relates to the technical field of machine learning, in particular to a classification model training method, a defect identification device and electronic equipment.
Background
Under the relevant application scene of classifying the target object, a machine learning training is generally utilized to obtain a classification model, and then the classification model is utilized to classify and identify relevant sample data, so as to obtain a classification result of the relevant object in the sample data. However, for many model training processes of application scenarios, it is difficult to obtain sample data with positive labels and negative labels simultaneously before training, for example, in an application scenario of industrial quality inspection, standard product samples can only be given in advance, and product samples with defects can not be given in advance, so that an accurate classification model can not be obtained according to positive and negative sample training by the current machine learning method.
The related art proposes a positive example and unlabeled sample learning (Learning from Positive and Unlabled Example) for PU or LPU learning, and a binary classifier is trained by labeled positive samples and a large number of unlabeled samples to finish classification and identification of related objects.
However, the current PU learning method only trains according to the approximate proportion of positive samples in the original data through an unbiased estimation formula, so as to estimate the positive and negative samples in the test set. However, in actual business, the proportion of positive samples in unlabeled data is not fixed, and meanwhile, the characteristics of the positive samples also have certain changes, so that the current method cannot learn the related information of the negative samples, and the classification accuracy of the final PU classification model is low.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a classification model training method, a defect recognition method, a device and an electronic apparatus, so as to improve accuracy of defect recognition.
An aspect of the embodiment of the invention provides a classification model training method, which comprises the following steps:
acquiring positive sample data and first label-free data;
inputting the positive sample data and the first unlabeled data into a positive example and a unlabeled sample learning model for classification processing, classifying from the first unlabeled data to obtain negative sample data and second unlabeled data, and obtaining first model parameters of the positive example and the unlabeled sample learning model;
combining the positive sample data and the negative sample data to obtain a labeled training set, and inputting the labeled training set and the second non-labeled data into a semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model;
and carrying out parameter optimization on the first model parameters according to the second model parameters to obtain updated first model parameters, and constructing a target classification model according to the updated first model parameters.
On the other hand, based on the classification model training method proposed in the first aspect, the embodiment of the invention further provides a defect identification method, which comprises the following steps:
Acquiring object data to be identified;
classifying and identifying the object data to be identified according to a target classification model, and determining that the object to be identified is a defect object or a qualified object;
wherein the target classification model is determined according to the classification model training method set forth in the first aspect.
On the other hand, the technical scheme of the invention also provides a classification model training device, which comprises:
the first module is used for acquiring positive sample data and first label-free data;
the second module is used for inputting the positive sample data and the first unlabeled data into a positive example and a unlabeled sample learning model to be classified, so as to obtain negative sample data and second unlabeled data from the first unlabeled data in a classifying way, and obtain first model parameters of the positive example and the unlabeled sample learning model;
the third module is used for combining the positive sample data and the negative sample data to obtain a labeled training set, inputting the labeled training set and the second non-labeled data into a semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model;
and a fourth module, configured to perform parameter optimization on the first model parameter according to the second model parameter, obtain an updated first model parameter, and construct a target classification model according to the updated first model parameter.
In some possible embodiments, the second module in the classification model training apparatus may include:
a first sub-module for determining a first proportion of the positive sample data in the first label-free data;
the second sub-module is used for calculating a second proportion of negative sample data in the first non-tag data according to a first proportion of the positive sample data in the first non-tag data;
a third sub-module, configured to calculate a prediction expectation of the positive sample data according to a preset substitution loss function and the first proportion;
a fourth sub-module, configured to calculate a prediction expectation of the negative sample data according to a preset substitution loss function and the second proportion;
a fifth sub-module, configured to calculate, according to the predicted expectation of the positive sample data and the predicted expectation of the negative sample data, first model parameters of the positive example and the unlabeled sample learning model;
and a sixth sub-module, configured to obtain negative sample data and second unlabeled data by classifying from the first unlabeled data based on the positive examples configured with the first model parameters and the unlabeled sample learning model.
In some possible embodiments, the fifth sub-module may include:
A first unit configured to calculate a first product between the first proportion and a predicted expectation of the positive sample data, calculate a second product between the second proportion and the predicted expectation of the negative sample data, and obtain a minimum value of a sum of the first product and the second product;
and the second unit is used for carrying out anti-overfitting processing on the minimum value to obtain the first model parameters of the positive example and the unmarked sample learning model.
In some possible embodiments, the third module in the classification model training apparatus may include:
a seventh sub-module, configured to perform data enhancement processing on the negative sample data to obtain new negative sample data;
and an eighth sub-module, configured to combine the positive sample data and the new negative sample data to obtain the labeled training set.
In some possible embodiments, the seventh sub-module may include:
a third unit for obtaining random values subject to beta distribution;
a fourth unit, configured to obtain a sample value and a tag value of any two samples from the negative sample data;
a fifth unit, configured to calculate a new sample value of a new sample according to the random value and sample values of the two samples, and calculate a new label value of the new sample according to the random value and label values of the two samples;
A sixth unit for constructing a new sample from the new sample value and the new tag value;
and a seventh unit, configured to aggregate each new sample to obtain the new negative sample data.
In some possible embodiments, the third module in the classification model training apparatus may further include:
a ninth sub-module, configured to input the labeled training set and the second unlabeled data as a training set into a MixMatch semi-supervised network model;
a tenth sub-module for constructing a target loss function according to the cross entropy loss function and the L2 loss function;
and an eleventh sub-module, configured to train the MixMatch semi-supervised network model with the objective loss function as a target, to obtain the second model parameter.
In some possible embodiments, the fourth module in the classification model training apparatus may include:
a twelfth sub-module for acquiring the weighting weight;
and a thirteenth sub-module, configured to perform weighted summation on the first model parameter and the second model parameter according to the weighted weight, so as to obtain an updated first model parameter.
In some possible embodiments, the fourth module may further comprise a fourteenth sub-module; the fourteenth submodule is used for carrying out model distillation on the target classification model to obtain a compressed target classification model.
In another aspect, an embodiment of the present invention further provides a defect identifying device, where the device includes:
a fifth module for acquiring the data of the object to be identified;
a sixth module, configured to perform classification recognition on the object data to be recognized according to a target classification model, and determine that the object to be recognized is a defect object or a qualified object;
the target classification model is determined according to the classification model training device.
In another aspect, an embodiment of the present invention further provides a defect identifying system, where the system includes:
the product imaging module is used for acquiring image data of a target product;
the defect identification module is used for carrying out defect identification on the image data of the target product through the target classification model and determining defect information of the target product;
the defect registration module is used for carrying out defect registration on the target product according to the defect information of the target product;
the target classification model is determined according to the classification model training device.
On the other hand, the embodiment of the invention also provides electronic equipment, which comprises a processor and a memory;
the memory is used for storing programs;
the processor executes the program to implement the classification model training method or the defect identification method.
Embodiments of the present invention also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, to cause the computer device to perform the foregoing method.
The method comprises the steps of firstly inputting positive sample data and first label-free data into a positive example and label-free sample learning model to be classified, classifying the positive sample data and the first label-free data to obtain negative sample data and second label-free data, and obtaining first model parameters of the positive example and label-free sample learning model; at the moment, negative sample data can be generated through classification processing of the positive example and the unmarked sample learning model, then the positive sample data and the negative sample data are combined to obtain a labeled training set, and the labeled training set and second unmarked data are classified through a semi-supervised network to obtain second model parameters of the semi-supervised network model; according to the method, the classification results of the positive example and the unmarked sample learning model can be corrected through training of the semi-supervised network model, so that the classification recognition accuracy is improved, finally, the first model parameters are subjected to parameter optimization according to the second model parameters to obtain updated first model parameters, and the target classification model is constructed according to the updated first model parameters.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of a result of defect identification for a product according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating steps of a training method for classification models according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating steps for determining first model parameters of a positive example and a label-free sample learning model in accordance with an embodiment of the present application;
FIG. 5 is a flowchart illustrating steps for data enhancement in an embodiment of the present application;
FIG. 6 is a flowchart showing a step of fusing two sample data to obtain new sample data according to an embodiment of the present application;
FIG. 7 is a flowchart of steps in a MixMatch semi-supervised network model training process in an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a product qualification model according to an embodiment of the present application;
FIG. 9 is a flowchart illustrating steps of a defect identifying method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a training device for classification models according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a defect identification system according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
Before proceeding to further detailed description of the disclosed embodiments, the terms and terms involved in the disclosed embodiments are described, which are applicable to the following explanation:
artificial Intelligence (AI): the system is a theory, a method, a technology and an application system which simulate, extend and extend human intelligence by using a digital computer or a machine controlled by the digital computer, sense environment, acquire knowledge and acquire a target result by using the knowledge. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision. The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions. With research and advancement of artificial intelligence technology, research and application of artificial intelligence technology is being developed in various fields, such as common smart home, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned, automatic driving, unmanned aerial vehicles, robots, smart medical treatment, smart customer service, etc., and it is believed that with the development of technology, artificial intelligence technology will be applied in more fields and with increasing importance value.
Semi-supervised network or Semi-supervised learning (Semi-Supervised Learning); in real life, unlabeled data is easy to obtain, and labeled data is often difficult to collect, and labeling is time-consuming and labor-consuming. In this case, semi-supervised learning is more suitable for real world applications, and has recently become a popular new direction in the field of deep learning, which requires only a small number of labeled samples and a large number of unlabeled samples.
A PU-learning algorithm or a PU classification algorithm; in an actual classification scenario, a problem like this is typically encountered: only marked positive samples, and unmarked samples. For example, in a financial wind control scenario, a portion of the target objects are marked as fraudulent target objects, and the remaining target objects are not marked, although most of these are good, a small number are likely fraudulent target objects. Although the unlabeled samples can be used as negative samples for training for convenient operation, the accuracy is reduced, and how to distinguish the positive sample from the negative sample in the unlabeled samples, so that the accuracy of the model is improved, becomes a considerable problem. Based on the problem, a PU-learning algorithm is provided, which is used for solving the problem of text classification at the earliest, and extends to various fields such as gene identification, anti-fraud and the like, and is a sharp tool for solving the problem of unlabeled samples.
Based on the technical theory foundation, in the scene needing to use the classification model, the PU algorithm adopted by the related technical scheme only trains according to the approximate proportion of the positive samples in the original data through an unbiased estimation formula, so that the positive and negative samples in the test set are estimated. However, in actual business, the proportion of positive samples in unlabeled data is not fixed, and the characteristics of the positive samples also have certain changes. In other scenarios where semi-supervised classification algorithms are chosen, they typically require negative sample data provided with labels; this requirement is somewhat accessible from the actual process. Furthermore, in a real scenario, it may only be possible to explicitly indicate the type of positive sample, but not to give an explicit definition of the kind of negative sample. In the case where only positive samples are provided, the semi-supervised network is not trainable, which may cause the network to determine all samples as positive samples.
Aiming at the defects or drawbacks of the related technical schemes, the embodiment of the invention provides a classification model training method, which can output the classification type corresponding to the data to be identified only by inputting positive sample data and unlabeled data, and the target classification model fuses the learning training result of the semi-supervised network model on the negative sample data, so that the classification accuracy of the target classification model can be improved, and the convergence rate of the target classification model is accelerated. In addition, the embodiment of the invention also provides a defect identification method, which is based on the classification model obtained by the classification model training method, can be applied to scenes such as industrial quality inspection and the like, and can be used for identifying product defects; for example, a picture of a product imaged is input to a classification model, and whether the product is defective is output through classification prediction.
System architecture and scene description applied to embodiments in the technical scheme of the present invention:
fig. 1 is a system architecture diagram to which a voice emotion change recognition method according to an embodiment of the present invention is applied. It includes a terminal 140, the internet 130, a gateway 120, a server 110, etc.
The terminal 140 is a carrier device that collects, receives sample data or data contents to be subjected to classification prediction, and outputs or visually presents the result after the data contents are subjected to classification prediction by the server 110. It may include various forms of desktop computers, laptops, PDAs (personal digital assistants), cell phones, car terminals, home theater terminals, dedicated terminals, etc. Based on different application scenes, the method can be embodied in the forms of mobile phones, vehicle-mounted terminals, home theater terminals, anti-theft alarm special terminals and the like. In addition, the device can be a single device or a set of a plurality of devices. The terminal 140 may communicate with the internet 130 in a wired or wireless manner, exchanging data.
Server 110 refers to a computer system that can provide certain services to terminal 140. The server 110 is required to have higher stability, security, performance, etc. than the general terminal 140. The server 110 may be one high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of one high-performance computer (e.g., a virtual machine), a combination of portions of multiple high-performance computers (e.g., virtual machines), etc. The server 110 can train the constructed classification training model and perform parameter optimization adjustment according to the relevant sample data acquired and uploaded by the terminal 140 under certain application scenes; after the training of the classification model is completed, the classification prediction is performed through the classification model according to the data content which is collected and uploaded by the terminal 140 and is subjected to the classification prediction, and the result of the classification prediction is returned to the terminal 140.
Gateway 120 is also known as an intersubnetwork connector, protocol converter. The gateway implements network interconnection on the transport layer, and is a computer system or device that acts as a translation. The gateway is a translator between two systems using different communication protocols, data formats or languages, and even architectures that are quite different. At the same time, the gateway may also provide filtering and security functions. The message sent by the terminal 140 to the server 110 is to be sent to the corresponding server 110 through the gateway 120. A message sent by the server 110 to the terminal 140 is also sent to the corresponding terminal 140 through the gateway 120.
In addition, in some possible implementation manners, the classification model training method and the defect identifying method provided by the embodiments of the present invention may be deployed as a computer program to be executed on a computer device; or on multiple computer devices deployed at a single site; still alternatively, executing on a plurality of computer devices distributed across a plurality of sites and interconnected by a communication network, the plurality of computer devices distributed across the plurality of sites and interconnected by the communication network can constitute a blockchain system. Based on the block chain system, the source of the sample data and the identification data to be classified in the implementation of the invention can be the data content stored by any node in the block chain and meeting the consensus mechanism. In addition, the classification model after training in the embodiment may also be stored in a certain node in the blockchain, and when other nodes need to perform related classification prediction operations, the classification model may be loaded into the current blockchain node based on a consensus mechanism. In addition, in the embodiment, the result of classification prediction and related data can be packaged into a new block through the block chain link point to be uploaded into a block chain; through the data storage mode of the decentralization of the block chain, the service data is more public and safe, and malicious data tampering is avoided at the same time. The block chain nodes may be any terminals 140 or servers 110, etc. having certain data processing capabilities in embodiments.
Taking a specific implementation scene of industrial quality inspection as an example:
in a common quality inspection scenario of industrial products, the data collected are generally recorded as normal samples of the product and yields of the production line, samples with obvious defects are not deliberately collected, and the specific types of defects that may occur during the production process are not determined. For example, as shown in fig. 2, for defect identification of leather materials, the surface image of the leather product to be inspected is obtained by the defect identification method provided by the technical scheme of the invention; and identifying the surface images of the batch by using the target classification model, and determining whether the leather surface of the target leather product has defects or not according to the output result of the target classification model.
The target classification model adopted in the classification process mainly comprises a classifier (classification model) and a semi-supervised network; the target classification model can be obtained by training the classification model training method provided by the technical scheme of the invention. In the training process of the target classification model, the obtained pictures of the normal sample and other sample pictures which are not subjected to quality inspection are subjected to classification training through a classifier at the same time, so that the pictures (labels which can be given to negative samples) suspected to have defects and the rest other pictures are obtained. Then, the data enhancement is carried out on the picture suspected to have defects, namely the negative sample data. And then the picture sample with the enhanced data and the picture of the normal sample are input to a semi-supervised network together for learning. Model weight migration is carried out on the classifier and the semi-supervised network on the basis of training, so that the classifier can obtain experience of semi-supervised network learning, and accuracy of a final classification result is improved.
It should be noted that, in each specific embodiment of the present application, when related processing is required according to information of a target object, behavior data of the target object, history data of the target object, and interaction data generated during man-machine interaction of the target object, permission or consent of the target object should be obtained first, and collection, use, processing, etc. of the data all comply with related laws and regulations and standards of related countries and regions. In addition, when the embodiment of the application needs to acquire the relatively sensitive information of the target object, the independent permission or independent consent of the target object is acquired through a popup window or a jump to a confirmation page and the like, and after the independent permission or independent consent of the target object is definitely acquired, the necessary target object related data for enabling the embodiment of the application to normally operate is acquired.
General description of the embodiments of the technical scheme of the application:
according to the embodiment disclosed by the technical scheme, a classification model training method is provided.
The broad description of the process of classification is to reflect the feature-type knowledge of how to find the common nature of the same class of things and the differential feature knowledge between different things. A narrow description of classification is to build a classification model through directed learning training and use the model to classify instances of unknown classification. The classification output attribute is discrete, unordered. From the technical implementation point of view, classification is by learning from existing datasets (training sets) to obtain an objective function f (model) that is used to map each set of attributes X onto a target attribute y (class), and y must be discrete.
For a narrow description of classification, the process of classification mainly comprises two steps: the first step is a model build phase, otherwise known as a model training phase; the second step is to perform a classification evaluation phase, or application (classification recognition) phase called model.
Based on analysis and understanding of classification concepts, as shown in fig. 3, the technical scheme of the invention discloses a classification model training method of an embodiment, which comprises the following steps:
step S01, positive sample data and first label-free data are obtained;
step S02, inputting positive sample data and first unlabeled data into a positive example and unlabeled sample learning model for classification processing, classifying from the first unlabeled data to obtain negative sample data and second unlabeled data, and obtaining first model parameters of the positive example and unlabeled sample learning model;
step S03, combining the positive sample data and the negative sample data to obtain a labeled training set, and inputting the labeled training set and second non-labeled data into a semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model;
and step S04, carrying out parameter optimization on the first model parameters according to the second model parameters to obtain updated first model parameters, and constructing a target classification model according to the updated first model parameters.
Steps S01 to S04 are described in detail below.
In step S01, the positive sample data and the first unlabeled data need to be collected and sorted. Wherein the content or form of the data mentioned in the embodiments should be unified, i.e. the data content (data form) includes but is not limited to forms of image data, audio data, text strings, etc. For various forms or types of data content, the data may be subjected to necessary preprocessing in the collection and sorting stage of the embodiment, for example, format normalization processing is performed on data of different sources of different channels, and for example, audio data with specific semantics is subjected to content extraction and converted into data content in a text format. More specifically, positive sample (positive sample) data in the embodiment is a target sample for detection, and is sample data conforming to expectations; for example, in the link of industrial quality inspection, a product passing quality inspection and qualified confirmation can be called a positive sample, and related description information (such as picture data, description text and the like) acquired based on the positive sample can be used as positive sample data; for example, in the implementation process of preference recommendation of the target object, the content information actively selected by the target object may be used as positive sample data. The first unlabeled data may refer to data content that is not labeled with any tag in the same scene, and in some possible implementations, (first) unlabeled data may refer to other unlabeled processed data content that remains after the labeling of the positive sample data in the same batch; for example, in the link of industrial quality inspection as well, sample data of all products in a certain product line is obtained as first non-tag data.
In an embodiment, the method may be a method of acquiring in real time, collecting the collected positive sample data and all original data (as first label-free data) of the same batch, and performing necessary preprocessing, as sample input in a subsequent model training process, or constructing to obtain a corresponding training data set. In other possible implementation scenarios, the positive sample data and the unlabeled data may be obtained from a database or other historical data record in a storage medium; integrating the data explicitly marked as positive samples in the historical data to form positive sample data; and integrating the data content which is not subjected to any label marking to obtain first label-free data.
Before describing the training process of the object classification model in this embodiment, it should be noted that the architecture of the object classification model in this embodiment mainly includes a classifier, i.e. a positive example and a non-labeled sample learning model, and a semi-supervised network model. The object classification model set constructed in the embodiment combines the advantages of the classification model and the semi-supervised network, firstly, the pseudo labels of the positive and negative samples can be obtained by selecting the samples through the classifier, then, the correction function of the semi-supervised network is utilized, the estimated deviation of the classifier in the classification process is corrected, and the accuracy of the final classification result is improved.
In step S02, the positive sample data and the first unlabeled data after the necessary preprocessing are input to the positive example and unlabeled sample learning model to realize training of the positive example and unlabeled sample learning model. In the training process of step S02, the positive example and the unlabeled exemplar learning model classify and predict the input positive exemplar data and the data without any label labeling, and perform preliminary classification on the data without any label labeling to obtain negative exemplar data (label labeling of the negative exemplar is given to the exemplar data) and the remaining unlabeled data which cannot be classified and predicted by the current stage model. In an embodiment, the positive example and the unlabeled sample learning model are mainly used for learning according to sample data which is already defined as a positive sample, classifying positive and negative samples of the sample data in the first unlabeled data by utilizing various characteristic information in the positive sample data, identifying and extracting the negative sample data in the sample, giving labels to the negative sample, and finally outputting all data carrying the negative sample labels to form the negative sample data. In addition, in the training process, the positive example and the unlabeled sample learning model cannot clearly identify the data sample which is determined to be the negative sample, any label is not given to the data sample, and the data sample is directly output to obtain second unlabeled data. In an implementation scene of industrial quality inspection, positive sample data of qualified leather products and a large amount of unlabeled data of leather products which are not subjected to quality inspection are obtained through a data acquisition stage, and the two types of data are used as training data and are input into a pre-constructed positive example and unlabeled sample learning model; in the training process of the model, the model can learn the characteristic information in the positive sample data, classify and identify negative samples possibly existing in the label-free data, assign labels of the negative samples to the data, and output and obtain the negative sample data. If the model cannot classify and identify whether the negative sample data is the negative sample data, any label or labeling process is not given to the negative sample data, and the negative sample data is directly output. The negative sample data output by the model in the training process can be leather products (corresponding images) containing certain flaws or defects, for example, products with obvious holes and wrinkles on the surface of the leather. The model can be judged whether to train to be optimal by setting a loss function by the positive example and the unlabeled sample learning model; for example, in an embodiment, parameters of the model may be adjusted during the repeated training of the model until the loss function converges; the optimal parameters of the model at the time of the loss function convergence may be used as the model parameters after the training is completed, and in the embodiment, the model parameters are denoted as first model parameters, and the model parameters include, but are not limited to, the number of layers, the hierarchy of hidden layers of the model, the weight of hidden layer nodes, and the like.
From the above description, it can be determined that the example and unlabeled exemplar learning model in the embodiments is essentially a Classifier (Classifier) implemented function; classification is an important implementation of data mining. The concept of classification is to learn a classification function or construct a classification model based on existing data, which can map data records in a database to one of the given classes, and thus can be applied to data prediction. In this embodiment, the pre-constructed positive example and unlabeled exemplar learning model may include, but is not limited to, decision trees, logistic regression, naive bayes, neural networks, and so on, algorithm tools, prior to the process of classifying and predicting (training) the first unlabeled data from the positive exemplar data.
In step S03, data integration is performed on the positive sample data obtained in step S01 and the negative sample data obtained by classification in step S02, so as to obtain a training set with a label; the labeled training set and the second non-labeled data directly output in the step S02 are input to a pre-constructed semi-supervised network model together; the semi-supervised network model is trained similar to step S02. In the training process, the semi-supervised network model learns according to positive samples and negative samples which are marked clearly by the labeled training set, classifies positive and negative samples of sample data in the second unlabeled data according to the characteristic information of the positive and negative samples, labels the positive and negative samples respectively, and finally, the classification is completed to obtain positive sample data number and negative sample data. The labeled training set is formed by integrating positive sample data and negative sample data. It is obvious that the elements in the training set are all sample data for explicitly labeling. By taking the industrial quality inspection process as an example, the initial unqualified product image is initially classified and identified by the classifier, and the image corresponding to the unqualified product and the product picture which cannot be distinguished are output. And combining the image corresponding to the unqualified product with the qualified product image to obtain a labeled training set, and training the semi-supervised network model through the labeled training set and the product picture which cannot be distinguished. In the training process, the semi-supervised network model learns the characteristic information of the positive sample and the characteristic information of the negative sample respectively, and based on the two characteristic information, further classifies and distinguishes the product pictures which cannot be distinguished, and classifies the positive and negative samples of the product images which are not distinguished in a label identification mode to finish classification of all the product images. Similarly, in the embodiment, in the process of repeatedly training the semi-supervised network model, parameters of the model can be adjusted until the loss function converges; the optimal parameters of the model when the loss function converges may be used as model parameters after training is completed, in this embodiment denoted as second model parameters. As with the first model parameters, the second model parameters may include, but are not limited to, the number of layers, the hierarchy of hidden layers of the model, the weights of hidden layer nodes, and so forth.
More specifically, the basic idea of the semi-supervised network model in the embodiment is to use a model hypothesis building learner on the data distribution to label the unlabeled data. Formalized description of the semi-supervised network model is: given a sample set s=lu from some unknown distribution, where L is the labeled training set l= { (x) 1 ,y 1 ),(x 2 ,y 2 ),…,(x |L| ,y |L| ) U characterizes the second unlabeled data U= { x in the embodiment c1 ,x c2 ,…x c|U| The expected function f can accurately predict its label y for sample x. Wherein x is i ,x ci All are d-dimensional vectors, y is the sample x i I L and i U are the magnitudes of L and U, respectively, i.e., the number of samples involved, semi-supervised learning is to find the optimal learner on the sample set S.
In step S04, the first model parameters obtained in step S02 are optimized and adjusted according to the second model parameters obtained in step S03, that is, the correction example and the unlabeled sample learning model are optimized and adjusted based on the optimized and adjusted first model parameters, so as to obtain the target classification model in implementation. The process of optimizing and adjusting in the embodiment can correspondingly modify and adjust the network hierarchy and the weights of the positive example and the unmarked sample learning model according to the network hierarchy of the semi-supervised network model and the weights of the semi-supervised network model, and the positive example and the unmarked sample learning model can directly obtain experience of learning of the semi-supervised network model by transferring parameters such as the hierarchy and the weights, so that classification accuracy is improved.
In some possible implementations, the PU classification algorithm model may be selected as the positive example and the unlabeled exemplar learning model in the examples. The PU classification algorithm model is mainly an algorithm for accurately identifying positive and negative samples in the data of a given part of positive samples and a large number of unlabeled samples. Further, as shown in fig. 4, in step S02 of the embodiment, the process of inputting the positive sample data and the first unlabeled data into the positive sample and unlabeled sample learning model to perform classification processing, classifying the first unlabeled data to obtain the negative sample data and the second unlabeled data, and obtaining the first model parameters of the positive sample and unlabeled sample learning model may include steps S021-S026:
s021, determining a first proportion of positive sample data in first label-free data;
s022, calculating a second proportion of negative sample data in the first label-free data according to a first proportion of the positive sample data in the first label-free data;
s023, calculating the prediction expectation of the positive sample data according to a preset substitution loss function and a first proportion;
s024, calculating the prediction expectation of the negative sample data according to a preset substitution loss function and a second proportion;
S025, calculating first model parameters of a positive example and a non-marked sample learning model according to the prediction expectation of the positive sample data and the prediction expectation of the negative sample data;
s026, based on the positive examples configured with the first model parameters and the unlabeled sample learning model, negative sample data and second unlabeled data are obtained by classification from the first unlabeled data.
In step S021, the ratio of the positive sample data to the unlabeled data acquired in the embodiment needs to be determined and recorded as a first ratio. By way of example, a data record of surface images of a large number of batches of 10-ten-thousand products is obtained in a production line of the products, a large number of unlabeled product images exist in the 10-ten-thousand products, and data images of 1-ten-thousand qualified products in a specific batch are also explicitly recorded in the data record; that is, in this scene, the surface image of 10 ten thousand products is taken as a label-free sample, the data image of a qualified product is taken as positive sample data, the duty ratio of the positive sample data in the label-free data is calculated to be 10%, and the first ratio is recorded.
In step S022, according to the mutually exclusive relationship between the positive sample and the negative sample, it can be assumed that sample data other than the positive sample among the unlabeled data can be regarded as negative sample data. In the example of step S021, the second proportion of negative sample data is easily obtained as 90%.
In step S023, by introducing a substitution loss function, a predicted expectation of positive sample data is obtained by calculating a product of the substitution loss function and the first scale. In the embodiment, since the objective function of the positive example and the unmarked sample learning model may have non-convex, discontinuous, poor mathematical properties and other functional characteristics, so that the optimization process of the objective function is complex, the embodiment needs to use other functions with better performance to replace, and the replacing function is a replacing loss function or a proxy loss function (surrogate loss function).
The division of positive and negative samples in the examples can be regarded as a binary classification problem, and training data obtained by performing necessary preprocessing on the positive and non-labeled data in the examples is denoted as { (X) 1 ,y 1 ),(X 2 ,y 2 ),…,(X n ,y n ) -wherein y i E {0,1}. In the embodiment, in order to quantitatively solve the quality of the model (positive example and unlabeled sample learning) of the binary classification problem, the quality needs to be measured through a loss function; the smaller the loss function, the better the model will work. For example, the positive and unlabeled exemplar learning models in an embodiment may employ zero-loss functions
Wherein, the liquid crystal display device comprises a liquid crystal display device,for the output of the model, m=1, 2, …, n, for the loss function i, the objective is to find an optimal classification model h that minimizes the expected loss of this classification model on the test samples of the training data, expressed mathematically as:
in theory, the embodiment can directly optimize the above formula to obtain the optimal classification model h as a positive example and a non-marking sample learning model. However, in practice, this optimization is very difficult, one of which is that the calculation of the expectation of the loss function is not feasible because the probability distribution of X y is unknown; secondly, this expected value is difficult to optimise, since the loss function is discontinuous. Thus, the embodiment uses a function that approximates zero-one loss as a proxy for zero-one loss; this proxy is called the proxy loss function.
In step S024, similarly to step S023, by introducing a substitution loss function, a predicted expectation of negative-sample data is obtained by calculating the product of the substitution loss function and the second ratio.
In step S025, on the basis of the prediction expectations of the positive and negative samples that have been calculated in steps S023 and S024, respectively, optimization processing is performed on the classification model constructed in advance, and after the model parameters after optimization are obtained, that is, the first model parameters of the learning model of the positive example and the unlabeled sample in the embodiment are constructed based on the first model parameters.
It should be noted that, in the embodiment, the initially constructed classification model may be trained by a loop iteration manner, and data that has been identified by classification and marked as a positive sample or a negative sample in the training process may be input again as training data into the model for learning, where a candidate classification model is obtained in each loop, and all obtained candidate classification models are integrated to obtain a model set. Based on loop iteration and model set construction, the process of determining the first model parameters and further constructing the learning model of the positive example and the unlabeled sample in the embodiment can be regarded as the process of optimal model selection. The embodiment selects an optimal classification model from classification models generated in each cycle according to a preset selection strategy. The main criteria for selecting the policy may include the following:
1) Prediction error lift difference
The goal of the training must be to minimize the prediction error of the model, thus, when the prediction error rise difference is less than 0, it is stated that the error of the previous round i to i-1 model starts to rise. The embodiment selects the i-1 round training model as the positive and unlabeled exemplar learning model.
2) F1 value lifting ratio
Model performance is illustrated as being improved when the F1 value improvement ratio > 1. Thus, the embodiment selects the last lifted model as the positive example and unlabeled exemplar learning model.
3) Voting (Vote)
And carrying out weighted combination on model models generated in each round of iteration to form a final model serving as a positive example and a label-free sample learning model.
4) Finally (Last)
And directly selecting the classification model generated in the last iteration as a positive example and a non-marked sample learning model.
In step S026, a positive example and a label-free sample learning model after the final training is completed are determined according to the first model parameters determined in step S025, and based on this model, classification prediction can be performed on the positive sample data and label-free data that are initially acquired, and the negative sample data and the remaining label-free data obtained by the classification prediction are used as inputs of the non-supervision network to perform subsequent model training processing.
In some possible implementations, the step S025 in the example calculates the first model parameters of the learning model of the positive example and the unlabeled example according to the predicted desire of the positive sample data and the predicted desire of the negative sample data, and may include steps S0251-S0252:
S0251, calculating a first product between the first proportion and the predicted expectation of the positive sample data, calculating a second product between the second proportion and the predicted expectation of the negative sample data, and obtaining a minimum value of the sum of the first product and the second product;
s0252, performing anti-overfitting processing on the minimum value to obtain first model parameters of the positive example and the unmarked sample learning model.
In step S0251, illustratively, the known portion of positive sample data that has been acquired in the embodimentA large number of unlabeled data +.>Where X is input data, Y is a tag, and Y ε { + -1 }. In addition, the proportion of positive sample data in unlabeled data is pi p Wherein p represents positive sample data; the proportion of negative samples in unlabeled data is pi n =1-π p N represents negative sample data. The embodiment needs to obtain a classification model g through training, and can correctly identify the positive sample and the negative sample.
In the embodiment, when an initial classification model is constructed, a PU classification network is adopted as a model architecture base, and the optimization process for the classification model g can be expressed as the following calculation formula:
wherein, the liquid crystal display device comprises a liquid crystal display device,l is the substitution loss function described previously.
However, there is a possibility that training data is insufficient when training the classification model g, that is, the training data cannot estimate the distribution of the entire data, or that over fitting (overfitting) of the model is often caused when over training the classification model g (overstraining). That is, as the training of the classification model g proceeds, the complexity of the model increases, and at this time, the training error of the model on the training data set gradually decreases, but when the complexity of the model reaches a certain level, the error of the model on the verification set increases as the complexity of the model increases. At this point, overfitting occurs, i.e., the complexity of the model increases, but the model does not exhibit a significant increase in performance or accuracy of the model over data sets other than the training set.
Therefore, in step S0252, the following is based onAnd in order to preventResulting in g * Is overfitted so g in step S0252 * The calculation formula of (2) is rewritten as:
finally, the embodiment can be based on g after overwriting * And determining optimal parameters of the positive example and the unlabeled sample learning model by a calculation formula, and constructing an optimal classification model.
It should be noted that, the specific process of rewriting the above formula for over-fitting is only one possible implementation manner of overcoming the over-fitting problem in the technical solution of the present invention, and in addition, the embodiment may be further described by, for example: methods such as early stopping, data enhancement (Data augmentation), regularization (Regularization), dropout and the like are used for solving the over-fitting phenomenon in the model training process. The specific solution of the overfitting is not limited in the examples.
In the implementation process of the embodiment, it is difficult to ensure that sufficient data can be used as support for training tasks in the preliminary training process of the model, so that in order to achieve a better training effect, the embodiment can fully utilize the existing data to perform data enhancement. Further, the process of combining the positive sample data and the negative sample data to obtain the labeled training set in step S03 in the embodiment may include steps S031-S032:
S031, performing data enhancement processing on the negative sample data to obtain new negative sample data;
s032, combining the positive sample data and the new negative sample data to obtain a labeled training set.
In step S031, the negative sample data obtained by the positive example and the unlabeled exemplar learning model output is caused to generate a value equivalent to more data without substantially increasing the data by means of data enhancement or data augmentation. The data enhancement mode may include a single sample data enhancement mode and a multiple sample data enhancement mode. Further, single sample data enhancement, i.e., when one sample is enhanced, all operations are performed around the sample itself, including geometric transformation classes, color transformation classes, etc.; unlike single sample data enhancement, multiple sample data enhancement methods utilize multiple samples to generate new samples.
Illustratively, in one possible implementation scenario, where pedestrians in the video frames need to be identified, a classifier is trained through the foregoing embodiment steps, and the classifier can classify the video frames of multiple frames to obtain negative sample data that does not include pedestrians; for the obtained negative sample data, the embodiment can perform data enhancement on the negative sample data in a SMOTE mode. In particular SMOTE, a synthetic minority oversampling technique (Synt hetic Minority Over-sampling Technique) to handle sample imbalance problems by artificially synthesizing new samples, thereby improving classifier performance. The SMOTE method is a multi-sample data enhancement method based on interpolation, which can synthesize new samples for small sample classes. In this implementation scenario, a small sample may refer to a captured video frame with a pedestrian, and a large sample may refer to a large number of video frames without identifying the pedestrian. First, an embodiment needs to define a feature space, and each video picture sample without pedestrians is corresponding to a certain point in the feature space, and a sampling multiplying power N is determined according to the unbalanced proportion of the samples. Further, for each small sample class sample (x, y), finding K nearest neighbor samples according to euclidean distance, randomly selecting a sample point from the K nearest neighbor samples, assuming that the selected nearest neighbor point is (x n ,y n ). Randomly selecting a point on a connecting line segment of a sample point and a nearest neighbor sample point in the feature space as a new sample point, and meeting the following formula:
(x new ,y new )=(x,y)+rand(0-1)*(x n -x),(y n -y))
wherein, (x) new ,y new ) Representing sample data after the data enhancement process. The above process is repeated until the large and small sample numbers are balanced. The data enhancement by SMOTE is a process of continuously fitting discrete sample points to a true sample distribution, but the added sample points remain within the region enclosed by the known small sample points in the feature space. In some other embodiments, the data enhancement effect can be better achieved by properly interpolating the sample set obtained by expanding the collection range of the sample beyond the given range.
In step S032, the negative sample data after data enhancement and the positive sample data acquired in step S01 are integrated to obtain a training data set of the semi-supervised network model. The sample data contained in the training data set are positive sample data or negative sample data after label marking, so the training data set is also marked as a labeled training set. It should be noted that, in the foregoing embodiments, the data enhancement is performed on the negative sample data, and in some necessary scenarios, there may be a scarcity of the positive sample data, and then the data enhancement processing needs to be performed on the obtained positive sample data, and the process is the same as the process of the negative sample data enhancement, which is not described herein.
In some possible implementations, in the data enhancement process in step S031, the embodiment method may use a data enhancement method of MixUp to improve generalization ability and robustness of the model. Further, as shown in fig. 5, step S031 may include steps S0311-S0315:
s0311, obtaining random values obeying beta distribution;
s0312, obtaining sample values of any two samples from negative sample data and tag values;
S0313, calculating a new sample value of a new sample according to the random value and the sample values of the two samples, and calculating a new label value of the new sample according to the random value and the label values of the two samples;
s0314, constructing a new sample according to the new sample value and the new tag value;
s0315, summarizing each new sample to obtain new negative sample data.
In step S0311, the beta distribution (Beta Distribution) employed is a density function that is a conjugate a priori distribution of the bernoulli distribution and the binomial distribution; the beta distribution can be described as a set of consecutive probability distributions defined in the (0, 1) interval. In particular, in an embodiment, the process of obtaining the random value obeying the beta distribution may be described by the following calculation formula:
x~Beta(a,b)
it can be known from the calculation formula that the random value in the embodiment is determined by two parameters (a, b), which are called shape parameters.
In step S0312, a classifier g is constructed by the principle of the PU classification model set forth in the foregoing embodiment step. The unlabeled training data D can be processed by the classifier g u Classifying intoAnd->Two classes, D u For the original all unlabeled data, +.>Representing unlabeled data left after data filtering. Wherein (1) >The sample that the classifier g deems to be a negative sample (with higher confidence) is collected and given a label of the negative sample. Examples from->Is extracted from (x) i ,y i ) And (x) j ,y j ) Two sample data, and tag information assigned by the classifier is acquired simultaneously.
In step S0313, as shown in FIG. 6, the method described aboveIs extracted to obtain any two sample data (x i ,y i ) And (x) j ,y j ) And performing fusion operation every two. The fusing operation may be to perform linear transformation according to the random value obtained in step S0311 to obtain new sample data, and perform the fusing operation according to the new sample data to obtain a new sample value; similarly, the tag values of the two sample data are similarly linearly changed to obtain new tag values. In particular, in an embodiment, the process of the fusion operation may be described by the following calculation formula:
x′=βx i +(1-β)x j
y′=βy i +(1-β)y j
where β is a random value following the beta (β) distribution and (x ', y') is the result after fusion.
Illustratively, in one possible implementation, the obtainedThe random value following the beta distribution was 0.75, and a (x A ,y B ) And B (x) B ,y B ) And performing fusion operation to obtain new sample data and labels, wherein the new sample value and label value have the following calculation formulas:
x =0.75x A +0.25x B
y′=0.75y i +0.25y j
In step S0314, the new sample value calculated in step S0313 and the new tag value are correlated according to the correspondence relationship to obtain new sample data. It should be noted that, in the sample data of the initial embodiment, i.e. the sample data before the MixUp step is performed, the tag value should be strictly follow the binary distribution, i.e. y i E {0,1}; that is, before the fusion process, the tag value of the sample data is only 0 or 1 (no tag data has no tag value or the tag value is null). However, in the fusion process, the coefficients of the linear transformation are random values which obey the beta distribution; thus, there may be cases where the calculated tag value of the new sample is not an integer, or is not 0 or 1. For this case, the embodiment may normalize the calculated new tag value and newly assign a 1 value or a 0 value according to the tag value from distances of 0 and 1 on the number axis. For example, in one possible embodiment, the calculated new tag value is 0.85, which is significantly less distant from point 1 than from point 0 on the number axis, and therefore, the new tag value is reassigned to 1.
In step S0315, a new number of data samples may be calculated in step S0313 and step S0314, and the new sample data set may be obtained by integrating the number of data samples. Wherein, since the MixUp processing of the sample data is performed in step S0313, the embodiment integrates or adds the sample data with the label of negative sample (the label value is 0) after the MixUp to the negative sample data; sample data with a label of positive samples (label value of 1) after MixUp is integrated or added to the positive sample data set.
The method comprises the steps that negative sample data are obtained after primary classification, data enhancement processing is carried out on the negative sample data, the negative sample data are subjected to data fusion with positive sample data obtained in advance, the fused data sample is used as training data of a semi-supervised network model, and the semi-supervised network model in the target classification model of the embodiment is trained; further, as shown in fig. 7, in step S03 of the embodiment, the process of inputting the labeled training set and the second unlabeled data into the semi-supervised network model to perform classification processing to obtain the second model parameters of the semi-supervised network model may include steps S033-S035:
s033, inputting the labeled training set and the second unlabeled data as the training set into a MixMatch semi-supervised network model;
s034, constructing a target loss function according to the cross entropy loss function and the L2 loss function;
and S035, training the MixMatch semi-supervised network model by taking the target loss function as a target to obtain a second model parameter.
In step S033, the label training set including the positive and negative samples and the second unlabeled data which fails to be given with the label data in the training process of the positive and unlabeled sample learning model are synchronously input to the pre-built MixMatch semi-supervised network model, and then the MixMatch semi-supervised network model is started. More specifically, in the embodiment, positive and negative sample data with labels and a large amount of non-label data have been obtained, and a classifier (classification model) f is obtained through training, so that positive and negative samples can be further identified correctly. In the embodiment, a MixMatch semi-supervised network model is adopted, and the formulation of the model is described as follows:
L′,U′=MixMatch(L,U)
Wherein, L, U respectively represent marked (positive and negative sample) data and unmarked (unlabeled) data, and L ', U' are fused data.
It should be noted that, the semi-supervised learning method proposed in the related technical scheme makes the model have better generalization capability by adding a loss term to the unlabeled data; the loss term typically comprises the following three types:
1. entropy minimization (entropy minimization) encourages models to output high confidence predictions on unlabeled data;
2. a consistency constraint (consistency regularization) encouraging the model to output the same probability distribution after the data has been perturbed;
3. generic regularization (generic regularization) encourages better generalization and reduces overfitting.
In the embodiment, the MixMatch semi-supervised network model is used for achieving a good effect by fusing the three loss items into one loss.
Illustratively, in the process of implementing prediction by the MixMatch semi-supervised network model in the embodiment, first, data augmentation is performed on positive and negative sample (tagged) data and unlabeled data of the input model. The model is only augmented once for tagged data, and the tag remains unchanged. And (3) carrying out K times of random augmentation (K is a super parameter) on unlabeled data, inputting the unlabeled data into a classification module (classifier) in a classification model to obtain average classification probability, and applying a temperature Sharpen algorithm to obtain a predictive label of unlabeled data. At this time, the amplified tagged data has one data set, the amplified untagged data may have K data sets, the two data sets are mixed (MixUp), and random rearrangement is performed to obtain a mixed data set, and finally the data content output by the MixMatch supervision network model is the data set of the tagged data obtained by MixUp of the amplified untagged data and the mixed data set, and the data set of the K untagged amplified data obtained by MixUp of the amplified untagged data and the mixed data set.
In step S034, according to the description in step S033, the loss function of the MixMatch supervision network model in the embodiment should include the loss term of the augmented tagged data and the loss term of the non-tagged augmented data, i.e. the loss values of the MixMatch supervision network model are summed according to the two loss terms. In some possible implementations, the cross entropy loss function is selected to calculate a loss term for the augmented tagged data; the loss term for the L2 loss function calculation of the unlabeled augmented data, i.e., the loss function for MixMatch in the example, is shown below:
wherein, the liquid crystal display device comprises a liquid crystal display device,represents the loss value of MixMatch, +.>In order for the cross-entropy loss to occur, for L2 loss, H is cross entropy, and C is the number of categories. f (x) represents the classification result obtained by the semi-supervised network classifier.
In step S035, according to the loss function constructed in step S034, calculating in real time a loss value between the classification prediction result output by the MixMatch semi-supervised network model and the input sample data, and continuously updating and adjusting model parameters of the MixMatch semi-supervised network model according to the loss value, wherein the parameters include, but are not limited to, the number of layers of hidden layers of the model, weights of each hidden layer, and the like; and (3) until the loss value is converged or a loss value minimum value is obtained, taking the current model parameter corresponding to the loss value as the optimal model parameter, namely determining a second model parameter.
In some possible embodiments, step S04 in the example method, the process of performing parameter optimization on the first model parameter according to the second model parameter to obtain an updated first model parameter may include steps S041-S042:
s041, obtaining a weighting weight;
s042, according to the weighted weight, the first model parameter and the second model parameter are weighted and summed to obtain the updated first model parameter.
In step S041, the concept of the technical scheme of the invention is to correct the estimation deviation problem existing in the classification model by using the correction function of the semi-supervised network, so as to improve the overall classification accuracy. Based on this concept, the embodiment needs to perform model weight migration after training of the classification model and the semi-supervised network model, and the weight migration process is to perform weighted summation on the weight of the classification model g and the weight of the semi-supervised network model f, so before performing weighted summation, the weight λ of the classification model g needs to be acquired, and correspondingly, the weight of the semi-supervised network model f in the embodiment is (1- λ).
In step S042, taking the PU classification model as an example, the weight of the PU classification model g and the weight of the semi-supervised network f are weighted and summed, where the weight of the classification model g obtained by training the PU framework is denoted as the weight λ, and the process of model weight migration in the embodiment may be expressed as follows:
And the weight of f is transferred to g, so that g can obtain experience of semi-supervised network learning, and classification accuracy is improved. Where e represents the number of epochs trained, and one epoch represents all data trained once. It should be noted that, in the embodiment of the present invention, the weights of the PU classification model and the semi-supervised network model are essentially a collective term for the related model parameter sets of the two models, and the specific content is determined according to the parameter content of the model, which refers to not only one numerical value.
In some possible implementations, the method for training a classification model provided in the embodiment may further include step S05, performing model distillation on the target classification model to obtain a compressed target classification model.
In an embodiment, training may be performed according to the process of steps S01-S04 in the embodiment to obtain a teacher (teacher) model, then the embodiment reconstructs a small-scale student (student) model, then fixes the weight parameters of the teacher model, and then designs a series of loss values, so that the student model gradually approaches to the performance characteristics of the teacher model in the process of distillation learning, and the prediction accuracy of the student model gradually approaches to the teacher model, so as to obtain a final target classification model.
The following describes the whole implementation process of the classification model training method provided by the technical scheme of the invention with reference to the attached drawings:
referring to fig. 8 of the specification, taking a training process of a product qualification judging model for product quality inspection as an example, the technical concept provided by the embodiment is that the advantages of a PU (polyurethane) classifying network and a semi-supervised classifying network are utilized, and the PU classifying network is utilized to select samples with more products so as to obtain pseudo labels of positive and negative samples; the positive sample is a qualified product in a product production line, and the negative sample is a disqualified product. Then, through the correction function of the semi-supervised network, the estimation deviation problem existing in the PU classification network is corrected, so that the overall classification accuracy is improved. In the training process of the embodiment, only the pseudo negative label output by the PU classification network is needed to be used for iterative training, and in the subsequent process of judging whether the product is qualified by using the product qualification judging model, the positive and negative results of identification confirmation can be obtained through the PU network.
According to the technical conception, the implementation process of the product qualification judging model in the embodiment mainly comprises two links of data screening correction and model weight migration.
In the data screening and correcting link, the method mainly comprises three steps:
step a, firstly, optimizing the existing PU classification network to obtain an optimized classifier g, wherein the function of the classifier g is expressed as follows:
through g, the unlabeled training data D can be subjected to u Classifying intoAnd->Two classes, D u For the original all unlabeled data, +.>Representing unlabeled data left after data screening,/->The sample that the classifier g deems to be a negative sample (with higher confidence) is collected and given a label of the negative sample.
Step b, obtaining a training set with a negative sample label after data enhancement through data fusion of MixUpWherein the process of MixUp is only required for +.>The fusion operation is performed by two arbitrary two samples, more specifically, the function of the fusion operation process in the embodiment is expressed as follows:
x′=βx i +(1-β)x j
y′=βy i +(1-β)y j
wherein beta is a random value following beta distribution, (x) i ,y i ) And (x) j ,y j ) Is thatIs a sample of (x) and its label, (x) ,y ) Is the result after fusion.
Step c, the original positive sample training set D p Andconstitute labeled training set D l ', will follow D u Label-free dataset stripped out +.>Seen as a new unlabeled training set D u '. Will D l ' and D u ' as training set, the training is carried out by adding into the semi-supervised network MixMatch network. The training process is as follows: for D l Performing supervised learning training on D u L2 penalty training is performed and the final constructed penalty function +.>The following are provided:
where H is the cross entropy loss.
In the link of model weight migration, the weight of the PU classification network g and the weight of the semi-supervised network f are weighted and summed, wherein the weight is obtained by training a framework of the PU classification network, in the embodiment, the weight is marked as lambda, and the formula of model weight migration is described as follows:
according to the embodiment, the weight of f is transferred to g, so that g can obtain experience of semi-supervised network learning, and classification accuracy is improved. It should be noted that, in the embodiment, the weights (g and f) of the PU classification network and the semi-supervised network model are essentially a generic term of the related model parameter sets for the two models, and the specific content is determined according to the parameter content of the models, and is not only a numerical value. In addition, the mark for ending the training of the product qualification judgment model in the embodiment is whether the number of times of the cyclic training reaches the preset number of times of the training, and the training is stopped after the number of times of the training is reached.
The final trained product qualification judgment model in the embodiment screens out defective samples under the condition of only providing positive samples in an industrial quality inspection scene; in addition, a semi-supervised network MixMatch is added to the training framework for the product qualification judging model, the classification result of the PU network is corrected by the semi-supervised network, and meanwhile, the characteristic generalization is enhanced by a fusion method of pictures MixUp, so that the accuracy of defect identification is improved; and the product qualification judging model provides a classifier weight migration mechanism in the training process, and the weights in the semi-supervised network classifier are migrated to the PU network, so that the convergence speed of the PU network classification accuracy is improved, and the accurate final classification model can be obtained more quickly.
In the scene of quality inspection of industrial products, for example, for identification of leather defects, under the condition that only normal samples and yield of a production line can be provided, leather imaging pictures can be directly input into the product qualification judging model, and whether leather products corresponding to the pictures have defects or not is determined through an automatic quality inspection process.
It can be understood that, besides the implementation scenario of industrial quality inspection introduced above, the classification model training method and the classification model obtained by training provided by the technical scheme of the invention can also be applied to the deriving fields of various artificial intelligence or machine learning such as user identification, intelligent recommendation and the like, and the applicable technical field and implementation scenario are not particularly limited by the embodiment of the invention.
On the basis of providing a classification model training method according to the technical scheme of the present invention, as shown in fig. 9, the implementation of the present invention may further provide a defect identification method, which may include steps Q01-Q02:
q01, acquiring data of an object to be identified;
q02, classifying and identifying the object data to be identified according to the target classification model, and determining that the object to be identified is a defect object or a qualified object;
the target classification model may be obtained by training according to the classification model training method described in the foregoing embodiment steps S01-S04, and will not be described herein.
In the field of intelligent traffic, taking the recognition of pedestrians in a real-time traffic video frame as an example, the embodiment needs to be trained to obtain a pedestrian recognition model, and whether pedestrians exist in the video frame can be recognized through the pedestrian recognition model. Because of complicated attributes such as the stature, sex, dressing, carried articles, motion states and the like of pedestrians, it is difficult to provide all training samples containing various attributes and various states of pedestrians for a pedestrian recognition model; therefore, in the embodiment, the pedestrian recognition model needs to be trained by a limited video frame without pedestrians and a large number of video frames without marks (whether pedestrians exist) as training data.
More specifically, the pedestrian recognition model constructed in the embodiment may be composed of a classifier and a semi-supervised network; in the training process of the pedestrian recognition model, the obtained video picture without pedestrians is used as positive sample data, the video picture without marks (whether pedestrians exist) is used as non-tag data, the non-tag data are input into a classifier together, preliminary classification training is carried out, the non-tag data can be roughly classified and recognized through training of the classifier, and the video picture with the pedestrians possibly existing in the non-tag data is obtained to be used as negative sample data; and determining classifier model parameters after training is completed while acquiring negative sample data. And then, carrying out data enhancement on the video picture suspected to have pedestrians in the negative sample data. And inputting the video pictures with the data enhanced and suspected pedestrians and the video pictures without pedestrians to a semi-supervised network together for learning to obtain model parameters of the semi-supervised network. And on the basis of training to obtain the classifier and the semi-supervised network, the classifier and the semi-supervised network are subjected to weight migration of model parameters, so that the classifier can obtain experience of semi-supervised network learning, and the accuracy of a final classification result is improved. Finally, the pedestrian recognition model after training is obtained until the loss value of the pedestrian recognition model is converged.
In the application stage of the model, the collected traffic video frames can be directly decomposed frame by frame, the decomposed image frames are input into the pedestrian recognition model, whether pedestrians exist in the current image frames or not is judged through the model, and the judgment result is visually output.
Description of the apparatus, system and device of embodiments of the invention:
in one aspect, referring to fig. 10, an embodiment of the present invention provides a classification model training apparatus, including:
a first module 1001, configured to obtain positive sample data and first label-free data;
a second module 1002, configured to input positive sample data and first unlabeled data into a positive example and unlabeled sample learning model to perform classification processing, classify the positive sample data and the first unlabeled data to obtain negative sample data and second unlabeled data, and obtain first model parameters of the positive example and the unlabeled sample learning model;
a third module 1003, configured to combine the positive sample data and the negative sample data to obtain a labeled training set, and input the labeled training set and the second non-labeled data into the semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model;
a fourth module 1004 is configured to perform parameter optimization on the first model parameter according to the second model parameter, obtain an updated first model parameter, and construct a target classification model according to the updated first model parameter.
The specific implementation process of the classification model training device in the embodiment is described below with reference to fig. 10 of the specification:
in particular, in an embodiment, the first module 1001 needs to collect and sort the positive sample data and the first untagged data. Positive sample data in the embodiment is a detected target sample, and is sample data conforming to expectations; the first untagged data may refer to data content that is not tagged with any tag in the same scene, corresponding to positive sample data. In an embodiment, the first module 1001 may aggregate and pre-process the collected positive sample data and all the original data of the same batch (as the first label-free data) in a real-time acquisition manner, and use the collected positive sample data and all the original data as a sample input or a corresponding training data set obtained by construction in a subsequent model training process. The positive sample data and the first unlabeled data after the necessary preprocessing are then input to the positive example and unlabeled sample learning model by the second module 1002 to enable training of the positive example and unlabeled sample learning model. In the training process, the positive example and the unlabeled sample learning model conduct classification prediction according to the input positive sample data and the data which is not labeled by any label, and the data which is not labeled by any label is primarily classified to obtain negative sample data and other residual unlabeled data which cannot be classified and predicted by the model in the current stage. Then, the third module 1003 performs data integration on the obtained positive sample data and the negative sample data obtained by classification to obtain a labeled training set; and the labeled training set and the directly output second unlabeled data are input to a pre-constructed semi-supervised network model together, and the semi-supervised network model is trained. In the training process, the semi-supervised network model learns according to positive samples and negative samples which are marked clearly by the labeled training set, classifies positive and negative samples of sample data in the second unlabeled data according to the characteristic information of the positive and negative samples, labels the positive and negative samples respectively, and finally, the classification is completed to obtain positive sample data number and negative sample data. Finally, the fourth module 1004 performs optimization adjustment on the parameters of the obtained second model parameters to obtain the first model parameters, and performs optimization adjustment on the correction example and the unmarked sample learning model based on the optimized and adjusted first model parameters, so as to obtain the target classification model in implementation.
According to the model training device provided by the embodiment of the invention, the classification results of the normal example and the unmarked sample learning model can be corrected through training of the semi-supervised network model, so that the accuracy of classification recognition is improved; according to the embodiment, the target classification model can be obtained through final training by the device, the classification type corresponding to the data to be identified can be output only by inputting positive sample data and label-free data, and the target classification model is fused with the learning training result of the semi-supervised network model on the negative sample data, so that the classification accuracy of the target classification model can be improved, and the convergence rate of the target classification model is increased.
In another aspect, an embodiment of the present invention further provides a defect identifying device, where the device includes:
a fifth module for acquiring the data of the object to be identified;
the sixth module is used for classifying and identifying the object data to be identified according to the target classification model, and determining that the object to be identified is a defect object or a qualified object;
the target classification model is determined according to the classification model training device shown in fig. 10, and the specific training process of the device is described in the foregoing specific implementation process, which is not described herein.
On the other hand, referring to fig. 11, an embodiment of the present application further provides a defect identifying system, including:
the product imaging module is used for acquiring image data of a target product;
the defect identification module is used for carrying out defect identification on the image data of the target product through the target classification model and determining defect information of the target product;
and the defect registration module is used for carrying out defect registration on the target product according to the defect information of the target product.
In the embodiment, taking the scene that the artificial intelligent product outputs service to the service party as an example, in the embodiment, a defect identification module is integrated in background service of a technical service provider in actual service use, an upstream module of the defect identification module comprises a product imaging module, a defect registration module and the like, and a downstream module of the defect identification module comprises a database module, a data analysis statistics module and the like; the object classification model in the defect recognition module may be obtained by training according to the classification model training method provided in the foregoing embodiment, and will not be described herein.
The embodiment of the application also provides electronic equipment, which comprises a processor and a memory;
the memory stores a program;
The processor executes a program to perform the classification model training method or the defect recognition method as provided in the foregoing respective embodiments.
The electronic device has a function of carrying and running software for data processing provided in the embodiment of the present application, for example, a personal computer (Personal Computer, PC), a mobile phone, a smart phone, a personal digital assistant (Personal Digital Assistant, PDA), a wearable device, a palm computer PPC (Pocket PC), a tablet computer, etc., referring to fig. 12, in the embodiment of the present application, a terminal device is taken as an example of the mobile phone:
fig. 12 is a block diagram showing a part of the structure of a mobile phone related to a terminal device provided by an embodiment of the present application. Referring to fig. 12, the mobile phone includes: radio Frequency (RF) circuitry 1210, memory 1220, input unit 1230, display unit 1240, sensor 1250, audio circuitry 1260, wireless fidelity (wireless fidelity, wiFi) module 1270, processor 1280, power supply 1290, and the like. Those skilled in the art will appreciate that the handset configuration shown in fig. 11 is not limiting of the handset and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
Embodiments of the present invention also disclose a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read from a computer-readable storage medium by a processor of a computer device, and executed by the processor, to cause the computer device to perform the method shown in fig. 1.
Compared with the PU learning method provided in the related technical scheme, the PU learning method provided by the invention always worsens the learning method of other unmarked samples, and the technical scheme provided by the invention has the following technical advantages:
1. according to the technical scheme, the traditional PU classification network label-free training data is utilized for screening, a part of samples are marked with negative-sample pseudo labels and are subjected to data enhancement, and the recombined data is corrected through semi-supervised network training, so that the final classification recognition (prediction) result is more accurate.
2. According to the technical scheme, parameters of the semi-supervised network are migrated to the PU network, so that accuracy of classification results of the PU network is further improved.
3. According to the technical scheme, the target classification model can be finally obtained by training, the classification type corresponding to the data to be identified can be output only by inputting the positive sample data and the label-free data, and the target classification model is fused with the learning training result of the semi-supervised network model on the negative sample data, so that the classification accuracy of the target classification model can be improved, and the convergence rate of the target classification model is accelerated.
In some alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flowcharts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed, and in which sub-operations described as part of a larger operation are performed independently.
Furthermore, while the invention is described in the context of functional modules, it should be appreciated that, unless otherwise indicated, one or more of the described functions and/or features may be integrated in a single physical device and/or software module or one or more functions and/or features may be implemented in separate physical devices or software modules. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary to an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be apparent to those skilled in the art from consideration of their attributes, functions and internal relationships. Accordingly, one of ordinary skill in the art can implement the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative and are not intended to be limiting upon the scope of the invention, which is to be defined in the appended claims and their full scope of equivalents.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the application, the scope of which is defined by the claims and their equivalents.
While the preferred embodiment of the present application has been described in detail, the present application is not limited to the embodiments described above, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present application, and these equivalent modifications or substitutions are included in the scope of the present application as defined in the appended claims.

Claims (15)

1. A method of training a classification model, comprising:
acquiring positive sample data and first label-free data;
inputting the positive sample data and the first unlabeled data into a positive example and a unlabeled sample learning model for classification processing, classifying from the first unlabeled data to obtain negative sample data and second unlabeled data, and obtaining first model parameters of the positive example and the unlabeled sample learning model;
combining the positive sample data and the negative sample data to obtain a labeled training set, and inputting the labeled training set and the second non-labeled data into a semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model;
and carrying out parameter optimization on the first model parameters according to the second model parameters to obtain updated first model parameters, and constructing a target classification model according to the updated first model parameters.
2. The method according to claim 1, wherein the step of inputting the positive sample data and the first unlabeled data into the positive sample and unlabeled sample learning model to perform classification processing, and classifying the first unlabeled data to obtain negative sample data and second unlabeled data, and obtaining first model parameters of the positive sample and unlabeled sample learning model includes:
Determining a first proportion of the positive sample data in the first unlabeled data;
calculating a second proportion of negative sample data in the first non-tag data according to a first proportion of the positive sample data in the first non-tag data;
calculating the prediction expectation of the positive sample data according to a preset substitution loss function and the first proportion;
calculating a predicted expectation of the negative sample data according to a preset substitution loss function and the second proportion;
calculating first model parameters of the positive example and the unlabeled sample learning model according to the predicted expectation of the positive sample data and the predicted expectation of the negative sample data;
and classifying the first unlabeled data to obtain negative sample data and second unlabeled data based on the positive examples and unlabeled sample learning models with the configured first model parameters.
3. The method according to claim 2, wherein the calculating the first model parameters of the positive example and the unlabeled exemplar learning model based on the predicted expectation of the positive exemplar data and the predicted expectation of the negative exemplar data includes:
calculating a first product between the first proportion and the predicted expectation of the positive sample data, calculating a second product between the second proportion and the predicted expectation of the negative sample data, and obtaining a minimum value of the sum of the first product and the second product;
And performing anti-overfitting processing on the minimum value to obtain first model parameters of the positive example and unmarked sample learning model.
4. The method of claim 1, wherein said combining said positive sample data and said negative sample data to obtain a labeled training set comprises:
performing data enhancement processing on the negative sample data to obtain new negative sample data;
combining the positive sample data and the new negative sample data to obtain the labeled training set.
5. The method of claim 4, wherein the performing data enhancement processing on the negative sample data to obtain new negative sample data comprises:
obtaining random values obeying beta distribution;
acquiring sample values of any two samples and tag values from the negative sample data;
calculating a new sample value of a new sample according to the random value and the sample values of the two samples, and calculating a new label value of the new sample according to the random value and the label values of the two samples;
constructing a new sample according to the new sample value and the new label value;
and summarizing each new sample to obtain the new negative sample data.
6. The method for training a classification model according to claim 1, wherein the step of inputting the labeled training set and the second unlabeled data into a semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model comprises:
inputting the labeled training set and the second unlabeled data as training sets into a MixMatch semi-supervised network model;
constructing a target loss function according to the cross entropy loss function and the L2 loss function;
and training the MixMatch semi-supervised network model by taking the target loss function as a target to obtain the second model parameters.
7. The method of claim 1, wherein the performing parameter optimization on the first model parameters according to the second model parameters to obtain updated first model parameters comprises:
acquiring a weighting weight;
and carrying out weighted summation on the first model parameter and the second model parameter according to the weighted weight to obtain an updated first model parameter.
8. A classification model training method according to any of claims 1-7, characterized in that the method further comprises:
And performing model distillation on the target classification model to obtain a compressed target classification model.
9. A defect identification method, comprising:
acquiring object data to be identified;
classifying and identifying the object data to be identified according to a target classification model, and determining that the object to be identified is a defect object or a qualified object;
wherein the object classification model is determined according to the classification model training method of any of claims 1-8.
10. A classification model training apparatus, comprising:
the first module is used for acquiring positive sample data and first label-free data;
the second module is used for inputting the positive sample data and the first unlabeled data into a positive example and a unlabeled sample learning model to be classified, so as to obtain negative sample data and second unlabeled data from the first unlabeled data in a classifying way, and obtain first model parameters of the positive example and the unlabeled sample learning model;
the third module is used for combining the positive sample data and the negative sample data to obtain a labeled training set, inputting the labeled training set and the second non-labeled data into a semi-supervised network model for classification processing to obtain second model parameters of the semi-supervised network model;
And a fourth module, configured to perform parameter optimization on the first model parameter according to the second model parameter, obtain an updated first model parameter, and construct a target classification model according to the updated first model parameter.
11. A defect recognition apparatus, comprising:
a fifth module for acquiring the data of the object to be identified;
a sixth module, configured to perform classification recognition on the object data to be recognized according to a target classification model, and determine that the object to be recognized is a defect object or a qualified object;
wherein the object classification model is determined according to the classification model training apparatus of claim 10.
12. A defect identification system, comprising:
the product imaging module is used for acquiring image data of a target product;
the defect identification module is used for carrying out defect identification on the image data of the target product through the target classification model and determining defect information of the target product;
the defect registration module is used for carrying out defect registration on the target product according to the defect information of the target product;
wherein the object classification model is determined according to the classification model training apparatus of claim 10.
13. An electronic device comprising a processor and a memory;
the memory is used for storing programs;
the processor executing the program implements the classification model training method of any one of claims 1 to 8 or the defect identification method of claim 9.
14. A computer-readable storage medium, characterized in that the storage medium stores a program that is executed by a processor to implement the classification model training method according to any one of claims 1 to 8 or the defect identification method according to claim 9.
15. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the classification model training method of any of claims 1 to 8 or the defect identification method of claim 9.
CN202310033452.9A 2023-01-10 2023-01-10 Classification model training method, defect identification method, device and electronic equipment Pending CN116956105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310033452.9A CN116956105A (en) 2023-01-10 2023-01-10 Classification model training method, defect identification method, device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310033452.9A CN116956105A (en) 2023-01-10 2023-01-10 Classification model training method, defect identification method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN116956105A true CN116956105A (en) 2023-10-27

Family

ID=88451747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310033452.9A Pending CN116956105A (en) 2023-01-10 2023-01-10 Classification model training method, defect identification method, device and electronic equipment

Country Status (1)

Country Link
CN (1) CN116956105A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117762113A (en) * 2024-02-22 2024-03-26 宁波数益工联科技有限公司 Automatic monitoring iterative parameter adjusting method and system based on integrated model
CN117762113B (en) * 2024-02-22 2024-05-10 宁波数益工联科技有限公司 Automatic monitoring iterative parameter adjusting method and system based on integrated model

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117762113A (en) * 2024-02-22 2024-03-26 宁波数益工联科技有限公司 Automatic monitoring iterative parameter adjusting method and system based on integrated model
CN117762113B (en) * 2024-02-22 2024-05-10 宁波数益工联科技有限公司 Automatic monitoring iterative parameter adjusting method and system based on integrated model

Similar Documents

Publication Publication Date Title
Pastore et al. Annotation-free learning of plankton for classification and anomaly detection
KR20190119548A (en) Method and apparatus for processing image noise
CN111091175A (en) Neural network model training method, neural network model classification method, neural network model training device and electronic equipment
CN109033107A (en) Image search method and device, computer equipment and storage medium
CN113095370A (en) Image recognition method and device, electronic equipment and storage medium
Li et al. A review of deep learning methods for pixel-level crack detection
CN111353377A (en) Elevator passenger number detection method based on deep learning
JP7214863B2 (en) Computer architecture for artificial image generation
KR102402194B1 (en) Deep learning based end-to-end o-ring defect inspection method
Singh et al. CNN based approach for traffic sign recognition system
CN114358249A (en) Target recognition model training method, target recognition method and device
CN115761240B (en) Image semantic segmentation method and device for chaotic back propagation graph neural network
CN116681128A (en) Neural network model training method and device with noisy multi-label data
CN116956105A (en) Classification model training method, defect identification method, device and electronic equipment
CN111563413A (en) Mixed dual-model-based age prediction method
Suyal et al. An Agile Review of Machine Learning Technique
Senapati et al. Image-to-image translation using Pix2Pix GAN and cycle GAN
Abdulraheem et al. Anomaly-Based Intrusion Detection System Using One Dimensional and Two Dimensional Convolutions
KR102556235B1 (en) Method and apparatus for content based image retrieval
KR20190078710A (en) Image classfication system and mehtod
CN111709479B (en) Image classification method and device
CN116630816B (en) SAR target recognition method, device, equipment and medium based on prototype comparison learning
CN117593890B (en) Detection method and device for road spilled objects, electronic equipment and storage medium
CN117809169B (en) Small-sample underwater sonar image classification method and model building method thereof
Chen Brain Tumor Prediction with LSTM Method

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