Search

CN-121982033-A - Deep learning-based method and system for detecting appearance defects of automobile sealing gasket

CN121982033ACN 121982033 ACN121982033 ACN 121982033ACN-121982033-A

Abstract

The invention discloses an appearance defect detection method and system for an automobile sealing gasket based on deep learning, and belongs to the field of computer vision and defect detection. The method comprises the steps of firstly collecting an original gray image of a sealing gasket by adopting a narrow-band annular shadowless light source and a high-precision industrial camera, carrying out gray normalization and region extraction of interest, secondly constructing and pre-training a depth residual error network, extracting a multi-scale feature image, then introducing a double-branch module containing channel attention and space attention, carrying out enhancement training on the feature image, enabling the model to focus on relevant defect features, then constructing a feature pyramid, fusing the feature images of different scales, and finally carrying out defect classification and positioning by utilizing the fused features, and automatically eliminating unqualified products by connecting an industrial control assembly. The invention effectively improves the detection precision and stability of the tiny defects on the surface of the black low-contrast sealing gasket, and realizes the complete industrial closed loop from image acquisition to automatic elimination.

Inventors

  • LIN YONGDA
  • WANG SHUAI

Assignees

  • 浙江优逸科汽车部件有限公司

Dates

Publication Date
20260505
Application Date
20260408

