A pad detection method, device, computer equipment and storage medium

Through technologies such as ResNet neural network model and HSV color space conversion, the problem of low accuracy of traditional pad detection methods is solved, efficient and accurate detection of flexible circuit board pads is achieved, and detection efficiency and accuracy are improved.

CN114418951BActive Publication Date: 2024-09-03SHENZHEN TECH UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202111583335.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2024-09-03
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

Traditional pad inspection methods have problems with low accuracy on flexible circuit boards and cannot effectively detect defects under specific conditions. Moreover, traditional machine learning algorithms based on traditional machine learning algorithms have poor robustness, weak adaptability and representation capabilities.

Method used

The ResNet neural network model is used for solder pad detection. By segmenting, annotating and model training the circuit board sample images, HSV color space conversion and feature methods are used for pre-classification, and detection is performed based on the preset thresholds for the proportion of good products and defective products to improve Detection accuracy and speed.

Benefits of technology

By accurately marking the pad position and using the ResNet neural network model for detection, the accuracy and speed of flexible circuit board pad detection are significantly improved, pad defects can be better identified, and detection efficiency and accuracy are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114418951B
    Figure CN114418951B
Patent Text Reader

Abstract

The embodiments of the present application belong to the field of FPC detection technology in artificial intelligence, and relate to a pad detection method, device, computer equipment and storage medium applied to flexible circuit boards. The present application can greatly improve the detection accuracy and speed by accurately marking the pad position coordinates of each product, using a program to parse the pad position coordinates of each pad, and then locally calibrating the parsed coordinates, and finally using a ResNet neural network model to detect the marked area on the flexible circuit board (FPC) image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of FPC detection technology in artificial intelligence, and in particular to a pad detection method, device, computer equipment and storage medium applied to a flexible circuit board. Background Art

[0002] Flexible Printed Circuit (FPC) has been widely used for its excellent performance such as light weight, thin thickness, free bending and folding. However, the quality inspection of FPC in China still mainly relies on manual visual inspection, which is costly and inefficient. With the rapid development of electronic technology, the design of circuit boards is becoming more and more high-precision and high-density. The traditional manual inspection method can no longer meet the production needs. The automated inspection of FPC defects has become an inevitable trend of development.

[0003] There is a pad detection method based on computer vision and using edge detection, zero mean, background subtraction, machine learning and other methods for detection, where:

[0004] 1. Edge detection method: Edge detection method is a spatial domain detection method. It extracts the edge contour of the part through a specific algorithm, detects the edge of the part, and determines whether the part is defective by comparison;

[0005] 2. Zero mean method: The zero mean method is to construct a zero mean image after processing the image of the part, and identify the damaged area by comparing and analyzing different thresholds during image segmentation;

[0006] 3. Background subtraction method: subtract the background image (excluding defects) estimated or calculated in advance from the preprocessed image, leaving a residual image containing defects and random noise;

[0007] 4. Machine learning method: Based on manually defined features and feature extraction methods, these features are used to train machine learning classifiers to achieve final defect detection.

[0008] However, the applicant found that the traditional pad detection method is generally not intelligent. The traditional method can only detect defects under specific conditions, such as defects with a certain size or obvious defect outlines with strong contrast and low noise under specific lighting conditions. The machine learning-based algorithm has a certain robustness, but the natural disadvantages of artificial features are weak representation ability and poor adaptability. Therefore, the traditional machine learning algorithm cannot learn the features that need to be detected well, resulting in low accuracy of the final detection results. It can be seen that the traditional pad detection method has the problem of low accuracy. Summary of the invention

[0009] The purpose of the embodiments of the present application is to provide a pad detection method, device, computer equipment and storage medium for flexible circuit boards to solve the problem of low accuracy of traditional pad detection methods.

[0010] In order to solve the above technical problems, the present application provides a pad detection method for a flexible circuit board, which adopts the following technical solution:

[0011] Accept model training requests with sample images of circuit boards and pad location information;

[0012] Performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image;

[0013] Sending the pad sample image to a terminal device to perform a labeling operation on the pad sample image;

[0014] Receiving a pad annotated image sent by the terminal device, wherein the pad annotated image is a pad sample image carrying annotation information, and the annotation information is good product information or defective product information;

[0015] Calling the original ResNet neural network model, and performing a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data, to obtain a target ResNet neural network model for identifying pad image quality;

[0016] Accept a pad inspection request with an image of the circuit board to be tested;

[0017] Inputting the circuit board image to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result;

[0018] The pad detection result is output.

[0019] Furthermore, after the step of segmenting the circuit board sample image according to the pad position information to obtain the pad sample image, the following step is also included:

[0020] The pad sample image is converted from the RGB color space to the HSV color space according to a conversion formula, and the conversion formula is expressed as:

[0021]

[0022]

[0023] V=max

[0024] Among them, max=max(r,g,b), min=min(r,g,b).

[0025] Furthermore, before the step of calling the original ResNet neural network model and performing a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data to obtain a target ResNet neural network model for identifying pad image quality, the following steps are also included:

[0026] The pad sample images are pre-classified according to the feature method to obtain a plurality of groups of pad sample images with similar pad shapes.

[0027] Furthermore, the step of inputting the image of the circuit board to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result specifically includes the following steps:

[0028] Counting the change area of ​​the B channel value in the RGB color space of each pad position to be tested in the image of the circuit board to be tested;

[0029] The image of the circuit board to be tested is detected according to the preset good product ratio threshold S1, the bad product ratio threshold S2 and the judgment function, and the judgment function is expressed as:

[0030]

[0031] Among them, the P I represents the ratio of the area of ​​the change region to the area of ​​the pad to be tested; f(ROI i ) represents the result obtained by performing a pad detection operation on the image of the circuit board to be tested through the target ResNet neural network model.

[0032] In order to solve the above technical problems, the embodiment of the present application further provides a pad detection device applied to a flexible circuit board, which adopts the following technical solution:

[0033] A training request receiving module, used to receive a model training request carrying a circuit board sample image and pad position information;

[0034] A segmentation operation module, used for performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image;

[0035] A labeling sending module, used for sending the pad sample image to a terminal device to perform a labeling operation on the pad sample image;

[0036] A label receiving module, used for receiving a pad label image sent by the terminal device, wherein the pad label image is a pad sample image carrying label information, and the label information is good product information or defective product information;

[0037] A model training module, used to call the original ResNet neural network model, and perform a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data, to obtain a target ResNet neural network model for identifying pad image quality;

[0038] A detection request receiving module, used for receiving a pad detection request carrying an image of a circuit board to be tested;

[0039] A pad detection module is used to input the image of the circuit board to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result;

[0040] The result output module is used to output the pad detection result.

[0041] Furthermore, the device also includes:

[0042] The color space conversion module is used to convert the pad sample image from the RGB color space to the HSV color space according to a conversion formula, and the conversion formula is expressed as:

[0043]

[0044]

[0045] V=max

[0046] Among them, max=max(r,g,b), min=min(r,g,b).

[0047] Furthermore, the device also includes:

[0048] The pre-classification module is used to perform a pre-classification operation on the pad sample images according to a feature method to obtain a plurality of groups of pad sample images with similar pad shapes.

[0049] Furthermore, the pad detection module includes:

[0050] A change region acquisition submodule is used to count the change region of the B channel value in the RGB color space of each pad position to be tested in the image of the circuit board to be tested;

[0051] The detection submodule is used to detect the image of the circuit board to be tested according to a preset good product ratio threshold S1, a defective product ratio threshold S2 and a judgment function, wherein the judgment function is expressed as:

[0052]

[0053] Among them, the P I represents the ratio of the area of ​​the change region to the area of ​​the pad to be tested; f(ROI i ) represents the result obtained by performing a pad detection operation on the image of the circuit board to be tested through the target ResNet neural network model.

[0054] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0055] The invention comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the pad detection method applied to a flexible circuit board as described above when executing the computer-readable instructions.

[0056] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0057] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the pad detection method applied to a flexible circuit board as described above are implemented.

[0058] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0059] The present application provides a pad detection method for a flexible circuit board, comprising: accepting a model training request carrying a circuit board sample image and pad position information; performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image; sending the pad sample image to a terminal device to perform a pad sample image annotation operation; receiving a pad annotated image sent by the terminal device, wherein the pad annotated image is a pad sample image carrying annotation information, wherein the annotation information is good product information or defective product information; calling an original ResNet neural network model, and performing a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data to obtain a target ResNet neural network model for identifying pad image quality; accepting a pad detection request carrying a circuit board image to be tested; inputting the circuit board image to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result; and outputting the pad detection result. This application can greatly improve the detection accuracy and speed by accurately marking the pad position coordinates of each product, using a program to parse the pad position coordinates of each pad, then locally calibrating the parsed coordinates, and finally using a ResNet neural network model to detect the marked area on the flexible circuit board (FPC) image. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0061] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0062] Figure 2 It is a flow chart of the implementation of the pad detection method applied to the flexible circuit board provided in the first embodiment of the present application;

[0063] Figure 3 This is a schematic diagram of the Mark points provided in Example 1 of the present application;

[0064] Figure 4 It is a schematic diagram of dividing a ring into four parts provided in Example 1 of the present application;

[0065] Figure 5 This is a schematic diagram of the structure of a pad detection device for a flexible circuit board provided in Example 2 of the present application:

[0066] Figure 6It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0068] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0069] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0070] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0071] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0072] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.

[0073] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0074] It should be noted that the pad detection method applied to the flexible circuit board provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the pad detection device applied to the flexible circuit board is generally arranged in the server / terminal device.

[0075] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0076] Continue to refer Figure 2 , shows an implementation flow chart of a pad detection method applied to a flexible circuit board provided in Example 1 of the present application. For ease of explanation, only the part related to the present application is shown.

[0077] The above-mentioned pad detection method applied to the flexible circuit board includes the following steps:

[0078] In step S201, a model training request carrying a circuit board sample image and pad position information is accepted.

[0079] In an embodiment of the present application, before receiving a model training request, it is necessary to manually annotate the sample image using a polygonal box to obtain the pad position, that is, the region of interest ROI to be detected, and store the coordinate position in a Json file.

[0080] In step S202, a segmentation operation is performed on the sample image of the circuit board according to the pad position information to obtain a pad sample image.

[0081] In an embodiment of the present application, when making a pad sample image, a minimum bounding box algorithm is used to frame the ROI area, and ROI images of 1000 images are cut out.

[0082] In the embodiment of the present application, the foreground arrangement of different products is different. When a batch of products is changed, firstly, the positions of all the foreground areas to be detected are marked on the sample image by manual marking using the minimum rectangular bounding box to obtain C. i (x,y,w,h)∈C, where x and y are the horizontal and vertical coordinates of the upper left corner of the minimum bounding box, and w and h are the width and height of the minimum bounding box.

[0083] In some optional implementations of this embodiment, the pad area to be detected is usually irregular in shape, and a part of the background area remains in the minimum bounding box. According to the brightness difference between the pad area and the background, the image is converted from the RGB color space to the HSV color space. The conversion formula is:

[0084]

[0085]

[0086] V=max

[0087] Among them, max = max(r, g, b), min = min(r, g, b), after conversion to HSV space, the Otsu method is used to automatically perform threshold segmentation on the H channel and set the value of the background area to zero.

[0088] In step S203, the pad sample image is sent to a terminal device to perform a labeling operation on the pad sample image.

[0089] In the embodiment of the present application, the cut ROI image is manually annotated as a good product or a defective product.

[0090] In the embodiment of the present application, in order to provide the data set required for subsequent neural network model training, the existing data set needs to be divided into a defective data set and a non-defective data set. Since the amount of data is not very large, the data can be manually screened, or the data set can be preliminarily screened and then manually screened by extracting obvious defect features, which can reduce the workload. In this embodiment, the color change defect of the pad is detected. To determine whether a pad contains defects, it is necessary to determine whether the color change area exceeds the allowed proportion, whether the degree of color change exceeds the allowed degree, and if a rainbow-like color change, that is, a sudden color change, occurs, it is judged as defective regardless of the size of the color change area. Because the color of the non-defective pad collected by the image acquisition system is bright white, and the color of the defective area is reddish or yellowish, it can be seen from the RGB color space that the color change from bright white to red or yellow is mainly related to the decrease in the pixel value of the blue channel. In this embodiment, the data set is preliminarily screened according to this color feature, and then manually screened to confirm that it is divided into a defective data set and a non-defective data set.

[0091] Considering that the illumination intensity may slightly change when the actual image acquisition system acquires the circuit board image, this embodiment enhances the data set. According to the conversion formula between RGB color space and HSV color space, it can be known that only the value of max(R,G,B) needs to be modified to simulate the change of illumination intensity. According to this method, the enhanced data set can be obtained by performing the operation of max(R,G,B)=max(R,G,B)±d on 1 / 3 of the data.

[0092] In step S204, a pad annotated image sent by a terminal device is received, where the pad annotated image is a pad sample image carrying annotation information, where the annotation information is good product information or defective product information.

[0093] In step S205, the original ResNet neural network model is called, and a model training operation is performed on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data to obtain a target ResNet neural network model for identifying pad image quality.

[0094] In the embodiment of the present application, ResNet is a network structure proposed by He et al. in the ImageNet Challenge in 2015, which alleviates the problem that the performance of the network degrades as the depth of the network increases. Experiments in the paper Deep Residual Learning for Image Recognition found that deep networks have a degradation problem (Degradation problem): when the network depth increases, the network accuracy becomes saturated or even decreases. This phenomenon can be seen intuitively in the figure: the 56-layer network is worse than the 20-layer network. This is not an overfitting problem, because the training error of the 56-layer network is also high. Because deep networks have the problem of gradient disappearance or explosion, this makes deep learning models difficult to train.

[0095] In the embodiment of the present application, for a stacked layer structure (composed of several stacked layers), when the input is x, the learned feature is recorded as H(x). Now we hope that it can learn the residual F(x) = H(x)-x, so the original learned feature is actually F(x)+x. Residual learning is easier than learning the original feature directly, because when the residual is 0, the stacked layer only performs an identity mapping, at least the network performance will not decrease, and in fact the residual will not be 0, which will also enable the stacked layer to learn new features based on the input features, thereby having better performance.

[0096] In the embodiments of the present application, the ResNet50 network is adopted in the existing deep learning package of "Halcon", indicating its certain reliability in industrial inspection. Therefore, this article uses the ResNet network to detect pad defects by combining the information between channels. The network structure consists of convolution, pooling, improved residual blocks, and a linear classifier. The input features go through convolution, batch normalization, pooling, and then repeat the above process. Finally, the output and the input features are superimposed pixel by pixel as the next input. After convolution, the importance of each channel is extracted and multiplied with the feature layer after convolution, and finally added to the input features, so that the convolution obtains the spatial and channel fusion information of the local area.

[0097] In the embodiments of the present application, the good product and defective product images are divided into a training set and a validation set according to a ratio of 3:1. The training set samples are input into the network, and the BP algorithm is used to update the model weights. The validation set is input into the network to verify the effect of the model, and this operation is looped until the model converges to a satisfactory accuracy.

[0098] In the embodiments of the present application, for the FPC image to be detected, the numerical distribution histogram of the B channel in the RGB color space of each ROI is statistically calculated. For a single ROI, if the ratio P of the discolored area to the pad area is greater than the threshold S2, then the FPC is a defective product; if S1 < P ≤ S2, the trained model f(x) is used to detect the ROI. If the detection result is a defective product, then the FPC is a defective product. If the detection result is a good product, then the next ROI is detected; if P ≤ S1, then the next ROI is detected; if all ROIs are good products, then the FPC is a good product, otherwise it is a defective product. The judgment result of the current FPC is obtained through the judgment function R(X). When R(X) = 0, the current FPC is a good product, otherwise it is a defective product. The formula is as shown in Equation (1):

[0099]

[0100] Among them, X is the current FPC image, and n is the number of ROIs of the FPC

[0101] In step S206, a pad detection request carrying the image of the circuit board to be tested is received.

[0102] In the embodiments of the present application, for the image acquisition of the FPC, an area array industrial camera is used to take pictures above the FPC board and transmit them to the image acquisition card of the computer to save the image file.

[0103] In step S207, the image of the circuit board to be tested is input into the target ResNet neural network model for pad detection operation to obtain the pad detection result.

[0104] In step S208, the pad detection result is output.

[0105] In an embodiment of the present application, a pad detection method for a flexible circuit board is provided, including: accepting a model training request carrying a circuit board sample image and pad position information; performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image; sending the pad sample image to a terminal device to perform a labeling operation on the pad sample image; receiving a pad labeling image sent by the terminal device, the pad labeling image being a pad sample image carrying labeling information, the labeling information being good product information or defective product information; calling an original ResNet neural network model, and performing a model training operation on the original ResNet neural network model using the pad sample image as training data and the labeling information as result data to obtain a target ResNet neural network model for identifying pad image quality; accepting a pad detection request carrying an image of a circuit board to be tested; inputting the image of the circuit board to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result; and outputting the pad detection result. This application can greatly improve the detection accuracy and speed by accurately marking the pad position coordinates of each product, using a program to parse the pad position coordinates of each pad, then locally calibrating the parsed coordinates, and finally using a ResNet neural network model to detect the marked area on the flexible circuit board (FPC) image.

[0106] In some optional implementations of this embodiment, before step S205, the following is further included:

[0107] The pad sample images are pre-classified according to the feature method to obtain multiple groups of pad sample images with similar pad shapes.

[0108] In the embodiment of this application, for the sake of universality, that is, we only detect the pads, regardless of the shape of the product image, we need to provide a JSON file for each image, in which the outline coordinates of the pad to be detected are marked. Because each image is taken by moving the camera across the entire large board, there will be a certain deviation from the coordinates marked in the JSON file, so alignment is required.

[0109] After registration, the pad image of the current image is cut out as the test set.

[0110] According to the project background, we know that although the shapes of each FPC pad are different, what remains unchanged is that each FPC board has a prototype pad, so the prototype pad can be used for alignment.

[0111] Registration steps:

[0112] In order to save costs and other considerations, multiple circuit boards will be spliced ​​in the production of circuit boards. When the spliced ​​board is transmitted to the image acquisition system described in step 2, the image of each circuit board is collected by moving the camera or the spliced ​​board, so the position coordinates contained in the corresponding JSON file will be relatively offset relative to the pad position of the circuit board image. Mark points are set in circuit board design to help the placement machine optical positioning, and this method also uses this point to align the JSON file with the circuit board image.

[0113] Mark points are composed of marked points and open areas, such as Figure 3 shown.

[0114] This method proposes a solid circle matching algorithm based on a ring. The algorithm first generates a ring template according to the coordinates of the Mark point area in the JSON file. The inner diameter of the ring is 1 pixel smaller than the edge diameter of the Mark area, and the outer diameter of the ring is 1 pixel larger than the edge diameter of the Mark. The template is divided into 4 arcs at 45 degrees and 135 degrees. Figure 4 shown.

[0115] The pixel value sets on the inner and outer arcs of the upper, lower, left and right sides are respectively Ui, Uo, Di, Do, Li, Lo, Ri and Ro. The recognition threshold δ is set according to the different color characteristics of the marked area and the open area of ​​the Mark point. The X-axis and Y-axis offset distances are calculated according to formulas (2) and (3). The template coordinates are updated to completely move the inner ring of the template to the inside of the Mark point marked area, and the outer ring of the template is outside the Mark point marked area.

[0116]

[0117]

[0118] where x offset Indicates the horizontal offset distance of the template relative to the current circuit board image, y offset Indicates the vertical offset distance of the template relative to the current circuit board image.

[0119] After registration, firstly, the pixel values ​​of the non-to-be-detected areas of the circuit board image are set to 0 according to the pad coordinates in the JSON file, and then the minimum rectangular bounding box of each pad is calculated according to Formula 4.

[0120]

[0121] Where (x 0 ,y 0 ) is the upper left corner of the bounding box, (x 1 ,y 1) is the lower right corner point of the bounding box, and X, Y are the horizontal and vertical coordinate sets of the pad. The minimum bounding box is determined based on the coordinates of the above two points on the circuit board image to cut out the pad image and save it to the data set, thereby generating a single pad image data set with a black background, that is, a pixel value of 0 in the non-pad area.

[0122] In the embodiment of the present application, after generating a single pad image data set with a black background, that is, a pixel value of 0 in the non-pad area, in order to provide the data set required for subsequent neural network model training, the existing data set needs to be divided into a defective data set and a non-defective data set. Since the amount of data is not very large, the data can be manually screened, or the data set can be preliminarily screened and then manually screened by extracting obvious defect features, which can reduce the workload. In this embodiment, the pad discoloration defect is detected. To determine whether a pad contains a defect, it is necessary to determine whether the discoloration area exceeds the allowed proportion, whether the degree of discoloration exceeds the allowed degree, and if a rainbow-like discoloration, that is, a color mutation, is generated, it is judged as defective regardless of the size of the discoloration area. Because the color of the non-defective pad collected by the image acquisition system is white and bright, and the color of the defective area is reddish or yellowish, it can be seen from the RGB color space that the color change from white and bright to red or yellow is mainly related to the decrease in the pixel value of the blue channel. In this embodiment, the data set is preliminarily screened according to this color feature, and then manually screened and confirmed to be divided into a defective data set and a non-defective data set.

[0123] Considering that the illumination intensity may slightly change when the actual image acquisition system acquires the circuit board image, this embodiment strengthens the data set. According to the conversion formula between RGB color space and HSV color space, it can be known that only the value of max(R,G,B) needs to be modified to simulate the change of illumination intensity. According to this method, the operation of max(R,G,B)=max(R,G,B)±d is performed on 1 / 3 of the data to obtain the enhanced data set.

[0124] In some optional implementations of this embodiment, considering that the illumination intensity may slightly change when the actual image acquisition system acquires the circuit board image, this embodiment enhances the data set. According to the conversion formula between the RGB color space and the HSV color space, it can be known that only the value of max(R,G,B) needs to be modified to simulate the change of illumination intensity. According to this method, the enhanced data set can be obtained by performing the operation of max(R,G,B)=max(R,G,B)±d on 1 / 3 of the data.

[0125] In summary, the present application provides a pad detection method for a flexible circuit board, including: accepting a model training request carrying a circuit board sample image and pad position information; performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image; sending the pad sample image to a terminal device to perform a pad sample image annotation operation; receiving a pad annotated image sent by the terminal device, wherein the pad annotated image is a pad sample image carrying annotation information, and the annotation information is good product information or defective product information; calling an original ResNet neural network model, and performing a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data to obtain a target ResNet neural network model for identifying pad image quality; accepting a pad detection request carrying a circuit board image to be tested; inputting the circuit board image to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result; and outputting the pad detection result. This application aims at the design and implementation of the FPC pad defect detection algorithm based on neural network for the FPC boards of different sizes provided by manufacturers, which contain multiple irregularly shaped pads. It improves the efficiency of defect detection while meeting the basic detection requirements. The detection method of visual inspection is easily affected by subjective and objective factors, and the correctness of the results cannot be guaranteed. In addition, the inspection process is very time-consuming. The system can solve these problems well, which meets our expectations for defect detection and has the advantages of both versatility and stability.

[0126] The content and results of the experiment are as follows:

[0127] (1) The sample image and template image are aligned based on the pad coordinates marked in the JSON file. As the size of the entire FPC image is large, the traditional template matching algorithm cannot match the rotated and translated images well. First, the pads are marked using the JSON file, and image alignment is performed for circular pads, which improves the matching accuracy and speed. Then, a method is proposed to first perform local template matching to find the feature points, and then perform affine transformation based on the feature points to achieve alignment between the sample image and the template image.

[0128] (2) Research related image processing algorithms, and design a neural network-based FPC defect extraction algorithm flow and classification method for pad defects. Due to differences in light and size between the sample image and the template image, as well as noise generated during image acquisition, transmission, and imaging, the difference between the defective and non-defective parts will be included in the difference in the difference. To address this problem, this paper uses a modified image brightness enhancement dataset. First, the dataset is used to train the network model, and then each image is aligned and the pads are segmented. Finally, the trained resnet network model is used to detect and segment the pads, implement the defect classification algorithm, and finally achieve defect detection and classification.

[0129] (3) Based on the existing mechanical structure and the overall requirements of the FPC defect detection system, the process flow and overall plan were designed, and the hardware and software parts were coordinated and communicated to complete the image acquisition.

[0130] (4) Finally, according to the demand analysis and the research objectives of the paper, the composition of the entire defect detection system, the system process flow, and the defect detection process are emphasized. The FPC pad detection and classification, and the visualization system of traceable detection data are integrated. After experiments, the accuracy and efficiency of the software are guaranteed.

[0131] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0132] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0133] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0134] Embodiment 2

[0135] Further references Figure 5 , as a response to the above Figure 2 The present application provides an embodiment of a pad detection device for a flexible circuit board. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0136] like Figure 5 As shown, the pad detection device 200 applied to the flexible circuit board described in this embodiment includes: a training request receiving module 210, a segmentation operation module 220, a label sending module 230, a label receiving module 240, a model training module 250, a detection request receiving module 260, a pad detection module 270 and a result output module 280. Among them:

[0137] A training request receiving module 210 is used to receive a model training request carrying a circuit board sample image and pad position information;

[0138] A segmentation operation module 220, configured to perform a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image;

[0139] The annotation sending module 230 is used to send the pad sample image to a terminal device to perform an annotation operation on the pad sample image;

[0140] The annotation receiving module 240 is used to receive the pad annotation image sent by the terminal device, where the pad annotation image is a pad sample image carrying annotation information, where the annotation information is good product information or defective product information;

[0141] A model training module 250 is used to call the original ResNet neural network model, and perform a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data, so as to obtain a target ResNet neural network model for identifying pad image quality;

[0142] A detection request receiving module 260, used for receiving a pad detection request carrying an image of a circuit board to be tested;

[0143] A pad detection module 270 is used to input the circuit board image to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result;

[0144] The result output module 280 is used to output the pad detection result.

[0145] In an embodiment of the present application, before receiving a model training request, it is necessary to manually annotate the sample image using a polygonal box to obtain the pad position, that is, the region of interest ROI to be detected, and store the coordinate position in a Json file.

[0146] In an embodiment of the present application, when making a pad sample image, a minimum bounding box algorithm is used to frame the ROI area, and ROI images of 1000 images are cut out.

[0147] In the embodiment of the present application, the foreground arrangement of different products is different. When a batch of products is changed, firstly, the positions of all the foreground areas to be detected are marked on the sample image by manual marking using the minimum rectangular bounding box to obtain C. i (x,y,w,h)∈C, where x and y are the horizontal and vertical coordinates of the upper left corner of the minimum bounding box, and w and h are the width and height of the minimum bounding box.

[0148] In some optional implementations of this embodiment, the pad area to be detected is usually irregular in shape, and a part of the background area remains in the minimum bounding box. According to the brightness difference between the pad area and the background, the image is converted from the RGB color space to the HSV color space. The conversion formula is:

[0149]

[0150]

[0151] V=max

[0152] Among them, max = max(r, g, b), min = min(r, g, b), after conversion to HSV space, the Otsu method is used to automatically perform threshold segmentation on the H channel and set the value of the background area to zero.

[0153] In the embodiment of the present application, the cut ROI image is manually annotated as a good product or a defective product.

[0154] In the embodiment of the present application, ResNet is a network structure proposed by He et al. in the ImageNet Challenge in 2015, which alleviates the problem that the performance of the network degrades as the depth of the network increases. Experiments in the paper Deep Residual Learning for Image Recognition found that deep networks have a degradation problem (Degradation problem): when the network depth increases, the network accuracy becomes saturated or even decreases. This phenomenon can be seen intuitively in the figure: the 56-layer network is worse than the 20-layer network. This is not an overfitting problem, because the training error of the 56-layer network is also high. Because deep networks have the problem of gradient disappearance or explosion, this makes deep learning models difficult to train.

