Micro crack detection and segmentation method based on sampling and geometric constraint

By using a sampling and geometric constraint-based approach, the accuracy and clarity of microcrack detection are improved. This solves the problem of existing models adapting to irregular geometric structures and background noise interference, and realizes the quantitative conversion from pixel-level segmentation to actual size, thus meeting the needs of engineering inspection.

CN122391244APending Publication Date: 2026-07-14HEBEI UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEBEI UNIV OF TECH
Filing Date
2026-06-16
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing deep learning models struggle to adapt to irregular geometric structures in the detection of minute cracks and are easily affected by background noise. They also lack constraints on slender geometric features and the ability to quantize physical dimensions, leading to a disconnect between detection accuracy and application results.

Method used

A sampling and geometric constraint-based approach is adopted, which generates a two-dimensional dynamic sampling offset tensor through a 3×3 spatial convolutional layer, extracts abrupt edge features by combining the Laplacian kernel matrix, and introduces regression loss calculation with angle penalty term and distance constraint term. Finally, a morphological thinning algorithm is used for crack segmentation and quantization.

Benefits of technology

It improves the extraction accuracy and edge clarity of micro-cracks, enables accurate positioning of the boundaries of slender cracks, and transforms pixel-level segmentation results into actual spatial geometric dimensions to meet the safety assessment requirements of engineering structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391244A_ABST
    Figure CN122391244A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer vision and image processing, and discloses a micro crack detection and segmentation method based on sampling and geometric constraint, which comprises the following steps: acquiring a structure surface image and converting it into tensor data, extracting spatial gradient amplitude and local variance to generate a dynamic sampling offset, performing irregular network sampling to make the sampling points fit the crack trend to extract the main features; using a Laplacian kernel to extract the abrupt edge features, performing weighted residual error fusion with the main features through a dynamic gating multiplier factor to enhance the boundary perception and suppress the background noise; introducing a multi-task loss function containing angle penalty and distance constraint to update the network parameters in the training stage; outputting a prediction mask in the inference stage, extracting the connected domain center skeleton to calculate the average pixel width, and converting it into actual physical size. The present application improves the segmentation accuracy of complex morphological micro cracks, and converts the pixel-level detection results into spatial geometric data which can be directly applied to engineering safety evaluation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and image processing technology, specifically to a method for detecting and segmenting minute cracks based on sampling and geometric constraints. Background Technology

[0002] As infrastructure ages, regular inspection of surface cracks is crucial for engineering safety assessment. In recent years, deep learning-based image processing techniques have been increasingly applied to crack detection and segmentation tasks. Existing deep neural networks typically use conventional convolutional kernels with fixed receptive fields for image feature extraction. However, the topological morphology of microcracks is often highly irregular and complex, and the fixed sampling grid of conventional convolutions is difficult to effectively adapt to such irregular geometric structures, causing the network to miss the fine edge details of cracks when extracting features.

[0003] In real-world engineering environments, the surface images of structures to be detected often contain complex background textures. Existing methods, when attempting to enhance crack edge information in feature maps, often lack a dynamic filtering mechanism, which introduces background texture noise into the deeper layers of the network, thereby interfering with the model's judgment and leading to blurred edges or false detections in the final segmentation results.

[0004] Furthermore, during the training of network models, existing object detection algorithms mostly use conventional intersection-union ratios or coordinate errors to calculate regression losses, lacking multidimensional constraints for the slender geometric characteristics of tiny cracks. This directly limits the model's accuracy in locating the bounding boxes of cracks with large aspect ratios. At the same time, most current crack segmentation algorithms only output pixel-level binary mask images, lacking the step of morphological quantization processing of the segmentation results, and cannot directly convert discrete pixel connected regions into actual physical dimensions such as average width. This single visual-level output is difficult to directly meet the dimensional data requirements of engineering structural damage assessment, resulting in a certain disconnect between algorithm applications and actual engineering scenarios. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method for detecting and segmenting microcracks based on sampling and geometric constraints. This method solves the problems that existing conventional convolution methods are unable to adapt to the irregular orientation of microcracks and are subject to background noise interference. At the same time, existing detection models lack constraint mechanisms for slender geometric features and the ability to directly quantize physical dimensions.

[0006] To achieve the above objectives, the present invention provides the following technical solution: This invention provides a method for detecting and segmenting minute cracks based on sampling and geometric constraints. It is implemented using a minute crack detection and segmentation system comprising an image preprocessing module, a feature extraction module, a feature aggregation module, a loss calculation module, a detection output module, an online inference module, a parameter quantization evaluation module, and a model training module. The method includes: The image preprocessing module acquires the original image of the structure surface to be detected, performs preprocessing operations, and converts it into tensor data. The feature extraction module uses a 3×3 spatial convolutional layer with preset padding and stride to directly perform linear mapping on the tensor data, generating a two-dimensional dynamic sampling offset tensor. This two-dimensional dynamic sampling offset tensor is applied to a standard sampling grid to perform irregular network sampling and output a crack trunk feature map. The feature aggregation module extracts abrupt change edge feature data tensors from the crack trunk feature map. These abrupt change edge feature data tensors are weighted using a dynamic gating multiplier factor and then initially fused with the tensor data to generate preliminary fused features. These preliminary fused features are then input into a refined network layer containing a 3×3 convolutional layer, a batch normalization layer, and a SiLU activation function for deep feature smoothing to generate smoothed features. Finally, a skip connection structure is used. The smoothed features are added to the tensor data after 1×1 convolution to generate the final geometrically enhanced feature map. During model training, manually labeled data containing the ground truth bounding boxes and the ground truth mask matrix are obtained. The detection output module outputs the predicted bounding boxes and the predicted mask matrix based on the geometrically enhanced feature map. The loss calculation module constructs the total regression loss value based on the angle penalty and distance constraint terms of the predicted bounding boxes and the ground truth bounding boxes. The overall multi-task loss value is generated by combining the segmentation loss and the classification loss. The network parameters are updated by the model training module using the overall multi-task loss value. During model inference, the final predicted bounding boxes and binarized pixel-level masks are output through the online inference module. The parameter quantization evaluation module extracts the central skeleton connected lines of the binarized pixel-level masks, calculates the average pixel width of the cracks, and converts them into actual spatial geometric dimensions.

[0007] Preferably, the feature extraction module directly performs linear mapping on the tensor data using a 3×3 spatial convolutional layer with preset padding and stride to generate a two-dimensional dynamic sampling offset tensor. This includes: configuring the number of output channels of the 3×3 spatial convolutional layer to be twice the square of the standard sampling kernel size; inputting the tensor data into the 3×3 spatial convolutional layer for convolution operations to extract geometric deformation features within the local spatial receptive field; and performing linear projection on the convolution output of the 3×3 spatial convolutional layer to directly generate a two-dimensional dynamic sampling offset tensor containing horizontal and vertical components. This step, by configuring a specific number of convolutional channels and a linear projection mechanism, can directly utilize local receptive field features to adaptively generate offset components, improving the model's efficiency in capturing the spatial geometric deformation features of cracks.

