CN115100393A - Deep learning-based PCB welding defect detection method - Google Patents

Deep learning-based PCB welding defect detection method Download PDF

Info

Publication number
CN115100393A
CN115100393A CN202210722138.7A CN202210722138A CN115100393A CN 115100393 A CN115100393 A CN 115100393A CN 202210722138 A CN202210722138 A CN 202210722138A CN 115100393 A CN115100393 A CN 115100393A
Authority
CN
China
Prior art keywords
defect detection
deep learning
size
detection method
anchor frame
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
CN202210722138.7A
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.)
Changzhou University
Original Assignee
Changzhou University
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 Changzhou University filed Critical Changzhou University
Priority to CN202210722138.7A priority Critical patent/CN115100393A/en
Publication of CN115100393A publication Critical patent/CN115100393A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • G06V10/763Non-hierarchical techniques, e.g. based on statistics of modelling distributions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing 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/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of defect detection, in particular to a PCB welding defect detection method based on deep learning, which comprises the steps of performing augmentation processing on a PCB image in a data set, completing conversion of data format and size, and dividing the data set; determining the number of regression prior frames by using a K-Means algorithm, and determining the size of an anchor frame by using a scaling formula; adjusting the receptive field of the NECK area, and adding an SE module when the downsampling of the Backbone area is completed; and inputting the converted data file into a training function for training, and setting training parameters. The invention solves the problems of low efficiency and low precision of the current PCB defect detection, continuously enhances the defect recognition capability of a machine through deep learning training, determines the size of an anchor frame by utilizing a K-Means algorithm, and accurately positions the defect part through an anchor frame scaling formula, thereby improving the defect detection rate and preventing the poor circuit board from flowing out.

Description

