Face recognition method and device, electronic equipment and storage medium
By calculating the confidence level of the input feature map and extracting region and relation features in the face recognition model, the problems of poor feature extraction effect and large computational load in the existing technology are solved, and high-quality face recognition and improved recognition rate are achieved.
Patent Information
- Application Number
- CN202310158924.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-13
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-02-13
AI Technical Summary
Existing face recognition models have poor feature extraction performance and high computational cost, resulting in poor recognition performance and limited application scenarios.
By acquiring the input feature map of the image to be recognized, the confidence level of each location belonging to each region is calculated, and feature extraction is performed under the guidance of the confidence level. Region convolution and graph convolution are used to extract the relationship features between regions, and an enhanced feature map is generated for face recognition.
It achieves high-quality face recognition, reduces computational load, and improves the accuracy and recognition rate of feature extraction, making it suitable for electronic devices with stringent computational requirements.
Smart Images

Figure CN116246323B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of facial recognition technology, and more particularly to a facial recognition method, device, electronic device, and storage medium. Background Technology
[0002] Currently, face recognition algorithms are usually implemented using face recognition models. The training of these models uses loss functions, backbones, and datasets. Existing technologies mainly focus on the design of loss functions. In fact, improvements to either the model or the loss function can enhance the network's performance.
[0003] However, existing feature extraction methods result in significant differences in convolution operations between different samples, leading to large computational costs that significantly hinder parallel computing. Furthermore, inaccurate feature extraction results in poor performance of face recognition models and limited application scenarios.
[0004] Therefore, there is an urgent need for a face recognition method that has good feature extraction performance and low computational cost. Summary of the Invention
[0005] The embodiments of the present invention provide a face recognition method, device, electronic device, and storage medium to solve the problems of poor feature extraction effect and large computational load in related technologies.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] According to one aspect of the present invention, a face recognition method is provided, the method comprising: acquiring an input feature map of an image to be recognized, and calculating the confidence score of each position in the input feature map belonging to a region in the input feature map; under the guidance of the confidence score, performing feature extraction on each region in the input feature map to obtain a region feature map; obtaining an output feature map by performing region convolution on the region feature map; extracting the relationship features between the regions in the output feature map using graph convolution to obtain a relationship feature map, and calculating an enhanced feature map based on the output feature map and the relationship feature map; and performing face recognition on the image to be recognized based on the enhanced feature map to obtain a face recognition result.
[0008] In an exemplary embodiment, calculating the confidence that each position in the input feature map belongs to each region in the input feature map includes: convolving the input feature map with a convolution kernel to obtain the weight of each region in the input feature map, adjusting the parameters of the activation function SoftMax according to the weight; and using the activation function SoftMax to calculate the probability that each position in the input feature map belongs to each region, as the confidence that each position in the input feature map belongs to each region.
[0009] In an exemplary embodiment, obtaining an output feature map from a region feature map through region convolution includes: using the ArgMax function to find the position with the highest confidence in each region in the region feature map; using the convolution kernel corresponding to each region to extract features from the found position to obtain the features of each region, thus forming the output feature map.
[0010] In one exemplary embodiment, the method further includes: obtaining an output feature map by performing region convolution on the region feature map, and then using confidence to spatially split the output feature map to obtain a dimension-reduced output feature map.
[0011] In an exemplary embodiment, extracting the relationship features between regions in the output feature map using graph convolution to obtain a relationship feature map includes: extracting the features between regions in the output feature map using a first convolution kernel in graph convolution to obtain a first feature map; adding the output feature map to the first feature map to obtain a second feature map; and extracting the features of the second feature map using a second convolution kernel in graph convolution to obtain the relationship feature map.
[0012] In an exemplary embodiment, calculating the enhanced feature map based on the output feature map and the relation feature map includes: adding the output feature map and the relation feature map to obtain the enhanced feature map.
[0013] In one exemplary embodiment, the face recognition is implemented by invoking a face recognition model, which is a trained machine learning model capable of performing face recognition on the image to be recognized.
[0014] According to one aspect of the present invention, a face recognition device includes: a confidence acquisition module, configured to extract the weight of each region in an input feature map to obtain the confidence that each position in the input feature map belongs to each region in the input feature map; a region feature extraction module, configured to extract features from each region in the input feature map under the guidance of the confidence, to obtain a region feature map; an output feature extraction module, configured to obtain an output feature map by performing region convolution on the region feature map; an enhanced feature map generation module, configured to extract the relationship features between each region using graph convolution based on the output feature map to obtain a relationship feature map, and calculate an enhanced feature map based on the output feature map and the relationship feature map; and a face recognition module, configured to perform face recognition on the image to be recognized based on the enhanced feature map to obtain a face recognition result.
[0015] According to one aspect of the present invention, an electronic device includes a processor and a memory, wherein the memory stores computer-readable instructions, which, when executed by the processor, implement the face recognition method as described above.
[0016] According to one aspect of the present invention, a storage medium having a computer program stored thereon, which, when executed by a processor, implements the face recognition method as described above.
[0017] According to one aspect of the present invention, a computer program product includes a computer program stored in a storage medium, a processor of a computer device reads the computer program from the storage medium, and the processor executes the computer program, causing the computer device to implement the face recognition method as described above when executed.
[0018] In the above technical solution, the present invention realizes a face recognition method with good feature extraction effect and low computational load.
[0019] Specifically, this invention first obtains the input feature map of the image to be recognized, calculates the confidence score of each position in the input feature map belonging to each region in the input feature map, and then extracts features from each region in the input feature map under the guidance of the confidence score to obtain a region feature map. The region feature map is then convolved with a region to obtain an output feature map. Graph convolution is then used to extract the relationship features between the regions in the output feature map to obtain a relationship feature map. An enhanced feature map is then calculated based on the output feature map and the relationship feature map, thus achieving accurate feature extraction. Face recognition is then performed on the image to be recognized based on the enhanced feature map, reducing the amount of data and enabling high-quality face recognition.
[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0022] Figure 1 This is a schematic diagram of the implementation environment involved in this application.
[0023] Figure 2 This is a flowchart illustrating a face recognition method according to an exemplary embodiment;
[0024] Figure 3 This is a schematic diagram illustrating a face recognition method according to an exemplary embodiment;
[0025] Figure 4 yes Figure 3 A schematic diagram of convolution in the corresponding embodiment;
[0026] Figure 5This is a comparison diagram of the effects of an exemplary embodiment in an application scenario with existing technologies;
[0027] Figure 6 This is a block diagram illustrating a face recognition device according to an exemplary embodiment;
[0028] Figure 7 This is a schematic diagram of the structure of a terminal according to an exemplary embodiment;
[0029] Figure 8 This is a hardware structure diagram of an electronic device according to an exemplary embodiment;
[0030] Figure 9 This is a block diagram illustrating an electronic device according to an exemplary embodiment.
[0031] The accompanying drawings have illustrated specific embodiments of the present invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the inventive concept in any way, but rather to illustrate the concept of the invention to those skilled in the art by referring to specific embodiments. Detailed Implementation
[0032] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0033] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0034] Existing technologies mainly focus on the design of loss functions, while exploration of model structure is less common. In fact, improvements to any part of the model or loss function can enhance network performance.
[0035] In addition, the concept of dynamic convolution has emerged in the field of image classification. The aim is to change the convolution kernel used by the model according to different input samples, thereby improving the model's classification ability with comparable computational cost. This involves dividing the samples into different regions and using different convolutions to extract features, which can achieve a significant improvement.
[0036] In other words, existing technologies use specific convolution kernels for targeted feature extraction, resulting in significant differences in convolution kernels between different samples. This leads to a large computational load, which greatly hinders parallel computing. Furthermore, the feature extraction is inaccurate, resulting in poor performance of face recognition models and a narrow range of application scenarios.
[0037] As can be seen from the above, the relevant technologies still have shortcomings such as poor feature extraction effect and large computational load.
[0038] To this end, the face recognition method provided in this application first obtains the input feature map of the image to be recognized, and calculates the confidence score of each position in the input feature map belonging to each region. Guided by the confidence score, features are extracted from each region in the input feature map to obtain a region feature map. The region feature map is then subjected to region convolution to obtain an output feature map. Graph convolution is used to extract the relationship features between regions in the output feature map to obtain a relationship feature map. An enhanced feature map is calculated based on the output feature map and the relationship feature map. Face recognition is then performed on the image to be recognized based on the enhanced feature map to obtain the face recognition result. This method can accurately extract features, reduce the amount of data in the face recognition process, and thus achieve high-quality face recognition. Accordingly, this face recognition method is applicable to face recognition devices, which can be deployed on electronic devices, such as computer devices with a von Neumann architecture, such as desktop computers, laptops, servers, etc. Furthermore, since the face recognition method provided by this invention has a relatively small computational load, the face recognition device can also be deployed on electronic devices with strict computational requirements, such as smartphones, tablets, and other mobile devices.
[0039] Figure 1 This is a schematic diagram of an implementation environment for a face recognition method. The implementation environment includes a user terminal 110, a data acquisition terminal 130, a gateway 150, a server 170, and a router 190.
[0040] Specifically, user terminal 110 can be an electronic device such as a smartphone, tablet, laptop, or desktop computer, without any limitation.
[0041] The acquisition terminal 130 is used to acquire the image to be recognized. For example, the acquisition terminal 130 can be an electronic device with image acquisition function, such as a camera or camcorder. The acquisition terminal 130 can also be an electronic device equipped with a camera. For example, the electronic device can be a user terminal 110 with image acquisition function, such as a smartphone or tablet computer.
[0042] The interaction between server 170, acquisition terminal 130, and user terminal 110 can be achieved through a local area network (LAN) or a wide area network (WAN). In one application scenario, server 170 establishes a wired or wireless communication connection with gateway 150 via router 190. This connection could include, but is not limited to, Wi-Fi, allowing server 170 and gateway 150 to be deployed on the same LAN. This enables acquisition terminal 130 and user terminal 110 to interact with server 170 via the LAN. This LAN may include, but is not limited to, ZigBee, Bluetooth, or Wi-Fi. In another application scenario, a wired or wireless communication connection is established between the server 170 and the acquisition terminal 130 or the user terminal 110. For example, the wired or wireless connection includes, but is not limited to, 2G, 3G, 4G, 5G, and WIFI. This allows the server 170 and the acquisition terminal 130 or the user terminal 110 to be deployed on the same wide area network, thereby enabling the server 170 to interact with the acquisition terminal 130 or the user terminal 110 through the wide area network path.
[0043] The server-side component 170 can be a single server, a server cluster consisting of multiple servers, or a cloud platform, cloud computing center, etc., composed of multiple servers, to better provide backend services. For example, backend services include facial recognition services.
[0044] In one application scenario, taking the server 170 providing face recognition service as an example, after the acquisition terminal 130 obtains the image to be recognized, it sends the image to the server 170. Then, the server 170 can receive the image to be recognized sent by the acquisition terminal 130 and provide face recognition service based on the image.
[0045] In another application scenario, taking face recognition provided by user terminal 170 as an example, user terminal 170 itself has image acquisition function. So, after user terminal 170 acquires the image to be recognized, it can calculate the confidence of each position in the input feature map of the image to be recognized belonging to each region in the input feature map. Guided by the confidence, feature map regions are generated for each region in the input feature map to obtain region feature maps. Then, region convolution is performed on the region feature maps to obtain the output feature map. Then, graph convolution is used to extract the relationship features between each region in the output feature map to obtain the relationship feature map. An enhanced feature map is calculated based on the output feature map and the relationship feature map. Finally, face recognition is performed on the image to be recognized based on the enhanced feature map to obtain the face recognition result.
[0046] Please see Figure 2 This application provides a face recognition method applicable to electronic devices, such as desktop computers, laptops, servers, and mobile devices like smartphones and tablets.
[0047] In the following method embodiments, for ease of description, the execution subject of each step of the method is an electronic device, but this does not constitute a specific limitation.
[0048] like Figure 2 As shown, the method may include the following steps:
[0049] Step 110: Obtain the input feature map of the image to be recognized, and calculate the confidence level of each position in the input feature map belonging to each region.
[0050] The image to be identified can be captured by a camera. The camera can be an electronic device with image capture capabilities, such as a camera or a smartphone with a webcam. Capture can be a single shot (resulting in a photograph) or multiple shots (resulting in a video). Therefore, the image to be identified can be any frame from the video or a photograph.
[0051] Regarding the acquisition of the image to be recognized, the image can originate from images captured and acquired in real time by the acquisition terminal, or it can be images captured and acquired by the acquisition terminal within a historical time period and pre-stored in the electronic device. Therefore, for the electronic device, after capturing and acquiring the image to be recognized, it can process the image in real time, or it can pre-store it for later processing. For example, it can process the image when the CPU of the electronic device is low, or it can process the image according to the instructions of the staff. Thus, the face recognition in this embodiment can be based on images acquired in real time or images acquired within a historical time period; no specific limitation is made here.
[0052] The input feature map refers to the feature map obtained after convolution operation on each pixel in the image to be recognized.
[0053] The position in the input feature map refers to the location of each pixel in the input feature map.
[0054] The regions in the input feature map refer to the semantic regions in the image to be identified. Taking a face image as an example, the semantic regions in the face image include, but are not limited to, eyes, nose, mouth, hair, etc.
[0055] In one possible implementation, step 110 may include the following steps: convolving the input feature map with a convolution kernel to obtain the weight of each region in the input feature map, adjusting the parameters of the activation function SoftMax according to the weight; and using the activation function SoftMax to calculate the probability that each position in the input feature map belongs to each region, as the confidence level that each position in the input feature map belongs to each region.
[0056] Step 130: Guided by the confidence level, extract features from each region in the input feature map to obtain the region feature map.
[0057] Specifically, for each location in the input feature map space, each region has a corresponding confidence level. Multiple convolutional kernels are used to extract features from these regions to obtain a complete region feature map.
[0058] Through the above process, guided by confidence, the present invention can extract features from each region more effectively, thereby improving the feature extraction effect and thus improving the accuracy of face recognition.
[0059] Step 150: The output feature map is obtained by performing region convolution on the region feature map.
[0060] Region convolution refers to using convolution kernels for each region to extract features from each location within that region.
[0061] Specifically, step 150 may include the following steps:
[0062] Step S1: Use the ArgMax function to find the location with the highest confidence in each region in the region feature map;
[0063] Step S2: Use the convolution kernels corresponding to each region to extract features from the found locations, obtain the features of each region, and form the output feature map.
[0064] One possible implementation is to find the region with the highest confidence and then use the convolution kernel of that region to extract features from that location. Since each region only needs to process the features within its own region, and the total area of these regions is equal to the spatial size of the original features, the total computational cost is the same as that of standard convolution. This improves the accuracy of feature extraction without increasing the computational cost.
[0065] As can be seen from the above, the embodiments of the present invention first use a convolutional kernel to adaptively extract corresponding regions from different samples, such as eyes, hair, and background. For these regions, we first use ordinary convolution for feature extraction. Unlike standard convolution, each convolution only processes the features of the current region, adopting a divide-and-conquer approach to improve the feature extraction effect and achieve better feature extraction.
[0066] Step 170: Use graph convolution to extract the relationship features between regions in the output feature map to obtain the relationship feature map, and calculate the enhanced feature map based on the output feature map and the relationship feature map.
[0067] The relationship characteristics between different regions refer to the characteristics between different regions in the output feature map.
[0068] Specifically, step 170 may include the following steps:
[0069] Step S1: Use the first convolution kernel in graph convolution to extract the features between regions in the output feature map to obtain the first feature map;
[0070] Step S2: Add the output feature map to the first feature map to obtain the second feature map;
[0071] Step S3: Use the second convolution kernel in graph convolution to extract features from the second feature map to obtain the relation feature map.
[0072] In this approach, graph convolution is used to extract features between different regions. These features can help the model to segment regions when faced with difficult samples, thereby improving the accuracy of face recognition.
[0073] Of course, the extraction of relationship features between regions is not limited to graph convolution. In other embodiments, the extraction of relationship features between regions also includes, but is not limited to, transformers, self-attention, etc., which are not intended to constitute a specific limitation.
[0074] Step 190: Perform face recognition on the image to be recognized based on the enhanced feature map to obtain the face recognition result.
[0075] In one possible implementation, the face recognition process includes: comparing the enhanced feature map with feature maps corresponding to multiple identities in the face database one by one, finding the feature map with the highest similarity to the enhanced feature map, comparing the highest similarity with a preset threshold, and if the highest similarity is greater than the preset threshold, a face recognition result is obtained. This face recognition result is used to indicate that the face recognition was successful, that is, the identity corresponding to the found feature map is used as the identity of the face in the image to be recognized; otherwise, a face recognition result is obtained, which is used to indicate that the face recognition failed, that is, the identity of the face in the image to be recognized was not found in the face database.
[0076] This invention first uses a convolutional kernel to adaptively extract corresponding regions from different samples, such as eyes, hair, and background. For these regions, we first use ordinary convolution for feature extraction. Unlike standard convolution, each convolution only processes the features of the current region. Then, we use graph convolution to extract the relationship between different regions and add this relationship to the original features, which plays an enhancement role and can more effectively distinguish difficult samples.
[0077] Through the above process, this embodiment of the invention first obtains the input feature map of the image to be recognized, calculates the confidence score of each position in the input feature map belonging to each region in the input feature map, and then extracts features from each region in the input feature map under the guidance of the confidence score to obtain a region feature map. The region feature map is then convolved with a region to obtain an output feature map. Graph convolution is then used to extract the relationship features between each region in the output feature map to obtain a relationship feature map. An enhanced feature map is then calculated based on the output feature map and the relationship feature map, thus achieving accurate feature extraction. Face recognition is then performed on the image to be recognized based on the enhanced feature map, reducing the amount of data and enabling high-quality face recognition.
[0078] Figure 3 and Figure 4 A schematic diagram of the structure of a face recognition model in one embodiment is shown. Figure 3First, the input feature map of the image to be recognized is obtained. Then, a 1x1 convolution kernel is used to obtain the confidence score of each position belonging to a certain region. Next, multiple ordinary convolutions are used to extract features from these regions, resulting in region feature maps. Specifically, ArgMax is used to find the region with the highest confidence score, and then the convolution kernel for that region is used to extract features from that position. After the above region convolutions, the output feature map is obtained. Then, graph convolution is used to extract features between regions, resulting in a relational feature map. Here, a simplified graph convolution containing only two one-dimensional convolutions is used. The specific structure of the graph convolution is shown in [link to graph convolution structure]. Figure 4 The resulting relational feature map is added to the output feature map obtained through region convolution to obtain an enhanced feature map, which is then used as the output feature map of this module. Figure 4 In the graph convolution, the first 1x1 convolution kernel is used to extract the features between regions in the output feature map to obtain the first feature map; the output feature map is added to the first feature map to obtain the second feature map; the second 1x1 convolution kernel is used to extract the features of the second feature map to obtain the relation feature map.
[0079] Now combined Figure 3 and Figure 4 The training process of the face recognition model is explained in detail below:
[0080] In one exemplary embodiment, face recognition is implemented by invoking a face recognition model, which is a trained machine learning model capable of performing face recognition on the image to be recognized. This machine learning model includes, but is not limited to, MobileFaceNets, ResNet, etc.
[0081] Specifically, the training process for a face recognition model includes the following steps:
[0082] Step S1: Obtain the dataset for training.
[0083] The dataset contains facial images with labels that indicate the identity of the person represented by the face. In other words, the labels are used to indicate the real identity of the person in the facial image.
[0084] Step S2: Use a machine learning model to perform face recognition on the current face image in the dataset to obtain the face recognition result.
[0085] The machine learning model can be MobileFaceNets, ResNet, etc., which can be considered as the initial face recognition model.
[0086] The face recognition results are used to indicate the predicted identity of the face in the predicted face image.
[0087] Step S3: Calculate the difference between the real identity indicated by the label and the predicted identity indicated by the face recognition result using a loss function to obtain the loss value.
[0088] The loss functions include, but are not limited to, SphereFace, CosFace, and ArcFace, etc., without being specified here.
[0089] If the loss value does not meet the convergence condition, the parameters of the machine learning model are updated, and the process returns to step S2. The updated machine learning model is then used to perform face recognition on the next face image in the dataset until the loss value meets the convergence condition.
[0090] Conversely, if the loss value meets the convergence condition, then the training is complete, and the face recognition model is obtained by the convergence of the machine learning model.
[0091] It should be noted that the convergence condition can be flexibly set according to the actual needs of the application scenario. For example, the convergence condition can be that the loss value reaches the minimum, so as to fully guarantee the accuracy of model training and thus the accuracy of face recognition. Alternatively, the convergence condition can be that the number of iterations reaches a set threshold, so as to improve the speed of model training. There is no limitation here.
[0092] Therefore, through the above training process, a face recognition model capable of performing face recognition on the image to be recognized can be obtained.
[0093] Specifically, replacing the ordinary convolutions in some commonly used face recognition models, such as MobileFaceNets and ResNet, with the present invention can achieve better results. In addition, the present invention can also achieve good results when using various loss functions, such as SphereFace, CosFace and ArcFace, without requiring any pre-training.
[0094] In addition, compared with some existing face recognition methods that involve extracting features through relationships, such as transformers and self-attention, the graph convolution used in this invention has a smaller computational cost, comparable to standard convolution. Therefore, the increased computational cost is small, comparable to the basic model, achieving significant growth on multiple face test sets while maintaining a small computational cost.
[0095] As can be seen from the above, the present invention has a more obvious effect on small models. These small models are usually applied to scenarios with strict requirements for computation, such as mobile devices. Such scenarios have strict requirements for computation, but less so for parameters. Therefore, the present invention is particularly effective for such scenarios.
[0096] Specifically, such as Figure 4As shown, the graph convolution contains two one-dimensional convolutions, using the features of each region as nodes of the graph convolution. The graph convolution used in this invention has a small computational cost, so the increased computational cost is small and comparable to the basic model. However, it can achieve a significant increase on multiple face test sets, thus improving the quality of face recognition while reducing the computational cost.
[0097] This invention first uses a convolutional kernel to adaptively extract corresponding regions from different samples, such as eyes, hair, and background. For these regions, we first use ordinary convolution for feature extraction. Unlike standard convolution, each convolution only processes the features of the current region. Then, we use graph convolution to extract the relationship between different regions and add this relationship to the original features, which plays an enhancement role and can more effectively distinguish difficult samples.
[0098] Through the above process, this embodiment of the invention first obtains the input feature map of the image to be recognized, calculates the confidence score of each position in the input feature map belonging to each region in the input feature map, and then extracts features from each region in the input feature map under the guidance of the confidence score to obtain a region feature map. The region feature map is then convolved with a region to obtain an output feature map. Graph convolution is then used to extract the relationship features between each region in the output feature map to obtain a relationship feature map. An enhanced feature map is then calculated based on the output feature map and the relationship feature map, thus achieving accurate feature extraction. Face recognition is then performed on the image to be recognized based on the enhanced feature map, reducing the amount of data and enabling high-quality face recognition.
[0099] The present invention has been subjected to a large number of experiments on a general face dataset. Specifically, the performance of a certain embodiment and various existing technologies on different datasets is shown in Table 1.
[0100] Table 1. Performance of the embodiments of the present invention and various prior technologies on different datasets.
[0101]
[0102] Based on the performance of the embodiments of the present invention and various prior art on different datasets shown in Table 1, the present invention achieves the highest scores in all metrics. Therefore, the present invention has reached a state-of-the-art level in the face recognition task. It should be noted that different datasets refer to combinations of different training sets and different test sets.
[0103] Figure 5 The diagram shows a comparison of the effects of the embodiments of this application with the prior art in various application scenarios. Ours represents the region division result of the present invention, and the regions include eyes, hair, background, etc. It can be clearly observed that the region division result of the present invention has the highest accuracy in various application scenarios.
[0104] The following are embodiments of the apparatus described in this application, which can be used to execute the face recognition method involved in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the method embodiments of the face recognition method involved in this application.
[0105] Please see Figure 6 In one exemplary embodiment, a face recognition device 600 is provided.
[0106] The device 600 includes, but is not limited to: a confidence acquisition module 610, a region feature extraction module 630, an output feature extraction module 650, an enhanced feature map generation module 670, and a face recognition module 650.
[0107] The confidence acquisition module 610 is used to extract the weight of each region in the input feature map and obtain the confidence of each position in the input feature map belonging to each region.
[0108] The region feature extraction module 630 is used to extract features from each region in the input feature map under the guidance of confidence level, so as to obtain the region feature map.
[0109] The output feature extraction module 650 is used to obtain the output feature map from the region feature map through region convolution.
[0110] The enhanced feature map generation module 670 is used to extract the relationship features between regions from the output feature map using graph convolution to obtain the relationship feature map, and to calculate the enhanced feature map based on the output feature map and the relationship feature map.
[0111] The face recognition module 690 is used to perform face recognition on the image to be recognized based on the enhanced feature map, and obtain the face recognition result.
[0112] It should be noted that the face recognition device provided in the above embodiments is only illustrated by the division of the above functional modules when performing face recognition. In actual applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the face recognition device will be divided into different functional modules to complete all or part of the functions described above.
[0113] Furthermore, the face recognition device and face recognition method embodiments provided in the above embodiments belong to the same concept, and the specific way in which each module performs operations has been described in detail in the method embodiments, and will not be repeated here.
[0114] Please see Figure 7 , Figure 7 This is a schematic diagram illustrating the structure of a terminal according to an exemplary embodiment. The terminal is suitable for… Figure 1 The user terminal 110 in the implementation environment is shown.
[0115] It should be noted that this terminal is merely an example adapted to this application and should not be construed as providing any limitation on the scope of use of this application. Furthermore, this terminal should not be interpreted as requiring or depending on any specific feature. Figure 7 One or more components of the exemplary terminal 1100 shown.
[0116] like Figure 7 As shown, terminal 1100 includes memory 101, memory controller 103, and one or more ( Figure 7 (Only one is shown) Processor 105, peripheral interface 107, radio frequency module 109, positioning module 111, camera module 113, audio module 115, touch screen 117, and button module 119. These components communicate with each other through one or more communication buses / signal lines 121.
[0117] The memory 101 can be used to store computer programs and modules, such as the computer programs and modules corresponding to the information recommendation method and apparatus in the exemplary embodiments of this application. The processor 105 executes various functions and data processing by running the computer programs stored in the memory 101, that is, it completes the face recognition method.
[0118] The memory 101, as a carrier for resource storage, can be random access memory, such as high-speed random access memory, non-volatile memory, such as one or more magnetic storage devices, flash memory, or other solid-state memory. The storage method can be temporary storage or permanent storage.
[0119] The peripheral interface 107 may include at least one wired or wireless network interface, at least one serial-to-parallel conversion interface, at least one input / output interface, and at least one USB interface, etc., for coupling various external input / output devices to the memory 101 and the processor 105 to realize communication with various external input / output devices.
[0120] The radio frequency module 109 is used to transmit and receive electromagnetic waves, realizing the mutual conversion between electromagnetic waves and electrical signals, thereby enabling communication with other devices through a communication network. The communication network includes cellular telephone networks, wireless local area networks, or metropolitan area networks, and these communication networks can use various communication standards, protocols, and technologies.
[0121] The positioning module 111 is used to obtain the current geographical location of the terminal 1100. Examples of positioning modules 111 include, but are not limited to, Global Positioning System (GPS), positioning technologies based on wireless local area networks or mobile communication networks.
[0122] The camera module 113 is part of the camera and is used to capture pictures or videos. The captured pictures or videos can be stored in the memory 101 or transmitted to the host computer via the radio frequency module 109.
[0123] The audio module 115 provides an audio interface to the user, which may include one or more microphone jacks, one or more speaker jacks, and one or more headphone jacks. Audio data is exchanged with other devices through the audio interface. Audio data can be stored in the memory 101 and can also be transmitted via the radio frequency module 109.
[0124] The touchscreen 117 provides an input / output interface between the terminal 1100 and the user. Specifically, the user can perform input operations through the touchscreen 117, such as clicking, touching, and swiping gestures, so that the terminal 1100 can respond to the input operations. The terminal 1100 then displays the output content, which can be text, images, or videos in any form or combination thereof, to the user through the touchscreen 117.
[0125] The button module 119 includes at least one button, providing an interface for users to input information into the terminal 1100. Users can press different buttons to enable the terminal 1100 to perform different functions. For example, the volume adjustment button allows users to adjust the volume of the sound played by the terminal 1100.
[0126] Understandable. Figure 7 The structure shown is for illustrative purposes only; the terminal 1100 may also include components that are more advanced than those shown. Figure 7 The more or fewer components shown, or having the same Figure 7 The different components are shown. Figure 7 The components shown can be implemented using hardware, software, or a combination thereof.
[0127] Figure 8 A schematic diagram of the structure of a server is shown according to an exemplary embodiment. This server is suitable for... Figure 1 The server-side configuration 170 in the implementation environment is shown.
[0128] It should be noted that this server is merely an example adapted to this application and should not be construed as providing any limitation on the scope of use of this application. Nor should this server be interpreted as requiring or depending on any specific feature. Figure 8 One or more components of the exemplary server 2000.
[0129] The hardware architecture of Server 2000 can vary significantly due to differences in configuration or performance, such as... Figure 8 As shown, the server 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.
[0130] Specifically, power supply 210 is used to provide operating voltage for the various hardware devices on server 2000.
[0131] Interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. For example, in Figure 1 The diagram illustrates the interaction between the server 170, the acquisition terminal 130, and the user terminal 110 in the implementation environment.
[0132] Of course, in other examples adapted in this application, interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. Figure 8 As shown, this does not constitute a specific limitation.
[0133] The memory 250 serves as a carrier for resource storage and can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include the operating system 251, application programs 253, and data 255, etc., and the storage method can be temporary storage or permanent storage.
[0134] The operating system 251 is used to manage and control the various hardware devices and application programs 253 on the server 2000, so as to enable the central processing unit 270 to perform calculations and processing on the massive data 255 in the memory 250. It can be Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0135] Application 253 is a computer program that performs at least one specific task based on operating system 251, and may include at least one module ( Figure 8 (Not shown), each module can contain a computer program for server 2000. For example, the face recognition device can be considered as application 253 deployed on server 2000.
[0136] Data 255 can be photos, pictures, etc. stored on a disk, or it can be input image data, etc., stored in memory 250.
[0137] The central processing unit 270 may include one or more processors and is configured to communicate with the memory 250 via at least one communication bus to read computer programs stored in the memory 250, thereby performing operations and processing on massive amounts of data 255 stored in the memory 250. For example, a face recognition method may be implemented by the central processing unit 270 reading a series of computer programs stored in the memory 250.
[0138] Furthermore, this application can also be implemented through hardware circuits or a combination of hardware circuits and software. Therefore, the implementation of this application is not limited to any specific hardware circuit, software, or combination thereof.
[0139] Please see Figure 9 This application provides an electronic device 4000, which may include: smartphones, tablets, desktop computers, laptops, servers, etc.
[0140] exist Figure 9 The electronic device 4000 includes at least one processor 4001, at least one communication bus 4002, and at least one memory 4003.
[0141] The processor 4001 and memory 4003 are connected, for example, via a communication bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this application.
[0142] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0143] The communication bus 4002 may include a path for transmitting information between the aforementioned components. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0144] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0145] The memory 4003 stores a computer program, and the processor 4001 reads the computer program stored in the memory 4003 through the communication bus 4002.
[0146] When the computer program is executed by the processor 4001, it implements the face recognition methods in the above embodiments.
[0147] In addition, this application provides a storage medium storing a computer program that, when executed by a processor, implements the face recognition methods described in the above embodiments.
[0148] This application provides a computer program product comprising a computer program stored in a storage medium. A processor of a computer device reads the computer program from the storage medium and executes the computer program, causing the computer device to perform the face recognition methods described in the above embodiments.
[0149] Compared with related technologies, the beneficial effects of the present invention are:
[0150] 1. This invention proposes a face recognition method that uses a 1x1 convolution to extract the region segmentation of the current sample. It adaptively extracts corresponding regions from different samples, such as eyes, hair, and background. For these regions, we first use ordinary convolution for feature extraction. Unlike standard convolution, each convolution only processes the features of the current region. Then, graph convolution is used to extract the relationship between different regions and adds this relationship to the original features, which enhances the feature extraction and more effectively distinguishes difficult samples. This results in accurate feature extraction, reduces data volume, and achieves high-quality face recognition. Furthermore, this invention achieves state-of-the-art performance in face recognition tasks, overcoming the shortcomings of existing related technologies, such as poor feature extraction and high computational cost.
[0151] 2. This invention improves the method of dividing face regions, and can dynamically adjust the region division method according to the proportion of each region. In the initial stage, the division is more even, which can take into account more regions to the maximum extent. In the later stage, the division is more obvious, which improves the effect of feature extraction and thus improves the accuracy of face recognition.
[0152] 3. This invention is versatile. Simply replacing the ordinary convolution in the original model with this invention will achieve better results. In addition, this invention can also achieve good results with various loss functions, and it can still produce good results without any pre-training.
[0153] 4. This invention has low computational cost. Compared with some related technologies that involve extracting features through relationships, the graph convolution used in this invention has a lower computational cost, resulting in a smaller increase in computational cost, comparable to the basic model. However, it can achieve a significant improvement on multiple face test sets, thus improving face recognition performance while reducing computational cost.
[0154] 5. This invention has a wide range of applications. It is particularly effective for small models, which are typically used in scenarios with stringent computational requirements, such as mobile devices. These devices have stricter computational requirements than parameter requirements, making this invention particularly effective for such scenarios.
[0155] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0156] The above description is merely a preferred exemplary embodiment of the present invention and is not intended to limit the implementation of the present invention. Those skilled in the art can easily make corresponding modifications or alterations based on the main concept and spirit of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection claimed in the claims.
Claims
1. A face recognition method, characterized in that, The method includes: Obtain the input feature map of the image to be recognized, convolve the input feature map using a convolution kernel to obtain the weight of each region in the input feature map, and adjust the parameters of the activation function Softmax according to the weight; The probability of each location in the input feature map belonging to each region is calculated using the activation function Softmax, and this probability is used as the confidence level of each location in the input feature map belonging to each region. Guided by the confidence level, features are extracted from each region in the input feature map to obtain a region feature map. Use the ArgMax function to find the location with the highest confidence level for each region in the region feature map; The convolutional kernels corresponding to each region are used to extract features from the found locations, thereby obtaining the features of each region and forming the output feature map. The first convolution kernel in the graph convolution is used to extract the features between regions in the output feature map to obtain the first feature map; wherein, the graph convolution contains two one-dimensional convolutions; The output feature map is added to the first feature map to obtain the second feature map; The second feature map is extracted using the second convolution kernel in graph convolution to obtain the relation feature map; The output feature map and the relation feature map are added together to obtain the enhanced feature map; Face recognition is performed on the image to be recognized based on the enhanced feature map to obtain the face recognition result.
2. The method as described in claim 1, characterized in that, After constructing the output feature map, the following is included: The output feature map is spatially split using confidence scores to obtain a reduced-dimensional output feature map.
3. The method according to any one of claims 1 to 2, characterized in that, The face recognition is implemented by calling a face recognition model, which is a trained machine learning model capable of performing face recognition on the image to be recognized.
4. A face recognition device, characterized in that, The device includes: The confidence acquisition module is used to convolve the input feature map using a convolution kernel to obtain the weight of each region in the input feature map, adjust the parameters of the activation function Softmax according to the weight, and use the activation function Softmax to calculate the probability that each position in the input feature map belongs to each region, as the confidence of each position in the input feature map belonging to each region. The region feature extraction module is used to extract features from each region in the input feature map under the guidance of confidence level, so as to obtain the region feature map. The output feature extraction module is used to use the ArgMax function to find the location with the highest confidence in each region in the region feature map; and to use the convolutional kernels corresponding to each region to extract features from the found locations to obtain the features of each region, thus forming the output feature map. An enhanced feature map generation module is used to extract features between regions in the output feature map using a first convolution kernel in graph convolution to obtain a first feature map; wherein the graph convolution includes two one-dimensional convolutions; the output feature map is added to the first feature map to obtain a second feature map; features in the second feature map are extracted using a second convolution kernel in graph convolution to obtain a relational feature map; the output feature map and the relational feature map are added to obtain an enhanced feature map; The face recognition module is used to perform face recognition on the image to be recognized based on the enhanced feature map, and obtain the face recognition result.
5. An electronic device, characterized in that, include: At least one processor, at least one memory, and at least one communication bus, wherein, The memory stores a computer program, and the processor reads the computer program from the memory via the communication bus; When the computer program is executed by the processor, it implements the face recognition method according to any one of claims 1 to 3.
6. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the face recognition method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Face depth forgery detection method and system based on face division
CN113537027A
