A method for processing mask-wearing data based on video analytics
By combining multi-model detection and attention mechanisms with target tracking technology, the problem of insufficient accuracy and false detection in mask wearing detection in existing technologies has been solved, and accurate classification and tracking of mask wearing status in videos has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-09
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies for detecting mask wearing status suffer from problems such as inaccurate classification, insufficient detection precision, and handling of false positives, especially in video analysis where it is difficult to accurately identify wearing status.
A multi-model detection approach combined with an attention mechanism is adopted, including human body, face, face occlusion, and mask detection models. Through target detection and target tracking technology, accurate identification and tracking of video frames are achieved. CBAM and SENet attention modules are used to improve detection accuracy, and the detection results are processed through logical judgment.
It improves the detection accuracy of mask wearing status, can accurately identify wearing, not wearing, and improper wearing, solves the problems of insufficient detection accuracy and false detection in existing technologies, and achieves accurate classification of mask wearing status in videos.
Smart Images

Figure CN114973070B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical data processing, and particularly relates to a mask wearing data processing method based on video analysis. BACKGROUND
[0002] In the past few years, with the application of deep learning in the field of computer vision becoming more and more in-depth, the effect is getting better and better, which has attracted widespread attention in academia and industry. Computer vision is an important artificial intelligence science discipline, and its core is to acquire and process the size, brightness, color, motion and other information of objects in visual data.
[0003] In the field of computer vision, the key point and the target detection field gradually applied to real life can realize the recognition and detection of various categories of objects by applying technology to various media data such as static images and video media data. In image data, the position of the object to be detected is labeled according to the spatial dimension and color channel, and in video media data, the position of the object to be detected is labeled according to the spatial dimension, time dimension and color channel.
[0004] The main task of target detection is to find the target object in the corresponding image, and to determine the class and position of the target object. Therefore, two sub-problems need to be solved. The first sub-problem is the classification problem of judging which class the target object belongs to, and the second sub-problem is the regression problem of finding the exact position of the target object.
[0005] With the development of deep learning, the technology has been widely applied to the task of object detection, which has promoted the rapid development of object detection field. The object detection algorithms based on deep learning can be mainly divided into two-stage algorithms and single-stage algorithms. In the two-stage algorithm, the process of solving the object detection task is as follows: first, the feature of the target image is extracted to generate a suggestion area, that is, a pre-selected frame that may contain the object to be detected, and then the sample is classified and positioned by using the convolutional neural network. The classic two-stage algorithm includes R-CNN (Region-CNN), SPPNet (Spatial Pyramid Pooling in Deep Convolutional Networks), Fast R-CNN (Fast Region-CNN), Faster R-CNN (Faster Region-CNN) and R-FCN (Region-based Fully Convolutional Networks). In the single-stage algorithm, the pre-generation of the detection area is not needed, and the classification and positioning regression of the target object are directly predicted according to the features extracted in the network structure. The classic single-stage algorithm includes SSD (Single shot multibox detector) and YOLO (You Only Look Once) series algorithm. The essential difference between the two kinds of object detection classification is whether a step is needed to generate a pre-selected frame that may contain the object to be detected. Both algorithms have developed greatly in the process of deep learning development.
[0006] The main indicators in the object detection task are the detection accuracy and the detection speed. The two-stage algorithm has an additional stage of generating a pre-detection area, which can improve the detection accuracy to a certain extent, but it also increases the detection time and reduces the detection speed. In the object detection based on video, the image processing is performed according to the FPS of the video. In the static image object detection in the image data, the two-stage algorithm can guarantee the detection accuracy to a certain extent, but the time cost means the sacrifice of the speed requirement in real-time detection. With the development and adjustment of deep learning, especially the YOLO series algorithm, the whole image data is used as the input of the network, and only one CNN operation is needed for fast object detection. The optimization of joint training, solving the number limitation of the predicted object and the size sensitivity problem can also guarantee the precision and speed of the detection at the practical level.
[0007] With the development of target detection field in recent years, some related fields related to target detection task have also developed, for example, target tracking field. Because the target detection based on video analysis is video media data instead of pure static picture data, such object has time dimension more than pure static picture data. Considering the position information of the target before and after a certain time point in the video, or in the adjacent frames, the information contained herein can realize the tracking of the target, instead of performing single target detection on the static image corresponding to the frame in each detection, which will lose the role of time dimension t as a video feature. DeepSort, as a relatively clear target tracking algorithm, is the main tracking idea at present. It adopts target recognition plus trajectory recognition. The SORT algorithm before DeepSort algorithm is relatively rough in solving the identity transformation problem in the target tracking task. It only considers the distance between the detection boxes of the target in the target detection, and simply matches the target between frames by distance to realize tracking, without considering the content in the target detection box, so identity transformation is easy to occur.
[0008] Applying target detection and target tracking technology to video media data can realize the detection of mask wearing situation of people in video data and real-time detection.
[0009] Although there are some mask wearing situation detection systems at present, they all have various limitations. Some systems detect only the mask target and cannot realize the matching situation of face wearing. Some systems detect the face with mask and the face without mask, and are prone to error recognition of various face covering situations. Basically, no system can detect the non-standard mask wearing situation, such as nose covering situation. Some systems detect the non-standard wearing situation as a new type, and the detection precision is poor. SUMMARY
[0010] The purpose of the present application is to provide a mask wearing data processing method based on video analysis to solve the problems of inaccurate classification of mask wearing situation, lack of detection precision and false detection object processing in the prior art.
[0011] The technical solution of the present application to solve the above technical problems is as follows:
[0012] A mask wearing data processing method based on video analysis, the mask wearing data processing method based on video analysis comprises:
[0013] S1: acquiring video data;
[0014] S2: performing recognition processing on a current frame image of the video data by using a target detection system to obtain a recognition processing result;
[0015] S3: performing target tracking on the recognition processing result to obtain a tracking result;
[0016] S4: outputting the recognition processing result or the tracking result as a processing result of mask wearing data in the current frame image.
[0017] Optionally, the step S2 comprises:
[0018] S21: determining whether the current frame image contains human body data, if yes, proceeding to step S22, otherwise, proceeding to step S27;
[0019] S22: determining whether the human body data contains a face, if yes, proceeding to step S23; otherwise, proceeding to step S3;
[0020] S23: identifying a face key point on the face and determining whether the face key point contains an occlusion, if yes, proceeding to step S24; otherwise, proceeding to step S26;
[0021] S24: determining whether the occlusion is a mask, if yes, proceeding to step S25; otherwise, proceeding to step S26;
[0022] S25: outputting the recognition processing result of the current frame image as correct mask wearing, and proceeding to step S3;
[0023] S26: outputting the recognition processing result of the current frame image as incorrect mask wearing, and proceeding to step S3;
[0024] S27: discarding the recognition processing result of the current frame, proceeding to the next frame, taking the next frame as the current frame and returning to step S21.
[0025] Optionally, in the step S2, the target detection system comprises a human body detection model, a face detection model, a face occlusion detection model and a mask detection model, the human body detection model is used to determine whether the current frame image contains human body data; the face detection model is used to determine whether the human body data contains a face; the face occlusion detection model is used to identify a key point on the face and determine whether the face key point contains an occlusion; and the mask detection model is used to determine whether the occlusion is a mask.
[0026] Optionally, the human body detection model, the face detection model, the face occlusion detection model and the mask detection model are obtained based on a system target detection overall network, and the system target detection overall network comprises, in sequence, a down-sampling module, a CBAM attention module, a first bottleneck layer module, a first convolution module, a second bottleneck layer module, a second convolution module, a third bottleneck layer module, a third convolution module, a spatial pyramid pooling module, a fourth bottleneck layer module and an SE-Net attention module.
[0027] Optionally, the CBAM attention module comprises a channel stage maximum pooling layer, a channel stage average pooling layer, an MLP first linear / convolution submodule, an MLP activation submodule, an MLP second linear / convolution submodule, a maximum pooling result layer, an average pooling result layer, a result activation layer, a spatial stage maximum pooling layer, a spatial stage average pooling layer, a joint convolution layer and an activation layer.
[0028] Outputs of the channel stage maximum pooling layer and the channel stage average pooling layer are connected to inputs of the MLP first linear / convolution submodule, and outputs of the MLP first linear / convolution submodule, the MLP activation submodule and the MLP second linear / convolution submodule are connected in sequence, and outputs of the MLP second linear / convolution submodule are connected to inputs of the maximum pooling result layer and the average pooling result layer, and outputs of the maximum pooling result layer and the average pooling result layer are connected to an input of the result activation layer, and an output of the result activation layer is connected to inputs of the spatial stage maximum pooling layer and the spatial stage average pooling layer, and outputs of the spatial stage maximum pooling layer and the spatial stage average pooling layer are connected to an input of the joint convolution layer, and an output of the joint convolution layer is connected to the activation layer.
[0029] The channel stage maximum pooling layer and the channel stage average pooling layer process a first input feature map respectively, and the processing results are transmitted to the maximum pooling layer and the average pooling layer after being subjected to convolution and activation operations of the MLP first linear / convolution submodule, the MLP activation submodule and the MLP second linear / convolution submodule in sequence, and the maximum pooling layer and the average pooling layer are connected to the result activation layer after summing the convolution and activation features, and a channel dimension attention feature map is generated by the result activation layer, and then the channel dimension attention feature map and elements of the first input feature layer are multiplied and then input into the spatial stage maximum pooling layer and the spatial stage average pooling layer, and then the spatial dimension attention feature map is generated by the joint convolution layer and the activation layer in sequence, and the spatial dimension attention feature map and elements of the first input feature layer are multiplied to generate a complete feature map after attention activation.
[0030] Optionally, the SENet attention module comprises a convolution dimension change layer, a global pooling layer, a first full connection layer, a second full connection layer, a second activation submodule and a feature reconstruction layer, the convolution dimension change layer is connected with the first input end of the global pooling layer and the feature reconstruction layer at the same time, the first full connection layer, the second full connection layer and the second activation submodule are connected in sequence, and the output end of the second activation submodule is connected with the second input end of the feature reconstruction layer.
[0031] The convolution dimension change layer is used for compressing the channel dimension of the second input feature map and generating a feature map after dimension compression, the global pooling layer is used for transmitting the feature map after dimension compression to the first full connection layer after global pooling operation, then the feature map after dimension compression is processed by the first full connection layer, the second full connection layer and the second activation submodule in sequence to generate a processing result entering the feature reconstruction layer, and the feature reconstruction layer is used for reconstructing the processing result and the feature map after dimension compression to generate a new feature map after attention activation.
[0032] Optionally, the step S3 comprises:
[0033] S31: performing a screening operation on the recognition processing result to obtain a screening result;
[0034] S32: performing trajectory prediction according to the screening result to obtain a trajectory prediction result;
[0035] S33: performing target matching between frames by using the trajectory prediction result to obtain a target matching result;
[0036] S34: outputting the target matching result as the target tracking result.
[0037] Optionally, the step S31 comprises:
[0038] screening the recognition processing result with low confidence according to a target detection confidence threshold to obtain a first screening result;
[0039] performing screening on the first screening result by using a non-maximum suppression algorithm to obtain a screening result.
[0040] Optionally, the step S32 comprises:
[0041] creating a plurality of predictors for each target in a current frame image to predict the trajectory of target movement;
[0042] generating the trajectory of the target in the next frame according to the position of each target in the current frame image or the trajectory of the predicted target movement;
[0043] According to the predicted trajectory of the target movement and the trajectory of the target in the next frame, the trajectory prediction result is obtained.
[0044] Optionally, in the step S33, the target matching includes cascade matching and IoU matching, the cascade matching is used to set different priority matching for the tracker of each detector, for the tracker, the parameter of the successfully matched and updated tracker is initialized as 0, otherwise, the parameter is added by 1, the priority of the tracker is inversely proportional to the size of the parameter, and the priority of the tracker is constantly reduced when the parameter is too large; and the IoU matching is used to judge the matching condition by measuring the target IoU index of the tracker and the detector.
[0045] The present application has the following beneficial effects:
[0046] The present application solves the limitations of the existing system for mask wearing condition detection, adopts multiple models for detection, adds attention mechanism in the models to strengthen detection accuracy, and designs a series of logical judgments to assist in processing the model detection results, so that the system can identify the mask wearing conditions as wearing a mask, not wearing a mask, and not standard wearing a mask, and adds a target tracking function according to the characteristics of video media data to assist in tracking each detection object between frames of the video, solving the problems of inaccurate classification of wearing conditions, lack of detection accuracy and false detection object processing in the prior art. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 A flowchart of the processing method of mask wearing data based on video analysis provided by the present application is shown in the figure;
[0048] Figure 2 A structural schematic diagram of a target detection system is shown in the figure;
[0049] Figure 3 A structural schematic diagram of a CBAM attention module is shown in the figure;
[0050] Figure 4 A structural schematic diagram of a SENet attention module is shown in the figure. DETAILED DESCRIPTION
[0051] The principles and characteristics of the present application are described below in combination with the drawings, and the examples are only used to explain the present application and are not used to limit the scope of the present application.
[0052] EMBODIMENT
[0053] A processing method of mask wearing data based on video analysis is shown in the figure, Figure 1 The processing method of mask wearing data based on video analysis includes:
[0054] S1: obtaining video data;
[0055] The video data described in the application refers to video data in any format, including MP4 format, image format, etc.
[0056] S2: using a target detection system to recognize and process the current frame image of the video data to obtain a recognition processing result;
[0057] Optionally, the step S2 comprises:
[0058] S21: determining whether the current frame image contains human body data, if yes, proceeding to step S22, otherwise, proceeding to step S27;
[0059] That is, if the human body data is contained, the current frame image is useful data, which is retained for the next determination, otherwise, it is useless data, which can be directly discarded.
[0060] Of course, in the case of containing human body data, since the human body has side body, back, front, etc., and the mask must be worn on the front of the human body, in step S22:
[0061] S22: determining whether the human body data contains a face, if yes, proceeding to step S23; otherwise, proceeding to step S3;
[0062] When the human body data does not include a face, the current human body data may be a side body or a back, and cannot output the mask wearing condition completely, so the current frame image is output to step S3.
[0063] S23: recognizing a face key point on the face and determining whether the face key point contains an occlusion, if yes, proceeding to step S24; otherwise, proceeding to step S26:
[0064] Here, those skilled in the art can think that the face key point is a nose tip and / or left and right lip corners, etc. related to the mask, if the face key point includes an occlusion, the occlusion cannot be regarded as a mask, and it may be a veil, a brim, etc. Therefore, in this step, the mask wearing condition cannot be determined, that is, only when the face key point has an occlusion, the next step can be proceeded. Obviously, in the case of no occlusion, there is no correct mask wearing.
[0065] S24: determining whether the occlusion is a mask, if yes, proceeding to step S25; otherwise, proceeding to step S26;
[0066] S25: outputting the recognition processing result of the current frame image as correct mask wearing, and proceeding to step S3;
[0067] S26: output the recognition processing result of the current frame image as not wearing a mask correctly, and enter step S3;
[0068] S27: discard the recognition processing result of the current frame, enter the next frame, take the next frame as the current frame, and return to step S21.
[0069] In addition, in the present application, the target detection system includes a human body detection model, a face detection model, a face occlusion detection model, and a mask detection model. The human body detection model is used to determine whether the current frame image contains human body data. The face detection model is used to determine whether the human body data contains a face. The face occlusion detection model is used to identify the key points on the face and determine whether the face key points contain an occlusion. The mask detection model is used to determine whether the occlusion is a mask.
[0070] Specifically, the human body detection model filters out all detection objects except for "people" after detection, achieving detection of people. The face detection model does not distinguish between wearing a mask and wearing a mask but not wearing it properly during the detection process. In this model, attention mechanisms SENet (Squeeze-and-Excitation Network) and CBAM (Convolutional Block Attention Module) are introduced. CBAM is a lightweight convolutional block attention model that can be added to any CNN architecture to improve model performance. It operates on feature maps, and through channel attention modules and spatial attention modules, the extracted features are more refined, improving the expressiveness of the model. Unlike general networks that optimize spatial dimensions, SENet optimizes channel dimensions. By introducing attention mechanisms, a small number of parameters are added, allowing the model to better capture features on different channels, thereby improving accuracy. These two attention mechanisms are introduced into the network structure to improve the network's attention to key locations in the image, thereby improving network performance. The face occlusion detection model achieves detection of all faces in the image, and during face detection, it detects face key points for the five features of the face. The 5-point face key point corresponds to the left and right corners of the eyes, the nose, and the left and right corners of the lips. The mask detection model achieves detection of all masks in the image.
[0071] Further, with reference to Figure 2As shown, the human body detection model, the face detection model, the face occlusion detection model and the mask detection model are obtained based on a system target detection overall network, and the system target detection overall network comprises, in sequence, a down-sampling module, a CBAM attention module, a first bottleneck layer module, a first convolution module, a second bottleneck layer module, a second convolution module, a third bottleneck layer module, a third convolution module, a spatial pyramid pooling module, a fourth bottleneck layer module and an SENet attention module.
[0072] Alternatively, with reference to Figure 3 As shown, the CBAM attention module comprises a channel stage max-pooling layer, a channel stage average-pooling layer, an MLP first linear / convolution submodule, an MLP activation submodule, an MLP second linear / convolution submodule, a max-pooling result layer, an average-pooling result layer, a result activation layer, a spatial stage max-pooling layer, a spatial stage average-pooling layer, a joint convolution layer and an activation layer.
[0073] The output ends of the channel stage max-pooling layer and the channel stage average-pooling layer are connected to the input end of the MLP first linear / convolution submodule, the output end of the MLP first linear / convolution submodule, the MLP activation submodule and the MLP second linear / convolution submodule are connected in sequence, the output end of the MLP second linear / convolution submodule is connected to the input ends of the max-pooling result layer and the average-pooling result layer, the output ends of the max-pooling result layer and the average-pooling result layer are connected to the input end of the result activation layer, the output end of the result activation layer is connected to the input ends of the spatial stage max-pooling layer and the spatial stage average-pooling layer, the output ends of the spatial stage max-pooling layer and the spatial stage average-pooling layer are connected to the input end of the joint convolution layer, and the output end of the joint convolution layer is connected to the activation layer.
[0074] The channel stage max-pooling layer and the channel stage average-pooling layer process the first input feature map respectively, the processing results are subjected to convolution and activation operations in the MLP first linear / convolution submodule, the MLP activation submodule and the MLP second linear / convolution submodule in sequence, and then are transmitted to the max-pooling layer and the average-pooling layer, the max-pooling layer and the average-pooling layer sum the convolution and activation feature maps and transmit them to the result activation layer, the channel dimension attention feature map is generated through the result activation layer, then the channel dimension attention feature map and the elements of the first input feature layer are multiplied and then enter the spatial stage max-pooling layer and the spatial stage average-pooling layer for operation and processing, and then enter the joint convolution layer and the activation layer in sequence to generate the spatial dimension attention feature map, and the spatial dimension attention feature map and the elements of the first input feature layer are multiplied to generate the complete feature map after attention activation.
[0075] Optionally, refer to Figure 4 As shown, the SENet attention module includes a convolutional dimension-changing layer, a global pooling layer, a first fully connected layer, a second fully connected layer, a second activation submodule, and a reconstructed feature layer. The convolutional dimension-changing layer is connected to the first input of both the global pooling layer and the reconstructed feature layer. The first fully connected layer, the second fully connected layer, and the second activation submodule are connected sequentially, and the output of the second activation submodule is connected to the second input of the reconstructed feature layer.
[0076] The convolutional dimension-changing layer is used to compress the channel dimensions of the second input feature map and generate a feature map with compressed dimensions. The global pooling layer is used to perform global pooling on the feature map with compressed dimensions and then transmit it to the first fully connected layer. After that, the feature map with compressed dimensions is processed sequentially by the first fully connected layer, the second fully connected layer and the second activation submodule to generate a processing result that enters the reconstructed feature layer. The reconstructed feature layer is used to reconstruct features from the processing result and the feature map with compressed dimensions to generate a new feature map after attention activation.
[0077] S3: Perform target tracking on the recognition processing results to obtain tracking results;
[0078] Alternatively, step S3 may include:
[0079] S31: Perform a filtering operation on the identification processing results to obtain the filtering results;
[0080] Here, the screening mainly includes two steps: first, screening out the identification processing results with low confidence based on the target detection confidence threshold to obtain the first screening result;
[0081] Next, the first screening result is screened using a non-maximum suppression algorithm to obtain the final screening result. Here, the non-maximum suppression algorithm is used to screen out redundant results with excessive overlap.
[0082] S32: Based on the screening results, perform trajectory prediction to obtain the trajectory prediction result;
[0083] Mainly includes:
[0084] Multiple predictors are created for each target in the current frame image to predict the trajectory of the target's movement;
[0085] Based on each target position in the current frame image or the predicted target movement trajectory, generate the target trajectory in the next frame;
[0086] The trajectory prediction result is obtained based on the predicted trajectory of the target and the trajectory of the target in the next frame.
[0087] S33: Use the trajectory prediction results to perform target matching between frames to obtain target matching results;
[0088] The target matching includes cascaded matching and IoU matching. Cascaded matching is used to set different priority matching for trackers of each detector. Trackers are matched in order of priority. The parameters of trackers that are successfully matched and updated are initialized to 0, otherwise they are incremented by 1. The priority of trackers is inversely proportional to the size of their parameters. Trackers with excessively large parameters have their priority continuously reduced. IoU matching is used to determine the matching status by measuring the target IoU index between the tracker and the detector.
[0089] S34: Output the target matching result as the target tracking result.
[0090] S4: Output the recognition processing result or the tracking result as the processing result of the mask wearing data in the current frame image.
[0091] Because the required masked face detection and mask object detection lack public benchmark datasets, the experiments in this invention were mainly conducted on two datasets created according to the system construction requirements: the "Masked Face Detection Dataset" and the "Mask Object Detection Dataset." Both datasets are image datasets, and the annotation files are in text file format according to the algorithm requirements. The "Masked Face Detection Dataset" includes two categories of objects: "faces wearing masks" and "faces not wearing masks"; the "Mask Object Detection Dataset" only includes the object category "mask."
[0092] The primary evaluation metric for object detection is mean accuracy (mAP), typically measured using two different threshold conditions: mAP@0.5 and mAP@0.5:0.95. mAP@0.5 refers to the average accuracy with an IoU threshold of 0.5, while mAP@0.5:0.95 represents the average accuracy obtained when the IoU thresholds are 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, and 0.95. Of these two metrics, mAP@0.5:0.95 is considered more stringent.
[0093] Table 1 shows a comparison of the average accuracy of the overall target detection algorithm provided by this invention with some existing mainstream target detection algorithms, based on two target detection datasets constructed in the work. The comparison objects are all mainstream single-stage algorithms, including SSD (Single Shot Multibox Detector), YOLOv3, YOLOv4, and the original YOLOv5 algorithm.
[0094] Table 1 Comparison of Target Detection Performance
[0095]
[0096] According to the comparison in the table, in the "Face Mask Target Detection Dataset," the mAP@0.5 score is only 0.35% lower than the original YOLOv5 algorithm, significantly higher than other algorithms, and significantly higher than other algorithms in the mAP@0.5:0.95 ratio. In the "Mask Target Detection Dataset," both the mAP@0.5 and mAP@0.5:0.95 scores are significantly higher than other algorithms. Therefore, the overall target detection network provided by this invention has higher detection accuracy than existing target detection algorithms, making the mask-wearing data processing method based on video analysis provided by this invention more suitable for practical performance requirements.
[0097] In summary, the present invention has the following beneficial effects:
[0098] This invention addresses the limitations of existing systems in detecting mask wearing status. It employs multiple models for separate detection, adds an attention mechanism to each model to enhance detection accuracy, and designs a series of logical judgments to assist in processing the model detection results. This enables the system to identify mask wearing status as wearing a mask, not wearing a mask, or improperly wearing a mask. Furthermore, considering the characteristics of video media data, a target tracking function is added to assist in tracking each detected object between video frames. This solves the problems of inaccurate classification of mask wearing status, lack of detection accuracy, and handling of false detection objects in existing technologies.
[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for processing mask-wearing data based on video analysis, characterized in that, The processing method of the mask wearing data based on video analysis comprises: S1: acquiring video data; S2: recognizing and processing a current frame image of the video data by using a target detection system to obtain a recognition processing result; S3: performing target tracking on the recognition processing result to obtain a tracking result; S4: outputting the recognition processing result and the tracking result as a processing result of mask wearing data in the current frame image; In the step S2, the target detection system comprises a human body detection model, a face detection model, a face occlusion detection model and a mask detection model, the human body detection model is used to judge whether the current frame image contains human body data; the face detection model is used to judge whether the human body data contains a face; the face occlusion detection model is used to identify key points on the face and judge whether the face key points contain an occlusion; the mask detection model is used to judge whether the occlusion is a mask; the key points adopt 5-point face key points, and the 5 points correspond to the left and right corners of the eyes, the nose tip and the left and right corners of the lips of a person; The human body detection model, the face detection model, the face occlusion detection model and the mask detection model are obtained based on a system target detection overall network, and the system target detection overall network comprises, in sequence, a down-sampling module, a CBAM attention module, a first bottleneck layer module, a first convolution module, a second bottleneck layer module, a second convolution module, a third bottleneck layer module, a third convolution module, a spatial pyramid pooling module, a fourth bottleneck layer module and a SE-Net attention module; The step S3 comprises: S31: performing a screening operation on the recognition processing result to obtain a screening result; S32: performing trajectory prediction according to the screening result to obtain a trajectory prediction result; S33: performing target matching between frames by using the trajectory prediction result to obtain a target matching result; S34: outputting the target matching result as the target tracking result; The step S31 comprises: screening the recognition processing result with a low confidence according to a target detection confidence threshold to obtain a first screening result; performing screening on the first screening result by using a non-maximum suppression algorithm to obtain a screening result; The step S32 comprises: creating a plurality of predictors for each target in a current frame image to predict the trajectory of the target movement; generating the trajectory of the target in the next frame according to the position of each target in the current frame image or the predicted trajectory of the target movement; obtaining the trajectory prediction result according to the predicted trajectory of the target movement and the trajectory of the target in the next frame; In the step S33, the target matching comprises cascade matching and IoU matching, the cascade matching is used to set different priority matching for the trackers of each detector, for the trackers in the order, the parameters of the tracker that is successfully matched and updated are initialized as 0, otherwise, the parameters are added by 1, the priority of the tracker is inversely proportional to the size of the parameter, and the priority of the tracker is constantly reduced when the parameter of the tracker is too large; the IoU matching is used to judge the matching condition by measuring the target IoU index of the tracker and the detector. 2.The method of claim 1, wherein, The step S2 comprises: S21: determining whether the current frame image contains human body data, if yes, entering step S22, otherwise, entering step S27; S22: determining whether the human body data contains a face, if yes, entering step S23; otherwise, entering step S3; S23: identifying face key points on the face and determining whether the face key points contain an occlusion, if yes, entering step S24; otherwise, entering step S26: S24: determining whether the occlusion is a mask, if yes, entering step S25; otherwise, entering step S26; S25: outputting the recognition processing result of the current frame image as correct mask wearing, entering step S3; S26: outputting the recognition processing result of the current frame image as incorrect mask wearing, entering step S3; S27: discarding the recognition processing result of the current frame, entering the next frame, taking the next frame as the current frame and returning to step S21. 3.The method of claim 1, wherein, The CBAM attention module comprises a channel stage maximum pooling layer, a channel stage average pooling layer, an MLP first linear / convolutional submodule, an MLP activation submodule, an MLP second linear / convolutional submodule, a maximum pooling result layer, an average pooling result layer, a result activation layer, a spatial stage maximum pooling layer, a spatial stage average pooling layer, a joint convolution layer and an activation layer; The output ends of the channel stage maximum pooling layer and the channel stage average pooling layer are connected to the input end of the MLP first linear / convolutional submodule, the output end of the MLP first linear / convolutional submodule, the MLP activation submodule and the MLP second linear / convolutional submodule are connected in sequence, and the output end of the MLP second linear / convolutional submodule is connected to the input ends of the maximum pooling result layer and the average pooling result layer, the output ends of the maximum pooling result layer and the average pooling result layer are connected to the input end of the result activation layer, the output end of the result activation layer is connected to the input ends of the spatial stage maximum pooling layer and the spatial stage average pooling layer, the output ends of the spatial stage maximum pooling layer and the spatial stage average pooling layer are connected to the input end of the joint convolution layer, and the output end of the joint convolution layer is connected to the activation layer; The channel stage maximum pooling layer and the channel stage average pooling layer respectively process the first input feature map, and the processing results are transmitted to the maximum pooling layer and the average pooling layer after convolution and activation operations of the MLP first linear / convolution submodule, the MLP activation submodule and the MLP second linear / convolution submodule in turn, the maximum pooling layer and the average pooling layer sum the feature maps after convolution and activation, and transmit them to the result activation layer, generate a channel dimension attention feature map through the result activation layer, then the channel dimension attention feature map and the elements of the first input feature layer are multiplied and respectively enter the spatial stage maximum pooling layer and the spatial stage average pooling layer for operation and processing, and then enter the joint convolution layer and the activation layer in turn to generate a spatial dimension attention feature map, and the spatial dimension attention feature map and the elements of the first input feature layer are multiplied to generate a complete feature map after attention activation. 4.The method of claim 1, wherein, The SENet attention module includes a convolution dimension changing layer, a global pooling layer, a first full connection layer, a second full connection layer, a second activation submodule and a feature reconstruction layer, the convolution dimension changing layer is connected to the first input end of the global pooling layer and the feature reconstruction layer, the first full connection layer, the second full connection layer and the second activation submodule are connected in turn, and the output end of the second activation submodule is connected to the second input end of the feature reconstruction layer; The convolution dimension changing layer is used for compressing the channel dimension of the second input feature map and generating a feature map after compression, the global pooling layer is used for global pooling operation on the feature map after compression and transmitting to the first full connection layer, then the feature map after compression is processed by the first full connection layer, the second full connection layer and the second activation submodule in turn to generate a processing result, and the processing result enters the feature reconstruction layer, and the feature reconstruction layer is used for feature reconstruction of the processing result and the feature map after compression to generate a new feature map after attention activation.
Citation Information
Patent Citations
Face mask recognition method based on video monitoring
CN112287823A