The formation of scales in pipes is one element that has a major impact on the efficiency of machinery used in the oil and gas sector. With the help of artificial intelligence, this new, non-invasive device was able to figure out the volume fraction of a two-phase flow by taking into account the thickness of the scale in the tested pipeline. The proposed design uses an isotope pair of barium-133 and cesium-137 as a dual-energy gamma generator. One detector records photons that are transmitted, and another detector records photons that are scattered. The signals from the detectors were simulated using the Monte Carlo N-Particle (MCNP) code, and then ten frequency and wavelet characteristics were extracted. To choose the best inputs from the collected features for computing the volume fraction, an ant colony optimization (ACO)-based method is applied. Six attributes, representing the optimal combination, were developed using this method. In order to forecast the volume percentage of two-phase flows independently of flow regime and scale thickness, we fed the characteristics introduced by ACO into a group method of data handling (GMDH) neural network. Volume fraction calculations had a maximum RMSE of 0.056, which is quite little compared to previous research. By using the ACO to choose the best characteristics, the current work has significantly increased its accuracy in identifying volume fractions. © 2024 Korean Nuclear Society