Font Size: a A A

Optimization And System Design Of Mask Wearing Detection Algorithm Based On YOLOv5s

Posted on:2024-04-19Degree:MasterType:Thesis
Country:ChinaCandidate:H ShaoFull Text:PDF
GTID:2530307124471304Subject:Electronic information
Abstract/Summary:
Since the outbreak of the new crown epidemic at the end of 2019,from the Delta virus with a high mortality rate to the Omicron strain,various variant strains are unpreventable,and the threat on a global scale continues unabated,and airborne transmission is the main transmission route of this epidemic virus,which has a serious impact on people’s physical and mental health,and wearing masks is the most basic and universal way to prevent and reduce the transmission of various viruses and influenza in the air,especially in public places,wearing masks is both to protect oneself and to the public.Therefore,during the pandemic,masks are mandatory when entering public places.However,for a variety of reasons,there will always be people who do not cooperate with these requirements.Relying on human management not only consumes a lot of manpower and material resources,but also easily causes human loopholes and contradictions,so it is necessary to design an intelligent automatic identification management system for public places to identify and record people who do not wear masks.The mask is a relatively small target,especially in the case of a large number of people,light impact,etc.,there are relatively high requirements for the accuracy and response speed of target recognition.This project focuses on the object detection algorithm in the automatic mask wearing recognition management system,as follows:(1)Aiming at the problems of small detection target,light influence and low detection accuracy caused by missed detection in the actual mask wearing detection scene,this paper adopts the YOLOv5 s algorithm and optimizes and improves it,adds the cross-channel attention mechanism structure to the backbone network,removes the original full connection layer,and uses one-dimensional convolution operation to realize cross-channel interaction in specific areas to improve the model’s ability to extract detailed information.Then,a feature fusion mechanism is added at the output prediction end,which can self-adjust the corresponding size and fuse the feature information for the feature maps of different sizes at the output end,retain useful feature information and filter out useless feature information,and further strengthen the ability to extract detailed information.(2)Aiming at the problems of uneven distribution,uneven proportion and difficult classification of positive and negative samples in the dataset,the focus loss function weight adjustment is used to effectively solve such problems,and a gradient coordination mechanism is adopted to avoid excessive attention to the problem of uneven sample distribution and difficult classification,and the loss attenuation problem is considered from a certain range of confidence,which effectively avoids the overfitting phenomenon caused by excessive focus on sample problems.In addition,the SIOU loss function is introduced to speed up the convergence speed of the model.(3)Then,the research and design of mask wearing detection system was realized in Python environment by using tools such as PyQT5,QT Designer and Eric6,and the effect was better in the detection of local file images,videos and real-time video streams of startup computer cameras.(4)The model after adding cross-channel attention mechanism,adaptive feature fusion and loss function optimization is trained and detected on the dataset created in this paper,and its detection accuracy reaches 93.22%,which is 1.34 percentage points higher than the original algorithm,and the speed is also increased from 14.1ms to 13.9ms,and the experimental results show that it meets the needs of real-time mask detection.
Keywords/Search Tags:deep learning, mask testing, attention mechanisms, adaptive feature fusion, Gradient coordination mechanism
Related items