Machine learning plays an increasingly important role in the field of disease risk prediction due to its optimization advantages. This paper proposes deep confidence network optimization based on the early warning model constructed by the neural network and chooses the restricted Boltzmann machine and backpropagation algorithm as the theoretical basis of deep confidence network construction. The deep confidence network is established through the construction and stacking of RBM, and backpropagation is used to fine-tune the network parameters to generate the model. Combined with the incidence rate data of sports injuries of physical education majors and the injury classification of the deep confidence network algorithm, the test data application results verify that the algorithm has a good effect of early warning in case of sports injuries. The survey data showed that the incidence of sports injuries was 228%, and the main risk indicators causing sports injuries were not drinking alcohol (95.31%) and incorrect sports knowledge (92.09%). The model correctly predicted 94.15% (95% CI: 0.9204, 0.9608) with sensitivity and specificity: 0.954 and 0.923, respectively.