[0008] Preferably, the process of applying the two-dimensional dynamic sampling offset tensor to the standard sampling grid to perform irregular network sampling and output the crack trunk feature map includes: extracting the sub-pixel offset vector from the two-dimensional dynamic sampling offset tensor; performing an addition operation between the basic relative coordinate vector of the standard grid and the sub-pixel offset vector to generate a set of deformation sampling coordinates; using a bilinear interpolation algorithm combined with a boundary truncation constraint mechanism to calculate the feature value at the floating-point coordinate space position; and performing element-wise multiplication and accumulation operations between the feature value and the convolution kernel weight parameters to output the irregular network sampling result. This step uses the offset vector to adjust the conventional regular sampling grid so that the distribution of sampling points can directly conform to the actual direction of the crack, thereby improving the network's accuracy in extracting small deformation features.

[0009] Furthermore, the process of outputting the crack trunk feature map also includes: performing a global average pooling operation along the spatial dimension on the irregular network sampling results to generate channel descriptors; inputting the channel descriptors into a multilayer perceptron network, sequentially performing channel dimensionality reduction projection based on constant scaling and channel dimensionality increase operations, and using a nonlinear activation function to map and generate channel attention weight vectors; performing element-wise multiplication operations on the channel attention weight vectors and the irregular network sampling results to output the crack trunk feature map; this step performs cross-channel filtering of sampled features by calculating the weight distribution of each channel to reduce the interference of invalid features in the background region.

[0010] Preferably, the feature aggregation module extracts abrupt change edge feature data tensors from the crack trunk feature map, including: performing spatial convolution filtering operations on the crack trunk feature map along the spatial height and width dimensions using a preset second-order differential Laplacian kernel matrix to extract abrupt change edge feature data tensors containing edge gradient change information; this step uses second-order differential operators to extract abrupt change edges of small cracks, enhancing the network model's ability to perceive the target physical boundary.

[0011] Furthermore, a dynamic gating multiplier factor is used to weight the mutation edge feature data tensor, and it is then fused with the tensor data through preliminary addition to generate preliminary fused features. This includes: extracting learnable gating scalar parameters from the computation graph; using the hyperbolic tangent function to calculate the nonlinear mapping value of the learnable gating scalar parameters to generate a dynamic gating multiplier factor; using the dynamic gating multiplier factor as a scalar weight, performing element-wise multiplication with the mutation edge feature data tensor to output a weighted edge feature tensor; and performing a spatially aligned element-wise addition fusion operation with the weighted edge feature tensor and the tensor data to generate preliminary fused features. This step constructs a dynamic weight adjustment mechanism that can automatically adjust the gating parameters during model training, control the proportion of edge information incorporated into the features, and prevent background noise from being excessively introduced into the deeper layers of the network.

[0012] Preferably, the total regression loss value is constructed by the loss calculation module based on the angle penalty term and the distance constraint term between the predicted bounding box and the real bounding box. This includes: extracting the width and height values ​​of the predicted bounding box and the real bounding box, calculating the arctangent of the width-to-height ratio, and obtaining the square of the difference between the two to construct the angle penalty term; calculating the square of the Euclidean distance between the center point of the predicted bounding box and the center point of the real bounding box to construct the distance constraint term; and adding the intersection-union ratio (IU) of the predicted target and the real target, the angle penalty term, and the distance constraint term to generate the total regression loss value. This step introduces the dual constraints of the bounding box aspect ratio and the center point distance in the regression loss calculation, which improves the model's accuracy in locating the boundary of slender cracks.

[0013] Furthermore, the overall multi-task loss value is generated by combining the segmentation loss and the classification loss, including: calculating the binary cross-entropy loss between the predicted mask matrix and the true mask matrix to generate the segmentation loss; calculating the error between the classification confidence of the network prediction output and the true class label to generate the classification loss; and weighting and summing the total regression loss value, the segmentation loss and the classification loss according to the first preset constant, the second preset constant and the third preset constant to generate the overall multi-task loss value.

[0014] Preferably, the online inference module outputs the final predicted bounding boxes and binarized pixel-level masks, including: sorting all predicted bounding boxes in descending order based on classification confidence and calculating the intersection-union ratio (IU) between candidate boxes; when the IU is greater than a preset suppression threshold, using a non-maximum suppression algorithm to filter redundant detection results; traversing the matrix elements of the predicted mask matrix that retains the probability distribution format within the effective region, mapping them to specific integer Boolean values ​​using a preset activation threshold, and outputting a discrete topological connected domain representing the distribution of physical cracks as a binarized pixel-level mask.

[0015] Preferably, the average pixel width of the crack is calculated by extracting the central skeleton connected line of the binarized pixel-level mask through the parameter quantization evaluation module and converting it into the actual spatial geometric size. This includes: applying a morphological thinning algorithm to the discrete topological connected domain to iteratively remove edge pixels, extracting the central skeleton connected line of single pixel width, and accumulating the Euclidean distance between adjacent connected pixels along the central skeleton connected line to generate a pixel-level total length value; dividing the total number of active pixels in the binarized pixel-level mask by the sum of the pixel-level total length value and the minimum smoothing constant to obtain the average pixel width; and multiplying the average pixel width by a preset physical calibration coefficient to convert it into the actual spatial geometric size. This step extracts the central skeleton of the connected domain through the morphological thinning algorithm and maps the calculated pixel width to the actual physical size, so that the image detection results can be directly applied to the safety assessment of engineering structures.

[0016] This invention provides a method for detecting and segmenting micro-cracks based on sampling and geometric constraints. It has the following beneficial effects: 1. This invention generates a two-dimensional dynamic sampling offset tensor by extracting the spatial gradient magnitude and local variance of the image, and performs irregular network sampling accordingly. This method changes the limitation of the fixed sampling grid in traditional convolution, so that the spatial distribution of convolution sampling points can adaptively fit the irregular geometric direction of the micro-crack, thereby improving the network model's accuracy in extracting features of complex crack shapes.

[0017] 2. This invention utilizes the second-order differential Laplacian kernel matrix to extract abrupt edge feature data, and then uses a learnable dynamic gating multiplier factor to weighted fuse it with the crack trunk feature map. This mechanism enhances the network's ability to perceive the physical boundaries of tiny cracks, while automatically controlling the fusion ratio of edge information according to the training process, preventing excessive introduction of texture noise from the background area into the feature map, and improving the edge clarity of the final segmentation result.

[0018] 3. In the regression loss calculation during the model training phase, this invention introduces an angle penalty term and a center point distance constraint term that reflect the aspect ratio of the predicted target. In the inference phase, a morphological thinning algorithm is used to extract the central skeleton of the predicted mask to calculate the average pixel width. This design not only improves the localization accuracy of the bounding box of slender cracks, but also realizes the quantitative conversion from pixel-level segmentation mask to actual spatial geometric dimensions, so that the detection results can directly meet the data requirements of engineering structure safety assessment. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the module architecture of the microcrack detection and segmentation system of the present invention; Figure 2 This is a schematic diagram of the overall process of the microcrack detection and segmentation method of the present invention; Figure 3 This is a schematic diagram of the image preprocessing operation flow of the present invention; Figure 4 This is a schematic diagram of the two-dimensional dynamic sampling offset tensor generation process of the present invention; Figure 5 This is a schematic diagram of the irregular network sampling operation process of the present invention; Figure 6 This is a schematic diagram of the process for generating the crack trunk feature map of the present invention; Figure 7 This is a schematic diagram of the mutation edge feature extraction and dynamic gating multiplier factor generation process of the present invention; Figure 8 This is a schematic diagram of the geometric enhancement feature map residual fusion generation process of the present invention; Figure 9 This is a schematic diagram of the overall multi-task loss calculation and network parameter update process of the present invention; Figure 10 This is a schematic diagram of the online inference output of predicted bounding boxes and binarized pixel-level masks of the present invention; Figure 11 This is a schematic diagram illustrating the process of calculating the average pixel width and converting the actual spatial geometric dimensions according to the present invention. Figure 12 This is a schematic diagram of the numerical iterative convergence curve of the multi-task loss during model training in this invention. Figure 13 This is a bar chart comparing the detection and segmentation accuracy of the method of the present invention with that of existing algorithms; Figure 14 This is a scatter plot showing the comparison between the predicted physical width of the crack and the actual physical width in this invention. Detailed Implementation

