Bridge pile foundation defect detection method and system based on image enhancement
By optimizing the generator and discriminator network structures and combining the attention mechanism with multi-scale feature fusion, the problems of insufficient recovery of tiny details and poor adaptability to non-standard forms in bridge pile foundation defect detection are solved, achieving high-precision and high-reliability defect detection.
Patent Information
- Application Number
- CN202510490264.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-04-18
AI Technical Summary
Existing bridge pile foundation defect detection methods are unable to effectively recover tiny details in low-resolution images, resulting in insufficient detection of detailed defects such as microcracks and localized corrosion. They also have weak ability to distinguish concrete texture, shadows, and background noise from uneven lighting, leading to false or missed detections. It is difficult to simultaneously capture large-scale corrosion and tiny cracks, resulting in insufficient reliability of detection results.
A combination of transposed convolution and nearest neighbor upsampling + deconvolution is adopted, and a self-attention module is embedded in the generator network to design the generator network. The discriminator network combines convolution operations and step size adjustment, inserts parameter-free attention mechanism and regional adaptive weight adjustment, introduces deformable convolution and void ratio, adopts multi-scale feature fusion and quadratic attenuation mechanism, and optimizes the loss function design.
It improves the accuracy and reliability of bridge pile foundation defect detection, can accurately restore and amplify tiny defects, reduce background noise interference, adapt to non-standard morphological defects, and improve detection effects.
Smart Images