Claims (10)

  1. 1. The method for detecting the appearance defects of the automobile sealing gasket based on deep learning is characterized by comprising the following steps of: Step S1, image acquisition and preprocessing, namely placing an automobile sealing gasket to be detected at a detection station, irradiating by adopting an annular shadowless light source with a light-emitting wavelength set in a narrow band range of 450-650 nanometers, acquiring an original gray image by utilizing a charge coupled device industrial camera with an actual physical size set between 0.01-0.05 millimeters corresponding to single pixel, sequentially performing gray scale normalization processing and region extraction on the original gray image to obtain the region image of interest, wherein the gray scale normalization processing calculates the gray scale average value mu and standard deviation sigma of all pixel points in the region of interest of the image, and calculates normalized pixel values according to a preset linear mapping formula Stabilizing the gray average value of the normalized image to be near 128; S2, constructing and pre-training a multi-scale feature extraction network, namely constructing a depth residual error network, and pre-training the depth residual error network by utilizing an interested region image so as to focus the depth residual error network on a main body region of the sealing gasket, wherein the depth residual error network comprises a plurality of residual error stage groups and is used for outputting feature images with different scales; step S3, constructing and pre-training an attention enhancement module, namely respectively introducing attention enhancement modules for feature graphs with different scales, wherein the attention enhancement modules are spatial channel attention modules comprising channel attention branches and spatial attention branches; s4, constructing a feature pyramid, namely fusing feature graphs of different scales processed by the attention enhancement module to construct the feature pyramid comprising a plurality of output levels; And S5, defect prediction and automatic rejection, namely performing defect classification and positioning by utilizing the output of the feature pyramid, and controlling an industrial control component to execute rejection action according to the detection result.
  2. 2. The method for detecting the appearance defect of the automobile sealing gasket based on deep learning according to claim 1, wherein in the step S1, the annular shadowless light source is formed by arranging a plurality of groups of light emitting components on an aluminum alloy substrate at equal intervals in an annular shape, and light is scattered through a light homogenizing plate made of high diffuse reflection materials; The preset linear mapping formula is as follows: Wherein, I represents the original pixel value, G represents the preset gain coefficient, the value range is 0.5 to 2.0, B represents the preset brightness offset value, and the value range is-50 to 50.
  3. 3. The method for detecting the appearance defect of the automobile sealing gasket based on the deep learning according to claim 1, wherein in the step S1, the extraction of the region of interest comprises the steps of smoothing the normalized image by using a Gaussian filter, calculating the gradient amplitude and the gradient direction of each pixel point in the image by using a Sobel operator, and determining the strong edge and the weak edge in the image by setting a double-threshold mechanism; And finally locking the external closed contour of the sealing gasket by a contour tracing algorithm, expanding the redundancy of 5 to 10 pixels on the outside, and cutting out a rectangular area containing the sealing gasket body as an interested area image.
  4. 4. The method for detecting an appearance defect of an automobile gasket based on deep learning according to claim 1, wherein in step S2, the depth residual network includes a2 nd residual phase group and a4 th residual phase group; The 2 nd residual stage group is used for outputting a characteristic diagram C3, the proportional size of the characteristic diagram C3 relative to the original input image is 1/8, and the channel number is 512; the 4 th residual error stage group is used for outputting a characteristic image C5, the proportional size of the characteristic image C5 relative to the original input image is 1/32, and the channel number is 2048; the process of pre-training the depth residual error network in the step S2 comprises the steps of constructing a pre-training data set containing seal gasket region pixel level segmentation labels, adopting a two-class cross entropy loss function as a pre-training target function, and enabling the network to learn to distinguish the seal gasket region from the background region by minimizing the loss function.
  5. 5. The method for detecting appearance defects of an automobile gasket based on deep learning according to claim 4, wherein the pre-training of the attention enhancement module in step S3 includes connecting an auxiliary classifier after the attention enhancement module, optimizing parameters of a channel attention branch and a space attention branch in the attention enhancement module by a back propagation algorithm with a defect classification task as an auxiliary target, enabling the channel attention branch to learn to give higher weight to key channels representing defect textures, enabling the space attention branch to learn to give higher weight to space regions where defects appear, and removing the auxiliary classifier after training is completed.
  6. 6. The method for detecting the appearance defect of the automobile sealing gasket based on deep learning according to claim 5, wherein in the step S3, a channel attention branch is used for carrying out space dimension compression on an input feature map to obtain a channel description vector, and the channel description vector sequentially passes through a compressed full-connection layer and an expanded full-connection layer to generate a channel attention weight vector; The spatial attention branches are used for respectively executing global maximum pooling and global average pooling operations on channel dimensions, and the obtained results are spliced and then pass through a convolution layer to generate a spatial attention weight graph.
  7. 7. The method for detecting the appearance defects of the automobile sealing gasket based on deep learning according to claim 4, wherein in the step S4, the feature images with different scales processed by the attention enhancement module are fused, and the feature image C5 is up-sampled by adopting a bilinear interpolation algorithm so that the spatial dimension of the feature image C5 is consistent with that of the feature image C3; the channel number of the C5 after up sampling is reduced from 2048 to 512 by a 1X 1 convolution layer, the C5 after dimension reduction and the feature map C3 are added and fused element by element, and the fused feature map is input into a 3X 3 convolution layer for smoothing treatment, so that a fused feature map P3 is obtained.
  8. 8. The method for detecting appearance defects of an automobile gasket based on deep learning according to claim 7, wherein in the step S4, constructing a feature pyramid including a plurality of output levels further includes performing 3×3 convolution downsampling of the fused feature map P3 with a step size of 2 to obtain a feature map P4 with a proportional size of 1/16 with respect to an original input image; the feature map P4 is downsampled by a 3 x 3 convolution with a step size of 2, resulting in a feature map P5 with a proportional size of 1/32 relative to the original input image.
  9. 9. The method for detecting the appearance defects of the automobile gasket based on deep learning according to claim 8, wherein in the step S5, the defect classification and positioning comprises the steps of respectively inputting each output level P3, P4 and P5 of the feature pyramid into a corresponding multi-branch detection head, wherein each detection head is preset with a plurality of anchor frames with different length-width ratios, and the length-width ratios of the anchor frames comprise 1:1, 1:3 and 3:1; The detection head learns the offset of the prediction frame relative to the anchor frame through the regression branch of the boundary frame, and judges the probability distribution of the region belonging to burrs, cracks, pinholes, deformation or normal surfaces through the classification branch; In the reasoning stage, a classification confidence threshold is set, candidate frames with confidence coefficient larger than 0.5 are reserved, a non-maximum suppression algorithm is applied to perform de-duplication, and the cross-correlation ratio threshold is preset to be 0.45.
  10. 10. A deep learning-based automotive gasket appearance defect detection system for performing the method of any one of claims 1 to 9, comprising: The image acquisition module comprises an annular shadowless light source with a luminous wavelength set in a narrow band range of 450-650 nanometers and a charge coupled device industrial camera with an actual physical size set between 0.01-0.05 millimeters corresponding to single pixels, and is used for acquiring an original gray image of an automobile sealing gasket to be detected; The image preprocessing module is used for executing gray scale normalization processing and region of interest extraction on an original gray scale image to obtain a region of interest image, wherein the gray scale normalization processing is used for stabilizing the gray scale average value of the normalized image to be near 128 by calculating the gray scale average value mu and standard deviation sigma of all pixel points in the region of interest of the image and calculating a normalized pixel value I' according to a preset linear mapping formula; The multi-scale feature extraction network is a pre-trained depth residual error network and is used for extracting feature images with different scales from the region-of-interest image; The attention enhancement module is a pre-trained module and comprises a channel attention branch and a space attention branch, and is used for carrying out feature enhancement on feature graphs with different scales; the feature pyramid construction module is used for fusing the feature graphs of different scales processed by the attention enhancement module and outputting a plurality of levels of feature graphs; The defect prediction module is used for classifying and positioning defects by utilizing the characteristic diagrams of a plurality of layers and outputting defect information; The industrial control assembly comprises a programmable logic controller, an electromagnetic valve and a pneumatic push rod, and is used for receiving defect information, tracking the position of a defect sealing gasket to be removed based on pulse data of a production line encoder, and driving the electromagnetic valve and the pneumatic push rod to execute removing action when the defect sealing gasket to be removed moves to a removing station.

Description

Deep learning-based method and system for detecting appearance defects of automobile sealing gasket Technical Field The application belongs to the field of computer vision and defect detection, and particularly relates to an automobile sealing gasket appearance defect detection method and system based on deep learning. Background With the continuous evolution of intelligent manufacturing technology, the automatic detection technology is increasingly widely applied to the field of automobile part quality control. As a key sealing element of an automobile power system and a transmission system, the surface quality of an automobile sealing gasket is directly related to the sealing reliability and the driving safety of the whole automobile. The high-precision defect detection is not only a core link for guaranteeing the delivery qualification rate of products, but also an important guarantee for reducing the maintenance cost of the whole vehicle and improving the brand competitiveness, and has important significance for realizing the precise production of the automobile industry. The deep learning detection method based on computer vision gradually replaces the traditional manual visual sampling inspection due to the strong characteristic characterization capability, and becomes a main scheme for realizing online full-quantity detection of the sealing gasket. The technology automatically extracts apparent characteristics of an object to be detected through a convolutional neural network, and aims to realize high-precision real-time identification and accurate positioning aiming at abnormal states such as cracks, pinholes, burrs and the like possibly existing on the surface of a sealing gasket. However, existing deep-learning detection models have significant limitations in dealing with black rubber or composite gaskets. Because the surface contrast of the target material is extremely low, the conventional convolution operation is extremely easy to cause serious loss of sub-millimeter defect characteristics in the deep network downsampling process. Meanwhile, uneven light and dust interference in the production environment often form false features, which cause false detection to frequently occur when the detection system processes background noise. In addition, the fusion capability of the traditional operator on the multi-scale features is weak, and the global deformation and the tiny loss local features of workpieces of different types are difficult to balance, so that the detection robustness in a complex industrial scene is difficult to meet the application requirements. Accordingly, a solution for detecting an appearance defect of an automotive gasket based on deep learning is desired. Disclosure of Invention The invention aims to provide a method and a system for detecting the appearance defects of an automobile sealing gasket based on deep learning, which can effectively solve the problems in the background technology. In order to achieve the above purpose, the technical scheme adopted by the invention is as follows: a method for detecting appearance defects of an automobile sealing gasket based on deep learning comprises the following specific steps: Step S1, image acquisition and preprocessing, namely placing an automobile sealing gasket to be detected at a detection station, irradiating by adopting an annular shadowless light source with a light-emitting wavelength set in a narrow band range of 450-650 nanometers, acquiring an original gray image by utilizing a charge coupled device industrial camera with an actual physical size set between 0.01-0.05 millimeters corresponding to single pixel, sequentially performing gray scale normalization processing and region extraction on the original gray image to obtain the region image of interest, wherein the gray scale normalization processing calculates the gray scale average value mu and standard deviation sigma of all pixel points in the region of interest of the image, and calculates normalized pixel values according to a preset linear mapping formula Stabilizing the gray average value of the normalized image to be near 128; S2, constructing and pre-training a multi-scale feature extraction network, namely constructing a depth residual error network, and pre-training the depth residual error network by utilizing an interested region image so as to focus the depth residual error network on a main body region of the sealing gasket, wherein the depth residual error network comprises a plurality of residual error stage groups and is used for outputting feature images with different scales; step S3, constructing and pre-training an attention enhancement module, namely respectively introducing attention enhancement modules for feature graphs with different scales, wherein the attention enhancement modules are spatial channel attention modules comprising channel attention branches and spatial attention branches; s4, constructing a feature pyramid, namely fusing