Face recognition method and device

By channel-level fusion of visible light images with infrared images, and using adaptive processing and YOLOv5s algorithm model optimization, the problem of low face recognition accuracy under poor ambient light is solved, and all-weather and high-precision face recognition is achieved.

CN115527257BActive Publication Date: 2025-08-22INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211203806.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-08-22
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

The existing face recognition algorithms have greatly reduced recognition accuracy when the ambient light is dim or the light source is unevenly distributed, and the infrared face image data is lacking, making it difficult to be used for face recognition alone.

Method used

The method of channel-level fusion of visible light images and infrared images is adopted, and infrared images are enhanced through image inversion and histogram equalization algorithm with limited adaptive contrast, image fusion is performed by combining information entropy calculation, and training is performed using the YOLOv5s algorithm model, and the CIOU loss function is used to optimize the recognition model.

Benefits of technology

In the case of poor ambient light, the accuracy of face recognition is improved, the problem of lack of infrared image data is solved, all-weather face recognition is achieved, and model deployment is simplified.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115527257B_ABST
    Figure CN115527257B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention disclose a face recognition method and device, relating to the field of artificial intelligence technology. The method comprises: obtaining a visible light face image and an infrared face image of a target to be identified; performing enhancement processing on the infrared face image to obtain a processed infrared face image; performing channel fusion on the visible light face image and the processed infrared face image to obtain a fused image; and inputting the fused image into a preset face recognition model to obtain a face recognition result of the target to be identified, output by the face recognition model. The face recognition model is obtained by training a preset machine learning model using training samples, and the training samples include: a fused image obtained by performing channel fusion on the visible light face image used for model training and the corresponding enhanced infrared face image. The present invention improves the accuracy of face recognition under poor lighting conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a face recognition method and device. Background Art

[0002] Currently, mainstream facial recognition algorithms typically use visible light images for face recognition. However, the limitation of using visible light images for face recognition is that their performance is significantly affected by environmental conditions. Recognition based solely on visible light images or videos is easily affected by changes in lighting. Recognition rates can be significantly reduced in dim or uneven lighting conditions. Improving the accuracy of face recognition in poor lighting conditions is an urgent technical challenge in this field. Summary of the Invention

[0003] In order to solve at least one technical problem in the above-mentioned background technology, the present invention proposes a face recognition method and device.

[0004] In order to achieve the above object, according to one aspect of the present invention, a face recognition method is provided, the method comprising:

[0005] Obtaining visible light face images and infrared face images of the target to be identified;

[0006] performing enhancement processing on the infrared face image to obtain a processed infrared face image;

[0007] Performing channel fusion on the visible light face image and the processed infrared face image to obtain a fused image;

[0008] The fused image is input into a preset face recognition model to obtain a face recognition result of the target to be identified output by the face recognition model, wherein the face recognition model is obtained by training a preset machine learning model using training samples, and the training samples include: a fused image obtained by channel fusion of a visible light face image used for model training and a corresponding enhanced infrared face image.

[0009] Optionally, the enhancing process on the infrared face image specifically includes:

[0010] Performing image inversion processing on the infrared face image to obtain a first processed image;

[0011] Processing the infrared face image using an adaptive contrast-limited histogram equalization algorithm to obtain a second processed image;

[0012] The infrared face image, the first processed image, and the second processed image are each taken as a channel for channel fusion to obtain the processed infrared face image.

[0013] Optionally, the processing of the infrared face image using an adaptive contrast-limited histogram equalization algorithm specifically includes:

[0014] Calculating the signal-to-noise ratio of the entire infrared face image and the signal-to-noise ratio of each region in the infrared face image;

[0015] Calculating the ratio of the signal-to-noise ratio of each region to the signal-to-noise ratio of the entire image, and determining the threshold corresponding to each region according to the ratio;

[0016] Pixels are reallocated for the infrared face image according to the threshold, and then histogram processing is performed on each area.

[0017] Optionally, performing channel fusion on the visible light facial image and the processed infrared facial image specifically includes:

[0018] Calculating the information entropy of the visible light face image and the processed infrared face image respectively;

[0019] Determining weights corresponding to the visible light facial image and the processed infrared facial image according to the information entropy;

[0020] Channel fusion is performed on the visible light face image and the processed infrared face image according to the weight.

[0021] Optionally, performing channel fusion on the visible light facial image and the processed infrared facial image specifically includes:

