Bearings are widely used in various electrical and mechanical equipment. As their core components, failures often have serious consequences. At present, most parameter adjustment methods are still manual adjustments of parameters. This adjustment method is easily affected by prior knowledge, easily falls into the local optimal solution, cannot obtain the global optimal solution, and requires a lot of resources. Therefore, this paper proposes a new method for bearing fault diagnosis based on wavelet packet transform and convolutional neural network optimized by a simulated annealing algorithm. Firstly, the original bearing vibration signal is extracted by wavelet packet transform to obtain the spectrogram, and then the obtained spectrogram is sent to the convolutional neural network for parameter adjustment, and finally the simulated annealing algorithm is used to adjust the parameters. To verify the effectiveness of the method, the bearing database of Case Western Reserve University is used for testing, and the traditional intelligent bearing fault diagnosis methods are compared. The results show that the new method for bearing fault diagnosis proposed in this paper has a better and more reliable diagnosis effect than the existing machine learning and deep learning methods.