A Bridge Defect Instance Segmentation Method and System Based on Structural Prior Attention Fusion
By generating multi-channel structural prior tensors and reliability maps, and combining reliability gating and structural consistency attention residual fusion, the robustness and accuracy issues of existing bridge defect segmentation schemes in complex scenarios are solved, achieving high-quality defect identification and quantification.
Patent Information
- Application Number
- CN202611310577.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-10
AI Technical Summary
Existing bridge defect instance segmentation schemes struggle to effectively utilize prior structural information in complex scenarios, resulting in insufficient recall of minor defects, poor segmentation boundary quality, and an inability to simultaneously meet robustness, pixel-level segmentation accuracy, and engineering quantification requirements.
By generating multi-channel structural prior tensors and reliability maps, and combining reliability gating and structural consistency attention residual fusion, multi-scale features are extracted and defect instance segmentation is performed to generate pixel-level segmentation results, including boundary quality scores and engineering quantification indicators.
It improves the robustness of disease identification and the interpretability of results in complex backgrounds, enhances the recall capability of minor diseases, and provides reliable boundary quality scores and engineering quantitative indicators, which facilitates subsequent result verification and screening.
Smart Images

Figure CN123071302A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent bridge inspection technology, specifically to a method and system for segmenting bridge defects based on structural prior attention fusion. Background Technology
[0002] With the increasing demands for efficiency and accuracy in bridge operation and maintenance management, image-based intelligent inspection technology has gradually replaced traditional manual interpretation methods, becoming the mainstream approach for bridge defect investigation. In existing technologies, deep learning-based instance segmentation models have been applied to identify bridge defects such as cracks, exposed rebar, corrosion, and spalling, outputting defect categories and pixel-level segmentation results. Existing solutions include four categories: manual interpretation, traditional image processing, object detection models, and instance segmentation models. Manual interpretation is inefficient and highly subjective; object detection can only output rectangular boxes, failing to provide pixel-level boundaries; traditional image processing relies on thresholds, edge and color rules, lacking robustness in complex backgrounds; pure deep instance segmentation models primarily rely on training data to learn bridge defect morphology, lacking explicit engineering physical prior constraints. To optimize recognition performance in complex scenarios, some solutions attempt to introduce prior structural information about bridge defects to assist network feature learning.
[0003] However, in practical applications, existing bridge defect instance segmentation schemes have obvious defects in their use of structural priors: either the structural priors are directly involved in defect determination in the form of fixed hard rules, which easily introduces background interference such as shadows, water stains, and construction joints as effective priors, thus introducing a lot of noise; or they are simply spliced to the image input as an additional channel, and the prior information cannot be effectively integrated with the depth features. The network cannot truly use the priors to enhance the expression of defect features, resulting in insufficient recall rate for small defects in complex bridge scenarios, poor segmentation boundary quality, and an inability to simultaneously take into account the robustness of defect recognition, pixel-level segmentation accuracy, engineering quantification requirements, and control of edge inference overhead. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention proposes a bridge defect instance segmentation method and system based on structural prior attention fusion to solve the aforementioned technical problems.
[0005] Firstly, a bridge defect instance segmentation method based on structural prior attention fusion is provided, including: The bridge surface image is acquired and preprocessed to obtain the standard input image; The standard input image is used to perform prior calculations of bridge defects, generating a multi-channel structural prior tensor and a reliability map characterizing the prior confidence level of each pixel; Extract the original multi-scale features of the standard input image, and perform gated encoding on the multi-channel structural prior tensor based on the reliability map to obtain structural prior fusion features; The original image's multi-scale features are fused with the structural prior fusion features using structural consistency attention residual fusion to obtain the fused multi-scale features. The fused multi-scale features are input into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance.
[0006] Specifically, this invention differs from existing bridge defect segmentation schemes in three core aspects: prior utilization method, feature fusion mechanism, and output value. Compared to target detection schemes that only output rectangular detection boxes and traditional image processing schemes that rely on fixed threshold rules, this scheme can output pixel-level segmentation masks, boundary quality scores, and engineering quantitative indicators, directly supporting defect length and area calculations and risk level assessments. Compared to pure depth segmentation networks that lack clear engineering physical prior constraints, this scheme integrates bridge defect morphology priors, pixel-level reliability, and prior conflict suppression mechanisms into multi-scale feature learning, improving... This approach enhances the robustness and interpretability of recognition in complex contexts. Compared to schemes that simply concatenate priors to the image input, this approach encodes priors through reliability gating and then uses structural consistency attention at multi-scale feature layers to achieve explicit feature modulation. This ensures the effective implementation of priors while preventing erroneous priors from interfering with the semantics of the original image. Compared to general self-learning attention modules and general instance segmentation heads, the attention in this approach is constrained by both engineering priors and semantic conflicts. The segmentation mask is generated from a dynamic prototype constrained by lesion morphology. There are hierarchical data dependencies between modules, rather than a simple stacking of independent algorithm modules.
[0007] Furthermore, the bridge surface image is acquired and preprocessed to obtain a standard input image, including: The bridge surface image is processed sequentially with size normalization, noise reduction, brightness equalization, and color correction to obtain a standard input image.
[0008] Furthermore, prior calculations of bridge defect structures are performed on the standard input image to generate a multi-channel structural prior tensor and a reliability map characterizing the prior confidence level of each pixel, including: Calculate the local dark and fine response, direction-consistent response, paired edge response, color deviation response, texture fragmentation response, and boundary closure response for the standard input image to obtain the basic response set; Based on the engineering form constraints corresponding to various bridge defects, the basic response set is weighted and combined to generate a multi-channel structural prior tensor that includes at least two types of defect priors. By combining candidate response intensity, morphological constraint satisfaction, neighborhood consistency, background interference suppression term, and category mutual exclusion term, the pixel-level reliability of each channel in the prior tensor of the multi-channel structure is calculated, and the multi-channel reliability map is obtained by stitching them together.
[0009] Furthermore, the original multi-scale features of the standard input image are extracted, and the multi-channel structural prior tensor is gate-coded based on the reliability map to obtain structural prior fusion features, including: The multi-channel structural prior tensor and the reliability map are concatenated by channel, and the local structural response is obtained through channel integration and neighborhood aggregation. The reliability map is scaled to the corresponding feature scale to generate spatial gating weights; The spatial gating weights are used to perform element-wise modulation on the local structural response to obtain multi-scale gating prior coding features; Spatial alignment and channel projection are performed on the multi-scale gated prior coding features to obtain structural prior fusion features.
[0010] Furthermore, the multi-scale features of the original image are fused with the structural prior fusion features using structural consistency attention residual fusion to obtain fused multi-scale features, including: Perform channel concatenation and element-wise multiplication operations on the prior fusion features of the structure and the multi-scale features of the original image to generate a spatial attention map; Global pooling and channel mapping are performed on the prior fusion features of the structure to generate a channel selection vector; Perform feature difference operation on the multi-scale features of the original image and the prior fusion features of the structure to generate a prior conflict suppression term; Using the original image's multi-scale features as the residual basis, feature modulation is performed by combining the spatial attention map, channel selection vector, and prior conflict suppression term. After channel reshaping, the fused multi-scale features are obtained.
[0011] Furthermore, the fused multi-scale features are input into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance, including: The fused multi-scale features are subjected to feature encoding and prototype generation processing to obtain multiple sets of disease mask prototypes and feature vectors of each candidate instance. The feature vectors of the candidate instances are integrated to obtain instance description vectors; wherein, the instance description vectors include category embedding, location embedding, feature pooling vector, prior reliability statistics and disease morphology description, and the disease morphology description includes at least one of the following: slenderness ratio, skeleton continuity, and boundary closure. The instance description vector is weighted to obtain the dynamic prototype combination weights corresponding to each candidate instance. The dynamic prototype combination weights are used to combine and calculate multiple disease mask prototypes to obtain the disease category, pixel-level mask, corresponding classification probability, and mask response intensity of each disease instance.
[0012] Furthermore, after obtaining the pixel-level mask for each disease instance, the process also includes: By combining the boundary matching degree and the mean of the prior reliability of the corresponding category structure, the boundary quality score of each disease instance is calculated; By combining the pixel-level mask with the region matching degree and the mean of the prior reliability of the corresponding category structure, the prior consistency score of each disease instance is calculated. The overall confidence level of each disease instance is calculated by combining the classification probability, mask response intensity, and the mean of prior reliability.
[0013] Furthermore, after obtaining the pixel-level mask for each disease instance, the process also includes: Perform connected component analysis, hole filling, boundary smoothing, and defect morphology verification on the pixel-level mask to obtain a refined instance mask; Based on the refined instance mask, the disease quantification index is calculated, wherein the disease quantification index includes area, length, average width, maximum width, and boundary integrity. Risk classification is performed by combining the disease categories, disease quantitative indicators, boundary quality scores, and prior consistency scores to generate structured inspection results.
[0014] Secondly, a bridge defect instance segmentation system based on structural prior attention fusion is provided. This system, based on any of the preceding descriptions of the bridge defect instance segmentation system based on structural prior attention fusion, includes: The image acquisition module is used to acquire images of the bridge surface and perform preprocessing to obtain a standard input image. The structural prior generation module is used to perform bridge defect structural prior calculation on the standard input image, and generate a multi-channel structural prior tensor and a reliability map characterizing the prior credibility of each pixel. The dual-branch feature extraction module is used to extract the original multi-scale features of the standard input image and to perform gated encoding on the multi-channel structural prior tensor based on the reliability map to obtain structural prior fusion features. The attention fusion module is used to perform structural consistency attention residual fusion of the original image multi-scale features and the structural prior fusion features to obtain fused multi-scale features. The instance segmentation module is used to input the fused multi-scale features into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance.
[0015] Furthermore, it also includes a result quantification and report generation module, which is used to refine, quantify and classify the pixel-level segmentation results, generate a disease ledger and a structured inspection report, and output them to the corresponding terminal or maintenance system.
[0016] The invention employing the above technical solution has the following advantages: 1. This invention generates multi-channel structural prior tensors for cracks, exposed rebar, corrosion, and spalling by designing multiple basic responses and engineering morphological constraints for bridge defects. This can effectively enhance candidate features of low-contrast cracks, exposed rebar, and spalling / fracture boundaries, improving the recall capability of difficult defects. The simultaneously generated pixel-level reliability map calibrates the prior credibility from multiple dimensions such as candidate response intensity, morphological constraint satisfaction, and background interference suppression, thereby reducing the prior influence of interference areas such as shadows, water stains, and construction joints, and thus avoiding invalid noise from entering the subsequent network.
[0017] 2. This invention adopts a reliable gating prior coding method, combines scale alignment and channel projection to generate structural prior fusion features that match the features of the original image, and then uses a residual fusion mechanism that combines spatial attention, channel selection and prior conflict suppression to specifically enhance the expression of the disease features of the original image in reliable prior regions, and automatically reduce the prior modulation intensity in regions where the prior and the semantics of the original image are inconsistent.
[0018] 3. This invention adopts a dynamic prototype mask generation method that incorporates disease morphology description and prior reliability statistics, enabling different morphological diseases to be matched with suitable mask prototype combinations, thus alleviating the problems of fine cracks, irregular peeling, rough boundaries, and fragmentation of rusted areas. At the same time, based on the matching relationship between the predicted mask and the prior structure of the corresponding category, the boundary quality score and the prior consistency score are calculated, which can provide interpretable quality quantification indicators for the segmentation results, facilitating subsequent result verification and screening. Attached Figure Description
[0019] To more clearly illustrate the specific embodiments of the present invention, the accompanying drawings used in the specific embodiments will be briefly described below. In all the drawings, the elements or parts are not necessarily drawn to scale.
[0020] Figure 1 This is the flowchart of the bridge defect instance segmentation method based on structural prior attention fusion of the present invention. Figure 1 ; Figure 2 This is a flowchart of the multi-disease structural prior graph generation process in the bridge defect instance segmentation method based on structural prior attention fusion of the present invention. Figure 3 This is an architecture diagram of the structural prior attention fusion module in the bridge defect instance segmentation method based on structural prior attention fusion of the present invention. Figure 4 This is the multi-scale instance segmentation output image in the bridge defect instance segmentation method based on structural prior attention fusion of the present invention; Figure 5 This is an architecture diagram of the bridge defect instance segmentation system based on structural prior attention fusion according to the present invention; Figure 6 This is the flowchart of the bridge defect instance segmentation method based on structural prior attention fusion of the present invention. Figure 2 . Detailed Implementation
[0021] The embodiments of the technical solution of the present invention will now be described in detail with reference to the accompanying drawings. These embodiments are merely illustrative of the technical solution of the present invention and are therefore intended to limit the scope of protection of the present invention.
[0022] like Figures 1-6 As shown, the bridge defect instance segmentation method based on structural prior attention fusion of the present invention includes: The bridge surface image is acquired and preprocessed to obtain the standard input image; In this embodiment, a bridge surface image is acquired and preprocessed to obtain a standard input image, including: The bridge surface image is processed sequentially with size normalization, noise reduction, brightness equalization, and color correction to obtain the standard input image.
[0023] Specifically, depending on the parameters of the acquisition device, distortion correction can be selectively performed to eliminate image distortion caused by shooting angle and lens distortion; size normalization is used to unify acquired images of different resolutions to the network input size; denoising is used to suppress random noise introduced during image acquisition and transmission; brightness equalization is used to compensate for the difference in brightness caused by uneven lighting on site; and color correction is used to unify the color response of different devices, thereby ensuring the stability of subsequent prior calculations.
[0024] Perform prior calculations on the bridge defect structure of the standard input image to generate a multi-channel structural prior tensor and a reliability map representing the prior confidence level of each pixel; In this embodiment, prior calculations of bridge defect structures are performed on the standard input image to generate a multi-channel structural prior tensor and a reliability map characterizing the prior confidence level of each pixel, including: Calculate the local dark and fine response, orientation-consistent response, paired edge response, color deviation response, texture fragmentation response, and boundary closure response for the standard input image to obtain the basic response set; Based on the engineering form constraints corresponding to various bridge defects, the basic response set is weighted and combined to generate a multi-channel structural prior tensor that includes at least two types of defects. By combining candidate response intensity, morphological constraint satisfaction, neighborhood consistency, background interference suppression term, and category mutual exclusion term, the pixel-level reliability of each channel in the multi-channel structural prior tensor is calculated, and the multi-channel reliability map is obtained by stitching them together.
[0025] Specifically, the prior generation logic and function of various diseases are as follows: Table 1
[0026] First, the standard input image I is transformed to obtain the luminance channel Y, color channel C, and local texture channel T. Then, at different window scales... The underlying set of responses is obtained by calculating local dark and fine response, orientation-consistent response, paired edge response, color deviation response, texture fragmentation response, and boundary closure response. Each basic response is normalized to 0-1 and then enters the category prior generator.
[0027] The formula for calculating the local dark and fine response is as follows:
[0028] Used to characterize the degree of darkness of a pixel relative to its surroundings within a local area, corresponding to the gray-scale abrupt change characteristics of crack-type diseases.
[0029] The formula for calculating the directionally consistent response is:
[0030] In the formula, The direction line segment passing through pixel x is used to characterize the consistency of the local gradient direction, corresponding to the directional continuity features of linear defects such as cracks and exposed reinforcement.
[0031] The formula for calculating paired edge response is:
[0032] Used to characterize the consistency and parallelism of the distance between the two edges of exposed reinforcement or cracks, corresponding to the paired edge characteristics of strip-shaped diseases.
[0033] The formula for calculating color deviation response is:
[0034] In the formula, Σ represents the mean of the local non-candidate background colors, and Σ is the color covariance or diagonal normalized matrix.
[0035] The formula for calculating texture fragmentation response is:
[0036] In the formula, It is a normalized HOG histogram The information entropy is calculated using the following formula:
[0037] Used to characterize rough texture features in areas of peeling or corrosion.
[0038] The formula for calculating the boundary closure response is:
[0039] In the formula, L represents the length, which is used to characterize the boundary closure trend of the candidate region, corresponding to the blocky boundary characteristics of peeling diseases.
[0040] Specifically, the prior structures for each category are generated using a weighted combination of disease morphology constraints:
[0041]
[0042]
[0043]
[0044] In the formula, For breakpoint bridging response, For skeleton continuity, For strip spindle consistency, For the difference in metallic texture, For occlusion compensation, For color diffusion consistency, For shadow suppression, The response is a convergence response at a broken boundary. For bump and shading response.
[0045] Crack continuity prior The process of obtaining it is as follows: calculate the local dark and fine response. Response in the same direction Linear accumulation and breakpoint bridging are performed along the main direction. Candidate connected components are checked for width stability, endpoint extensibility, and skeleton continuity. Texture lines with excessively large width abrupt changes or that do not meet the elongated shape requirement are filtered out to obtain continuous values. .
[0046] Exposed tendon strip prior test The process of obtaining the data is as follows: Calculate the paired edge density, strip principal axis direction, metal texture difference, and local occlusion compensation response, and form the data based on aspect ratio, edge parallelism, and internal texture consistency of the strip. .
[0047] Rust color-texture prior The process of obtaining the result is as follows: Based on the adaptive estimation of the reddish-brown deviation response of the local background of the image, combined with the neighborhood color diffusion consistency and rough texture response, shadow, mud stains, and lighting color cast areas are suppressed to obtain the result. .
[0048] Prior knowledge of the detachment and fragmentation boundary The process of obtaining the result is as follows: calculate local texture abrupt changes, fragmented boundary aggregation, bump shadow response, and block integrity, and obtain the result based on the boundary closure trend and the texture differences within the region. The above. , , , All can be initialized by rule parameters or training set statistical parameters, and can be fine-tuned during the training phase using learnable weights.
[0049] The process of generating the reliability map R is as follows: for each type of prior... Simultaneously calculate candidate response strength morphological constraint satisfaction Neighborhood Consistency Background interference suppression term and category mutual exclusion ;in, From the intensity of the corresponding candidate image, Constraints arising from disease morphology such as aspect ratio, continuity, closure, or color diffusion. It indicates the degree of consistency in response direction, color, or texture within a local neighborhood. Higher values should be used in areas with interference such as shadows, water stains, construction joints, and ordinary textures. Reduce the weight of non-dominant categories when multiple disease channels conflict with each other.
[0050] Single-channel reliability can be measured as follows:
[0051] calculate in, to For reliability component weights; the multi-channel reliability map R can be represented as concat( ,..., When single-channel gating is required, it can be used. Alternatively, a weighted fusion based on category weights can be used. Thus, the reliability graph can clearly indicate whether the prior is reliable at the current location, rather than simply replicating the candidate prior graph.
[0052] The weight parameters are determined as follows: to Initially, statistics can be generated using a small number of labeled samples, for example, to simulate the actual diseased area. , , The mean contribution is higher than that of the background interference term. and category mutual exclusion When training data is available, to Participating as a learnable parameter and The backpropagation update can be used; when deployed in a lightweight manner on the edge, the stable parameters obtained by the validation set grid search can also be fixed.
[0053] Unified Prior Fusion Weights Initialize the dataset based on the frequency of disease types, mean reliability, and validation set performance, and apply prior consistency loss during the training phase. Update; Multi-scale fusion modulation coefficients Initialize to small positive values to ensure the model primarily uses RGB semantics during initial training, then adjust based on prior effectiveness at each scale; dynamically combine weights using a prototype. Vectors described by instances Generated by Softmax, these are sample-level dynamic weights, rather than fixed global parameters.
[0054] Formula 4-1: Prior multi-channel splicing of structure:
[0055] In the formula, P is the prior tensor of the multi-channel structure; concat(·) represents concatenation by channel dimension; For the continuity of cracks, a priori; Exposed reinforcement strips are a prerequisite; For rust color-texture priors; The a priori for the detachment and fragmentation boundary.
[0056] Each prior channel is a continuous value probability map, not the final segmentation result.
[0057] Formula 4-2 Reliability Weighted Unified Prior:
[0058] In the formula, To unify the prior graph structure; K represents the number of prior channels participating in the fusion; This is the prior graph of the k-th type of structure; This is the prior reliability map for the k-th type; ε represents the learnable fusion weights of the k-th prior; ε is a stabilizing term to prevent the denominator from being zero.
[0059] The prior quality gating module performs isolated noise suppression, small connected component filtering, excessively large background region suppression, category mutual exclusion coordination, and merging of adjacent suspected regions on P and R. The output of this gating is a continuous probability map and reliability weights, which are not used as the final disease segmentation result; the final determination is still completed by the subsequent structural consistency fusion network combined with RGB semantics.
[0060] Extract multi-scale features from the original image of the standard input image, and perform gated encoding on the multi-channel structural prior tensor based on the reliability map to obtain structural prior fusion features; In this embodiment, multi-scale features of the original standard input image are extracted, and the multi-channel structural prior tensor is gated-encoded based on the reliability map to obtain structural prior fusion features, including: The multi-channel structural prior tensor and reliability map are spliced together by channel, and the local structural response is obtained by channel integration and neighborhood aggregation. The reliability map is scaled to the corresponding feature scale to generate spatial gating weights; By employing spatial gating weights to perform element-wise modulation on the local structural response, multi-scale gating prior coding features are obtained. Spatial alignment and channel projection are performed on the multi-scale gated prior encoded features to obtain structural prior fusion features.
[0061] Specifically, the structure-aware dual-branch feature extraction network consists of an original image semantic encoding branch and a structure prior enhancement branch.
[0062] The original image semantic encoding branch takes the RGB image I as input and uses a hierarchical residual aggregation unit to extract multi-scale image features Fi. The hierarchical residual aggregation unit includes local texture convolution, cross-scale downsampling, residual connection and lightweight normalization, which are used to preserve details such as crack ends and peeling edges in the shallow layer and extract semantics of the disease area in the deep layer.
[0063] In the main implementation, the structural prior enhancement branch can directly generate structural prior candidate features from the corresponding scale features through lightweight convolution and participate in subsequent fusion, thereby achieving trainability and deployment without changing the basic interface of the general segmentation head. In the main implementation, the structural prior enhancement branch does not require additional explicit prior map input; it directly uses the features of the original map at the i-th scale. Based on this, structural prior fusion features Fs,i are generated endogenously through 1×1 channel integration, 3×3 neighborhood aggregation, and Sigmoid gating, and then directly inserted into the multi-scale feature stream of the backbone or neck network. This implementation can be completed in the existing YOLO segmentation network by adding a lightweight structural prior attention fusion module, without requiring additional annotation types or rewriting of the general segmentation head, and has the advantages of simple training links and low deployment costs.
[0064] In a preferred embodiment, externally generated structural prior maps and reliability maps may also be introduced as enhanced inputs.
[0065] The primary implementation method requires no additional annotation of prior information, has a simple training path, low deployment cost, and can be directly adapted to existing mainstream segmentation network architectures. The preferred enhanced implementation method introduces explicit priors and morphological constraints, resulting in better recognition accuracy and boundary quality. It is suitable for scenarios with higher requirements for detection performance. Both methods retain the complete structural prior attention fusion core mechanism.
[0066] Formula 4-3 Reliability Gated Prior Encoding and Scale Alignment:
[0067]
[0068] In the formula, Input tensors for the prior branches; The local structural response is obtained through 1×1 category selection and 3×3 neighborhood aggregation; The spatial gating weights are generated after scaling the reliability map R to the i-th scale; Let i be the gated prior encoding feature for the i-th scale; To match the features of the original image Aligned structural prior fusion features; δ(·) represents nonlinear activation; Resize(·) represents scaling transformation; (·) indicates spatial alignment; (·) indicates channel projection; ⊙ indicates element-wise multiplication.
[0069] Wherein, the 1×1 mapping is used in , , , , Class selection weights are generated between R and the algorithm, and their parameters are learned through backpropagation during the training phase; 3×3 local aggregation is used to encode the continuity, striping, color diffusion, and boundary closure information of neighboring pixels into neighborhood structure responses. ; The reliability map R is generated through scaling, 1×1 mapping, and sigmoid activation. Lower values indicate stronger prior noise at that location, thus... The strength of this coding unit is weakened. This coding unit differs from ordinary convolutional coding in that its convolutional input, spatial gating, and scale alignment are all constrained by the prior knowledge of bridge defects and their reliability.
[0070] Figure 1 In This represents the scale-aligned prior features fed into the structural consistency attention fusion module. In other words, It is the original gated prior code generated by the prior reliability coding branch at the i-th scale. Features of the original image Aligned and fused input; used by subsequent attention modules and calculate , and .
[0071] Through the above design, the prior branch does not simply perform convolutional encoding on traditional visual results, but instead uses reliability to learnably suppress prior noise and provides structural cues corresponding to the morphology of the disease at multiple scales. This structure enables the model to maintain high stability even in scenarios such as low-contrast cracks, rust and stains that are similar, and broken edges of peeling.
[0072] The original image's multi-scale features and structural prior fusion features are fused using structural consistency attention residual fusion to obtain the fused multi-scale features. In this embodiment, the multi-scale features of the original image are fused with the structural prior fusion features using structural consistency attention residual fusion to obtain the fused multi-scale features, including: Perform channel splicing and element-wise multiplication operations on the structural prior fusion features and the multi-scale features of the original image to generate a spatial attention map; Global pooling and channel mapping are performed on the structural prior fusion features to generate channel selection vectors; Perform feature difference operation on the multi-scale features and structural prior fusion features of the original image to generate a prior conflict suppression term; Using the multi-scale features of the original image as the residual basis, feature modulation is performed by combining the spatial attention map, channel selection vector and prior conflict suppression term, and the fused multi-scale features are obtained after channel reshaping.
[0073] Specifically, the structural consistency attention fusion module is used to address the issues of false detections, missed detections, or scale misalignment in the prior image. For the features of the original image at the i-th scale... and structural prior fusion features The module first jointly computes spatial attention. Channel selection vector and prior conflict suppression term .
[0074] in, This indicates the increased weight of suspected diseases in terms of spatial location. This indicates the feature channel weights related to the current disease morphology. This indicates the prior influence that needs to be reduced when there is a conflict between RGB semantics and structural priors.
[0075] Formula 4-4 Structural Consistency Attention Generation:
[0076]
[0077]
[0078] In the formula, Spatial attention map; Choose a vector for the channel; σ is the prior conflict suppression term; σ(·) is the Sigmoid activation function; GAP(·) is the global average pooling; For already mapped to Prior fusion features of structures with the same spatial size and number of channels; [·,·] represents channel splicing.
[0079] This invention uses only formulas 4-5 to calculate the fused features. Formula 4-4 is only used to generate the fusion required. , and inaction The alternative calculation formula.
[0080] Formulas 4-5 simultaneously incorporate four parts: spatial enhancement, channel selection, conflict suppression, and residual preservation. This ensures that the structural prior can only enhance the original image features in reliable regions; when the prior conflicts with the semantics of the original image, This will reduce the prior modulation intensity and prevent false detections of prior information from overriding the semantics of the original image.
[0081] Formula 4-5 Structural Consistency Residual Fusion:
[0082] In the formula, This represents the i-th scale feature after fusion. This represents the i-th scale feature of the original image branch; Spatial attention map; Choose a vector for the channel; This is a priori conflict suppression term; Let be the learnable modulation coefficients at the i-th scale; ⊙ denotes element-wise multiplication; (·) indicates channel compression and feature remodeling mapping.
[0083] The value of is used to control the prior injection intensity of structures at different scales. Shallow scale More emphasis is placed on enhancing details such as crack ends, exposed reinforcement edges, and spalling edges; mid-level scale More emphasis is placed on semantic confirmation of linear, strip-shaped, and block-shaped candidate regions; deep-scale It places greater emphasis on integrity constraints for large-area instances such as rust and flaking. During training... By learning through a comprehensive loss function, the numerical values obtained during inference are consistently used.
[0084] Specifically, the role of structural priors varies at different feature scales: Shallow scales correspond to high-resolution edges, textures, and local details, while structural a priori focuses on enhancing crack ends, minor exposed ribs, and spalling / fracture boundaries, while simultaneously... Suppress interference from construction seams and shadows to improve recall of small targets and clarity of mask boundaries; The mid-level scale corresponds to local semantics and regional structure. The structural prior focuses on fusing linear, strip, and block candidate regions, and selects vectors based on channels to highlight corresponding disease features, thereby reducing false detections caused by ordinary textures, stains, and watermarks. The deep scale corresponds to high-level semantics and global spatial distribution. The structural prior focuses on injecting information on the overall distribution of areas such as corrosion and peeling, and constrains the adhesion and fragmentation between instances, in order to improve the integrity and category stability of large-area disease instances.
[0085] The prior effects and corresponding outcomes of each feature level are as follows: Table 2
[0086] The fused multi-scale features are input into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance.
[0087] In this embodiment, the fused multi-scale features are input into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance, including: The fused multi-scale features are processed by feature encoding and prototype generation to obtain multiple sets of disease mask prototypes and feature vectors of each candidate instance. Information is integrated from the feature vectors of candidate instances to obtain instance description vectors; wherein, instance description vectors include class embedding, location embedding, feature pooling vector, prior reliability statistics and disease morphology description, and disease morphology description includes at least one of the following: slenderness ratio, skeleton continuity and boundary closure. The instance description vector is weighted to obtain the dynamic prototype combination weights for each candidate instance. The dynamic prototype combination weights are used to combine and calculate multiple disease mask prototypes to obtain the disease category, pixel-level mask, corresponding classification probability, and mask response intensity for each disease instance.
[0088] Specifically, the fused multi-scale features F'i are input into the general instance segmentation output head in the main implementation to output the disease category, confidence level, bounding box, and pixel-level mask; then, in the result refinement and quantification stage, the structural prior consistency, boundary closure, and disease morphology statistics are combined to generate boundary quality score, prior consistency score, and engineering quantification index.
[0089] This primary implementation already possesses a well-defined software structure, training entry point, and repeatable training path. As a preferred enhanced implementation, the fused multi-scale features F'i can also be input into the adaptive prototype mask segmentation head to further enhance the specialized representation capabilities for fine cracks, exposed rib strips, and irregular peeling boundaries.
[0090] In the main implementation, the reasoning process includes: First, performing category prediction, bounding box regression, and pixel-level mask prediction on the fused feature F' to obtain the basic instance segmentation result; second, performing connected component analysis, boundary smoothing, structural prior consistency verification, and disease morphology statistics on the predicted mask to obtain boundary quality score, prior consistency score, and quantitative indicators such as area, length, and width; finally, forming a structured output based on the disease category, quantitative indicators, and score results. As a preferred enhanced implementation, dynamic prototype combination weights can also be further introduced. And a multi-prototype mask generation process to obtain a stronger ability to express small targets and irregular boundaries.
[0091] In the preferred enhancement implementation, dynamic prototype combination weights The generation process is as follows: embedding the category and location of the s-th instance candidate, fusing the feature pooling vector, corresponding prior reliability statistics, and disease morphology description. Concatenate into instance description vectors After passing through two layers of perceptron and Softmax, the following is obtained:
[0092] In the formula, Let represent the contribution weight of the s-th instance to the j-th mask prototype, and Disease morphology description quantity It includes at least one of the following: slenderness ratio, skeleton continuity, boundary closure, color diffusion, and texture fragmentation, so that different types of diseases can choose different prototype combinations: fine cracks tend to be slender and continuous prototypes, exposed veins tend to be striped edge prototypes, corrosion tends to be color diffusion prototypes, and peeling tends to be blocky closed boundary prototypes.
[0093] To avoid the dynamic prototype mask degenerating into a general prototype combination, this invention sets morphologically constrained prototype sets for different bridge defects:
[0094] Constraining slender, continuous structures, primarily serving cracks; Constrain paired edges and strip spindles, primarily serving exposed ribs; It restricts color diffusion and rough texture, primarily serving corrosion; Constrained block regions and boundary closures, primarily serving the peeling process. Instance description vector. The category embedding and morphological description quantity together determine the weight of each prototype.
[0095] In the preferred enhanced implementation, the disease morphology constraint can be expressed as:
[0096] In the formula, Constraining the continuity and width stability of the crack mask skeleton Constrain the aspect ratio and edge parallelism of exposed reinforcement strips. Constrain the uniformity of color diffusion in the corroded area. Constraining the boundary closure and region integrity of the peeling area. This constraint is used to enhance the bridge-specific representation capability of the adaptive prototype mask head, rather than requiring the main implementation to rewrite the general segmentation head.
[0097] Formula 4-6 Adaptive Prototype Mask Generation:
[0098] In the formula, is the pixel-level mask for the s-th disease instance; J is the number of mask prototypes; This is the j-th mask prototype generated from the fusion feature F'; σ is the dynamic combination weight of the s-th instance with the j-th prototype; σ(·) is the Sigmoid activation function.
[0099] In this embodiment, after obtaining the pixel-level mask for each disease instance, the method further includes: By combining the boundary matching degree and the mean of the prior reliability of the corresponding category structure, the boundary quality score of each disease instance is calculated; By combining the pixel-level mask with the region matching degree and the mean of the prior reliability of the corresponding category structure, the prior consistency score of each disease instance is calculated. The overall confidence level of each disease instance is calculated by combining the classification probability, mask response intensity, and the mean of prior reliability.
[0100] Specifically, Formula 4-7 boundary quality score
[0101] In the formula, The boundary quality score for the s-th instance; Edge(·) represents the boundary extraction operator; This represents the structural prior channel corresponding to the s-th instance category; This represents the average reliability within the instance region.
[0102] The instance category label is obtained by performing Softmax on the candidate instance vectors in the classification branch and taking the category with the highest probability; the confidence score is jointly determined by the classification probability, the average mask response, and the mean prior reliability, and can be expressed as:
[0103] The bounding box (bbox) is made up of pixel-level masks. The minimum bounding rectangle is obtained, or it is obtained by weighting and correcting the bounding rectangle of the mask after the detection box regression branch prediction.
[0104] Prior consistency score It can be represented as:
[0105] Or adopt Continuous priors with the corresponding category Weighted correlation calculation; In the formula, As a priori threshold, This represents the average reliability within the instance region.
[0106] Risk level Classification is based on disease type, area, length, average width, boundary quality score, and prior consistency score, for example, by... Alternatively, the risk classifier obtained through training may output low, medium, or high levels.
[0107] Disease Quantitative Indicators It includes at least one of the following: area, length, average width, maximum width, circumscribed range, and region integrity. The area is calculated from the number of mask pixels and the scale factor; the crack length is calculated from the number of skeleton pixels; the crack width is calculated from the ratio of area to skeleton length or from distance transformation statistics; the boundary integrity is calculated by combining the ratio of closed boundary length to instance outer contour length, the number of holes, and the number of fragments.
[0108] The output of the method of this invention may include: disease category label, instance number id, confidence score, bounding box (bbox), pixel-level mask, and boundary quality score. Disease Quantitative Indicators Prior consistency score and risk level In the main implementation, the mask can be output by a general instance segmentation head, and the above-mentioned score and quantitative index can be obtained through result refinement and structural prior consistency verification. In the preferred enhanced implementation, the mask can be further refined by dynamic prototype combination to alleviate the problems of fine crack fracture, rough peeling edges and fragmentation of rusted areas.
[0109] In this embodiment, after obtaining the pixel-level mask for each disease instance, the method further includes: Perform connected component analysis, hole filling, boundary smoothing and defect morphology verification on the pixel-level mask to obtain the refined instance mask; The disease quantification index is calculated based on the refined instance mask, which includes area, length, average width, maximum width and boundary integrity. Risk classification is performed by combining disease category, disease quantitative indicators, boundary quality score and prior consistency score, and structured inspection results are generated.
[0110] Specifically, after inference, the predicted mask undergoes connected component analysis, hole filling, small region filtering, boundary smoothing, and category-specific morphology verification, combined with boundary quality scoring. Consistency score with prior knowledge Low-quality instances are reviewed. For crack-type defects, the length, average width, and maximum width can be calculated based on the skeletonization results; for rusted, peeling, and exposed rebar areas, the area, circumscribed range, edge roughness, and area integrity can be calculated based on the camera calibration scale or on-site scale information.
[0111] If image scale calibration information is available, pixel measurement results can be converted into actual engineering units; if only relative scale is available, pixel-level indicators and relative risk levels will be output. The system can generate structured records or inspection reports from disease instances, quantitative indicators, original image overlay results, inspection location and time information.
[0112] Engineering quantification can be achieved by using the following conversion relationship to convert pixel-level instance masks into maintenance indicators such as area, length, and average width.
[0113] Formula 4-9 Disease Area Conversion:
[0114] In the formula, Let be the actual area of the s-th disease instance; This is a pixel-level mask for this instance; κ represents the number of pixels within the mask; s represents the actual length scale corresponding to a single pixel; and s represents the defect instance number.
[0115] Formula 4-10 Crack Length Conversion:
[0116] In the formula, The actual length of crack instance c; Skel( ) for crack masking The skeletonization result; κ represents the number of skeleton pixels; c represents the actual length scale of a single pixel; and c represents the crack instance number.
[0117] Formula 4-11 Estimation of average crack width:
[0118] In the formula, Let c be the average width of the crack instance. The actual area of crack instance c; Let Lc be the actual length of crack instance c, and Lc > 0. This formula is used to deduce the average crack width from the area and skeleton length.
[0119] Boundary integrity is calculated by combining the ratio of closed boundary length to instance outer contour length, the number of holes, and the number of fragments. Risk level is graded based on disease type, area, length, average width, boundary quality score, and prior consistency score, outputting low, medium, and high risk levels. Finally, structured records or inspection reports can be generated from disease instances, quantitative indicators, original image overlay results, inspection location, and time information.
[0120] The model training in this embodiment uses a pre-labeled bridge defect instance segmentation dataset. Each sample includes the original image, defect category, instance bounding box, and instance mask. During training, RGB images and instance segmentation annotations are mandatory inputs. End-to-end training is completed by inserting a structural prior attention fusion module into the backbone or neck network. The structural prior tensor P and the unified prior map are used. The reliability graph R can be generated online or pre-generated offline and used as additional input for training.
[0121] The loss functions during the training phase include bounding box regression loss, classification loss, instance mask segmentation loss, boundary consistency loss, prior consistency loss, and prior conflict suppression loss, with the following overall form: Formula 4-8: Overall training loss
[0122] In the formula, L represents the total training loss; For bounding box regression loss; For classification loss; For instance mask segmentation loss; For boundary consistency loss; This is due to the loss of prior consistency. To mitigate losses from prior conflicts; Losses are constrained by the morphology of the disease; to These are the weighting coefficients for each loss term.
[0123] The structural prior tensor and reliability graph support two generation modes: online generation mode can be combined with data augmentation to maintain feature consistency, and offline pre-generation mode can improve training throughput efficiency. The mode can be flexibly selected according to training resources.
[0124] The loss function is enabled in layers according to the implementation method: the main implementation method includes at least the detection box regression loss, classification loss and instance mask segmentation loss; the preferred enhanced implementation method can additionally enable the boundary consistency loss, prior consistency loss, prior conflict suppression loss and disease morphology constraint loss.
[0125] The specific settings for training and evaluation are as follows: Training samples: The data is segmented and labeled using examples of bridge cracks, exposed rebar, corrosion, spalling, water seepage, bearing corrosion, and expansion joint damage. The samples cover different lighting conditions, component materials, shooting distances, and viewing angles.
[0126] Comparison Models: A no-prior segmentation model, a simple RGB and binary image splicing model, and a structure-prior attention fusion model were set as control groups, and their performance was compared with the main implementation method and the preferred enhanced implementation method of the present invention, respectively.
[0127] Evaluation metrics: mAP50-mask, mAP50-95-mask, Dice, IoU, Boundary-F1, crack recall rate, false positive rate, FPS, and parameter quantity are used as core evaluation metrics.
[0128] Ablation experiments: Five control experiments were set up to verify the technical contributions of each module, namely, disabling the structure prior fusion module, disabling explicit prior input, disabling conflict suppression, disabling result refinement scoring, and disabling dynamic prototype enhancement.
[0129] Sample balancing strategy: For small targets such as cracks and exposed reinforcement or categories with few samples, class reweighting, hard case mining or small target enhanced sampling strategies are adopted to alleviate the problem of uneven sample distribution.
[0130] The main implementation method includes at least bounding box regression loss, classification loss and instance mask segmentation loss, and can be trained by end-to-end backpropagation in conjunction with the structure prior attention fusion module. It does not require the predicted mask to be completely consistent with the prior map, but rather constrains the prediction results to maintain a reasonable response near the reliable prior region; Used to constrain prior conflict suppression terms This causes the network to reduce the prior modulation intensity when the prior and RGB semantics are inconsistent. Dynamic prototype masks and disease morphology constraint learning are used to optimize the implementation of the enhancement scheme. For small targets or categories with few samples, such as cracks and exposed reinforcement, category reweighting, hard case mining, or small target enhancement sampling strategies can be adopted.
[0131] Table 3
[0132] In other embodiments, a bridge defect instance segmentation system based on structural prior attention fusion is provided. The bridge defect instance segmentation system based on structural prior attention fusion, as described above, includes: The image acquisition module is used to acquire images of the bridge surface and perform preprocessing to obtain a standard input image. The structural prior generation module is used to perform structural prior calculations of bridge defects on standard input images, and generate multi-channel structural prior tensors and reliability maps that characterize the prior confidence level of each pixel. The dual-branch feature extraction module is used to extract multi-scale features of the original image of the standard input image, and to perform gated encoding on the multi-channel structural prior tensor based on the reliability map to obtain structural prior fusion features; The attention fusion module is used to perform structural consistency attention residual fusion of the multi-scale features of the original image with the structural prior fusion features to obtain the fused multi-scale features. The instance segmentation module is used to input the fused multi-scale features into the instance segmentation head for processing, and obtain pixel-level segmentation results for each disease instance.
[0133] In this embodiment, a result quantification and report generation module is also included, which is used to refine, quantify and classify the pixel-level segmentation results, generate a disease ledger and a structured inspection report, and output them to the corresponding terminal or maintenance system.
[0134] In a detailed embodiment of the present invention, the above-mentioned prior structure generation module can be further divided into two independent functional units to clarify the data link and functional boundaries: The structure prior candidate generation unit is used to generate explicit structure prior maps or endogenous structure prior candidate features from standard input images. The structural prior quality gating unit performs isolated noise suppression, small connected component filtering, excessively large background region suppression, category mutual exclusion coordination, and adjacent suspected region merging operations on prior candidates. After noise reduction, mutual exclusion coordination, and reliability modulation, it outputs the final multi-channel structural prior tensor and reliability map. The output of this unit is only a continuous probability map and reliability weights, and is not directly used as the final defect determination result. The final determination is completed by the subsequent structural consistency fusion network combined with RGB semantics.
[0135] Specifically, the data flow between modules in the upper-level architecture is as follows: the image acquisition module outputs the original acquired image to the image preprocessing module; the image preprocessing module outputs the standard input image to the structure prior generation module and the dual-branch feature extraction module; the structure prior generation module outputs the structure prior tensor and reliability map to the dual-branch feature extraction module; the dual-branch feature extraction module outputs the original image multi-scale features and the fused structure prior features to the attention fusion module; the attention fusion module outputs the fused multi-scale features to the instance segmentation module; the instance segmentation module outputs the pixel-level segmentation results to the result quantization and report generation module; and the result quantization and report generation module outputs the final inspection results to the external terminal or maintenance system.
[0136] In the refined splitting embodiment, the data flow inside the structure prior generation module is as follows: the structure prior candidate generation unit receives the standard input image, generates structure prior candidates, and outputs them to the structure prior quality gating unit; after the structure prior quality gating unit completes noise reduction, mutual exclusion coordination, and reliability modulation, it outputs the final structure prior tensor and reliability map to the dual-branch feature extraction module.
[0137] This embodiment can be implemented using Python, C++, or similar languages; model training and inference can use general deep learning frameworks, ONNXRuntime, TensorRT, or similar inference frameworks as the engineering environment. The system can be deployed on servers, edge computing boxes, UAV ground stations, inspection robots, vehicle-mounted inspection terminals, or web / mobile inspection platforms.
[0138] This solution supports multiple alternative implementation methods: Backbone network replacement: The underlying feature extraction network can be replaced with other convolutional networks, lightweight networks or visual Transformer networks, but at least the core mechanisms of structural prior attention fusion and structural consistency residual fusion must be retained; Alternative prior generation methods: Structural prior maps and reliability maps can be generated online or cached offline; without introducing explicit prior map input, structural prior candidates can also be generated in real time from the internal features of the backbone network or neck network through lightweight convolution; when the computing power of the edge is limited, the number of prior channels can be reduced, structural prior fusion can be enabled only at some scales, the number of mask prototypes can be reduced, or the gating parameters of some scales can be shared. Component adaptation and adjustment: The configuration of prior passages can be adjusted for different bridge components. For example, in the bridge deck pavement scenario, prior passages for cracks or potholes can be added; in the beam scenario, prior passages for cracks and exposed rebar can be emphasized; in the pier scenario, prior passages for spalling, water seepage, or corrosion can be added; and in the bearing and expansion joint scenario, prior passages for corrosion, damage, or displacement can be added.
[0139] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.
Claims
1. A bridge defect instance segmentation method based on structural prior attention fusion, characterized in that, include: Acquire and preprocess images of the bridge surface to obtain a standard input image; The bridge defect structure prior calculation is performed on the standard input image to generate a multi-channel structural prior tensor and a reliability map characterizing the prior confidence level of each pixel; Extract the original multi-scale features of the standard input image, and perform gated encoding on the multi-channel structural prior tensor based on the reliability map to obtain structural prior fusion features; The original image's multi-scale features are fused with the structural prior fusion features using structural consistency attention residual fusion to obtain the fused multi-scale features. The fused multi-scale features are input into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance.
2. The bridge defect instance segmentation method based on structural prior attention fusion according to claim 1, characterized in that, The bridge surface image is acquired and preprocessed to obtain a standard input image, including: The bridge surface image is processed sequentially with size normalization, noise reduction, brightness equalization, and color correction to obtain a standard input image.
3. The bridge defect instance segmentation method based on structural prior attention fusion according to claim 1, characterized in that, The standard input image is used to perform prior calculations on bridge defect structures, generating a multi-channel structural prior tensor and a reliability map representing the prior confidence level of each pixel, including: Calculate the local dark and fine response, direction-consistent response, paired edge response, color deviation response, texture fragmentation response, and boundary closure response for the standard input image to obtain the basic response set; Based on the engineering form constraints corresponding to various bridge defects, the basic response set is weighted and combined to generate a multi-channel structural prior tensor that includes at least two types of defect priors. By combining candidate response intensity, morphological constraint satisfaction, neighborhood consistency, background interference suppression term, and category mutual exclusion term, the pixel-level reliability of each channel in the prior tensor of the multi-channel structure is calculated, and the multi-channel reliability map is obtained by stitching them together.
4. The bridge defect instance segmentation method based on structural prior attention fusion according to claim 1, characterized in that, Extract the original multi-scale features of the standard input image, and perform gated encoding on the multi-channel structural prior tensor based on the reliability map to obtain structural prior fusion features, including: The multi-channel structural prior tensor and the reliability map are concatenated by channel, and the local structural response is obtained through channel integration and neighborhood aggregation. The reliability map is scaled to the corresponding feature scale to generate spatial gating weights; The spatial gating weights are used to perform element-wise modulation on the local structural response to obtain multi-scale gating prior coding features; Spatial alignment and channel projection are performed on the multi-scale gated prior coding features to obtain structural prior fusion features.
5. The bridge defect instance segmentation method based on structural prior attention fusion according to claim 1, characterized in that, The original image's multi-scale features are fused with the structural prior fusion features using structural consistency attention residual fusion to obtain fused multi-scale features, including: Perform channel concatenation and element-wise multiplication operations on the prior fusion features of the structure and the multi-scale features of the original image to generate a spatial attention map; Global pooling and channel mapping are performed on the prior fusion features of the structure to generate a channel selection vector; Perform feature difference operation on the multi-scale features of the original image and the prior fusion features of the structure to generate a prior conflict suppression term; Using the original image's multi-scale features as the residual basis, feature modulation is performed by combining the spatial attention map, channel selection vector, and prior conflict suppression term. After channel reshaping, the fused multi-scale features are obtained.
6. The bridge defect instance segmentation method based on structural prior attention fusion according to claim 1, characterized in that, The fused multi-scale features are input into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance, including: The fused multi-scale features are subjected to feature encoding and prototype generation processing to obtain multiple sets of disease mask prototypes and feature vectors of each candidate instance. The feature vectors of the candidate instances are integrated to obtain instance description vectors; wherein, the instance description vectors include category embedding, location embedding, feature pooling vector, prior reliability statistics and disease morphology description, and the disease morphology description includes at least one of the following: slenderness ratio, skeleton continuity, and boundary closure. The instance description vector is weighted to obtain the dynamic prototype combination weights corresponding to each candidate instance. The dynamic prototype combination weights are used to combine and calculate multiple disease mask prototypes to obtain the disease category, pixel-level mask, corresponding classification probability, and mask response intensity of each disease instance.
7. The bridge defect instance segmentation method based on structural prior attention fusion according to claim 6, characterized in that, After obtaining the pixel-level masks for each disease instance, the following is also included: By combining the boundary matching degree and the mean of the prior reliability of the corresponding category structure, the boundary quality score of each disease instance is calculated; By combining the pixel-level mask with the region matching degree and the mean of the prior reliability of the corresponding category structure, the prior consistency score of each disease instance is calculated. The overall confidence level of each disease instance is calculated by combining the classification probability, mask response intensity, and the mean of prior reliability.
8. The bridge defect instance segmentation method based on structural prior attention fusion according to claim 7, characterized in that, After obtaining the pixel-level masks for each disease instance, the following is also included: Perform connected component analysis, hole filling, boundary smoothing, and defect morphology verification on the pixel-level mask to obtain a refined instance mask; Based on the refined instance mask, the disease quantification index is calculated, wherein the disease quantification index includes area, length, average width, maximum width, and boundary integrity. Risk classification is performed by combining the disease categories, disease quantitative indicators, boundary quality scores, and prior consistency scores to generate structured inspection results.
9. A bridge defect instance segmentation system based on structural prior attention fusion, characterized in that, The bridge defect instance segmentation system based on structural prior attention fusion according to any one of claims 1 to 8 includes: The image acquisition module is used to acquire images of the bridge surface and perform preprocessing to obtain a standard input image. The structural prior generation module is used to perform bridge defect structural prior calculation on the standard input image, and generate a multi-channel structural prior tensor and a reliability map characterizing the prior credibility of each pixel. The dual-branch feature extraction module is used to extract the original multi-scale features of the standard input image and to perform gated encoding on the multi-channel structural prior tensor based on the reliability map to obtain structural prior fusion features. The attention fusion module is used to perform structural consistency attention residual fusion of the original image multi-scale features and the structural prior fusion features to obtain fused multi-scale features. The instance segmentation module is used to input the fused multi-scale features into the instance segmentation head for processing to obtain pixel-level segmentation results for each disease instance.
10. The bridge defect instance segmentation system based on structural prior attention fusion according to claim 9, characterized in that, It also includes a result quantification and report generation module, which is used to refine, quantify and classify the pixel-level segmentation results, generate a disease ledger and a structured inspection report, and output them to the corresponding terminal or maintenance system.
