Freezing of gait (FOG) is an episodic gait disturbance affecting initiation and continuation of locomotion in many Parkinson’s disease (PD) patients, causing falls and a poor quality of life. FOG can be experienced on turning and start hesitation, passing through doorways or crowded areas dual tasking, and in stressful situations. Electroencephalography (EEG) offers an innovative technique that may be able to effectively foresee an impending FOG. From data of 16 PD patients, using directed transfer function (DTF) and independent component analysis (ICA) as data pre-processing, and an optimal Bayesian neural network as a predictor of a transition of 5 seconds before the impending FOG occurs in 11 in-group PD patients, we achieved sensitivity and specificity of 85.86% and 80.25% respectively in the test set (5 out-group PD patients). This study therefore contributes to the development of a non-invasive device to prevent freezing of gait in PD.