Copper foil surface defect detection method, system and equipment based on machine learning
By combining high-precision shooting equipment and multi-resolution image feature extraction with machine learning technology, the problems of low efficiency and poor accuracy in copper foil surface defect detection were solved, achieving efficient and reliable defect detection and quality control.
Patent Information
- Application Number
- CN202510170317.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-02-17
AI Technical Summary
Existing copper foil surface defect detection methods are inefficient and error-prone, with high model complexity, limited real-time performance, poor interpretability, high hardware requirements, and low versatility and flexibility.
High-precision shooting equipment is used to obtain multiple copper foil surface images. Multi-resolution image feature extraction and similarity region growing methods are combined with machine learning technology for defect detection and classification. Histogram equalization is used to enhance contrast, and defect feature indicators are calculated for comprehensive judgment.
It realizes the automated detection of copper foil surface defects, improves the detection accuracy and reliability, ensures the consistency of product quality, prevents unqualified products from flowing into subsequent production links, and improves the efficiency and reliability of product quality control.
Smart Images

Figure CN120107195B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, system and equipment for detecting copper foil surface defects based on machine learning. Background Art
[0002] Copper foil, a key industrial material, is widely used in electronics, batteries, aerospace, and other fields. Surface defects on copper foil (such as scratches, holes, wrinkles, and oxidation) directly impact its performance and service life. Currently, copper foil surface defect detection relies primarily on manual visual inspection, which is inefficient and prone to errors. In recent years, with the advancement of machine learning and deep learning technologies, automated inspection methods based on image processing have gradually gained attention. However, existing deep learning-based inspection methods suffer from high model complexity, limited real-time performance, poor interpretability, high hardware requirements, and low versatility and flexibility.
[0003] A similar prior art Chinese patent application with publication number CN111489326A provides a copper foil substrate surface defect detection method based on semi-supervised deep learning, including: obtaining a defect sample set of the copper foil substrate, and labeling less than 30% of the defect samples in the defect sample set to obtain a labeled defect sample set (x, y) and an unlabeled defect sample set u; constructing a neural network model Fθ; training the neural network model Fθ to obtain the optimal model parameter θ, and obtaining the optimal neural network model; inputting the collected defect image of the copper foil substrate into the trained neural network, and automatically calculating the defect category of the copper foil substrate through the neural network.
[0004] A similar prior art includes a Chinese patent application with publication number CN119399095A, which provides a real-time copper foil defect detection method, including: establishing a dataset of copper foil surface defects, building a basic YoloV8 model and a corresponding environment, using a dual convolution (DualConv) structure, a deformable large kernel attention (D-LKAAttention) mechanism, and a ShapeIoU loss function to improve the YoloV8 model, training and optimizing the YOLO network model, generating a weight file and saving it locally, and using these weight files to identify and classify copper foil surface defects.
[0005] However, the above two documents face high costs and complex deployment requirements in practical applications, and do not take into account the efficiency of defect detection. Therefore, the present invention provides a copper foil surface defect detection method, system and device based on machine learning. Summary of the Invention
[0006] The present application provides a copper foil surface defect detection method, system and equipment based on machine learning, which are used to improve the detection efficiency and accuracy of copper foil surface defects.
[0007] In a first aspect, the present application provides a method for detecting copper foil surface defects based on machine learning, the method comprising:
[0008] Step S1: Fixing a high-precision photographing device, using the high-precision photographing device to photograph the surface of a copper foil to be inspected, moving the copper foil to be inspected at a preset first speed during the photographing process to obtain a plurality of different copper foil surface images with overlapping areas, performing defect detection on each copper foil surface image to obtain a corresponding first defect area, and also obtaining position information of the first defect area;
[0009] Step S2: obtaining the position information of the first defect area of the first copper foil surface image as first position information, calculating the position information of the first defect area of the next copper foil surface image based on the first position information and the first speed, and calling the calculated position information inferred position information. The inferred position information of the first defect area of all copper foil surface images is calculated;
[0010] Step S3: for the remaining copper foil surface images except the first copper foil surface image, obtain the corresponding position information and the inferred position information, calculate a deviation value between the position information and the inferred position information, and if the deviation value is less than a preset first threshold, determine that the first defect area of the first copper foil surface image and the first defect area of the next copper foil surface image are the same defect, obtain a first number of all copper foil surface images that are the same defect as the first defect area of the first copper foil surface image, and if a ratio of the first number to the total number of all copper foil surface images is greater than or equal to a preset second threshold, determine the corresponding first defect area as a second defect area;
[0011] Step S4: After obtaining the second defect area, obtain the second defect area of each copper foil surface image, segment a small area where the second defect area is located from each copper foil surface image, splice all the small areas into a spliced image, and use machine learning technology based on the spliced image to further detect and classify defects.
[0012] In combination with the first aspect, in a first implementation of the first aspect of the present application, performing defect detection on each copper foil surface image to obtain a corresponding first defect area includes:
[0013] grayscale the copper foil surface image to obtain a corresponding grayscale image, and enhance the contrast of the grayscale image by histogram equalization to obtain a balanced image;
[0014] Generate multiple corresponding low-resolution images based on the balanced image, perform feature extraction on each of the low-resolution images to obtain corresponding feature points, determine the pixel positions of multiple feature points in the balanced image, if the pixel positions of multiple feature points in the balanced image are the same, use the feature points as defect key points, if the pixel positions of the feature points in the balanced image are different, calculate the first change rate of each feature point in the balanced image, and use the feature point corresponding to the largest first change rate as the defect key point;
[0015] The defect key point is used as the initial defect area, the adjacent pixels of the initial defect area are obtained, and the similarity between each adjacent pixel and the defect key point is calculated. If the similarity is greater than a preset third threshold and the corresponding adjacent pixel is adjacent to any pixel in the initial defect area, the corresponding adjacent pixel is added to the initial defect area. This step is then repeated until no new pixels are added to the initial defect area, and the final generated initial defect area is used as the first defect area.
[0016] In combination with the first aspect, in a second implementation of the first aspect of the present application, generating a plurality of corresponding low-resolution images based on the equalized image includes:
[0017] Dividing the equalized image into a plurality of small areas, each of which has the same length and width, and extracting key feature points from each of the small areas;
[0018] Downsample each small area to generate a low-resolution image. During the downsampling process, the positions of the key feature points are mapped from the equalized image to the corresponding low-resolution image, the downsampling ratio is adjusted, and this step is repeated to generate multiple low-resolution images with different resolutions.
[0019] In combination with the first aspect, in a third implementation of the first aspect of the present application, calculating a first change rate of each feature point in the equalized image includes:
[0020] Acquire multiple adjacent pixels in four different directions from the feature point, where the four different directions include a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction, calculate the grayscale change rate of the grayscale value of each of the adjacent pixels and the feature point in each direction, obtain the maximum value of all the grayscale change rates as the grayscale change rate in the corresponding direction, calculate the average value of the grayscale change rates in the four directions, and use the average value as the first change rate of the feature point in the equalized image.
[0021] In combination with the first aspect, in a fourth implementation of the first aspect of the present application, calculating the similarity between each adjacent pixel point and the defect key point includes:
[0022] Calculate the difference in grayscale values between the adjacent pixel points and the defect key point, divide the difference by the grayscale value of the defect key point to obtain a result value as the grayscale similarity, calculate the gradient difference of the gradient intensity of the adjacent pixel points and the defect key point, divide the gradient difference by the gradient intensity of the defect key point to obtain a result value as the gradient similarity, calculate the average of the grayscale similarity and the gradient similarity as the average similarity, and use the average similarity as the similarity between the adjacent pixel points and the defect key point.
[0023] In combination with the first aspect, in a fifth implementation of the first aspect of the present application, stitching all the small areas into a stitched image includes:
[0024] The same area of the second defect area in each of the small-area areas is compared, and based on the same area, all the small-area areas are aligned, and the specific defect areas in the aligned multiple small-area areas are merged into the stitched image to generate the stitched image.
[0025] In combination with the first aspect, in a sixth implementation of the first aspect of the present application, further detecting and classifying defects based on the stitched image using machine learning technology includes:
[0026] Acquire several stitched images, cut out several normal images from the copper foil surface image, annotate the stitched images and the normal images, store the annotated images as learning images, use the learning images as input data to train a first model, calculate the judgment error of the first model during the training of the first model, update the parameters of the first model based on the judgment error, optimize the performance of the first model, save the optimized first model, input the generated stitched images into the first model, and output the corresponding defect type by the first model.
[0027] In combination with the first aspect, in a seventh implementation of the first aspect of the present application, after the first model outputs the corresponding defect type, the following steps are further performed:
[0028] Calculate the defect feature index in the stitched image, and determine whether the defect of the corresponding copper foil surface image is within a preset range in combination with the defect type output by the first model. If so, determine that the copper foil surface image is a qualified product; if not, determine that the copper foil surface image is an unqualified product.
[0029] In a second aspect, the present application provides a copper foil surface defect detection system based on machine learning, the system comprising:
[0030] a first detection unit, configured to fix a high-precision photographing device, use the high-precision photographing device to photograph the surface of the copper foil to be inspected, move the copper foil to be inspected at a preset first speed during the photographing process to obtain a plurality of different copper foil surface images with overlapping areas, perform defect detection on each copper foil surface image to obtain a corresponding first defect area, and also obtain position information of the first defect area; a position inference unit, configured to obtain the position information of the first defect area of a first copper foil surface image as first position information, calculate the position information of the first defect area of a next copper foil surface image based on the first position information and the first speed, the calculated position information being referred to as inferred position information, and calculate the inferred position information of the first defect area for all copper foil surface images;
[0031] a defect determination unit, configured to obtain, for the remaining copper foil surface images except the first copper foil surface image, the corresponding position information and the inferred position information, calculate a deviation value between the position information and the inferred position information, and if the deviation value is less than a preset first threshold, determine that the first defect region of the first copper foil surface image and the first defect region of the next copper foil surface image are the same defect, obtain a first number of all the copper foil surface images that are the same defect as the first defect region of the first copper foil surface image, and if a ratio of the first number to the total number of all the copper foil surface images is greater than or equal to a preset second threshold, determine the corresponding first defect region as a second defect region;
[0032] A defect classification unit is used to obtain the second defect area from each of the copper foil surface images after obtaining the second defect area, segment a small area where the second defect area is located from each of the copper foil surface images, splice all the small areas into a spliced image, and use machine learning technology based on the spliced image to further detect and classify defects.
[0033] The third aspect of the present application provides a copper foil surface defect detection device based on machine learning, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the copper foil surface defect detection device based on machine learning performs the above-mentioned copper foil surface defect detection method based on machine learning.
[0034] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0035] In the technical solution provided in the present application, automatic detection of copper foil surface defects is achieved through machine learning and image processing technology, avoiding the low efficiency and error-prone problems of manual visual inspection; through feature extraction of multi-resolution images and a region growing method based on similarity, defect areas can be more accurately identified and located, improving the accuracy and reliability of defect detection; through feature extraction of multi-resolution images and a region growing method based on similarity, defect areas can be more accurately identified and located, improving the accuracy and reliability of defect detection; by calculating defect feature indicators and making a comprehensive judgment based on the defect type, the quality of the copper foil surface image can be scientifically evaluated to ensure the consistency of product quality; it can also timely detect defects on the copper foil surface to prevent unqualified products from flowing into subsequent production links, thereby improving the efficiency and reliability of product quality control. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 This is a schematic diagram of an embodiment of a method for detecting copper foil surface defects based on machine learning in an embodiment of the present application;
[0038] Figure 2 This is a schematic diagram of an embodiment of a first defect area generated in an embodiment of the present application;
[0039] Figure 3 Schematic diagram of an embodiment of the present application showing four different directions of the characteristic point O;
[0040] Figure 4 This is a schematic diagram of an embodiment of a copper foil surface defect detection system based on machine learning in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The embodiments of the present application provide a method, system and apparatus for detecting copper foil surface defects based on machine learning. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or apparatus.
[0042] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In the embodiments of the present application, an embodiment of a copper foil surface defect detection method based on machine learning includes:
[0043] Step S1: Fix the high-precision camera and use the high-precision camera to shoot the surface of the copper foil to be inspected. During the shooting process, the copper foil to be inspected is moved at a preset first speed to obtain multiple different copper foil surface images with repeated areas. Defect detection is performed on each copper foil surface image to obtain a corresponding first defect area, and the position information of the first defect area is also obtained.
[0044] Specifically, in order to improve the defect detection accuracy of copper foil surface images, the high-precision shooting equipment is first fixed, the copper foil to be inspected is spread flat under the shooting equipment, and the copper foil surface is photographed using the high-precision shooting equipment. In order to obtain multiple copper foil surface images, the copper foil to be inspected is moved at a preset first speed during the shooting process, and multiple different copper foil surface images with repeated areas are captured, which facilitates subsequent surface defect detection of the copper foil. Defect detection is performed on each copper foil surface image to obtain the corresponding first defect area, and the detected first defect area is used as a defect candidate area. The first defect area is subsequently further confirmed, and the position information of the first defect area in the photographed copper foil surface image is also obtained. The position information is used for subsequent position inference and defect confirmation.
[0045] Step S2: Obtain the position information of the first defect area of the first copper foil surface image as the first position information, calculate the position information of the first defect area of the next copper foil surface image based on the first position information and the first speed, and refer to the calculated position information as the inferred position information. Calculate the inferred position information of the first defect area of all copper foil surface images.
[0046] Specifically, position information of a first defect area in a first copper foil surface image is obtained as first position information. The first position information may be the coordinates of a center point of the first defect area in the copper foil surface image, such as (x0, y0). Based on a first speed of movement of the image and the first position information, position information of the first defect area in each subsequent copper foil surface image is calculated. The calculated position information is referred to as inferred position information. Assuming that the copper foil moves only in a horizontal direction, only the horizontal coordinates of the corresponding defect position will change. For example, the inferred position information in the second copper foil surface image is (x0+a, y0). After calculating the inferred position information of all subsequent copper foil surface images, a comparison is made between the inferred position information and the position information of the first defect area in each subsequent copper foil surface image to further confirm whether the detected first defect area is a defect area, thereby improving detection accuracy.
[0047] Step S3: For the remaining copper foil surface images except the first copper foil surface image, obtain corresponding position information and inferred position information, calculate the deviation value between the position information and the inferred position information, and if the deviation value is less than a preset first threshold value, determine that the first defect area of the first copper foil surface image and the first defect area of the next copper foil surface image are the same defect, obtain a first number of all copper foil surface images that are the same defect as the first defect area of the first copper foil surface image, and if the ratio of the first number to the total number of all copper foil surface images is greater than or equal to a preset second threshold value, determine the corresponding first defect area as the second defect area.
[0048] Specifically, assuming that there are 10 copper foil surface images in total, the position information of the first defect area of the first copper foil surface image is (100, 200), and after inference and calculation, the first defect position of each subsequent copper foil surface image is (110, 200), (120, 200), (130, 200), (140, 200), (150, 200), (160, 200), (170, 200), (180, 200), (190, 200). The position information of the first defect position of each subsequent copper foil surface image actually detected is (111, 200), (122, 200), (129, 200), (146, 200), (151, 200). , 200), (166, 200), (171, 200), (182, 200), (197, 200), assuming that the preset first threshold is 5, the first number that meets the condition is 7 copper foil surface images, assuming that the preset threshold is 0.7, the corresponding first defect area is determined to be the second defect area, and the second defect area refers to the first defect area detected to be the real defect area. The above method calculates the inferred position of the first defect area in the subsequent copper foil surface images and verifies whether these positions match the actual detected positions. It uses double judgment to determine whether the first defect area is a real defect, which not only improves the accuracy of defect detection, but also reduces the possibility of false detection.
[0049] Step S4: After obtaining the second defect area, obtain the second defect area of each copper foil surface image, segment the small area where the second defect area is located from each copper foil surface image, splice all the small areas into a spliced image, and use machine learning technology based on the spliced image to further detect and classify defects.
[0050] Specifically, for each second defect area, a small area containing the defect is segmented from the corresponding image. For example, a 100×100 pixel area around the defect area is selected as the small area. The same area of the second defect area in each small area is compared. Based on the same area, all small areas are aligned. Image registration technology, such as a feature point-based registration method, can be used to merge specific defect areas in the aligned multiple small areas into a stitched image to generate a final stitched image. Then, machine learning technology is used based on the stitched image to further detect and classify defects.
[0051] In a specific embodiment, defect detection is performed on each copper foil surface image to obtain a corresponding first defect area, and the following steps are further performed:
[0052] The copper foil surface image is grayscaled to obtain the corresponding grayscale image, and the contrast of the grayscale image is enhanced by histogram equalization to obtain a balanced image.
[0053] Specifically, in order to ensure that potential defect areas can be identified more comprehensively, the original copper foil surface image is grayscaled to obtain a grayscale image. Grayscale processing can reduce the amount of data and simplify the processing process. Then, histogram equalization is used to enhance the contrast of the image to obtain a balanced image. Histogram equalization enhances the contrast of the image and makes the defect area more obvious.
[0054] Based on the balanced image, multiple corresponding low-resolution images are generated, and feature extraction is performed on each low-resolution image to obtain corresponding feature points. The pixel positions of multiple feature points in the balanced image are determined. If the pixel positions of multiple feature points in the balanced image are the same, the feature points are used as defect key points. If the pixel positions of the feature points in the balanced image are different, the first change rate of each feature point in the balanced image is calculated, and the feature point corresponding to the largest first change rate is used as the defect key point.
[0055] Specifically, in order to further improve the accuracy of defect detection, multiple low-resolution images are generated based on the balanced image. By generating images of different resolutions, features at different scales are captured to more comprehensively identify potential defects. Feature extraction is performed on each low-resolution image to obtain corresponding feature points. These feature points may be clues to defects. By comparing the positions of feature points on images of different resolutions in the original image, it is determined whether they point to the same area. If multiple feature points point to the same position, it means that these feature points have a high degree of consistency, which further indicates that the position is more likely to be a real defect and the feature point can be regarded as a key point of the defect. If the positions of the feature points are inconsistent, the importance of each feature point is evaluated by calculating the change rate. The change rate reflects the stability of the feature point in the balanced image. The feature point with a high change rate is more likely to be the key point of the defect. The feature point with the highest change rate is selected as the key point of the defect, which improves the reliability of defect detection and also helps in subsequent defect analysis and confirmation. Through the above steps, feature points can be extracted from images of different resolutions and key defect points can be determined by position consistency and change rate evaluation. This method not only improves the accuracy of defect detection, but also reduces the possibility of misjudgment and improves detection efficiency.
[0056] The defect key point is used as the initial defect area, the adjacent pixels of the initial defect area are obtained, and the similarity between each adjacent pixel and the defect key point is calculated. If the similarity is greater than a preset third threshold, and the corresponding adjacent pixel is adjacent to any pixel in the initial defect area, the corresponding adjacent pixel is added to the initial defect area. This step is then repeated until no new pixels are added to the initial defect area. The final generated initial defect area is used as the first defect area.
[0057] Specifically, the defect key point is the point that is most likely to be a defect after screening in the previous steps, and it is used as the center of the initial defect area, such as Figure 2 As shown in the figure, it is a schematic diagram of the first defect area generated. Assume Figure 2 The position of point C in the middle is the defect key point, and the defect key point is the initial defect area. The adjacent pixel points around point C are obtained with point C as the center, providing a basis for subsequent area expansion. The defect key point is used as the starting point of defect detection. By obtaining the adjacent pixel points around the initial defect area, such as Figure 2 The pixels at the positions indicated by the numbers 1 to 24 are adjacent pixels. More pixels can also be divided into adjacent pixels. No excessive constraints are imposed here. These adjacent pixels are analyzed to see whether they also belong to the defect area, providing candidate pixels for subsequent region growth. By calculating the similarity between these adjacent pixels and the defect key points, if the similarity is greater than the preset third threshold, it means that the adjacent pixels and the defect key points have similar features and may belong to the defect area. In order to ensure the connectivity of the obtained defect area, it is also determined whether the adjacent pixels are connected to the existing defect area, such as Figure 2 As shown, taking point C as an example, the eight points from point 1 to point 8 are interconnected with the defect key point C. Assuming that the similarity between point 22 and point 23 and the defect key point C is greater than the preset third threshold, but the similarity between point 7 and point 8 and the defect key point C is less than the preset third threshold, then point 22 and point 23 are not connected to the defect key point C. Therefore, point 22 and point 23 cannot be added to the initial defect area. Through calculation, it is found that the similarity between point 1, point 2, point 3, point 4, point 5, point 10, point 14, point 15, point 16 and point 17 and the defect key point is greater than the third threshold and is interconnected with the defect area. Therefore, these points are added to the defect area to form the final first defect area. The above steps, starting from the defect key point, gradually expand and determine the complete defect area through similarity calculation and connectivity conditions, ensuring the accuracy and completeness of the defect area while reducing the possibility of misjudgment.
[0058] In a specific embodiment, generating a plurality of corresponding low-resolution images based on the equalized image specifically includes the following steps:
[0059] The balanced image is divided into multiple small areas, each with the same length and width, and key feature points are extracted from each small area;
[0060] Each small area is downsampled to generate a low-resolution image. During the downsampling process, the positions of the key feature points are mapped from the equalized image to the corresponding low-resolution image, the downsampling ratio is adjusted, and this step is repeated to generate multiple low-resolution images with different resolutions.
[0061] Specifically, assuming that the size of the equalized image is 512×512 pixels, select a suitable segmentation size, such as 64×64 pixels, and divide the image into 8×8 small areas. The size of each small area is 64×64 pixels. In each small area, a certain feature point detection algorithm is used to extract key feature points. The feature point detection algorithms include SIFT, SURF or ORB, which are all existing technologies. You can arbitrarily select one of the algorithms and apply the selected algorithm to each small area to extract key feature points. For example, use the SIFT algorithm to extract the key feature points in each small area, select a suitable downsampling method, such as bilinear interpolation, bicubic interpolation, etc., and apply the selected downsampling to each small area. Sampling method, generate low-resolution images, for example, downsample each 64×64 small area to a 32×32 small area. During the downsampling process, map the position of the key feature points from the high-resolution image to the low-resolution image. This can be achieved by simple coordinate scaling. For example, if the downsampling ratio is 1 / 2, the coordinates (x, y) of the key point in the low-resolution image are (x / 2, y / 2), so that the descriptors of the key feature points are retained in the downsampled low-resolution image. Select different downsampling ratios, such as 1 / 2, 1 / 4, 1 / 8, etc. Repeat the above downsampling steps for each downsampling ratio to generate multiple low-resolution images of different resolutions. Through the above steps, we can generate multiple low-resolution images of different resolutions while retaining the important features of the image.
[0062] In a specific embodiment, calculating the first change rate of each feature point in the equalized image includes the following steps:
[0063] Acquire multiple adjacent pixels of the feature point in four different directions, where the four different directions include horizontal, vertical, left diagonal and right diagonal directions, calculate the grayscale change rate of the grayscale value of each adjacent pixel and feature point in each direction, obtain the maximum value of all grayscale change rates as the grayscale change rate in the corresponding direction, calculate the average value of the grayscale change rates in the four directions, and use the average value as the first change rate of the feature point in the balanced image.
[0064] Specifically, for example, to calculate the first change rate of a feature point, multiple adjacent pixels in four different directions of the feature point are obtained. The four different directions include horizontal, vertical, left diagonal and right diagonal directions. By obtaining the adjacent pixels of the feature point in the horizontal, vertical, left diagonal and right diagonal directions, the local information around the feature point can be fully analyzed, such as Figure 3The figure shows a schematic diagram of feature point O in four different directions. Point O is a feature point. The grayscale change rate of point O in the four different directions is calculated. Taking the horizontal direction as an example, assuming that the grayscale value of point O is 15, the grayscale value of the pixel to its left is 10, and the grayscale value of the pixel to its right is 20. The grayscale change rate of point O in the horizontal direction is (15-10) / 10=0.5, and the grayscale change rate of the grayscale value on its right is (20-15) / 15=0.33. The grayscale change rate in the horizontal direction is the maximum value, 0.5. The grayscale change rate in other directions is calculated in the same way as the horizontal direction. After calculating the grayscale change rate in the four directions, the average of these grayscale change rates is calculated and used as the first change rate of the feature point in the balanced image. Through the above steps, the grayscale change of the feature point in different directions can be comprehensively analyzed. The significance and stability of the feature point can be evaluated by calculating the average change rate. This method can improve the accuracy of feature point screening and provide more reliable feature information for subsequent defect detection.
[0065] In a specific embodiment, calculating the similarity between each adjacent pixel point and the defect key point specifically includes the following steps:
[0066] Calculate the difference in grayscale values between adjacent pixels and defect key points, and divide the difference by the grayscale value of the defect key point to obtain the result value as the grayscale similarity. Calculate the gradient difference of the gradient intensity of adjacent pixels and defect key points, and divide the gradient difference by the gradient intensity of the defect key point to obtain the result value as the gradient similarity. Calculate the average of the grayscale similarity and the gradient similarity as the average similarity, and use the average similarity as the similarity between adjacent pixels and defect key points.
[0067] Specifically, in order to evaluate the similarity between each adjacent pixel point and the defect key point, the difference in their grayscale values is first calculated. The difference can be used to quantify the difference in brightness between the adjacent pixel points and the defect key point. The smaller the difference, the more similar the adjacent pixel points and the defect key point are in grayscale value. The result obtained by dividing the difference by the grayscale value of the defect key point is used as the grayscale similarity. The closer the grayscale similarity is to 0, the more similar the adjacent pixel points and the defect key point are in grayscale value. The difference in gradient between the gradient intensities of the adjacent pixel points and the defect key point is calculated to quantify the difference in gradient between the adjacent pixel points and the defect key point. The smaller the difference, the more similar the adjacent pixel points and the defect key point are in gradient features. The gradient difference is divided by the gradient strength of the defect key point to obtain the result value as the gradient similarity. By calculating the average of the grayscale similarity and the gradient similarity as the average similarity, a more comprehensive similarity measurement can be obtained by comprehensively considering the grayscale similarity and the gradient similarity. The average similarity is used as the similarity between adjacent pixels and the defect key point. This similarity value can be used later to decide whether to add adjacent pixels to the defect area where the defect key point is located. Through the above steps, the similarity between adjacent pixels and the defect key point can be comprehensively evaluated, providing a more accurate similarity measurement for region growing and defect detection, thereby improving the accuracy and reliability of defect detection.
[0068] In a specific embodiment, stitching all the small areas into a stitched image specifically includes the following steps:
[0069] The same area of the second defect area in each small area is compared, and based on the same area, all the small areas are aligned, and the specific defect areas in the aligned multiple small areas are merged into the stitched image to generate a stitched image.
[0070] Specifically, the defect areas in each small area are compared to identify overlapping or identical areas. For example, the defect area in small area 1 overlaps with the defect area in small area 2 at certain positions. Based on the overlapping or identical areas, the positions of the small areas are adjusted so that they are spatially aligned. For example, if small area 1 and small area 2 overlap at a certain position, their positions are adjusted so that the overlapping parts are aligned, and the defect areas in the aligned small areas are merged into one image. For example, the defect areas in small area 1 and small area 2 are merged into one image to generate a final stitched image containing the defect areas in all small areas. This image can be used for subsequent defect analysis and detection. Through the above steps, the defect areas in multiple small areas can be compared, aligned and merged to generate a stitched image containing all defect areas. This method can improve the accuracy and reliability of defect detection and provide a more comprehensive view for subsequent analysis and verification.
[0071] In a specific embodiment, machine learning technology is used to further detect and classify defects based on the stitched image, specifically including the following steps:
[0072] A number of stitched images are obtained, and a number of normal images are cut out from the copper foil surface image. The stitched images and the normal images are annotated, and the annotated images are stored as learning images. The learning images are used as input data to train a first model. During the training of the first model, the judgment error of the first model is calculated, the parameters of the first model are updated based on the judgment error, the performance of the first model is optimized, the optimized first model is saved, and the generated stitched images are input into the first model, and the first model outputs the corresponding defect type.
[0073] Specifically, several stitched images are generated from the copper foil surface image, which contain defect areas; several normal images are cut out from the copper foil surface image, which do not contain defects; the stitched images and normal images are labeled, for example, the stitched images are labeled as "defect type A" and the normal images are labeled as "normal"; the labeled images and corresponding labels are stored as learning images, for example, as image files and label files; the learning images are used as input data to train the first model; during the training process, the error between the prediction result of the model and the true label is calculated, for example, using the cross entropy loss function; by calculating the error, the performance of the model under the current parameters can be understood; the error value can guide the optimization direction of the model and help adjust the model parameters; through error back propagation, the weights and biases of the model are updated to reduce the error; the optimized model will have better performance on the training data and can more accurately identify and classify defects; the trained first model is used to perform defect detection and classification on the new stitched image to be detected; through the above steps, a deep learning model can be trained to automatically identify and classify defects in copper foil surface images.
[0074] In a specific embodiment, after the first model outputs the corresponding defect type, the following steps are further performed:
[0075] Calculate the defect feature index in the spliced image, and combine the defect type output by the first model to determine whether the defects of the corresponding copper foil surface image are within a preset range. If so, judge the copper foil surface image as a qualified product; if not, judge the copper foil surface image as an unqualified product.
[0076] Specifically, by calculating defect characteristic indicators (such as defect area, defect length, defect shape, etc.), the characteristics of the defect can be converted into specific numerical values, providing necessary data for subsequent judgment steps, making the judgment process more scientific and objective. Different types of defects may have different impacts. Combining the defect type and defect characteristic indicators can more accurately determine whether the copper foil surface image is qualified. By comparing the calculated defect characteristic indicators with the preset standard range, it can be determined whether the defect is within an acceptable range. If the defect is within the acceptable range, it means that the copper foil surface image meets the quality standards and can be used as a qualified product, avoiding the waste of qualified products due to overly strict standards and improving production efficiency. If the defect exceeds the acceptable range, it means that the copper foil surface image does not meet the quality standards and needs to be processed or scrapped to ensure that unqualified products do not flow into subsequent production links and ensure product quality. Through the above steps, the quality of the copper foil surface image can be scientifically evaluated to determine whether it is qualified. This method not only improves the efficiency of quality control, but also ensures the consistency of product quality.
[0077] The above describes the copper foil surface defect detection method based on machine learning in the embodiment of the present application. The following describes the copper foil surface defect detection system based on machine learning in the embodiment of the present application. Figure 4 In the embodiment of the present application, an embodiment of a copper foil surface defect detection system based on machine learning includes:
[0078] The first detection unit is used to fix the high-precision shooting equipment, use the high-precision shooting equipment to shoot the surface of the copper foil to be inspected, move the copper foil to be inspected at a preset first speed during the shooting process to obtain multiple different copper foil surface images with repeated areas, perform defect detection on each copper foil surface image to obtain a corresponding first defect area, and also obtain position information of the first defect area.
[0079] A position inference unit is used to obtain position information of a first defect area of a first copper foil surface image as first position information, calculate position information of the first defect area of a next copper foil surface image based on the first position information and a first speed, and refer to the calculated position information as inferred position information. The inferred position information of the first defect area of all copper foil surface images is calculated.
[0080] The defect determination unit is configured to obtain corresponding position information and inferred position information for the remaining copper foil surface images except the first copper foil surface image, calculate a deviation value between the position information and the inferred position information, and if the deviation value is less than a preset first threshold value, determine that a first defect area of the first copper foil surface image and a first defect area of the next copper foil surface image are the same defect, obtain a first number of all copper foil surface images that are the same defect as the first defect area of the first copper foil surface image, and if a ratio of the first number to the total number of all copper foil surface images is greater than or equal to a preset second threshold value, determine the corresponding first defect area as a second defect area.
[0081] The defect classification unit is used to obtain the second defect area of each copper foil surface image after obtaining the second defect area, segment the small area where the second defect area is located from each copper foil surface image, splice all the small areas into a spliced image, and use machine learning technology based on the spliced image to further detect and classify defects.
[0082] The present application also provides a copper foil surface defect detection device based on machine learning. The copper foil surface defect detection device based on machine learning includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the copper foil surface defect detection method based on machine learning in the above-mentioned embodiments.
[0083] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0084] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program code.
[0085] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A copper foil surface defect detection method based on machine learning, characterized in that: The method comprises: Step S1, using a fixed high-precision shooting device to shoot the surface of the copper foil to be inspected, moving the copper foil to be inspected at a preset first speed during the shooting process to obtain multiple different copper foil surface images with repeated areas, performing defect detection on each copper foil surface image to obtain a corresponding first defect area, including: grayscale processing and histogram equalization on the copper foil surface image to obtain a balanced image; generating multiple corresponding low-resolution images based on the balanced image, performing feature extraction on each of the low-resolution images to obtain corresponding feature points, judging whether the pixel positions of multiple feature points in the balanced image are the same, if they are the same, taking the feature points as defect key points, if they are different, calculating the first change rate of each feature point in the balanced image, and taking the feature point corresponding to the maximum first change rate as the defect key point; starting from the defect key point, gradually expanding and determining the complete defect area through similarity calculation and connectivity conditions, taking the complete defect area as the first defect area, and obtaining position information of the first defect area; Step S2: obtaining the position information of the first defect area of the first copper foil surface image as first position information, calculating the position information of the first defect area of the next copper foil surface image based on the first position information and the first speed, and calling the calculated position information inferred position information. The inferred position information of the first defect area of all copper foil surface images is calculated; Step S3: for the remaining copper foil surface images except the first copper foil surface image, obtain the corresponding position information and the inferred position information, calculate a deviation value between the position information and the inferred position information, and if the deviation value is less than a preset first threshold, determine that the first defect area of the first copper foil surface image and the first defect area of the next copper foil surface image are the same defect, obtain a first number of all copper foil surface images that are the same defect as the first defect area of the first copper foil surface image, and if a ratio of the first number to the total number of all copper foil surface images is greater than or equal to a preset second threshold, determine the corresponding first defect area as a second defect area; Step S4: Obtain the second defect area of each copper foil surface image, segment a small area where the second defect area is located from each copper foil surface image, splice all the small areas into a spliced image, and further detect and classify defects based on the spliced image using machine learning technology.
2. The method according to claim 1, characterized in that Generating a plurality of corresponding low-resolution images based on the equalized image, including: Dividing the equalized image into a plurality of small areas, each of which has the same length and width, and extracting key feature points from each of the small areas; Downsample each small area to generate a low-resolution image. During the downsampling process, the positions of the key feature points are mapped from the equalized image to the corresponding low-resolution image, the downsampling ratio is adjusted, and this step is repeated to generate multiple low-resolution images with different resolutions.
3. The method according to claim 1, characterized in that Calculating a first change rate of each feature point in the equalized image includes: Acquire multiple adjacent pixels in four different directions from the feature point, where the four different directions include a horizontal direction, a vertical direction, a left diagonal direction, and a right diagonal direction, calculate the grayscale change rate of the grayscale value of each of the adjacent pixels and the feature point in each direction, obtain the maximum value of all the grayscale change rates as the grayscale change rate in the corresponding direction, calculate the average value of the grayscale change rates in the four directions, and use the average value as the first change rate of the feature point in the equalized image.
4. The method according to claim 1, wherein Calculating the similarity between each adjacent pixel and the defect key point includes: Calculate the difference in grayscale values between the adjacent pixel points and the defect key point, divide the difference by the grayscale value of the defect key point to obtain a result value as the grayscale similarity, calculate the gradient difference of the gradient intensity of the adjacent pixel points and the defect key point, divide the gradient difference by the gradient intensity of the defect key point to obtain a result value as the gradient similarity, calculate the average of the grayscale similarity and the gradient similarity as the average similarity, and use the average similarity as the similarity between the adjacent pixel points and the defect key point.
5. The method according to claim 1, characterized in that All of the small areas are stitched together into a stitched image, including: The same area of the second defect area in each of the small-area areas is compared, and based on the same area, all the small-area areas are aligned, and the specific defect areas in the aligned multiple small-area areas are merged into the stitched image to generate the stitched image.
6. The method according to claim 1, characterized in that Machine learning techniques are used based on the stitched image to further detect and classify defects, including: Acquire several stitched images, cut out several normal images from the copper foil surface image, annotate the stitched images and the normal images, store the annotated images as learning images, use the learning images as input data to train a first model, calculate the judgment error of the first model during the training of the first model, update the parameters of the first model based on the judgment error, optimize the performance of the first model, save the optimized first model, input the generated stitched images into the first model, and output the corresponding defect type by the first model.
7. The method according to claim 6, characterized in that After the first model outputs the corresponding defect type, the following is also executed: Calculate the defect feature index in the stitched image, and determine whether the defect of the corresponding copper foil surface image is within a preset range in combination with the defect type output by the first model. If so, determine that the copper foil surface image is a qualified product; if not, determine that the copper foil surface image is an unqualified product.
8. The method according to claim 1, characterized in that Starting from the key points of the defect, the complete defect area is gradually expanded and determined through similarity calculation and connectivity conditions, including: The defect key point is used as the initial defect area, the adjacent pixels of the initial defect area are obtained, and the similarity between each adjacent pixel and the defect key point is calculated. If the similarity is greater than a preset third threshold and the corresponding adjacent pixel is adjacent to any pixel in the initial defect area, the corresponding adjacent pixel is added to the initial defect area, and this step is repeated until no new pixel is added to the initial defect area.
9. A copper foil surface defect detection system based on machine learning, used to implement the copper foil surface defect detection method based on machine learning as described in any one of claims 1 to 8, characterized in that: The system comprises: The first detection unit is configured to use a fixed high-precision shooting device to shoot the surface of the copper foil to be tested, move the copper foil to be tested at a preset first speed during the shooting process to obtain multiple different copper foil surface images with repeated areas, and perform defect detection on each copper foil surface image to obtain a corresponding first defect area, including: grayscale processing and histogram equalization of the copper foil surface image to obtain a balanced image; generating multiple corresponding low-resolution images based on the balanced image, performing feature extraction on each of the low-resolution images to obtain corresponding feature points, determining whether the pixel positions of multiple feature points in the balanced image are the same, if they are the same, taking the feature points as defect key points, if they are different, calculating a first change rate of each feature point in the balanced image, and taking the feature point corresponding to the maximum first change rate as the defect key point; starting from the defect key point, gradually expanding and determining the complete defect area through similarity calculation and connectivity conditions, taking the complete defect area as the first defect area, and obtaining position information of the first defect area; a position inference unit, configured to obtain the position information of the first defect area of the first copper foil surface image as first position information, calculate the position information of the first defect area of the next copper foil surface image based on the first position information and the first speed, and refer to the calculated position information as inferred position information; and calculate the inferred position information of the first defect area for all copper foil surface images; a defect determination unit, configured to obtain, for the remaining copper foil surface images except the first copper foil surface image, the corresponding position information and the inferred position information, calculate a deviation value between the position information and the inferred position information, and if the deviation value is less than a preset first threshold, determine that the first defect region of the first copper foil surface image and the first defect region of the next copper foil surface image are the same defect, obtain a first number of all the copper foil surface images that are the same defect as the first defect region of the first copper foil surface image, and if a ratio of the first number to the total number of all the copper foil surface images is greater than or equal to a preset second threshold, determine the corresponding first defect region as a second defect region; a defect classification unit, configured to obtain the second defect area of each copper foil surface image, segment a small area where the second defect area is located from each copper foil surface image, splice all the small areas into a spliced image, and further detect and classify defects based on the spliced image using machine learning technology.
10. A copper foil surface defect detection device based on machine learning, characterized in that: The copper foil surface defect detection equipment based on machine learning includes: a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory to enable the copper foil surface defect detection device based on machine learning to execute the copper foil surface defect detection method based on machine learning as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Copper foil substrate surface defect detection method based on semi-supervised deep learning
CN111489326A
Real-time defect detection method for copper foil
CN119399095A
Apparatus and method for detecting surface defect of workpiece, surface inspection system for workpiece, and program
JP2021056182A