A method for segmenting apparent defects of bridge cables based on deep learning
By improving the feature extraction and segmentation capabilities of the deep learning model, the problem of insufficient recognition accuracy in bridge cable apparent defect detection is solved, and a more efficient and accurate defect segmentation effect is achieved.
Patent Information
- Application Number
- CN202410591742.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-14
AI Technical Summary
The existing technology is insufficient in the detection of apparent defects in bridge cables, especially the identification of defects such as tiny holes and cracks, and the real-time detection and accuracy are low, making it difficult to effectively identify defect areas in complex backgrounds.
A method based on deep learning is used to construct a data set of apparent defects in bridge cables through sample enhancement and annotation. The YOLACT++ model is improved, and the anchor box generation mechanism, CBAM attention mechanism and Mish activation function are combined to optimize the feature transfer and feature extraction of the model. ability to improve the accuracy and efficiency of defect segmentation.
It achieves faster and more accurate segmentation of apparent defects in bridge cables, reduces the impact of background noise on detection results, improves the overall effect of detection, and can better identify defect areas under complex backgrounds.
Smart Images

Figure CN118351316B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of bridge health detection and machine vision technology, and in particular relates to a method for segmenting apparent defects of bridge cables based on deep learning. Background Art
[0002] The number of bridges in my country has jumped to the first place in the world. In the bridge system, cable-stayed bridges are widely used because of their stable structure, large span range and beautiful structure. Cables are the key load-bearing components of cable-stayed bridges. Their durability and bearing capacity can effectively guarantee the service performance of cable-stayed bridges. However, due to the long-term exposure of cables to the natural environment, affected by various factors such as temperature, humidity, hurricanes, and high loads, the HDPE sheath of the cables is prone to damage, and water penetrates into the cables, causing steel wires to rust, resulting in cable breakage and even bridge collapse. This will seriously affect the service life of the bridge and driving safety. The location and morphology of apparent cracks and scratches on the cables can provide a lot of information about internal damage, degradation and potential risks of the structure. Therefore, it is necessary and important to detect apparent defects of bridge cables, evaluate the health status of bridges, and carry out subsequent structural maintenance and repair.
[0003] At present, there are mainly manual inspection and machine vision-based apparent defect inspection in bridge cable surface defect inspection. Manual inspection mainly relies on human eye observation. Inspectors use high-resolution telescopes or take professional cable cars on the cables for close observation. However, manual inspection is costly, inefficient, prone to missed inspections, and poses great safety risks. Machine vision-based apparent defect inspection relies on the development of electronic technology. It uses climbing robots or drones to collect images of bridge cable surfaces, and then analyzes and processes the images based on deep learning-based apparent defect detection methods to complete the detection of bridge cable surface defects.
[0004] Although the machine vision method has low detection cost and high efficiency, the process is also relatively complicated, so it has become an important research direction for bridge cable surface defect detection.
[0005] Gao Chao et al. used Sobel edge detection and dynamic threshold segmentation to binarize the image, and completed defect recognition by image morphological operation and statistical pixel area of each connected defect, but it is difficult to effectively identify tiny hole defects and crack defects. Li Xinke et al. improved the edge detection algorithm based on the Sobel operator to identify the defects of inclined cables, but the identification of the types of defects was not comprehensive and the recognition accuracy needed to be further improved. Liu Zhaotao et al. used the mean difference, variance difference and energy difference of the grayscale histogram of adjacent cable images to identify the diseased cables, but mainly for cracking diseases. Yun et al. proposed a classifier based on convolutional variational autoencoder data generation technology and deep neural network to solve the problem of fewer defect samples, but its sensitivity to external interference in the application environment is low. Li Zhonghai et al. combined the cascaded autoencoder network and the compact convolutional neural network to complete the recognition of defect targets in the image, but the real-time detection performance is low.
[0006] Therefore, it is an urgent problem for technical personnel in this field to propose a method for segmenting apparent defects of bridge cables based on deep learning to solve the difficulties existing in the prior art. Summary of the invention
[0007] In view of the deficiencies of the existing technology and evaluation system, the present invention provides a method for segmenting apparent defects of bridge cables based on deep learning.
[0008] In order to achieve the above object, the present invention adopts the following technical solution: a method for segmenting apparent defects of bridge cables based on deep learning, comprising the following steps:
[0009] S1: Perform sample enhancement on the bridge cable apparent defect image set to generate sample images of cable apparent crack defects. Combined with the real bridge cable apparent defect images, after further manual screening, a bridge cable apparent defect image set is constructed.
[0010] S2: Annotate the constructed bridge cable apparent defect image set, unify the size of the cable apparent defect image using splitting and interpolation algorithms, annotate the defect areas in the cable apparent defect image, and obtain a bridge cable apparent defect sample image dataset that can be used to train the model;
[0011] S3: Improve the bridge cable apparent defect segmentation model based on the instance segmentation network YOLACT++, explore the feature transfer mechanism of the key structure of the YOLACT++ model, and use the anchor frame generation mechanism optimization, CBAM attention mechanism fusion and Mish activation function update to improve the bridge cable apparent defect segmentation model;
[0012] S4: dividing the bridge cable apparent defect sample image dataset into a training set and a validation set, using the training set to train the bridge cable apparent defect segmentation model to obtain a trained bridge cable apparent defect segmentation model, inputting the validation set into the trained bridge cable apparent defect segmentation model to verify the accuracy, and obtaining a verified bridge cable apparent defect segmentation model;
[0013] S5: Inputting the bridge cable apparent defect image to be processed into the verified bridge cable apparent defect segmentation model to obtain the defect segmentation result in the bridge cable apparent image.
[0014] In the above method, optionally, the specific steps of S1 include:
[0015] S101: Based on the apparent cracks of various types of existing cables, cylindrical objects and similar bridge structures, obtain crack defect mask data;
[0016] S102: subjecting the crack mask data to geometric transformation, grayscale adjustment and advanced deformation processing to achieve diversified processing of the crack mask morphology, thereby obtaining enhanced crack defect mask data;
[0017] S103: using a random positioning method, after fusing the enhanced crack defect mask data with the normal cable appearance image, a sample image of the bridge cable appearance crack defect is obtained;
[0018] S104: The generated crack defect sample images and the real cable apparent defect sample images are aggregated and manually screened to construct a bridge cable apparent defect image set.
[0019] In the above method, an optional method for optimizing the anchor box generation mechanism in S3 is as follows:
[0020] The aspect ratios of all defective targets in the training set samples were manually binned and divided into three boxes. The silhouette coefficient method was used to analyze and determine the optimal number of clusters for each data box, and the optimal number of clusters for the aspect ratio of each data box was obtained to be 2, 1, and 2, respectively. Based on the known optimal number of clusters, the K-means++ algorithm was used to cluster the aspect ratios of the defective targets in each box, and combined with manual analysis, the anchor frame aspect ratio parameters of the bridge cable apparent defect segmentation model were clarified.
[0021] The above method, optionally, the CBAM attention mechanism fusion method in S3 is:
[0022] For the YOLACT++ benchmark model, a three-layer CBAM attention module was introduced between its backbone network ResNet-50 and FPN, which was specifically integrated into the feature outputs of the C3, C4, and C5 layers of ResNet-50 to enhance the feature extraction capability of the bridge cable apparent defect segmentation model.
[0023] In the above method, the optional Mish activation function in S3 is:
[0024]
[0025] Mish = x·Tanh(ln(1+e x ))
[0026] Where x represents the activation input of the neuron;
[0027] For the FPN and Prediction Head structures of the YOLACT++ benchmark model, the Mish activation function is used to replace the Relu activation function.
[0028] In the above method, optionally, the specific content of S5 is:
[0029] The bridge cable apparent defect segmentation model inputs the bridge cable apparent defect image to be processed into the ResNet-50 network to extract the shallow semantic feature map, uses the CBAM attention module to enhance the model's perception of key features in complex images, and fuses the shallow spatial features and high-level semantic feature maps of the image through the FPN structure. The optimized anchor frame generation parameters are used to generate the defect prediction area on the output of the FPN, and the category probability and segmentation mask of the pixel point are multiplied with the feature vector. After further feature learning and processing, the defect segmentation result of the bridge cable apparent defect image is obtained.
[0030] It can be seen from the above technical solutions that, compared with the prior art, the present invention provides a method for segmenting apparent defects of bridge cables based on deep learning, which has the following beneficial effects:
[0031] (1) Based on a variety of image processing technologies, the present invention generates a large number of cable apparent crack defect images based on sample enhancement, constructs a feature-rich and category-balanced bridge cable apparent defect image dataset, and provides sufficient data support for the bridge cable apparent defect segmentation model based on deep learning;
[0032] (2) The bridge cable apparent defect segmentation model used in the method of the present invention optimizes and adjusts the preset anchor frame aspect ratio of the model through the anchor frame generation mechanism, thereby improving the accuracy of the network in defect detection; the feature extraction capability of the model is enhanced through the fusion of the CBAM attention mechanism, which strengthens the network's perception of the apparent defect area of the cable in the image and reduces the misjudgment of pixels in the defect area under complex backgrounds; the feature transfer capability of the deep structure of the model is enhanced through the Mish activation function update, thereby optimizing the model recognition speed and generalization capability;
[0033] (3) The bridge cable apparent defect segmentation method based on deep learning in the present invention can achieve faster and more accurate segmentation of bridge cable apparent defects, improve the influence of background noise on defect segmentation speed and accuracy, and enhance the comprehensive detection effect of bridge cable apparent defect segmentation. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0035] Figure 1 A flow chart of a method for segmenting apparent defects of bridge cables based on deep learning disclosed in the present invention;
[0036] Figure 2 It is a schematic diagram of the process of enhancing the apparent crack sample of the bridge cable disclosed in the present invention;
[0037] Figure 3 It is a schematic diagram of the diversified processing flow of apparent crack masks of bridge cables disclosed in the present invention;
[0038] Figure 4 It is a schematic diagram of the process flow of optimizing the aspect ratio parameters of the anchor frame disclosed in the present invention;
[0039] Figure 5 This is a schematic diagram of the attention mechanism fusion network structure disclosed in the present invention;
[0040] Figure 6 It is a schematic diagram of the architecture of the bridge cable apparent defect segmentation model disclosed in the present invention. DETAILED DESCRIPTION
[0041] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0042] In this application, 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 such actual relationship or order between these entities or operations. 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. In the absence of more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0043] Reference Figure 1 As shown, a method for segmenting apparent defects of bridge cables based on deep learning includes the following steps:
[0044] S1: The bridge cable apparent defect image set is sample enhanced. After extracting the existing crack defect mask, diversifying the defect morphology, and randomly constructing the defect image, a variety of cable apparent crack defect sample images are generated. Combined with the real bridge cable apparent defect images, after further manual screening, a feature-rich and sample-balanced bridge cable apparent defect image set is constructed;
[0045] S2: Annotate the constructed bridge cable apparent defect image set, use the splitting and interpolation algorithm to unify the size of the cable apparent defect image, annotate the defect area in the cable apparent defect image, and obtain a bridge cable apparent defect sample image dataset that can be used to train the model;
[0046] S3: Improve the bridge cable apparent defect segmentation model based on the instance segmentation network YOLACT++, explore the feature transfer mechanism of the key structure of the YOLACT++ model, and enhance the comprehensive recognition performance of the bridge cable apparent defect segmentation model through anchor frame generation mechanism optimization, CBAM attention mechanism fusion and Mish activation function update;
[0047] S4: Divide the bridge cable apparent defect sample image dataset into a training set and a validation set, use the training set to train the bridge cable apparent defect segmentation model, and input the validation set into the trained bridge cable apparent defect segmentation model to verify the accuracy;
[0048] S5: Input the bridge cable apparent defect image to be processed into the pre-trained bridge cable apparent defect segmentation model to obtain the defect segmentation result in the bridge cable apparent defect image.
[0049] Further, such as Figure 2 As shown, the specific steps of S1 include:
[0050] S101: Based on the apparent cracks of various types of existing cables, cylindrical objects and similar bridge structures, a large amount of crack defect mask data with different shapes is obtained;
[0051] S102: subjecting the crack mask data to geometric transformation, grayscale adjustment and advanced deformation processing to achieve diversified processing of the crack mask morphology, thereby obtaining enhanced crack defect mask data;
[0052] Specifically, Figure 3 As shown in the figure, for the crack defect mask obtained, a random combination method is used for diversified processing, including simple geometric transformation, basic grayscale adjustment and advanced deformation processing; then for the crack defect mask after diversified processing, a pruning method is used to remove samples larger than the resolution of the bridge cable image, and obtain effective crack defect mask data;
[0053] S103: using a random positioning method, the enhanced crack defect mask data is fused with the normal cable appearance image to generate a large number of bridge cable appearance crack defect sample images with rich features and various shapes;
[0054] Specifically, the approximate area rectangle of the cable in the image can be estimated by preset parameters first, and for crack-type defect masks of different sizes, the fusion area range of the center point of each mask in the entire cable apparent image can be adaptively calculated; then, based on this range, the coordinates of the center point of the disease mask are randomly assigned, and the disease mask is integrated into the healthy cable apparent image; finally, for the generated bridge cable apparent crack defect image, an artificial screening method is used to eliminate unreasonable fusion results, and samples of crack-type cable apparent diseases such as annular cracks, longitudinal cracks and aging cracks of different forms are obtained.
[0055] S104: The generated crack defect sample images and the real cable apparent defect sample images are aggregated, and after manual screening, a bridge cable apparent defect image set with rich features and balanced samples is constructed.
[0056] Furthermore, the optimization method of the anchor box generation mechanism in S3 is:
[0057] The aspect ratios of all defective targets in the training set samples were manually binned and divided into three boxes. The silhouette coefficient method was used to analyze and determine the optimal number of clusters for each data box, and the optimal number of clusters for the aspect ratio of each data box was obtained to be 2, 1, and 2, respectively. Based on the known optimal number of clusters, the K-means++ algorithm was used to cluster the aspect ratios of the defective targets in each box, and combined with manual analysis, the anchor frame aspect ratio parameters of the bridge cable apparent defect segmentation model were clarified.
[0058] Specifically, Figure 4 As shown in Figure 2, the specific process of optimizing the high ratio parameters for anchor box generation is as follows:
[0059] Each pixel in the five feature maps of the original model FPN generates three anchor frame aspect ratio parameters with ratios of 1, 0.5 and 2. According to the imbalance of anchor frame aspect ratio parameters in the defect area of the bridge cable apparent defect image, it is easy to cause defect omission or misdetection. The present invention optimizes the anchor frame aspect ratio parameters to improve the speed and accuracy of the model in detecting defect areas. The whole process is divided into three steps: manual data binning, contour coefficient method to determine the optimal number of clusters in each box, and K-means++ algorithm to obtain cluster values.
[0060] In manual data binning, by drawing a scatter plot of the aspect ratio data of all defect areas in the training samples, it is found that the values in the range of 0 to 2 account for the largest proportion, and then a box plot of this range is drawn, in which the data points above the quartile line 0.5 are normally distributed, while the data points below the line are relatively outliers, so the data is binned by 0.5. Through the above series of operations, the results of data binning are: box a 0-0.5, box b 0.5-2, and box c greater than 2.
[0061] The silhouette coefficient method determines the optimal number of clusters in each box. This method is used to evaluate cluster compactness and separation. The specific formula is as follows:
[0062]
[0063] Among them, a(i) represents cohesion, which calculates the average distance from sample i to other samples in the same cluster. The smaller the value, the more sample i should be clustered into this cluster; b(i) represents separation, which calculates the minimum value of the average distance from sample i to all samples in other clusters. The larger the value, the less sample i belongs to other clusters; s(i) represents clustering effect, with a range of (-1, 1). The larger the value, the better the clustering result.
[0064] Based on the silhouette coefficient method, the number of clusters for each binned data is determined: for the a-box data, the maximum silhouette coefficient of 0.64 corresponds to 2 clusters, so the number of clusters is 2; for the b-box data, the span range of the data in this area is analyzed, and the sample size that can effectively cover this area when the aspect ratio is 1 is verified through experiments, so there is no need to perform cluster analysis; for the c-box data, the maximum silhouette coefficient of 0.74 corresponds to 4 clusters. Considering that too many anchor boxes will significantly affect the real-time performance of the model, and because the sample data in this interval is small and the silhouette coefficient is still a better value when the number of clusters is 2, the number of clusters in the c-box is finally determined to be 2.
[0065] The K-means++ algorithm is used to obtain cluster values. This algorithm is an improved K-Means clustering algorithm. This method uses probability distribution to initialize cluster centers more effectively, reduces the sensitivity of the algorithm to initial values, and improves the quality and convergence speed of clustering results. The principle formula involved is as follows:
[0066]
[0067] Among them, P(x) is the probability that data point x is selected as the next cluster center; D(x) is the distance from data point x to the nearest selected cluster center; the denominator is the sum of the distances from all data points that are not selected as cluster centers to the selected cluster centers. Using the K-means++ algorithm, combined with the analysis of the considered data features, the aspect ratio parameters of the anchor box of box a are determined to be 0.147 and 0.384, the aspect ratio parameters of the anchor box of box b are 1, and the aspect ratio parameters of the anchor box of box c are 2.848 and 8.976.
[0068] The present invention optimizes the anchor frame aspect ratio parameter of the FPN network in the model through manual data binning, the silhouette coefficient method and the K-means++ algorithm, so that the bridge cable apparent defect segmentation model can better adapt to defect areas of different sizes and complex shapes in the bridge cable apparent defect image, thereby improving the training effect and segmentation performance of the bridge cable apparent defect segmentation model, and ultimately achieving faster and more accurate segmentation of bridge cable apparent defects.
[0069] Furthermore, the CBAM attention mechanism fusion method in S3 is:
[0070] For the YOLACT++ benchmark model, a three-layer CBAM attention module was introduced between its backbone network ResNet-50 and FPN, which was specifically integrated into the feature outputs of the C3, C4, and C5 layers of ResNet-50 to enhance the feature extraction capability of the bridge cable apparent defect segmentation model.
[0071] Specifically, Figure 5As shown in the figure, for the YOLACT++ benchmark model, for the C3, C4 and C5 layers of the model's backbone network ResNet-50, and the P3, P4 and P5 layers of the feature pyramid network FPN, a total of 3 layers of CBAM attention mechanism modules are introduced between feature layers of the same scale, which are used to enhance the perception ability of the bridge cable apparent defect segmentation model for key defect features and improve the defect recognition accuracy of the model.
[0072] Among them, the apparent defect image of the bridge cable is used as the input of the C1 layer of the backbone network ResNet-50, and the output of the shallow coding layer is also the input of the deep coding layer; the outputs of the C3, C4 and C5 layers are used as the main features extracted by the model backbone network ResNet-50, which takes into account the shallow spatial features and deep semantic features of the input image; the CBAM attention mechanism is introduced for this part of the features, so that the information extracted from the apparent defect image of the bridge cable is more accurate and comprehensive, thereby improving the accuracy of the model in segmenting the defective area.
[0073] Among them, the CBAM attention mechanism is composed of two modules: channel attention and spatial attention. Channel attention includes maximum pooling, average pooling, activation layer and fully connected layer in the spatial dimension, which is used to improve the weight of key channels in the input features; spatial attention includes global average pooling, channel dimension, activation layer and convolution layer in the channel dimension, which is used to strengthen the attention on the key spatial positions of the input feature map; considering both the channel and space dimensions at the same time, the feature extraction capability of the bridge cable apparent defect segmentation model is more comprehensively improved.
[0074] In the channel attention, the feature map is used as the input of the global maximum pooling to obtain a feature map of size 1×1×C. The feature map is used as the input of the global average pooling to obtain a feature map of size 1×1×C. The feature map of size 1×1×C output by the global maximum pooling and the feature map of size 1×1×C output by the global average pooling are used as the input of the perceptron. The two feature maps output by the perceptron are added together, and the output of the Sigmoid activation function is used as the output of the feature channel layer.
[0075] In spatial attention, the result of multiplying the output of the feature channel layer and the input feature map is used as the input of the average pooling to obtain a feature map of size H×W×1. The result of multiplying the output of the feature channel layer and the input feature map is used as the input of the maximum pooling to obtain a feature map of size H×W×1. The two H×W×1 feature maps are channel-concatenated and input into the 7×7 convolution layer, and then the output of the spatial layer is obtained through the Sigmoid activation function.
[0076] Among them, the features processed by the CBAM attention mechanism are used as the input of the P3, P4 and P5 layers of the feature pyramid network FPN; in FPN, after multi-scale feature fusion, the model can adapt to the characteristics of target defects of different scales and sizes, thereby enhancing the detection and recognition ability of the bridge cable apparent defect segmentation model for defective areas.
[0077] Furthermore, the Mish activation function in S3 is:
[0078]
[0079] Mish = x·Tanh(ln(1+e x ))
[0080] Where x represents the activation input of the neuron;
[0081] Specifically, for the FPN and Prediction Head structures of the YOLACT++ benchmark model, the Relu activation functions in these parts are replaced with the Mish activation function to enhance the feature transfer capability of the deep structure of the bridge cable apparent defect sub-model. The Mish activation function introduces nonlinear properties by scaling and translating the input values, and avoids the gradient vanishing problem while maintaining smoothness.
[0082] Furthermore, the specific content of S5 is:
[0083] like Figure 6 As shown in the figure, the bridge cable apparent defect segmentation model inputs the bridge cable apparent defect image to be processed into the ResNet-50 network to extract the shallow semantic feature map, uses the CBAM attention module to enhance the model's perception of key features in complex images, and fuses the shallow spatial features and high-level semantic feature maps of the image through the FPN structure. The optimized anchor frame generation parameters are used to generate the defect prediction area on the output of the FPN, and the category probability and segmentation mask of the pixel point are multiplied with the feature vector. After further feature learning and processing, the defect segmentation result of the bridge cable apparent defect image is obtained.
[0084] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0085] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for segmenting apparent defects of bridge cables based on deep learning, characterized in that: The following steps are involved: S1: Perform sample enhancement on the bridge cable apparent defect image set to generate sample images of cable apparent crack defects. Combined with the real bridge cable apparent defect images, after further manual screening, a bridge cable apparent defect image set is constructed. S2: Annotate the constructed bridge cable apparent defect image set, unify the size of the cable apparent defect image using splitting and interpolation algorithms, annotate the defect areas in the cable apparent defect image, and obtain a bridge cable apparent defect sample image dataset that can be used to train the model; S3: Improve the bridge cable apparent defect segmentation model based on the instance segmentation network YOLACT++, explore the feature transfer mechanism of the key structure of the YOLACT++ model, and use the anchor frame generation mechanism optimization, CBAM attention mechanism fusion and Mish activation function update to improve the bridge cable apparent defect segmentation model; S4: dividing the bridge cable apparent defect sample image dataset into a training set and a validation set, using the training set to train the bridge cable apparent defect segmentation model to obtain a trained bridge cable apparent defect segmentation model, inputting the validation set into the trained bridge cable apparent defect segmentation model to verify the accuracy, and obtaining a verified bridge cable apparent defect segmentation model; S5: inputting the bridge cable apparent defect image to be processed into the verified bridge cable apparent defect segmentation model to obtain the defect segmentation result in the bridge cable apparent image; The specific steps of S1 include: S101: Based on the apparent cracks of various types of existing cables, cylindrical objects and similar bridge structures, obtain crack defect mask data; S102: subjecting the crack mask data to geometric transformation, grayscale adjustment and advanced deformation processing to achieve diversified processing of the crack mask morphology, thereby obtaining enhanced crack defect mask data; S103: using a random positioning method, the enhanced crack defect mask data is fused with the normal cable appearance image to generate a sample image of the bridge cable appearance crack defect; S104: Summarize the generated crack defect sample images and the real cable apparent defect sample images, and construct a bridge cable apparent defect image set after manual screening; The optimization method of the anchor box generation mechanism in S3 is: The aspect ratios of all defective targets in the training set samples were manually binned and divided into three boxes. The silhouette coefficient method was used to analyze and determine the optimal number of clusters for each data box, and the optimal number of clusters for the aspect ratio of each data box was obtained to be 2, 1, and 2 respectively. Based on the known optimal number of clusters, the K-means++ algorithm was used to cluster the aspect ratios of the defective targets in each box, and combined with manual analysis, the anchor frame aspect ratio parameters of the bridge cable apparent defect segmentation model were clarified. The CBAM attention mechanism fusion method in S3 is: For the YOLACT++ benchmark model, a three-layer CBAM attention module is introduced between its backbone network ResNet-50 and FPN, which is specifically integrated with the feature outputs of the C3, C4, and C5 layers of ResNet-50 to enhance the feature extraction capability of the bridge cable apparent defect segmentation model; Among them, the features processed by the CBAM attention mechanism are used as the input of the P3, P4 and P5 layers of the feature pyramid network FPN; in FPN, after multi-scale feature fusion, the model can adapt to the characteristics of different scales and sizes of target defects, thereby enhancing the detection and recognition capabilities of the bridge cable apparent defect segmentation model for defect areas; The Mish activation function in S3 is: in, x represents the activation input of the neuron; For the FPN and Prediction Head structures of the YOLACT++ benchmark model, the Mish activation function is used to replace the Relu activation function; The specific contents of S5 are: The bridge cable apparent defect segmentation model inputs the bridge cable apparent defect image to be processed into the ResNet-50 network to extract the shallow semantic feature map, uses the CBAM attention module to enhance the model's perception of key features in complex images, and fuses the shallow spatial features and high-level semantic feature maps of the image through the FPN structure. The optimized anchor frame generation parameters are used to generate the defect prediction area on the output of the FPN, and the category probability and segmentation mask of the pixel point are multiplied with the feature vector. After further feature learning and processing, the defect segmentation result of the bridge cable apparent defect image is obtained.