[0155] In the embodiment of the present application, for a stacked layer structure (composed of several stacked layers), when the input is x, the learned feature is recorded as H(x). Now we hope that it can learn the residual F(x) = H(x)-x, so the original learned feature is actually F(x)+x. Residual learning is easier than learning the original feature directly, because when the residual is 0, the stacked layer only performs an identity mapping, at least the network performance will not decrease, and in fact the residual will not be 0, which will also enable the stacked layer to learn new features based on the input features, thereby having better performance.

[0156] In the embodiment of the present application, the ResNet50 network is used in the existing deep learning package of "Halcon", which shows that it has a certain reliability in industrial detection. Therefore, this article adopts the ResNet network and combines the inter-channel information to detect pad defects. The network structure consists of convolution, pooling, improved residual blocks and linear classifiers. The input features are convolved, batch normalized, pooled, and the above process is repeated. Finally, the output and input features are superimposed pixel by pixel as the next input; after the convolution, the importance of each channel is extracted, multiplied with the feature layer after the convolution, and finally added to the input feature, so that the convolution obtains the fusion information of the space and channel of the local area.

[0157] In the embodiment of the present application, the images of good products and bad products are divided into training set and verification set in a ratio of 3:1. The training set samples are input to the network, the BP algorithm is used to update the model weights, and the verification set is input to the network to verify the effect of the model. This operation is repeated until the model converges to a satisfactory accuracy.

[0158] In the embodiment of the present application, for the FPC image to be detected, the numerical distribution histogram of the B channel in the RGB color space of each ROI is statistically analyzed. For a single ROI, if the ratio P of the discolored area to the pad area is greater than the threshold S2, then the FPC is a defective product; if S1 < P ≤ S2, the trained model f(x) is used to detect the ROI. If the detection result is a defective product, then the FPC is a defective product; if the detection result is a non-defective product, the next ROI is detected; if P ≤ S1, the next ROI is detected; if all ROIs are non-defective products, then the FPC is a non-defective product, otherwise it is a defective product. The judgment result of the current FPC is obtained through the judgment function R(X). When R(X) = 0, the current FPC is a non-defective product, otherwise it is a defective product. The formula is as shown in Equation (1):

[0159]

[0160] where X is the current FPC image, and n is the number of ROIs of the FPC

[0161] In the embodiment of the present application, for the image acquisition of the FPC, an area array industrial camera is used to take pictures above the FPC board and transmit them to the image acquisition card of the computer to save the image file.

[0162] In an embodiment of the present application, a pad detection device 200 for a flexible circuit board is provided, including: a training request receiving module 210, for receiving a model training request carrying a circuit board sample image and pad position information; a segmentation operation module 220, for performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image; an annotation sending module 230, for sending the pad sample image to a terminal device to perform an annotation operation on the pad sample image; an annotation receiving module 240, for receiving a pad annotated image sent by the terminal device, the pad annotated image being a pad sample image carrying annotation information, and the annotation information being good product information. Or defective product information; model training module 250, used to call the original ResNet neural network model, and use the pad sample image as training data and the annotation information as result data to perform model training operations on the original ResNet neural network model, and obtain a target ResNet neural network model for identifying the quality of the pad image; detection request receiving module 260, used to accept a pad detection request carrying a circuit board image to be tested; pad detection module 270, used to input the circuit board image to be tested into the target ResNet neural network model for pad detection operations, and obtain pad detection results; result output module 280, used to output the pad detection results. This application can greatly improve the detection accuracy and speed by accurately marking the pad position coordinates of each product, using a program to parse the pad position coordinates of each pad, and then locally calibrating the parsed coordinates, and finally using the ResNet neural network model to detect the marked area on the flexible circuit board (FPC) image.

[0163] In some optional implementations of this embodiment, the pad detection device 200 applied to the flexible circuit board further includes:

[0164] The pre-classification module is used to perform a pre-classification operation on the pad sample images according to a feature method to obtain a plurality of groups of pad sample images with similar pad shapes.

[0165] In the embodiment of this application, for the sake of universality, that is, we only detect the pads, regardless of the shape of the product image, we need to provide a JSON file for each image, in which the outline coordinates of the pad to be detected are marked. Because each image is taken by moving the camera across the entire large board, there will be a certain deviation from the coordinates marked in the JSON file, so alignment is required.

[0166] After registration, the pad image of the current image is cut out as the test set.

[0167] According to the project background, we know that although the shapes of each FPC pad are different, what remains unchanged is that each FPC board has a prototype pad, so the prototype pad can be used for alignment.

[0168] Registration steps:

[0169] In order to save costs and other considerations, multiple circuit boards will be spliced ​​in the production of circuit boards. When the spliced ​​board is transmitted to the image acquisition system described in step 2, the image of each circuit board is collected by moving the camera or the spliced ​​board, so the position coordinates contained in the corresponding JSON file will be relatively offset relative to the pad position of the circuit board image. Mark points are set in circuit board design to help the placement machine optical positioning, and this method also uses this point to align the JSON file with the circuit board image.

[0170] Mark points are composed of marked points and open areas, such as Figure 3 shown.

[0171] This method proposes a solid circle matching algorithm based on a ring. The algorithm first generates a ring template according to the coordinates of the Mark point area in the JSON file. The inner diameter of the ring is 1 pixel smaller than the edge diameter of the Mark area, and the outer diameter of the ring is 1 pixel larger than the edge diameter of the Mark. The template is divided into 4 arcs at 45 degrees and 135 degrees. Figure 4 shown.

[0172] The pixel value sets on the inner and outer arcs of the upper, lower, left and right sides are respectively Ui, Uo, Di, Do, Li, Lo, Ri and Ro. The recognition threshold δ is set according to the different color characteristics of the marked area and the open area of ​​the Mark point. The X-axis and Y-axis offset distances are calculated according to formulas (2) and (3). The template coordinates are updated to completely move the inner ring of the template to the inside of the Mark point marked area, and the outer ring of the template is outside the Mark point marked area.

