Pipeline Internal Surface Detection based on Convolutional Neural Networks and Code Wave Time-Frequency Transform

This study introduces an innovative approach that integrates principles of coda wave interferometry, wavelet transform, convolutional neural networks, and deep learning for the analysis and detection of contaminants within pipelines. The primary objective of this method is to identify various types of contaminants, enhance contamination detection sensitivity and accuracy, thereby providing an effective solution for monitoring and remediation in the oil and gas pipeline transportation industry. The findings of this research offer valuable insights and serve as a significant reference for improving pipeline cleaning practices. Further optimization can be explored through enhancements in the model architecture, the incorporation of data augmentation techniques, and the exploration of alternative training strategies. However, the performance of this method still requires further study and improvement. The study encompasses the following key aspects: Firstly, ultrasonic analysis is employed to characterize the structural properties of contaminants, enabling the extraction of crucial structural features and performance parameters through the analysis of ultrasonic echo signals. Secondly, wavelet transform is applied to conduct comprehensive time-frequency analysis of the ultrasonic echo signals, facilitating the capture of distinctive features associated with contaminants across different frequency bands and time scales. Thirdly, convolutional neural networks, specifically leveraging the VGG-16 model, are used to extract informative features from the ultrasonic signals and perform classification. Through rigorous training and fine-tuning processes, the model achieves precise identification of contaminant types and estimation of their thickness.


. Introduction
Energy is the material foundation for the survival and development of human society, holding a strategic position in the national economy.Transportation is an indispensable component of the energy supply chain, significantly impacting energy supply and its safe utilization.For natural gas, a crucial energy source, transporta-tion methods primarily include long-distance gas pipeline

. Coda Wave Time-frequency transform
The research on time-frequency analysis of coda wave has not progressed, mainly for the following reasons:(1) Complex waveforms: Coda wave usually have complex waveforms that contain multiple reflection, refraction, and scattering components.These components are intertwined in time and frequency, giving the time-frequency representation of the coda wave complex features.For the coda wave of complex waveforms, it becomes more difficult to choose an appropriate time-frequency analy-sis method and parameter settings.(2)Attenuation and interference: Coda wave will experience energy attenuation and interference during propagation.This means that the amplitude and energy of the coda wave gradually diminishes along the propagation path, making the signal strength of the coda wave relatively weak.When performing time-frequency analysis, a lower signal-to-noise ratio may lead to a decrease in the accuracy of the analysis results, and may be interfered by environmental noise, making it more difficult to accurately extract the time-frequency characteristics of the coda wave signal.(3)Multi-path interference: The coda wave is reflected and scattered on multiple paths, and the delay and phase difference of these paths may cause inter-ference effects.This makes time-frequency analysis of coda wave more challenging, as signals on different paths may interfere with each other at specific times and fre-quencies, resulting in intricate patterns in the time-frequency representation.(4)Data acquisition and processing: Accurate and high-quality data acquisition is required for timefrequency analysis of coda wave.In practical applications, the acquisition of coda wave signals may be limited by various factors, such as sensor location, environmen-tal noise, sampling rate, etc.These factors may have an impact on the results of the time-frequency analysis, thus requiring careful handling and optimization of the data acquisition process.Combining wavelet transform with coda wave time-frequency transform.Wavelet analysis is a time-frequency analysis method of variational fre-quency.The shape of the time-frequency window of the traditional fourier transform is fixed, the duration of high-frequency signals is short, and the duration of low-frequency signals is long, so its ability to analyze non-stationary signals is limited.Wavelet transform solves this problem by taking different shapes of time-frequency windows for signals of different frequencies 6,7 .The basic idea of wavelet transform is to decompose and reconstruct the signal by choosing the appropriate wavelet function.The wavelet function is a function with localization characteristics, which can present localization characteristics in time domain and frequency domain.The wavelet function has vari-able scale and translation, so it can capture the changes of different frequency and time domain positions in the signal.The general formula of wavelet transform can be expressed as: Among them, Xˆ( a, b) represents the coefficient after wavelet transformation, where x(t) is the original signal.ψ(t) is the wavelet function, a is the scale parameter, b is the translation parameter.
The wavelet function can capture different frequency and time domain characteristics of the signal under different scales and translation parameters.Through the wavelet transform of the signal at different scales and translations, a series of wavelet coefficients with different scales and frequencies can be obtained to describe the time-frequency characteristics of the signal.

. 3 Convolutional neural network
In living organisms, numerous systems exist to maintain attention, balance, reg-ulate emotions, and more.McCulloch drew analogies from biological systems and discovered that many systems respond to new inputs in a network and differences within an existing network 8 .By adapting to these responses, changes can be made to reduce differences.Based on this, the author proposed the first mathematical model of a neuron, the MP model.Rumelhart introduced a novel algorithm based on neuron-like units in a network, called backpropagation algorithm 9 .This algorithm can be analogized to the positive and negative processes of partial integration in mathe-matics, enabling adjustment of the weights in the interconnected network to minimize the discrepancy between actual and expected outputs.One evident drawback of this algorithm is the possibility of getting trapped in local minima while searching for the expected output, thus failing to find the global minimum.To address this issue, weight space can be introduced to assign different weights to different parts of the compu-tation process, allowing the gradient descent function to escape from local minima.Cortes proposed support vector machines (SVM), which can solve the problem of binary classification in sample data 10 .However, it still cannot resolve issues such as getting trapped in local minima and overfitting.Hinton proposed an effective method for initializing weights, utilizing multi-layer training and small learning rates to overcome inherent problems in neural network algorithms 11 .

