In this work, a novel approach for the topology optimization of phononic crystals based on the replacement of the computationally demanding traditional solvers for the calculation of dispersion diagrams with a surrogate deep learning (DL) model is proposed. We show that our trained DL model is ultrafast in the prediction of the dispersion diagrams, and therefore can be efficiently used in the optimization framework