Novel Adaptive Hidden Markov Model Utilizing Expectation–Maximization Algorithm for Advanced Pipeline Leak Detection
Abstract
:1. Introduction
1.1. Background and Literature Review
1.1.1. Importance of Leak Detection
1.1.2. Existing Methods and Research Gaps
1.2. Contribution Highlights and Paper Organization
- Introducing the Adaptive Hidden Markov Model (AHMM): This novel method identifies the size and location of oil leakages more accurately than existing techniques like K-NN, SVM, logistic regression, and Naive Bayes, and operates effectively in detecting small leaks. The AHMM extracts linear flow and pressure trends using the Hidden Markov concept, providing a robust analysis in both online and offline settings.
- Practical Application and Flexibility: The proposed AHMM algorithm has been successfully tested using simulation data generated by OLGA, a widely used industrial standard for pipeline simulation. Although actual leak data were unavailable, the simulations were carefully calibrated with real pipeline parameters from a section of the Iranian Oil Export pipeline, ensuring that the results closely reflect real-life operational conditions. These promising results suggest that the model holds potential for practical implementation. The flexibility of the AHMM allows for effective analysis of pressure and flow data, making it adaptable to various real-world scenarios.
2. Principle of Leak Detection
2.1. Model and Equations
2.2. Impact of Leakage on Flow
2.3. Impact of Leakage on Pressure
3. Hidden Markov Model
3.1. Markov Chain
3.2. Typical HMM Method
- Evaluation Problem: Given a sequence of observations y1, y2, y3, …, yT and a model λ = (π, A, B), how can we efficiently calculate the probability of the sequence of observations, given the model P (Y|λ)?
- Optimal State Sequence Problem: Given a sequence of observed values y1, y2, y3, …, yT and a model λ = (π, A, B), how can we determine the most likely sequence for hidden states q1, q2, …, qT that best describes the sequence of observations?
- Training Problem: How to optimize the parameters of the model λ = (π, A, B) to maximize P (Y|λ) and the probability of a sequence of observations, y1, y2, y3, …, yT, given the model?
4. The Adaptive Hidden Markov Model (AHMM)
- (i)
- When there are missing values;
- (ii)
- When estimating the maximum likelihood is challenging and consequently estimating the parameters of the complete data becomes difficult.
4.1. Expectation–Maximization Algorithm
4.2. Efficient Calculation of the Desired Quantities
4.3. Viterbi Algorithm
5. Numerical Analysis
5.1. Practical Results of the Model
5.2. Measures of Fault Detection and Performance
5.3. Numeric Results
- (i)
- Simulated leak pressure data with (0, 0.1, …, 2) inch sizes located at (5, 10, 20, …, 80) km distances from the source were used as inputs to the OLGA software.
- (ii)
- For each scenario, pressure data were observed for N = 78 locations.
- (iii)
- Each set of observed data was randomly split into a test sample and a training sample.
- (iv)
- The AHMM Optimal State Sequence Problem classifiers obtained from the training sample were applied, assigning each of the test data to leak or without leak states.
- (v)
- Using k-NN, Naive Bayes, SVM classifier, linear logistic regression algorithms, and examples, the experimental samples were classified.
- (vi)
- After classifying different scenarios with the presented algorithms, the values of indicators of precision, i.e., recall and F1 score, are calculated and the accuracy of the classifiers is compared.
- (i)
- For various scenarios of the leak, by EM algorithm, the amount of pressure was estimated by the fitted regression models.
- (ii)
- For each model, the leak size was determined using Optimal State Sequence problem-solving.
- (iii)
- Using the AHMM, sample point pressures were estimated.
- (iv)
- With having the true pressure at the test sample points, RMSE was used for size estimation with the AHMM fitted model.
- (v)
- The size of the leak in the selected model was compared with the actual values, and the RMSE of the method was calculated.
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Nomenclature
Symbol | Description |
Physical Quantities | |
Mass | |
Velocity | |
Mass Source/Sink | |
Acceleration Of Gravity | |
Height | |
Pressure Force | |
φ | Fluid Angle to Gravity |
Rate of Mass Transfer | |
L | Existing Phases |
E | Field Energy |
H | Enthalpy of the Field |
S | Source/Sink of Enthalpy |
Q | Heat Flow in Pipe Wall |
T | Energy Transfer Between Different Fields |
Density | |
Friction Forces | |
Wall Friction | |
Momentum Contributions Related to Mass Transfer | |
Mathematical Operations | |
Differentiation In Time | |
Spatial Differentiation | |
∑ | Summation |
cos | Cosine |
log | Logarithm |
max | Maximum |
argmax | Argument of the Maximum |
Time Differentiation of Mass | |
Spatial Differentiation of Mass | |
Time Differentiation of Momentum | |
Spatial Differentiation of Momentum | |
Mass Change Over Time | |
Statistical Measures | |
Unknown Parameter of the Regression Line Slope | |
Unknown Parameter Indicating the Intercept | |
Lagrange Multiplier | |
Variance | |
L(∙) | Likelihood Function |
Performance Metrics | |
F1 | F1 Score |
DR | Detection Rate |
FAR | False Alarm Rate |
MAR | Missed Alarm Rate |
RMSE | Root Mean Square Error |
Pr | Precision |
R | Recall Rates |
FP | False Positive |
TN | True Negative |
FN | False Negative |
Hmm Parameters | |
Intercept Parameter in AHMM | |
Regression Line Slope Parameter in AHMM | |
Variance of the Error Term for the i-th Hidden State | |
Estimator of the Parameter in AHMM | |
Estimator of the Parameter in AHMM | |
Estimator of the Variance of the Error Term for the i-th Hidden State | |
pij | Transition Probability from State i to j |
πi | Initial Probability of State i |
Parameter Vector in the AHMM | |
N | Number of Hidden States Within the Markov Chain |
A | Matrix of State Transition Probabilities |
B | Emission Probability Distribution |
Observed Symbol at Time t | |
Hidden State at Time t | |
Hidden State at Time t + 1 | |
Set of Possible States of AHMM | |
State of the System at the i-th Time Step in the Hidden Markov Model | |
Probability of Transition from State to State | |
Forward Variable | |
Backward Variable | |
Q | Set of Hidden States |
X | Design Matrix |
Maximum Number of Iterations | |
Abbreviations | |
RTU | Remote Transfer Unit |
MTU | Master Terminal Unit |
SCADA | Supervisory Control and Data Acquisition |
EM | Expectation–Maximization algorithm |
Appendix A. Details the Derivation Process
References
- Duru, C.; Ani, C. A statistical analysis on the leak detection performance of underground and overground pipelines with wireless sensor networks through the maximum likelihood ratio test. Sadhana 2017, 42, 1889–1899. [Google Scholar] [CrossRef]
- PHMSA. Available online: https://www.phmsa.dot.gov/data-and-statistics/pipeline/pipeline-incident-20-year-trends (accessed on 18 April 2024).
- Adegboye, M.A.; Fung, W.-K.; Karnik, A. Recent Advances in Pipeline Monitoring and Oil Leakage Detection Technologies: Principles and Approaches. Sensors 2019, 19, 2548. [Google Scholar] [CrossRef] [PubMed]
- Henrie, M.; Carpenter, P.; Nicholas, R.E. Pipeline Leak Detection Handbook; Elsevier: Amsterdam, The Netherlands, 2016. [Google Scholar] [CrossRef]
- Wang, C.; Zhang, Y.; Song, J.; Liu, Q.; Dong, H. A novel optimized SVM algorithm based on PSO with saturation and mixed time-delays for classification of oil pipeline leak detection. Syst. Sci. Control Eng. 2019, 7, 75–88. [Google Scholar] [CrossRef]
- Rajasekaran, U.; Kothandaraman, M. A Survey and Study of Signal and Data-Driven Approaches for Pipeline Leak Detection and Localization. J. Pipeline Syst. Eng. Pract. 2024, 15, 03124001. [Google Scholar] [CrossRef]
- Zadehbagheri, O.; Salehizadeh, M.R.; Naghavi, V.; Moatari, M. Design of Pipeline leak Detection System using Neural Network on Scada Platform of National Iranian Oil Company. Pet. Res. 2020, 31, 39–50. [Google Scholar]
- Valizadeh, S.; Moshiri, B.; Salahshoor, K.; Hakim, A.H.; Vasant, P.; Barsoum, N. Multiphase Pipeline Leak Detection Based on Fuzzy Classification. AIP Conf. Proc. 2009, 1159, 72–80. [Google Scholar] [CrossRef]
- Navarro, A.; Begovich, O.; Sánchez, J.; Besancon, G. Real-Time Leak Isolation Based on State Estimation with Fitting Loss Coefficient Calibration in a Plastic Pipeline. Asian J. Control 2017, 19, 255–265. [Google Scholar] [CrossRef]
- Song, J.; He, X. Model-based fault diagnosis of networked systems: A survey. Asian J. Control 2022, 24, 526–536. [Google Scholar] [CrossRef]
- Korlapati, N.V.S.; Khan, F.; Noor, Q.; Mirza, S.; Vaddiraju, S. Review and analysis of pipeline leak detection methods. J. Pipeline Sci. Eng. 2022, 2, 100074. [Google Scholar] [CrossRef]
- Qu, Z.; Feng, H.; Zeng, Z.; Zhuge, J.; Jin, S. A SVM-based pipeline leakage detection and pre-warning system. Measurement 2010, 43, 513–519. [Google Scholar] [CrossRef]
- Valizadeh, S.; Moshiri, B.; Salahshoor, K. Leak Detection in Transportation Pipelines Using Feature Extraction and KNN Classification. In Pipelines 2009; American Society of Civil Engineers: Reston, VA, USA, 2009; pp. 580–589. [Google Scholar] [CrossRef]
- Cascianelli, S.; Costante, G.; Crocetti, F.; Ricci, E.; Valigi, P.; Fravolini, M.L. Data-based design of robust fault detection and isolation residuals via LASSO optimization and Bayesian filtering. Asian J. Control 2021, 23, 57–71. [Google Scholar] [CrossRef]
- Habibi, H.; Howard, I.; Habibi, R. Bayesian Fault Probability Estimation: Application in Wind Turbine Drivetrain Sensor Fault Detection. Asian J. Control 2020, 22, 624–647. [Google Scholar] [CrossRef]
- Habibi, H.; Howard, I.; Habibi, R. Bayesian Sensor Fault Detection in a Markov Jump System. Asian J. Control 2017, 19, 1465–1481. [Google Scholar] [CrossRef]
- Siddique, M.F.; Ahmad, Z.; Ullah, N.; Ullah, S.; Kim, J.-M. Pipeline Leak Detection: A Comprehensive Deep Learning Model Using CWT Image Analysis and an Optimized DBN-GA-LSSVM Framework. Sensors 2024, 24, 4009. [Google Scholar] [CrossRef]
- Yang, D.; Hai, X.; Ren, Y.; Cui, J.; Li, K.; Zeng, S. A hybrid fault prediction method for control systems based on extended state observer and hidden Markov model. Asian J. Control 2023, 25, 418–432. [Google Scholar] [CrossRef]
- Jia, T.; Song, J.; Niu, Y.; Chen, B.; Cao, Z. Optimized hybrid design with stabilizing transition probability for stochastic Markovian jump systems under hidden Markov mode detector. Asian J. Control 2022, 24, 2787–2795. [Google Scholar] [CrossRef]
- Wang, A.; Fei, M.; Song, Y. Optimal fault-tolerant control for Markov jump power systems with asynchronous actuator faults. Asian J. Control 2023, 25, 4466–4480. [Google Scholar] [CrossRef]
- Lu, D.; Zeng, G.; Liu, J. Non-Fragile Simultaneous Actuator and Sensor Fault-Tolerant Control Design for Markovian Jump Systems Based on Adaptive Observer. Asian J. Control 2018, 20, 125–134. [Google Scholar] [CrossRef]
- Saize, S.; Yang, X. On the definitions of hidden Markov models. Appl. Math. Model. 2024, 125, 617–629. [Google Scholar] [CrossRef]
- Westhead, D.R.; Vijayabaskar, M.S. (Eds.) Hidden Markov Models; Springer: New York, NY, USA, 2017; Volume 1552. [Google Scholar] [CrossRef]
- Che, J.; Zhu, Y.; Zhou, D. Hidden Markov model-based robust H∞ fault estimation for Markov switching systems with application to a single-link robot arm. Asian J. Control 2021, 23, 2227–2238. [Google Scholar] [CrossRef]
- Ozkan, H.; Ozkan, F.; Kozat, S.S. Online Anomaly Detection under Markov Statistics with Controllable Type-I Error. IEEE Trans. Signal Process. 2016, 64, 1435–1445. [Google Scholar] [CrossRef]
- Ai, C.; Sun, X.; Zhao, H.; Ma, R.; Dong, X. Pipeline damage and leak sound recognition based on HMM. In Proceedings of the 2008 7th World Congress on Intelligent Control and Automation, Chongqing, China, 25–27 June 2008; pp. 1940–1944. [Google Scholar] [CrossRef]
- Qiu, J.; Liang, W.; Zhang, L.; Yu, X.; Zhang, M. The early-warning model of equipment chain in gas pipeline based on DNN-HMM. J. Nat. Gas Sci. Eng. 2015, 27, 1710–1722. [Google Scholar] [CrossRef]
- Ai, C.; Zhao, H.; Ma, R.; Dong, X. Pipeline Damage and Leak Detection Based on Sound Spectrum LPCC and HMM. In Proceedings of the Sixth International Conference on Intelligent Systems Design and Applications, Jinan, China, 16–18 October 2006; pp. 829–833. [Google Scholar] [CrossRef]
- Fagiani, M.; Squartini, S.; Gabrielli, L.; Severini, M.; Piazza, F. A Statistical Framework for Automatic Leakage Detection in Smart Water and Gas Grids. Energies 2016, 9, 665. [Google Scholar] [CrossRef]
- Liu, J.; Zang, D.; Liu, C.; Ma, Y.; Fu, M. A leak detection method for oil pipeline based on markov feature and two-stage decision scheme. Measurement 2019, 138, 433–445. [Google Scholar] [CrossRef]
- Zhang, M.; Chen, X.; Li, W. Hidden Markov models for pipeline damage detection using piezoelectric transducers. J. Civ. Struct. Health Monit. 2021, 11, 745–755. [Google Scholar] [CrossRef]
- Available online: https://www.slb.com/products-and-services/delivering-digital-at-scale/software/olga/olga-dynamic-multiphase-flow-simulator (accessed on 14 September 2024).
- Ramezani, A.; Moshiri, B.; Abdulhai, B.; Kian, A. Estimation of free flow speed and critical density in a segmented freeway using missing data and Monte Carlo-based expectation maximisation algorithm. IET Control Theory Appl. 2011, 5, 123–130. [Google Scholar] [CrossRef]
Setting Number | Parameters | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
π1 | p11 | p22 | α1 | α2 | β1 | β2 | ||||
1 | True value | 1 | 0.9 | 1 | 2000 | 1688 | −2 | 0 | 1 | 2 |
Estimation | 1 | 0.92 | 1 | 1999.922 | 1687.721 | −1.9999 | 0.0009 | 0.622 | 2.13 | |
Standard deviation | 0.0001 | 0.0011 | 0 | 1.8559 | 0.9604 | 0.0293 | 0.0314 | 0.938 | 0.1122 | |
2 | True value | 1 | 0.9 | 1 | 2000 | 1844 | −2 | −1 | 1 | 2 |
Estimation | 1 | 0.9185 | 1 | 1999.922 | 1843.721 | −1.9999 | −0.999 | 0.6225 | 2.1322 | |
Standard deviation | 0.0001 | 0.00022 | 0.0018 | 0.1806 | 0.0826 | 0.00183 | 0.00019 | 0.0294 | 0.0005 | |
3 | True value | 1 | 0.9 | 1 | 2000 | 2000 | −2 | −2 | 1 | 2 |
Estimation | 1 | 0.8719 | 0.993 | 2000 | 1999.76 | −2.002 | −1.999 | 0.4349 | 2.0732 | |
Standard deviation | 0.0002 | 0.168 | 0.3463 | 0.0445 | 0.2081 | 0.0009 | 0.0009 | 0.3365 | 0.2789 | |
4 | True value | 1 | 0.9 | 1 | 2000 | 2156 | −2 | −3 | 1 | 2 |
Estimation | 1 | 0.9185 | 1 | 1999.922 | 2155.72 | −1.9999 | −2.999 | 0.6225 | 2.132 | |
Standard deviation | 0.0001 | 0 | 0.0006 | 0.417 | 1.3443 | 0.0041 | 0.0032 | 0.1169 | 0.1715 | |
5 | True value | 1 | 0.9 | 1 | 2000 | 2312 | −1 | −4 | 1 | 2 |
Estimation | 1 | 0.91859 | 1 | 1999.922 | 2311.72 | −1.999 | −3.999 | 0.6225 | 2.132 | |
Standard deviation | 0 | 0.0007 | 0 | 0.5383 | 1.903 | 0.0052 | 0.0045 | 0.1647 | 0.2981 |
Model | Precision | Recall | F1 Score |
---|---|---|---|
AHMM | 0.974783 | 0.980324 | 0.977545 |
K-NN | 0.943281 | 0.945343 | 0.944311 |
SVM | 0.934868 | 0.941408 | 0.938126 |
Logistic Regression | 0.899915 | 0.927853 | 0.913671 |
Naive Bayes | 0.945415 | 0.946655 | 0.946035 |
Model | Precision | Recall | F1 score |
---|---|---|---|
AHMM | 0.982782 | 0.973328 | 0.978032 |
K-NN | 0.981434 | 0.993878 | 0.987617 |
SVM | 0.974711 | 0.994316 | 0.984416 |
Logistic Regression | 0.982736 | 0.995628 | 0.98914 |
Naive Bayes | 0.954286 | 0.488414 | 0.951776 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zadehbagheri, O.; Salehizadeh, M.R.; Naghavi, S.V.; Moattari, M.; Moshiri, B. Novel Adaptive Hidden Markov Model Utilizing Expectation–Maximization Algorithm for Advanced Pipeline Leak Detection. Modelling 2024, 5, 1339-1364. https://doi.org/10.3390/modelling5040069
Zadehbagheri O, Salehizadeh MR, Naghavi SV, Moattari M, Moshiri B. Novel Adaptive Hidden Markov Model Utilizing Expectation–Maximization Algorithm for Advanced Pipeline Leak Detection. Modelling. 2024; 5(4):1339-1364. https://doi.org/10.3390/modelling5040069
Chicago/Turabian StyleZadehbagheri, Omid, Mohammad Reza Salehizadeh, Seyed Vahid Naghavi, Mazda Moattari, and Behzad Moshiri. 2024. "Novel Adaptive Hidden Markov Model Utilizing Expectation–Maximization Algorithm for Advanced Pipeline Leak Detection" Modelling 5, no. 4: 1339-1364. https://doi.org/10.3390/modelling5040069
APA StyleZadehbagheri, O., Salehizadeh, M. R., Naghavi, S. V., Moattari, M., & Moshiri, B. (2024). Novel Adaptive Hidden Markov Model Utilizing Expectation–Maximization Algorithm for Advanced Pipeline Leak Detection. Modelling, 5(4), 1339-1364. https://doi.org/10.3390/modelling5040069