Deep learning-based PCB welding defect detection method
Technical Field
The invention relates to the technical field of defect detection, in particular to a PCB welding defect detection method based on deep learning.
Background
Printed Circuit Boards (PCBs) are essential components of all electronic devices and have evolved over the years into a complex assembly. The defects of missing holes, mouse bites, open circuits, short circuits, open circuits, stray, false copper and the like exist in the production process of the current PCB, the appearance of the PCB is influenced, and the use performance of the PCB can be damaged. The traditional PCB image to be detected is compared with a pre-specified standard template in the detection process based on machine vision detection defects, the detection flow is complex and is easily influenced by the environment, and the detection speed and the detection precision cannot be adapted to a quick production link. The target detection method based on deep learning can be simply divided into a two-stage algorithm represented by an R-CNN series and a one-stage algorithm represented by an SSD or a YOLO series, and the defect detection problem is converted into a classification regression problem. The PCB defect detection based on deep learning is that learning training is carried out through a mass data set, a defect rule is searched from the defect rule and parameters are saved, when a target to be detected is changed, only a new data set is needed to be added for learning training, and compared with a traditional machine learning method, the method based on deep learning is stronger in adaptability, higher in detection speed and precision and capable of adapting to a quick production detection link.
Disclosure of Invention
Aiming at the defects of the existing algorithm, the invention solves the problems of low efficiency and low precision of the current PCB defect detection, continuously enhances the defect recognition capability of the machine through deep learning training, utilizes the K-Means algorithm to determine the size of the anchor frame, and precisely positions the defect part through the anchor frame scaling formula, thereby improving the defect detection rate and preventing the poor circuit board from flowing out.
The technical scheme adopted by the invention is as follows: a PCB welding defect detection method based on deep learning comprises the following steps:
s1, performing amplification processing on the PCB image in the data set, completing conversion of data format and size, and dividing the data set;
s2, determining the number of regression prior frames by using a K-Means algorithm, and determining the size of an anchor frame by using a scaling formula;
further, the anchor frame size is recalculated using a 1-IOU based K-means algorithm to generate 9 sets of anchor frames, 12,31 13,15 16,26 20,13 33,66 38,48 45,54 56,34 81, 87.
Further, the scaling formula is:
x′ 1 =Ax 1 (1)
Figure BDA0003711882600000021
Figure BDA0003711882600000022
in the formula, x i The width of the ith group of anchor frames (in the order of the width size of the anchor frames from small to large), i is 2,3.. 9; x' i The width of the zoomed anchor frame; a is the reduction multiple of the anchor frame, and A is 0.65; y is i The height of the ith group of anchor frames; y' i Is the zoomed anchor frame height.
S3, adjusting the receptive field of the NECK area, and adding an SE module when the backhaul area finishes downsampling;
further, the method comprises the steps of deleting 19 × 19 characteristic branches of the receptor field of the NECK region and adding 152 × 152 characteristic branches;
s4, inputting the converted data file into an improved Yolov5S network for training, and setting training parameters;
further, the iteration number epoch is set to 200, and the img-size is set to 608 × 608.
The invention has the beneficial effects that:
1. the method can quickly learn the characteristics of the tiny defects, and solves the problems of low efficiency and low accuracy of the traditional defect detection; the method for clustering Anchors in the K-Means algorithm is set to be based on the 1-IOU distance, and scaling processing is carried out according to the defect types, so that the defect types can be better covered.
Drawings
FIG. 1 is a PCB defect detection flow chart based on deep learning of the present invention;
FIG. 2 is a graph of the detection effect of the method of the present invention in FIG. 1;
FIG. 3 is a graph of the detection effect of the method of the present invention FIG. 2;
FIG. 4 is a graph of the detection effect of the method of the present invention shown in FIG. 3.
Detailed Description
The invention will be further described with reference to the accompanying drawings and examples, which are simplified schematic drawings and illustrate only the basic structure of the invention in a schematic manner, and therefore only show the structures relevant to the invention.
As shown in fig. 1, a PCB welding defect detection method based on deep learning includes the following steps:
s1, performing amplification processing on the PCB image in the data set to complete conversion of data format and size, and dividing the data set;
performing amplification processing on the PCB image in the data set, wherein the amplification processing comprises cutting, splicing and rotating, labeling part of the defects of the PCB image by adopting Labelme software to obtain a generated json format label file, wherein the label file comprises six common defects and defect category names of the PCB, converting the xml file in the original data set and the json file in the amplification part into a txt file, and enabling the image and the label to be as follows: 2, dividing the training set into an original training set and an original testing set in proportion;
the method is characterized in that a single picture in the original data set is randomly combined corresponding to a single defect to form multiple defects of the picture, and meanwhile, the method for changing the brightness and adding Gaussian noise is adopted, so that the value of a boundary frame is not changed, different environments under various actual production can be met, and the overfitting risk of a neural network during training is reduced;
the defect images of the PCBs in the data set are captured by conventional industrial cameras, and usually have a larger resolution, such as 3034 x 1586 and 2544 x 2516, and the defect images are smaller in proportion than the whole image, so that all the image sizes are set to 608 x 608 in the training function, and the determination of the anchor frame is facilitated.
S2, inputting the converted data file into a Yolov5S network, wherein the Yolov5S network mainly comprises an input end, a backsbone, a Neck and a preview, and compared with Yolov5m, Yolov5x and Yolov5l, the network has the defects that the speed is higher when a small target is detected, but the precision is not high enough, and the following is an improvement in the network structure:
s21, modifying the self-adaptive generation anchor frame of the input end, because the width and height difference of the anchor frame of the target defect existing in the defect type is too large, and the error of the clustering result is very large by using a Euclidean distance formula, modifying the self-adaptive generation anchor frame of the input end, replacing the sample distance measurement of the K-means algorithm from the Euclidean distance to the IOU distance, calculating 9 groups of anchor frames which are respectively [12,31] [13,15] [16,26] [20,13] [33,66] [38,48] [45,54] [56,34] [81,87], wherein the return value Accuracy is 0.804815, reflecting the IOU values of all the box and other clustering center anchors, and the larger value indicates that the more marked frames can be adapted by K anchors.
Determining a group of scaling formulas according to the actual defect type size to ensure that the scaled anchor frame can more effectively cover the mark frame in the data set, wherein the scaling formulas are as follows:
x′ 1 =Ax 1 (1)
Figure BDA0003711882600000041
Figure BDA0003711882600000051
in the formula, x i The width of the ith group of anchor frames (in the order of the width size of the anchor frames from small to large), i is 2,3.. 9; x' i The width of the zoomed anchor frame; a is the reduction multiple of the anchor frame, and A is 0.65; y is i The height of the ith group of anchor frames; y' i Is the zoomed anchor frame height.
S3, deleting 19 × 19 characteristic branches of the NECK regional receptive field, and adding 152 × 152 characteristic branches; and an SE module is added when the backup area finishes downsampling, so that the importance degrees of different channel characteristics are automatically learned, and the sensitivity of the model to the channel characteristics is improved.
The NECK area of Yolov5s adopts the structure of FPN + PAN, so that through the combination operation, the FPN layer transmits semantic features from top to bottom, and the feature pyramid transmits the semantic features from bottom to top to be determined as features, thereby further improving the feature extraction capability; the original Yolov5s feature maps were 19 × 19, 38 × 38, and 76 × 76, and since the defect target was too small compared to the overall image, the 19 × 19 feature branch with the largest receptive field in the NECK region was deleted and 152 × 152 feature branches were added.
Compared with other Yolov5 series networks, the Yolov5s has shallow depth and width, so an attention mechanism is added, an SE module is added when a backsbone area completes a down-sampling process, a new characteristic diagram is obtained through learning calculation, and the SE module is added in the original Yolov5s network structure, so that less calculation amount is increased, and performance is improved.
And S4, inputting the converted data file into an improved Yolov5S network in S3 for training, setting training parameters, setting the iteration time epoch to be 200 and the img-size to be 608 × 608, testing the trained model, and performing performance evaluation and optimization.
And the evaluation of the model takes mAP @0.5:0.95 as a standard, the training model is evaluated in performance, and when the evaluation fails to reach the required standard, the iteration times can be adjusted while the data set is enriched. When test set inspection is carried out on a subsequent test function, the conf-thres is set to be 0.5, and the iou-thres is set to be 0.45, so that the problems of overlapping of anchor frames and non-display of partial defects can be effectively avoided; in actual production testing, the value of conf-thres may be increased or the value of iou-thres may be decreased if a test frame overlap is encountered.
The actual measurement results are shown in fig. 2,3 and 4, in which a rectangular frame is used for detecting the defect part, and the defect type and the confidence coefficient are arranged above the rectangular frame.
The actual measurement result shows that the method can effectively detect the defects in the PCB production process.
In light of the foregoing description of the preferred embodiment of the present invention, many modifications and variations will be apparent to those skilled in the art without departing from the spirit and scope of the invention. The technical scope of the present invention is not limited to the content of the specification, and must be determined according to the scope of the claims.

