Face detection method based on self-calibration illumination and improved Retinaface
By self-calibrating lighting and improving the Retinaface network, combined with the Ghostnet and GCAnet attention mechanisms, the problems of insufficient face detection accuracy and high model latency in dark environments are solved, and efficient and accurate face detection is achieved.
Patent Information
- Application Number
- CN202310145499.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-22
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-02-22
AI Technical Summary
Existing face detection methods lack detection accuracy in complex environments, especially low-light environments, and suffer from low detection efficiency and high latency when the model is deployed.
A self-calibration lighting module is used to pre-process dark light images. Combined with the improved Retinaface network, Ghostnet is used as the backbone network, the global pooling GCAnet attention mechanism is introduced, and the FPN module is used to perform feature fusion and multi-task loss function optimization to improve detection accuracy and efficiency.
It significantly improves face detection accuracy in low-light environments, reduces model latency, and improves detection efficiency and adaptability to complex environments.
Smart Images

Figure CN116884051B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision, and in particular relates to a face detection method based on self-calibration lighting and improved Retinaface. Background Art
[0002] Face detection, a key issue in computer vision, has broad applications in scenarios such as security verification and work attendance. Therefore, research on face detection accuracy remains highly valuable. Retinaface improves face detection accuracy in challenging scenarios by annotating five facial key points on the WIDER FACE dataset and leveraging external supervisory signals. As mentioned above, current face detection methods have significantly improved accuracy through various approaches. However, due to the increasing size of models, deployment still faces numerous challenges, such as low detection efficiency and increased latency. Furthermore, existing models still have accuracy issues for complex detection scenarios, such as low-light conditions, which require further improvement. Summary of the Invention
[0003] To overcome the shortcomings of existing technologies, this paper provides a face detection method based on self-calibration illumination and an improved RetinaFace. This method leverages the low-light processing capabilities of the self-calibration illumination framework and the high detection accuracy of RetinaFace, addressing the low detection accuracy and insufficient dimming capabilities of traditional algorithms. It achieves superior face detection results in dimly lit environments.
[0004] The technical solution adopted by the present invention to solve its technical problems is as follows: the dataset uses DarkFace, the input is a 640*640 format image, the self-calibration lighting module pre-processes the data, Retinafce uses an improved attention mechanism for feature enhancement, and adopts the FPN module to achieve feature fusion and multi-task loss to improve positioning accuracy. First, the dark light image is pre-processed using the SCI module, which will improve the subsequent detection accuracy by adjusting the lighting environment of the image to a relatively reasonable state. The pre-processed photos are sequentially processed through the improved Retinaface feature extraction, the feature enhancement module of the attention mechanism, the feature fusion (FPN), and the SSH module to finally obtain the detection results.
[0005] Compared with the existing technology, the beneficial effects of the present invention are as follows: the present invention proposes a new attention mechanism GCAnet, which adds a global pooling part (global pooling) on the basis of capturing information in the x and y directions, thereby improving the capture of global information correlation; Ghostnet reduces the model size and latency, improves detection efficiency, the newly proposed attention mechanism improves detection accuracy, and the introduced self-calibration lighting framework improves detection accuracy in low-light environments; giving full play to the respective advantages of the self-calibration module and the Retinafce network, it can improve detection accuracy and efficiency, and has a better detection effect in dim environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 This is a flow chart of the dark light face detection method based on self-calibration illumination and improved Retinaface.
[0007] Figure 2 This is a framework diagram of the self-calibration lighting module of the present invention.
[0008] Figure 3 This is the network structure diagram of GCANet attention mechanism. DETAILED DESCRIPTION
[0009] The present invention will be further described below with reference to the accompanying drawings:
[0010] The specific execution steps are as follows: Before execution, the self-calibration lighting framework needs to obtain the corresponding weights through training on a large number of pictures. The weights reflect the mapping from an original picture to the result picture after dark light processing. The obtained weights will be used in subsequent practical use. Step 1, the input picture is processed by the self-calibration lighting framework to process the dim environment in the picture. Step 2, the processed picture enters the backbone network of the detection network. This article uses ghostnet as the backbone network. After the picture is input, a smaller feature map is first generated through the convolution operation therein. Then, on this basis, a new feature map is generated through depth-separable convolution. The two sets of feature maps are spliced together to generate the output result. Step 3, the feature map obtained in step 2 is input into the attention mechanism GCAnet (global coordinate attention mechanism) part. This part is divided into three branches. The first two branches perform separate pooling operations on the input feature map in the horizontal and vertical directions, respectively, resulting in two feature maps. They each capture the long-range dependencies of the input feature map along a spatial direction. The third branch uses global pooling to capture the dependencies between the input feature maps in different directions. The results of the three branches are then concatenated to obtain the output. The purpose of this step is to perform more detailed feature extraction. In step 4, the output of step 3 is passed through the FPN feature pyramid network and the SSH single-stage headless detection network. The FPN part performs 1x1 convolution on the previously output feature layer to adjust the number of channels and upsample and fuse features. The SSH further enhances feature extraction to obtain more accurate feature maps. In step 5, ClassHead extracts whether the prior box contains a face. BoxHead performs prior position detection, and LandmarkHead detects the location of facial landmarks. These three parts each produce a feature prediction result, which is then converted to a specific format through Decode and concatenated to obtain a preliminary prediction result. Step 6: In the preliminary prediction results, there may be multiple prediction boxes for a certain face. NMS (non-maximum suppression) will remove the duplicate prediction boxes to obtain the final prediction result.
[0011] like Figure 1As shown in the figure, it is the flowchart of improving Retinaface's dark light face detection. The self-calibrated illumination module is the dark light processing module used in this paper. GhostNet is the backbone of the detection network, responsible for extracting image features. GCAnet is the attention mechanism proposed by the authors of this paper, which addresses the problem that existing attention mechanisms lack the ability to capture global information correlations, thereby improving detection accuracy. The FPN (Feature Pyramid Network) is a feature pyramid network. The previous steps generate feature layers at different scales of the input image. This module outputs different feature layers through 1x1 convolution, adjusting the number of channels, and performing upsampling and feature fusion to enhance feature extraction. The SSH (Single Stage Headless) is a single-stage headless detection network, which further enhances feature extraction at the feature layer. Headless refers to its ability to achieve advanced results while removing the fully connected layers of its underlying classification network. ClassHead is used for classification detection (determining the presence of a face), BoxHead is used for face location detection, and LandmarkHead is used for facial landmark location detection. Decode is used for decoding, converting the three results obtained above into different formats for subsequent processing. Non-maximum suppression (NMS) removes highly overlapping prediction boxes from the decoded results. First, the publicly available Darkface dataset was selected. Because this dataset contains many identical scenes, the DataAnchor Sample method was used to randomly crop and resize images in the Darkface dataset. This yielded multiple preprocessed images. Preprocessing involves random cropping and rescaling, and the resulting images correspond to the images processed through these two steps, with a one-to-one correspondence. The self-calibrated illumination module (SCI) was then used as the preprocessing component for Retinaface. Joint training was performed on the aforementioned dataset. After obtaining the joint model weights, the model was deployed on mobile devices for actual detection. During training, the self-calibrated illumination module uses a weight-sharing scheme to train multiple cascaded blocks. However, since the outputs of multiple cascaded blocks ultimately converge to the same value, only one cascaded block is used during testing. In practice, detected images are first enhanced by the self-calibrated illumination preprocessing module, with brightness and contrast adjustments applied for images in low-light environments. These processed images are then fed into the improved Retinaface component to obtain detection results.
[0012] The dark light processing link uses the SCI (self-Calibrated illumination) self-calibration lighting framework proposed by Long Ma in 2022. Figure 2As shown in Figure 2, during the training phase, the framework consists of an illumination estimation module and a self-calibration module. The self-calibration module first processes the initial illumination input, and the result is then used as the input for the illumination estimation phase in the next stage. These two modules share parameters throughout the training process. During the testing phase, only a single illumination estimation module is utilized.
[0013] Considering that the existing Retinaface algorithm uses a ResNet-50 backbone network, which offers high accuracy but suffers from high latency in actual deployments due to its computationally intensive model, this method uses a different backbone network than the original ResNet-50. Instead, it uses GhostNet, a framework recently developed by Huawei's Noah's Ark Lab. This network replaces traditional convolutional units with some depthwise separable convolutions, reducing the overall model size while minimizing accuracy and improving detection efficiency.
[0014] Many networks now use the attention mechanism, the purpose of which is to make the neural network automatically focus on key positions instead of paying attention to everything, so as to achieve network adaptive attention. SENet is a typical channel attention mechanism, which makes the network pay more attention to some more important channels by obtaining the weights of each channel of the input feature layer. ECANet replaces the fully connected layer in SENet with a 1D convolutional layer to obtain better cross-channel information acquisition capabilities. CANet proposed by Qibin Hou et al. in 2021 decomposes channel attention into two 1-dimensional feature encoding processes, aggregating features from two directions to strengthen the representation of the object of attention. It can be found from the structure of CANet that although the pooling process in two directions can more accurately capture the position information in each direction, because it abandons the global pooling part and replaces it with the splicing of the two-directional information, it will inevitably lose some global related information, which is not conducive to the accurate extraction of overall features. Based on this point, this paper proposes GCANet, that is, adding a global pooling part on the basis of this network, which enables the attention mechanism to capture not only the precise position information in each direction, but also the global position information. Its structure is as follows Figure 3 As shown in Figure 2. G is the self-calibration module and F is the illumination estimation module. In illumination estimation, u t is the residual of the tth stage. θ is the illumination estimation weight. This parameter is independent of the number of stages and is shared across multiple stages. Further understanding of this module reveals that under the progressive optimization and parameter sharing mechanism, each stage hopes to obtain an output close to the target, so there is a self-calibration module G. The purpose of this module is to analyze the relationship between each stage and ensure that the outputs of different stages in the training process can converge to the same state. t is the input illumination at stage t, vt is the input for illumination estimation after the self-calibration phase in phase t, y is the low-light observation result, K θ is the weight of the self-calibration stage, which is also independent of the number of stages. The remaining parameters are basic intermediate variables of the operation
[0015] Bounding box regression is a key step in object detection. Traditionally, bounding box regression uses the L1 loss function. The model needs to output an object classification score and the corresponding bounding box for object localization. Previous models often used the classification score as a measure of confidence in object localization accuracy, and based on this, performed NMS on a large number of candidate object bounding boxes. However, a growing body of work has shown that high classification scores do not guarantee high localization accuracy. This model network uses IoU loss instead of L1 loss. Furthermore, it was found that incorporating facial landmark detection during training can improve regression accuracy. Therefore, the overall loss function of the model uses a linear combination of classification loss, bounding box regression loss, and facial landmark loss.
[0016] Conventional face detection has achieved good results and is widely used in various practical scenarios. However, face detection in low-light environments still suffers from low accuracy. Furthermore, in actual deployments, due to the increasing size of models, high latency occurs during the detection process. From a practical perspective, this method innovatively combines a low-light processing module with a face detection model. It also employs an improved attention mechanism and a new backbone network to reduce latency and improve dimly lit environments while maintaining high accuracy.
Claims
1. A face detection method based on self-calibration illumination and improved Retinaface, characterized in that The steps include: In step 1, the input image is processed through the self-calibration lighting framework to process the dim environment in the image; Step 2: The processed image enters the backbone network of the detection network. GhostNet is used as the backbone network. After the image is input, it first generates a feature map through the convolution operation. Then, based on this, a new feature map is generated through depthwise separable convolution. The two sets of feature maps are spliced together to generate the output result. Step 3: The feature map obtained in step 2 is input into the attention mechanism; An improved attention mechanism is adopted. A global pooling part is added on the basis of the original attention mechanism CANet. This part is divided into three branches. The first two branches perform separate pooling operations on the input feature map in the horizontal and vertical directions respectively, and then obtain two feature maps, which capture the long-range dependency of the input feature map along one spatial direction respectively. The third branch captures the dependency between the input feature maps in different directions through global pooling. The results of the three branches are then spliced together to obtain the output for more detailed feature extraction. Step 4: The output of step 3 is passed through the FPN feature pyramid network and the SSH single-stage headless detection network. The FPN part performs 1x1 convolution on the previously output feature layer to adjust the number of channels and upsample and fuse features. The SSH further enhances feature extraction to obtain a more accurate feature map. Step 5: ClassHead extracts whether the prior box contains a face, BoxHead is a priori position detection, and LandmarkHead is a facial key point position detection. These three parts will each obtain a feature prediction result, which is then converted into a certain format through Decode and spliced to obtain a preliminary prediction result; Step 6: In the preliminary prediction results, there may be multiple prediction boxes for a certain face. Non-maximum suppression will remove the duplicate prediction boxes to obtain the final prediction result.
2. The face detection method based on self-calibration illumination and improved Retinaface according to claim 1, characterized in that: When using the improved Retinaface network structure to detect face images, the key point prediction branch is introduced to assist the face detection results.
3. The face detection method based on self-calibration illumination and improved Retinaface according to claim 1, characterized in that: The method adopts the Ghost network to replace the original backbone network, maintaining high accuracy while reducing the size of the network model.
4. The face detection method based on self-calibration illumination and improved Retinaface according to claim 1, characterized in that: In order to solve the problem of face detection accuracy in dim environments, a dark light processing framework SCI is introduced. This framework significantly improves the lighting conditions in the image through two parts: illumination estimation and self-calibration modules.