An Integrated Approach for Monitoring Social Distancing and Face Mask Detection Using Stacked ResNet-50 and YOLOv5
Abstract
:1. Introduction
- A robust dataset consisting of 1916 masked and 1930 unmasked images has been developed from various sources, and then data augmentation is applied.
- Five types of models have been trained on the dataset for face mask detection and their comparative analysis has been presented.
- The human faces have been extracted using DSFD and then have been fed into the proposed model (Stacked ResNet-50) to be classified as masked or unmasked.
- The integrated system used YOLOv5 to detect humans in a particular frame, which is then clustered using DBSCAN for social distancing monitoring. The Euclidean distance between each detected bounding box has been computed. A social distance violation threshold has been predefined which ensures whether social distancing rules are being followed.
- The proposed technique was systematically analysed using different algorithms with the same set of parameters.
2. Related Work
3. Materials and Methods
- A.
- Data Collection
- B.
- Data Augmentation
- Gaussian blur: here a Gaussian filter is used (Equation (1)), which removes noise and reduces details.
- Average blur: The kernel taken for this has a range of (3, 7). The image is processed with a filter box during this operation. The mean of all the pixels in the kernel region is used to replace the image’s core component.
- In motion blur out of the 4 types of blurs namely vertical, horizontal, main diagonal, and anti-diagonal one was chosen at random and applied to the image. It has a kernel range of (3, 8). Figure 2 shows the sample images of original and non-masked images used in research. The dataset of 528 random images have been created using web scraping and various other sources containing masked and non-masked classes.
4. Proposed Methodology
- A.
- Face Mask Classifier Using Stacked ResNet-50
- B.
- Social Distance Monitoring using DBSCAN and YOLOv5
- YOLOv5
- b.
- DBSCAN
5. Result and Analysis
- A.
- Face mask Classifier using Stacked ResNet-50
- B.
- Social Distance Monitoring using DBSCAN and YOLOV5
- C.
- Comparison with State of art methods
6. Conclusions and Future Scope
Author Contributions
Funding
Conflicts of Interest
References
- WHO Corona-Viruses (COVID-19). 2020. Available online: https://www.who.int/emergencies/diseases/novel-coronavirus-2019 (accessed on 4 November 2021).
- Kooraki, S.; Hosseiny, M.; Myers, L.; Gholamrezanezhad, A. Coronavirus (COVID-19) Outbreak: What the Department of Radiology Should Know. J. Am. Coll. Radiol. 2020, 17, 447–451. [Google Scholar] [CrossRef]
- Siedner, M.J.; Gandhi, R.T.; Kim, A.Y. Desperate Times Call for Temperate Measures: Practicing Infectious Diseases During a Novel Pandemic. J. Infect. Dis. 2020, 222, 1084–1085. [Google Scholar] [CrossRef] [PubMed]
- Dhand, R.; Li, J. Coughs and sneezes: Their role in transmission of respiratory viral infections, including SARS-CoV-2. Am. J. Respir. Crit. Care Med. 2020, 202, 651–659. [Google Scholar] [CrossRef]
- Majidi, H.; Niksolat, F. Chest CT in patients suspected of COVID-19 infection: A reliable alternative for RT-PCR. Am. J. Emerg. Med. 2020, 38, 2730–2732. [Google Scholar] [CrossRef] [PubMed]
- Palanisamy, V.; Thirunavukarasu, R. Implications of big data analytics in developing healthcare frameworks—A review. J. King Saud Univ.-Comput. Inf. Sci. 2019, 31, 415–425. [Google Scholar] [CrossRef]
- Chu, D.K.; Akl, E.A.; Duda, S.; Solo, K.; Yaacoub, S.; Schünemann, H.J.; Reinap, M. Physical distancing, face masks, and eye protection to prevent person-to-person transmission of SARS-CoV-2 and COVID-19: A systematic review and meta-analysis. Lancet 2020, 395, 1973–1987. [Google Scholar] [CrossRef]
- Gilani, S.; Roditi, R.; Naraghi, M. COVID-19 and anosmia in Tehran, Iran. Med. Hypotheses 2020, 141, 109757. [Google Scholar] [CrossRef] [PubMed]
- Elston, D.M. The coronavirus (COVID-19) epidemic and patient safety. J. Am. Acad. Dermatol. 2020, 82, 819–820. [Google Scholar] [CrossRef] [Green Version]
- Ferguson, N.M.; Cummings, D.A.; Cauchemez, S.; Fraser, C.; Riley, S.; Meeyai, A.; Iamsirithaworn, S.; Burke, D. Strategies for Containing an Emerging Influenza Pandemic in Southeast Asia. Nature 2005, 437, 209–214. [Google Scholar] [CrossRef] [Green Version]
- Wen, L.; Li, X.; Gao, L. A transfer convolutional neural network for fault diagnosis based on ResNet-50. Neural Comput. Appl. 2020, 32, 6111–6124. [Google Scholar] [CrossRef]
- Sanders, J.G.; Jenkins, R. Individual differences in hyper-realistic mask detection. Cogn. Res. Princ. Implic. 2018, 3, 24. [Google Scholar] [CrossRef] [Green Version]
- Wang, X.; Peng, Y.; Lu, L.; Lu, Z.; Bagheri, M.; Summers, R.M. Chestx-ray8: Hospital-scale chest X-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017. [Google Scholar]
- Chinazzi, M.; Davis, J.T.; Ajelli, M.; Gioannini, C.; Litvinova, M.; Merler, S.; Piontti, Y.; Pastore, A.; Mu, K.; Rossi, L.; et al. The Effect of Travel Restrictions on the Spread of the 2019 Novel Coronavirus (Covid-19) Outbreak. Science 2020, 368, 395–400. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Peeri, N.C.; Shrestha, N.; Rahman, M.S.; Zaki, R.; Tan, Z.; Bibi, S.; Baghbanzadeh, M.; Aghamohammadi, N.; Zhang, W.; Haque, U. The SARS, MERS and novel coronavirus (COVID-19) epidemics, the newest and biggest global health threats: What lessons have we learned? Int. J. Epidemiol. 2020, 49, 717–726. [Google Scholar] [CrossRef] [Green Version]
- Jain, R.; Gupta, M.; Taneja, S.; Hemanth, D.J. Deep learning based detection and analysis of COVID-19 on chest X-ray images. Appl. Intell. 2021, 51, 1690–1700. [Google Scholar] [CrossRef]
- Ozturk, T.; Talo, M.; Yildirim, E.A.; Baloglu, U.B.; Yildirim, O.; Acharya, U.R. Automated detection of COVID-19 cases using deep neural networks with X-ray images. Comput. Biol. Med. 2020, 121, 103792. [Google Scholar] [CrossRef] [PubMed]
- Kumar, D.; Batra, U. Classification of Invasive Ductal Carcinoma from histopathology breast cancer images using Stacked Generalized Ensemble. J. Intell. Fuzzy Syst. 2021, 40, 4919–4934. [Google Scholar] [CrossRef]
- Qin, B.; Li, D. Identifying facemask-wearing condition using image super-resolution with classification network to prevent COVID-19. Sensors 2018, 20, 5236. [Google Scholar] [CrossRef]
- Din, N.U.; Javed, K.; Bae, S.; Yi., J. A Novel GAN-Based Network for Unmasking of Masked Face. IEEE Access 2020, 8, 44276–44287. [Google Scholar] [CrossRef]
- Loey, M.; Smarandache, F.; Khalifa, N.E.M. Within the Lack of Chest COVID-19 X-ray Dataset: A Novel Detection Model Based on GAN and Deep Transfer Learning. Symmetry 2020, 12, 651. [Google Scholar] [CrossRef] [Green Version]
- Sathyamoorthy, A.J.; Patel, U.; Savle, Y.A.; Paul, M.; Manocha, D. COVID-robot: Monitoring social distancing constraints in crowded scenarios. arXiv 2020, arXiv:2008.06585. [Google Scholar]
- Punn, N.S.; Sonbhadra, S.K.; Agarwal, S.; Rai, G. Monitoring COVID-19 social distancing with person detection and tracking via fine-tuned YOLO v3 and Deepsort techniques. arXiv 2020, arXiv:2005.01385. [Google Scholar]
- Nguyen, C.T.; Saputra, Y.M.; Van Huynh, N.; Nguyen, N.T.; Khoa, T.V.; Tuan, B.M.; Ottersten, B. A comprehensive survey of enabling and emerging technologies for social distancing—Part I: Fundamentals and enabling technologies. IEEE Access 2020, 8, 153479–153507. [Google Scholar] [CrossRef] [PubMed]
- Rahman, A.; Hossain, M.S.; Alrajeh, N.A.; Alsolami, F. Adversarial Examples—Security Threats to COVID-19 Deep Learning Systems in Medical IoT Devices. IEEE Internet Things J. 2021, 8, 9603–9610. [Google Scholar] [CrossRef]
- Militante, S.V.; Dionisio, N.V. Real-Time Facemask Recognition with Alarm System using Deep Learning. In Proceedings of the 2020 11th IEEE Control and System Graduate Research Colloquium (ICSGRC), Shah Alam, Malaysia, 8 August 2020; pp. 106–110. [Google Scholar]
- Jaiswal, S.; Valstar, M. Deep learning the dynamic appearance and shape of facial action units. In Proceedings of the 2016 IEEE Winter Conference on Applications of Computer Vision (WACV), Lake Placid, NY, USA, 7–10 March 2016; pp. 1–8. [Google Scholar]
- Yang, D.; Yurtsever, E.; Renganathan, V.; Redmill, K.; Özgüner, Ü. A Vision-Based Social Distancing and Critical Density Detection System for COVID-19. Sensors 2021, 21, 4608. [Google Scholar] [CrossRef] [PubMed]
- Ramadass, L.; Arunachalam, S.; Sagayasree, Z. Applying deep learning algorithm to maintain social distance in public place through drone technology. Int. J. Pervasive Comput. Commun. 2020, 16, 223–234. [Google Scholar] [CrossRef]
- Hossain, M.S.; Muhammad, G.; Guizani, N. Explainable AI and Mass Surveillance System-Based Healthcare Framework to Combat COVID-I9 Like Pandemics. IEEE Netw. 2020, 34, 126–132. [Google Scholar] [CrossRef]
- Inamdar, M.; Ninad, M. Real-Time Face Mask Identification Using Face Mask Net Deep Learning Network. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3663305 (accessed on 4 November 2021). [CrossRef]
- Lucena, O.; Junior, A.; Moia, V.; Souza, R.; Valle, E.; Lotufo, R. Transfer Learning Using Convolutional Neural Networks for Face Anti-spoofing. In Proceedings of the Lecture Notes in Computer Science, Montreal, QC, Canada, 5–7 July 2017; Springer: Berlin/Heidelberg, Germany, 2017; pp. 27–34. [Google Scholar]
- Alotaibi, A.; Mahmood, A. Enhancing computer vision to detect face spoofing attack utilizing a single frame from a replay video attack using deep learning. In Proceedings of the 2016 International Conference on Optoelectronics and Image Processing (ICOIP), Warsaw, Poland, 10–12 June 2016; pp. 1–5. [Google Scholar]
- Dzisi, E.K.J.; Dei, O.A. Adherence to social distancing and wearing of masks within public transportation during the COVID 19 pandemic. Transp. Res. Interdiscip. Perspect. 2020, 7, 100191. [Google Scholar] [CrossRef]
- Ahmed, I.; Ahmad, M.; Rodrigues, J.J.; Jeon, G.; Din, S. A deep learning-based social distance monitoring framework for COVID-19. Sustain. Cities Soc. 2021, 65, 102571. [Google Scholar] [CrossRef]
- Walia, I.; Srivastava, M.; Kumar, D.; Rani, M.; Muthreja, P.; Mohadikar, G. Pneumonia Detection using Depth-Wise Convolutional Neural Network (DW-CNN). EAI Endorsed Trans. Pervasive Health Technol. 2020, 6. [Google Scholar] [CrossRef]
- Sener, F.; Ikizler-Cinbis, N. Two-person interaction recognition via spatial multiple instance embedding. J. Vis. Commun. Image Represent. 2015, 32, 63–73. [Google Scholar] [CrossRef]
- Ghorai, A.; Gawde, S.; Kalbande, D. Digital Solution for Enforcing Social Distancing. In Proceedings of the International Conference on Innovative Computing & Communications (ICICC), New Delhi, India, 20–22 February 2020. [Google Scholar]
- Kumar, D.; Jain, N.; Khurana, A.; Mittal, S.; Satapathy, S.C.; Senkerik, R.; Hemanth, J.D. Automatic Detection of White Blood Cancer from Bone Marrow Microscopic Images Using Convolutional Neural Networks. IEEE Access 2020, 8, 142521–142531. [Google Scholar] [CrossRef]
- Loey, M.; Manogaran, G.; Taha, M.H.N.; Khalifa, N.E.M. A hybrid deep transfer learning model with machine learning methods for face mask detection in the era of the COVID-19 pandemic. Measurement 2021, 167, 108288. [Google Scholar] [CrossRef] [PubMed]
- Wang, Z.; Wang, G.; Huang, B.; Xiong, Z.; Hong, Q.; Wu, H.; Liang, J. Masked face recognition dataset and application. arXiv 2020, arXiv:2003.09093. [Google Scholar]
- Singh, S.; Ahuja, U.; Kumar, M.; Kumar, K.; Sachdeva, M. Face mask detection using YOLOv3 and faster R-CNN models: COVID-19 environment. Multimed. Tools Appl. 2021, 80, 19753–19768. [Google Scholar] [CrossRef]
- Loey, M.; Manogaran, G.; Taha, M.H.N.; Khalifa, N.E.M. Fighting against COVID-19: A novel deep learning model based on YOLO-v2 with ResNet-50 for medical face mask detection. Sustain. Cities Soc. 2021, 65, 102600. [Google Scholar] [CrossRef]
- Ejaz, S.; Islam, R.; Ejaz, M.S.; Islam, M.R.; Sifatullah, M.; Sarker, A. Implementation of Principal Component Analysis on Masked and Non-masked Face Recognition. In Proceedings of the 2019 1st International Conference on Advances in Science, Engineering and Robotics Technology (ICASERT), Dhaka, Bangladesh, 3–5 May 2019. [Google Scholar]
- Venkateswarlu, I.B.; Kakarla, J.; Prakash, S. Face mask detection using MobileNet and Global Pooling Block. In Proceedings of the 2020 IEEE 4th Conference on Information & Communication Technology (CICT), Chennai, India, 3–5 December 2020; pp. 1–5. [Google Scholar]
- Yu, J.; Zhang, W. Face Mask Wearing Detection Algorithm Based on Improved YOLO-v4. Sensors 2021, 21, 3263. [Google Scholar] [CrossRef]
- Sethi, S.; Kathuria, M.; Kaushik, T. Face Mask Detection using Deep Learning: An Approach to Reduce Risk of Coronavirus Spread. J. Biomed. Inform. 2021, 120, 103848. [Google Scholar] [CrossRef]
Training | Testing | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Model | CNN | MobileNetV3 | Inception V3 | Resnet-50 | Stacked ResNet-50 | CNN | MobileNetV3 | InceptionV3 | ResNet-50 | Stacked ResNet-50 |
Accuracy | 0.92 | 0.94 | 0.95 | 0.96 | 0.96 | 0.75 | 0.83 | 0.83 | 0.77 | 0.87 |
Precision | 0.57 | 0.59 | 0.67 | 0.70 | 0.73 | 0.51 | 0.56 | 0.66 | 0.54 | 0.71 |
Recall | 0.67 | 0.94 | 0.94 | 0.90 | 0.93 | 0.65 | 0.93 | 0.93 | 0.67 | 0.92 |
F1 Score | 0.61 | 0.7 | 0.77 | 0.77 | 0.81 | 0.52 | 0.59 | 0.65 | 0.59 | 0.79 |
Loss | 0.13 | 0.11 | 0.11 | 0.18 | 0.12 | 0.18 | 0.13 | 0.13 | 0.19 | 0.14 |
Specificity | 0.53 | 0.82 | 0.92 | 0.78 | 0.83 | 0.48 | 0.8 | 0.91 | 0.79 | 0.81 |
Source | Authors | Methodology | Social Distance Monitoring | Resul t(%) |
---|---|---|---|---|
[42] | S Singh et al. | Faster R-CNN + Yolov3 | No | AP-62(FasterCNN) 55(YOLOv3) |
[43] | Loey, Mohamed, et al. | YOLOv2 + ResNet50 | No | AP-81 * |
[19] | Ge, Shiming, et al. | LLE-CNNs | No | AP-76.1 * |
[44] | Ejaz, Md Sabbir, et al. | PCA | No | AC-70 * |
[45] | Venkateswarlu et al. | ResNet-50 | No | AC-84.1 * |
[46] | Yu Jimin et al. | YOLOv4 | No | AC-98.3 * |
[47] | S. Sethi et al. | ResNet-50 | No | AP-98.2 * |
Proposed Methdology | Stacked Resnet-50 | YES | 87 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Walia, I.S.; Kumar, D.; Sharma, K.; Hemanth, J.D.; Popescu, D.E. An Integrated Approach for Monitoring Social Distancing and Face Mask Detection Using Stacked ResNet-50 and YOLOv5. Electronics 2021, 10, 2996. https://doi.org/10.3390/electronics10232996
Walia IS, Kumar D, Sharma K, Hemanth JD, Popescu DE. An Integrated Approach for Monitoring Social Distancing and Face Mask Detection Using Stacked ResNet-50 and YOLOv5. Electronics. 2021; 10(23):2996. https://doi.org/10.3390/electronics10232996
Chicago/Turabian StyleWalia, Inderpreet Singh, Deepika Kumar, Kaushal Sharma, Jude D. Hemanth, and Daniela Elena Popescu. 2021. "An Integrated Approach for Monitoring Social Distancing and Face Mask Detection Using Stacked ResNet-50 and YOLOv5" Electronics 10, no. 23: 2996. https://doi.org/10.3390/electronics10232996
APA StyleWalia, I. S., Kumar, D., Sharma, K., Hemanth, J. D., & Popescu, D. E. (2021). An Integrated Approach for Monitoring Social Distancing and Face Mask Detection Using Stacked ResNet-50 and YOLOv5. Electronics, 10(23), 2996. https://doi.org/10.3390/electronics10232996