A method for detecting defects on the surface of ALC wall panels

By introducing a simple attention conversion layer and an enhanced attention fusion module in the image defect detection method, the problems of high computational complexity and insufficient detection accuracy in the prior art are solved, and efficient and accurate detection of surface defects of ALC wall panels are achieved.

CN118691596BActive Publication Date: 2025-04-08深圳市宏源茂实业有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410925438.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2025-04-08
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

In practical applications, the existing image defect detection method based on ViT has problems such as high computational complexity, high hardware resource requirements, and insufficient detection accuracy during fine-grained defect detection, making it difficult to be applied to production environments with limited resources.

Method used

The simple attention conversion layer (MATL) and the enhanced attention fusion module (EAF) are introduced to reduce the computational complexity through simple self-attention operations, and to improve detection accuracy and efficiency through feature fusion technology.

Benefits of technology

It significantly reduces the computing resource requirements of the model, improves detection accuracy and efficiency, and can accurately identify subtle defects on the surface of ALC wall panels, enhancing the reliability and stability of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691596B_ABST
    Figure CN118691596B_ABST
Patent Text Reader

Abstract

The present invention provides an ALC wall panel surface image defect detection method, which belongs to the technical field of image processing. The present invention realizes the detection of ALC wall panel surface defects by introducing two efficient structural designs, namely a minimalist attention transfer layer (MATL) and an enhanced attention fusion module (EAF); the minimalist attention transfer layer (MATL) simplifies the self-attention operation, reduces the calculation complexity, and maintains the efficient extraction of image features; the enhanced attention fusion module (EAF) realizes the efficient fusion of features through the feature fusion technology, further improves the detection accuracy and efficiency, and realizes the detection and positioning of the surface defects of the ALC wall panel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image processing, and in particular relates to a method for detecting surface image defects of an ALC wallboard. Background Art

[0002] With the continuous development of industrial automation and intelligent manufacturing, image defect detection technology is being used more and more widely in production quality control. Among the existing image defect detection methods, the method based on vision transformer (ViT) has attracted much attention due to its excellent performance in image classification, target detection and other tasks; however, ViT also has some problems and limitations in practical applications. First, the ViT model requires a large amount of labeled data for training to obtain better detection accuracy. In the actual production process, obtaining a large amount of high-quality labeled data often requires a lot of manpower and time costs. Secondly, the ViT model has high computational complexity and high requirements on hardware resources, and is not suitable for production environments with limited resources; in addition, the ViT model is prone to insufficient detection accuracy when dealing with fine-grained defect detection tasks.

[0003] As a new type of building material, ALC wallboard is widely used in building interior and exterior wall decoration due to its excellent fire resistance, moisture resistance, and corrosion resistance. However, during the production and construction process, ALC wallboards are prone to defects such as cracking of board seams and bubbling of walls. These defects not only affect the aesthetics of the wallboard, but may also affect the safety of the building structure. Therefore, developing an efficient and accurate ALC wallboard surface image defect detection method is of great significance to improving the production quality and use safety of ALC wallboards. Summary of the invention

[0004] The present invention provides an ALC wall panel surface image defect detection method, which aims to improve the accuracy and efficiency of wall panel defect detection. By introducing an efficient structural design, including a minimalist attention transfer layer (MATL) and an enhanced attention fusion module (EAF), accurate detection of ALC wall panel surface defects is achieved; the minimalist attention transfer layer (MATL) introduces a simple self-attention operation, which reduces the computational complexity while maintaining efficient extraction of image features; the enhanced attention fusion module (EAF) achieves efficient fusion of features through feature fusion technology, further improving detection accuracy and efficiency.

[0005] The present invention aims to propose an ALC wall panel surface image defect detection model and provide an ALC wall panel surface image defect detection method, which includes the following steps.

[0006] S1. ALC wall panel surface image dataset is prepared. ALC wall panel surface defect images are collected and each defect image is annotated. The annotation target is the defect area on the surface of the ALC wall panel. After the annotation is completed, the ALC wall panel defect surface image dataset is obtained.

