In the petrochemical industry, the ball valve internal leakage has been identified as a significant cause of production safety accidents, leading to mass casualties and economic losses. Depending on the flowing direction of the fluid, the form of ball valve internal leakage can be separated into unilateral and bilateral internal leakage. If a ball valve has a unilateral internal leakage, it is capable to play a sealing role, which can reduce gas venting and economic losses during natural gas fire operations. Therefore, this study aimed to develop a method for predicting the internal leakage rate and recognizing the unilateral and bilateral internal leakage used in gas transmission pipelines. For predicting the ball valve internal leakage rate, an Adaboost Integrated Circular Search Algorithm Optimised Support Vector Regression (CSA-SVR-Adaboost) model was employed and compared with other models. The CSA-SVR-Adaboost model demonstrated superior performance, displaying the lowest errors and highest correlation coefficients compared to the other models considered. Furthermore, this study aimed to identify unilateral and bilateral internal leakage of ball valves. To achieve this, a Dung Beetle Optimization Algorithm for Optimizing Kernel Extreme Learning Machine (DBO-KELM) model was adopted and evaluated based on its recognition performance. The recognition accuracy of DBO-KELM was 85.19%, surpassing the recognition accuracy of the Extreme Learning Machine (ELM) and Kernel Extreme Learning Machine (KELM) algorithms by 9.5% and 14.9%, respectively.