[0022] Calculating the information entropy of the visible light face image and the infrared face image respectively;

[0023] Determining weights corresponding to the visible light facial image and the infrared facial image respectively according to the information entropy;

[0024] Channel fusion is performed on the visible light face image and the processed infrared face image according to the weight.

[0025] Optionally, the face recognition method further includes:

[0026] Obtaining the training sample;

[0027] The training samples are used to train a preset machine learning model to obtain the face recognition model.

[0028] Optionally, the preset machine learning model includes: a YOLOv5s algorithm model; and CIOU is used as a loss function during model training.

[0029] In order to achieve the above object, according to another aspect of the present invention, a face recognition device is provided, the device comprising:

[0030] An image acquisition unit, configured to acquire a visible light face image and an infrared face image of a target to be identified;

[0031] an infrared image processing unit, configured to perform enhancement processing on the infrared facial image to obtain a processed infrared facial image;

[0032] An image channel fusion unit, configured to perform channel fusion on the visible light face image and the processed infrared face image to obtain a fused image;

[0033] A face recognition unit is used to input the fused image into a preset face recognition model to obtain a face recognition result of the target to be identified output by the face recognition model, wherein the face recognition model is obtained by training a preset machine learning model using training samples, and the training samples include: a fused image obtained by channel fusion of a visible light face image used for model training and a corresponding enhanced infrared face image.

[0034] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer device is further provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned face recognition method when executing the computer program.

[0035] In order to achieve the above-mentioned purpose, according to another aspect of the present invention, a computer-readable storage medium is further provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the steps of the above-mentioned face recognition method are implemented.

[0036] In order to achieve the above-mentioned object, according to another aspect of the present invention, a computer program product is further provided, comprising a computer program / instruction, which implements the steps of the above-mentioned face recognition method when executed by a processor.

[0037] The beneficial effects of the present invention are:

[0038] The present invention overcomes the problem of reduced face recognition accuracy of existing face recognition algorithms caused by dim ambient light or uneven light source distribution, and proposes a solution for channel-level fusion of visible light images and infrared images. The present invention utilizes the characteristics of infrared imaging technology such as long working range and strong anti-interference ability, and combines visible light images with infrared images for face recognition, thereby improving the accuracy of face recognition under poor lighting conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0040] Figure 1 is a first flow chart of the face recognition method according to an embodiment of the present invention;

[0041] Figure 2 is a second flow chart of the face recognition method according to an embodiment of the present invention;

[0042] Figure 3 is a third flow chart of the face recognition method according to an embodiment of the present invention;

[0043] Figure 4 is a fourth flow chart of the face recognition method according to an embodiment of the present invention;

[0044] Figure 5 is a fifth flow chart of the face recognition method according to an embodiment of the present invention;

[0045] Figure 6 is a schematic diagram of image fusion according to an embodiment of the present invention;

[0046] Figure 7 This is a second structural block diagram of the face recognition device according to an embodiment of the present invention;

[0047] Figure 8 Schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0049] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0050] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or are inherent to these processes, methods, products or apparatuses.

[0051] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments of the present invention can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0052] It should be noted that the acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0053] It should be noted that the face recognition method and device of the present invention can be used in the financial field, and can also be used in any field other than the financial field. The application field of the face recognition method and device of the present invention is not limited.

[0054] Currently, most facial recognition algorithms use only visible light images for face recognition. This invention overcomes the problem of reduced accuracy in existing facial recognition algorithms caused by dim ambient light or uneven light distribution. It proposes a channel-level adaptive fusion technology for visible light and infrared images. Through lightweight convolutional neural network training, this method is simple to deploy, does not require image calibration before inputting facial images into the network, and can effectively improve facial recognition accuracy. Furthermore, this invention overcomes the current shortage of infrared facial images and proposes an adaptive infrared image enhancement algorithm that increases the amount of data while increasing the information content of infrared images.

[0055] Figure 1 This is a first flow chart of the face recognition method according to an embodiment of the present invention. Figure 1 As shown, in one embodiment of the present invention, the face recognition method of the present invention includes steps S101 to S104.

[0056] Step S101 , obtaining a visible light face image and an infrared face image of a target to be identified.

[0057] In the present invention, while simultaneously collecting visible light facial images of a target, the present invention also collects infrared facial images of the target. In one embodiment of the present invention, the infrared facial images can be collected using an existing infrared camera. The present invention also constructs a visible light facial database and an infrared facial database.