[0173]

[0174]

[0175] where x offset Indicates the horizontal offset distance of the template relative to the current circuit board image, y offset Indicates the vertical offset distance of the template relative to the current circuit board image.

[0176] After registration, firstly, the pixel values ​​of the non-to-be-detected areas of the circuit board image are set to 0 according to the pad coordinates in the JSON file, and then the minimum rectangular bounding box of each pad is calculated according to Formula 4.

[0177]

[0178] Where (x 0 ,y 0 ) is the upper left corner of the bounding box, (x 1 ,y 1) is the lower right corner point of the bounding box, and X, Y are the horizontal and vertical coordinate sets of the pad. The minimum bounding box is determined based on the coordinates of the above two points on the circuit board image to cut out the pad image and save it to the data set, thereby generating a single pad image data set with a black background, that is, a pixel value of 0 in the non-pad area.

[0179] In the embodiment of the present application, after generating a single pad image data set with a black background, that is, a pixel value of 0 in the non-pad area, in order to provide the data set required for subsequent neural network model training, the existing data set needs to be divided into a defective data set and a non-defective data set. Since the amount of data is not very large, the data can be manually screened, or the data set can be preliminarily screened and then manually screened by extracting obvious defect features, which can reduce the workload. In this embodiment, the pad discoloration defect is detected. To determine whether a pad contains a defect, it is necessary to determine whether the discoloration area exceeds the allowed proportion, whether the degree of discoloration exceeds the allowed degree, and if a rainbow-like discoloration, that is, a color mutation, is generated, it is judged as defective regardless of the size of the discoloration area. Because the color of the non-defective pad collected by the image acquisition system is white and bright, and the color of the defective area is reddish or yellowish, it can be seen from the RGB color space that the color change from white and bright to red or yellow is mainly related to the decrease in the pixel value of the blue channel. In this embodiment, the data set is preliminarily screened according to this color feature, and then manually screened and confirmed to be divided into a defective data set and a non-defective data set.

[0180] Considering that the illumination intensity may slightly change when the actual image acquisition system acquires the circuit board image, this embodiment strengthens the data set. According to the conversion formula between RGB color space and HSV color space, it can be known that only the value of max(R,G,B) needs to be modified to simulate the change of illumination intensity. According to this method, the operation of max(R,G,B)=max(R,G,B)±d is performed on 1 / 3 of the data to obtain the enhanced data set.

[0181] In some optional implementations of this embodiment, considering that the illumination intensity may slightly change when the actual image acquisition system acquires the circuit board image, this embodiment enhances the data set. According to the conversion formula between the RGB color space and the HSV color space, it can be known that only the value of max(R,G,B) needs to be modified to simulate the change of illumination intensity. According to this method, the enhanced data set can be obtained by performing the operation of max(R,G,B)=max(R,G,B)±d on 1 / 3 of the data.

[0182] In summary, the present application provides a pad detection device 200 for a flexible circuit board, including: a training request receiving module 210, for receiving a model training request carrying a circuit board sample image and pad position information; a segmentation operation module 220, for performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image; an annotation sending module 230, for sending the pad sample image to a terminal device to perform an annotation operation on the pad sample image; an annotation receiving module 240, for receiving a pad annotated image sent by the terminal device, the pad annotated image being a pad sample image carrying annotation information, and the annotation information being good product information Or defective product information; model training module 250, used to call the original ResNet neural network model, and use the pad sample image as training data and the annotation information as result data to perform model training operation on the original ResNet neural network model, and obtain a target ResNet neural network model for identifying the quality of the pad image; detection request receiving module 260, used to accept a pad detection request carrying a circuit board image to be tested; pad detection module 270, used to input the circuit board image to be tested into the target ResNet neural network model for pad detection operation, and obtain a pad detection result; result output module 280, used to output the pad detection result. This application is aimed at the FPC boards of different sizes provided by the manufacturer, which contain multiple irregularly shaped pads, and studies the design and system implementation of the FPC pad defect detection algorithm based on neural network, while meeting the basic detection requirements, improving the efficiency of defect detection. The detection method of naked eye inspection is easily affected by subjective and objective factors, and the correctness of the results cannot be guaranteed, and the inspection process is very time-consuming. The system can solve these problems well, meet our expectations for defect detection, and has both the advantages of versatility and stability.

[0183] The content and results of the experiment are as follows:

[0184] (1) The sample image and template image are aligned based on the pad coordinates marked in the JSON file. As the size of the entire FPC image is large, the traditional template matching algorithm cannot match the rotated and translated images well. First, the pads are marked using the JSON file, and image alignment is performed for circular pads, which improves the matching accuracy and speed. Then, a method is proposed to first perform local template matching to find the feature points, and then perform affine transformation based on the feature points to achieve alignment between the sample image and the template image.

[0185] (2) Research related image processing algorithms, and design a neural network-based FPC defect extraction algorithm flow and classification method for pad defects. Due to differences in light and size between the sample image and the template image, as well as noise generated during image acquisition, transmission, and imaging, the difference between the defective and non-defective parts will be included in the difference in the difference. To address this problem, this paper uses a modified image brightness enhancement dataset. First, the dataset is used to train the network model, and then each image is aligned and the pads are segmented. Finally, the trained resnet network model is used to detect and segment the pads, implement the defect classification algorithm, and finally achieve defect detection and classification.

[0186] (3) Based on the existing mechanical structure and the overall requirements of the FPC defect detection system, the process flow and overall plan were designed, and the hardware and software parts were coordinated and communicated to complete the image acquisition.

[0187] (4) Finally, according to the demand analysis and the research objectives of the paper, the composition of the entire defect detection system, the system process flow, and the defect detection process are emphasized. The FPC pad detection and classification, and the visualization system of traceable detection data are integrated. After experiments, the accuracy and efficiency of the software are guaranteed.

