A tunnel crack detection method based on image recognition

By employing an image recognition method that combines orientation-adaptive deblurring and illumination-invariant feature enhancement, the problems of motion blur and abrupt illumination changes in tunnel lining crack detection are solved, enabling clear extraction and high-precision quantization of crack details.

CN121415265BActive Publication Date: 2026-03-20Jiangxi Jiaotong Maintenance Technology Group Co., Ltd. +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

In existing technologies for detecting cracks in tunnel linings, motion blur and sudden changes in illumination caused by high-speed mobile acquisition lead to the loss of crack details and a decrease in detection accuracy.

Method used

An image recognition-based approach is adopted, which combines orientation-adaptive deblurring and illumination-invariant feature enhancement with deformable convolutional networks and multi-head self-attention mechanisms to achieve crack segmentation and parameter quantization.

Benefits of technology

It significantly improves the integrity and detection accuracy of crack edges, effectively preserves crack details under complex lighting conditions, reduces false detection rate, and improves detection efficiency and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121415265B_ABST
    Figure CN121415265B_ABST
Patent Text Reader

Abstract

The application discloses a tunnel crack detection method based on image recognition and relates to the technical field of civil engineering structure health monitoring and operation and maintenance detection. The direction self-adaptive deblurring processing can significantly improve the integrity of the crack edge under the motion blur state, the slender crack still maintains clear morphological characteristics under the dynamic acquisition condition, and the crack breaking or missing detection problem caused by the blur is avoided; the illumination invariance feature enhancement mechanism is introduced to effectively overcome the interference of uneven illumination in the tunnel, the crack details in the shadow area and the overexposure area are fully reserved through dynamic balance of the brightness difference at the feature level, the contrast of the crack and the background is enhanced, and the false detection rate under the complex illumination condition is reduced; the collaborative design is adopted to guarantee the practicability and robustness of the system, the quality gate mechanism automatically filters the low-quality input, and invalid processing is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of civil engineering structure health monitoring and operation detection technology, and particularly relates to a tunnel crack detection method based on image recognition. BACKGROUND

[0002] Tunnel lining crack detection is a key link in the operation and maintenance of transportation infrastructure; in recent years, with the application of mobile imaging systems with industrial cameras in vehicles in tunnels, image-based automatic detection combined with deep learning has been widely studied and promoted in engineering, making it possible to achieve high-speed and continuous surface coverage under normal traffic conditions.

[0003] High-speed mobile acquisition brings two core problems: first, the translation type motion blur along the direction of travel caused by vehicle travel and airborne vibration easily causes the loss of details and the breaking of elongated cracks parallel to the direction of travel in the image; second, the unevenness of fixed light sources and the superposition of vehicle-mounted fill light and environmental light in the tunnel lighting conditions result in the coexistence of local overexposure and shadows, and the contrast of cracks and background is reduced.

[0004] Existing work attempts to exclude severely blurred images through no-reference image quality assessment, and uses multi-scale Retinex and other enhancement and attention mechanism / directional convolution to strengthen crack representation; however, when strong motion blur and severe illumination change are superimposed, it is still difficult to ensure the integrity and stable extraction of crack geometric details while ensuring detection efficiency. SUMMARY

[0005] In view of the above existing problems, the present application is proposed.

[0006] The present application provides a tunnel crack detection method based on image recognition to solve the problem of motion blur and illumination mutation in tunnel mobile acquisition, resulting in loss of crack details and reduced detection accuracy.

[0007] To solve the above technical problems, the present application provides the following technical solutions:

[0008] The present application provides a tunnel crack detection method based on image recognition, which comprises:

[0009] Step S1, obtaining the original image of the lining surface obtained by the mobile acquisition system under normal traffic conditions in the tunnel;

[0010] Step S2, performing direction-adaptive deblurring processing on the original image to obtain a deblurred image;

[0011] Step S3, performing illumination invariance feature enhancement on the deblurred image to obtain an enhanced image;

[0012] Step S4, inputting the enhanced image into a crack segmentation model to obtain a crack segmentation result;

[0013] Step S5, quantifying crack parameters based on the crack segmentation result, and outputting crack length, width and type.

[0014] As a preferred scheme of the tunnel crack detection method based on image recognition, the direction adaptive deblurring processing is realized by a deformable convolution network, and the deformable convolution network performs direction selective restoration on local features by learning obtained sampling offset and weight.

[0015] As a preferred scheme of the tunnel crack detection method based on image recognition, the deformable convolution network includes a blur kernel estimation sub-network and a restoration sub-network.

[0016] The blur kernel estimation sub-network performs point spread function prediction to guide non-blind restoration, and fuses the restoration results in multiple scales.

[0017] The process of performing point spread function prediction is as follows:

[0018] Step C1, on the local features extracted by the blur kernel estimation sub-network on the observed image, first obtain an unnormalized kernel, and then obtain a discrete PSF by differentiable normalization:

[0019] ,

[0020] Wherein, represents a discrete point spread function, represents an unnormalized kernel, is a component at row and column index , is a kernel grid index, is a kernel size, is a non-negative function, is a sum over kernel grid, is a unit and normalization operator, is a PSF prediction network mapping characterized by parameter , and is a blur observed image.

[0021] Step C2, to limit non-physical shape and noise ringing, while combining the local principal motion direction, a composite regularization is introduced:

[0022] ,

[0023] Wherein, is a kernel regularization term, are three weight coefficients, is a gradient field of the kernel on a two-dimensional discrete grid, norm, is a component at index is a natural logarithm, is a second moment matrix weighted by kernel weights, is a unit eigenvector corresponding to the largest eigenvalue, is a unit vector of local principal motion direction aggregated from deformable offsets;

[0024] The second moment matrix is defined on pixel coordinates

[0025] ,

[0026] wherein, is a kernel grid coordinate, , is a weighted center coordinate;

[0027] Step C3, synchronously input the predicted PSF into the deconvolutional network, and drive the two sub-networks end-to-end training with data consistency and reconstruction error:

[0028] ,

[0029] wherein, is a PSF prediction network parameter, is a deconvolutional network parameter, is a weighting coefficient of the three losses, is a mapping of the deconvolutional network from the observed-kernel pair to the clean image, is a clean reference image, is a discrete convolution operator, norm;

[0030] Step C4, repeat the above three steps on the Gaussian or Laplacian pyramid, generate kernel and intermediate deconvolutional results at each scale, and cross-scale fusion with learnable weights, and add a light normalization bias penalty and edge clipping in the early training stage.

[0031] As a preferred scheme of the tunnel crack detection method based on image recognition provided by the application, the illumination invariance feature enhancement comprises instance normalization and attention mechanism, and the feature map is dynamically weighted.

[0032] ​​​​​​As a preferred scheme of the tunnel crack detection method based on image recognition, the illumination invariance feature enhancement further comprises a logarithmic domain brightness compression and reflection-illumination separation exposure correction strategy.

[0033] As a preferred scheme of the tunnel crack detection method based on image recognition, the crack segmentation model is an encoder-decoder architecture, the encoder integrates a self-attention module, and the decoder adopts multi-level skip connection for step-by-step restoration.

[0034] As a preferred scheme of the tunnel crack detection method based on image recognition, the self-attention module is a Transformer encoder layer and processes the feature sequence through a multi-head self-attention mechanism.

[0035] The process of the multi-head self-attention mechanism for processing the feature sequence is as follows:

[0036] Step D1, the feature sequence obtained by the enhanced image through the encoder is denoted as ; the linear mapping of the first head is performed to obtain the query / key / value:

[0037] ,

[0038] wherein represents the feature sequence with a length of , the channel dimension is , , , is the head index, is the number of heads, , , is a learnable projection matrix;

[0039] Step D2, the attention output of the first head is calculated:

[0040] ,

[0041] wherein is normalized by row, is a scaling factor, is an additive mask / bias matrix, is the output of the first head;

[0042] Step D3, the head outputs are spliced by channel and linearly mapped back to the model dimension:

[0043] ,

[0044] wherein, is the concatenated tensor, concatenated along the channel dimension, is the output projection matrix, is the linear output of the multi-head attention block;

[0045] Step D4, pre-normalization encoder layer is used to apply residual and dropout to attention and feed-forward respectively:

[0046] ,

[0047] ,

[0048] wherein, are two layer normalization operators with parameter vectors , denotes the process computation defined in steps D1 to D3, is the feed-forward sublayer mapping, is the dropout operator with probabilities , is the residual output after the attention sublayer, is the final output of the encoder layer.

[0049] As a preferred scheme of the tunnel crack detection method based on image recognition provided by the application, wherein: further comprising executing quality gating before step S4:

[0050] Calculating blur score and exposure score of the image, and skipping segmentation and quantization steps when the score is lower than the threshold.

[0051] As a preferred scheme of the tunnel crack detection method based on image recognition provided by the application, wherein: the crack parameter quantization comprises:

[0052] Performing connected component analysis and skeleton extraction on the segmentation result, obtaining crack length in physical scale based on pixel distance and calibration parameters; and estimating crack width based on distance transform of the skeleton.

[0053] As a preferred scheme of the tunnel crack detection method based on image recognition provided by the application, wherein: the mobile acquisition system adopts trigger-synchronized industrial cameras and light supplement units, and combines an inertial measurement unit to provide motion direction priori.

[0054] The application has the beneficial effects that: through the direction self-adaptive deblurring processing, the integrity of the crack edge in the motion blur state can be significantly improved, the slender crack still maintains clear morphological characteristics under the dynamic acquisition condition, and the problems of crack breaking or missing detection caused by blur are avoided. The illumination invariance feature enhancement mechanism is introduced to effectively overcome the interference of uneven illumination in the tunnel, the crack details in the shadow area and overexposure area are fully retained through dynamic balance of the brightness difference at the feature level, the contrast of the crack and the background is enhanced, and the false detection rate under complex illumination conditions is reduced.

[0055] The architecture of the application adopts collaborative design to guarantee the practicability and robustness of the system, the quality gate mechanism automatically filters low-quality input to avoid invalid processing, the multi-head self-attention mechanism enhances the understanding of the global context of the crack, and can effectively distinguish real cracks from interference features such as lining joints and stains, and the end-to-end processing flow ensures the coherence from image preprocessing to parameter output, improves the detection efficiency while maintaining the quantization accuracy. These improvements work together to make the system adapt to complex working conditions in tunnel detection while maintaining high-speed processing, and provide reliable technical support for infrastructure maintenance. BRIEF DESCRIPTION OF DRAWINGS

