Method, device, equipment and computer storage medium for controlling the wearing of masks by pedestrians
By receiving pedestrian mask wear detection requests, obtaining pedestrian surveillance video information and performing facial image extraction and mask detection, the problems of high cost, low efficiency and poor operability of pedestrian mask wear control methods in the existing technology are solved, and a fast, economical and efficient control effect is achieved.
Patent Information
- Application Number
- CN202010338364.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-26
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2040-04-26
AI Technical Summary
The existing technology of the Bank of China has high cost, low efficiency and poor operability.
By receiving pedestrian mask wear detection requests, pedestrian surveillance video information is obtained, facial images are extracted, and processing is done through preset mask detection models to determine whether pedestrians wear masks and control them based on identity information.
It has achieved rapid identification of whether pedestrians on the road wearing masks, saving police resources, improving control efficiency and operability, and reducing costs.
Smart Images

Figure CN111539338B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of machine learning, and in particular, to a method, device, equipment and computer storage medium for controlling the wearing of masks by pedestrians. Background Art
[0002] Currently, when it is necessary to control pedestrians not wearing masks on the road, usually traffic police observe on the road and persuade pedestrians not wearing masks. However, this control method requires a large amount of police resources, and the traffic police need to be exposed in crowded places, putting the safety of the traffic police themselves at risk. Thus, it can be seen that the current method for controlling the wearing of masks by pedestrians has high costs, low efficiency, and poor operability. Summary of the Invention
[0003] The main purpose of this application is to provide a method, device, equipment and computer storage medium for controlling the wearing of masks by pedestrians, aiming to solve the technical problems of high costs, low efficiency, and poor operability in the existing method for controlling the wearing of masks by pedestrians.
[0004] To achieve the above purpose, this application provides a method for controlling the wearing of masks by pedestrians, and the steps of the method for controlling the wearing of masks by pedestrians include:
[0005] Receiving a request for detecting the wearing of masks by pedestrians, and obtaining pedestrian monitoring video information corresponding to the request for detecting the wearing of masks by pedestrians;
[0006] Extracting the face image of the pedestrian from the pedestrian monitoring video information;
[0007] Inputting the face image into a target convolutional layer or a target pooling layer through a jump connection layer in a preset mask detection model for processing, to obtain a detection result of whether the pedestrian wears a mask;
[0008] When the detection result of whether the pedestrian wears a mask indicates that the pedestrian does not wear a mask, determining the identity information of the pedestrian according to the face image, and controlling the pedestrian according to the identity information.
[0009] Optionally, the step of receiving a request for detecting the wearing of masks by pedestrians and obtaining pedestrian monitoring video information corresponding to the request for detecting the wearing of masks by pedestrians includes:
[0010] Receiving a request for detecting the wearing of masks by pedestrians, and obtaining first pedestrian monitoring video information collected by a preset monitoring device;
[0011] Analyzing the first pedestrian monitoring video information to obtain the shooting area corresponding to the first pedestrian monitoring video information;
[0012] Judging whether there is a monitoring blind area not covered by the preset monitoring device according to the shooting area;
[0013] If there is a monitoring blind area not covered by the preset monitoring device, call the preset mobile acquisition device to take pictures of the monitoring blind area to obtain the second pedestrian monitoring video information;
[0014] Associate the first pedestrian monitoring video information and the second pedestrian monitoring video information as the pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request.
[0015] Optionally, the step of extracting the face image of the pedestrian in the pedestrian monitoring video information includes:
[0016] Compare each video frame in the pedestrian monitoring video information to determine whether there is a moving object in the pedestrian monitoring video information;
[0017] When there is a moving object in the pedestrian monitoring video information, determine whether the contour of the moving object is a human contour;
[0018] When the contour of the moving object is a human contour, obtain the target video frame containing the moving object, and extract the face image of the pedestrian in the target video frame.
[0019] Optionally, the step of inputting the face image into the target convolutional layer or the target pooling layer through the jump connection layer in the preset mask detection model to obtain the mask wearing detection result of the pedestrian includes:
[0020] Input the face image into the preset mask detection model, and process the face image through the convolutional layer in the preset mask detection model to obtain a convolutional image;
[0021] Input the convolutional image into the jump connection layer of the preset mask detection model, and input the convolutional image into the target convolutional layer or the target pooling layer through the jump connection layer;
[0022] Process the convolutional image through the target convolutional layer to obtain a new convolutional image, or process the convolutional image through the target pooling layer to obtain a pooled image;
[0023] Input the new convolutional image or the pooled image into the jump connection layer until the new convolutional image or the pooled image is input into the last pooling layer through the jump connection layer, and use the pooled image output by the last pooling layer as the target feature map;
[0024] Input the target feature map into the fully connected layer of the preset mask detection model, obtain the matrix-vector product of the matrix vector corresponding to the target feature map through the fully connected layer, and perform classification according to the matrix-vector product;
[0025] When the matrix-vector product is of the first type, output the mask wearing detection result that the pedestrian wears a mask;
[0026] When the matrix-vector product is of the second type, output the mask wearing detection result that the pedestrian does not wear a mask.
[0027] Optionally, the step of determining the identity information of the pedestrian according to the face image and controlling the pedestrian according to the identity information when the mask wearing detection result is that the pedestrian does not wear a mask includes:
[0028] When the mask wearing detection result is that the pedestrian does not wear a mask, compare the face image with a preset image in a preset database to obtain a target image that matches the face image;
[0029] Obtain the identity information associated with the target image and generate a prompt message including the identity information;
[0030] Send the prompt message to a target terminal so that the target terminal performs the mask wearing monitoring duty or the mask wearing duty for the corresponding user, where the target terminal includes: the monitoring terminal associated with the pedestrian monitoring video information, and / or the user terminal corresponding to the identity information.
[0031] Optionally, after the step of obtaining the mask wearing detection result of the pedestrian by jumping the face image to a target convolutional layer or a target pooling layer through a jump connection layer in a preset mask detection model, the method includes:
[0032] When the mask wearing detection result is that the pedestrian wears a mask, input the face image into a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian;
[0033] If the identity information is that of a criminal suspect, generate a warning message and send the warning message to the monitoring terminal associated with the pedestrian monitoring video information.
[0034] Optionally, before the step of inputting the face image into a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian when the mask wearing detection result is that the pedestrian wears a mask, the method further includes:
[0035] Obtain a target face image wearing a mask as a training sample;
[0036] Input the training sample into an initial recognition model, increase the weights of the face shape features, the eye pupil distance features, and / or the iris features in the training sample according to a preset attention mechanism, train the initial recognition model, and obtain a recognition training model;
[0037] When the recognition accuracy rate of the recognition training model is higher than the preset accuracy rate, the recognition training model is used as the preset face recognition model and / or the preset iris recognition model.
[0038] In addition, to achieve the above object, the present application further provides a pedestrian mask wearing control device, and the pedestrian mask wearing control device includes:
[0039] A request receiving module, configured to receive a pedestrian mask wearing detection request and obtain pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request;
[0040] An image extraction module, configured to extract a face image of a pedestrian from the pedestrian monitoring video information;
[0041] A mask detection module, configured to input the face image into a target convolutional layer or a target pooling layer through a jump connection layer in a preset mask detection model for processing, and obtain a mask wearing detection result of the pedestrian;
[0042] A wearing prompt module, configured to determine identity information of the pedestrian according to the face image and control the pedestrian according to the identity information when the mask wearing detection result is that the pedestrian is not wearing a mask.
[0043] In addition, to achieve the above object, the present application further provides a pedestrian mask wearing control device, and the pedestrian mask wearing control device includes: a memory, a processor, and a pedestrian mask wearing control program stored on the memory and executable on the processor. When the pedestrian mask wearing control program is executed by the processor, the steps of the above-mentioned pedestrian mask wearing control method are implemented.
[0044] In addition, to achieve the above object, the present application further provides a computer storage medium, and a pedestrian mask wearing control program is stored on the computer storage medium. When the pedestrian mask wearing control program is executed by a processor, the steps of the above-mentioned pedestrian mask wearing control method are implemented.
[0045] This application provides a method, device, equipment and computer storage medium for controlling the wearing of masks by pedestrians. The method for controlling the wearing of masks by pedestrians receives the collected pedestrian monitoring video information sent by a preset collection device; sends the pedestrian monitoring video information including the collected pedestrian monitoring video information to a preset face detection model for detection to obtain a face image in the pedestrian monitoring video information; calls a preset mask detection model to detect the face image to determine whether the person in the face image wears a mask; when the person in the face image does not wear a mask, determines the identity information of the person in the face image according to the face image, and outputs a wearing prompt including the identity information. Through the above method, it can quickly identify whether pedestrians on the road wear masks. And when it is identified that a pedestrian on the road does not wear a mask, a preset mobile collection device is used for on-site shouting and persuasion, or the traffic police go to the scene for persuasion. Therefore, it is not necessary for traffic police to observe on the road and persuade pedestrians who do not wear masks, and at the same time, it avoids traffic police being exposed in crowded places, putting the safety of traffic police themselves at risk, thus saving the cost of controlling the wearing of masks by pedestrians, improving the efficiency and operability of controlling the wearing of masks by pedestrians. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic diagram of the hardware structure of an optional device in an embodiment of this application;
[0047] Figure 2 It is a schematic flowchart of the first embodiment of the method for controlling the wearing of masks by pedestrians in this application;
[0048] Figure 3 It is a schematic diagram of the structure of a preset mask detection model in the first embodiment of the method for controlling the wearing of masks by pedestrians in this application;
[0049] Figure 4 This application Figure 3 is a preferred schematic diagram of the structure of a preset mask detection model therein;
[0050] Figure 5 It is a schematic diagram of the functional modules of an embodiment of the device for controlling the wearing of masks by pedestrians in this application.
[0051] The realization, functional features and advantages of the purpose of this application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.
[0053] As Figure 1 shown, Figure 1 is a schematic diagram of the structure of the equipment (equipment for controlling the wearing of masks by pedestrians) of the hardware operating environment involved in the solution of the embodiment of this application. As Figure 1As shown in the figure, the device for controlling the wearing of masks by pedestrians in this row may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0054] Those skilled in the art can understand that Figure 1 the device structure shown in the figure does not constitute a limitation on the device, and it may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.
[0055] As Figure 1 shown, the memory 1005, as a computer storage medium, may include an operation network communication module, a user interface module, and a program for controlling the wearing of masks by pedestrians in this row.
[0056] In Figure 1 the device shown, the network interface 1004 is mainly used to connect to the background server and communicate with the background server for data; the user interface 1003 is mainly used to connect to the client (user side) and communicate with the client for data; and the processor 1001 may be used to call the program for controlling the wearing of masks by pedestrians in this row stored in the memory 1005 and execute the operations in the following method for controlling the wearing of masks by pedestrians in this row.
[0057] In Figure 1 the device for controlling the wearing of masks by pedestrians in this row shown, the processor 1001 is used to execute the program for controlling the wearing of masks by pedestrians in this row stored in the memory 1005 to implement the following steps:
[0058] Receive a request for detecting the wearing of masks by pedestrians, and obtain the pedestrian monitoring video information corresponding to the request for detecting the wearing of masks by pedestrians;
[0059] Extract the face images of pedestrians in the pedestrian monitoring video information;
[0060] Jump and input the face image into the target convolutional layer or the target pooling layer through the jump connection layer in the preset mask detection model for processing, and obtain the detection result of whether the pedestrian wears a mask;
[0061] When the mask wearing detection result indicates that the pedestrian is not wearing a mask, determine the identity information of the pedestrian based on the face image, and conduct control over the pedestrian according to the identity information.
[0062] Further, the processor 1001 may call the pedestrian mask wearing control program stored in the memory 1005. The step of receiving the pedestrian mask wearing detection request and obtaining the pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request further performs the following operations:
[0063] Receive the pedestrian mask wearing detection request, and obtain the first pedestrian monitoring video information collected by a preset monitoring device;
[0064] Analyze the first pedestrian monitoring video information to obtain the shooting area corresponding to the first pedestrian monitoring video information;
[0065] Judge whether there is a monitoring blind area not covered by the preset monitoring device according to the shooting area;
[0066] If there is a monitoring blind area not covered by the preset monitoring device, call a preset mobile acquisition device to shoot the monitoring blind area to obtain the second pedestrian monitoring video information;
[0067] Associate the first pedestrian monitoring video information and the second pedestrian monitoring video information as the pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request.
[0068] Further, the processor 1001 may call the pedestrian mask wearing control program stored in the memory 1005. The step of extracting the face image of the pedestrian in the pedestrian monitoring video information further performs the following operations:
[0069] Compare each video frame in the pedestrian monitoring video information to judge whether there is a moving object in the pedestrian monitoring video information;
[0070] When there is a moving object in the pedestrian monitoring video information, judge whether the contour of the moving object is a human contour;
[0071] When the contour of the moving object is a human contour, obtain the target video frame containing the moving object, and extract the face image of the pedestrian in the target video frame.
[0072] Further, the processor 1001 may call the pedestrian mask wearing control program stored in the memory 1005. The step of inputting the face image into the target convolutional layer or the target pooling layer through the jump connection layer in the preset mask detection model for processing to obtain the mask wearing detection result of the pedestrian further performs the following operations:
[0073] Input the face image into a preset mask detection model, and process the face image through the convolutional layer in the preset mask detection model to obtain a convolutional image;
[0074] Input the convolutional image into the skip connection layer of the preset mask detection model, and input the convolutional image into the target convolutional layer or the target pooling layer through the skip connection layer;
[0075] Process the convolutional image through the target convolutional layer to obtain a new convolutional image, or process the convolutional image through the target pooling layer to obtain a pooled image;
[0076] Input the new convolutional image or the pooled image into the skip connection layer until the new convolutional image or the pooled image is input into the last pooling layer through the skip connection layer, and use the pooled image output by the last pooling layer as the target feature map;
[0077] Input the target feature map into the fully connected layer of the preset mask detection model, obtain the matrix-vector product of the matrix vector corresponding to the target feature map through the fully connected layer, and perform classification according to the matrix-vector product;
[0078] When the matrix-vector product is of the first type, output the mask wearing detection result that the pedestrian wears a mask;
[0079] When the matrix-vector product is of the second type, output the mask wearing detection result that the pedestrian does not wear a mask.
[0080] Further, the processor 1001 may call the pedestrian mask wearing control program stored in the memory 1005. When the mask wearing detection result is that the pedestrian does not wear a mask, the step of determining the identity information of the pedestrian according to the face image and controlling the pedestrian according to the identity information further performs the following operations:
[0081] When the mask wearing detection result is that the pedestrian does not wear a mask, compare the face image with a preset image in a preset database to obtain a target image matching the face image;
[0082] Obtain the identity information associated with the target image and generate a prompt message including the identity information;
[0083] Send the prompt message to a target terminal so that the target terminal performs mask wearing monitoring duties or mask wearing duties for the corresponding user, where the target terminal includes: the monitoring terminal associated with the pedestrian monitoring video information, and / or the user terminal corresponding to the identity information.
[0084] Further, the processor 1001 may call the pedestrian mask wearing control program stored in the memory 1005. After the step of inputting the face image to the target convolutional layer or the target pooling layer through the jump connection layer in the preset mask detection model for processing to obtain the mask wearing detection result of the pedestrian, the following operations are further performed:
[0085] When the mask wearing detection result is that the pedestrian wears a mask, input the face image to a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian;
[0086] If the identity information is that of a criminal suspect, generate a warning message and send the warning message to the monitoring terminal associated with the pedestrian monitoring video information.
[0087] Further, the processor 1001 may call the pedestrian mask wearing control program stored in the memory 1005. Before the step of inputting the face image to a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian when the mask wearing detection result is that the pedestrian wears a mask, the following operations are further performed:
[0088] Obtain a target face image wearing a mask as a training sample;
[0089] Input the training sample into an initial recognition model, increase the weights of the face shape features, eye pupil distance features, and / or iris features in the training sample according to a preset attention mechanism, train the initial recognition model, and obtain a recognition training model;
[0090] When the recognition accuracy of the recognition training model is higher than a preset accuracy, use the recognition training model as the preset face recognition model and / or the preset iris recognition model.
[0091] Based on the above hardware structure, various embodiments of the pedestrian mask wearing control method of the present application are proposed.
[0092] Refer to Figure 2 , the first embodiment of the pedestrian mask wearing control method of the present application includes:
[0093] Step S10, receive a pedestrian mask wearing detection request, and obtain the pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request;
[0094] In this embodiment, the pedestrian mask wearing control method is applied to a pedestrian mask wearing control device, and the pedestrian mask wearing control device is communicatively connected to a preset monitoring device (the preset acquisition device refers to a preset monitoring video acquisition device) in public areas such as roads, subways, hospitals, high-speed railway stations, and libraries.
[0095] The pedestrian mask wearing control device receives a pedestrian mask wearing detection request. The triggering method of the pedestrian mask wearing detection request is not specifically limited. That is, the pedestrian mask wearing detection request can be triggered actively by the user. For example, the management user clicks the "Pedestrian Mask Wearing Control" button on the display page of the pedestrian mask wearing control device to actively trigger the pedestrian mask wearing detection request. In addition, the pedestrian mask wearing detection request can also be triggered automatically. For example, when the pedestrian mask wearing control device recognizes the face information, it automatically triggers the pedestrian mask wearing detection request.
[0096] When the pedestrian mask wearing control device receives the pedestrian mask wearing detection request, it obtains the collected pedestrian monitoring video information sent by the preset collection device.
[0097] Step S20: Extract the face images of pedestrians in the pedestrian monitoring video information.
[0098] When the pedestrian mask wearing control device receives the pedestrian monitoring video information sent by the preset collection device, the pedestrian mask wearing control device analyzes the pedestrian monitoring video information to obtain the face images in the pedestrian monitoring video information. The number of faces in the face images is not specifically limited, and the number of faces is at least one. The face images in the pedestrian monitoring video information are photos containing people, and the states of the people in the face images are not specifically limited. That is, the face images can be frontal photos of people, profile photos of people, close-up photos of people, full-body photos of people, etc.
[0099] Step S30: Input the face images into the target convolutional layer or target pooling layer through the jump connection layer in the preset mask detection model for processing to obtain the mask wearing detection result of the pedestrian.
[0100] Specifically, it includes:
[0101] Input the face images into the preset mask detection model, and process the face images through the convolutional layer in the preset mask detection model to obtain convolutional images.
[0102] Input the convolutional images into the jump connection layer of the preset mask detection model, and input the convolutional images into the target convolutional layer or target pooling layer through the jump connection layer.
[0103] Process the convolutional images through the target convolutional layer to obtain new convolutional images, or process the convolutional images through the target pooling layer to obtain pooling images.
[0104] Input the new convolutional images or the pooling images into the jump connection layer until the new convolutional images or the pooling images are input into the last pooling layer through the jump connection layer, and use the pooling images output by the last pooling layer as the target feature maps.
[0105] Input the target feature map into the fully connected layer of a preset mask detection model, obtain the matrix-vector product of the matrix vector corresponding to the target feature map through the fully connected layer, and perform classification based on the matrix-vector product;
[0106] When the matrix-vector product is of the first type, output the mask wearing detection result as the pedestrian wearing a mask; when the matrix-vector product is of the second type, output the mask wearing detection result as the pedestrian not wearing a mask.
[0107] That is, the pedestrian mask wearing control device preprocesses the obtained face image, grayscales the face color image. The pedestrian mask wearing control device calls the convolutional layer in the preset mask detection model to process the preprocessed face image to obtain a convolutional image. A convolutional image refers to an image obtained by performing a convolution operation on a face image using the convolutional layer in the preset mask detection model. The pedestrian mask wearing control device inputs the convolutional image into the skip connection layer in the preset mask detection model to obtain feature information; inputs the convolutional image into the jump connection layer in the preset mask detection model to obtain feature information; selects the convolutional layer and / or pooling layer in the preset mask detection model according to the feature information, and performs a convolution operation and / or pooling operation on the convolutional image through the convolutional layer and / or pooling layer to obtain a target feature map, and determines whether the pedestrian wears a mask according to the target feature map.
[0108] Among them, the specific steps for obtaining the target feature map include: the pedestrian mask wearing control device inputs the convolutional image into the skip connection layer in the preset mask detection model to obtain feature information; the feature information is a gradient value; when the gradient value is greater than a preset gradient threshold, select a target pooling layer according to the magnitude of the gradient value, input the convolutional image into the target pooling layer for a pooling operation to obtain a pooled image, use the pooled image as a new convolutional image, and input it into the jump connection until the target feature map is obtained; when the gradient value is less than or equal to the preset gradient threshold, select a target convolutional layer according to the magnitude of the gradient value, input the convolutional image into the target convolutional layer for a second convolution operation to obtain a new convolutional image, and input the new convolutional image into the jump connection until the target feature map is obtained.
[0109] As Figure 4 shown, the preset mask detection model is a model that can detect and determine whether a person in a face image wears a mask. The preset mask detection model includes a total of 9 processing steps, namely stage1 to stage9. Input the face image starting from stage1, and perform recognition on the input face image in stage2 to stage8 until the face image recognition result is output at the end of stage9; as Figure 3As shown in the figure, the preset mask detection model includes a convolutional layer SConv of the skip connection layer. The convolutional layer SConv is composed of a normal convolutional layer NConv. The first two-dimensional convolutional layer module and the fourth two-dimensional convolutional layer module on the left branch are both NConv, 1×1; the second two-dimensional convolutional layer module and the third two-dimensional convolutional layer module are both NConv, k×k, where each NConv is a normal convolutional layer, and k can be selected as 3 or 5 or other numbers. The first two-dimensional convolutional layer module and the fourth two-dimensional convolutional layer module in the middle branch are both NConv, k×k; the second two-dimensional convolutional layer module and the third two-dimensional convolutional layer module are both NConv, 1×1. Similarly, each NConv is a normal convolutional layer, and k can be selected as 3 or 5 or other numbers. The right branch is a skip connection module. The left branch, the middle branch, and the right branch simultaneously process the input face image to obtain the target feature map of the face image, and classify according to the target feature map to determine whether the pedestrian wears a mask.
[0110] Step S40, when the mask wearing detection result is that the pedestrian does not wear a mask, determine the identity information of the pedestrian according to the face image, and control the pedestrian according to the identity information.
[0111] Specifically, it includes:
[0112] When the mask wearing detection result is that the pedestrian does not wear a mask, compare the face image with the preset images in the preset database to obtain the target image matching the face image;
[0113] Obtain the identity information associated with the target image and generate a prompt message including the identity information;
[0114] Send the prompt message to the target terminal so that the target terminal performs the mask wearing monitoring duty or the mask wearing duty for the corresponding user. Among them, the target terminal includes: the monitoring terminal associated with the pedestrian monitoring video information, and / or the user terminal corresponding to the identity information.
[0115] That is, when the mask wearing detection result is that the pedestrian does not wear a mask, the pedestrian mask wearing control device determines the identity information of the pedestrian according to the face image. The identity information includes information such as name and age; that is, the pedestrian mask wearing control device compares the face image with the preset identity database, such as the ID card data of the Ministry of Public Security, so as to determine the identity information of the person in the face image.
[0116] The pedestrian mask wearing control device obtains a preset wearing prompt sample; the preset wearing prompt sample refers to the persuasion that is pre-set to prompt people without masks to wear masks. The pedestrian mask wearing control device replaces the personnel information in the wearing prompt sample with the identity information to generate a target prompt sample; according to the preset wearing prompt sample, the personnel information in the preset wearing prompt sample is replaced with the identity information of the person not wearing a mask to generate a target prompt sample, and then the mask wearing control is carried out through the target prompt sample. Output the target prompt sample according to the preset prompt method. The preset prompt method refers to presetting the mobile acquisition device to shout and persuade or relevant management personnel to go to the scene to persuade people not wearing masks to wear masks.
[0117] In this embodiment, the pedestrian mask wearing control device quickly identifies whether pedestrians on the road are wearing masks. And when it is identified that pedestrians on the road are not wearing masks, a preset mobile acquisition device is used to conduct on-site shouting and persuasion or the traffic police go to the scene to persuade. Therefore, there is no need for the traffic police to observe on the road and persuade pedestrians not wearing masks, and at the same time, it avoids the traffic police being exposed in crowded places, putting the safety of the traffic police themselves at risk, thus saving the cost of pedestrian mask wearing control, improving the efficiency and operability of pedestrian mask wearing control.
[0118] Further, based on the first embodiment of the pedestrian mask wearing control method of the present application, a second embodiment of the pedestrian mask wearing control method of the present application is proposed.
[0119] This embodiment is after step S10 in the first embodiment. In the second embodiment of the pedestrian mask wearing control method of the present application, it includes:
[0120] Receive a pedestrian mask wearing detection request, and obtain the first pedestrian monitoring video information collected by a preset monitoring device;
[0121] Analyze the first pedestrian monitoring video information to obtain the shooting area corresponding to the first pedestrian monitoring video information;
[0122] Judge whether there is a monitoring blind area not covered by the preset monitoring device according to the shooting area;
[0123] If there is a monitoring blind area not covered by the preset monitoring device, call a preset mobile acquisition device to shoot the monitoring blind area to obtain the second pedestrian monitoring video information;
[0124] Associate the first pedestrian monitoring video information and the second pedestrian monitoring video information as the pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request.
[0125] Specifically, in this embodiment, the pedestrian mask wearing control device acquires the first pedestrian monitoring video information collected by a preset monitoring device; analyzes the first pedestrian monitoring video information to obtain the shooting area corresponding to the first pedestrian monitoring video information, and determines the monitoring blind area of the preset acquisition device by comparing the shooting area corresponding to the first pedestrian monitoring video information with the preset monitoring area.
[0126] For the monitoring blind area that is not covered, at this time, a preset mobile acquisition device equipped with a camera (the preset mobile acquisition device is used as a device for acquiring video images, and the preset mobile acquisition device can be a drone or other devices) is called to conduct regular patrols and capture videos or pictures in real time to obtain supplementary second pedestrian monitoring video information. The pedestrian mask wearing control device associates the first pedestrian monitoring video information and the second pedestrian monitoring video information as the pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request.
[0127] In this embodiment, the preset acquisition devices are distributed in public areas such as some traffic light intersections, community entrances, gardens, etc. For areas such as traffic light intersections, community entrances, and gardens, the positions of the preset acquisition devices for video images can be reasonably arranged according to the shooting effect; another situation is places where the monitoring is not covered, such as many places on the road that cannot be fully covered by the monitoring, or some places are blind spots for monitoring. Since there will be shooting monitoring blind areas that are not covered by all the preset acquisition devices after the preset acquisition devices are installed, by calling the preset mobile acquisition device for supplementary shooting, the shooting blind areas are reduced, making the monitoring area more comprehensive and further reducing the waste of human resources.
[0128] Furthermore, based on the above embodiments of the pedestrian mask wearing control method of the present application, a third embodiment of the pedestrian mask wearing control method of the present application is proposed.
[0129] This embodiment is a refinement step of step S20 in the first embodiment. The difference between this embodiment and the above embodiments is as follows:
[0130] Compare each video frame in the pedestrian monitoring video information to determine whether there are moving objects in the pedestrian monitoring video information;
[0131] When there are moving objects in the pedestrian monitoring video information, determine whether the contour of the moving object is a human contour;
[0132] When the contour of the moving object is a human contour, obtain the target video frame containing the moving object, and extract the face image of the pedestrian in the target video frame.
[0133] That is, the pedestrian mask wearing control device compares each frame of the pedestrian monitoring video information to determine moving objects. For example, if there is an additional object in the third frame compared to the second frame, it can be determined that this object belongs to a moving object. Then, the contour of the moving object is identified through image recognition technology. Since the contours of running animals or moving vehicles are different from those of pedestrians, it is possible to determine whether the frames of the pedestrian monitoring video information contain human contours based on the recognition result of the contour. When the contour of the moving object is a human contour, the target video frame containing the moving object is obtained, and the face image of the pedestrian in the target video frame is extracted. In this embodiment, the specific steps for obtaining the face image are described, improving the accuracy of the analysis of the monitoring video information.
[0134] Further, based on the above embodiments of the pedestrian mask wearing control method of the present application, a fourth embodiment of the pedestrian mask wearing control method of the present application is proposed.
[0135] This embodiment is the step after step S30 in the first embodiment. The difference between this embodiment and the above embodiments is as follows:
[0136] When the mask wearing detection result is that the pedestrian is wearing a mask, the face image is input into a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian;
[0137] If the identity information is that of a criminal suspect, a warning message is generated and the warning message is sent to the monitoring terminal associated with the pedestrian monitoring video information.
[0138] That is, when the mask wearing detection result is that the pedestrian is wearing a mask, the pedestrian mask wearing control device inputs the face image into a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian; if the identity information is that of a criminal suspect, the pedestrian mask wearing control device generates a warning message, and the pedestrian mask wearing control device sends the warning message to the monitoring terminal associated with the pedestrian monitoring video information so that the monitoring terminal can pay attention.
[0139] Before the steps of this embodiment are executed, the pedestrian mask wearing control device trains a preset face recognition model and / or a preset iris recognition model. Specifically, it includes:
[0140] Obtain the target face image wearing a mask as a training sample;
[0141] Input the training sample into the initial recognition model, and train the initial recognition model by increasing the weights of the face shape features, interpupillary distance features, and / or iris features in the training sample according to a preset attention mechanism to obtain a recognition training model;
[0142] When the recognition accuracy rate of the recognition training model is higher than the preset accuracy rate, the recognition training model is used as the preset face recognition model and / or the preset iris recognition model.
[0143] That is, the pedestrian mask wearing control device obtains the target face image of the person wearing a mask as a training sample; the pedestrian mask wearing control device inputs the training sample into the initial recognition model, and the initial recognition model increases the training weights of the face shape features, the interpupillary distance features and / or the iris features in the training sample according to the preset attention mechanism to perform recognition model training; when the recognition accuracy rate in the recognition model training is higher than the preset accuracy rate, the trained recognition model is used as the preset face recognition model and / or the preset iris recognition model.
[0144] In this embodiment, the pedestrian mask wearing control device can detect and recognize the face image of the person wearing a mask, avoid illegal activities by criminals wearing masks, and improve the safety of operations.
[0145] In addition, referring to Figure 5 , an embodiment of the present application further provides a pedestrian mask wearing control device, which includes:
[0146] A request receiving module 10, configured to receive a pedestrian mask wearing detection request and obtain pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request;
[0147] An image extraction module 20, configured to extract the face image of the pedestrian from the pedestrian monitoring video information;
[0148] A mask detection module 30, configured to jump and input the face image into a target convolutional layer or a target pooling layer through a jump connection layer in a preset mask detection model for processing, and obtain the mask wearing detection result of the pedestrian;
[0149] A wearing prompt module 40, configured to, when the mask wearing detection result is that the pedestrian is not wearing a mask, determine the identity information of the pedestrian according to the face image, and perform control on the pedestrian according to the identity information.
[0150] The present application further provides a pedestrian mask wearing control device, which includes: a memory, a processor, and a pedestrian mask wearing control program stored on the memory and executable on the processor. When the pedestrian mask wearing control program is executed by the processor, the steps of the above-mentioned pedestrian mask wearing control method are implemented.
[0151] The present application further provides a computer storage medium, on which a pedestrian mask wearing control program is stored. When the pedestrian mask wearing control program is executed by a processor, the steps of the above-mentioned pedestrian mask wearing control method are implemented.
[0152] In the embodiments of the method, apparatus, device, and readable storage medium for controlling the wearing of masks by pedestrians in this application, all the technical features of each embodiment of the above-mentioned method for controlling the wearing of masks by pedestrians are included. The content of the expansion and explanation in the specification is basically the same as that of each embodiment of the above-mentioned method for controlling the wearing of masks by pedestrians, and will not be elaborated here.
[0153] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "including one..." does not exclude the existence of additional identical elements in the process, method, article, or system including that element.
[0154] The serial numbers of the above-mentioned embodiments of this application are only for description and do not represent the superiority or inferiority of the embodiments.
[0155] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of this application.
[0156] The above are only the preferred embodiments of this application, and do not limit the patent scope of this application accordingly. Any equivalent structural or equivalent process transformation made by using the content of the specification and drawings of this application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of this application.
Claims
1. A method for controlling the wearing of masks by pedestrians, characterized in that, the method for controlling the wearing of masks by pedestrians includes the following steps: Receiving a mask wearing detection request for a pedestrian, and obtaining pedestrian monitoring video information corresponding to the mask wearing detection request for the pedestrian; Extracting the face image of the pedestrian from the pedestrian monitoring video information; Jumping and inputting the face image into a target convolutional layer or a target pooling layer through a jump connection layer in a preset mask detection model for processing, to obtain a mask wearing detection result for the pedestrian; When the mask wearing detection result is that the pedestrian is not wearing a mask, determining the identity information of the pedestrian according to the face image, and controlling the pedestrian according to the identity information; The step of jumping and inputting the face image into a target convolutional layer or a target pooling layer through a jump connection layer in a preset mask detection model for processing, to obtain a mask wearing detection result for the pedestrian, includes: Inputting the face image into a preset mask detection model, and processing the face image through a convolutional layer in the preset mask detection model to obtain a convolutional image; Inputting the convolutional image into a jump connection layer of the preset mask detection model, and inputting the convolutional image into a target convolutional layer or a target pooling layer through the jump connection layer; Processing the convolutional image through the target convolutional layer to obtain a new convolutional image, or processing the convolutional image through the target pooling layer to obtain a pooled image; Inputting the new convolutional image or the pooled image into the jump connection layer until the new convolutional image or the pooled image is input into the last pooling layer through the jump connection layer, and using the pooled image output by the last pooling layer as a target feature map; Inputting the target feature map into a fully connected layer of the preset mask detection model, obtaining a matrix-vector product of the matrix vector corresponding to the target feature map through the fully connected layer, and performing classification according to the matrix-vector product; When the matrix-vector product is of the first type, outputting a mask wearing detection result that the pedestrian is wearing a mask; When the matrix-vector product is of the second type, outputting a mask wearing detection result that the pedestrian is not wearing a mask.
2. The method for controlling the wearing of masks by pedestrians according to claim 1, characterized in that, the step of receiving a mask wearing detection request for a pedestrian and obtaining pedestrian monitoring video information corresponding to the mask wearing detection request for the pedestrian includes: Receiving a mask wearing detection request for a pedestrian, and obtaining first pedestrian monitoring video information collected by a preset monitoring device; Analyzing the first pedestrian monitoring video information to obtain a shooting area corresponding to the first pedestrian monitoring video information; Judging whether there is a monitoring blind area not covered by the preset monitoring device according to the shooting area; If there is a monitoring blind area not covered by the preset monitoring device, then calling a preset mobile acquisition device to shoot the monitoring blind area to obtain second pedestrian monitoring video information; Associating the first pedestrian monitoring video information and the second pedestrian monitoring video information as the pedestrian monitoring video information corresponding to the mask wearing detection request for the pedestrian.
3. The method for controlling the wearing of masks by pedestrians according to claim 1, characterized in that, The steps of extracting the face image of a pedestrian from the pedestrian monitoring video information include: Comparing each video frame in the pedestrian monitoring video information to determine whether there is a moving object in the pedestrian monitoring video information; When there is a moving object in the pedestrian monitoring video information, determining whether the contour of the moving object is a human contour; When the contour of the moving object is a human contour, obtaining a target video frame containing the moving object and extracting the face image of the pedestrian in the target video frame.
4. The method for controlling the wearing of a mask by a pedestrian according to claim 1, wherein, the steps of determining the identity information of the pedestrian according to the face image and controlling the pedestrian according to the identity information when the mask wearing detection result is that the pedestrian is not wearing a mask include: When the mask wearing detection result is that the pedestrian is not wearing a mask, comparing the face image with a preset image in a preset database to obtain a target image matching the face image; Obtaining the identity information associated with the target image and generating a prompt message containing the identity information; Sending the prompt message to a target terminal so that the target terminal performs the mask wearing monitoring duty or the mask wearing duty for the corresponding user, wherein the target terminal includes: a monitoring terminal associated with the pedestrian monitoring video information, and / or a user terminal corresponding to the identity information.
5. The method for controlling the wearing of a mask by a pedestrian according to any one of claims 1 to 4, wherein, after the step of obtaining the mask wearing detection result of the pedestrian by jumping and inputting the face image to a target convolutional layer or a target pooling layer through a jump connection layer in a preset mask detection model, the method includes: When the mask wearing detection result is that the pedestrian is wearing a mask, inputting the face image into a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian; If the identity information is that of a criminal suspect, generating a warning message and sending the warning message to the monitoring terminal associated with the pedestrian monitoring video information.
6. The method for controlling the wearing of a mask by a pedestrian according to claim 5, wherein, before the step of inputting the face image into a preset face recognition model and / or a preset iris recognition model to obtain the identity information of the pedestrian when the mask wearing detection result is that the pedestrian is wearing a mask, the method further includes: Obtaining a target face image wearing a mask as a training sample; Inputting the training sample into an initial recognition model, training the initial recognition model by increasing the weights of the face shape features, the interpupillary distance features and / or the iris features in the training sample according to a preset attention mechanism, and obtaining a recognition training model; When the recognition accuracy of the recognition training model is higher than a preset accuracy, using the recognition training model as the preset face recognition model and / or the preset iris recognition model.
7. A device for controlling the wearing of a mask by a pedestrian, wherein, the device for controlling the wearing of a mask by a pedestrian includes: A request receiving module, configured to receive a pedestrian mask wearing detection request and obtain pedestrian monitoring video information corresponding to the pedestrian mask wearing detection request; An image extraction module, configured to extract a face image of a pedestrian from the pedestrian monitoring video information; A mask detection module, configured to input the face image into a target convolutional layer or a target pooling layer for processing through a jump connection layer in a preset mask detection model to obtain a mask wearing detection result of the pedestrian; the mask detection module is further configured to input the face image into the preset mask detection model, process the face image through a convolutional layer in the preset mask detection model to obtain a convolutional image; input the convolutional image into a jump connection layer of the preset mask detection model, and input the convolutional image into the target convolutional layer or the target pooling layer through the jump connection layer; process the convolutional image through the target convolutional layer to obtain a new convolutional image, or process the convolutional image through the target pooling layer to obtain a pooled image; input the new convolutional image or the pooled image into the jump connection layer until the new convolutional image or the pooled image is input into the last pooling layer through the jump connection layer, and use the pooled image output by the last pooling layer as a target feature map; input the target feature map into a fully connected layer of the preset mask detection model, obtain a matrix-vector product of the matrix vector corresponding to the target feature map through the fully connected layer, and perform classification according to the matrix-vector product; when the matrix-vector product is of a first type, output a mask wearing detection result that the pedestrian wears a mask; when the matrix-vector product is of a second type, output a mask wearing detection result that the pedestrian does not wear a mask; A wearing prompt module, configured to determine identity information of the pedestrian according to the face image and control the pedestrian according to the identity information when the mask wearing detection result is that the pedestrian does not wear a mask.
8. A pedestrian mask wearing control device, characterized in that, the pedestrian mask wearing control device includes: a memory, a processor, and a pedestrian mask wearing control program stored on the memory and executable on the processor, and when the pedestrian mask wearing control program is executed by the processor, the steps of the pedestrian mask wearing control method according to any one of claims 1 to 6 are implemented.
9. A computer storage medium, characterized in that, a pedestrian mask wearing control program is stored on the storage medium, and when the pedestrian mask wearing control program is executed by a processor, the steps of the pedestrian mask wearing control method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Chef cap and mask wearing detection method based on deep learning
CN111062429A