计算机与现代化 ›› 2025, Vol. 0 ›› Issue (08): 76-81.doi: 10.3969/j.issn.1006-2475.2025.08.011

• 图像处理 • 上一篇    下一篇

改进YOLOv8的课堂行为检测算法

  


  1. (西安工程大学计算机科学学院,陕西 西安 710600)
  • 出版日期:2025-08-27 发布日期:2025-08-28
  • 作者简介: 作者简介:苏衍森(1998—),男,山西运城人,硕士研究生,研究方向:目标检测,E-mail: 1349128235@qq.com; 牟莉(1972—),女,陕西西安人,副教授,研究方向:智能化信息系统和嵌入式系统应用。
  • 基金资助:
     基金项目:陕西省科技计划项目(2019CGXNG-015)
       

Improved Classroom Behavior Detection Algorithm for YOLOv8


  1. (School of Computer Science, Xi’an Polytechnic University, Xi’an 710600, China)
  • Online:2025-08-27 Published:2025-08-28

摘要: 摘要:针对监控下学生课堂行为检测精度低和模型难以部署等问题,提出一种改进的YOLOv8算法用于对学生课堂行为进行检测。首先,对YOLOv8主干网络进行改进,引入Swin Transformer网络作为主干特征提取网络,减少特征信息丢失以提高特征提取的效果;其次,为增强模型对远距离目标特征的关注,引入一种灵活的双通道注意力机制EMA,使模型更加关注远距离像素少的目标而提高检测精度;最后,在Neck部分使用包含GSConv的Slim-Neck设计范式对模型进行轻量化改进。在SCB-Dataset3数据集上的实验结果表明,改进后的模型参数量和计算量分别为3.3 M和11.1 GFLOPs,检测精度达到88.75%,与原模型相比参数量减少40.7%,计算量减少15.9%,检测精度提高7.7百分点,在实现模型轻量化的同时取得了较好的检测精度。

 

关键词: 关键词:课堂行为检测, YOLOv8, Swin Transformer, 注意力机制, Slim-Neck

Abstract:
Abstract: Aiming at the problems of low detection accuracy of student classroom behavior under monitoring and difficulty in deploying models, an improved YOLOv8 algorithm is proposed for detecting student behavior. Firstly, the YOLOv8 backbone network is improved by introducing the Swin Transformer network as the backbone feature extraction network to reduce information loss and improve the effectiveness of feature extraction. Secondly, to enhance the model’s attention to the features of distant targets, a flexible dual channel attention mechanism EMA is introduced, which makes the model focus more on targets with fewer pixels at long distances and improves detection accuracy. Finally, in the Neck section, the Slim Neck design paradigm containing GSConv is used to make lightweight improvements to the model. The experimental results on the SCB-Dataset3 dataset show that the improved model has a parameter count of 3.3 M and a computational load of 11.1 GFLOPs, respectively, with a detection accuracy of 88.75%. Compared with the original model, the parameter count is reduced by 40.7%, the computational load is reduced by 15.9%, and the detection accuracy is improved by 7.7 percentage points. This achieves good detection accuracy while achieving model lightweighting.

Key words: Key words: classroom behavior detection, YOLOv8, Swin Transformer, attention mechanism, Slim-Neck
Backbone

中图分类号: