A method and system for detecting the corrosion ratio of an enclosure structure
The improved DeepLabV3+ network with CBAM attention mechanism enables rapid and accurate rust proportion assessment in building enclosures, addressing the inefficiencies and subjectivity of traditional methods.
Patent Information
- Application Number
- CN202410961765.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-07-18
AI Technical Summary
The prior art is difficult to quickly and accurately detect the corrosion ratio of the enclosure structure, which makes it time-consuming and labor-intensive to detect and subjective judgments prone to occur.
The improved DeepLabV3+ network structure is adopted, combined with the channel attention module CAM and the spatial attention module SAM, and the corrosion feature marking of the enclosure structure image through a semantic segmentation network, and the pixel count ratio of the corrosion and the enclosure structure are counted to realize automated detection.
It achieves rapid and accurate acquisition of the corrosion ratio of the enclosure structure, reduces the time and subjective errors of manual inspection, and provides a basis for scientific decision-making.
Smart Images

Figure CN118822999B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of maintenance structure corrosion, and in particular relates to a method and system for detecting the corrosion ratio of a building envelope structure. Background Art
[0002] The building envelope structure is an important part of a construction project and is a structure used to reinforce and protect a building. Materials such as profiled metal sheets are commonly used in the building envelope structure. The building envelope structure is exposed to the outdoors for a long time, and corrosion damage is a common damage form in the building envelope structure. The corrosion damage of the building envelope structure may cause various problems. First, corrosion can cause spots, oxides, and corrosion pits on the surface of the metal material, destroying the appearance aesthetics. Second, corrosion weakens the strength and structural stability of the metal material, leading to a decrease in the strength of the structure and an increased risk of failure. In addition, corrosion may also cause problems such as water leakage, cracks, and structural deformation, further affecting the function and durability of the building envelope structure.
[0003] Detecting the corrosion and the degree of corrosion of an existing building envelope structure is crucial for ensuring the safety and reliability of the structure. The currently commonly used method is visual inspection, which is one of the simplest and most commonly used methods. By carefully observing the metal material on the surface of the building envelope structure, any visible signs of corrosion are searched for, such as color changes, spots, oxides, and corrosion pits, etc. Visual inspection can detect obvious corrosion damage, but may not be able to detect problems hidden inside the structure or difficult to observe. Summary of the Invention
[0004] The main problem to be solved by the present invention is how to quickly detect the corrosion ratio of a building envelope structure, and a method and system for detecting the corrosion ratio of a building envelope structure are provided.
[0005] To solve the above technical problems, the technical solution adopted is:
[0006] A method for detecting the corrosion ratio of a building envelope structure, comprising the following steps:
[0007] Step 1: Obtain an image of the building envelope structure and splice it into a complete image of the building envelope structure;
[0008] Step 2: Input the spliced image of the building envelope structure into a trained semantic segmentation network model to obtain a corrosion feature part marked by a multi-segment line enclosing area in one color and a building envelope structure part marked by a multi-segment line enclosing area in another color in the image;
[0009] Step 3: Count the number of pixel points of the corrosion feature part of the area enclosed by one or more multi-segment lines marked in the same color and the number of pixel points of the building envelope structure part of the area enclosed by the multi-segment line marked in another color;
[0010] Step 4: Calculate the ratio of the number of pixels in the corroded feature part to the number of pixels in the enclosure structure part to obtain the corrosion ratio of the enclosure structure and output it.
[0011] Further, the semantic segmentation network model is an improved DeepLabV3+ network structure.
[0012] Further, the improved DeepLabV3+ network structure means adding an attention mechanism after the dilated convolutional layer in the DeepLabV3+ network structure.
[0013] Further, the attention mechanism includes a channel attention module CAM and a spatial attention module SAM to perform attention on channels and space respectively.
[0014] Further, the training method of the improved DeepLabV3+ network structure is as follows:
[0015] 1) Obtain a certain number of datasets of corroded enclosure structures;
[0016] 2) Perform data augmentation on the images in the dataset respectively;
[0017] 3) Use the semantic segmentation feature annotation software labelme to annotate the corroded parts in the image with a multi-segment line enclosed area of one color, and annotate the features of the target enclosure structure with a multi-segment line enclosed area of another color;
[0018] 4) Use the image set after feature annotation to train the semantic segmentation network model.
[0019] Further, the method of data augmentation is to compile a data augmentation algorithm using the Python language.
[0020] Further, the method of stitching is to use the SIFT image stitching algorithm.
[0021] Further, the method of counting pixels refers to using Python programming to count the pixels in the area enclosed by the multi-segment line of the same color in the image after feature annotation.
[0022] The present invention also provides an enclosure structure corrosion ratio detection system, which uses each step of the above-mentioned enclosure structure corrosion ratio detection method.
[0023] Adopting the above technical solutions, the present invention has the following beneficial effects:
[0024] A method and system for detecting the corrosion ratio of an enclosure structure provided by the present invention label the area enclosed by a multi-segment line of one color for the enclosure structure, and label the corroded part in the enclosure structure with a multi-segment line of another color. Then, the number of pixel points in the areas enclosed by these two colors of multi-segment lines is respectively counted, and further the ratio of the corroded part in the overall enclosure structure is obtained. Using the method of the present invention, the corrosion ratio can be given more quickly, so as to understand the condition of the enclosure structure, and then make a decision on whether to replace it, solving the problems of time-consuming and laborious when using the manual method for detection and being prone to subjective judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a flowchart of the system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0026] The technical solutions of the present invention will be described clearly and completely below with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0027] Figure 1 A specific embodiment of a method for detecting the corrosion ratio of an enclosure structure according to the present invention is shown, including the following steps:
[0028] Step 1: Obtain an image of the enclosure structure and splice it into a complete image of the enclosure structure.
[0029] In this embodiment, after obtaining the image of the enclosure structure in Step 1, the obtained image of the enclosure structure needs to be spliced into a complete enclosure structure. Only for a complete enclosure structure can its corrosion ratio be solved. The splicing method is to use the SIFT image splicing algorithm. Moreover, when obtaining the image of the enclosure structure, it is recommended to take pictures from different angles. This can capture the corrosion conditions of different parts and provide a more comprehensive perspective.
[0030] Step 2: Input the spliced image of the enclosure structure into a trained semantic segmentation network model to obtain the corroded feature part labeled with an area enclosed by a multi-segment line of one color and the enclosure structure part labeled with an area enclosed by a multi-segment line of another color in the image.
[0031] In this embodiment, the semantic segmentation network model is an improved DeepLabV3+ network structure. The improved DeepLabV3+ network structure means that an attention mechanism is added after the dilated convolutional layer in the DeepLabV3+ network structure. The attention mechanism includes two modules: a channel attention module CAM and a spatial attention module SAM, which perform attention on channels and spaces respectively. Specifically: A CBAM attention mechanism is added after the dilated convolutional layer. CBAM mainly contains two modules, the channel attention module CAM and the spatial attention module SAM, which perform channel and spatial attention respectively. The channel attention module CAM performs global max pooling and global average pooling on the input feature map X (height × width × C) based on width and height respectively, obtaining two 1×1×C feature maps. Then these two feature maps are respectively fed into a two-layer neural network MLP. The number of neurons in the first layer is C / r, the activation function is Relu, and the number of neurons in the second layer is C. This two-layer neural network is shared. Then, the features output by the neural network MLP are subjected to an element-wise addition operation, and then passed through a sigmoid activation operation to generate the final channel attention feature M c , finally, M c and the input feature map X are subjected to an element-wise multiplication operation to generate the input feature required by the spatial attention module. For the spatial attention module SAM, the feature map X' output by the channel attention module is used as the input feature map of this module. First, global max pooling and global average pooling based on channels are performed to obtain two feature maps of height × width × 1. Then these two feature maps are concatenated based on channels (channel splicing), and then passed through a 7×7 convolutional operation to reduce the dimension to 1 channel, that is, height × width × 1, and then passed through sigmoid to generate the spatial attention feature M s . Finally, the feature is multiplied by the input feature of this module to obtain the finally generated feature. The addition of the CBAM attention mechanism pays more attention to the apparent characteristics of the rust on the metal enclosure structure, and thus better realizes the semantic segmentation of rust
[0032] In this embodiment, DeepLabV3+ is used as the backbone feature extraction network to extract high- and low-order feature semantic maps. After extraction, the high-order feature semantic map will enter the dilated convolution module, which includes a parallel 1×1 convolution, dilated convolutions with various dilation rates, and a global average pooling layer. The feature map obtained after dilated convolution processing is concatenated and fused with the low-order feature semantic map of the decoding module to maintain consistency in the channel dimension. The image spatial information is gradually restored through upsampling to capture a clearer target boundary in the corroded area. An attention mechanism is added to enable the convolutional neural network to adaptively focus on areas that require more attention. Specifically, the CBAM attention mechanism is added after the dilated convolution of the DeepLabV3+ model to make the model more conducive to the detection of corrosion features of the enclosure structure, enabling the network to pay more attention to the apparent characteristics of the corrosion of the metal enclosure structure, and thus better realizing the semantic segmentation of corrosion.
[0033] In this embodiment, the training method of the improved DeepLabV3+ network structure is as follows:
[0034] 1) Obtain a certain number of images of corroded enclosure structures as the training set.
[0035] 2) Perform data augmentation on the images in the image set respectively. In this embodiment, the data augmentation method is to compile a data augmentation algorithm using the Python language. The data augmentation algorithm includes but is not limited to using computer vision algorithms to perform rotation / reflection transformation, flipping transformation, scaling transformation, translation transformation, etc. on the pictures to expand the data set and improve the generalization ability and robustness of the model.
[0036] 3) Use the semantic segmentation feature annotation software labelme to use a polyline-enclosed area of one color to label the corroded part in the image, and use a polyline-enclosed area of another color to label the feature of the target enclosure structure;
[0037] 4) Use the image set with feature annotations to train the semantic segmentation network model.
[0038] Step 3: Count the number of pixel points in the corroded feature part enclosed by one or more polylines labeled with the same color, and the number of pixel points in the enclosure structure part enclosed by the polyline labeled with another color.
[0039]
[0040] In this embodiment, the method of counting pixel points refers to counting the pixel points in the area enclosed by polylines of the same color in the image after feature annotation using Python programming. For multiple corrosion areas that appear in the same enclosure structure, an area enclosed by a polyline represents one corrosion area. There may be multiple corrosion areas in one enclosure structure, so there will be multiple polylines enclosing them. Since the corrosion areas are enclosed by polylines of the same color, the pixel points of multiple corrosion areas enclosed by polylines of the same color are counted together as the total pixel points of the corroded part.
[0041] The enclosure structure is the area enclosed by polylines marked with another color. Since in an image, the enclosure structure may only be a part of the image, the enclosure structure part is marked with polylines of another color, and the pixel points of the area enclosed by the polylines are counted to facilitate the calculation of the corrosion ratio.
[0042] Step 4: Calculate the ratio of the number of pixel points in the corroded feature part to the number of pixel points in the enclosure structure part, obtain the corrosion ratio of the enclosure structure, and output it.
[0043] In this embodiment, a trained network model is used to detect the corrosion of the enclosure structure. Specifically, the image to be detected is used as the input to splice the SIFT images into a complete image to be detected, and the trained corrosion detection network of the improved DeepLabV3+ for the enclosure structure is applied, with the corrosion detection result and the enclosure structure detection result after semantic segmentation as the output. The pixel points occupied by the enclosure structure and the corroded part are counted to obtain the detection result of the proportion of the corrosion of the enclosure structure. Using the method of the present invention, the corrosion ratio can be given faster, so as to understand the condition of the enclosure structure, and then make a decision on whether to replace it, solving the problems of time-consuming, laborious and easy to cause subjective judgment when using the manual method for detection at present.
[0044] The present invention also provides a detection system for the corrosion ratio of the enclosure structure, which uses each step of the above-mentioned detection method for the corrosion ratio of the enclosure structure.
[0045] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting the corrosion ratio of an enclosure structure, characterized in that, It includes the following steps: Step 1: Obtain the enclosure structure images and stitch them into a complete enclosure structure image; Step 2: Input the stitched enclosure structure image into the trained semantic segmentation network model to obtain the corroded feature part marked by the area enclosed by multi-segment lines of one color and the enclosure structure part marked by the area enclosed by multi-segment lines of another color in the image; Step 3: Count the number of pixel points in the corroded feature part of the area enclosed by one or more multi-segment lines marked with the same color and the number of pixel points in the enclosure structure part of the area enclosed by the multi-segment lines marked with another color; Step 4: Calculate the ratio of the number of pixel points in the corroded feature part to the number of pixel points in the enclosure structure part to obtain the corrosion ratio of the enclosure structure and output it; The semantic segmentation network model is an improved DeepLabV3+ network structure; The improved DeepLabV3+ network structure means adding an attention mechanism after the dilated convolution layer in the DeepLabV3+ network structure; The attention mechanism includes a channel attention module CAM and a spatial attention module SAM, which perform attention on channels and spaces respectively; The channel attention module CAM performs global max pooling and global average pooling on the input feature map X based on width and height respectively to obtain two feature maps of 1×1×C. Then these two feature maps are respectively fed into a two-layer neural network MLP. The number of neurons in the first layer is C / r, and the activation function is Relu. The number of neurons in the second layer is C, and this two-layer neural network is shared. The features output by the neural network MLP are subjected to an element-wise addition operation and then passed through a sigmoid activation operation to generate the final channel attention feature M c , finally, M c and the input feature map X are subjected to an element-wise multiplication operation to generate the input features required by the spatial attention module; Spatial Attention Module SAM takes the feature map X' output by the channel attention module as the input feature map of this module. First, it performs a channel-based global max pooling and global average pooling to obtain two feature maps of height × width × 1. Then, these two feature maps are concatenated based on the channel, and then passed through a 7×7 convolutional operation to reduce the dimension to 1 channel, that is, height × width × 1. Finally, it passes through sigmoid to generate the spatial attention feature M s ; Finally, multiply this feature by the input feature of this module to obtain the finally generated feature; The training method of the improved DeepLabV3+ network structure is: 1) Obtain a certain number of datasets of corroded enclosure structures; 2) Perform data augmentation on the images in the dataset respectively; 3) Use the semantic segmentation feature annotation software labelme to mark the features of the corroded part with the area enclosed by multi-segment lines of one color and mark the features of the target enclosure structure with the area enclosed by multi-segment lines of another color in the image; 4) Use the image set marked with features to train the semantic segmentation network model.
2. The method for detecting the corrosion ratio of an enclosure structure according to claim 1, characterized in that The method of data augmentation is to compile a data augmentation algorithm using the Python language.
3. A method for detecting the corrosion ratio of an enclosure structure according to claim 2, characterized in that, The method of stitching is to use the SIFT image stitching algorithm.
4. A method for detecting the corrosion ratio of an enclosure structure according to any one of claims 1 to 3, characterized in that, The method of counting pixel points refers to using Python programming to count the pixel points in the area enclosed by multi-segment lines of the same color in the image marked with features.
5. A detection system for the corrosion ratio of an enclosure structure, characterized in that, Use each step of the method for detecting the corrosion ratio of an enclosure structure according to any one of claims 1 to 4.
Citation Information
Patent Citations
Panoramic visual detection method, system and device for corrosion defect of steel structure metal roof
CN118230172A