[0020] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] See attached document Figure 1 , Figure 1 This is a system architecture diagram according to an embodiment of the present invention. The present invention provides a micro-crack detection and segmentation system, including an image preprocessing module, a feature extraction module, a feature aggregation module, a loss calculation module, a detection output module, an online inference module, a parameter quantization evaluation module, and a model training module.

[0022] The image preprocessing module receives the original image of the structural surface from the outside and includes a data format conversion unit. It performs size transformation and numerical normalization operations to convert the image into tensor data that can be processed by deep learning networks.

[0023] The feature extraction module includes the backbone feature extraction layer and the adaptive sparse convolution component in the network structure. Its function is to perform spatial dimension sampling operations on the tensor data of the input image, calculate the local rate of change and dynamically adjust the sampling coordinates, extract the target features and output the feature map.

[0024] The feature aggregation module consists of a backbone feature path and a geometric enhancement path. It integrates an edge filtering kernel and a dynamic gating function unit. Its function is to extract high-frequency abrupt change features and adaptively fuse them into the backbone feature map to enhance the topological physical connectivity of the features.

[0025] The loss calculation module includes a bounding box scale extraction logic unit, a classification error calculation logic unit, and a location distance calculation logic unit. Its function is to calculate various errors between the predicted values ​​and the true labels for targets of various size ratios, as well as the classification confidence error, during the model training process, and generate a comprehensive loss value to update the network node parameters.

[0026] The detection output module is deployed at the output end of the network. It includes a multi-scale classification regression head and a mask decoding head. Its function is to receive the high-dimensional feature map after fusion by the preceding modules and output the bounding box coordinates of the target and the pixel-level segmentation mask result.

[0027] The online inference module is used to acquire the image to be tested during the model deployment phase, call the network model with pre-fixed weights to output the prediction results, and use the non-maximum suppression algorithm to filter redundant detection results to output discrete topological connected domains.

[0028] The parameter quantization and evaluation module is used to perform geometric feature parsing on the output discrete topological connected domains, extract the central skeleton connected lines to calculate the average pixel width of the crack target, and map it to the actual spatial geometric dimensions to generate damage status evaluation data; the model training module is used to receive the image dataset during the model training phase and divide it into training and validation sets, control the model to perform forward computation, and use the overall multi-task loss value generated by the loss calculation module to start the backpropagation algorithm to update the network parameters.

[0029] See attached document Figure 2 , Figure 2 This is a flowchart of a method according to an embodiment of the present invention. The present invention provides a method for detecting and segmenting minute cracks, comprising the following steps: The original image of the surface of the structure to be detected is obtained, and the size scaling, edge pixel filling and data normalization operations are performed to convert the processed image into tensor data format. A 3×3 spatial convolutional layer is used to capture local spatial geometric deformation features, and a two-dimensional dynamic sampling offset is output through linear projection. The two-dimensional dynamic sampling offset is applied to the standard sampling grid to change the spatial coordinates of each sampling point. The feature value at the offset position is obtained by bilinear interpolation to complete the sampling of irregular network. The channel descriptors are calculated by global average pooling and corresponding channel attention weights are generated. The channel attention weights are then multiplied element-wise with the sampling results of the irregular network to output the crack trunk feature map. In the branching pathway, the Laplacian kernel matrix is ​​used to perform spatial filtering on the feature map of the crack trunk to extract the abrupt change edge feature data, and the hyperbolic tangent mapping value of the learnable parameter is calculated; The hyperbolic tangent mapping value is used as a multiplier factor on the abrupt change edge feature data and is initially fused with the tensor data. The initially fused features are then input into a refined network layer containing 3×3 convolutional layers, batch normalization layers, and SiLU activation functions for deep feature smoothing. Finally, a skip connection structure is used to perform residual addition operations on the smoothed features and the tensor data that has undergone 1×1 convolutional mapping to generate the final geometrically enhanced feature map. Extract the width and height values ​​of the predicted bounding box and the true bounding box, calculate the arctangent of the width-to-height ratio, and square the difference between the two to construct an angle penalty term; The Euclidean distance between the center point of the predicted bounding box and the center point of the ground truth bounding box is calculated to construct a distance constraint term. The intersection-union ratio, angle penalty term and distance constraint term are combined to generate the total regression loss value. The binary cross-entropy loss between the predicted mask and the ground truth mask is calculated to generate the segmentation loss. The error between the predicted classification confidence and the ground truth class label is calculated to generate the classification loss. The total regression loss value, segmentation loss and classification loss are combined to generate the overall multi-task loss value to update the network parameters. After the model training is completed and the network parameters are fixed, the data to be inferred is input into the network. The initial prediction results are output through end-to-end forward operation. The non-maximum suppression algorithm is used to filter redundant target region bounding box coordinate data and corresponding binarized pixel-level masks based on classification confidence. Then, the central skeleton connected lines of the binarized pixel-level masks are extracted and the total pixel length is calculated. The average pixel width is calculated by combining the total number of activated pixels in the connected components and converted into actual spatial geometric dimensions to perform structural damage state assessment.

[0030] See attached document Figure 3 , Figure 3 This is a detailed diagram of an image preprocessing process according to an embodiment of the present invention. The image preprocessing module is used to acquire the original image of the surface of the structure to be detected and perform data dimension transformation operation to generate a low-level input source that can be received by the network.

[0031] In this embodiment, the image preprocessing module acquires raw image data of the structural surface containing the microcrack target through an external vision acquisition system. The raw image data contains multi-channel color pixel information and is stored in a physical memory buffer in the form of a discrete two-dimensional array. As a preferred approach, the image preprocessing module performs spatial scaling on the original image data. When calculating the aspect ratio scaling factor of the original image, the scaling factor is kept constant. In the blank areas at the edges of the scaled image, pixels are filled using a fixed grayscale constant value (the specific value is configured as a discrete integer value of 0 or 128). This ensures that the width and height dimensions of the output image conform to the preset fixed input resolution dimension limit (e.g., configured as a fixed pixel dimension of 512×512 or 1024×1024). In this process, a bilinear interpolation algorithm is used to calculate the value of each pixel at the target size.

