CN114663729A - Cylinder sleeve small sample defect detection method based on meta-learning - Google Patents

Cylinder sleeve small sample defect detection method based on meta-learning Download PDF

Info

Publication number
CN114663729A
CN114663729A CN202210318273.5A CN202210318273A CN114663729A CN 114663729 A CN114663729 A CN 114663729A CN 202210318273 A CN202210318273 A CN 202210318273A CN 114663729 A CN114663729 A CN 114663729A
Authority
CN
China
Prior art keywords
meta
training
learning
model
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
CN202210318273.5A
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.)
Nanjing Institute of Technology
Original Assignee
Nanjing Institute of Technology
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 Nanjing Institute of Technology filed Critical Nanjing Institute of Technology
Priority to CN202210318273.5A priority Critical patent/CN114663729A/en
Publication of CN114663729A publication Critical patent/CN114663729A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a cylinder liner small sample defect detection method based on meta-learning, which fuses a Yolov3 network and a meta-learning method (MAML) so as to detect a cylinder liner of a small sample. Firstly, data collection and image preprocessing operation are carried out, then, a Yolov3 algorithm is selected as a skeleton network, and a migration learning module is added before a support set of an image test set is trained, so that the support set in a meta test set has strong feature extraction capability, a model can identify feature information more easily, and model convergence is accelerated. And in the face of an unknown cylinder sleeve data set, the model is finely adjusted based on a support set of the meta-test set, and a small sample is detected by utilizing the query set. In the training and testing, an N-way K-shot task classification method is randomly adopted to train and test the model, and finally the detection of the small sample is realized.

Description

