This application claims the benefit of priority from Chinese Patent Application No. 202210483136.7, filed on May 6, 2022. The content of the aforementioned application, including any intervening amendments thereto, is incorporated herein by reference in its entirety.
This application relates to defect detection, and more particularly to a subtle defect detection method based on coarse-to-fine strategy.
With the rapid development of science and technology, the requirement for various industrial products become increasingly strict. In the traditional industrial manufacturing, surface defects are detected mainly by manual operation, which has low efficiency and large labor consumption. Moreover, in the manual detection, many subtle defects on the workpiece will be missed due to the randomness and diversity in type and size of the defects, leading to poor detection precision and unsatisfactory product quality.
With the emergence and development of artificial intelligence technology, machine vision-based image surface defect detection strategies have been developed, which have a significantly improved detection efficiency, and have been widely applied in road and tunnel engineering detection, workpiece surface quality inspection and aerospace manufacturing. This detection method eliminates the subjective errors in the manual detection, but still fails to enable the precise detection of subtle defects of the products.
An objective of this application is to provide a subtle defect detection method based on coarse-to-fine strategy to overcome the problems of high missing detection rate and low detection accuracy, and the inability to accurately locate and extract subtle defects in the existing manual detection. In the defect detection method provided herein, the micro defects on the object surface can be accurately located and classified, so as to lower the missing detection rate and improve the detection accuracy and efficiency of subtle defects.
Technical solutions of this application are described as follows.
This application provides a method for detecting micro defects based on coarse-to-fine strategy, comprising:
In an embodiment, step (S2) further comprises:
In an embodiment, the classification network and the regression network share a feature weight at the same level; wherein first five layers of a backbone in the backbone network are composed of four convolutional layers and one pooling layer.
In an embodiment, the defect point detection network comprises a backbone network comprising six stages, a bidirectional feature pyramid network, a classification network and a regression network;
In an embodiment, the bidirectional feature pyramid network is configured to perform fusion feature mapping on an input defect feature through steps of:
In an embodiment, the classification network is configured to predict the defect position; and the regression network is configured to perform detect location and regression, and output a defect identification-location-detection image.
In an embodiment, the classification network and the regression network each comprises two convolution kernels; and the classification network and the regression network share a common input feature mapping as fusion feature mapping.
In an embodiment, in step (S3), the defect segmentation loss function is used to train a precision of the defect point detection network;
the edge loss Le is defined as follows:
Le=λ2LBCE(s,ŝ);
wherein {circumflex over (ƒ)} and ŝ are defect labels; λ1 and λ2 are two balance parameters, and λ1 and λ2∈[0.1].
In an embodiment, last two parts of the defect segmentation loss function are the first regularization loss function and the second regularization loss function;
1s,p={1:s>thrs};
Compared with the prior art, this application has the following beneficial effects.
Regarding the method provided herein, after acquiring an image of the object to be detected, the subtle defects in the image can be accurately recognized and located, and thus the missing detection and false detection can be effectively eliminated, thereby improving the defect detection accuracy.
This application will be described in detail below with reference to the accompanying drawings and embodiments.
Referring to an embodiment shown in
A defect area location network is constructed and the image to be detected is preprocessed by using the defect area location network to initially determine a defect position. Step (S2) is further performed as follows.
The classification network and the regression network share a feature weight at the same level.
First five layers of a backbone in the backbone layer network are composed of four convolutional layers and one pooling layer. A small number of convolutional layers is capable of reducing redundant calculation and accelerating defect detection.
The defect point detection network is constructed. And then, the defect point detection network is trained by using a defect segmentation loss function to extract defect feature from the preprocessed the image surface.
Referring to an embodiment shown in
The backbone network in the defect point detection network is designed. The preprocessed image data is input into the backbone network. The backbone network includes six stages, which is shown in Table 1.
In the six stages, a first stage includes a convolutional layer and a 7×7 convolution kernel.
A second stage includes a 3×3 max-pooling layer and a dense block; A third stage is composed of a dense block. A fourth stage is composed of a dense block structurally different from the dense block of the third stage. The third stage and the fourth stage are configured to accelerate transmission of the defect feature and improve utilization of a defect feature image.
A fifth stage is composed of two dilated bottleneck layers to capture subtle target defect features.
A sixth stage is composed of a dilated bottleneck layer to avoid loss of the subtle target defect features.
The bidirectional feature pyramid network is configured to perform fusion feature mapping on an input defect feature, which is performed as follows.
Information of different defect features is acquired through a bidirectional connection. The defect features at different layers are balanced by variable-weighted feature fusion through the following equation:
The classification network is configured to predict the defect position from the image to be detected. The regression network is configured to perform data location and regression, and output a defect identification-location-detection image. The classification network and the regression network each includes two convolution kernels. The classification network and the regression network share a common input feature mapping as fusion feature mapping.
The semantic segmentation loss Lss is configured to predict a semantic segmentation f by using standard cross entropy (CE) loss, and the edge loss Le is configured to predict a feature mapping s by using standard binary cross entropy (BCE) loss, where the semantic segmentation loss Lss is defined as follows:
Lss=λ1LCE({circumflex over (ƒ)},ƒ); and
The last two parts of the defect segmentation loss function are the first regularization loss function and the second regularization loss function.
The first regularization loss function is configured to avoid a mismatch between a defect edge and a predicted edge, defined as follows:
The second regularization loss function is configured to match semantic prediction by using edge prediction to prevent overfitting, defined as follows:
1s,p={1:s>thrs};
In this embodiment, the thrs is set to be 0.8, λ3 is set to be 0.15, λ4 is set to be 0.12 to optimize the segmentation performance.
Described above are merely preferred embodiments of the disclosure, which are not intended to limit the scope of the application. Any technical solutions made within the idea of this disclosure shall fall within the protection scope of this application; It should be understood by those skilled in the art that any and changes and modifications made without departing from the spirit of the application shall fall within the scope of the present application defined by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
202210483136.7 | May 2022 | CN | national |
Number | Name | Date | Kind |
---|---|---|---|
20170357895 | Karlinsky | Dec 2017 | A1 |
20200257100 | Putman | Aug 2020 | A1 |
20210383557 | Brauer | Dec 2021 | A1 |
20220059316 | Bhattacharyya | Feb 2022 | A1 |
Number | Date | Country |
---|---|---|
111768388 | Oct 2020 | CN |
113052103 | Jun 2021 | CN |
Number | Date | Country | |
---|---|---|---|
20230260101 A1 | Aug 2023 | US |