CROSS-SCALE DEFECT DETECTION METHOD BASED ON DEEP LEARNING
20230306577 · 2023-09-28
Inventors
Cpc classification
G06V20/70
PHYSICS
G06V10/7715
PHYSICS
International classification
G06V20/70
PHYSICS
G06V10/77
PHYSICS
Abstract
A cross-scale defect detection method based on deep learning, including: (S1) building a vision data acquisition system to acquire a surface image of a part to be processed; and building a defect dataset; (S2) building a deep learning-based cross-scale defect detection model; and inputting the defect dataset obtained in the step (S1) into the deep learning-based cross-scale defect detection model for model training; and (S3) building a defect detection system according to the deep learning-based cross-scale defect detection model and the vision data acquisition system; and detecting a defect of the surface image of the part to be processed.
Claims
1. A cross-scale defect detection method based on deep learning, comprising: (S1) building a vision data acquisition system to acquire a depth image and a visible image of a defect of a surface image of a part to be processed; and constructing a defect dataset; (S2) building a deep learning-based cross-scale defect detection model; and inputting the defect dataset constructed in step (S1) into the deep learning-based cross-scale defect detection model for model training; and (S3) building a defect detection system according to the deep learning-based cross-scale defect detection model and the vision data acquisition system; and detecting, by the defect detection system, the defect of the surface image of the part to be processed.
2. The cross-scale defect detection method of claim 1, wherein step (S1) comprises: (S11) acquiring, by a depth sensor, the depth image of the defect of the surface image of the part to be processed, and acquiring, by a vision sensor, the visible image of the defect of the surface image of the part to be processed, wherein the depth image of the defect and the visible image of the defect are constructed as a defect data group; (S12) rotating, cutting, scaling and converting the depth image and the visible image acquired in step (S11) to increase data of the surface image of the part to be processed for training; and (S13) annotating the defect of the surface image of the part to be processed by means of LabelImg to obtain the defect dataset.
3. The cross-scale defect detection method of claim 1, wherein the defect comprises a scratch and crack on a surface on the part to be processed, and a protrusion, dent and roughness of a fastener.
4. The cross-scale defect detection method of claim 1, wherein in step (S2), the deep learning-based cross-scale defect detection model is operated through steps of: (a) taking a defect data group comprising the depth image and the visible image as an input; (b) extracting a feature of the depth image and a feature of the visible image by means of a bi-branch feature extraction network; and subjecting the feature of the depth image and the feature of the visible image respectively extracted by two branches of the bi-branch feature extraction network to weighted fusion through an attention mechanism; and (c) subjecting the feature of the depth image and the feature of the visible image after weighted fusion to cross-scale feature fusion to reduce a channel dimension of a feature map F.sub.A2 of a first scale, a channel dimension of a feature map F.sub.A3 of a second scale, a channel dimension of a feature map F.sub.A4 of a third scale, a channel dimension of a feature map F.sub.A5 of a fourth scale and a channel dimension of a feature map F.sub.A6 acquired by a squeeze-and-excitation (SE) module from 256 to 64; and obtaining intermediate feature maps F.sub.B2, F.sub.B3, F.sub.B4, F.sub.B5 and F.sub.B6 by using a 1×1 convolution; performing up-sampling and/or down-sampling on the F.sub.B2, F.sub.B3, F.sub.B4 and F.sub.B5 followed by concatenating to obtain a 256-D feature map having the same spatial resolution with a corresponding scale; and concatenating the F.sub.A4 with the 256-D feature map to achieve a cross-scale feature fusion of five scales, expressed as:
f=Σ.sub.n.sup.N sum(Σ.sub.iϵW,jϵHF.sub.n(x.sub.i,y.sub.j))+F.sub.A4; wherein (x, y) is a pixel point of F.sub.n; sum indicates summation; N is the number of feature maps; W is an image width; and H is an image height.
5. The cross-scale defect detection method of claim 4, wherein each of the two branches of the bi-branch feature extraction network comprises a mix convolution branch and a squeeze-and-excitation (SE) branch; wherein the mix convolution branch is configured to fuse multi-scale local information by using different receptive fields according to a convolution kernel size and a group size; the SE branch is configured to distinguish a significance between different feature layers, and deepen semantic extraction and decoding through residual skip connection; the group size G determines the number of different types of convolution kernels for a single input tensor; and when G=1, mix convolution is equivalent to a normal depth convolution.
6. The cross-scale defect detection method of claim 4, wherein a fusion equation of the attention mechanism is expressed as:
F=Σ.sub.i.sup.Nλ.sub.1F.sub.di+λ.sub.2F.sub.vi; wherein λ.sub.1 is a weight of the feature of the depth image; λ.sub.2 is a weight of the feature of the visible image; N is the number of layers of a feature map; F.sub.di is an i.sup.th-layer feature map of the depth image; and F.sub.vi is an i.sup.th-layer feature map of the visible image.
7. The cross-scale defect detection method of claim 1, wherein the step (S3) comprises: building the defect detection system according to the deep learning-based cross-scale defect detection model and the vision data acquisition system; and outputting, by the defect detection system, defect detection results in real time and saving the defect detection results in a form comprising a defect image and a table comprising a defect location; wherein the vision data acquisition system is configured to acquire data; and the deep learning-based cross-scale defect detection model is configured for defect detection and detection result output.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0039]
[0040]
[0041]
DETAILED DESCRIPTION OF EMBODIMENTS
[0042] The present disclosure will be described below in detail below with reference to the accompanying drawings and embodiments.
[0043] As shown in
[0044] (S1) A vision data acquisition system is built to acquire a surface image of a part to be processed. A defect dataset is constructed. The step (S1) includes the following steps.
[0045] (S11) A depth image of the defect of the surface image of the part to be processed is acquired by a depth sensor. A visible image of the defect of the surface image of the part to be processed is acquired by a vision sensor. Structural defects such as protrusion and dent can be greatly shown through the depth sensor. Defects such as scratch and paint-shedding can be greatly shown through the vision sensor. The depth image of the defect and the visible image of the defect are constructed as a defect data group.
[0046] (S12) The depth image and the visible image acquired in the step (S1) are rotated, cut, scaled and converted to increase data of the surface image of the part to be processed for training.
[0047] (S13) The defect of the surface image of the part to be processed is annotated by means of LabelImg to obtain the defect dataset.
[0048] In an embodiment, the defect includes a scratch and crack on a surface on the part to be processed, and a protrusion, dent, and roughness of a fastener.
[0049] (S2) A deep learning-based cross-scale defect detection model is built. The defect dataset constructed in the step (S1) is input into the deep learning-based cross-scale defect detection model for model training.
[0050] In an embodiment, as shown in
[0053] The two branches of the bi-branch feature extraction network each include a mix convolution branch and a SE branch. The mix convolution is configured to fuse multi-scale local information by using different receptive fields according to a convolution kernel size and a group size. The SE branch is configured to distinguish a significance between different feature layers, and deepen semantic extraction and decoding through residual skip connection. The group size G determines the number of different types of convolution kernels for a single input tensor. When G=1, mix convolution is equivalent to a normal depth convolution.
[0054] A fusion equation of the attention mechanism is expressed as:
F=Σ.sub.i.sup.Nλ.sub.1F.sub.di+λ.sub.2F.sub.vi;
[0055] where λ.sub.1 is a weight of the feature of the depth image; λ.sub.2 is a weight of the feature of the visible image; N is the number of layers of a feature map; F.sub.di is an i.sup.th-layer feature map of the depth image; and F.sub.vi is an i.sup.th-layer feature map of the visible image. [0056] (c) The feature of the depth image and the feature of the visible image after weighted fusion are subjected to cross-scale feature fusion as shown in
[0057] The F.sub.B2, F.sub.B3, F.sub.B4 and F.sub.B5 are subjected to up-sampling and/or down-sampling and concatenating to obtain a 256-D feature map having the same spatial resolution with a corresponding scale.
[0058] The F.sub.A4 is superimposed onto the 256-D feature map to achieve a cross-scale feature fusion of five scales, expressed as:
f=Σ.sub.n.sup.N sum(Σ.sub.iϵW,jϵHF.sub.n(x.sub.i,y.sub.j))+F.sub.A4;
[0059] where (x, y) is a pixel point of F.sub.n; sum indicates summation; N is the number of the feature map; W is an image width; and H is an image height.
[0060] (S3) A defect detection system is built according to the deep learning-based cross-scale defect detection model and the vision data acquisition system. The defect of the surface image of the part to be processed is detected by the defect detection system to determine part quality and facilitate maintenance, so as to ensure the safety.
[0061] In an embodiment, the step (S3) includes the following steps.
[0062] The defect detection system is built according to the deep learning-based cross-scale defect detection model and the vision data acquisition system.
[0063] Defect detection results are output in real time by the defect detection system. The defect detection results are saved in a form including a defect image and a table including a defect location.
[0064] The vision data acquisition system is configured to acquire data; and the deep learning-based cross-scale defect detection model is configured for defect detection and detection result output.
[0065] Described above are merely preferred embodiments of the disclosure, which are illustrative and are not intended to limit the disclosure. It should be understood that any variations, modifications and replacements made by those skilled in the art without departing from the spirit of the disclosure should fall within the scope of the disclosure defined by the appended claims.