Pipeline leakage detection method based on acoustic signal spectrum noise reduction
Through rectangular window noise power spectrum estimation, wavelet packet decomposition and multi-feature entropy extraction, combined with local linear embedding algorithm and multi-sensor confidence weighted fusion, the problems of signal extraction distortion and inaccurate positioning in pipeline leakage detection are solved, and more efficient leak detection and positioning are achieved.
Patent Information
- Application Number
- CN202510905196.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-02
- Publication Date
- 2025-09-19
AI Technical Summary
The existing technology suffers from pipeline leakage signal extraction distortion, large positioning error, low multi-sensor positioning reliability under strong background noise, and insufficient feature characterization capability under complex working conditions, resulting in high missed detection rate, high false alarm rate and inaccurate positioning.
A rectangular window is used to estimate the noise power spectrum, combined with wavelet packet decomposition and multi-feature entropy extraction, and the classifier is optimized using the local linear embedding algorithm dimensionality reduction method. The multi-sensor confidence weighted fusion mechanism is combined for positioning, adaptive gain compensation and spectral subtraction operations.
It effectively reduces missed detection rate and positioning error, improves model generalization and positioning stability, reduces false alarm rate, and enhances leakage signal characterization capability and positioning reliability under complex working conditions.
Smart Images

Figure CN120667653A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of pipeline leakage monitoring, and in particular relates to a pipeline leakage detection method based on acoustic signal spectrum subtraction and noise reduction. Background Art
[0002] Pipeline leak detection generally uses acoustic sensors to collect noise signals and analyze abnormal sound wave characteristics to determine leaks. Mainstream solutions rely on fixed threshold methods (such as signal energy thresholds) or spectrum peak detection (such as sudden energy increases in specific frequency bands). Multi-sensor positioning is mainly based on the time difference of cross-correlation (TDOA) method, which does not consider the impact of environmental interference on positioning accuracy. Spectral subtraction is used to suppress background noise, but it has two key flaws: directly using a Hanning window for noise estimation results in insufficient smoothing of the noise power spectrum (a rectangular window better preserves noise details); directly splicing the denoised signal frames causes energy loss, and weak leakage signals may be over-suppressed; The main technical issues currently being addressed are: 1. Distortion in leakage signal extraction under strong background noise: Traditional spectral subtraction uses a symmetric window function (such as a Hanning window) to estimate the noise power spectrum. This oversmoothes noise details in sudden industrial noise scenarios, resulting in blurred leakage features after noise reduction. Direct frame splicing during inverse transform signal reconstruction causes energy discontinuity (especially in low-frequency bands) and time domain waveform distortion. This results in an increased missed detection rate (weak leakage signals are drowned out by noise) and increased positioning errors.
[0003] 2. Insufficient ability to characterize complex working conditions: Existing methods use single-type features (such as energy thresholds or spectral entropy) and are unable to capture the multi-scale nonlinear characteristics of leakage signals (such as the difference in entropy changes between transient impacts and continuous leakage). When high-dimensional features are input into the classifier, there is a dimensionality curse, the model's generalization ability decreases (especially obvious in small sample scenarios), which will lead to an increase in false alarm rates (fluid turbulence is misjudged as leakage) and the failure of model migration across scenarios.
[0004] 3. Low reliability of multi-sensor positioning: Time difference calculation relies on cross-correlation peaks, which are prone to peak offset in low signal-to-noise ratio environments. A sensor confidence assessment mechanism has not been established, allowing faulty sensors or low-quality signals to be directly involved in positioning calculations. This can cause jumps in positioning results (for example, the coordinates of the leak point fluctuate by more than ±10 meters), making it difficult for operations and maintenance personnel to respond quickly. Summary of the Invention
[0005] In order to solve the above problems existing in the prior art, the present invention provides a pipeline leakage detection method based on acoustic signal spectrum subtraction and noise reduction. The purpose of the present invention can be achieved through the following technical solutions: A pipeline leakage detection method based on acoustic signal spectrum subtraction and noise reduction, comprising: S1: When there is no leakage in the pipeline or the background noise is stable, a pure background noise signal is collected as a noise analysis sample by an acoustic sensor; the noise analysis sample is framed and windowed, and then a noise power spectrum is estimated to obtain an average noise power spectrum estimate; S2: collecting an original acoustic signal containing a potential leak through an acoustic sensor; performing frame processing on the original acoustic signal; S3: adding a window to each frame of the original acoustic signal after the framing process, performing a discrete Fourier transform on the windowed signal frame to obtain a complex spectrum; and separating the amplitude spectrum and phase angle information of the complex spectrum; S4: performing spectrum subtraction on the amplitude spectrum of the current frame by estimating the average noise power spectrum to obtain the amplitude spectrum after noise reduction; S5: Recombining the denoised amplitude spectrum with the retained original phase angle to form a denoised complex spectrum; performing an inverse discrete Fourier transform on the denoised complex spectrum to obtain a denoised time domain signal frame; and directly splicing the denoised time domain signal frame into a continuous denoised acoustic signal; S6: extracting features from the continuous noise reduction acoustic signal, performing anomaly detection on the current signal segment using a pipeline leakage detection model, and outputting a leakage signal segment; S7: Locate the leakage point according to the time difference between the leakage signal segments reaching different sensors.
[0006] Specifically, the windowing process of the noise analysis sample is a rectangular window, and the frame length of the noise analysis sample is consistent with that of the original acoustic signal.
[0007] Specifically, the noise power spectrum estimation method is: Select the noise segment, divide it into frames, perform discrete Fourier transform on each frame of noise signal, and calculate its amplitude spectrum; The power spectra of all noise frames are averaged to obtain an estimate of the average noise power spectrum under the background environment.
[0008] Specifically, the feature extraction in S6 includes: Perform wavelet packet decomposition on the denoised signal to extract energy entropy and permutation entropy; The difference of the signal accumulation values of adjacent time domain intervals is calculated, and the energy entropy, permutation entropy and signal accumulation value difference are fused into a multi-feature entropy vector and input into the pipeline leakage detection model.
[0009] Specifically, the pipeline leakage detection model adopts an SVM classifier, and its training process includes: The local linear embedding algorithm is used to reduce the seven-dimensional feature vector to three dimensions, and the radial basis kernel function is used to optimize the classification boundary.
[0010] Furthermore, the seven-dimensional feature vector received by the pipeline leakage detection model includes envelope entropy for analyzing the energy distribution of the signal envelope, approximate entropy for measuring signal regularity, fuzzy entropy for enhancing robustness to noise interference, sample entropy for characterizing signal complexity, and multi-feature entropy vector.
[0011] Specifically, the time difference positioning in S7 specifically includes: For the same leakage event, the peak of the cross-correlation function is extracted from the multi-sensor signals to determine the arrival time difference; the leakage point location is calculated based on the sensor spacing and sound speed.
[0012] Specifically, when a leakage signal segment is detected, the sound and light alarm is triggered and the positioning coordinates are sent to the host computer; the leakage point location and confidence level are marked on the pipeline topology map.
[0013] Specifically, the multi-sensor confidence weighted fusion mechanism performs a comprehensive assessment of leak point location, including: When a single sensor detects a leakage signal, the time domain signal-to-noise ratio and frequency domain energy entropy of the corresponding sensor signal are calculated as confidence weight factors; When multiple sensors detect related leakage events simultaneously, an adaptive federated filtering algorithm is used to fuse the time difference measurements of each sensor, in which the filter gain matrix is dynamically adjusted according to the confidence weight. When the positioning result is output, a positioning confidence score is attached.
[0014] Specifically, in S5, adaptive gain compensation is performed before splicing the noise-reduced time domain signal frames: An energy ratio between the original noisy signal frame and the noise-reduced signal frame is calculated, and the noise-reduced frame is scaled according to the energy ratio.
[0015] The beneficial effects of the present invention are: The present invention uses a rectangular window to estimate the noise power spectrum, which retains more noise details and avoids the problem of over-smoothing noise in sudden industrial noise scenarios caused by traditional symmetric window functions, making the leakage characteristics clearer after noise reduction and effectively reducing the missed detection rate and positioning error. By fusing multiple types of features to form a multi-feature entropy vector and using a local linear embedding algorithm for dimensionality reduction, the ability to characterize the multi-scale nonlinear characteristics of leakage signals under complex working conditions is enhanced, overcoming the limitations of single-type features, improving the generalization of the model, reducing the false alarm rate, and improving the effectiveness of model migration across scenarios. A multi-sensor confidence weighted fusion mechanism is established, which can reduce the impact of cross-correlation peak offset on time difference calculation in a low signal-to-noise ratio environment, while avoiding interference of faulty sensors or low-quality signals on positioning calculations, making positioning results more stable and reliable, and facilitating rapid response by operation and maintenance personnel. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] To facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0017] Figure 1 Schematic diagram of a pipeline leakage detection method based on acoustic signal spectrum subtraction and noise reduction according to the present invention; DETAILED DESCRIPTION
[0018] In order to further illustrate the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0019] See also Figure 1 , a pipeline leakage detection method based on acoustic signal spectrum subtraction and noise reduction, comprising: S1: When there is no leakage in the pipeline or the background noise is stable, a pure background noise signal is collected by an acoustic sensor as a noise analysis sample; the noise analysis sample is framed and windowed, and then a noise power spectrum is estimated to obtain an average noise power spectrum estimate.
[0020] S2: collecting an original acoustic signal containing a potential leak through an acoustic sensor; performing frame processing on the original acoustic signal; S3: adding a window to each frame of the original acoustic signal after the framing process, performing a discrete Fourier transform on the windowed signal frame to obtain a complex spectrum; and separating the amplitude spectrum and phase angle information of the complex spectrum; S4: performing spectrum subtraction on the amplitude spectrum of the current frame by estimating the average noise power spectrum to obtain the amplitude spectrum after noise reduction; S5: Recombining the denoised amplitude spectrum with the retained original phase angle to form a denoised complex spectrum; performing an inverse discrete Fourier transform on the denoised complex spectrum to obtain a denoised time domain signal frame; and directly splicing the denoised time domain signal frame into a continuous denoised acoustic signal; S6: extracting features from the continuous noise reduction acoustic signal, performing anomaly detection on the current signal segment using a pipeline leakage detection model, and outputting a leakage signal segment; S7: Locate the leakage point according to the time difference between the leakage signal segments reaching different sensors.
[0021] Specifically, the windowing process of the noise analysis sample is a rectangular window, and the frame length of the noise analysis sample is consistent with that of the original acoustic signal.
[0022] Specifically, the noise power spectrum estimation method is: Select the noise segment, divide it into frames, perform discrete Fourier transform on each frame of noise signal, and calculate its amplitude spectrum; The power spectra of all noise frames are averaged to obtain an estimate of the average noise power spectrum under the background environment.
[0023] In this embodiment, the original signal x(n) is divided into frames of length L, with no overlap between frames, and windowed; , Where w(n) is the window function; Embedded systems need to process streaming audio, and frame overlay processing will cause frame overlap distortion. A rectangular window is used to avoid distortion. The core formula for noise power spectrum estimation is discrete Fourier transform and average noise power spectrum. Take a pure noise segment, divide it into frames, and calculate its average amplitude spectrum as the noise estimate: , Among them, n m (k) is the mth frame noise, M is the noise frame, and FFT represents discrete Fourier transform.
[0024] The example code for MATLAB is as follows: { oise_segment = audio(noise_start:noise_end); num_noise_frames = floor(length(noise_segment) / frame_length); noise_psd = zeros(frame_length, 1); for i = 1:num_noise_frames frame = noise_segment((i-1)*frame_length+1:i*frame_length) .* win; noise_psd = noise_psd + abs(fft(frame)); end noise_psd = noise_psd / num_noise_frames; } In this embodiment, spectral subtraction is performed by mag_denoised = max(mag - alpha*noise_psd, beta*noise_psd), and the mathematical expression is: , Among them, α is the over-reduction factor, which is used to control the noise reduction strength and balance the signal-to-noise ratio improvement and speech distortion; β is the spectrum lower limit coefficient, which is used to set the base noise layer and suppress music noise; Y(k) is the frequency domain signal after noise suppression processing, which means the signal amplitude after noise suppression algorithm processing at the kth frequency point; X(k) is the original frequency domain signal, which means the signal amplitude without noise suppression processing at the kth frequency point; P noise (k) is the noise power spectrum, which represents the estimated noise power at the kth frequency point; While suppressing noise, it avoids causing excessive distortion to the speech signal and suppresses noise by setting a spectrum lower limit.
[0025] Specifically, the feature extraction in S6 includes: Perform wavelet packet decomposition on the denoised signal to extract energy entropy and permutation entropy; The difference of the signal accumulation values of adjacent time domain intervals is calculated, and the energy entropy, permutation entropy and signal accumulation value difference are fused into a multi-feature entropy vector and input into the pipeline leakage detection model.
[0026] Specifically, the pipeline leakage detection model adopts an SVM classifier, and its training process includes: The local linear embedding algorithm is used to reduce the seven-dimensional feature vector to three dimensions, and the radial basis kernel function is used to optimize the classification boundary.
[0027] Furthermore, the seven-dimensional feature vector received by the pipeline leakage detection model includes envelope entropy for analyzing the energy distribution of the signal envelope, approximate entropy for measuring signal regularity, fuzzy entropy for enhancing robustness to noise interference, sample entropy for characterizing signal complexity, and multi-feature entropy vector.
[0028] In this embodiment, the db4 wavelet basis is selected for wavelet packet decomposition, the number of decomposition levels is set to 3, and 8 sub-bands are generated; the energy entropy calculation formula is: , Among them, E e is the energy entropy, E i is the energy of each sub-band, E total is the total energy; After determining the embedding dimension and time delay, the probability distribution of the sequence arrangement pattern is calculated. The permutation entropy is calculated by the probability distribution of the sequence arrangement pattern: , Calculate the difference of the accumulated values of adjacent windows according to the window that segments the signal; The sample code for SVM classifier training and optimization is as follows: { # Pseudocode implementation (based on Scikit-learn) from sklearn.manifold import LocallyLinearEmbedding from sklearn.svm import SVC from sklearn.pipeline import Pipeline #Step 1: LLE dimensionality reduction [
[10] ][
[15] ] lle = LocallyLinearEmbedding(n_components=3, n_neighbors=15, method='standard') # Number of neighborhood points = 15 # Step 2: RBF-SVM classifier svm = SVC(kernel='rbf', gamma='scale', C=1.0, decision_function_shape='ovo') # Build the training pipeline model = Pipeline([('lle', lle), ('svm', svm)]) # Training and validation (sample division) X_train, X_test, y_train, y_test = train_test_split(features, labels,test_size=0.3, stratify=labels) model.fit(X_train, y_train) } Among them, LLE dimensionality reduction determines the optimal number of neighbors by minimizing the reconstruction error: test k = 5~20, and select the minimum k value with reconstruction error ≤ 0.05; output three-dimensional feature space; Grid search + cross validation is used to optimize hyperparameters, and the optimal parameter combination maximizes the decision boundary distance.
[0029] Specifically, the time difference positioning in S7 specifically includes: For the same leakage event, the peak of the cross-correlation function is extracted from the multi-sensor signals to determine the arrival time difference; the leakage point location is calculated based on the sensor spacing and sound speed.
[0030] Specifically, when a leakage signal segment is detected, the sound and light alarm is triggered and the positioning coordinates are sent to the host computer; the leakage point location and confidence level are marked on the pipeline topology map.
[0031] Specifically, the multi-sensor confidence weighted fusion mechanism performs a comprehensive assessment of leak point location, including: When a single sensor detects a leakage signal, the time domain signal-to-noise ratio and frequency domain energy entropy of the corresponding sensor signal are calculated as confidence weight factors; When multiple sensors detect related leakage events simultaneously, an adaptive federated filtering algorithm is used to fuse the time difference measurements of each sensor, in which the filter gain matrix is dynamically adjusted according to the confidence weight. When the positioning result is output, a positioning confidence score is attached.
[0032] In this embodiment, the calculation formula for the positioning credibility score is: , Among them, C is the credibility score, w i is the sensor confidence weight, t i is the arrival time measurement, is the time estimate after fusion, σ t is the standard deviation of the system time difference measurement; Through dynamic weight fusion and credibility assessment, the robustness of small leakage positioning in complex noise environments is significantly improved, and the positioning jump problem caused by multipath interference is solved.
[0033] Specifically, in S5, adaptive gain compensation is performed before splicing the noise-reduced time domain signal frames: An energy ratio between the original noisy signal frame and the noise-reduced signal frame is calculated, and the noise-reduced frame is scaled according to the energy ratio.
[0034] In this embodiment, the energy ratio of the original noisy signal frame and the noise-reduced signal frame is calculated: , Among them, G k is the energy ratio, k is the frame index, N is the frame length, and ϵ is the minimum constant to prevent zero division.
[0035] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any person skilled in the art can make some changes or modifications to equivalent embodiments using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A pipeline leakage detection method based on acoustic signal spectrum subtraction and noise reduction, characterized in that: include: S1: When there is no leakage in the pipeline or the background noise is stable, the acoustic sensor collects pure background noise signals as noise analysis samples; Performing frame and window processing on the noise analysis samples and then performing noise power spectrum estimation to obtain an average noise power spectrum estimation; S2: collecting an original acoustic signal containing a potential leak through an acoustic sensor; performing frame processing on the original acoustic signal; S3: adding a window to each frame of the original acoustic signal after the framing process, performing a discrete Fourier transform on the windowed signal frame to obtain a complex spectrum; and separating the amplitude spectrum and phase angle information of the complex spectrum; S4: performing spectrum subtraction on the amplitude spectrum of the current frame by estimating the average noise power spectrum to obtain the amplitude spectrum after noise reduction; S5: Recombining the denoised amplitude spectrum with the retained original phase angle to form a denoised complex spectrum; performing an inverse discrete Fourier transform on the denoised complex spectrum to obtain a denoised time domain signal frame; and directly splicing the denoised time domain signal frame into a continuous denoised acoustic signal; S6: extracting features from the continuous noise reduction acoustic signal, performing anomaly detection on the current signal segment using a pipeline leakage detection model, and outputting a leakage signal segment; S7: Locate the leakage point according to the time difference between the leakage signal segments reaching different sensors.
2. The method according to claim 1, characterized in that The windowing process of the noise analysis sample is a rectangular window, and the frame length of the noise analysis sample is consistent with that of the original acoustic signal.
3. The method according to claim 1, characterized in that The method for estimating the noise power spectrum is: Select the noise segment, divide it into frames, perform discrete Fourier transform on each frame of noise signal, and calculate its amplitude spectrum; The power spectra of all noise frames are averaged to obtain an estimate of the average noise power spectrum under the background environment.
4. The method according to claim 1, wherein The feature extraction in S6 includes: Perform wavelet packet decomposition on the denoised signal to extract energy entropy and permutation entropy; The difference of the signal accumulation values of adjacent time domain intervals is calculated, and the energy entropy, permutation entropy and signal accumulation value difference are fused into a multi-feature entropy vector and input into the pipeline leakage detection model.
5. The method according to claim 1, wherein The pipeline leakage detection model adopts SVM classifier, and its training process includes: The local linear embedding algorithm is used to reduce the seven-dimensional feature vector to three dimensions, and the radial basis kernel function is used to optimize the classification boundary.
6. The method according to claim 5, characterized in that The seven-dimensional feature vector received by the pipeline leakage detection model includes envelope entropy for analyzing the energy distribution of the signal envelope, approximate entropy for measuring signal regularity, fuzzy entropy for enhancing robustness to noise interference, sample entropy for characterizing signal complexity, and a multi-feature entropy vector.
7. The method according to claim 1, characterized in that The time difference positioning in S7 specifically includes: For the same leakage event, the peak of the cross-correlation function is extracted from the multi-sensor signals to determine the arrival time difference; the leakage point location is calculated based on the sensor spacing and sound speed.
8. The method according to claim 1, characterized in that When a leakage signal segment is detected, the sound and light alarm is triggered and the positioning coordinates are sent to the host computer; the leakage point location and confidence level are marked on the pipeline topology map.
9. The method according to claim 1, characterized in that The multi-sensor confidence-weighted fusion mechanism performs a comprehensive assessment of leak location, including: When a single sensor detects a leakage signal, the time domain signal-to-noise ratio and frequency domain energy entropy of the corresponding sensor signal are calculated as confidence weight factors; When multiple sensors detect related leakage events simultaneously, an adaptive federated filtering algorithm is used to fuse the time difference measurements of each sensor, in which the filter gain matrix is dynamically adjusted according to the confidence weight. When the positioning result is output, a positioning confidence score is attached.
10. The method according to claim 1, characterized in that Before splicing the noise-reduced time domain signal frames in S5, adaptive gain compensation is performed: An energy ratio between the original noisy signal frame and the noise-reduced signal frame is calculated, and the noise-reduced frame is scaled according to the energy ratio.
Citation Information
Cited By
Method for identifying internal leakage of liquid hydrogen C-type ball valve based on acoustic emission frequency characteristics
CN121829919A
Method for identifying liquid hydrogen c-type ball valve internal leakage based on acoustic emission frequency characteristics
CN121829919B