Global demand for fossil fuels has increased the importance of flow measurement in the oil sector. As a result, a new submarket in the flowmeter business has opened up. To improve the accuracy of gamma-based two-phase flowmeters, this study employs time-feature extraction methods, a particle swarm optimization (PSO) based feature selection system, and an artificial neural network. This article proposes a fraction detection system that uses a 137Cs gamma source, two NaI detectors for recording the photons, and a Pyrex-glass pipe between them. The Monte Carlo N Particle method was used to simulate the geometry mentioned above. Thirteen time-domain features were extracted from the raw data recorded by both detectors. Optimal characteristics were identified with the help of PSO. This procedure resulted in the identification of eight efficient features. The input-output relationship was approximated using a Multi-Layer Perceptron (MLP) neural network. The innovation of the present research is in the use of a feature extraction technique based on the PSO algorithm to determine volume percentages, with results such as: (1) introducing eight appropriate time characteristics in determining volume percentages; (2) achieving an accuracy of less than 0.37 in root mean square error (RMSE) and 0.14 in mean square error (MSE) while predicting the volume fraction of components in a gas-liquid two-phase flow; and (3) reducing the calculation load. Utilizing optimization-based feature selection techniques has allowed for the selection of meaningful inputs, which has decreased the volume of computations while boosting the precision of the presented system.