Face recognition method and device, computer equipment and storage medium

By combining an RGB camera and an infrared sensor and employing an attention mechanism to calculate feature weights, the accuracy issues of face recognition under varying lighting conditions and spoofing attacks were resolved, achieving stable face recognition results.

CN119296151APending Publication Date: 2025-01-10CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411303218.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Existing facial recognition technology has poor accuracy under different lighting conditions, is easily affected by changes in lighting, and is vulnerable to spoofing attacks.

Method used

By combining an RGB camera and an infrared sensor, the feature weights of the RGB and infrared images are calculated through an attention mechanism, and the feature weights are summed and input into a pre-trained face recognition model for recognition.

Benefits of technology

It provides stable feature analysis under different lighting conditions, reduces the impact of spoofing attacks, and improves the accuracy and anti-interference ability of face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296151A_ABST
    Figure CN119296151A_ABST
Patent Text Reader

Abstract

The invention discloses a face recognition method and device, computer equipment and a storage medium, and belongs to the technical field of artificial intelligence. The method comprises the steps of obtaining a to-be-recognized image, and obtaining an infrared image corresponding to the to-be-recognized image; performing feature extraction on the to-be-recognized image to obtain RGB image features, and performing feature extraction on the infrared image to obtain infrared image features; respectively calculating feature weights of the RGB image features and the infrared image features by adopting a preset attention mechanism; performing feature weighted summation on the RGB image features and the infrared image features by using the feature weights to obtain image combination features; and inputting the image combination features into a pre-trained face recognition model, and outputting a face recognition result. The invention also relates to the technical field of block chains, and the face recognition result is stored in a block chain network. According to the method, the RGB image features and the infrared image features are combined, and the image features are weighted, so that the accuracy and the anti-interference capability of face recognition are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and specifically relates to a face recognition method, device, computer equipment and storage medium. Background Art

[0002] Face recognition is a biometric technology that identifies people based on their facial features. Face recognition analyzes the input face image or video stream to first determine whether there is a face and provide information about the location, size, and location of the main facial organs of each face. Then, it further extracts the identity feature data from the face and compares it with known faces to identify the identity of each face.

[0003] At present, the application of facial recognition in insurance underwriting systems provides insurance companies with a more efficient, accurate and convenient way of identity authentication, which helps to improve the security of insurance business and customer experience. For example, facial recognition technology can quickly and accurately identify the identity information of the policyholder or the insured, which greatly improves the efficiency of underwriting compared with traditional manual review or ID card information comparison. For another example, through facial recognition technology, insurance companies can establish a facial feature database of policyholders or the insured. Once abnormal or inconsistent facial features are found, the insurance company can immediately initiate an anti-fraud investigation to effectively curb the occurrence of fraud.

[0004] However, current face recognition is usually implemented on the basis of RGB images, which are sensitive to lighting conditions. The image quality under different lighting conditions varies greatly, which may affect the accuracy of face recognition. For example, in strong or weak light environments, the shadow and reflection effects of the face may change, resulting in a decrease in recognition rate. At the same time, although face recognition technology based on RGB images still faces the challenge of camouflage attacks, attackers may deceive the system through photos, videos or high-imitation masks, resulting in recognition failure or misrecognition. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a face recognition method, apparatus, computer equipment and storage medium to solve the technical problems that existing face recognition schemes are greatly affected by lighting conditions, affecting the accuracy of face recognition, and there are recognition failures or misrecognitions when facing face disguises.

[0006] In order to solve the above technical problems, the embodiment of the present application provides a face recognition method, which adopts the following technical solution:

[0007] A face recognition method, comprising:

[0008] Receive a face recognition instruction, obtain an image to be recognized, and obtain an infrared image corresponding to the image to be recognized, wherein the image to be recognized is an image taken by an RGB camera, and the infrared image is an image taken by an infrared sensor;

[0009] Perform feature extraction on the image to be identified to obtain RGB image features, and perform feature extraction on the infrared image to obtain infrared image features;

[0010] The preset attention mechanism is used to calculate the feature weights of RGB image features and infrared image features respectively;

[0011] Use feature weights to perform feature weighted summation on RGB image features and infrared image features to obtain image combination features;

[0012] The image combination features are input into the pre-trained face recognition model and the face recognition results are output.

[0013] Furthermore, the steps of receiving a face recognition instruction, obtaining an image to be recognized, and obtaining an infrared image corresponding to the image to be recognized specifically include:

[0014] Based on the face recognition instruction, obtain the video stream shot by the RGB camera;

[0015] Parse the video stream to obtain the video frame sequence;

[0016] Performing liveness detection on each video frame in the video frame sequence in turn to obtain liveness features;

[0017] The video frame with living features is used as the image to be identified;

[0018] An infrared image set taken by an infrared sensor is obtained, and an infrared image corresponding to the image to be identified is determined in the infrared image set.

[0019] Furthermore, the step of performing liveness detection on each video frame in the video frame sequence in turn to obtain liveness features specifically includes:

[0020] Input the video frame sequence into the pre-trained liveness detection model;

[0021] Use the liveness detection model to perform liveness detection on each video frame in turn, and judge whether there is a live object in each video frame in turn;

[0022] When a living object exists in a video frame, target detection is performed on the video frame containing the living object to obtain the region coordinates of the living object;

[0023] The image features within the region coordinate range are extracted to obtain the living body features.

[0024] Furthermore, the step of obtaining an infrared image set taken by an infrared sensor and determining an infrared image corresponding to the image to be identified in the infrared image set specifically includes:

[0025] Retrieving an infrared image set taken by an infrared sensor from a preset image database;

[0026] Determine the video frame corresponding to the image to be identified, and obtain the target video frame;

[0027] Determine the position of the target video frame in the video frame sequence, and identify the timestamp of the target video frame;

[0028] The infrared image corresponding to the image to be identified is searched in the infrared image set according to the timestamp.

[0029] Furthermore, the feature weights include RGB feature weights and infrared feature weights. The steps of respectively calculating the feature weights of the RGB image features and the infrared image features using a preset attention mechanism specifically include:

[0030] Construct an RGB image feature map based on the RGB image features, and perform average pooling on the RGB image feature map to obtain a first pooled feature map;

[0031] Input the first pooled feature map into a preset self-attention layer to obtain a first weight map;

[0032] Analyze the first weight map to obtain RGB feature weights;

[0033] constructing an infrared image feature map based on the infrared image features, and performing average pooling on the infrared image feature map to obtain a second pooled feature map;

[0034] Input the second pooled feature map into the preset self-attention layer to obtain a second weight map;

[0035] The second weight map is parsed to obtain the infrared feature weights.

[0036] Furthermore, the step of using feature weights to perform feature weighted summation on the RGB image features and the infrared image features to obtain image combination features specifically includes:

[0037] Using the RGB feature weights to perform feature weighting on the RGB image features, obtaining a first weighted feature;

[0038] Using the infrared feature weight to perform feature weighting on the infrared image feature to obtain a second weighted feature;

[0039] A feature summation operation is performed on the first weighted feature and the second weighted feature to obtain an image combination feature.

[0040] Furthermore, before the step of inputting the image combination features into the pre-trained face recognition model and outputting the face recognition result, the method further includes:

[0041] Acquire a training data set, wherein the training data set includes a pre-collected historical RGB image and a historical infrared image corresponding to the historical RGB image;

[0042] Perform face annotation on historical RGB images and historical infrared images to obtain face annotation labels;

[0043] Perform feature extraction on historical RGB images to obtain historical RGB image features, and perform feature extraction on historical infrared images to obtain historical infrared image features;

[0044] The attention mechanism is used to calculate the feature weights of historical RGB image features and historical infrared image features respectively, and the historical feature weights are obtained;

[0045] Use historical feature weights to perform weighted summation on historical RGB image features and historical infrared image features to obtain historical image combined features;

[0046] Input the combined features of historical images into a preset prediction model to obtain the initial recognition results output by the prediction model;

[0047] Compare the initial recognition result with the face annotation label and calculate the recognition error;

[0048] The prediction model is iterated based on the recognition error and back propagation algorithm until the model is fitted to obtain the face recognition model.

[0049] In order to solve the above technical problems, the embodiment of the present application further provides a face recognition device, which adopts the following technical solution:

[0050] A face recognition device, comprising:

[0051] An image acquisition module is used to receive a face recognition instruction, acquire an image to be recognized, and acquire an infrared image corresponding to the image to be recognized, wherein the image to be recognized is an image taken by an RGB camera, and the infrared image is an image taken by an infrared sensor;

[0052] A feature extraction module is used to extract features from the image to be identified to obtain RGB image features, and to extract features from the infrared image to obtain infrared image features;

[0053] A weight calculation module, used to calculate the feature weights of RGB image features and infrared image features respectively using a preset attention mechanism;

[0054] A feature weighting module is used to perform feature weighted summation on RGB image features and infrared image features using feature weights to obtain image combination features;

[0055] The face recognition module is used to input the image combination features into the pre-trained face recognition model and output the face recognition results.

[0056] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0057] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of any of the above-mentioned face recognition methods when executing the computer-readable instructions.

[0058] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0059] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of any one of the above-mentioned face recognition methods.

[0060] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0061] The present application discloses a face recognition method, device, computer equipment and storage medium, belonging to the field of artificial intelligence technology. The present application obtains an image to be recognized and an infrared image corresponding to the image to be recognized; extracts features of the image to be recognized to obtain RGB image features, and extracts features of the infrared image to obtain infrared image features; uses a preset attention mechanism to calculate the feature weights of RGB image features and infrared image features respectively; uses feature weights to perform feature weighted summation of RGB image features and infrared image features to obtain image combination features; inputs the image combination features into a pre-trained face recognition model to output face recognition results. The present application combines infrared images to provide stable features under different lighting conditions for face recognition analysis, combines RGB image features and infrared image features, and performs weighted processing on image features, thereby overcoming the problem that traditional RGB images are easily distorted under changing lighting. At the same time, infrared images are implemented based on the principle of thermal imaging to identify face disguise, reduce the impact of disguise attacks, and effectively improve the accuracy and anti-interference ability of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0063] Figure 1 An exemplary system architecture diagram is shown in which the present application can be applied;

[0064] Figure 2 A flow chart of an embodiment of a face recognition method according to the present application is shown;

[0065] Figure 3 A schematic structural diagram of an embodiment of a face recognition device according to the present application is shown;

[0066] Figure 4 A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION

[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0068] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0069] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0070] like Figure 1As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0071] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0072] The terminal device 101 can be various electronic devices with a display screen and supporting web browsing. In addition to the laptop computer 1011, the tablet computer 1012 or the mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer and a desktop computer, etc.

[0073] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0074] It should be noted that the face recognition method provided in the embodiments of the present application is generally executed by a server / terminal device, and accordingly, the face recognition device is generally set in the server / terminal device.

[0075] It should be understood that Figure 1 The numbers of terminal devices, networks and servers in the embodiment are merely illustrative. The above system may have any number of terminal devices, networks and servers according to implementation requirements.

[0076] The embodiment of the present application discloses a face recognition method, which is applied to a face recognition platform. The face recognition platform is a software client architecture designed based on the Windows platform, using OpenCV services and the winform framework, using C# as the upper layer to develop the client interface, using C++ as the middle service layer to provide video data acquisition, and linking the upper client and the backend server. The face recognition platform is provided with a binocular camera, including an RGB camera and an infrared sensor, and the middle service layer is provided with an image feature function unit, a feature weight processing unit, a face recognition unit, etc. The RGB image taken by the RGB camera and the infrared image taken by the infrared sensor are sequentially passed through the image feature function unit, the feature weight processing unit, and the face recognition unit of the middle service layer, and finally the face recognition result is output.

[0077] Continue to refer Figure 2 , shows a flow chart of an embodiment of a face recognition method according to the present application. The face recognition method comprises the following steps:

[0078] S201, receiving a face recognition instruction, obtaining an image to be recognized, and obtaining an infrared image corresponding to the image to be recognized, wherein the image to be recognized is an image taken by an RGB camera, and the infrared image is an image taken by an infrared sensor.

[0079] Specifically, the system first receives externally uploaded face recognition requests, which can be triggered by the user (such as login, identity authentication) or automatically (such as real-time recognition in monitoring scenarios). Once the command is received, the system starts the face recognition platform, which simultaneously controls two camera devices, namely the RGB camera and the infrared sensor. The RGB camera captures RGB images under the visible spectrum. RGB images can capture visual information such as the color, shape and texture of the face, but their performance may be unstable under different lighting conditions. The infrared sensor captures infrared images, which can effectively reflect the thermal radiation characteristics of the face or the reflective characteristics of the skin surface, and are not affected by changes in ambient light. Especially in insufficient light or backlight conditions, infrared images can make up for the defect that RGB images cannot clearly obtain facial details. By combining these two types of images, the system can collect facial information from different angles, thereby enhancing the subsequent recognition effect.

[0080] In addition, after acquiring these two images, the system preprocesses the obtained images, such as resizing, aligning and denoising the images to ensure that the RGB image and the infrared image are analyzed in the same reference frame.

[0081] S202, extracting features from the image to be recognized to obtain RGB image features, and extracting features from the infrared image to obtain infrared image features.

[0082] Specifically, the system extracts image features from the image to be identified (RGB image) and the infrared image respectively. Feature extraction of RGB images and infrared images can be processed by traditional convolutional neural networks (CNN) or pre-trained deep learning models. For RGB images, the model automatically identifies key areas in the image, such as facial features such as eyes, nose, mouth, as well as texture, color distribution, etc. These features are very effective in good lighting conditions, but when the lighting changes greatly, the extracted features may be distorted. For infrared images, the feature extraction process usually focuses on changes in facial structure and temperature characteristics. This type of image reflects thermal information, so it can help identify camouflaged or obscured faces, and can even work properly in low-light or no-light environments.

[0083] In order to realize these feature extractions, the corresponding network architecture can be selected to train specific feature extraction models for RGB images and infrared images respectively. Finally, the feature extraction model will output RGB image feature vectors and infrared image feature vectors.

[0084] S203, using a preset attention mechanism to respectively calculate the feature weights of the RGB image features and the infrared image features.

[0085] Specifically, the system introduces a preset attention mechanism to dynamically calculate the weights of RGB image features and infrared image features, and automatically adjust the importance of the two types of image features according to the different conditions of the input image. In deep learning, the attention mechanism can help the model focus on the key parts of the input and ignore secondary information. For face recognition tasks, the importance of RGB image features and infrared image features may be different in different scenarios. For example, in well-lit conditions without camouflage, RGB image features may be more reliable, so the weights will be biased towards RGB images; while in low-light or strong-light conditions, the features of infrared images may be more discernible, and the weights will increase accordingly. The implementation of the attention mechanism is usually based on a set of learned parameters, which dynamically assign weights according to the characteristics of the input data. These weights depend not only on the quality of the image itself and the environmental conditions, but can also be optimized based on the empirical data accumulated in the previous recognition process.

[0086] S204, using feature weights to perform feature weighted summation on the RGB image features and the infrared image features to obtain image combination features.

[0087] Specifically, at this stage, the system applies the weights calculated by the attention mechanism to the RGB image features and the infrared image features. Each type of feature is weighted according to its corresponding weight, so as to generate a unified image combination feature after weighted summation. This image combination feature not only contains the color and texture information in the RGB image, but also combines the structure and thermal features in the infrared image. Through weighted summation, the system can effectively fuse the features from two different sources into a unified feature representation.

[0088] The advantage of this method is that it can not only improve recognition accuracy under normal lighting conditions, but also maintain high robustness under poor lighting and complex environments. The weighted summation process ensures the rationality of feature fusion, allowing the model to simultaneously refer to facial features under the visible spectrum and structural features under the infrared spectrum. The resulting combined features will be used in the next step of the face recognition model. The image combined features are more expressive comprehensive feature vectors than single RGB features or infrared features.

[0089] S205, input the image combination features into the pre-trained face recognition model, and output the face recognition result.

[0090] Specifically, the system inputs the weighted sum of the combined image features into a pre-trained deep learning model for face recognition. The pre-trained model can be based on existing mature face recognition frameworks, such as FaceNet, VGGFace, etc. These models are trained with a large number of face image data sets and have good recognition capabilities. By inputting the fused image features, the model can still accurately perform face matching and identity authentication while considering complex conditions such as lighting, occlusion, and camouflage.

[0091] Since the model has been pre-trained with a large amount of data, it has strong generalization capabilities and can handle a variety of different input feature combinations. In addition, the use of image combination features further enhances the model's recognition capabilities, especially when dealing with extreme conditions such as camouflage and lighting changes. The output recognition result can be a matching identity tag, or in the open set recognition scenario, it can determine whether the current face belongs to a person in a known database.

[0092] In the above embodiments, the present application combines infrared images to provide stable features for face recognition analysis under different lighting conditions, combines RGB image features and infrared image features, and performs weighted processing on the image features, thereby overcoming the problem that traditional RGB images are easily distorted under lighting changes. At the same time, infrared images are implemented based on the principle of thermal imaging to identify facial disguises, reduce the impact of disguise attacks, and effectively improve the accuracy and anti-interference ability of face recognition.

[0093] Furthermore, the steps of receiving a face recognition instruction, obtaining an image to be recognized, and obtaining an infrared image corresponding to the image to be recognized specifically include:

[0094] Based on the face recognition instruction, obtain the video stream shot by the RGB camera;

[0095] Parse the video stream to obtain the video frame sequence;

[0096] Performing liveness detection on each video frame in the video frame sequence in turn to obtain liveness features;

[0097] The video frame with living features is used as the image to be identified;

[0098] An infrared image set taken by an infrared sensor is obtained, and an infrared image corresponding to the image to be identified is determined in the infrared image set.

[0099] In this embodiment, based on the received face recognition instruction, the system first starts to obtain the video stream from the RGB camera, parses the video stream, generates a video frame sequence by frame processing, and disassembles the real-time video stream into a series of independent static images (video frames). Next, the system performs liveness detection on each frame image in turn to determine whether the face in the image is a real live body. The implementation of liveness detection can be combined with a variety of technologies, such as based on optical flow, blink detection, skin texture analysis or judgment through three-dimensional depth information. Once a video frame image is detected to have obvious liveness features, the frame is marked as an image to be recognized. Then, the system further synchronously obtains the corresponding infrared image set through the infrared sensor. The infrared image can capture the thermal radiation characteristics of the skin, eliminate the influence of lighting conditions and detect camouflage (such as occlusion, false face, etc.), so that the face recognition analysis is not easily affected by external ambient light or surface camouflage. The system can match the RGB image to be recognized with the corresponding infrared image through a timestamp or other synchronization mechanism to ensure that the RGB image and the infrared image correspond to the facial information at the same time point.

[0100] Through the above steps, liveness detection and multimodal image processing are effectively combined to avoid camouflage attacks that may occur when using static images for face recognition. With the assistance of infrared images, the system can improve recognition accuracy in poor lighting or complex environments, and ensure that only real, uncamouflaged live faces are recognized, improving the security and robustness of the system.

[0101] Furthermore, the step of performing liveness detection on each video frame in the video frame sequence in turn to obtain liveness features specifically includes:

[0102] Input the video frame sequence into the pre-trained liveness detection model;

[0103] Use the liveness detection model to perform liveness detection on each video frame in turn, and judge whether there is a live object in each video frame in turn;

[0104] When a living object exists in a video frame, target detection is performed on the video frame containing the living object to obtain the region coordinates of the living object;

[0105] The image features within the region coordinate range are extracted to obtain the living body features.

[0106] In this embodiment, the system first inputs the parsed video frame sequence into the pre-trained liveness detection model for processing. The liveness detection model is a deep learning model trained with a large number of live samples and camouflage samples, and has a strong ability to distinguish. After inputting the video frame, the liveness detection model will analyze each image frame by frame, automatically detect whether there is a live object in the image, and make a judgment through the algorithm inside the liveness detection model, such as by detecting facial micro-expressions, blinking, head micro-movements, or by analyzing skin texture.

[0107] Once the system detects the presence of a living object in a video frame, it will further perform target detection, that is, identify the specific area of ​​the living object in the video frame and mark its area coordinates. Target detection usually uses models such as YOLO and Faster R-CNN, which use borders to lock the face or other key parts of the living object. Next, the system extracts image features within the coordinate range of the area, namely live features. These features may include skin color, texture, subtle facial movements, etc. These features are more real-time and biological than general facial features, and can further confirm that the object in the video frame is a real live face.

[0108] Through the above steps, the combination of pre-trained liveness detection model and target detection technology ensures accurate identification of live objects in video frames. Through frame-by-frame detection and feature extraction, the system can not only effectively prevent static image camouflage attacks, but also further locate live areas and extract precise biological features.

[0109] Furthermore, the step of obtaining an infrared image set taken by an infrared sensor and determining an infrared image corresponding to the image to be identified in the infrared image set specifically includes:

[0110] Retrieving an infrared image set taken by an infrared sensor from a preset image database;

[0111] Determine the video frame corresponding to the image to be identified, and obtain the target video frame;

[0112] Determine the position of the target video frame in the video frame sequence, and identify the timestamp of the target video frame;

[0113] The infrared image corresponding to the image to be identified is searched in the infrared image set according to the timestamp.

[0114] In this embodiment, the system first retrieves the infrared image set taken by the infrared sensor from the preset image database. The infrared image set is usually stored in the system database in real time as auxiliary information synchronized with the RGB video stream. Next, the system will identify and determine the RGB video frame to be identified. This video frame is the target video frame determined after liveness detection and target recognition. The target video frame represents an image containing liveness features and has a higher priority in the face recognition task.

