Search

CN-115511820-B - Flexible circuit board defect detection model training method and defect detection method

CN115511820BCN 115511820 BCN115511820 BCN 115511820BCN-115511820-B

Abstract

The invention discloses a training method and a defect detection method for a flexible circuit board defect detection model, wherein the training method comprises the steps of obtaining an original image of the flexible circuit board, marking target defects in the original image of the flexible circuit board to obtain one or more data sets, carrying out data enhancement expansion on the data sets by adopting a mosaic data enhancement method and/or a random clipping data enhancement method to obtain a sample set, constructing and improving a YOLOv4 structure based on YOLOv algorithm to obtain an improved YOLOv model, training the improved YOLOv model by utilizing the sample set to obtain the flexible circuit board defect detection model, and detecting the defects of the flexible circuit board more accurately and more quickly by utilizing the detection model obtained by the training method.

Inventors

  • ZHANG ZHANGJIAN
  • ZHOU DIBIN

Assignees

  • 苏州科德软体电路板有限公司

Dates

Publication Date
20260512
Application Date
20220921

Claims (7)

  1. 1. A flexible circuit board defect detection model training method based on YoloV-Ghost is characterized by comprising the following steps: obtaining an original image of the flexible circuit board, and marking target defects in the original image of the flexible circuit board to obtain one or more data sets; Performing data enhancement expansion operation on the data set by adopting a mosaic data enhancement method and/or a random clipping data enhancement method to obtain a sample set; Constructing a YOLOv4 structure based on a YOLOv algorithm, adopting a GhostNet network structure as a feature extraction backbone network, using a feature pyramid CSPP module and improving a negk part of the YOLOv structure into a SPANet structure to obtain an improved YOLOv4 model, wherein the improved YOLOv model comprises the feature extraction backbone network, the feature pyramid CSPP module, a SPANet path aggregation network module and a multi-classifier module, the GhostNet network structure is configured to generate and output four feature graphs A 1 、A 2 、A 3 and A 4 , the feature graphs A 1 、A 2 、A 3 and A 4 are transmitted to the feature pyramid CSPP module to generate and output feature graphs C 1 、C 2 、C 3 and C 4 , and the feature pyramid CSPP module operates the feature graphs A 1 、A 2 、A 3 and A 4 by transmitting the feature graphs A 1 、A 2 、A 3 and A 4 through pooling layers of 5, 9 and 13 respectively, and performing convolution with convolution kernel sizes of 5, 7 and 9 to convolve six-layer convolution kernels by convolving and performing convolution kernel convolution, and performing corresponding operation C3732 and C3695; The feature maps C 1 、C 2 、C 3 and C 4 are transmitted to the SPANet path aggregation network module to generate an effective feature map, the effective feature map is transmitted to the multi-classifier module, and the SPANet path aggregation network module processes the feature maps C 1 、C 2 、C 3 and C 4 as follows: Performing convolution operation on the four feature images C to generate C, performing up-sampling operation on the C to obtain C, performing feature fusion on the C and the C to form C, performing convolution operation on an effective feature layer of the C for a plurality of times to form C, performing up-sampling operation on the C and performing feature fusion on an up-sampling result of the C to form C, performing feature fusion on the C and the C to form C, performing convolution operation on an effective feature layer of the C for a plurality of times to form C, performing down-sampling operation on the C and splicing the down-sampling result of the C and the C to form C, performing convolution operation on the C to generate an effective feature image P, performing element-by-element addition on the effective feature image P after performing convolution operation on the effective feature image P and the maximum pooling operation, performing convolution operation on the effective feature image P and the C, performing convolution operation on the obtained result, performing convolution operation on the effective feature image P and the C, and performing element-by-element addition on the effective feature image P, and generating an effective feature image P; Training the improved YOLOv model by using the sample set to obtain a soft body circuit board defect detection model; After training, combining semantic information of the feature maps P 1 、P 2 、P 3 and P 4 and semantic information of the feature maps C 1 、C 2 、C 3 and C 4 to create a feature map block from bottom to top and from left to right; and detecting a plurality of prediction frames in one image, wherein the plurality of prediction results of the same prediction frame only adopt the prediction result with the highest confidence score.
  2. 2. The method of claim 1, wherein the multi-classifier module comprises a plurality of Yolo Head classifiers, the plurality of Yolo Head classifiers configured to receive fusion features of different sizes.
  3. 3. The flexible circuit board defect detection model training method based on YoloV-Ghost of claim 1, wherein the operation of performing data enhancement expansion on the dataset comprises: and (3) adopting one or more modes of adding noise, translating, rotating, cutting, affine transformation, increasing gray level and fusing specific background to the data set to realize data enhancement and/or expansion.
  4. 4. The flexible circuit board defect detection model training method based on YoloV-Ghost of claim 1, wherein the target defects include folds, indentations, foreign objects, oxidation.
  5. 5. The flexible circuit board defect detection model training method based on YoloV-Ghost of any of claims 1-4, wherein the sample set is divided into a training set and a validation set, the number of samples of the training set being greater than the number of samples of the validation set; Training the improved YOLOv model by using the training set to obtain a soft body circuit board defect detection model; Verifying the detection capability of the obtained soft body circuit board defect detection model by using the verification set, and evaluating the performance of the soft body circuit board defect detection model; And if not, network parameters of the model need to be finely adjusted and/or the number of samples of the training set is increased, and the soft circuit board defect detection model is optimized until the verified soft circuit board defect detection model is obtained.
  6. 6. The flexible circuit board defect detection model training method based on YoloV-Ghost of claim 5, wherein verifying and evaluating the performance of the flexible circuit board defect detection model includes defect classification evaluation, the defect classification evaluation step is: Calculating the average accuracy mAP of the soft body circuit board defect detection model, wherein the calculation formula is as follows: wherein, AP i is the accuracy of the ith defect classification, and k is the number of defect classifications; if the average accuracy mAP is more than or equal to 90%, the soft circuit board defect detection model is determined to be capable of accurately detecting various defects, otherwise, the soft circuit board defect detection model is optimized.
  7. 7. The method for detecting the defects of the flexible circuit board is characterized by comprising the following steps of: acquiring an image of a flexible circuit board to be detected; Carrying out data enhancement expansion on the data set by adopting a mosaic data enhancement method and/or a random clipping data enhancement method to obtain a sample set; Inputting the sample set into a soft body circuit board defect detection model which is trained in advance for detection; The soft circuit board defect detection model outputs a detection result, wherein the output detection result comprises the position of the target defect, the type of the target defect and the confidence coefficient of the target defect; The soft body circuit board defect detection model is trained by the training method according to any one of claims 1 to 6.

