Pipelines are widely regarded as the most cost‐effective mode of transportation for oil and gas, particularly when it comes to covering long distances. Regrettably, pipelines are not impervious to accidents, which can result in colossal material damage and fatalities. As the demand for oil and gas rises, so does the need for pipelines. Therefore, issues in pipeline malfunctions cannot be overlooked. Leakage and blockage are the two main faults in pipelines that lead to pipeline incidents if not addressed timely. Detecting pipeline leaks is a major hurdle for industry, and various techniques have been developed to tackle this. This article focuses on the modeling of leakage detection in pipelines in two‐phase transient flows. Initially, OLGA, a multiphase software, is used for simulating the transient flows in a black oil case study. A leak was induced after 30 min of the simulation and leak cases were designed with varying parameters. Using the simulated data of mass flow rate, and pressure at the inlets and outlets, the model will be identified. The adaptive thresholds‐based model was able to predict the leaks accurately. The performance of the leak detection model was analyzed. The model was able to detect leaks of 2%–10% sizes successfully.