Building material surface defect detection method based on infrared polarization imaging

By fusing the polarization, infrared and depth characteristics of building materials, and using self-attention mechanism and channel cellular operation to generate polarization-enhanced images of building materials, the problems of insufficient information utilization and insufficient detection capabilities in the prior art are solved, and higher accuracy and adaptability of building materials surface defect detection are achieved.

CN119559183AActive Publication Date: 2025-03-04CHINA STATE CONSTR INT ENG CO LTD

Patent Information

Application Number
CN202510128774.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-05
Publication Date
2025-03-04
Estimated Expiration
2045-02-05

AI Technical Summary

Technical Problem

The existing infrared polarization imaging technology has problems such as insufficient information utilization, insufficient detection capabilities of complex scenarios and lack of effective multimodal fusion strategies in the detection of surface defects of building materials.

Method used

By fusing the polarization characteristics, infrared characteristics and depth characteristics of building material images, using self-attention mechanism and channel cellular operation, a building material polarization enhancement image is generated, and spatial features are extracted through multi-layer convolution and pooling layers, and finally using the Softmax activation function to classify defect types.

Benefits of technology

Improve the accuracy and recognition ability of surface defect detection of building materials, enhance adaptability to complex and variable scenarios, especially when detecting tiny defects and complex surfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559183A_ABST
    Figure CN119559183A_ABST
Patent Text Reader

Abstract

The invention provides a building material surface defect detection method based on infrared polarization imaging, which belongs to the field of image processing, and constructs a building material surface defect detection model through input, image preprocessing, a feature extraction module, a feature fusion module, a building material polarization enhancement image module, a building material surface defect detection module and output. Information of a polarization image, an infrared image and a depth image is fused, more comprehensive feature representation is provided, the model has higher recognition capability on fine defects, a self-attention mechanism further optimizes the focusing effect of the features, interference of background noise is avoided, it is ensured that a defect area is fully recognized, and the recognition efficiency is improved. The method has better adaptability and performance in the field of defect detection, can cope with more complex and variable building material detection tasks, and particularly shows stronger advantages when detecting tiny defects and complex surfaces.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of image processing, and in particular relates to a method for detecting surface defects of building materials by infrared polarization imaging. Background Art

[0002] With the rapid development of the construction industry, the quality inspection of building materials has become an important means to ensure the safety and durability of building structures. Traditional methods for detecting surface defects of building materials mainly rely on manual visual inspection, ultrasonic detection, X-ray imaging and other technologies. Although these methods can detect surface defects such as cracks and corrosion to a certain extent, they have some inherent disadvantages, such as low efficiency of manual inspection, radiation risk of X-rays, and high requirements on material thickness for ultrasonic detection. Therefore, how to improve the efficiency, accuracy and safety of surface defect detection of building materials has always been a hot topic of research in industry and academia.

[0003] In recent years, with the development of imaging technology, infrared imaging technology has gradually become an effective means widely used in material defect detection due to its non-destructive and real-time characteristics. By capturing the infrared radiation on the surface of the object, it can provide a temperature distribution map of the material surface, thereby revealing abnormalities on the surface and inside of the object; polarization imaging technology, as an emerging imaging method, has received widespread attention in recent years. Polarization imaging can effectively provide additional information on surface details by capturing the polarization characteristics of light reflected from the surface of the object, especially on surfaces with high reflected light intensity or less texture. Polarization imaging can reveal defect characteristics that ordinary infrared imaging cannot capture. By analyzing data such as polarization angle and polarization degree, polarization imaging technology can reveal the geometric characteristics of the object surface, such as the location, shape and depth of defects such as cracks, corrosion and peeling.

[0004] However, existing polarization imaging technologies are mostly used in the visible light band and are often used separately from traditional infrared imaging technologies. Even in the field of infrared polarization imaging, traditional infrared polarization imaging methods mainly rely on the separate processing of polarization information or depth information, and cannot fully utilize the advantages of both for joint analysis. As a result, in the detection of surface defects in building materials, there are many challenges such as insufficient information utilization, insufficient detection capabilities in complex scenes, and lack of effective multimodal fusion strategies. Summary of the invention

[0005] The present invention provides a method for detecting surface defects of building materials by infrared polarization imaging, aiming to integrate polarization features, infrared features and depth features of building material images to enhance the surface detail information of the building material polarization images and improve the model's ability to identify building material defects, and comprises the following steps.