Description

Flexible circuit board defect detection model training method and defect detection method Technical Field The invention relates to the technical field of soft circuit board defect detection, in particular to a soft circuit board defect detection model training method and a defect detection method. Background The flexible circuit board has the characteristics of free bending, winding and folding, can meet various space layout requirements, can effectively reduce the volume and weight of electronic products when used in the electronic products, and meets the requirements of the development of the electronic products in the high-density, miniaturized and high-reliability directions. However, in the process of producing the flexible circuit board, because of factors such as process defects, environmental influences, improper personnel operation and the like, defects such as bubbles, kong Lizu welding, white fly, dirt on the surface, uneven surface and the like can be generated, so that the yield of the flexible circuit board is too low. The method is crucial to the detection of defects of the flexible circuit board, and is a precondition for improving the qualification rate of electronic products. The YOLOv algorithm is optimized in different degrees from various aspects such as data processing, a backbone network, network training, an activation function, a loss function and the like on the basis of a YOLO (You Only Live Once) target detection architecture, and the YOLOv algorithm is applied to the field of target detection and has good classification precision and detection precision. However, due to the characteristics of multiple types of images, random positions, small defects and the like of the flexible circuit board, the traditional target detection method is difficult to accurately detect the defects of the flexible circuit board, and the accurate positioning and classification of the small target defects on the surface of the flexible circuit board are difficult to be carried out through YOLOv networks. The foregoing background is only for the purpose of providing an understanding of the principles and concepts of the application and is not necessarily related to the prior art or is not necessarily taught by the present application and is not intended to be used for the purposes of assessing the novelty and creativity of the present application without express evidence that such is already disclosed prior to the filing date of this patent application. Disclosure of Invention The invention aims to provide a flexible circuit board defect detection model training method and a defect detection method based on YoloV-Ghost, which can accurately position and classify smaller defect targets on the surface of a flexible circuit board, improve the detection precision and efficiency of surface defects and save labor cost. In order to achieve the above purpose, the invention adopts the following technical scheme: a flexible circuit board defect detection model training method based on YoloV-Ghost comprises the following steps: obtaining an original image of the flexible circuit board, and marking target defects in the original image of the flexible circuit board to obtain one or more data sets; Performing data enhancement expansion operation on the data set by adopting a mosaic data enhancement method and/or a random clipping data enhancement method to obtain a sample set; Based on YOLOv's 4 algorithm, constructing YOLOv's structure, adopting GhostNet's network structure as the characteristic extraction backbone network, using the characteristic pyramid CSPP module, and improving the neck part of YOLOv's structure to SPANet's structure, to obtain improved YOLOv's 4 model; and training the improved YOLOv model by using the sample set to obtain a soft body circuit board defect detection model. Further, the improved YOLOv model includes a feature extraction backbone network, a feature pyramid CSPP module, a SPANet path aggregation network module, and a multi-classifier module; The GhostNet network fabric is configured to generate and output four feature graphs a 1、A2、A3 and a 4; The feature graphs A 1、A2、A3 and A 4 are transmitted to the feature pyramid CSPP module, and feature graphs C 1、C2、C3 and C 4 are generated and output; and transmitting the feature maps C 1、C2、C3 and C 4 to the SPANet path aggregation network module to generate an effective feature map. Further, the processing steps of the SPANet path aggregation network module on the feature graphs C 1、C2、C3 and C 4 are as follows: Performing convolution operation on the four feature maps C 1、C2、C3、C4 respectively to generate C 1_0、C2_0、C3_0、C4_0; Performing up-sampling operation on C 4_0 to obtain C 4_1, performing feature fusion on C 3_0 and C 4_1 to form C 3_1, performing multi-time convolution operation on an effective feature layer of C 3_1 to form C 3_2, performing up-sampling on C 3_2 and performing feature fusion on an up-sampling result and C 2_0 t