Claims (5)

1. A PCB welding defect detection method based on deep learning is characterized by comprising the following steps:
s1, performing amplification processing on the PCB image in the data set, completing conversion of data format and size, and dividing the data set;
s2, determining the prior frame number of the regression by using a K-Means algorithm, and determining the size of an anchor frame by a scaling formula;
s3, adjusting the receptive field of the NECK area, and adding an SE module when the backhaul area finishes downsampling;
and S4, inputting the converted data file into an improved Yolov5S network for training, and setting training parameters.
2. The deep learning-based PCB welding defect detection method of claim 1, wherein the prior frame number is based on recalculating the anchor frame size by the K-means algorithm of the 1-IOU to generate 9 sets of anchor frames, respectively [12,31] [13,15] [16,26] [20,13] [33,66] [38,48] [45,54] [56,34] [81,87 ].
3. The deep learning based PCB welding defect detection method of claim 1, wherein the scaling formula is as follows:
x′ 1 =Ax 1 (1)
Figure FDA0003711882590000011
Figure FDA0003711882590000012
in the formula, x i The width of the ith group of anchor frames (in the order of the width size of the anchor frames from small to large), i is 2,3.. 9; x' i The width of the zoomed anchor frame; a is the reduction multiple of the anchor frame, and A is 0.65; y is i The height of the ith group of anchor frames; y' i Is the zoomed anchor frame height.
4. The deep learning-based PCB welding defect detection method of claim 1, wherein the adjusting of the NECK regional reception field is to delete 19 × 19 characteristic branches of the NECK regional reception field and add a 152 × 152 characteristic branch.
5. The deep learning-based PCB welding defect detection method of claim 1, wherein the training parameters comprise: the number of iterations epoch is 200 and img-size 608.
CN202210722138.7A 2022-06-24 2022-06-24 Deep learning-based PCB welding defect detection method Pending CN115100393A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210722138.7A CN115100393A (en) 2022-06-24 2022-06-24 Deep learning-based PCB welding defect detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210722138.7A CN115100393A (en) 2022-06-24 2022-06-24 Deep learning-based PCB welding defect detection method