[0032] In the aforementioned interpolation operation, the spatial distance weights of the four neighboring pixels in the original image coordinate system are calculated by back-mapping the target pixel coordinates to the original image coordinate system, and then weighted summation is performed to obtain the interpolation result. For the specific low-level code implementation of the bilinear interpolation algorithm, those skilled in the art can directly call existing open-source computer vision computing libraries to complete the corresponding software construction logic. The image preprocessing module then performs pixel value normalization on the image matrix after scaling and padding operations, mapping the color intensity values ​​in the discrete integer range to continuous tensor element floating-point data that are usually in the range of negative one to positive one floating-point numbers. In this context, the specific normalized mathematical mapping relationship is expressed using the following formula: ; In the formula: The feature tensor after normalization; To create the original image matrix tensor after scaling and pixel padding; The numerical mean of the input original image matrix tensor along its spatial dimensions; The standard deviation of the original image matrix tensor along the spatial dimension is used as input. The image preprocessing module then transposes the arrangement order of the image spatial dimension and channel dimension according to the memory reading rules of the underlying tensor calculation framework to generate multidimensional tensor data and loads it into a contiguous memory address space.

[0033] See attached document Figure 4 , Figure 4 This is a schematic diagram illustrating the spatial feature extraction and offset generation principle according to an embodiment of the present invention. The feature extraction module receives low-level tensor data or shallow feature mapping to generate an input feature tensor. This tensor has a specific channel dimension. and spatial height With width property.

[0034] In this embodiment, the feature extraction module utilizes a deep learning convolutional mapping mechanism to achieve adaptive generation of sampling offsets.

[0035] The specific implementation method is as follows: First, the feature extraction module is configured with a spatial convolutional layer with a kernel size of 3×3 and a stride consistent with the tensor data. This convolutional layer automatically learns and captures the spatial deformation features of crack edges in the image through backpropagation; secondly, the spatial convolutional layer... The number of output channels is precisely configured to be twice the total number of discrete nodes within the reference sampling grid; In this embodiment, a 3×3 standard sampling kernel is used, therefore the number of output channels is set to 18 to correspond to the floating-point offset values ​​of each node in the grid in the horizontal and vertical coordinate axes; the overall mathematical mapping relationship of this offset generation process is expressed by the formula: P X); In the formula: P is the calculated two-dimensional dynamic sampling offset tensor; The nonlinear transformation function is used to perform multidimensional spatial mapping calculations; X is the input tensor data; finally, the generated two-dimensional dynamic sampling offset tensor is dimensionally aligned with the tensor data in the spatial height and width dimensions.

[0036] See attached document Figure 5 , Figure 5 This is a schematic diagram of the dynamic deformation sampling principle according to an embodiment of the present invention. After obtaining the two-dimensional dynamic sampling offset tensor, the feature extraction module directly applies it to the standard convolutional sampling grid to change the spatial physical location distribution of the original receptive field.

[0037] In this embodiment, the standard grid sampling coordinate set for extracting features from a specific center point is defined as follows: When the network uses a regular 3x3 convolutional kernel, this set is specifically defined as a vector cluster containing nine relative coordinates from the top left to the bottom right. The feature extraction module extracts the set of sub-pixel offset vectors corresponding to the current center point from the offset tensor and performs an addition operation between the basic relative coordinate vector of the standard grid and the sub-pixel offset vector to generate a set of deformable sampling coordinates. This coordinate transformation mechanism makes the actual sampling points of the convolution operation deviate from the regular rectangular array distribution.

[0038] Since the deformation sampling coordinate set generated after superimposing the sub-pixel offset vector contains continuous floating-point coordinate data, the feature extraction module uses a bilinear interpolation algorithm to calculate and obtain the precise feature pixel value at the spatial location of the floating-point coordinate. As a preferred method, the network uses the above floating-point coordinates to back-map to four adjacent discrete integer coordinate points of the original input feature tensor and performs weighted summation by calculating the spatial distance weight between the floating-point coordinates and each adjacent integer coordinate to obtain the interpolated feature data. When performing coordinate mapping operations, the feature extraction module introduces a boundary truncation constraint mechanism to force all floating-point coordinates that cross the physical boundary of the input feature tensor to be restricted to a legal spatial index range in order to avoid memory access out-of-bounds failures. For the distance weight allocation logic of the bilinear interpolation algorithm, in this embodiment, the technician can use existing common sense about graphics interpolation to configure it, and the process is a well-known technology in the field.

[0039] After obtaining the valid interpolated feature data at each deformation sampling coordinate, the feature extraction module performs element-wise multiplication and accumulation operations with the corresponding convolution kernel weight parameters in the adaptive sparse convolutional layer. The comprehensive mathematical mapping logic of the above dynamic deformation sampling and feature value calculation process adopts the following formula: ; In the formula: This is the feature vector output at the center coordinate position after sampling from the irregular network; The base coordinate vector of the center pixel on the feature map; It is the set of discrete offsets of neighboring pixels in a regular grid sampling region; This is the offset vector of the local grid neighborhood position traversed within the aforementioned set; These are the numerical weight coefficients of the sampling convolution kernel at the corresponding local neighborhood location; The input low-level feature tensor for participating in irregular sampling calculations; This refers to the corresponding dynamic deformation coordinate offset extracted from the sampling offset field tensor.

[0040] The feature extraction module performs the aforementioned deformation sampling and weighted summation operations by traversing all the spatial center coordinates of the input feature tensor, and outputs a complete irregular network sampling result. The data dimension of this result is consistent with that of the input feature tensor, and it initially integrates the local high-dimensional deformation feature information of the crack target at the spatial level. The aforementioned irregular network sampling result is then written into the video memory stack of the computing device and directly passed to the next level channel reweighted network structure through the internal hierarchical data link as the underlying computational data source for performing channel feature filtering operations and filtering irrelevant background noise information.

[0041] See attached document Figure 6 , Figure 6 This is a schematic diagram of the channel feature reweighting principle according to an embodiment of the present invention. After obtaining the sampling results of the irregular network, the feature extraction module further performs cross-channel dimension data filtering operations.

[0042] In this embodiment, the sampling result of the irregular network is assumed to have spatial height and width dimensions as follows: and And the number of channels is 3D feature tensor The feature extraction module performs a global average pooling operation on the 3D feature tensor along the spatial dimension. This pooling operation traverses the feature mapping plane and calculates the arithmetic mean of the feature values ​​at all discrete pixel positions within the corresponding channel. The resulting global statistical results constitute a dimension of... Multiply-1 channel descriptor Specific channels The descriptor numerical calculation logic uses the following formula: ; In the formula: For the first The global feature descriptor values ​​extracted from each channel domain; The spatial height dimension is the physical size of the irregular sampling feature tensor; The spatial width dimension of the irregular sampling feature tensor is its physical size. This represents the discrete spatial pixel coordinate index value corresponding to the height direction; This represents the discrete spatial pixel coordinate index value corresponding to the width direction; This represents the element values ​​of the irregular sampling feature tensor at specific channels and spatial coordinate points; This is the discrete index number for the channel dimension of the corresponding calculation level.

[0043] As a preferred approach, the feature extraction module internally constructs a multilayer perceptron network containing two fully connected layers to receive the aforementioned channel descriptors. This multilayer perceptron network performs channel-wise dimension reduction projection on the input data through the first fully connected layer, and the dimension reduction coefficient is determined by a preset constant. Control, and the constant's value is configured to be an integer range of 4 to 32 (typically 16), makes the output dimension become After mapping, the feature data is processed by the ReLU nonlinear activation function. The feature data after the initial mapping enters the second fully connected layer for dimensionality upscaling to restore the initial number of channels. The sigmoid activation function is used to map tensor elements to the output channel attention weight vector within a continuous interval of zero to one. The overall attention weight is calculated using the following formula: ; In the formula: This is the non-linear channel attention weight vector output by the mapping; The Sigmoid probability activation function maps real numbers to the interval between zero and one; To recover the weight matrix of the second-layer linear fully connected layer responsible for feature dimensions in the network; The ReLU nonlinear activation function is used for feature truncation. This is the weight matrix of the first-layer linear fully connected layer responsible for channel dimension compression in the network; The global channel feature descriptor vector generated for the preceding pooling operation.

[0044] The initialization and update mechanism of the weight parameters of the fully connected layers in a multilayer perceptron network can be configured using existing deep learning backpropagation algorithms, and its gradient descent logic is a well-known technique in the field, which will not be elaborated here. The feature extraction module obtains the attention weight vector containing the importance values ​​of the responses of each channel. Then, it is multiplied element-wise with the sampling results of the irregular network. The specific calculation process uses the following formula: ; In the formula: The crack trunk feature map tensor output after performing feature reweighting; The nonlinear channel attention weight vector obtained from the aforementioned calculations; For element-wise broadcast multiplication operators performed along the network tensor channel dimension; The original irregular network of the input module is sampled into a three-dimensional feature tensor. This operation enables the channel data with high attention weights to be amplified by scalar multiplication at the numerical level. The feature extraction module finally passes the main feature map of the crack to the main feature path in the feature aggregation module as the underlying data source for performing multi-scale topological feature fusion and geometric operations.

[0045] See attached document Figure 7 , Figure 7 This is a schematic diagram of edge feature extraction and gating parameter mapping according to an embodiment of the present invention. The feature aggregation module receives the crack trunk feature map output by the feature extraction module and inputs it into the trunk feature path and the geometric enhancement path respectively.

[0046] In this embodiment, the feature aggregation module calls a fixed Laplacian kernel matrix within the geometric enhancement path to perform spatial convolution filtering on the feature map of the crack backbone to extract abrupt edge feature data reflecting the physical morphology of the target. The Laplacian kernel matrix is ​​essentially an isotropic second-order differential operator matrix and is configured as a three-by-three two-dimensional constant tensor. During the operation, the operation is performed independently on the feature map channel by channel along the channel dimension to keep the number of feature channels constant. As a preferred method, the two-dimensional constant tensor is configured as a mild edge operator matrix, with the weight value of its central element set to 6, the weight values ​​of its four orthogonal adjacent elements (top, bottom, left, and right) all set to -1, and the weight values ​​of its four diagonal adjacent elements all set to -0.5. This weight layout enables the filtering operation to calculate the sum of the second-order partial derivatives between the feature map at the spatial center point and its neighboring pixel groups, thereby capturing high-frequency edge gradient change information.

[0047] The feature aggregation module performs sliding calculations on the Laplacian kernel matrix along the spatial height and width dimensions of the feature map. During this process, the kernel matrix and pixel data within the receptive field of the feature map are fixed, and element-wise multiplication and summation operations are performed to generate a tensor of abrupt change edge feature data containing high-frequency topological information. The specific mathematical operations of spatial filtering are performed using the following formula: ; In the formula: This is the tensor of abrupt change edge feature data output after spatial filtering extraction; The second-order differential Laplace kernel constant matrix for performing edge feature enhancement; The standard spatial convolution operator is performed along the topology of the two-dimensional plane of the data. The tensor is the feature map of the crack backbone propagated forward through the network path; for the specific underlying computation logic of standard spatial convolution, in this embodiment, those skilled in the art can use existing tensor acceleration libraries for configuration, and the process is a well-known technique in the field.

[0048] In the process of extracting mutation edge feature data, the feature aggregation module independently sets a scalar parameter as a learnable gating variable to control the intensity of feature flow. This scalar parameter is assigned an initial constant value during the network instantiation stage and registered as a trainable node in the computation graph to participate in gradient updates during backpropagation. The feature aggregation module extracts the current coefficient value of this scalar parameter and uses the hyperbolic tangent function to calculate its nonlinear mapping value to generate a dynamic gating multiplier factor. Its core mapping calculation logic adopts the formula: ; In the formula: The dynamic gated multiplier scalar generated after hyperbolic tangent mapping calculation; The hyperbolic tangent nonlinear activation transform function; Learnable gated scalar parameters are registered in the static computation graph of the network; this computation mechanism enables the generated multiplier factors to undergo adaptive numerical evolution with iterative feedback of training data and provides stable and bounded weight multipliers for subsequent fusion operations.

[0049] See attached document Figure 8 , Figure 8 This is a schematic diagram of feature residual fusion according to an embodiment of the present invention. After obtaining the dynamic gating multiplier factor and the abrupt change edge feature data tensor, the feature aggregation module performs intensity scaling operation on high-frequency physical information.

[0050] In this embodiment, the feature aggregation module uses the dynamic gating multiplier factor in the range of negative one to positive one as a scalar weight to directly apply to the mutation edge feature data tensor in the geometric enhancement path. The multiplication operation between the scalar and the tensor is performed by multiplying the gating multiplier factor element by element with the edge feature data through the tensor broadcasting mechanism of the underlying computing framework, and outputting the weighted edge feature tensor. The tensor operation mechanism receives the numerical feedback of the backpropagation gradient flow and outputs high-frequency geometric feature data with a specific numerical distribution range.

[0051] The feature aggregation module extracts the crack backbone feature map retained in the backbone feature path and combines it with the weighted and adjusted edge feature tensor in a spatial topological dimension. As a preferred approach, the feature aggregation module adopts a skip connection network topology structure to perform a spatially aligned element-wise addition fusion operation on the output data of the backbone feature path and the geometric enhancement path to generate a geometric enhancement feature map. The specific mathematical mapping relationship for the residual fusion calculation adopts the following formula: ; In the formula: This is the final geometrically enhanced feature map generated; This is a refined network transformation operator consisting of 3×3 convolutional layers, batch normalization layers, and SiLU activation functions, used to achieve deep fusion of heterogeneous features; X is tensor data input from the preprocessing module; This is the scalar of the dynamic gated multiplier factor obtained after mapping calculation; The tensor of abrupt change edge features is extracted using Laplacian spatial filtering; finally, the residual branch is used... X introduces the original spatial information, which has been mapped by a 1x1 convolution, into the output to enhance the robustness of the feature representation.

[0052] During the element-wise addition fusion operation cycle, the crack trunk feature map and the weighted edge feature tensor that participate in the calculation maintain strict consistency in spatial height, width and total number of channels, so that the output geometrically enhanced feature map tensor completely retains the basic network physical resolution. The fused feature data matrix is ​​written into the video memory block and passed to the next-level detection output module. The detection output module includes a bounding box coordinate resolution network and a pixel-level mask generation network composed of multiple stacked two-dimensional conventional convolutional layers. The aforementioned network outputs coordinate vectors representing the physical locations of minute cracks on the structural surface and a binarized mask matrix representing the distribution of the topological connected domains of the cracks by performing linear classification and regression mapping in the channel dimension. As for the scheduling and allocation logic of feature tensors among memory nodes, in this embodiment, those skilled in the art can use existing deep learning framework communication mechanisms for configuration, and the process is a well-known technology in the field.

