A method for detecting the risk level of a non-destructive pipeline based on audio processing
By performing frame processing and dynamic filtering of pipeline audio signals, combined with adaptive filtering and wavelet thresholding method, the single and noise complexity problems of detection in the prior art are solved, and high-precision pipeline risk level classification is achieved.
Patent Information
- Application Number
- CN202510538735.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-04-27
AI Technical Summary
The pipeline detection method in the prior art has a single purpose, and does not consider the complexity and diversity of noise in different environments, and does not consider the imbalance of pipeline risk level samples, resulting in low classification accuracy.
By performing equal-length frame-division and smoothing processing on the audio signal, the proportion of noise characteristic bands is determined, the dynamic selection filter is used for denoising, and combining adaptive filters and wavelet thresholding methods, the time domain, frequency domain and time-frequency domain characteristics are extracted, and a few oversampling technologies and deep learning networks are used for classification.
It improves the accuracy and environmental adaptability of pipeline risk level detection, effectively removes noise, solves the problems of noise complexity and sample imbalance, and improves the prediction accuracy of the classifier.
Smart Images

Figure CN120089160B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pipeline detection, and in particular to a non-destructive pipeline risk level detection method based on audio processing. Background Art
[0002] The research and application of pipeline defect detection technology play an important role in optimizing the design of urban water supply and drainage systems, improving management levels, and preventing flood risks. With the development of technology, the detection efficiency and accuracy have been continuously improved, which is beneficial to enhancing the management level of urban drainage systems and also has reference significance for the detection technologies of other underground pipelines such as water supply and drainage pipelines and natural gas pipelines.
[0003] A water supply pipeline leakage detection and location method with the application number 2017101397727 uses audio enhancement and time delay estimation methods to determine whether there is a leakage in the pipeline. Although the noise in the signal is reduced, irreversible effects may be caused to the collected pipeline transportation sounds during the enhancement process, reducing the final detection accuracy.
[0004] A signal processing method for water supply pipeline leakage detection and location with the application number 2009101039188 uses audio noise reduction, autocorrelation prediction comparison and other methods to determine whether there is a leakage in the pipeline. However, this method only relies on time-domain correlation peaks and autocorrelation entropy value analysis and does not utilize frequency-domain features, resulting in insufficient feature discrimination and affecting the final detection accuracy.
[0005] A pipeline leakage detection method and system based on audio processing with the application number 2022107321722 uses frame-by-frame windowing preprocessing and multi-band spectrum energy analysis to avoid directly using audio enhancement technology that may cause signal distortion and reduce the damage to the original signal; extracts spectrum features through Fourier transform and calculates the energy ratio by dividing frequency bands to make up for the lack of frequency-domain features; however, the detection purpose of this method is single, only determining whether there is a leakage in the pipeline, not considering multi-level risk classification, unable to guide differential maintenance strategies, and not considering the imbalance of pipeline risk level samples, which may lead to missed detection problems; only performing time-domain frame-by-frame windowing preprocessing, not fully considering the complexity and diversity of noise in different environments, resulting in limited suppression effect on complex environmental noise, thus affecting the accuracy of interference signal extraction and reducing the risk detection accuracy; the audio feature extraction method is single, only obtaining the single-frame feature distribution by processing frame signals through Fourier transform and calculating the energy ratio of different frequency bands, not fully exploring the time-domain, frequency-domain and time-frequency domain features of audio signals, with limited feature expression ability, unable to accurately reflect the true condition of the pipeline, resulting in poor model generalization ability and reduced classification accuracy. Summary of the Invention
[0006] To this end, the technical problem to be solved by the present invention is to overcome the problems in the prior art, such as single detection purpose, single feature extraction method, failure to consider the complexity and diversity of noise in different environments, and failure to consider the imbalance of pipeline risk level samples, resulting in low classification accuracy.
[0007] To solve the above technical problems, the present invention provides a non-destructive pipeline risk level detection method based on audio processing, including:
[0008] Perform equal-length framing and smoothing processing on the original audio signals of the pipeline to be detected collected at each sampling moment to obtain each audio frame of the pipeline to be detected;
[0009] Based on multi-window spectral estimation, determine the industrial noise feature band and residential noise feature band in each audio frame; based on the energy ratio expression, calculate the proportion of the industrial noise feature band and the proportion of the residential noise feature band in each audio frame;
[0010] Preset the initial noise mode of each audio frame; if the initial noise mode of the current audio frame is the residential noise mode, and the proportion of the industrial noise feature band in this audio frame is greater than the preset multiple of the proportion of the residential noise feature band, then the target noise mode of the current audio frame is the industrial noise mode, otherwise the target noise mode of the current audio frame is the residential noise mode; if the initial noise mode of the current audio frame is the industrial noise mode, and the proportion of the residential noise feature band in this audio frame is greater than the preset multiple of the proportion of the industrial noise feature band, then the target noise mode of the current audio frame is the residential noise mode, otherwise the target noise mode of the current audio frame is the industrial noise mode;
[0011] Select a filter corresponding to the frequency of the target noise mode of each audio frame, filter out the noise signal corresponding to the target noise mode of each audio frame, and obtain each filtered audio frame;
[0012] Use an adaptive filter to perform denoising processing on each filtered audio frame to obtain each target audio frame;
[0013] Perform frame combination processing on all target audio frames to obtain the target audio signal of the pipeline to be detected; perform feature extraction on the target audio signal to obtain the feature set of the target audio signal;
[0014] Input the feature set of the target audio signal into the trained classifier to obtain the risk level classification result of the pipeline to be detected.
[0015] Preferably, the step of performing equal-length framing and smoothing processing on the original audio signals of the pipeline to be detected collected at each sampling moment to obtain each audio frame of the pipeline to be detected includes:
[0016] According to the preset frame length and preset overlap rate, perform frame segmentation on the original audio signal of the pipeline to be detected collected at each sampling moment, and perform zero-padding processing on the frames that do not meet the preset frame length to obtain equal-length frames of the pipeline to be detected;
[0017] Based on the Hanning window function, smooth each equal-length frame to obtain audio frames of the pipeline to be detected.
[0018] Preferably, the initial noise pattern of each preset audio frame includes:
[0019] Set the initial noise pattern of the first audio frame to industrial noise pattern or residential noise pattern; set the initial noise pattern of the second to the th audio frames to the target noise pattern of its corresponding previous audio frame.
[0020] Preferably, the selection of the filter corresponding to the target noise pattern frequency of each audio frame includes:
[0021] If the target noise pattern of the current audio frame is industrial noise pattern, select a filter with a frequency of 50 - 100 Hz;
[0022] If the target noise pattern of the current audio frame is residential noise pattern, select a filter with a frequency of 1000 - 3000 Hz.
[0023] Preferably, after using the adaptive filter to denoise each filtered audio frame to obtain each target audio frame, it further includes:
[0024] Use the wavelet threshold method to denoise each target audio signal again to obtain each denoised target audio frame.
[0025] Preferably, after extracting the features of the target audio signal to obtain the feature set of the target audio signal, it further includes:
[0026] Use the feature screening algorithm to obtain the feature subset of the target audio signal based on the feature set of the target audio signal.
[0027] Preferably, the training process of the classifier includes:
[0028] Perform equal-length frame segmentation and smoothing processing on the original audio signals of different pipelines to obtain audio frames of different pipelines, and calculate the proportion of the industrial noise feature band and the proportion of the residential noise feature band in each audio frame of different pipelines;
[0029] Based on the preset initial noise pattern of each audio frame of each pipeline, determine the target noise pattern of each audio frame of each pipeline;
[0030] Select filters corresponding to the target noise pattern frequencies of each audio frame of each pipeline, and combine with an adaptive filter to denoise each audio frame of each pipeline to obtain each target audio frame of each pipeline;
[0031] Perform frame combination on each target audio frame of each pipeline and then perform feature extraction to obtain the target audio signal feature set of each pipeline;
[0032] Based on the feature sets of the target audio signals of different pipelines and their corresponding risk level labels, construct a data set, and divide the data set into a training set and a test set;
[0033] Use the Synthetic Minority Over-sampling Technique (SMOTE) algorithm, through linear interpolation, generate new samples between the minority class samples and their minority class neighbors in the training set, and then obtain a new training set;
[0034] Use the new training set to train a classifier to obtain a trained classifier.
[0035] Preferably, the step of using the Synthetic Minority Over-sampling Technique (SMOTE) algorithm, through linear interpolation, generating new samples between the minority class samples and their minority class neighbors in the training set, and then obtaining a new training set includes:
[0036] Obtain each category in the training set and its corresponding number of samples, and based on the number of samples of all categories, find the maximum value of the number of samples as the maximum category sample number;
[0037] If the number of samples of the current category is less than the maximum category sample number, then use the K-dimensional tree method to perform a nearest neighbor search on each sample of the current category to find each nearest neighbor sample of each sample of the current category, and construct a nearest neighbor sample set of each sample of the current category;
[0038] Randomly select any nearest neighbor sample in the nearest neighbor sample set of the current sample of the current category as the target nearest neighbor sample of the current sample of the current category; perform linear interpolation between the current sample of the current category and its target nearest neighbor sample to obtain the new sample corresponding to the current sample of the current category;
[0039] If the new sample corresponding to the current sample of the current category is between the minimum and maximum values of the features of the current sample of the current category, then retain the current new sample, otherwise reject it;
[0040] Add the current sample of the current category and its corresponding new sample to the result data set;
[0041] If the number of samples of the current category is not less than the maximum category sample number, then add each sample of the current category to the result data set;
[0042] Shuffle the order of all samples in the result data set to obtain a new training set.
[0043] Preferably, the classifier is any one of a support vector machine, a BP neural network, a convolutional neural network, a K-nearest neighbor, and a random forest.
[0044] Preferably, the risk level classification results include no risk, low risk, medium risk, and high risk.
[0045] The above technical solution of the present invention has the following beneficial effects compared with the prior art:
[0046] (1) For the method for detecting the risk level of a lossless pipeline based on audio processing according to the present invention, the original audio signals of the pipeline to be detected collected at each sampling moment are subjected to equal-length framing processing and smoothing processing to obtain each audio frame of the pipeline to be detected, which helps to specifically suppress the dominant noise in each frame during subsequent denoising processing, improve the denoising efficiency, retain more effective audio signals, and compared with processing the complete long audio signal, the data volume after framing processing is reduced, reducing the computational complexity of the denoising algorithm, and is conducive to more comprehensively and accurately analyzing the characteristics of the pipeline audio signal and improving the accuracy of judging the pipeline risk status; according to the initial noise pattern of each audio frame and the proportion of the industrial noise characteristic band and the proportion of the residential noise characteristic band in the audio frame, combined with a preset multiple, the target noise pattern of each audio frame is determined, which helps to perform targeted processing in subsequent denoising processing, accurately remove the main noise under the corresponding noise pattern, improve the noise reduction effect, make the pipeline audio signal purer, and provide a reliable basis for subsequent analysis; adjusting the processing strategy in a timely manner according to the change of the framing mode can ensure a stable and efficient state in different scenarios and enhance its environmental adaptability; dynamically selecting a filter can accurately match the noise pattern and can specifically filter the noise in a specific frequency band. In an industrial noise environment, a filter targeting 50-100 Hz is selected to effectively attenuate the industrial equipment noise in this frequency band. In a residential noise environment, a filter adapted to 1000-3000 Hz is used to mainly suppress the living noise. Compared with a fixed filter, dynamic selection can remove noise more efficiently, retain the effective signals of the pipeline audio, make the audio signal purer, and improve the accuracy and effectiveness of noise reduction; through an adaptive filter, denoising processing is performed on each filtered audio frame, which can flexibly adjust the filtering method according to the characteristics of the audio frame, avoid over-damaging the key features of the audio, help the subsequent analysis and understanding of the audio content, better retain the feature information related to the pipeline state, and provide support for accurately judging the risk level; wavelet threshold denoising is used after the adaptive filter to further eliminate the residual noise, improve the processing accuracy of each audio frame in the pipeline to be detected, and provide accurate data support for subsequent pipeline level detection.
[0047] (2) In a non-destructive pipeline risk level detection method based on audio processing according to the present invention, pipeline audio signals are classified into four risk levels: risk-free, low-risk, medium-risk, and high-risk, and then collected and subsequently classified. This is conducive to adopting different coping strategies and has better application value. The time-domain, frequency-domain, and time-frequency domain features of the target audio signal are used as the input of the classifier. By introducing classifiers of different models, an optimal classification model is trained, and the optimal classification model is used to realize the monitoring and analysis of pipeline risks, improving the prediction accuracy of the pipeline risk level classification result. In order to further improve the correlation between the input data and the risk level detection, through a feature screening algorithm, irrelevant features that contribute less to the classification or prediction task are identified and removed, which helps to reduce the data dimension, reduce the complexity of data processing, and improve the training speed and efficiency of subsequent models. In addition, before training the classifier, the Synthetic Minority Over-sampling Technique (SMOTE) algorithm is used, combined with a boundary protection mechanism, to increase the samples of the minority class, effectively solving the problem of unbalanced samples of the pipeline risk level of audio signals. Secondly, the K-dimensional tree data structure is used for nearest neighbor search, improving the efficiency of nearest neighbor search, especially with obvious advantages when dealing with high-dimensional data, reducing the running time of the SMOTE algorithm. And after oversampling all classes, the order of each sample in the final result dataset is randomly shuffled to ensure that the data order is random, improving the universality of the samples and the generalization performance of the model, laying a foundation for subsequent improvement of the prediction accuracy of the pipeline risk level classification result. Description of the Drawings
[0048] In order to make the content of the present invention easier to be clearly understood, the following further details the present invention according to specific embodiments of the present invention and in combination with the drawings, where:
[0049] Figure 1 is a flowchart of a non-destructive pipeline risk level detection method based on audio processing provided by the present invention;
[0050] Figure 2 is a frequency-domain comparison diagram of the original audio signal, the audio signal after denoising by dynamically selecting corresponding filters and adaptive filters based on the noise pattern, and the audio signal after denoising by dynamically selecting corresponding filters, adaptive filters, and wavelet thresholds based on the noise pattern; where, Figure 2 (a) in it represents the amplitude spectrum diagram of the original audio signal; Figure 2 (b) in it represents the amplitude spectrum diagram of the audio signal after denoising by dynamically selecting corresponding filters and adaptive filters based on the noise pattern; Figure 2 (c) in it represents the amplitude spectrum diagram of the audio signal after denoising by dynamically selecting corresponding filters, adaptive filters, and wavelet thresholds based on the noise pattern;
[0051] Figure 3 It is a flowchart of preprocessing pipeline audio signals;
[0052] Figure 4 It is a flowchart of the Synthetic Minority Over-sampling Technique (SMOTE) algorithm;
[0053] Figure 5 It is the amplitude spectrogram of pipeline audio signals with different risk levels; Figure 5 In (a) of [reference], it represents the amplitude spectrogram of pipeline audio signals with no risk level; Figure 5 In (b) of [reference], it represents the amplitude spectrogram of pipeline audio signals with a low risk level; Figure 5 In (c) of [reference], it represents the amplitude spectrogram of pipeline audio signals with a medium risk level; Figure 5 In (d) of [reference], it represents the amplitude spectrogram of pipeline audio signals with a high risk level;
[0054] Figure 6 It is the time-domain diagram of pipeline audio signals with different risk levels; Figure 6 In (a) of [reference], it represents the time-domain diagram of pipeline audio signals with no risk level; Figure 6 In (b) of [reference], it represents the time-domain diagram of pipeline audio signals with a low risk level; Figure 6 In (c) of [reference], it represents the time-domain diagram of pipeline audio signals with a medium risk level; Figure 6 In (d) of [reference], it represents the time-domain diagram of pipeline audio signals with a high risk level. Detailed implementation manners
[0055] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, so that those skilled in the art can better understand the present invention and be able to implement it, but the embodiments given are not intended to limit the present invention. Embodiment 1
[0056] Refer to Figure 1 as shown in Figure 1 It is a flowchart of a non-destructive pipeline risk level detection method based on audio processing provided by the present invention; specifically including:
[0057] S1: Perform equal-length framing and smoothing processing on the original audio signals of the pipeline to be detected collected at each sampling moment, and obtain each audio frame of the pipeline to be detected, including:
[0058] Perform framing processing on the original audio signals of the pipeline to be detected collected at each sampling moment according to a preset frame length and a preset overlap rate, and perform zero-padding at the end on the frames that do not meet the preset frame length to obtain each equal-length frame of the pipeline to be detected; in a specific embodiment of the present invention, the preset frame length is 1024 points; the preset overlap rate is 75%;
[0059] Based on the Hanning window function, each equal-length framed audio is smoothed to obtain each audio frame of the pipeline to be detected; wherein, the expression of the Hanning window function is:
[0060] ;
[0061] wherein, represents the value of the Hanning window function at the th sampling moment; represents the time index of the Hanning window function; represents the length of the Hanning window function, i.e., the preset frame length;
[0062] S2: Based on multi-taper spectral estimation, determine the industrial noise characteristic band and the residential noise characteristic band in each audio frame; calculate the proportion of the industrial noise characteristic band and the proportion of the residential noise characteristic band in each audio frame based on the energy ratio expression;
[0063] wherein, in a specific embodiment of the present invention, the multi-taper spectral estimation is the 4th-order Thomson multi-taper spectral estimation;
[0064] The expressions for the proportion of the industrial noise characteristic band and the proportion of the residential noise characteristic band in each audio frame are:
[0065] ;
[0066] ;
[0067] wherein, represents the proportion of the industrial noise characteristic band in the th audio frame; represents the industrial noise characteristic band in the th audio frame; represents the proportion of the residential noise characteristic band in the th audio frame; represents the residential noise characteristic band in the th audio frame; represents the th audio frame;
[0068] S3: Preset the initial noise pattern for each audio frame; wherein, in a specific embodiment of the present invention, set the initial noise pattern of the first audio frame to the industrial noise pattern or the residential noise pattern; set the initial noise pattern of the second to the th audio frames to the target noise pattern of its corresponding previous audio frame, and complete the preset of the initial noise pattern for each audio frame;
[0069] If the initial noise mode of the current audio frame is the residential noise mode, and the proportion of the industrial noise feature band in this audio frame is greater than a preset multiple of the proportion of the residential noise feature band, then the target noise mode of the current audio frame is the industrial noise mode; otherwise, the target noise mode of the current audio frame is the residential noise mode. If the initial noise mode of the current audio frame is the industrial noise mode, and the proportion of the residential noise feature band in this audio frame is greater than a preset multiple of the proportion of the industrial noise feature band, then the target noise mode of the current audio frame is the residential noise mode; otherwise, the target noise mode of the current audio frame is the industrial noise mode. Among them, in a specific embodiment of the present invention, the preset multiple is 1.2;
[0070] S4: Select a filter corresponding to the frequency of the target noise mode of each audio frame, filter out the noise signal corresponding to the target noise mode of each audio frame, and obtain each filtered audio frame;
[0071] Among them, the selection of the filter corresponding to the frequency of the target noise mode of each audio frame includes: if the target noise mode of the current audio frame is the industrial noise mode, then select a filter with a frequency of 50 - 100 Hz; if the target noise mode of the current audio frame is the residential noise mode, then select a filter with a frequency of 1000 - 3000 Hz. In a specific embodiment of the present invention, select a 12th-order Butterworth band-pass IIR filter corresponding to the frequency of the target noise mode of each audio frame;
[0072] Among them, after being processed by the 12th-order Butterworth band-pass IIR filter, the signal at the th sampling moment in the filtered current audio frame has the following expression:
[0073] ;
[0074] Among them, represents the th-order feedforward coefficient, which determines the zero position of the filter; represents the th-order feedback coefficient, which determines the pole position of the filter; represents the signal at the th sampling moment in the current audio frame input to the Butterworth band-pass IIR filter; represents the filter order index;
[0075] Among them, the transfer function of the 12th-order Butterworth band-pass IIR filter
[0076] has the following expression:
[0077] Among them, represents a variable;
[0078] S5: An adaptive filter is used to denoise each filtered audio frame to obtain each target audio frame; among them, in a specific embodiment of the present invention, the adaptive filter is a high-order normalized LMS (NLMS), its order is set to 64, and the step size is set to 0.01. Its weight update formula is:
[0079] ;
[0080] Among them, represents the filter weight vector corresponding to the signal at the -th sampling moment in the current audio component; represents the filter weight vector corresponding to the signal at the -th sampling moment in the current audio component; represents the step size factor, that is, the convergence coefficient; represents the error signal corresponding to the -th sampling moment in the current audio component, ; represents the desired signal corresponding to the -th sampling moment of the current audio component; represents the output signal corresponding to the -th sampling moment of the current audio component, ; represents the regularization term;
[0081] The above adaptive filter weight update formula realizes the adaptive update of the filter weights. Through the product term of the error signal and the input signal, the weight vector is automatically adjusted to make the output signal approximate the effective components in the desired signal; the step size factor controls the balance between the convergence speed and the steady-state error; the denominator term is the input vector energy. By normalizing it, the stability problem caused by the fixed step size of the traditional LMS is solved; when the amplitude of the input signal suddenly changes (such as in a pipeline noise scenario), the traditional LMS will diverge, while the NLMS dynamically adjusts the step size , decoupling the convergence rate from the signal energy; the regularization term is to prevent the denominator from exploding when the input energy approaches zero (such as in a silent segment). The code implicitly adds a minimum value (the MATLAB default is ) to ensure numerical stability, which is a safety mechanism not available in the traditional LMS;
[0082] In order to further eliminate the residual noise, in a specific embodiment of the present invention, the wavelet threshold method is also adopted to perform denoising processing on each target audio signal again, obtaining each denoised target audio frame. Subsequently, each denoised target audio frame is processed, that is: cascade wavelet threshold denoising after the adaptive filter, and utilize the multi-resolution characteristic of the wavelet to eliminate the residual noise. According to the time-frequency distribution characteristics of the pipeline audio signal, select the wavelet basis function Sym8, and automatically adjust the decomposition layer number according to the input signal, decompose the signal into different scales and frequency sub-bands. The automatic adjustment formula for the wavelet decomposition layer number is:
[0083] ;
[0084] wherein, represents the length of the input audio frame, that is, the preset frame length; represents the floor operation, avoiding non-integer layers, ensuring strict decomposability. For short signals, automatically reduce the layer number to avoid invalid decomposition; for long signals, limit the layer number to 8 to balance the effect and the calculation amount;
[0085] In each sub-band, adopt the soft threshold method to remove the noise component. Use the heuristic wavelet threshold (heursure) function method to process the wavelet coefficients at each decomposed scale, and then reconstruct the original signal with the estimated wavelet coefficients at each scale, retaining the effective audio features, improving the signal quality, and highlighting the audio details related to the pipeline risk;
[0086] In a specific embodiment of the present invention, the frequency domain comparison diagrams of the original audio signal, the audio signal after denoising by dynamically selecting the corresponding filter and the adaptive filter based on the noise pattern, and the audio signal after denoising by dynamically selecting the corresponding filter, the adaptive filter, and the wavelet threshold are as Figure 2 shown; it can be seen that the method adopted by the present invention not only highlights the important details of the audio signal, but also improves the filtering effect on high-frequency noise;
[0087] In summary, S1 - S5 are the preprocessing processes of the pipeline audio signal, and the corresponding flowchart is as Figure 3 shown;
[0088] S6: Perform frame combination processing on all target audio frames to obtain the target audio signal of the pipeline to be detected; extract features from the target audio signal to obtain the feature set of the target audio signal. In a specific embodiment of the present invention, use the Opensmile speech feature extraction tool to extract the time domain, frequency domain, and time-frequency domain features of the target audio signal, and construct the feature set of the target audio signal; wherein, the number of extracted audio features is 384;
[0089] Since the number of extracted features is large, if a classifier needs to be trained for each feature subset, the computational cost of the algorithm is high, the computational complexity is high, and it is difficult to implement. In a specific embodiment of the present invention, a feature screening algorithm is also used to obtain a feature subset of the target audio signal based on the feature set of the target audio signal, and then the feature subset of the target audio signal is processed, that is, the feature subset of the target audio signal is input into the classifier; wherein, the feature screening algorithm is the Relief algorithm;
[0090] S7: Input the feature set of the target audio signal into the trained classifier to obtain the risk level classification result of the pipeline to be detected; wherein, the classifier is any one of a support vector machine, a BP neural network, a convolutional neural network, a K-nearest neighbor, and a random forest; the risk level classification result includes no risk, low risk, medium risk, and high risk; wherein, the amplitude spectrograms of the pipeline audio signals with different risk levels are as Figure 5 shown, and the time domain diagrams of the pipeline audio signals with different risk levels are as Figure 6 shown; the pipeline risk level classification criteria and corresponding strategies are shown in Table 1.
[0091] Table 1 Pipeline risk level classification criteria and corresponding strategies
[0092] Risk level Classification criteria Coping strategies No risk Fully meet the safety requirements of the current national standards and specifications. The pipeline network is in good operating condition, and very few pipeline sections have structural safety hazards, basically in a state of system safety and overall reliability. Carry out daily regular maintenance inspections and pay attention to the impacts of external environments, adjacent surrounding activities, and weather conditions, etc. Low risk Meet the safety requirements of the current national standards and specifications. Very few pipeline sections have structural safety hazards, basically in a state of system safety and overall reliability. Organize regular inspection and maintenance, and conduct inspections or monitoring on pipelines in key areas. Medium risk Basically meet the safety requirements of the current national standards and specifications. There are signs of deterioration and aggravated diseases in the pipeline network, and risk events occur occasionally, which may affect system safety and overall functions. Maintenance measures should be taken for some pipelines, and regular inspections or monitoring should be strengthened. High risk Do not meet the safety requirements of the current national standards and specifications. The pipelines in the pipeline network have suffered serious deterioration or diseases, and risk events may occur, affecting system safety and overall functions. Maintenance or renovation and renewal measures should be taken for key areas, and pipelines with a diameter of DN800 and above should be preferably inspected and monitored.
[0093] The training process of the classifier includes:
[0094] Perform equal-length framing and smoothing processing on the original audio signals of different pipelines to obtain each audio frame of different pipelines, and calculate the proportion of the industrial noise feature band and the proportion of the residential noise feature band in each audio frame of different pipelines;
[0095] Based on the preset initial noise pattern of each audio frame of each pipeline, determine the target noise pattern of each audio frame of each pipeline;
[0096] Select a filter corresponding to the target noise pattern frequency of each audio frame of each pipeline, and combine it with an adaptive filter to denoise each audio frame of each pipeline to obtain each target audio frame of each pipeline;
[0097] Perform frame combination processing on each target audio frame of each pipeline first and then perform feature extraction to obtain the target audio signal feature set of each pipeline;
[0098] Based on the feature sets of the target audio signals of different pipelines and their corresponding risk level labels, construct a data set, and divide the data set into a training set and a test set;
[0099] Using the Synthetic Minority Over-sampling Technique (SMOTE) algorithm, new samples are generated between the minority class samples and their minority class neighbors in the training set through linear interpolation, and then a new training set is obtained. The specific process is as follows: Figure 4 as shown below, including:
[0100] Obtain the number of samples for each category in the training set and their corresponding sample numbers, and based on the sample numbers of all categories, find the maximum value of the sample numbers as the maximum number of samples in a category;
[0101] If the number of samples in the current category is less than the maximum number of samples in a category, then use the K-d tree method to perform a nearest neighbor search for each sample in the current category to find the nearest neighbor samples of each sample in the current category, and construct a set of nearest neighbor samples for each sample in the current category;
[0102] Randomly select any nearest neighbor sample in the set of nearest neighbor samples of the current sample in the current category as the target nearest neighbor sample of the current sample in the current category; perform linear interpolation between the current sample in the current category and its target nearest neighbor sample to obtain the new sample corresponding to the current sample in the current category;
[0103] If the new sample corresponding to the current sample in the current category is between the minimum and maximum values of the features of the current sample in the current category, then retain the current new sample; otherwise, discard it;
[0104] Add the current sample in the current category and its corresponding new sample to the result dataset;
[0105] If the number of samples in the current category is not less than the maximum number of samples in a category, then add each sample in the current category to the result dataset;
[0106] Shuffle the order of all samples in the result dataset to obtain a new training set;
[0107] Use the new training set to train a classifier to obtain a trained classifier;
[0108] Among them, during the classifier training process, the ten-fold cross-validation method is used, 90% of the data is used as the training set, 10% of the data is used as the test set, and the average accuracy rate of the ten validations is used as the accuracy rate of the risk level detection of the classifier. It is found that the accuracy rate of random forest classification is the highest and the calculation time is short, which is suitable for classifying the pipeline risk level.
[0109] During the classifier training process, the Synthetic Minority Over-sampling Technique (SMOTE) algorithm is used to oversample the number of minority class samples to balance the multi-class dataset, solve the problem of unbalanced samples of the audio signal pipeline risk level, and further improve the classification accuracy. The basic idea of the SMOTE algorithm is to analyze the minority class samples. For each minority class sample, new samples are generated by linear interpolation between it and its minority class neighbors, so that the number of samples in each class reaches balance, that is, the number of samples in each class is equal to the number of samples in the largest class in the dataset. In random forests, more minority class samples can make the decision tree consider the minority class more when constructing branches, thereby improving the classification performance for the minority class. The present invention improves the traditional SMOTE algorithm, specifically reflected in:
[0110] (1) It has the ability to automatically process multi-class data, oversample all minority classes, balance the number of samples in each class, and significantly improve the practicability of the algorithm in multi-class scenarios;
[0111] (2) Use the K-dimensional tree data structure for nearest neighbor search; the K-dimensional tree is an efficient spatial index structure, which can greatly improve the efficiency of nearest neighbor search, especially has obvious advantages when dealing with high-dimensional data, and reduces the running time of the algorithm;
[0112] (3) Introduce a boundary protection mechanism; after generating each synthetic sample, its feature values will be restricted between the minimum and maximum values of the original data features, ensuring that the generated samples are within a reasonable range, improving the quality of the synthetic samples, and thus helping to improve the performance of subsequent machine learning models;
[0113] (4) After oversampling all classes, the final dataset will be randomly shuffled to ensure that the data order is random, avoiding the adverse effects on model training caused by data order problems, and improving the generalization performance of the model. Embodiment 2
[0114] In order to verify a lossless pipeline risk level detection method based on audio processing provided by the present invention, more than 90 devices were installed in multiple places in Dongcheng District and Haidian District of Beijing for collection. Finally, a total of 5096 audio were collected. After denoising, the number of effective audio was 4910, and the time of each audio was 11 seconds; the effective audio signals were labeled, which were 1 - no risk, 2 - low risk, 3 - medium risk, and 4 - high risk respectively;
[0115] Extract the features of the effective audio signal using the Opensmile language feature extraction tool, and select IS09_emotion for the feature configuration; the number of features extracted for each audio is 384, and the size of the feature dataset is 4910 * 384; use the Relief algorithm to screen 50-dimensional features to obtain the dataset after feature screening; among them, the dataset after feature screening contains the feature subset of the target audio signal of each pipeline and its corresponding risk level label.
[0116] Divide the dataset after feature screening into a training sample set and a test sample set. The classification process uses the ten-fold cross-validation method, with 90% of the data as the training set and 10% of the data as the test set.
[0117] Before inputting the training sample set, first balance the dataset through the SMOTE algorithm, and then input it into the classifier for training. When the training reaches the required accuracy or the maximum number of training times, stop the training; among them, taking the use of a random forest as the classifier as an example, the parameter settings are: the number of decision trees is 300, the minimum number of samples contained in the leaf nodes of the decision tree is 1, and the "Out-of-Bag" (OOB) samples are used to evaluate the impact of each input feature on the model prediction accuracy and the prediction process.
[0118] Input the test set into the trained classifier for prediction, and use the average accuracy of the ten-fold cross-validation as the risk level detection accuracy of the classifier. When using the improved random forest + SMOTE algorithm classifier, the accuracy can reach up to 92.46%.
[0119] In summary, the advantages of the present invention are as follows:
[0120] 1. The pipeline risk level detection method based on audio processing proposed by the present invention collects and classifies audio signals according to the four risk levels of risk-free, low-risk, medium-risk, and high-risk in accordance with the current national standards and specifications, which is conducive to adopting different coping strategies and has better application value.
[0121] 2. The pipeline risk level detection method based on audio processing proposed by the present invention determines the target noise pattern of each audio frame, which helps to perform targeted processing in subsequent denoising, accurately remove the main noise under the corresponding noise pattern, improve the denoising effect, make the pipeline audio signal purer, and provide a reliable basis for subsequent analysis; adjusting the processing strategy in a timely manner according to the change of the frame mode can ensure a stable and efficient state in different scenarios, enhancing its environmental adaptability; dynamically selecting filters can accurately match the noise pattern, and can filter specific frequency band noise. In an industrial noise environment, selecting a filter for 50 - 100 Hz can effectively attenuate the industrial equipment noise in this frequency band. In a residential noise environment, using a filter adapted to 1000 - 3000 Hz can focus on suppressing living noise. Compared with fixed filters, dynamic selection can remove noise more efficiently, retain the effective signal of the pipeline audio, make the audio signal purer, and improve the accuracy and effectiveness of denoising.
[0122] 3. The pipeline risk level detection method based on audio processing proposed by the present invention designs an adaptive filter to filter the original audio signal, tracks the changes in noise frequency and amplitude in real time, and effectively removes environmental noise and pipeline inherent vibration noise; using NLMS, combined with a variable order filter structure and regularized step size control, significantly improves the performance of the adaptive filtering system in a dynamic noise environment.
[0123] 4. The non-destructive pipeline risk level detection method based on audio processing proposed by the present invention uses wavelet transform to remove interference, adopts a soft threshold function, and can adaptively adjust the number of wavelet decomposition layers to effectively filter out interference signals.
[0124] 5. The pipeline risk level detection method based on audio processing proposed by the present invention uses an improved SMOTE algorithm to increase minority class samples before training the classifier, effectively solving the problem of unbalanced samples of pipeline risk levels in audio signals.
[0125] 6. The pipeline risk level detection method based on audio processing proposed by the present invention realizes the monitoring and analysis of pipeline risks by introducing a deep learning network. The trained network model has a high recognition accuracy, solving the problems of missed detection and false detection caused by manual detection based on empirical knowledge.
[0126] Obviously, the above embodiments are only examples given for clear illustration and are not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to enumerate all implementation manners here. And the obvious changes or modifications derived therefrom are still within the protection scope of the present invention.
Claims
1. A method for detecting the risk level of a non-destructive pipeline based on audio processing, characterized in that, Including: Perform equal-length framing and smoothing processing on the original audio signals of the pipeline to be detected collected at each sampling moment to obtain each audio frame of the pipeline to be detected; Based on multi-window spectral estimation, determine the industrial noise characteristic band and the residential noise characteristic band in each audio frame; Based on the energy ratio expression, calculate the proportion of the industrial noise characteristic band and the proportion of the residential noise characteristic band in each audio frame; Preset the initial noise mode of each audio frame; if the initial noise mode of the current audio frame is the residential noise mode, and the proportion of the industrial noise characteristic band in this audio frame is greater than the preset multiple of the proportion of the residential noise characteristic band, then the target noise mode of the current audio frame is the industrial noise mode, otherwise the target noise mode of the current audio frame is the residential noise mode; if the initial noise mode of the current audio frame is the industrial noise mode, and the proportion of the residential noise characteristic band in this audio frame is greater than the preset multiple of the proportion of the industrial noise characteristic band, then the target noise mode of the current audio frame is the residential noise mode, otherwise the target noise mode of the current audio frame is the industrial noise mode; Select a filter corresponding to the frequency of the target noise mode of each audio frame, and filter out the noise signal corresponding to the target noise mode of each audio frame to obtain each filtered audio frame; Use an adaptive filter to perform denoising processing on each filtered audio frame to obtain each target audio frame; Perform frame combination processing on all target audio frames to obtain the target audio signal of the pipeline to be detected; perform feature extraction on the target audio signal to obtain the feature set of the target audio signal; Input the feature set of the target audio signal into the trained classifier to obtain the risk level classification result of the pipeline to be detected; The training process of the classifier includes: Perform equal-length framing and smoothing processing on the original audio signals of different pipelines obtained to obtain each audio frame of different pipelines, and calculate the proportion of the industrial noise characteristic band and the proportion of the residential noise characteristic band in each audio frame of different pipelines; Based on the preset initial noise mode of each audio frame of each pipeline, determine the target noise mode of each audio frame of each pipeline; Select a filter corresponding to the frequency of the target noise mode of each audio frame of each pipeline, and combine with an adaptive filter to perform denoising on each audio frame of each pipeline to obtain each target audio frame of each pipeline; Perform frame combination processing first and then feature extraction on each target audio frame of each pipeline to obtain the target audio signal feature set of each pipeline; Based on the feature sets of the target audio signals of different pipelines and their corresponding risk level labels, construct a data set, and divide the data set into a training set and a test set; Using the Synthetic Minority Over-sampling Technique (SMOTE) algorithm, new samples are generated between the minority class samples and their minority class neighbors in the training set through linear interpolation, and then a new training set is obtained, including: obtaining the number of samples in each category in the training set and their corresponding numbers, and based on the number of samples in all categories, finding the maximum value of the number of samples as the maximum number of samples in a category; if the number of samples in the current category is less than the maximum number of samples in a category, then using the K-dimensional tree method to perform a nearest neighbor search on each sample in the current category to find each nearest neighbor sample of each sample in the current category, and constructing a set of nearest neighbor samples for each sample in the current category; randomly selecting any nearest neighbor sample from the set of nearest neighbor samples of the current sample in the current category as the target nearest neighbor sample of the current sample in the current category; performing linear interpolation between the current sample in the current category and its target nearest neighbor sample to obtain a new sample corresponding to the current sample in the current category; if the new sample corresponding to the current sample in the current category is between the minimum and maximum values of the features of the current sample in the current category, then retain the current new sample, otherwise reject it; adding the current sample in the current category and its corresponding new sample to the result dataset; if the number of samples in the current category is not less than the maximum number of samples in a category, then adding each sample in the current category to the result dataset; shuffling the order of all samples in the result dataset to obtain a new training set; Using the new training set, train a classifier to obtain a trained classifier.
2. The non-destructive pipeline risk level detection method based on audio processing according to claim 1, characterized in that The equal-length framing and smoothing of the original audio signal of the pipeline to be detected collected at each sampling moment to obtain each audio frame of the pipeline to be detected include: According to the preset frame length and preset overlap rate, perform framing processing on the original audio signal of the pipeline to be detected collected at each sampling moment, and perform zero-padding at the end on the frames that do not meet the preset frame length to obtain each equal-length frame of the pipeline to be detected; Based on the Hanning window function, perform smoothing processing on each equal-length frame to obtain each audio frame of the pipeline to be detected.
3. A method for detecting the risk level of a lossless pipeline based on audio processing according to claim 1, characterized in that, The preset initial noise pattern for each audio frame includes: Set the initial noise pattern of the first audio frame as the industrial noise pattern or the residential noise pattern; set the initial noise pattern of the second to the th audio frames as the target noise pattern of its corresponding previous audio frame.
4. A method for detecting the risk level of a non-destructive pipeline based on audio processing according to claim 1, characterized in that The selection of a filter corresponding to the target noise pattern frequency of each audio frame includes: If the target noise pattern of the current audio frame is an industrial noise pattern, then select a filter with a frequency of 50 - 100 Hz; If the target noise pattern of the current audio frame is a residential noise pattern, then select a filter with a frequency of 1000 - 3000 Hz.
5. The non-destructive pipeline risk level detection method based on audio processing according to claim 1, wherein, After using an adaptive filter to perform denoising processing on each filtered audio frame to obtain each target audio frame, it further includes: Using the wavelet threshold method to perform denoising processing on each target audio signal again to obtain each denoised target audio frame.
6. The non-destructive pipeline risk level detection method based on audio processing according to claim 1, characterized in that, After performing feature extraction on the target audio signal to obtain a feature set of the target audio signal, it further includes: Using a feature screening algorithm, based on the feature set of the target audio signal, obtain a feature subset of the target audio signal.
7. A method for detecting the risk level of a lossless pipeline based on audio processing according to claim 1, characterized in that The classifier is any one of a support vector machine, a BP neural network, a convolutional neural network, a K-nearest neighbor, and a random forest.
8. A lossless pipeline risk level detection method based on audio processing according to claim 1, characterized in that, The risk level classification results include no risk, low risk, medium risk, and high risk.
Citation Information
Patent Citations
Noise suppression method and device and mobile terminal
CN110335620A
Pipeline leakage detection method and system based on audio processing
CN115264408A