Face recognition method and device, equipment and medium
By using the alignment detection model and the recognition model for feature extraction and matching in the face recognition system, the problem of feature information redundancy and low utilization caused by independent modules in the traditional system is solved, and more efficient and accurate face recognition is achieved. .
Patent Information
- Application Number
- CN202411387279.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-24
AI Technical Summary
In traditional face recognition systems, the relatively independent modules lead to redundancy in feature information and low utilization, and the models and data of each module need to be trained and maintained separately, which increases the maintenance difficulty and affects the operation efficiency of the recognition system.
通过获取待识别的人脸图像,将其输入到对齐检测模型中进行处理,输出人脸位置信息和对齐特征,识别模型根据这些特征进行特征提取,并与人脸数据库中的特征进行匹配,以 Determine the identity to be recognized.
It reduces unnecessary modules or layers, reduces model complexity, ensures that features are effectively utilized in the model, reduces information redundancy, improves the processing speed of the system, and improves recognition accuracy by improving algorithms and model training.
Smart Images

Figure CN119360427A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology and financial technology, and in particular to a face recognition method, device, equipment and storage medium. Background Art
[0002] In the financial sector, the application of image processing technology is becoming increasingly important. It can be used in multiple fields such as identity authentication, security monitoring, and personalized recommendations in actual financial application scenarios. For example, in financial services, it is crucial to ensure the authenticity of user identities. By using image processing technology, especially face recognition systems, financial institutions are able to achieve fast and contactless identity authentication. This technology not only improves the security and efficiency of financial services, but also provides customers with a more personalized and convenient experience.
[0003] The application of image processing technology in the financial field also includes security monitoring. It can help identify specific groups of people, such as criminal suspects or missing children, and analyze the emotional state of the crowd, providing important reference for security warnings. Face recognition systems usually include key modules such as face detection, face alignment, feature extraction, and feature comparison.
[0004] However, in traditional face recognition systems, these modules are often relatively independent, resulting in redundant feature information and low utilization. In addition, the model and data of each module need to be trained and maintained separately, which increases the difficulty of maintenance. In addition, the data needs to be processed before and after the model is processed, interrupting the acceleration effect of the neural network framework, causing the recognition system to run too long. Summary of the invention
[0005] The main purpose of the present invention is to provide a face recognition method, device, equipment and storage medium, aiming to solve the technical problem in the prior art that the playback speed of voice content in the video cannot be automatically adjusted to match the video content and rhythm, and manual editing is required, which is time-consuming and inefficient.
[0006] To achieve the above object, the present invention provides a face recognition method, comprising:
[0007] Obtaining a face image to be identified, and inputting the face image to be identified into an alignment detection model;
[0008] The alignment detection model detects the face image to be identified, and outputs face position information and alignment features according to the detection result;
[0009] The recognition model extracts features from the alignment features and the face position information to obtain features of the face to be recognized;
[0010] The facial features to be identified are matched with the facial features in a face database, and a face recognition matching result is output.
[0011] Furthermore, in order to achieve the above object, the present invention provides a face recognition device, comprising:
[0012] An image acquisition module is used to acquire a face image to be identified and input the face image to be identified into an alignment detection model;
[0013] An image processing module, used for the alignment detection model to detect the face image to be identified, and output face position information and alignment features according to the detection result;
[0014] An image recognition module is used to extract features of the alignment features and face position information by a recognition model to obtain features of the face to be recognized;
[0015] The image matching module is used to match the facial features to be identified with the facial features in the face database and output the facial recognition matching results.
[0016] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer device, which includes a memory, a processor, and a face recognition program stored in the memory and executable on the processor, and the face recognition program, when executed by the processor, implements the steps of the face recognition method as described above.
[0017] Furthermore, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a face recognition program is stored, and when the face recognition program is executed by a processor, the steps of the face recognition method described above are implemented.
[0018] Beneficial effects: The present invention relates to the fields of image processing technology and financial technology, and discloses a face recognition method, which obtains a face image to be recognized, inputs the obtained image into an alignment detection model for processing, and then the alignment detection model outputs the face position information and aligned features, and then the recognition model extracts the specific features of the face according to the alignment features and the face position information, and then matches the extracted face features with the face features stored in the database to determine the identity of the face to be recognized. The present invention reduces unnecessary modules or layers, reduces the complexity of the model, ensures that the features are effectively used in the model, reduces information redundancy, improves the processing speed of the system, and improves the accuracy of recognition by training the improved model. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0020] Figure 1 A schematic diagram of an application environment of a face recognition method according to an embodiment of the present invention;
[0021] Figure 2 A schematic diagram of a flow chart of an embodiment of a face recognition method of the present invention;
[0022] Figure 3 A schematic diagram of functional modules of a preferred embodiment of the face recognition device of the present invention;
[0023] Figure 4 A schematic diagram of the structure of a computer device in one embodiment of the present invention;
[0024] Figure 5 FIG. 4 is another schematic diagram of the structure of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0025] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0026] The face recognition method provided by the embodiment of the present invention can be applied in Figure 1 In an application environment, the user terminal communicates with the server terminal through a network. The server terminal can obtain a face image to be identified through the user terminal, and input the obtained image into an alignment detection model for processing. The alignment detection model outputs the position information of the face and the aligned features. The recognition model extracts the specific features of the face based on the alignment features and the face position information. The extracted face features are matched with the face features stored in the database to determine the identity of the face to be identified. The present invention reduces the complexity of the model by reducing unnecessary modules or layers. Ensure that the features are effectively used in the model and reduce information redundancy. Improve the processing speed of the system by optimizing algorithms and hardware acceleration. Improve the accuracy of recognition by improving algorithms and model training. Among them, the user terminal can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server terminal can be implemented with an independent server or a server cluster consisting of multiple servers. The present invention is described in detail below through specific embodiments.
[0027] See also Figure 2 , Figure 2 This is a flow chart of an embodiment of a face recognition method provided by the present invention. It should be noted that although a logical sequence is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0028] like Figure 2 As shown, the face recognition method proposed by the present invention comprises the following steps:
[0029] S10, obtaining a face image to be identified, and inputting the face image to be identified into an alignment detection model;
[0030] S20: the alignment detection model detects the face image to be identified, and outputs face position information and alignment features according to the detection result;
[0031] S30, extracting features from the alignment features and face position information using a recognition model to obtain features of the face to be recognized;
[0032] S40: Match the facial features to be recognized with the facial features in a facial database, and output a facial recognition matching result.
[0033] In this embodiment, in the face recognition system, it is first necessary to capture or receive a face image to be recognized, which can be achieved by camera shooting, image uploading or other methods. Subsequently, the face image to be recognized is input into the alignment detection model to perform face detection and feature alignment operations.
[0034] The alignment detection model starts processing the input image by first identifying the faces in the image and outputting the location information of the faces in the form of face boxes. The model then aligns the facial features to standardize the pose and expression of the face and outputs the alignment features.
[0035] Next, the aligned features are fed into a recognition model that is designed to extract more discriminative facial features. The recognition model uses deep learning algorithms, such as convolutional neural networks (CNNs), to extract key features from the aligned features that represent an individual’s identity.
[0036] The extracted facial features are then compared with known facial features stored in the database to determine the identity of the face to be identified. This process involves calculating the similarity between the facial features to be identified and each facial feature in the database. If the similarity exceeds the preset similarity match threshold, the system will output a successful match result to confirm the identity of the face to be identified. If the similarity does not exceed the threshold, the system will output a failed match result.
[0037] When the matching failure result is output, more diverse face images can be used for training, such as different ages, genders, races, expressions, lighting conditions, etc., to improve the generalization ability of the model. Combine facial features with other biometric features, such as fingerprints, irises, and voices, to improve the accuracy and security of recognition. Adjust the similarity threshold according to actual conditions. For example, in scenarios with high security requirements, a higher threshold can be set to reduce the false recognition rate. First use a fast matching algorithm for rough matching, and then use a more accurate matching algorithm for fine matching to improve recognition efficiency. When facial feature matching fails, a manual review mechanism can be introduced to manually determine whether it is a correct face recognition result. Combine other identity authentication methods, such as passwords, fingerprints, irises, etc., to improve the accuracy and security of identity authentication.
[0038] In practical applications, different solutions are needed to solve the problem of facial feature matching failure according to specific circumstances. By improving matching accuracy, adding recognition algorithms, manual review and other methods, the accuracy and robustness of the face recognition system can be improved and the number of matching failures can be reduced.
[0039] The entire process is automated and combines multiple technologies such as image processing, feature extraction, and machine learning. Through the above process, the face recognition system can efficiently and accurately identify and verify personal identity, and is widely used in security verification, access control, monitoring analysis and other fields.
[0040] A specific embodiment of the present invention integrates face detection and facial key point location through an end-to-end training method, which means that the entire system is processed by a unified model rather than multiple separate models. Since the detection and alignment tasks are completed in one model, the complexity of the entire system is reduced. In traditional methods, data needs to be transferred between different models, and each transfer requires data format conversion and processing. The end-to-end model eliminates these steps. The unified model makes the software development kit (SDK) packaging more concise and easier to maintain. The simplified model and code reduce the technical support and maintenance work in actual deployment, thereby reducing costs.
[0041] The present invention combines face detection and face key point positioning to directly output aligned face features from the original image. All steps are completed by a deep network model, avoiding data transfer and processing between multiple models. The present invention can better utilize the optimization and acceleration functions of the deep learning framework, thereby providing a faster response speed in practical applications.
[0042] In terms of feature extraction, features are extracted directly from the original image, reducing information loss during image preprocessing and information transmission. Due to less information loss, the extracted features contain richer facial information, which helps improve the accuracy of face recognition.
[0043] The shallow features after face alignment on the face feature module can be directly used for face recognition without the need for additional feature extraction steps. Since the shallow features of the alignment model can be reused, the recognition model can omit this part of the structure, thereby reducing the size of the model. This method improves the efficiency of computing resources because there is no need to repeatedly extract shallow features when building the recognition model.
[0044] In one embodiment, the alignment detection model detects the face image to be identified, and before outputting face position information and alignment features according to the detection result, includes:
[0045] Acquire detection training data, and input the detection training data into the alignment detection model;
[0046] Training the detection network according to the detection training data until the detection network converges;
[0047] Fix the parameters of the detection network, input the detection training data into the detection network again for processing, and output feature information and face position information;
[0048] Acquire alignment training data, and train the alignment network according to the alignment training data, feature information, and face position information until the alignment network converges, thereby completing the training of the alignment detection model.
[0049] In this embodiment, in building a high-precision face recognition system, the training of the detection alignment network is a key step. A large amount of training data needs to be collected, including face and non-face images. These data will be input into the detection alignment network for preliminary training. At this stage, the network learns to distinguish between face and non-face images and outputs the location information of the face, that is, the face frame. In order to improve the recognition accuracy of the detection network for the face position in the image, the training data should contain face images with marked face frames. In this way, the network can learn how to accurately locate the face by using the face frame as a supervisory signal. Specifically, the detection training data is collected and input into the detection alignment network. The detection network is trained using these data until the network reaches a convergence state. In this process, the detection network will process the input detection training data to output feature information and face position information.
[0050] To ensure that the detection network can accurately identify the location of faces in images, we use training data containing both face and non-face images, where the face images have been labeled with the location of the face frame. Using the face frame as a supervisory signal, we train the detection network to distinguish between face and non-face images and accurately output the location of the face frame.
[0051] Next, the parameters of the shallow network in the detection network are fixed to stabilize the cropping and alignment operations on the feature information. After the shallow parameters of the detection network are fixed, the face images with the key points of the face are used as the alignment training data. These key points are used as the supervision signal to train the alignment network to perform cropping and alignment operations to output aligned face features.
[0052] After the detection and alignment networks have converged separately, in order to achieve the best overall performance, all parameters will be released and end-to-end joint training will be performed. Using data containing face images, face boxes, and alignment key points, the parameters of the detection network and the alignment network are optimized simultaneously until the model fully converges.
[0053] In the financial sector, accurately trained alignment detection models can be used in scenarios such as identity verification and anti-fraud. This ensures that the system can quickly and accurately recognize the user's face and perform identity verification, thereby enhancing the security and convenience of financial services.
[0054] Training the alignment detection model in steps not only helps improve the performance of the model, but also enhances its robustness in a variety of application environments. This training method enables the model to better adapt to different facial postures and expression changes, improving the accuracy and reliability of recognition.
[0055] Through these steps, the face recognition system can more accurately identify and align facial features, providing a solid foundation for the final feature extraction and matching.
[0056] In one embodiment, the alignment detection model detects the face image to be identified, and outputs face position information and alignment features according to the detection result, including:
[0057] Inputting the face image to be identified into a pre-extraction network, the pre-extraction network extracts features from the face image to be identified, and outputs feature information;
[0058] The feature information is input into a post-detection network, which analyzes the feature information and outputs face position information.
[0059] In this embodiment, the internal structure and functions of the alignment detection model involve three main networks: a pre-extraction network, a post-detection network, and an alignment network.
[0060] The function of the pre-extraction network is to extract the basic features of the image, such as edges, positions, etc., to provide necessary information for subsequent face detection and alignment operations. The network consists of a focus structure and a convolutional layer. It inputs the face image to be recognized and outputs feature information containing facial features, but does not distinguish between face and non-face images at this time.
[0061] The function of the post-detection network is to perform face detection based on the feature information f1 output by the pre-extraction network and output the location information of the face frame. The network consists of block1 and block2 of Res2Net18 (Residual Networks with Multi-scale TraversalBlocks, neural network architecture) and performs feature extraction. In order to improve the detection accuracy, a pyramid network is used for feature fusion, and GFL (Generalized Focal Loss) is used as the loss function to solve the problem of imbalance between positive and negative samples and enhance the robustness of the detection network. The output result is the face location information, including the coordinates of the upper left and lower right corners of the face frame.
[0062] Specifically, Res2Net is a neural network architecture that is an improved version of the traditional residual network (ResNet). That is, a residual network with a multi-scale traversal block. This architecture enhances the representation ability of the network by introducing the concept of multi-scale feature fusion. In Res2Net, the core component is the "Res2Net block", which allows for more fine-grained multi-scale feature extraction within the network. Specifically, the Res2Net block adds additional sub-networks to the traditional residual connection, which can capture features of different scales and fuse them together. Res2Net18 refers to a network that uses the Res2Net block and has a similar depth to ResNet-18. ResNet-18 is a classic residual network that contains 18 weight layers (excluding pooling and normalization layers). In Res2Net18, these weight layers are replaced with Res2Net blocks to enhance the network's multi-scale feature extraction capabilities.
[0063] By introducing multiple sub-networks in the Res2Net block, the network can extract features at different scales, which helps improve the recognition of objects of different sizes in the image. The fusion of multi-scale features helps the network learn richer representations, which is beneficial for various visual tasks such as image classification, object detection, and semantic segmentation. Despite the introduction of additional sub-networks, the design of Res2Net still maintains high computational efficiency, making it suitable for resource-constrained environments.
[0064] In one embodiment, the feature information and face position information are input into an alignment network, and the alignment network obtains alignment features according to the feature information and face position information.
[0065] In this embodiment, the function of the alignment network is to use the face position information output by the post-detection network to crop and align the feature information output by the pre-extraction network, and finally output the aligned face features. The network crops the face region features based on the face position information on the feature information, and performs a correction operation on the cropped face region features to put them in a standard posture. The output alignment features contain standardized features of the face, which are suitable for subsequent feature extraction and recognition.
[0066] Specifically, the face image to be recognized is input into the pre-extraction network, which processes the image and outputs key feature information; then, the feature information is passed to the post-detection network, which further processes the feature information to output the position information of the face; finally, the feature information and the face position information are input into the alignment network, which is processed and outputs standardized face alignment features. This process ensures accurate detection and alignment of face images, laying the foundation for subsequent face recognition tasks.
[0067] Furthermore, the alignment detection model is composed of a pre-extraction network and a post-detection network, and can be used alone as a face detection model to meet the detection requirements in the face system. Integrating face detection and alignment operations into one model simplifies the model structure and improves operating efficiency. Through the collaborative work of the three modules of the pre-extraction network, the post-detection network, and the alignment network, the model completes the detection, cropping, and alignment operations of the face image, and finally outputs the aligned face features, providing a solid foundation for subsequent face recognition and verification.
[0068] The alignment detection model adopts an end-to-end training method, which can better learn the relationship between face detection, cropping and alignment, and improve the performance and robustness of the model. The feature information output by the pre-extraction network is used by the post-detection network and the alignment network at the same time, realizing feature reuse and improving feature utilization. The structure of the alignment detection model is relatively simple, and the computational complexity is small, which can meet the needs of real-time face recognition. Training the alignment detection model requires a large number of datasets with annotated face images and alignment key points. The scale and quality of the dataset have a great impact on the performance of the model. Although the structure of the alignment detection model is relatively simple, as the complexity of the face detection and alignment tasks increases, the complexity of the model may also increase. The alignment detection model needs to accurately detect and align faces in different scenes and lighting conditions. The generalization ability of the model is crucial for practical applications.
[0069] The alignment detection model is an efficient face recognition technology with broad application prospects in various fields. With the continuous development of technology, the performance of the alignment detection model will continue to improve and its application scenarios will continue to expand.
[0070] In one embodiment, the inputting the feature information and the face position information into the alignment network, and the alignment network obtaining the alignment feature according to the feature information and the face position information, comprises:
[0071] Inputting the feature information and face position information into an alignment network;
[0072] The alignment network cuts the feature information according to the face position information to obtain face region features;
[0073] Performing face correction on the face region features to obtain alignment features.
[0074] In this embodiment, the feature information output by the pre-extraction network and the face position information provided by the post-detection network are first input into the alignment network. The alignment network uses this position information to crop the feature information in order to extract the regional features containing key face information. This process usually relies on position information such as the face frame to guide the cropping, ensuring that the extracted features correspond to the precise position of the face in the image and contain the key visual information necessary for face recognition.
[0075] The cropped facial region features are then subjected to a correction operation, a step designed to ensure the consistency of features under different postures and expressions, thereby improving recognition accuracy. The correction operation is usually implemented using a deformable convolutional network structure, which can dynamically adjust the convolution kernel according to the actual shape of the face to better adapt to the facial features. The facial region features are cropped from the feature information, excluding background information in order to focus on the face part. This step involves determining the exact location of key coordinate points of the face, such as the eyes, nose, and mouth, based on the face position information.
[0076] Based on these key coordinate points, the key areas of the face are determined, which usually include the areas around the eyes, nose and mouth. In this way, the features related to the face can be extracted more accurately. Although the extracted face area features contain the key features of the face, they may be affected by factors such as angle, expression, and lighting. In order to eliminate these effects, face correction operations are performed on the cropped face area features to make them reach the standard posture, thereby improving the robustness of the features.
[0077] Subsequently, the cropped and corrected facial region features are input into the deformable convolutional network. This network uses the facial position information to perform alignment correction operations, adjusts the position and shape of the convolution kernel to better extract facial features, and reduces interference from factors such as angle, expression, and lighting.
[0078] The features after correction are called alignment features. These features are standardized and normalized, and are very suitable for face recognition. Ultimately, these alignment features will be used as input to the recognition model for facial feature extraction and matching. Through a series of operations such as cropping and correction, the alignment network can effectively handle various changes in the face, provide high-quality input features for the recognition model, and ensure the efficiency and accuracy of the face recognition system.
[0079] Finally, the alignment features are obtained, which contain standardized representations of the face, such as face features in standard postures such as frontal, expressionless, and uniform lighting. Through the cropping and correction operations of the alignment network, the face image can be extracted and standardized from the original image, significantly improving the accuracy and robustness of face recognition.
[0080] In one embodiment, the alignment network cuts the feature information according to the face position information to obtain face region features, including:
[0081] Acquire key facial coordinate points according to the facial position information;
[0082] The key face area is determined according to the key face coordinate points, and the face area features of the key face area are extracted.
[0083] In this embodiment, in the face recognition system, accurately obtaining key coordinate points of the face is a key step in face alignment and feature extraction. These key coordinate points, including the position information of key parts such as eyes, nose, mouth, etc., are crucial for determining the shape and structure of the face and guide the subsequent feature extraction operation.
[0084] First, the face detection network is used to locate the face in the image and output the location information of the face frame. Then, the key point detection network further analyzes the detected face to accurately locate key feature points, such as the center of the eye, the tip of the nose, and the corners of the mouth. In addition, manual annotation methods can also be used to annotate these key parts in the face image.
[0085] The key areas of a face are the areas containing the main features such as eyes, nose, and mouth. Determining these areas helps focus on the key information of the face and achieve more accurate feature extraction. The bounding box or shape of the key areas of a face can be determined by the key coordinate points, for example, a rectangular box centered on the key coordinate points, or a triangular area with the eyes and nose tip as vertices.
[0086] Specifically, the bounding box or shape of the key areas of the face can be determined based on the key coordinate points. For example, a rectangular box containing key parts such as eyes, nose, and mouth is determined with the key coordinate points as the center. A triangular area containing the eyes, nose, and mouth is determined with the eyes and nose tips as vertices. The face can be segmented into different areas, such as the eye area, nose area, and mouth area, etc. by using face segmentation technology. Output the key areas of the face, such as the eye area, nose area, and mouth area, etc. Using face segmentation technology, the face can be segmented into different areas, such as the eye area, nose area, and mouth area, etc. The features of these key areas are extracted for more in-depth analysis and subsequent face recognition. Facial features include information such as shape, texture, and color, which are used to distinguish different faces.
[0087] On the feature map output by the pre-extraction network, the corresponding feature area is cropped according to the key area of the face, and feature extraction is performed on it, such as using a convolutional neural network (CNN) to extract deep features. This step may involve image processing technology. For example, an affine transformation, such as rotation, scaling, translation, etc., can be performed on the face image according to the key coordinate points of the face to ensure that the extracted features can accurately reflect the key information of the face.
[0088] Deformable convolutional networks play an important role in this process. They can adjust the position and shape of the convolution kernel according to the face position information, so as to better extract facial features and reduce the influence of factors such as angle, expression, and lighting.
[0089] The role of the alignment network is to align the key area features of the face to a standard posture, which helps to reduce the recognition error caused by changes in facial posture. The alignment network adjusts the extracted features according to the key coordinate points of the face to align them to a standard posture, such as frontal, expressionless, and evenly illuminated. The alignment network can use technologies such as deformable convolution and affine transformation to achieve correction of facial features. Affine transformation can perform affine transformations on facial images according to the key coordinate points of the face, such as rotation, scaling, and translation, to ensure that the extracted features can accurately reflect the key information of the face. Feature correction operations may include standardizing the mean and variance of the features, and normalizing the feature vectors.
[0090] In summary, through the precise processing of key coordinate points, key areas and feature extraction, we can better understand the role and working principle of the alignment network in the face recognition system, thereby improving the accuracy and robustness of the system.
[0091] In one embodiment, performing face correction on the face region features to obtain alignment features includes:
[0092] Inputting the facial region features into a deformable convolutional network;
[0093] The facial image is aligned and corrected according to the facial position information through a deformable convolutional network.
[0094] In this embodiment, in the alignment network, the correction operation is to use a deformable convolutional network structure to perform face correction operations. In traditional convolutional neural networks, the size and shape of the convolution kernel are preset and unchanged, which limits the network's ability to capture features when processing faces of different sizes, postures, and expressions. This fixedness leads to insufficient generalization of the network in the face of unknown changes. Traditional convolutional network calculation formula:
[0095]
[0096] Among them, y(p0) represents the output feature at position p0, p0 represents the position point currently processed by the deformable convolution, and p n is the area corresponding to the convolution kernel, w(p n ) represents the convolution kernel weight coefficient at the corresponding position, x is the input feature map, and y is the convolution output result at the corresponding position.
[0097] To solve this problem, deformable convolutional networks were introduced into face recognition systems. Deformable convolutional networks introduce an additional direction vector (offset or offset) on the basis of traditional convolution, so that the convolution kernel can dynamically adjust its shape and position according to the content of the input feature map. This adjustment allows the convolution kernel to better adapt to the characteristics of the face, regardless of how the face's posture and expression change. Deformable convolution is based on traditional convolution, adding a direction vector Δp to adjust the convolution kernel on the feature map. n :
[0098]
[0099] In the processing of feature maps, deformable convolution learns offsets by adding an additional 3×3 convolution layer. The number of output channels of this convolution layer is 2N, where N is the number of channels of the convolution kernel and 2 represents the offset in the x and y directions of each convolution kernel position. These offsets are applied to the original convolution kernel position through interpolation operations to achieve dynamic adjustment of the convolution kernel.
[0100] During the training process, the aligned faces are used as supervisory signals to guide the network to learn how to adjust the shape of the convolution kernel. The network offsets the convolution kernel point by point so that the shape of the convolution kernel fits the aligned facial features better, achieving more accurate face alignment.
[0101] Face alignment through deformable convolution helps improve the accuracy of face recognition because it ensures that the network can extract the most relevant and stable features regardless of how the face's posture and expression change. In general, the deformable convolutional network structure significantly improves the adaptability and generalization ability of the network to faces with different postures and expressions by dynamically adjusting the shape of the convolution kernel. The application of this technology in the alignment network enables the face recognition system to more accurately identify and align facial features, thereby improving the performance and reliability of the entire system.
[0102] Furthermore, Deformable Convolutional Networks is a new type of convolutional neural network that adds additional flexibility to standard convolutions, allowing the convolution kernel to shift the position of spatial sampling points on the input feature map.
[0103] Deformable convolution can adaptively adjust the sampling position according to the input features, which enables the network to better capture the shape and position information of the target. By offsetting the sampling points, deformable convolution can effectively handle the geometric transformation of objects, such as scale changes, rotations, deformations, etc., which has great advantages when processing multiple samples in the real world. Deformable convolution can learn more complex and sophisticated feature representations, which is especially important for tasks that require high-precision positioning (such as target detection, face recognition, etc.). Reduce dependence on anchor design: In target detection tasks, deformable convolution can reduce dependence on anchor design because it can directly learn the precise position of the target. Deformable convolution can effectively fuse features of different scales, which is very useful for processing multi-scale tasks with objects of different scales.
[0104] Deformable convolutional networks can be seamlessly integrated with existing deep learning frameworks and can be trained in an end-to-end manner, which makes the learning process of the entire network more efficient. Deformable convolutions can be easily embedded into existing convolutional neural networks without significantly modifying the network structure, which improves its versatility. In practical applications, the introduction of deformable convolutions often leads to performance improvements, especially when dealing with complex scenes and challenging tasks. Deformable convolutions reduce the need for manually designed feature extractors and geometric transformation invariance because the network can automatically learn these features.
[0105] In summary, the deformable convolutional network enhances the convolutional neural network's ability to model geometric transformations by introducing offsets in spatial sampling points, thereby showing significant performance advantages when processing complex visual tasks.
[0106] In one embodiment, matching the facial features to be identified with facial features in a facial database and outputting facial recognition matching results includes:
[0107] Calculating the similarity between the facial feature and each facial feature in the face database;
[0108] According to the similarity, facial features matching the facial features to be identified are selected from the face database, and the matching results are output.
[0109] In this embodiment, in the face recognition system, calculating the similarity between the face features to be recognized and the face features stored in the database is a key step in determining whether the two match. This process usually uses a specific similarity measurement algorithm, such as Euclidean distance, cosine similarity or Hamming distance, to quantify the difference between the two feature vectors.
[0110] The system compares the features of the face to be identified with the features of each face in the database and records the matches with the highest similarity. The similarity match threshold is a pre-set parameter that determines when two feature vectors can be considered similar enough to represent the same face.
[0111] When the calculated similarity exceeds or equals this matching threshold, the system will determine that the face to be identified successfully matches a feature in the database. This condition ensures that the system will only output a successful match result when the two feature vectors are close enough.
[0112] When the match is successful, the system will output the match results, which may include the matched identity information, similarity score, and other relevant data. If the match fails, that is, no features with a similarity exceeding the threshold are found, the system may prompt that no match was found or require further verification.
[0113] Setting the similarity matching threshold is an important part of system design, which requires balancing the recognition rate and the false recognition rate. A too low threshold may lead to an increase in the false recognition rate, while a too high threshold may lead to a decrease in the recognition rate. Therefore, accurate feature extraction, efficient matching algorithms, and reasonable threshold settings are essential to ensure the accuracy of the system and user trust.
[0114] In summary, the matching stage described in the document is the core component of the face recognition system, which confirms whether the face to be recognized corresponds to a known face in the database by calculating feature similarity and applying a matching threshold. This process requires high precision and careful design to ensure the overall performance and reliability of the system.
[0115] The present invention relates to the fields of image processing technology and financial technology, and discloses a face recognition method, which obtains a face image to be recognized and inputs the obtained image into an alignment detection model for processing. The alignment detection model outputs the position information of the face and the aligned features. The recognition model extracts the specific features of the face based on the alignment features and the face position information. The extracted face features are matched with the face features stored in a database to determine the identity of the face to be recognized. The present invention reduces the complexity of the model by reducing unnecessary modules or layers. It ensures that the features are effectively used in the model and reduces information redundancy. The processing speed of the system is improved by optimizing the algorithm and hardware acceleration. The accuracy of recognition is improved by improving the algorithm and model training.
[0116] In one embodiment, a face recognition device is provided, which corresponds one-to-one to the face recognition method in the above embodiment. Figure 3 , Figure 3This is a schematic diagram of the functional modules of a preferred embodiment of the face recognition device of the present invention, including an image acquisition module 101, an image processing module 102, an image recognition module 103 and an image matching module 104. The functional modules are described in detail as follows:
[0117] The image acquisition module 101 is used to acquire a face image to be identified and input the face image to be identified into the alignment detection model;
[0118] An image processing module 102 is used for detecting the face image to be identified by the alignment detection model, and outputting face position information and alignment features according to the detection result;
[0119] An image recognition module 103 is used to extract features from the alignment features and face position information using a recognition model to obtain features of the face to be recognized;
[0120] The image matching module 104 is used to match the facial features to be recognized with the facial features in the facial database and output the facial recognition matching result.
[0121] In one embodiment, the face recognition device further includes a model training module, which is specifically used to:
[0122] Acquire detection training data, and input the detection training data into the alignment detection model;
[0123] Training the detection network according to the detection training data until the detection network converges;
[0124] Fix the parameters of the detection network, input the detection training data into the detection network again for processing, and output feature information and face position information;
[0125] Acquire alignment training data, and train the alignment network according to the alignment training data, feature information, and face position information until the alignment network converges, thereby completing the training of the alignment detection model.
[0126] In one embodiment, the image processing module 102 includes:
[0127] A feature information unit, used for inputting the face image to be identified into a pre-extraction network, and having the pre-extraction network perform feature extraction on the face image to be identified, and outputting feature information;
[0128] A face position information unit, used to input the feature information into a post-detection network, and the post-detection network analyzes the feature information and outputs face position information;
[0129] The alignment feature unit is used to input the feature information and the face position information into the alignment network, and the alignment network obtains the alignment feature according to the feature information and the face position information.
[0130] In one embodiment, the image processing module 102 includes:
[0131] An information input unit, used to input the feature information and face position information into the alignment network;
[0132] A cutting unit, used for the alignment network to cut the feature information according to the face position information to obtain face area features;
[0133] The correction unit is used to perform face correction on the face area features to obtain alignment features.
[0134] In one embodiment, the cutting unit specifically includes:
[0135] Acquire key facial coordinate points according to the facial position information;
[0136] The key face area is determined according to the key face coordinate points, and the face area features of the key face area are extracted.
[0137] In one embodiment, the correction unit specifically includes:
[0138] Inputting the facial region features into a deformable convolutional network;
[0139] The facial image is aligned and corrected according to the facial position information through a deformable convolutional network.
[0140] In one embodiment, the image matching module 104 includes:
[0141] A similarity unit, used to calculate the similarity between the facial feature and each facial feature in the face database;
[0142] The matching unit is used to select the facial features that match the facial features to be identified in the face database according to the similarity, and output the matching results.
[0143] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external user terminal through a network connection. When the computer program is executed by the processor, it implements a function or step on the server side of a face recognition method.
[0144] In one embodiment, a computer device is provided. The computer device may be a user terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external server via a network connection. When the computer program is executed by the processor, it implements a function or step on the user side of a face recognition method
[0145] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0146] Obtaining a face image to be identified, and inputting the face image to be identified into an alignment detection model;
[0147] The alignment detection model detects the face image to be identified, and outputs face position information and alignment features according to the detection result;
[0148] The recognition model extracts features from the alignment features and the face position information to obtain features of the face to be recognized;
[0149] The facial features to be identified are matched with the facial features in a face database, and a face recognition matching result is output.
[0150] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0151] Obtaining a face image to be identified, and inputting the face image to be identified into an alignment detection model;
[0152] The alignment detection model detects the face image to be identified, and outputs face position information and alignment features according to the detection result;
[0153] The recognition model extracts features from the alignment features and the face position information to obtain features of the face to be recognized;
[0154] The facial features to be identified are matched with the facial features in a face database, and a face recognition matching result is output.
[0155] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant descriptions on the server side and the user side in the aforementioned method embodiment. To avoid repetition, they will not be described one by one here.
[0156] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0157] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0158] It should be noted that if software tools or components other than those of the Company appear in the embodiments of the present application, they are only used for illustration and do not represent actual use. The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the above-mentioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents; and these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A face recognition method, characterized in that: The following steps are involved: Obtaining a face image to be identified, and inputting the face image to be identified into an alignment detection model; The alignment detection model detects the face image to be identified, and outputs face position information and alignment features according to the detection result; The recognition model extracts features from the alignment features and the face position information to obtain features of the face to be recognized; The facial features to be identified are matched with the facial features in a face database, and a face recognition matching result is output.
2. The face recognition method according to claim 1, characterized in that: The alignment detection model detects the face image to be identified, and before outputting face position information and alignment features according to the detection result, the method further includes: Acquire detection training data, and input the detection training data into the alignment detection model; Training the detection network according to the detection training data until the detection network converges; Fix the parameters of the detection network, input the detection training data into the detection network again for processing, and output feature information and face position information; Acquire alignment training data, and train the alignment network according to the alignment training data, feature information, and face position information until the alignment network converges, thereby completing the training of the alignment detection model.
3. The face recognition method according to claim 1, characterized in that: The alignment detection model detects the face image to be identified, and outputs face position information and alignment features according to the detection result, including: Inputting the face image to be identified into a pre-extraction network, the pre-extraction network extracts features from the face image to be identified, and outputs feature information; Inputting the feature information into a post-detection network, the post-detection network analyzes the feature information and outputs face position information; The feature information and face position information are input into an alignment network, and the alignment network obtains alignment features according to the feature information and face position information.
4. The face recognition method according to claim 3, characterized in that: The step of inputting the feature information and the face position information into an alignment network, and obtaining alignment features according to the feature information and the face position information by the alignment network, comprises: Inputting the feature information and face position information into an alignment network; The alignment network cuts the feature information according to the face position information to obtain face region features; Performing face correction on the face region features to obtain alignment features.
5. The face recognition method according to claim 4, characterized in that: The alignment network cuts the feature information according to the face position information to obtain face region features, including: Acquire key facial coordinate points according to the facial position information; The key face area is determined according to the key face coordinate points, and the face area features of the key face area are extracted.
6. The face recognition method according to claim 4, characterized in that: The performing face correction on the face region features to obtain alignment features includes: Inputting the facial region features into a deformable convolutional network; The facial image is aligned and corrected according to the facial position information through a deformable convolutional network.
7. The face recognition method according to claim 1, characterized in that: The step of matching the face features to be identified with the face features in a face database and outputting the face recognition matching result includes: Calculating the similarity between the facial feature and each facial feature in the face database; According to the similarity, facial features matching the facial features to be identified are selected from the face database, and the matching results are output.
8. A face recognition device, characterized in that: The face recognition device comprises: An image acquisition module is used to acquire a face image to be identified and input the face image to be identified into an alignment detection model; An image processing module, used for the alignment detection model to detect the face image to be identified, and output face position information and alignment features according to the detection result; An image recognition module is used to extract features of the alignment features and face position information by a recognition model to obtain features of the face to be recognized; The image matching module is used to match the facial features to be identified with the facial features in the face database and output the facial recognition matching results.
9. A computer device, characterized in that: The computer device includes a memory, a processor, and a face recognition program stored in the memory and executable on the processor. When the face recognition program is executed by the processor, the steps of the face recognition method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The storage medium stores a face recognition program, and when the face recognition program is executed by the processor, the steps of the face recognition method according to any one of claims 1 to 7 are implemented.