[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments, and it should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope of the present application.

[0057] Figure 1 The flowchart of the image recognition-based tunnel crack detection method in the embodiments. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.

[0059] All terms used in the present application (including technical and scientific terms) have meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted to have meanings consistent with the context of the present specification, and should not be interpreted in an idealized or overly formal manner.

[0060] For example, the terms "first", "second", etc. used in the present application are only used to distinguish similar objects, to distinguish the first object from another object, and are not used to describe a specific order or sequence, nor can be understood as indicating or implying relative importance.

[0061] The application provides a tunnel crack detection method based on image recognition, which combines Figure 1 The method comprises the following steps:

[0062] In step S1, an original image of a lining surface obtained by a mobile acquisition system under normal traffic conditions of a tunnel is acquired.

[0063] In step S2, the original image is subjected to direction-adaptive deblurring processing to obtain a deblurred image.

[0064] In step S3, the deblurred image is subjected to illumination invariance feature enhancement to obtain an enhanced image.

[0065] In step S4, the enhanced image is input into a crack segmentation model to obtain a crack segmentation result.

[0066] In step S5, crack parameters are quantified based on the crack segmentation result, and the crack length, width and type are output.

[0067] In the embodiment, the mobile acquisition system refers to an industrial camera and a light supplement unit installed on a detection vehicle and a trigger control assembly synchronized therewith, and the original image refers to an image frame after camera intrinsic calibration and distortion correction, without sharpening and denoising. Specifically, the default resolution is in the order of 20 million pixels, the frame rate is 60 frames per second, and the exposure time is in the order of 1 millisecond, which can be adjusted online according to the target aperture of the vehicle speed of 20 to 60 kilometers per hour and the ground sampling interval of 0.5 to 1.5 millimeters per pixel. According to engineering practice, the motion blur is not more than 0.3 pixels. For example, the original image can be subjected to white balance locking and dark current correction before entering step S2, so as to avoid color deviation introduced in the subsequent enhancement stage. Alternatively, if frame loss or trigger asynchronization occurs in a certain period, the time stamp and odometer of the last frame are interpolated to generate placeholder metadata and marked as unusable for quantization, so that the process can continue to be executed. Further, if the vehicle speed exceeds the rated range of the device, the upper limit of the exposure is temporarily converged to 0.5 milliseconds and the frame rate is reduced to 30 frames per second, so as to ensure data consistency and safety margin.

[0068] In an embodiment, the direction-adaptive deblurring process is implemented by a deformable convolution network that learns sample shifts and weights to direction-selectively restore local features; in this embodiment, the local principal motion direction is obtained by aggregating sample shifts within a spatial neighborhood, with the direction vector pointing to the dominant direction of shifts and taking unit length. Specifically, the default neighborhood length is set to 21 pixels, the step length is set to 8-16 pixels, and the shift amplitude is clipped in the range of 3-7 pixels, based on the measured vehicle body vibration frequency band and the camera pixel size. For example, to suppress isolated abnormal shifts, a 1-3 pixel median smoothing can be applied to the direction field; when the aggregated direction amplitude is insufficient to determine the dominant direction, the isotropic restoration weight is maintained. Optionally, in the case of triggering synchronous availability, the pitch and yaw rate of the inertial measurement unit can be used as a weak prior for the direction vector, but not replace the dominant direction obtained from image shifts. Further, if the direction estimation fails or the signal-to-noise ratio is too low, it is degraded to isotropic non-blind restoration and recorded as a low-confidence sample.

[0069] In an embodiment, the deformable convolution network includes a blur kernel estimation subnetwork and a restoration subnetwork;

[0070] The blur kernel estimation subnetwork performs point spread function prediction to guide non-blind restoration, and fuses the restoration results at multiple scales;

[0071] The process of performing point spread function prediction is as follows:

[0072] Step C1: On the local features extracted by the blur kernel estimation subnetwork from the observed image, first obtain the unnormalized kernel, and then obtain the discrete PSF by differentiable normalization, which is used to guide the subsequent restoration:

[0073] ,

[0074] wherein, denotes the discrete point spread function (PSF), denotes the unnormalized kernel, is the component at row and column indices , is the kernel grid index, is the kernel size, is the non-negativity function, is the summation over the kernel grid, is the unit and normalization operator, is the PSF prediction network mapping characterized by the parameter , and is the blurred observed image.

[0075] Step C2, to restrict non-physical shape with noise ringing while incorporating local principal motion direction, introduce compound regularization:

[0076] ,

[0077] where, is the kernel regularization term, are three weight coefficients, is the gradient field of the kernel on a two-dimensional discrete grid, is norm, is component at index , is the natural logarithm, is the second moment matrix weighted by kernel weight, is unit eigenvector corresponding to the largest eigenvalue (principal axis direction), is the local principal motion direction unit vector aggregated from deformable offset;

[0078] The second moment matrix is defined on pixel coordinates as:

[0079] ,

[0080] where, is the kernel grid coordinate, , is the weighted center coordinate;

[0081] Step C3, the predicted PSF is synchronously input into the deconvolutional network, and both data consistency and reconstruction error are used to drive the end-to-end training of the two sub-networks:

[0082] ,

[0083] where, is the PSF prediction network parameter, is the deconvolutional network parameter, is the weight coefficient of the three loss terms, is the mapping of the deconvolutional network from the observation-kernel pair to the clean image, is the clean reference image, the subscript indicates the reference attribute in the present scheme, is the discrete convolution operator, is norm;

[0084] Step C4, repeat the previous three steps on the Gaussian or Laplacian pyramid to generate kernels and intermediate restoration results at each scale, and cross-scale fusion with learnable weights, with a light normalization bias penalty and edge clipping added in the early training stage to reduce the interference of boundary effects on kernel learning;

[0085] In this embodiment, the kernel size is set to 11-31 pixels by default, the number of pyramid layers is set to 3-5 layers, and the cross-scale fusion weight is determined by searching the validation set between 0.2 and 0.6. Specifically, the weight of the smoothing regularizer is preferably of the order of 0.1, the entropy constraint weight is preferably of the order of 1%, and the direction consistency constraint weight is preferably of the order of 0.5; the relative weight of the reconstruction error and the data consistency is 1:0.5 by default, and the kernel regularizer weight is 0.1 by default, which is selected comprehensively according to the peak signal-to-noise ratio and the structural similarity of the validation set. For example, the training uses an adaptive moment estimation optimizer with an initial learning rate of one times ten to the negative fourth power, a batch size of 2-8, and 50-150 rounds; data augmentation can include random exposure perturbation and light Gaussian noise to match the tunnel lighting fluctuations. Optionally, a slight penalty for kernel center offset is introduced in the first 10-20 rounds to avoid generating non-physical solutions far from the center; when the memory resource is insufficient, the gradient accumulation is adopted to keep the effective batch size unchanged. Further, if gradient explosion occurs, the gradient norm is temporarily clipped to the unit order and the learning rate is reduced by half until it is stable.

[0086] Specifically, the network output is mapped to a discrete kernel that satisfies non-negativity and unit sum through a differentiable normalization to reduce the feasible region pressure of the subsequent objective; then the smoothing, entropy and direction consistency constraints are combined into a kernel regularizer, where the direction item suppresses unreasonable diffusion patterns by measuring the consistency of the second moment principal axis and the local motion direction, so that the kernel shape matches the motion prior; the objective function places the reconstruction error and data consistency on an equal footing with the kernel regularizer, and the kernel is not only an explicit input to the restoration network but also enters the convolution consistency channel, so that the kernel and the clear image are converged to a mutually matched solution in the same optimization framework; the multi-scale path effectively covers different blur ranges and balances details and stability through cross-scale fusion; this design focuses on trainability and engineering feasibility, and takes into account direction adaptation and anti-artifact ability, and is suitable for directional motion blur generated by vehicles in tunnel working conditions and complex lighting conditions; specifically, the training set can be composed of half of the existing tunnel real data and simulation degradation, the kernel shape of simulation degradation covers two categories of slender and elliptical, the intensity distribution covers light to heavy blur, and the training, validation and testing are divided according to 70%, 15% and 15%; the standard for determining convergence is to stop early when the structural similarity and segmentation accuracy of the validation set do not improve for five consecutive evaluation periods. Similarly, to ensure the stability of the deployed deployment, real number domain convolution and edge mirror padding are used in the reasoning stage, and the single image edge length is limited to no more than four thousand pixels to meet common computing resources.

[0087] In one embodiment, the illumination-invariant feature enhancement includes instance normalization and attention mechanism, and dynamically weights the feature map to reduce the impact of uneven illumination, overexposure and shadow on the crack contrast;

[0088] In this embodiment, instance normalization refers to calculating the mean and variance in the channel dimension of a single image respectively and performing standardization, and the attention mechanism refers to a lightweight gating unit with global statistics in the channel dimension as input, and outputs scaling coefficients for each channel. Specifically, the compression ratio of the gating unit is set to 4-16 by default, the activation adopts a saturable monotonic function, and the gating coefficient is limited between zero and one to avoid over-amplifying noise. For example, in the strong contrast scene of illumination, the gating output allows to tend to a smaller value in the high-illumination area and to a larger value in the shadow area, thereby improving the separability of cracks and background. Optionally, to prevent high-frequency noise from being excessively lifted, a slight smoothing with a radius of 1-3 pixels can be performed on the brightness component before normalization without changing the chroma component. Further, if the variance of any channel after normalization tends to zero, fallback to batch normalization is performed to avoid numerical instability.

[0089] In one embodiment, the illumination-invariant feature enhancement also includes a log-domain brightness compression and reflection-illumination separation exposure correction strategy to improve the distinguishability of fine cracks in strong dynamic range scenes; in this embodiment, the log-domain brightness compression refers to mapping the intensity to the log space to suppress high-light overflow, and the reflection-illumination separation refers to estimating the slowly changing illumination in the spatial neighborhood and obtaining the reflection component in the form of quotient or difference; the smoothing radius of the illumination estimation is set to 15-45 pixels by default, and the compression intensity corresponds to the exponential or gain coefficient of 0.8-1.2 by default, which is determined according to the joint recall rate and false detection rate of fine cracks on the validation set. Specifically, to suppress extreme highlights, the upper quantile cutoff range of brightness is suggested to be 95%-99%; to protect dark details, the upper quantile is not lifted by more than 5%. Optionally, if the dynamic range of the input image is limited, skip the separation and only perform lightweight compression; if color distortion occurs, return to the original color space for chroma re-projection to keep the hue unchanged after separation. Further, when the estimated illumination field is discontinuous at the boundary, a one-time boundary interpolation correction is applied to the illumination field to avoid ring artifacts.

[0090] In one embodiment, the crack segmentation model is an encoder-decoder architecture, the encoder integrates a self-attention module to capture global context, and the decoder adopts multi-level skip connection for step-by-step restoration;

[0091] In this embodiment, the encoder-decoder architecture adopts a 4-5 level scale, the downsampling is completed by a convolution with a step of 2, and the number of feature channels doubles with the scale to the order of 256; the decoder adopts a combination of bilinear upsampling and 1*1 convolution to reduce the moiré. Specifically, the skip connection fuses the features of the same scale in a channel splicing manner, and immediately applies normalization and activation after fusion to avoid amplitude drift caused by scale mismatch; the output of the last layer uses a pixel-wise classifier and cooperates with a threshold near 0.5 for binarization, and the best threshold is automatically searched by the validation set. Optionally, if the video memory is insufficient, the upsampling can be changed to the nearest interpolation and the number of intermediate channels can be reduced to half of the original setting without changing the output segmentation size. Further, when the input resolution changes greatly, the long side is uniformly scaled to a fixed upper limit and the aspect ratio is kept to ensure the stability of the down-sampling level.

[0092] In one embodiment, the self-attention module is a Transformer encoder layer, and the feature sequence is processed by a multi-head self-attention mechanism to suppress the interference response of non-crack structures such as joints and leaks;

[0093] The process of processing the feature sequence by the multi-head self-attention mechanism is as follows:

[0094] Step D1, the feature sequence obtained by the encoder from the enhanced image is denoted as ; the linear mapping is performed on the first head to obtain the query / key / value:

[0095] ,

[0096] wherein, represents the feature sequence with a length of , the channel dimension is , , , is the head index, is the number of heads, , , is a learnable projection matrix;

[0097] Step D2, the attention output of the first head is calculated:

[0098] ,

[0099] wherein, is normalized by row, is a scaling factor, is an additive mask / bias matrix (zero when there is no mask), is the output of the first head;

[0100] Step D3: Concatenate the outputs of each header by channel and linearly map them back to the model dimension:

[0101] ,

[0102] in, For the spliced ​​tensor, splicing along the channel, To output the projection matrix, Linear output for multi-head attention blocks;

[0103] Step D4: Using a pre-normalized encoder layer, residuals and discarding are applied to the attention and feedforward layers, respectively.

[0104] ,

[0105] ,

[0106] in, For the two layer normalization operators, the parameter vectors are respectively , Refers to the process calculations defined in steps D1 to D3. For feedforward sublayer mapping (a combination of two linear and activation layers, with an output dimension of...) ), To discard the operator, the probabilities are respectively , This is the residual output after the attention sublayer. This is the final output of the encoder layer;

