Table of Contents
Model-based leak detection compares pipeline measurements with physics: a mass balance or a real-time transient model (RTTM) predicts the flows and pressures the line should show, and a leak appears as a mismatch. Data-driven methods learn normal behaviour from SCADA history and flag departures. The two are often combined, with statistics or machine learning applied to model residuals.
Key takeaways
- Computational leak detection on liquid pipelines is described in API RP 1130. It covers volume and mass balance, transient models, pressure wave, statistical and pattern recognition methods (Shaw et al., 2012).
- Every internal method is limited by its instruments: with flow meters of 1% accuracy, no internal system can detect a leak smaller than 1% of flow.
- A transient model handles start-ups and other transients, but a poorly configured and calibrated one gives very low reliability.
- Data-driven detectors rarely have real leaks to learn from, so studies add calculated leaks to real data or train on simulator output.
- In US incident reports from 2010 to mid-2012, a computational system first identified 17 of the 86 hazardous liquid releases on lines where one was working.
What must a leak detection system do?
A 2012 study by Kiefner and Associates for the US Pipeline and Hazardous Materials Safety Administration (PHMSA) uses the four performance criteria of API 1155 (Shaw et al., 2012):
- Sensitivity: the smallest leak detected and the time taken to raise the alarm.
- Reliability: missing as few real leaks as possible, and raising as few false alarms as possible.
- Accuracy: estimating the leak rate and location correctly.
- Robustness: continuing to work when an instrument or a communication link fails.
These goals conflict. More sensitivity means more false alarms, and the study warns that too many false alarms are a hazard in themselves: controllers lose confidence and may ignore a real alarm. It recommends combining internal, external and inspection methods that complement each other.
Which leak detection methods exist?
Internal methods infer a leak from the measurements the pipeline already has: flow, pressure, temperature and density from SCADA. API RP 1130 covers these algorithmic tools, which help the controller recognise hydraulic anomalies that could show a leak. The PHMSA study lists them in three groups (Shaw et al., 2012):
- Monitoring of operational data by controllers: volume balance, rate of change of pressure or flow, pressure point analysis and the negative pressure wave method.
- Computational pipeline monitoring (CPM): mass balance with line pack correction, real-time transient modelling, statistical pattern recognition, pressure and flow pattern recognition, and negative pressure wave modelling.
- Data analysis methods: statistical methods and digital signal analysis.
External methods add dedicated sensors along the line, such as acoustic sensors, fibre optic cables or infrared thermography, and visual methods include patrols, trained dogs and pigging (Adegboye et al., 2019). This article covers internal methods, since they are the ones built on SCADA data.
How does model-based leak detection work?
Volume and mass balance
Mass in minus mass out of a leak-free pipeline equals the change in mass stored in the line, called line pack. Any extra imbalance indicates a leak. A basic volume balance uses only the receipt and delivery meters, so it must average over a long period to hide line pack changes; the study notes this period becomes very long during start-ups, pressure or product changes, and on most gas pipelines.
A compensated mass balance calculates line pack from pressure and temperature profiles and an equation of state. A transient model of the whole line gives the most accurate profiles.
Real-time transient models
An RTTM solves the full fluid flow equations in real time, from SCADA boundary conditions, to account for fluid compressibility, pipe wall elasticity and temperature effects on density. It detects leaks in two main ways: by comparing measured values with simulated ones (deviation analysis), or by computing line pack for a model-compensated mass balance (Shaw et al., 2012).
It keeps working during transients such as a start-up. But the study states that implementation tends to be complex and that a poorly configured and calibrated RTTM will inevitably provide very low reliability. A review in Sensors calls the transient approach the most sensitive but also the most complex leak detection technique in use (Adegboye et al., 2019).
Negative pressure waves
A sudden leak sends a pressure drop travelling upstream and downstream at the speed of sound in the fluid, and its arrival times at the transmitters locate the leak. The first wave is short: it is best seen when pressure is sampled tens or hundreds of times per second, while normal SCADA scan rates catch only the weaker wave that follows. Waves fade quickly in gas, so the method suits liquid lines (Shaw et al., 2012). The Sensors review adds that it is effective mainly for large, sudden leaks and that normal pressure waves are easily mistaken for leaks (Adegboye et al., 2019).
The common limit: instrument accuracy
All internal methods depend on metering, SCADA and telecommunications. The PHMSA study gives the arithmetic: no internal system using 1% accuracy meters can detect a leak smaller than 1% of flow, so a 100,000 barrels per day pipeline is blind to leaks of around 1,000 barrels per day (Shaw et al., 2012). A better algorithm does not remove this limit; better instruments do.
How does data-driven leak detection work?
Data-driven methods learn what normal operation looks like and test whether new data departs from it. Two families already appear in the API RP 1130 grouping:
- Statistical methods apply a hypothesis test, such as the sequential probability ratio test, to the volume imbalance. They are tuned by running the system for two to three weeks of leak-free operation and adjusting the confidence limits until no alarms are raised. The alarm is then not tied to a fixed percentage of flow (Shaw et al., 2012).
- Pattern recognition applies classifiers, including naive Bayes, maximum entropy classifiers and neural networks, to measurements or to calculated imbalances.
Recent work applies machine learning to SCADA data. An undergraduate project at the University of Ibadan, later posted on arXiv, used four weeks of SCADA data from a gas pipeline of about 11 km in Nigeria, with leaks of 0.1% to 10% of flow added by calculation (Oshingbesan, 2022). Random forest and decision tree models detected a 0.1% leak in about two hours, with no false alarms in testing. A transient model from the literature located leaks more precisely, and the author suggests using such models alongside an RTTM. A 2026 conference paper trains random forest and XGBoost classifiers on two-phase oil and gas flow simulated with OLGA (Naanouh, 2026).
Both show the central problem: real leaks are rare, so training and testing rely on simulated ones. Our guides to anomaly detection methods and labelling failures in time series data cover how to build and test detectors with few labelled events.
Model-based or data-driven: how do they compare?
| Balance and transient models | Statistical and machine learning methods | |
|---|---|---|
| Built from | Conservation laws, pipe and fluid data, an equation of state | SCADA history of normal operation, sometimes with simulated leaks |
| Main strength | Physical meaning; an RTTM works during transients and helps locate leaks | No full pipeline model needed; alarm limits adapt to normal noise |
| Main weakness | Needs good metering and careful configuration and calibration | Knows only the conditions in its training data; few or no real leaks to learn from |
| Leak location | RTTM and pressure wave methods can locate leaks | Usually weaker; often relies on a model or pressure wave timing |
| Upkeep | Recalibration, model updates, staff training | Retraining after operating changes; monitoring of false alarms |
| Typical role | Core detection layer | Layer on top of balance or model residuals to reduce false alarms |
The study also warns about cost: an RTTM is cheaper to implement than a full acoustic array on a long pipeline, but over five years the manpower, training and testing it needs typically make it far more expensive (Shaw et al., 2012). A data-driven layer needs similar ongoing care. Our article on virtual flow metering shows the same physics, data and hybrid choice applied to well rates.
How well does leak detection work in practice?
The PHMSA study analysed incident reports filed between January 2010 and July 2012 (Shaw et al., 2012). For hazardous liquid pipelines:
- The pipeline controller or control room identified the release about 17% of the time.
- A CPM system was the first to identify 17 of the 86 releases (20%) where one was working at the time.
- SCADA was the first to identify 43 of the 152 releases (28%) where it was working.
- Emergency responders and members of the public were more likely to identify a release than air patrols or operator crews.
The authors also found that procedures may have allowed controllers to ignore alarms, restart pumps or open valves in several of the larger releases. Detection is a people and procedures problem as much as an algorithm problem.
How do you test a leak detection system?
The study prefers removing product from the line (a withdrawal or draw test), which needs special connections and can be unannounced to test the controllers too. Simulated tests, which modify SCADA values or meter factors or use a transient hydraulic model, are far cheaper but less reliable (Shaw et al., 2012).
In the United States, 49 CFR 195.444 requires hazardous liquid pipelines to have an effective leak detection system. The operator's evaluation must consider the length and size of the line, the product, how quickly leaks can be detected, the location of the nearest response personnel and leak history. CPM systems must follow API RP 1130 for operation, maintenance, testing, record keeping and dispatcher training. API RP 1175 adds a framework for managing the whole leak detection programme.
These are US rules and industry standards, not Algerian law. In Algeria, the Ministry of Commerce lists the Autorité de Régulation des Hydrocarbures (ARH) as responsible for the technical framework applicable to pipeline transport. Confirm the requirements for your line with ARH and with legal counsel.
How do you choose and start, step by step?
- Map the instruments: meters and transmitters, their accuracy, scan rates and known faults. This sets the best sensitivity any method can reach.
- Set targets with the control room: the leak size and detection time that matter, and the false alarm rate controllers will accept.
- Start from what you have. Use a calibrated hydraulic model if one exists; otherwise a compensated mass balance with statistical alarming is a sound base.
- Collect normal history: months of SCADA data with the event log of start-ups, batch changes, shut-ins and instrument faults. See our guide to integrating AI with SCADA and OT systems.
- Add a data-driven layer to the residuals, trained on leak-free operation, to reduce false alarms during known transients.
- Test with simulated leaks, then a withdrawal test, recording time to detect, estimated location and every false alarm.
- Write the alarm response procedure and train controllers before go-live.
What we have seen at KABAS AI
We have not published a pipeline leak detection project. Our published oil and gas work is at ADFC (Sonatrach Group), on drilling fluid formulation with Virtual Lab, a different problem. Our practical advice follows from the evidence above:
- Most of the work is in the data: meter calibration, time alignment of SCADA tags and an event log that explains transients.
- A residual is easier to trust than a black box. A data-driven layer on a balance or transient model gives controllers a physical quantity to check when an alarm sounds, as a soft sensor does.
- Keep the detector advisory and inside your network, with read-only access to SCADA.
Our data science team prepares industrial data, builds predictive models and deploys them with monitoring on your own infrastructure. See our oil and gas solutions and the wider list of AI use cases in North African oil and gas.
Sources
- Shaw et al. (Kiefner and Associates), Leak Detection Study, Final Report No. 12-173 for PHMSA, December 2012 (copy filed with the North Dakota Public Service Commission, case PU-19-204)
- American Petroleum Institute, API RP 1130, Computational Pipeline Monitoring for Liquids
- American Petroleum Institute, API RP 1175, Pipeline Leak Detection: Program Management
- 49 CFR 195.444, Leak detection (Cornell Legal Information Institute)
- Adegboye, Fung and Karnik, Recent Advances in Pipeline Monitoring and Oil Leakage Detection Technologies: Principles and Approaches, Sensors 19(11), 2019
- Oshingbesan, Leak Detection in Natural Gas Pipeline Using Machine Learning Models, arXiv 2209.10121, 2022
- Naanouh, Pipeline Leakage Detection Using Machine Learning Techniques in Multiphase Flow Systems, Pipeline Technology Conference, 2026
- Ministère du Commerce, Listing des autorités de régulation
Frequently asked questions
Can machine learning replace a real-time transient model for leak detection?
Not on current evidence. Published work presents data-driven models as a complement: one study found machine learning models more robust and reliable, while the transient model was more sensitive and located leaks more accurately. Some commercial systems already combine a transient model with statistical analysis of its deviations.
What is the smallest leak a computational leak detection system can find?
It depends on the instruments, the method and the operating conditions. A PHMSA-commissioned study notes that an internal system using flow meters with 1% accuracy cannot detect a leak smaller than 1% of flow, so a 100,000 barrels per day line is blind to leaks of around 1,000 barrels per day. Averaging over longer periods reduces false alarms from line pack changes but slows detection.
Do we need real leak data to train a data-driven leak detector?
Usually not, because real leaks are rare. Detectors are trained on normal operation and flag departures from it. To test them, studies add calculated leaks to real SCADA data or generate leak cases with a transient simulator, and operators run withdrawal tests that remove product from the line under controlled conditions.
Do the same methods work on gas pipelines?
In principle many do, but gas compressibility makes them harder to apply. Line pack changes cause large imbalances during transients, pressure waves fade quickly in gas, and a downstream leak may barely change the measured flow. Transient models handle these effects best, but they are complex to configure and calibrate.
Do US leak detection rules apply to pipelines in Algeria?
No. 49 CFR 195.444 and the API recommended practices it references are US rules and industry standards; many operators use them as reference practice. In Algeria, the Autorité de Régulation des Hydrocarbures oversees the technical framework for pipeline transport. Confirm the requirements for your line with the regulator and with legal counsel.