Cylinder sleeve small sample defect detection method based on meta-learning
Technical Field
The invention relates to the field of target detection and the field of image processing, in particular to a method for detecting defects of small samples of a cylinder sleeve based on meta-learning.
Background
With the improvement of computer process technology, enterprise detection of workpiece defects by using computer vision image processing technology is more and more. The deep learning net framework is more and more mature and widely applied to the aspects of daily life. However, for small sample problems, the deep network training results are not ideal.
The cylinder liner is an important component of the internal combustion engine, and the production process and the quality of the cylinder liner directly influence the performance of the internal combustion engine. In the industrial production process, different defects such as sand holes, cracks, abrasion and the like may occur in the cylinder sleeves produced in batches along with uneven distribution of temperature, impurities and stress during processing. These defects indirectly affect the life of the cylinder liner. In order to improve the production process, in recent years, online detection based on computer vision technology is applied to industry, but the accuracy is limited by the performance and robustness of the algorithm. The detection method using deep learning is much higher in accuracy than the conventional detection method. In order to detect various defects of the cylinder liner using deep learning, it is necessary to collect sufficient cylinder liner defect data, but the production equipment and environment of the current factory are excellent, defective products rarely occur, and it is difficult to collect a large amount of cylinder liner defect data. Therefore, it is important to improve the detection method of small samples.
Industrial surface defects are one of the important factors affecting the quality of products, and defect detection refers to finding and detecting defects of a workpiece in some way. The current methods for detecting the defects of the workpiece are common as follows:
traditional detection: for industrial defects, the conventional detection is manual detection, namely, whether a workpiece contains defects is checked by human eyes, and the detection mode is simple. In addition to the manual visual inspection method, there are eddy current inspection, X-ray inspection, and the like. The eddy current detection ET (eddy current testing) technology utilizes the electromagnetic induction principle to enable a sine alternating current coil to be close to a pipe workpiece to be detected, and eddy current is generated in a pipe wall through a generated alternating magnetic field. If the defects exist, the voltage or the current is changed, so that whether the pipe workpiece is qualified or not is judged. X-ray is first discovered by roentgen in 1895, is an electromagnetic wave with the wavelength of 0.0001-10 nm, is generated by different energy level transitions of electrons in atoms, and has wave-particle duality. The principle of X-ray detection RT (radiographic testing) is that rays with certain intensity are adopted to vertically project an object to be detected, and the absorption capacity of normal parts and defect parts to the rays is different, so that whether the object to be detected is qualified is judged.
And (3) machine learning detection: the characteristics or the statistical characteristics of specific areas of the image are designed mainly by manual qualitative. The feature extraction method needs human intervention, and the traditional feature extraction method is SIFT, SURF and the like.
Deep learning detection: deep learning detection is a brand-new thought mode, and an internal rule hidden in the appearance of an object is found. Recently, with the continuous upgrading of computer equipment and the continuous progress of artificial intelligence, deep learning is achieved in terms of life. The method also achieves excellent performance in industrial defect detection. Deep learning is currently divided into one-stage neural networks and two-stage neural networks. For the first-order neural network, the target frame is directly generated for target detection. The method has the characteristics of high speed but low detection precision, and common algorithms include a Yolo series algorithm, an SSD (solid State disk) and the like, wherein the Yolo series algorithm is superior to other one-stage algorithms in precision. For the second-order neural network, candidate frames are generated firstly, and then a final target frame is selected from the generated candidate frames. The two-stage network has the characteristic of high precision, but the detection speed is slow due to the fact that the candidate frame is generated firstly, and the two-stage network is not suitable for industrial application. Common are fast RCNN, Mask RCNN, etc.
For the manual visual inspection method: low efficiency and high cost. The human factor is the largest.
For the eddy current test method: the inspection efficiency is relatively low, and in addition, the type, shape and specific position of the defect are generally difficult to distinguish only by means of eddy current inspection, and the inspection result is also easily interfered by the material and other factors. Therefore, eddy current testing cannot effectively eliminate surface defects of the cylinder liner, and for an internal combustion engine, potential safety hazards exist, so that the eddy current testing is not suitable for detecting the surface defects of the cylinder liner.
For X-rays: although X-rays are the main method for detecting the defects of the tubular workpieces at present and are suitable for the tubular workpieces made of all materials, the accuracy of X-ray detection results is related to the defect direction, the X-rays have certain radiation damage to operators, meanwhile, the detectors are required to have certain professional knowledge, and the detection period cannot meet the real-time detection requirement. Therefore, X-rays cannot be applied to cylinder liner surface defect detection.
For machine learning detection, the defects are that for different targets, a detection algorithm needs to be designed according to different prior knowledge, so that the detection algorithm cannot well extract the global semantic features of an image, the robustness of the algorithm is low, and defect detection under complex tasks is difficult to complete. Meanwhile, the defect detection based on machine learning has high requirements on images, all images must be uniform backgrounds, and the defect part is only an abnormal part in a normal image. The surface defect sizes of actual cylinder liners are different, the collecting backgrounds are different, and the cylinder liners are different in model, so that the machine vision is not suitable for detecting the surface defects of the cylinder liners.
For deep learning, the deep learning is more suitable for detecting defects on the surface of the cylinder sleeve. The biggest difference between the target detection of deep learning and the traditional mode is as follows: and extracting image features. The traditional image feature extraction method is limited by expert experience, on the contrary, deep learning is to extract image features by using a convolutional neural network, and the image features are extracted by taking inner products of data of windows with different sizes and convolutional kernels (filter matrixes). And the detection algorithm based on the deep network fully utilizes the information to detect the target. However, the robustness of deep learning is poor, the generalization is not good, and the deep learning depends on mass data. Only enough data can effectively extract the target characteristic information. If the data amount is not enough, the training result of the deep learning network may be deteriorated, and even an under-fitting phenomenon may occur, so that the model is difficult to converge.
The problem of small samples can be effectively solved by the appearance of meta-learning, and the initialization parameters with strong generalization ability can be found by the MAML method, so that training under the condition of insufficient data is facilitated. In view of the above, the present invention proposes to introduce the idea of meta-learning into deep learning. Meta learning is learning that learns to learn, and the purpose of meta learning is to learn an unlearned task by using already learned information so as to adapt to a new task as soon as possible. Meta-learning is typically applied to small sample datasets. For tasks with data sets difficult to collect, meta-learning is applied to deep learning, and the problem of robustness of deep learning is effectively improved. Studies based on meta-learning are currently divided into five categories: the method is based on metric learning, the initialization method with strong generalization ability, the optimizer, the additional external storage and the data enhancement. The patent is a meta-learning research target based on an initialization method with strong generalization ability. In order to better learn the characteristic information, the concept of transfer learning is introduced at the same time. The transfer learning is to pre-train the big data of the source domain to construct a network model. The shallow parameters are then migrated directly into the target domain. The fine-tuning of the network is performed on a small number of target domains, eventually enabling the model to converge quickly, even with a small amount of data. When the tasks of the target domain and the source domain are relatively similar, the transfer learning effect is better.
Disclosure of Invention
The invention aims to provide a method for detecting defects of small sample marks of a cylinder sleeve based on meta-learning, aiming at the problems of small samples and difficulty in obtaining enough data.
The technical scheme adopted by the invention is as follows: a cylinder liner small sample defect detection method based on meta-learning is characterized in that a Yolov3 network and a meta-learning method (MAML) are fused so as to perform cylinder liner detection of small samples, and the method comprises the following steps:
the method comprises the following steps: firstly, data collection and image preprocessing operation are carried out;
step two: secondly, selecting a Yolov3 algorithm to replace the original network, and adding a transfer learning module before training a support set of the image test set, so that the model can identify characteristic information more easily, and the convergence of the model is accelerated;
step three: and finally, randomly adopting an N-way K-shot task classification method to train and test the model, and finally realizing the detection of the small sample.
Preferably, the first step specifically includes:
data collection and processing: firstly, collecting a common industrial surface defect data set, and intercepting a local defect map from an original image of a cylinder sleeve according to a defect calibration position; secondly, dividing a common industrial surface defect data set into two parts according to different defects, wherein one part of the common industrial surface defect data set is used as data for transfer learning training, and the other part of the common industrial surface defect data set is divided into a training set and a testing set. And (3) intercepting a local defect map from the original image of the cylinder liner according to the position calibrated by the defect to divide the original image of the cylinder liner into a cylinder liner training set and a cylinder liner testing set. And performing image preprocessing operation on all the collected images, zooming all the collected images to the size of the same size, performing image enhancement operation, randomly inverting the images, and horizontally rotating the images. Normalizing the processed picture, wherein the image normalization formula is as follows:
Figure BDA0003569573800000031
wherein x is input feature information, u is a mean value, and std is a standard deviation.
Preferably, the second step specifically comprises:
data division: in the meta-training set, a corresponding support set and a corresponding query set are designed, and the support set and the query set are respectively constructed from a training set and a testing set of common industrial surface defects. In the meta-test set, a support set and a query set are extracted from a training set and a test set of the cylinder liner, respectively. Randomly extracting n tasks from the preprocessed common industrial surface defect data set to serve as a meta-training data set, sequentially sending the tasks to Yolov3 for model training and parameter updating, and finally storing the updated parameters. And taking the pretreated cylinder sleeve defect data set as a meta-training data set, sending the data to Yolov3, training the model and finely adjusting parameters.
Selecting a model: the Yolov3 network used in the method is used for constructing a model and carrying out detection based on meta-learning. Yolov3 is a one-stage network, and has the advantages of maintaining precision, and being high in detection speed and the like. The Yolov3 network was characterized by the extraction of features from the darknet53, feature fusion from the FPN (image pyramid), and finally classification and regression tasks with 3 × 3 and convolution and 1 × 1 convolution. Because the defects of the cylinder sleeve are small, 3 predicted head layers which are output originally can be reserved for 1 predicted head layer. The predictive header layer is dedicated to detecting small targets. Thereby reducing network training time.
Transfer learning: generally, in the training process, training parameters are initialized randomly and cannot be adjusted manually, and a large number of pictures need to be trained to obtain good parameters. And partial parameters extracted by the features in the small samples occupy a lot, and in order to make up for the defect of small sample number, a transfer learning module is added in the meta-learning process. Firstly, putting the previously divided migration learning training data into a Yolov3 network for training to obtain a network training weight. And then, adding the weight of the model trained previously before the support set of the meta-learning training test set to perform transfer learning, and enhancing the capability of extracting the image features in the support set in the meta-learning test set. And the iteration times of the model are reduced, and the rapid convergence of the model is accelerated.
Preferably, the third step specifically comprises:
meta learning: in the meta-training stage, a task randomly adopts an N-way K-shot task classification method, wherein N is a randomly selected category, and K is the number of corresponding pictures in the selected category.
For a support set of a meta-training set, the method adopts a 5-way 1-shot classification method to put data into a network for training;
for the query set of the meta-training set, the method adopts a 5-way 15-shot classification method to test.
For the support set of the meta-test set, the method adopts a 5-way 1-shot classification method to put data into a network for fine adjustment,
for the query set of the meta-test set, the method adopts a 5-way 15-shot classification method to test the cylinder sleeve.
Firstly, inputting a support set of meta-training data into Yolov3, extracting features through a DarkNet layer, performing feature fusion through an FPN layer, generating a predicted value through a prediction head layer, and calculating loss with a true value label to obtain a loss gradient. And generating a predicted value by the query set through a Yolov3 network, calculating loss with a true value label, and updating parameters through SGD gradient descent. The penalty of Yolov3 consists of three components, position penalty, confidence penalty, and category penalty. The formula is as follows:
(1) position loss:
Figure BDA0003569573800000041
wherein s is2The number of meshes generated for the final feature map, i is the number of meshes, B is the number of 3 frames generated on one mesh, j is the number of frames, γcoordIs a weight parameter that is a function of,
Figure BDA0003569573800000042
the jth box of the ith grid is responsible for the object, xiIs the abscissa of the predicted center point of the object,
Figure BDA0003569573800000043
is the abscissa of the center point of the real object, yiThe ordinate of the predicted center point of the object,
Figure BDA0003569573800000044
is the ordinate of the true object center point; w is aiIs the width of the prediction box or frames,
Figure BDA0003569573800000051
is the width of the real frame, hiIs the height of the prediction box or frames,
Figure BDA0003569573800000052
is the height of the real box.
(2) Confidence loss:
Figure BDA0003569573800000053
wherein
Figure BDA0003569573800000054
Is the jth box of the ith grid responsible for the background, ciIs the confidence level of the prediction that it is,
Figure BDA0003569573800000055
is the true confidence.
(3) Class loss:
Figure BDA0003569573800000056
wherein p isi(c) The category of the prediction is represented by,
Figure BDA0003569573800000057
representing the true category.
The overall loss function is:
lgeneral assembly=lreg+lDevice for placing+lcls
Secondly, performing internal and external 2 sub-optimization on the model through the query set and the support set. The formula for updating the internal parameters is as follows:
Figure BDA0003569573800000058
where theta is a model initialization parameter,
Figure BDA0003569573800000059
is the parameter of the model of the ith task after the gradient update of the (n-1) th step, and the value range is (0, m)]To (c) to (d); alpha is the meta-learning rate,
Figure BDA00035695738000000510
is the gradient of θ with respect to loss, L is the loss function, TiIs a task of random sampling;
Figure BDA00035695738000000511
predicted value of model after gradient update of step n-1 for ith task, DaTag information for a support set. And based on the updated parameter model, utilizing a query set of tasks to realize model external optimization. The formula is as follows:
Figure BDA00035695738000000512
wherein beta is the meta learning rate, DbIs a label for the query set. The Yolov3 network parameters are iteratively updated using SGD (gradient back propagation algorithm).
And finally, updating the model parameters through a task training network in the training stage of meta-learning. In the test stage of meta-learning, a training support set directly migrates a pre-training model trained before, and fine adjustment is performed on a small number of support sets (target domains) to accelerate training time and precision. And finally, in the query set of the meta-learning test set, firstly carrying out normalization processing on the data, and testing the cylinder sleeve through the trained network model. Compared with the theta initialized at random, the updated theta can be used for training an unknown cylinder sleeve data set more quickly, so that convergence is accelerated, and detection of a small sample data set is facilitated. And finally, the detection of the small sample is realized.
Has the advantages that: according to the invention, the Yolov3 is used as the meta-learning model of the framework and the detection method combining the transfer learning and the meta-learning, so that the feasibility of small sample detection is improved, the number of training samples and the number of iterations are reduced, and the training time is shortened. Compared with the existing target detection method, the target detection method can effectively solve the problem of small samples and has certain universality under the condition that the training data volume is difficult to obtain.
Drawings
FIG. 1 is a flow chart of the detection method of the present invention;
FIG. 2 is a diagram of the transfer learning and meta-learning training of the present invention;
FIG. 3 is a schematic network diagram of Yolov3 according to the present invention.
Detailed description of the invention
The invention is further described with reference to the following figures and detailed description.
The technology used by the invention is to fuse a Yolov3 network and a meta learning method (MAML) so as to detect the cylinder liner of a small sample. Firstly, data collection and image preprocessing operation are carried out, then, a Yolov3 algorithm is selected as a skeleton network, and a migration learning module is added before a support set of an image test set is trained, so that the support set in a meta test set has strong feature extraction capability, a model can identify feature information more easily, and model convergence is accelerated. And in the face of an unknown cylinder sleeve data set, the model is finely adjusted based on a support set of the meta-test set, and a small sample is detected by utilizing the query set. In the training and testing process, an N-way K-shot task classification method is randomly adopted to train and test the model, and finally the detection of the small sample is realized.
As shown in fig. 1-3, the specific process of the present invention comprises the following steps:
step 1: collection of Experimental data sets
And (4) making a VOC format data set, and labeling the picture data in the cylinder sleeve data set by using a LabelImg tool to generate an xml file. And collecting a common workpiece surface defect data map comprising marking information. Dividing a common industrial surface defect data set into two parts according to different defects, wherein one part of the common industrial surface defect data set is used as data for transfer learning training, and the other part of the common industrial surface defect data set is divided into a training set and a testing set. And (3) intercepting a local defect map from the original image of the cylinder liner according to the position calibrated by the defect to divide the original image of the cylinder liner into a cylinder liner training set and a cylinder liner testing set. And performing image preprocessing operation on all the collected images, zooming all the collected images to the same size, performing image enhancement operation, randomly inverting the images, and horizontally rotating the images. And carrying out normalization operation on the processed picture.
Step 2: data partitioning
There are corresponding support and query sets in the meta-training set, which are extracted from the training and test sets of common industrial surface defects, respectively. And extracting a support set and a query set in the meta-test set from a training set and a test set of the cylinder liner respectively. And randomly extracting n tasks from the preprocessed common industrial surface defect data set to serve as a meta-training data set, sequentially sending the tasks to Yolov3 for model training and parameter updating, and finally storing the updated parameters. And taking the pretreated cylinder sleeve defect data set as a meta-training data set, sending the data to Yolov3, training the model and finely adjusting parameters.
And step 3: model selection
The Yolov3 network used in the method is used for constructing a model and carrying out detection based on meta-learning. Yolov3 is a one-stage network, and has the advantages of maintaining precision, and being high in detection speed and the like. The Yolov3 network was characterized by the extraction of features from the darknet53, feature fusion from the FPN (image pyramid), and finally classification and regression tasks with 3 × 3 and convolution and 1 × 1 convolution. Because the defects of the cylinder sleeve are small, 3 originally output prediction head networks can be reserved for 1 prediction head network (the prediction head network is specially used for detecting small targets). Thereby reducing network training time.
And 4, step 4: transfer learning
Generally, in the training process, training parameters are initialized randomly and cannot be adjusted manually, and a large number of pictures need to be trained to obtain good parameters. And partial parameters of feature extraction in the small samples account for a lot, and in order to make up for the defect of small sample number, a transfer learning module is added in the meta-learning process. Firstly, putting the previously divided migration learning training data into a Yolov3 network for training to obtain a network training weight. And then, adding the weight of the model trained previously before a support set of the meta-learning training test set to perform transfer learning, and enhancing the capability of extracting the image features in the support set in the meta-learning test set. And the iteration times of the model are reduced, and the rapid convergence of the model is accelerated.
And 5: meta learning
In the meta-training stage, an N-way K-shot task classification method is randomly adopted in one task (task), N is a randomly selected category, and K is the number of corresponding pictures in the selected category. For a support set of a meta training set, a 5-way 1-shot classification method is adopted to put data into a network for training, and a 5-way 15-shot classification method is adopted for a query set of the meta training set for testing. And (3) placing data into a network for fine adjustment by adopting a 5-way 1-shot classification method for a support set of the meta-test set, and testing the cylinder liner by adopting a 5-way 15-shot classification method for an inquiry set of the meta-test set. Firstly, the support set of the meta-training data is sent to Yolov3, features are extracted through a darknet layer, feature fusion is carried out through an FPN layer, a predicted value is generated through a predicted head layer, loss is calculated through a true value label, and a loss gradient is obtained. And generating a predicted value by the query set through a Yolov3 network, calculating loss with a true value label, and updating parameters through SGD gradient descent.
The embodiments described above are presented to facilitate one of ordinary skill in the art to understand and practice the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (4)

