Pipelines are observed one of the economic modes of transport for transporting oil, gas, and water between various locations. Most of the countries in the world transport petroleum and other flammable products through underground pipelines. The underground and aboveground pipelines are facing various damages due to corrosion, dents, and ruptures due to the environment and operational fluid conditions. The danger of leaks and accidents increases as a result of these damages. Pipelines must be evaluated on a regular basis to make sure they are fit for transmission. By evaluating the effects of damages and the possibility of catastrophic failures using a variety of techniques, pipeline integrity is controlled. Applying the relative risk scoring (RRS) technique, pipeline failures are predicted. One of the probabilistic techniques used to forecast risk based on an impartial assessment is machine learning. With different parameters like corrosion, leakage, materials, atmosphere, surface, earth-movements, above-ground and underground facilities, etc., the RRS method provides an accuracy of 97.5% in identifying the risk and gives a precise classification of risk, whether the pipeline has a high, medium, or low risk without any delay on the prediction compared with Naive Bayes, decision tree, support vector machine, and graph convolutional network.