CN116091506B - Machine vision defect quality inspection method based on YOLOV5 - Google Patents
Machine vision defect quality inspection method based on YOLOV5 Download PDFInfo
- Publication number
- CN116091506B CN116091506B CN202310385347.1A CN202310385347A CN116091506B CN 116091506 B CN116091506 B CN 116091506B CN 202310385347 A CN202310385347 A CN 202310385347A CN 116091506 B CN116091506 B CN 116091506B
- Authority
- CN
- China
- Prior art keywords
- product
- defect
- quality inspection
- camera
- sided
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/0014—Image feed-back for automatic industrial control, e.g. robot with camera
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformation in the plane of the image
- G06T3/40—Scaling the whole image or part thereof
- G06T3/4038—Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/761—Proximity, similarity or dissimilarity measures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/778—Active pattern-learning, e.g. online learning of image or video features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/80—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level
- G06V10/806—Fusion, i.e. combining data from various sources at the sensor level, preprocessing level, feature extraction level or classification level of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Abstract
The invention discloses a quality inspection method for machine vision defects based on YOLOV5, which relates to the technical field of vision inspection product quality, and comprises the following steps of 1, respectively collecting a plurality of six-sided photos of standard qualified products and unqualified products with different defects; step 2, respectively forming a six-surface standard diagram training library of the qualified product and a six-surface diagram training library of the unqualified product; step 3, constructing a quality inspection platform based on a YOLOV5 algorithm; and step 4, judging whether the product to be detected is qualified or not. According to the invention, a plurality of sample images are acquired through a machine vision system under the same condition and are used as training materials of a quality inspection platform based on a deep learning YOLOV5 algorithm, the accuracy and efficiency of quality inspection can be greatly improved after the quality inspection platform is trained by a large amount of materials, the patterns of four reference characteristic points are adopted to simplify comparison, the concept of a distance difference threshold value is introduced in the comparison of the reference characteristic points, feedback data is provided for quality control of products to be inspected, and the improvement of product quality is facilitated.
Description
Technical Field
The invention relates to the technical field of visual inspection of product quality, in particular to a machine vision defect quality inspection method based on YOLOV 5.
Background
Visual inspection is to replace the human eye with a machine to make measurements and decisions. The visual detection means that a machine visual product, namely an image shooting device, is used for converting a shot target into an image signal, transmitting the image signal to a special image processing system, and converting the image signal into a digital signal according to pixel distribution, brightness, color and other information; the image system performs various operations on these signals to extract characteristics of the object, and further controls the operation of the on-site device according to the result of the discrimination. Is a valuable mechanism for production, assembly or packaging. It has immeasurable value in detecting defects and preventing defective products from being dispensed to consumers.
At present, visual systems are increasingly adopted to collect appearance pictures of products in automatic production, and then visual algorithms are matched to realize quality inspection of product defects, however, conventional methods generally only can realize quality inspection of defects on the upper surface of the products, are applicable to quality inspection of products with upper surfaces being mainly used surfaces, have low applicability to products with six surfaces having important characteristics, and also need manual work or other quality inspection procedures to finish quality inspection of defects on other surfaces.
Disclosure of Invention
In order to solve the technical problem that the quality inspection of six surfaces cannot be performed at one time when the quality inspection of an automated product is performed by adopting a visual technology, the invention provides a machine vision defect quality inspection method based on a YOLOV 5. The following technical scheme is adopted:
a quality inspection method for machine vision defects based on YOLOV5 comprises the following specific steps:
step 1, collecting a plurality of six-sided photos of standard qualified products, and collecting a plurality of six-sided photos of unqualified products with different defects;
step 4, judging whether the product to be detected is qualified or not, acquiring six-sided images to be detected of the product to be detected by adopting a machine vision system, splicing the six-sided images to be detected into a product image to be detected by running an image splicing algorithm, inputting the product image to be detected into a quality detection platform, acquiring the characteristics of the product image to be detected by the quality detection platform by adopting a YOLOV5 algorithm, and outputting the product qualification judgment when the similarity IOU value of the product image to be detected and the six-sided image of the standard qualified product is larger than a set similarity threshold value through similarity comparison;
and outputting the unqualified judgment of the product when the similarity IOU value of the six-surface to-be-detected drawing of the product and the six-surface drawing of the standard qualified product is smaller than or equal to the set similarity threshold value.
By adopting the technical scheme, the traditional visual inspection-based product defect quality inspection usually only acquires a top view or a three-dimensional view for quality inspection, and cannot be applicable to six products to be inspected with important characteristics, six surfaces of the product to be inspected are respectively acquired and inspected, and then the six surfaces of the product to be inspected are spliced, and six surfaces of the product to be inspected are inspected at one time, so that the visual quality inspection efficiency is greatly improved, and the visual inspection-based product quality inspection method is applicable to six surfaces of the product to be inspected with important characteristics;
in order to meet the quality inspection requirement, firstly, collecting a plurality of sample images of standard qualified products and unqualified products by adopting the same conditions through a machine vision system, and taking the sample images as training materials of a quality inspection platform based on a deep learning YOLOV5 algorithm, wherein splicing operation is required after the materials of the standard qualified products and the unqualified products are collected, and finally, the accuracy and the efficiency of quality inspection can be greatly improved after the quality inspection platform is trained by a large amount of materials;
the quality inspection platform is a visual server essentially, various visual algorithms are carried in the visual server, the quality inspection platform collects the characteristics of a product to-be-inspected graph by using a YOLOV5 algorithm, and through similarity comparison, when the similarity IOU value of the product to-be-inspected graph and a standard qualified product six-face graph is larger than a set similarity threshold value, the judgment of product qualification is output.
Optionally, in step 2, a YOLOV5 target detection algorithm is adopted to detect defect characteristics of six-sided photos of a plurality of sets of unqualified products, and a defect characteristic comparison library is formed.
Optionally, the YOLOV5 deep learning network of the YOLOV5 target detection algorithm model uses defect feature comparison library data to perform iterative training, scales and fills gray edges to 224×224 in size in a width-height equal proportion manner in the defect feature comparison library, extracts three effective feature layers (52,52,256), (26,26,512) and (13,13,1024) from a training image sample through a Focus network structure, and builds a fourth feature FPN layer based on the three effective feature layers.
By adopting the technical scheme, after the defect characteristics in the defect characteristic comparison library are captured by a YOLOV5 target detection algorithm, a characteristic layer based on the defect characteristics is directly obtained, and finally the characteristic layer is divided into three effective characteristic layers according to the size of the defect characteristics, wherein the training image sample with the characteristic layer being (52,52,256) corresponds to a small target, the characteristic layer is a target in detection granularity grid correspondence (26,26,512), the characteristic layer is a large target in detection granularity grid correspondence (13,13,1024), and a fourth characteristic FPN layer can be obtained after the 3 initial characteristic layers are subjected to convolution processing operation.
Optionally, the features of the three effective feature layers (52,52,256), (26,26,512) and (13,13,1024) are extracted by a 3×3 convolution manner to fuse the different features, and then prediction is performed on the feature map obtained by fusion to obtain a fourth feature FPN layer.
By adopting the technical scheme, the Focus network structure converts the information on the w-h plane into the channel dimension, and then different features are extracted in a 3X 3 convolution mode. By adopting the method, the information loss caused by downsampling can be reduced, and the characteristic represented by the fourth characteristic FPN layer is more accurate.
Optionally, at least four reference feature points on the fourth feature FPN layer are sampled, where the reference feature points are feature areas smaller than 3 pixels, the brightness variation degree in the feature areas is greater than 50%, the four reference feature points are respectively extracted and constructed to form a defect fast comparison layer based on the four reference feature points, a distance detection algorithm is adopted to measure the mutual distance between the four reference feature points, and the distance data is used as an additional comparison item of the defect fast comparison layer.
Optionally, a shading detection algorithm is used to detect the shading change of the fourth feature FPN layer.
By adopting the technical scheme, because the defect feature quantity in most unqualified products is more, the four reference feature points are simplified and compared by adopting the mode of the four reference feature points, the defect feature can be accurately positioned by adding the position distance relation data to the four reference feature points, the principle is similar to the fingerprint feature point identification, the feature with the largest defect feature is the brightness change, and therefore, the brightness change detection can be realized by adopting the brightness detection algorithm, and the four reference feature points can be quickly obtained.
Optionally, the machine vision defect quality inspection method further includes step 41, outputting product defect characteristics, performing defect characteristic traversal before comparing the similarity of the product to-be-inspected graph with six-sided graph pieces of standard qualified products, calling a defect quick comparison layer of a defect characteristic comparison library to traverse the product to-be-inspected graph, if the matching is successful on the characteristics of four reference characteristic points, the matching similarity IOU value is greater than 0.9, and the mutual distance difference between the four reference characteristic points is smaller than a distance difference threshold, directly judging that the product is unqualified by the quality inspection platform, performing frame selection processing on the defect positions, and displaying based on frame selection marks.
Optionally, the distance difference value refers to an absolute value calculation of a difference between a distance value between any two reference feature points of the product to be detected and a distance value between two corresponding reference feature points in the defect rapid comparison layer, and then a ratio operation is performed between the absolute value and the distance value between the two corresponding reference feature points in the defect rapid comparison layer, so as to set any two references of the product to be detectedThe distance value between the feature points is S, the distance value between the corresponding two reference feature points in the defect rapid comparison layer is S1, and the distance difference threshold value is DThe distance difference threshold is set to 0.05-0.1.
By adopting the technical scheme, the quality inspection platform makes unqualified judgment of the product to be inspected and marks specific defect positions and defect types, so that positive feedback can be made on the production of the product by the defect quality inspection of the product, and the improvement of the product qualification rate is facilitated;
specifically, in order to mark a specific defect position and defect type, firstly, defect characteristic similarity is compared based on a defect quick comparison layer, if the similarity IOU value is larger than 0.9, the defect type is determined, then, position data is compared, the concept of a distance difference threshold is introduced, the distance difference threshold is actually a key for positioning the defect position, positioning of the defect position can be completed if matching is successful, finally, a quality inspection platform outputs unqualified judgment of a product to be inspected, meanwhile, box selection marking is carried out on an unqualified area, and the defect type is marked, so that feedback data is provided for quality control of the product to be inspected, and improvement of product quality is facilitated.
The utility model provides a machine vision system for obtain six of waiting to examine the picture of product to be examined, including transparent platform, bottom camera, portal frame and the top camera module that is used for supporting the product to be examined, transparent platform sets up the exit at waiting to examine the product production line, the bottom camera sets up in the below of transparent platform for shoot the bottom view of waiting to examine the product, the portal frame sets up in the top of transparent platform, the top camera module includes front portion camera, rear portion camera, left side camera, right side camera and overlook the camera, front portion camera, rear portion camera, left side camera, right side camera and overlook the camera and hang respectively on the portal frame, be used for shooing front portion view, rear portion view, left side view, right side view and the top view of waiting to examine the product respectively, bottom camera, front portion camera, rear portion camera, left side camera, right side camera and overlook the camera and be connected with quality inspection platform communication respectively.
Through adopting above-mentioned technical scheme, traditional machine vision system can only acquire the picture above the product, adopts above-mentioned structure can accomplish the front portion view of detection product, rear portion view, left side view, right side view and the acquisition of top view, provides six under the same state for follow-up quality control once only and waits to examine the picture, because is once shooting simultaneously, so the photo condition is unanimous, is favorable to follow-up quality control platform to make quality control result judgement more.
In summary, the present invention includes at least one of the following beneficial technical effects:
the invention can provide a quality inspection method for machine vision defects based on YOLOV5, which is characterized in that a plurality of sample images are acquired for standard qualified products and unqualified products by adopting the same condition through a machine vision system, the sample images are used as training materials of a quality inspection platform based on a deep learning YOLOV5 algorithm, the accuracy and the efficiency of quality inspection can be greatly improved after the quality inspection platform is trained by a large amount of materials, the defect characteristics can be accurately positioned by adopting a mode of four reference characteristic points to simplify comparison, the four reference characteristic points are added with position distance relation data, the brightness and darkness change detection can be realized by adopting a brightness detection algorithm, the concept of distance difference threshold values is introduced in the comparison of the reference characteristic points, meanwhile, frame selection marking is carried out on unqualified areas, the defect types are marked, feedback data are provided for quality control of the products to be inspected, and the improvement of the quality of the products is facilitated.
Drawings
FIG. 1 is a schematic flow chart of a method for inspecting quality of machine vision defects based on Yolov5 of the present invention;
FIG. 2 is a schematic diagram of the electrical device connection principle of a machine vision system of the present invention;
FIG. 3 is a schematic illustration of the effect of a fast comparison layer of defects in a machine vision defect quality inspection method based on Yolov5 of the present invention.
Reference numerals illustrate: 1. a bottom camera; 2. a front camera; 3. a rear camera; 4. a left side camera; 5. a right side camera; 6. a top view camera; 100. and a quality inspection platform.
Description of the embodiments
The present invention will be described in further detail with reference to the accompanying drawings.
The embodiment of the invention discloses a machine vision defect quality inspection method based on YOLOV 5.
Referring to fig. 1-3, a YOLOV 5-based machine vision defect quality inspection method comprises the following specific steps:
step 1, collecting a plurality of six-sided photos of standard qualified products, and collecting a plurality of six-sided photos of unqualified products with different defects;
step 4, judging whether the product to be detected is qualified or not, acquiring six-sided images of the product to be detected by adopting a machine vision system, splicing the six-sided images to form a product image to be detected by running an image splicing algorithm, inputting the product image to be detected into a quality inspection platform 100, acquiring the characteristics of the product image to be detected by the quality inspection platform 100 by adopting a YOLOV5 algorithm, and outputting the judgment of the product qualification when the similarity IOU value of the product image to be detected and the six-sided image of the standard qualified product is larger than a set similarity threshold value through similarity comparison;
and outputting the unqualified judgment of the product when the similarity IOU value of the six-surface to-be-detected drawing of the product and the six-surface drawing of the standard qualified product is smaller than or equal to the set similarity threshold value.
The traditional visual inspection-based product defect quality inspection usually only acquires a top view or a three-dimensional view for quality inspection, and cannot be applied to products to be inspected with six important characteristics, six surfaces of the products to be inspected are respectively acquired and inspected, and then the six surfaces of the products to be inspected are spliced, and the six surfaces of the products to be inspected are inspected at one time, so that the visual quality inspection efficiency is greatly improved, and the visual inspection-based product defect quality inspection method is applicable to the products to be inspected with six surfaces of the products to be inspected with the important characteristics;
in order to meet the quality inspection requirement, firstly, collecting a plurality of sample images of standard qualified products and unqualified products by adopting the same conditions through a machine vision system, and taking the sample images as training materials of a quality inspection platform based on a deep learning YOLOV5 algorithm, wherein splicing operation is required after the materials of the standard qualified products and the unqualified products are collected, and finally, the accuracy and the efficiency of quality inspection can be greatly improved after the quality inspection platform is trained by a large amount of materials;
the quality inspection platform 100 is essentially a visual server, wherein various visual algorithms are carried, the quality inspection platform 100 adopts a YOLOV5 algorithm to collect characteristics of a product to-be-inspected graph, and through similarity comparison, when the similarity IOU value of the product to-be-inspected graph and a six-surface graph of a standard qualified product is larger than a set similarity threshold value, the judgment of product qualification is output, and the judgment mode is to compare the six-surface graph of the standard qualified product first, namely to estimate the priority qualification, so that the quality inspection platform is more suitable for quality inspection of product defects with qualification rate larger than 90%, and defect quality inspection efficiency can be greatly improved.
In the step 2, a Yolov5 target detection algorithm is adopted to detect the defect characteristics of six-sided photos of a plurality of sets of unqualified products, and a defect characteristic comparison library is formed.
The YOLOV5 deep learning network of the YOLOV5 target detection algorithm model uses defect feature comparison library data to carry out iterative training, the width and height equal proportion of pictures in the defect feature comparison library are scaled and filled with gray edges to 224×224 size input, a training image sample is subjected to Focus network structure to extract three effective feature layers (52,52,256), (26,26,512) and (13,13,1024) respectively, and a fourth feature FPN layer is constructed based on the three effective feature layers.
After the defect features in the defect feature comparison library are captured by a YOLOV5 target detection algorithm, a feature layer based on the defect features is directly obtained, and finally the feature layer is divided into three effective feature layers according to the size of the defect features, wherein the training image sample with the feature layer being (52,52,256) corresponds to a small target, the feature layer is a target in detection granularity grid correspondence (26,26,512), the feature layer is a large target in detection granularity grid correspondence (13,13,1024), and a fourth feature FPN layer can be obtained after convolution processing operation is performed on the 3 initial feature layers.
And extracting different features from the features of the three effective feature layers (52,52,256), (26,26,512) and (13,13,1024) in a 3×3 convolution mode, fusing, and predicting on the fused feature map to obtain a fourth feature FPN layer.
The Focus network structure converts the information on the w-h plane to the channel dimension, and then extracts different features by means of 3×3 convolution. By adopting the method, the information loss caused by downsampling can be reduced, and the characteristic represented by the fourth characteristic FPN layer is more accurate.
Sampling at least four reference feature points on a fourth feature FPN layer, wherein the reference feature points are feature areas smaller than 3 pixel points, the brightness variation degree in the feature areas is larger than 50%, respectively extracting the four reference feature points and constructing a defect rapid comparison layer based on the four reference feature points, measuring the mutual distance between the four reference feature points by adopting a distance detection algorithm, and taking distance data as an additional comparison item of the defect rapid comparison layer.
And detecting the brightness change of the fourth characteristic FPN layer by adopting a brightness detection algorithm.
Because the defect feature quantity in most unqualified products is more, the four reference feature points are simplified and compared by adopting the mode of the four reference feature points, the defect feature can be accurately positioned by adding the position distance relation data to the four reference feature points, the principle is similar to the fingerprint feature point identification, the feature with the largest defect feature is the brightness change, and therefore, the brightness change detection can be realized by adopting the brightness detection algorithm, and the four reference feature points can be quickly obtained.
The machine vision defect quality inspection method further comprises a step 41 of outputting defect characteristics of the product, wherein before the similarity of the to-be-inspected image of the product and the six-sided image of the standard qualified product is compared, the defect characteristic traversal is firstly carried out, a defect quick comparison layer of a defect characteristic comparison library is called to traverse the to-be-inspected image of the product, if the matching is successful, the matching similarity IOU value is larger than 0.9, the mutual distance difference between the four reference characteristic points is smaller than a distance difference threshold value, the quality inspection platform 100 directly judges that the product is unqualified, meanwhile, the defect position is subjected to frame selection processing, and the display is carried out based on a frame selection mark.
The distance difference value refers to the absolute value calculation of the difference between the distance value between any two reference feature points of the product to be inspected and the distance value between the corresponding two reference feature points in the defect rapid comparison layer, then the ratio operation is carried out on the absolute value and the distance value between the corresponding two reference feature points in the defect rapid comparison layer, the distance value between any two reference feature points of the product to be inspected is set as S1, the distance difference threshold value is set as D, and thenThe distance difference threshold is set to 0.05-0.1.
The quality inspection platform 100 makes unqualified judgment and marks specific defect positions and defect types at the same time, so that the product defect quality inspection can positively feed back the production of the product, and the improvement of the product qualification rate is facilitated;
specifically, in order to mark a specific defect position and defect type, firstly, defect characteristic similarity is compared based on a defect rapid comparison layer, if the similarity IOU value is greater than 0.9, the defect type is determined, then, position data is compared, the concept of a distance difference threshold is introduced, the distance difference threshold is actually a key for positioning the defect position, positioning of the defect position can be completed if matching is successful, finally, the quality inspection platform 100 outputs unqualified judgment of a product to be inspected, meanwhile, box selection marking is carried out on an unqualified area, and the defect type is marked, so that feedback data is provided for quality control of the product to be inspected, and improvement of product quality is facilitated.
The utility model provides a machine vision system for obtain six pictures of waiting to examine of product, including being used for supporting the transparent platform of waiting to examine the product, bottom camera 1, portal frame and top camera module, transparent platform sets up the exit at waiting to examine product production line, bottom camera 1 sets up in the below of transparent platform, a bottom view for shoot waiting to examine the product, the portal frame sets up in the top of transparent platform, top camera module includes front camera 2, rear camera 3, left side camera 4, right side camera 5 and overlook camera 6, front camera 2, rear camera 3, left side camera 4, right side camera 5 and overlook camera 6 mount respectively on the portal frame, be used for shooing front view of waiting to examine the product respectively, rear view, left side view, right side view and top view, bottom camera 1, front camera 2, rear camera 3, left side camera 4, right side camera 5 and overlook camera 6 respectively with quality inspection platform 100 communication connection.
The traditional machine vision system can only acquire the picture above the product, and the front view, the rear view, the left side view, the right side view and the top view of the detected product can be acquired by adopting the structure, so that six to-be-detected pictures in the same state are provided for subsequent quality inspection at one time, and the light and film conditions are consistent because of one-time simultaneous shooting, thereby being more beneficial to the subsequent quality inspection platform 100 to judge quality inspection results.
The implementation principle of the machine vision defect quality inspection method based on the YOLOV5 provided by the embodiment of the invention is as follows:
in a product quality inspection scene of a specific industrial production line, the product to be inspected after the processing is completed at a certain moment is conveyed to a designated position of a transparent platform from the industrial production line, and a picture to be inspected is simultaneously shot by a bottom camera 1, a front camera 2, a rear camera 3, a left camera 4, a right camera 5 and a top camera 6 and is transmitted to the quality inspection platform 100.
The quality inspection platform 100 operates an image stitching algorithm to stitch six-sided images to form a product image, the product image is input to the quality inspection platform 100,
firstly, traversing defect characteristics, calling a defect quick comparison layer of a defect characteristic comparison library to traverse a product to-be-inspected graph, analyzing defects after workers find out the unqualified products, adjusting the process and playing a role in feeding back the product qualification rate after matching the characteristics of four successfully-matched reference characteristic points with the characteristics of surface cracks, wherein the matching similarity IOU values are larger than 0.9, and the mutual distance difference between the four reference characteristic points is smaller than a distance difference threshold value of 0.05.
The above embodiments are not intended to limit the scope of the present invention, and therefore: all equivalent changes in structure, shape and principle of the invention should be covered in the scope of protection of the invention.
Claims (7)
1. A quality inspection method for machine vision defects based on YOLOV5 is characterized in that: the method comprises the following specific steps:
step 1, collecting a plurality of six-sided photos of standard qualified products, and collecting a plurality of six-sided photos of unqualified products with different defects;
step 2, respectively running an image stitching algorithm on six photos of a standard qualified product and a unqualified product to regenerate a six-sided image of the standard qualified product and a six-sided image of the unqualified product, wherein the six-sided image of the standard qualified product comprises all appearance characteristics of six faces of the standard qualified product, the six-sided image of the unqualified product comprises all appearance characteristics of six faces of the unqualified product, a six-sided standard image training library of the qualified product is formed by a plurality of six-sided images of the standard qualified product, and a six-sided image training library of the unqualified product is formed by a plurality of six-sided images of the unqualified product;
step 3, a quality inspection platform (100) based on a YOLOV5 algorithm is built, and the quality inspection platform (100) is trained by adopting the six-face standard diagram training library of the qualified products and the six-face diagram training library of the unqualified products generated in the step 2;
step 4, judging whether the product to be detected is qualified or not, acquiring six-sided images to be detected of the product to be detected by adopting a machine vision system, splicing the six-sided images to be detected into a product image to be detected by running an image splicing algorithm, inputting the product image to be detected into a quality inspection platform (100), acquiring the characteristics of the product image to be detected by the quality inspection platform (100) by adopting a YOLOV5 algorithm, and outputting the judgment of the product qualification when the similarity IOU value of the product image to be detected and the six-sided image of the standard qualified product is larger than a set similarity threshold value through similarity comparison;
outputting the unqualified judgment of the product when the similarity IOU value of the six-surface to-be-detected drawing of the product and the six-surface drawing of the standard qualified product is smaller than or equal to a set similarity threshold value;
step 4 further includes step 41, outputting product defect characteristics, namely performing defect characteristic traversal before comparing the similarity of the product to be detected with the six-sided drawing pieces of the standard qualified product, invoking a defect quick comparison layer of a defect characteristic comparison library to traverse the product to be detected, and if the matching is successful, matching the characteristics of four reference characteristic points, wherein the similarity IOU value is greater than 0.9, and the mutual distance difference between the four reference characteristic points is less than a distance difference threshold, directly judging that the product is unqualified by a quality inspection platform (100), and meanwhile, performing frame selection processing on the defect positions and displaying based on frame selection marks;
the distance difference value refers to the absolute value calculation of the difference between the distance value between any two reference feature points of the product to be detected and the distance value between the corresponding two reference feature points in the defect rapid comparison layer, then the ratio operation is carried out on the absolute value and the distance value between the corresponding two reference feature points in the defect rapid comparison layer, the distance value between any two reference feature points of the product to be detected is set as S1, the distance difference threshold value is set as D, and thenThe distance difference threshold is set to 0.05-0.1.
2. A YOLOV 5-based machine vision defect quality inspection method according to claim 1, characterized in that: in the step 2, a Yolov5 target detection algorithm is adopted to detect the defect characteristics of six-sided photos of a plurality of sets of unqualified products, and a defect characteristic comparison library is formed.
3. A YOLOV 5-based machine vision defect quality inspection method according to claim 2, characterized in that: the YOLOV5 deep learning network of the YOLOV5 target detection algorithm model uses defect feature comparison library data to carry out iterative training, the width and height equal proportion of pictures in the defect feature comparison library are scaled and filled with gray edges to 224×224 size input, a training image sample is subjected to Focus network structure to extract three effective feature layers (52,52,256), (26,26,512) and (13,13,1024) respectively, and a fourth feature FPN layer is constructed based on the three effective feature layers.
4. A YOLOV 5-based machine vision defect quality inspection method according to claim 3, characterized in that: and extracting different features from the features of the three effective feature layers (52,52,256), (26,26,512) and (13,13,1024) in a 3×3 convolution mode, fusing, and predicting on the fused feature map to obtain a fourth feature FPN layer.
5. The YOLOV 5-based machine vision defect quality inspection method of claim 4, wherein: sampling at least four reference feature points on a fourth feature FPN layer, wherein the reference feature points are feature areas smaller than 3 pixel points, the brightness variation degree in the feature areas is larger than 50%, respectively extracting the four reference feature points and constructing a defect rapid comparison layer based on the four reference feature points, measuring the mutual distance between the four reference feature points by adopting a distance detection algorithm, and taking distance data as an additional comparison item of the defect rapid comparison layer.
6. The YOLOV 5-based machine vision defect quality inspection method of claim 5, wherein: and (3) detecting the brightness change of the fourth characteristic FPN layer by adopting a brightness detection algorithm, marking all areas with the brightness change degree of more than 50%, and determining four characteristic points with the maximum brightness change degree as reference characteristic points.
7. A machine vision system, characterized by: the method for inspecting quality of machine vision defects based on YOLOV5 used for obtaining six-sided images to be inspected of products to be inspected comprises a transparent platform for supporting the products to be inspected, a bottom camera (1), a portal frame and a top camera module, wherein the transparent platform is arranged at an outlet of a production line of the products to be inspected, the bottom camera (1) is arranged below the transparent platform and is used for shooting bottom views of the products to be inspected, the portal frame is arranged above the transparent platform, the top camera module comprises a front camera (2), a rear camera (3), a left side camera (4), a right side camera (5) and a top camera (6), and the front camera (2), the rear camera (3), the left side camera (4), the right side camera (5) and the top camera (6) are respectively mounted on the portal frame and are respectively used for shooting front views, rear views, left side views, right side views and top views of the products to be inspected, and the bottom camera (1), the front camera (2), the rear camera (3), the left side camera (4), the right side camera (5) and the top camera (6) are respectively connected with the quality inspection platform (100).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310385347.1A CN116091506B (en) | 2023-04-12 | 2023-04-12 | Machine vision defect quality inspection method based on YOLOV5 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310385347.1A CN116091506B (en) | 2023-04-12 | 2023-04-12 | Machine vision defect quality inspection method based on YOLOV5 |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116091506A CN116091506A (en) | 2023-05-09 |
CN116091506B true CN116091506B (en) | 2023-06-16 |
Family
ID=86199577
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310385347.1A Active CN116091506B (en) | 2023-04-12 | 2023-04-12 | Machine vision defect quality inspection method based on YOLOV5 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116091506B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116883417B (en) * | 2023-09-08 | 2023-12-05 | 武汉东方骏驰精密制造有限公司 | Workpiece quality inspection method and device based on machine vision |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019032268A (en) * | 2017-08-09 | 2019-02-28 | 日立金属株式会社 | Surface defect determination method and surface defect inspection device |
CN111006608A (en) * | 2019-12-17 | 2020-04-14 | 湖南科创信息技术股份有限公司 | Transparent plate through hole visual detection system and method |
CN114627082A (en) * | 2022-03-16 | 2022-06-14 | 东南大学 | Photovoltaic module EL defect detection method based on improved YOLOv5 network |
CN114742818A (en) * | 2022-05-09 | 2022-07-12 | 苏州荣视软件技术有限公司 | Visual defect detection system based on industrial area array camera and detection method thereof |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08247962A (en) * | 1995-03-10 | 1996-09-27 | Sumitomo Chem Co Ltd | Defect detection method and apparatus for color filter and defect detection method and apparatus for panel display |
JP4351522B2 (en) * | 2003-11-28 | 2009-10-28 | 株式会社日立ハイテクノロジーズ | Pattern defect inspection apparatus and pattern defect inspection method |
JP5549364B2 (en) * | 2010-05-11 | 2014-07-16 | 株式会社Sumco | Wafer defect inspection apparatus and wafer defect inspection method |
CN108242054A (en) * | 2018-01-09 | 2018-07-03 | 北京百度网讯科技有限公司 | A kind of steel plate defect detection method, device, equipment and server |
CN111462056B (en) * | 2020-03-20 | 2023-09-01 | 深圳科瑞技术股份有限公司 | Workpiece surface defect detection method, device, equipment and storage medium |
CN112345539A (en) * | 2020-11-05 | 2021-02-09 | 菲特(天津)检测技术有限公司 | Aluminum die casting surface defect detection method based on deep learning |
CN114705693B (en) * | 2022-01-30 | 2023-03-28 | 中信云网有限公司 | AI visual inspection device and system for shell structure defect detection |
CN115147397A (en) * | 2022-07-25 | 2022-10-04 | 南昌大学 | X-ray image defect detection method for strain clamp of power transmission line |
CN115205290B (en) * | 2022-09-15 | 2022-11-18 | 深圳市合成快捷电子科技有限公司 | Online detection method and system for PCB production process |
CN115457037B (en) * | 2022-11-10 | 2023-03-24 | 澳润(山东)药业有限公司 | Raw material quality inspection method for donkey-hide gelatin product production |
-
2023
- 2023-04-12 CN CN202310385347.1A patent/CN116091506B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2019032268A (en) * | 2017-08-09 | 2019-02-28 | 日立金属株式会社 | Surface defect determination method and surface defect inspection device |
CN111006608A (en) * | 2019-12-17 | 2020-04-14 | 湖南科创信息技术股份有限公司 | Transparent plate through hole visual detection system and method |
CN114627082A (en) * | 2022-03-16 | 2022-06-14 | 东南大学 | Photovoltaic module EL defect detection method based on improved YOLOv5 network |
CN114742818A (en) * | 2022-05-09 | 2022-07-12 | 苏州荣视软件技术有限公司 | Visual defect detection system based on industrial area array camera and detection method thereof |
Non-Patent Citations (2)
Title |
---|
一种陶质焊接衬垫产品质量检测方法;肖书浩;《机械设计与制造》;139-142+146 * |
基于电镀产品表面缺陷检测系统研究;黄东阳;;建材与装饰(第36期);196-197 * |
Also Published As
Publication number | Publication date |
---|---|
CN116091506A (en) | 2023-05-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109900711A (en) | Workpiece, defect detection method based on machine vision | |
CN111325713A (en) | Wood defect detection method, system and storage medium based on neural network | |
CN111047655A (en) | High-definition camera cloth defect detection method based on convolutional neural network | |
CN114399672A (en) | Railway wagon brake shoe fault detection method based on deep learning | |
CN112233067A (en) | Hot rolled steel coil end face quality detection method and system | |
WO2023168972A1 (en) | Linear array camera-based copper surface defect detection method and apparatus | |
CN102175692A (en) | System and method for detecting defects of fabric gray cloth quickly | |
CN108090896B (en) | Wood board flatness detection and machine learning method and device and electronic equipment | |
CN106355579A (en) | Defect detecting method of cigarette carton surface wrinkles | |
CN116091506B (en) | Machine vision defect quality inspection method based on YOLOV5 | |
CN105223208B (en) | A kind of circuit board detecting template and preparation method thereof, circuit board detecting method | |
CN112819844B (en) | Image edge detection method and device | |
CN110554052A (en) | artificial board surface defect detection method and system | |
CN106872488A (en) | A kind of double surface defect visible detection methods of rapid large-area transparent substrate and device | |
CN114972177A (en) | Road disease identification management method and device and intelligent terminal | |
CN110728269B (en) | High-speed rail contact net support pole number plate identification method based on C2 detection data | |
CN116071315A (en) | Product visual defect detection method and system based on machine vision | |
CN114881987A (en) | Improved YOLOv 5-based hot-pressing light guide plate defect visual detection method | |
CN114820439A (en) | PCB bare board defect detection system and method based on AOI | |
JPH08189904A (en) | Surface defect detector | |
CN210377552U (en) | Fruit is multiaspect image acquisition device for classification | |
CN115947066B (en) | Belt tearing detection method, device and system | |
CN116465315A (en) | Automatic screen quality detection method and system | |
CN115937555A (en) | Industrial defect detection algorithm based on standardized flow model | |
CN110111317A (en) | A kind of dispensing visual detection method for quality based on intelligent robot end |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |