Pipeline leakage detection method and device, electronic equipment and storage medium

By generating leakage signals under different conditions and building a deep learning model, the problem of insufficient pipeline leakage detection accuracy caused by dataset limitations was solved, and higher accuracy leakage detection and location were achieved.

CN118088953BActive Publication Date: 2026-06-23NORTHEAST GASOLINEEUM UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHEAST GASOLINEEUM UNIV
Filing Date
2024-03-27
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

In existing technologies, limitations in datasets significantly impact algorithm performance, making it difficult to effectively detect and locate pipeline leaks in various situations, and the accuracy of leak location needs improvement.

Method used

By acquiring the first leakage signal of the pipeline under the first condition, a second leakage signal under the second condition is generated. A leakage detection model is constructed using the first and second leakage signals, including using multiple acoustic sensors to detect signals, generating leakage signals at different distance multiples, and performing signal processing and noise identification through a deep learning model, and constructing a feature interaction module to optimize signal strength.

Benefits of technology

It enables effective amplification of leakage signal samples in various scenarios, improves the detection accuracy and applicability of the model, and enhances the accuracy and location precision of pipeline leakage detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118088953B_ABST
    Figure CN118088953B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a pipeline leakage detection method and device, electronic equipment and storage medium, the method comprising: acquiring a first leakage signal of a pipeline under a first condition; generating a second leakage signal under a second condition based on the first leakage signal, the signal detection step length under the second condition being smaller than the signal detection step length of the first condition, the signal detection step length being a reference distance between a sensor and a leakage point; constructing a leakage detection model using the first leakage signal and the second leakage signal; and performing processing on the leakage signal using the leakage detection model to detect a leakage event. The embodiments of the present disclosure can improve the leakage detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of pipeline signal processing technology, and in particular to a pipeline leak detection method and apparatus, electronic equipment and storage medium. Background Technology

[0002] Pipeline transportation is crucial to the global oil and gas industry, but leaks are becoming increasingly prominent. Rapid and accurate leak detection and location are essential for reducing economic and environmental losses. In recent years, data-driven leak detection and location have become a research hotspot. By monitoring parameters such as pressure, flow rate, temperature, and density of internal fluids and using machine learning algorithms for analysis, rapid leak detection and accurate location can be achieved. These technologies are of great significance to social and public safety and are expected to continue to play a vital role in the future. Significant progress has been made in the field of pipeline leak detection and location. However, some key issues still require further research and resolution:

[0003] (1) The limitations of the dataset have a significant impact on the performance of the algorithm; due to the limited number of leaked samples in the dataset, it is difficult to detect and effectively locate leaked events in multiple situations.

[0004] (2) The accuracy of leak location needs to be further improved. Summary of the Invention

[0005] This disclosure presents a pipeline leak detection method, apparatus, electronic equipment, and storage medium applicable to the detection and location of multiple leak scenarios.

[0006] According to one aspect of this disclosure, a pipeline leakage detection method is provided, comprising:

[0007] Obtain the first leakage signal of the pipeline under the first condition;

[0008] A second leakage signal under a second condition is generated based on the first leakage signal. The signal detection step size under the second condition is smaller than the signal detection step size under the first condition. The signal detection step size is the reference distance between the sensor and the leakage point.

[0009] A leak detection model is constructed using the first and second leak signals;

[0010] The leakage detection model is used to process the leakage signal and detect leakage events.

[0011] In some possible implementations, obtaining the first leakage signal of the pipeline under the first condition includes:

[0012] Acoustic signals are detected using multiple acoustic sensors installed on the at least one pipe, wherein the distance between the acoustic sensors and the leak point is a multiple of a first distance;

[0013] The first leakage signal is generated based on the acoustic signal and the leakage tag corresponding to the acoustic signal, wherein the leakage tag includes the spacing and the aperture of the leakage point.

[0014] In some possible implementations, generating a second leakage signal based on the first leakage signal under a second condition includes: using the first leakage signal to generate a second leakage signal located at a second distance multiple of the leakage point, wherein the second distance is less than the first distance;

[0015] The step of generating a second leakage signal located at a second distance multiple of the leakage point using the first leakage signal includes:

[0016] Obtain the time difference between the peak values ​​of the first leakage signals from two sensors on the same pipeline;

[0017] The propagation speed of the first leakage signal is determined based on the time difference;

[0018] The relationship between the interpeak distance of the first leakage signal and the location of the leakage point is determined using the propagation speed and the location of the leakage point;

[0019] The first leakage signal is time-domain shifted using the aforementioned correspondence to obtain the second leakage signal.

[0020] In some possible implementations, generating a second leakage signal located at a second distance multiple of the leakage point using the first leakage signal further includes:

[0021] Noise-adding processing is performed on the first leakage signal and the second leakage signal respectively to obtain a first noisy leakage signal and a second noisy leakage signal;

[0022] A preset model is trained using the first noisy leaked signal to obtain a first model capable of identifying noise information and leak labels in the first noisy leaked signal; and the preset model is trained using the second noisy leaked signal to obtain a second model capable of identifying noise information and corresponding leak labels in the second leaked signal.

[0023] A third model is trained using the first and second noisy leakage signals, and a second leakage signal with optimized signal strength is output based on the third model. The third model includes a first branch consisting of a first encoder and a first feature-guided generation module of the first model, a second branch consisting of a second encoder and a second feature-guided generation module of the second model, a feature interaction module that fuses and interacts with the first and second branches, and a decoder for outputting the second leakage signal with optimized strength.

[0024] In some possible implementations, training the third model using the first and second noisy leakage signals includes:

[0025] The parameters of the second encoder and the second feature-guided generation module of the second model are fixed, and the first encoder and the first feature-guided generation module of the first model are transferred and trained.

[0026] and / or

[0027] The initial parameters of the decoder of the third model are the same as the decoder parameters of the second model.

[0028] In some possible implementations, the first feature generation module and the second generation module have the same structure and are configured as follows:

[0029] Obtain the conditional encoding for the input leakage signal;

[0030] The conditional coding is used to perform feature guidance and fusion processing on the input coded features to obtain guided fused features.

[0031] In some possible implementations, the feature interaction module is configured to perform feature interaction processing on the guided fusion features output by the first branch and the second branch;

[0032] The interactive processing includes performing cross-attention processing on the guided fusion features output by the first branch and the second branch;

[0033] And / or the method further includes:

[0034] Max pooling and average pooling are performed on the guided fusion features output by the first branch and the second branch respectively, and the pooling results are added together to obtain the pooling features of the first branch and the second branch respectively.

[0035] Based on the principle of feature similarity, the order of another set of pooling features is adjusted according to a set of pooling features to obtain matching feature pairs;

[0036] The cross-attention processing is performed according to the matching feature pairs.

[0037] According to a second aspect of this disclosure, a pipeline leak detection device is provided, comprising: a leak detection model for processing pipeline leak signals and detecting leak events; wherein, constructing the leak detection model includes:

[0038] Obtain the first leakage signal of the pipeline under the first condition;

[0039] A second leakage signal under a second condition is generated based on the first leakage signal. The signal detection step size under the second condition is smaller than the signal detection step size under the first condition. The signal detection step size is the reference distance between the sensor and the leakage point.

[0040] A leak detection model is constructed using the first and second leak signals;

[0041] The leakage detection model is used to process the leakage signal and detect leakage events.

[0042] According to a third aspect of this disclosure, an electronic device is provided, comprising:

[0043] processor;

[0044] Memory used to store processor-executable instructions;

[0045] The processor is configured to invoke instructions stored in the memory to execute the method described in any one of the first aspects.

[0046] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the method described in any one of the first aspects.

[0047] Based on the above configuration, the embodiments of this disclosure can generate leakage signals under various scenarios and conditions based on pipeline leakage signals under specific conditions, thereby effectively amplifying leakage signal samples and improving the detection accuracy of the constructed model.

[0048] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure.

[0049] Other features and aspects of this disclosure will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description

[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.

[0051] Figure 1This is a flowchart of a pipeline leak detection method according to an embodiment of the present disclosure;

[0052] Figure 2 This is a schematic diagram of the pipeline structure for collecting leakage signals according to an embodiment of this disclosure;

[0053] Figure 3 This disclosure includes a schematic diagram of a pipeline leakage structure according to an embodiment.

[0054] Figure 4 A flowchart illustrating the construction of a pipeline leak detection model according to embodiments of this disclosure;

[0055] Figure 5 This is a flowchart illustrating the noise addition and reverse noise reduction processes performed on a leaked signal according to embodiments of this disclosure.

[0056] Figure 6 This is a flowchart of the feature processing of the feature-guided generation module in an embodiment of this disclosure;

[0057] Figure 7 This is a flowchart of the feature processing of the feature interaction module in an embodiment of this disclosure;

[0058] Figure 8 This is a schematic diagram of the structure of the pipeline leak detection device according to an embodiment of the present disclosure;

[0059] Figure 9 A block diagram of an electronic device 800 according to an embodiment of the present disclosure is shown;

[0060] Figure 10 A block diagram of another electronic device 1900 according to an embodiment of the present disclosure is shown. Detailed Implementation

[0061] Various exemplary embodiments, features, and aspects of this disclosure will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.

[0062] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.

[0063] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0064] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.

[0065] The pipeline leak detection method provided in this disclosure can be executed by a signal processing device. For example, the pipeline leak detection method can be executed by a terminal device, a server, or other processing device. The terminal device can be a user equipment (UE), mobile device, user terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, vehicle-mounted device, wearable device, etc. In some possible implementations, the pipeline leak detection method can be implemented by a processor calling computer-readable instructions stored in memory.

[0066] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further.

[0067] Figure 1 A flowchart illustrating a pipeline leak detection method according to an embodiment of this disclosure is shown, such as... Figure 1 As shown, the pipeline leak detection method includes:

[0068] S10: Obtain the first leakage signal of the pipeline under the first condition;

[0069] In some possible implementations, leakage signals from the pipeline can be collected to form a dataset. The pipeline may include natural gas pipelines, water pipelines, oil pipelines, etc., and this disclosure does not specifically limit this. By setting sensors at different locations along the pipeline, the corresponding sensing signals can be detected and used as leakage signals in embodiments of this disclosure. The sensors may include one or more of acoustic sensors, pressure sensors, temperature sensors, and flow sensors. A first condition includes that the distance between the sensor and the leak point is a multiple of a first distance, such as 10 meters. Additionally, the leakage signals obtained in embodiments of this disclosure also include a leakage label indicating the pipeline leakage condition. The leakage label may include the size of the leak orifice and the distance between the leak point and the pipeline inlet or sensor.

[0070] S20: Generate a second leakage signal under the second condition based on the first leakage signal. The signal detection step size under the second condition is smaller than the signal detection step size under the first condition. The signal detection step size is the reference distance between the sensor and the leakage point.

[0071] In some possible implementations, embodiments of this disclosure perform data augmentation processing on the first leakage signal obtained under the first condition to obtain a second leakage signal under the second condition. Since the leakage signal obtained under the first condition is singular and not conducive to detecting different leakage situations, embodiments of this disclosure obtain the second leakage signal under the second condition based on the first leakage signal under the first condition. In the second condition, the second distance between the sensor and the leak point is smaller than the first distance; for example, the second distance can be 2.5m or 5m. This method can increase leakage data with smaller leakage distances, improving the detection accuracy of pipeline leaks.

[0072] S30: Construct a leak detection model using the first and second leak signals;

[0073] In some possible implementations, given the first and second leakage signals, a deep learning network can be trained using the dataset constructed from both to obtain a leakage detection model.

[0074] S40: The leakage detection model is used to process the leakage signal and detect leakage events.

[0075] In some possible implementations, leakage signals collected on-site can be used for leakage detection to detect the occurrence of a leak and locate the leak point.

[0076] Based on the above configuration, the embodiments of this disclosure can utilize leakage data under certain conditions to expand the leakage data and construct a pipeline leakage detection model that can achieve leakage detection at a smaller distance, thus having better applicability and detection accuracy.

[0077] The process of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings. Figure 2 This is a schematic diagram of a pipeline structure according to an embodiment of this disclosure. Figure 2 As shown, the pipeline in this embodiment of the disclosure may include a gas pipeline and an oil pipeline, and multiple sensors, such as acoustic sensors, are installed on the pipelines respectively. In other embodiments, temperature / flow sensors may also be included. Figure 2In this example, sensor A is installed at the pipe inlet, and sensors B and C are installed at the pipe outlet. In other embodiments, multiple sensors can be adaptively installed, and this disclosure does not specifically limit this. The distances between the sensors and the pipe leak points are multiples of a reference distance of 10m. Simultaneously, multiple leak points are installed on the pipe, with a distance of 10m between each leak point. In other embodiments, more sensors can be installed, and different reference distances can be used.

[0078] This disclosure embodiment can adjust the leakage state of different leak points and use sensors to collect leakage signals. All collected leakage signals can constitute a dataset of the first leakage signal of this disclosure embodiment. When setting the leak point location, the size of the leak orifice and the pipe flow rate can also be set simultaneously. At least one of the following information can be used as a leak tag for the first leakage signal collected by the sensors: leak orifice size, distance from the leak point (leak point location), and flow rate. In other words, in this disclosure embodiment, obtaining the first leakage signal of the pipe under the first condition includes: detecting acoustic signals using multiple acoustic sensors disposed on the at least one pipe, the distance between the acoustic sensors and the leak point being a multiple of a first distance; generating the first leakage signal based on the acoustic signals and the corresponding leak tags, the leak tags including the distance and the orifice size of the leak point.

[0079] Specifically, the leak signal inside the pipe is a one-dimensional sequence including leak events, wherein the acquisition method may include at least one of the following:

[0080] A) Directly utilize acoustic wave sensors to collect signal sequences of leakage events; acoustic wave sensors are not intended to be a specific limitation of this disclosure;

[0081] B) Transmitting and receiving a one-dimensional signal sequence of a leakage event via an electronic device; embodiments of this disclosure may receive leakage signals transmitted by other electronic devices via communication, and the communication method may include wired communication and / or wireless communication, which is not specifically limited in this disclosure.

[0082] C) Read the leakage signal sequence of the leakage event stored in the database; the embodiments of this disclosure can read the leakage signal sequence stored locally or stored in the server according to the received data reading instruction, and this disclosure does not make specific limitations in this regard.

[0083] like Figure 2As shown, this disclosed gas pipeline leak detection system can include: a pipeline system, a leak point, and a signal acquisition system. The pipeline system mainly includes an operating system, a water storage tank, a gas storage tank, an air compressor, a water pump, and a water-gas assembly to obtain leak signals in the two-phase water-gas system. The pipeline is 169 meters long, with a wall thickness of 4 mm and an outer diameter of 50.3 mm. It is made of 304 stainless steel. Regarding fluid dynamics parameters, the Mach number is set to 0.04, and the Reynolds number to 1.32 × 10^5. According to design standards, this experimental device approximates a natural gas pipeline; for safety reasons, air is used instead of natural gas. According to Chinese medium-pressure natural gas pipeline standards, the internal pressure of the pipeline is set to 0.5 ± 0.02 MPa. Vibration isolation measures are implemented between the pipeline and the ground.

[0084] In this embodiment, a total of 12 leak points are set, with each leak point 10 meters apart. The operating system can monitor the real-time values ​​of pressure, temperature, and flow sensors located at the pipeline inlet and outlet. Communication is conducted via the RS-485 protocol, and the pipeline pressure is automatically controlled by a flow controller. An acoustic sensor, Sensor A, is installed at the pipeline inlet, while Sensors B and C are installed at the outlet, 10 meters apart. This embodiment can also use multiple sensors, with a first distance of 10 meters between the sensors, and the distance between the sensors and the leak points is a multiple of this first distance.

