Abstract Gas–liquid counter-current flow in vertical annulus is involved in several industrial fields such as petroleum engineering. For example, in coalbed methane wells with liquid pump drainage, obtaining the real-time flow rate of gas–liquid two-phase in the annulus is crucial for the development management of coalbed methane wells. However, due to complex flow conditions, this demand is difficult to achieve through traditional flow metering means. Therefore, this paper proposes a flow prediction method based on multi-group differential pressure signals and machine learning technology. Air-water two-phase flow experiments were carried out on a vertical annulus pipeline with inner and outer diameters of 75 mm/125 mm and adjustable eccentricity. The probability density function and power spectrum density of 3 groups of differential pressure signals collected at different height intervals in the annulus were used as model inputs. A gas–liquid two-phase flow prediction model was constructed based on the artificial neural network model, and the model hyper-parameters were optimized using Bayesian optimization. The results show that on the 440-group test dataset under the combined conditions of air superficial velocity of 0.06–5.04 m s−1, water superficial velocity of 0.03–0.25 m s−1, and pipeline eccentricity of 0, 0.25, 0.5, 0.75, 1, etc. This model can achieve average prediction errors of 9.12% and 29.34% for gas and water flow rates respectively. This method can be applied to the non-throttling, non-invasive measurement of phase flow rate under the condition of annulus air-liquid counter-current flow.