[0006] S1. Production of a dataset of building material surface defects. Use a polarization industrial camera with a depth sensor to shoot building materials with surface defects at different polarization angles to obtain polarization images, infrared images, and depth images of building materials, and annotate them. After annotation, a dataset of building material surface defects is obtained.

[0007] S2. Image preprocessing: introducing adaptive standard deviation and improving Gaussian filtering to preprocess the polarization image of building materials and generate polarization preprocessed images of building materials.

[0008] S3, feature extraction module, uses different convolution layers to extract features from the building material polarization preprocessed image, the building material infrared image and the building material depth image to obtain the building material polarization features, the building material infrared features and the building material depth features.

[0009] S4, feature fusion module, adds the polarization features and infrared features of building materials, and then splices them with the depth features of building materials. Use 1×1 convolution to reduce the dimension of the spliced ​​features to obtain the fusion features of building materials.

[0010] S5, building material polarization enhanced image module, uses the self-attention mechanism to process the building material fusion features and the building material polarization features to obtain the first-order building material fusion features, and the channel honeycomb operation generates the second-order building material fusion features. The first-order building material fusion features and the second-order building material fusion features are added together and then the number of channels is reduced through 1×1 convolution to obtain the building material polarization enhanced image.

[0011] S6, building material surface defect detection module, extracts the spatial features of the polarization-enhanced image of building materials through three 3×3 convolutional layers, reduces the size of the feature map through the pooling layer, flattens the pooled feature map into a vector, uses a fully connected layer for linear transformation, and uses the Softmax activation function to classify the types of building material defects.

[0012] S7. Construct a building material surface defect detection model, including input, image preprocessing, feature extraction module, feature fusion module, building material polarization enhanced image module, building material surface defect detection module and output.

[0013] S8. Training and testing of building material surface defect detection model. Use building material surface defect dataset to train the model. After the training is completed, obtain the surface image of the building material to be tested and input it into the building material surface defect detection model to obtain the classification result.

[0014] Preferably, in S1, a polarization industrial camera with a depth sensor is used to photograph building materials with surface defects at different polarization angles to obtain polarization images of the building materials. , infrared images of building materials and building material depth images , where H, W and 4 are the height, width and number of channels of the polarization image of building materials, H, W and 1 are the height, width and number of channels of the infrared image of building materials, and H, W and 4 are the height, width and number of channels of the depth image of building materials. They are annotated and the annotated defects are divided into five categories, including cracks, corrosion, peeling, holes and blistering. After the annotation is completed, the surface defect dataset of building materials is obtained.

[0015] Preferably, in S2, for the polarization image of the building material Preprocessing is performed, and adaptive standard deviation is introduced and applied to Gaussian filtering. The size and standard deviation of the filter kernel are adaptively adjusted according to the characteristics of the local area. For different channels in the polarization image of building materials, the standard deviation is adaptively adjusted according to the gradient information of each channel. , for each channel c, calculate the adaptive standard deviation: , Where x and y represent the height and width of the polarized image of the building material on channel c, respectively. To adjust the parameters and control the upper limit of the standard deviation, is the gradient of the polarization image of building materials at position (x, y, c). The image is convolved with a Gaussian filter kernel that introduces an adaptive standard deviation to generate a polarization preprocessed image of building materials. : , in is the pixel value of the building material polarization image at position (x,y,c), Polarization preprocessed image of building materials generated by Gaussian kernel , where H, W and 4 are the height, width and number of channels of the polarization preprocessed image of building materials.

[0016] Preferably, in S2, an adaptive standard deviation is introduced to dynamically adjust the standard deviation according to the gradient information of the image, which can ensure that a smaller standard deviation is used in areas with larger gradients to avoid blurred edges. Using a larger standard deviation in smooth areas can effectively remove noise, making the denoising process more intelligent and precise, while retaining key texture and edge information during denoising, which is particularly suitable for scenarios that need to retain details, such as surface defect detection of building materials.