[0058] Step S102 , performing enhancement processing on the infrared face image to obtain a processed infrared face image.

[0059] Step S103 , performing channel fusion on the visible light face image and the processed infrared face image to obtain a fused image.

[0060] Step S104: input the fused image into a preset face recognition model to obtain a face recognition result of the target to be identified output by the face recognition model, wherein the face recognition model is obtained by training a preset machine learning model using training samples, and the training samples include: a fused image obtained by channel fusion of a visible light face image used for model training and a corresponding enhanced infrared face image.

[0061] like Figure 2 As shown, in one embodiment of the present invention, the above-mentioned step S102 of enhancing the infrared facial image specifically includes steps S201 to S203.

[0062] Step S201 , performing image inversion processing on the infrared face image to obtain a first processed image.

[0063] It should be noted that the image reversal processing of the present invention refers to image inversion processing. Inversion processing is an existing processing method in the field of image processing. Since the mainstream face recognition algorithm is applied in scenarios based on visible light images and is not suitable for identifying infrared targets, it is necessary to preprocess the infrared face image to achieve the purpose of making the infrared image closer to the visible light image. The present invention uses the idea of ​​domain migration to enable the network to be more adaptable to the processed infrared image. The formula for the inversion processing operation is:

[0064] f:x p =1-x

[0065] Step S202 : Processing the infrared face image using an adaptive contrast-limited histogram equalization algorithm to obtain a second processed image.

[0066] Step S203 , performing channel fusion on the infrared facial image, the first processed image, and the second processed image as a channel to obtain the processed infrared facial image.

[0067] In the present invention, the infrared facial image, the first processed image and the second processed image are each taken as a channel for channel fusion, and the obtained processed infrared facial image is a three-channel image.

[0068] like Figure 3As shown, in one embodiment of the present invention, the above-mentioned step S202 uses an adaptive contrast-limited histogram equalization algorithm to process the infrared face image, which specifically includes steps S301 to S303.

[0069] Step S301 , calculating the signal-to-noise ratio of the entire infrared face image and the signal-to-noise ratio of each region in the infrared face image.

[0070] Step S302 : Calculate the ratio of the signal-to-noise ratio of each region to the signal-to-noise ratio of the entire image, and determine the threshold corresponding to each region according to the ratio.

[0071] Step S303 : reallocate pixels to the infrared face image according to the threshold, and then perform histogram processing on each area.

[0072] The adaptive contrast-limited histogram equalization algorithm of the present invention is an improvement on the CLAHE (contrast-limited histogram equalization) algorithm. Since the contrast of infrared images is relatively low, their grayscale distribution is usually distributed in a narrow area. The use of histogram equalization can make the grayscale distribution of infrared images more uniform, thereby achieving the effect of increasing image detail information. The steps of histogram equalization are: first, calculate the grayscale probability of each pixel on the image, and then calculate the distribution after pixel transformation. The CLAHE algorithm is an improvement on histogram equalization. It divides the image into different areas, limits the contrast of each area, and evenly distributes the parts greater than the threshold according to the threshold, and then performs histogram equalization on the evenly distributed areas. However, this approach uses the same threshold for all areas, which will result in insufficient noise suppression in areas with a lot of noise.

[0073] This paper proposes a signal-to-noise ratio (SNR)-based CLAHE image enhancement method. The method first calculates the SNR of the entire image and each region. The threshold for each region is then set to the ratio of the sub-image's SNR to the overall SNR. The CLAHE threshold is then determined based on this ratio, and pixels are redistributed according to the threshold. Histogram equalization is then performed on each region. By combining the SNR with the CLAHE method, this method can adaptively adjust the threshold for each region, enhancing image detail while suppressing noise.

[0074] like Figure 4 As shown, in one embodiment of the present invention, the above-mentioned step S103 of performing channel fusion on the visible light face image and the processed infrared face image specifically includes steps S401 to S403.

[0075] Step S401 , calculating the information entropy of the visible light face image and the processed infrared face image respectively.

[0076] Step S402 : determining weights corresponding to the visible light facial image and the processed infrared facial image according to the information entropy.

[0077] Step S403 : performing channel fusion on the visible light face image and the processed infrared face image according to the weights.

[0078] In one embodiment of the present invention, the visible light facial image contains three RGB channels, and the processed infrared facial image is also a three-channel image. The present invention performs channel fusion on the visible light facial image and the processed infrared facial image, and the obtained fused image is a six-channel image.