[0007] S2. Construct a multi-head self-attention layer MHSA, including multi-head self-attention operations.

[0008] S3. Construct a feed-forward network FFN, including deep convolution, RELU activation function, point convolution and 3×3 convolution.

[0009] S4. Construct a minimalist attention conversion layer MATL, input image features into the minimalist attention conversion layer, perform minimalist self-attention operations on the image features, and reduce the computational requirements of the model.

[0010] S5. Construct a sparse attention enhancement layer SAAL, including a multi-head self-attention layer MHSA, a feedforward network FFN and a minimalistic attention transformation layer MATL.

[0011] S6. Construct the enhanced attention fusion module EAF, including 1×1 convolution, depth convolution and feature matrix scaling operations to achieve feature fusion.

[0012] S7. Build an ALC wall panel surface image defect detection model, including input, image embedding, sparse attention enhancement layer SAAL, enhanced attention fusion module EAF, fully connected layer, and output. Image embedding is achieved by 3×3 convolution.

[0013] S8. Train the ALC wall panel surface image defect detection model. Use the ALC wall panel surface image dataset to train the defect detection model. After the training is completed, shoot the ALC wall panel surface in real time, extract frames from the shot video and input them into the defect detection model. If there are surface defects in the image, the detection model will identify the defects and mark them with a rectangular frame.

[0014] Preferably, in step S1, the surface defects of the ALC wall panels include cracking of panel seams and bubbling of the wall surface.

[0015] Preferably, in step S2, for the multi-head self-attention layer MHSA, the input ALC wallboard image features are , , , and are the height, width and number of channels of the input features respectively, and the input feature sequence use , and Perform a linear transformation to generate , and , , , , , and is the weight matrix learned from the ALC wall panel image features, and then calculates the query vector and key vector The dot product of To scale: , where d is The dimension is then used to calculate the attention matrix Pair value vector Perform a weighted sum: , is the activation function, It is the output of the multi-head self-attention layer MHSA.

[0016] Preferably, in step S2, for the multi-head self-attention layer MHSA, a self-attention operation is performed on the input image features to obtain the global dependency between the image sequences, and the global dependency is provided to the simplified attention transformation layer MATL to obtain a low-complexity attention matrix.

[0017] Preferably, in step S3, for the feed-forward network FFN, including deep convolution, RELU activation function, point convolution and 3×3 convolution, the input ALC wallboard image feature is , , , and The height, width and number of channels of the input features are respectively, and the input features are subjected to depth convolution and ReLU activation function: , is the activation function, is the depthwise convolution, It is an intermediate variable used to store the results, and then the features are further processed using point convolution and RELU activation function: , It is a point convolution, and finally the output features are generated by 3×3 convolution: , is a 3×3 convolution, is the output of the feed-forward network FFN.

[0018] Preferably, in step S3, this module implements efficient feature extraction through deep convolution (DWConv) and point convolution (PWConv); first, the input features are processed through a deep convolution layer, which uses a RELU activation function to effectively capture the nonlinear relationship in the input ALC wall panel image features, and then further processed through a point convolution layer, which also uses a RELU activation function to enhance the extraction capability of nonlinear features, and finally, a 3x3 convolution layer is used to generate the final output features; the combination of deep convolution and point convolution makes feature extraction more refined while maintaining high computational efficiency.

[0019] Preferably, in step S4, for the minimalist attention conversion layer MATL, the image features are input to the minimalist attention conversion layer, and a minimalist self-attention operation is performed on the image features. The minimalist self-attention operation includes: the input ALC wallboard image features are , , , and The height, width and number of channels of the input features are respectively transformed linearly to generate a new low-complexity attention matrix: ,in, and They are all linear transformation operations. is the matrix transpose operation, is an intermediate variable used to store the results, and then use the new attention matrix Input to the Minimalist Attention Transformation Layer (MATL) Perform weighted summation to obtain : , is the output of the minimalistic attention conversion layer MATL, is the activation function.