1. A method for detecting defects of small samples of a cylinder sleeve based on meta-learning is characterized by comprising the following steps: the method comprises the following steps:
the method comprises the following steps: firstly, data collection and image preprocessing operation are carried out;
step two: secondly, selecting a Yolov3 algorithm as a skeleton network, and adding a transfer learning module before training a support set of the image test set, so that the model can identify characteristic information more easily, and the convergence of the model is accelerated;
step three: and finally, randomly adopting an N-way K-shot task classification method to train and test the model, and finally realizing the detection of the small sample.
2. The method for detecting the defects of the small cylinder liner samples based on meta-learning according to claim 1, characterized in that: the first step specifically comprises:
data collection and processing: firstly, collecting a common industrial surface defect data set, and intercepting a local defect map from an original image of a cylinder sleeve according to a defect calibration position; secondly, dividing a common industrial surface defect data set into two parts according to different defects, wherein one part of the common industrial surface defect data set is used as data for transfer learning training, and the other part of the common industrial surface defect data set is divided into a training set and a testing set; cutting a local defect image of the original image of the cylinder sleeve according to the position of defect calibration to divide the original image of the cylinder sleeve into a cylinder sleeve training set and a cylinder sleeve testing set; performing image preprocessing operation on all collected images, zooming all the collected images to the same size, performing image enhancement operation, randomly inverting the images, and horizontally rotating the images; normalizing the processed picture, wherein the image normalization formula is as follows:
Figure FDA0003569573790000011
wherein x is input feature information, u is a mean value, and std is a standard deviation.
3. The method for detecting the defects of the small cylinder liner samples based on meta-learning according to claim 1, characterized in that: the second step specifically comprises:
data division: designing a corresponding support set and a corresponding query set in the meta-training set, and respectively constructing from a training set and a test set of common industrial surface defects; in the meta-test set, a support set and a query set are respectively extracted from a training set and a test set of the cylinder liner; randomly extracting n tasks from the preprocessed common industrial surface defect data set to serve as a meta-training data set, sequentially sending the tasks to Yolov3 for model training and parameter updating, and finally storing the updated parameters; taking the pretreated cylinder sleeve defect data set as a meta-training data set, sending the data to Yolov3, training a model and finely adjusting parameters;
model selection: constructing a model by adopting a Yolov3 network, and detecting based on meta-learning; extracting a feature map of a Yolov3 network by using darknet53, performing feature fusion by using FPN, and finally performing a classification task and a regression task by using 3 × 3 and convolution and 1 × 1 convolution; because the defects of the cylinder sleeve are small, 1 predicted head layer is reserved for 3 originally output predicted head layers, and the predicted head layers are specially used for detecting small targets, so that the network training time is reduced;
transfer learning: firstly, putting the previously divided transfer learning training data into a Yolov3 network for training to obtain a network training weight; adding the weight of the model trained previously before the support set of the meta-learning training test set for transfer learning, and enhancing the capability of extracting the image features in the support set in the meta-learning training test set; and the iteration times of the model are reduced, and the rapid convergence of the model is accelerated.
4. The method for detecting the defects of the small cylinder liner samples based on meta-learning according to claim 1, characterized in that: the third step specifically comprises:
meta learning: in the meta-training stage, one task randomly adopts an N-way K-shot task classification method, wherein N is a randomly selected category, and K is the number of corresponding pictures in the selected category;
for the support set of the meta-training set, putting data into a network for training by adopting a 5-way 1-shot classification method;
for the query set of the meta-training set, testing by adopting a 5-way 15-shot classification method;
for the support set of the meta-test set, a 5-way 1-shot classification method is adopted to put data into a network for fine adjustment;
for the query set of the meta-test set, testing the cylinder liner by adopting a 5-way 15-shot classification method;
firstly, inputting a support set of meta-training data into Yolov3, extracting features through a DarkNet layer, performing feature fusion through a FPN layer, generating a predicted value through a prediction head layer, and calculating loss with a true value label to obtain a loss gradient; and generating a predicted value by the query set through a Yolov3 network, calculating loss with a true value label, and updating parameters through SGD gradient descent. The penalty of Yolov3 consists of three components, position penalty, confidence penalty, and category penalty; the formula is as follows:
(1) position loss:
Figure FDA0003569573790000021
wherein s is2The number of meshes generated for the final feature map, i is the number of meshes, B is the number of 3 frames generated on one mesh, j is the number of frames, γcoordIs a weight parameter that is a function of,
Figure FDA0003569573790000022
the jth box of the ith grid is responsible for the object, xiIs the abscissa of the predicted center point of the object,
Figure FDA0003569573790000023
is the abscissa of the center point of the real object, yiThe ordinate of the predicted center point of the object,
Figure FDA0003569573790000024
is the ordinate of the true object center point; w is aiIs the width of the prediction box or frames,
Figure FDA0003569573790000025
is the width of the real frame, hiIs the height of the prediction box or frames,
Figure FDA0003569573790000026
is the height of the real frame;
(2) confidence loss:
Figure FDA0003569573790000027
wherein
Figure FDA0003569573790000028
Is the jth box of the ith grid responsible for the background, ciIs the confidence level of the prediction that the prediction is,
Figure FDA0003569573790000029
is the true confidence;
(3) class loss:
Figure FDA00035695737900000210
wherein p isi(c) A category of the prediction is represented by a number of categories,
Figure FDA0003569573790000031
representing real categories;
the overall loss function is:
lgeneral assembly=lreg+lDevice for placing+lcls
Secondly, performing internal and external 2-suboptimization on the model through a query set and a support set; the formula for updating the internal parameters is as follows:
Figure FDA0003569573790000032
where theta is a model initialization parameter and,
Figure FDA0003569573790000033
is the parameter of the model of the ith task after the gradient update of the (n-1) th step, and the value range is (0, m)]To (c) to (d); alpha is the meta-learning rate,
Figure FDA0003569573790000034
is the gradient of θ with respect to loss, L is the loss function, TiIs a task of random sampling;
Figure FDA0003569573790000035
predicted value of model after gradient update of step n-1 for ith task, DaLabel information for the support set;
based on the updated parameter model, utilizing a query set of tasks to realize model external optimization; the formula is as follows:
Figure FDA0003569573790000036
wherein beta is the meta learning rate, DbA label for a query set; iteratively updating the Yolov3 network parameters by using the SGD;
finally, in the training stage of meta-learning, updating model parameters through a task training network; in the test stage of meta-learning, training support set directly transfers the pre-training model trained previously, and fine adjustment is performed on a support set with small quantity, so that training time and precision are accelerated; finally, in the query set of the meta-learning test set, firstly carrying out normalization processing on data, and testing the cylinder sleeve through a trained network model; compared with the theta initialized at random, the updated theta is faster to train a model facing an unknown cylinder sleeve data set, so that convergence is accelerated, detection of a small sample data set is facilitated, and detection of a small sample is finally realized.
CN202210318273.5A 2022-03-29 2022-03-29 Cylinder sleeve small sample defect detection method based on meta-learning Pending CN114663729A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210318273.5A CN114663729A (en) 2022-03-29 2022-03-29 Cylinder sleeve small sample defect detection method based on meta-learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210318273.5A CN114663729A (en) 2022-03-29 2022-03-29 Cylinder sleeve small sample defect detection method based on meta-learning

Publications (1)

Publication Number Publication Date
CN114663729A true CN114663729A (en) 2022-06-24

Family

ID=82033503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210318273.5A Pending CN114663729A (en) 2022-03-29 2022-03-29 Cylinder sleeve small sample defect detection method based on meta-learning

Country Status (1)

Country Link
CN (1) CN114663729A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174272A (en) * 2022-09-06 2022-10-11 浙江工业大学 Small sample malicious network flow detection method based on meta-learning
CN115359345A (en) * 2022-09-16 2022-11-18 湖南苏科智能科技有限公司 Different-class meta-learning-based overlapped object identification method under X-ray
CN115564773A (en) * 2022-11-18 2023-01-03 南方电网数字电网研究院有限公司 Small sample image defect detection method, device and equipment based on meta-learning
CN116312860A (en) * 2023-03-24 2023-06-23 江南大学 Agricultural product soluble solid matter prediction method based on supervised transfer learning
CN116595443A (en) * 2023-07-17 2023-08-15 山东科技大学 Wireless signal book gesture recognition method based on meta learning
WO2024032010A1 (en) * 2022-08-11 2024-02-15 重庆邮电大学 Transfer learning strategy-based real-time few-shot object detection method

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024032010A1 (en) * 2022-08-11 2024-02-15 重庆邮电大学 Transfer learning strategy-based real-time few-shot object detection method
CN115174272A (en) * 2022-09-06 2022-10-11 浙江工业大学 Small sample malicious network flow detection method based on meta-learning
CN115359345A (en) * 2022-09-16 2022-11-18 湖南苏科智能科技有限公司 Different-class meta-learning-based overlapped object identification method under X-ray
CN115564773A (en) * 2022-11-18 2023-01-03 南方电网数字电网研究院有限公司 Small sample image defect detection method, device and equipment based on meta-learning
CN116312860A (en) * 2023-03-24 2023-06-23 江南大学 Agricultural product soluble solid matter prediction method based on supervised transfer learning
CN116312860B (en) * 2023-03-24 2023-09-12 江南大学 Agricultural product soluble solid matter prediction method based on supervised transfer learning
CN116595443A (en) * 2023-07-17 2023-08-15 山东科技大学 Wireless signal book gesture recognition method based on meta learning
CN116595443B (en) * 2023-07-17 2023-10-03 山东科技大学 Wireless signal book gesture recognition method based on meta learning

Similar Documents

Publication Publication Date Title
CN114663729A (en) Cylinder sleeve small sample defect detection method based on meta-learning
CN112183667B (en) Insulator fault detection method in cooperation with deep learning
CN112116560B (en) Welding image defect identification method, device, storage medium and equipment
CN111553303B (en) Remote sensing orthographic image dense building extraction method based on convolutional neural network
WO2019183153A1 (en) Training a machine learning model with synthetic images
CN109859163A (en) A kind of LCD defect inspection method based on feature pyramid convolutional neural networks
CN110779937A (en) Casting product internal defect intelligent detection device
CN110222681A (en) A kind of casting defect recognition methods based on convolutional neural networks
CN114092832B (en) High-resolution remote sensing image classification method based on parallel hybrid convolutional network
CN112884791B (en) Method for constructing large-scale remote sensing image semantic segmentation model training sample set
CN111985325B (en) Aerial small target rapid identification method in extra-high voltage environment evaluation
CN111932511B (en) Electronic component quality detection method and system based on deep learning
Wang et al. 3D point cloud instance segmentation of lettuce based on PartNet
CN112613350A (en) High-resolution optical remote sensing image airplane target detection method based on deep neural network
He et al. A survey of defect detection applications based on generative adversarial networks
CN115984543A (en) Target detection algorithm based on infrared and visible light images
JP2022027473A (en) Generation of training data usable for inspection of semiconductor sample
CN110490188A (en) A kind of target object rapid detection method based on SSD network improvement type
Qian et al. Classification of rice seed variety using point cloud data combined with deep learning
Zou et al. Automatic segmentation, inpainting, and classification of defective patterns on ancient architecture using multiple deep learning algorithms
Zhang et al. Research on pipeline defect detection based on optimized faster r-cnn algorithm
CN114078106A (en) Defect detection method based on improved Faster R-CNN
CN116958073A (en) Small sample steel defect detection method based on attention feature pyramid mechanism
CN116448765A (en) Identification positioning system for surface defects of manually laid prepreg
Yang et al. Visual defects detection model of mobile phone screen

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