In this paper, the transformer target detection algorithm is established by combining deep learning technology, and the Deep algorithm is added on the basis of SORT to optimize and improve SORT and overcome the problems of SORT. After the DeepSORT model is constructed, YOLOv5 is introduced into the model, and finally, the YOLOv5-DeepSORT model for sports element detection and tracking is constructed and completed. The ATT-BERT sports culture element entity recognition model is constructed from four levels: the BERT layer, the BiLSTM layer, the attention layer, and the CRF layer, which results in an application framework for the integration of traditional sports culture into teaching. The influence factors of sports culture perception and sports teaching, as well as the integration of traditional ethnic sports culture into sports teaching in Z, were empirically examined. The study shows that the correlation coefficient between the two is around 0.465, and there is a positive and strong correlation between the two. The correlation coefficients of the dimensions for physical education students and non-physical education students were 0.513, 0.483, 0.485, and 0.462, respectively. The most common teaching methods used by teachers in physical education classrooms integrating traditional sports culture were explanation, demonstration, and complete decomposition, with ratios of 0.78 and 0.7, respectively. The integration of sports culture into physical education has resulted in good results. The outcome was satisfactory.