[0020] Preferably, in step S4, the simplified attention conversion layer performs a simplified self-attention operation on the input image features, generates a new low-complexity attention matrix using linear transformation, and performs weighted summation on the features through the Softmax function, and outputs enhanced features, which can effectively capture global context information and improve feature representation capabilities. It can effectively capture the global context information of the input image, so that the model can pay more attention to key areas when processing image features, thereby improving the accuracy and discrimination of feature representation.

[0021] Preferably, in step S5, for the sparse attention enhancement layer SAAL, including the multi-head self-attention layer MHSA, the feed-forward network FFN and the minimalistic attention transformation layer MATL, the input ALC wallboard image feature is , , , and are the height, width and number of channels of the input features respectively, , is the output of the sparse attention enhancement layer SAAL, is a simple attention transfer layer. is a feed-forward network, For multi-head self-attention.

[0022] Preferably, in step S5, multi-head self-attention (MHSA) and feedforward network (FFN) are used to extract and enhance important information in the input features. The input features first pass through the multi-head self-attention mechanism to extract global context information, and then undergo nonlinear transformation through the feedforward network. Finally, the features are weighted synthesized through the sparse attention transformation layer (MATL), which can more effectively capture the key information in the input features and improve the attention allocation and feature expression capabilities of the model.

[0023] Preferably, in step S6, for the enhanced attention fusion module EAF, including 1×1 convolution, depth convolution and feature matrix scaling operations, the input ALC wallboard image features are , , , and are the height, width, and number of channels of the input features, respectively. The input features are processed using deep convolution to capture spatial dependencies, and then processed using 1×1 convolution to obtain , , is a 1×1 convolution, is the depthwise convolution, is a normalization operation, and then the feature matrix is ​​scaled using the scaling factor β Scaling is performed, and the β value is 0.5. , is the scaled image feature, and the attention matrix of the current stage Added to the scaled image features to form the final attention matrix: , To enhance the output of the attention fusion module EAF.

[0024] Preferably, in step S6, for the enhanced attention fusion module EAF, the feature extraction capability of the deep convolutional neural network is improved, which helps to capture the global and local information of the image, thereby improving the recognition accuracy of the model; the fixed scale scaling method (FixedScale) is used to optimize the attention mechanism, enhance the model's sensitivity and expression ability to features of different scales, and ultimately improve the overall performance.

[0025] Compared with the prior art, the present invention has the following technical effects:

[0026] The present invention significantly reduces the computational complexity and simplifies the self-attention operation by introducing the Minimalist Attention Transfer Layer (MATL), while maintaining efficient image feature extraction capabilities; this innovative design effectively reduces the model's computational resource requirements, making it more suitable for practical application scenarios. Secondly, the use of the Enhanced Attention Fusion Module (EAF) achieves efficient feature fusion through feature fusion technology. This module can better combine multiple feature information, so that the model can still maintain high robustness when facing complex backgrounds and diverse defects; in addition, when processing ALC wall panel surface defects, the method of the present invention can accurately identify subtle defects such as cracks in panel seams and bubbling on the wall, significantly improving the reliability and stability of detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of ALC wall panel surface image defect detection provided by the present invention.

[0028] Figure 2 It is a schematic diagram of the feed-forward network FFN provided by the present invention.

[0029] Figure 3 It is a schematic diagram of the sparse attention enhancement layer SAAL provided by the present invention.

[0030] Figure 4 It is a schematic diagram of the enhanced attention fusion module EAF provided by the present invention.

[0031] Figure 5 This is an ALC wall panel surface image defect detection effect diagram provided by the present invention. DETAILED DESCRIPTION

[0032] This paper aims to construct a method for detecting surface defects of ALC wall panels. By introducing a sparse attention enhancement layer (SAAL), using a multi-head self-attention layer (MHSA), a feed-forward network (FFN) and a minimalistic attention transformation layer (MATL), the computational complexity is significantly reduced while maintaining efficient image feature extraction capabilities. The enhanced attention fusion module (EAF) combines 1×1 convolution, deep convolution and feature matrix scaling operations. Through efficient feature fusion technology, the ALC wall panel surface defect detection model can still maintain high robustness when facing complex backgrounds and diverse defects.

