A surface defect on-line visual detection method for copper foil production
By constructing a feature set of copper foil surface defects and performing K-means multidimensional clustering, the optimal features are selected for automated classification of copper foil surface defect types, solving the problem of insufficient detection and identification accuracy in copper foil production and achieving efficient automated detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHAANXI WESTERN NEW MATERIAL TECH CO LTD
- Filing Date
- 2026-03-05
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies cannot effectively improve the accuracy of detecting and identifying surface defects in copper foil production. Manual inspection is affected by personal standards and subjectivity, while deep learning models abstract image features and consume a lot of computational resources.
A feature set of defects on the surface of copper foil is constructed, including the area, gray value, edge shape and minimum bounding rectangle of the defect region. Through K-means multidimensional clustering and feature suitability evaluation, the optimal features are selected for clustering, realizing automated classification and recognition by unsupervised machine learning.
It improves the accuracy of detecting and identifying surface defects on copper foil, reduces manual intervention and computational resource consumption, and enhances the automation and accuracy of detection.
Smart Images

Figure CN121767370B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image data processing technology, and in particular to an online visual inspection method for surface defects in copper foil production. Background Technology
[0002] The introduction of surface defect visual inspection technology into copper foil production enables continuous, online, and full-width inspection of surface defects, reducing the missed detection rate and labor costs, improving product consistency and yield, and thus enhancing the stability of the copper foil production process and product quality. Therefore, visual inspection of copper foil surface defects is of great significance to copper foil production.
[0003] Existing technologies can capture and mark defective areas on the surface of copper foil production using machine vision. However, further manual judgment of the defect type of the marked defect area is usually required. During manual inspection, the inspection results are affected by factors such as personal standards, emotions, environment, and subjectivity, which cannot guarantee the accuracy of the identification results of copper foil surface defect types.
[0004] Therefore, improving the accuracy of detecting and identifying the types of defects on the surface of copper foil has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, embodiments of the present invention provide an online visual inspection method for surface defects in copper foil production, in order to solve the problem of how to improve the accuracy of detecting and identifying the types of surface defects in copper foil.
[0006] This invention provides an online visual inspection method for surface defects in copper foil production, the method comprising the following steps:
[0007] According to the known copper foil surface defect types, a preset number of defect images for each copper foil surface defect type are obtained. Based on the area, gray value, edge shape and the size of the minimum bounding rectangle of the defect region in each defect image, a defect feature set for distinguishing different copper foil surface defect types is constructed. The defect feature set contains at least 4 defect features. The feature value of each defect image with respect to each defect feature is obtained.
[0008] For any defect feature, based on the feature value of each defect image with respect to the defect feature, all defect images are clustered to obtain at least two clusters. Based on the inter-cluster separation between each pair of clusters, the intra-cluster compactness of each cluster, and the proportion of defect images of the dominant copper foil surface defect type in each cluster, the feature suitability of the defect feature is obtained.
[0009] Based on the feature suitability of each defect feature, three optimal defect features are selected from the defect feature set to distinguish different copper foil surface defect types. A clustering space is constructed using the feature values of the three optimal defect features for defect images of known copper foil surface defect types and defect images of unknown copper foil surface defect types. The data in the clustering space are clustered to obtain the clustering results. Based on the clustering results, the defect type of the defect image of the unknown copper foil surface defect type is detected.
[0010] Preferably, the defect feature set used to distinguish different types of copper foil surface defects includes the length of the long side of the minimum bounding rectangle of the defect region in the defect image, the length of the short side of the minimum bounding rectangle of the defect region in the defect image, the area of the defect region in the defect image, the degree of edge variation of the defect region in the defect image, the proportion of the number of pixels in the minimum bounding rectangle of the defect region that do not belong to the defect region to the total number of pixels in the minimum bounding rectangle, the average gray value of all pixels in the defect region in the defect image, and the variance of the gray values of all pixels in the defect region in the defect image.
[0011] Preferably, obtaining the degree of edge variation of the defect region in the defect image includes:
[0012] For any defective image, obtain the edge pixels of the defective region in the defective image. Construct a coordinate system with the lower left corner of the smallest bounding rectangle of the defective region in the defective image as the origin. Obtain the coordinates of each edge pixel according to the coordinate system. With any edge pixel as the center and the right neighbor pixel of any edge pixel as the starting point, traverse the edge pixels adjacent to any edge pixel in a clockwise direction. Record the first traversed edge pixel adjacent to any edge pixel as the first neighbor pixel and the second traversed edge pixel adjacent to any edge pixel as the second neighbor pixel.
[0013] Obtain the line connecting any edge pixel and the first adjacent pixel, calculate the cosine of the angle between the line and the positive direction of the horizontal coordinate of the coordinate system, obtain the first slope between any edge pixel and the first adjacent pixel, obtain the second slope between any edge pixel and the second adjacent pixel, and if the first slope and the second slope are not equal, then record any edge pixel as the target edge pixel.
[0014] Obtain the first slope and the second slope corresponding to each edge pixel of the defect region in any defect image. Based on the first slope and the second slope corresponding to each edge pixel of the defect region in any defect image, obtain all target edge pixels. Calculate the proportion of the number of all target edge pixels in the total number of edge pixels to obtain the degree of edge change of the defect region in any defect image.
[0015] Preferably, the step of obtaining the feature suitability of any defect feature based on the inter-cluster separation between every two clusters, the intra-cluster compactness of each cluster, and the proportion of the defect image of the dominant copper foil surface defect type within each cluster includes:
[0016] The spatial distribution suitability of any defect feature is obtained based on the inter-cluster separation between any two clusters and the intra-cluster compactness of each cluster.
[0017] The suitability of the defect type distribution for any given defect feature is obtained based on the proportion of defect images of the dominant copper foil surface defect type within each cluster.
[0018] The sum of the spatial distribution suitability and the defect type distribution suitability is calculated to obtain the feature suitability of any defect feature.
[0019] Preferably, obtaining the spatial distribution suitability of any defect feature based on the inter-cluster separation between any two clusters and the intra-cluster compactness of each cluster includes:
[0020] Obtain the cluster center of each cluster. For any cluster, denot all clusters other than the cluster mentioned above as other clusters. Obtain the Euclidean distance between the cluster center of the cluster mentioned above and the cluster centers of each of the other clusters. Select the minimum value among all Euclidean distances as the minimum Euclidean distance between the cluster mentioned above and other clusters. Obtain the minimum Euclidean distance between each cluster and other clusters. Normalize the sum of the minimum Euclidean distances corresponding to all clusters to obtain the degree of inter-cluster separation.
[0021] Calculate the Euclidean distance between the data point corresponding to any defect image within any cluster and the data point corresponding to each other defect image. Select the minimum value among the Euclidean distances between the data point corresponding to any defect image and the data point corresponding to each other defect image, and record it as the minimum distance between any defect image and other defect images. Obtain the minimum distance corresponding to each defect image within any cluster. Calculate the mean of the minimum distances corresponding to all defect images within any cluster to obtain the intra-cluster average distance of any cluster. Obtain the intra-cluster average distance of each cluster. Normalize the sum of the intra-cluster average distances of all clusters to obtain the sum-normalized value. Subtract the sum-normalized value from the constant 1 to obtain the intra-cluster compactness.
[0022] The sum of the inter-cluster separation degree and the intra-cluster compactness degree is calculated to obtain the spatial distribution suitability of any defect feature.
[0023] Preferably, obtaining the suitability of the defect type distribution for any defect feature based on the proportion of defect images of the dominant copper foil surface defect type within each cluster includes:
[0024] For any cluster, count the number of defect images of each copper foil surface defect type within the cluster, and record the copper foil surface defect type corresponding to the largest number as the dominant defect type of the cluster. Calculate the proportion of the number of defect images of the dominant defect type in the cluster to the total number of defect images within the cluster to obtain the homogeneity of the cluster. Obtain the homogeneity of each cluster, and normalize the accumulated values of all homogeneity to obtain the type separation degree of any defect feature.
[0025] Clusters other than any of the aforementioned clusters are denoted as other clusters. In each of the other clusters, the number of defect images of the dominant defect type of any cluster is obtained. All the numbers are accumulated to obtain the spillover degree of the dominant defect type of any cluster. The spillover degree of the dominant defect type of each cluster is obtained. The accumulated value of all spillover degrees is normalized to obtain the inter-cluster confusion degree. The constant 1 is subtracted from the inter-cluster confusion degree to obtain the feature discrimination of any defect feature.
[0026] The sum of the type separation degree and the feature distinguishability is calculated to obtain the defect type distribution suitability of any defect feature.
[0027] Preferably, the step of selecting three optimal defect features from the defect feature set to distinguish different types of copper foil surface defects based on the feature suitability of each defect feature includes:
[0028] Based on the feature suitability of each defect feature, all defect features are sorted in descending order to obtain a sequence. The first three defect features in the sequence are recorded as the optimal defect features.
[0029] Preferably, the clustering result contains at least two clusters, and the number of clusters is equal to the number of known copper foil surface defect types.
[0030] Preferably, the step of detecting the defect type of the defect image based on the clustering results for unknown copper foil surface defect types includes:
[0031] For any defect image of an unknown copper foil surface defect type, obtain the cluster in which the defect image of the unknown copper foil surface defect type belongs, and denote it as the target cluster. Based on the copper foil surface defect type of each known copper foil surface defect type defect image in the target cluster, obtain the dominant defect type of the target cluster, and mark the defect type of the defect image of the unknown copper foil surface defect type as the dominant defect type of the target cluster.
[0032] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows:
[0033] This invention extracts defect features suitable for identifying defect types from defect images of known copper foil surface defect types. It then obtains feature values for each defect feature in the defect image of each known copper foil surface defect type, and performs K-means multidimensional clustering on the defect images of known copper foil surface defect types. This achieves automated classification and identification of copper foil surface defects through unsupervised machine learning, improving the accuracy of detecting and identifying copper foil surface defect types. Considering that the maximum dimension of K-means multidimensional clustering is best set to three dimensions, one-dimensional clustering is performed on all defect images using each defect feature to obtain the clustering result under each defect feature. The clustering effect under each defect feature is evaluated by assessing the inter-cluster separation, intra-cluster compactness, and purity of each cluster (i.e., the proportion of defect images of the dominant copper foil surface defect type within each cluster). Three optimal defect features for identifying defect types are then selected to prevent the curse of dimensionality and improve the accuracy of clustering results. A clustering space is constructed using defect images of known copper foil surface defect types and defect images of unknown copper foil surface defect types with respect to the feature values of the three optimal defect features. Based on the clustering results in the clustering space, the defect types of defect images of unknown copper foil surface defect types are detected, thus improving the accuracy of detecting and identifying copper foil surface defect types. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 This is a flowchart of an online visual inspection method for surface defects in copper foil production, provided in Embodiment 1 of the present invention. Detailed Implementation
[0036] Embodiments of this disclosure are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting it.
[0037] It should be noted that the terms "first," "second," etc., used in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure.
[0038] To illustrate the technical solution of the present invention, specific embodiments are described below.
[0039] See Figure 1 This is a flowchart of an online visual inspection method for surface defects in copper foil production, provided in Embodiment 1 of the present invention. Figure 1 As shown, the method may include:
[0040] Step S101: According to the known copper foil surface defect types, a preset number of defect images for each copper foil surface defect type are obtained. Based on the area, gray value, edge shape, and size of the minimum bounding rectangle of the defect region in each defect image, a defect feature set for distinguishing different copper foil surface defect types is constructed. The defect feature set contains at least 4 defect features. The feature value of each defect image with respect to each defect feature is obtained.
[0041] Traditionally, machine vision is used to capture and mark defective areas on the surface of copper foil production. Then, deep learning models (such as convolutional neural networks) are used to extract image features of these defective areas, and the defect type is determined based on these features, or manually. However, manual inspection is affected by personal standards, environment, and subjectivity, which cannot guarantee the accuracy of copper foil surface defect type identification. Furthermore, image features extracted by deep learning models are highly abstract and digital visual information representations with poor interpretability, difficulty in understanding and debugging, sensitivity to data distribution, limited generalization ability, slow inference speed, and high computational resource consumption. Therefore, in this embodiment of the invention, a custom defect feature set is defined based on the characteristics of different copper foil surface defect types. A suitable clustering sample space for constructing a high-dimensional clustering model is analyzed, and high-dimensional K-means clustering is performed on historical defect sets to achieve automated classification and identification of copper foil surface defects through unsupervised machine learning, improving the accuracy of copper foil surface defect type detection and identification.
[0042] Defects on the surface of copper foil include, but are not limited to, dents, black spots, copper particles, foreign objects, oxide spots, and scratches. Pockmarks are typically clustered together but have relatively irregular edges. Black spots are usually small in area, have high grayscale, and relatively regular edges. Copper particles are usually small in area but have relatively irregular edges. Foreign objects are usually uniform in grayscale but have relatively irregular edges. Oxide spots are usually relatively irregular in edges and have discrete grayscale distribution. Scratches are usually elongated and narrow in area, with relatively regular edges and small area. Based on the above description, firstly, according to the known types of copper foil surface defects, at least 200 defect images of each defect type are obtained from a historical defect image set that has been manually inspected and labeled. There is no limit to this; the implementer can set the number of defect images for each type of copper foil surface defect according to the complexity of different defect types. It is worth noting that a defect image contains only one defect region. In machine vision-based defect detection, the segmentation and labeling results of the defect region are usually presented in the form of connected components. Machine vision-based defect detection is existing technology and will not be elaborated further here. Then, based on the characteristics of different defect types described above, a defect feature set is constructed to distinguish different copper foil surface defect types. The defect feature set contains at least four defect features, including but not limited to: the length of the long side of the minimum bounding rectangle of the defect region in the defect image (used to characterize the approximate length of the defect region); the length of the short side of the minimum bounding rectangle of the defect region in the defect image (used to characterize the approximate width of the defect region); the area of the defect region in the defect image; the degree of edge variation of the defect region in the defect image (used to characterize whether the shape of the defect region is regular; regular defect regions have a smaller degree of edge variation); the proportion of the number of pixels in the minimum bounding rectangle of the defect region that do not belong to the defect region to the total number of pixels in the minimum bounding rectangle (used to characterize the distribution of holes in the defect region, such as the distribution of holes in oxide spots or corrosion spots; there are more pixels that do not belong to the connected domain in the minimum bounding rectangle); the average gray value of all pixels in the defect region in the defect image (used to characterize the main color of the defect region); and the variance of the gray values of all pixels in the defect region in the defect image (used to characterize the concentration or dispersion of the color distribution in the defect region).
[0043] The specific method for obtaining the degree of edge variation in the defect region of the defect image is as follows:
[0044] For any defective image, the edge pixels (pixels on the edge line with a single pixel width) of the defective region in the defective image are obtained through the binarized image of the defective image. The acquisition of edge pixels is an existing technology and will not be described in detail here. A coordinate system is constructed with the lower left corner of the smallest bounding rectangle of the defective region in the defective image as the origin. The coordinates of each edge pixel are obtained according to the coordinate system. Taking any edge pixel as the center and the right neighbor pixel of any edge pixel as the starting point, the edge pixels adjacent to any edge pixel are traversed clockwise. The first edge pixel adjacent to any edge pixel is recorded as the first neighbor pixel, and the second edge pixel adjacent to any edge pixel is recorded as the second neighbor pixel.
[0045] Obtain the line connecting any edge pixel and the first adjacent pixel, calculate the cosine of the angle between the line and the positive direction of the horizontal coordinate of the coordinate system, obtain the first slope between any edge pixel and the first adjacent pixel, obtain the second slope between any edge pixel and the second adjacent pixel. If the first slope and the second slope are not equal, it indicates that the line connecting any edge pixel and its first and second adjacent pixels has turned, and the edge shape is irregular. Therefore, the any edge pixel is recorded as the target edge pixel.
[0046] Obtain the first slope and the second slope corresponding to each edge pixel of the defect region in any defect image. Based on the first slope and the second slope corresponding to each edge pixel of the defect region in any defect image, obtain all target edge pixels. Calculate the proportion of the number of all target edge pixels in the total number of edge pixels to obtain the degree of edge change of the defect region in any defect image.
[0047] After the defect feature set is constructed, the feature values of each defect image with respect to each defect feature in the defect feature set are obtained. That is, the length of the long side and the length of the short side of the minimum bounding rectangle of the defect region in each defect image are obtained, the area and edge variation of the defect region, the proportion of the number of pixels that do not belong to the defect region within the minimum bounding rectangle of the defect region to the total number of pixels within the minimum bounding rectangle, the average gray value of all pixels within the defect region, and the variance of the gray values of all pixels within the defect region.
[0048] Step S102: For any defect feature, cluster all defect images according to the feature value of each defect image with respect to the defect feature to obtain at least two clusters. Based on the inter-cluster separation between each two clusters, the intra-cluster compactness of each cluster, and the proportion of defect images of the dominant copper foil surface defect type in each cluster, obtain the feature suitability of the defect feature.
[0049] By performing K-means multidimensional clustering on the feature values of each defect feature in the defect feature set for each defect image, defect images with similar features can be grouped into the same cluster, while defect images with different features can be distinguished into different clusters. This enables the identification and detection of defect types on the copper foil surface. However, the maximum dimension of K-means multidimensional clustering is best set to three dimensions. For high-dimensional K-means clustering with more than three dimensions, the higher the dimension, the greater the overhead of calculating the distance matrix for each iteration, and the slower the convergence speed. Not only will the computational load increase exponentially, leading to a huge computational load in the actual system, but it will also cause the curse of dimensionality, such as unclear cluster boundaries. Therefore, it is necessary to evaluate the three most suitable defect features for defect clustering to improve the accuracy of detecting and identifying the types of defects on the copper foil surface.
[0050] In this embodiment of the invention, the feature suitability of each defect feature is obtained by analyzing the distribution characteristics of the single-dimensional clustering results of each defect feature in the defect feature set, in order to evaluate the clustering effect under each defect feature. Taking the q-th defect feature in the defect feature set as an example, K-means clustering is performed on all defect images according to the feature value of each defect image with respect to the q-th defect feature. Here, K is set to the number of known copper foil surface defect types, K≥2, resulting in K clusters, i.e., the number of clusters is the number of known copper foil surface defect types. K-means clustering is a prior art and will not be elaborated here. The method for obtaining the feature suitability of the q-th defect feature based on the distribution characteristics of each cluster is as follows:
[0051] (1) Based on the inter-cluster separation between each pair of clusters and the intra-cluster compactness of each cluster, obtain the spatial distribution suitability of the qth defect feature.
[0052] Specifically: Obtain the cluster center of each cluster. For any given cluster, all clusters other than the given cluster are denoted as other clusters. Obtain the Euclidean distance between the cluster center of the given cluster and the cluster centers of each of the other clusters. Select the minimum value among all Euclidean distances as the minimum Euclidean distance between the given cluster and other clusters. Obtain the minimum Euclidean distance between each cluster and other clusters. Normalize the sum of the minimum Euclidean distances corresponding to all clusters to obtain the degree of inter-cluster separation.
[0053] Calculate the Euclidean distance between the data point corresponding to any defect image within any cluster and the data point corresponding to each other defect image. Select the minimum value among the Euclidean distances between the data point corresponding to any defect image and the data point corresponding to each other defect image, and record it as the minimum distance between any defect image and other defect images. Obtain the minimum distance corresponding to each defect image within any cluster. Calculate the mean of the minimum distances corresponding to all defect images within any cluster to obtain the intra-cluster average distance of any cluster. Obtain the intra-cluster average distance of each cluster. Normalize the sum of the intra-cluster average distances of all clusters to obtain the sum-normalized value. Subtract the sum-normalized value from the constant 1 to obtain the intra-cluster compactness.
[0054] The sum of the inter-cluster separation degree and the intra-cluster compactness degree is calculated to obtain the spatial distribution suitability of the q-th defect feature.
[0055] In one embodiment, the formula for calculating the spatial distribution suitability of the q-th defect feature is:
[0056]
[0057] in, This represents the spatial distribution suitability of the q-th defect feature. This represents the total number of clusters, which is also the number of known types of copper foil surface defects. This represents the minimum Euclidean distance between the i-th cluster and all other clusters. This represents the number of defect images in the i-th cluster, which is also the number of data points in the i-th cluster. This represents the minimum distance between the i-th defect image in the i-th cluster and other defect images. This represents the normalization function.
[0058] It should be noted that, The larger the value, the greater the distance between different clusters, the greater the feature difference between the i-th cluster and other clusters, the higher the reliability of the cluster partitioning result, and the stronger the suitability of the q-th defect feature. The larger; The smaller the value, the closer the interval between data points within the same cluster, the smaller the feature difference of the q-th defect feature among defect images within the same cluster, the higher the cluster density, and the stronger the suitability of the q-th defect feature. The larger.
[0059] (2) Based on the proportion of the defect image of the dominant copper foil surface defect type in each cluster, obtain the suitability of the defect type distribution of the qth defect feature.
[0060] Even with a favorable spatial distribution, actual clusters may still contain defect images with different defect types but similar q-th defect features. Therefore, it is necessary to further evaluate the distribution of defect types in the defect images within the cluster and obtain the suitability of the defect type distribution for the q-th defect feature. Specifically: for any cluster, count the number of defect images of each copper foil surface defect type within the cluster, and record the copper foil surface defect type corresponding to the largest number as the dominant defect type of the cluster. Calculate the proportion of the number of defect images of the dominant defect type in the cluster to the total number of defect images within the cluster to obtain the homogeneity of the cluster. Obtain the homogeneity of each cluster, and normalize the sum of all homogeneity values to obtain the type separation degree of any defect feature.
[0061] Clusters other than any of the aforementioned clusters are denoted as other clusters. In each of the other clusters, the number of defect images of the dominant defect type of any cluster is obtained. All the numbers are accumulated to obtain the spillover degree of the dominant defect type of any cluster. The spillover degree of the dominant defect type of each cluster is obtained. The accumulated value of all spillover degrees is normalized to obtain the inter-cluster confusion degree. The constant 1 is subtracted from the inter-cluster confusion degree to obtain the feature discrimination of any defect feature.
[0062] The sum of the type separation degree and the feature distinguishability is calculated to obtain the defect type distribution suitability of the q-th defect feature.
[0063] In one embodiment, the formula for calculating the suitability of the defect type distribution for the qth defect is:
[0064]
[0065] in, This represents the suitability of the defect type distribution for the q-th defect feature. This represents the number of defect images representing the dominant defect type in the i-th cluster. This represents the number of defect images in the i-th cluster, which is also the number of data points in the i-th cluster. This represents the total number of clusters, which is also the number of known types of copper foil surface defects. This represents the number of defect images representing the dominant defect type of the i-th cluster contained in the t-th other cluster. This represents the normalization function.
[0066] It should be noted that, The larger the value, the better the clustering effect within the cluster matches the original defect type cluster division. This indicates a better convergence of defect images of the same defect type to the same cluster under the q-th defect feature, resulting in higher reliability of the cluster division results. The larger; The smaller the value, the fewer defect images of the dominant defect type in the i-th cluster spill over into other clusters. This results in better convergence of defect images of the same defect type to the same cluster under the q-th defect feature, leading to higher reliability of the cluster partitioning results. The larger.
[0067] (3) Calculate the sum between the spatial distribution suitability and the defect type distribution suitability to obtain the feature suitability of the q-th defect feature, denoted as . ,Right now , This represents the spatial distribution suitability of the q-th defect feature. This represents the suitability of the defect type distribution for the q-th defect feature. The larger, and The larger the value, the more concentrated the distribution of defect images of the same defect type under the q-th defect feature. This indicates a higher probability that defects of the same type are distributed in the same cluster, resulting in better clustering performance under the q-th defect feature. The larger.
[0068] Similarly, obtain the feature suitability of each defect feature in the defect feature set.
[0069] Step S103: Based on the feature suitability of each defect feature, select three optimal defect features from the defect feature set to distinguish different copper foil surface defect types. Construct a clustering space using the feature values of the known copper foil surface defect types and the defect images of unknown copper foil surface defect types with respect to the three optimal defect features. Cluster the data in the clustering space to obtain the clustering results. Detect the defect type of the defect image of the unknown copper foil surface defect type based on the clustering results.
[0070] Step S102 yields the feature suitability of each defect feature in the defect feature set. Further, based on the feature suitability of each defect feature, all defect features are sorted in descending order to obtain a sequence. The first three defect features in the sequence are recorded as the optimal defect features.
[0071] Defect images of unknown copper foil surface defect types are obtained, along with the feature values of each image for each unknown copper foil surface defect type with respect to each optimal defect feature. A three-dimensional clustering space is constructed using defect images of known copper foil surface defect types and the feature values of the images of unknown copper foil surface defect types with respect to the three optimal defect features. K-means clustering is then performed on the data in the three-dimensional clustering space, where K is set to the number of known copper foil surface defect types (K≥2), resulting in K clusters. Next, the cluster to which the defect image of each unknown copper foil surface defect type belongs is obtained. Based on the dominant defect type in the cluster to which the defect image of each unknown copper foil surface defect type belongs, the defect type of the defect image of each unknown copper foil surface defect type is detected. Specifically:
[0072] For any defect image of an unknown copper foil surface defect type, obtain the cluster in which the defect image of the unknown copper foil surface defect type belongs, and denote it as the target cluster. This is consistent with the method of obtaining the dominant defect type of the cluster in step S102. Based on the copper foil surface defect type of each known copper foil surface defect type defect image in the target cluster, obtain the dominant defect type of the target cluster, and mark the defect type of the defect image of the unknown copper foil surface defect type as the dominant defect type of the target cluster.
[0073] Similarly, by labeling the defect type of each unknown copper foil surface defect image, the identification and detection of copper foil surface defect types can be completed, thereby achieving relatively more accurate online visual recognition and detection of surface defects in automated copper foil production.
[0074] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An online visual inspection method for surface defects in copper foil production, characterized in that, The online visual inspection method for surface defects in copper foil production includes: According to the known copper foil surface defect types, a preset number of defect images for each copper foil surface defect type are obtained. Based on the area, gray value, edge shape and the size of the minimum bounding rectangle of the defect region in each defect image, a defect feature set for distinguishing different copper foil surface defect types is constructed. The defect feature set contains at least 4 defect features. The feature value of each defect image with respect to each defect feature is obtained. For any defect feature, based on the feature value of each defect image with respect to the defect feature, all defect images are clustered to obtain at least two clusters. Based on the inter-cluster separation between each pair of clusters, the intra-cluster compactness of each cluster, and the proportion of defect images of the dominant copper foil surface defect type in each cluster, the feature suitability of the defect feature is obtained. Based on the feature suitability of each defect feature, three optimal defect features are selected from the defect feature set to distinguish different copper foil surface defect types. A clustering space is constructed using the feature values of the three optimal defect features for defect images of known copper foil surface defect types and defect images of unknown copper foil surface defect types. The data in the clustering space are clustered to obtain the clustering results. Based on the clustering results, the defect type of the defect image of the unknown copper foil surface defect type is detected.
2. The online visual inspection method for surface defects in copper foil production according to claim 1, characterized in that, The defect feature set used to distinguish different types of copper foil surface defects includes the length of the long side of the minimum bounding rectangle of the defect region in the defect image, the length of the short side of the minimum bounding rectangle of the defect region in the defect image, the area of the defect region in the defect image, the degree of edge variation of the defect region in the defect image, the proportion of the number of pixels that do not belong to the defect region within the minimum bounding rectangle of the defect region in the defect image to the total number of pixels within the minimum bounding rectangle, the average gray value of all pixels within the defect region in the defect image, and the variance of the gray values of all pixels within the defect region in the defect image.
3. The online visual inspection method for surface defects in copper foil production according to claim 2, characterized in that, The acquisition of the degree of edge variation in the defect region of the defect image includes: For any defective image, obtain the edge pixels of the defective region in the defective image. Construct a coordinate system with the lower left corner of the smallest bounding rectangle of the defective region in the defective image as the origin. Obtain the coordinates of each edge pixel according to the coordinate system. With any edge pixel as the center and the right neighbor pixel of any edge pixel as the starting point, traverse the edge pixels adjacent to any edge pixel in a clockwise direction. Record the first traversed edge pixel adjacent to any edge pixel as the first neighbor pixel and the second traversed edge pixel adjacent to any edge pixel as the second neighbor pixel. Obtain the line connecting any edge pixel and the first adjacent pixel, calculate the cosine of the angle between the line and the positive direction of the horizontal coordinate of the coordinate system, obtain the first slope between any edge pixel and the first adjacent pixel, obtain the second slope between any edge pixel and the second adjacent pixel, and if the first slope and the second slope are not equal, then record any edge pixel as the target edge pixel. Obtain the first slope and the second slope corresponding to each edge pixel of the defect region in any defect image. Based on the first slope and the second slope corresponding to each edge pixel of the defect region in any defect image, obtain all target edge pixels. Calculate the proportion of the number of all target edge pixels in the total number of edge pixels to obtain the degree of edge change of the defect region in any defect image.
4. The online visual inspection method for surface defects in copper foil production according to claim 1, characterized in that, The process of obtaining the feature suitability of any defect feature based on the inter-cluster separation between any two clusters, the intra-cluster compactness of each cluster, and the proportion of the defect image of the dominant copper foil surface defect type within each cluster includes: The spatial distribution suitability of any defect feature is obtained based on the inter-cluster separation between any two clusters and the intra-cluster compactness of each cluster. The suitability of the defect type distribution for any given defect feature is obtained based on the proportion of defect images of the dominant copper foil surface defect type within each cluster. The sum of the spatial distribution suitability and the defect type distribution suitability is calculated to obtain the feature suitability of any defect feature.
5. The online visual inspection method for surface defects in copper foil production according to claim 4, characterized in that, The step of obtaining the spatial distribution suitability of any defect feature based on the inter-cluster separation between any two clusters and the intra-cluster compactness of each cluster includes: Obtain the cluster center of each cluster. For any cluster, denot all clusters other than the cluster mentioned above as other clusters. Obtain the Euclidean distance between the cluster center of the cluster mentioned above and the cluster centers of each of the other clusters. Select the minimum value among all Euclidean distances as the minimum Euclidean distance between the cluster mentioned above and other clusters. Obtain the minimum Euclidean distance between each cluster and other clusters. Normalize the sum of the minimum Euclidean distances corresponding to all clusters to obtain the degree of inter-cluster separation. Calculate the Euclidean distance between the data point corresponding to any defect image within any cluster and the data point corresponding to each other defect image. Select the minimum value among the Euclidean distances between the data point corresponding to any defect image and the data point corresponding to each other defect image, and record it as the minimum distance between any defect image and other defect images. Obtain the minimum distance corresponding to each defect image within any cluster. Calculate the mean of the minimum distances corresponding to all defect images within any cluster to obtain the intra-cluster average distance of any cluster. Obtain the intra-cluster average distance of each cluster. Normalize the sum of the intra-cluster average distances of all clusters to obtain the sum-normalized value. Subtract the sum-normalized value from the constant 1 to obtain the intra-cluster compactness. The sum of the inter-cluster separation degree and the intra-cluster compactness degree is calculated to obtain the spatial distribution suitability of any defect feature.
6. The online visual inspection method for surface defects in copper foil production according to claim 4, characterized in that, The step of obtaining the suitability of defect type distribution for any defect feature based on the proportion of defect images of the dominant copper foil surface defect type within each cluster includes: For any cluster, count the number of defect images of each copper foil surface defect type within the cluster, and record the copper foil surface defect type corresponding to the largest number as the dominant defect type of the cluster. Calculate the proportion of the number of defect images of the dominant defect type in the cluster to the total number of defect images within the cluster to obtain the homogeneity of the cluster. Obtain the homogeneity of each cluster, and normalize the accumulated values of all homogeneity to obtain the type separation degree of any defect feature. Clusters other than any of the aforementioned clusters are denoted as other clusters. In each of the other clusters, the number of defect images of the dominant defect type of any cluster is obtained. All the numbers are accumulated to obtain the spillover degree of the dominant defect type of any cluster. The spillover degree of the dominant defect type of each cluster is obtained. The accumulated value of all spillover degrees is normalized to obtain the inter-cluster confusion degree. The constant 1 is subtracted from the inter-cluster confusion degree to obtain the feature discrimination of any defect feature. The sum of the type separation degree and the feature distinguishability is calculated to obtain the defect type distribution suitability of any defect feature.
7. The online visual inspection method for surface defects in copper foil production according to claim 1, characterized in that, The process involves selecting three optimal defect features from the defect feature set based on the suitability of each defect feature to distinguish different types of copper foil surface defects. These features include: Based on the feature suitability of each defect feature, all defect features are sorted in descending order to obtain a sequence. The first three defect features in the sequence are recorded as the optimal defect features.
8. The online visual inspection method for surface defects in copper foil production according to claim 1, characterized in that, The clustering results contain at least two clusters, and the number of clusters is equal to the number of known copper foil surface defect types.
9. The online visual inspection method for surface defects in copper foil production according to claim 6, characterized in that, The defect type of the defect image, which detects unknown surface defect types of copper foil based on clustering results, includes: For any defect image of an unknown copper foil surface defect type, obtain the cluster in which the defect image of the unknown copper foil surface defect type belongs, and denote it as the target cluster. Based on the copper foil surface defect type of each known copper foil surface defect type defect image in the target cluster, obtain the dominant defect type of the target cluster, and mark the defect type of the defect image of the unknown copper foil surface defect type as the dominant defect type of the target cluster.
Citation Information
Patent Citations
Steel structure welding process quality management recommendation method based on big data processing
CN118132849A
Mold injection molding control method and system for injection molding of automobile parts
CN121095204A