[0053] See attached document Figure 9 , Figure 9 This is a schematic diagram of the joint optimization principle of network training and loss according to an embodiment of the present invention. In the model training stage, the system receives a dataset of structural surface crack images collected by an external vision device and divides it into independent and mutually exclusive training and validation sets through the configured model training module in the model building stage.

[0054] In this embodiment, the model training module reads image samples and corresponding real human-annotated labels from local storage and normalizes the pixel values ​​of the original image tensor to a floating-point range of zero to one to complete the basic data preprocessing. The real human-annotated labels specifically include a set of real bounding box coordinates that annotate the physical boundary positions of the micro-cracks and a real binary mask matrix corresponding to the pixel-level distribution of the crack morphology. The model training module inputs the aforementioned preprocessed low-level input tensor into a deep learning network model containing feature extraction and aggregation structures according to a preset batch size to perform forward propagation calculations and obtain the predicted coordinate vector and predicted mask matrix finally output by the detection output module.

[0055] After acquiring the forward propagation output data, the model training module uses the loss calculation module to calculate the spatial topology and pixel distribution differences between the predicted results and the true labels. As a preferred method, the loss calculation module calculates the comprehensive regression loss between the predicted coordinate vector and the true coordinate for the bounding box regression task. Specifically, the width and height values ​​of the predicted bounding box and the ground truth bounding box are extracted. The arctangent of the width-to-height ratio is calculated, and the square of the difference is used to construct an angle penalty term. The square of the Euclidean distance between the center point of the predicted bounding box and the center point of the ground truth bounding box is calculated to construct a distance constraint term. The intersection-over-union ratio (IoU), angle penalty term, and distance constraint term are combined to generate the total regression loss value. For the pixel-level segmentation task loss calculation module, the binary cross-entropy loss between the predicted mask and the ground truth mask is calculated. For the target category determination task loss calculation module, the classification confidence loss between the network prediction output and the ground truth category label is calculated. The total loss calculation logic for multi-task joint optimization adopts the following formula: ; In the formula: The overall multi-task loss value obtained from the joint optimization of network multi-tasks; The first preset constant is used to control the feedback intensity of the spatial bounding box regression loss, and its value ranges from 0.1 to 2.0; A second preset constant is used to control the intensity of the pixel mask segmentation loss feedback, and its value ranges from 0.1 to 2.0; A third preset constant is used to control the intensity of the classification loss feedback, and its value ranges from 0.1 to 2.0; The classification confidence loss function configured for the target category determination task; The set of classification confidence scores for the network's predicted output; This is the set of real category labels read in during the data preprocessing stage; A comprehensive regression error calculation function configured for the boundary coordinate regression task; This is the set of physical coordinate vectors of the bounding boxes output by the network prediction analysis. This is the set of coordinates of real manually annotated bounding boxes read in during the data preprocessing stage; A binary cross-entropy loss function configured for pixel-level connected component segmentation tasks; Predict the mask feature matrix in the probability distribution format generated for network prediction; This is the corresponding real binary label mask matrix read in during the data preprocessing stage.

[0056] The model training module uses the overall multi-task loss scalar value output by the loss calculation module to start the backpropagation algorithm to generate the error gradient tensor corresponding to all learnable parameter nodes in the global network computation graph. During this operation, the model training module calls the adaptive moment estimation optimizer with built-in momentum decay mechanism to dynamically update the values ​​of various convolution kernel weights and transformation function variables in the network. The model training module performs multiple rounds of cyclic iterations using training data of a fixed batch size and calculates the total loss value on the validation set after each iteration to monitor the network's generalization status. When the scalar loss value on the validation set fluctuates below a preset constant (the value of which is limited to 10) for several consecutive iterations (this threshold is configured to be between 10 and 20 training cycles), the module detects the network's generalization. -4 Up to 10 -3 Training stops and the parameter model with fixed weights is output when the floating-point range is within the specified range. For the specific algorithm logic of the network optimizer, in this embodiment, the technicians can use the existing knowledge of deep learning parameter optimization to configure its internal differentiation process, which is a well-known technology in this field.

[0057] See attached document Figure 10 , Figure 10 This is a schematic diagram of the online inference and detection result output principle of a model according to an embodiment of the present invention. In the model deployment and inference stage, the online inference module configured by the system acquires the surface image matrix of the structure to be tested transmitted by the front-end acquisition device in an actual industrial environment and performs tensor dimension alignment and numerical normalization processing operations.

[0058] In this embodiment, the online inference module sends the preprocessed tensor of the image to be tested into a network model containing feature extraction and aggregation structures with pre-fixed weights to perform end-to-end forward computation logic. The feature paths inside the network model sequentially perform spatial deformation sampling and multi-scale feature fusion operations on the input tensor. The online inference module then obtains the continuous floating-point format predicted coordinate vector and the probability distribution format predicted mask matrix finally output by the detection output module and uses them as the original computation data source for subsequent result filtering.

[0059] To address the issue of highly overlapping redundant detection results in the online inference module, a non-maximum suppression algorithm is introduced to filter out redundant detection results in the space from the multiple acquired predicted coordinate vectors. As a preferred method, the online inference module sorts all predicted bounding boxes in descending order based on classification confidence and calculates the intersection-union ratio (IUR) between the highest-scoring box and the remaining candidate boxes. When the IUR is greater than a preset suppression threshold, the corresponding candidate box is removed from the valid result queue. The suppression threshold is configured within a floating-point range of 0.4 to 0.6. The IUR calculation logic uses the following formula: ; In the formula: The crossover ratio between bounding boxes is used to determine the redundancy detection results; An algebraic function for calculating the area of ​​a closed figure in two-dimensional plane geometry; The set of current baseline predicted bounding box coordinates used in spatial overlap calculation; The set of coordinates of candidate predicted bounding boxes to be compared and used in spatial overlap calculation; A logical operator for calculating the area of ​​the geometric intersection of two two-dimensional planar regions; The logical operator is used to obtain the area of ​​the geometric union of two two-dimensional planar regions. For the underlying traversal logic of this suppression algorithm, those skilled in the art can use existing common sense about post-detection processing to configure it, and the process is a well-known technology in the field.

[0060] After completing the redundancy removal of the bounding box, the online inference module performs a discrete binarization mapping operation on the prediction mask matrix within the retained valid region, outputting a discrete topological connected component representing the actual physical crack distribution. The online inference module traverses the mask matrix elements in the probability distribution format and maps them to specific binary values ​​using a preset activation threshold. The specific binarization calculation logic adopts the formula: ; In the formula: To output the integer Boolean value of the discrete binary mask matrix at a specific spatial coordinate point; These are the discrete pixel coordinate index values ​​corresponding to the height direction of the mask matrix; These are the discrete pixel coordinate index values ​​corresponding to the width direction of the mask matrix; This represents the floating-point value of the original output probability mask matrix of the network at the corresponding spatial coordinate position; A custom activation threshold constant of 0.5 is set to perform the nonlinear binarization mapping operation. The online inference module encapsulates the determined detection bounding box coordinates and binarization mask results in a format and transmits them to an external hardware terminal for the system to extract the quantitative physical parameters related to structural damage.

[0061] See attached document Figure 11 , Figure 11 This is a schematic diagram of physical parameter quantization and geometric feature extraction according to an embodiment of the present invention. The parameter quantization evaluation module further configured in the system performs geometric feature parsing operation from the pixel domain to the physical dimension after obtaining the binarized mask result of the previous output.

