Bridge pile foundation defect detection method and system based on image enhancement
By using technical means such as transposed convolution, self-attention module and parameterless attention mechanism in the detection of bridge pile foundation defects, the problems of insufficient recovery ability of small details and difficulty in capturing defects at different scales in the existing technology are solved, and more efficient and reliable detection of bridge pile foundation defects is achieved.
Patent Information
- Application Number
- CN202510490264.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-18
Smart Images

Figure CN120013939A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image enhancement, and in particular to a bridge pile foundation defect detection method and system based on image enhancement. Background Art
[0002] The bridge pile foundation defect detection method is a detection method that comprehensively uses deep learning technology to automatically identify and locate surface cracks, corrosion and other defects on bridge pile foundations. However, the general bridge pile foundation defect detection method cannot effectively restore the tiny details in low-resolution images, resulting in insufficient detection of detail 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; the general bridge pile foundation defect detection method has the problem of difficulty in capturing large-scale corrosion and tiny cracks at the same time, and missed detection of non-standard bridge pile foundation cracks and corrosion defects, resulting in insufficient reliability of the final bridge pile foundation defect detection 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 has the problem that it cannot effectively restore the tiny details in the low-resolution image, resulting in insufficient detection of the detail defects of microcracks and local corrosion, and the ability to distinguish the background noise of concrete texture, shadow and uneven illumination is weak, 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 the low-resolution image are accurately restored and amplified. The self-attention module is embedded in the generator to focus on capturing the local subtle areas of the microcracks in the image, highlighting the real defects in the complex background, reducing the background noise interference, and improving the accuracy of bridge pile foundation defect detection. In the discriminator network design, the convolution operation combined with the step size adjustment is used instead of the pooling layer, which is more suitable for detecting the tiny cracks or corrosion on the surface of the bridge pile foundation. Through the residual module design, and in each convolution The attention module is embedded in the layer, and 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; the general bridge pile foundation defect detection method has the problem that it is difficult to capture large-scale corrosion and tiny cracks at the same time, and misses the non-standard form of bridge pile foundation cracks and corrosion defects, which leads to the problem that the final bridge pile foundation defect detection result is insufficient. 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 area; deformable convolution is used on the fused features, and the void rate is introduced to dynamically adjust the sampling position to adapt to defects of different scales, comprehensively capture defect characteristics, better adapt to the non-standard form 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 the bridge pile foundation image with defects marked as an original bridge pile foundation image set.
[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 expressed 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] Further, 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; the final bridge pile foundation defect detection result is output; specifically includes the following steps:
[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 hole rate d, 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 of 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 of different scales. The overall process of multi-scale feature fusion is expressed as: ; Where Y is the fused feature output, which is subsequently input into 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 It is 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, respectively; 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 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 scores 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 keep the detection box; is a parameter that controls the score decay rate; after secondary 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 comprises 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 a final bridge pile foundation image set through a generator and a 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 bridge pile foundations. Through the residual module design and the attention module embedded 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 bridge pile foundations, 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 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 characteristic 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 characteristics, 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. 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 It is a 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 is necessary to understand that terms such as “upper”, “lower”, “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, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the referred system or element must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on 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 comprises the following steps:
[0034] Step S1: bridge pile foundation image acquisition: acquiring a bridge pile foundation image with defects marked;
[0035] Step S2: bridge pile foundation image enhancement; generating 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 construction of the bridge pile foundation defect detection model is completed;
[0037] Step S4: bridge pile foundation defect detection: using 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 acquisition uses the bridge pile foundation image with defect annotation 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 for the complex defect morphology and background noise in the 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 combination 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 the fully connected layer 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 expressed 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; in order to improve the classification and accuracy of the bridge pile foundation defect image, we made the following improvements to the discriminator: using convolution operations instead of traditional pooling layers, controlling the adjustment of the 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 residual modules, so that even in deeper network layers, information can flow effectively, enhancing the deep learning ability of the network; and adding attention modules in each convolution layer to dynamically adjust the response of each area 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, the general bridge pile foundation defect detection method cannot effectively restore the tiny details in the low-resolution image, resulting in insufficient detection of the detail defects of microcracks and local corrosion, and the weak ability to distinguish the concrete texture, shadows and background noise of uneven illumination, 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 the generator network structure to ensure that the tiny defects of microcracks in the low-resolution image are accurately restored and amplified. The self-attention module is embedded in the generator to focus on capturing the local subtle areas of the microcracks in the image, highlighting the real defects in the complex background, reducing the background noise interference, and improving the accuracy of bridge pile foundation defect detection; in the discriminator network design, the convolution operation combined with the step size adjustment is used instead of the pooling layer, which is more suitable for detecting the tiny cracks or corrosion on the surface of the bridge pile foundation. Through the residual module design and the attention module embedded in each convolution layer, the 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.
[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 to output the final bridge pile foundation defect detection result; specifically, the following steps are included:
[0044] 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 adjust the weight distribution according to the unknown defects of the bridge pile foundation; near the defective area of the bridge pile foundation, the weight of the attention mechanism will be more concentrated, while in the defect-free area, the weight will be effectively suppressed; and contrast enhancement is 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: ; ;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 the detection of bridge pile foundation, 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 and improve the detection accuracy without increasing the 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 rate d is introduced to capture more long-distance bridge pile foundation defect information, 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 of 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 of different scales. The overall process of multi-scale feature fusion is expressed as: ; Where Y is the fused feature output, which is subsequently input into YOLOv8-2d; FPX(·) is multi-scale feature fusion; It is a feature map of different scales; the 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 It is 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, respectively; 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 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 scores of overlapping detection frames are attenuated. The more overlaps there are, the more obvious the attenuation is, thereby reducing the confidence of the overlapping frames. By attenuating the scores of overlapping frames, more high-confidence frames are retained, misjudgment is reduced, and the detection accuracy of bridge pile foundation defects is improved, especially in the area of 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 keep the detection box; is a parameter that controls the score decay rate; after secondary 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, in view of the fact that the general bridge pile foundation defect detection method has the problem of difficulty in capturing large-scale corrosion and tiny cracks at the same time, and misses the non-standard forms of bridge pile foundation cracks and corrosion defects, which leads to the problem of 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 area; deformable convolution is used on the fused features, and the void rate is introduced to dynamically adjust the sampling position to adapt to defects of different scales, comprehensively capture defect characteristics, 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.
[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 a final bridge pile foundation image set through a generator and a 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 article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0056] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations 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, and 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 ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. A bridge pile foundation defect detection method based on image enhancement, characterized in that: The method comprises the following steps: Step S1: bridge pile foundation image acquisition: 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 bridge pile foundation image acquired in real time; Step S2 includes step S21: design of the generator network structure; using transposed convolution and nearest neighbor upsampling + deconvolution combination in the generator network; using batch normalization in each layer; using FCN to replace the fully connected layer and embedding the self-attention module; the final output is expressed 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.
2. The bridge pile foundation defect detection method based on image enhancement according to claim 1 is characterized in that: In step S2, the bridge pile foundation image enhancement further includes step S22: discriminator network structure design; using convolution operation instead of pooling layer, and adjusting the feature map size by step size control; introducing residual module, and adding 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.
3. The bridge pile foundation defect detection method based on image enhancement according to claim 2 is characterized in that: In step S3, the construction of the bridge pile foundation defect detection model is to establish a deep learning model, and the input image is the final bridge pile foundation image set; Output the final bridge pile foundation defect detection results; specifically include the following steps: 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.
4. The bridge pile foundation defect detection method based on image enhancement according to claim 3 is 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 of 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 of different scales. The overall process of multi-scale feature fusion is expressed as: ; Where Y is the fused feature output, which is subsequently input into YOLOv8-2d; FPX(·) is multi-scale feature fusion; are feature maps of different scales.
5. The bridge pile foundation defect detection method based on image enhancement according to claim 4 is 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 It is 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, respectively; 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.
6. The bridge pile foundation defect detection method based on image enhancement according to claim 5 is characterized in that: In step S34, the secondary attenuation mechanism is to perform non-maximum suppression on the detection results 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 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 scores 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 keep the detection box; is a parameter that controls the score decay rate; after secondary 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.
7. The bridge pile foundation defect detection method based on image enhancement according to claim 6 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 image of the bridge pile foundation 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.
8. A bridge pile foundation defect detection system based on image enhancement, used to implement the bridge pile foundation defect detection method based on image enhancement as described in any one of claims 1 to 7, 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 building 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 a final bridge pile foundation image set through a generator and a 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
Deep learning concrete bridge crack real-time detection method based on domain adaptation
CN114693615A
Wind turbine surface defect detection method
CN115719337A
Ship coating defect detection method based on improved attention module
CN116309502A
Transform-based multi-stage bridge defect detection method
CN116485729A
ADSS optical cable electro-corrosion defect detection method based on dynamic snakelike convolution
CN119228755A