The art of music, which is a necessary component of daily life and an ideology older than language, reflects the emotions of human reality. Many new elements have been introduced into music as a result of the quick development of technology, gradually altering how people create, perform, and enjoy music. It is incredible to see how actively AI has been used in music applications and music education over the past few years and how significantly it has advanced. AI technology can efficiently pull in the course, stratify complex large-scale music or sections, simplify teaching, improve student understanding of music, solve challenging student problems in class, and simplify the tasks of teachers. The traditional music education model has been modified, and the music education model’s audacious innovation has been made possible by reducing the distance between the teacher and the student. A classification algorithm based on spectrogram and NNS is proposed in light of the advantages in image processing. The abstract features on the spectrogram are automatically extracted using the NNS, which completes the end-to-end learning and avoids the tediousness and inaccuracy of manual feature extraction. This study, which uses experimental analysis to support its findings, demonstrates that different music teaching genres can be accurately classified at a rate of over 90%, which has a positive impact on recognition.