PCB board mark point reflective spot segmentation method based on deep learning

Through a deep learning-based method, using U-shaped neural network and spatial weight array, the problem of affecting the recognition of reflective spots in Mark points in printed circuit board production is solved, and high-precision Mark point recognition is achieved, suitable for a variety of reflective segmentation applications .

CN114202489BActive Publication Date: 2024-11-26SUZHOU ANDAO INTELLIGENT TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111273505.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2024-11-26
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

During the production process of printed circuit boards, when the ring light source illuminates the PCB board, due to the unevenness of the photosensitive film and the specular reflection of the copper foil, various shapes of light spots appear in the Mark point, which affects the recognition effect, and it is difficult to effectively eliminate the existing technology. Reflection, reduces Mark point recognition accuracy.

Method used

Using the Mark dot reflective spot segmentation method of PCB board based on deep learning, the space weight array is generated by acquiring and annotating grayscale images, and a U-shaped neural network is constructed for segmentation. The loss function optimization model is used to combine cross entropy loss function and spatial weight. Automatically identify and cover the reflective area.

Benefits of technology

Effectively eliminate reflection caused by irradiation of annular light sources, improve Mark point recognition accuracy, simplify image acquisition and preprocessing process, reduce manual participation, improve segmentation speed and accuracy, and is suitable for various reflective segmentation applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114202489B_ABST
    Figure CN114202489B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for segmenting reflective spots of PCB board Mark points based on deep learning, the method comprising: marking all reflective pixels in a grayscale image of a PCB board Mark point at the same coordinate position of another grayscale image to obtain a marked image; preprocessing the PCB board image and the corresponding marked image to obtain a training set and a test set; filtering and denoising the PCB board image, and then scaling the PCB board image and the marked image at the same ratio; normalizing the grayscale values ​​of all pixels in the PCB board image at the same time; generating a spatial weight array using the preprocessed PCB board image and the marked image; segmenting the PCB board image using the spatial weight array, the marked image and a neural network; and transferring the segmentation result to the PCB board image to cover the reflective area. The present invention can eliminate the reflection generated by the annular light source irradiating the photosensitive film on the PCB board, and improve the recognition accuracy of the Mark point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of printed circuit board manufacturing, and specifically relates to a method for segmenting reflective light spots of PCB board Mark points based on deep learning. Background Art

[0002] The reference (Mark) point is a positioning mark on the printed circuit board (PCB). Common shapes include circle, diamond, triangle and cross. In the production process of PCB boards, a layer of copper foil is usually attached to the PCB board before a layer of photosensitive film is attached. When using a ring light source for illumination, due to the unevenness of the photosensitive film and the mirror reflection of the copper foil, the industrial camera obtains the PCB board image. There are light spots of various shapes in the mark point, which affects the recognition effect. There are many types of PCB circuit boards produced, and the number is increasing year by year. Therefore, reducing the impact of reflection is extremely important for the production process of PCB boards. Summary of the invention

[0003] In response to the problem that there are light spots of various shapes inside the mark points in the PCB board image, the present invention provides a PCB board mark point reflective spot segmentation method based on deep learning, which aims to eliminate the reflection generated by the ring light source irradiating the photosensitive film on the PCB board and improve the mark point recognition accuracy.

[0004] The present invention provides a method for segmenting reflective spots of PCB board Mark points based on deep learning, and the method comprises the following steps:

[0005] S1. Obtain a grayscale image of a Mark point on a PCB board, and mark all reflective pixels in the grayscale image of the Mark point on the PCB board at the same coordinate position in another grayscale image to obtain a marked image;

[0006] S2, preprocessing the grayscale image of the Mark points of the PCB board and the corresponding annotated images to obtain a training set and a test set;

[0007] Filter and reduce noise on the PCB board image, and then scale the PCB board image and the annotated image to the same size so that the image size is the same as the size of the neural network defined input image;

[0008] At the same time, the grayscale values ​​of all pixels in the PCB board image are normalized to the interval [0,1]. The normalization calculation method is: the grayscale values ​​of all pixels are divided by 255;

[0009] S3, using the pre-processed PCB board image and the annotated image to generate a spatial weight array;

[0010] S4, segmenting the PCB board image using the spatial weight array, the labeled image and the neural network;

[0011] S5. Transfer the segmentation result to the PCB board image to cover the reflective area.

[0012] Furthermore, in S1, in the annotated image, all the annotated pixels are connected into a number of continuous closed areas, wherein the grayscale value of the background pixel is 0 and the grayscale value of the reflective pixel is 1.

[0013] Furthermore, in S2, the training set and the test set are obtained by the following steps:

[0014] Remove the PCB board images and corresponding annotated images that contain artifacts and blurs, randomly select a number of PCB board images and corresponding annotated images as training sets, and another number of PCB board images and corresponding annotated images as test sets.

[0015] Furthermore, in S2, the process of filtering and denoising the PCB board image is: scanning all pixels of the image with an n×n filter, and replacing the central pixel with a weighted average of pixels in the neighborhood determined by the mask and the mask at the corresponding position, where n is a positive integer.

[0016] Furthermore, in S2, in the process of scaling the PCB board image and the annotated image at the same ratio, if the length or width of the image scaled at the same ratio is smaller than the image defined by the neural network, the image area will be smaller than the area of ​​the image defined by the neural network, then the part smaller than the image defined by the neural network will be filled with the background color, and the final image size will be the same as the size of the input image defined by the neural network.

[0017] Furthermore, in S3, the spatial weight array is generated using the preprocessed PCB board image and the annotated image, specifically including:

[0018] S31, preprocessing the annotated image, including: finding the arc edge of the circular hole area in the annotated image, fitting the circle to form a circular contour circle1 with a radius of r, and then drawing a circular contour circle2 with a radius of (1+μ%)*r, where μ is a threshold; and selecting the area surrounded by the circular contour circle2 as a circular ROI;

[0019] S32, first calculate the maximum distance l from the edge of the circular ROI to the center of the circular ROI max , divide this distance into n segments, each segment is l max / n, then the distance d between the pixel in the i-th segment and the center point satisfies:

[0020] Then calculate the distance between all reflective pixels in the circular ROI and the center point of the circular ROI, classify the calculated reflective pixels according to the distance from the center point of the circular ROI, and classify the reflective pixels in the i-th segment into the i-th category, and then calculate the number of pixels in the same category;

[0021] S33, define a spatial weight array A with a length of n, the element value of the array index i is equal to the number of elements in the i+1th category, and finally normalize the weight array so that all values ​​are distributed between 0 and 1;

[0022] X is the weight value in the array, Xmax, Xmin, and Xnorm are the maximum and minimum values ​​in the spatial weight array and the normalized value, respectively. The normalization method is as follows:

[0023]

[0024] S34. Replace the original weight value of the array with Xnorm to generate a new spatial weight array.

[0025] Furthermore, the value range of μ is 10-20.

[0026] Furthermore, after S34, the step further includes the following steps:

[0027] S35. If the last weight value An of the new weight array is 0, remove the last weight value An, reduce the array dimension by 1, the classification book will be n-1, and repeat this operation until the last weight value is not 0.

[0028] Furthermore, in S4, the PCB board image is segmented using a spatial weight array, annotated images, and a neural network, including the following steps:

[0029] S41. Constructing U-type neural network:

[0030] The U-shaped neural network includes a left unit and a right unit, and a convolution unit connecting the left unit and the right unit;

[0031] The left unit includes four compression path units, and two adjacent compression path units perform bilateral convolution operations and pooling operations in sequence;

[0032] The right unit includes four extension path units, and two adjacent extension path units are sequentially subjected to upsampling operation, splicing operation, two convolution operations and squeeze excitation operation of the squeeze excitation module;

[0033] The convolution operation is used to perform two convolution operations on the input of the left unit and transmit it to the right unit;

[0034] Input features to the squeeze excitation module Figure X ;feature Figure X After the convolution operation, the feature map U is obtained; the feature map U is further convolutionally operated to obtain the feature map V. The feature map U is also subjected to global average pooling, squeezing operation, full connection operation, and sigmoid activation function to obtain a 1×1×C feature vector; finally, the 1×1×C feature vector is multiplied with the feature map V to finally achieve the excitation of important channels and the suppression of unimportant channels;

[0035] S42, inputting the PCB board picture into the U-type neural network of S41, obtaining a prediction graph after the U-type neural network calculates the PCB board picture, and the size of the prediction graph is the same as the size of the annotated picture, and determining whether the predicted value of the prediction graph is the same as the grayscale value of the same position of the annotated picture;

[0036] If they are different, a loss will occur. The cross entropy loss function is used to calculate the difference between the predicted image and the labeled image as the loss L1, and then the difference between the result of combining the predicted image and the spatial weight array and the labeled image is used as the loss L2. The specific calculation results are as follows:

[0037] Take (α11, α21), (α12, α22), (α13, α23), ..., (α1 k , α2 k ) is the loss function weight of k groups of network models. The weight values ​​are not repeated so that each learner has different preferences. The loss L of k models is as follows:

[0038] L=α1 i L1+α2 i L2 (where i = 1, 2, 3, ..., k)

[0039] The calculation method of L2 is as follows:

[0040] If a pixel is predicted to have no reflection, that is, the predicted value is 0, and the pixel at the same position in the actual annotated image has reflection, that is, the gray value is 1, then the pixel is a false negative example FN; or if the pixel is predicted to have reflection, that is, the predicted value is 1, and the pixel in the annotated image has no reflection, that is, the gray value is 0, then the pixel is a false positive example FP. Losses will only occur when false negative examples and false positive examples occur; let the predicted value of a pixel be y pred , the grayscale value of the pixel at the same position in the actual annotated image is y true , according to the method described in S32, it is calculated that the pixel belongs to the jth interval, and the spatial weight value of the interval is Aj, then the calculation formula of L2 is:

[0041] L2=(y true -y pred ) 2 ·ln(1+A j)

[0042] S43. Use back propagation to update the U-type neural network parameters, and repeat the above steps to obtain the optimized U-type neural network model.

[0043] Furthermore, in S5, the segmentation result is transferred to the PCB board image to cover the reflective area, which specifically includes:

[0044] During segmentation, the image is passed into k models to obtain k prediction images. Therefore, there are k prediction results for each pixel. The prediction value is determined by the principle of minority obeys majority to determine whether the pixel is a reflective pixel.

[0045] The coordinate position of the reflective pixel identified in the segmentation result is transferred to the PCB board image, and the grayscale value of the pixel at the coordinate position on the PCB board image is set to 0, covering the reflective spot within the Mark point on the PCB board image.

[0046] Compared with the prior art, the beneficial effects of the present invention using the above scheme are:

[0047] The method of the present invention can eliminate the reflections caused by the ring light source irradiating the photosensitive film on the PCB board, and improve the recognition accuracy of the Mark points. In addition, the method of the present invention is simple to obtain images, and the preprocessing and neural network construction have relevant open source functions, and the design process is modular and easy to use. Automatic segmentation is performed by industrial computers, and no human participation is required, which reduces the operation time, so the segmentation speed is fast and the accuracy is high. Because the neural network has a strong learning ability, when there are enough PCB board pictures, it can learn to segment various difficult-to-identify areas, so it can segment difficult-to-identify areas. Because this method is suitable for various applications of reflection segmentation, the various units and modules in the network model are widely applicable, and the structure does not require major adjustments, so it has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a picture of the PCB board;

[0049] Figure 2 It is to label the picture;

[0050] Figure 3 It is the pixel interval diagram of the PCB board image;

[0051] Figure 4 is a spatial weight array graph;

[0052] Figure 5 It is the squeeze excitation module diagram;

[0053] Figure 6 is the compression path unit graph;

[0054] Figure 7 is the extended path unit graph;

[0055] Figure 8 is the convolutional unit graph;

[0056] Fig. 9 It is a complete network structure diagram;

[0057] Fig.10 This is the result graph. DETAILED DESCRIPTION

[0058] In order to more clearly understand the above-mentioned objectives, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0060] This embodiment provides a method for segmenting reflective spots at Mark points on a PCB board based on deep learning, and the method includes the following steps:

[0061] S1. Obtain the grayscale image of the Mark point of the PCB board, mark all the reflective pixels in the grayscale image of the Mark point of the PCB board at the same coordinate position of another grayscale image, and obtain the marked image, including:

[0062] First, use a camera or other imaging device to obtain a grayscale image of the PCB board mark point, such as Figure 1 All the reflective pixels in the Mark point in the PCB board Mark point image are marked with a labeling tool (such as Photoshop or labelme software) at the same coordinate position in another grayscale image, and the grayscale image is the marked image. All the marked pixels are connected into several continuous closed areas, such as Figure 2 , the grayscale value of the background pixel is 0, and the grayscale value of the reflective pixel is 1.

[0063] S2. Preprocess the grayscale image of the PCB board Mark points and the corresponding annotated images to obtain the training set and test set, including:

[0064] Remove the PCB images and corresponding annotated images that contain artifacts and blurs that affect the training effect of the neural network, and then randomly select 80% of the PCB images and the corresponding annotated images as the training set, and the remaining 20% ​​of the PCB images and the corresponding annotated images as the test set;

[0065] Gaussian filtering can be used to filter and reduce noise on PCB images. That is, a filter of m×m (m is a positive integer, for example, m is 5) is used to scan all pixels of the image, and the value of the central pixel is replaced by the weighted average of the pixels in the neighborhood determined by the mask and the mask at the corresponding position.

[0066] Scale the PCB board image and the annotated image to the same ratio (mostly reduce it to reduce the amount of calculation of the neural network) to facilitate deep learning network learning. If the length or width of the image scaled to the same ratio is smaller than the area of ​​the image defined by the neural network, the area of ​​the image will be smaller than the area of ​​the image defined by the neural network, then the part smaller than the image defined by the neural network will be filled with the background color, and finally the size of the scaled PCB board image and the annotated image will be the same as the size of the input image defined by the neural network;

[0067] Normalize the grayscale values ​​of all pixels in the PCB board image to a value between [0,1]. The calculation method is to divide the grayscale values ​​of all pixels by 255.

[0068] S3. Generate a spatial weight array using the preprocessed PCB board image and the annotated image, including:

[0069] S31, preprocessing the annotated image, including: finding the arc edge of the circular hole area in the annotated image, fitting the circle to form a circular contour circle1 through opencv or other image processing libraries. The radius of the circular contour is r, and circle2 is drawn with (1+μ%)*r as the radius, μ is a threshold value, which can be 10 to 20. The area surrounded by the circular contour circle2 is selected as the circular ROI.

[0070] S32, first calculate the radius l of the circular ROI max , divide the distance into n segments, each segment length is The distance d between the pixel in the i-th segment and the center point is in an interval, and the interval where d is located is as follows:

[0071]

[0072] All pixel intervals are shown in Figure 3 shown.

[0073] Then calculate the distance between all reflective pixels in the circular ROI and the center point of the circular ROI. Classify the calculated reflective pixels according to the distance from the center point of the circular ROI. Those in the i-th segment are classified into the i-th category, and then calculate the number of pixels in the same category. (x, y) is the coordinate of the reflective pixel in the circular ROI, and the coordinate of the center point of the circular ROI is (x0, y0). The calculation formula for the distance D between the reflective pixel and the center point of the circular ROI is as follows:

[0074]

[0075] S33. Define a spatial weight array A with a length of n. The value of the element with array index i is equal to the number of elements in the i+1th class. Finally, normalize the weight array so that all values ​​are distributed between 0 and 1. X is the weight value in the array, Xmax, Xmin, and Xnorm are the maximum and minimum values ​​and the normalized value in the spatial weight array, respectively. The normalization method is as follows:

[0076]

[0077] S34, replace the original weight value of the array with Xnorm, and the resulting spatial weight array is as follows Figure 4 As shown, Ai represents the value of the i-th element (ie, Xnorm), which is the spatial weight value of all pixels located in the i-th segment in the PCB board image.

[0078] S35. If the last weight value of the weight array, that is, An, is 0, An is removed, the array dimension is reduced by 1, and the number of categories is reduced to n-1. This operation is repeated until the last weight value is not 0.

[0079] S4, using the spatial weight array, the labeled image and the neural network to segment the PCB board image, including the following steps:

[0080] S41. Constructing U-type neural network:

[0081] U-Net, including left and right units, and convolutional units connecting the left and right units, such as Fig. 9 As shown;

[0082] The left unit includes four compression path units, each of which contains a Max-Pooling operation and two Conv operations. Figure 6 The right unit consists of four extended path units, each of which contains an Upsampling operation, a Concat operation, two Conv operations, and a SE module. Figure 7 .

[0083] Squeeze excitation module such as Figure 5 As shown, the input features Figure XAfter the convolution operation, the feature map U is obtained; the feature map U is convolved again to obtain the feature map V. The feature map U is subjected to the GAP (global average pooling, squeezing) operation, the FN (full connection) operation, and the sigmoid activation function to obtain a 1×1×C feature vector; finally, the 1×1×C feature vector is multiplied with the feature map V, which can ultimately achieve the excitation of important channels and the suppression of unimportant channels. The convolution unit is two convolution operations, which are used to connect the compression path and the expansion path, see Figure 8 .

[0084] S42, input the PCB board image into the U-shaped neural network of S41, and a prediction image can be obtained after complex calculations in the U-shaped neural network. The size of the prediction image is the same as the size of the labeled image. The training adopts the method of ensemble learning, and k network models are trained. The specific training process of each network model is as follows: input the training set PCB board image into the neural network, output the prediction image, and if the predicted value of the prediction image is different from the grayscale value of the same position in the labeled image, a loss will be generated. The loss is divided into two parts. The cross entropy loss function is used to calculate the difference between the predicted image and the labeled image as the loss L1, and then the difference between the result of combining the predicted image and the spatial weight and the labeled image is used as the loss L2.

[0085] (α11, α21), (α12, α22), (α13, α23),…, (α1 k , α2 k ) is the loss function weight of k groups of network models. The weight values ​​are not repeated so that each learner has different preferences. The loss L of k models is as follows:

[0086] L=α1 i L1+α2 i L2 (where i = 1, 2, 3, ..., k) (4)

[0087] Among them, in the loss function weight of each group of network models, α determines the proportion of L1 and L2, the value range is [0,1], and the loss function weight of each group of network models is α1+α2=1.

[0088] The calculation method of L2 is as follows:

[0089] If a pixel is predicted to have no reflection (predicted value is 0), but the pixel at the same position in the actual label image has reflection (grayscale value is 1), then the pixel is a false negative FN; or if the pixel is predicted to have reflection (predicted value is 1), but the pixel in the label image has no reflection (grayscale value is 0), then the pixel is a false positive FP. Losses will only occur when false negatives and false positives occur. The predicted value of a pixel is y pred , the grayscale value of the pixel at the same position in the actual label image is y true, according to the method described in S32, it is calculated that the pixel belongs to the jth interval, and the spatial weight value of the interval is Aj, then the calculation formula of L2 is as shown in the following formula 5:

[0090] L2=(y true -y pred ) 2 ·ln(1+A j ) (5)

[0091] S43, finally, back propagation is used to update the parameters of the U-type neural network. The optimized U-type neural network model can be obtained by looping the above steps.

[0092] S5. Transfer the segmentation result to the PCB board image to cover the reflective area, including:

[0093] During segmentation, the image is passed to k models to obtain k prediction images. Therefore, there are k prediction results for each pixel. The prediction value is determined by the principle of minority obeys majority, that is, assuming that k is 3, if two or three models predict the pixel as reflective, then the pixel is considered to be a reflective pixel, otherwise it is considered to be a background pixel. The coordinate position of the reflective pixel identified in the segmentation result is passed to the PCB board image, and the grayscale value of the pixel at the coordinate position on the PCB board image is set to 0 (black, background color), covering the reflective spot in the Mark point on the PCB board image. Fig.10 As shown, the reflective spot within the mark point of the PCB image is covered with black, which is conducive to the identification of positioning coordinates.

