Closed-loop neuromodulation, especially using the phase of the electroencephalography (EEG) rhythm to assess the real-time brain state and optimize the brain stimulation process, is becoming a hot research topic. Because the EEG signal is non-stationary, the commonly used EEG phase-based prediction methods have large variances, which may reduce the accuracy of the phase prediction. In this study, we proposed a machine learning-based EEG phase prediction network, which we call EEG phase prediction network (EPN), to capture the overall rhythm distribution pattern of subjects and map the instantaneous phase directly from the narrow-band EEG data. We verified the performance of EPN on pre-recorded data, simulated EEG data, and a real-time experiment. Compared with widely used state-of-the-art models (optimized multi-layer filter architecture, auto-regress, and educated temporal prediction), EPN achieved the lowest variance and the greatest accuracy. Thus, the EPN model will provide broader applications for EEG phase-based closed-loop neuromodulation.