In order to improve the accuracy of leakage detection in water pipelines, this paper proposes a novel method based on Transformer and transfer learning. A laboratory test platform was established to obtain datasets with rich leakage characteristics. An enhanced feature extraction technique using a shift window input method mapped the NPW sequences into embedding vectors, effectively capturing the fine-grained features while reducing the sequence length, thereby enhancing the Transformer’s retention of sequence details. An improved Transformer encoder was pre-trained on the Experimental pipeline dataset and refined with limited leakage data from real pipelines for accurate detection. Additionally, a novel signal difference-based method was introduced for precise leak localization. The pressure signal was denoised, and the inflection points were identified by subtracting two signals. The points between the inflection and lowest signal points were traversed, with slope calculations optimizing the time delay computations. A leakage simulation test was conducted on a section of a raw water pipeline in Shanghai, and the test results confirmed the effectiveness of these methods. A 100% detection rate, zero false alarms, and a relative positioning error of less than 3.14% were achieved on a test set of 45 instances.
Read full abstract