[0107] If there is no mask, in step D2, set... ;

[0108] In this embodiment, the feature sequence is obtained by flattening the two-dimensional feature map in row-major order. The position encoding adopts a sine and cosine form and is added element-wise to the sequence. The number of heads is 4-8 by default, the intermediate dimension of the feedforward sub-layer is 2-4 times the input dimension by default, and the dropout probability is 0.1-0.3 by default. Specifically, the mask is set to zero when there is no padding, and a negative bias is applied to the corresponding position when there is an invalid region to suppress attention diffusion. Residual pre-normalization is used during training to help stabilize deep layers. For example, to balance efficiency and accuracy, only the first few heads can be retained in deeper layers for global modeling, and the remaining heads can be used for nearest neighbor modeling without changing the output interface. Optionally, if the hardware is not friendly to long sequences, the feature map is downsampled to a safe length with a large stride, and then restored to the original number of channels through linear mapping. Furthermore, if the attention distribution is too sharp during training, causing gradient instability, the dropout probability is temporarily increased and the attention weights are temperature-amplified to above one in several rounds to smooth the learning.

[0109] Position encoding is used to preserve sequential information, which can be learned or cosine form and added with the same dimension as the mask Mask Can be used to mask padding or suppress specific interference areas, the intermediate dimension of the feedforward sublayer can be learned To improve the representation ability;