[0079] When the ambient light is uneven or the light is too strong during shooting, the image will be overexposed or too dark. The visible light image captured at this time is not conducive to face recognition. At the same time, if the image is out of focus when shooting, resulting in blurred images, the captured image is also unusable. When the above situation occurs, the histogram distribution of the visible light image will be more concentrated. For the above situation, the image entropy can be calculated to evaluate. The image information entropy is expressed as the bit average of the image grayscale set, which describes the average amount of information of the image source. It can represent the degree of aggregation of the image grayscale distribution, so it can be used as an evaluation of whether the image is blurred and the environmental conditions. The calculation formula for the image entropy is:

[0080]

[0081] The present invention combines information entropy to adaptively fuse infrared images and visible light images. First, the information entropy of the image is calculated based on the histogram distribution of the image, and the information entropy is normalized. If the information entropy of the visible light is greater than that of the infrared image, it means that the light distribution of the visible light image is more uniform and the picture is clearer. At this time, the weight of the visible light image is set to the information entropy calculated for the visible light image plus the information entropy of the two. In this way, when the visible light image is clear and well-lit during the day, the visible light image is used as the main method for face recognition. When the visible light image is blurred or the light is insufficient, the infrared image is used as the main method for face recognition.

[0082] In another embodiment of the present invention, the above-mentioned step S103 of channel-fusing the visible light facial image and the processed infrared facial image specifically includes the following steps: respectively calculating the information entropy of the visible light facial image and the infrared facial image; determining the weights corresponding to the visible light facial image and the infrared facial image according to the information entropy; and channel-fusing the visible light facial image and the processed infrared facial image according to the weights.

[0083] Figure 6Schematic diagram of image fusion according to an embodiment of the present invention. Figure 6 As shown, the present invention first performs image inversion processing on the infrared facial image to obtain a first processed image, then processes the infrared facial image using an adaptive contrast-limited histogram equalization algorithm to obtain a second processed image. Finally, the infrared facial image, the first processed image, and the second processed image are each treated as a channel for channel fusion to obtain the processed infrared facial image. Weights corresponding to the visible light facial image and the processed infrared facial image are then determined. Finally, the visible light facial image and the processed infrared facial image are channel fused based on the weights.

[0084] like Figure 5 As shown, in one embodiment of the present invention, the face recognition method of the present invention further includes step S501 and step S502.

[0085] Step S501: Obtain the training sample.

[0086] Step S502: Use the training samples to train the preset machine learning model to obtain the face recognition model.

[0087] In one embodiment of the present invention, the preset machine learning model includes: a YOLOv5s algorithm model; CIOU is used as a loss function when performing model training.

[0088] In one embodiment of the present invention, the machine learning model in the present invention can also be replaced by other network models. The present invention only uses a network model with relatively high accuracy in the current open source as a face recognition model. Because this network is relatively flexible, its backbone network can be replaced at will. While ensuring accuracy, the network is relatively lightweight. On this basis, the original loss function is replaced and the CIOU loss function is used for training.

[0089] It can be seen from the above embodiments that the face recognition method of the present invention achieves at least the following beneficial effects:

[0090] 1. Currently, mainstream face recognition algorithms all use visible light images for face recognition, while few rely on infrared images. A limitation of using visible light images for face recognition is that their performance is significantly affected by environmental conditions. Recognition based solely on visible light images or videos is easily affected by lighting variations. Recognition rates can be significantly reduced in dim or uneven lighting conditions. Infrared imaging technology, on the other hand, offers advantages such as long range and strong anti-interference capabilities, and can also detect and recognize faces even in low lighting conditions. However, because infrared light has difficulty penetrating glass, if the subject is wearing glasses, the infrared image will appear as if they are wearing sunglasses, resulting in loss of eye information. Therefore, infrared images alone cannot be used for face recognition. This invention proposes a method for adaptive channel-level fusion of visible light and infrared images. Combining visible light and infrared images for face recognition effectively addresses the problem of reduced face recognition rates when using visible light images alone in conditions of insufficient or uneven lighting, enabling face recognition algorithms to perform all-weather face recognition.

[0091] 2. Currently, infrared facial data is relatively scarce, and infrared images are often affected by infrared detectors and environmental noise during acquisition, resulting in poor image quality and low signal-to-noise ratio. Therefore, data expansion is crucial in situations where data is scarce. This paper proposes an adaptive contrast-limited histogram equalization technique that combines signal-to-noise ratio (SNR) and CLAHE, as well as an inversion algorithm for infrared image preprocessing. This technique effectively improves infrared image quality while addressing the scarcity of infrared images.

