Mask_Wearing_Detection_Based_on_Ultralytics
A project of mask-wearing detection based on Ultralytics.
基于 Ultralytics 的口罩佩戴检测项目。
Relevant project
- 同济大学2023年大学生创新创业训练计划项目
Since the COVID-19 pandemic, correctly and properly wearing masks has been a primary and effective method to block the transmission of the virus. This project is based on the YOLOv8 object detection algorithm to establish an access control system for detecting mask wearing and its compliance, helping to monitor mask wearing and its appropriateness, thus aiding in response to potential future pandemic situations.
Through the initial phase of reading papers and researching materials, the project members gained a preliminary understanding of the YOLO model principles; in the second phase, the team constructed the project model and selected some open-source datasets for initial training, successfully completing a binary classification for mask wearing detection; in the third phase, the team attempted to expand the dataset by adding images of improperly worn masks and conducted manual labeling, while also adjusting model parameters to make the prediction results more accurate; finally, in the fourth phase, the team evaluated the experimental data and summarized the project findings.
The team, based on the currently mature object detection model (YOLOv8), designed an access control detection system for mask wearing with high accuracy and real-time capabilities, suitable for real-time mask wearing detection applications.
By using our own optimized training dataset, which includes images of mask wearing in various scenarios, we achieved the access control detection system's functionality to detect whether a mask is worn and whether it is worn correctly. Innovative designs were implemented regarding the standard of mask wearing, and combined with the detection results, commands on whether to grant access are issued.
This project can be applied to campuses, stations, and other scenarios with high foot traffic and complex environments, aimed at reducing labor costs and aiding in pandemic prevention.
自新冠肺炎疫情后,正确规范佩戴口罩是阻断疫情传播的主要途径和有效方法。本项目基于 YOLOv8 目标检测算法来建立门禁检测口罩佩戴系统,帮助检测口罩佩戴及佩戴是否规范,有助于应对未来可能的疫情情况。
通过第一阶段的论文阅读和资料查询,项目成员初步掌握了 YOLO 模型相关原理;在第二阶段项目成员搭建了项目模型并选取一些开源数据集进行初步训练,成功完成是否佩戴口罩的二分类;在第三阶段项目成员在第三阶段尝试增添数据集,补充未规范佩戴口罩的图片集并进行了手动标注,同时调整了模型参数使得预测结果更加精确;最后在第四阶段小组对实验数据进行评估以及对项目进行总结。
团队基于当前比较成熟的目标检测模型(YOLOv8),设计了一套门禁检测口罩佩戴系统,具有较高的准确性和实时性,适合于实时口罩佩戴检测应用。
我们通过使用自己搭建的优化过的训练数据集,包含各种场景下的口罩佩戴图像,实现了门禁检测口罩佩戴系统对是否佩戴口罩、是否佩戴完好的检测功能,并针对口罩佩戴的规范性进行了创新性设计,并结合检测结果,给出是否放行的指令。
该项目能应用于校园、车站等人流量大、环境复杂的情形,旨在降低人力成本,有助于防范疫情。
-
Project Plan Application 项目计划申请书
-
Opening Defense 项目开题答辩
-
First Quarter Report 项目第一季度报告
-
Second Quarter Report 项目第二季度报告
-
Mid-term Defense 项目中期答辩
-
Mid-term Report 项目中期检查报告
-
Third Quarter Report 项目第三季度报告
-
Fourth Quarter Report 项目第四季度报告
-
Final Report 项目结题报告
-
Final Defense 项目结题答辩
-
SITP Acceptance Results Announcement 2024年电子与信息工程学院大学生创新训练项目结题验收结果公示
-
Certificate 校级大学生创新创业训练计划结题证书
-
Business Plan 商业策划书
-
Dataset 数据集
-
Results 模型训练结果
-
模型训练代码
from ultralytics import YOLO model = YOLO('yolov8n.pt') model.train(data='Dataset/data.yaml', workers=0, epochs=100, batch=16)
-
模型检测代码
from ultralytics import YOLO yolo = YOLO('Train/weights/best.pt', 'detect') result = yolo(source=0, show=True)
2024年4月24日