Movatterモバイル変換


[0]ホーム

URL:


CN111932503A - Deep learning-based detection method for surface defects of metal blank cap - Google Patents

Deep learning-based detection method for surface defects of metal blank cap
Download PDF

Info

Publication number
CN111932503A
CN111932503ACN202010693405.3ACN202010693405ACN111932503ACN 111932503 ACN111932503 ACN 111932503ACN 202010693405 ACN202010693405 ACN 202010693405ACN 111932503 ACN111932503 ACN 111932503A
Authority
CN
China
Prior art keywords
metal blank
blank cap
image
defect
target
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
CN202010693405.3A
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.)
TAICANG INSTITUTE OF COMPUTING TECHNOLOGY CHINESE ACADEMY OF SCIENCES
Original Assignee
TAICANG INSTITUTE OF COMPUTING TECHNOLOGY CHINESE ACADEMY OF SCIENCES
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 TAICANG INSTITUTE OF COMPUTING TECHNOLOGY CHINESE ACADEMY OF SCIENCESfiledCriticalTAICANG INSTITUTE OF COMPUTING TECHNOLOGY CHINESE ACADEMY OF SCIENCES
Priority to CN202010693405.3ApriorityCriticalpatent/CN111932503A/en
Publication of CN111932503ApublicationCriticalpatent/CN111932503A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the invention discloses a method for detecting surface defects of a metal blank cap based on deep learning. Analyzing the normal surface of the metal blank cap and the defect surface of the metal blank cap, and determining the defect type and defect characteristics of the surface of the metal blank cap to be detected; acquiring an image of the surface of the metal blank cap to be detected by adopting a camera, and processing the image to obtain an image data set; and constructing a detection model of the surface defects of the metal blank cap according to the image data set, extracting features of different layers of the image by adopting an improved deep convolution network, and learning and obtaining a defect type and range detection model based on the features, wherein the defect type and range detection model can detect the positions of the surface defects in the image. The detection method has high detection speed and precision and is suitable for some specific production places.

Description

Deep learning-based detection method for surface defects of metal blank cap
Technical Field
The invention relates to the technical field of defect detection, in particular to a method for detecting surface defects of a metal blank cap based on deep learning.
Background
With the development of industrial production technology, the requirements of modern manufacturing industry on the surface quality of processed parts are more and more strict. The surface quality of the machined part not only affects the appearance shape of the product, but also more likely affects the function of the product. At present, the method for detecting the surface quality of a product in actual production comprises the following steps: manual visual inspection, magnetic particle inspection, penetration inspection, eddy current inspection and the like, and the inspection methods have respective characteristics and application ranges thereof. Manual detection is difficult to quantify in speed and precision, and missing detection and missing judgment are easily caused to the surface quality of a product in the surface quality qualitative process, and particularly, a small deformation or an included defect cannot be detected. The penetration detection, the eddy current detection and the magnetic particle detection have limitations in many production fields and production sites, and the requirements of process conditions, material properties, cost, productivity conditions and the like are difficult to meet in a specific production scene.
Therefore, in view of the above technical problems, it is necessary to provide a method for detecting surface defects of a metal blank cap based on deep learning, which has high detection speed and accuracy and is suitable for some specific production sites.
Disclosure of Invention
In view of the above, an object of the embodiments of the present invention is to provide a method for detecting a surface of a metal cap based on deep learning. According to the detection method of the metal blank cap surface based on deep learning, provided by the embodiment of the invention, the machine vision is adopted to replace human eyes to detect and judge the defects, relevant information is firstly extracted from an image of an objective target, then the relevant information is processed through an intelligent algorithm, and the final processing result is applied to the detection of an actual product.
In order to achieve the above object, an embodiment of the present invention provides the following technical solutions: a detection method of metal blank cap surface defect based on deep learning comprises step S1, analyzing normal surface of metal blank cap and defect surface of metal blank cap, and determining defect type and defect characteristic of metal blank cap surface to be detected; step S2: acquiring an image of the surface of the metal blank cap to be detected by adopting a camera, and processing the image to obtain an image data set; step S3: and constructing a detection model of the surface defects of the metal blank cap according to the image data set, extracting features of different layers of the image by adopting an improved deep convolution network, and learning and obtaining a defect type and range detection model based on the features, wherein the defect type and range detection model can detect the positions of the surface defects in the image.
As a further improvement of the present invention, in step S1, the normal surface of the metal blank cap is taken as a positive sample, and the defective surface of the metal blank cap is taken as a negative sample.
As a further improvement of the present invention, the defect types include scratches, gouges and stains.
As a further improvement of the present invention, the step S2 specifically includes: and labeling the defect type and the defect area of the image on the surface of the metal blank cap to be detected acquired by the camera by using labeImg software, labeling each image to obtain a corresponding XML (extensive makeup language) labeled file, and storing the labeled image and the labeled XML labeled file respectively.
As a further improvement of the present invention, the image capturing manner in step S2 is: on putting the thing platform, keep the detection surface up and place in putting thing platform central point with the metal stifle, set up the light source and play a face structure light in the perpendicular top of metal stifle, set up the camera and shoot the collection image in the perpendicular top of metal stifle.
As a further improvement of the invention, the improved deep convolutional network in the step S3 is a Yolov3 network, and the Yolov3 network is composed of a Darknet-53 structure and a multi-scale bounding box prediction structure, wherein the Darknet-53 structure is composed of a series of 1 × 1 and 3 × 3 convolutional layers.
As a further improvement of the invention, said Darknet-53 structure consists of a series of1X 1 and3X 3 convolutional layers, each followed by a BN layer and a LeakyReLU layer, there being a total of 53 (2+1X 2+1+2X 2+1+8X 2+1+4X 2+1) convolutional layers in Darknet-53.
As a further improvement of the invention, the multi-scale bounding box prediction structure is used for performing the prediction of the bounding box on three feature layers with different sizes of 52 × 52, 26 × 26 and 13 × 13 respectively.
As a further improvement of the method, the target boundary frames are predicted on three feature layers with different sizes, convolution prediction is carried out through (4+1+ c) x k convolution kernels with the size of 1 x 1, k is the number of preset boundary frames, k is taken asdefault 3, c is the number of classes of the predicted target, 4k parameters are responsible for predicting the offset of the target boundary frames, k parameters are responsible for predicting the probability that the target is contained in the target boundary frames, and ck parameters are responsible for predicting the probability that the k preset boundary frames correspond to the c target classes.
The invention has the following advantages:
according to the detection method of the metal blank cap surface based on deep learning, provided by the embodiment of the invention, the machine vision is adopted to replace human eyes to detect and judge the defects, relevant information is firstly extracted from an image of an objective target, then the relevant information is processed through an intelligent algorithm, and the final processing result is applied to the detection of an actual product. The detection method of the metal blank cap surface based on deep learning provided by the embodiment of the invention solves the problems of low detection speed and low precision of the traditional manual visual defect detection, and also solves the problems of limited application fields and production scenes of other traditional defect detection.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for detecting a surface of a metal cap based on deep learning according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of another expression in the embodiment of FIG. 1;
FIG. 3 is a schematic view of the surface defect type and inspection parameters of the blank cap;
FIG. 4 is a schematic diagram of a Yolov3 model network structure according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating target bounding box prediction according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1 and fig. 2, a schematic flow chart of a detection method for a metal blank cap surface based on deep learning is provided. In this embodiment, the detection method of the metal blank cap surface based on deep learning includes three steps, and the details of each step are as follows.
And step S1, analyzing the normal surface of the metal blank cap and the defect surface of the metal blank cap, and determining the defect type and defect characteristics of the surface of the metal blank cap to be detected. The surface of the metal blank cap is a circular part with a certain radian on the surface. The modern manufacturing industry has more and more strict requirements on the surface quality of processed parts, and the quality of the surface quality not only affects the appearance and shape of the product, but also more likely affects the functions of the product.
In the steps of the embodiment, a manual visual inspection method is adopted to select the surface of the metal blank cap to manufacture a data set, and the metal blank cap is divided into a qualified product and a defective product by comparing the normal surface and the defective surface of the metal blank cap, wherein the qualified product is a positive sample, and the defective product is a negative sample, and various defects needing to be detected exist on the surface of the defective product. As shown in fig. 3, the types of blank cap surface defects include: scratches, abrasions, stains; the parameters include "x, y, w, h", x being the abscissa of the predicted bounding box center position, y being the ordinate of the predicted bounding box center position, w being the width of the predicted bounding box, and h being the height of the predicted bounding box.
Step S2: and acquiring an image of the surface of the metal blank cap to be detected by adopting a camera, and processing the image to obtain an image data set. The metal blank cap part is small in size, the surface defects of the metal blank cap part are different in size, and in order to ensure that the quality of the collected image meets the detection requirement, a blank cap surface picture needs to be obtained through a specific data collection mode. In this embodiment, an image capture mode based on an industrial camera is defined: on putting the thing platform, keep the detection surface up and place in putting thing platform central point with the metal stifle, set up the light source and play a face structure light in the perpendicular top of metal stifle, set up the camera and shoot the collection image in the perpendicular top of metal stifle.
The acquired images are input into a convolutional neural network for training, label defect types and defect areas of the images of the surface of the metal blank cap to be detected acquired by a camera by using labeImg software, obtain corresponding XML label files after each image is labeled, and respectively store the labeled images and the XML label files. The XML labeling file is provided with parameters of the center coordinates (x, y), the width (w) and the height (h) of a labeling frame; in order to prevent the image from being distorted due to the difference of the aspect ratio during the resampling process, the acquired rectangular-shaped image resize is composed of 1:1 images with the resolution of 416 × 416, and then the resampling is performed.
Step S3: and constructing a detection model of the surface defects of the metal blank cap according to the image data set, extracting features of different layers of the image by adopting an improved deep convolution network, and learning and obtaining a defect type and range detection model based on the features, wherein the defect type and range detection model can detect the positions of the surface defects in the image. Taking the marked image and the marked file obtained by the marking in the step S2 as a training data set; calling an API (application program interface) for Google target detection to train; before training, modifying the configuration file of Yolov3, wherein the main part of modification is the path and the iteration number of the data set, and in this embodiment, the set iteration number is 100000; and finally, performing model training through a command line to obtain a metal blank cap surface defect detection model.
The integral structure of the Yolov3 model is shown in fig. 4. The Yolov3 model is an end-to-end network and is mainly divided into two parts: the first part is Darknet-53 network structure, the network structure is mainly composed of a series of 1 × 1 and 3 × 3 convolutional layers (each convolutional layer is followed by a BN layer and a LeakyReLU layer), the network comprises 53 resonant layers including the last Connected layer, the size of the network initial input image is 416 × 416, and the size of the final output feature map is 13 × 13; the second part is a multiscale prediction bounding box network structure, a group of convolutions are respectively carried out on feature layers with the sizes of 52 x 52, 26 x 26 and 13 x 13 obtained by convolution in a Darknet-53 network structure, the convolution operation sequence is 1 x 1 convolution kernel convolution, 3 x 3 convolution kernel convolution, 1 x 1 convolution kernel convolution, 3 x 3 convolution kernel convolution and 1 x 1 convolution kernel convolution, and finally 3 feature layers with different sizes are obtained.
After three feature layers with different sizes are obtained, convolution prediction is carried out on the feature layers through (4+1+ c) x k convolution kernels with the size of 1 x 1, k is the number of preset bounding boxes (bounding box priors), 3 is taken as a default k, and c is the number of classes of a predicted target, wherein 4k parameters are responsible for predicting the offset of the target bounding boxes, k parameters are responsible for predicting the probability that the target is contained in the target bounding boxes, and ck parameters are responsible for predicting the probability that the k preset bounding boxes correspond to the c target classes. As shown in fig. 4, the dotted rectangle is a preset boundary, and the solid rectangle is a predicted boundary calculated from the offset of the network prediction. Wherein (c)x,cy) For the center coordinates of the preset bounding box on the feature map, (p)w,ph) To preset the width and height of the bounding box on the feature map, (t)x,th,tw,th) Are respectively netsBounding box center offset (t) of the envelope predictionx,ty) And aspect ratio (t)w,th),(bx,by,bw,bh) Is the final predicted target bounding box.
In order to accelerate network convergence, the left side of the center of a preset bounding box needs to be fixed in a cell, a sigmoid function is used to scale the prediction offset between (0, 1), and the scaling formula is shown as formula 1:
bx=(tx)+cx
by=(ty)+cy
Figure BDA0002590053790000061
Figure BDA0002590053790000062
the bounding box size is preset on each feature map as shown in table 1:
TABLE 1 Preset bounding Box
Figure BDA0002590053790000063
Figure BDA0002590053790000071
Target confidence may be understood as the probability of predicting the presence of a target within a rectangular box of the target, the target confidence loss Lconf(o, c) use is made of Binary Cross Entropy losses (Binary Cross Entropy), where oiE {0, 1} represents whether the target really exists in the predicted target bounding box i, 0 represents not existing, and 1 represents existing.
Figure BDA0002590053790000072
Sigmoid probability representing whether or not there is an object within the predicted object rectangular box i, whichThe formula is shown in formula 2:
Figure BDA0002590053790000073
wherein
Figure BDA0002590053790000074
Target class penalty Lcla(o, c) also used are binary cross-entropy losses, where oijE {0, 1} represents whether the jth class target really exists in the predicted target bounding box i, 0 represents not existing, and 1 represents existing.
Figure BDA0002590053790000075
The Sigmoid probability of the j-th class target in the network prediction target boundary box i is represented, and the formula is shown in formula 3:
Figure BDA0002590053790000076
wherein
Figure BDA0002590053790000077
Loss of target location Lloc(l, g) using the sum of squares of the difference between the true deviation value and the predicted deviation value, wherein
Figure BDA0002590053790000078
Indicating the predicted rectangular box coordinate offset,
Figure BDA0002590053790000079
indicating the coordinate offset between the bounding box and the default box that matches it, (b)x,by,bw,bh) For the predicted target rectangle frame parameter, (c)x,cy,cw,ch) As default rectangular box parameter, (g)x,gy,gw,gh) For the matched real target rectangular frame parameter, the formula is as followsFormula 4:
Figure BDA00025900537900000710
wherein
Figure BDA00025900537900000711
Figure BDA00025900537900000712
Figure BDA0002590053790000081
Figure BDA0002590053790000082
According to the detection method of the metal blank cap surface based on deep learning, provided by the embodiment of the invention, the machine vision is adopted to replace human eyes to detect and judge the defects, relevant information is firstly extracted from an image of an objective target, then the relevant information is processed through an intelligent algorithm, and the final processing result is applied to the detection of an actual product. The detection method of the metal blank cap surface based on deep learning provided by the embodiment of the invention solves the problems of low detection speed and low precision of the traditional manual visual defect detection, and also solves the problems of limited application fields and production scenes of other traditional defect detection.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.
Furthermore, it should be understood that although the present description refers to embodiments, not every embodiment may contain only a single embodiment, and such description is for clarity only, and those skilled in the art should integrate the description, and the embodiments may be combined as appropriate to form other embodiments understood by those skilled in the art.

Claims (9)

1. A detection method of surface defects of a metal blank cap based on deep learning is characterized by comprising the following steps:
step S1, analyzing the normal surface of the metal blank cap and the defect surface of the metal blank cap, and determining the defect type and defect characteristics of the surface of the metal blank cap to be detected;
step S2: acquiring an image of the surface of the metal blank cap to be detected by adopting a camera, and processing the image to obtain an image data set;
step S3: and constructing a detection model of the surface defects of the metal blank cap according to the image data set, extracting features of different layers of the image by adopting an improved deep convolution network, and learning and obtaining a defect type and range detection model based on the features, wherein the defect type and range detection model can detect the positions of the surface defects in the image.
2. The method for detecting surface defects of a metal blank cap based on deep learning of claim 1, wherein in step S1, the normal surface of the metal blank cap is used as a positive sample, and the defect surface of the metal blank cap is used as a negative sample.
3. The method of claim 1, wherein the defect types include scratch, mar, and stain.
4. The method for detecting surface defects of a metal blank cap based on deep learning of claim 1, wherein the step S2 specifically includes: and labeling the defect type and the defect area of the image on the surface of the metal blank cap to be detected acquired by the camera by using labeImg software, labeling each image to obtain a corresponding XML (extensive makeup language) labeled file, and storing the labeled image and the labeled XML labeled file respectively.
5. The method for detecting surface defects of a metal blank cap based on deep learning of claim 1, wherein the image capturing manner in step S2 is: on putting the thing platform, keep the detection surface up and place in putting thing platform central point with the metal stifle, set up the light source and play a face structure light in the perpendicular top of metal stifle, set up the camera and shoot the collection image in the perpendicular top of metal stifle.
6. The method for detecting the surface defect of the metal blind based on the deep learning of claim 1, wherein the improved deep convolutional network in the step S3 is a Yolov3 network, and the Yolov3 network is composed of a Darknet-53 structure and a multi-scale bounding box prediction structure, which are composed of a series of 1 x 1 and 3 x 3 convolutional layers.
7. The method as claimed in claim 6, wherein the Darknet-53 structure is composed of a series of 1 x 1 and 3 x 3 convolutional layers, each convolutional layer is followed by a BN layer and a LeakyReLU layer, and there are (2+1 x 2+1+2 x 2+1+8 x 2+1+4 x 2+1)53 convolutional layers in the Darknet-53.
8. The method as claimed in claim 6, wherein the multi-scale bounding box prediction structure is a bounding box prediction on three feature layers with different sizes, namely 52 × 52 feature layers, 26 × 26 feature layers and 13 × 13 feature layers.
9. The method as claimed in claim 8, wherein the prediction of the target bounding box is performed on three feature layers with different sizes, the convolution prediction is performed through (4+1+ c) xk convolution kernels with the size of 1 x 1, k is the number of preset bounding boxes, k is 3 as default, and c is the number of classes of the predicted target, wherein 4k parameters are responsible for predicting the offset of the target bounding box, k parameters are responsible for predicting the probability that the target is contained in the target bounding box, and ck parameters are responsible for predicting the probability that the k preset bounding boxes correspond to the c target classes.
CN202010693405.3A2020-07-172020-07-17Deep learning-based detection method for surface defects of metal blank capPendingCN111932503A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202010693405.3ACN111932503A (en)2020-07-172020-07-17Deep learning-based detection method for surface defects of metal blank cap

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202010693405.3ACN111932503A (en)2020-07-172020-07-17Deep learning-based detection method for surface defects of metal blank cap

Publications (1)

Publication NumberPublication Date
CN111932503Atrue CN111932503A (en)2020-11-13

Family

ID=73312592

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010693405.3APendingCN111932503A (en)2020-07-172020-07-17Deep learning-based detection method for surface defects of metal blank cap

Country Status (1)

CountryLink
CN (1)CN111932503A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109636772A (en)*2018-10-252019-04-16同济大学The defect inspection method on the irregular shape intermetallic composite coating surface based on deep learning
CN111292305A (en)*2020-01-222020-06-16重庆大学Improved YOLO-V3 metal processing surface defect detection method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109636772A (en)*2018-10-252019-04-16同济大学The defect inspection method on the irregular shape intermetallic composite coating surface based on deep learning
CN111292305A (en)*2020-01-222020-06-16重庆大学Improved YOLO-V3 metal processing surface defect detection method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王素琴等: "改进YOLOX的药品泡罩铝箔表面缺陷检测方法", 《图学学报》, vol. 43, no. 5, pages 803 - 814*
神罗NOCTIS: "深入理解YOLO v3实现细节 - 第2篇 backbone&network", pages 1, Retrieved from the Internet <URL:https://zhuanlan.zhihu.com/p/80056633>*

Similar Documents

PublicationPublication DateTitle
CN114663346B (en) A strip steel surface defect detection method based on improved YOLOv5 network
CN115131283B (en)Defect detection and model training method, device, equipment and medium for target object
CN106875381B (en)Mobile phone shell defect detection method based on deep learning
CN111612751A (en) Lithium battery defect detection method based on Tiny-yolov3 network embedded with grouped attention module
CN111915704A (en)Apple hierarchical identification method based on deep learning
CN112053317A (en)Workpiece surface defect detection method based on cascade neural network
CN113298809B (en)Composite material ultrasonic image defect detection method based on deep learning and superpixel segmentation
CN106127204A (en)A kind of multi-direction meter reading Region detection algorithms of full convolutional neural networks
CN119290896B (en) A method and system for detecting defects in textile products
CN118967672B (en) Industrial defect detection method, system, device and storage medium
CN116205876B (en)Unsupervised notebook appearance defect detection method based on multi-scale standardized flow
CN116012291A (en)Industrial part image defect detection method and system, electronic equipment and storage medium
CN108305260A (en)Detection method, device and the equipment of angle point in a kind of image
CN115035082B (en) A defect detection method for aircraft transparent parts based on YOLOv4 improved algorithm
CN111523540A (en) Deep learning-based metal surface defect detection method
Chen et al.Real-time defect detection of TFT-LCD displays using a lightweight network architecture
CN112001396B (en)Bearing surface deformation and character mixed defect image detection method
CN115829995A (en)Cloth flaw detection method and system based on pixel-level multi-scale feature fusion
CN113205136A (en)Real-time high-precision detection method for appearance defects of power adapter
CN113313678A (en)Automatic sperm morphology analysis method based on multi-scale feature fusion
CN119091236B (en) Ceramic packaging substrate detection method and system based on visual inspection and meta-learning
CN120235871B (en)Intelligent drug particle detection system and method based on image processing
CN115937077A (en)Workpiece surface micro-defect detection method based on improved SSD algorithm
CN115205210A (en) A Surface Defect Detection Method Based on Deep Autoencoder
CN114841992A (en) Defect detection method based on recurrent generative adversarial network and structural similarity

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20201113

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp