Transform-based automobile part defect detection method and system
By using Transformer to extract features and combining edge and texture information in automotive parts detection, the problems of data acquisition difficulties and degraded model generalization performance are solved, and higher detection accuracy and robustness are achieved.
Patent Information
- Application Number
- CN202410935839.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-15
AI Technical Summary
In the detection of automotive parts defects, it is difficult to obtain large-scale, high-quality labeled data, and the generalization performance of deep learning models decreases when facing complex defects, especially due to metal artifacts and blurred boundary information that affect detection accuracy.
Using Transformer-based method, space and long-distance dependency features are extracted through Vision Transformer, boundary information is enhanced by combining Sobel filter and significance edge guidance module, and texture feature enhancement method is used to segment the foreground and background marks of images to improve the accuracy of detection. Sex and robustness.
Effectively eliminate metal artifacts, enhance the model's perception of subtle features, improve the accuracy and generalization performance of defect detection, weaken the impact of boundary blur, and achieve more accurate defect positioning.
Smart Images

Figure CN118967566A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing for automobile industry inspection, and in particular to a method and system for automobile parts defect inspection based on Transformer. Background Art
[0002] In today's 5G and artificial intelligence era, deep learning has a profound impact on computer vision and has a huge impact on people's daily lives, industry, academia and even national security. At the same time, the widespread application of deep learning technology has promoted the development of automotive parts defect detection technology. Automotive parts defect detection plays a vital role in automobile manufacturing. At first, the defect detection of automotive parts mainly relied on manual operation, but this method had the dilemma of difficult to improve work efficiency. Therefore, the machine detection mode is gradually becoming the mainstream trend. This mode has the characteristics of high efficiency and low cost, and has been widely used in the automotive industry. At present, although there are some methods to reduce the occurrence of part defects in the production process, these methods are not perfect. Therefore, how to further improve the accuracy of defect detection has become an urgent problem to be solved.
[0003] In the field of automotive parts defect detection based on deep learning, there are two main challenges: (1) Difficulty in obtaining large-scale, high-quality data: Obtaining large-scale, high-quality labeled data is the key to deep learning model training. However, the defects of automotive parts are usually diverse and complex, and manual data acquisition requires a lot of time and cost. (2) Model accuracy and generalization performance: The collected parts images contain metal artifacts and blurred boundary information, which greatly affects the accuracy of defect location. At the same time, the defects of automotive parts may be diverse, and deep learning models may not generalize well when faced with new and unseen defect types, resulting in performance degradation.
[0004] With the development of deep learning, as a deep learning model based on the attention mechanism, Transformer can effectively capture long-distance dependencies and is suitable for processing image data with complex spatial structures and global dependencies. In automotive parts defect detection, Transformer can effectively capture key features and defect information in parts images and improve detection performance. Defects of automotive parts usually appear as irregular textures or shape changes. Using texture information can help the detection model identify and locate defect areas more accurately. By introducing texture information, the model's perception of subtle features can be enhanced and the accuracy of defect detection can be improved. Defects usually appear at the boundaries or specific areas of parts, so boundary information is very important for detecting defects. Introducing boundary information into the deep learning model can help the model better distinguish the boundaries between defects and normal areas, improving the accuracy and robustness of detection. At the same time, boundary information also helps to extract richer features and enhance the model's understanding of defects.
[0005] Therefore, it is urgent to use Transformer, texture information and boundary information to fully mine the key features and defect information in component images, so as to improve the accuracy, robustness and generalization of automotive component defect detection. Summary of the invention
[0006] The purpose of the present invention is to provide a Transformer-based automobile parts defect detection method and system, which can improve the accuracy, robustness and generalization of automobile parts image detection.
[0007] In order to achieve the above object, the present invention provides the following technical solutions:
[0008] A method for defect detection of automobile parts based on Transformer comprises the following steps:
[0009] Acquire a two-dimensional vehicle assembly image;
[0010] Performing data processing on the two-dimensional automobile assembly image to obtain a two-dimensional automobile parts image;
[0011] Data processing of 2D automotive parts images until they meet the training requirements based on deep learning;
[0012] Using Vision Transformer as an encoder, we extract spatial features and long-distance dependency features from two-dimensional automotive parts images and obtain four-level automotive parts coding feature maps.
[0013] The fourth-level automobile parts coding feature map is sequentially input into the Sobel filter and the saliency edge guidance module to enhance and extract the boundary information of the defective area in the image, and obtain a high-level saliency coding map;
[0014] The texture feature enhancement method is used to extract and enhance the texture features of the four-level automobile parts coding feature maps to generate texture feature maps of different levels;
[0015] The context-enhanced decoding module is used to perform foreground and background labeling segmentation on the high-level saliency coding map and texture feature maps of different levels, and the automobile parts defect location result image is obtained through the neural network training method.
[0016] A Transformer-based automobile parts defect detection system, comprising:
[0017] An image acquisition unit, used for acquiring a two-dimensional vehicle assembly image;
[0018] An image preprocessing unit, used for performing data processing on a two-dimensional automobile assembly image to obtain a two-dimensional automobile parts image;
[0019] The feature encoding unit uses Vision Transformer as an encoder to extract spatial features and long-distance dependency features from the two-dimensional automobile parts image, and obtains a four-level automobile parts encoding feature map;
[0020] A saliency edge prediction unit is used to input the fourth-level automobile parts coding feature map into the Sobel filter and the saliency edge guidance module in sequence, perform feature enhancement and extraction on the boundary information of the defective area in the image, and obtain a high-level saliency coding map;
[0021] A texture enhancement evolution unit is used to extract and enhance texture features of automobile parts coding images at different levels through a texture feature enhancement method, and generate texture feature images at different levels;
[0022] The image decoding generation unit is used to perform foreground and background marking segmentation on the high-level saliency coding map and the texture feature maps of different levels to obtain an automobile parts defect positioning result image.
[0023] In the above technical solution, the present invention has the following beneficial effects:
[0024] The present invention extracts component edge information and component texture information from images in sequence, and effectively eliminates metal artifacts through encoding and context-enhanced decoding conversion. It also uses a significant edge guidance method to take the foreground as a seed point and the background as an irrelevant area. The algorithm performs segmentation near the seed point, effectively mining key features and defect information in component images, while also reducing the impact of boundary blur, and more effectively and accurately detecting defect areas in single automotive component images. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0026] Figure 1 A schematic diagram of the process of the automobile parts defect detection method provided by the present invention;
[0027] Figure 2 A schematic diagram of a flow chart for data processing of a two-dimensional automobile assembly image provided by the present invention;
[0028] Figure 3 A schematic diagram of the flow chart of the feature encoding unit provided by the present invention;
[0029] Figure 4 A schematic diagram of the process flow of the saliency edge prediction unit provided by the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0031] like Figure 1 As shown, the present invention provides a method for detecting defects in automobile parts based on Transformer, comprising:
[0032] Step 100: Acquire a two-dimensional vehicle assembly parts image.
[0033] Step 200: Process the two-dimensional automobile assembly image, select image denoising, contrast enhancement, image scaling, image rotation, image horizontal and vertical mirror transformation as needed, and obtain a two-dimensional automobile parts image; the image denoising process includes three operations: expansion, corrosion, and median filtering, which can be selected as needed. After the data of the two-dimensional automobile parts image is processed, the quantity and quality have reached the training requirements of deep learning.
[0034] Step 300: Using Vision Transformer as an encoder, extract spatial features and long-distance dependency features from the two-dimensional automobile parts image to obtain coding feature maps of automobile parts at four different levels, namely, the first level F1, the second level F2, the third level F3, and the fourth level F4.
[0035] Step 400: The fourth-level automobile parts coding feature map F4 is sequentially input into the Sobel filter and the saliency edge guidance module, and the feature enhancement and extraction of the boundary information of the defect area in the image are performed to obtain a high-level saliency coding map; the saliency edge guidance module is constructed according to the foreground area, uncertain area, background area and context attention block of the saliency map. After the fourth-level automobile parts coding feature map F4 is processed by the Sobel filter, the automobile parts coding feature map F4 is continued to be processed by the saliency edge guidance module.
[0036] Step 500: Using a texture feature enhancement method, the texture features of the two-dimensional automobile parts coding images at different levels are extracted and enhanced to generate corresponding texture feature maps at different levels. The texture enhancement method includes the operations of average maximum pooling (MP) and skip connection (SC). The texture enhancement method is applied to the coding feature map of each level extracted by the Vision Transformer to extract information of different scales while enhancing the abnormal area of the automobile parts image.
[0037] Step 600: Using the context-enhanced decoding module, perform foreground and background label segmentation on the high-level saliency coding map and the texture feature maps of different levels to obtain the final automobile parts defect location result image.
[0038] Among them, in order to obtain accurate automobile parts defect positioning result map, the training method of automobile parts defect detection based on Transformer is:
[0039] Obtain training data, including high-level saliency coding maps and texture feature maps. In order to improve the image quality and thus the accuracy of defect location, the experimental data is processed accordingly. After processing, the data has met the training requirements of deep learning in terms of quantity and quality; build a training model for automotive parts defect detection based on Transformer; input the training data into the training model and use the edge loss function for training.
[0040] And, the edge loss function is preferably:
[0041]
[0042] Among them, Ipre(i) is the predicted map of the saliency edge guidance module in the network, and Igt(i) is the actual boundary map.
[0043] As an implementation of step 100, it specifically includes:
[0044] The two-dimensional automobile assembly images are enhanced and transformed by image dilation, image erosion, median filtering, contrast enhancement, image scaling, image rotation, and horizontal and vertical mirror transformations to obtain a large number of two-dimensional automobile parts images as the input of the deep learning model.
[0045] As an implementation of step 200, it specifically includes:
[0046] The encoder based on Vision Transformer allows the model to focus on different parts of the two-dimensional automobile parts image through multiple layers of self-attention mechanism and feedforward neural network, effectively aggregating information across image blocks. It also processes image block embedding in a hierarchical manner to capture local and global dependencies in the image and obtain the automobile parts encoding feature map.
[0047] As an implementation of step 500, it specifically includes:
[0048] The four-level texture feature maps and the boundary feature maps output by the saliency edge guidance module, i.e., the high-level saliency encoding map, will be used as the input of the context-enhanced decoding module; the module structure is mainly composed of the channel-wise global average pooling (GAP) submodule, the downsampling submodule, and the convolution operation submodule. The global average pooling submodule significantly reduces the number of parameters and reduces the risk of overfitting. The downsampling submodule retains the main features while reducing the sensitivity to noise and unimportant details. The convolution operation submodule can extract local features such as edges and textures in the feature map.
[0049] like Figure 2 As shown, the present invention provides a data processing process for a two-dimensional automobile assembly image, including:
[0050] The two-dimensional automobile assembly images are enhanced and transformed by image dilation, image erosion, median filtering, contrast enhancement, image scaling, image rotation, and horizontal and vertical mirror transformations to obtain a large number of two-dimensional automobile parts images as the input of the deep learning model.
[0051] like Figure 3 As shown, the present invention provides an encoder based on Vision Transformer, comprising the following steps:
[0052] Step 100: Acquire a two-dimensional vehicle assembly parts image;
[0053] Step 200: Data processing is performed on the two-dimensional automobile assembly image, including image denoising, contrast enhancement, image scaling, image rotation, and image horizontal and vertical mirror transformation, to obtain a two-dimensional automobile parts image; the image denoising process includes three operations: dilation, erosion, and median filtering. After processing, the automobile parts image data has met the training requirements of deep learning in terms of quantity and quality;
[0054] Step 300: Using Vision Transformer as an encoder, extracting spatial features and long-distance dependency features from the two-dimensional automobile parts image to obtain encoding feature maps of automobile parts at four different levels;
[0055] like Figure 4 As shown, the present invention provides a saliency edge guidance module, comprising:
[0056] Firstly, the Sobel filter is used to extract the salient boundary information feature map from the fourth-level automobile parts coding feature map obtained based on the Vision Transformer encoder feature extraction module;
[0057] Then, the salient boundary information feature map is used as the input of the salient edge guidance module. By extracting its foreground map, uncertainty region map and background map, contextual attention is used for implicit edge guidance, thereby extracting rich semantic features without additional explicit boundary information supervision and enhancing the uncertain regions in the defect segmentation results of automotive parts.
[0058] The calculation methods of the foreground image, background image, and uncertainty area image are defined as follows:
[0059] F f =max(F-0.5,0),
[0060] F b =max(0.5-F,0),
[0061] F u =0.5-abs(F-0.5)
[0062] Among them, F is a significant boundary information feature map, F f 、F f and F f They respectively represent the foreground image, background image and uncertain area image extracted based on the significant boundary information feature map, and max() and abs() represent the maximum value and average value functions respectively.
[0063] The calculation method of the encoding feature map output by the saliency edge guidance module is defined as follows:
[0064] F edge =Att(F f ⊙F b ⊙F u )
[0065] Among them, ⊙ is the concatenation operation and Att is the contextual attention operation.
[0066] Based on the above technical solution, the following embodiments are provided.
[0067] The following steps are performed for the acquired two-dimensional vehicle assembly image:
[0068] Step 1: The data enhancement effect that this embodiment aims to achieve is to increase the quantity and improve the quality of the two-dimensional vehicle assembly image. The input two-dimensional vehicle assembly image is subjected to data processing, including image expansion, corrosion, median filtering, contrast enhancement, image scaling, image rotation, and image horizontal and vertical mirror transformation to obtain a two-dimensional automobile parts image.
[0069] Step 2: Use Vision Transformer as an encoder; Due to the influence of factors such as equipment, there will often be metal artifact noise in the actual two-dimensional vehicle assembly images. Therefore, we extract key features and defect information from the acquired two-dimensional automotive parts images to enhance the ability to eliminate metal artifacts, making the encoder suitable for processing component image data with complex spatial structures and long-term dependencies.
[0070] The Vision Transformer encoder is composed of n stacked encoder layers (n=5), each of which consists of a multi-head self-attention (MHSA) module and a multi-layer perceptron (MHP). Assume that the input of the i-th layer is F i-1 , then its output is defined as follows:
[0071]
[0072] in, Represents the element-wise addition operation. MSA and MLP represent the multi-head self-attention layer and multi-layer perceptron layer, respectively.
[0073] Step 3: Although the encoder can effectively extract shallow and deep semantic information of automobile parts images, the defect detection of automobile parts images is challenging due to factors such as irregular shapes, diverse scales, and blurred boundaries of defect areas in automobile parts images. In order to better cope with these challenges, a saliency edge guidance module is specially designed to capture the subtle boundary features around the defect area. However, how to construct appropriate input data for the saliency edge guidance module is the main challenge in the design of this module. Different from the traditional simple feature concatenation, the output of the Sobel filter layer is used as the boundary information head of the saliency edge guidance module to improve the sensitivity and accuracy of boundary features.
[0074] By inputting the fourth-level automobile parts coding feature map into the Sobel filter for processing and then into the saliency edge guidance module, the defect area boundary information in the image is enhanced and extracted to obtain a high-level saliency coding map. The foreground map, background map, uncertainty area map and Sobel filter calculation method are defined as follows:
[0075]
[0076] Among them, F 5 is the output of the Vision Transformer encoder, F is the significant boundary information feature map after passing through the Sobel filter, and F f 、F f and F f They respectively represent the foreground image, background image and uncertain area image extracted based on the significant boundary information feature map, and max() and abs() represent the maximum value and average value functions respectively.
[0077] The calculation method of the encoding feature map output by the saliency edge guidance module is defined as follows:
[0078] F edge =Att(F f ⊙F b ⊙F u ) (3)
[0079] Among them, ⊙ is the concatenation operation and Att is the contextual attention operation.
[0080] Step 4: Design texture feature enhancement to extract texture information of automobile parts; In order to preserve more texture information to capture defective areas of automobile parts, a texture feature enhancement block is designed. First, block-based local average pooling is applied to downsample the feature map of a specific layer i in the encoder to obtain a merged feature map D. Then, the residual is defined at the feature level i in the encoder to represent the texture information, as shown below
[0081] Ti =F i -D (4)
[0082] Here T includes F i Then 3 layers of densely connected convolutional blocks are used to enhance T.
[0083] Step 5: The context-enhanced decoding module aims to inject abnormal cues related to boundaries and textures into representation learning to enhance feature representations with object structure semantics. It is well known that different feature channels usually contain different semantics. Therefore, in order to achieve good integration and obtain powerful representations, a local channel attention mechanism is introduced to explore cross-channel interactions and mine key cues between channels.
[0084] The four levels of texture enhancement feature maps and the boundary feature map output by the saliency edge guidance module will be used as the input of the context enhancement decoding module. i (i∈{2,3,...,5}) and the boundary feature F output by the saliency edge guidance module edge First, we multiply the elements between them and obtain the initial fusion features through 3×3 convolution. It is expressed as:
[0085]
[0086] Where D is downsampling, f conv It is a 3×3 convolution. is element-wise multiplication, and ⊕ is element-wise addition. In order to enhance feature representation, local attention is designed to explore key feature channels. Specifically, a channel-level global average pooling (GAP) is designed to aggregate convolutional features. The corresponding channel weights are then obtained through one-dimensional convolution and sigmoid function. Unlike the fully connected operation that captures the dependencies between all channels and shows high complexity, this step explores local cross-channel interactions and learns each attention in a local way, for example, only considering the k neighbors of each channel. Then, the channel attention is combined with the input features Finally, a 1×1 convolution is used to obtain the final output of the module:
[0087]
[0088] Among them, f conv1 is a 1×1 convolution, is a one-dimensional convolution with a kernel size of k, and σ represents a Sigmoid function. |*| odd represents the nearest odd number, C is channel.
[0089] Therefore, by utilizing the context-enhanced decoding module, the high-level saliency coding map and the texture feature maps at different levels are segmented by foreground and background labels to obtain the final automobile parts defect location result image.
[0090] Step 6: The training of the Transformer-based automobile parts defect detection model includes two types of losses, namely the edge loss function and the defect location supervision loss function. For the generation of defect location feature maps, the weighted cross entropy loss is used. and weighted IOU loss For edge supervision, we use Dice loss (L edge ) to handle the strong imbalance between positive and negative samples. Note that mask supervision is the three defect predictions (P i , i∈{2,3,4,5}). Therefore, the total loss is defined as:
[0091]
[0092] Among them, λ is a trade-off parameter and GT is the Ground Truth for defect prediction and positioning.
[0093] In this embodiment, forward and back propagation training are performed through two forms of supervision, so that the network learns powerful feature representations, reduces the influence of noise, blurred boundaries and metal artifacts, and performs defect detection on automotive parts images more effectively and accurately, so as to better generalize to more suitable automotive parts scenarios in the actual industry.
[0094] In addition, the present invention also provides a Transformer-based automobile parts defect detection system, comprising:
[0095] An image acquisition unit, used for acquiring a two-dimensional vehicle assembly image;
[0096] An image preprocessing unit is used to perform data processing on a two-dimensional automobile assembly image, including image denoising, contrast enhancement, image scaling, image rotation, and image horizontal and vertical mirror transformation to obtain a two-dimensional automobile parts image;
[0097] The feature encoding unit uses Vision Transformer as an encoder to extract spatial features and long-distance dependent features from the two-dimensional automobile parts image to obtain the encoding feature map of the automobile parts;
[0098] The salient edge prediction unit is used to input the fourth-level automobile parts coding feature map into the Sobel filter and the salient edge guidance module in sequence, perform feature enhancement and extraction on the defect area boundary information in the image, and obtain a high-level salient coding map; the salient edge guidance module is constructed based on the foreground map, background map and uncertain area map extracted from the salient boundary information feature map;
[0099] A texture enhancement evolution unit is used to extract and enhance texture features of automobile parts coding images at different levels by using a texture feature enhancement method, and generate texture feature images at different levels;
[0100] The image decoding generation unit is used to use the context-enhanced decoding module to perform foreground and background label segmentation on the high-level saliency coding map and the texture feature maps of different levels to obtain the final automobile parts defect positioning result image.
[0101] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.
Claims
1. A Transformer-based automobile parts defect detection method, characterized in that: The following steps are involved: Acquire a two-dimensional vehicle assembly image; Performing data processing on the two-dimensional automobile assembly image to obtain a two-dimensional automobile parts image; Data processing of 2D automotive parts images until they meet the training requirements based on deep learning; Using Vision Transformer as an encoder, we extract spatial features and long-distance dependency features from two-dimensional automotive parts images and obtain four-level automotive parts coding feature maps. The fourth-level automobile parts coding feature map is input into the Sobel filter to extract the salient boundary information feature map, and the salient boundary information feature map is input into the salient edge guidance module to enhance and extract the boundary information of the defective area in the image to obtain a high-level salient coding map; The texture feature enhancement method is used to extract and enhance the texture features of the four-level automobile parts coding feature maps to generate texture feature maps of different levels; The context-enhanced decoding module is used to perform foreground and background labeling segmentation on the high-level saliency coding map and texture feature maps of different levels, and the automobile parts defect location result image is obtained through the neural network training method.
2. The method for defect detection of automobile parts based on Transformer according to claim 1, characterized in that: The saliency edge guided module is constructed based on the foreground region, uncertain region, background image region and contextual attention blocks of the saliency boundary information feature map.
3. The method for defect detection of automobile parts based on Transformer according to claim 1, characterized in that: The data processing of the two-dimensional automobile assembly image includes: any one or more of image expansion, image erosion, median filtering, contrast enhancement, image scaling, image rotation, and image horizontal and vertical mirror transformation, so as to perform data enhancement and change processing on the two-dimensional automobile assembly image.
4. The method for defect detection of automobile parts based on Transformer according to claim 1, characterized in that: Using Vision Transformer as an encoder, we extract spatial features and long-distance dependency features from two-dimensional automotive parts images, and obtain four levels of automotive parts coding feature maps, including: The encoder based on Vision Transformer allows the model to focus on different parts of the two-dimensional automotive parts image and aggregate information across image blocks through multiple layers of self-attention mechanisms and feedforward neural networks; and processes image block embeddings in a hierarchical manner to capture local and global dependencies in the image, obtaining four levels of automotive parts encoding feature maps.
5. The method for defect detection of automobile parts based on Transformer according to claim 1, characterized in that: The fourth-level automobile parts coding feature map is input into the Sobel filter and the saliency edge guidance module, and the feature enhancement and extraction of the defect area boundary information in the image are performed to obtain a high-level saliency coding map. The steps include: Sobel filter is used to extract significant boundary information feature maps from the fourth-level automobile parts coding feature map; The boundary information feature map is used as the input of the saliency edge guidance module. By extracting its foreground map, uncertainty region map and background map, the context information in the boundary information feature map is used for implicit edge guidance, thereby extracting rich semantic features without additional explicit boundary information supervision and enhancing the uncertainty region in the defect segmentation results of automobile parts. The calculation method of the foreground image, background image and uncertainty area image is defined as follows: F f =max(F-0.5,0), F b =max(0.5-F,0), F u =0.5-abs(F-0.5) Among them, F is a significant boundary information feature map, F f 、F b and F u They represent the foreground image, background image and uncertain area image extracted based on the significant boundary information feature map, respectively. max() and abs() represent the maximum value and average value functions, respectively. The calculation method of the high-level saliency encoding map output by the saliency edge guidance module is defined as follows: F edge =That(F f ⊙F b ⊙F u ) Among them, ⊙ is the concatenation operation and Att is the contextual attention operation.
6. The method for defect detection of automobile parts based on Transformer according to claim 1, characterized in that: The texture enhancement method includes average max pooling and skip connection operations.
7. The method for defect detection of automobile parts based on Transformer according to claim 1, characterized in that: The four-level texture-enhanced feature maps and the high-level saliency coding map output by the saliency edge guidance module will be used as the input of the context-enhanced decoding module; The context-enhanced decoding module includes: a global average pooling submodule, a downsampling submodule, and a convolution operation submodule; The global average pooling submodule is used to reduce the number of parameters and reduce the risk of overfitting. The downsampling submodule is used to retain the main features and reduce the sensitivity to noise. The convolution operation submodule is used to extract edge and texture local features in texture enhancement feature maps and high-level saliency coding maps.
8. The method for defect detection of automobile parts based on Transformer according to claim 1, characterized in that: The neural network training method includes the following steps: Get training images; Build a training model to build a training model for automotive parts defect detection based on Transformer; The edge loss function is used for training until the edge loss function converges to obtain a neural network for defect detection of automotive parts; The high-level layer saliency coding map and texture feature map are used as training images and input into the automobile parts defect detection neural network to obtain the automobile parts defect location result image.
9. The method for defect detection of automobile parts based on Transformer according to claim 8, characterized in that: The marginal loss function is: Among them, Ipre(i) is the predicted map of the saliency edge guidance module in the network, and Igt(i) is the true boundary map.
10. A Transformer-based automobile parts defect detection system, characterized in that: include: An image acquisition unit, used for acquiring a two-dimensional vehicle assembly image; An image preprocessing unit, used for performing data processing on a two-dimensional automobile assembly image to obtain a two-dimensional automobile parts image; The feature encoding unit uses Vision Transformer as an encoder to extract spatial features and long-distance dependency features from the two-dimensional automobile parts image, and obtains a four-level automobile parts encoding feature map; The saliency edge prediction unit is used to process the fourth-level automobile parts coding feature map through the Sobel filter and input it into the saliency edge guidance module to enhance and extract the boundary information of the defect area in the image to obtain a high-level saliency coding map; A texture enhancement evolution unit is used to extract and enhance texture features of automobile parts coding images at different levels through a texture feature enhancement method, and generate texture feature images at different levels; The image decoding generation unit is used to perform foreground and background marking segmentation on the high-level saliency coding map and the texture feature maps of different levels to obtain an automobile parts defect positioning result image.
Citation Information
Patent Citations
Method for detecting abnormal state in long-distance pipeline based on different-spectrum data association analysis
CN118230059A
Plant treatment system with plant recognition
EP4165987A1
Cited By
Construction method and application of fault detection model for heating and ventilation system
CN119202751A
Building exterior wall defect detection method based on infrared polarization imaging
CN120431102A
Diode packaging defect X-ray image automatic interpretation system and method
CN120543502A
Low-illumination color fabric defect rapid detection method and system
CN121582261A
A low-illumination color fabric defect rapid detection method and system
CN121582261B