[0033] See also Figure 1 As shown, a method for detecting surface image defects of an ALC wall panel in an embodiment of the present application has the following process.

[0034] S1. ALC wall panel surface image dataset is prepared. ALC wall panel surface defect images are collected and each defect image is annotated. The annotation target is the defect area on the surface of the ALC wall panel. After the annotation is completed, the ALC wall panel defect surface image dataset is obtained, which is divided into training set and validation set in a ratio of 7 to 3.

[0035] Furthermore, in step S1, for the surface defects of ALC wall panels, including cracking of panel seams and bubbling of wall surfaces, the defect images were annotated using the annotation software labelImg. The resulting dataset size was 5,000 images, and the dataset was divided into a training set and a validation set in a ratio of 7:3.

[0036] S2. Construct a multi-head self-attention layer MHSA, including multi-head self-attention operations.

[0037] Furthermore, in step S2, for the multi-head self-attention layer MHSA, the input feature is , , 320, 320 and 32 are the height, width and number of channels of the input feature respectively. Use linear transformation to generate , and , , , , , and is the learned weight matrix, calculating the query vector and key vector The dot product of To scale: , using the attention matrix Pair value vector Perform a weighted sum: , is the activation function, It is the output of the multi-head self-attention layer MHSA.

[0038] S3. Construct a feed-forward network FFN, including deep convolution, RELU activation function, point convolution and 3×3 convolution.

[0039] Furthermore, in step S3, for the feedforward network FFN, its structure is as follows Figure 2 As shown, it includes deep convolution, RELU activation function, point convolution and 3×3 convolution, and the input feature is , , 320, 320 and 32 are the height, width and number of channels of the input features respectively, and the input features are subjected to depth convolution and ReLU activation: , is the activation function, is the depthwise convolution, is an intermediate variable used to store the results, and then point convolution is used to further process the features: , It is a point convolution, and finally the output features are generated by 3×3 convolution: , is a 3×3 convolution, is the output of the feed-forward network FFN.

[0040] S4. Construct a minimalist attention conversion layer MATL, input image features into the minimalist attention conversion layer, and perform minimalist self-attention operations on the image features.

[0041] Furthermore, in step S4, for the minimalist attention conversion layer MATL, the image features are input to the minimalist attention conversion layer, and a minimalist self-attention operation is performed on the image features. The minimalist self-attention operation includes: the input features are , , 320, 320 and 32 are the height, width and number of channels of the input features respectively. The input feature sequence is linearly transformed to generate a new attention matrix: ,in, and They are all linear transformation operations. is the matrix transpose operation, is an intermediate variable used to store the results, and then use the new attention matrix Input to the Minimalist Attention Transformation Layer (MATL) Perform a weighted sum: , is the output of the minimalistic attention conversion layer MATL, is the activation function.

[0042] S5. Construct a sparse attention enhancement layer SAAL, including a multi-head self-attention layer MHSA, a feedforward network FFN and a minimalistic attention transformation layer MATL.

[0043] Furthermore, in step S5, for the sparse attention enhancement layer SAAL, its structure is as follows Figure 3 As shown, it includes a multi-head self-attention layer MHSA, a feedforward network FFN and a simplified attention conversion layer MATL. The input features are , , 320, 320 and 32 are the height, width and number of channels of the input features respectively, , is the output of the sparse attention enhancement layer SAAL, is a simple attention transfer layer, is a feed-forward network, For multi-head self-attention.

[0044] S6. Construct the enhanced attention fusion module EAF, including 1×1 convolution, depth convolution and feature matrix scaling operations.

[0045] Furthermore, in step S6, for the enhanced attention fusion module EAF, its structure is as follows Figure 4 As shown, it includes 1×1 convolution, depth convolution and feature matrix scaling operations, and the input features are , , 320, 320 and 32 are the height, width and number of channels of the input features respectively. The input features are processed using deep convolution to capture spatial dependencies and then processed using 1×1 convolution to obtain , , is a 1×1 convolution, is the depthwise convolution, is a normalization operation, and then the feature matrix is ​​scaled using the scaling factor β Scaling is performed, and the β value is 0.5. , is the scaled image feature, and the attention matrix of the current stage Added to the scaled image features to form the final attention matrix: , To enhance the output of the attention fusion module EAF.