[0062] In this embodiment, the parameter quantization evaluation module applies a morphological thinning algorithm to the input discrete topological connected domain to extract the single-pixel width central skeleton connected line of the target region. This thinning algorithm iteratively strips away edge pixels of the connected domain until the central network topology is preserved and outputs a skeletonized pixel set. The parameter quantization evaluation module accumulates the Euclidean distances between adjacent connected pixels along the central skeleton connected line to generate the pixel-level total length of the crack in the image coordinate system. For the specific structural iteration template of the morphological thinning algorithm, those skilled in the art can configure it using existing computer vision knowledge, and the process is a well-known technique in the field.

[0063] After obtaining the pixel-level total length value, the parameter quantization evaluation module calculates the average pixel width of the crack target by combining it with the total pixel area of ​​the binarized mask. As a preferred method, the parameter quantization evaluation module divides the total number of active pixels in the connected component mask matrix by the sum of the total length of the skeleton connected lines and the minimum smoothing constant to obtain the average pixel width. The aforementioned pixel-level size parameters are then converted into actual spatial geometric dimensions through preset physical calibration coefficients. The calculation logic for the specific physical dimension mapping adopts the following formula: ; In the formula: To calculate the actual physical average width that characterizes the geometric state of the crack target; The spatial physical resolution difference constant is extracted and determined by the hardware calibration program. This represents the total number of active target pixels within the connected component mask matrix. Measure the pixel-level total length of the target center skeleton obtained by morphological thinning algorithm analysis; To prevent the occurrence of a minimum smoothing constant with an abnormally zero denominator in the underlying division operator.

[0064] After obtaining the actual spatial geometric dimensions of the target, the parameter quantification and evaluation module compares and verifies them with the set structural safety threshold (which is set to a physical size range of 0.2 mm to 0.5 mm according to specific engineering specifications) and generates a damage status assessment data source. This module will structure and encode multidimensional data including the crack physical location coordinates, actual length, actual width and corresponding original image fragments and output a standard format assessment report file. The parameter quantification and evaluation module pushes the evaluation report file to the relational database of the structural health monitoring system through the underlying bus interface as basic business data. During the data flow and persistent storage cycle, each characteristic indicator has a unique spatiotemporal timestamp to ensure the closed-loop traceability of the entire industrial inspection process. When the aforementioned actual spatial size value exceeds the structural safety threshold (e.g., the actual crack width is greater than 0.2 mm), the system triggers the corresponding hardware-level alarm interrupt signal. The processing and distribution of basic business data and the software and hardware deployment logic constitute a complete intelligent detection and quantification evaluation scheme for structural surface defects.

[0065] Application Examples: Please see the appendix Figure 12 -Appendix Figure 14 To better understand the technical solution of this invention, the following explanation uses the structural health inspection of concrete bridge piers along high-speed railways as an example: According to engineering specifications, when the width of cracks on the surface of concrete bridge piers exceeds 0.2 mm, it is considered a potential structural safety hazard. Based on this, specific defect detection tasks are carried out.

[0066] The image preprocessing module receives the original image of the concrete pier surface acquired by the vision acquisition device, performs proportional scaling and fills the blank areas at the edges with a fixed grayscale constant value of 128, and converts the processed image into a tensor data format with a resolution dimension limit of 1024 by 1024.

[0067] The feature extraction module calculates the spatial gradient magnitude and local variance of the image tensor data and generates a two-dimensional dynamic sampling offset. The two-dimensional dynamic sampling offset is applied to the standard sampling grid to obtain the sampling results of the irregular network. The feature aggregation module calls the Laplacian kernel matrix to extract the mutation edge feature data, calculates the hyperbolic tangent mapping value as a multiplier factor applied to the mutation edge feature data, and performs residual addition operation on the weighted mutation edge feature data and the backbone path data to generate a geometrically enhanced feature map.

[0068] The online inference module obtains the tensor of the image to be tested and calls the network model with fixed weights to output the predicted coordinate vector in continuous floating-point format and the predicted mask matrix in probability distribution format. The non-maximum suppression algorithm is used to filter redundant detection results based on classification confidence. The predicted mask matrix in the retained region is subjected to discrete binarization mapping operation to output a discrete topological connected region representing the actual physical crack distribution.

[0069] The parameter quantization evaluation module applies a morphological thinning algorithm to the discrete topological connected domain to extract the central skeleton connecting line of single pixel width. It calculates the average pixel width by combining the total number of active pixels inside the binary mask matrix. Using physical calibration coefficients, the average pixel width is converted into an actual spatial geometric dimension of 0.28 mm. If the actual spatial geometric dimension is determined to exceed the preset structural safety threshold of 0.2 mm, the system triggers the corresponding hardware-level alarm interrupt signal and pushes the structured evaluation report file containing spatiotemporal timestamps to the external relational database.

[0070] The experiment used a structural surface defect dataset containing 5,000 manually annotated images of tiny cracks, which was divided into a training set, a validation set, and a test set according to a specific ratio for numerical verification of the system's detection and segmentation functions.

[0071] The experiment selected the Mask R-CNN model, YOLOv8-Seg model, and Deep Crack model as control groups. The calculation results of the system of the present invention and the above control groups were compared and output under a unified physical hardware test environment.

[0072] The experiment uses the mean accuracy as the evaluation index for bounding box detection, the mean intersection-union ratio as the evaluation index for mask segmentation, the frames per second as the evaluation index for inference real-time performance, and the mean absolute error as the evaluation index for physical size quantization accuracy.

[0073] Table 1: Performance Comparison of Multi-Object Detection and Pixel-Level Segmentation According to the test data recorded in Table 1, the corresponding bounding box detection accuracy of the system of the present invention is 94.6%, the corresponding mask segmentation accuracy is 88.2%, the corresponding false negative rate is 2.1%, and the corresponding inference speed is 42 frames per second.

[0074] Table 2: Comparison of Physical Dimension Quantization Errors Based on the test data recorded in Table 2, for test image samples with a real width in the physical range of 0.1 mm to 0.5 mm, the comprehensive average absolute error obtained by the test calculation of the present invention system is fixed at 0.015 mm.

[0075] Figure 12 This is a graph showing the change in loss during the training process. The horizontal axis of this graph is set to the training iteration period in the range of 0 to 150, and the vertical axis is set to the total multi-task loss value. The solid dot matrix in the graph represents the monotonically decreasing mapping relationship of the joint multi-task loss value as the iteration period increases.

[0076] Figure 13 This is a grouped bar chart comparing the performance of multiple models. The horizontal axis of the chart is set to the independent identifiers of the four groups of comparison objects, and the vertical axis is set to a specific percentage value in the range of 0 to 100. The chart contains rectangular bars with different filling styles, which correspond to the quantized values ​​of the actual measured bounding box detection accuracy and mask segmentation accuracy of the specific groups.

[0077] Figure 14 This is a discrete scatter plot of the physical width measurement error. The horizontal axis of the plot is set to the actual physical width quantization value in a specific unit format, and the vertical axis is set to the system's predicted physical width quantization value in the same unit format. The discrete data points recorded in the two-dimensional coordinate system in the plot reflect the one-to-one mapping physical comparison relationship between the predicted width and the actual width of each sample. A diagonal reference line segment with a fixed slope constant of 1 is drawn from the origin of the plot.