[0085] The leakage signal acquisition system mainly consists of the NIPXIe-1082 signal acquisition component and a piezoelectric ceramic sensor-based acoustic pressure sensor. With a sampling frequency of 2kHz, the signal acquisition component can collect acoustic pressure signals from the sensor inside the pipeline in real time.

[0086] During signal acquisition, an air compressor needs to be activated to apply pressure to the pipeline, adjusting the internal pressure to 0.5 ± 0.02 MPa. Simultaneously, ensuring the flow and circulation of high-pressure gas within the pipeline is also crucial. To ensure the reliability of the leak signal captured based on the characteristics of the acoustic pressure sensor, the high-pressure gas flowing within the pipeline and the noise generated during machine operation are used as background noise to more accurately simulate real pipeline transportation conditions. The leak signal is superimposed on this background noise. After the machine has been running stably for a period of time, experiments with four different leak orifice diameters are conducted at each leak location.

[0087] Different levels of leakage were simulated using plugs with varying orifice diameters (0.4 mm, 1 mm, 2 mm, 3 mm). During leak signal acquisition, high-pressure gas flow was maintained within the pipe, and 50 repeated experiments were performed for each leak point and each orifice diameter to ensure statistical significance. The acquired leak signals were synchronously recorded by an acoustic sensor. These signals were temporally aligned and spatially formed into multi-channel data, which served as model input to maximize the preservation of both temporal and spatial information about the leak. Ultimately, this embodiment of the present disclosure constructed a first leak signal dataset within the pipe containing 2400 data samples, encompassing 48 different data types. Each sample underwent two types of labeling: the orifice diameter size and the distance of the leak location from the inlet. This data was divided into a training set (1440 samples), a validation set (480 samples), and a test set (480 samples) for model parameter optimization and evaluation. Additionally, the operating environment consisted of a Windows 10 64-bit operating system, an Intel Core i5-7300HQ CPU @ 2.50GHz, and a GTX 1050 2GB graphics card. The deep learning framework used was PyTorch 1.7.1 and Python 3.8.

[0088] After obtaining the first leakage signal, a second leakage signal under second conditions can be generated using the first leakage signal. Generating the second leakage signal under second conditions based on the first leakage signal includes: generating a second leakage signal located at a second distance multiple of the leakage point, where the second distance is less than the first distance. Specifically, embodiments of this disclosure can generate a leakage signal, i.e., a second leakage signal, at a distance less than the first distance from the leakage point, based on the first leakage signal. The detection accuracy of the leakage detection model constructed using the second leakage signal and the first leakage signal can then be improved. The second distance can be 5m or 2.5m, but this is not a specific limitation of this disclosure.

[0089] In some possible implementations, generating a second leakage signal using a first leakage signal includes: acquiring the time difference between the peak values ​​of the first leakage signals from two sensors on the same pipe; determining the propagation speed of the first leakage signal based on the time difference; determining the correspondence between the distance between the peaks of the first leakage signal and the location of the leakage point using the propagation speed and the location of the leakage point; and performing a time-domain shift on the first leakage signal using the correspondence to obtain the second leakage signal.

[0090] Specifically, such as Figure 3The diagram shows a schematic of a pipeline leakage structure according to an embodiment of this disclosure. In this embodiment, the propagation speed of the leaking acoustic signal inside the pipe is first obtained. The relationship between wave velocity and sampling rate is used to obtain the proportional relationship between the number of data points and the propagation distance of the leaking acoustic signal group inside the pipe. In this embodiment, it is assumed that the propagation speed of the leaking signal in the pipeline remains constant. The calculation method for the number of data points and the propagation distance is as follows:

[0091]

[0092] Where n represents the first leakage signal Sample 10m The entire sample set; leakage The distance from the leak location to inlet sensor A is represented by l; l represents the total length of the pipeline. The x-axis represents the peak value of the first leakage signal, and the peak of the acoustic signal appears in the S-th sampling period. This represents the sampling period (propagation speed) required for the leaked acoustic signal to propagate one meter. Then, through a preset mapping relationship, the interpeak distance nop(l) can be obtained. leakage The mapping relationship between the leak location and the corresponding location. The default mapping expression is:

[0093]

[0094] Finally, by sampling a single sample from the acoustic signal set of the leak in the pre-expansion pipe and performing a time-domain shift by adjusting the inter-peak distance, a second acoustic signal (Noise) with different leak locations can be obtained. 5 / 2.5m Each sample was assigned two labels: the size of the leak orifice and the distance from the leak point to the pipe inlet.

[0095] Through the above embodiments, a second leakage signal with a detection step size smaller than the first distance can be obtained by time-domain shifting of the first leakage signal, thereby performing preliminary data enhancement on the leakage signal data sample. In other embodiments of this disclosure, noise addition processing and amplitude-direction enhancement processing can be further performed on the data sample.

[0096] In some possible implementations, generating a second leakage signal located at a second distance multiple of the leakage point using the first leakage signal further includes: performing noise addition processing on the first leakage signal and the second leakage signal respectively to obtain a first noisy leakage signal and a second noisy leakage signal; training a preset model using the first noisy leakage signal to obtain a first model capable of identifying noise information and leakage tags in the first noisy leakage signal; training the preset model using the second noisy leakage signal to obtain a second model capable of identifying noise information and corresponding leakage tags in the second leakage signal; training a third model using the first noisy leakage signal and the second noisy leakage signal, and outputting a second leakage signal with optimized signal strength based on the third model; the third model includes a first branch composed of a first encoder and a first feature-guided generation module of the first model, a second branch composed of a second encoder and a second feature-guided generation module of the second model, a feature interaction module that fuses and interacts with the first branch and the second branch, and a decoder for outputting the second leakage signal with optimized strength.

[0097] Specifically, in this embodiment of the disclosure, upon obtaining a first leakage signal and / or a second leakage signal, noise addition processing can be performed on the first leakage signal and / or the second leakage signal respectively to obtain a first noisy leakage signal corresponding to the first leakage signal and a second noisy leakage signal corresponding to the second leakage signal. For ease of explanation of the noise addition process, the first leakage signal and the second leakage signal will be uniformly represented as "pipe leakage signal" below. This embodiment of the disclosure can gradually add noise to the pipe leakage signal samples until their distribution approaches a standard normal distribution. This process not only simulates the natural generation mechanism of data but also lays the foundation for subsequent generation and sampling.

[0098] Table 1 provides a table of symbol explanations.

[0099] Table 1. Symbol Explanation Table

[0100]

[0101] This disclosure employs maximum likelihood estimation to learn the unknown parameters of the probability distribution, specifically by maximizing the log probability ln(p(x0)) of the observed data. Since x... 1:TThe variables are latent variables, and our goal is to maximize the marginal distribution p(x0)). However, directly maximizing ln(p(x0)) involves integration of the latent variables, which is impractical. Therefore, this disclosure instead seeks a lower bound function for ln(p(x0)), namely the Evidence Lower Bound (ELBO), and indirectly maximizes the probability distribution of x0 by maximizing the ELBO. By analyzing the ELBO function, we can conclude that the key challenge in maximizing the ELBO lies in maximizing D. KL (q(x t-1 |x t ,x0)||p θ (x t-1 |x t ), where q(x) t-1 |x t ,x0) is an explicit function. Therefore, the optimization objective is transformed into solving for the model parameters p given the observed data. θ Given the powerful ability of neural networks to handle nonlinear problems, constructing a deep learning model with moderate nonlinear capabilities has become a key objective for solving p-related problems. θ The key to this problem is that this method not only simplifies the problem-solving process but also fully leverages the flexibility and expressive power of neural networks, thereby achieving more efficient and accurate results in data generation and model training. θ Specifically refers to the presupposed model in this article.

[0102] Figure 4 A flowchart illustrating the construction of a pipeline leak detection model according to embodiments of this disclosure. Figure 5 A flowchart illustrating the noise addition and reverse denoising processes performed on a leaked signal according to an embodiment of this disclosure is shown. Wherein, from left x0 to right... T For the diffusion and noise addition process, until x T It conforms to a standard normal distribution, and the reverse is the inverse denoising process. Figure 5 (A) is the leakage signal inside the pipe. The method of adding noise to the leakage signal inside the pipe to obtain the noisy leakage sound wave signal inside the pipe is shown in the following formula, which is called parameter renormalization (reparameter re-parameter technique).

[0103]

[0104] Where α t =1-β t ; β t As a hyperparameter, it can satisfy linear functions, sigmoid functions, cosine functions, etc., β t=Variance(t), t∈[0,1000); I is the unit covariance matrix; ∈ indicates sampling a value from the standard normal distribution. Select a pipe leakage acoustic signal from x0. Here, 3 refers to three sensors A, B, and C of the same type but different sources; 1792 refers to the time length of each sample; and i represents the sample number. These three sensors are synchronized in time and processed in parallel in space to maximize the preservation of detailed information about the time series and spatial distribution. A value ∈R is then sampled from a standard normal distribution. 3×1792 The internal leakage signal x of the noise-increasing tube can then be obtained. t It is worth noting that x varies depending on t. t They are not the same either.

[0105] When generating a corresponding noisy leakage signal using the pipe leakage signal, the leakage label of the pipe leakage signal can also be assigned to the corresponding noisy leakage signal. Then, the obtained noisy leakage signal can be used to train a deep learning model to identify the noise information and leakage label of the input signal.

[0106] Specifically, a preset model is trained using the first noisy leaked signal corresponding to the first leaked signal to obtain a first model capable of identifying noise information and leak tags in the first noisy leaked signal; and the preset model is trained using the second noisy leaked signal to obtain a second model capable of identifying noise information and corresponding leak tags in the second leaked signal. The preset model in this embodiment includes a feature reduction encoder, a feature guidance module, and a feature enhancement decoder. The feature reduction encoder can be a ResNet-18 module, the feature guidance module is used to guide the fusion of the obtained encoded features, and the enhancement decoder is a ResNet-26 module; these are not intended to limit the scope of this disclosure. During the training of the preset model, the input is the noisy leaked signal x. t The noisy signal is obtained after processing by a deep learning model (preset model). The optimized objective function is to find the noisy leakage signal ∈ 1 / 2 of the standard normal distribution. The mean squared error loss is calculated between the two values. After obtaining the loss value, the gradient descent optimization algorithm is executed to update the parameters of the preset model based on the acoustic signal dataset of the leak in the pipe, until the mean squared error loss meets the set conditions, such as being less than 0.01, or the number of training iterations reaches the set value, such as 5000. The above is not intended to be a specific limitation of this disclosure.

[0107] In addition, in order to further improve the data sample size and the stability of the pipeline leakage detection model, the embodiments of this disclosure can also perform data augmentation processing on the data samples after obtaining the first noise-added leakage signal and the second noise-added leakage signal.

[0108] Specifically, various noise signals, such as Gaussian noise signals, can be randomly generated or collected from the real environment. These are then input into a first model and a second model, respectively. The first and second models process the input noise signals to obtain corresponding decomposed noise signals and their corresponding leakage labels. The difference between the input noise signal and the decomposed noise signal can be used to generate the corresponding leakage signal. Based on this process, the original leakage signal can be augmented to obtain more leakage signals. This improves the robustness and stability of the model during subsequent training. In the following embodiment, the leakage signal obtained after augmentation by the first model can be used as the first noisy leakage signal, and the leakage signal obtained after augmentation by the second model can be used as the second noisy leakage signal.

[0109] Given a first noise-added leakage signal and a second noise-added leakage signal, a third model can be trained using the first noise-added leakage signal and the second noise-added leakage signal. Based on the third model, a second leakage signal with optimized signal strength is output. The third model includes a first branch consisting of a first encoder and a first feature-guided generation module of the first model, a second branch consisting of a second encoder and a second feature-guided generation module of the second model, a feature interaction module that fuses and interacts with the first branch and the second branch, and a decoder for outputting the second leakage signal with optimized strength.

[0110] As described in the above embodiments, this disclosure embodiment can also perform amplitude enhancement and optimization processing on the obtained second leakage signal. Specifically, training the third model using the first and second noisy leakage signals includes: fixing the parameters of the second encoder and the second feature-guided generation module of the second model, and transferring the training of the first encoder and the first feature-guided generation module of the first model; and / or using the initial parameters of the decoder of the third model as the decoder parameters of the second model.

[0111] like Figure 4 As shown, the third model includes two feature encoding branches. The first branch includes a first feature encoder and a first feature guidance generation module, and the second branch includes a second feature encoder and a second feature guidance generation module. Additionally, the third model includes a feature interaction module (CSCA) connected to the outputs of the first and second feature guidance generation modules, and a decoder connected to the CSCA module. The inputs to the first branch are a first noisy leakage signal and a first leakage signal, the inputs to the second branch are a second noisy leakage signal and a second leakage signal, and the output of the decoder is a second leakage signal with optimized amplitude.

[0112] During the training of the third model, the initial parameters of the first feature encoder and the first feature-guided generation module are the same as those of the feature encoder and feature-guided generation module in the first model. Training continues to optimize based on these initial parameters, essentially a transfer training of the feature encoder and feature-guided generation module from the first model. Furthermore, the parameters of the second feature encoder and the second feature-guided generation module are fixed to those of the feature encoder and feature-guided generation module in the second model; these parameters remain unchanged during training, effectively being frozen. The initial parameters of the decoder in the third model are the same as those of the decoder in the second model, and training continues to optimize them. This embodiment is inspired by a combination of cross-domain transfer learning and Bayesian inference. In this framework, the first two steps serve as the source domain for transfer learning, providing rich prior knowledge and likelihood functions, laying a solid foundation for the prediction task in the third step. Finally, the output of the third step is used to predict the expanded pipe leakage acoustic signal. By reparameterizing the deep learning model in the third step, an expanded dataset of acoustic signals from pipe leakage can be obtained.

[0113] Figure 6 This is a flowchart illustrating the feature processing of the feature guidance generation module in this embodiment. In this embodiment, the first feature guidance generation module and the second feature guidance generation module have the same structure and are configured to: acquire conditional codes for the input leakage signal; and use the conditional codes to perform feature guidance and fusion processing on the input encoded features to obtain guided fusion features.

[0114] This disclosure employs conditional coding to perform feature guidance, thereby improving feature accuracy. For example... Figure 4 As shown, this disclosure introduces three key conditional information types: time step information C. t Leakage location information C location and leakage level C catogry (e.g., leak orifice diameter), this information collectively contributes to the synthesis of leakage acoustic signals from arbitrary leak points with varying orifice diameters. This conditional information is a set of adaptively adjustable vectors, guided by the optimization objective. C t As a one-dimensional tensor, it plays a crucial role in distinguishing noise intensity under different time steps t. The time step C in this embodiment of the disclosure... t The method for obtaining is shown in the following formula.

[0115]

[0116] Among them, "max_period" is a key hyperparameter scalar that plays a role in controlling the sampling frequency, ensuring the accuracy and efficiency of signal processing. The SiLU activation function, as an advanced nonlinear transformation, gives the model stronger expressive power, enabling the network to capture more complex data patterns. "dim" represents the channel dimension of the tensor, set to 256 here. "Linear" represents a linear neural network layer. Leakage location information C location and leakage level C catogry These represent the leakage location condition and the leakage degree condition, respectively, and are also tensors of size 256×1.

[0117] Methods for obtaining conditional encoding include utilizing the time step information C of the leaked signal. t Leakage location information C location and leakage level C catogry These three vectors are added pointwise to obtain the conditional code C. This method fuses their respective information, providing rich conditional information for the model. The conditional code C, together with the encoded feature map output by the ResNet-18 encoder, serves as the input to the feature-guided generation module. Under the modulation of conditional C, specific types of leaky samples are successfully synthesized.

[0118] In this embodiment, the feature map output by the ResNet-18 feature encoder is used as the input to the feature-guided generation module StLm. The present invention first performs a positional information embedding operation on the feature map output by the encoder, as shown in the following equation.

[0119]

[0120] Where x is the output feature map, Conv1d refers to a one-dimensional convolutional neural network, d_model refers to the feature map scale, which is 256 here, and pos∈[0,224]. The encoder's output feature map x is subjected to one-dimensional convolution processing, and the result is added pointwise with the position information PE to obtain the encoded feature x1 with injected position information. It will be used together with the conditional coding information C as the input of the feature-guided generation module.

[0121] In this process, activation processing and linear mapping processing are performed on the conditional code C. For example, in the embodiments of this disclosure, the SiLu activation function can be used to perform activation processing on the conditional code C, and then a linear neural network can be used to perform linear projection to obtain the conditional code features C. out .

[0122] Furthermore, this conditional coding feature C out Feature-guided optimization processing is performed on the encoded feature x1 of the injected location information. This embodiment of the disclosure can perform two feature-guided processing steps.

[0123] The first feature guidance process is a frequency domain guidance process, which includes: performing layer regularization on the encoded feature x1 to obtain the first regularized feature; and performing conditional coding on the feature C. out Dimensional transformation processing is performed to obtain the first deformed feature with dimensions (B, 6, 256). The first deformed feature is then used to perform the first feature guidance on the encoded feature x1, resulting in the first guided feature. The first guided feature and the first regularized feature are added together to obtain the input feature x2 for the second feature guidance processing. The six sets of features in the first deformed feature include Scale1, Shift1, Gate1, Scale2, Shift2, and Gate2. Scale1, Shift1, and Gate1 are used for frequency domain angle feature processing in the first feature guidance processing, while Scale2, Shift2, and Gate2 are used for time domain angle feature processing in the second feature guidance processing. Scale and Shift are used for linear modulation operations to improve the robustness of the generative deep learning model to changes in the temporal information and amplitude of the leaking acoustic signal due to different leak locations and degrees.

[0124] The first feature guidance is performed on the encoded feature x1 using the first deformed feature. This includes performing a linear modulation operation on x1 using Scale1 and Shift1 to obtain the first modulation feature. Then, the first modulation feature is subjected to a discrete Fourier transform and gated by point-by-point multiplication with Gate1 to obtain the first gated feature. The first gated feature is added to the first regularization feature to obtain the input feature x2 for the second feature guidance process. The expression for the linear modulation operation is:

[0125] x=x*(1+scale.unsqueeze(1)+shift.unsqueeze(1))

[0126] Here, `Scale` is used to increase the magnitude of the input feature map `x1`. `unsqueeze(1)` is a PyTorch operation that adds a new axis of size 1 on the specified dimension (here, dimension 1), allowing `scale` to be added element-wise with `x`. Thus, each element of `x` is multiplied by (1 + `Scale`), achieving magnitude scaling. `Shift` is an offset used to move the position of the input feature map `x` during modulation. Similarly, `unsqueeze(1)` adds a new axis to `shift` on dimension 1, allowing `shift` to be added element-wise with `x`. Thus, each element of `x` is added to `shift`, achieving positional offset.

[0127] Furthermore, after linear modulation, a Discrete Fourier Transform (DFT) is performed on the obtained first modulation feature. A 2D DFT is then performed on the first modulation feature in both the time series length dimension and the feature dimension. This is followed by a 2D complex-domain parametric linear neural network (CTNN) used for filtering and learning spectral information. A 2D Inverse Discrete Fourier Transform (IDFT) is then performed to obtain the filtered feature map. SoftMax activation is then applied to this feature map in the time series length dimension. Finally, each attention feature is concatenated, and multiple feature maps are fused using a linear neural network to achieve frequency domain feature extraction of feature map x. This method first uses a complex-domain neural network to adjust the amplitude and phase information of each frequency component of the noisy leaked acoustic signal to distinguish the leaked acoustic signal features from the added Gaussian noise. After adjusting the power spectrum information, the method returns to the time domain perspective and finally performs attention activation in the time series length dimension using the SoftMax activation function. This makes the model focus on the weight of each sampling point, which is reflected in the frequency domain as the spectral distribution of each sampling point. Through these operations, a wavelet transform-like time-spectrum feature extraction is achieved. In addition, there is a parallel multi-head attention mechanism branch located in the same position as the Discrete Fourier Transform module. The outputs of the two branches are added pointwise for use as input to subsequent networks. The fused feature map of the two branches is multiplied pointwise with Gate1 of Part 1. The role of Gate1 is to implement the gating mechanism, which determines the degree of contribution of the fused feature map to the final output.

[0128] Correspondingly, the second feature guidance process is a time-domain guidance process, which includes performing layer regularization on the input feature x2 to obtain the second regularized feature; using the first deformed feature to perform the second feature guidance on the encoded feature x2 to obtain the second guided feature; and adding the second guided feature and the second regularized feature to obtain the output feature of the feature guidance module. The second feature guidance on the encoded feature x2 using the first deformed feature includes performing linear modulation operations on x2 using Scale2 and Shift2 to obtain the second modulation feature; then performing feedforward neural network processing on the second modulation feature, followed by point-by-point multiplication with Gate2 to obtain the second gated feature; and finally adding the second gated feature and the second regularized feature to obtain the output feature.

[0129] The time-domain angle processing method and the frequency-domain angle processing method of this embodiment are similar. In particular, the discrete Fourier transform layer is replaced by a feedforward neural network layer (a standard two-layer linear neural network with 256×256 neuron parameters in each layer). Finally, the overall architecture of the network adopts a residual block structure.

[0130] In this embodiment of the disclosure, after obtaining the output features of the feature guidance generation module for the first branch and the second branch, the feature interaction module can be used to perform feature interaction processing on the two output features (guided fusion features). Specifically, the feature interaction module is configured to perform feature interaction processing on the guided fusion features output by the first branch and the second branch; the interaction processing includes performing cross-attention processing on the guided fusion features output by the first branch and the second branch.

[0131] Figure 7 This is a flowchart of the feature processing of the feature interaction module in an embodiment of this disclosure. In order to further capture the dynamically changing amplitude attenuation information and waveform evolution characteristics during the propagation of the leakage signal, this embodiment of the disclosure uses the feature interaction module to learn the propagation loss law from the first leakage signal and transfer it to the second leakage signal.

[0132] This embodiment of the disclosure can perform cross-attention processing on the guided fusion features of the two outputs to obtain cross-fused features. The principle of cross-attention processing is as follows:

[0133]

[0134] Here, the values ​​of Query and Key are the guided fusion features output from the second and first branches, respectively, and the value is the same as the key, where Query ∈ R. 224×256 Key∈R 224×256 The feature map query has a dimension of 256. Where W... Q W K and W V These are the weight parameters for a 256×256 linear neural network. Each element of the output feature map represents the attention weight between the feature vector in feature map Query for a certain sampling period and the corresponding feature vector in feature map Key. This weight matrix has a dimension of 224×224, revealing the interaction and correlation between the two branch feature maps. Subsequently, through β... ij The weight matrix is ​​normalized to ensure that the sum of the weights in the second dimension is 1, thus transforming the weights into a probability distribution. This normalization allows the model to focus more on features more relevant to those in the feature map Key, thereby refining the representation of the feature map Query. In this way, the pseudo-feature map Query can extract key information from the real feature map Key. This information helps improve the quality of the pseudo-feature map Query, making it closer to the real data distribution. Furthermore, by freezing the model parameters of the second branch, CSCA optimizes the signal amplitude information related to propagation loss while preserving the localization information of the pseudo dataset, thereby improving the realism of the pseudo dataset.

[0135] In addition, during feature interaction processing, the method further includes: performing max pooling and average pooling on the guided fusion features output by the first branch and the second branch respectively, and adding the pooling results to obtain the pooling features of the first branch and the second branch respectively; adjusting the order of the group pooling features corresponding to the second branch according to the pooling features corresponding to the first branch according to the feature similarity principle, to obtain a matching feature pair, or adjusting the order of the group pooling features corresponding to the first branch according to the pooling features corresponding to the second branch according to the feature similarity principle, to obtain a matching feature pair; updating the input guided fusion features according to the matching feature pair, and updating the labels of the training samples, so that the second leakage signal and the first leakage signal with the same attenuation amplitude are paired to correspond to a leakage label.

[0136] For example, in some embodiments, the output of the feature-guided generation module of the second branch yields the guided fusion feature Query, which is then summed point by point after average pooling and max pooling operations to obtain a 256×1 feature tensor F. Further, based on this feature tensor, the most similar set of feature values ​​I is automatically found in the feature-guided fusion feature Key from the feature distribution output by the feature-guided generation module of the first branch and paired with it. Furthermore, the feature maps Query and Key are paired according to the pairing method of FI and used as input to Cross-Attention. This step ensures that the refinement and realism improvement of the feature map in the 10-meter region between two adjacent leakage points are based on the features of these two specific leakage points. The calculation formula is shown in Figure 12. Through this similarity pairing, the model can more accurately capture feature changes near the leakage points, thereby improving the realism of pseudo-samples. The method for determining the matching feature pairs is expressed as follows:

[0137]

[0138] AP refers to Average Pooling. T represents the transpose operation. Cross-Attention uses a key value lookup method. After obtaining the feature interaction features using the feature interaction module, a second leak signal with adjusted amplitude can be output using linear neural networks, thus completing the amplitude optimization of the second leak signal.

[0139] Based on the above embodiment, a second leakage signal under the second condition can be generated using the first leakage signal. In this process, the richness of the data sample is improved by means of adding noise to the signal and optimizing the amplitude of the second leakage signal, thus achieving the effect of data enhancement.

[0140] Given the first leakage signal, the second leakage signal, the first noisy leakage signal, and the second noisy leakage signal, a pipeline leakage detection model can be trained using these signals to detect leakage events. The network structure of the pipeline leakage detection model can be the structure of the aforementioned preset model, including a dimensionality reduction encoder, a feature-guided generation module, and a dimensionality increase decoder. The feature-guided generation module discards conditional information, and the dimensionality increase decoder outputs the leakage orifice size and leakage point location information corresponding to the input leakage signal through two linear neural networks. After training, the model can detect the leakage degree and leakage point location information corresponding to the leakage signal of a leakage event. In some embodiments, the leakage orifice size label is divided into four categories: 0, 1, 2, and 3, corresponding to leakage orifice sizes of 0.4 mm, 1 mm, 2 mm, and 3 mm, respectively; this is a classification task. The leakage location label is the distance of the leakage signal from the pipeline inlet, after 0-1 normalization processing; this is a regression task. After signal processing and feature extraction by the model, two output values ​​can be obtained: the size of the leakage orifice and the specific location of the leak, thereby achieving accurate identification and localization of leakage events.

[0141] In addition, the embodiments disclosed herein also include the following analyses.

[0142] (1) Analysis of the authenticity and diversity of the data synthesized by the method in this paper.

[0143] To verify that the synthesized second leakage signal still retains the characteristics of the leakage acoustic signal, the following experiment was designed. Experiment 1: The dataset uses the first leakage signal Sample. 10m The dataset was divided into a training set (1440 samples), a validation set (480 samples), and a test set (480 samples) according to the leakage type. The prediction model used was the discriminant model mentioned above. The discriminant model parameters were optimized on the training set, and the model's performance was validated on the test set. After optimization, the discriminant model parameters were tested on the samples... 5m and Sample 2.5m The model inference process was executed on the test set, and the aperture recognition accuracy metric was observed. If the model successfully infers the sample... 5m and Sample 2.5m The test set then proves that the samples synthesized in this disclosure have denser leak points. 5m and Sample 2.5m The characteristics of the acoustic signal from leakage inside the pipe were preserved. The experimental results are shown in Table 2:

[0144] Table 2. Experimental results on the authenticity of features.

[0145]

[0146] Experiment 2: Put the Sample 5m and Sample 2.5m The training set is filled into the Sample 10m In the training set, the validation set and the test set are Sample. 10m The validation and test sets are prepared. The parameters of the discrimination model are initialized, and training is performed on the current training set. The aperture recognition accuracy and leak location metrics on the test set are observed. The purpose is to verify that the synthesized, denser leak point data contains information related to location, and that the dataset distribution and sample... 10m The distribution difference is within an acceptable range, ensuring the sample... 10m The inference results on the test set were unaffected. The experimental results are shown in the table below.

[0147] Table 3

[0148]

[0149] Experiment 3: Experiments 1 and 2 verified the feature quality of the synthetic dataset. Experiment 3 will verify the feature quality of the synthetic dataset related to the localization task. Because cross-correlation analysis can locate leak events at any point on the pipeline, cross-correlation analysis is used to analyze the sample. 10m Sample 5m and Sample 2.5m Perform inference and prediction for localization tasks. (Sample) 10m The absolute error of the positioning prediction index will be used as a control experiment. If Sample 5m and Sample 2.5m The absolute positioning error and Sample 10m If the results are similar, it indicates that the synthesized dataset satisfies the location-related characteristics of the initial intra-pipe leak acoustic signal dataset. The experimental results are shown in Table 4.

[0150] Table 4

[0151]

[0152] As shown in Table 3, the quality of the model for synthesizing leak samples decreases as the distance between two adjacent leak points gets closer, but it is still within an acceptable range overall. The maximum absolute positioning error increases by 0.36 meters, which meets the requirements of engineering practice.

[0153] In summary, Experiments 1, 2, and 3 verified the reliability of the TPCDiff model presented in this paper, and the reliability of the synthesized denser leakage acoustic signal meets the actual requirements.

[0154] (2) Ablation test

[0155] 1) Analysis of the effectiveness of this method.

[0156] Table 5. Quality and diversity assessment of the synthesized high-positioning-accuracy dataset

[0157]

[0158] TP / M: Number of trainable parameters, in millions; P / M: Total number of parameters, in millions; N: Total number of samples.

[0159] Table 5 illustrates the quality and diversity of the high-precision localization dataset synthesized in steps 2 and 3 using the method presented in this study. As can be seen from the table, both steps 2 and 3 successfully adapted to the distribution of different leakage pore size characteristics, demonstrating excellent fitting ability and high resolution for different leakage pore sizes. Furthermore, step 3 shows an improvement over step 2 in terms of localization performance. Additionally, step 3 requires only 5 million training parameters, accounting for only 13.2% of the total parameters, indicating that it maintains high performance while having a small parameter scale.

[0160] Table 6. Analysis of absolute positioning error under different leakage conditions in the 5-meter and 2.5-meter positioning accuracy datasets.

[0161]

[0162] Table 6 shows the experimental results (unit: meters) of the absolute positioning error under four leakage conditions in the 5-meter and 2.5-meter positioning accuracy datasets. Based on the data in the table, the following conclusions can be drawn: Whether in the 5-meter or 2.5-meter positioning accuracy dataset, step 3, compared to step 2, exhibits a smaller absolute positioning error under the four different leakage conditions, with a reduction of approximately 23.7 percentage points. This strongly demonstrates the effectiveness of step 3. Furthermore, the method shows varying performance in fitting the feature distribution for different leakage orifice sizes, with 1mm and 2mm leakage orifice sizes being handled more easily. It is noteworthy that even when the positioning accuracy is increased from 5 meters to 2.5 meters, the robustness of this method remains significant; the positioning error does not increase significantly. In fact, the absolute error decreases under the 0.4mm and 3mm orifice diameter leakage conditions. For example, with a 5-meter positioning accuracy and a 0.4mm leakage orifice diameter, this method first roughly locates the leak point in the pipeline with an accuracy of 5 meters, and then controls the positioning error within 1.41 meters before and after the corresponding leak location. With a positioning accuracy of 2.5 meters and a leakage orifice diameter of 0.4 mm, this method first roughly locates the leakage position at 2.5-meter intervals, and controls the leakage error within 1.11 meters before and after the corresponding leakage position. In summary, the above experimental results further demonstrate the effectiveness of this method in synthesizing high-precision positioning datasets.

[0163] 2) The effectiveness of the CSCA module (transfer learning network).

[0164] To verify the effectiveness of the CSCA module, we conducted the following comparative experiment. Comparative Experiment 1: In Figure 2 In step 3, the CSCA module was removed, and the Query and Key Values ​​were directly added together to achieve fusion, thereby verifying the effectiveness of the CSCA module. Comparative experiment 2: The Cross-Attention component was removed to verify the effectiveness of the cosine similarity-optimized Cross-Attention. The experimental results are shown in Table 7.

[0165] Table 7 Validation of the CSCA module

[0166]

[0167] Table 7 shows the evaluation results of the 5-meter positioning accuracy dataset synthesized in step 3. For Comparative Experiment 1, the leakage aperture recognition accuracy remained at 0.967, but the positioning metric R2 score was only 0.467. This indicates that Comparative Experiment 1 is not good at handling inter-peak distance temporal information. Furthermore, due to the local receptive field and translation invariance of CNNs, it can still achieve a high leakage aperture size recognition accuracy even without temporal information. However, the lack of temporal information also affected the leakage aperture size recognition accuracy, reducing it by 3 percentage points.

[0168] The model needs to adapt to the distribution of two different datasets and extract the required features for fusion, which requires a more sophisticated model structure. In Comparative Experiment 2, when a cosine similarity constraint is introduced, and the encoder and SSF-TF weights of the high-precision positioning dataset features are frozen, the model can extract the inter-peak distance information from the two datasets as a common feature, thus achieving a positioning index of 0.988. However, it is worth noting that the recognition accuracy for the four types of leak orifice sizes decreased by 9 percentage points. This is because all leak points in the pipeline have four different leak orifice sizes, and their inter-peak distance information is similar. If only the cosine similarity constraint is introduced, it only constrains the inter-peak distance information and cannot refine the features of different leak orifice sizes, resulting in a classification accuracy of only 0.916 for the four types of leaks. This disclosure solves the above problem.

[0169] 3) The effectiveness of the feature-guided generation module.

[0170] To verify the reliability of the feature-guided generation module, the following comparative experiments were conducted. First, in the feature-guided generation module, the multi-head attention mechanism was replaced with a Vanilla structure, while retaining the decoding method for the conditional encoding information controlling the leakage aperture size and leakage location. Second, the proposed three-step architecture was adopted to verify the effectiveness of time-frequency joint modeling in the Transformer's Encoder structure; this is referred to as Comparative Experiment 3. The experimental results are shown in the table below:

[0171] Table 8. Effectiveness Analysis (Absolute Error) of Feature-Guided Generation Module

[0172]

[0173]

[0174] Table 8 shows the experimental results of the absolute positioning error on the 5-meter and 2.5-meter positioning accuracy datasets with different leak orifice sizes. The experimental results show that the feature-guided generation module has a smaller absolute positioning error on both datasets compared to the Vanilla method, thus verifying the effectiveness of the feature-guided generation module. In addition, the absolute error of the 2.5-meter positioning accuracy in Experiment 3 is larger than that of the 5-meter positioning accuracy. This indicates that when processing dynamically changing inter-peak distance time-series information, as the positioning accuracy increases, the SoftMax attention scores of the inter-peak distance information of different leak locations in the Vanilla method are too similar, failing to further improve the discrimination, thus leading to an increase in absolute error. However, the feature-guided generation module optimizes the above phenomenon and further reduces the absolute positioning error on the 2.5-meter positioning accuracy dataset. The reason is: 1) The core of the feature-guided generation module is frequency domain processing, which is not limited by the discrimination and refinement capabilities of the SoftMax activation function. 2) When the positioning accuracy increases from 5 meters to 2.5 meters, the distance between leakage points shortens, and the more similar the features, the easier it is for the model to learn the changing patterns of inter-peak distances and the evolution of propagation loss information. This further reduces the positioning error for 0.4mm and 3mm leakage apertures. However, the model also has limitations in its ability to control at the pixel level, so the absolute error does not continue to decrease with increasing positioning accuracy. Furthermore, on the 5-meter and 2.5-meter datasets, the absolute errors for 0.4mm and 3mm leakage apertures are slightly larger than those for 1mm and 2mm. Analysis shows that the 0.4mm leakage aperture has a very small leakage volume, making feature extraction difficult and susceptible to noise from the industrial operating environment, resulting in a larger absolute error. However, when additional information is introduced, i.e., improving positioning accuracy and optimizing the CSCA module, the error is further reduced. The 3mm leakage aperture has a large leakage volume, insignificant propagation loss information, and is more difficult to extract features. Therefore, in experiments on the 5-meter positioning accuracy dataset, the positioning error is larger compared to other apertures. However, when new prior knowledge is introduced (i.e., the positioning accuracy is improved to 2.5 meters), the evolution of the leakage signal on the pipeline becomes easier to analyze, which in turn further reduces the positioning error.

[0175] Compared with the prior art, the beneficial effects of this disclosure include the following aspects:

[0176] Pipeline leak detection and location focus on multi-source sensor signals, involving dynamic changes in the shape and location of leak signals, as well as the combination of multiple variables. This requires models with stronger leak characteristic representation and time-series relationship analysis capabilities. The embodiments disclosed herein have the following features and effects compared to existing technologies:

[0177] (1) Multi-source sensor signals. This disclosure implements the processing of signal data from multiple sensors, which have different characteristics. Based on this, the pipeline leakage detection model constructed by this disclosure can be applied to multi-source signal models, effectively integrate and analyze these different data characteristics, and perform accurate leakage detection.

[0178] (2) Shape and position information changes. The leakage signal in the embodiments of this disclosure involves dynamic changes in shape and position. The model is constructed by considering the temporal relationship of the signal and is able to capture and understand the evolution pattern between signals at different leakage points, making the constructed model more reliable.

[0179] (3) Changes in the combination of multivariable signals. In sensor data, there may be complex correlations and interactions between different variables. The embodiments of this disclosure can adaptively learn and model the relationships between these variables, thereby enabling a better understanding and prediction of the behavior of the entire system.

[0180] Based on the above configuration, the embodiments of this disclosure can comprehensively consider the multi-source nature, temporal nature, and combinability of the collected leakage signals, expand the leakage signals under various conditions in multiple ways, and construct a more accurate leakage detection model that is suitable for multiple scenarios, with better stability and accuracy.

[0181] It should be noted that the image group in this embodiment can be color images of the same object in the same scene or in different scenes. Those skilled in the art can choose the appropriate scene field according to their needs, and no specific limitation is made here.

[0182] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0183] In addition, this disclosure also provides a pipeline leak detection device, electronic equipment, computer-readable storage medium, and program, all of which can be used to implement any of the pipeline leak detection methods provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding section of the method and will not be repeated here.

[0184] Figure 8 A block diagram of a pipeline leak detection apparatus according to an embodiment of the present disclosure is shown, such as Figure 8 As shown, the pipeline leak detection device includes: a leak detection model, used to process pipeline leak signals and detect leak events; wherein, constructing the leak detection model includes:

[0185] The acquisition module 100 acquires the first leakage signal of the pipeline under the first condition;

[0186] The generation module 200 generates a second leakage signal under a second condition based on the first leakage signal. The signal detection step size under the second condition is smaller than the signal detection step size under the first condition. The signal detection step size is the reference distance between the sensor and the leakage point.

[0187] The construction module 300 is used to construct a leakage detection model using the first leakage signal and the second leakage signal.

[0188] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0189] This disclosure also proposes a computer-readable storage medium storing computer program instructions that, when executed by a processor, implement the above-described method. The computer-readable storage medium may be a non-volatile computer-readable storage medium.

[0190] This disclosure also proposes an electronic device, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured as described above.

[0191] Electronic devices can be provided as terminals, servers, or other forms of devices.

[0192] Figure 9 This diagram illustrates a block diagram of an electronic device 800 according to an embodiment of the present disclosure. For example, the electronic device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, or other terminal.

[0193] Reference Figure 9 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0194] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0195] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of this data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0196] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.

[0197] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0198] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0199] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0200] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0201] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0202] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0203] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions that can be executed by a processor 820 of an electronic device 800 to perform the above-described method.

[0204] Figure 10 A block diagram of another electronic device 1900 according to an embodiment of the present disclosure is shown. For example, electronic device 1900 may be provided as a server. (Refer to...) Figure 10 The electronic device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the methods described above.

[0205] Electronic device 1900 may also include a power supply component 1926 configured to perform power management of electronic device 1900, a wired or wireless network interface 1950 configured to connect electronic device 1900 to a network, and an input / output (I / O) interface 1958. Electronic device 1900 can operate on an operating system stored in memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or similar.

[0206] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions that can be executed by a processing component 1922 of an electronic device 1900 to perform the above-described method.

[0207] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.

[0208] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0209] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0210] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.

[0211] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0212] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0213] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0214] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0215] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, and are not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for detecting pipeline leaks, characterized in that, include: Obtaining a first leakage signal of a pipeline under a first condition includes: detecting an acoustic signal using multiple acoustic sensors installed on at least one pipeline, wherein the distance between the acoustic sensors and the leakage point is a multiple of a first distance; generating the first leakage signal based on the acoustic signal and a leakage tag corresponding to the acoustic signal, wherein the leakage tag includes the distance and the aperture of the leakage point; Generating a second leakage signal under a second condition based on the first leakage signal, wherein the signal detection step size under the second condition is smaller than the signal detection step size under the first condition, and the signal detection step size is a reference distance between the sensor and the leakage point, the generation of the second leakage signal under the second condition based on the first leakage signal includes: generating a second leakage signal located at a second distance multiple of the leakage point using the first leakage signal, wherein the second distance is smaller than the first distance; wherein, generating the second leakage signal located at a second distance multiple of the leakage point using the first leakage signal includes: obtaining the time difference between the peak values ​​of the first leakage signals from two sensors on the same pipe; determining the propagation speed of the first leakage signal based on the time difference; determining the correspondence between the distance between the peak values ​​of the first leakage signal and the location of the leakage point using the propagation speed and the location of the leakage point; and performing a time-domain shift on the first leakage signal using the correspondence to obtain the second leakage signal; The method further includes: performing noise addition processing on the first leaked signal and the second leaked signal respectively to obtain a first noisy leaked signal and a second noisy leaked signal; training a preset model using the first noisy leaked signal to obtain a first model capable of identifying noise information and leaked tags in the first noisy leaked signal; training the preset model using the second noisy leaked signal to obtain a second model capable of identifying noise information and corresponding leaked tags in the second leaked signal; training a third model using the first noisy leaked signal and the second noisy leaked signal, and outputting a second leaked signal with optimized signal strength based on the third model; the third model includes a first branch composed of a first encoder and a first feature guidance generation module of the first model, a second branch composed of a second encoder and a second feature guidance generation module of the second model, a feature interaction module that fuses and interacts with the first branch and the second branch, and a decoder for outputting the second leaked signal with optimized strength; A leakage detection model is constructed using the first and second leakage signals. The leakage detection model is then used to process the leakage signals and detect leakage events.

2. The pipeline leakage detection method according to claim 1, characterized in that, The step of training the third model using the first and second noisy leakage signals includes: The parameters of the second encoder and the second feature-guided generation module of the second model are fixed, and the first encoder and the first feature-guided generation module of the first model are transferred and trained.

3. The pipeline leakage detection method according to any one of claims 1 or 2, characterized in that, The initial parameters of the decoder of the third model are the same as the decoder parameters of the second model.

4. The pipeline leakage detection method according to any one of claims 1 or 2, characterized in that, The first feature-guided generation module and the second feature-guided generation module have the same structure and are configured as follows: Obtain the conditional encoding for the input leakage signal; The conditional coding is used to perform feature guidance and fusion processing on the input coded features to obtain guided fused features.

5. The pipeline leakage detection method according to claim 3, characterized in that, The first feature-guided generation module and the second feature-guided generation module have the same structure and are configured as follows: Obtain the conditional encoding for the input leakage signal; The conditional coding is used to perform feature guidance and fusion processing on the input coded features to obtain guided fused features.

6. The pipeline leakage detection method according to any one of claims 1, 2, or 5, characterized in that, The feature interaction module is configured to perform feature interaction processing on the guided fusion features output by the first branch and the second branch; The interactive processing includes performing cross-attention processing on the guided fusion features output by the first branch and the second branch.

7. The pipeline leakage detection method according to claim 3, characterized in that, The feature interaction module is configured to perform feature interaction processing on the guided fusion features output by the first branch and the second branch; The interactive processing includes performing cross-attention processing on the guided fusion features output by the first branch and the second branch.

8. The pipeline leakage detection method according to claim 4, characterized in that, The feature interaction module is configured to perform feature interaction processing on the guided fusion features output by the first branch and the second branch; The interactive processing includes performing cross-attention processing on the guided fusion features output by the first branch and the second branch.

9. The pipeline leakage detection method according to claim 6, characterized in that, The guided fusion features output from the first and second branches undergo cross-attention processing, including: Max pooling and average pooling are performed on the guided fusion features output by the first branch and the second branch respectively, and the pooling results are added together to obtain the pooling features of the first branch and the second branch respectively. Based on the principle of feature similarity, the order of another set of pooling features is adjusted according to a set of pooling features to obtain matching feature pairs; The cross-attention processing is performed according to the matching feature pairs.

10. The pipeline leakage detection method according to any one of claims 7 or 8, characterized in that, The guided fusion features output from the first and second branches undergo cross-attention processing, including: Max pooling and average pooling are performed on the guided fusion features output by the first branch and the second branch respectively, and the pooling results are added together to obtain the pooling features of the first branch and the second branch respectively. Based on the principle of feature similarity, the order of another set of pooling features is adjusted according to a set of pooling features to obtain matching feature pairs; The cross-attention processing is performed according to the matching feature pairs.

11. A pipeline leak detection device, used to perform the pipeline leak detection method according to any one of claims 1 to 10, characterized in that, include: The acquisition module is used to acquire the first leakage signal of the pipeline under the first condition; The generation module is used to generate a second leakage signal under a second condition based on the first leakage signal. The signal detection step size under the second condition is smaller than the signal detection step size under the first condition. The signal detection step size is the reference distance between the sensor and the leakage point. A construction module is used to construct a leakage detection model using the first leakage signal and the second leakage signal, and to process the leakage signal using the leakage detection model to detect leakage events.

12. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the pipeline leak detection method according to any one of claims 1 to 10.

13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the pipeline leakage detection method according to any one of claims 1 to 10.