Research on Leak Detection and Localization Algorithm for Oil and Gas Pipelines Using Wavelet Denoising Integrated with Long Short-Term Memory (LSTM)–Transformer Models - Yunbin Ma; Zuyue Shang; Jie Zheng; Yichen Zhang; Guangyuan Weng; Shu Zhao; Cheng Bi (Sensors)
Traditional leakage prediction models for long-distance pipelines have limitations in effectively synchronizing spatial and temporal features of leakage signals, leading to data processing that heavily relies on manual experience and exhibits insufficient generalization capabilities. This paper introduces a novel leakage detection and localization algorithm for oil and gas pipelines, integrating wavelet denoising with a Long Short-Term Memory (LSTM)-Transformer model. The proposed algorithm utilizes pressure sensors to collect real-time pipeline pressure data and applies wavelet denoising to eliminate noise from the pressure signals. By combining LSTM’s temporal feature extraction with the Transformer’s self-attention mechanism, we construct a short-term average pressure gradient-average instantaneous flow network model. This model continuously predicts pipeline flow based on real-time pressure gradient inputs, monitors deviations between actual and predicted flow, and employs a pressure curve distance algorithm to accurately determine the leakage location. Experimental results from the Jilin-Changchun long-distance oil pipeline demonstrate that the model possesses superior leakage warning and localization capabilities. Specifically, the leakage prediction accuracy reaches 99.995%, with a leakage location error margin below 2.5%. Additionally, the model can detect leaks exceeding 0.6% of the main pipeline flow without generating false alarms during operation.