Figure CN120013939B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image enhancement, and in particular to a method and system for detecting bridge pile foundation defects based on image enhancement. Background Art
[0002] Bridge pile foundation defect detection utilizes deep learning technology to automatically identify and locate surface defects such as cracks and corrosion on bridge pile foundations. However, typical methods for detecting bridge pile foundation defects are unable to effectively recover minute details in low-resolution images, resulting in insufficient detection of detailed defects such as microcracks and localized corrosion. They also have a poor ability to distinguish concrete texture, shadows, and background noise from uneven lighting, leading to false or missed detections. Furthermore, these methods struggle to simultaneously capture large-scale corrosion and minute cracks, leading to missed detection of non-standard pile foundation cracks and corrosion defects, resulting in unreliable results. Summary of the Invention
[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a bridge pile foundation defect detection method and system based on image enhancement. The general bridge pile foundation defect detection method is unable to effectively restore the tiny details in low-resolution images, resulting in insufficient detection of detailed defects of microcracks and local corrosion, and weak ability to distinguish background noise of concrete texture, shadows and uneven lighting, resulting in false detection or missed detection. This solution combines transposed convolution with nearest neighbor upsampling + deconvolution, and embeds a self-attention module to design a generator network structure to ensure that the tiny defects of microcracks in low-resolution images are accurately restored and amplified. The self-attention module is embedded in the generator to focus on capturing the local subtle areas of microcracks in the image, highlighting the real defects in the complex background, reducing background noise interference, and improving the accuracy of bridge pile foundation defect detection. In the discriminator network design, the convolution operation is combined with the step size adjustment to replace the pooling layer, which is more suitable for detecting tiny cracks or corrosion on the surface of the bridge pile foundation. Through the residual module design, and in each convolution An attention module is embedded in the P4 layer to dynamically weight different regions in the feature map, which can focus more on the key defect areas on the surface of the bridge pile foundation, thereby improving the subsequent bridge pile foundation defect detection effect. To address the problem that general bridge pile foundation defect detection methods have difficulty in simultaneously capturing large-scale corrosion and tiny cracks, and miss non-standard bridge pile foundation cracks and corrosion defects, resulting in insufficient reliability of the final bridge pile foundation defect detection results, this scheme inserts a parameter-free attention mechanism in the P4 layer of CSPDarkNet, and introduces regional adaptive weight adjustment and contrast enhancement to automatically enhance the feature response of the bridge pile foundation crack and corrosion areas. Deformable convolution is used on the fused features, and the void ratio is introduced to dynamically adjust the sampling position to adapt to defects of different scales, comprehensively capture defect features, better adapt to the non-standard morphology of bridge pile foundation defects, overcome the limitations of fixed sampling positions, and improve the reliability of defect detection. A local complexity compensation factor is introduced in the loss function, and the accuracy of defect detection is ultimately improved based on the quadratic attenuation mechanism.
[0004] The technical solution adopted by the present invention is as follows: The bridge pile foundation defect detection method based on image enhancement provided by the present invention comprises the following steps:
[0005] Step S1: bridge pile foundation image acquisition;
[0006] Step S2: bridge pile foundation image enhancement;
[0007] Step S3: constructing a bridge pile foundation defect detection model;
[0008] Step S4: Bridge pile foundation defect detection.
[0009] Furthermore, in step S1 , the bridge pile foundation image acquisition is to acquire bridge pile foundation images with defects marked as original bridge pile foundation image sets.
[0010] Furthermore, in step S2, the bridge pile foundation image enhancement specifically includes the following steps:
[0011] Step S21: Design the generator network structure; use transposed convolution and nearest neighbor upsampling + deconvolution in the generator network; use batch normalization in each layer; use FCN to replace the fully connected layer and embed the self-attention module; the final output is represented as: ; Where x is the input feature map; It is the nearest neighbor upsampling process; It is transposed convolution processing; is the fused output image; SA(·) is the embedded self-attention module; is a data augmentation operation, are parameters including rotation angle, flip probability and noise level;
[0012] Step S22: Discriminator network structure design; use convolution operation instead of pooling layer, control the adjustment of feature map size by step size; introduce residual module, and add attention module in each convolution layer; expressed as: ; ; Where F(x) is the transformation operation; is the output feature map of the residual module; and is the gradient; is bitwise multiplication; It is a weighted feature map calculated by the attention mechanism.
[0013] Furthermore, in step S3, the construction of the bridge pile foundation defect detection model is to establish a deep learning model, the input image is the final bridge pile foundation image set; and the final bridge pile foundation defect detection result is output; specifically, the following steps are included:
[0014] Step S31: Attention mechanism design; CSPDarkNet is used as the backbone network, and a parameter-free attention mechanism is inserted into the P4 layer of the backbone network to weight local features, introduce regional adaptive weight adjustment, and introduce contrast enhancement; the whole process is expressed as: ; ;in, is the attention energy, which is used to dynamically adjust the weights of each region in the feature map; and is a fixed calculation factor; L is the total length of the feature; is the i-th input feature; y is the high response of the defective area of the bridge pile foundation; is the regularization parameter, which controls the magnitude of the weight; is the sharpness parameter; is the regional adaptive weight; M is the total number of features in the neighborhood; j is the feature index in the neighborhood; is the neighborhood feature; tanh(·) is the tanh function; β is the contrast enhancement coefficient;
[0015] Step S32: Multi-scale feature fusion: Use FPN to fuse features from different levels according to weights to obtain comprehensive features; on the fused features, use deformable convolution to adjust local sampling and introduce the void rate d, which is expressed as: ;in, Is the output feature at the reference position The value of; G is the number of convolution groups, each group g shares the same projection weight; K is the number of sampling points, k is the sampling point index; is the convolution weight of the g-th group; is the normalized modulation factor of the k-th sampling point in the g-th group; The input feature map is in group g; is the fixed sampling point offset; is the offset to be learned, which is used to dynamically adjust the sampling position to adapt to the defects of bridge pile foundations at different scales. The overall process of multi-scale feature fusion is expressed as: ; Among them, Y is the fused feature output, which is subsequently input to YOLOv8-2d; FPX(·) is multi-scale feature fusion; are feature maps of different scales;
[0016] Step S33: Design activation function and loss function; introduce local complexity compensation factor into the loss function Activation function Expressed as: ;in, and is the scaling parameter to be learned based on the loss gradient update; the loss function is expressed as: ; ; Wherein, (x1, y1) is the center coordinate of the predicted bridge pile foundation defect frame; is the center coordinate of the real bridge pile foundation defect frame; W g and H g are the width and height of the defect frame of the real bridge pile foundation; is the standard IoU loss value; is the complexity adjustment parameter; is the local texture complexity of the predicted position; Mh(·) is the activation function; L is the loss function;
[0017] Step S34: Secondary attenuation mechanism: non-maximum suppression is performed on the detection results, and secondary score attenuation is performed; the initial attenuation is expressed as: ;in, It is non-maximum suppression; is a set of detection frames to be processed; b is the detection frame currently being processed; are the other detection boxes compared with b; IoU(·) is the intersection over union ratio; Td is the intersection over union ratio threshold; is the confidence score; It is to attenuate the score of overlapping detection boxes; quadratic attenuation is expressed as: ;in, Is the detection frame score; is the current highest score box; It is the updated score after score attenuation, which is used to finally decide whether to retain the detection box; is a parameter that controls the score decay rate. After quadratic decay, the optimal detection frame is selected from the set of detection frames to be processed as the final bridge pile foundation defect detection area.
[0018] Furthermore, in step S4, the bridge pile foundation defect detection is based on the established bridge pile foundation defect detection model, and the bridge pile foundation image to be detected is acquired in real time and input into the bridge pile foundation defect detection model. The model will extract features from the input image and identify the defective area in the image, thereby completing the bridge pile foundation defect detection.
[0019] The bridge pile foundation defect detection system based on image enhancement provided by the present invention includes a bridge pile foundation image acquisition module, a bridge pile foundation image enhancement module, a bridge pile foundation defect detection model construction module and a bridge pile foundation defect detection module;
[0020] The bridge pile foundation image acquisition module acquires a bridge pile foundation image with defects marked;
[0021] The bridge pile foundation image enhancement module generates the final bridge pile foundation image set through the generator and discriminator network;
[0022] The bridge pile foundation defect detection model construction module is based on the CSPDarkNet backbone network, combined with the attention mechanism, multi-scale feature fusion and quadratic attenuation mechanism to complete the construction of the bridge pile foundation defect detection model;
[0023] The bridge pile foundation defect detection module uses the constructed detection model to detect bridge pile foundation defects on the bridge pile foundation image acquired in real time.
[0024] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0025] (1) In view of the fact that general bridge pile foundation defect detection methods cannot effectively restore tiny details in low-resolution images, resulting in insufficient detection of detailed defects such as microcracks and local corrosion, and weak ability to distinguish concrete texture, shadows and background noise with uneven lighting, resulting in false detection or missed detection, this scheme combines transposed convolution with nearest neighbor upsampling + deconvolution and embeds a self-attention module to design a generator network structure to ensure that the tiny defects of microcracks in low-resolution images are accurately restored and amplified. The self-attention module is embedded in the generator to focus on capturing the local subtle areas of microcracks in the image, highlighting the real defects in the complex background, reducing background noise interference, and improving the accuracy of bridge pile foundation defect detection; in the discriminator network design, the convolution operation combined with step size adjustment is used instead of the pooling layer, which is more suitable for detecting tiny cracks or corrosion on the surface of the bridge pile foundation. By designing the residual module and embedding the attention module in each convolution layer, different areas in the feature map are dynamically weighted, which can pay more attention to the key defect areas on the surface of the bridge pile foundation, thereby improving the subsequent bridge pile foundation defect detection effect.
[0026] (2) In view of the fact that general bridge pile foundation defect detection methods have difficulty in capturing large-scale corrosion and tiny cracks at the same time, and miss detection of non-standard bridge pile foundation cracks and corrosion defects, which leads to insufficient reliability of the final bridge pile foundation defect detection results, this scheme inserts a parameter-free attention mechanism into the P4 layer of CSPDarkNet, and introduces regional adaptive weight adjustment and contrast enhancement to automatically enhance the feature response of bridge pile foundation cracks and corrosion areas; deformable convolution is used on the fused features, and the void ratio is introduced to dynamically adjust the sampling position to adapt to defects of different scales, comprehensively capture defect features, better adapt to the non-standard forms of bridge pile foundation defects, overcome the limitations of fixed sampling positions, and improve the reliability of defect detection; a local complexity compensation factor is introduced in the loss function, and the accuracy of defect detection is ultimately improved based on the quadratic attenuation mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A schematic diagram of the flow of the bridge pile foundation defect detection method based on image enhancement provided by the present invention;
[0028] Figure 2 A schematic diagram of a bridge pile foundation defect detection system based on image enhancement provided by the present invention;
[0029] Figure 3 Schematic diagram of the process of step S3.
[0030] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0031] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0032] In the description of the present invention, it should be understood that terms such as "up", "down", "front", "back", "left", "right", "top", "bottom", "inside" and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the system or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, they should not be understood as limiting the present invention.
[0033] Example 1, see Figure 1 The present invention provides a bridge pile foundation defect detection method based on image enhancement, which includes the following steps:
[0034] Step S1: Acquiring a bridge pile foundation image; acquiring a bridge pile foundation image with defects marked;
[0035] Step S2: Bridge pile foundation image enhancement; generate the final bridge pile foundation image set through the generator and discriminator network;
[0036] Step S3: Construct a bridge pile foundation defect detection model; based on the CSPDarkNet backbone network, combined with the attention mechanism, multi-scale feature fusion and quadratic attenuation mechanism, the bridge pile foundation defect detection model is constructed;
[0037] Step S4: Bridge pile foundation defect detection: Utilize the constructed detection model to detect bridge pile foundation defects on the bridge pile foundation image acquired in real time.
[0038] Example 2, see Figure 1 This embodiment is based on the above embodiment. In step S1, the bridge pile foundation image is acquired by taking the bridge pile foundation image with defects marked as the original bridge pile foundation image set for model training.
[0039] Example 3, see Figure 1 This embodiment is based on the above embodiment. In step S2, the bridge pile foundation image enhancement is to increase the diversity of the original bridge pile foundation image set through data enhancement to target the complex defect morphology and background noise in bridge pile foundation detection; and obtain the final bridge pile foundation image set. Specifically, the following steps are included:
[0040] Step S21: Generator network structure design; In bridge pile foundation defect detection, the role of the generator is to generate fake images to train the discriminator to improve detection accuracy; In order to adapt to the complex bridge pile foundation defect morphology and background noise in bridge pile foundation detection, we adopt the following optimization design in the generator network: Use transposed convolution and nearest neighbor upsampling + deconvolution to ensure image resolution recovery and enhance detail features; Transposed convolution can generate higher quality feature maps to help detect tiny bridge pile foundation defects; Use batch normalization in each layer to reduce fluctuations during training and improve stability; Use FCN instead of fully connected layers to ensure the spatial consistency of the output feature map, which helps to generate accurate images of bridge pile foundation surface defects; And embed a self-attention module to further enhance the capture of tiny cracks; The final output is represented as: ; Where x is the input feature map; It is the nearest neighbor upsampling process; It is transposed convolution processing; is the fused output image; SA(·) is the embedded self-attention module; is a data augmentation operation, are parameters including rotation angle, flip probability and noise level;
[0041] Step S22: Discriminator network structure design; the main function of the discriminator is to judge the authenticity of the generated image and provide feedback signals to the generator; to improve the classification and accuracy of bridge pile foundation defect images, we made the following improvements to the discriminator: using convolution operations instead of traditional pooling layers, controlling the adjustment of feature map size by step size, and maintaining key local details, which is suitable for the detection of subtle defects such as cracks or corrosion on the bridge pile foundation surface; introducing a residual module to enable effective information flow even in deeper network layers, enhancing the network's deep learning capabilities; and adding an attention module to each convolutional layer to dynamically adjust the response of each region in the feature map, further strengthening the recognition of subtle defects on the bridge pile foundation surface; expressed as: ; ; Where F(x) is the transformation operation; is the output feature map of the residual module; and is the gradient; is bitwise multiplication; It is a weighted feature map calculated by the attention mechanism.
[0042] By performing the above operations, we address the problems of conventional bridge pile foundation defect detection methods, which are unable to effectively restore tiny details in low-resolution images. This leads to insufficient detection of detailed defects such as microcracks and localized corrosion, and poor discrimination of concrete texture, shadows, and background noise caused by uneven lighting, resulting in false or missed detections. This solution combines transposed convolution with nearest neighbor upsampling and deconvolution, and embeds a self-attention module to design a generator network structure. This ensures that tiny defects such as microcracks in low-resolution images are accurately restored and amplified. The self-attention module is embedded in the generator to focus on capturing the localized subtle areas of microcracks in the image, highlighting the true defects against complex backgrounds, reducing background noise interference, and improving the accuracy of bridge pile foundation defect detection. In the discriminator network design, convolution operations combined with step size adjustment are used instead of pooling layers, making it more suitable for detecting subtle cracks or corrosion on the surface of bridge pile foundations. By designing a residual module and embedding an attention module in each convolutional layer, different regions in the feature map are dynamically weighted, focusing more on key defect areas on the surface of bridge pile foundations, thereby improving the subsequent bridge pile foundation defect detection effect.
[0043] Example 4, see Figure 1 and Figure 3 This embodiment is based on the above embodiment. In step S3, building a bridge pile foundation defect detection model is to establish a deep learning model that can accurately detect bridge pile foundation cracks and corrosion defects. The input image is the final bridge pile foundation image set; CSPDarkNet is used as the backbone network and optimized, and the final bridge pile foundation defect detection results are output. The specific steps include:
[0044] Step S31: Design of attention mechanism. CSPDarkNet is used as the backbone network. A parameter-free attention mechanism is inserted into the P4 layer of the backbone network to weight local features. Regional adaptive weight adjustment is introduced to adjust the weight distribution according to the unknown defects of the bridge pile foundation. The weight of the attention mechanism will be more concentrated near the defective area of the bridge pile foundation, while the weight will be effectively suppressed in the defect-free area. Contrast enhancement is also introduced to make the network more sensitive to the contrast between the defective area of the bridge pile foundation and the background. The whole process is expressed as follows: ; ;in, is the attention energy, which is used to dynamically adjust the weights of each region in the feature map; and is a fixed calculation factor; L is the total length of the feature; is the i-th input feature; y is the high response of the defective area of the bridge pile foundation; is the regularization parameter, which controls the magnitude of the weight; is the sharpness parameter; is the regional adaptive weight; M is the total number of features in the neighborhood; j is the feature index in the neighborhood; is the neighborhood feature; tanh(·) is the tanh function; β is the contrast enhancement coefficient; in bridge pile foundation detection, the background is complex and the texture is diverse. The parameter-free attention mechanism can directly highlight the defective area of the bridge pile foundation, improving the detection accuracy without adding additional computational burden;
[0045] Step S32: Multi-scale feature fusion. Bridge pile foundation defects appear at different scales, so FPN is used to fuse features from different levels according to weights to obtain comprehensive features. On the fused features, deformable convolution is used to further adjust local sampling, and the void ratio d is introduced to capture more long-range bridge pile foundation defect information, which can be expressed as: ;in, Is the output feature at the reference position The value of; G is the number of convolution groups, each group g shares the same projection weight; K is the number of sampling points, k is the sampling point index; is the convolution weight of the g-th group; is the normalized modulation factor of the k-th sampling point in the g-th group; The input feature map is in group g; is the fixed sampling point offset; is the offset to be learned, which is used to dynamically adjust the sampling position to adapt to the defects of bridge pile foundations at different scales. The overall process of multi-scale feature fusion is expressed as: ; Among them, Y is the fused feature output, which is subsequently input to YOLOv8-2d; FPX(·) is multi-scale feature fusion; It is a feature map of different scales; deformable convolution dynamically adjusts the receptive field at different scales to enhance the detection capability of bridge pile foundation defects of different scales; it can also enhance the network's response to non-standard bridge pile foundation defects through dynamic sampling; and use YOLOv8-2d for bridge pile foundation defect detection;
[0046] Step S33: Design activation function and loss function; introduce local complexity compensation factor into the loss function , which makes the regression error more strictly penalized in the complex bridge pile foundation defect area; activation function Expressed as: ;in, and is the scaling parameter to be learned based on the loss gradient update; the loss function is expressed as: ; ; Where (x1, y1) is the center coordinate of the predicted bridge pile foundation defect frame; is the center coordinate of the real bridge pile foundation defect frame; W g and H g are the width and height of the defect frame of the real bridge pile foundation; is the standard IoU loss value; is the complexity adjustment parameter; is the local texture complexity of the predicted position; Mh(·) is the activation function; L is the loss function;
[0047] Step S34: Secondary attenuation mechanism; perform non-maximum suppression on the detection results, remove redundant detection frames, retain only the optimal frame, and perform secondary score attenuation; the initial attenuation is expressed as: ;in, It is non-maximum suppression; is a set of detection frames to be processed; b is the detection frame currently being processed; are the other detection boxes compared with b; IoU(·) is the intersection over union ratio; Td is the intersection over union ratio threshold; is the confidence score; The score of the overlapping detection frames is attenuated. The more overlaps there are, the more obvious the attenuation is, which reduces the confidence of the overlapping frames. By attenuating the scores of the overlapping frames, more high-confidence frames are retained, which reduces misjudgments and improves the detection accuracy of bridge pile foundation defects, especially in areas with multiple overlapping bridge pile foundation defects. The quadratic attenuation is expressed as: ;in, Is the detection frame score; is the current highest score box; It is the updated score after score attenuation, which is used to finally decide whether to retain the detection box; is a parameter that controls the score decay rate. After quadratic decay, the optimal detection frame is selected from the set of detection frames to be processed as the final bridge pile foundation defect detection area.
[0048] By performing the above operations, we address the problem that general bridge pile foundation defect detection methods have difficulty in simultaneously capturing large-scale corrosion and tiny cracks, and miss detection of non-standard bridge pile foundation cracks and corrosion defects, resulting in insufficient reliability of the final bridge pile foundation defect detection results. This scheme inserts a parameter-free attention mechanism into the P4 layer of CSPDarkNet, and introduces regional adaptive weight adjustment and contrast enhancement to automatically enhance the feature responses of bridge pile foundation cracks and corrosion areas. Deformable convolution is used on the fused features, and the void ratio is introduced to dynamically adjust the sampling position to adapt to defects of different scales, comprehensively capture defect features, better adapt to the non-standard forms of bridge pile foundation defects, overcome the limitations of fixed sampling positions, and improve the reliability of defect detection. A local complexity compensation factor is introduced into the loss function, and the accuracy of defect detection is ultimately improved based on the quadratic attenuation mechanism.
[0049] Example 5, see Figure 1This embodiment is based on the above embodiment. In step S4, the bridge pile foundation defect detection is based on the established bridge pile foundation defect detection model. The bridge pile foundation image to be detected is acquired in real time and input into the bridge pile foundation defect detection model. The model will extract features from the input image and identify the defect area in the image, thereby completing the bridge pile foundation defect detection.
[0050] Example 6, see Figure 2 This embodiment is based on the above embodiment. The bridge pile foundation defect detection system based on image enhancement provided by the present invention includes a bridge pile foundation image acquisition module, a bridge pile foundation image enhancement module, a bridge pile foundation defect detection model construction module and a bridge pile foundation defect detection module;
[0051] The bridge pile foundation image acquisition module acquires a bridge pile foundation image with defects marked;
[0052] The bridge pile foundation image enhancement module generates the final bridge pile foundation image set through the generator and discriminator network;
[0053] The bridge pile foundation defect detection model construction module is based on the CSPDarkNet backbone network, combined with the attention mechanism, multi-scale feature fusion and quadratic attenuation mechanism to complete the construction of the bridge pile foundation defect detection model;
[0054] The bridge pile foundation defect detection module uses the constructed detection model to detect bridge pile foundation defects on the bridge pile foundation image acquired in real time.
[0055] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus.
[0056] While the embodiments of the present invention have been shown and described, it will be apparent to those skilled in the art that various changes, modifications, substitutions, and alterations can be made to the embodiments without departing from the principles and spirit of the invention.
[0057] The present invention and its embodiments are described above. Such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if a person skilled in the art is inspired by the above, and does not deviate from the purpose of the present invention, without inventive design, a structure and embodiment similar to the technical solution should fall within the scope of protection of the present invention.
Claims
1. A bridge pile foundation defect detection method based on image enhancement, characterized by: The method comprises the following steps: Step S1: Acquiring a bridge pile foundation image; acquiring a bridge pile foundation image with defects marked; Step S2: bridge pile foundation image enhancement; Step S3: constructing a bridge pile foundation defect detection model; Step S4: bridge pile foundation defect detection: using the constructed detection model to detect bridge pile foundation defects on the real-time acquired bridge pile foundation image; In step S2, the bridge pile foundation image enhancement specifically includes the following steps: Step S21: Design the generator network structure; use transposed convolution and nearest neighbor upsampling + deconvolution in the generator network; use batch normalization in each layer; use FCN to replace the fully connected layer and embed the self-attention module; the final output is represented as: ; Where x is the input feature map; It is the nearest neighbor upsampling process; It is transposed convolution processing; is the fused output image; SA(·) is the embedded self-attention module; is a data augmentation operation, are parameters including rotation angle, flip probability and noise level; Step S22: Discriminator network structure design; use convolution operation instead of pooling layer, control the adjustment of feature map size by step size; introduce residual module, and add attention module in each convolution layer; expressed as: ; ; Where F(x) is the transformation operation; is the output feature map of the residual module; and is the gradient; is bitwise multiplication; It is a weighted feature map calculated by the attention mechanism; In step S3, the bridge pile foundation defect detection model is constructed by establishing a deep learning model, the input image is the final bridge pile foundation image set; the final bridge pile foundation defect detection result is output; specifically, the following steps are included: Step S31: Attention mechanism design; CSPDarkNet is used as the backbone network, and a parameter-free attention mechanism is inserted into the P4 layer of the backbone network to weight local features, introduce regional adaptive weight adjustment, and introduce contrast enhancement; the whole process is expressed as: ; ;in, is the attention energy, which is used to dynamically adjust the weights of each region in the feature map; and is a fixed calculation factor; L is the total length of the feature; is the i-th input feature; y is the high response of the defective area of the bridge pile foundation; is the regularization parameter, which controls the magnitude of the weight; is the sharpness parameter; is the regional adaptive weight; M is the total number of features in the neighborhood; j is the feature index in the neighborhood; is the neighborhood feature; tanh(·) is the tanh function; β is the contrast enhancement coefficient; Step S32: multi-scale feature fusion; Step S33: designing activation function and loss function; Step S34: Secondary attenuation mechanism.
2. The bridge pile foundation defect detection method based on image enhancement according to claim 1, characterized in that: In step S32, the multi-scale feature fusion is to use FPN to fuse features from different levels according to weights to obtain comprehensive features; on the fused features, deformable convolution is used to adjust local sampling, and the hole rate d is introduced, which is expressed as: ;in, Is the output feature at the reference position The value of; G is the number of convolution groups, each group g shares the same projection weight; K is the number of sampling points, k is the sampling point index; is the convolution weight of the g-th group; is the normalized modulation factor of the k-th sampling point in the g-th group; The input feature map is in group g; is the fixed sampling point offset; is the offset to be learned, which is used to dynamically adjust the sampling position to adapt to the defects of bridge pile foundations at different scales. The overall process of multi-scale feature fusion is expressed as: ; Among them, Y is the fused feature output, which is subsequently input to YOLOv8-2d; FPN(·) is multi-scale feature fusion; are feature maps of different scales.
3. The bridge pile foundation defect detection method based on image enhancement according to claim 2, characterized in that: In step S33, the activation function and loss function are designed by introducing a local complexity compensation factor into the loss function. Activation function Expressed as: ;in, and is the scaling parameter to be learned based on the loss gradient update; the loss function is expressed as: ; ; Where (x1, y1) is the center coordinate of the predicted bridge pile foundation defect frame; is the center coordinate of the real bridge pile foundation defect frame; W g and H g are the width and height of the defect frame of the real bridge pile foundation; is the standard IoU loss value; is the complexity adjustment parameter; is the local texture complexity of the prediction position; Mh(·) is the activation function; L is the loss function.
4. The bridge pile foundation defect detection method based on image enhancement according to claim 3 is characterized in that: In step S34, the secondary attenuation mechanism performs non-maximum suppression on the detection results and performs secondary score attenuation; the initial attenuation is expressed as: ;in, It is non-maximum suppression; is a set of detection frames to be processed; b is the detection frame currently being processed; are the other detection boxes compared with b; IoU(·) is the intersection over union ratio; Td is the intersection over union ratio threshold; is the confidence score; It is to attenuate the score of overlapping detection boxes; quadratic attenuation is expressed as: ;in, Is the detection frame score; is the current highest score box; It is the updated score after score attenuation, which is used to finally decide whether to retain the detection box; is a parameter that controls the score decay rate. After quadratic decay, the optimal detection frame is selected from the set of detection frames to be processed as the final bridge pile foundation defect detection area.
5. The bridge pile foundation defect detection method based on image enhancement according to claim 4 is characterized in that: In step S4, the bridge pile foundation defect detection is based on the established bridge pile foundation defect detection model. The bridge pile foundation image to be detected is acquired in real time and input into the bridge pile foundation defect detection model. The model will extract features from the input image and identify the defective area in the image, thereby completing the bridge pile foundation defect detection.
6. A bridge pile foundation defect detection system based on image enhancement, for implementing the bridge pile foundation defect detection method based on image enhancement as described in any one of claims 1 to 5, characterized in that: It includes a bridge pile foundation image acquisition module, a bridge pile foundation image enhancement module, a bridge pile foundation defect detection model construction module and a bridge pile foundation defect detection module; The bridge pile foundation image acquisition module acquires a bridge pile foundation image with defects marked; The bridge pile foundation image enhancement module generates the final bridge pile foundation image set through the generator and discriminator network; The bridge pile foundation defect detection model construction module is based on the CSPDarkNet backbone network, combined with the attention mechanism, multi-scale feature fusion and quadratic attenuation mechanism to complete the construction of the bridge pile foundation defect detection model; The bridge pile foundation defect detection module uses the constructed detection model to detect bridge pile foundation defects on the bridge pile foundation image acquired in real time.
Citation Information
Patent Citations
Wind turbine surface defect detection method
CN115719337A
Ship coating defect detection method based on improved attention module
CN116309502A