[0188] To solve the above technical problems, the present application also provides a computer device. Figure 6 , Figure 6 This is a basic structural block diagram of the computer device in this embodiment.

[0189] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 300 having components 310-330, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0190] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0191] The memory 310 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 310 can also include both the internal storage unit of the computer device 300 and its external storage device. In this embodiment, the memory 310 is generally used to store an operating system and various application software installed on the computer device 300, such as computer-readable instructions for a pad detection method for a flexible circuit board. In addition, the memory 310 can also be used to temporarily store various data that have been output or are to be output.

[0192] The processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 320 is generally used to control the overall operation of the computer device 300. In this embodiment, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as running the computer-readable instructions of the pad detection method applied to the flexible circuit board.

[0193] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.

[0194] The computer device provided in the present application can greatly improve the detection accuracy and speed by accurately marking the pad position coordinates of each product, using a program to parse the pad position coordinates of each pad, and then locally calibrating the parsed coordinates, and finally using a ResNet neural network model to detect the marked area on the flexible circuit board (FPC) image.

[0195] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the pad detection method applied to the flexible circuit board as described above.

[0196] The computer-readable storage medium provided by the present application can greatly improve the detection accuracy and speed by accurately marking the pad position coordinates of each product, using a program to parse the pad position coordinates of each pad, and then locally calibrating the parsed coordinates, and finally using a ResNet neural network model to detect the marked area on the flexible circuit board (FPC) image.

[0197] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0198] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A pad detection method for a flexible circuit board, It is characterized in that The steps include: Accept model training requests with sample images of circuit boards and pad location information; Performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image; Sending the pad sample image to a terminal device to perform a labeling operation on the pad sample image; Receiving a pad annotated image sent by the terminal device, wherein the pad annotated image is a pad sample image carrying annotation information, and the annotation information is good product information or defective product information; Calling the original ResNet neural network model, and performing a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data, to obtain a target ResNet neural network model for identifying pad image quality; Accept a pad inspection request with an image of the circuit board to be tested; Inputting the circuit board image to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result; Outputting the pad detection result; After the step of segmenting the circuit board sample image according to the pad position information to obtain the pad sample image, the following step is also included: The pad sample image is converted from the RGB color space to the HSV color space according to a conversion formula, and the conversion formula is expressed as: in, , ,After converting to HSV space, the H channel is automatically segmented using the Otsu method, and the value of the background area is set to zero; The step of inputting the circuit board image to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result specifically includes the following steps: Counting the change area of ​​the B channel value in the RGB color space of each pad position to be tested in the image of the circuit board to be tested; The image of the circuit board to be tested is detected according to the preset good product ratio threshold S1, the bad product ratio threshold S2 and the judgment function, and the judgment function is expressed as: Among them, the Indicates the ratio of the area of ​​the change region to the area of ​​the pad to be tested; Represents the result obtained by performing a pad detection operation on the image of the circuit board to be tested through the target ResNet neural network model.

2. The pad detection method for a flexible circuit board according to claim 1, It is characterized in that Before the step of calling the original ResNet neural network model and performing a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data to obtain a target ResNet neural network model for identifying pad image quality, the following step is also included: The pad sample images are pre-classified according to the feature method to obtain a plurality of groups of pad sample images with similar pad shapes.

3. A pad detection device for a flexible circuit board, It is characterized in that include: A training request receiving module, used to receive a model training request carrying a circuit board sample image and pad position information; A segmentation operation module, used for performing a segmentation operation on the circuit board sample image according to the pad position information to obtain a pad sample image; A labeling sending module, used for sending the pad sample image to a terminal device to perform a labeling operation on the pad sample image; A label receiving module, used for receiving a pad label image sent by the terminal device, wherein the pad label image is a pad sample image carrying label information, and the label information is good product information or defective product information; A model training module, used to call the original ResNet neural network model, and perform a model training operation on the original ResNet neural network model using the pad sample image as training data and the annotation information as result data, to obtain a target ResNet neural network model for identifying pad image quality; A detection request receiving module, used for receiving a pad detection request carrying an image of a circuit board to be tested; A pad detection module is used to input the image of the circuit board to be tested into the target ResNet neural network model to perform a pad detection operation to obtain a pad detection result; A result output module, used for outputting the pad detection result; The device also includes: The color space conversion module is used to convert the pad sample image from the RGB color space to the HSV color space according to a conversion formula, and the conversion formula is expressed as: in, , ,After converting to HSV space, the H channel is automatically segmented using the Otsu method, and the value of the background area is set to zero; The pad detection module comprises: A change region acquisition submodule is used to count the change region of the B channel value in the RGB color space of each pad position to be tested in the image of the circuit board to be tested; The detection submodule is used to detect the image of the circuit board to be tested according to a preset good product ratio threshold S1, a defective product ratio threshold S2 and a judgment function, wherein the judgment function is expressed as: Among them, the Indicates the ratio of the area of ​​the change region to the area of ​​the pad to be tested; Represents the result obtained by performing a pad detection operation on the image of the circuit board to be tested through the target ResNet neural network model.

4. The pad detection device for a flexible printed circuit board according to claim 3, It is characterized in that The device also includes: The pre-classification module is used to perform a pre-classification operation on the pad sample images according to a feature method to obtain a plurality of groups of pad sample images with similar pad shapes.

5. A computer device, It is characterized in that It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the pad detection method applied to a flexible circuit board as described in any one of claims 1 to 2 are implemented.

6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the pad detection method applied to a flexible circuit board as described in any one of claims 1 to 2 are implemented.

Citation Information

Cited By

  • Backlight board circuit board defect detection system and method based on vision

    CN115861217A