Explainable EEG-Based Framework for Student Attention Classification with LLM Instructional Recommendations
Abstract
Student attention is a central factor in learning effectiveness, yet most existing electroencephalography-based attention monitoring systems focus exclusively on classification accuracy without addressing interpretability or practical instructional utility. This paper presents a unified framework that integrates attention classification, explainable artificial intelligence, and large language model-driven instructional recommendations to bridge the gap between physiological monitoring and actionable teaching decisions. The framework derives binary attention labels from electroencephalography spectral features using the Theta-Beta Ratio combined with age-adjusted Monastra thresholds, applied here as population-level heuristic guidelines rather than individual diagnostic criteria. Five machine learning classifiers were trained and evaluated under stratified five-fold cross-validation on a publicly available dataset of 983 samples with precomputed electroencephalography spectral power features across five frequency bands. Gradient Boosting achieved the strongest performance, reaching 98.3% accuracy, 97.8% balanced accuracy, and a macro F1-score of 97.6%, with particularly reliable detection of the low-attention class. These figures represent an upper bound, given the shared spectral origin of the labeling mechanism and model inputs, and the absence of subject-level identifiers in the dataset. To ensure transparency, Shapley Additive Explanations analysis was applied at both global and local levels, identifying Beta and Theta band activity as the dominant predictors of attention state. A large language model component then maps each classified attention state to a concrete, knowledge-grounded instructional strategy drawn from peer-reviewed educational literature, providing teachers with an actionable pedagogical recommendation rather than a classification label alone. The proposed framework advances the field by combining classification accuracy, model interpretability, and practical instructional guidance within a single deployable system, providing a foundation for intelligent, transparent, and educationally responsive attention monitoring in real classroom settings.
Keywords
Full Text:
PDFReferences
J. Zhang, “Cognitive Functions of the Brain: Perception, Attention and Memory,” May 30, 2019, arXiv: arXiv:1907.02863. doi: 10.48550/arXiv.1907.02863.
J. Sweller, “Cognitive Load During Problem Solving: Effects on Learning,” Cognitive Science, vol. 12, no. 2, pp. 257–285, Apr. 1988, doi: 10.1207/s15516709cog1202_4.
A. Diamond, “Want to Optimize Executive Functions and Academic Outcomes? Simple, Just Nourish the Human Spirit,” in Minnesota Symposia on Child Psychology, 1st ed., P. D. Zelazo and M. D. Sera, Eds., Wiley, 2013, pp. 203–230. doi: 10.1002/9781118732373.ch7.
N. Bergdahl, "Engagement and disengagement in online learning," Computers & Education, vol. 188, Art. no. 104476, 2022. doi: 10.1016/j.compedu.2022.104476
M. K. Syed, H. Wang, A. A. Siddiqi, S. Qureshi, and M. A. Gouda, "EEG-Based Attention Classification for Enhanced Learning Experience," Applied Sciences, vol. 15, no. 15, p. 8668, 2025, doi: 10.3390/app15158668.
A. Al-Nafjan and M. Aldayel, “Predict Students’ Attention in Online Learning Using EEG Data,” Sustainability, vol. 14, no. 11, 2022, doi: 10.3390/su14116553.
R. H. C. e Souza and E. L. M. Naves, “Attention Detection in Virtual Environments Using EEG Signals: A Scoping Review,” Frontiers in Physiology, vol.12,2021, 2021, doi: 10.3389/fphys.2021.727840.
W. Wan, X. Cui, Z. Gao, and Z. Gu, “Frontal EEG-Based Multi-Level Attention States Recognition Using Dynamical Complexity and Extreme Gradient Boosting,” Front. Hum. Neurosci., vol. 15, p. 673955, Jun. 2021, doi: 10.3389/fnhum.2021.673955.
R. Guidotti, A. Monreale, S. Ruggieri, F. Turini, F. Giannotti, and D. Pedreschi, “A Survey of Methods for Explaining Black Box Models,” ACM Comput. Surv., vol. 51, no. 5, pp. 1–42, Sep. 2019, doi: 10.1145/3236009.
Z. C. Lipton, "The mythos of model interpretability," ACM Queue, vol. 16, no. 3, pp. 31–57, 2018. doi: 10.1145/3236386.3241340
M. T. Ribeiro, S. Singh, and C. Guestrin, “‘Why Should I Trust You?’: Explaining the Predictions of Any Classifier,” in Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco California USA: ACM, Aug. 2016, pp. 1135–1144. doi: 10.1145/2939672.2939778.
S. M. Lundberg and S.-I. Lee, "A unified approach to interpreting model predictions," in Advances in Neural Information Processing Systems, vol. 30, pp. 4765–4774, 2017. doi: 10.48550/arXiv.1705.07874.
T. B. Brown et al., "Language models are few-shot learners," in Advances in Neural Information Processing Systems, vol. 33, pp. 1877–1901, 2020. doi: 10.48550/arXiv.2005.14165.
E. Kasneci et al., "ChatGPT for good? On opportunities and challenges of large language models for education," Learning and Individual Differences, vol. 103, p. 102274, 2023, doi: 10.1016/j.lindif.2023.102274.
K. Suwida, S. C. Hidayati, and R. Sarno, “Application of machine learning algorithm for mental state attention classification based on electroencephalogram signals,” presented at the 2023 International Conference on Computer Science, Information Technology and Engineering (ICCoSITE), IEEE, 2023, pp. 354–358.
C. L. Peiris et al., “Classroom Movement Breaks Reduce Sedentary Behavior and Increase Concentration, Alertness and Enjoyment during University Classes: A Mixed-Methods Feasibility Study,” IJERPH, vol. 18, no. 11, p. 5589, May 2021, doi: 10.3390/ijerph18115589.
P. Ginns, K. Muscat, and R. Naylor, “Rest breaks aid directed attention and learning,” Educational and Developmental Psychologist, vol. 40, no. 2, pp. 141–150, Jul. 2023, doi: 10.1080/20590776.2023.2225700.
M. E. Haagsman, K. Scager, J. Boonstra, and M. C. Koster, “Pop-up Questions Within Educational Videos: Effects on Students’ Learning,” J Sci Educ Technol, vol. 29, no. 6, pp. 713–724, Dec. 2020, doi: 10.1007/s10956-020-09847-3.
M. S. Doğru, F. Yüzbaşıoğlu, and I. Arpaci, “The effect of interactive videos enhanced with pop-up questions on teacher candidates’ learning performance in science,” Research in Science & Technological Education, vol. 43, no. 1, pp. 312–327, Jan. 2025, doi: 10.1080/02635143.2023.2272820.
M. Prince, "Does active learning work? A review of the research," Journal of Engineering Education, vol. 93, no. 3, pp. 223–231, 2004, doi: 10.1002/j.2168-9830.2004.tb00809.x.
M. Stigmar, “Peer-to-peer Teaching in Higher Education: A Critical Literature Review,” Mentoring & Tutoring: Partnership in Learning, vol. 24, no. 2, pp. 124–136, Mar. 2016, doi: 10.1080/13611267.2016.1178963.
X. Chen, L. Wang, X. Zhai, and Y. Li, "Exploring the effects of argument map-supported online group debate activities on college students' critical thinking," Front. Psychol., vol. 13, Art. no. 856462, 2022, doi: 10.3389/fpsyg.2022.856462.
J. Metcalfe, “Learning from Errors,” Annu. Rev. Psychol., vol. 68, no. 1, pp. 465–489, Jan. 2017, doi: 10.1146/annurev-psych-010416-044022.
J. C.-Y. Sun, “Influence of polling technologies on student engagement: An analysis of student motivation, academic performance, and brainwave data,” Computers & Education, vol. 72, pp. 80–89, Mar. 2014, doi: 10.1016/j.compedu.2013.10.010.
J.-W. Wang, D.-W. Zhang, and S. J. Johnstone, “Portable EEG for assessing attention in educational settings: A scoping review,” Acta Psychologica, vol. 255, p. 104933, May 2025, doi: 10.1016/j.actpsy.2025.104933.
DOI: https://doi.org/10.47738/jads.v7i3.1379
Refbacks
- There are currently no refbacks.

Journal of Applied Data Sciences
| ISSN | : | 2723-6471 (Online) |
| Publisher | : | Bright Publisher |
| Website | : | http://bright-journal.org/JADS |
| : | taqwa@amikompurwokerto.ac.id (principal contact) | |
| support@bright-journal.org (technical issues) |
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0




.png)