[0115] The system determines the specific position of the target video frame by analyzing the frame position in the video frame sequence and obtains the timestamp information of the frame. The timestamp identifies the generation time of each frame of video and is used to synchronize RGB images and infrared images.

[0116] Since infrared images are taken by independent sensors, the capture time of the RGB camera and the infrared sensor needs to be aligned through the timestamp. The system searches for the infrared image corresponding to the timestamp of the target video frame in the infrared image set based on the timestamp of the target video frame. In order to ensure the accurate match of the two types of images, the system will look for infrared images with the same time as the target video frame and mark them as infrared images corresponding to the image to be identified. In this way, the system can combine the RGB image and the infrared image to ensure that the two types of information can be comprehensively utilized in the subsequent recognition process to maximize the recognition effect.

[0117] Through the above steps, the synchronous matching of RGB video frames and infrared images is achieved, and the time stamp is used to ensure the temporal and spatial consistency of the images.

[0118] Furthermore, the feature weights include RGB feature weights and infrared feature weights. The steps of respectively calculating the feature weights of the RGB image features and the infrared image features using a preset attention mechanism specifically include:

[0119] Construct an RGB image feature map based on the RGB image features, and perform average pooling on the RGB image feature map to obtain a first pooled feature map;

[0120] Input the first pooled feature map into a preset self-attention layer to obtain a first weight map;

[0121] Analyze the first weight map to obtain RGB feature weights;

[0122] constructing an infrared image feature map based on the infrared image features, and performing average pooling on the infrared image feature map to obtain a second pooled feature map;

[0123] Input the second pooled feature map into the preset self-attention layer to obtain a second weight map;

[0124] The second weight map is parsed to obtain the infrared feature weights.

[0125] In this embodiment, the system first constructs an RGB image feature map based on the features extracted from the RGB image. The feature map is a multi-dimensional feature extracted from the original image by a deep learning model such as a convolutional neural network (CNN), which can represent the feature distribution of each pixel or region in the image, such as edges, colors, and textures. Next, the system performs average pooling on the RGB image feature map. Average pooling is a dimensionality reduction technique that reduces the dimension of the data by averaging the area of ​​the feature map, retaining important information and removing noise. Through pooling, the system obtains the first pooled feature map. Next, the first pooled feature map is input into the self-attention layer. The self-attention layer is a mechanism for enhancing the model's attention to important features. By analyzing the contribution of each part of the feature map to the overall feature, a weight map is generated. Each value in the weight map represents the importance of the feature area. The system extracts the weight information of the RGB feature by parsing the weight map.

[0126] Similarly, the system constructs an infrared image feature map based on the features extracted from the infrared image, and performs the same average pooling process to obtain a second pooled feature map. The second pooled feature map is then also input into the self-attention layer to generate a second weight map, and the weights of the infrared features are parsed. These weight values ​​will be used in the subsequent weighted fusion steps to ensure that the system can dynamically adjust the relative importance of RGB and infrared image features according to different situations in the scene.

[0127] Through the above steps, the self-attention mechanism is used to intelligently allocate the weights of RGB image features and infrared image features, so that the system can adaptively adjust the attention to different image features according to different scenes. In this way, when the lighting conditions are not ideal or there is camouflage, the system automatically gives higher weights to more suitable features.

[0128] Furthermore, the step of using feature weights to perform feature weighted summation on the RGB image features and the infrared image features to obtain image combination features specifically includes:

[0129] Using the RGB feature weights to perform feature weighting on the RGB image features, obtaining a first weighted feature;

[0130] Using the infrared feature weight to perform feature weighting on the infrared image feature to obtain a second weighted feature;

[0131] A feature summation operation is performed on the first weighted feature and the second weighted feature to obtain an image combination feature.

[0132] In this embodiment, the system first uses the previously obtained RGB feature weights to weight the RGB image features. The RGB feature weights are calculated through the self-attention mechanism and reflect which RGB image features are more important for the recognition task in a specific scenario. Therefore, through the feature weighting operation, the system amplifies the features with higher weights, while the features with lower weights are weakened accordingly.

[0133] Next, the infrared image features are also weighted. The system weights the infrared image features according to the calculated infrared feature weights to generate the second weighted features. The feature weights of the infrared image are also provided by the self-attention mechanism, which can capture the key information of the infrared image under different lighting conditions. The weighted operation ensures that the features related to facial recognition in the infrared image are given priority in specific scenarios. Next, the system performs feature summation operations on the weighted features of the RGB image and the weighted features of the infrared image to generate image combination features. The purpose of feature summation is to fuse the two types of image information together, so that the system can refer to the key information from the RGB image and the infrared image at the same time. The summed image combination features have the color, texture and other information of the RGB image, and also include the structure and temperature information of the infrared image, thereby forming a more comprehensive facial feature representation.

[0134] Through the above steps, the effective fusion of RGB image and infrared image features is achieved, ensuring stable facial recognition results under different lighting conditions and camouflage conditions. Through dynamic weighting and feature summation, the system can not only adapt to environmental changes, but also comprehensively utilize multimodal features to improve recognition accuracy and anti-interference ability.

[0135] Furthermore, before the step of inputting the image combination features into the pre-trained face recognition model and outputting the face recognition result, the method further includes:

[0136] Acquire a training data set, wherein the training data set includes a pre-collected historical RGB image and a historical infrared image corresponding to the historical RGB image;

[0137] Perform face annotation on historical RGB images and historical infrared images to obtain face annotation labels;

[0138] Perform feature extraction on historical RGB images to obtain historical RGB image features, and perform feature extraction on historical infrared images to obtain historical infrared image features;

[0139] The attention mechanism is used to calculate the feature weights of historical RGB image features and historical infrared image features respectively, and the historical feature weights are obtained;

[0140] Use historical feature weights to perform weighted summation on historical RGB image features and historical infrared image features to obtain historical image combined features;

[0141] Input the combined features of historical images into a preset prediction model to obtain the initial recognition results output by the prediction model;

[0142] Compare the initial recognition result with the face annotation label and calculate the recognition error;

[0143] The prediction model is iterated based on the recognition error and back propagation algorithm until the model is fitted to obtain the face recognition model.

[0144] In this embodiment, the system first needs to obtain a training data set, which includes pre-collected historical RGB images and their corresponding historical infrared images. In order to further process these images, the system first annotates the faces in the historical RGB images and historical infrared images. Face annotation is to label the face area in each image manually or automatically so that the subsequent model can correctly learn which areas are related to face recognition.

[0145] After the annotation is completed, the system begins to extract features from historical RGB images and historical infrared images. For RGB images, the extracted features may include color, texture, facial contours, etc.; while for infrared images, the features are more related to temperature and structure. After the features of the two types of images are extracted, the system will use the attention mechanism to calculate the historical feature weights of historical RGB image features and historical infrared image features respectively. The attention mechanism analyzes the contribution of each feature in the recognition task and dynamically adjusts the weight to ensure that the impact of important features in subsequent processing is amplified.

[0146] Next, the system uses historical feature weights to perform weighted summation on these two types of image features to obtain combined features of historical images that fuse multimodal information. The fused features can represent the comprehensive information of each image. These combined features are then input into a preset prediction model, which generates initial face recognition results based on these inputs.

[0147] To ensure the accuracy of the model, the system compares the initial recognition results with the previously annotated face labels and calculates the recognition error. Based on the size of the error, the system adjusts the model parameters through the back propagation algorithm and performs iterative training. This process is repeated until the model's recognition results are highly consistent with the annotated labels and the error is minimized, ultimately resulting in a fully trained face recognition model.

[0148] Through the above steps, the multimodal features of historical RGB images and infrared images are gradually integrated, and the prediction model is optimized through continuous iterative training, which effectively combines the advantages of different sensors and overcomes the shortcomings of single RGB images affected by lighting and camouflage. The robustness of the model is enhanced by infrared images, thereby significantly improving the accuracy and reliability of face recognition.

[0149] In the above embodiment, the present application discloses a face recognition method, which belongs to the field of artificial intelligence technology. The present application obtains an image to be recognized and an infrared image corresponding to the image to be recognized; extracts features of the image to be recognized to obtain RGB image features, and extracts features of the infrared image to obtain infrared image features; uses a preset attention mechanism to calculate the feature weights of RGB image features and infrared image features respectively; uses feature weights to perform feature weighted summation of RGB image features and infrared image features to obtain image combination features; inputs the image combination features into a pre-trained face recognition model to output face recognition results. The present application combines infrared images to provide stable features under different lighting conditions for face recognition analysis, combines RGB image features and infrared image features, and performs weighted processing on image features, thereby overcoming the problem that traditional RGB images are easily distorted under changing lighting conditions. At the same time, infrared images are implemented based on the principle of thermal imaging to identify face disguise, reduce the impact of disguise attacks, and effectively improve the accuracy and anti-interference ability of face recognition.

[0150] In this embodiment, the face recognition method is executed on the electronic device (eg Figure 1 The server shown in the figure can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, Wi-Fi connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (Ultra Wi-Fi Band) connection, and other wireless connection methods currently known or to be developed in the future.

[0151] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned facial recognition result information, the above-mentioned facial recognition result information can also be stored in a blockchain node.

[0152] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0153] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0154] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0155] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0156] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0157] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a face recognition device, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0158] like Figure 3 As shown, the face recognition device 300 described in this embodiment includes:

[0159] The image acquisition module 301 is used to receive a face recognition instruction, acquire an image to be recognized, and acquire an infrared image corresponding to the image to be recognized, wherein the image to be recognized is an image taken by an RGB camera, and the infrared image is an image taken by an infrared sensor;

[0160] The feature extraction module 302 is used to extract features from the image to be identified to obtain RGB image features, and to extract features from the infrared image to obtain infrared image features;

[0161] A weight calculation module 303 is used to calculate the feature weights of the RGB image features and the infrared image features respectively using a preset attention mechanism;

[0162] A feature weighting module 304 is used to perform feature weighted summation on the RGB image features and the infrared image features using feature weights to obtain image combination features;

[0163] The face recognition module 305 is used to input the image combination features into the pre-trained face recognition model and output the face recognition result.

[0164] Furthermore, the image acquisition module 301 is specifically used for:

[0165] Based on the face recognition instruction, the video stream shot by the RGB camera is obtained; the video stream is parsed to obtain a video frame sequence; liveness detection is performed on each video frame in the video frame sequence in turn to obtain liveness features; the video frames with liveness features are used as images to be identified; an infrared image set shot by the infrared sensor is obtained, and the infrared image corresponding to the image to be identified is determined in the infrared image set.

[0166] Furthermore, the image acquisition module 301 is further used for:

[0167] The video frame sequence is input into the pre-trained liveness detection model; the liveness detection model is used to perform liveness detection on each video frame in turn, and each video frame is judged in turn whether there is a live object; when a live object exists in a video frame, target detection is performed on the video frame with the live object to obtain the regional coordinates of the live object; image features within the regional coordinate range are extracted to obtain liveness features.

[0168] Furthermore, the image acquisition module 301 is also used for:

[0169] A set of infrared images taken by an infrared sensor is retrieved from a preset image database; the video frame corresponding to the image to be identified is determined to obtain a target video frame; the position of the target video frame in the video frame sequence is determined, and the timestamp of the target video frame is identified; and the infrared image corresponding to the image to be identified is searched in the infrared image set according to the timestamp.

[0170] Furthermore, the weight calculation module 303 is specifically used for:

[0171] An RGB image feature map is constructed based on RGB image features, and average pooling is performed on the RGB image feature map to obtain a first pooled feature map; the first pooled feature map is input into a preset self-attention layer to obtain a first weight map; the first weight map is parsed to obtain RGB feature weights; an infrared image feature map is constructed based on infrared image features, and average pooling is performed on the infrared image feature map to obtain a second pooled feature map; the second pooled feature map is input into a preset self-attention layer to obtain a second weight map; the second weight map is parsed to obtain infrared feature weights.

[0172] Furthermore, the feature weighting module 304 is specifically used for:

[0173] The RGB image features are weighted using the RGB feature weights to obtain the first weighted features; the infrared image features are weighted using the infrared feature weights to obtain the second weighted features; and the first weighted features and the second weighted features are summed to obtain the image combination features.

[0174] Furthermore, the face recognition device 300 also includes a model training module, which is specifically used for:

[0175] A training data set is obtained, wherein the training data set includes a historical RGB image collected in advance, and a historical infrared image corresponding to the historical RGB image; faces are annotated on the historical RGB image and the historical infrared image to obtain a face annotation label; features are extracted on the historical RGB image to obtain historical RGB image features, and features are extracted on the historical infrared image to obtain historical infrared image features; an attention mechanism is used to calculate feature weights of the historical RGB image features and the historical infrared image features respectively to obtain historical feature weights; historical feature weights are used to perform feature weighted summation on the historical RGB image features and the historical infrared image features to obtain historical image combined features; the historical image combined features are input into a preset prediction model to obtain an initial recognition result output by the prediction model; the initial recognition result is compared with the face annotation label to calculate the recognition error; the prediction model is iterated based on the recognition error and the back propagation algorithm until the model is fitted to obtain a face recognition model.

[0176] In the above embodiment, the present application discloses a face recognition device, which belongs to the field of artificial intelligence technology. The present application obtains an image to be recognized and an infrared image corresponding to the image to be recognized; extracts features of the image to be recognized to obtain RGB image features, and extracts features of the infrared image to obtain infrared image features; uses a preset attention mechanism to calculate the feature weights of RGB image features and infrared image features respectively; uses feature weights to perform feature weighted summation of RGB image features and infrared image features to obtain image combination features; inputs the image combination features into a pre-trained face recognition model to output face recognition results. The present application combines infrared images to provide stable features under different lighting conditions for face recognition analysis, combines RGB image features and infrared image features, and performs weighted processing on image features, thereby overcoming the problem that traditional RGB images are easily distorted under changing lighting conditions. At the same time, infrared images are implemented based on the principle of thermal imaging to identify face disguise, reduce the impact of disguise attacks, and effectively improve the accuracy and anti-interference ability of face recognition.

[0177] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0178] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 4 having a memory 41, a processor 42, and a network interface 43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital processor (DSP), an embedded device, etc.

[0179] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0180] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the face recognition method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0181] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the face recognition method.

[0182] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0183] In the above embodiment, the present application discloses a computer device, which belongs to the field of artificial intelligence technology. The present application obtains an image to be identified and an infrared image corresponding to the image to be identified; extracts features of the image to be identified to obtain RGB image features, and extracts features of the infrared image to obtain infrared image features; uses a preset attention mechanism to calculate the feature weights of RGB image features and infrared image features respectively; uses feature weights to perform feature weighted summation of RGB image features and infrared image features to obtain image combination features; inputs the image combination features into a pre-trained face recognition model to output face recognition results. The present application combines infrared images to provide stable features under different lighting conditions for face recognition analysis, combines RGB image features and infrared image features, and performs weighted processing on image features, thereby overcoming the problem that traditional RGB images are easily distorted under lighting changes. At the same time, infrared images are implemented based on the principle of thermal imaging to identify face disguise, reduce the impact of disguise attacks, and effectively improve the accuracy and anti-interference ability of face recognition.

[0184] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the face recognition method as described above.

[0185] In the above embodiment, the present application discloses a computer-readable storage medium, which belongs to the field of artificial intelligence technology. The present application obtains an image to be identified and an infrared image corresponding to the image to be identified; extracts features of the image to be identified to obtain RGB image features, and extracts features of the infrared image to obtain infrared image features; uses a preset attention mechanism to calculate the feature weights of RGB image features and infrared image features respectively; uses feature weights to perform feature weighted summation of RGB image features and infrared image features to obtain image combination features; inputs the image combination features into a pre-trained face recognition model to output face recognition results. The present application combines infrared images to provide stable features under different lighting conditions for face recognition analysis, combines RGB image features and infrared image features, and performs weighted processing on image features, thereby overcoming the problem that traditional RGB images are easily distorted under changing lighting conditions. At the same time, infrared images are implemented based on the principle of thermal imaging to identify face disguise, reduce the impact of disguise attacks, and effectively improve the accuracy and anti-interference ability of face recognition.

[0186] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0187] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0188] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A face recognition method, characterized in that: include: Receive a face recognition instruction, obtain an image to be recognized, and obtain an infrared image corresponding to the image to be recognized, wherein the image to be recognized is an image taken by an RGB camera, and the infrared image is an image taken by an infrared sensor; Extracting features of the image to be identified to obtain RGB image features, and extracting features of the infrared image to obtain infrared image features; Using a preset attention mechanism to respectively calculate the feature weights of the RGB image features and the infrared image features; Using the feature weights, the RGB image features and the infrared image features are summed to obtain image combination features; The image combination features are input into a pre-trained face recognition model, and a face recognition result is output.

2. The face recognition method according to claim 1, characterized in that: The steps of receiving a face recognition instruction, obtaining an image to be recognized, and obtaining an infrared image corresponding to the image to be recognized specifically include: Based on the face recognition instruction, obtaining a video stream shot by the RGB camera; Parsing the video stream to obtain a video frame sequence; Performing liveness detection on each video frame in the video frame sequence in turn to obtain liveness features; Using the video frame containing the living body feature as the image to be identified; An infrared image set taken by the infrared sensor is acquired, and an infrared image corresponding to the image to be identified is determined in the infrared image set.

3. The face recognition method according to claim 2, characterized in that: The step of sequentially performing liveness detection on each video frame in the video frame sequence to obtain liveness features specifically includes: Inputting the video frame sequence into a pre-trained living body detection model; Using the liveness detection model to perform liveness detection on each of the video frames in turn, and judging in turn whether there is a live object in each of the video frames; When the living object exists in the video frame, target detection is performed on the video frame containing the living object to obtain the region coordinates of the living object; The image features within the region coordinate range are extracted to obtain the living body features.

4. The face recognition method according to claim 2, characterized in that: The step of acquiring a set of infrared images taken by the infrared sensor and determining the infrared image corresponding to the image to be identified in the set of infrared images specifically includes: Retrieving a set of infrared images taken by the infrared sensor from a preset image database; Determine the video frame corresponding to the image to be identified, and obtain a target video frame; Determine the position of the target video frame in the sequence of video frames, and identify the timestamp of the target video frame; The infrared image corresponding to the image to be identified is searched in the infrared image set according to the timestamp.

5. The face recognition method according to claim 1, characterized in that: The feature weights include RGB feature weights and infrared feature weights. The step of using a preset attention mechanism to respectively calculate the feature weights of the RGB image features and the infrared image features specifically includes: Constructing an RGB image feature map based on the RGB image features, and performing average pooling on the RGB image feature map to obtain a first pooled feature map; Inputting the first pooled feature map into a preset self-attention layer to obtain a first weight map; Parsing the first weight map to obtain the RGB feature weights; constructing an infrared image feature map based on the infrared image features, and performing average pooling on the infrared image feature map to obtain a second pooled feature map; Inputting the second pooled feature map into a preset self-attention layer to obtain a second weight map; The second weight map is parsed to obtain the infrared feature weight.

6. The face recognition method according to claim 5, characterized in that: The step of using the feature weights to perform feature weighted summation on the RGB image features and the infrared image features to obtain image combination features specifically includes: Using the RGB feature weights to perform feature weighting on the RGB image features to obtain a first weighted feature; Using the infrared feature weight to perform feature weighting on the infrared image feature to obtain a second weighted feature; A feature summation operation is performed on the first weighted feature and the second weighted feature to obtain the image combination feature.

7. The face recognition method according to claim 1, characterized in that: Before the step of inputting the image combination features into the pre-trained face recognition model and outputting the face recognition result, the step further includes: Acquire a training data set, wherein the training data set includes pre-collected historical RGB images and historical infrared images corresponding to the historical RGB images; Performing face annotation on the historical RGB image and the historical infrared image to obtain face annotation labels; Performing feature extraction on the historical RGB image to obtain historical RGB image features, and performing feature extraction on the historical infrared image to obtain historical infrared image features; The attention mechanism is used to calculate the feature weights of the historical RGB image features and the historical infrared image features respectively, to obtain the historical feature weights; Using the historical feature weights, the historical RGB image features and the historical infrared image features are summed to obtain historical image combined features; Inputting the historical image combination features into a preset prediction model to obtain an initial recognition result output by the prediction model; Compare the initial recognition result with the face annotation label to calculate the recognition error; The prediction model is iterated based on the recognition error and the back propagation algorithm until the model is fitted to obtain the face recognition model.

8. A face recognition device, characterized in that: include: An image acquisition module is used to receive a face recognition instruction, acquire an image to be recognized, and acquire an infrared image corresponding to the image to be recognized, wherein the image to be recognized is an image taken by an RGB camera, and the infrared image is an image taken by an infrared sensor; A feature extraction module is used to extract features from the image to be identified to obtain RGB image features, and to extract features from the infrared image to obtain infrared image features; A weight calculation module, used to respectively calculate the feature weights of the RGB image features and the infrared image features using a preset attention mechanism; A feature weighting module, used for performing feature weighted summation on the RGB image features and the infrared image features using the feature weights to obtain an image combination feature; The face recognition module is used to input the image combination features into a pre-trained face recognition model and output a face recognition result.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the face recognition method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the face recognition method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Emotion recognition method and emotion analysis system

    CN120472435A