(RTTM for Rupture)Pipeline Rupture Detection Using Real-Time Transient Modelling and Convolutional Neural Networks
(RTTM for Rupture)Pipeline Rupture Detection Using Real-Time Transient Modelling and Convolutional Neural Networks
IPC2018
September 24-28, 2018, Calgary, Alberta, Canada
IPC2018-78426
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
PIPELINE RUPTURE DETECTION USING REAL-TIME TRANSIENT MODELLING
AND CONVOLUTIONAL NEURAL NETWORKS
ABSTRACT 1. INTRODUCTION
Demonstrating the ability to reliably detect pipeline ruptures Pipelines are one of most efficient and economic
is critical for pipeline operators as they seek to maintain the transportation methods for oil and gas products. However,
social license necessary to construct and upgrade their pipeline demands associated with the safe operation of oil and gas
systems. Current leak detection systems range from very simple pipeline transport are high and continue to increase. Leaks from
mass balances to highly complex models with real-time pipelines are a serious problem that threaten our environment.
simulation and advanced statistical processing with the goal of Between 1997 and 2017, the Pipeline and Hazardous Materials
detecting small leaks around 1% of the nominal flow rate. No Safety Administration (PHMSA) has recorded 6,603 liquid
matter how finely-tuned these systems are, however, they are pipeline leaks, which spilled 2.11 million barrels of hazardous
invariably affected by noise and uncertainties in a pipeline liquids, causing $3.68 billion in environmental damage in the US
system, resulting in false alarms that reduce system confidence. [12]. Therefore, the development of both internal and external
This study aims to develop a leak detection system that can leak detection methods is an area of active research interest [17].
detect leaks with high reliability by focusing on sudden-onset Qi et al. used two sensors to measure sound waves
leaks of various sizes (ruptures), as opposed to slow leaks that propagating from leak points through the wall of water-piping to
develop over time. The expected outcome is that not only will identify pipeline leak locations [1]. Martini used a vibration
pipeline operators avoid the costs associated with false-alarm measurement under leaking condition and directly compared
shut downs, but more importantly, they will be able to respond with the measurement for the non-leaking condition without
faster and more confidently in the event of an actual rupture. To defining a threshold level to identify leaks in a pipeline [2]. Hou
accomplish these goals, leaks of various sizes are simulated et al. [3] used fiber Bragg grating (FBG) sensors, which have a
using a real-time transient model based on the method of series of parallel gratings printed onto the core of an optical fiber
characteristics. A novel leak detection model is presented that and reflect a narrow wavelength. For petroleum leakage
fuses together several different preprocessing techniques, detection. Meniconi et al. [4] examined the interaction patterns
including convolution neural networks. This leak detection between different pressure waves. The experimental tests
system is expected to increase operator confidence in leak showed that a larger pressure wave was reflected by a leak. The
alarms, when they occur, and therefore decrease the amount of acoustical signal due to the pipeline leakage provides physical
time between leak detection and pipeline shutdown. information of the leakage and can be used for the identification
of the leak. Wei et al. [5] examined sound pressure and sound
Keywords: Leak Detection, Rupture, Artificial Intelligence, pressure level distribution in a gas pipeline with leaks of different
Computational Pipeline Monitoring. diameters and running pressures. Mpesha et al. [6] presented a
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
and interference. Other researchers are developing an as single phase fluid, the analytical fluid model can be written
algorithmic monitoring tool that alerts the operator to respond to using the following two equations:
a detectable pipeline hydraulic abnormality [7]. Torris discussed
some failure detection methods of oil transport using simulations 𝜕𝐻 𝑎2 𝜕𝑄
[8]. The method utilizes the deviation between plant and model + =0 (1)
𝜕𝑡 𝑔𝐴 𝜕𝑥
observations with the models defined by normal operating
assumptions. Billmann et al. also present a pipeline model using 1 𝜕𝑄 𝜕𝐻 𝑓𝑄|𝑄|
numerical equations [9]. They used mathematical dynamic + + =0 (2)
𝑔𝐴 𝜕𝑡 𝜕𝑥 2𝑔𝐷𝐴2
models, nonlinear adaptive state observers and correlation
detection techniques to detect leaks for oil and gas pipelines. where H is hydraulic head, Q the volumetric flow rate, g the
Geiger et al. [10] presented a combined leak method using acceleration due to gravity, a the speed of sound in the medium,
pattern recognition techniques to improve the leak detection f the Darcy friction factor, D the internal pipe diameter, A the
systems’ performance, robustness and applicability. The leak cross-sectional area of the flow, x distance in the direction of the
detection method presented combined different internal leak flow, and t time.
detection methods such as real-time transient model (RTTM), Equations (1) and (2) are coupled non-linear first-order
mass balancing, and volume balancing for a liquid multi-product partial differential equations (PDEs). It is possible to numerically
pipeline. solve these two equations, but the solution process requires an
Most current computational pipeline leak detection systems iterative method that is time-consuming. The method of
are based on physical principles, which incorporate real-time characteristics (MoC) is a method to transform the PDEs into a
transient models to increase system sensitivity. However, system of two ordinary differential equations (ODEs). The
numerous factors affect the false positive and false negative leak advantage of solving ODEs as opposed to PDEs is that they can
detection rates. The fluid dynamics in a pipeline network are be discretized and solved exactly in a single step, saving
difficult to simulate with high fidelity. Alarm set points are significant time.
sometimes selected manually to meet criteria such as minimum
At a given point 𝑃 in the simulation grid, the fluid head and
detectable leak size or maximum allowable number of false
flow rate at that point are 𝐻𝑃 and 𝑄𝑃 , respectively, and these can
alarms per year. The challenge with such systems is that
be solved for using the following equations:
condensing all of the available measurements into a single value
of interest will necessarily discard important information that 𝐶𝑃 + 𝐶𝑀
could otherwise inform a decision about the state of the pipeline. 𝐻𝑃 = (3)
Additionally, the decision about where to set the alarm level is 2
based on human judgement, which can introduce bias depending 𝐶𝑃 − 𝐻𝑃 𝐻𝑃 − 𝐶𝑀
on the experience of operators. 𝑄𝑃 = 𝑜𝑟 𝑄𝑃 = (4)
𝐵 𝐵
The proposed leak detection system presented in this paper
is based on a machine learning technique known as a where 𝐶𝑃 and 𝐶𝑀 are constants defined as
convolutional neural network (CNN). A CNN is trained to
recognize the distinctive patterns that appear in the measurement 𝐶𝑃 = 𝐻𝐴 + 𝑄𝐴 (𝐵 − 𝑅 ∙ |𝑄𝐴 |) (5)
data when a sudden-onset leak (rupture) occurs, minimizing any
human input. This system is trained on available measurements 𝐶𝑀 = 𝐻𝐵 − 𝑄𝐵 (𝐵 − 𝑅 ∙ |𝑄𝐵 |) (6)
and does not rely on assumptions about what a leak “should”
look like. Rather, the CNN learns a variety of features from both
where B (Characteristics impedance) and R (Resistance
normal and abnormal data to differentiate a leak from other coefficient) are expressed as
operating conditions. The objectives for this study are to develop 𝑎
a real-time transient model, simulate a section of pipeline and 𝐵= (7)
𝑔𝐴
validate the simulation using real measurements, create a new
leak detection technique that uses a CNN, and compare our new 𝑓∆𝑥
method with an industry standard leak detection technique. 𝑅= (8)
2𝑔𝐷𝐴2
2. SIMULATIONS
To verify that our simulation works properly, we compared
Our simulation of the flow in a pipeline is based on the
method of characteristics (MoC). This is a widely used method results from the simulation to a set of measurements taken from
of simulating incompressible pipe flow, so we will only briefly a real pipeline system. The real system is a single segment of
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
320
300
Elevation (m)
280
260
240
Figure 3: Error in simulated flow rate between simulation and
220 measurements
200
There are two things to note in the results presented in
0 20 40 60
Distance (km) Figure 3. The first is that over a period of 3.5 hours, the simulated
Figure 1: Elevation profile for the pipeline being simulated flow rate is close to the actual measured values (within a couple
percent) and that the dynamics of the system seem to match up
To evaluate the performance of the flow model, we operated very closely. The second thing to note is that there is a clear linear
the simulation using the measured pressures at either end as trend in the error, which is caused by a new batch of fluid
boundary conditions, and compared the resulting simulated flow entering the pipeline segment and the associated change in fluid
rate to the measured value. The simulation results are shown in properties.
Figure 2, and the relative error in percent is shown in Figure 3. Although the simulation is capable of modeling variations
in both fluid viscosity and density, only the measured density at
the inlet was provided. As a result, we needed to assume other
fluid properties for each batch of fluid based on the measured
density (i.e. more dense oil generally has a higher viscosity and
vice-versa). The result of this assumption is that the amount of
error in the simulation changes as the fluid coming into the
segment changes, but will remain steady after the segment
becomes full of a single fluid. In addition, the flow meters are
affected by different fluid properties, which can introduce a bias
of approximately 0.5%, depending on the product and operating
temperature. These effects are difficult to quantify, so the error
that they introduce is difficult to correct for.
The proposed leak detection technique is based on detecting
Figure 2: Comparison between simulated volumetric flow rate relatively fast changes in the system, not long-term or even short-
(orange) and measured volumetric flow rate (blue) over a term averaging. As a result, we do not expect that the slow
period of 3.5 hours (TCPL data). change in simulation error associated with batch fluid property
changes (generally several hours) will have a noticeable effect
on the ultimate ability of our algorithm to detect leaks.
Figure 4: Generation of flow rate perturbation signal. (A) Simulation result with constant boundary conditions. (b) Simulation result
with the same boundary conditions, and a leak which occurs in the middle of the simulation. (c) Difference between signals (a) and (b)
to get a signal that represents only the difference between the two.
Simulating Leaks
To generate the sufficient amount of data required to train a An example of the process of generating this training signal is
leak detection algorithm, it is necessary to develop a technique shown in Figure 5.
for simulating the effects of a leak. This may be accomplished The advantage in using this approach for generating training
using a simulation where it is possible to control all of the data is that it retains all of the normal variation in the
process variables. Performing this for real pipeline systems is, measurements, so that a learning algorithm can be trained to
however, extremely difficult due to the large number of distinguish a leak from real operating noise. There are still
unknowns. Some of these unknowns include pipe roughness, modelling assumptions that had to be made in order to simulate
control system parameters, pump dynamics, vibrations, and a leak, but these would be present no matter how we generated
other sources of variation in the measured system parameters our training data.
(both intentional and inadvertent). These variations, which can
occur on differing time scales, are not possible to recreate Monte Carlo Simulation
realistically in a numerical simulation. It is therefore necessary In order to have a robust leak detection algorithm, it is
to use a technique for adding in a leak perturbation into a data necessary to train it on a very large amount of training data that
set that has been previously measured from a real pipeline encompasses all of the potential rupture scenarios that we want
system. Using real measurements as a starting point ensures that it to detect. To this end, we performed a Monte Carlo simulation
real-world system dynamics are included in the training data so varying the location of the simulated leaks over the entire length
that the leak detection algorithm can more precisely learn the of the pipe, at each of 3 fixed leak sizes: 1%, 4%, and 9%. Larger
difference between normal operating conditions and leaks are easier to detect, so we anticipate that if our method can
abnormalities, such as leaks. reliably detect a 9% leak, it will be equally as effective at larger
To accomplish this aim, we first perform a simulation of the sizes as well.
pipe flow with no leak to produce a set of simulated pressures We have obtained several months’ worth of data, we observe
and flow rates, 𝑝𝑛𝑜 𝑙𝑒𝑎𝑘 (𝑥, 𝑡) and 𝑄𝑛𝑜 𝑙𝑒𝑎𝑘 (𝑥, 𝑡), as a function of a wide range of operating conditions with different flow rates,
both distance along the pipe and time. Then, using the exact pressures, and fluid properties. We assume that these
same boundary conditions, we perform a second simulation measurements are fully representative of the pipeline’s nominal
where a simulated rupture occurs at some intermediate point on operating conditions. Ideally, we would use all of the data for
the pipeline, and produce a second set of simulated pressures and testing and training, but at the current time, we lack the
flow rates, 𝑝𝑙𝑒𝑎𝑘 (𝑥, 𝑡) and 𝑄𝑙𝑒𝑎𝑘 (𝑥, 𝑡). Subtracting the no leak computational resources to do so. Therefore, this work will use
simulated data from the leak simulated data gives us pressure and just a month of the data, with the expectation that when trained
flow rate signals that represent the leak-induced deviation from on the full set, the results will become even more robust.
normal operation: The current goal of this research is to detect ruptures that
𝑝𝑑𝑒𝑣 (𝑥, 𝑡) = 𝑝𝑙𝑒𝑎𝑘 (𝑥, 𝑡) + 𝑝𝑛𝑜 𝑙𝑒𝑎𝑘 (𝑥, 𝑡) (9) occur during normal operations (as opposed to start-up, shut-
down, or shut-in conditions which will be addressed in later
𝑄𝑑𝑒𝑣 (𝑥, 𝑡) = 𝑄𝑙𝑒𝑎𝑘 (𝑥, 𝑡) + 𝑄𝑛𝑜 𝑙𝑒𝑎𝑘 (𝑥, 𝑡) (10) work), so we first filter out all of the data that we are not
interested in. A single instance of a set of training data covers a
An example of this process is shown in Figure 4. 5-minute period, because this is approximately the amount of
Finally, in order to generate a set of training data, we add time it takes for the perturbation created by a rupture to be
these leak-induced pressure and flow rate deviations to a set of measured at both ends of the pipeline and for it to decay back
measurements from a real pipeline system. below detectable levels, based on the fluid properties and
𝑝𝑡𝑟𝑎𝑖𝑛 (𝑥, 𝑡) = 𝑝𝑚𝑒𝑎𝑠 (𝑥, 𝑡) + 𝑝𝑑𝑒𝑣 (𝑥, 𝑡) (11) pipeline length. We therefore divided the measurements into 5-
minute intervals, yielding approximately 9800 sets of data. In
𝑄𝑡𝑟𝑎𝑖𝑛 (𝑥, 𝑡) = 𝑄𝑚𝑒𝑎𝑠 (𝑥, 𝑡) + 𝑄𝑑𝑒𝑣 (𝑥, 𝑡) (12) each of these intervals, we randomly decided whether to add a
simulated rupture. For training purposes, we used the first 80%
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
over time, and we wanted to demonstrate that the CNN can make Boundary conditions Resulting simulation outputs
accurate predictions under flow conditions that it has not Inlet pressure, outlet pressure Inlet flow rate, outlet flow rate
previously seen. Inlet pressure, outlet flow rate Inlet flow rate, outlet pressure
Inlet flow rate, outlet pressure Inlet pressure, outlet flow rate
3. CONVOLUTIONAL NEURAL NETWORKS
The proposed technique for detecting leaks uses real time For each pair of boundary conditions, we use the measured
transient modelling for preprocessing the data, followed by a values from the pipeline, and record the resulting simulation
scaling process, followed by a temporal (1-dimensional) outputs. In total, this results in 6 output residual signals, an
convolutional neural network (CNN) for signal classification. example of which can be seen in Figure 6. Note that at the
CNNs, and deep learning in general, have received a lot of beginning, all of the residuals start close to 0, meaning that the
attention in recent years because research has shown that CNN simulation outputs match their respective measured values. At
can be very flexible and very effective learning techniques around the 30-minute mark, a leak occurs and all of the residuals
requiring little to no a priori knowledge to make complex change significantly. This example is of a very large leak (on the
classifications. Their primary applications are in image order of 8% of the nominal flow rate through the pipe) to
recognition where they have quickly become the clear standard. exaggerate the change for illustration purposes.
While image recognition is a 2-dimensional problem, CNNs are
equally as applicable to a 1-dimensional (temporal) problem as Inlet pressure, outlet flow rate
well.
CNNs have several significant advantages that make them
well-suited for this problem. First, they are capable of learning
to recognize very complex features in a dataset in a highly
efficient and reliable manner. This capability has been well
documented empirically in a variety of applications. Another
advantage of CNNs over other pattern recognition methods is
that they are shift-invariant, meaning that they can detect the
features that they have learned to detect, no matter where they Inlet pressure, outlet pressure
occur in the input data. This is a capability that emerges due to
how the convolutional layers are applied to the input data in each
successive layer. Finally, CNNs learn features that are only
conditioned on the input and target output values. The network
will maximize the likelihood of making the correct decision,
without the simplifying assumptions that would be necessary to
hand-craft appropriate leak detection features. If the training data
is sufficiently varied, the predictions should be better than the
predictions of a person who has seen the same data.
Inlet flow rate, outlet pressure
Preprocessing
Before classifying the pipeline data with our CNN, we need
to first preprocess the data. The first step in our preprocessing
method is to run a real-time transient model using pipeline
measurements as the boundary conditions.
We perform this simulation under the assumption that a leak
does not occur in the pipeline. If that is true, then the residual
(difference between the simulation and measurement) should be
relatively small. If there is a leak, however, we would expect that Figure 6: Example of 3 combinations of boundary conditions
the residuals would change dramatically, and in a predictable and the resulting flow rate residuals for an hour-long segment
way depending on what flow properties are being controlled at of data.
the inlet and outlet.
When performing a 1-D, transient, incompressible After these residuals have been generated, the next step in
simulation of the flow in a pipe, there are three possible preprocessing the data is to break the signal up into smaller
combinations of boundary conditions: inlet pressure and outlet periods of time. Immediately after a leak occurs, the perturbance
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
created by the leak decays, and the system reaches a new steady
state. Keeping these two facts in mind, we have chosen to
segment the signal into 5-minute long periods in order to capture
the entire transient, but still keep the segments short enough for
classification efficiency.
The final step in preprocessing the data is to individually
scale each of the six signals in each period of data to be within a
range of [0,1] given that the residuals that are produced from the
simulation have very different scales; pressure error is on the
order of tens to hundreds of thousands, while flow rate error is
on the order of 0.1. Rescaling these signals to a common range
improves the efficiency of the training process, and more
importantly, removes any bias that could be introduced by the (a)
absolute value of the residual. If, for example, our simulation had
a large, constant error because of a poor fluid viscosity
approximation, this would not be indicative of a leak. We are
only interested in detecting the dynamic effects of a leak, which
are isolated by this scaling process.
A sample output from the preprocessing step is shown in
Figure 7. There are 256 data points per signal resulting in a CNN
input size of 6 x 256. Visually, it is easy to distinguish between
the two inputs because the leak simulated in this example is quite
large (around 8% of nominal flow rate) for illustration purposes.
After the scaling process, the data is ready to be classified by the
CNN to determine if it contains the onset of a leak.
CNN Structure
A CNN is made up of two distinct parts. The first part is
made up of a series of convolutional layers that detect small,
simple features at first, and build those features into more (b)
complex representations of the data through each subsequent Figure 7: Preprocessed data. These are the 6 signals that were
layer. The second part of a CNN are the attention layers, which individually plotted in Figure 6. (a) the 6 scaled residuals
are fully connected single rows of neurons as in a normal neural during normal operation showing large, random fluctuations.
network. These attention layers take the complex features (b) the same 6 residuals during the onset of a leak.
extracted by the convolutional layers and use them to make
classifications.
Our CNN has a relatively simple architecture because the 4. RESULTS
signals that we are training it to detect are also rather simple. To demonstrate the capability of this new leak detection
There are 2 convolutional layers, each with 10 filters of width 5, system, we simulated several leak scenarios with 1%, 4%, and
that are each followed by a rectified linear unit (ReLU) activation 9% leaks of the nominal pipeline flow rate. Our leak detection
function. After the second activation function, we use two fully system based on convolutional neural networks is compared to a
connected layers, the first with 1024 neurons, and the second conventional volume balance leak detection system.
with 256 neurons. The output layer (2 neurons; one for leak and
one for no leak) is fully connected to the second fully connected Convolutional Neural Networks (CNN)
layer, and the network is trained using the adaptive moment The output from the CNN are two numbers between one and
estimation (Adam) optimizer based on the gradient descent zero. The first represents the network’s confidence that the input
optimization scheme to minimize categorical cross-entropy of data contains a leak, and the second number represents its
the softmax of the output layer. We train using a batch size of 32 confidence that the input data does not contain a leak. These two
for 15 epochs until the training accuracy reaches 100% (i.e., all numbers sum to 1, so it is possible to classify leaks using just one
normal and abnormal data in the training set is correctly of the two numbers, since the other is redundant (for this case).
classified). For the rest of these results, we will only deal with the number
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
Based on our experience, a single CNN can detect leaks of each of the three leak sizes, and in Figure 9 we plot the CNNs
all sizes, although, as expected, it has more difficulty detecting confidence that a leak exists. As a control, we also had the same
smaller leaks. It also has difficulty performing accurately during network classify the same data with no leak present to ensure that
periods when the system operator is changing operating it would not generate an unacceptable number of false alarms.
conditions because during these brief periods the transience can The results shown in Figure 9 indicate that, over the set of
look very similar to a leak. It is expected that this issue will be test data, our leak detection system positively identifies 100% of
overcome in our future work, and we will describe how we leaks at 9% of the nominal flow rate, 100% of leaks at 4% of the
intend on accomplishing that in the discussion section. nominal flow rate, and 97.4% of leaks at 1% of the nominal flow
To evaluate the performance of our leak detection system, rate. The same leak detection system also correctly classified
we took several hours of data that included steady-state operation 97.9% of the data as normal when no leak is present. All but one
and periods of transience due to the operator intentionally of the misclassifications occur during periods of transience
changing system operating conditions. The raw training data is caused by the operator.
shown in Figure 8, and the periods of operator-induced
transience are indicated by the shaded region.
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
average uses a window of 12 hours, which is long enough to
smooth out most of the variations in the line balance that occur
naturally, leaving an estimate of the true mean. The alarm
threshold for this long-term moving average is set much lower
than for the short-term moving average, and is therefore able to
detect much smaller leaks, at the expense of a longer period
before they are detected.
Since there will always be some error between the inlet and
outlet flow rate measurements, the moving average will ideally
drive the error to zero over the long term, allowing for the Figure 10: Volume balance with alarm thresholds performed on
detection of smaller leaks. Some sources of error in the volume normal data with two different averaging windows (5 minutes
balance include error in the meters themselves, transience in the and 60 minutes). Shaded regions indicate periods of operator-
system, line pack, or thermal expansion or contraction of the induced transience.
fluid. As a result, the error will never actually be zero, which
We further note that the leak is detected using the longer, 60-
introduces a fundamental lower limit on the detectability of very
minute averaging window, but that it takes 25 minutes for the
small leaks.
signal to cross the threshold. In addition, the signal must remain
When a leak occurs, it introduces a constant offset in the
above the threshold for a significant amount of time before an
error signal, and smaller leaks introduce smaller offsets. For a
alarm is generated (as previously described). The result is that
given averaging window, the smallest detectable leak is the leak
this technique can take an hour or longer to generate an alarm,
that produces an offset that is greater than the natural variation
whereas the technique using a CNN is able to detect leaks of this
in the averaged signal. If the detectability threshold were chosen
size as soon as the transience created by the leak (which travels
to be lower than the natural variation in the signal, then there
at the speed of sound) is measured at both ends of the pipe.
would be many false alarms, which is not desirable. After a leak
starts, it takes one full averaging period for the averaged signal
to reach the offset that is the result of the leak.
The result of these statistical factors is that it can take a very
long time to detect small leaks (if they are detectable at all)
without having to deal with an excessively high false alarm rate.
To demonstrate, we have taken the normal signal shown in
Figure 8, and performed the volume balance technique using a
short averaging window (5 minutes) and a long averaging
window (60 minutes) to determine where the thresholds should
be set to minimize the number of false alarms. These signals
(solid lines) along with their thresholds (dashed lines) are shown
in Figure 10. The threshold for the 5-minute window was
selected to be 1.0, and the threshold for the 60-minute window Figure 11: Volume balance with alarm thresholds
was selected to be 0.25. These thresholds are slightly larger than performed when a leak occurs, with two different averaging
the highest peak in each signal to provide some buffer to avoid windows (5 minutes and 60 minutes). Shaded regions indicate
false alarms. In practice, these thresholds should be set by periods of operator-induced transience. The leak is
looking at far more data, but we are only concerned in this approximately 1% of the nominal flow rate, and starts at t = 1
section with making a direct comparison between the volume hour (indicated by the vertical red line).
balance method and our method using the exact same data.
A leak (1% of nominal flow rate) was introduced into this 5. DISCUSSION
signal using the same methodology as previously described. The These results are subject to several assumptions and
leak starts at 1 hour into the dataset, and the response from the limitations. The largest source of errors in the simulation is the
volume balance system is plotted in Figure 11 (solid line) along assumptions that we had to make about fluid properties and pipe
with the thresholds for detection (dashed line). roughness. The fluid density was measured indirectly by the
We note that the leak is not detected using a 5-minute ultrasonic flow meters, which can introduce a measurement error
averaging window (blue) because it does not exceed and remain of approximately 10%, while the viscosity of the fluid is not
above the threshold for long enough at any point of the dataset, measured. Measurement error from the sensors also contributed
whereas our leak detection technique using a CNN is able to to error in our simulation, and provides a fundamental lower
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
these unknowns (density, viscosity, and roughness) is to viscosity, speed of sound, pipe roughness, or pump control
introduce a constant error into the simulation over short time system parameters. Alternatively, we could perform additional
spans. Since we break the measured values up into short time preprocessing steps to try and remove the effects of operating
spans and then scale them from 0 to 1, the simulation error does system changes, although this approach could introduce new
not significantly affect the results when the pipeline is operating biases, which is something that we are explicitly trying to avoid.
at quasi-steady state. Finally, it is possible that the CNN could be trained specifically
This study uses real measurements from a large, well- to recognize the difference between a change in operating
instrumented pipeline. As a result, we are detecting leaks in a condition and a leak. This would require using more data
signal that has a realistic amount of noise and variations. While collected over a longer period to capture more of these events,
we must simulate leaks to get enough data to train our model, we and provide the CNN with more examples during the training
have demonstrated that we can detect the simulated leaks under process.
conditions that are as close to real as possible. In the future, we plan to further develop a method for
The proposed method relies on detecting dynamic changes dealing with a change in set point, as well as other transient
in the residuals (differences between experiments and conditions such as pipeline start-up or shut-down, since these are
simulations) when a leak occurs. Therefore, the assumptions that periods where leaks can occur and can often go undetected.
we have made in the simulation about the fluid’s speed of sound Improvements in this area will likely come from refinements to
and pump control dynamics have a more significant effect on the the RTTM model and changes to the preprocessing procedure.
accuracy of our leak detection system than unknowns such as
density, viscosity, or roughness do. 6. CONCLUSIONS
A speed of sound error in the simulation would cause the We have demonstrated a novel leak detection system using
residuals to change at different points in time compared to what real-time transient modelling and a deep convolutional neural
would happen in real life. This effect is more pronounced for network (CNN). Using the test data, the leak detection system
longer pipeline segments. We expect that for larger leaks or was shown capable of detecting leaks as small as 4% of the
ruptures, assumptions about the speed of sound will not have a pipeline nominal flow rate with 100% accuracy, and leaks as
significant influence on detection accuracy because the small as 1% of the nominal flow rate with 97.4% accuracy. All
magnitude of change in the residual is sufficiently large enough of the misclassifications were found to occur during periods of
to accurately classify the signals. For smaller leaks, however, the change that were induced by the system operator. Our technique
temporal co-location in changes in the residuals would likely compares well to the standard volume balance leak detection
provide important information needed to make accurate technique, being able to detect similarly sized leaks with similar
classifications. accuracy, but in a much shorter time span. Deep learning is a
This logic holds for the simulation of pump dynamics as highly promising technique for detecting pipeline leaks, and that
well. Large leaks create changes that minimize the effects of the this avenue should be further explored.
control systems at the inlet and outlet of the pipe; however, for There is still room for improvements in the proposed
very small leaks, detecting the response of a pump to a change technique and some of these improvements can be implemented
could be just as important as the change itself. at the expense of longer computation time. The primary
Another important assumption in the method is that in the limitation of the method is that it classifies short periods of data,
simulation we assume that a leak occurs instantaneously, and that with no regard for long-term trends. As a result, nearly all of the
the pressure wave remains sharp as it travels along the pipeline. system misclassifications occurred during periods of transient
In reality, the pressure wave spreads out and arrives at events that were induced by the operator. With further work, it
measurement points as a relatively fast drop that occurs over should be possible to overcome these limitations and produce a
several seconds. This difference in system dynamics could have robust leak detection technique that improves confidence in the
a significant effect on the ability of our technique to detect leak detection system and helps reduce response time in the event
smaller leaks, but is likely not an issue for the rupture detection of a leak or rupture.
system described here.
Our primary barrier towards detecting even smaller leaks ACKNOWLEDGMENTS
relates to dealing with changing operating conditions given that The authors would like to thank TransCanada Pipelines for
our method does not look at long-term averaged in the data. If, their support of this research project.
for example, the operator changes the flow rate set point (i.e.
pump station), the residual between the measurement and our
simulation tends to resemble a leak for a short period of time
before the pipeline reaches a new quasi-steady state. There are
Downloaded from http://asmedigitalcollection.asme.org/IPC/proceedings-pdf/IPC2018/51883/V003T04A016/2511855/v003t04a016-ipc2018-78426.pdf by National Tsing Hua University user on 19 March 2024
leak detection in buried plastic pipes of water supply
networks by means of vibration measurements, Shock and
Vibration, http://dx.doi.org/10.1155/2015/165304.
[3] Hou, Q. et al., 2014. Experimental study of leakage
detection of natural gas pipeline using FBG based strain
sensor and least square support vector machine. Journal of
Loss Prevention in the Process Industries, 32, pp. 144-151.
[4] Meniconi, S., Brunone, B., Ferrante, M. & Massari, C.,
2013. Numerical and experimental investigation of leaks in
viscoeleastic pressurized pipe flow. Drinking Water
Engineering and Science, 6, pp. 11-16.
[5] Wei, L., Laibin, Z. & Chunying, Y., 2013. Gas pipeline
leakage detection based on acoustic technology.
Engineering failure analysis, 31, pp. 1-7.
[6] Mpesha, W., Gassman, S. L. & Chaudhry, M. H., Februry
2001. Leak detection in pipes by frequency response
method. Journal of hydraulic engineering, pp. 134-147.
[7] API 1130, 2012. Computational Pipeline Monitoring for
Liquids, Washington: API.
[8] Digernes, T., 1980. Real-time failure detection and
identification applied to supervision of oil transport in
pipelines. Modeling, Identification and Control, 1(1), pp.
39-49.
[9] Billmann, L. & Isermann, R., 1987. Leak detection methods
for pipeline. Automatica, pp. Vol. 23., No. 3, pp. 381-385.
[10] Geiger, G. & Vogt, D., 2014. A combined leak detection
method using pattern recognition techniques. ASME
International Pipeline Conference.
[11] Wylie, E. B., 1983. The microcomputer and pipeline
transients. Hydraul. Eng., 109(12), pp. 1723-1739.
[12] Pipeline and Hazardous Materials Safety Administration,
2017. All reported incident 20 year trend.
https://hip.phmsa.dot.gov/analyticsSOAP/saw.dll?Portalpa
ges
[13] Wylie, E. B., Streeter, V. L., 1993. Fluid transients in
systems. Prentice Hall.
[14] Chaudry, M. H., 2014. Applied hydraulic transients, 3 rd ed.
Springer.
[15] CSA Z662-15: Oil and gas pipeline systems, 2015. Canadian
standard association.
[16] Henrie, M., Carpenter, P., Nicholas, R. E., 2016. Pipeline
leak detection handbook, pp. 45-55.
[17] American Petroleum Institute, 2014. Liquid Pipeline
Rupture Recognition and Response.