Pipe inner wall defect image recognition method and system based on deep learning

CN123015421APending Publication Date: 2026-10-30XIAN HUANHAI ROBOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611145485.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0005]本发明提供了基于深度学习的管道内壁缺陷图像识别方法及系统,可解决现有技术存在的微小缺陷漏检率高、复杂工况下误检率居高不下的问题,提升管道内壁缺陷识别的精度和鲁棒性

Benefits of technology

通过几何光学耦合感知初始化网络的并行卷积通路同时提取高频纹理响应与低频光照基底特征,实现空间频域解耦与多尺度感受野聚合;借助基于内蕴测地线度量场的空间注意力机制,从初始特征中自适应估计柱面投影畸变参数,无需额外相机标定即可完成逐位置特征校正。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015421A_ABST
    Figure CN123015421A_ABST
Patent Text Reader

Abstract

The application provides a pipeline inner wall defect image recognition method and system based on deep learning, relates to the technical field of computer vision and pipeline detection, and the method comprises the following steps: acquiring a pipeline inner wall cylindrical development video stream collected by a wide-angle cylindrical imaging module, and extracting a single-frame cylindrical development image from the video stream; inputting the single-frame cylindrical development image into a preset geometric-optical coupling perception initialization network to obtain an initial feature map; estimating a cylindrical projection distortion parameter matrix according to the initial feature map; and reconstructing a cylindrical intrinsic geodesic line metric field according to the cylindrical projection distortion parameter matrix. The application can solve the problems of high micro-defect missing detection rate and high false detection rate under complex working conditions in the prior art, and improve the precision and robustness of pipeline inner wall defect recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and pipeline inspection technology, and in particular to a method and system for image recognition of pipeline inner wall defects based on deep learning. Background Technology

[0002] As the core carrier of fluid transportation, the safe operation of pipelines is directly related to urban public safety and the stability of energy supply. During long-term service, pipelines are prone to internal wall defects such as cracks, corrosion, perforation, and deformation due to factors such as medium corrosion, geological subsidence, and construction disturbance. If these defects are not detected and repaired in time, they may lead to safety accidents.

[0003] Currently, vision-based pipeline internal wall defect detection technology has become the mainstream technology in the pipeline inspection field. However, existing pipeline internal wall defect identification technologies based on wide-angle cylindrical imaging generally suffer from the following drawbacks: the inherent geometric projection distortion of wide-angle cylindrical imaging forms a deep coupling effect with the non-uniformity of annular illumination inside the pipeline. This coupling effect makes geometric distortion and illumination interference intertwined and difficult to separate, severely limiting the accuracy and reliability of defect identification.

[0004] This defect causes nonlinear distortion of defect features in different areas of the pipeline's inner wall, especially in areas with significant changes in axial edge and radial curvature. The shape, size, and relative position of defects are severely distorted, leading to a higher rate of missed detections of small defects such as small cracks and pitting corrosion. Furthermore, geometric distortion amplifies the light and shadow differences caused by the annular illumination gradient, making reflective and shadowed areas of the pipe wall visually highly similar to actual defect features. This greatly increases the difficulty of distinguishing defects from the background, resulting in a persistently high false detection rate. These problems are particularly pronounced in complex conditions such as long-distance oil and gas pipelines and urban underground drainage networks, making it difficult to simultaneously meet the dual requirements of detection accuracy and robustness. Summary of the Invention

[0005] This invention provides a method and system for identifying pipeline inner wall defects based on deep learning, which can solve the problems of high missed detection rate of small defects and high false detection rate under complex working conditions in the existing technology, and improve the accuracy and robustness of pipeline inner wall defect identification.

[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, a deep learning-based method for identifying defects in the inner wall of a pipe, the method comprising: Step 1: Obtain the video stream of the cylindrical surface unfolded inside the pipe acquired by the wide-angle cylindrical imaging module, and extract a single frame of the cylindrical surface unfolded image from the video stream. Step 2: Input the single-frame cylindrical unfolded image into the preset geometric-optical coupled sensing initialization network to obtain the initial feature map; Step 3: Estimate the cylindrical projection distortion parameter matrix based on the initial feature map; reconstruct the intrinsic geodesic field of the cylinder based on the cylindrical projection distortion parameter matrix to obtain the intrinsic geodesic distance distribution; obtain the spatial attention weight map based on the intrinsic geodesic distance distribution; and perform position-by-position modulation on the initial feature map based on the spatial attention weight map to obtain the geometrically corrected feature map. Step 4: Estimate the ring illumination gradient field based on the geometric correction feature map; extract the channel energy response extrema based on the ring illumination gradient field to obtain the channel attention modulation vector; perform channel-by-channel gain allocation on the geometric correction feature map based on the channel attention modulation vector to obtain the geometric optics decoupling feature map. Step 5: Perform manifold topology conformal spectral alignment processing based on the geometric optics decoupling feature map to obtain multi-scale spectral basis functions; perform cross-scale feature remapping and topological constraint propagation based on the multi-scale spectral basis functions to obtain multi-scale aligned feature maps; Step 6: Based on the multi-scale aligned feature map, nonlinear threshold separation is performed using a defect classification and boundary regression mechanism to obtain the defect category probability vector; sub-pixel level coordinate regression is performed based on the defect category probability vector to obtain the defect category and defect location information of the inner wall of the pipeline.

[0007] Secondly, a deep learning-based image recognition system for pipe inner wall defects includes: The image acquisition and preprocessing module is used to acquire the original optical sensing signals of the wide-angle cylindrical imaging module, generate a video stream of the cylindrical surface unfolding inside the pipe, and extract a high-quality single-frame cylindrical surface unfolding image. The coupled-aware initialization module has a built-in geometric-optical coupled-aware initialization network, which is used to extract features from the input single-frame cylindrical unfolded image and output an initial feature map. The geometric correction module is used to estimate the cylindrical projection distortion parameter matrix, reconstruct the intrinsic geodesic field and generate a spatial attention weight map, and complete the geometric correction of the initial feature map. The illumination decoupling module is used to estimate the ring illumination gradient field, obtain the channel attention modulation vector, and realize the illumination interference decoupling of the geometric correction feature map; The manifold spectral alignment module is used to construct the manifold Laplacian operator and perform spectral decomposition, execute cross-scale feature remapping and topological constraint propagation, and obtain multi-scale aligned feature maps. The defect detection output module is used to perform defect classification and sub-pixel-level boundary regression based on multi-scale aligned feature maps to obtain the final defect category and location information.

[0008] Thirdly, a computing device includes: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the method.

[0009] Fourthly, a computer-readable storage medium storing a program that, when executed by a processor, implements the method.

[0010] The above-described solution of the present invention has at least the following beneficial effects: By using the parallel convolutional pathway of the geometric optics coupled sensing initialization network, high-frequency texture response and low-frequency illumination substrate features are extracted simultaneously, achieving spatial frequency domain decoupling and multi-scale receptive field aggregation. With the help of the spatial attention mechanism based on the intrinsic geodesic metric field, cylindrical projection distortion parameters are adaptively estimated from the initial features, and position-by-position feature correction can be completed without additional camera calibration.

[0011] By utilizing a channel attention mechanism modeled for the unique annular illumination distribution within pipelines, adaptive illumination gain allocation is achieved through channel energy response extremum calculation. Manifold topology conformal spectral alignment is employed to construct a feature node adjacency graph and perform spectral decomposition, preserving the essential topological structure of defects during cross-scale feature fusion. Finally, a probability gradient-guided sub-pixel-level coordinate regression mechanism is used for boundary contour fitting. This effectively breaks the deep coupling effect between geometric projection distortion and annular illumination inhomogeneity in wide-angle cylindrical imaging, solving the problem of high false negative rates for small defects such as small-sized cracks and pitting corrosion caused by nonlinear distortion of defect features in areas with large variations in axial and radial curvature of pipelines.

[0012] It overcomes the problem of high false detection rate caused by the difference in illumination gradient due to geometric distortion, making it difficult to distinguish between pipe wall reflections, shadows and real defects; thus effectively improving the overall accuracy and sub-pixel level positioning accuracy of pipeline inner wall defect identification, enhancing the robustness and environmental adaptability of the algorithm under complex working conditions, and effectively meeting the needs of automated, efficient and high-precision detection in various complex scenarios such as long-distance oil and gas pipelines and urban underground drainage networks. Attached Figure Description

[0013] Figure 1 This is a flowchart illustrating the deep learning-based method for identifying defects in the inner wall of a pipe, provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of a deep learning-based pipeline inner wall defect image recognition system provided in an embodiment of the present invention; Figure 3 This is a characteristic distortion curve diagram before geometric correction provided in the experimental example of the present invention; Figure 4This is a curve showing the feature distortion recovery effect after geometric correction provided in the experimental example of the present invention; Figure 5 This is a box plot of the channel response distribution before and after illumination decoupling provided in the experimental example of the present invention. Detailed Implementation

[0014] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0015] like Figure 1 As shown, embodiments of the present invention propose a method for identifying defects in the inner wall of pipes based on deep learning. The method includes the following steps: Step 1: Obtain the video stream of the cylindrical surface unfolded inside the pipe acquired by the wide-angle cylindrical imaging module, and extract a single frame of the cylindrical surface unfolded image from the video stream. Step 2: Input the single-frame cylindrical unfolded image into the preset geometric-optical coupled sensing initialization network to obtain the initial feature map; Step 3: Estimate the cylindrical projection distortion parameter matrix based on the initial feature map; reconstruct the intrinsic geodesic field of the cylinder based on the cylindrical projection distortion parameter matrix to obtain the intrinsic geodesic distance distribution; obtain the spatial attention weight map based on the intrinsic geodesic distance distribution; and perform position-by-position modulation on the initial feature map based on the spatial attention weight map to obtain the geometrically corrected feature map. Step 4: Estimate the ring illumination gradient field based on the geometric correction feature map; extract the channel energy response extrema based on the ring illumination gradient field to obtain the channel attention modulation vector; perform channel-by-channel gain allocation on the geometric correction feature map based on the channel attention modulation vector to obtain the geometric optics decoupling feature map. Step 5: Perform manifold topology conformal spectral alignment processing based on the geometric optics decoupling feature map to obtain multi-scale spectral basis functions; perform cross-scale feature remapping and topological constraint propagation based on the multi-scale spectral basis functions to obtain multi-scale aligned feature maps; Step 6: Based on the multi-scale aligned feature map, nonlinear threshold separation is performed using a defect classification and boundary regression mechanism to obtain the defect category probability vector; sub-pixel level coordinate regression is performed based on the defect category probability vector to obtain the defect category and defect location information of the inner wall of the pipeline.

[0016] In this embodiment of the invention, high-frequency texture and low-frequency illumination substrate features are extracted in parallel through a geometric optical coupling sensing initialization network, laying the foundation for the step-by-step decoupling of geometric distortion and illumination interference. By leveraging the spatial attention mechanism based on the intrinsic geodesic metric field, cylindrical projection distortion parameters are adaptively estimated from the features, and position-by-position feature correction can be completed without additional camera calibration, accurately restoring the true shape and size information of defects, and effectively reducing the missed detection rate of small defects such as small-sized cracks and point corrosion.