[0094] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A PCB board mark point reflective spot segmentation method based on deep learning, characterized in that: The method comprises the following steps: S1. Obtain a grayscale image of a Mark point on a PCB board, and mark all reflective pixels in the grayscale image of the Mark point on the PCB board at the same coordinate position in another grayscale image to obtain a marked image; S2, preprocessing the grayscale image of the Mark points of the PCB board and the corresponding annotated images to obtain a training set and a test set; Filter and reduce noise on the PCB board image, and then scale the PCB board image and the annotated image to the same size so that the image size is the same as the size of the neural network defined input image; At the same time, the grayscale values ​​of all pixels in the PCB board image are normalized to the interval [0,1]. The normalization calculation method is: the grayscale values ​​of all pixels are divided by 255; S3, using the pre-processed PCB board image and the annotated image to generate a spatial weight array; S4, segmenting the PCB board image using the spatial weight array, the labeled image and the neural network; S5. Transfer the segmentation result to the PCB board image to cover the reflective area.

2. The method for segmenting the reflective spot of a PCB board Mark point based on deep learning according to claim 1 is characterized in that: In S1, in the annotated image, all the annotated pixels are connected into a number of continuous closed areas, wherein the grayscale value of the background pixel is 0 and the grayscale value of the reflective pixel is 1.

3. The method for segmenting the reflective spot of a PCB Mark point based on deep learning according to claim 1 is characterized in that: In S2, the training set and the test set are obtained by the following steps: Remove the PCB board images and corresponding annotated images that contain artifacts and blurs, randomly select a number of PCB board images and corresponding annotated images as training sets, and another number of PCB board images and corresponding annotated images as test sets.

4. The method for segmenting the reflective spot of a PCB Mark point based on deep learning according to claim 1 is characterized in that: In S2, the process of filtering and denoising the PCB board image is: using an n×n filter to scan all pixels of the image, and replacing the central pixel with a weighted average of pixels in the neighborhood determined by the mask and the mask at the corresponding position, where n is a positive integer.

5. The method for segmenting the reflective spot of a PCB Mark point based on deep learning according to claim 1, characterized in that: In S2, in the process of scaling the PCB board image and the annotated image at the same ratio, if the length or width of the image scaled at the same ratio is smaller than the image defined by the neural network, the image area will be smaller than the area of ​​the image defined by the neural network, then the part smaller than the image defined by the neural network will be filled with the background color, and the final image size will be the same as the size of the input image defined by the neural network.

6. The method for segmenting the reflective spot of a PCB Mark point based on deep learning according to claim 1, characterized in that: In S3, the spatial weight array is generated using the preprocessed PCB board image and the annotated image, specifically including: S31, preprocessing the annotated image, including: finding the arc edge of the circular hole area in the annotated image, fitting the circle to form a circular contour circle1 with a radius of r, and then drawing a circular contour circle2 with a radius of (1+μ%)*r, where μ is a threshold; and selecting the area surrounded by the circular contour circle2 as a circular ROI; S32, first calculate the maximum distance l from the edge of the circular ROI to the center of the circular ROI max , divide this distance into n segments, each segment is l max / n, then the distance d between the pixel in the i-th segment and the center point satisfies: Then calculate the distance between all reflective pixels in the circular ROI and the center point of the circular ROI, classify the calculated reflective pixels according to the distance from the center point of the circular ROI, and classify the reflective pixels in the i-th segment into the i-th category, and then calculate the number of pixels in the same category; S33, define a spatial weight array A with a length of n, the element value of the array index i is equal to the number of elements in the i+1th category, and finally normalize the weight array so that all values ​​are distributed between 0 and 1; X is the weight value in the array, Xmax, Xmin, and Xnorm are the maximum and minimum values ​​in the spatial weight array and the normalized value, respectively. The normalization method is as follows: S34. Replace the original weight value of the array with Xnorm to generate a new spatial weight array.

7. The method for segmenting the reflective spot of a PCB Mark point based on deep learning according to claim 6, characterized in that: The value range of μ is 10-20.

8. The method for segmenting reflective spots of PCB board Mark points based on deep learning according to claim 6, characterized in that: The step S34 also includes the following steps: S35. If the last weight value An of the new weight array is 0, remove the last weight value An, reduce the array dimension by 1, the classification book will be n-1, and repeat this operation until the last weight value is not 0.