[0110] Specifically, after obtaining the query, key and value through linear mapping, the normalized weight is obtained through the scaled dot product and row softmax, the information aggregation across positions is realized, the multi-head parallel modeling is performed in different subspaces, so that the contrast of the sequence is improved and the response to the non-crack structure such as joint and leakage is dispersed, the multi-head result is restored to the model dimension through splicing and output projection, which is convenient for docking with subsequent sublayers, the combination of pre-normalization and residual is adopted to improve the stability of deep training and reduce gradient attenuation, the dropout operator provides regularization on the attention and feedforward path, which helps to suppress overfitting and noise amplification; combined with the optional use of the mask, the false attention can be reduced when there is occlusion or invalid area, so as to strengthen the discriminant performance of the crack pattern;

[0111] In one embodiment, it further includes performing quality gating before step S4:

[0112] Calculate the blur score and exposure score of the image, skip the segmentation and quantization steps when the score is below the threshold to avoid interference of low-quality samples;

[0113] In this embodiment, the blur score can be calculated according to the gradient energy or Laplacian variance, and the default threshold is in the range of 50-150 normalized units; the exposure score can be calculated according to the combination of the proportion of saturated pixels and the median of the gray scale, and the default threshold is that the proportion of highlight saturation is not more than 5% and the median is between 0.2-0.8. Specifically, the score takes the sliding median in a one-second time window to suppress transient jitter; once any score is below the threshold, the corresponding image is marked for quality inspection only and does not participate in segmentation and quantization. Optionally, the threshold can be adaptively fine-tuned according to the tunnel interval, and the range is limited within plus or minus 20% of the default value. Further, if the score module is temporarily disabled, it will be rolled back to the fixed threshold and recorded in the state register for offline review.

[0114] In one embodiment, the crack parameter quantization includes:

[0115] The connected component analysis and skeleton extraction are performed on the segmentation result, the crack length in physical scale is obtained based on the pixel distance and calibration parameters, and the crack width is estimated based on the distance transform of the skeleton; in this embodiment, the connected component analysis uses four or eight neighborhood consistency, the skeleton extraction uses the thinning operator until stability, the length is calculated as the cumulative distance of the skeleton path in physical scale, and the width is obtained by multiplying the distance transform at the skeleton by two times the distance and the calibration coefficient. Specifically, the calibration parameter is obtained from a scale or a known size of structural plane, and the unit conversion accuracy is preferably better than 1%; to suppress noise, the minimum crack length threshold is preferably 50-150 mm, and the minimum area threshold is preferably fifty to two hundred pixel equivalents, and the threshold is determined by the recall and false detection trade-off of the validation set. Optionally, the endpoints of the skeleton can be extended by no more than three pixels at a time to bridge slight breaks, but cannot cross obvious non-crack areas. Further, if the calibration parameter is missing, the last valid calibration parameter is used and marked as an estimated result in the output.

[0116] In one embodiment, the mobile acquisition system uses a trigger-synchronized industrial camera and a light supplement unit, and optionally combines an inertial measurement unit to provide a motion direction priori for improving the direction adaptive processing of step S2; in this embodiment, trigger synchronization means that the camera, light supplement and odometer work under the same time reference, the flash duration is 0.5-2 ms by default, and a global shutter image sensor is preferred to avoid rolling distortion. Specifically, the coupling rule of vehicle speed and exposure is to preferentially shorten the exposure time and correspondingly increase the light supplement power as the speed increases until the device upper limit, and then reduce the frame rate as needed to maintain the signal-to-noise ratio; the sampling frequency of the inertial measurement unit is greater than 100 Hz by default, and the timestamps are aligned by a unified clock. Optionally, if the light supplement power is limited, the vehicle speed is reduced to ensure that the upper limit of motion blur is not broken; if any sensor is missing data, the missing data is filled with linear interpolation in the last valid time window, but no image data is generated, and the degradation mode is automatically released after synchronization recovery. Further, to prevent overexposure caused by strong reflection, a frame-by-frame automatic power fine-tuning can be set in the light supplement path, the adjustment step is not more than 10%, and the adjustment is fixed after the brightness closed loop is stable.

[0117] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

[0118] Furthermore, to the extent that the terms "comprises", "comprising", "includes", "including" and "has" or any variation thereof are used in the specification and / or claims, these terms are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, includes or has a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Additionally, to the extent that the terms "coupled" and "current-coupled" are used in the detailed description and / or claims, such terms are intended to mean that the devices are in electronic communication and / or signal communication, unless otherwise indicated. Also, where necessary, the use of the terms "a", "an" and "the" are intended to mean "one or more", unless otherwise indicated.

Claims