[0017] A channel attention mechanism based on a ring-shaped illumination gradient field is adopted to model the unique illumination distribution inside the pipe. Adaptive illumination gain allocation is achieved by calculating the extreme value of the channel energy response, which effectively suppresses light and dark interference such as pipe wall reflection and shadow, and reduces false detections.

[0018] By using manifold topology-preserving spectral alignment, a feature node adjacency graph is constructed and spectral decomposition is performed. This process preserves the essential topological structure of the defect during cross-scale feature fusion, improving the consistency of feature representation. Finally, a sub-pixel-level coordinate regression mechanism guided by probability gradients is used to achieve accurate fitting of the defect boundary, further improving recognition accuracy and positioning accuracy. This enhances the robustness and adaptability of the algorithm under complex conditions such as long-distance oil and gas pipelines and urban underground drainage networks.

[0019] In a preferred embodiment of the present invention, step 1 above may include: Step 1.1: Acquire the raw optical sensor signal sequence output in real time from the wide-angle cylindrical imaging module. Perform analog-to-digital conversion and frame rate normalization on the raw optical sensor signal sequence to obtain the video stream of the cylindrical surface unfolded on the inner wall of the pipe. Specifically, this includes: acquiring the raw optical sensor signal sequence output in real time from the wide-angle cylindrical imaging module, which is fixedly installed at the central axis position of the front end of the pipe inspection robot; the wide-angle cylindrical imaging module adopts an optical structure combining an ultra-wide-angle fisheye lens and a coaxial parabolic cylindrical reflector, and works with a global shutter CMOS image sensor to achieve 360-degree panoramic imaging of the inner wall of the pipe without blind spots. This is achieved through the 12-bit high-precision module built into the module. The digital-to-digital converter chip converts continuously changing analog light intensity signals into discrete digital grayscale signals within the range of 0 to 4095. Then, it resamples the original digital signals according to the standard frame rate of 25fps commonly used in the field of industrial pipeline inspection. When the actual acquisition frame rate of the module is higher than 25fps, a uniform frame extraction strategy with equal intervals is used to retain valid frames. When the actual acquisition frame rate is lower than 25fps, a black pixel edge filling strategy is used to supplement missing frames, unifying the temporal resolution and frame interval of the video stream. At the same time, a synchronization timestamp accurate to the microsecond level is added to each frame of data, and finally, a standardized and time-sequential video stream of the inner wall cylindrical surface of the pipeline is obtained.

[0020] Step 1.2: Based on the video stream unfolded from the inner wall of the pipe, extract the inter-frame time stamps and the kinematic attitude parameters of the detection robot; perform continuous motion jitter frequency domain filtering based on the inter-frame time stamps and kinematic attitude parameters to obtain a sequence of motion-stable candidate frames. Specifically, this includes: extracting the corresponding hardware synchronization time stamp information from the standard header field of each frame of the video stream unfolded from the inner wall of the pipe, and simultaneously acquiring the real-time kinematic attitude parameters output by the built-in sensors of the detection robot. The six-axis inertial measurement unit is used to detect the robot's three-dimensional motion acceleration and angular velocity changes, and the high-precision wheeled odometer is used to detect the robot's travel distance and linear velocity. The two are combined to obtain a complete kinematic attitude parameter sequence including travel linear velocity, pitch angle, yaw angle, and roll angle; use cubic spline interpolation to interpolate the discrete attitude parameter sequence to the precise time point corresponding to each frame image to achieve sub-millisecond precise alignment of the time stamps and attitude parameters on the time axis.

[0021] The specific process is as follows: The acquisition time points corresponding to the discrete attitude parameters are used as interpolation nodes. The attitude parameter values ​​corresponding to each node are recorded. Based on this, a smooth cubic polynomial curve is constructed between every two adjacent interpolation nodes. This curve is composed of a cubic function and is only valid within the time interval of the corresponding two nodes. This ensures that the values, rates of change, and accelerations of adjacent curves at the connection nodes remain continuous, effectively fitting the continuous change characteristics of attitude parameters during robot motion and avoiding abrupt errors caused by linear interpolation. In a preferred embodiment, the cubic function adopts the following expression:

[0022] in Indicates time The corresponding attitude parameter value, a b, c, d The coefficients of the cubic polynomial are uniquely determined by the node constraints. Correspondingly, the specific position of each frame on the time axis is determined by the hardware synchronization time stamp of each frame. The interval between two adjacent interpolation nodes to which the position belongs is located. The time value is substituted into the cubic polynomial curve corresponding to the interval for calculation, and the attitude parameter value corresponding to the precise time point can be obtained. Further, a windowed fast Fourier transform is performed on the aligned attitude parameter sequence to separate the low-frequency shaking component of the robot as a whole below 0.5Hz and the high-frequency vibration component of the mechanical structure above 10Hz. At the same time, a reasonable threshold for the attitude change amplitude is set, and the image frames corresponding to the above unstable frequency components and whose attitude change amplitude exceeds the preset threshold are removed from the original video stream. Finally, a candidate frame sequence with stable motion is obtained.

[0023] Step 1.3: Based on the motion-stationary candidate frame sequence, calculate the local illuminance variance and the confidence level of biofilm coverage on the pipe wall for each frame image; based on the local illuminance variance and coverage confidence level, remove water accumulation reflection frames and low signal-to-noise ratio frames to obtain a high-quality effective frame set. Specifically, this includes: performing uniform grid segmentation on each frame image in the motion-stationary candidate frame sequence, dividing the entire cylindrical unfolded image into 32×32 pixel non-overlapping square sub-image blocks, calculating the arithmetic mean and variance of the grayscale values ​​of all pixels in each sub-image block, using the average variance of all sub-blocks as the overall local illuminance variance of the frame image, and simultaneously converting the image from the RGB color space to the HSV color space, extracting the saturation distribution features of the S channel and the brightness distribution features of the V channel, and combining the four texture features of contrast, energy, entropy, and correlation obtained by the gray-level co-occurrence matrix to calculate the confidence level of biofilm coverage on the pipe wall for each frame image.

[0024] In a preferred embodiment, a gray-level co-occurrence matrix (GLCM) is first constructed: the image is converted into a single-channel grayscale image, and the grayscale values ​​are quantized to reduce computation. Based on this, four commonly used directions—horizontal, vertical, 45-degree, and 135-degree—are selected, and the frequency of two pixel grayscale values ​​appearing simultaneously in the image in the specified directions and separated by one pixel is statistically analyzed to form GLCMs in four directions. Finally, the average of the matrices in the four directions is taken to obtain the final GLCM. Based on the above GLCM, four texture features are calculated: contrast is calculated as the sum of the products of all elements in the GLCM and their distances to the diagonal of the matrix, reflecting the severity of local grayscale changes in the image; energy is calculated as the sum of the squares of all elements in the GLCM, reflecting the uniformity of the image texture; entropy is calculated by multiplying each element in the GLCM by its own logarithm and summing the results, reflecting the complexity of the image texture; and correlation is calculated as the ratio of the covariance of the elements in the GLCM to the product of the variances of the grayscale values ​​in the two directions, reflecting the linear correlation between pixel pairs in the image.

[0025] The confidence level of biofilm coverage on the pipe wall is calculated using a multi-feature weighted fusion model. This model is a linear feature fusion model specifically designed for quantitatively assessing the degree of biofilm coverage on the inner wall of pipes. It consists of a feature input unit, a feature normalization unit, a weighted fusion calculation unit, and a confidence output unit connected sequentially. The model is constructed through the following process: First, image samples of the inner wall of the pipe under different operating conditions are collected and manually labeled by professionals. Then, the aforementioned color and texture features are extracted from all samples. Correlation analysis is used to select the feature combinations with the highest discriminative power. The least squares method is used to optimize and solve the weight coefficients of each feature. Finally, the model parameters are validated and adjusted using an independent test set. The calculation formula is as follows:

[0026] In the formula Confidence level for biofilm coverage on the tube wall. The normalized mean saturation value. The normalized mean brightness value. To normalize texture energy, To normalize texture entropy, The preset feature weight coefficients satisfy the following conditions: The preset three-level threshold standard is an industrially common detection threshold obtained through statistical analysis of tens of thousands of pipe inner wall image samples of different materials, pipe diameters, and working conditions. These thresholds correspond to the judgment conditions for three types of unqualified images: The first level is the threshold for strong reflective water accumulation frames, with an upper limit of 1200 for the local illuminance variance. When the overall local illuminance variance of the image exceeds this threshold, it is judged as an unqualified frame with large-area water accumulation and reflection. The second level is the threshold for low signal-to-noise ratio dark frames, with a lower limit of 80 for the local illuminance variance. When the overall local illuminance variance of the image is lower than this threshold, it is judged as an unqualified frame with low signal-to-noise ratio due to insufficient illumination. The third level is the threshold for severely blurred frames, with an upper limit of 0.7 for the confidence level of biofilm coverage. When the confidence level of biofilm coverage exceeds this threshold, it is judged as a blurred unqualified frame due to severe biofilm coverage. Based on the above three-level threshold standard, the three types of unqualified image frames are sequentially removed, ultimately obtaining a high-quality set of valid frames that meet the requirements for defect recognition accuracy.

[0027] Step 1.4: Based on the set of high-quality effective frames, an adaptive temporal sliding window mechanism is used to select the reference image frame corresponding to the current processing cycle to obtain the single-frame cylindrical unfolded image. Specifically, this includes: dynamically adjusting the window size of the temporal sliding window according to the real-time travel speed of the detection robot; setting the window length according to a fixed ratio of 5 effective images per meter of pipe length to ensure that the physical length of the pipe covered by each sliding window is always kept at 0.2 meters; within the range of high-quality effective frames covered by each sliding window, the Laplacian gradient variance method is used to calculate the overall sharpness score of each frame image; simultaneously, the ORB feature matching algorithm is used to extract feature points of the current frame and the preceding and following adjacent frames and perform brute-force matching; the proportion of the number of successfully matched feature points to the total number of feature points is calculated as the feature similarity; the image with the highest sharpness score within the window is selected first, and then its feature similarity with the preceding and following adjacent frames is verified to be within a reasonable range of 0.6 to 0.9; if multiple frames meet the conditions, the image with the timestamp closest to the center of the window is selected; finally, a single-frame cylindrical unfolded image is obtained for subsequent feature extraction and defect identification.

[0028] Specifically, the calculation process of the Laplacian gradient variance method is as follows: The single-frame cylindrical image to be evaluated is converted into a single-channel grayscale image to eliminate the interference of color information on sharpness evaluation; based on this, a 3×3 isotropic standard Laplacian operator is used to perform pixel-by-pixel convolution operations on the grayscale image. This operator can effectively extract edge and texture information in the image and is very sensitive to the degree of image blur; correspondingly, for any pixel in the image, eight neighboring pixels are selected around that pixel to form a 3×3 pixel matrix, where the weight of the central pixel is 8, and the weights of the eight neighboring pixels are all -1; further... The process involves multiplying the grayscale value of each pixel by its corresponding weight, then summing all nine weighted grayscale values ​​to obtain the Laplacian response value of the center pixel. Simultaneously, the Laplacian response values ​​of all pixels in the image are calculated sequentially using the same method. The arithmetic mean of all Laplacian response values ​​for the entire image is then calculated to obtain the average Laplacian response. Further, the square of the difference between each pixel's Laplacian response value and the average is calculated. The sum of all squared values ​​is then divided by the total number of pixels to obtain the variance of the Laplacian response values. Finally, this variance is used as the overall image sharpness score; a higher score indicates a sharper image, while a lower score indicates a blurrier image.

