This paper proposes an artificial intelligence-based system to automatically detect whether students are paying attention to the class or are distracted. This system is designed to help teachers maintain students’ attention, optimize their lessons, and dynamically introduce modifications in order for them to be more engaging.