1. A tunnel crack detection method based on image recognition, characterized in that, include: Step S1: Obtain the original image of the lining surface obtained by the mobile acquisition system under normal tunnel traffic conditions; Step S2: Perform orientation-adaptive deblurring on the original image to obtain a deblurred image; The orientation-adaptive deblurring process is implemented by a deformable convolutional network, which performs orientation-selective restoration of local features by learning the sampling offset and weights. The deformable convolutional network includes a fuzzy kernel estimation subnetwork and a complex atom network; The fuzzy kernel estimation subnetwork performs point spread function prediction to guide non-blind restoration and fuses the restoration results at multiple scales; The process of performing point spread function prediction is as follows: Step C1: Based on the local features extracted from the observed image by the fuzzy kernel estimation subnetwork, first obtain the unnormalized kernel, then obtain the discrete PSF by differentiability normalization. , in, Represents the discrete-point spread function. Indicates unnormalized nuclei. In order to be in Row and column index The component at that location, For the core grid index, For core size, It is a nonnegative function. In order to be in Summation on the kernel grid For unit and normalization operators, For parameters Characterized PSF prediction network mapping, The image contains blurred observations; Step C2, to limit non-physical shape and noise ringing, and in conjunction with the local principal motion direction, introduces a composite regularity: , in, For kernel regularization terms, There are three weighting coefficients. The gradient field of the kernel on a two-dimensional discrete grid. for Norm, for In the index The component at that location, It is the natural logarithm. It is a second-order moment matrix weighted by kernel weights. for The unit eigenvector corresponding to the largest eigenvalue. The local principal motion direction unit vector is obtained by deformable offset aggregation; Second-order moment matrix at pixel coordinates The above is defined as: , in, For core grid coordinates, , The coordinates are the weighted center coordinates; Step C3 involves synchronously inputting the predicted PSF into the complex atom network, and using data consistency and reconstruction error to drive end-to-end training of the two sub-networks: , in, Predict network parameters for PSF. For complex atom network parameters, The weighting coefficients for the three losses are... This is a mapping from observation-checking to a clear image for complex atom networks. For a clear reference image, For discrete convolution operators, for Norm; Step C4: Repeat the above three steps on the Gaussian or Laplace pyramid to generate kernel and intermediate restoration results at each scale, and perform cross-scale fusion with learnable weights, adding a light normalization bias penalty and edge clipping in the early training phase. Step S3: Perform illumination invariant feature enhancement on the deblurred image to obtain an enhanced image; Step S4: Input the enhanced image into the crack segmentation model to obtain the crack segmentation result; Step S5: Based on the crack segmentation results, the crack parameters are quantified, and the crack length, width, and type are output.

2. The tunnel crack detection method based on image recognition as described in claim 1, characterized in that, The illumination invariance feature enhancement includes instance normalization and attention mechanisms, and dynamic weighting of the feature map.

3. The tunnel crack detection method based on image recognition as described in claim 2, characterized in that, The enhancement of illumination invariance features also includes an exposure correction strategy that combines logarithmic domain brightness compression with reflection-illumination separation.

4. The tunnel crack detection method based on image recognition as described in claim 1, characterized in that, The crack segmentation model is an encoder-decoder architecture, in which the encoder integrates a self-attention module and the decoder uses multi-level jump connections for step-by-step reconstruction.

5. The tunnel crack detection method based on image recognition as described in claim 4, characterized in that, The self-attention module is a Transformer encoder layer, and it processes the feature sequence through a multi-head self-attention mechanism. The process by which the multi-head self-attention mechanism processes the feature sequence is as follows: Step D1, the feature sequence obtained from the enhanced image by the encoder is denoted as... ; for the first The query / key / value is obtained by linearly mapping the heads: , in, Indicates length is The feature sequence, with channel dimension of , , , For header index, For the number of heads, , , For learnable projection matrix; Step D2, calculate the attention output of the i-th head: , in, Normalize by row, Scaling factor For additive mask / bias matrix, For the first Output of the head; Step D3: Concatenate the outputs of each header by channel and linearly map them back to the model dimension: , in, For the spliced ​​tensor, splicing along the channel, To output the projection matrix, Linear output for multi-head attention blocks; Step D4: Using a pre-normalized encoder layer, residuals and discarding are applied to the attention and feedforward layers, respectively. , , in, For the two layer normalization operators, the parameter vectors are respectively This refers to the process calculations defined in steps D1 to D3. For feedforward sublayer mapping, To discard the operator, the probabilities are respectively , This is the residual output after the attention sublayer. This is the final output of the encoder layer.

6. The tunnel crack detection method based on image recognition as described in claim 1, characterized in that, This also includes performing quality gating before step S4: Calculate the blur score and exposure score of the image, and skip the segmentation and quantization steps when the score is below the threshold.

7. The tunnel crack detection method based on image recognition as described in claim 1, characterized in that, The crack parameter quantification includes: Connectivity analysis and skeleton extraction are performed on the segmentation results. The crack length at the physical scale is obtained based on the pixel spacing and calibration parameters. The crack width is estimated based on the distance transformation of the skeleton.

8. The tunnel crack detection method based on image recognition as described in claim 1, characterized in that, The mobile acquisition system uses an industrial camera and a supplementary lighting unit that are triggered for synchronization, and combines them with an inertial measurement unit to provide prior knowledge of the direction of motion.

Citation Information

Patent Citations

  • Non-local-total-variation image restoration method based on sparse overlapped group priori constraints

    CN107993208A

  • Multi-attention mechanism fused tunnel lining crack intelligent detection method and application

    CN120953217A