Publications (1)

Publication Number Publication Date
CN115100393A true CN115100393A (en) 2022-09-23

Family

ID=83293578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210722138.7A Pending CN115100393A (en) 2022-06-24 2022-06-24 Deep learning-based PCB welding defect detection method

Country Status (1)

Country Link
CN (1) CN115100393A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116342485A (en) * 2023-02-16 2023-06-27 国网江苏省电力有限公司南通供电分公司 Protective cap missing detection system and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116342485A (en) * 2023-02-16 2023-06-27 国网江苏省电力有限公司南通供电分公司 Protective cap missing detection system and method

Similar Documents

Publication Publication Date Title
CN113077453B (en) Circuit board component defect detection method based on deep learning
CN110070536B (en) Deep learning-based PCB component detection method
CN111899241B (en) Quantitative on-line detection method and system for defects of PCB (printed Circuit Board) patches in front of furnace
JPH0321811A (en) Method of determining text azimuth
CN110929720B (en) Component detection method based on LOGO matching and OCR
JP6401648B2 (en) Defect classification apparatus and defect classification method
CN113205511B (en) Electronic component batch information detection method and system based on deep neural network
CN113256598B (en) Visual inspection system for chip production
JP2021190716A5 (en)
CN110927184A (en) Visual detection method for chip packaging defects
CN112381175A (en) Circuit board identification and analysis method based on image processing
CN112651966A (en) Printed circuit board micro-defect detection method based on ACYOLOV4_ CSP
CN112365497A (en) High-speed target detection method and system based on Trident Net and Cascade-RCNN structures
CN110796078A (en) Vehicle light detection method and device, electronic equipment and readable storage medium
Xie et al. A method for surface defect detection of printed circuit board based on improved YOLOv4
CN116228741A (en) PCBA (printed circuit board assembly) component defect detection method and device
CN115100393A (en) Deep learning-based PCB welding defect detection method
CN116309427A (en) PCB surface defect detection method based on improved YOLOv5 algorithm
CN114332084A (en) PCB surface defect detection method based on deep learning
CN114882204A (en) Automatic ship name recognition method
CN114078106A (en) Defect detection method based on improved Faster R-CNN
JP4814116B2 (en) Mounting board appearance inspection method
CN116091470A (en) Intelligent industrial control method and device based on 5G technology, electronic equipment and storage medium
CN112308816A (en) Image recognition device, image recognition method and computer program product thereof
CN115937555A (en) Industrial defect detection algorithm based on standardized flow model

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