9. The method for segmenting the reflective spot of a PCB Mark point based on deep learning according to claim 6, characterized in that: In S4, the PCB board image is segmented using a spatial weight array, annotated images, and a neural network, including the following steps: S41. Constructing U-type neural network: The U-shaped neural network includes a left unit and a right unit, and a convolution unit connecting the left unit and the right unit; The left unit includes four compression path units, and two adjacent compression path units perform bilateral convolution operations and pooling operations in sequence; The right unit includes four extension path units, and two adjacent extension path units are sequentially subjected to upsampling operation, splicing operation, two convolution operations and squeeze excitation operation of the squeeze excitation module; The convolution operation is used to perform two convolution operations on the input of the left unit and transmit it to the right unit; The feature map X is input to the squeeze excitation module; the feature map X is subjected to a convolution operation to obtain a feature map U; the feature map U is further subjected to a convolution operation to obtain a feature map V, and the feature map U is further subjected to global average pooling, a squeeze operation, a full connection operation, and a sigmoid activation function to obtain a 1×1×C feature vector; finally, the 1×1×C feature vector is multiplied by the feature map V, and finally the excitation of important channels and the suppression of unimportant channels are realized; S42, inputting the PCB board picture into the U-type neural network of S41, obtaining a prediction graph after the U-type neural network calculates the PCB board picture, and the size of the prediction graph is the same as the size of the annotated picture, and determining whether the predicted value of the prediction graph is the same as the grayscale value of the same position of the annotated picture; If they are different, a loss will occur. The cross entropy loss function is used to calculate the difference between the predicted image and the labeled image as the loss L1, and then the difference between the result of combining the predicted image and the spatial weight array and the labeled image is used as the loss L2. The specific calculation results are as follows: Take (α11, α21), (α12, α22), (α13, α23), ..., (α1 k , α2 k ) is the loss function weight of k groups of network models. The weight values ​​are not repeated so that each learner has different preferences. The loss L of k models is as follows: L=α1 i L1+α2 i L2 (where i = 1, 2, 3, ..., k) The calculation method of L2 is as follows: If a pixel is predicted to have no reflection, that is, the predicted value is 0, and the pixel at the same position in the actual annotated image has reflection, that is, the gray value is 1, then the pixel is a false negative example FN; or if the pixel is predicted to have reflection, that is, the predicted value is 1, and the pixel in the annotated image has no reflection, that is, the gray value is 0, then the pixel is a false positive example FP. Losses will only occur when false negative examples and false positive examples occur; let the predicted value of a pixel be y pred , the grayscale value of the pixel at the same position in the actual annotated image is y true , according to the method described in S32, it is calculated that the pixel belongs to the jth interval, and the spatial weight value of the interval is Aj, then the calculation formula of L2 is: L2=(and true -and pred ) 2 ln(1+A j ) S43. Use back propagation to update the U-type neural network parameters, and repeat the above steps to obtain the optimized U-type neural network model.

10. The method for segmenting the reflective spot of a PCB Mark point based on deep learning according to claim 9, characterized in that: In S5, the segmentation result is transferred to the PCB board image to cover the reflective area, which specifically includes: During segmentation, the image is passed into k models to obtain k prediction images. Therefore, there are k prediction results for each pixel. The prediction value is determined by the principle of minority obeys majority to determine whether the pixel is a reflective pixel. The coordinate position of the reflective pixel identified in the segmentation result is transferred to the PCB board image, and the grayscale value of the pixel at the coordinate position on the PCB board image is set to 0, covering the reflective spot within the Mark point on the PCB board image.

Citation Information

Patent Citations

  • Image Semantic Segmentation Method Based on Deep Full Convolutional Network and Conditional Random Field

    AU2020103901A4

  • Direct down type backlight module

    CN103162192A

  • PCB hole position detection device and method

    CN107345789A

  • An image semantic segmentation method based on deep learning

    CN109711413A

  • PCB laser target identification method and system based on deep learning

    CN112347950A