[0017] Preferably, in S3, the process of extracting features from the polarization preprocessed image of building materials, the infrared image of building materials and the depth image of building materials is respectively: S31. Use 3×3 convolution to extract features from the polarization preprocessed image of building materials to obtain polarization features of building materials. ,in represents the maximum pooling, is the ReLU activation function, Represents 3×3 convolution, the polarization characteristics of building materials obtained ,in , and C represent the height, width, and number of channels of the polarization characteristics of the building materials, respectively; S32. Use 5×5 convolution to extract features from infrared images of building materials to obtain infrared features of building materials. ,in represents the maximum pooling, is the ReLU activation function, Represents 5×5 convolution, and the infrared features of building materials obtained ,in , and C represent the height, width, and number of channels of infrared features of building materials, respectively; S33. Use 5×5 convolution to extract features from the building material depth image to obtain the building material depth features. ,in represents the maximum pooling, is the ReLU activation function, Represents 5×5 convolution, the deep features of building materials obtained ,in , and C represent the height, width, and number of channels of the depth feature of the building material, respectively.

[0018] Preferably, in S3, the polarization preprocessed image of building materials shows tiny geometric changes on the surface. Using 3x3 convolution to extract features from the polarization preprocessed image of building materials can more accurately capture details in local areas, avoid over-smoothing or information loss in areas with rich details, and maintain high resolution of features. The infrared image of building materials and the depth image of building materials contain a wider range of scene information, involving larger-scale surface changes. The infrared image of building materials shows large-scale thermal changes on the surface through temperature distribution, while the depth image of building materials reflects the overall structure of the surface. Using 5x5 convolution to capture a wide range of features is helpful to detect larger-scale defects such as cracks and corrosion. At the same time, it can cover a larger receptive field, helping the network to understand the global structure and temperature distribution changes, and then model the overall morphology of surface defects of building materials.

[0019] Preferably, in S4, the polarization feature of the building material and the infrared feature of the building material are added, and then spliced ​​with the depth feature of the building material, and the dimensionality of the spliced ​​feature is reduced using 1×1 convolution to obtain the fusion feature of the building material ,in represents 1×1 convolution, Represents the splicing operation, generating the fusion features of building materials ,in , and C represent the height, width, and number of channels of the building material fusion feature, respectively.

[0020] Preferably, in S4, the information provided by the polarization characteristics of building materials and the infrared characteristics of building materials are highly complementary. The polarization characteristics of building materials help to reveal the geometric and reflective properties of the surface of building materials, while the infrared characteristics of building materials provide information on the surface temperature and thermal changes of building materials. The fusion of the two can provide richer surface information of building materials, which helps to better capture defects such as cracks and corrosion on the surfaces of complex building materials; the polarization characteristics of building materials and the infrared characteristics of building materials focus on providing the surface characteristics of building materials, and the depth characteristics of building materials focus on providing the geometric structure information of building materials. Splicing the added polarization characteristics of building materials and infrared characteristics of building materials into the depth characteristics of building materials can ensure that the characteristics of each mode are effectively retained, enhance the representation ability of the model, and avoid unnecessary feature redundancy.

[0021] Preferably, in S5, the building material polarization enhanced image module step includes: S51. Polarize building materials Integration of building materials Add them together, and then perform three different linear transformations through the fully connected layer to convert them into query vectors, key vectors, and value vectors. The specific process is as follows: , in represent the query vector, key vector and value vector of the added building material polarization features and building material fusion features respectively, Respectively represent the The learning weight matrix of S52, first-order building material fusion feature generation, query vector and key vector Concatenate and input to the fully connected layer for linear transformation. Use the tanh activation function to limit the output between -1 and 1, increase nonlinearity, and then add the value vector Multiply each channel by channel, and finally obtain the first-order building material fusion features through a fully connected layer. The specific process is as follows: , Among them, FC represents the fully connected layer, Concat represents the concatenation operation, and tanh represents the tanh activation function. Represents a channel-by-channel multiplication operation; S53, generate second-order building material fusion features through channel honeycomb operation, first add the building material polarization features and the building material fusion features, then perform linear transformation through a fully connected layer, and then extract the weight list through the global average pool, multiply the two sets of weights in the weight list with the building material polarization features and the building material fusion features respectively, and then add them channel by channel, and then multiply them with the value vectors of the added building material polarization features and building material fusion features channel by channel, and then pass through a fully connected layer to obtain the second-order building material fusion features. The specific process is: , , Where FC represents the fully connected layer, H and W represent the height and width of the feature map after linear transformation through the fully connected layer. are the weights corresponding to the polarization characteristics of building materials and the fusion characteristics of building materials in the weight list, Represents a channel-by-channel multiplication operation; S54, after adding the first-order building material fusion features and the second-order building material fusion features channel by channel, further process them through a 1×1 convolution to reduce the number of channels and map the feature map into a building material polarization enhanced image. ,in Represents a 1×1 convolution, enhanced polarization image of building materials , where H, W, and 4 represent the height, width, and number of channels of the polarization-enhanced image of building materials, respectively.

[0022] Preferably, in S5, the polarization features of building materials and the fusion features of building materials are spliced, and then the spliced ​​feature map is converted into queries, keys and values. The importance of different regions is dynamically adjusted through the subsequent attention mechanism, so that the network can strengthen its attention to the defect location according to the importance of the region; the tanh activation function is used to perform nonlinear transformation on the feature map, which increases the separability of the data and the model's learning ability for nonlinear features. The model can better handle the complex features after the fusion of polarization images with infrared images and depth images, and further enhance the significance of defective areas of building materials; through the self-attention mechanism, the model is helped to reduce background interference and focus on defective areas. The convolution operation is used to finally enhance the features, making the defect information more prominent, especially in the detection of tiny defects such as cracks and corrosion on the material surface. The enhanced polarization image can provide clearer surface details, and the generated building material polarization-enhanced image can be used as the input of the subsequent defect detection model to ensure the high accuracy and robustness of the detection results.

[0023] Preferably, in S6, the building material surface defect detection module process includes: S61, extract the spatial features of the polarization enhanced image of building materials through three 3×3 convolutional layers. The specific process is as follows: , , in is the ReLU activation function, BN means batch normalization, represents 3×3 convolution, Indicates The input of the convolutional layer, Indicates The output of the convolutional layer, The value range is 0, 1, 2; S62, reduce the size of the feature map through the pooling layer while retaining the most important spatial information, then flatten the pooled feature map into a vector, and use the fully connected layer for linear transformation. The specific process is: , in represents the maximum pooling operation, represents the flattening operation, FC is the fully connected layer; S63. Use the Softmax activation function to classify the types of building material defects and output the probability of each defect category. ,in represents the predicted probability of the type of building material defects, and softmax represents the softmax activation function; S64. Use the cross entropy loss function to measure the error between the category prediction and the true label. The cross entropy loss function formula is: ,in Indicates the actual building material defect type label, represents the probability of the building material defect category predicted by the model, and log represents the log function.

[0024] Preferably, in S6, convolution, ReLU and batch normalization can help extract features of the surface of building materials and enhance sensitivity to defective areas of building materials; pooling and flattening operations reduce the size of feature maps while retaining the most significant features for subsequent processing; this method can efficiently extract and fuse multimodal information, thereby improving the accuracy of building material surface defect detection.

[0025] Preferably, in S7, for the building material surface defect detection model, the building material polarization image, the building material infrared image, and the building material depth image are input into the model, and the building material polarization image is first preprocessed, and then the image enters the feature extraction module to extract features, and the feature fusion module to complete feature fusion, and then the image enters the building material polarization enhancement image module to generate the building material polarization enhancement image, and finally enters the building material surface defect detection module for processing to obtain the detection output result.

[0026] Compared with the prior art, the present invention has the following technical effects: the polarization image, infrared image and depth image information are integrated to provide a more comprehensive feature representation, the model has a stronger recognition ability for subtle defects, the self-attention mechanism further optimizes the focusing effect of the features, and enables the model to dynamically adjust the attention level of each area, avoiding the interference of background noise, and ensuring that the defective area is fully identified. The present invention has better adaptability and performance in the field of defect detection, and can cope with more complex and changeable building material detection tasks, especially showing stronger advantages when detecting tiny defects and complex surfaces. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 This is a flow chart of a method for detecting surface defects of building materials using infrared polarization imaging provided by the present invention.

[0028] Figure 2 This is a diagram of the image processing process of building materials using infrared polarization imaging provided by the present invention.

[0029] Figure 3 It is a structural diagram of the polarization-enhanced image module of building materials provided by the present invention.

[0030] Figure 4 It is a structural diagram of a building material surface defect detection module provided by the present invention.

[0031] Figure 5 A diagram showing the effect of detecting surface defects of building materials in an embodiment provided by the present invention. DETAILED DESCRIPTION

[0032] The following will be combined with the accompanying drawings of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0033] See also Figures 1 to 5 The present invention provides a method for detecting surface defects of building materials by infrared polarization imaging, which aims to integrate polarization features, infrared features and depth features of building material images to enhance the surface detail information of the building material polarization image and improve the model's ability to identify building material defects, and includes the following steps.

[0034] S1. Use a polarization industrial camera with a depth sensor to take photos of building materials with surface defects at four polarization angles: 0°, 45°, 90°, and 135°. A total of 3,000 images are taken to obtain polarization images of building materials. , infrared images of building materials and building material depth images , where 640, 640 and 4 are the height, width and number of channels of the polarization image of building materials, 640, 640 and 1 are the height, width and number of channels of the infrared image of building materials, and 640, 640 and 4 are the height, width and number of channels of the depth image of building materials. They are annotated and the annotated defects are divided into five categories, including cracks, corrosion, peeling, holes and blistering. After the annotation is completed, the surface defect dataset of building materials is obtained, and the training set and test set are divided into 7:3.

[0035] S2. Image preprocessing: introducing adaptive standard deviation and improving Gaussian filtering to preprocess the polarization image of building materials and generate polarization preprocessed images of building materials.

[0036] Furthermore, in S2, for the polarization image of building materials Preprocessing is performed, and adaptive standard deviation is introduced and applied to Gaussian filtering. The size and standard deviation of the filter kernel are adaptively adjusted according to the characteristics of the local area. For different channels in the polarization image of building materials, the standard deviation is adaptively adjusted according to the gradient information of each channel. , for each channel c, calculate the adaptive standard deviation: , Where x and y represent the height and width of the polarized image of the building material on channel c, respectively. To adjust the parameters, control the upper limit of the standard deviation, the value range is (0.5, 2), the smaller value is used to maintain finer image features, and the larger value is used for smoothing and denoising. In this embodiment, the value is 0.7. is the gradient of the polarization image of building materials at position (x, y, c). The image is convolved with a Gaussian filter kernel that introduces an adaptive standard deviation to generate a polarization preprocessed image of building materials. : , in is the pixel value of the building material polarization image at position (x,y,c), Polarization preprocessed image of building materials generated by Gaussian kernel , where 640, 640 and 4 are the height, width and number of channels of the polarization preprocessed image of building materials.

[0037] S3, feature extraction module, uses different convolution layers to extract features from the building material polarization preprocessed image, the building material infrared image and the building material depth image to obtain the building material polarization features, the building material infrared features and the building material depth features.

[0038] Furthermore, in S3, the process of extracting features from the polarization preprocessed image of building materials, the infrared image of building materials, and the depth image of building materials is as follows: S31. Use 3×3 convolution to extract features from the polarization preprocessed image of building materials to obtain polarization features of building materials. ,in represents the maximum pooling, is the ReLU activation function, Represents 3×3 convolution, the polarization characteristics of building materials obtained , where 320, 320, and 64 represent the height, width, and number of channels of the polarization characteristics of the building material, respectively; S32. Use 5×5 convolution to extract features from infrared images of building materials to obtain infrared features of building materials. ,in represents the maximum pooling, is the ReLU activation function, Represents 5×5 convolution, and the infrared features of building materials obtained , where 320, 320 and 64 represent the height, width and number of channels of infrared characteristics of building materials, respectively; S33. Use 5×5 convolution to extract features from the building material depth image to obtain the building material depth features. ,in represents the maximum pooling, is the ReLU activation function, Represents 5×5 convolution, the deep features of building materials obtained , where 320, 320, and 64 represent the height, width, and number of channels of the building material depth feature, respectively.

[0039] S4, feature fusion module, adds the polarization features and infrared features of building materials, and then splices them with the depth features of building materials. Use 1×1 convolution to reduce the dimension of the spliced ​​features to obtain the fusion features of building materials.

[0040] Furthermore, in S4, the polarization features of building materials and the infrared features of building materials are added, and then spliced ​​with the depth features of building materials. The 1×1 convolution is used to reduce the dimension of the spliced ​​features to obtain the fusion features of building materials. ,in represents 1×1 convolution, Represents the splicing operation, generating the fusion features of building materials , where 320, 320, and 64 represent the height, width, and number of channels of the building material fusion feature, respectively.

[0041] S5, building material polarization enhanced image module, uses the self-attention mechanism to process the building material fusion features and the building material polarization features to obtain the first-order building material fusion features, and the channel honeycomb operation generates the second-order building material fusion features. The first-order building material fusion features and the second-order building material fusion features are added together and then the number of channels is reduced through 1×1 convolution to obtain the building material polarization enhanced image.

[0042] Further, in S5, the building material polarization enhancement image module step includes: S51. Polarize building materials Integration of building materials Add them together, and then perform three different linear transformations through the fully connected layer to convert them into query vectors, key vectors, and value vectors. The specific process is as follows: , in represent the query vector, key vector and value vector of the added building material polarization features and building material fusion features respectively, Respectively represent the The learning weight matrix, It is learned adaptively during the training process and initialized using Xavier initialization. ,in represents a Gaussian distribution, and Respectively represent the dimensions of input and output, and are both set to 64 in this embodiment; S52, first-order building material fusion feature generation, query vector and key vector Concatenate and input to the fully connected layer for linear transformation. Use the tanh activation function to limit the output between -1 and 1, increase nonlinearity, and then add the value vector Multiply each channel by channel, and finally obtain the first-order building material fusion features through a fully connected layer. The specific process is as follows: , Among them, FC represents the fully connected layer, Concat represents the concatenation operation, and tanh represents the tanh activation function. Represents a channel-by-channel multiplication operation; S53, generate second-order building material fusion features through channel honeycomb operation, first add the building material polarization features and the building material fusion features, then perform linear transformation through a fully connected layer, and then extract the weight list through the global average pool, multiply the two sets of weights in the weight list with the building material polarization features and the building material fusion features respectively, and then add them channel by channel, and then multiply them with the value vectors of the added building material polarization features and building material fusion features channel by channel, and then pass through a fully connected layer to obtain the second-order building material fusion features. The specific process is: , , Where FC represents the fully connected layer, H and W represent the height and width of the feature map after linear transformation through the fully connected layer. are the weights corresponding to the polarization characteristics of building materials and the fusion characteristics of building materials in the weight list, Represents a channel-by-channel multiplication operation; S54, after adding the first-order building material fusion features and the second-order building material fusion features channel by channel, further process them through a 1×1 convolution to reduce the number of channels and map the feature map into a building material polarization enhanced image. ,in Represents a 1×1 convolution, enhanced polarization image of building materials , where 640, 640, and 4 represent the height, width, and number of channels of the polarization-enhanced image of building materials, respectively.

[0043] S6, building material surface defect detection module, three 3×3 convolutional layers extract the spatial features of the polarization enhanced image of building materials, reduce the size of the feature map through the pooling layer, and then flatten the pooled feature map into a vector, use the fully connected layer for linear transformation, and use the Softmax activation function to classify the types of building material defects.

[0044] Further, in S6, the building material surface defect detection module process includes: S61, extract the spatial features of the polarization enhanced image of building materials through three 3×3 convolutional layers. The specific process is as follows: , , in is the ReLU activation function, BN means batch normalization, represents 3×3 convolution, Indicates The input of the convolutional layer, Indicates The output of the convolutional layer, The value range is 0, 1, 2; S62, reduce the size of the feature map through the pooling layer while retaining the most important spatial information, then flatten the pooled feature map into a vector, and use the fully connected layer for linear transformation. The specific process is: , in represents the maximum pooling operation, represents the flattening operation, FC is the fully connected layer; S63. Use the Softmax activation function to classify the types of building material defects and output the probability of each defect category. ,in represents the predicted probability of the type of building material defects, and softmax represents the softmax activation function; S64. Use the cross entropy loss function to measure the error between the category prediction and the true label. The cross entropy loss function formula is: ,in Indicates the actual building material defect type label, represents the probability of the building material defect category predicted by the model, and log represents the log function.

[0045] S7. Construct a building material surface defect detection model, including input, image preprocessing, feature extraction module, feature fusion module, building material polarization enhanced image module, building material surface defect detection module and output.

[0046] Furthermore, in S7, for the building material surface defect detection model, the building material polarization image, the building material infrared image, and the building material depth image are input into the model, and the building material polarization image is first preprocessed, and then enters the feature extraction module to extract features, and the feature fusion module to complete feature fusion, and then enters the building material polarization enhancement image module to generate the building material polarization enhancement image, and finally enters the building material surface defect detection module for processing to obtain the detection output result.

[0047] S8. Training and testing of building material surface defect detection model. Use building material surface defect dataset to train the model. After the training is completed, obtain the surface image of the building material to be tested and input it into the building material surface defect detection model to obtain the classification result.