Experimental design of pipeline inner surface detection
The experimental design idea is as follows: First, we place the iron plate in the experimental device, and then place solid wax with a thickness of about 1mm and 2mm and solid glue with a thickness of 1 mm and 2 mm respectively under the iron plate.These materials will be in close contact with the iron plate, simulating the contact between the inner surface of the pipe and the dirt in actual application.During the experiment, we can change the shape of solid wax and solid glue to produce different bumps or irregular surfaces.By varying the shape of these materials, we can simulate different forms and distributions of dirt inside pipes, such as bumps, depressions or irregular buildups.This allows the shape of the experiment to span a large span, better simulating actual industrial scenarios.In order to collect echo data, we will place piezoelectric sheets on the iron plate to simulate the position of the inner surface of the pipe.Piezoelectric sheets can convert ultrasonic echo signals into electrical signals and record them.By reasonably arranging the position and angle of the piezoelectric sheet, we can ensure that it can effectively receive the ultrasonic echo signals that penetrate the iron plate and dirt.

Pipeline inner surface inspection test results
The purpose of the data set design is to make full use of sample data of different  From the results, we can observe the following:With the increase of Epoch, the loss of training set and validation set decreases, while the accuracy rate increases.This shows that the model gradually learns the features and patterns of the data during the training process and improves the performance to a certain extent.The accuracy of the training set and the verification set are close, indicating that the performance of the model on the training set and the verification set is relatively consistent, and there is no obvious over-fitting or under-fitting phenomenon.The accuracy on the validation set is 0.83, which remains relatively stable.This may be because the model is already close to its optimal performance, and further training has limited impact on improving accuracy.Overall, we can see that the model gradually converges and reaches a certain level of performance during training.However, to further optimize the model and improve the accuracy rate, it may be necessary to adjust the model structure and other training strategies, such as learning rate adjustment, data enhancement, etc.

Conclusion
This study proposes an innovative method for the analysis and detection of fouling in pipelines, combining the principles of coda wave interferometry, wavelet transform, convolutional neural networks, and deep learning.Through this approach, our aim is to identify different types of fouling and improve the sensitivity and accuracy of fouling detection.Firstly, we utilize ultrasonic analysis to characterize the structural properties of fouling.Ultrasonic testing is a non-destructive testing method that involves sending ultrasonic signals and receiving their echoes to obtain structural characteristics and performance parameters of fouling.Secondly, we use wavelet transform to analyze the time -frequency characteristics of the ultrasonic echo signal.By performing wavelet transform on the ultrasonic echo signals and generating time-frequency spectrograms, we can effectively analyze the structural properties of fouling and capture features at different frequency and time scales.Next, we employ convolutional neural networks for feature extraction and classi-fication of ultrasonic signals.Using the VGG-16 deep learning model, combined with pre-training and fine-tuning techniques, enables the model to learn and recognize com-plex features.By establishing a database of ultrasonic signals containing different types and thicknesses of fouling and using convolutional neural networks for training and classification, we can accurately identify the type and thickness of fouling, enabling non-destructive evaluation and prediction.According to the experimental results, we observe that as the training duration increases, the model's loss on the training set and validation set gradually decreases, and the accuracy rate continues to rise.The accuracy of the training set and the validation set are close, indicating that the model' s performance is relatively consis-tent across different data sets, with no significant overfitting or underfitting observed.The accuracy on the validation set stabilizes at 0.83, possibly because the model is already approaching its optimal performance, and further training has limited impact on improving accuracy.In summary, this study's method achieves effective results in the detection of fouling on the inner surface of pipelines through the combination of coda wave time-frequency transformation and convolutional neural networks.These findings provide the pipeline industry with powerful fouling analysis and monitoring tools and serve as important references for improving pipeline cleaning solutions.Further optimiza-tion can be explored by adjusting the model structure and adopting other training strategies, such as learning rate adjustment and data augmentation.

Discussion
This study effectively achieves the detection of fouling within pipelines by combining coda wave time-frequency transformation and convolutional neural networks.These findings may provide tools for fouling analysis and monitoring in the pipeline indus-try and serve as a reference for improving pipeline cleaning solutions.However, the performance of this method still requires further investigation, and further optimiza-tion can be explored through adjustments in the model structure and the adoption of other training strategies, such as learning rate adjustment and data augmentation.

Fig. 1 :
Fig. 1 : Figure of an acoustic signal measured in a complex medium

Fig. 2 :Fig. 3 :Fig. 4 :
Fig. 2: Schematic figure of experimental research system thicknesses and shapes during the training process of the deep learning model, so as to improve the generalization ability and accuracy of the model.The specific design is as follows: Training Set: Contains 1mm wax, 2mm wax, 1mm solid glue, and 2mm solid glue echo spectrograms of different shapes, a total of 300.These samples are used for the training of the model, enabling the model to learn the echo characteristics under different materials and thicknesses.Test Set :Contains the same type of samples as the training set, a total of 100.The test set is used to evaluate the performance of the trained model on new samples to judge the generalization ability of the model.Validation Set: Contains 100 spectrograms of echoes of different shapes of 1.5mm paraffin and 1.5mm solid glue.The dataset adopts the Keras deep learning framework and uses the VGG-16 model as the basic model for training.During the training process, strategies of fine-tuning parameters and pre-training are adopted to improve the performance and generalization ability of the model.