[0029] In a preferred embodiment of the present invention, step 2 above may include: Step 2.1: Input the single-frame cylindrical unfolded image into a pre-set geometric-optical coupling sensing initialization network, perform tensor dimension alignment and pixel value normalization processing to obtain a standardized input tensor. Specifically, the pre-set geometric-optical coupling sensing initialization network is based on a lightweight ResNet18 architecture. It has been specifically optimized for the special characteristics of deep coupling between geometric distortion and illumination interference in wide-angle cylindrical imaging of the inner wall of the pipe. It retains the mature residual connection structure of the original architecture to effectively prevent the gradient vanishing problem during deep network training. At the same time, the first 7×7 single convolutional layer of the original architecture is replaced with two parallel convolutional paths with different receptive fields, which are specifically used to achieve spatial frequency domain decoupling and multi-scale feature extraction. This balances the computational efficiency and feature decoupling capability of the network and can adapt to the deployment requirements of the embedded computing platform of the pipe inspection robot.

[0030] The construction process of this network is as follows: First, a basic residual feature extraction backbone is built, and the first three residual modules of ResNet18 are completely retained as general feature extraction units. Each residual module contains two convolutional layers and one cross-layer residual connection, which can preserve the basic structural information of the input image while extracting deep semantic features. On this basis, two parallel pre-convolutional paths are designed. One path uses two consecutive 3×3 small-size convolutional kernel sequences, and the other path uses two consecutive 7×7 large-size convolutional kernel sequences. Each path's convolutional layer is connected to a batch normalization layer and a ReLU activation function. The features output by the two paths are concatenated in the channel dimension and then input into the subsequent residual modules. Finally, a 1×1 pointwise convolutional layer is set at the end of the network as a channel dimensionality reduction layer to compress the number of feature channels to a preset dimension and output the initial feature map.

[0031] The training process of this network is divided into two stages: the first stage is the general pre-training stage, which involves large-scale pre-training on the ImageNet general image dataset, enabling the network to learn general image feature representation capabilities such as edges, textures, and shapes, providing good parameter initialization for subsequent specialized task training; the second stage is the specialized fine-tuning stage, which constructs a specialized training dataset containing more than 50,000 images of the inner walls of pipes under different working conditions, covering pipes of different materials such as carbon steel, cast iron, concrete, and fiberglass, different pipe diameters from DN100 to DN1000, and different conditions such as dryness, water accumulation, biofilm coverage, and silt deposition. In the same operating environment, each image in the dataset was labeled with corresponding cylindrical projection distortion parameters and ring illumination distribution labels by professionals. An end-to-end supervised learning approach was used to fine-tune the network. The total loss function was the weighted sum of the geometric distortion parameter estimation error and the illumination distribution fitting error. The network parameters were iteratively updated using the Adam optimizer with an initial learning rate of 0.001. Every 10 epochs of training, the network was validated on an independent test set containing 5000 images until the loss function no longer decreased for 20 consecutive epochs and the feature decoupling effect met the preset requirements, thus completing the network pre-setting process.

[0032] After the single-frame cylindrical unfolded image is input into the preset geometric optical coupling perception initialization network, the spatial resolution and number of channels of the input image are automatically detected. If they do not match the preset 512×512×3 input tensor dimension of the network, the core region is preserved by center cropping for images that are too large, and the size is filled by zero padding at the edges for images that are too small. At the same time, the single-channel grayscale image is converted into a three-channel tensor format by channel copying to complete the tensor dimension alignment operation. On this basis, the pixel values ​​of the image are linearly mapped from the original integer range of 0 to 255 to the floating-point range of 0 to 1. Then, the pixel mean obtained by the special training dataset is subtracted and divided by the pixel standard deviation to achieve pixel value standardization and normalization. This eliminates the interference of the overall brightness and contrast differences of the image under different imaging conditions on the subsequent feature extraction process, and finally obtains a standardized input tensor with a uniform format and normalized numerical distribution.

[0033] Step 2.2: Based on the standardized input tensor, spatial frequency domain decoupling and multi-scale receptive field aggregation are performed through the pre-set geometric-optical coupling sensing initialization network's built-in parallel convolutional pathways to obtain high-frequency texture response feature sets and low-frequency illumination basis feature sets. Specifically, the obtained standardized input tensor is simultaneously input into two independent parallel convolutional pathways built into the pre-set geometric-optical coupling sensing initialization network, and feature extraction operations at different scales are performed respectively. Specifically, the first pathway uses two consecutive 3×3 small-size convolutional kernels for layer-by-layer feature extraction. After each convolutional operation, a batch feature standardization layer and a nonlinear transformation unit are connected. The small-size convolutional kernels have a small receptive field, which can accurately capture local information of drastically changing pixel values ​​in the image, corresponding to the edge contours and fine cracks of defects in the inner wall of the pipe. The first path extracts high-frequency detail features such as texture and dotted corrosion spots. Building upon this, the second path uses two consecutive 7×7 large-size convolutional kernels for layer-by-layer feature extraction. Each convolutional operation is followed by a batch feature normalization layer and a non-linear transformation unit. The large convolutional kernels have a large receptive field, effectively capturing global region information with gently changing pixel values, corresponding to low-frequency illumination base features such as the overall brightness distribution of the pipe's inner wall, ring-shaped illumination gradients, and large-area shadows. Both paths use the same convolution stride and edge-filling strategy to ensure completely consistent spatial resolution of the output feature maps, achieving precise decoupling of the spatial and frequency domains and effective aggregation of multi-scale receptive fields. Ultimately, this yields a high-frequency texture response feature set containing complete defect detail information and a low-frequency illumination base feature set containing global illumination distribution information, respectively.

[0034] Step 2.3: Based on the high-frequency texture response feature set and the low-frequency illumination base feature set, channel-level feature cross-fusion and spatial dimension reorganization are performed to obtain a primary coupled representation map. Specifically, this includes: stitching the obtained high-frequency texture response feature set and low-frequency illumination base feature set in the channel dimension, so that the number of channels of the two feature sets is doubled, while maintaining the spatial resolution of the feature map completely consistent with the input image, ensuring that the texture features and illumination features correspond one-to-one in spatial position; on this basis, a 1×1 pointwise convolution operation is used to perform channel transformation and information reorganization on the stitched feature map. This operation can realize information interaction and cross-fusion between different channels without changing the spatial size of the feature map, so that each output channel contains the correlation information of high-frequency texture features and low-frequency illumination features, and completely preserves the coupling relationship between geometric distortion and illumination interference; correspondingly, the feature map after channel transformation can simultaneously reflect the texture change and illumination change characteristics at different positions of the pipe inner wall, complete the spatial dimension reorganization operation, and finally obtain a primary coupled representation map that contains the coupling information of geometric distortion and illumination interference and can completely reflect the imaging characteristics of the pipe inner wall.

[0035] Step 2.4: Based on the primary coupling representation map, perform residual path superposition and channel dimensionality reduction projection to obtain the initial feature map. Specifically, this includes: sending the obtained primary coupling representation map into the residual fusion branch to complete shallow original feature reinforcement and feature information solidification processing; specifically, firstly, extract the original basic features without deep convolution transformation from the standardized input tensor at the front end of the network. This part of the features retains the original shallow basic information of the pipe wall image, such as the pipe wall outline, background color, and rough texture, which can compensate for the minor detail loss caused by deep convolution operations; on this basis, use a single-layer 1×1 lightweight convolution to perform dimensionality adaptation transformation on the original basic features. This convolution operation does not change the spatial size of the feature map, but only maps and aligns the feature channels, so that the transformed original basic features and the primary coupling representation map maintain completely consistent spatial resolution and channel dimension, ensuring that the two types of features strictly correspond one-to-one in spatial pixel positions.

[0036] Correspondingly, the original basic features after dimensional adaptation are superimposed with the primary coupling representation map at pixel-by-pixel positions. The weak defect details and pipe wall morphology information lost in the primary coupling representation map are reinforced by residual cross-layer fusion. The specific process is as follows: For each spatial position on the feature map, the feature amplitude of the original basic feature at that position is directly added to the feature amplitude of the primary coupling representation map at the same position. This allows the weak defect signals such as sub-pixel level crack traces and early stage of point corrosion contained in the original basic features, as well as the basic morphology information such as the metallic luster of the pipe wall and the rough texture of the concrete, to be directly superimposed on the coupling features extracted by deep convolution. This fusion method can effectively recover the low-amplitude weak feature signals that are smoothed out during deep convolution without destroying the coupling relationship between geometric distortion and illumination interference, while retaining the global coupling feature information already extracted in the primary coupling representation map.

[0037] Furthermore, channel-based dimensionality reduction projection processing is performed on the feature map obtained from residual fusion. A single 1×1 pointwise convolution is used to compress the channels, reducing the number of feature channels from 128 dimensions to 64 dimensions. During dimensionality reduction, based on the weight parameters learned during network training, highly sensitive feature channels that are highly correlated with cylindrical geometric distortion, annular illumination gradient, and pipe wall defect texture are adaptively selected and retained. Irrelevant noise, invalid background, and redundant low-contribution feature channels inside the pipe are filtered out, thus refining and purifying the feature information. At the same time, the channel dimensionality reduction operation can compress the feature data volume, reduce the computational load of the subsequent geometric correction module and illumination decoupling module, and adapt to the low computing power operating conditions of the embedded device of the pipe inspection robot. Finally, an initial feature map with uniform spatial distribution, strong feature representation ability, and simplified and standardized dimensions is generated. This initial feature map completely retains the coupling features of cylindrical projection distortion, annular illumination unevenness, and various defect micro-texture features, providing stable, reliable, and highly recognizable pre-feature data for subsequent distortion parameter estimation, spatial attention modulation, and illumination gradient decoupling.

[0038] In a preferred embodiment of the present invention, step 3 above may include: Step 3.1: Based on the initial feature map, extract the spatial gradient response component and the local curvature a priori; perform nonlinear parameter regression based on the spatial gradient response component and the local curvature a priori to obtain the cylindrical projection distortion parameter matrix. Specifically, this includes: first, performing global smoothing preprocessing on the initial feature map output from the previous step; then, using a fixed-size two-dimensional Gaussian smoothing kernel to perform global convolution noise reduction on the feature map, weakening the abnormal feature disturbances caused by small noise points and imaging stray light in the feature map, suppressing pixel-level abrupt feature fluctuations, smoothing the amplitude of local abnormal pixels, eliminating the interference of random noise points on feature extraction during pipeline imaging, and ensuring the stability and reliability of the subsequent gradient extraction process.

[0039] Based on this, the Sobel operator is used to collect the gray-level changes of features pixel by pixel along the horizontal and vertical extension directions of the feature map, accurately capturing the abrupt changes in brightness at the feature boundaries. The gray-level change amplitudes in the horizontal and vertical directions of the image are extracted separately, and the brightness differences between the pipe wall texture and the background under different orientations are quantified to obtain independent horizontal and vertical gradient components. The two types of gradient components are superimposed and merged in the spatial dimension to generate a spatial gradient response component that can intuitively represent the local deformation trend of the pipe wall. At the same time, relying on the inherent cylindrical geometric constraints of wide-angle cylindrical imaging, combined with the pipe The continuous curved surface morphology features of the inner wall are used to define a fixed range of neighborhood measurement area around a single pixel. Second-order differential curvature inference calculation is performed on the gradient change trend within the neighborhood of each pixel. This inference method can capture the rate of increase and decrease of gradient values ​​and the trend of change. Unlike the brightness and darkness recognition ability of ordinary first-order gradient, it can accurately determine the degree of bending deformation at the local position of the pixel, and meticulously divide the straight area, slightly curved area and curvature change area of ​​the pipe. It can accurately distinguish the inflection point, edge stretching area and center flat area of ​​the pipe wall surface, and finally extract the local curvature a priori that fits the real curved surface morphology of the pipe.

[0040] Furthermore, the spatial gradient response components and local curvature a priori information are merged by channel dimension to summarize the information of deformation gradient features and surface curvature features, and integrated to obtain a fusion feature tensor that combines texture deformation information and surface geometric information. This tensor is then fed into the nonlinear parameter regression submodule built into the network. The nonlinear parameter regression submodule is equipped with a two-layer serial fully connected mapping structure. Based on the massive cylindrical distortion mapping rules learned in the previous network training phase, it processes the input fusion features layer by layer. The first fully connected structure is responsible for dimensional compression and basic weight mapping of the high-dimensional fusion features, selecting effective features that are strongly correlated with distortion and eliminating redundant and invalid features. The compressed features are transformed by the built-in nonlinear mapping transformation unit. This transformation unit can break the simple linear relationship between features, simulate the complex nonlinear distortion rules of the pipe cylinder, and adapt to the fitting of irregular deformation features such as surface stretching, compression, and offset. The features after nonlinear transformation are fed into the second fully connected structure to complete secondary weight correction and feature depth fitting, further reducing the fitting deviation.

[0041] Finally, the linear activation mapping unit at the end of this submodule achieves a stable output of distortion parameters. This linear unit does not change the parameter mapping relationship, ensuring that the output distortion parameters are continuous and true physical values, avoiding parameter output distortion caused by nonlinear transformations. Correspondingly, the fitting operation continuously iterates and corrects key distortion parameters such as the lateral offset of the imaging center point, the radial stretching deformation coefficient, and the circumferential bending deformation coefficient. It continuously compares the difference between the fitted distortion distribution and the true imaging distortion distribution, and fine-tunes the internal weight parameters of the network to reduce fitting errors. All optimized distortion parameters are arranged in an orderly matrix format, and finally integrated to generate a cylindrical projection distortion parameter matrix with regular dimensions and accurate physical meaning. .

[0042] Step 3.2: Construct a local metric tensor in the feature space based on the cylindrical projection distortion parameter matrix; perform geodesic path integration on the local metric tensor to obtain the intrinsic geodesic distance distribution, specifically including: based on the generated cylindrical projection distortion parameter matrix... By combining the spatial geometric constraints of the pipeline cylinder, a second-order symmetric local metric tensor is constructed pixel by pixel in the high-dimensional feature space. This local metric tensor does not require an explicit matrix arrangement. Relying on the deformation coefficients built into the distortion parameter matrix, it quantifies the spatial deformation characteristics of each feature pixel position. It can accurately characterize the degree of axial expansion and contraction, circumferential compression, and coupling offset between the axial and circumferential directions at different positions under the action of cylinder projection, and intuitively describe the nonlinear geometric deformation law generated in the feature space.

[0043] Based on this, using the center of the feature map as the reference observation origin for the pipeline cylindrical surface, multiple continuous and smooth curved surface calculation paths are planned along the circumferential and axial extension directions of the pipeline to avoid the surface distortion problem caused by the straight-line calculation method. Furthermore, relying on the constructed local metric tensor, the spatial deformation deviation is accumulated point by point for each calculation path to complete the geodesic path integral calculation. This integral perfectly matches the actual curvature of the pipeline surface and calculates the shortest true distance within the curved surface space. The corresponding intrinsic geodesic distance integral expression is as follows:

[0044] in The intrinsic geodesic distance corresponding to a single pixel position represents the true surface distance of that pixel relative to the reference origin. The preset surface measurement path strictly conforms to the bending direction of the pipe column surface; It is a local metric tensor corresponding to any pixel position, used to correct the distance deviation caused by surface deformation; , It represents the differential changes in the horizontal and vertical coordinates of pixels along the path; The infinitesimal length of the surface path is given. After traversing all pixel positions in the feature map, the calculated distances of all pixels are summarized to generate an intrinsic geodesic distance distribution map that can intuitively reflect the differences in distance and deformation intensity of the distorted region.

[0045] Step 3.3: Based on the intrinsic geodesic distance distribution, perform nonlinear inversion of the distance field and global normalization mapping to obtain a spatial attention weight map. Specifically, this includes: performing nonlinear inversion of the distance field on the obtained intrinsic geodesic distance distribution map, mapping the correspondence between distance values ​​and attention weights in reverse, and amplifying the weight proportion of high-distortion regions. In a preferred embodiment, the nonlinear inversion transformation expression is as follows: ,in These are the original attention weights after the inversion process. A fixed adjustment coefficient, with a constant value of 0.25, is used to control the decay rate of the weight mapping. It is the reciprocal of the geodesic distance; The transformation logic assigns higher response weights to pixel positions that are farther from the reference origin, have more severe projection distortion, and have a greater degree of surface curvature, while assigning lower response weights to pixel positions that are closer to the reference origin, have weak imaging distortion, and have a higher degree of surface flatness, thereby highlighting the feature correction priority of the distortion area at the edge of the pipe.

[0046] Based on this, a global statistical analysis is performed on the inverted distance field to extract the maximum and minimum weight values ​​as the normalization boundary interval. Furthermore, a uniform scaling mapping of the global weights is performed based on the boundary interval, uniformly constraining the weight values ​​of all spatial locations within a reasonable range of 0 to 1. The normalization mapping expression is as follows: ,in The final spatial attention weights after normalization. 、 These are the maximum and minimum values ​​in the original weight map, respectively. This normalization operation can eliminate the overcorrection problem caused by extreme value weights; finally, a spatial attention weight map with continuous spatial distribution, clear weight hierarchy, and size completely consistent with the initial feature map is generated.

[0047] Step 3.4: Based on the spatial attention weight map, perform position-by-position feature amplitude modulation on the initial feature map to obtain a geometrically corrected feature map. Specifically, this includes: attaching the generated spatial attention weight map to the initial feature map to complete position-by-position adaptive amplitude modulation processing; specifically, using the pixel spatial position as the precise matching benchmark, completing the pixel-level alignment and overlap between the weight map and the initial feature map, ensuring that each spatial weight in the weight map can accurately correspond to the feature pixel at the same coordinate position in the initial feature map, achieving unbiased matching and binding; on this basis, traversing all spatial pixels within the feature map, performing pixel-by-pixel and channel-by-channel feature amplitude modulation operations for all feature channels at the same spatial position.

[0048] During modulation, the feature response intensity is adaptively adjusted based on the magnitude of the spatial attention weights. For high-distortion areas such as pipe wall edges, curved surface inflection points, and radial stretching zones, high weight coefficients are matched to enhance the feature amplitude, amplifying the texture representation of weak defects such as cracks and corrosion points, and highlighting easily lost defect details in distorted areas. For the low-distortion, smooth imaging area at the center of the pipe, low weight coefficients are matched to maintain the original feature amplitude, preserving the basic morphological features of the pipe wall and avoiding feature distortion caused by over-enhancement in normal areas. Furthermore, relying on the differentiated correction characteristics of weight modulation, false textures, edge artifacts, and deformation noises caused by cylindrical projection distortion coupling are eliminated, and poor imaging problems such as feature stretching, pixel compression, and positional offset caused by curved surface projection are corrected, unifying the spatial geometric scale of the entire feature map. After feature modulation processing is completed at all pixel positions, a geometrically corrected feature map with high surface morphology restoration, no defect feature distortion, thorough spatial deformation correction, and balanced global feature distribution is generated.

[0049] In a preferred embodiment of the present invention, step 4 above may include: Step 4.1: Extract multi-channel brightness distribution components based on the geometric correction feature map; perform annular spatial filtering and radial attenuation modeling based on the multi-channel brightness distribution components to obtain an annular illumination gradient field. Specifically, this includes: performing full-domain refined information decomposition on the geometric correction feature map after geometric distortion correction processing; retrieving feature channel data one by one according to the set channel traversal order; collecting the feature brightness amplitude within a single channel pixel by pixel; recording the brightness intensity differences at different spatial coordinate positions; sorting out the brightness fluctuation change pattern within each channel; summarizing the brightness distribution information of all feature channels; and integrating them to form a multi-channel brightness distribution component that can completely characterize the brightness difference across the entire pipe wall and retain local light and shadow fluctuation characteristics.

[0050] Considering that the inner wall of the pipe is a closed cylindrical space, the imaging light naturally exhibits a ring-shaped distribution. The unfolded image of the cylindrical surface retains the original ring-shaped light and shadow arrangement characteristics. Conventional square neighborhood sampling mode would capture irrelevant pixels with different curvatures and different ring directions, which would easily disrupt the continuity of the ring-shaped light and shadow on the pipe wall. Therefore, the conventional square neighborhood filtering method is abandoned, and a ring-shaped neighborhood sampling mode adapted to the cylindrical pipe wall structure is adopted. This sampling mode takes the current pixel to be corrected as the center and selects the surrounding ring-shaped pixels under the same ring curvature radius to form the sampling neighborhood, giving priority to sampling pixels with the same ring direction and the same curvature. Adjacent pixels with curvature are used to avoid interference from pixels across curvature. The physical imaging structure of the cylindrical surface of the pipe is conformed to, and the extracted brightness distribution components are subjected to annular spatial smoothing filtering. During the filtering process, the brightness amplitude of all compliant pixels within the annular neighborhood is statistically analyzed and the arithmetic mean is calculated. The neighborhood mean is used to replace the distorted pixels that are abnormally bright or abnormally dark. By correcting the pixel mean of the annular neighborhood, abnormal brightness disturbances caused by irregular illumination noise such as scattered reflective spots on the pipe wall, local point shadows, and imaging stray light noise are eliminated, ensuring that the illumination distribution substrate is continuous and smooth.

[0051] Based on this, and considering the hardware characteristics of the wide-angle cylindrical imaging module of this invention being centrally positioned, and following the physical illumination characteristics of the imaging light gradually attenuating from the center of the lens towards the periphery of the pipe wall, a radial attenuation law modeling is carried out. The modeling method uses the optical center of the imaging module as the attenuation reference origin, and divides the central direct light area, the intermediate transition grayscale area, and the dark shadow area at the edge of the pipe wall from near to far according to the radial distance of the pixels. The light energy retention values ​​at different distance positions are collected ring by ring along the radial direction. Combined with the light scattering loss caused by the air medium, trace water vapor, and suspended impurities inside the pipe, the degree of light loss at different radial distance positions is calculated step by step, the energy attenuation amplitude during the light propagation process is quantified, and the gradual change law of the bright area, the transition grayscale area, and the dark shadow area is accurately fitted. The composite light change law combining the circumferential surrounding brightness fluctuation and the radial brightness gradient attenuation is completely sorted out, and finally a ring illumination gradient field that can realistically reproduce the complex light and shadow arrangement inside the pipe and accurately depict the ring brightness and darkness levels is constructed.

[0052] Step 4.2: Calculate the energy response spectrum of each feature channel based on the annular illumination gradient field; perform extreme value localization and channel weight normalization based on the energy response spectrum to obtain the channel attention modulation vector. Specifically, this includes: relying on the constructed annular illumination gradient field, and combining the bright interval, transition interval, and shadow interval divided by the gradient field, sequentially traversing each independent feature channel in the geometric correction feature map, calculating the feature activation intensity of a single channel in different illumination partitions pixel by pixel, recording the response activity of the feature in the strong light reflection area, normal pipe wall area, and dark occlusion area, and summarizing the energy fluctuation changes of a single channel in the entire space. Based on the situation, the energy response information is classified and archived according to the illumination partition. In this way, the energy response spectrum of each feature channel with independent light-induced response characteristics is obtained. Combining the imaging manifestation characteristics of different types of defects such as cracks, corrosion, and defects in strong light, weak light, and shadow environments, the energy response spectrum of all channels is located using global numerical extremum positioning. The feature response nodes corresponding to the energy peak and energy valley are accurately captured. High-quality feature channels with high sensitivity to changes in light and shadow and strong defect characterization ability are selected. At the same time, redundant feature channels that are severely affected by illumination interference, can only reflect light and shadow noise, and have low defect recognition are identified.

[0053] Based on this, the statistical mean and variance of energy fluctuations of all feature channels are collected. Combined with the overall distribution of illumination across the entire field, the response values ​​of all channels are uniformly balanced. A global scaling constraint is used to standardize and adjust the channel weights globally. This constraint method first collects the maximum and minimum values ​​of all feature channel weights as scaling boundaries, uses the statistical mean as the scaling benchmark, compresses and converges abnormal weights with excessive fluctuations, and appropriately increases low-amplitude weights with weak responses. This uniformly constrains all channel weights within a fixed and reasonable range, weakens the feature bias caused by extreme weights, and avoids feature imbalance caused by excessive weights in a single channel. Finally, the adjusted normalized weight values ​​are arranged in an orderly combination according to the original arrangement of the feature channels, ultimately generating a channel attention modulation vector with regular dimensions, distinct weight differences, and the ability to achieve adaptive global illumination control.

[0054] Step 4.3: Construct a channel-level gain allocation matrix based on the channel attention modulation vector; perform channel-by-channel multiplication modulation on the geometric correction feature map based on the channel-level gain allocation matrix to obtain a geometric optical decoupling feature map. Specifically, this includes: referring to the differentiated channel control weight values ​​already labeled within the channel attention modulation vector, strictly matching the inherent channel arrangement sequence of the geometric correction feature map, orderly regularizing and expanding the dimensions of the weight parameters, and constructing a channel-level gain allocation matrix with regular rows and columns and a clear one-to-one mapping relationship. This ensures that each set of control parameters within the matrix can be accurately bound and matched with the feature channel corresponding to the encoded sequence number within the feature map, preventing channel weight mismatch from interfering with the control effect.

[0055] Using the constructed channel-level gain allocation matrix, fine-grained feature amplitude adjustment is performed on all feature channels within the geometric correction feature map. For high-sensitivity channels corresponding to areas of strong light reflection on the pipe wall, the feature response amplitude of abnormally protruding features within the channel is appropriately suppressed to inhibit false highlights caused by reflection. For low-response channels corresponding to dark shadow areas on the pipe sidewall, the feature activation amplitude of weak defects within the channel is reasonably increased to enhance the texture representation of defects under shadow coverage. For stable channels in the central normally illuminated area, the original feature amplitude is maintained to ensure that the basic morphology is not lost. The differentiated gain control method relies on the exclusive weight parameters built into the matrix and adopts an independent control logic of one gain per channel. It does not use a uniform fixed magnification to process all channels in batches. The gain amplitude is adaptively allocated according to the differences in the sensitivity of each channel to illumination. Attenuation gain is applied to noise interference channels, reinforcement gain is applied to defect effective channels, and constant gain is applied to steady-state basic channels, accurately adapting to the complex illumination distribution characteristics of the entire pipe area.

[0056] By using differentiated gain control, adaptive illumination gain allocation is achieved for all-dimensional feature channels. Redundant components such as residual annular illumination substrate, brightness gradient noise, and reflected shadow interference are gradually stripped away from the feature information. This effectively severs the coupling relationship between defect features and illumination noise, so that the feature data is no longer adversely affected by changes in brightness. The result is a geometrically and optically decoupled feature map that is free from both geometric distortion interference and annular illumination interference, has high purity, prominent defect texture, and can accurately highlight the body features of various defects on the inner wall of the pipe.

[0057] In a preferred embodiment of the present invention, step 5 above may include: Step 5.1: Based on the geometric-optical decoupling feature map, construct a spatial adjacency graph of feature nodes; based on the spatial adjacency graph of feature nodes, perform graph topology matrixing and differential operator discretization mapping to obtain the manifold Laplacian operator. Specifically, this includes: using the output geometric-optical decoupling feature map as the processing basis, to balance the continuity of the pipe wall surface and the discreteness of defect features, uniform sampling of feature nodes is completed in the two-dimensional space of the feature map using a fixed-interval grid sampling method. Each pixel with an independent feature response is defined as a basic feature node, and all feature nodes are synchronized. The system retains its own position coordinates and characteristic amplitude information; combined with the spatial constraints of the continuous curvature of the inner wall of the pipe, it presets a fixed spatial distance that conforms to the curvature change of the pipe wall as the adjacency determination threshold, prioritizes the connectivity of the curved surface, and determines the feature nodes with spatial spacing less than the determination threshold and with smooth curvature change and no obvious defect abrupt change as adjacent nodes. At the same time, it removes invalid adjacency relationships in the abrupt change area of ​​the curved surface, and accurately counts the correlation correspondence of all adjacent nodes. In this way, it constructs a spatial adjacency map of feature nodes that conforms to the curved surface morphology of the pipe wall, retains local feature associations, and removes erroneous adjacent edges.

[0058] Based on the completed graph construction, the disordered feature nodes are ordered and encoded, and unique encoding numbers are assigned according to the spatial arrangement order of the nodes. The adjacency connectivity and correlation between nodes are transformed into a digital matrix representation, completing the topological matrix transformation of the graph structure. Simultaneously, considering the characteristic that the pipe wall surface belongs to a continuous manifold space, the traditional planar differential solution logic is abandoned. The differential operation rules in the continuous space are adapted to the discrete feature nodes and rewritten point by point, completing the discretization mapping of the differential operator. Relying on the node correlation information stored in the topological matrix, combined with the discrete differential operator, a manifold Laplace operator adapted to the pipe surface manifold structure is constructed. In a preferred embodiment, the discrete calculation formula of the manifold Laplace operator is expressed as follows: ,in To adapt the Laplace operator for discrete manifolds of the pipe wall surface; This is the feature node degree matrix, used to store the number of adjacent connected nodes for each feature node in the pipe wall; The node adjacency correlation matrix is ​​used to record whether there are connected edges between nodes and the degree of correlation. This operator can accurately characterize the topological undulation changes at any position on the pipe wall surface and is specifically used to quantify the curvature differences, spatial distances and feature correlations between different feature nodes.

[0059] Step 5.2 involves performing spectral decomposition and conformal coordinate mapping based on the manifold Laplacian operator to obtain multi-scale spectral basis functions. Specifically, this includes: performing multi-dimensional layer-by-layer spectral decomposition on the constructed manifold Laplacian operator, decomposing the low-frequency topological components and high-frequency fluctuation components contained within the operator according to the differences in characteristic fluctuation frequencies. The low-frequency components are used to characterize the basic surface morphology of the pipe wall with large-scale, gradual changes, while the high-frequency components are used to characterize the local topological mutation information caused by minor defects such as cracks, pits, and local protrusions. Based on the layered characteristic components obtained from the spectral decomposition, and combined with the physical constraints that the pipe cylinder surface is non-stretchable, non-deformable, and has constant curvature, conformal coordinate mapping is performed. Under the premise of strictly not changing the real surface topology of the pipe wall and not distorting the original geometric shape of the defects, the coordinate distortion caused by surface curvature is eliminated, and the surface topological information of the high-dimensional feature space is mapped to a regularized planar coordinate system.

[0060] By using a hierarchical energy sorting method, the fundamental mapping functions at different frequency levels are selected based on the proportion of characteristic energy. In a preferred embodiment, the multi-scale spectral basis functions are defined using hierarchical orthogonal mapping expressions:

[0061] in For the first Scale level, first Multiscale spectral basis functions for sorting sequence numbers. For discrete feature nodes on a curved surface, For the first A scale-specific scale decay coefficient is used to adjust the retention weights of features at different levels. The first Laplace operator of a manifold The inherent values ​​of the first-order characteristic are used to distinguish the frequency response levels. To further clarify the physical operation logic of the exponential decay term and to fit the computational characteristics of discrete nodes on the pipe surface, the exponential decay term is expanded using the second-order Pad approximation with a lightweight approach. The approximate calculation formula is as follows: ; The factorial of the second-order natural number serves as the normalized denominator for the second-order correction term, constraining the amplification of the quadratic term and preventing excessive amplification of high-order values ​​from causing distortion of feature values. This expansion truncates lower-order operational terms, adapting to lightweight operations in embedded devices while ensuring computational accuracy. It also exponentially suppresses high-intrinsic-value high-frequency noise features while preserving effective pipe wall morphology features with low intrinsic values. The orthogonal basis mapping function uses a normalized orthogonal calculation formula:

[0062] In the formula The normalized orthogonal basis mapping function, For the unnormalized original basis mapping components, fractional operations are used to implement the orthogonal normalization constraint of the basis vectors; to adapt to the summation logic of discrete feature nodes, the normalized denominator is further restricted, and the summation interval is set to the sampling nodes of the entire pipe wall: In the formula The set of all discrete feature nodes of the pipe wall surface is defined. This constraint method can ensure that the normalized statistical range covers the entire feature map, eliminate the basis offset problem caused by local statistics, and ensure that there is no feature redundancy superposition and no information interference between spectral basis functions of different scales. This set of deepening expressions can realize hierarchical orthogonal storage of coarse and fine features, accurately distinguish between low-frequency morphology and high-frequency defects of the pipe wall, and finally generate multi-scale spectral basis functions that can completely cover coarse-scale surface morphology to fine-scale defect texture, with positive interaction of layers without interference.

[0063] Step 5.3: Obtain the feature projection weight matrix based on multi-scale spectral basis functions; perform scale-space interpolation on the geometric-optical decoupling feature map according to the feature projection weight matrix to obtain a cross-scale remapping feature tensor. Specifically, this includes: summarizing all levels and different frequencies of multi-scale spectral basis functions; combining the sensitivity differences of various spectral basis functions to characterizing different curvature features and different sizes of defects such as smooth pipe wall surfaces, microcracks, point corrosion, and local depressions; and completing the adaptive allocation of weight coefficients based on the proportion of spectral energy, assigning higher weights to high-spectral basis functions with high defect sensitivity and assigning stable weights to low-spectral basis functions characterizing the basic morphology; integrating all weight coefficients strictly according to the scale hierarchy order according to the fixed matrix arrangement rules to generate a feature projection weight matrix with dimension matching, clear hierarchy, and differentiated weight allocation; and performing surface adaptive scale-space interpolation processing on the geometric-optical decoupling feature map based on the generated feature projection weight matrix, abandoning the traditional fixed magnification and globally consistent interpolation method, and adjusting the interpolation density and number of interpolation sampling points according to the curvature fluctuation degree of different regions of the pipe wall.

[0064] In the defect-dense areas with abrupt curvature changes and complex textures, a high-density interpolation method is used to encrypt feature sampling points and preserve the information of subtle defect textures and edge abrupt changes to the maximum extent. In the normal pipe wall areas with gentle curvature and no defect interference, a low-density interpolation method is used to simplify repetitive features and compress redundant feature data. Through differential interpolation, cross-level fusion mapping of multi-scale feature information is completed, and features of different scales and frequencies are spatially aligned and superimposed to finally integrate and generate a cross-scale remapping feature tensor that combines macroscopic surface morphology information, mesoscale pipe wall structure information, and microscopic defect texture information.

[0065] Step 5.4: Calculate the topological curvature deviation field between adjacent scale levels based on the cross-scale remapping feature tensor; perform elastic potential energy equilibrium evolution and damped smooth propagation iteration based on the topological curvature deviation field to obtain a topologically aligned intermediate state feature map. Specifically, this includes: performing precise point-by-point comparison of feature data at three preset scale levels (coarse, medium, and fine) within the cross-scale remapping feature tensor; extracting the spatial pixel position offset and surface curvature amplitude difference between features at adjacent scales; and quantifying the degree of feature misalignment at the same physical pipe wall position at different scales. In a preferred embodiment, the surface curvature representation is constructed based on second-order differential logic of the surface, and the calculation formula is... in For the first Pixel position at scale level The corresponding surface curvature representation quantity, This is the second-order differential operator for surfaces, used to solve for the local curvature of a surface. The spectral basis mapping feature quantity corresponds to the current scale; to adapt to the engineering calculation method of discrete pixels in the image, the second-order differential operator is discretized and further expanded:

[0066] In the formula The horizontal and vertical pixel coordinates of the feature map are respectively. The second-order partial derivatives after splitting can solve the axial curvature and circumferential curvature of the pipe wall respectively, accurately adapting to the geometric characteristics of bidirectional bending of the pipe surface. The symbol is for partial differentials; the expression for calculating the topological curvature deviation field is as follows:

[0067] in For the first Pixel position at scale level The corresponding topological curvature deviation field amplitude, The curvature of the surface is represented by the symbol of the next adjacent scale level. This involves second-order norm operations, used to calculate the absolute deviation of curvature between two points; to make the deviation operation logic more intuitive and clear, the second-order norm is further expanded in the real number field: This unfolding method eliminates complex number operation logic, retaining only real number curvature deviation, which aligns with the physical characteristic that the curvature of the pipe is a non-negative real number. It integrates global pixel deviation information to generate a topological curvature deviation field that can intuitively reflect the degree of feature misalignment, the magnitude of deformation offset, and the difference in curvature matching. Based on the topological curvature deviation field, it performs elastic potential energy equilibrium evolution processing, simulating the physical correction logic of elastic deformation of a real cylindrical surface. It identifies the feature stretching area as the elastic tension area, the feature compression area as the elastic compression area, and the pixel misalignment area as the elastic offset area. For the stretching distortion area, it reduces the pixel spacing through elastic retraction force to offset the feature diffusion problem caused by excessive stretching. For the compression distortion area, it reasonably widens the pixel spacing through elastic expansion force to alleviate the feature stacking blur phenomenon. For the misalignment offset area, it relies on the elastic constraint of the surface to guide the pixels back to their real physical positions, continuously balancing the spatial distribution potential energy between features of different scales, so that the global feature potential energy tends to be uniform.

[0068] Based on this, a damped smoothing propagation iterative mechanism is introduced. This mechanism is specifically designed to suppress feature oscillations, edge spikes, and local artifacts that are easily generated during iterative correction. The mechanism includes a damping attenuation coefficient and a neighborhood smoothing propagation unit. In a single iteration, the feature spatial position is first corrected based on the topological deviation, and then smoothing and noise reduction are completed by combining the mean of the neighborhood pixel deviation. The damping coefficient constrains the single correction amplitude to avoid repeated feature oscillations caused by excessive correction step size. The entire process of deviation calculation, elastic correction, and damping smoothing is executed cyclically according to a fixed number of iterations to gradually weaken the residual small topological disturbances and continuously suppress defective edge artifacts and pixel noise until the average value of the global curvature deviation is lower than the set threshold and the deviation fluctuation no longer changes significantly. The iteration is then determined to have terminated, and finally, a topologically aligned intermediate feature map with effectively reduced topological deformation error, high multi-scale feature alignment, and clean edge texture without artifacts is generated.

[0069] Step 5.5: Based on the topology-aligned intermediate feature map, perform inverse spectral transformation and feature space recombination to obtain a multi-scale aligned feature map. Specifically, this includes: for the topology-aligned intermediate feature map after iterative convergence, according to the multi-scale spectral basis function weight parameters retained in Step 5.2, reversely call the pre-spectral basis function of hierarchical matching to complete the high-precision inverse spectral transformation. This inverse transformation process reversely cancels the spatial regularization effect brought by the previous conformal coordinate mapping, decomposes the feature binding relationship under the regularized planar coordinate system layer by layer, and accurately remaps the feature information after topology correction and scale alignment back to the original curved surface feature space of the pipe, effectively restoring the natural cylindrical curved topology of the pipe wall and eliminating the spatial incongruity caused by artificial coordinate transformation. After the inverse spectral transformation is completed, the full-domain features are hierarchically divided based on the frequency energy threshold, accurately separating the low-frequency morphological features representing the macroscopic structure of the pipe wall and the high-frequency defect features representing small damage. The two types of features are orderly recombined and spliced ​​according to the hierarchical arrangement order from coarse scale to fine scale, ensuring that the multi-scale features at the same physical location are superimposed layer by layer and do not misalign with each other.

[0070] During the feature recombination process, homogeneous feature information at different scale levels is compared, and redundant information such as texture overlap and feature repetition generated in the multi-scale fusion stage is identified and eliminated. At the same time, weak topological jitter noise and slight noise at the surface edges left over from the iterative smoothing process are specifically screened out to further purify the feature semantics and optimize the feature spatial distribution. After completing all feature screening and recombination optimization processes, scale fusion deviations are smoothed out and topological alignment effects are solidified. Finally, a multi-scale aligned feature map with accurate spatial topological alignment, sufficient multi-scale feature fusion, clear defect hierarchy division, and realistic pipe wall morphology is generated, providing high-precision, high-purity, and high-identifiability standardized feature input for subsequent defect detection, defect classification, and defect quantitative assessment.

[0071] In a preferred embodiment of the present invention, step 6 above may include: Step 6.1: Based on the multi-scale aligned feature map, feature channels are reorganized and semantic space is projected through the defect classification and boundary regression mechanism to obtain the feature response map to be separated. Specifically, the multi-scale aligned feature map is used as the input basis for the defect identification stage. The built-in defect classification and boundary regression mechanism is started. This mechanism adopts a dual-branch parallel linkage structure of classification and regression. The two branches share the pre-channel screening module, do not interfere with each other and are mutually constrained. The classification branch is specifically used to extract the semantic features of the defect and determine the specific category of the defect. The boundary regression branch is specifically used to capture the abrupt change information of the curved edge and lock the position of the defect contour boundary. The synergistic effect of the two branches can simultaneously take into account the accuracy of defect classification and the precision of boundary positioning, and is suitable for the detection conditions of irregular shape of pipeline inner wall defects, blurred boundaries and strong background interference.

[0072] Specifically, during the mechanism's operation, based on the sensitivity of different feature channels to pipe wall defect textures, curved surface edges, and structural contour inflection points, all feature channels are prioritized and selectively reorganized. The channel ranking process uses the variance of the channel feature response as the evaluation criterion. Channels with drastic variance fluctuations and high sensitivity to texture abrupt changes are identified as high-quality, effective channels, while channels with stable amplitudes and no significant feature fluctuations are identified as invalid, redundant channels. Invalid, redundant channels that offer no benefit in defect identification and only provide feedback on the uniform background of the pipe wall are specifically eliminated. Defect-specific feature channels that are highly sensitive to crack edges, corrosion pits, and local defects, as well as contour-sensitive channels with significant boundary abrupt changes, are retained to construct a streamlined and efficient subset of defect-specific features. Based on this... The defect-specific feature subset, after being reorganized and screened, is fed into the semantic projection fully connected layer. The semantic space projection process is divided into three progressive stages: dimensionality compression, feature decoupling, and spatial binding. Specifically, high-dimensional feature dimensionality compression is achieved through the weight matrix, eliminating redundant and extraneous information in the channels. Furthermore, relying on the semantic mapping weights and bias parameters solidified during the training stage, the category semantic components and position semantic components within the feature are separated to achieve accurate decoupling of the two types of information. Correspondingly, the fusion of features at the same location is completed, and the defect category features and boundary position features under the same physical location of the pipe wall are spatially bound and fused. This weakens the semantic interference caused by the background texture, strengthens the feature representation ability of the defect itself, and finally generates a feature response map to be separated that has both high category discrimination and high edge positioning accuracy.

[0073] Step 6.2: Based on the feature response map to be separated, perform nonlinear threshold segmentation and category confidence mapping to obtain the defect category probability vector. Specifically, this includes: based on the feature response map to be separated, traversing the feature response amplitudes of all pixels within the feature map, and adopting an adaptive nonlinear threshold segmentation method adapted to the uneven brightness characteristics of the pipe wall. This method differs from fixed threshold segmentation, avoiding brightness deviation caused by pipe ring illumination. It dynamically adjusts the judgment criteria based on local brightness conditions, suppressing over-segmentation of bright areas and preventing under-segmentation of dark areas. Specifically, during the threshold solution stage, pixel feature response amplitudes are collected across the entire domain, and the average amplitude and fluctuation variance of the entire domain feature are statistically analyzed to characterize the brightness level and texture disturbance degree of the pipe wall substrate, respectively. Based on this, the segmentation threshold is dynamically solved in conjunction with the background energy distribution. In a preferred embodiment, the adaptive segmentation threshold calculation formula is: In the formula The adaptive segmentation threshold is... The mean value of the feature magnitude of all pixels in the domain; This is the pipe wall illumination correction factor, used to adapt to the interference of reflection and shadow on the curved surface of the pipe. The preferred value range is 1.20 to 1.65, and the typical value in engineering is 1.40. The standard deviation of the global feature amplitude is used to characterize the strength of texture fluctuations. Correspondingly, the threshold is automatically raised in areas with brighter lighting to suppress reflective false defects, while the threshold is appropriately lowered in areas with darker lighting to capture weak defect textures. Furthermore, areas with amplitudes higher than the dynamic threshold are identified as suspected defect areas, while those with amplitudes lower than the dynamic threshold are identified as normal pipe wall areas, thus completing the global binarization division.

[0074] Based on this, confidence mapping is performed on independent suspected defect regions using a pre-defined defect classification mapping logic. This logic relies on trained and fixed weights to complete feature conversion, first aggregating texture, edge, and curvature features of a single region, and then projecting them onto the category determination space to calculate the confidence level of defect attribution. In a preferred embodiment, the defect category confidence calculation formula is as follows: In the formula The confidence score for the k-th type of defect; The specific feature weights for cracks, corrosion, and defects are respectively assigned. The sum of the normalization constraints for the three types of weights is 1. The preferred value ranges are 0.35 to 0.50, 0.25 to 0.40, and 0.15 to 0.30, respectively, while the typical engineering values ​​are 0.42, 0.33, and 0.25, respectively. For the linear edge characteristics of the crack, For the rough texture characteristic quantity of corrosion, The feature quantity is the curvature indentation of the defect. Correspondingly, the proportion of linear edges is weighted on the crack category side, the gray-level dispersion is weighted on the corrosion category side, and the curvature abrupt change amplitude is weighted on the defect category side. Each type of defect generates a confidence score independently. The higher the score, the greater the probability of defect attribution. Finally, the confidence scores of each type are encoded and arranged to generate a defect category probability vector with dimension matching and normalization constraints.

[0075] Step 6.3: Based on the defect category probability vector, perform probability gradient guidance and spatial coordinate weight allocation to obtain the sub-pixel regression prior field. Specifically, this includes: extracting the confidence values ​​of various defects stored within the solved defect category probability vector; selecting the defect type corresponding to the maximum probability as the target category for the current suspected area; constructing a global gradient guidance signal based on the spatial change gradient of the probability of this category; using the strength of the gradient signal as the basis for weight allocation; and performing refined spatial coordinate weight allocation processing on all pixels within the suspected defect area. Pixels closer to the true edge contour of the defect are given higher constraint weights, while pixels far from the defect boundary and located in the flat area at the center of the defect are given relatively lower constraint weights. In a preferred embodiment, the spatial coordinate weight allocation uses a calculation formula... ; Represents the regression weight of a single pixel. Represents the independently sampled pixel points within the feature map. To define a single suspected defect area, It is the maximum category confidence probability within the current defect area, with an effective judgment range of 0.60 to 1.00, and a typical engineering screening threshold of 0.75; The regression decay coefficient, which is used to regulate the rate of weight decay, is preferably in the range of 0.80 to 1.50, and a typical value in engineering is 1.10. Represents the geometric Euclidean distance from the current pixel location to the boundary of the defect region; The exponential function is used to achieve a smooth decay of weights with boundary distance. This formula is used to complete the quantization and arrangement of pixel weights across the entire domain, and finally obtain a sub-pixel regression prior field with boundary constraint capability and adaptability to sub-pixel positioning requirements.

[0076] Step 6.4: Based on the sub-pixel regression prior field, perform continuous coordinate interpolation calculation and boundary contour fitting to obtain the defect category and defect location information of the inner wall of the pipe. Specifically, this includes: based on the constructed sub-pixel regression prior field, relying on the pixel weight distribution relationship stored within the prior field, performing continuous coordinate interpolation calculation on the discrete integer pixel coordinates in the suspected defect area. A bicubic interpolation logic adapted to surface edge fitting is used to generate continuous sub-pixel coordinate points between adjacent integer pixels. Regression weights are introduced during the interpolation process to complete weighted correction. Boundary pixels with higher weight values ​​contribute more to the coordinates of the sub-pixel points. In a preferred embodiment, the continuous coordinate interpolation calculation uses the following formula: ; in This represents the sub-pixel precise coordinate vector obtained from the solution. This is the set of neighboring sampled pixels surrounding the current pixel. In engineering, the eight-neighbor sampling mode is preferred. These are independently sampled pixels within the neighborhood. This represents the bicubic interpolation kernel function, with the interpolation smoothing coefficient ranging from 0.40 to 0.70, and a typical value of 0.55. The original integer coordinate vector of the neighboring pixels is used. After solving the sub-pixel coordinate encryption, all sub-pixel points are collected to construct the defect boundary point set. The least squares fitting algorithm is used to perform smooth boundary contour fitting on the point set to remove the contour burrs caused by discrete noise points. The fitting results in a continuous, smooth, and closed boundary curve that fits the true shape of the defect. Finally, the defect category label obtained in step 6.2 and the fitted boundary coordinate information are combined to output accurate and reliable pipeline inner wall defect category and defect location information.

[0077] like Figure 2 As shown, embodiments of the present invention also provide a deep learning-based image recognition system for defects in the inner wall of pipes, comprising: The image acquisition and preprocessing module is used to acquire the original optical sensing signals of the wide-angle cylindrical imaging module, generate a video stream of the cylindrical surface unfolding inside the pipe, and extract a high-quality single-frame cylindrical surface unfolding image. The coupled-aware initialization module has a built-in geometric-optical coupled-aware initialization network, which is used to extract features from the input single-frame cylindrical unfolded image and output an initial feature map. The geometric correction module is used to estimate the cylindrical projection distortion parameter matrix, reconstruct the intrinsic geodesic field and generate a spatial attention weight map, and complete the geometric correction of the initial feature map. The illumination decoupling module is used to estimate the ring illumination gradient field, obtain the channel attention modulation vector, and realize the illumination interference decoupling of the geometric correction feature map; The manifold spectral alignment module is used to construct the manifold Laplacian operator and perform spectral decomposition, execute cross-scale feature remapping and topological constraint propagation, and obtain multi-scale aligned feature maps. The defect detection output module is used to perform defect classification and sub-pixel-level boundary regression based on multi-scale aligned feature maps to obtain the final defect category and location information.

[0078] It should be noted that this system is a system corresponding to the above method. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0079] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0080] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0081] Experimental example: This experiment selected a DN600 concrete drainage pipe in an underground city as the test scenario. The pipe was 120m long and contained 47 typical defects, including cracks, pitting corrosion, and localized defects. Among these, there were 12 micro-cracks with a width ≤0.2mm and 15 pitting corrosions with a diameter ≤2mm. The experiment used a pipe inspection robot equipped with a wide-angle cylindrical imaging module to collect data. The embedded computing platform was configured as an NVIDIA Jetson Xavier NX. The overall process corresponds to the full-step design in the application document. The data and results at each stage are as follows: Step 1: Extraction of high-quality single-frame cylindrical unfolded image The experiment first acquired the raw optical sensing signal output by the wide-angle cylindrical imaging module. After analog-to-digital conversion, a standardized cylindrical unfolding video stream of 25fps was obtained, totaling 7200 frames of raw data. 1820 frames of blurred frames caused by robot movement jitter were removed by frequency domain filtering for motion jitter. Then, 410 frames of water reflection and 390 frames of dark frames with low signal-to-noise ratio were removed by screening based on local illumination variance and biofilm coverage confidence. Finally, 4580 high-quality effective frames were obtained.

[0082] An adaptive temporal sliding window mechanism (5 frames selected per 0.2m pipe) was used to select a baseline frame. The quality evaluation results of the 5 candidate images within the sliding window showed that: Frame 1 had a Laplacian sharpness score of 0.62 and a feature similarity of 0.65; Frame 2 had a sharpness of 0.68 and a similarity of 0.69; Frame 3 had a sharpness of 0.85 and a similarity of 0.72; Frame 4 had a sharpness of 0.59 and a similarity of 0.58; and Frame 5 had a sharpness of 0.71 and a similarity of 0.67. Among them, only Frame 3 had a feature similarity in the acceptable range of 0.6 to 0.9 and the highest sharpness, so it was selected as the baseline single-frame cylindrical unfolded image for the current period. The other frames were removed due to insufficient sharpness or similarity deviation from the range.

[0083] Step 2, Geometric Optical Coupled Sensing Initialization The 512×512×3 normalized input tensor is fed into the improved lightweight ResNet18 network. High-frequency texture features are extracted through the 3×3 small convolutional kernel path and low-frequency illumination basis features are extracted through the 7×7 large convolutional kernel path. After channel cross-fusion and residual superposition, a 64-dimensional initial feature map is output.

[0084] The feature response quantization results show that the 3×3 small convolutional kernel path has an activation intensity of 1.82 for the 0.15mm wide microcrack texture on the pipe wall surface, which is significantly higher than the 0.31 in the background area. The 7×7 large convolutional kernel path completely captures the annular illumination attenuation gradient from the center to the edge of the pipe wall. The average illumination response in the central region is 156, while it drops to 47 in the edge region. The two are not separated in advance and retain the coupling relationship, which provides a basis for subsequent step-by-step decoupling.

[0085] Step 3, Geometric correction of cylindrical projection distortion Based on the initial feature map, a 3×3 cylindrical projection distortion parameter matrix is ​​estimated. After reconstructing the intrinsic geodesic metric field, a spatial attention weight map is generated. The initial feature map is then modulated position by position to obtain a geometrically corrected feature map.

[0086] like Figure 3 and Figure 4 Together, they demonstrate the contrast between feature distortion before and after geometric correction, with the horizontal axis representing spatial location and the vertical axis representing feature response intensity; among which... Figure 3The curve before correction exhibits obvious nonlinear stretching characteristics. In the axial edge region of the pipe, the crack features that should have been evenly distributed are elongated by the cylindrical projection, and the waveform envelope is widened by about 40%, resulting in an artificially increased measured width of 0.25 mm. The position of the feature peak is shifted, and the distortion rate of the defect features in the distorted region is as high as 37%. Figure 4 The corrected curve has a compact and regular waveform. Spatial attention weights were used to specifically compress and modulate the gain of the high-distortion edge region (edge ​​gain coefficient of about 1.8), which restored the originally elongated waveform to its original period and amplitude. The crack texture returned to the true geometric size of 0.18mm, and the distortion rate of the defect features in the distorted region was reduced to 4%. According to actual measurements, the absolute value of the defect size error of 100 edge regions after correction was controlled within 0.03mm, which verified the accuracy of geometric correction.

[0087] Step 4, Ring Illumination Interference Decoupling Based on the estimation of the ring illumination gradient field using the geometric correction feature map, the channel attention modulation vector is calculated, and then the gain is assigned to each channel of the feature map to output the geometric optical decoupling feature map.

[0088] like Figure 5 The distribution of channel response before and after illumination decoupling is shown. Before decoupling (box plot on the left), the channel response is severely polarized due to the influence of ring illumination: the box position is relatively high, the upper whisker extends to about 250, while the lower whisker is pressed down to close to 0. The overall distribution span is extremely large, and the response difference between the strong light area and the shadow area is obvious. The standard deviation of characteristic fluctuation caused by illumination is as high as 65.

[0089] After decoupling (box plot on the right), the distribution pattern changes fundamentally. The boxes are compressed and concentrated in a narrow range of 40 to 85, and the range of the upper and lower whiskers is significantly narrowed, eliminating extreme outliers. This is thanks to the precise effect of the channel attention modulation vector: an attenuation gain of 0.4 to 0.7 is applied to the high-response strong light channel, and an enhancement gain of 1.3 to 1.6 is applied to the low-response shadow channel. Twenty defect samples from different lighting zones were randomly selected for feature stability testing. After decoupling, the coefficient of variation of the defect feature amplitude decreased from 0.47 to 0.12, effectively eliminating the interference of reflection and shadow on defect identification.

[0090] Step 5, manifold topology conformal spectrum alignment After constructing the spatial adjacency graph of feature nodes, the manifold Laplacian operator is solved. Through spectral decomposition, multi-scale spectral basis functions covering coarse, medium, and fine scales are obtained. Cross-scale feature remapping and topological constraint propagation are completed, and multi-scale aligned feature maps are output.

[0091] Multi-scale fusion verification shows that the coarse-scale spectral basis function completely preserves the overall surface morphology of the pipeline, the meso-scale spectral basis function clearly presents the pipe wall structure texture, and the fine-scale spectral basis function accurately captures the sub-pixel-level edge mutations of point corrosion. After the three are fused through elastic potential energy equilibrium evolution, the topological integrity of the defect area is improved from 76% in the single-scale process to 98%. The boundary integrity of 15 point corrosion samples was manually verified, and the defect edge breakage rate after fusion was reduced from 24% in the single-scale process to 1%.

[0092] Step 6, Defect Classification and Subpixel-Level Localization Defect classification and boundary regression were performed based on multi-scale aligned feature maps, and the defect category and location information were finally output. In this experiment, a total of 46 defects were detected, and only one 0.18 mm crack that was partially covered by biofilm was not detected. There were no false alarms.

[0093] Defect location accuracy tests showed that the fitting error of the crack boundary with a width of 0.22 mm on the left was ≤0.08 pixels, and the confidence level of the point corrosion category with a diameter of 1.8 mm on the right reached 0.94. The final experimental result showed a false negative rate of 2.1% and a false positive rate of 0, which is a significant improvement compared to the 18.7% false negative rate and 6.3% false positive rate of the traditional YOLOv5 algorithm in the same test scenario. Further analysis of the detection time showed that the average processing time for a single frame image was 87 ms, which can effectively meet the speed requirements of real-time operation of pipeline inspection robots and verify the practicality and reliability of the method in this application under complex working conditions.

[0094] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for image recognition of defects in the inner wall of pipes based on deep learning, characterized in that, The method includes: Step 1: Obtain the video stream of the cylindrical surface unfolded inside the pipe acquired by the wide-angle cylindrical imaging module, and extract a single frame of the cylindrical surface unfolded image from the video stream. Step 2: Input the single-frame cylindrical unfolded image into the preset geometric-optical coupled sensing initialization network to obtain the initial feature map; Step 3: Estimate the cylindrical projection distortion parameter matrix based on the initial feature map; reconstruct the intrinsic geodesic field of the cylinder based on the cylindrical projection distortion parameter matrix to obtain the intrinsic geodesic distance distribution; obtain the spatial attention weight map based on the intrinsic geodesic distance distribution; and perform position-by-position modulation on the initial feature map based on the spatial attention weight map to obtain the geometrically corrected feature map. Step 4: Estimate the ring illumination gradient field based on the geometric correction feature map; extract the channel energy response extrema based on the ring illumination gradient field to obtain the channel attention modulation vector; perform channel-by-channel gain allocation on the geometric correction feature map based on the channel attention modulation vector to obtain the geometric optics decoupling feature map. Step 5: Perform manifold topology conformal spectral alignment processing based on the geometric optics decoupling feature map to obtain multi-scale spectral basis functions; perform cross-scale feature remapping and topological constraint propagation based on the multi-scale spectral basis functions to obtain multi-scale aligned feature maps; Step 6: Based on the multi-scale aligned feature map, nonlinear threshold separation is performed using a defect classification and boundary regression mechanism to obtain the defect category probability vector; sub-pixel level coordinate regression is performed based on the defect category probability vector to obtain the defect category and defect location information of the inner wall of the pipeline.

2. The method for identifying pipeline inner wall defects based on deep learning according to claim 1, characterized in that, Acquire the video stream of the expanded cylindrical surface of the pipe inner wall captured by the wide-angle cylindrical imaging module, and extract a single frame of the expanded cylindrical surface image from the video stream, including: The original optical sensing signal sequence output in real time by the wide-angle cylindrical imaging module is acquired, and the original optical sensing signal sequence is subjected to analog-to-digital conversion and frame rate normalization to obtain the video stream of the cylindrical surface of the inner wall of the pipe. Based on the video stream unfolded from the inner wall of the pipe, the inter-frame time stamps and kinematic posture parameters of the detected robot are extracted; based on the inter-frame time stamps and kinematic posture parameters, continuous motion jitter frequency domain filtering is performed to obtain a sequence of motion-stable candidate frames. Based on the motion-stable candidate frame sequence, the local illuminance variance and the biofilm coverage confidence of each frame image are calculated; based on the local illuminance variance and coverage confidence, water accumulation reflective frames and low signal-to-noise ratio frames are removed to obtain a high-quality effective frame set. Based on a set of high-quality valid frames, an adaptive temporal sliding window mechanism is used to select the reference image frame corresponding to the current processing cycle to obtain the single-frame cylindrical unfolded image.

3. The method for identifying pipeline inner wall defects based on deep learning according to claim 2, characterized in that, A single-frame cylindrical unfolded image is input into a pre-defined geometric-optical coupled sensing initialization network to obtain an initial feature map, including: The single-frame cylindrical unfolded image is input into a preset geometric optical coupling sensing initialization network, and tensor dimension alignment and pixel value normalization are performed to obtain a standardized input tensor. Based on the standardized input tensor, spatial frequency domain decoupling and multi-scale receptive field aggregation are performed through the built-in parallel convolution path of the pre-set geometric optical coupling sensing initialization network to obtain high-frequency texture response feature set and low-frequency illumination basis feature set. Based on the high-frequency texture response feature set and the low-frequency illumination substrate feature set, channel-level feature cross-fusion and spatial dimension reorganization are performed to obtain the primary coupling characterization map; Based on the primary coupling representation map, residual path superposition and channel dimension reduction projection are performed to obtain the initial feature map.

4. The method for identifying pipeline inner wall defects based on deep learning according to claim 3, characterized in that, Estimate the cylindrical projection distortion parameter matrix based on the initial feature map; reconstruct the intrinsic geodesic field of the cylinder based on the cylindrical projection distortion parameter matrix to obtain the intrinsic geodesic distance distribution; obtain the spatial attention weight map based on the intrinsic geodesic distance distribution. The initial feature map is modulated position-by-position based on the spatial attention weight map to obtain a geometrically corrected feature map, including: Based on the initial feature map, extract the spatial gradient response component and the local curvature a priori; Nonlinear parameter regression is performed based on the spatial gradient response components and local curvature a priori to obtain the cylindrical projection distortion parameter matrix; Based on the cylindrical projection distortion parameter matrix, a local metric tensor of the feature space is constructed; geodesic path integration is performed on the local metric tensor to obtain the intrinsic geodesic distance distribution. Based on the intrinsic geodesic distance distribution, a spatial attention weight map is obtained by performing nonlinear inversion of the distance field and global normalization mapping. Based on the spatial attention weight map, the initial feature map is subjected to position-by-position feature amplitude modulation to obtain a geometrically corrected feature map.

5. The method for identifying pipeline inner wall defects based on deep learning according to claim 4, characterized in that, The annular illumination gradient field is estimated based on the geometric correction feature map; the channel energy response extrema are extracted based on the annular illumination gradient field to obtain the channel attention modulation vector; Based on the channel attention modulation vector, a channel-by-channel gain allocation is performed on the geometric correction feature map to obtain the geometric optical decoupling feature map, including: Based on the geometric correction feature map, multi-channel brightness distribution components are extracted; based on the multi-channel brightness distribution components, annular spatial filtering and radial attenuation modeling are performed to obtain the annular illumination gradient field; Based on the annular illumination gradient field, the energy response spectrum of each feature channel is calculated; based on the energy response spectrum, extreme value localization and channel weight normalization are performed to obtain the channel attention modulation vector. Based on the channel attention modulation vector, a channel-level gain allocation matrix is ​​constructed; the geometric correction feature map is then subjected to channel-by-channel multiplication modulation based on the channel-level gain allocation matrix to obtain a geometric optical decoupling feature map.

6. The method for identifying pipeline inner wall defects based on deep learning according to claim 5, characterized in that, Based on the geometric optics decoupling feature map, manifold topology conformal spectral alignment is performed to obtain multi-scale spectral basis functions; Cross-scale feature remapping and topological constraint propagation are performed based on multi-scale spectral basis functions to obtain multi-scale aligned feature maps, including: Based on the geometric-optical decoupling feature map, a spatial adjacency graph of feature nodes is constructed; based on the spatial adjacency graph of feature nodes, graph topology matrixization and differential operator discretization mapping are performed to obtain the manifold Laplacian operator; Based on the manifold Laplacian operator, spectral decomposition and conformal coordinate mapping are performed to obtain multi-scale spectral basis functions; The feature projection weight matrix is ​​obtained based on the multi-scale spectral basis function; the geometric optical decoupling feature map is then interpolated in scale space according to the feature projection weight matrix to obtain the cross-scale remapping feature tensor; Based on the cross-scale remapping feature tensor, the topological curvature deviation field between adjacent scale levels is calculated; based on the topological curvature deviation field, elastic potential energy equilibrium evolution and damped smooth propagation iteration are performed to obtain the topologically aligned intermediate state feature map. Based on the topologically aligned intermediate state feature map, inverse spectral domain transformation and feature space recombination are performed to obtain a multi-scale aligned feature map.

7. The method for identifying pipeline inner wall defects based on deep learning according to claim 6, characterized in that, Based on the multi-scale aligned feature map, a nonlinear threshold separation is performed using a defect classification and boundary regression mechanism to obtain the defect category probability vector. Subpixel-level coordinate regression is performed based on the defect category probability vector to obtain information on the defect category and location of the pipe inner wall, including: Based on the multi-scale aligned feature map, feature channel reorganization and semantic space projection are performed through defect classification and boundary regression mechanisms to obtain the feature response map to be separated; Based on the feature response map to be separated, nonlinear threshold segmentation and category confidence mapping are performed to obtain the defect category probability vector; Based on the defect category probability vector, probability gradient guidance and spatial coordinate weight allocation are performed to obtain the sub-pixel regression prior field; Based on the subpixel regression prior field, continuous coordinate interpolation calculation and boundary contour fitting are performed to obtain the defect category and defect location information of the inner wall of the pipeline.

8. A deep learning-based image recognition system for defects in the inner wall of a pipe, wherein the system implements the method as described in any one of claims 1 to 7, characterized in that, include: The image acquisition and preprocessing module is used to acquire the original optical sensing signals of the wide-angle cylindrical imaging module, generate a video stream of the cylindrical surface unfolding inside the pipe, and extract a high-quality single-frame cylindrical surface unfolding image. The coupled sensing initialization module has a built-in geometric optics coupled sensing initialization network, which is used to extract features from the input single-frame cylindrical unfolded image to obtain the initial feature map; The geometric correction module is used to estimate the cylindrical projection distortion parameter matrix, reconstruct the intrinsic geodesic field and generate a spatial attention weight map, and complete the geometric correction of the initial feature map. The illumination decoupling module is used to estimate the ring illumination gradient field, obtain the channel attention modulation vector, and realize the illumination interference decoupling of the geometric correction feature map; The manifold spectral alignment module is used to construct the manifold Laplacian operator and perform spectral decomposition, execute cross-scale feature remapping and topological constraint propagation, and obtain multi-scale aligned feature maps. The defect detection output module is used to perform defect classification and sub-pixel-level boundary regression based on multi-scale aligned feature maps to obtain the final defect category and location information.

9. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.