Application of Machine Learning-Based Models in Early Detection of Production Anomalies in Oil and Gas Wells
Abstract
The early detection of production anomalies in petroleum wells is critical for optimizing operational efficiency, reducing downtime, and mitigating environmental risks, particularly in complex and prolific regions like the Niger Delta. This study investigates the application of both unsupervised and supervised artificial intelligence models for anomaly detection using historical well production data. A comprehensive exploratory data analysis of 15,634 records revealed significant variability and skewness in key parameters such as downhole pressure and oil production, justifying the need for advanced detection techniques. Several machine learning models were evaluated, including Isolation Forest, One-Class Support Vector Machine (SVM), and Copula-Based Outlier Detection (COPOD) as unsupervised methods, together with Random Forest and XGBoost as supervised methods. The unsupervised models demonstrated varying degrees of success; One-Class SVM achieved the highest recall (0.879), effectively capturing most anomalies but with lower precision, while COPOD offered a more balanced performance (F1-score: 0.66). The supervised models initially achieved perfect classification metrics (F1-score: 1.0); this was traced to a data-leakage error in which the target column was inadvertently retained among the input features. After removing the leaked feature and re-evaluating with time-series cross-validation, XGBoost achieved the best supervised performance (F1-score: 0.85, AUC: 0.95) and Random Forest a precision of 0.95, giving realistic rather than perfect results. Reconstruction-based methods such as autoencoders were also explored and are identified as a promising direction for future evaluation. The results underscore a fundamental trade-off: unsupervised models provide scalable, label-free solutions ideal for initial screening across diverse assets, whereas supervised models deliver superior accuracy when high-quality labeled data is available. The study concludes that a hybrid framework, leveraging unsupervised methods for broad monitoring and supervised models for confirmed anomaly types, offers the most pragmatic and effective strategy for deployment in the dynamic operational environment of the Niger Delta. This approach promises to enhance proactive well management, support predictive maintenance, and contribute to more sustainable and economically efficient petroleum production.
Keywords
Ethical Statement
Thanks
References
- Aljameel, S. S., Alomari, D. M., Alismail, S., Khawaher, F., Alkhudhair, A. A., Aljubran, F., & Alzannan, R. M. (2022). An Anomaly Detection Model for Oil and Gas Pipelines Using Machine Learning. Computation, 10(8), 138. https://doi.org/10.3390/computation10080138
- Aranha, P. E., Policarpo, N. A., & Sampaio, M. A. (2024). Unsupervised machine learning model for predicting anomalies in subsurface safety valves and application in offshore wells during oil production. Journal of Petroleum Exploration and Production Technology, 14(2), 567–581. https://doi.org/10.1007/s13202-023-01720-4
- Bayazitova, G., Anastasiadou, M., & dos Santos, V. D. (2024). Oil and gas flow anomaly detection on offshore naturally flowing wells using deep neural networks. Geoenergy Science and Engineering, 242, 213240. https://doi.org/10.1016/j.geoen.2024.213240
- Bergmeir, C., & Benítez, J. M. (2012). On the use of cross-validation for time series predictor evaluation. Information Sciences, 191, 192–213. https://doi.org/10.1016/j.ins.2011.12.028
- Chen, T., & Guestrin, C. (2016). XGBoost: A Scalable Tree Boosting System. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD’16) (pp. 785–794), 13-17 August 2016, San Francisco, USA. https://doi.org/10.1145/2939672.2939785
- Fernandes, W., Jr., Komati, K. S., & Assis de Souza Gazolli, K. (2023). Anomaly detection in oil-producing wells: A comparative study of one-class classifiers in a multivariate time series dataset. Journal of Petroleum Exploration and Production Technology, 14(1), 343–363. https://doi.org/10.1007/s13202-023-01710-6
- Kapoor, S., & Narayanan, A. (2023). Leakage and the reproducibility crisis in machine-learning-based science. Patterns, 4(9), 100804. https://doi.org/10.1016/j.patter.2023.100804
- Li, J., Zhang, C., Lin, Y., Liu, Y., Jin, Q., Xiao, T., Liu, X., & Zhang, Y. (2025). An early warning system for oil wells based on improved long short-term memory network. Frontiers in Earth Science, 12, 1508776. https://doi.org/10.3389/feart.2024.1508776
Details
Primary Language
English
Subjects
Petroleum Engineering (Other)
Journal Section
Research Article
Authors
Early Pub Date
September 29, 2026
Publication Date
September 30, 2026
Submission Date
June 15, 2026
Acceptance Date
July 24, 2026
Published in Issue
Year 2026 Volume: 13 Number: 3