PurposeThis paper aims to fully understand the relationship between students' classroom emotions and teachers' behaviors in the teaching environment, provide personalized teaching support, stimulate teachers' motivation, and enhance the emotional connection between teachers and students. This paper designs a teacher's ability model based on emotion-behavior relevance theory and artificial intelligence (AI) technology. MethodsFirstly, this paper expounds on the integration of emotion-behavior relevance theory, AI, and teacher's ability model under the background of ideological and political education. Subsequently, the artificial neural network (ANN) model is deeply analyzed in relation to the development of psychology and AI technology. Guided by the theory of emotion-behavior relevance, an ANN model is used to optimize the classroom emotion recognition module in the teacher's ability model. The accuracy of the optimized teacher's ability model in recognizing attention and resistance is verified by experiments. The relationship between the teacher's classroom emotions, students' classroom behavior, and the teacher's teaching ability is analyzed. ResultsThe experimental results show that the optimized model can effectively identify students' classroom emotions, and the accuracy of identifying attention and resistance reaches 93.6 % and 92 %, respectively, significantly exceeding the traditional model. For other emotions, the accuracy of the experimental group ranges from 80.6 % to 87.9 %, while that of the control group is only 61.1 %. The optimized model shows a better effect on the emotional recognition of multiple students. This proves the effectiveness of the proposed optimization model. In addition, by analyzing teachers' emotions in real classroom videos, people can observe that teachers' psychological emotions and behaviors change with the changes in students' classroom emotions. Under the students' positive emotions, teachers scored high in psychological emotions, behaviors, and teaching achievements, with the lowest scores of 87, 80, and 85, respectively. Under students' negative emotions, teachers' related scores are low, with the highest scores of 40, 40, and 42. This highlights the critical influence of the emotional attitude and values of the main characters on teachers' teaching ability in the classroom environment from the psychological perspective. ConclusionStudents' positive emotions, such as concentration and devotion, will arouse teachers' satisfaction and happiness, motivate them to teach more diligently, and improve the teaching effect. On the contrary, students' negative emotions, such as resistance and doubt, may cause teachers to feel depressed and discouraged. This proves the importance and effectiveness of integrating the emotion-behavior relevance theory into teaching. Students' emotions impact teachers' psychological emotions and behaviors and affect the teaching effect. In this case, teachers need to use their emotional adjustment ability to adjust their feelings in time to better guide students and improve teaching efficiency. This paper provides valuable insights for optimizing the teacher's ability model.