[0048] Furthermore, the building material surface defect detection model was coded using the Pycharm application and Python language, using the Pytorch framework. The model input was trained with polarization images of building materials with a resolution of 640×640×4, infrared images of building materials with a resolution of 640×640×1, and depth images of building materials with a resolution of 640×640×1. The model was trained for 300 epochs, of which 50 epochs were frozen.

[0049] 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 surface defects of building materials by infrared polarization imaging, characterized in that: The following steps are involved: S1, collect images of surface defects of building materials and construct a data set; S2, introduce adaptive standard deviation and improve Gaussian filtering to pre-process polarization images of building materials; S3, feature extraction module, uses convolutional layer to extract features; S4, feature fusion module, adds the polarization features of building materials and the infrared features of building materials, and then splices them with the depth features of building materials. After splicing, the convolution layer is used for dimensionality reduction; S5, building material polarization enhanced image module, uses self-attention mechanism to generate first-order building material fusion features, channel honeycomb operation to generate second-order building material fusion features, adds the first-order building material fusion features and the second-order building material fusion features, and then reduces the number of channels; S6, building material surface defect detection module, extracts the spatial features of the building material polarization enhanced image through the convolution layer, reduces the size and flattens it through the pooling layer, and obtains the type of building material defects after linear transformation using the fully connected layer; S7, constructing a building material surface defect detection model, including input, image preprocessing, feature extraction module, feature fusion module, building material polarization enhanced image module, building material surface defect detection module and output; S8. Training and testing of building material surface defect detection models.

2. The method for detecting surface defects of building materials by infrared polarization imaging according to claim 1, further characterized in that: In S2, for the polarization image of building materials Preprocessing is performed, and adaptive standard deviation is introduced and applied to Gaussian filtering. The size and standard deviation of the filter kernel are adaptively adjusted according to the characteristics of the local area. For different channels in the polarized image of building materials, according to the gradient information of each channel, for each channel c, the adaptive standard deviation calculation formula is: , Where x and y represent the height and width of the polarized image of the building material on channel c, respectively. To adjust the parameters and control the upper limit of the standard deviation, is the gradient of the polarization image of the building material at the position (x, y, c). The image is convolved using a Gaussian filter kernel with an adaptive standard deviation. The generation process of the polarization preprocessed image of the building material is: , in is the pixel value of the polarized image of the building material at position (x, y, c), Polarization preprocessed image of building materials generated by Gaussian kernel , where H, W and 4 are the height, width and number of channels of the polarization preprocessed image of building materials.

3. The method for detecting surface defects of building materials by infrared polarization imaging according to claim 2 is further characterized in that: In S3, the process of extracting features from the polarization preprocessed image of building materials, the infrared image of building materials and the depth image of building materials are respectively: S31. Use 3×3 convolution to extract features from the polarization preprocessed image of building materials to obtain polarization features of building materials. ,in represents the maximum pooling, is the ReLU activation function, Represents 3×3 convolution, the polarization characteristics of building materials obtained ,in , and C represent the height, width, and number of channels of the polarization characteristics of the building materials, respectively; S32. Use 5×5 convolution to extract features from infrared images of building materials to obtain infrared features of building materials. ,in represents the maximum pooling, is the ReLU activation function, Represents 5×5 convolution, and the infrared features of building materials obtained ,in , and C represent the height, width, and number of channels of infrared features of building materials, respectively; S33. Use 5×5 convolution to extract features from the building material depth image to obtain the building material depth features. ,in represents the maximum pooling, is the ReLU activation function, Represents 5×5 convolution, the deep features of building materials obtained ,in , and C represent the height, width, and number of channels of the depth feature of the building material, respectively.

4. The method for detecting surface defects of building materials by infrared polarization imaging according to claim 3 is further characterized in that: In S4, the polarization features of the building materials and the infrared features of the building materials are added, and then spliced ​​with the depth features of the building materials. The spliced ​​features are reduced in dimension using 1×1 convolution to obtain the fusion features of the building materials. ,in represents 1×1 convolution, Represents the splicing operation, generating the fusion features of building materials ,in , and C represent the height, width, and number of channels of the building material fusion feature, respectively.