[0078] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for detecting and segmenting micro-cracks based on sampling and geometric constraints, characterized in that, A microcrack detection and segmentation system is implemented, comprising an image preprocessing module, a feature extraction module, a feature aggregation module, a loss calculation module, a detection output module, an online inference module, a parameter quantization and evaluation module, and a model training module. The method includes: The image preprocessing module obtains the original image of the surface of the structure to be detected, performs preprocessing operations, and converts it into tensor data. The feature extraction module uses a 3×3 spatial convolutional layer with preset padding and stride to directly perform linear mapping on the tensor data, generating a two-dimensional dynamic sampling offset tensor. The two-dimensional dynamic sampling offset tensor is then applied to a standard sampling grid to perform irregular network sampling and output a crack trunk feature map. The feature aggregation module extracts abrupt change edge feature data tensors from the crack backbone feature map. These tensors are then weighted using a dynamic gating multiplier factor, and preliminarily fused with the tensor data to generate preliminary fused features. These preliminary fused features are then input into a refined network layer containing 3×3 convolutional layers, batch normalization layers, and SiLU activation functions for deep feature smoothing to generate smoothed features. Finally, a skip connection structure is used to perform residual addition operations on the smoothed features and the tensor data mapped by 1×1 convolutions to generate the final geometrically enhanced feature map. During the model training phase, manually labeled data containing real bounding boxes and real mask matrices are obtained. The detection output module outputs predicted bounding boxes and predicted mask matrices based on the geometric enhancement feature map. The loss calculation module constructs a total regression loss value based on the angle penalty term and distance constraint term of the predicted bounding boxes and the real bounding boxes. The overall multi-task loss value is generated by combining the segmentation loss and the classification loss. The network parameters are updated by the model training module using the overall multi-task loss value. During the model inference stage, the online inference module outputs the final predicted bounding box and a binarized pixel-level mask. The parameter quantization evaluation module extracts the central skeleton connecting line of the binarized pixel-level mask to calculate the average pixel width of the crack and converts it into the actual spatial geometric dimensions.

2. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 1, characterized in that, The step of using the feature extraction module to directly perform a linear mapping on the tensor data using a 3×3 spatial convolutional layer with preset padding and stride to generate a two-dimensional dynamic sampling offset tensor includes: The number of output channels of the 3×3 spatial convolutional layer is configured to be twice the square of the standard sampling kernel size; The tensor data is input into the 3×3 spatial convolutional layer for convolution operation to extract the geometric deformation features within the local spatial receptive field; A linear projection is performed on the convolution output of the 3×3 spatial convolutional layer to directly generate a two-dimensional dynamic sampling offset tensor containing horizontal and vertical components.

3. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 2, characterized in that, The process of applying the two-dimensional dynamic sampling offset tensor to the standard sampling grid to perform irregular network sampling and output crack trunk feature maps includes: Extract the sub-pixel offset vector from the two-dimensional dynamic sampling offset tensor, and perform an addition operation between the basic relative coordinate vector of the standard grid and the sub-pixel offset vector to generate a set of deformation sampling coordinates; The bilinear interpolation algorithm combined with the boundary truncation constraint mechanism is used to calculate the feature value at the floating-point coordinate space location. The feature value is then multiplied and accumulated element-wise with the convolution kernel weight parameters to output the irregular network sampling result.

4. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 3, characterized in that, The process of outputting the feature map of the crack backbone also includes: Perform a global average pooling operation along the spatial dimension on the sampling results of the irregular network to generate channel descriptors; The channel descriptor is input into a multilayer perceptron network, and channel dimensionality reduction projection based on constant scaling and channel dimensionality increase operations are performed sequentially. A nonlinear activation function is used to map and generate channel attention weight vectors. The channel attention weight vector is multiplied element-wise with the sampling result of the irregular network to output the feature map of the crack trunk.

5. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 1, characterized in that, The step of extracting abrupt change edge feature data tensors from the crack trunk feature map through the feature aggregation module includes: Using a preset second-order differential Laplacian kernel matrix, spatial convolution filtering is performed on the crack trunk feature map along the spatial height and width dimensions to extract the abrupt edge feature data tensor containing edge gradient change information.

6. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 5, characterized in that, The step of weighting the mutation edge feature data tensor using a dynamic gating multiplier factor and then performing preliminary addition and fusion with the tensor data to generate preliminary fused features includes: Learnable gated scalar parameters are extracted from the computation graph, and the nonlinear mapping value of the learnable gated scalar parameters is calculated using the hyperbolic tangent function to generate the dynamic gated multiplier factor. The dynamic gating multiplier factor is used as a scalar weight and multiplied element-wise with the mutation edge feature data tensor to output a weighted edge feature tensor. The weighted edge feature tensor and the tensor data are fused by an element-wise addition operation with spatial alignment to generate the preliminary fused feature.

7. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 1, characterized in that, The step of constructing the total regression loss value through the loss calculation module based on the angle penalty term and distance constraint term between the predicted bounding box and the true bounding box includes: Extract the width and height values ​​of the predicted bounding box and the true bounding box, calculate the arctangent of the width-to-height ratio, and construct the angle penalty term by taking the square of the difference between the two. The distance constraint term is constructed by calculating the squared Euclidean distance between the center point of the predicted bounding box and the center point of the actual bounding box. The total regression loss value is generated by adding the intersection-union ratio (IU) of the predicted target and the true target, the angle penalty term, and the distance constraint term.

8. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 7, characterized in that, The process of combining segmentation loss and classification loss to generate the overall multi-task loss value includes: The segmentation loss is generated by calculating the binary cross-entropy loss between the predicted mask matrix and the true mask matrix; The classification loss is generated by calculating the error between the classification confidence score of the network's predicted output and the true class label; According to the first preset constant, the second preset constant, and the third preset constant, the total regression loss value, the segmentation loss, and the classification loss are weighted and summed respectively to generate the overall multi-task loss value.

9. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 1, characterized in that, The step of outputting the final predicted bounding box and binarized pixel-level mask through the online inference module includes: All predicted bounding boxes are sorted in descending order based on classification confidence and the cross-union ratio (CUP) between candidate boxes is calculated. When the CUP is greater than a preset suppression threshold, the non-maximum suppression algorithm is used to filter redundant detection results. The prediction mask matrix, which retains the probability distribution format within the effective region, is traversed through its elements. Each element is mapped to a specific integer Boolean value using a preset activation threshold. The output is a discrete topological connected domain representing the distribution of physical cracks, which is then used as the binarized pixel-level mask.

10. The method for detecting and segmenting micro-cracks based on sampling and geometric constraints according to claim 9, characterized in that, The step of extracting the central skeleton connected lines of the binarized pixel-level mask through the parameter quantization evaluation module, calculating the average pixel width of the crack, and converting it into actual spatial geometric dimensions includes: The morphological thinning algorithm is applied to the discrete topological connected domain to iteratively remove edge pixels, extract the central skeleton connected line with a single pixel width, and accumulate the Euclidean distance between adjacent connected pixels along the central skeleton connected line to generate a pixel-level total length value. The average pixel width is obtained by dividing the total number of active pixels in the binarized pixel-level mask by the sum of the total pixel-level length and the minimum smoothing constant. The average pixel width is multiplied by a preset physical calibration coefficient to convert it into the actual spatial geometric size.