[0046] S7. Build an ALC wall panel surface image defect detection model, including input, image embedding, sparse attention enhancement layer SAAL, enhanced attention fusion module EAF, fully connected layer, and output. Image embedding is achieved by 3×3 convolution.

[0047] Further, in step S7, for the ALC wall panel surface image defect detection model, including input, image embedding, sparse attention enhancement layer SAAL, enhanced attention fusion module EAF, fully connected layer, output, image embedding is achieved by 3×3 convolution; the input image is , , and then image embedding is performed, which includes a 3×3 convolution to obtain , , trained using the ALC wall panel surface image dataset.

[0048] S8. Train the ALC wall panel surface image defect detection model. Use the ALC wall panel surface image dataset to train the defect detection model. After the training is completed, shoot the ALC wall panel surface in real time, extract frames from the shot video and input them into the defect detection model. If there are surface defects in the image, the detection model will identify the defects and mark them with a rectangular frame.

[0049] Furthermore, in step S8, the ALC wall panel surface image defect detection model is trained. The code is written using the Pycharm application and Python language. The code is improved based on the Uniformer algorithm framework. The model is trained using the Pytorch framework and the ALC wall panel defect image with an input resolution of 640×640×3. The model is trained from scratch for 300 epochs and optimized using the AdamW optimizer. The learning rate is set to 0.001 and the batchsize is set to 64.

[0050] Furthermore, in step S8, the ALC wall panel surface image defect detection effect is as follows: Figure 5 As shown, Figure 5 The upper left part shows the defect detection box and the detection confidence level of 0.90. Figure 5 It can be seen that for the ALC wallboard surface image defects, the wallboard defects can be successfully detected using the defect detection model, and are not affected by factors such as the interval depressions and normal textures in Figure 5.

[0051] The above are only preferred embodiments of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.

Claims

1. A method for detecting defects on the surface of an ALC wallboard, characterized in that: The following steps are involved: S1. ALC wallboard surface image dataset is prepared. ALC wallboard surface defect images are collected and each defect image is annotated. The annotated target is the defect area on the surface of the ALC wallboard. After the annotation is completed, the ALC wallboard defect surface image dataset is obtained. S2, construct a multi-head self-attention layer MHSA, including multi-head self-attention operations; S21. For the multi-head self-attention layer MHSA, the input ALC wall panel image feature is F MHSAIN , F MHSAIN ∈R H×W×C , H, W and C are the height, width and number of channels of the input features respectively, and W is used for the input feature sequence F Q , W K and W V Perform linear transformation to generate Q, K and V, Q = FW Q , K=FW K , V=FW V , W Q , W K and W V is the weight matrix learned from the ALC wallboard image features, and then calculates the dot product of the query vector Q and the key vector K and scales it by the factor To scale: Where d is the dimension of K, and then the attention matrix A is used to perform a weighted summation on the value vector V: F MHSAOUT =Softmax(A)V, Softmax is the activation function, F MHSAOUT is the output of the multi-head self-attention layer MHSA; S3. Construct a feed-forward network FFN, including deep convolution, RELU activation function, point convolution and 3×3 convolution; S4. Construct a minimalist attention conversion layer MATL, input image features into the minimalist attention conversion layer, and perform minimalist self-attention operations on the image features; S5. Construct the sparse attention enhancement layer SAAL, including the multi-head self-attention layer MHSA, the feed-forward network FFN and the minimalistic attention transformation layer MATL; S6. Construct the enhanced attention fusion module EAF, including 1×1 convolution, depth convolution and feature matrix scaling operations; S7. Build an ALC wall panel surface image defect detection model, including input, image embedding, sparse attention enhancement layer SAAL, enhanced attention fusion module EAF, fully connected layer, and output. Image embedding is achieved by 3×3 convolution. S8. Train the ALC wall panel surface image defect detection model. Use the ALC wall panel surface image dataset to train the defect detection model. After the training is completed, shoot the ALC wall panel surface in real time, extract frames from the shot video and input them into the defect detection model. If there are surface defects in the image, the detection model will identify the defects and mark them with a rectangular frame.