5. The method for detecting surface defects of building materials by infrared polarization imaging according to claim 4 is further characterized in that: In said S5, said building material polarization enhancement image module step comprises: S51. Polarize building materials Integration of building materials Add them together, and then perform three different linear transformations through the fully connected layer to convert them into query vectors, key vectors, and value vectors. The specific process is as follows: , in represent the query vector, key vector and value vector of the added building material polarization features and building material fusion features respectively, Respectively represent the The learning weight matrix of S52, first-order building material fusion feature generation, query vector and key vector Concatenate and input to the fully connected layer for linear transformation. Use the tanh activation function to limit the output between -1 and 1 and then add it to the value vector Multiply each channel by channel, and finally obtain the first-order building material fusion features through a fully connected layer. The specific process is as follows: , Among them, FC represents the fully connected layer, Concat represents the concatenation operation, and tanh represents the tanh activation function. Represents a channel-by-channel multiplication operation; S53, generate second-order building material fusion features through channel honeycomb operation, first add the building material polarization features and the building material fusion features, then perform linear transformation through a fully connected layer, and then extract the weight list through the global average pool, multiply the two sets of weights in the weight list with the building material polarization features and the building material fusion features respectively, and then add them channel by channel, and then multiply them with the value vectors of the added building material polarization features and building material fusion features channel by channel, and then pass through a fully connected layer to obtain the second-order building material fusion features. The specific process is: , , Where FC represents the fully connected layer, H and W represent the height and width of the feature map after linear transformation through the fully connected layer. are the weights corresponding to the polarization characteristics of building materials and the fusion characteristics of building materials in the weight list, Represents a channel-by-channel multiplication operation; S54, after adding the first-order building material fusion features and the second-order building material fusion features channel by channel, further process them through a 1×1 convolution to reduce the number of channels and map the feature map into a building material polarization enhanced image. ,in Represents a 1×1 convolution, enhanced polarization image of building materials , where H, W, and 4 represent the height, width, and number of channels of the polarization-enhanced image of building materials, respectively.

6. The method for detecting surface defects of building materials by infrared polarization imaging according to claim 5, further characterized in that: In S6, the building material surface defect detection module comprises: S61, extract the spatial features of the polarization enhanced image of building materials through three 3×3 convolutional layers. The specific process is as follows: , , in is the ReLU activation function, BN means batch normalization, represents 3×3 convolution, Indicates The input of the convolutional layer, Indicates The output of the convolutional layer, The value range is 0, 1, 2; S62, reduce the size of the feature map through the pooling layer while retaining the most important spatial information, then flatten the pooled feature map into a vector, and use the fully connected layer for linear transformation. The specific process is: , in represents the maximum pooling operation, represents the flattening operation, FC is the fully connected layer; S63. Use the Softmax activation function to classify the types of building material defects and output the probability of each defect category. ,in represents the predicted probability of the type of building material defects, and softmax represents the softmax activation function; S64. Use the cross entropy loss function to measure the error between the category prediction and the true label. The cross entropy loss function formula is: ,in Indicates the actual building material defect type label, represents the probability of the building material defect category predicted by the model, and log represents the log function.

7. The method for detecting surface defects of building materials by infrared polarization imaging according to claim 6 is further characterized in that: In S7, for the building material surface defect detection model, the building material polarization image, the building material infrared image, and the building material depth image are input into the model, and the building material polarization image is first preprocessed, and then the image enters the feature extraction module to extract features, and the feature fusion module to complete feature fusion, and then the image enters the building material polarization enhancement image module to generate the building material polarization enhancement image, and finally enters the building material surface defect detection module for processing to obtain the detection output result.

Citation Information

Patent Citations

  • A bearing appearance defect detection system

    CN109255785A

  • Object surface pattern screening method based on artificial neural network

    CN112683923A

  • Circuit board surface defect detection method based on polarization prior

    CN114549391A

  • Image deep learning feature enhancement method, system and device

    CN114782830A

  • Surface defect data enhancement method and device, electronic equipment and storage medium

    CN115330803A

Cited By

  • Building exterior wall defect detection method based on infrared polarization imaging

    CN120431102A

  • Die cutting defect detection method and system

    CN120672726A

  • Surface defect detection method and system based on aluminum alloy for aerospace

    CN121298747A

  • Method and system for surface defect detection based on aerospace aluminum alloy

    CN121298747B

  • Architectural coating detection method based on infrared polarization imaging

    CN121861042A