10 gigabit passive optical network (XGPON) is considered to be an efficient and energy-saving solution for bandwidth resource allocation in mobile fronthaul (MFH), as it significantly reduces delay and jitter caused by signal transmission in the MFH network. In the upstream direction of passive optical networks, optical network units (ONUs) report their load conditions to the optical line terminal (OLT), and based on these conditions, the OLT schedules and allocates network resources using dynamic bandwidth allocation (DBA) algorithm. However, DBA based on the request/grant mechanism fails to meet the low delay requirements of 5G networks. Therefore, we propose a machine learning-based DBA algorithm that utilizes extreme learning machine (ELM) to predict the future load conditions of ONUs. ELM is widely popular in machine learning due to its fast learning speed and excellent generalization performance. It achieves this by randomly initializing the weights and biases of hidden layer neurons and then solving the output weights directly using linear equations. According to simulation results, the proposed ELM-DBA algorithm exhibits outstanding performance in terms of delay and jitter. Specifically, the algorithm achieves low delay of 125 μs, meeting the 3GPP requirements for delay below 250 μs, and the jitter remains below 80 μs consistently. Furthermore, ELM demonstrates exceptional learning speed, with training speed improved by at least 600 times compared to gate recurrent unit and long short term memory.