Trustworthy volumetric flow measurements are essential in many applications such as power plant controls or district heating systems. Flow metering under disturbed flow conditions, such as downstream of bends, is a challenge and leads to errors of up to 20 %. In this paper, an algorithm based on a shallow neural network (SNN) is developed, leading to a significant error reduction for strongly disturbed flow profiles. To cover a wide range of disturbances, the training dataset was chosen to consist of three base types of elbow configurations. For 83 % of the test data, the SNN produces a smaller error than the state-of-the-art approach. The average error is reduced from 2.25 % to 0.42 %. For the SNN, an error of less than 1 % can be achieved for downstream distances greater than 10 pipe diameters. The SNN demonstrated robustness to various reductions of the training dataset, as well as to noisy input data. Additionally, simulation data of a realistic pipe system with a significantly different geometry compared with the training data was used for testing. In this strong extrapolation, the mean error of the SNN was always smaller than the state-of-the-art approach and an error of less than 1 % could be achieved for more than 10 pipe diameters downstream of the last disturbance.