Multi-scale mutual feedback attention crack segmentation method and device and electronic equipment
By employing a multi-scale mutual feedback attention crack segmentation method, the problems of insufficient segmentation accuracy and weak global modeling in crack identification are solved, achieving efficient and accurate crack detection in complex backgrounds, and suitable for real-time applications in vehicle-mounted and edge terminals.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ANHUI INST OF BUILDING RES & DESIGN
- Filing Date
- 2026-01-20
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies for crack identification and early warning suffer from problems such as insufficient segmentation accuracy and boundary clarity, weak global structure modeling, redundant skip connections and spatial mismatch, semantic conflicts in multi-scale fusion, and limitations in computational efficiency and deployment. In particular, it is difficult to achieve fast, accurate, and scalable crack detection in complex contexts.
A multi-scale mutual feedback attention crack segmentation method is adopted. Through multi-level feature encoding, modulation processing and cross-scale bidirectional interactive fusion, combined with dual-path units and mutual feedback modulation attention modules, the method achieves collaborative modeling of local details and global context, suppresses redundant information and enhances the response of the target region, generates modulation jump features, and finally outputs crack segmentation results.
It improves the continuity and boundary clarity of cracks, reduces false detections and artifacts, and increases crack detection rate and positioning accuracy. It maintains stable segmentation performance under multiple material, lighting, and noise conditions, and adapts to the real-time deployment needs of vehicle-mounted/edge terminals.
Smart Images

Figure CN121544643B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a multi-scale mutual feedback attentional crack segmentation method, a multi-scale mutual feedback attentional crack segmentation device, an electronic device, and a computer-readable storage medium. Background Technology
[0002] In the field of infrastructure safety operation and maintenance, crack identification and early warning for roads, bridges, tunnels, and building exteriors are crucial aspects of structural health monitoring. Cracks, as one of the most common forms of damage to concrete and asphalt materials, are characterized by their elongated shape, irregular orientation, narrow width, blurred edges, low contrast, and discontinuity. Furthermore, on-site images are often affected by uneven lighting, shadows, contaminants, and surface textures, leading to missed or false detections by algorithms in complex environments. With urban renewal and increasing traffic intensity, rapid, accurate, and scalable crack detection has become an urgent need in road maintenance and public safety. Summary of the Invention
[0003] This invention aims to at least partially solve one of the technical problems in related technologies. Therefore, the first objective of this invention is to propose a multi-scale mutual-feedback attention crack segmentation method.
[0004] The second objective of this invention is to provide a multi-scale mutual feedback attention crack segmentation device.
[0005] The third objective of this invention is to provide an electronic device.
[0006] The fourth objective of this invention is to provide a computer-readable storage medium.
[0007] To achieve the above objectives, a first aspect of the present invention proposes a multi-scale mutual-feedback attention crack segmentation method, comprising: performing multi-level feature encoding on the input preprocessed crack image, extracting and downsampling at each level to obtain encoded features at multiple scales; performing modulation processing on the encoded features to suppress redundant information in the encoded features and enhance the response of the target region, generating modulation skip features; performing multi-level feature decoding on the encoded features, performing cross-scale bidirectional interactive fusion based on the modulation skip features and the decoded features in the decoding process to obtain fused features, so as to collaboratively recover semantic information and detail information, and upsampling at each level to obtain a fused feature map; and outputting crack segmentation results based on the fused feature map.
[0008] In addition, the multi-scale mutual feedback attention crack segmentation method according to the above embodiments of the present invention may also have the following additional technical features:
[0009] According to some embodiments of the present invention, at least one level in multi-level feature encoding includes: fusing and extracting local details and long-range context information from the input features of the current level through a dual-path unit to form the encoded features of the current level; wherein, the dual-path unit includes parallel local convolutional paths and global state space paths.
[0010] According to some embodiments of the present invention, the input features of the current level are fused and extracted by a dual-path unit to form the encoded features of the current level, including: obtaining the first feature output by the local convolutional path and the second feature output by the global state space path; generating pixel-level adaptive weights based on the first and second features; using the pixel-level adaptive weights to perform weighted fusion of the first and second features, and adding the fusion result to the input features to obtain the encoded features.
[0011] According to some embodiments of the present invention, obtaining a first feature output by a local convolutional path and a second feature output by a global state space path includes: applying a spatially weighted convolution operation to the two-dimensional input features to obtain initial convolutional features; wherein the convolution kernel of the spatially weighted convolution includes a spatial weight matrix constructed based on the outer product of a learnable one-dimensional vector; performing nonlinear activation and normalization processing on the initial convolutional features to output the first feature; serializing the input features along multiple directions to obtain multiple directional sequences; performing state space model operations on each directional sequence respectively; reorganizing the operation results of the state space models in each direction into two-dimensional features and fusing them to output the second feature.
[0012] According to some embodiments of the present invention, modulation processing of encoded features includes: extracting a first global attribute vector and a second local salient vector of the encoded features respectively; performing mutual feedback modulation based on the first global attribute vector and the second local salient vector to generate a fused attribute vector; generating a spatial selection mask based on the fused attribute vector; and using the spatial selection mask to perform weighted filtering of the encoded features to generate a modulation skip feature.
[0013] According to some embodiments of the present invention, mutual feedback modulation based on a first global attribute vector and a second local salient vector includes: generating a first modulation weight from the first global attribute vector and applying it to the second local salient vector; generating a second modulation weight from the second local salient vector and applying it to the first global attribute vector; and fusing the modulated first global attribute vector and the second local salient vector to obtain a fused attribute vector.
[0014] According to some embodiments of the present invention, multi-level feature decoding is performed on encoded features, and cross-scale bidirectional interactive fusion is performed based on modulation hopping features and decoded features in the decoding process, including: mapping decoded features from the decoding path to a first set of attention vectors, and mapping modulation hopping features from the modulation path to a second set of attention vectors; performing a first attention aggregation on the second set of attention vectors with the query vector in the first set of attention vectors to obtain a first interaction result; performing a second attention aggregation on the first set of attention vectors with the query vector in the second set of attention vectors to obtain a second interaction result; combining the first interaction result with a first feature, and combining the second interaction result with a second feature; fusing the combined two features to output a fused feature; wherein both the first attention aggregation and the second attention aggregation adopt a multi-head attention mechanism.
[0015] To achieve the above objectives, a second aspect of the present invention proposes a multi-scale mutual-feedback attention crack segmentation device, comprising: an encoding module configured to perform multi-level feature encoding on the input preprocessed crack image, extracting and downsampling at each level to obtain encoded features at multiple scales; a modulation module configured to modulate the encoded features to suppress redundant information in the encoded features and enhance the response of the target region, generating modulation jump features; a decoding module configured to perform multi-level feature decoding on the encoded features, performing cross-scale bidirectional interactive fusion based on the modulation jump features and the decoded features in the decoding process to obtain fused features, so as to collaboratively recover semantic information and detail information, and upsampling at each level to obtain a fused feature map; and a segmentation module configured to output crack segmentation results based on the fused feature map.
[0016] To achieve the above objectives, a third aspect of the present invention provides an electronic device, comprising: a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the multi-scale mutual feedback attention crack segmentation method described above.
[0017] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the multi-scale mutual feedback attention crack segmentation method described above.
[0018] According to embodiments of the present invention, a multi-scale mutual feedback attention-based crack segmentation method, apparatus, and electronic device firstly perform multi-level feature encoding on the input preprocessed crack image, extracting and downsampling at each level to obtain encoded features at multiple scales; further, the encoded features are modulated to suppress redundant information and enhance the response of the target region, generating modulation jump features; then, the encoded features are decoded at multiple levels, and cross-scale bidirectional interactive fusion is performed based on the modulation jump features and the decoded features in the decoding process to obtain fused features, so as to collaboratively recover semantic and detail information, and upsampling at each level to obtain a fused feature map; finally, the crack segmentation result is output based on the fused feature map. Therefore, this application can improve the continuity and boundary clarity of cracks, reduce false detections and artifacts, improve crack detection rate and positioning accuracy, maintain stable segmentation performance and good generalization under multiple materials, multiple illuminations, and multiple noise conditions, and simultaneously meet the real-time deployment requirements of vehicle / edge terminals.
[0019] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0020] Figure 1 A flowchart of a multi-scale mutual feedback attention crack segmentation method according to some embodiments of the present invention;
[0021] Figure 2 This is a schematic diagram of a partial multi-scale mutual feedback attention crack segmentation system according to some embodiments of the present invention;
[0022] Figure 3 This is a schematic diagram illustrating the acquisition of encoded features according to some embodiments of the present invention;
[0023] Figure 4 This is a schematic diagram illustrating the acquisition of a first feature of the local convolutional path output according to some embodiments of the present invention;
[0024] Figure 5 This is a schematic diagram illustrating the acquisition of a second feature of the global state space path output according to some embodiments of the present invention;
[0025] Figure 6 This is a schematic diagram of weighted fusion according to some embodiments of the present invention;
[0026] Figure 7 This is a schematic diagram illustrating the generation of modulation hopping features according to some embodiments of the present invention;
[0027] Figure 8 This is a schematic diagram of the output fusion features according to some embodiments of the present invention;
[0028] Figure 9This is a block diagram of a multi-scale mutual feedback attention crack segmentation device according to some embodiments of the present invention;
[0029] Figure 10 This is a block diagram of an electronic device according to some embodiments of the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.
[0031] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this invention should have the ordinary meaning understood by those skilled in the art. The terms "first," "second," and similar terms used in the embodiments of this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0032] As described in the background section, in the field of infrastructure safety operation and maintenance, crack identification and early warning for roads, bridges, tunnels, and building exteriors is a crucial aspect of structural health monitoring. Cracks, as one of the most common forms of damage to concrete and asphalt materials, are characterized by their elongated shape, irregular orientation, narrow width, blurred edges, low contrast, and discontinuity. Furthermore, on-site images are often affected by uneven lighting, shadows, contaminants, and surface texture interference, leading to frequent missed and false detections by algorithms in complex environments. With urban renewal and increased traffic intensity, rapid, accurate, and scalable crack detection has become an urgent need in road maintenance and public safety.
[0033] In the process of developing this invention, the applicant discovered that current crack detection technologies can be broadly classified into three categories.
[0034] The first category consists of methods based on image processing and traditional features, which extract cracks through edge detection, thresholding / connected component analysis, local binary patterns, or morphological operations. These methods are simple to implement and have low computational cost, but they are sensitive to parameters and image quality, struggle to handle strong noise backgrounds and extremely fine cracks, are prone to boundary breakage, and lack robustness.
[0035] The second category comprises convolutional network methods based on machine learning / deep learning. These methods extract multi-scale semantic and texture information through end-to-end learning, improving pixel-level segmentation accuracy. Typical approaches include U-shaped encoder-decoder networks and their variants, which utilize skip connections to fuse multi-layer features to improve localization and boundary quality. For example, U-shaped structures combined with skip connections are used to fuse multi-scale features, resulting in good localization capabilities. However, traditional convolutions are limited by local receptive fields, leading to shortcomings in global consistency modeling of cross-regional, curved, or discontinuous crack structures. Furthermore, unfiltered skip connections may carry significant texture noise, resulting in blurred boundaries and misjudgments.
[0036] The third category comprises hybrid or non-convolutional methods based on attention and sequence modeling, introducing self-attention or sequence modeling units to enhance long-range dependency representation. Introducing Transformer / cross-attention structures can improve global perception; for example, a SegFormer segmentation model based on the Transformer architecture can be used to segment crack images and obtain crack mask maps. However, pure Transformer methods have high computational and memory overhead, making them difficult to deploy at edge environments. In recent years, efficient sequence modeling modules based on state-space models have been introduced into visual tasks, possessing linear complexity and strong long-range dependency modeling capabilities. Schemes embedding these modules into segmentation networks have emerged, such as image segmentation methods and devices using sequence modeling units. However, current solutions still have shortcomings in fine-grained boundary characterization and cross-scale, cross-layer semantic alignment, especially in key areas such as skip connection redundancy suppression, semantic conflict mitigation during decoding, and coherence restoration of cracks in small targets. There is still a lack of integrated designs that balance accuracy and efficiency.
[0037] In summary, the current technology still faces the following common challenges: (1) While maintaining linear or quasi-linear computational complexity, jointly model local details and global context to ensure the continuity and boundary clarity of fine cracks; (2) How to selectively transfer and spatially align cross-layer features of skip connections to suppress false detections caused by redundant noise; (3) How to achieve cross-scale interaction between high-level semantics and low-level details in the decoding stage to alleviate semantic conflicts and improve the detection rate of small targets.
[0038] The current technology still faces the following shortcomings: (1) Insufficient segmentation accuracy and boundary clarity: Under complex backgrounds (shadows, pollution, texture interference, reflection, etc.) and low contrast conditions, traditional image processing and pure convolutional neural network methods are insufficient in their ability to depict extremely fine cracks (pixel-level width) and blurred boundaries, often resulting in crack breakage, adhesion, blurred boundaries, or holes, with both missed detections and false detections. Weak global structure modeling: Convolutional networks are limited by local receptive fields, making it difficult to establish cross-regional and long-distance contextual relationships. When facing curved, bifurcated, and discontinuous cracks, the structural coherence modeling is insufficient. Although introducing Transformer can enhance global perception, it has high computational / memory overhead and limited deployment at the edge. Pure sequence modeling enhances long-range dependencies, but it is still insufficient in expressing local details and sharp boundaries.
[0039] (2) Redundancy and spatial mismatch of skip connections: Skip connections in the U-shaped structure are directly superimposed without screening, which easily transmits texture noise and background interference to the decoding end. Furthermore, there is spatial misalignment and semantic inconsistency between features of different layers, resulting in blurred boundaries, increased artifacts, and misjudgment.
[0040] (3) Semantic conflicts in multi-scale fusion: When high-level semantics and low-level details are fused in the decoding stage, there is a lack of effective cross-scale and cross-source interaction mechanisms, which easily leads to semantic conflicts (coarse semantics "covers" fine details or detail noise "pollutes" high-level semantics), resulting in the omission of small target cracks and inaccurate boundaries.
[0041] (4) Limited computational efficiency and deployment: The complexity of Transformer-type models increases nearly quadratically with resolution, requiring high GPU memory and computing power; deep convolutional neural networks have a large number of parameters and FLOPs, making it difficult to achieve real-time inference or high-resolution processing on in-vehicle / handheld / edge devices. Insufficient generalization and robustness: There are significant differences in distribution between different materials (asphalt, concrete, stone, walls), different lighting and pollution scenarios. Currently, the models are not robust enough to inter-domain migration and noise perturbation, and are prone to accuracy decay and false alarms in non-training domains.
[0042] The following description, with reference to the accompanying drawings, describes the multi-scale mutual feedback attention crack segmentation method, multi-scale mutual feedback attention crack segmentation device, electronic device, and computer-readable storage medium proposed in embodiments of the present invention.
[0043] refer to Figure 1 This is a flowchart of a multi-scale mutual feedback attention crack segmentation method according to some embodiments of the present invention.
[0044] In some embodiments, the multi-scale mutual feedback attention-based crack segmentation method of the present invention can be applied to a multi-scale mutual feedback attention-based crack segmentation system, wherein the multi-scale mutual feedback attention-based crack segmentation system includes a data acquisition and preprocessing unit, an encoder unit, a skip connection modulation unit, a decoder unit, a segmentation head, a training and inference control unit, and a computer-readable storage medium.
[0045] like Figure 1 As shown, the multi-scale mutual feedback attention crack segmentation method of this invention may include the following steps:
[0046] S101 performs multi-level feature encoding on the preprocessed crack image, extracting and downsampling at each level to obtain encoded features at multiple scales.
[0047] Specifically, crack images can be acquired through a data acquisition and preprocessing unit. The acquired crack images undergo normalization, size integration, and synchronous geometric transformation. During the training phase, data augmentation (random flipping, rotation, scaling, cropping, color jittering, and mild noise adjustment, etc.) strictly registered with the mask is performed to ensure consistency in the input scale and distribution of multi-source heterogeneous data, thus obtaining a preprocessed crack image. Then, refer to... Figure 2 The diagram below is a partial multi-scale mutual feedback attention crack segmentation system according to some embodiments of the present invention. The encoder unit performs multi-level feature encoding on the preprocessed crack image of the input multi-scale mutual feedback attention crack segmentation system, extracts features level by level, and downsamples level by level to obtain encoded features at multiple scales.
[0048] S102, Modulation processing is performed on the coding features to suppress redundant information in the coding features and enhance the response of the target region, generating modulation skip features.
[0049] Specifically, continue to refer to Figure 2 To reduce the interference of redundant textures and spatial mismatches in decoding and reconstruction in traditional skip connections, the skip connection modulation unit can modulate the encoded features of the encoder unit. This allows for the suppression of redundant information and spatial alignment in the encoded features before they enter the decoder unit, and enhances the response of the target region, generating modulated skip features that effectively reduce artifacts and boundary blurring in subsequent fusion.
[0050] S103 performs multi-level feature decoding on the encoded features, and performs cross-scale bidirectional interactive fusion based on modulation skip features and decoding features in the decoding process to obtain fused features, so as to collaboratively recover semantic information and detail information, and upsamples level by level to obtain fused feature maps.
[0051] Specifically, continue to refer to Figure 2The decoder unit can perform multi-level feature decoding on the encoded features. During the decoding stage, it achieves collaborative recovery of semantic and detail information through cross-scale bidirectional interactive fusion. The decoder unit is symmetrical to the encoder unit. The decoder unit fuses modulation skip features with the current decoded features to obtain fused features, and then upsamples at each level to recover the spatial resolution, resulting in a fused feature map. For example, each layer of the decoder receives modulation skip features from the encoder at the same level and upsampled features from the decoder at the previous level, and achieves cross-scale information interaction through concatenation, addition, or attention fusion.
[0052] S104, output the crack segmentation result based on the fused feature map.
[0053] Specifically, continue to refer to Figure 2 The segmentation head can perform channel compression and probability mapping on the fused feature map and output the crack segmentation result (crack probability mask). It can maintain stable segmentation performance and good generalization in multi-source heterogeneous scenarios (multi-material, multi-light, multi-noise), while meeting the real-time deployment requirements of vehicle / edge terminals. The training and inference control unit is used throughout the process, responsible for batch scheduling, loss calculation, parameter updates, and slicing, stitching, and post-processing during inference. The computer-readable storage medium is used to store executable instructions and trained model parameters.
[0054] In some embodiments of the present invention, at least one level of multi-level feature encoding includes: fusing and extracting local details and long-range context information from the input features of the current level through a dual-path unit to form the encoded features of the current level; wherein the dual-path unit includes parallel local convolutional paths and global state space paths.
[0055] Specifically, dual-path units are introduced in each layer of the encoder unit. These dual-path units can be MSMC (Mamba Spatially Modulated Convolution) units, which, while maintaining linear or quasi-linear computational complexity and efficient inference, jointly model the local edge texture details and long-range contextual information of cracks from the input features of the current level to form the encoded features of the current level, thereby improving the continuity and boundary clarity of fine cracks. The dual-path unit includes parallel local convolutional paths and global state space paths, allowing the encoder unit to dynamically balance details and global information. In each layer of the encoder unit, dual-path units composed of "spatial weighted convolutional branches (local convolutional paths) + multi-directional state space branches (global state space paths)" are introduced to enhance the representation capability of fine cracks and boundaries.
[0056] In some embodiments of the present invention, the local details and long-range context information of the input features of the current level are fused and extracted by the dual-path unit to form the encoded features of the current level, including: obtaining the first feature output by the local convolution path and the second feature output by the global state space path; generating pixel-level adaptive weights based on the first feature and the second feature; using the pixel-level adaptive weights to perform weighted fusion of the first feature and the second feature, and adding the fusion result to the input features to obtain the encoded features.
[0057] Specifically, refer to Figure 3 The diagram illustrates the process of obtaining encoded features according to some embodiments of the present invention. To obtain the first feature output from the local convolutional path and the second feature output from the global state space path, a separate weight generation module (e.g., 1×1 convolution + Sigmoid / Softmax activation) can dynamically assign weights to the first feature output from the local convolutional path and the second feature output from the global state space path, generating pixel-level adaptive weights. The weight generation logic can typically be adaptively adjusted. Then, the first and second features are weighted and fused using the pixel-level adaptive weights, allowing each pixel position to independently determine the fusion ratio of local and global features. The fusion result is added to the input features to obtain the encoded features.
[0058] In some embodiments of the present invention, obtaining the first feature output by the local convolution path and the second feature output by the global state space path includes: applying a spatially weighted convolution operation to the two-dimensional input features to obtain initial convolution features; wherein the convolution kernel of the spatially weighted convolution includes a spatial weight matrix constructed based on the outer product of a learnable one-dimensional vector; performing nonlinear activation and normalization processing on the initial convolution features to output the first feature; serializing the input features along multiple directions to obtain multiple directional sequences; performing state space model operations on each directional sequence respectively; reorganizing the operation results of the state space models in each direction into two-dimensional features and fusing them to output the second feature.
[0059] Specifically, a position-sensitive spatially weighted convolution operation is applied to the two-dimensional input features. A learnable spatial weight matrix, constructed from the outer product of one-dimensional vectors of length k, is superimposed on the convolution kernel of the spatially weighted convolution. This matrix possesses central symmetry, allowing for fine-tuning of the contribution of pixels at different relative positions, resulting in the initial convolutional features. When the weights degenerate to constants, it is equivalent to standard convolution, significantly enhancing the response to fine crack edges and narrow slit textures while maintaining the efficiency of convolution. (Reference) Figure 4 This is a schematic diagram illustrating the acquisition of a first feature from the output of a local convolutional path according to some embodiments of the present invention. The initial convolutional features are subjected to nonlinear activation and normalization processing to output the first feature. (See reference...) Figure 5This diagram illustrates the acquisition of a second feature from the global state space path output according to some embodiments of the present invention. The two-dimensional input features are serialized along multiple directions (up, down, left, right) to obtain multiple directional sequences. State space model operations are then performed along each direction (e.g., discrete state space update, i.e., modeling long-range dependencies with linear complexity using SSM (State Space Model), and finally, pixel-level gating generated by parallel aggregation using global average pooling / global max pooling is used to adaptively fuse the two types of features pixel-by-pixel and superimpose residuals), resulting in a representation that combines global dependency and directional consistency. The results of the state space model operations in each direction are then reorganized into two-dimensional features and fused using lightweight convolution to output the second feature.
[0060] To avoid single-path dominance and introduce regional adaptability, refer to Figure 6 The diagram illustrates weighted fusion according to some embodiments of the present invention. The dual-path unit performs global average pooling and global max pooling operations in parallel on the concatenated features output from the two branch paths. Pixel-level gating weights are generated through two layers of lightweight convolution and sigmoid. Pixel-wise weighted fusion is performed on the convolutional branch and the state space branch, and the input residual is added, thereby adaptively selecting more reliable details or contextual representations at each position. Downsampling of the encoder unit can be achieved through stride convolution or pooling, and multiple layers are stacked to form a top-down multi-scale semantic pyramid (encoded features).
[0061] In some embodiments of the present invention, the modulation processing of the encoded features includes: extracting a first global attribute vector and a second local salient vector of the encoded features respectively; performing mutual feedback modulation based on the first global attribute vector and the second local salient vector to generate a fused attribute vector; generating a spatial selection mask based on the fused attribute vector; and using the spatial selection mask to perform weighted filtering of the encoded features to generate a modulation skip feature.
[0062] Specifically, RCA (Reciprocal Comodulation Attention) is applied to each jump path to filter redundancy and align spatial information. (Reference) Figure 7The diagram illustrates the generation of modulation skip features according to some embodiments of the present invention. RCA first performs global average pooling and global max pooling operations on the skip features from the encoder unit to obtain a first global attribute vector representing global smoothness and a second local salient vector representing local salient texture. Then, it performs downsampling with small convolutions to enhance local correlation. Subsequently, it performs mutual feedback modulation based on the first global attribute vector and the second local salient vector to generate a fused attribute vector. The features of the modulated fused attribute vector are upsampled back to their original scale and added together. A spatial selection mask is then generated through convolution and a sigmoid function. This spatial selection mask is used to weight and filter the encoded features (original skip features) (e.g., pointwise multiplication) to generate modulation skip features. This process suppresses redundant information and achieves spatial alignment in the encoded features before they enter the decoder unit, effectively reducing artifacts and boundary blurring in subsequent fusion. This "mutual feedback modulation → mask reconstruction → selective transfer" chain significantly reduces noise introduction and boundary blurring problems.
[0063] In some embodiments of the present invention, mutual feedback modulation based on a first global attribute vector and a second local saliency vector includes: generating a first modulation weight from the first global attribute vector and applying it to the second local saliency vector; generating a second modulation weight from the second local saliency vector and applying it to the first global attribute vector; and fusing the modulated first global attribute vector and the second local saliency vector to obtain a fused attribute vector.
[0064] Specifically, a first modulation weight is generated from the first global attribute vector and applied to the second local salient vector. This can also be understood as generating the first modulation weight using convolution and a sigmoid function on the first global attribute vector, and then modulating the second local salient vector based on this first modulation weight. A second modulation weight is generated from the second local salient vector and applied to the first global attribute vector. In other words, the second modulation weight is generated using convolution and a sigmoid function on the second local salient vector, and then modulated based on this second modulation weight. This ensures that the two types of attribute vectors retain the component more sensitive to the crack region within a mutual constraint. Finally, the modulated first global attribute vector and the second local salient vector are fused to obtain a fused attribute vector.
[0065] In some embodiments of the present invention, multi-level feature decoding is performed on the encoded features, and cross-scale bidirectional interactive fusion is performed based on modulation hopping features and decoded features in the decoding process. This includes: mapping decoded features from the decoding path to a first set of attention vectors, and mapping modulation hopping features from the modulation path to a second set of attention vectors; performing a first attention aggregation on the second set of attention vectors using the query vector in the first set of attention vectors to obtain a first interaction result; performing a second attention aggregation on the first set of attention vectors using the query vector in the second set of attention vectors to obtain a second interaction result; combining the first interaction result with a first feature, and combining the second interaction result with a second feature; fusing the combined two features to output a fused feature; wherein both the first attention aggregation and the second attention aggregation employ a multi-head attention mechanism.
[0066] Specifically, the decoder unit can recover resolution step-by-step from bottom to top. The decoder unit maps the decoding features from the decoding path to a first set of attention vectors, and maps the modulation hop features from the modulation path to a second set of attention vectors. Each stage of the decoder unit first upsamples the output of the previous layer, and then inputs it into the CIF (Cross Interaction Fusion) module along with the second set of attention vectors modulated by RCA at the same scale. (See reference) Figure 8 The diagram illustrates the output fusion features according to some embodiments of the present invention. CIF addresses the cross-scale semantic-detail alignment problem by flattening the first and second sets of attention vectors into sequences and linearly mapping them to query, key, and value representations. Then, bidirectional multi-head cross-attention is performed: on one side, the query vector from the first set of attention vectors is used to perform a first attention aggregation on the key-value pairs of the second set of attention vectors, resulting in a first interaction result, which can emphasize the selection of useful details under high-level semantic guidance. On the other side, the query vector from the second set of attention vectors is used to perform a second attention aggregation on the first set of attention vectors, resulting in a second interaction result, which can supplement the refinement of semantic region boundaries and positional correction.
[0067] The residuals of the first interaction result and the first feature are added together, and the residuals of the second interaction result and the second feature are added together. The combined two feature paths are then concatenated along their channel dimensions. Bottleneck convolution and normalization are used to suppress redundancy and enhance semantic consistency, resulting in a fused feature at this scale. This fused feature is then input into the next decoding stage. During the decoding stage, cross-scale, bidirectional interactive fusion of high-level semantics and low-level details can be achieved, mitigating semantic conflicts and improving the detection rate and localization accuracy of cracks in small targets. Furthermore, selective transfer and spatial alignment of skip features between encoding and decoding can be performed to suppress redundancy and noise, reducing false detections and artifacts.
[0068] Through the cascading of multiple levels of CIF, the network continuously completes semantic alignment and boundary refinement at a progressively larger spatial scale. Finally, it is mapped to a single-channel probability map by the 1×1 convolution of the segmentation head, and the crack segmentation result is output by Sigmoid activation.
[0069] This invention maps upsampled semantic features and RCA-filtered skip detail features to a first set of attention vectors and a second set of attention vectors at each decoding stage. The two sets of attention vectors are then concatenated after residual back-injection, and redundancy is suppressed and semantic alignment is achieved through convolutional and normalized bottleneck units. This fixed order of "bidirectional interaction + residual back-injection + bottleneck refinement" effectively alleviates semantic conflicts during the decoding stage.
[0070] In some embodiments, the operation process of the present invention is divided into two modes: training and inference. In the training mode, the multi-scale mutual feedback attention-based crack segmentation system first imports a dataset with pixel-level annotations, performs preprocessing and data augmentation, and then inputs the samples into the network in the order of "MSMC—RCA—CIF—segmentation head" to calculate the predicted mask. Subsequently, a combined loss mainly based on Dice and cross-entropy is used to measure the difference with the true mask, and all learnable parameters are updated through backpropagation and an optimizer (preferably Adam, with learning rate scheduling). Performance is monitored on the validation set and the optimal weights are saved according to a preset strategy.
[0071] In inference mode, the multi-scale feedback attention-based crack segmentation system receives images from the field or from the database, performs the same preprocessing, and then performs single-pass or sliding-window forward inference to obtain a probability mask. If necessary, small connected component filtering and lightweight morphological thinning can be performed to improve visualization and measurement stability. The entire method relies on the linear time complexity of state-space units and the lightweight convolution bottleneck, significantly reducing memory and computational requirements while ensuring segmentation accuracy and boundary clarity, making it suitable for real-time applications in vehicles, handheld devices, and edge computing.
[0072] Therefore, this invention achieves unified modeling of local details and global context by introducing a collaborative design of multi-scale mutual feedback attention into the U-shaped encoding-decoding framework. Compared with related technologies, it achieves significant improvements in segmentation accuracy, boundary clarity, coherence of small cracks, and robustness to complex backgrounds. The MSMC dual-path feature unit enhances fine crack and edge responses with learnable spatial weighted convolution and efficiently captures long-range dependencies with multi-directional discrete state spatial units. Then, pixel-level gating is used to adaptively fuse the two types of features pixel by pixel, effectively avoiding the dilemma of "global semantics suppressing details" or "detail noise polluting semantics". RCA mutual feedback co-modulation attention generates spatial selection masks on skip channels, selectively propagating and spatially aligning cross-layer features, significantly suppressing redundant interference caused by shadows, contamination, and surface textures, and reducing artifacts and misjudgments. The CIF interactive fusion module achieves cross-scale alignment and collaborative recovery of high-level semantics and low-level details through bidirectional multi-head cross attention during the decoding stage, taking into account both the detection of small target cracks and sharp reconstruction of boundaries.
[0073] See Table 1 for a comparison of results from publicly available datasets.
[0074] Table 1
[0075]
[0076] As shown in Table 1, relying on the above-mentioned collaborative mechanism, under the unified training and inference configuration, the present invention achieves higher overall accuracy and clearer boundary visualization on multi-source datasets including roads, concrete and building surfaces. On representative comprehensive datasets, the average intersection-union ratio is about 72.8% and the Dice ratio is about 79.7%, which is about 2-3 percentage points higher than the typical comparison model. The false detection (precision and accuracy) in complex backgrounds is significantly reduced and the continuity of fine cracks is better maintained.
[0077] Referring back to Table 1, in terms of computational efficiency and deployability, this invention is based on the linear time-space complexity of state-space units, supplemented by low-overhead implementation of lightweight convolution bottlenecks and pixel-level gating, keeping the overall overhead manageable even with high-resolution input. Evaluation under consistent hardware conditions with 448×448 input shows an inference overhead of approximately 36.0 GFLOPs and a parameter count of approximately 0.259M, significantly lower than similar Transformer-based methods, facilitating real-time or near-real-time inference on automotive, handheld, and edge devices. Model memory usage and bandwidth pressure are simultaneously reduced, making it easier to process high-resolution or large-format images in real-world environments (using sliding window and stitching strategies) without sacrificing boundary quality. Furthermore, the training process is stable and has low hyperparameter sensitivity, facilitating rapid adaptation to new scenes and devices.
[0078] This invention possesses excellent engineering feasibility and scalability: the core operators consist of general convolution, pooling, linear mapping, and standard upsampling / downsampling, facilitating implementation on mainstream deep learning frameworks and heterogeneous hardware (such as CPUs, GPUs, and AI accelerator chips). The global state space path can be equivalently replaced by similar efficient sequence modules, and spatially weighted convolution and cross-attention can be lightweighted and pruned according to hardware resources, ensuring a controllable trade-off between accuracy and efficiency across different deployment targets. In summary, this invention significantly improves the accuracy, boundary quality, and cross-scenario robustness of crack segmentation while maintaining inference efficiency and resource friendliness, meeting the needs of large-scale, real-time, and engineering applications in infrastructure inspection.
[0079] This invention clearly defines the data flow and structural layout—MSMC is uniformly adopted in each layer of the encoder and decoder units, RCA is inserted at all skip connections for pre-screening, and CIF is used to complete the interaction at each decoding and skip fusion position before upsampling / downstream decoding. Finally, the segmentation head outputs the probability mask. Through parallel convolution of SSM, long-range dependency modeling and memory usage increase linearly with sequence length, and pixel-level gating and lightweight bottlenecks reduce redundant computation. While ensuring accuracy, it reduces FLOPs and parameter count, adapting to real-time inference on vehicle / handheld / edge terminals. This "linear / quasi-linear complexity global modeling + lightweight fusion" offers significant efficiency advantages.
[0080] In summary, the multi-scale mutual feedback attention crack segmentation method according to embodiments of the present invention firstly performs multi-level feature encoding on the input preprocessed crack image, extracting and downsampling at each level to obtain encoded features at multiple scales; further, the encoded features are modulated to suppress redundant information and enhance the response of the target region, generating modulation skip features; then, the encoded features are decoded at multiple levels, and cross-scale bidirectional interactive fusion is performed based on the modulation skip features and the decoded features in the decoding process to obtain fused features, so as to collaboratively recover semantic and detail information, and upsampling at each level to obtain a fused feature map; finally, the crack segmentation result is output based on the fused feature map. Therefore, this method can improve the continuity and boundary clarity of cracks, reduce false detections and artifacts, improve crack detection rate and positioning accuracy, maintain stable segmentation performance and good generalization under multiple materials, multiple illuminations, and multiple noise conditions, and simultaneously meet the real-time deployment requirements of vehicle / edge terminals.
[0081] It should be noted that the method of this embodiment can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method of this embodiment, and the multiple devices will interact with each other to complete the above method.
[0082] It should be noted that the above description describes some embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than that shown in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0083] Corresponding to the above embodiments, the present invention also proposes a multi-scale mutual feedback attention crack segmentation device.
[0084] like Figure 9 As shown, the multi-scale mutual feedback attention crack segmentation device of this invention includes: an encoding module 910, a modulation module 920, a decoding module 930, and a segmentation module 940.
[0085] The encoding module 910 is configured to perform multi-level feature encoding on the preprocessed crack image, extracting and downsampling features at each level to obtain encoded features at multiple scales. The modulation module 920 is configured to modulate the encoded features to suppress redundant information and enhance the response of the target region, generating modulation skip features. The decoding module 930 is configured to perform multi-level feature decoding on the encoded features, performing cross-scale bidirectional interactive fusion based on the modulation skip features and the decoded features during the decoding process to obtain fused features, collaboratively recovering semantic and detail information, and upsampling at each level to obtain a fused feature map. The segmentation module 940 is configured to output crack segmentation results based on the fused feature map.
[0086] In some embodiments of the present invention, at least one level of multi-level feature encoding includes: fusing and extracting local details and long-range context information from the input features of the current level through a dual-path unit to form the encoded features of the current level; wherein the dual-path unit includes parallel local convolutional paths and global state space paths.
[0087] In some embodiments of the present invention, the encoding module 910 extracts local details and long-range context information from the input features of the current level through a dual-path unit to form the encoding features of the current level. Specifically, it is used to: obtain the first feature output by the local convolution path and the second feature output by the global state space path; generate pixel-level adaptive weights based on the first and second features; use the pixel-level adaptive weights to perform weighted fusion of the first and second features, and add the fusion result to the input features to obtain the encoding features.
[0088] In some embodiments of the present invention, the encoding module 910 obtains a first feature output by a local convolution path and a second feature output by a global state space path, specifically for: applying a spatially weighted convolution operation to the two-dimensional input features to obtain initial convolution features; wherein the convolution kernel of the spatially weighted convolution includes a spatial weight matrix constructed based on the outer product of a learnable one-dimensional vector; performing nonlinear activation and normalization processing on the initial convolution features to output the first feature; serializing the input features along multiple directions to obtain multiple directional sequences; performing state space model operations on each directional sequence respectively; reorganizing the operation results of the state space models in each direction into two-dimensional features and fusing them to output the second feature.
[0089] In some embodiments of the present invention, the modulation module 920 modulates the encoded features, specifically for: extracting a first global attribute vector and a second local salient vector of the encoded features respectively; performing mutual feedback modulation based on the first global attribute vector and the second local salient vector to generate a fused attribute vector; generating a spatial selection mask based on the fused attribute vector; and using the spatial selection mask to perform weighted filtering of the encoded features to generate a modulation jump feature.
[0090] In some embodiments of the present invention, the modulation module 920 performs mutual feedback modulation based on the first global attribute vector and the second local saliency vector, specifically for: generating a first modulation weight from the first global attribute vector and applying it to the second local saliency vector; generating a second modulation weight from the second local saliency vector and applying it to the first global attribute vector; and fusing the modulated first global attribute vector and the second local saliency vector to obtain a fused attribute vector.
[0091] In some embodiments of the present invention, the decoding module 930 performs multi-level feature decoding on the encoded features and performs cross-scale bidirectional interactive fusion based on modulation skip features and decoding features in the decoding process. Specifically, it is used to: map the decoding features from the decoding path to a first set of attention vectors and map the modulation skip features from the modulation path to a second set of attention vectors; perform a first attention aggregation on the second set of attention vectors using the query vector in the first set of attention vectors to obtain a first interaction result; perform a second attention aggregation on the first set of attention vectors using the query vector in the second set of attention vectors to obtain a second interaction result; combine the first interaction result with the first feature and combine the second interaction result with the second feature; fuse the two combined features and output the fused feature; wherein both the first attention aggregation and the second attention aggregation adopt a multi-head attention mechanism.
[0092] It should be noted that for details not disclosed in the multi-scale mutual feedback attention crack segmentation device of the present invention, please refer to the details disclosed in the multi-scale mutual feedback attention crack segmentation method of the present invention, which will not be repeated here.
[0093] For ease of description, the above apparatus is described in terms of its functions, divided into various modules. Of course, in implementing this invention, the functions of each module can be implemented in one or more software and / or hardware components.
[0094] The apparatus of the above embodiments is used to implement the corresponding method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0095] Corresponding to the above embodiments, the present invention also proposes an electronic device.
[0096] refer to Figure 10 The diagram below is a block diagram of an electronic device according to some embodiments of the present invention. It illustrates a more specific hardware structure of the electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are internally connected to each other via the bus 1050.
[0097] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0098] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0099] The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0100] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0101] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0102] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0103] The electronic devices described above are used to implement the corresponding methods in any of the foregoing embodiments and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0104] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, the present invention also provides a computer-readable storage medium storing computer instructions for causing a computer to perform the methods of any of the above embodiments.
[0105] The aforementioned computer-readable storage medium can be any available medium or data storage device that a computer can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0106] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to perform the methods of any of the above exemplary method sections, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0107] Furthermore, although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Rather, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0108] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0109] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this invention should have the ordinary meaning understood by those skilled in the art. The terms "first," "second," and similar terms used in the embodiments of this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word covers the element or object listed after the word and its equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0110] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be interpreted in the broadest sense, thereby encompassing all such modifications and equivalent structures and functions.
Claims
1. A multi-scale mutual-feedback attention crack segmentation method, characterized in that, include: Multi-level feature encoding is performed on the preprocessed crack image input, and features are extracted and downsampled at each level to obtain encoded features at multiple scales. The encoded features are modulated to suppress redundant information and enhance the response of the target region, thereby generating modulation skip features; The encoded features are subjected to multi-level feature decoding. Based on the modulation skipping features and the decoding features in the decoding process, cross-scale bidirectional interactive fusion is performed to obtain fused features, so as to collaboratively recover semantic information and detail information, and the fused feature map is obtained by upsampling at each level. At least one level of the multi-level feature encoding includes: fusing and extracting local details and long-range context information from the input features of the current level through a dual-path unit to form the encoded features of the current level; wherein, the dual-path unit includes parallel local convolutional paths and global state space paths; The step of fusing and extracting local details and long-range context information from the input features of the current level through a dual-path unit to form the encoded features of the current level includes: obtaining the first feature output by the local convolutional path and the second feature output by the global state space path; Pixel-level adaptive weights are generated based on the first feature and the second feature; The first feature and the second feature are weighted and fused using the pixel-level adaptive weights, and the fusion result is added to the input feature to obtain the encoded feature; The step of performing multi-level feature decoding on the encoded features, and performing cross-scale bidirectional interactive fusion based on the modulation skip features and the decoding features in the decoding process, includes: mapping the decoding features from the decoding path to a first set of attention vectors, and mapping the modulation skip features from the modulation path to a second set of attention vectors. The query vector in the first set of attention vectors is used to perform a first attention aggregation on the second set of attention vectors to obtain a first interaction result; The query vector in the second set of attention vectors is used to perform a second attention aggregation on the first set of attention vectors to obtain a second interaction result; The first interaction result is combined with the first feature, and the second interaction result is combined with the second feature; The two combined features are fused together to output the fused feature; wherein, both the first attention aggregation and the second attention aggregation adopt a multi-head attention mechanism. The crack segmentation result is output based on the fused feature map.
2. The multi-scale mutual feedback attention crack segmentation method according to claim 1, characterized in that, The step of obtaining the first feature of the local convolution path output and the second feature of the global state space path output includes: A spatially weighted convolution operation is applied to the two-dimensional input features to obtain initial convolutional features; wherein the convolution kernel of the spatially weighted convolution includes a spatial weight matrix constructed based on a learnable one-dimensional vector outer product; The initial convolutional features are subjected to nonlinear activation and normalization processing to output the first feature; The input features are serialized along multiple directions to obtain multiple directional sequences; State-space model calculations are performed on each of the aforementioned direction sequences; The computational results of the state-space models in each direction are reorganized into two-dimensional features and fused to output the second feature.
3. The multi-scale mutual feedback attention crack segmentation method according to claim 1, characterized in that, The modulation processing of the encoded features includes: Extract the first global attribute vector and the second local saliency vector of the encoded features respectively; Based on the mutual feedback modulation of the first global attribute vector and the second local saliency vector, a fused attribute vector is generated. A spatial selection mask is generated based on the fusion attribute vector; The spatial selection mask is used to weight and filter the encoded features to generate the modulation skipping features.
4. The multi-scale mutual feedback attention crack segmentation method according to claim 3, characterized in that, The mutual feedback modulation based on the first global attribute vector and the second local saliency vector includes: A first modulation weight is generated from the first global attribute vector and applied to the second local saliency vector; A second modulation weight is generated from the second local saliency vector and applied to the first global attribute vector; The modulated first global attribute vector is fused with the second local saliency vector to obtain the fused attribute vector.
5. A multi-scale mutual-feedback attention crack segmentation device, characterized in that, include: The encoding module is configured to perform multi-level feature encoding on the input preprocessed crack image, extracting and downsampling at each level to obtain encoded features at multiple scales; The modulation module is configured to modulate the coded features to suppress redundant information in the coded features and enhance the response of the target region, thereby generating modulation skip features; The decoding module is configured as follows: The encoded features are subjected to multi-level feature decoding. Based on the modulation skipping features and the decoding features in the decoding process, cross-scale bidirectional interactive fusion is performed to obtain fused features, so as to collaboratively recover semantic information and detail information, and the fused feature map is obtained by upsampling at each level. At least one level of the multi-level feature encoding includes: fusing and extracting local details and long-range context information from the input features of the current level through a dual-path unit to form the encoded features of the current level; wherein, the dual-path unit includes parallel local convolutional paths and global state space paths; The method of fusing and extracting local details and long-range context information from the input features of the current level through the dual-path unit to form the encoded features of the current level is specifically used to: obtain the first feature output by the local convolutional path and the second feature output by the global state space path; Pixel-level adaptive weights are generated based on the first feature and the second feature; The first feature and the second feature are weighted and fused using the pixel-level adaptive weights, and the fusion result is added to the input feature to obtain the encoded feature; The step of performing multi-level feature decoding on the encoded features, and performing cross-scale bidirectional interactive fusion based on the modulation skip features and the decoding features in the decoding process, is specifically used to: map the decoding features from the decoding path to a first set of attention vectors, and map the modulation skip features from the modulation path to a second set of attention vectors. The query vector in the first set of attention vectors is used to perform a first attention aggregation on the second set of attention vectors to obtain a first interaction result; The query vector in the second set of attention vectors is used to perform a second attention aggregation on the first set of attention vectors to obtain a second interaction result; The first interaction result is combined with the first feature, and the second interaction result is combined with the second feature; The two combined features are fused together to output the fused feature; wherein, both the first attention aggregation and the second attention aggregation adopt a multi-head attention mechanism. The segmentation module is configured to output crack segmentation results based on the fused feature map.
6. An electronic device, characterized in that, include: A processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the multi-scale mutual feedback attention crack segmentation method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the multi-scale mutual feedback attention crack segmentation method as described in any one of claims 1 to 4.