当前位置:网站首页>Mask wearing detection method based on yolov5
Mask wearing detection method based on yolov5
2022-07-01 22:24:00 【Short section senior】
pick want
Wearing masks correctly is of great significance to effectively reduce the infection of covid-19 among people at this stage . be based on YOLOv5 Excellent performance in the field of image recognition and detection , This paper is based on YOLOv5 Automatic wear detection method for mask wear . First, find and collect pictures of people wearing masks in different scenes from the Internet and real life, about 500 Zhang Bing built his own dataset , And then use it YOLOv5 Model framework , Modify its relevant configuration files and detection parameters , And adopt data enhancement and Dropout Technology prevents overfitting . The experimental results verify YOLOv5 Superior performance in image recognition task of model crowd wearing masks , On test set YOLOv5s The accuracy of model recognition is as high as 85.45%.
key word Image recognition ; Mask wearing test ;YOLOv5; Feature learning ;
introduction
since 2019 Since then , Novel coronavirus pneumonia attacks the world , It affects people's life safety , China has taken strong and effective prevention and control measures , It has achieved great success in fighting COVID-19 , But we still can't relax , In the crowded airport , Stations and markets, etc , There is a risk of transmission if you are careless . Wearing masks correctly is one of the effective measures to effectively reduce the infection between personnel at this stage , Wearing a mask for detection also requires certain detection technology , At present, the efficiency of mask wearing detection is low due to the influence of the surrounding complex environment , Lead to missed inspection and other conditions . In order to achieve better detection effect , This paper mainly uses YOLOv5 Research on network model in lightweight mask wearing Detection Algorithm .
1 Data preprocessing
1.1 Data collection
The wearing image of crowd masks is 2022 year 5 month 23 Japan , Three students in this group took pictures on the Internet and in the real scene with their mobile phones , total 1027 A picture . The original image resolution obtained by different acquisition devices is different , When modeling data, scale to 324×324 Size specification
surface 1 Data collection information
Number Camera resolution Mobile phone model Number of images
1 2532 x 1170 Iphone12 250
2 2532 x 1170 IPhone13 325
3 4000 x 3000 Xiaomi 10S 301
(a) Mask wearing style
(b) Types of masks
chart 1. Mask wearing style data display
1.2 Data to enhance
In order to improve the generalization ability of convolutional neural network model , Wear the image on each mask by rotating 、 translation 、 Distortion 、 The zoom 、 Traditional digital image processing methods such as flipping perform random transformation to expand the number of samples . Some samples of a mask image after data enhancement are shown in the figure 2 Shown , The mask wearing image generated by random transformation greatly expands the data set , Make the sample more widely distributed .
chart 2 Some image samples after data enhancement
2 Test model
In this paper YOLOv5 Build a target mask detection model , It uses multiple residual components to deepen the network model , Directly increase the ability of network feature extraction and feature fusion .
2.1 Network structure
The recognition model constructed in this paper is mainly YOLOv5s, It is small and light , Fast features , Suitable for fast and accurate identification tasks . Model diagram 3-1.
The model input image is set to 324×324 Three channel color image , The residual structure contains bottleneck residual modules in turn 、 Conventional residual module ×2、 Bottleneck residual module 、 Conventional residual module ×3、 Bottleneck residual module 、 Conventional residual module ×22、 Bottleneck residual module 、 Conventional residual module ×2. Its internal convolution kernel setting is slightly adjusted . Last , After the network full connection layer Softmax The classifier outputs the classification probability of each category .
chart 3-1YOLOv5 Identify the network diagram
3 experiment
3.1 Experimental setup
In the experiment of image detection , The effects of different network architectures under different parameters are tested . Method of transforming model structure : change YOLOv5 There are three models in , Observe the accuracy of the three models under the same parameters .
The experimental programming development environment is PyCharm Community Edition 2021.1, The computing device is a personal computer , CPU by Intel Core i7-1065G7, The main frequency is 1.30GHz, Internal 8GB, The graphics card is NVIDIA GeForce MX230, To display as 4GB. The division ratio of training data and test data is 9:1.
3.2 experimental result
3.2.1 The best experimental results
First , Merge the mask image data set of all people together , Random stratified sampling 90% As a training set , rest 10% As a testing machine , Read in randomly out of order , Each iteration in the training process is randomly disrupted once , Training 5 Time , Verify once after each training , The data enhancement method is to move up, down, left and right randomly 20 Pixel ,x Axis random reflection . The recognition accuracy is shown in the table 3 Shown . among YOLOv5x The training set has the highest accuracy, but the training takes time 132 branch 51 second , YOLOv5l Training time consuming 105 branch 43 second ,YOLOv5s Training time consuming 78 branch 34 second . From the perspective of resource consumption and income ratio ,YOLOv5s Strong performance .YOLOv5x The generalization ability is poor , There is a problem of over fitting and the training process oscillates seriously .
surface 3. The best recognition result
The algorithm name Training accuracy Test accuracy
YOLOv5x 100 97.87
YOLOv5l 99.87 95.55
YOLOv5s 98.32 94.68
4 Conclusion
In this paper YOLOv5 The detection network model establishes the detection model of people wearing masks , It is used to automatically detect the wearing of masks of mobile people in different scenes . First , Search in Baidu gallery on the Internet 151 An image of the wearing of masks , Then, images of the wearing of masks were taken from different scenes around the crowd 876 Zhang . A total of 1027 Zhang . And manually mark the wearing of masks ; And then YOLOv5 Model architecture , Migration learns a convolutional neural network , The recognition accuracy on the test set can reach 98%, In different scenes , For different angles , Different types of masks have high recognition accuracy , Overall good performance , It has certain practical significance for the prevention and control of COVID-19 .
In order to improve the accuracy of large-scale crowd mask wearing detection in large scenes 、 Timeliness and robustness , The next step will continue to optimize the network structure and parameters , Add convolution model , Improve the overall accuracy , Transform data set content , The idea of hierarchical representation combined with feature learning , Transfer features 、 Feature learning and artificial features are combined to build a deep learning model that is easy to train .
ginseng Examination writing offer
[1] Wang Liru . be based on YOLOv5s Mask wearing test [J]. Tibetan science and Technology ,2022(05):65-67.
[2] Zhang Luyao , Hanwha . be based on YOLOv5s Whether to wear a mask on your face [J]. Intelligent computers and applications ,2021,11(09):196-199.
[3] Tan Shilei , Don't xiongbo , Lugonglin , Talk about Xiaohu . be based on YOLOv5 The personnel of the network model wear masks for real-time monitoring [J]. Laser magazine ,2021,42(02):147-150.
[4] Wang Feng . improvement yolov5 Artificial intelligence detection and recognition algorithm for wearing masks and helmets [J]. Architecture and budget ,2020(11):67-69.
[5] Wang Xinran , Tianqichuan , Zhang Dong . A review of research on face mask wearing detection [J]. Computer engineering
Welcome to join me for wechat exchange and discussion ( Please note csdn Add )
边栏推荐
- Why does blocprovider feel similar to provider?
- Unity uses SQLite
- MQ learning notes
- [live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
- Simple interactive operation of electron learning (III)
- idea中类中显示成员变量和方法
- Classify boost libraries by function
- JS how to get a list of elements in a collection object
- 收到一封CTO来信,邀约面试机器学习工程师
- 最近公共祖先(LCA)在线做法
猜你喜欢
杰理之、产线装配环节【篇】
[live broadcast review] the first 8 live broadcasts of battle code Pioneer have come to a perfect end. Please look forward to the next one!
MySQL learning notes - SQL optimization of optimization
ngnix基础知识
东哥套现,大佬隐退?
Spark面试题
工控设备安全加密的意义和措施
杰理之蓝牙耳机品控和生产技巧【篇】
JS how to get a list of elements in a collection object
[deep learning] use deep learning to monitor your girlfriend's wechat chat?
随机推荐
功利点没啥!
"The silk road is in its youth and looks at Fujian" is in the hot collection of works in the Fujian foreign youth short video competition
I received a letter from CTO inviting me to interview machine learning engineer
Airserver mobile phone third-party screen projection computer software
从MLPerf谈起:如何引领AI加速器的下一波浪潮
Count the number of each character in the character
Basic operation of binary tree
PWN攻防世界cgpwn2
分离字符串中的字母和数字并使得字母在前数组在后
LIS (longest ascending subsequence) problem that can be understood [easy to understand]
【生态伙伴】鲲鹏系统工程师培训
Test cancellation 1
Go - exe corresponding to related dependency
为什么数字化转型战略必须包括持续测试?
函数基本学习之一
上半年暂停考试要补考?包含监理工程师、建筑师等十项考试
Go — 相关依赖对应的exe
Design and practice of new generation cloud native database
面试题:MySQL的union all和union有什么区别、MySQL有哪几种join方式(阿里面试题)[通俗易懂]
焱融看 | 混合云时代下,如何制定多云策略