A mask face pose classification method based on weighted two-stream residual network
By using a weighted two-stream residual network and an improved CAM module in face pose estimation, and using the unoccluded information of the mask for feature extraction and weighting processing, the problem of insufficient robustness of face pose estimation under mask occlusion is solved and high performance is achieved. Accurate gesture recognition and information utilization.
Patent Information
- Application Number
- CN202110053899.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-15
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-01-15
AI Technical Summary
The existing technology is not robust enough to face mask occlusion in facial pose estimation, and it is difficult to effectively handle illumination changes and noise interference, especially in model-based methods.
Using a method based on weighted two-stream residual network, by constructing a two-stream residual convolutional neural network and combining it with the improved CAM module, the information of the unoccluded part of the mask is used for feature extraction and weighting processing to establish a more robust mask face pose. Classification model.
It achieves accurate recognition of facial gesture images blocked by masks, with an overall accuracy of 97.86%, which improves information utilization, highlights important features through adaptive weighting, suppresses unimportant features, and enhances the robustness of the model.
Smart Images

Figure CN112800882B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a mask face posture classification method based on a weighted dual-stream residual network, and belongs to the field of computer vision. Background Art
[0002] Face pose estimation is a hot research topic in computer vision and intelligent analysis technology. Face pose estimation has a wide range of applications in face recognition, behavior analysis, human-computer interaction and other fields. By estimating face pose, computers can be assisted to better analyze and execute corresponding programs or operations. Usually, face pose estimation methods are divided into two categories: model-based and appearance-based. Model-based methods are not robust to factors such as facial occlusion, illumination changes, and noise interference, so appearance-based methods are more suitable for mask face pose estimation. Appearance-based methods can be regarded as pattern recognition tasks. Their essence is to construct a mapping relationship from image space or feature space to pose space, find sensitive and robust features, and build a classifier with good performance. This is the core task of this method.
[0003] In recent years, with the continuous development of convolutional neural networks based on deep learning, it has made great progress in the field of image classification. Convolutional neural networks have powerful feature acquisition capabilities and excellent classification performance, and have been successfully applied to face pose estimation. Face pose estimation has been effectively achieved in field scenes such as changing lighting and noise interference, so convolutional neural networks will be used to solve the problem of face pose estimation under mask occlusion. Summary of the invention
[0004] The present invention proposes a mask face posture classification method based on a weighted two-stream residual network. For face targets occluded by masks, the unoccluded information is fully utilized to perform modeling based on a convolutional neural network, thereby effectively realizing the estimation of the face posture of the mask-occluded face.
[0005] The present invention adopts the following technical solutions to solve the technical problems:
[0006] A mask face posture classification method based on a weighted two-stream residual network includes the following specific steps:
[0007] Step 1: Collect and construct a mask face posture dataset, and make a semi-simulated mask face posture dataset for data expansion;
[0008] Step 2: Divide the mask face posture dataset into a training sample part and a test sample part;
[0009] Step 3: Divide the mask face posture image into the unobstructed part of the mask, and resize the unobstructed part of the mask image and the mask face posture image to 128×128;
[0010] Step 4: Construct a weighted two-stream residual network model, which is composed of a two-way residual convolutional neural network in parallel. The network model includes 2 pre-convolutional layers and 8 residual convolutional units, 1 improved CAM module, 1 adaptive mean pooling layer and 1 fully connected layer;
[0011] Step 5: Train the weighted two-stream residual network model constructed in step 4 on the training sample part of the mask face posture data set in step 2 to obtain a trained model;
[0012] Step 6: Input the test sample part of the mask face posture data set in step 2 into the model trained in step 5 to obtain the output probability of each face posture category and realize the mask face posture estimation.
[0013] The mask face posture data set in step 1 has seven posture categories in the Yaw direction: -67°, -45°, -22°, 0°, +22°, +45°, and +67°.
[0014] The training sample part in step 2 is 70% of the actual collected data and the produced semi-simulated mask face posture data, and the test sample part is the remaining 30% of the actual collected data.
[0015] The improved CAM module in step 4 performs global mean pooling, global random value pooling and global maximum pooling on the input channel feature map, thereby squeezing out three feature descriptors, and then sending the three feature descriptors into a shared network consisting of two fully connected layers for calculation. The shared network outputs a weight vector, and then activates the weight vector through a sigmoid function to obtain the weight of each feature channel. Finally, the weight is assigned to the feature map of the corresponding channel. The formula is as follows:
[0016]
[0017] in, C is the number of channels, r is the scaling factor of the shared network, which is 16, σ is the sigmoid activation function, F is the input feature map, ReLU(·) is the activation function, Avgpool(·) is the global average pooling, Maxpool(·) is the global maximum pooling, Stochasticpool(·) is the global random value pooling, z1 represents the feature descriptor after global maximum pooling, z2 represents the feature descriptor after global average pooling, z3 represents the feature descriptor after global random value pooling, s c is the weight of each feature channel.
[0018] The weighted two-stream residual network model described in step 4 is composed of a two-way residual convolutional neural network in parallel, where one network contains one pre-convolutional layer and four residual convolutional units. The middle layer of a single residual convolutional unit consists of two convolutional layers, and the convolution kernel size is 3×3. The number of output channels of the four residual convolutional units is 64, 128, 256, and 512 respectively. The formula of the residual convolutional unit is as follows:
[0019] y=Conv(x,H i )+H s x
[0020] =H2σ(H1x)+H s x (2)
[0021] Where x is the input feature map, Conv(·) is the intermediate convolution layer of the residual convolution unit, H1 and H2 are the first and second level convolution mapping relationships of the intermediate layer of the residual convolution unit, respectively. s In order to maintain a linear mapping relationship consistent with the output dimension after the residual convolution unit is short-circuited, σ is the sigmoid activation function; y is the output after the residual convolution unit;
[0022] The other network has the same structure, but the convolution method in the residual convolution module is dilated convolution; the output feature maps obtained from the two paths are concatenated along the channel dimension, and an improved CAM module is used to adaptively weight the feature maps of each channel.
[0023] The beneficial effects of the present invention are as follows:
[0024] 1. The mask face posture classification model based on weighted dual-stream residual network proposed in the present invention can accurately identify the face posture images blocked by masks, and the overall accuracy rate reaches 97.86%.
[0025] 2. The present invention improves the utilization of useful information by constructing a dual-stream convolutional neural network model and increasing the utilization of information on the unblocked part of the mask.
[0026] 3. The present invention adopts an improved CAM (channel attention module) module to adaptively weight the feature maps obtained by the two-way convolutional neural network. The channel weighting method can more effectively highlight the features with large contributions and suppress the features with small contributions.
[0027] 4. The present invention increases the information of the compression channel feature map by improving the CAM module, enriching the available information in the excitation stage, so that the CAM module can better weight each feature channel. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1It is the overall flow chart.
[0029] Figure 2 This is a diagram showing some sample data.
[0030] Figure 3 It is a schematic diagram of the improved CAM module.
[0031] Figure 4 It is a schematic diagram of the weighted two-stream residual network structure.
[0032] Figure 5 This is the model training and testing flow chart. DETAILED DESCRIPTION
[0033] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0034] The present invention provides a mask face posture classification method based on a weighted dual-stream residual network, the overall process is as follows Figure 1 As shown. First, facial posture image data of people wearing masks in real scenes were collected. There are 7 posture categories in the Yaw direction (-67°, -45°, -22°, 0°, +22°, +45°, +67°). Facial images of 57 people were collected, containing a total of 798 samples. Due to the small amount of sample data, the present invention generates semi-simulated mask facial posture image data by superimposing simulated mask images that have undergone appropriate deformation, scaling, rotation and other operations on publicly available facial posture images. The facial posture of this data set is consistent with the real mask facial posture image, and it contains facial images of 1040 volunteers, with a total of 7280 samples. Some samples of semi-simulated mask facial posture images and real mask facial posture images are shown as follows. Figure 2 As shown in the figure. All the semi-simulated mask face pose images and 70% of the real mask face pose images are used as training data, and the remaining 30% of the real mask face pose images are used as test data. In addition, the data needs to be preprocessed before being sent to the network model training. First, the sample image is divided into two equal parts, and then the upper half of the image containing the human eye information and the overall face image are uniformly resized to 128×128, and the image is interfered by Gaussian noise, salt and pepper noise, mean blur, brightness transformation and other data enhancement operations.
[0035] The weighted two-stream residual network has two inputs, namely the whole mask face posture image and the unobstructed part of the mask image. Since the unobstructed part of the mask image contains a lot of image information that can be used for posture recognition, by adding a convolutional neural network to extract features from this part of the image, the effective information of the mask face posture image can be fully utilized. Combined with another convolutional neural network to extract features from the whole image, the two-way convolutional neural network can obtain richer image features. Among them, for the residual network with the whole image as input, the object of its information acquisition is the whole image, which has a wide area, so the convolution method is selected as the dilated convolution to expand the range of the receptive field, so as to better grasp the global information. Since the features obtained by the two-way network have different importance, it is necessary to weight the features to highlight the features that contribute greatly to the classification results and suppress the features that contribute little or invalid to the classification results. Therefore, the feature maps output by the last convolution layer of the two-way residual network are first spliced along the channel dimension, and then the improved CAM module is used to weight each feature channel. The standard CAM module only uses the global maximum pooling information and global mean pooling information of the feature map. On this basis, the global random value pooling is added to enrich the available information of the CAM module in the excitation stage. The three feature symbols of maximum pooling, mean pooling and random value pooling are combined to more comprehensively describe the feature map information, so that the CAM module can better weight each channel feature. The improved CAM module is as follows: Figure 3 Then the output weighted feature map will be sent to the adaptive pooling layer, the feature map is compressed to 1×1×n (n is the number of channels of the output feature map) and sent to the fully connected layer to integrate the feature information, and finally sent to the Softmax (Softmax is a function name) classification layer to obtain the final posture classification result. The overall network diagram of the weighted two-stream residual network is shown in Figure 4 shown.
[0036] The network training and testing process of the mask face posture classification method based on the weighted dual-stream residual network described in the present invention is as follows: Figure 5 As shown, the specific process is as follows:
[0037] The constructed weighted two-stream residual network model is trained in the training sample part. The training algorithm is the stochastic gradient descent method, with a momentum factor of 0.9, a weight decay factor of 0.0005, an initial learning rate of 0.01, a batch size of 16, 100 iterations, and a cross entropy loss function. The CPU processor of the experimental platform is Core i7-9750H, 8GB memory, and the GPU graphics card is NVIDIA GeForce GTX 1650, based on the Pytorch deep learning framework. After the training is completed, the model performance is verified in the test sample part.
[0038] First, in order to illustrate the beneficial effect of using the improved CAM module on feature weighting, the experiment set up a network model that did not use the CAM module to weight the spliced feature map, a network model that used the CAM module to weight the spliced feature map, and a network model that used the improved CAM module to weight the spliced feature map for comparison. The experimental results are shown in Table 1. As can be seen from the table, using the CAM module to weight the spliced feature map can effectively improve the performance of the network model, and using the improved CAM module can further optimize the weighted effect and improve the overall accuracy of the model.
[0039] Table 1 Comparative experiment using improved CAM module
[0040]
[0041] In order to compare the effect of using two-stream convolutional neural network, the experiment set up a network model that only extracts features from the overall face information and a network model that only extracts features from the face information that is not blocked by the mask. The experimental results are shown in Table 2. As can be seen from the table, the effect of the single-channel convolutional neural network model that only uses the overall face image or the face image that is not blocked by the mask is poor, while the two-stream convolutional neural network can make full use of the information of the mask face image and effectively realize the mask face posture estimation.
[0042] Table 2 Comparison of the effects of using two-stream convolutional neural network
[0043]
[0044] The above description is only a preferred embodiment of the present invention and does not constitute any other form of limitation to the present invention. Any modification or equivalent change made based on the technical essence of the present invention still falls within the scope of protection required by the present invention.
Claims
1. A mask face posture classification method based on weighted two-stream residual network, characterized in that , including the following specific steps: Step 1: Collect and construct a mask face posture dataset, and make a semi-simulated mask face posture dataset for data expansion; Step 2: Divide the mask face posture dataset into a training sample part and a test sample part; Step 3: Divide the mask face posture image into the unobstructed part of the mask, and resize the unobstructed part of the mask image and the mask face posture image to 128×128; Step 4: Construct a weighted two-stream residual network model, which is composed of a two-way residual convolutional neural network in parallel. The network model includes 2 pre-convolutional layers and 8 residual convolutional units, 1 improved CAM module, 1 adaptive mean pooling layer and 1 fully connected layer; The weighted two-stream residual network has two inputs, namely the whole mask face posture image and the unobstructed part of the mask image. One residual convolutional neural network is added to extract features of the unobstructed part of the mask image, and another residual convolutional neural network is added to extract features of the whole mask face posture image. The object of obtaining information is the whole image, and the convolution method is selected as dilated convolution. Since the features obtained by the two-way residual convolutional neural network have different importance, the features need to be weighted. First, the feature maps output by the last convolutional layer of the two-way residual network are spliced along the channel dimension, and then the improved CAM module is used to weight each feature channel. The improved CAM module performs global mean pooling, global random value pooling and global maximum pooling on the input channel feature map, thereby squeezing out three feature descriptors, and then sending the three feature descriptors into a shared network consisting of two fully connected layers for calculation. The shared network outputs a weight vector, and then activates the weight vector through a sigmoid function to obtain the weight of each feature channel. Finally, the weight is assigned to the feature map of the corresponding channel. The formula is as follows: in, C is the number of channels, r is the scaling factor of the shared network, which is 16, σ is the sigmoid activation function, F is the input feature map, ReLU(·) is the activation function, Avgpool(·) is the global average pooling, Maxpool(·) is the global maximum pooling, Stochasticpool(·) is the global random value pooling, z1 represents the feature descriptor after global maximum pooling, z2 represents the feature descriptor after global average pooling, z3 represents the feature descriptor after global random value pooling, s c The weight for each feature channel Step 5: Train the weighted two-stream residual network model constructed in step 4 on the training sample part of the mask face posture data set in step 2 to obtain a trained model; Step 6: Input the test sample part of the mask face posture data set in step 2 into the model trained in step 5 to obtain the output probability of each face posture category and realize the mask face posture estimation.
2. A mask face posture classification method based on a weighted dual-stream residual network according to claim 1, characterized in that: The mask face posture data set in step 1 has seven posture categories in the Yaw direction: -67°, -45°, -22°, 0°, +22°, +45°, and +67°.
3. The mask face posture classification method based on weighted dual-stream residual network according to claim 1 is characterized in that: The training sample part in step 2 is 70% of the actual collected data and the produced semi-simulated mask face posture data, and the test sample part is the remaining 30% of the actual collected data.
4. The mask face posture classification method based on weighted dual-stream residual network according to claim 1 is characterized in that: The weighted two-stream residual network model described in step 4 is composed of a two-way residual convolutional neural network in parallel, where one network contains one pre-convolutional layer and four residual convolutional units. The middle layer of a single residual convolutional unit consists of two convolutional layers, the convolution kernel size is 3×3, and the output channel numbers of the four residual convolutional units are 64, 128, 256, and 512 respectively. The formula of the residual convolutional unit is as follows: Where x is the input feature map, Conv(·) is the intermediate convolution layer of the residual convolution unit, H1 and H2 are the first and second level convolution mapping relationships of the intermediate layer of the residual convolution unit, respectively. s In order to maintain a linear mapping relationship consistent with the output dimension after the residual convolution unit is short-circuited, σ is the sigmoid activation function; y is the output after the residual convolution unit; The other network has the same structure, but the convolution method in the residual convolution module is hollow convolution; the output feature maps obtained from the two paths are spliced along the channel dimension, and the improved CAM module is used to adaptively weight the feature maps of each channel.
