Intelligent masked-person detection system for epidemic prevention and control

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.


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. 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

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

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.

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'.

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.  The system can be applied to public places with certain flow of people, such as the entrance and exit of schools, companies, convenience stores, restaurants, hotels, airports, stations and other places. In these scenes, the flow of people will be limited, only a few people can pass at a time, and the face information can be completely collected by the camera, so it can play a good role in the detection and recording function of the system. However, for scenes with high pedestrian density, such as square, which has a wide area and no specific entrance, the acquisition of face information by camera will be limited. In this case, it is difficult to detect pedestrian flow, and other more efficient algorithms are needed.

Conclusions
In order to effectively control the spread of the epidemic in public places and reduce the manpower investment in supervision, this paper introduces a mask recognition system based on PC. This system combines MTCNN with MobileNet algorithm, which achieves high recognition accuracy. It can effectively detect whether pedestrian wears masks and whether they wear them properly, then record the target. However, there are still some aspects to be improved in this system. One is that FPS needs to be improved in real-time detection. In the face of multiple person detection, the effect is not ideal. This performance improvement can be improved from two aspects of hardware and algorithm. In a certain range, improving the camera acquisition performance and computer related configuration can significantly improve the running speed of the system. Secondly, the face recognition accuracy decreases when the mask is occluded, which can be further improved from the perspective of face recognition algorithm.