基于Python + Flask + MySQL的dlib人脸识别考勤签到系统
dlib-Based Face Recognition Attendance and Check-In System Using Python, Flask, and MySQL
摘要: 传统人工签到、刷卡签到等考勤方式存在效率低、易作弊、数据统计繁琐等问题,难以满足组织高效准确的管理需求。因此,文章设计并实现了一套人脸识别考勤签到系统,以解决传统考勤痛点。系统采用Python开发,借助Flask框架构建Web应用,MySQL存储用户信息、人脸特征与考勤数据,核心依赖dlib库实现人脸检测、特征提取与匹配,搭配OpenCV与PIL库完成图像处理。系统为三层架构,涵盖用户登录与权限管理、教师课程及考勤管理、学生人脸采集与记录查询等功能模块,通过SQLAlchemy ORM简化数据库操作。测试验证显示,系统人脸检测与识别响应时间 < 5秒,支持多用户并发操作,运行稳定、数据安全,能精准完成考勤全流程。该系统实现了考勤自动化,减少了人工干预,提升了管理效率与准确性,兼具低成本、定制化强等优势,具有良好的实用性与应用价值。
Abstract: Traditional methods of attendance tracking, such as manual sign-in and card-based attendance, suffer from inefficiencies, susceptibility to cheating, and cumbersome data collection processes, making it challenging to meet organizations’ needs for efficient and accurate management. This article describes the design and implementation of a facial recognition attendance tracking system to address the shortcomings of traditional attendance tracking methods. The system is developed using Python, with a web application built using the Flask framework. MySQL is used to store user information, facial features, and attendance data. The core functionality is achieved through the dlib library for facial detection, feature extraction, and matching, complemented by OpenCV and PIL libraries for image processing. The system employs a three-layer architecture, including modules for user login and permission management, teacher course and attendance management, student facial data collection, and record query. SQL Alchemy ORM simplifies database operations. Testing has shown that the system’s facial detection and recognition response time is less than 5 seconds, it supports concurrent operations by multiple users, operates stably, ensures data security, and accurately completes the entire attendance tracking process. This system automates attendance tracking, reduces manual intervention, enhances management efficiency and accuracy, and offers advantages such as low cost and strong customization capabilities, making it highly practical and valuable.
文章引用:纪雨欣, 王立东, 武佳瑶, 方星元, 林安超, 李思颖. 基于Python + Flask + MySQL的dlib人脸识别考勤签到系统[J]. 计算机科学与应用, 2026, 16(5): 243-250. https://doi.org/10.12677/csa.2026.165180

参考文献

[1] 李远. 人脸识别课堂考勤系统的研究与实现[D]: [硕士学位论文]. 杭州: 浙江工业大学, 2020.
[2] 李俊甲, 王峥. 面向低代码平台的软件系统架构设计[J]. 信息记录材料, 2025, 26(11): 94-96+173.
[3] 吴小龙, 李雪松, 丁艳, 等. 基于LAB和HOG特征的KCF-TLD融合目标跟踪算法[J]. 计算机工程与科学, 2026, 48(3): 512-520.
[4] 陶冶, 曲洪权, 李洋, 等. 基于HOG特征的脑电地形图分类算法研究[J]. 工业控制计算机, 2023, 36(10): 71-72+74.
[5] 刘晓涵, 高艳鹍, 刘一非, 等. 基于可学习权重残差连接的深度网络优化方法[J]. 计算机工程与设计, 2026, 47(3): 717-724.
[6] 康秀谦, 陈景霞, 郭承湘, 等. 基于ResNet模型的高校人脸识别库构建与应用研究[J]. 电脑知识与技术, 2025, 21(5): 30-33.