Hybrid attention road feature recognition algorithm
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-08-11
AI Technical Summary
与此同时,分割结果多停留于像素级语义表达,缺乏向工程量化指标(如病害面积与长度)的有效映射机制
[0058]利用本发明的技术方案制作的一种混合注意力路面特征识别算法,本发明通过构建方向混合注意力机制EFCA与风车卷积PConv,有效克服了传统注意力机制未能结合目标几何形态进行特征加权的局限性。消融试验数据表明,将基础的3×3卷积替换为PConv后,模型针对裂缝的F1分数提升了4.16%;在引入EFCA模块后,裂缝类别的判别精度进一步获得了4.68%的提升,充分验证了PConv与EFCA在复杂背景下针对方向型及结构型路面病害具有显著的协同增益效果。
Smart Images

Figure CN122551310A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision and intelligent transportation, and in particular to a hybrid attention road feature recognition algorithm. Background Technology
[0002] With the development of deep learning technology, semantic segmentation methods based on convolutional neural networks have been widely applied in the field of automatic pavement defect detection. By performing pixel-level classification on images, this type of method can automatically identify multiple types of defects such as cracks, potholes, construction joints, and strip repairs. Compared with traditional manual detection and rule-based image processing methods, it has significant advantages in detection efficiency and accuracy.
[0003] In existing research, typical models such as U-Net and its improved structures achieve multi-scale feature fusion through an encoder-decoder framework and skip connections, which can, to some extent, balance semantic and detailed information. Furthermore, some methods introduce attention mechanisms to weight channel or spatial features, thereby improving the responsiveness of key regions. However, in real-world scenarios of rural cement concrete pavements, the types of defects are complex and structurally diverse. Cracks, in particular, typically exhibit elongated, low-contrast, and directional structural features, and are significantly affected by lighting variations, texture interference, and background noise. This limits the practical application of existing methods. Moreover, current research primarily focuses on improving segmentation accuracy, while neglecting the comprehensive needs of engineering applications. In practical pavement inspection tasks, models not only need high recognition accuracy but also must maintain good real-time performance and operational stability under computationally limited conditions. Simultaneously, segmentation results often remain at the pixel-level semantic level, lacking an effective mapping mechanism to engineering quantitative indicators (such as defect area and length). Therefore, it is necessary to systematically optimize existing semantic segmentation methods by combining the structural characteristics of pavement defects with the needs of engineering applications, so as to achieve a unified improvement in detection accuracy, computational efficiency and engineering practicality. Summary of the Invention
[0004] The purpose of this invention is to solve the above-mentioned problems by designing a hybrid attention road feature recognition algorithm.
[0005] The technical solution of the present invention to achieve the above objectives is a hybrid attention road feature recognition algorithm, comprising the following steps:
[0006] Step S1: Road surface image data acquisition and preprocessing; Step S2: Constructing a directional hybrid attention network PFK-Unet, which includes the directional hybrid attention mechanism EFCA and the windmill convolution PConv; Step S3: Constructing a lightweight hybrid attention network GS-Unet, which includes the spatial gated convolution GSConv and the directional hybrid attention mechanism EFCA; Step S4: Selecting a network based on the engineering background, PFK-Unet is selected for high-precision and refined detection scenarios, while GS-Unet is selected for lightweight and rapid deployment scenarios with limited computing power; Step S5: Road surface damage assessment based on semantic segmentation connected component feature extraction, including clustering eight-connected component instances on the segmentation mask, converting the actual damaged area of pothole damage to pixel area, and obtaining the damaged area of strip repair damage through skeleton extraction and length conversion.
[0007] Preferably, in step S1: the rural cement concrete road surface image is acquired by a multi-functional road inspection vehicle. Industrial cameras are installed on both sides of the inspection vehicle to synchronously acquire road surface information to ensure that the acquired image can completely cover the driving lane area. For the original acquired image, the road surface image and its corresponding labeled image are subjected to unified preprocessing operations during the data construction stage, including image size normalization, dynamic range adjustment and grayscale processing.
[0008] Preferably, in step S2, EFCA includes three collaborative sub-modules: fine-grained channel attention, spatial attention, and a direction-sensitive weighting mechanism. In the fine-grained channel attention stage, global average pooling (GAP) is first used to process the three-dimensional tensor... The channel global statistics vector is compressed into a one-dimensional vector U. To simultaneously capture both local dependencies between adjacent channels and global dependencies across channels, one-dimensional convolutions with adaptive kernel sizes are used to generate local channel responses U. lc And use 1×1 convolution to generate global channel response U gc Subsequently, a cross-correlation matrix M is constructed to characterize the interaction between local and global features: ;
[0009] The local and global prior weights U are obtained by summing the rows and columns of M. lc w with U gc w Furthermore, a learnable scalar θ is introduced for dynamic balancing and fusion, and the final channel attention vector W is obtained by normalization using the Sigmoid function σ. C :
[0010] In the spatial attention stage, a 3×3 convolution is applied to the input feature F and activation is performed to generate a spatial weight map W. S This is used to highlight the spatial location of the disease and suppress disease-free areas;
[0011] ;
[0012] In the core direction-sensitive enhancement stage, the feature map F is divided into four specific feature subspaces F=[F1,F2,F3,F4] along the channel dimension. An adaptively learned direction weight vector is then introduced. The enhanced directional residual feature F is obtained after weighting. β :
[0013] ;
[0014] Finally, the high-precision feature tensor F* output by the EFCA module is obtained by summing and recalibrating channel gating, spatial gating, and directional features:
[0015] ;
[0016] Preferably, in step S2: the windmill convolution PConv includes: Let the feature map tensor input to the nth layer be X, with dimensions (h1, w1, c1), then the input intermediate layer feature tensor is... Before performing feature extraction, the PConv module first instantiates four fully parallel convolutional branches. Each branch shares the same kernel size k×k (k=3), but is assigned a different asymmetric padding parameter vector p1=(p l ,p t ,p r ,p b (These represent the number of pixel layers where zeros are padded at the left, top, right, and bottom boundaries of the feature map, respectively):
[0017] Horizontal left-leaning branch: Fill parameters Heavy padding on the left forces the effective convolution region to shift to the left of the input features in physical space.
[0018] Vertical upper branch: Fill parameter The heavy padding at the top guides the convolutional kernel to focus on the top.
[0019] Horizontal right-leaning branch: Fill parameters Modeling is shifted to the right.
[0020] Vertical downward branch: Fill parameter Downward offset modeling.
[0021] These four parallel branches apply standard 2D convolution operations to the feature maps after spatial translation, followed by batch normalization to stabilize the internal covariance shift, and then introduce a smooth nonlinear mapping using the SigmoidLinearUnit activation function. The convolution kernel size is k, the stride is s, and W represents the kernel parameters. This stage outputs four intermediate feature tensors containing local responses in different directions, denoted as:
[0022] ;
[0023] ;
[0024] ;
[0025] ;
[0026] Subsequently, the module enters the feature fusion stage, concatenating the four feature maps representing different directional views along the channel dimension to obtain the intermediate feature representation Z:
[0027] ;
[0028] To fuse convolutional responses from different directions and restore the preset number of output channels, PConv applies a 2×2 convolution operation after concatenation, with no padding and a stride of 1, and its weight is denoted as w'. This convolution is used to fuse feature responses from branches in different directions and adjust the spatial dimensions of the output feature map to the preset height and width of the network. Its output can be represented as:
[0029] ;
[0030] Finally, multi-directional features are integrated through fusion convolution, and the output feature map is consistent with the output of the corresponding standard convolutional layer in terms of spatial size. This allows the PConv module to directly replace traditional convolutional layers and be embedded in the existing network structure without changing the overall scale transformation relationship of the network.
[0031] Explanation of formula symbols:
[0032] In the EFCA attention mechanism:
[0033] M: Represents the cross-correlation matrix tensor between local and global channel responses, used to capture hidden joint relationships between complex channels in a higher dimension.
[0034] W S The spatial significance scalar matrix mapped back to the original feature size indicates that the closer the element value is to 1, the higher the confidence level of the core damaged area corresponding to that pixel.
[0035] β: The vector set is a scalar obtained by the network through adaptive learning during backpropagation, precisely corresponding to the importance confidence of the feature subspaces in the four segmentation directions.
[0036] F*: The semantic feature tensor output to the decoder after undergoing fine-grained channel attention, spatial feature enhancement, and orientation enhancement.
[0037] In windmill convolution:
[0038] P(X;p i ): Perform zero-padding geometric operations on the underlying feature map X according to four preset asymmetric parameter vectors.
[0039] W: Weight parameters of the parallel directional convolution operator;
[0040] W': The weight matrix of the 2×2 convolutional kernel that is ultimately responsible for dimensionality reduction and fusion;
[0041] k: kernel size (default is 3);
[0042] s: stride length;
[0043] Z: A high-dimensional redundant tensor that splices together asymmetric features in four directions.
[0044] Preferably, the spatial gated convolution GSConv in step S3 includes: extracting deep semantics from the input features via a 3×3 convolution backbone branch, generating gated features via a 3×3 bottleneck convolution branch, compressing the output channel into one channel, obtaining a spatial attention mask after Sigmoid activation, multiplying it element-wise with the backbone features through a broadcast mechanism, and then adding it to the residual connection after 1×1 convolution recalibration.
[0045] Preferably, in step S4, the number of parameters of PFK-Unet is 10.775M, and the inference time per frame is 0.054s; the number of parameters of GS-Unet is 6.775M, and the inference time per frame is 0.017s.
[0046] Preferably, in step S5, the identification results of strip-shaped repair defects are subjected to connected component extraction to obtain the coordinates (x, y, y) of the upper left corner of the i-th connected component. i min ,y i min The coordinates of the lower right corner of the connected domain (x) i max ,y i max ), Area of connected domain S i Subsequently, by statistically analyzing the lengths of the skeleton structures within the connected domain, the damaged area corresponding to the strip-shaped repair defects was calculated.
[0047] ;
[0048] The height H of the i-th (i≥1) connected component in the image is obtained using the above formula. i and width W i First, the skeleton of the strip-shaped repair disease features within the connected domain is extracted and the pixel points P are counted. i Therefore, the damaged area was calculated as follows: (Unit: m²), where G r This represents the size (in meters) of a single pixel mapped to the actual road surface. For pothole defects, after pothole defect segmentation, the pixel area of the i-th pothole connected region is S. i The physical size of a single pixel mapped to the actual road surface is G. r The actual damaged area of the pit can then be directly calculated using pixel statistics. Finally, the damaged area of the road surface in the current image is obtained by summing the results.
[0049] Explanation of formula symbols;
[0050] (x,y): Any pixel with a defect;
[0051] S i : The total area of pixels within the connected region of the i-th pit;
[0052] G r: The actual physical side length of the road surface corresponding to a single pixel in the image is (unit: m / pixel).
[0053] D i: The actual physical damage area of this pothole defect example;
[0054] (x) i min ,y i min ): the coordinates of the top-left corner of the i connected components;
[0055] (x) i max ,y i max ): the coordinates of the lower right corner of the i connected components;
[0056] H i The height of the connected component;
[0057] W i : Width of the connected component.
[0058] This invention presents a hybrid attention-based pavement feature recognition algorithm. By constructing a directional hybrid attention mechanism (EFCA) and a windmill convolution (PConv), this algorithm effectively overcomes the limitation of traditional attention mechanisms that fail to incorporate target geometry for feature weighting. Ablation test data shows that replacing the basic 3×3 convolution with PConv improves the model's F1 score for cracks by 4.16%. Furthermore, introducing the EFCA module further improves the crack category discrimination accuracy by 4.68%, fully validating the significant synergistic gain effect of PConv and EFCA for directional and structural pavement defects in complex environments.
[0059] This invention introduces the windmill convolution PConv, achieving a significant breakthrough in the nonlinear receptive field in a specific direction at the cost of an extremely small increase in the number of parameters. PConv, through four sets of asymmetric padding settings, forcibly stretches the theoretical span of the equivalent joint feature sampling region to 5 in both the horizontal and vertical directions, nonlinearly expanding the effective receptive field area to 25, which is 2.78 times larger than the standard 3×3 convolution. It also highly focuses on the radial extension regions in both the longitudinal and transverse directions, conforming to the characteristics of road surface cracks extending across directions and having numerous branches. This effectively improves the problem of lost connectivity structure caused by limited local field of view during downsampling pooling of discontinuous cracks.
[0060] This invention replaces windmill convolution with spatial gated convolution GSConv, reducing the number of parameters from 10.775M to 6.775M while ensuring a slight decrease in recognition accuracy. The inference time per image is shortened from 0.054s to 0.017s, and the computational cost is about 1 / 9 of that of standard convolution. This enables lightweight and rapid deployment, effectively overcoming the engineering limitations of high-precision models that are difficult to deploy in real time on resource-constrained devices.
[0061] This invention designs a flexible and selectable deployment scheme based on computing power constraints. By switching the core convolution module on demand, the system can smoothly adapt to two typical engineering backgrounds: high-precision fine detection and computing power-constrained lightweight rapid deployment, achieving an effective trade-off between detection accuracy and computing resource consumption.
[0062] This invention constructs a post-processing operator based on eight-connected domain instance separation and skeletonization dimensionality reduction, which transforms two-dimensional discrete pixel-level masks into physical quantitative indicators such as actual damaged area and equivalent impact area. This realizes an effective transformation from "deep learning semantic segmentation" to "quantitative evaluation of road engineering", which can seamlessly connect with the current highway technical condition evaluation standards and provide objective methodological support for the automated and standardized maintenance management of rural roads. Attached Figure Description
[0063] Figure 1This is a flowchart of a hybrid attention road feature recognition algorithm described in this invention. Detailed Implementation
[0064] The present invention will now be described in detail with reference to the accompanying drawings, such as... Figure 1 As shown, a hybrid attention road feature recognition algorithm is proposed:
[0065] Step S1: Road surface image data acquisition and preprocessing.
[0066] The primary step was to construct a high-quality image feature database of cement concrete pavement. The rural cement concrete pavement images used in the experiment were acquired by a multi-functional road inspection vehicle. Industrial cameras mounted on both sides of the vehicle simultaneously captured pavement information to ensure complete coverage of the driving lane area. For the raw images, unified preprocessing operations were performed on both the pavement images and their corresponding labeled images during the data construction phase. These included image size normalization, dynamic range adjustment, and grayscale conversion to improve image quality and enhance the consistency and recognizability of pavement details. After image preprocessing, the team performed detailed manual annotation on all pavement images. Different colors were used to distinguish the targets based on the type of damage: white for the pavement background, red for cracks, blue for strip repairs, yellow for potholes, and purple for construction joints. Areas without damage were not additionally annotated and were uniformly considered background. This annotation strategy, while ensuring concise and intuitive results, effectively highlights the differences between different damage types, providing a reliable data foundation for the subsequent training and performance evaluation of the semantic segmentation model.
[0067] Detailed logic:
[0068] This invention first acquires original high-resolution images of cement concrete pavement covering the entire driving lane area using an industrial camera mounted on a multi-functional road inspection vehicle. Road surface images acquired under complex external environments exhibit significant differences in lighting conditions, contrast distribution, and sensor resolution. Directly inputting such raw multi-channel tensors into a deep learning network is highly susceptible to gradient update direction oscillations during backpropagation due to drastic fluctuations in the numerical distribution of input features, leading to gradient vanishing or exploding phenomena, severely impacting the model's convergence speed and final performance. To ensure the network's numerical stability and feature discriminability during the extraction of multiple types of defects, this invention designs image preprocessing operations. These operations specifically include image size normalization, dynamic range adjustment, and grayscale conversion.
[0069] Formula logic:
[0070] First, to improve the network's processing efficiency for input data and ensure consistency in training scale, a bilinear interpolation algorithm is used to standardize the original road surface images acquired by different sensors to a standard resolution of 512×512. Bilinear interpolation effectively mitigates the jagged edges and local distortion caused by scale scaling by comprehensively considering the information of the four neighboring pixels surrounding the target pixel and performing weighted calculations. Its core interpolation formula is constructed as follows:
[0071] ;
[0072] Subsequently, grayscale reduction processing was performed on the high-dimensional color images. Since directly processing three-channel (R, G, B) color images by deep learning models would exponentially increase computational complexity, and the essential characteristics of road surface defects rely more on texture structure and grayscale abrupt changes than color differences, the data was reduced to a single channel. To preserve the contrast and brightness characteristics between the defects and the background to the greatest extent possible, based on the inherent physiological differences in the human visual system's sensitivity to different color bands (most sensitive to green, followed by red, and least sensitive to blue), specific weighting coefficients were assigned to the red, green, and blue channels for fusion. ;
[0073] Finally, to eliminate the overall pixel shift in road surface images caused by overexposure, local shadows, or low illumination, an adaptive dynamic range adjustment method is used to map image pixels to a standardized numerical range, achieving unified calibration across image brightness.
[0074] ;
[0075] Explanation of formula symbols:
[0076] I1, I2, I3, I4: These represent the specific brightness values of the four nearest neighboring pixels when the target pixel is mapped back to the original high-resolution image.
[0077] α: Normalized weight parameter for the horizontal distance of the target pixel relative to its four nearest neighbors;
[0078] β: Normalized weight parameter for the vertical distance of the target pixel relative to its four nearest neighbors;
[0079] Gray(x,y): The final brightness pixel value of the single-channel grayscale image generated after dimensionality reduction at spatial coordinates (x,y);
[0080] B(x,y), G(x,y), R(x,y): These are the pixel values of the blue, green, and red color channels in the original image at the same coordinates, respectively.
[0081] : The target pixel value after dynamic range normalization mapping;
[0082] I: Represents the original grayscale pixel value before dynamic range normalization;
[0083] I max The maximum pixel extreme value within a single input image or a local image region in the batch;
[0084] I min The minimum pixel extreme value within a single input image or a local image region in the batch;
[0085] A and B: Preset lower and upper limits of the target distribution interval (e.g., the [-1,1] normalization interval commonly used in conventional neural networks).
[0086] Analysis of the function of each part of the formula:
[0087] The combined effect of the above preprocessing mechanisms is to perform deep denoising and standardized mathematical correction on the original unstructured data. The use of the bilinear interpolation formula not only unifies the spatial dimension of the data input tensor, but also smooths out the minor and insignificant noise interference caused by road surface weathering and aging while keeping the computational complexity at an extremely low level.
[0088] The grayscale weighting formula reduces the three-channel tensor to a single-channel representation by cutting off the hue and saturation information that are weakly correlated with the identification of disease structures. This not only reduces the number of parameters and memory overhead of the bottom convolutional layer to one-third of the original, but also effectively avoids the network from fitting useless environmental color features.
[0089] The linear forced mapping formula for dynamic range ensures that the data tensors input into the network in the same batch have a highly consistent statistical distribution scale. This approach can alleviate the engineering problem of unbalanced gradient updates during deep network training, allowing the backpropagation parameters to maintain a reasonable range of variation. It fundamentally avoids the drastic oscillation of the loss function caused by differences in brightness between images, significantly improving the convergence speed of the subsequent orientation sensing module and the model's generalization robustness under complex lighting conditions.
[0090] step Construct a directional hybrid attention network (PFK-Unet).
[0091] Construction of Directional Hybrid Attention (EFCA) and its application to windmill convolution
[0092] Detailed logic:
[0093] Besides typical structural defects such as cracks and potholes, rural cement concrete pavements commonly exhibit surface characteristics such as visible construction joints and aging of strip repair areas during long-term service. Construction joints, as an unavoidable structural feature of cement concrete pavements, are prone to cracking, corner breakage, or propagation under traffic loads and environmental influences, often becoming the starting point for crack development and significantly impacting the overall structural integrity of the pavement. Simultaneously, strip repair areas typically reflect repair traces of existing defects, differing from the original pavement material in texture, color, and mechanical properties. During subsequent service, these areas are prone to interface weakening and repeated loading, easily forming new weak points and becoming a significant cause of recurring and expanding defects. Therefore, construction joints and strip repairs are not only important surface features of cement concrete pavements but also key factors affecting pavement performance and durability. Based on these considerations, this invention selects four typical pavement features—cracks, strip repairs, potholes, and construction joints—as research objects.
[0094] At the feature extraction level, the U-Net network, as one of the representative structures in semantic segmentation, effectively preserves the spatial details of images while fully extracting semantic information by introducing an encoder-decoder architecture and a skip connection mechanism. It is widely used in various scenarios such as medical image analysis, remote sensing image processing, and road structure recognition. However, while the U-Net network performs excellently in processing medical images or structurally regular targets, it has significant limitations when dealing with various types of defects in cement concrete pavements. Especially for slender topological structures with significant directional features, such as cracks and construction joints, traditional 3×3 or even 5×5 standard square convolutional kernels face structural defects when scanning features. The physical characteristics of a square receptive field dictate that it inevitably expands isotropically in all directions, while cracks typically occupy only a few pixels along the central diagonal or a single axis of the receptive field. This causes standard convolutional kernels to inevitably identify a large amount of useless redundant information from the surrounding normal pavement background when extracting features, severely diluting the already weak features of the small cracks, leading to crack breakage and misidentification in the segmentation results.
[0095] To address this technical challenge, this invention constructs a directional hybrid attention mechanism (EFCA), enabling the network to accurately evaluate the direction of feature extension based on channel recalibration and spatial saliency modeling. In conjunction with replacing traditional standard convolution with pinwheel-shaped convolution (PConv), the pinwheel convolution induces significant spatial shifts and diffusions in the receptive fields of each branch convolution kernel across different dimensions (vertical, horizontal, and vertical) by constructing four spatially asymmetric zero-padding strategies. This results in a cross-receptive field distribution on the feature map, resembling "windmill blades," greatly enhancing the ability to capture cross-directional extended structural features. This leads to the construction of a high-precision directional hybrid attention network, PFK-Unet.
[0096] Formula logic:
[0097] First, by eliminating background redundancy and enhancing directional structural features, this invention constructs a Directional Hybrid Attention (EFCA) mechanism. EFCA comprises three collaborative sub-modules: fine-grained channel attention, spatial attention, and a direction-sensitive weighting mechanism. In the fine-grained channel attention stage, global average pooling (GAP) is first used to weight the three-dimensional tensor... The channel global statistics vector is compressed into a one-dimensional vector U. To simultaneously capture both local dependencies between adjacent channels and global dependencies across channels, one-dimensional convolutions with adaptive kernel sizes are used to generate local channel responses U. lc And use 1×1 convolution to generate global channel response U gc Subsequently, a cross-correlation matrix M is constructed to characterize the interaction between local and global features:
[0098] ;
[0099] The local and global prior weights U are obtained by summing the rows and columns of M. lc w with U gc w Furthermore, a learnable scalar θ is introduced for dynamic balancing and fusion, and the final channel attention vector W is obtained by normalization using the Sigmoid function σ. C :
[0100] In the spatial attention stage, a 3×3 convolution is applied to the input feature F and activation is performed to generate a spatial weight map W. S Used to highlight the spatial location of the disease and suppress disease-free areas:
[0101]
[0102] In the core direction-sensitive enhancement stage, the feature map F is divided into four specific feature subspaces F=[F1,F2,F3,F4] along the channel dimension. An adaptively learned direction weight vector is then introduced. The enhanced directional residual feature F is obtained after weighting. β :
[0103]
[0104] Finally, the high-precision feature tensor F* output by the EFCA module is obtained by summing and recalibrating channel gating, spatial gating, and directional features:
[0105]
[0106] Regarding the reference to the windmill convolution (PConv), this invention assumes that the feature map tensor input to the nth layer is X, with dimensions (h1, w1, c1). Then, the input intermediate layer feature tensor is... Before performing feature extraction, the PConv module first instantiates four fully parallel convolutional branches. Each branch shares the same kernel size k×k (k=3), but is assigned a different asymmetric padding parameter vector p1=(p l ,p t ,p r ,p b (These represent the number of pixel layers where zeros are padded at the left, top, right, and bottom boundaries of the feature map, respectively):
[0107] Horizontal left-leaning branch: Fill parameters Heavy padding on the left forces the effective convolution region to shift to the left of the input features in physical space.
[0108] Vertical upper branch: Fill parameter The heavy padding at the top guides the convolutional kernel to focus on the top.
[0109] Horizontal right-leaning branch: Fill parameters Modeling is shifted to the right.
[0110] Vertical downward branch: Fill parameter Downward offset modeling.
[0111] These four parallel branches apply standard 2D convolution operations to the feature maps after spatial translation, followed by batch normalization (BN) to stabilize the internal covariance shift, and then introduce a smooth nonlinear mapping using the SiLU (Sigmoid Linear Unit) activation function. The convolution kernel size is k, the stride is s, and W represents the kernel parameters. This stage outputs four intermediate feature tensors containing local responses in different directions, denoted as...
[0112]
[0113]
[0114]
[0115]
[0116] Subsequently, the module enters the feature fusion stage, concatenating the four feature maps representing different directional views along the channel dimension to obtain the intermediate feature representation Z:
[0117]
[0118] To fuse convolutional responses from different directions and restore the preset number of output channels, PConv applies a 2×2 convolution operation (no padding, stride of 1) after concatenation, with weights denoted as w'. This convolution fuses feature responses from branches in different directions and adjusts the spatial dimensions of the output feature map to the network's preset height and width. Its output can be represented as:
[0119]
[0120] Finally, multi-directional features are integrated through fusion convolution, and the output feature map is consistent with the output of the corresponding standard convolutional layer in terms of spatial size. This allows the PConv module to directly replace traditional convolutional layers and be embedded in the existing network structure without changing the overall scale transformation relationship of the network.
[0121] Explanation of formula symbols:
[0122] In the EFCA attention mechanism:
[0123] M: Represents the cross-correlation matrix tensor between local and global channel responses, used to capture hidden joint relationships between complex channels in a higher dimension.
[0124] W S The spatial significance scalar matrix mapped back to the original feature size indicates that the closer the element value is to 1, the higher the confidence level of the core damaged area corresponding to that pixel.
[0125] β: The vector set is a scalar obtained by the network through adaptive learning during backpropagation, precisely corresponding to the importance confidence of the feature subspaces in the four segmentation directions.
[0126] F*: The semantic feature tensor output to the decoder after undergoing fine-grained channel attention, spatial feature enhancement, and orientation enhancement.
[0127] In windmill convolution:
[0128] P(X;p i ): Perform zero-padding geometric operations on the underlying feature map X according to four preset asymmetric parameter vectors.
[0129] W: Weight parameters of the parallel directional convolution operator
[0130] W': The weight matrix of the 2×2 convolutional kernel that is ultimately responsible for dimensionality reduction and fusion.
[0131] k: Convolution kernel size (default is 3)
[0132] s: Sliding stride
[0133] Z: A high-dimensional redundant tensor that splices together asymmetric features in four directions.
[0134] Analysis of the function of each part of the formula:
[0135] The core innovation of EFCA lies in effectively overcoming the limitation of traditional attention mechanisms that fail to incorporate target geometry into feature weighting. Specifically, the cross-correlation matrix M constructs the interaction relationship between global and local channels, enabling the network to adaptively mine deep semantic associations between multi-dimensional features. Spatial weight graph W S Through pixel-by-pixel multiplication ( This achieves spatial saliency modulation, effectively suppressing the characteristic responses of complex background noise such as pavement stone reflection and tire marks, and significantly enhancing the weight allocation of key structural areas such as pothole edges and cracks. Furthermore, based on F... β The directional mechanism, which addresses the differences in the orientation of defects such as longitudinal cracks and transverse construction joints, endows the model with orientation-sensitive feature recalibration capabilities through feature channel segmentation and independent reorganization of directional weight β.
[0136] The advantage of the EFCA module lies in its ability to adaptively optimize the β weights of the directional branches that best match the pavement distresses with complex cross-topologies. This collaborative design effectively ensures that the directional topology information, after being extracted through PConv receptive field expansion, is not only spared from the spatial structural information loss caused by deep downsampling operations, but is also continued and strengthened in the global high-level semantic weight allocation. Ablation test data show that replacing the basic 3×3 convolution with PConv improves the model's F1 score for cracks by 4.16%; and after introducing the EFCA module, the crack category discrimination accuracy is further improved by 4.68%, fully verifying the significant synergistic gain effect of PConv and EFCA for directional and structural pavement distresses in complex contexts.
[0137] The core technological advantage of PConv (Phosphine Convolution) lies in its ability to achieve a significant breakthrough in the nonlinear receptive field in a specific direction at the cost of an extremely slight increase in the number of parameters. Rigorous mathematical derivation demonstrates that when a conventional network uses a 3×3 convolution kernel, its receptive field area is rigidly limited to A. Conv =3×3=9. PConv sets the offset through four sets of asymmetric padding. This forces the theoretical span of the equivalent joint feature sampling region to be stretched to [a certain value] in both the horizontal and vertical directions. Therefore, the effective receptive field area of this module is nonlinearly expanded to... This 2.78-fold increase in receptive field area, due to its asymmetric arrangement, highly focuses on the longitudinal and lateral radial extension regions, consistent with the characteristics of road surface cracks extending across directions and branching extensively. This mechanism enables the network to span isolated pixels at a very shallow coding level, capturing longer crack extensions, thereby improving the problem of lost connectivity structure caused by limited local field of view during downsampling pooling of discontinuous cracks.
[0138] step : Construct a lightweight hybrid attention network (GS-Unet).
[0139] Construct a lightweight spatially gated convolution GSConv.
[0140] Detailed logic:
[0141] In rural road maintenance and inspection, detection systems are typically deployed on mobile edge platforms with limited computing resources, such as vehicle-mounted embedded terminals or drones. This objective condition leads to severe limitations in the practical application of existing high-precision models: their massive computational overhead is difficult to match with the limited computing power of the platform, severely restricting the model's real-time deployment capability. In step a, although the PFK-Unet network constructed in this invention has significant accuracy advantages in the refined segmentation of multiple types of diseases, its internal dense multi-branch feature extraction and cross-matrix operations result in a model parameter size as high as 10.775M, and the forward inference time for a single frame image reaches 0.054s. The excessively high computational load makes it difficult for this model to achieve an effective balance between detection accuracy and inference efficiency in computing-constrained engineering environments.
[0142] To systematically address the aforementioned issues, this invention, based on the PFK-Unet network, introduces a self-constructed spatially gated convolution GSConv to replace the windmill convolution, reducing the number of model parameters and computational complexity. It also retains the EFCA attention mechanism to compensate for the degradation in feature representation capabilities caused by lightweight design, thus deriving the lightweight architecture GS-Unet. Consequently, this invention designs a flexible and adaptive solution constrained by computational power: through the dynamic selection of core convolutional modules, it achieves an effective trade-off between lightweight and rapid deployment and high-precision, refined detection, thereby meeting the needs of road surface defect identification tasks in diverse scenarios.
[0143] Firstly, this invention improves upon GBConv convolution, a lightweight convolutional module that combines a bottleneck convolution structure with a gating mechanism. It introduces pointwise convolution and depthwise convolution mechanisms from depthwise separable convolution. Unlike traditional convolution that directly maps features in a high-dimensional feature space, GBConv first performs channel compression on the input features through bottleneck convolution, mapping high-dimensional features to a low-dimensional subspace. The main spatial feature extraction process is completed within this subspace, effectively reducing parameter size and computational complexity. Subsequently, pointwise convolution remaps the features back to the original channel dimension to ensure the integrity of the feature representation. Building upon this, GBConv introduces a gating mechanism to dynamically modulate the features. Specifically, the input features are divided into a main feature branch and a gating branch. The main branch is responsible for extracting basic structural and texture features, while the gating branch generates a gating weight map with the same scale as the input features through lightweight bottleneck convolution, used to characterize the importance of features at different spatial locations and channel dimensions. The two are fused element-wise to enhance key information and suppress redundant information, thereby improving the discriminativeness and robustness of the feature representation. Furthermore, the GBConv module fuses the modulated features with the original input features through residual connections, preserving basic semantic information while ensuring stable gradient propagation and effectively avoiding feature degradation.
[0144] Secondly, and this is the key design of this step, step b expands the gate modulation method of the bottleneck convolution (GBConv) structure from the traditional channel level to channel spatial level modulation. By explicitly learning pixel-level spatial weights, the network is guided to pay more attention to the disease area during the feature extraction process, thereby improving the boundary expression ability and regional response stability of semantic segmentation.
[0145] Specifically, the GBConv module contains two bottleneck convolutions with 3×3 kernels (block1 and block2) and two bottleneck convolutions with 1×1 kernels (block3 and block4), along with residual connections. The newly introduced spatial gating branch is the core innovation of the entire GBConv module. This branch is inserted after the feature extraction branch (block3) and before the feature fusion (multiplication) operation. The input features of GBConv are processed through 3×3 convolutions, normalization, and activation operations to extract deep spatial semantics and local structural information, forming the backbone feature representation (block1 and block2). Simultaneously, 1×1 convolutions, normalization, and activation operations generate gated features (block3), completing feature recombination and weight modeling along the channel dimension. Subsequently, the two branches achieve adaptive nonlinear modulation through element-wise multiplication, thereby strengthening discriminative information and suppressing redundant responses. Finally, the modulated features are recalibrated through 1×1 convolutions, normalization, and activation operations (block4), and feature fusion and stable transfer are completed using residual identity mapping.
[0146] GSConv (Spatial Gated Convolution) structurally reconstructs the feature fusion method of GBConv by introducing a spatial gating mechanism, achieving adaptive feature selection and enhancement in the spatial dimension. Its core process involves the input features first being processed by cascaded 3×3 convolutional backbone branches to extract deep semantic and local structural information (block1 and block2); simultaneously, the input tensor X is fed into a parallel feature-aware branch (block3). Unlike GBConv, GSConv deploys a 3×3 bottleneck convolution instead of a 1×1 bottleneck convolution here, giving the gating branch a larger receptive field. Before generating the gating weights, the network can capture richer local spatial context information, making the subsequently generated gating mask more sensitive to spatial structures such as image edges and textures. Next, unlike GBConv which directly multiplies the backbone features and gating branch features element-wise, GSConv uses the Sigmoid activation function to strictly map and compress the output values to between 0 and 1, so that weights close to 1 represent allowing important information to pass, while weights close to 0 represent suppressing irrelevant background noise. This makes network training more stable and avoids numerical explosion. It compresses the input channels into a single channel. This means the gating shape is (B, 1, H, W). When the (B, 1, H, W) gating is multiplied by (B, C, H, W), a tensor broadcasting mechanism is triggered. At this point, GSConv actually constructs a spatial attention mask. It applies the same weight to the same spatial coordinates of all channels, forcing the network to focus its attention on the most salient spatial locations in the image (such as the outline of the target object or key parts). This operation gives the network the ability to "filter attention" in the spatial dimension: the mask matrix applies a uniform penalty or incentive to all channels of the backbone features in the spatial coordinate system. It can adaptively amplify key target regions with high signal-to-noise ratios and effectively suppress redundant static background noise or light and shadow interference. The spatially modulated fused features are pushed into the terminal's 1×1 bottleneck convolutional unit (block4). This unit acts as a feature space recalibrator, correcting the local feature distribution shift that may be induced by pointwise mask multiplication, achieving information smoothing and dimensionality reduction reorganization in the channel dimension. Finally, feature recalibration is completed through 1×1 convolution, and stable information fusion and gradient propagation are achieved by combining residual identity mapping.
[0147] Finally, this invention constructs a lightweight feature modeling framework GSConv that combines spatial perception, gated modulation, and residual reconstruction. This framework significantly improves feature representation capabilities and robustness in complex scenarios while controlling computational complexity.
[0148] Formula logic:
[0149] The GSConv module consists of four bottleneck modules and one explicit gated branch, with residual connections. Assume that both input and output channels are C, and the spatial dimensions are H×W.
[0150] (1) Computational analysis of bottleneck convolution (BottConv)
[0151] GSConv consists of multiple bottleneck convolutional units. The internal structure of each bottleneck module first performs 1×1 pointwise convolution, then channelwise convolution, and finally outputs through 1×1 pointwise convolution. Therefore, the computational cost of a single bottleneck convolution (BottConv) can be decomposed into three parts.
[0152] The first pointwise convolution:
[0153] ;
[0154] Channel-wise convolution (in C) m (Perform k×k convolutions on each channel) ;
[0155] The second pointwise convolution:
[0156]
[0157] The number of bottleneck channels is set as follows:
[0158]
[0159] In the code implementation, the compression ratio r is set to 8. Therefore, the convolution computation cost of a single bottleneck module is:
[0160] ;
[0161] Substitute C m =C / r gives: ;
[0162] element-wise operations
[0163] Within the GSConv module, there are three key element-wise operations: gated convolution, gated multiplication, and residual addition. These three operations appear sequentially in the structural order, and their computational complexity is of the same order of magnitude: the number of channels multiplied by the spatial size, i.e., the number of channels × height × width.
[0164] Gated convolution is used to generate spatial attention maps. Its input is a feature map with multiple channels, and its output is a single-channel two-dimensional image (i.e., a spatial attention map). Internally, it uses a 1×1 convolution kernel. At each spatial location, it performs a dot product operation between the values of all channels and a weight vector of length equal to the number of channels, outputting a single value. This operation requires calculating the channel orientation at each spatial location. Since the image has a total of height multiplied by width, the overall computational complexity is simply the number of channels multiplied by the height multiplied by the width.
[0165] Gated multiplication is used to perform element-wise multiplication of the feature map extracted from the main branch with the gated map, achieving spatial attention modulation. Although the gated map is single-channel, it is automatically expanded to the same number of channels as the main branch feature map during computation through a broadcast mechanism. At each channel and each position, the model performs only one numerical multiplication, without addition or other operations. Therefore, the total number of computations performed by this operation is exactly equal to the number of channels of the feature map multiplied by its height and width. It is important to note that although the gated map is copied multiple times during computation, this "copying" is a frame-level memory broadcast and does not increase the actual number of multiplications. The actual computation is still one multiplication per position, so the computational cost of this operation is a single traversal of the entire feature map.
[0166] Residual addition refers to adding the output feature map of the GSConv module to the input feature map element-wise to enhance feature propagation and gradient stability. Since the two feature maps are of identical size, the addition operation performs a floating-point addition once per channel and position. Therefore, each channel at each pixel undergoes only one addition, and the entire operation traverses the complete feature map. Figure 1 The computational cost is also the same: number of channels × height × width.
[0167] Although spatial gating, gated multiplication, and residual addition in GSConv are fundamentally different—the former is a convolution and the latter two are element-wise operations—they share the common characteristic of performing only one multiplication or addition at each spatial location and each channel. Therefore, their computational complexity is the same as the total number of elements in the feature map, which is the number of channels × height × width. This linear complexity ensures that the GSConv module maintains good computational efficiency while enhancing its structure. Therefore, the computational cost of gated convolution, gated multiplication, and residual connections is HW × C, and the total computational complexity of element-wise operations is:
[0168] ;
[0169] The computational complexity of spatial gating can be expressed as: ;
[0170] (3) The overall computational cost of GSConv;
[0171] GSConv contains three bottleneck convolutions with k=3 (block1, block2, block3), one bottleneck convolution with k=1 (block4), one spatially gated convolution, one gated multiplication, and one residual connection. Therefore, the total computational cost (FLOPs) of convolutions is:
[0172] ;
[0173] ;
[0174] In the code implementation, the compression ratio is set to r=8: ;
[0175] Comparison of computational cost between standard convolution and GSConv convolution;
[0176] For standard convolution with the same channel setting, the computational cost is:
[0177] ;
[0178] For GSConv spatially gated lightweight convolutions with the same channel setting, the computational cost is:
[0179] ;
[0180] Generally, with a large number of convolutional kernels C, and C / 1 being negligible, the ratio of GSConv's spatially gated convolution to ordinary convolution is approximately 1 / 9, significantly reducing the number of parameters. GSConv enhances the network's response stability to target regions in complex backgrounds with minimal parameters.
[0181] Explanation of formula symbols:
[0182] C: Number of convolution kernels;
[0183] K: Number of convolution kernels;
[0184] The computational complexity of spatial gating;
[0185] The first pointwise convolution;
[0186] Channel-wise convolution (performing k×k convolutions on each of the Cm channels);
[0187] The second pointwise convolution;
[0188] Number of bottleneck channels;
[0189] The computational cost of convolution in a single bottleneck module;
[0190] The total computational complexity of element-wise operations;
[0191] The overall computational cost of GSConv;
[0192] Standard convolution computational cost;
[0193] r: Compression ratio is set to r=8;
[0194] Analysis of the function of each part of the formula:
[0195] The innovation of this invention lies in retaining the two k=3 bottleneck convolutions in the GBConv convolution ( ) is used for backbone feature extraction, and the bottleneck convolution with k=1 used for branch feature extraction is used ( Change to 3×3 bottleneck convolution ( This change gives the gating branch a larger receptive field, allowing the network to capture richer local spatial context information before generating gating weights, making the subsequently generated gating mask more sensitive to spatial structures such as image edges and textures.
[0196] The most important innovation is the introduction of a gating mechanism, which receives 3×3 bottleneck convolutions ( The output branch features are compressed into a single channel. This means the gating shape is (B, 1, H, W), where B represents the batch size (the number of samples input into the model at one time). When the (B, 1, H, W) gating is multiplied by the backbone features (B, C, H, W), a tensor broadcasting mechanism is triggered. At this point, GSConv actually constructs a purely spatial attention mask. It applies the same weight to the same spatial coordinates of all channels, forcing the network to focus its attention on the most salient spatial locations in the image (such as the outline or key parts of the target object). This operation gives the network the ability to "filter attention" in the spatial dimension: the mask matrix applies a uniform penalty or incentive to all channels of the backbone features in the spatial coordinate system. It can adaptively amplify key target regions with high signal-to-noise ratios and effectively suppress redundant static background noise or lighting interference.
[0197] step Network selection based on different engineering backgrounds.
[0198] In practical engineering applications of rural cement concrete pavement distress detection, the diversity of application scenarios places differentiated demands on the performance focus of deep learning models. Addressing the inherent contradiction between high-precision feature extraction and limited edge computing power, this invention overcomes the limitations of a single network architecture and designs a flexible, selectable deployment scheme driven by computing power constraints. By switching the core convolutional modules as needed, the system can smoothly adapt to the following two typical engineering scenarios:
[0199] (1) PFK-Unet network is selected for high-precision and refined detection scenarios;
[0200] When engineering tasks focus on offline, high-precision quantitative assessment of pavement defects (such as microcracks and construction joints), and the computing platform has sufficient computing power, the system prioritizes deploying the PFK-Unet network. This network integrates directional hybrid attention (EFCA) and windmill convolution (PConv), effectively overcoming background noise interference in complex environments and possessing strong topological continuity maintenance capabilities. Although its dense cross-matrix operations result in a model parameter count of 10.775M and a single-frame forward inference time of 0.054s, it can provide high-precision segmentation results in complex and variable high-noise environments, making it an ideal choice for achieving accurate mapping of engineering defects quantitative indicators.
[0201] (2) Switching to the GS-Unet network for lightweight, rapid deployment scenarios with limited computing power;
[0202] In routine road inspection tasks, detection systems often need to be directly mounted on edge computing platforms such as vehicle-mounted embedded mobile terminals or drones. Faced with such stringent computational bottlenecks and real-time requirements, the system can flexibly switch to the lightweight network GS-Unet. This architecture retains the overall advantages of PFK-Unet, only requiring the smooth replacement of its windmill convolution with the spatially gated convolution constructed in this invention. This point-by-point replacement of the underlying module significantly reduces the model's massive computational overhead and memory usage, effectively resolving the engineering limitations of high-precision models being difficult to deploy in real-time on resource-constrained devices. Compared to PFK-Unet, GS-Unet, while maintaining a slight decrease in recognition accuracy, reduces the number of parameters from 10.775M to 6.775M, and shortens the inference time per image from 0.054s to 0.017s, demonstrating its engineering advantages in the rapid detection and real-time application of defects in rural cement concrete pavements.
[0203] In summary, this invention improves upon the classic U-Net network by employing a self-developed directional hybrid attention mechanism (EFCA) to address the issues of insufficient feature detail representation in cement concrete pavements, which leads to the easy omission of slender targets and discontinuous segmentation. Furthermore, a self-developed spatially gated convolution (GSConv) further reduces the network's computational overhead, ultimately resulting in two semantic segmentation networks that can be configured according to engineering needs. This strategy, based on flexible selection of core convolutional modules, effectively overcomes the limitations of single networks in complex pavement scenarios. This technical solution achieves an effective trade-off between feature detection accuracy and computational resource consumption while ensuring robustness in identifying multiple types of defects, significantly enhancing the feasibility of the model in practical engineering applications.
[0204] step A method for assessing road surface defects based on semantic segmentation and connected component feature extraction.
[0205] Detailed logic:
[0206] Different types of pavement distress exhibit significant differences in geometric morphology and structural failure mechanisms, and their engineering measurement methods also differ fundamentally. Surface distress, represented by potholes, typically manifests as closed areas, and its evaluation index is based on the actual damaged area (m²). 2 The core is the structural integrity; while cracks and strip repairs are typical linear defects, and their apparent width is easily affected by imaging conditions and construction factors, making it difficult to accurately reflect the degree of structural damage. Therefore, the engineering assessment of such defects needs to separate the width information, measure it based on the length m of the skeleton centerline, and combine it with the equivalent impact width specified in the standard to achieve area conversion.
[0207] Whether it's the high-precision PFK-Unet or the lightweight GS-Unet, the final output of the semantic segmentation model is a two-dimensional discrete mask, which is essentially a numerical representation of pixel-level category labels (such as cracks, potholes, etc.). However, this type of result belongs to the representation level and cannot directly meet the actual needs of quantitative assessment of pavement defects in engineering applications. To achieve an effective transformation from "pixel semantics" to "engineering quantification," it is necessary to build a post-processing mechanism oriented towards industry standards, mapping the segmentation results to a structured physical index system that conforms to the "Rural Road Technical Condition Assessment Standard (JTG 5211-2024)" and the "Highway Technical Condition Assessment Standard (JTG 5210-2018)."
[0208] To systematically solve this problem, this invention, based on the aforementioned engineering physical constraints and evaluation logic, designs differentiated geometric feature extraction and quantification operators for different types of diseases, and performs refined post-processing on the segmentation mask, thereby achieving high-precision inversion of disease morphological parameters and standardized expression of engineering indicators.
[0209] Formula logic:
[0210] First, the principle of 8-connectivity in digital image processing is introduced. The entire semantic segmentation prediction mask is traversed to find similar highlighted defect pixels and perform region growing and connected component instance clustering. In the mathematical definition of 8-connectivity, taking any defect pixel (x, y) as the core, its horizontal, vertical, and four diagonal (top left, bottom left, top right, bottom right) adjacent pixels are rigorously detected. If adjacent points belong to the same defect category, they are included in the current growing set. This process can separate scattered predicted pixels into i independent defect connected component instances with clear physical meaning.
[0211] The extent of pothole damage is evaluated based on its actual damaged area, measured in square meters (m²), without the need for length or width conversions. In calculating the damaged area, the pothole segmentation results are first analyzed using connected components to extract their geometric features, including the coordinates of the top-left corner of each of the i connected components (x, y, y). i min ,y i min The coordinates of the lower right corner of the connected domain (x) i max ,y i max ), Area of connected domain S i Subsequently, by establishing a mapping relationship between pixel scale and actual physical scale, the number of pixels in the connected domain is counted, thereby directly converting the actual damaged area of potholes and realizing a quantitative assessment of potholes.
[0212] Strip repair is a pavement repair method typically used for localized damage areas such as cracks and potholes. It involves cutting and filling strips to create a linear structure. According to the "Highway Technical Condition Assessment Standard (JTG 5210-2018)," the damaged area of a strip repair defect is obtained by multiplying the repair length (in meters) by the standard repair width of 0.2 meters. In the specific calculation process, the connected component of the identified strip repair defect is first extracted to obtain the coordinates (x, y, y) of the top-left corner of the i-th connected component. i min ,y i min The coordinates of the lower right corner of the connected domain (x) i max ,y i max ), Area of connected domain S i Subsequently, by statistically analyzing the lengths of the skeleton structures within the connected domain, the damaged area corresponding to the strip-shaped repair defects was calculated.
[0213] ;
[0214] The height H of the i-th (i≥1) connected component in the image is obtained using the above formula. i and width W i First, the skeleton of the strip-shaped repair disease features within the connected domain is extracted and the pixel points P are counted. i Therefore, the damaged area was calculated as follows: (Unit: m²), where G r This represents the size (in meters) of a single pixel mapped to the actual road surface. For pothole defects, after pothole defect segmentation, the pixel area of the i-th pothole connected region is S. i The physical size of a single pixel mapped to the actual road surface is G. r The actual damaged area of the pit can then be directly calculated using pixel statistics. Finally, the damaged area of the road surface in the current image is obtained by summing the results.
[0215] Explanation of Formula Symbols
[0216] (x,y): Any pixel with a defect;
[0217] S i : The total area of pixels within the connected region of the i-th pit;
[0218] G r: The actual physical side length of the road surface corresponding to a single pixel in the image is (unit: m / pixel).
[0219] D i: The actual physical damage area of this pothole defect example;
[0220] (x) i min ,y i min ): the coordinates of the top-left corner of the i connected components;
[0221] (x) i max ,y i max ): the coordinates of the lower right corner of the i connected components;
[0222] H i The height of the connected component;
[0223] W i : Width of the connected component;
[0224] Analysis of the function of each part of the formula
[0225] This evaluation system effectively addresses the technical challenges of bridging deep learning semantic segmentation results with quantitative assessment of road maintenance projects, achieving a systematic mapping from pixel-level semantic information to physical indicators at the engineering entity level. An eight-connected-domain algorithm is introduced to transform the discrete and unordered set of pixels in the original mask into independent connected domains with spatial consistency, thus completing the crucial transition from "semantic annotation" to "instance separation." This process enables accurate separation of multi-target defects in complex scenarios, assigns a unique identifier to each connected domain, and extracts its geometric boundary features, achieving independent modeling and analysis oriented towards engineering accounting units.
[0226] At the geometric quantization level, addressing the issue of unstable widths and susceptibility to imaging and construction factors in linear defects (cracks and strip repairs), this invention introduces a morphological skeleton extraction algorithm. By performing topology-preserving skeletonization on segmented regions, irregularly wide areas like strip repairs are compressed into a single-pixel-width centerline structure, thus achieving a stable depiction of the spatial extension path of the defect. This method essentially performs mathematical dimensionality reduction from two-dimensional regions to one-dimensional topological structures, effectively avoiding measurement biases caused by visual width fluctuations, making defect quantification more aligned with its structural mechanics significance. Subsequently, the physical length is calculated based on the skeleton pixel length and spatial resolution, and combined with the equivalent influence width specified in industry standards, a standardized conversion of the linear defect area is achieved.
[0227] Finally, the algorithm iterates through all connected component instances, uniformly calculates and accumulates the geometric parameters of different types of defects, completes the comprehensive damage assessment at the single image scale, and outputs a structured engineering report. This report includes image identification information, the number of defects of each type, and their corresponding physical quantitative indicators (area). It can seamlessly integrate with existing road technical condition assessment databases, enabling automated data entry and standardized management. Overall, this method significantly improves the usability and practical value of semantic segmentation results in real-world engineering decision-making while ensuring computational accuracy and robustness.
[0228] In summary, this invention addresses the characteristics of pavement defects and the diverse engineering needs across various scenarios, proposing a hybrid attention-based pavement feature recognition algorithm and constructing an intelligent pavement defect assessment framework based on it. This scheme first innovatively derives the PFK-Unet and GS-Unet semantic segmentation network groups through the flexible selection of the EFCA mechanism and core convolutional modules (PConv / GSConv). This achieves a trade-off between lightweight, rapid inspection and high-precision, refined analysis, while accurately compensating for the high rates of missed and false detections of slender defects. Building upon this, the invention introduces processing operators based on eight-connected domain instance separation and skeletonization dimensionality reduction, transforming two-dimensional discrete pixel-level masks into physical quantitative indicators such as actual damaged area and equivalent impact area, according to current highway assessment standards. This end-to-end technical solution effectively transforms "deep learning semantic segmentation" into "quantitative assessment of pavement engineering," providing objective methodological support for the automated and standardized maintenance management of rural roads.
[0229] The above technical solutions only embody the preferred technical solutions of the present invention. Any modifications that may be made by those skilled in the art to certain parts thereof embody the principles of the present invention and fall within the protection scope of the present invention.
Claims
1. A hybrid attention-based road feature recognition algorithm, characterized in that, Includes the following steps: Step S1: Road surface image data acquisition and preprocessing; Step S2: Constructing a directional hybrid attention network PFK-Unet, which includes the directional hybrid attention mechanism EFCA and the windmill convolution PConv; Step S3: Constructing a lightweight hybrid attention network GS-Unet, which includes the spatial gated convolution GSConv and the directional hybrid attention mechanism EFCA; Step S4: Selecting a network based on the engineering background, PFK-Unet is selected for high-precision and refined detection scenarios, while GS-Unet is selected for lightweight and rapid deployment scenarios with limited computing power; Step S5: Road surface damage assessment based on semantic segmentation connected component feature extraction, including clustering eight-connected component instances on the segmentation mask, converting the actual damaged area of pothole damage to pixel area, and obtaining the damaged area of strip repair damage through skeleton extraction and length conversion.
2. The hybrid attention road feature recognition algorithm according to claim 1, characterized in that, In step S1: the rural cement concrete road surface image is acquired by a multi-functional road inspection vehicle. Industrial cameras are installed on both sides of the inspection vehicle to synchronously acquire road surface information to ensure that the acquired image can completely cover the driving lane area. For the original acquired image, the road surface image and its corresponding labeled image are subjected to unified preprocessing operations during the data construction stage, including image size normalization, dynamic range adjustment and grayscale processing.
3. The hybrid attention road feature recognition algorithm according to claim 1, characterized in that, In step S2, EFCA comprises three collaborative sub-modules: fine-grained channel attention, spatial attention, and orientation-sensitive weighting. In the fine-grained channel attention stage, global average pooling (GAP) is first used to process the three-dimensional tensor... The channel global statistics vector is compressed into a one-dimensional vector U. To simultaneously capture both local dependencies between adjacent channels and global dependencies across channels, one-dimensional convolutions with adaptive kernel sizes are used to generate local channel responses U. lc And use 1×1 convolution to generate global channel response U gc Subsequently, a cross-correlation matrix M is constructed to characterize the interaction between local and global features: ; The local and global prior weights U are obtained by summing the rows and columns of M. lc w with U gc w Furthermore, a learnable scalar θ is introduced for dynamic balancing and fusion, and the final channel attention vector W is obtained by normalization using the Sigmoid function σ. C : In the spatial attention stage, a 3x3 convolution is applied to the input feature F and activated to generate a spatial weight map W S , which is used to highlight the spatial location of the disease and suppress the disease-free area. ; In the core direction-sensitive enhancement stage, the feature map F is divided into four specific feature subspaces F=[F1,F2,F3,F4] along the channel dimension, and an adaptive learning direction weight vector is introduced. The enhanced directional residual feature F is obtained after weighting. β : ; Finally, the high-precision feature tensor F* output by the EFCA module is obtained by summing and recalibrating channel gating, spatial gating, and directional features: 。 4. The hybrid attention road feature recognition algorithm according to claim 1, characterized in that, In step S2: the windmill convolution PConv includes assuming the feature map tensor input to the nth layer is X, with dimensions (h1, w1, c1), then the input intermediate layer feature tensor is... Before performing feature extraction, the PConv module first instantiates four fully parallel convolutional branches. Each branch shares the same kernel size k×k (k=3), but is assigned a different asymmetric padding parameter vector p1=(p l ,p t ,p r ,p b (These represent the number of pixel layers where zeros are padded at the left, top, right, and bottom boundaries of the feature map, respectively): Horizontal left-leaning branch: Fill parameters Heavy padding on the left forces the effective convolution region to shift to the left of the input features in physical space. Vertical upper branch: Fill parameter The heavy padding at the top guides the convolutional kernel to focus on the top. Horizontal right-leaning branch: Fill parameters Modeling is shifted to the right. Vertical downward branch: Fill parameter Downward offset modeling. These four parallel branches apply standard 2D convolution operations to the feature maps after spatial translation, followed by batch normalization to stabilize the internal covariance shift, and then introduce a smooth nonlinear mapping using the SigmoidLinearUnit activation function. The convolution kernel size is k, the stride is s, and W represents the kernel parameters. This stage outputs four intermediate feature tensors containing local responses in different directions, denoted as: ; ; ; ; Subsequently, the module enters the feature fusion stage, concatenating the four feature maps representing different directional views along the channel dimension to obtain the intermediate feature representation Z: ; To fuse convolutional responses from different directions and restore the preset number of output channels, PConv applies a 2×2 convolution operation after concatenation, with no padding and a stride of 1, and its weight is denoted as w'. This convolution is used to fuse feature responses from branches in different directions and adjust the spatial dimensions of the output feature map to the preset height and width of the network. Its output can be represented as: ; Finally, multi-directional features are integrated through fusion convolution, and the output feature map is consistent with the output of the corresponding standard convolutional layer in terms of spatial size. This allows the PConv module to directly replace traditional convolutional layers and be embedded in the existing network structure without changing the overall scale transformation relationship of the network. Explanation of formula symbols: In the EFCA attention mechanism: M: Represents the cross-correlation matrix tensor between local and global channel responses, used to capture hidden joint relationships between complex channels in a higher dimension; W S : the spatial saliency scalar matrix mapped back to the original feature size, the closer the element value is to 1, the higher the confidence of the pixel point corresponding to the disease core damage area; β: The vector set is a scalar obtained by the network through adaptive learning during backpropagation, precisely corresponding to the importance confidence of the feature subspaces in the four segmentation directions. F*: The semantic feature tensor output to the decoder after undergoing fine-grained channel attention, spatial feature enhancement, and orientation enhancement. In windmill convolution: P(X; p i ): Perform a zero padding geometric operation on the base features map X according to the pre-set four asymmetric parameter vectors W: Weight parameters of the parallel directional convolution operator; W': The weight matrix of the 2×2 convolutional kernel that is ultimately responsible for dimensionality reduction and fusion; k: kernel size (default is 3); s: stride length; Z: A high-dimensional redundant tensor that splices together asymmetric features in four directions.
5. The hybrid attention road feature recognition algorithm according to claim 1, characterized in that, The spatial gated convolution GSConv in step S3 includes: the input features are used to extract deep semantics through a 3×3 convolution backbone branch, and a gated feature is generated through a 3×3 bottleneck convolution branch. The output channel is compressed into one channel, and after activation by Sigmoid, a spatial attention mask is obtained. This mask is then multiplied element-wise with the backbone features through a broadcast mechanism, and after recalibration by a 1×1 convolution, it is added to the residual connection.
6. The hybrid attention road feature recognition algorithm according to claim 1, characterized in that, In step S4, the PFK-Unet has 10.775M parameters and a single-frame inference time of 0.054s; the GS-Unet has 6.775M parameters and a single-frame inference time of 0.017s.
7. The hybrid attention road feature recognition algorithm according to claim 1, characterized in that, In step S5, the identification results of strip-shaped repair defects are processed by connected component extraction to obtain the coordinates (x, y) of the top-left corner of the i-th connected component. i min ,y i min The coordinates of the lower right corner of the connected domain (x) i max ,y i max ), Area of connected domain S i Subsequently, by statistically analyzing the lengths of the skeleton structures within the connected domain, the damaged area corresponding to the strip-shaped repair defects was calculated. ; The height H of the i-th (i≥1) connected component in the image is obtained using the above formula. i and width W i First, the skeleton of the strip-shaped repair disease features within the connected domain is extracted and the pixel points P are counted. i Therefore, the damaged area was calculated as follows: (Unit: m²), where G r This represents the size (in meters) of a single pixel mapped to the actual road surface. For pothole defects, after pothole defect segmentation, the pixel area of the i-th pothole connected region is S. i The physical size of a single pixel mapped to the actual road surface is G. r The actual damaged area of the pit can then be directly calculated using pixel statistics. Finally, the damaged area of the road surface in the current image is obtained by summing the results. Explanation of Formula Symbols (x,y): Any pixel with a defect; S i : Total area of pixels in the ith hole connected domain; G r: The actual real road surface physical side length corresponding to a single pixel in the image is (unit: m / pixel); D i: the actual physical damage area of the cavity disease instance; (x i min ,y i min ): coordinates of the top-left corner point of i connected domains; (x i max ,y i max ): coordinates of the bottom-right corner points of i connected domains; H i : height of connected component; W i : Width of connected component.