The traditional BP neural network search algorithm based on gradient orientation is easy to fall into local minimum, the convergence process is slow, and it cannot guarantee the convergence to the global optimal solution. In order to improve the prediction accuracy of short-term load forecasting, this paper applies the bacterial foraging optimization algorithm to BP neural network, using its unique breeding and eviction operation, can improve the convergence speed of the algorithm, strengthen the ability to search the global optimal solution, and reduce the prediction error.