Intelligent countermeasures analysis in oil and gas projects utilizing topic modeling
Ehab Elhosary, Osama Moselhi · Journal of Loss Prevention in the Process Industries · 2025
The oil and gas industry is inherently complex and high-risk, with potential fires, explosions, and releases of hazardous substances posing significant safety challenges. Despite robust safety management systems, accidents persist, highlighting the importance of learning from past incidents and hazard reports. Historical Hazard and Operability (HAZOP) reports generate valuable countermeasures—safeguards and recommendations—that inform the design of protection systems to enhance safety management. However, the sheer volume of countermeasures produced makes addressing each one prohibitively expensive and time-consuming. Additionally, current HAZOP literature and software tools lack automation of these countermeasures, impeding the efficient dissemination of information to the appropriate departments for detailed design. This paper introduces categorizing countermeasures utilizing the BERTopic algorithm in natural language processing (NLP). The methodology comprises data preprocessing, SBERT (a modification of the Bidirectional Encoder Representations from Transformers) for generating embeddings, Uniform manifold approximation and projection (UMAP) for dimensionality reduction, hierarchical density-based spatial clustering of applications with noise (HDBSCAN) for clustering, and KeyBERT for topic representation. Applied to 1,574 records from a HAZOP report of an oil pump station, the BERTopic model achieved 84.6% coherence score and 90.7% topic diversity score, resulting in 15 final topics, outperforming Latent Dirichlet Allocation (LDA) (45.3% and 84.7%) and Latent Semantic Analysis (LSA) (53% and 96%). The study identified included and excluded topics for each node and the most frequent topics by risk rate. The generated safety systems (SS) were validated against API RP 750 and RP 752 standards and the Countermeasures Breakdown Structure (CBS) was introduced to organize safety systems hierarchically. The developed model was tested on another dataset of an oil and gas production facility, comprising 512 records and 21 nodes, achieving 85.29% coherence and 98.33% topic diversity, confirming its robustness and consistency. This research benefits HAZOP participants by improving hazard identification, emphasizing key preventative actions, and assigning them to relevant departments for design-stage deployment.