Intelligent masked-person detection system for epidemic prevention and control
MATEC Web of Conferences 336, 06005 (2021)
CSCNS2020
https://doi.org/10.1051/matecconf/202133606005
Intelligent masked-person detection system for
epidemic prevention and control
Yizhuo Zhou1, Jiming Sa 1,*, Yang Xiang1, Yihao Zhang1, Fenghao Zheng1 and Jin Li2
1
2
Wuhan University of Technology, Wuhan 430070, China
Suzhou Inovance Technology Co.,Ltd. Suzhou 215104, China
Abstract. In order to control the epidemic and complete the supervision of
increasing population, we devised a kind of face detection system. This
system detected face with MTCNN and then it detect whether the person
wears the mask with MobileNet. Also we added non-standardized samples
in the model training so that it can detect pedestrians who are not properly
worn. The experimental results showed that the system can effectively
identify the wearing of masks.
1 Introduction
In the end of 2019, a severe outbreak of novel coronavirus pneumonia broke out around
the world. The new type of coronavirus pneumonia has seriously threatened people's lives
and health. According to relevant data, the number of casualties worldwide has exceeded one
million [1]. As we all know, wearing masks in public can effectively hinder the spread of the
COVID-19, so that the epidemic will be controlled in some tent. Therefore, it’s important to
strengthen the detections for whether the public have wearing masks, especially in the context
of this epidemic. So we designed a mask detection system with some algorithm of detections.
Now there are two mainstream methods to perform the target detection. One is the onestage algorithm, such as a series of YOLO algorithm. Among them, YOLOv3 algorithm [2]
is a new algorithm proposed by CVPR in 2018. Different from the traditional R-CNN
algorithm and Fast R-CNN algorithm [3]. The other one is the two-stage algorithm. The twostage algorithm has better accuracy. This design used the MobileNet algorithm [4] and the
MTCNN algorithm [5] to detect whether someone has worn the mask. After some testing this
system could detect masked person with high accuracy. At last, we designed an interactive
interface for the system to improve system usability. This system can perform high-accuracy
mask wearing recognition on targets, and record the appearance time of targets without masks,
so that users can consult relevant data, so as to promptly investigate suspicious person
without masks.
2 Design of hardware
The system is mainly composed of a camera, USB adapter cable, computer, etc. At first we
*
Corresponding author:
© The Authors, published by EDP Sciences. This is an open access article distributed under the terms of the Creative Commons
Attribution License 4.0 (http://creativecommons.org/licenses/by/4.0/).
MATEC Web of Conferences 336, 06005 (2021)
CSCNS2020
https://doi.org/10.1051/matecconf/202133606005
use a high-definition camera to monitor the picture in real time and feed back to the PC. On
the PC image processing end, we use Qt as the image processing interface. Through the
algorithm, we can identify whether the image data contains a human face and whether a mask
is worn with high frame rate and accuracy. The hardware module diagram is shown in Fig 1.
Fig. 1. Hardware module.
3 Design of software
3.1 Overview of design
First of all, we use Video Capture function in OpenCV to call the camera to get the real time
monitoring picture, and then it will detect the targets in the image. Then the system will
recognize the face using the MTCNN algorithm. After recognizing the face,it will perform
operations such as resize, normalization, and eye alignment on the recognized face, and then
perform the next step to identify whether to wear masks. This was achieved by sending the
processed face part to the MobileNet network. Then it will judge whether the target is wearing
a mask and get the result according to the calculated characteristic value of the image. At last,
we’ll frame the target location and show the detection results. The overall program flow chart
is shown in Fig 2.
Fig. 2. Flow chart.
2
MATEC Web of Conferences 336, 06005 (2021)
CSCNS2020
https://doi.org/10.1051/matecconf/202133606005
3.2 Date set
The data set used in this experiment is the RMFD data set open sourced by Wuhan University
at the beginning of this year [6]. We selected a thousand sample images, of which 371 were
wearing masks and 472 were not. In response to some irregular mask wearing and hand
concealment situations that occurred in actual detection, we selected and added 128 samples
of non-standard mask wearing on the basis of the original data set. An example of nonstandard wearing of a mask is shown in Fig 3.
Fig. 3. Some non-standard images.
3.3 Design of GUI
We mainly use Python's pyqt5 library to design GUI. The interface layout is shown in Fig 4.
On the left are the ‘Start Camera’ button, the ‘Save Data’ button, the ‘View Data’ button and
the ‘Exit’ button, and the blank part on the right is the canvas for displaying the video. Click
the ‘Start Camera’ button to send the corresponding signal to the corresponding slot function,
call the external camera, input the video stream and call the mask detection module for mask
detection. Click the 'Save Data' button to save the current frame to the corresponding folder,
the 'View Data' button can open the above folder, the 'Start Camera' button will turn into a
'Stop Camera' button after clicking it, the camera will be closed after clicking, click the 'Exit'
button can exit the interface. The interface design of GUI adopts Qt interface generator (Qt
Designer) to design, the code is simple and efficient. The slot function of the GUI is mainly
composed of MTCNN and MobileNet algorithms. This GUI has a good detection effect for
special situations such as not wearing a mask, wearing a mask irregularly, not covering the
nose and mouth, and ‘covering with hands’.
Fig. 4. GUI design.
3
MATEC Web of Conferences 336, 06005 (2021)
CSCNS2020
https://doi.org/10.1051/matecconf/202133606005
4 Test results analysis
The 1660Ti computer runs this program, and the real-time frame rate can reach 25 frames
per second, which can basically meet the requirements for real-time detection of human flow,
and it can also have a better recognition effect when detecting multiple targets. The specific
recognition effect is shown in Fig. 4 When the mask is not worn, the face frame is displayed
in red, indicating ‘no mask’; after wearing the mask, the face frame is displayed in green, and
the mark is ‘mask’. The detection of non-standard wearing of masks such as the exposed nose,
the test results are shown in Fig.5. It can be seen that this type of non-standard wearing can
be effectively identified. Detect the situation where multiple people appear in the screen at
the same time, and the result is shown in Fig. 6. The result shows that the situation where
multiple people appear can also be effectively detected.
(a)Wearing mask
(b) Wearing no masks
Fig. 5. Mask wearing detection (...truncated)