2. The ALC wallboard surface image defect detection method according to claim 1, characterized in that: In step S1, the surface defects of ALC wall panels include cracking of panel seams and bubbling of wall surfaces.

3. The ALC wallboard surface image defect detection method according to claim 1, characterized in that: In step S3, for the feed-forward network FFN, including deep convolution, RELU activation function, point convolution and 3×3 convolution, the input ALC wall panel image feature is F FFNIN , F FFNIN ∈R H×W×C , H, W and C are the height, width and number of channels of the input features respectively, and the input features are subjected to depth convolution and ReLU activation: X = RELU (DWConv (F FFNIN )), RELU is the activation function, DWConv is the depth convolution, X is the intermediate variable used to store the result, and then the feature is further processed using point convolution: X = RELU (PWConv (X)), PWConv is the point convolution, and finally the output feature is generated through 3 × 3 convolution: F FFNOUT =Conv 3×3 (H), Conv 3×3 is a 3×3 convolution, F FFNOUT is the output of the feed-forward network FFN.

4. The ALC wallboard surface image defect detection method according to claim 3, characterized in that: In step S4, for the minimalist attention conversion layer MATL, the ALC wall panel image features are input to the minimalist attention conversion layer, and the image features are subjected to a minimalist self-attention operation. The minimalist self-attention operation includes: the input feature is FM ATLIN , F MATLIN ∈R H×W×C , H, W and C are the height, width and number of channels of the input features respectively. The input feature sequence is linearly transformed to generate a new attention matrix: A′=Linear2((Linear1(F MATLIN )) T ) T , where Linear1 and Linear2 are both linear transformation operations, T is a matrix transpose operation, A′ is an intermediate variable used to store the result, and then the new attention matrix A′ is used to convert the input F of the simplified attention conversion layer MATL MATLIN Perform weighted sum: F MATLOUT =Softmax(A′)F MATLIN , F MATLOUT is the output of the simplified attention conversion layer MATL, and Softmax is the activation function.

5. The method for detecting surface image defects of ALC wallboard according to claim 4, characterized in that: In step S5, for the sparse attention enhancement layer SAAL, including the multi-head self-attention layer MHSA, the feed-forward network FFN and the minimalistic attention transformation layer MATL, the input ALC wallboard image feature is F SAALIN , F SAALIN ∈R H×W×C , H, W and C are the height, width and number of channels of the input features respectively, F SAALOUT =MATL(FFN(MHSA(F SAALIN )))+F SAALIN , F SAALOUT is the output of the sparse attention enhancement layer SAAL, MATL is the minimalistic attention transfer layer, FFN is the feedforward network, and MHSA is the multi-head self-attention.

6. The ALC wallboard surface image defect detection method according to claim 1, characterized in that: In step S6, for the enhanced attention fusion module EAF, including 1×1 convolution, depth convolution and feature matrix scaling operations, the input ALC wallboard image feature is F EAFIN , F EAFIN ∈R H×W×C , H, W and C are the height, width and number of channels of the input features respectively. The input features are processed using deep convolution to capture spatial dependencies, and then processed using 1×1 convolution to obtain A″, A″=Conv 1×1 (Norm(DWConv(F EAFIN ))), Conv 1×1 is a 1×1 convolution, DWConv is a deep convolution, Norm is a normalization operation, and then the feature matrix A″ is scaled using the scaling factor β, β is set to 0.5, FixedScale(A″)=βA″, FixedScale is the scaled image feature, and the current stage attention matrix A″ is added to the scaled image feature to form the final attention matrix: F EAFOUT =A″+FixedScale(A″), F EAFOUT To enhance the output of the attention fusion module EAF.

Citation Information

Patent Citations

  • Image processing method and device based on random walk kernel self-attention mechanism

    CN115760871A

  • Chip surface defect detection method of compressed multi-head self-attention neural network

    CN117474863A