[0092] 3. While traditional facial recognition systems offer fast recognition speeds, they are highly limited and easily affected by other factors, resulting in reduced accuracy. Deep learning-based facial recognition systems, while highly accurate, are difficult to deploy on mobile devices due to their complex network structure and lengthy training times. This paper uses the YOLOv5s algorithm as the facial recognition model and CIOU as the loss function, making the entire algorithm more convenient to deploy.

[0093] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0094] Based on the same inventive concept, an embodiment of the present invention further provides a face recognition device, which can be used to implement the face recognition method described in the above embodiment, as described in the following embodiment. Since the principle of solving the problem by the face recognition device is similar to that of the face recognition method, the embodiment of the face recognition device can refer to the embodiment of the face recognition method, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements the predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0095] Figure 7 FIG. 1 is a structural block diagram of a face recognition device according to an embodiment of the present invention. Figure 7 As shown, in one embodiment of the present invention, the face recognition device of the present invention includes:

[0096] Image acquisition unit 1, used to acquire visible light face image and infrared face image of the target to be identified;

[0097] Infrared image processing unit 2, used for performing enhancement processing on the infrared face image to obtain a processed infrared face image;

[0098] An image channel fusion unit 3 is configured to perform channel fusion on the visible light face image and the processed infrared face image to obtain a fused image;

[0099] The face recognition unit 4 is used to input the fused image into a preset face recognition model to obtain the face recognition result of the target to be identified output by the face recognition model, wherein the face recognition model is obtained by training a preset machine learning model using training samples, and the training samples include: a fused image obtained by channel fusion of a visible light face image used for model training and a corresponding enhanced infrared face image.

[0100] In one embodiment of the present invention, the infrared image processing unit 2 specifically includes:

[0101] a first processing module, configured to perform image inversion processing on the infrared face image to obtain a first processed image;

[0102] a second processing module, configured to process the infrared face image using an adaptive contrast-limited histogram equalization algorithm to obtain a second processed image;

[0103] The channel fusion module is used to perform channel fusion on the infrared face image, the first processed image and the second processed image as a channel to obtain the processed infrared face image.

[0104] In one embodiment of the present invention, the second processing module specifically includes:

[0105] a signal-to-noise ratio calculation submodule, configured to calculate the signal-to-noise ratio of the entire infrared face image and the signal-to-noise ratio of each region in the infrared face image;

[0106] A threshold determination submodule is used to calculate the ratio between the signal-to-noise ratio of each region and the signal-to-noise ratio of the entire image, and determine the threshold corresponding to each region according to the ratio;

[0107] The processing submodule is used to reallocate pixels for the infrared face image according to the threshold value, and then perform histogram processing on each area.

[0108] In one embodiment of the present invention, the image channel fusion unit 3 specifically includes:

[0109] A first information entropy calculation module is used to calculate the information entropy of the visible light face image and the processed infrared face image respectively;

[0110] a first weight determination module, configured to determine weights corresponding to the visible light facial image and the processed infrared facial image, respectively, based on the information entropy;

[0111] The first fusion module is configured to perform channel fusion on the visible light face image and the processed infrared face image according to the weights.

[0112] In another embodiment of the present invention, the image channel fusion unit 3 specifically includes:

[0113] A second information entropy calculation module is used to calculate the information entropy of the visible light face image and the infrared face image respectively;

[0114] a second weight determination module, configured to determine weights corresponding to the visible light facial image and the infrared facial image respectively according to the information entropy;

[0115] The second fusion module is used to perform channel fusion on the visible light face image and the processed infrared face image according to the weight.

[0116] In one embodiment of the present invention, the face recognition device of the present invention includes:

[0117] A training sample acquisition unit, configured to acquire the training sample;

[0118] The model training unit is used to train the preset machine learning model using the training samples to obtain the face recognition model.

[0119] In one embodiment of the present invention, the preset machine learning model specifically adopts the YOLOv5s algorithm model, and CIOU is used as the loss function when performing model training.

[0120] In order to achieve the above object, according to another aspect of the present application, a computer device is also provided. Figure 8 As shown, the computer device includes a memory, a processor, a communication interface and a communication bus. The memory stores a computer program that can be run on the processor. When the processor executes the computer program, the steps in the above embodiment method are implemented.

[0121] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0122] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and units, such as the corresponding program units in the above-described method embodiments of the present invention. The processor executes the non-transitory software programs, instructions, and modules stored in memory to perform various processor functions and work data processing, thereby implementing the methods in the above-described method embodiments.

[0123] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0124] The one or more units are stored in the memory, and when executed by the processor, perform the method in the above embodiment.

[0125] The specific details of the above-mentioned computer device can be understood by referring to the corresponding descriptions and effects in the above-mentioned embodiments, and will not be repeated here.

[0126] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and the computer program implements the steps in the above-mentioned face recognition method when executed in a computer processor. Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory (Flash Memory), a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0127] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a computer program product is further provided, comprising a computer program / instruction, which implements the steps of the above-mentioned face recognition method when executed by a processor.

[0128] Obviously, those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using a general-purpose computing device. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they can be implemented using program code executable by a computing device, which can then be stored in a storage device and executed by the computing device. Alternatively, they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0129] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A face recognition method, characterized in that: include: Obtaining visible light face images and infrared face images of the target to be identified; Performing image inversion processing on the infrared face image to obtain a first processed image; Calculating the signal-to-noise ratio of the entire infrared face image and the signal-to-noise ratio of each region in the infrared face image; Calculating the ratio of the signal-to-noise ratio of each region to the signal-to-noise ratio of the entire image, and determining the threshold corresponding to each region according to the ratio; reallocating pixels for the infrared face image according to the threshold, and then performing histogram processing on each region to obtain a second processed image; performing channel fusion on the infrared face image, the first processed image, and the second processed image, each as a channel, to obtain a processed infrared face image; Performing channel fusion on the visible light face image and the processed infrared face image to obtain a fused image; The fused image is input into a preset face recognition model to obtain a face recognition result of the target to be identified output by the face recognition model, wherein the face recognition model is obtained by training a preset machine learning model using training samples, and the training samples include: a fused image obtained by channel fusion of a visible light face image used for model training and a corresponding enhanced infrared face image.

2. The face recognition method according to claim 1, characterized in that The performing channel fusion on the visible light face image and the processed infrared face image specifically includes: Calculating the information entropy of the visible light face image and the processed infrared face image respectively; Determining weights corresponding to the visible light facial image and the processed infrared facial image according to the information entropy; Channel fusion is performed on the visible light face image and the processed infrared face image according to the weight.

3. The face recognition method according to claim 1, characterized in that The performing channel fusion on the visible light face image and the processed infrared face image specifically includes: Calculating the information entropy of the visible light face image and the infrared face image respectively; Determining weights corresponding to the visible light facial image and the infrared facial image respectively according to the information entropy; Channel fusion is performed on the visible light face image and the processed infrared face image according to the weight.

4. The face recognition method according to claim 1, characterized in that Also includes: Obtaining the training sample; The training samples are used to train a preset machine learning model to obtain the face recognition model.

5. The face recognition method according to claim 4, characterized in that: The preset machine learning model includes: a YOLOv5s algorithm model; CIOU is used as the loss function when performing model training.

6. A face recognition device, characterized in that: include: An image acquisition unit, configured to acquire a visible light face image and an infrared face image of a target to be identified; an infrared image processing unit, configured to perform image inversion processing on the infrared facial image to obtain a first processed image; calculate the signal-to-noise ratio of the entire infrared facial image and the signal-to-noise ratio of each region in the infrared facial image; calculate the ratio between the signal-to-noise ratio of each region and the signal-to-noise ratio of the entire image, and determine a threshold value corresponding to each region based on the ratio; reallocate pixels to the infrared facial image based on the threshold value, and then perform histogram processing on each region to obtain a second processed image; and perform channel fusion on the infrared facial image, the first processed image, and the second processed image, each as a channel, to obtain a processed infrared facial image; An image channel fusion unit, configured to perform channel fusion on the visible light face image and the processed infrared face image to obtain a fused image; A face recognition unit is used to input the fused image into a preset face recognition model to obtain a face recognition result of the target to be identified output by the face recognition model, wherein the face recognition model is obtained by training a preset machine learning model using training samples, and the training samples include: a fused image obtained by channel fusion of a visible light face image used for model training and a corresponding enhanced infrared face image.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Face recognition method and system based on visible light image and infrared image fusion

    CN108921100A