Yorick-Ryu / drowsiness-detection

Repository from Github https://github.comYorick-Ryu/drowsiness-detectionRepository from Github https://github.comYorick-Ryu/drowsiness-detection

疲劳检测系统

该项目实现了一个基于深度学习的疲劳检测系统,通过分析员面部图像来判断是否处于疲劳状态。

项目依赖

  • Python 3.9.18
  • TensorFlow 2.17
  • OpenCV
  • NumPy
  • Pandas
  • Matplotlib
  • split-folders

数据集

使用了疲劳数据集(Driver Drowsiness Dataset),包含两类图像:

  • 疲劳状态(Drowsy)
  • 清醒状态(Non-Drowsy)ß

数据集下载链接: Driver Drowsiness Dataset on Kaggle

数据集按7:1.5:1.5的比例分为训练集、验证集和测试集。

模型架构

项目实现了三种模型:

  1. 自定义CNN模型
  • 3个卷积层(Conv2D)
  • 3个最大池化层(MaxPool2D)
  • 2个全连接层(Dense)
  • 输出层(softmax)
  1. VGG19迁移学习模型
  • 预训练VGG19作为特征提取器
  • 添加全局平均池化
  • 2个全连接层
  • Dropout和BatchNormalization
  • 输出层(softmax)
  1. MobileNet迁移学习模型
  • 预训练MobileNet作为特征提取器
  • 与VGG19模型相同的顶层架构

实验结果

三个模型在测试集上的表现:

Model Accuracy Precision Recall
CNN 0.99 0.99 0.99
VGG19 0.78 0.78 0.78
MobileNet 0.99 0.99 0.99

CNN和MobileNet模型更好。

About


Languages

Language:Jupyter Notebook 99.9%Language:Python 0.1%