Face anti-cheating method, device, computer equipment and storage medium

By obtaining the fusion processing of infrared and color image features and inter-frame optical flow features, it solves the problems of long face anti-cheating and low recognition accuracy in the existing technology, and achieves fast and accurate living face recognition.

CN113822222BActive Publication Date: 2024-09-06CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111183527.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-11
Publication Date
2024-09-06
Estimated Expiration
2041-10-11

AI Technical Summary

Technical Problem

Existing face anti-cheating technology is time-consuming and has low recognition accuracy, and is prone to errors especially in multi-person recognition scenarios and long-distance recognition.

Method used

By acquiring the infrared image and color image of the person to be identified, extracting the infrared image features and color image features, and calculating the inter-frame optical flow features, and then inputting the fusion into the classifier for processing, it can determine whether the face is alive or cheating.

Benefits of technology

It achieves fast and accurate face recognition, prevents face cheating, is suitable for multi-person recognition scenarios and long-distance recognition, and reduces the false recognition rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113822222B
    Figure CN113822222B
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence, and discloses a face anti-cheating method, device, computer equipment and storage medium. The method comprises: obtaining a plurality of infrared images and a plurality of color images of a person to be identified in the same time interval; extracting infrared image features of the person to be identified from the infrared image; extracting color image features of the person to be identified from the color image; calculating a plurality of inter-frame optical flow features of a plurality of color images; fusing infrared image features, color image features and inter-frame optical flow features to obtain fusion features; inputting the fusion features into a preset classifier for processing, and outputting a classification result of whether the face of the person to be identified is a live face or a cheating face. The present invention can comprehensively judge whether the face of the person to be identified is a live face or a cheating face, with high recognition accuracy and short time consumption. In addition, the scheme of the present invention can be applied to the fields of smart cities, smart education, etc., which is conducive to promoting the construction of smart cities or smart education.
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, and in particular to a face anti-cheating method, device, computer equipment and storage medium. Background Art

[0002] With the continuous development of Internet technology, video surveillance has been widely used in various fields. Many video surveillance applications urgently need a fast face recognition technology that can quickly and accurately confirm the identity of people at a long distance and realize intelligent early warning. In order to improve the accuracy and security of face recognition, face anti-cheating technology has emerged. Face anti-cheating is a technology used in face recognition scenarios to prevent impersonation of other people's faces. Usually, impersonating someone else's face is to use a mobile phone, tablet, printed paper, etc. to show the recognition system a photo or video of someone else's face.

[0003] The existing technology mainly uses interactive verification to prevent facial cheating, that is, the client sends instructions such as blinking, turning the head, raising the head, opening the mouth, etc. to the person being identified. If the corresponding action of the person being identified is not detected, it is considered cheating and will not be passed. This method uses human-computer interaction to perform facial anti-cheating verification, which is time-consuming and only suitable for one-to-one scenarios, not for scenarios with multiple people being identified at the same time. The different performances of infrared light irradiated on real people, mobile phones, and paper are used to determine whether cheating is occurring. Although this method can support scenarios with multiple people being identified, it often results in incorrect identification when the distance between the person being identified and the camera is slightly farther.

[0004] It can be seen that the existing face anti-cheating methods have the problems of being time-consuming and having low recognition accuracy. Summary of the invention

[0005] Based on this, it is necessary to provide a face anti-cheating method, device, computer equipment and storage medium to address the above technical problems, so as to solve the problems of long time consumption and low recognition accuracy in existing face anti-cheating methods.

[0006] A face anti-cheating method, comprising:

[0007] Acquire a plurality of infrared images and a plurality of color images of the person to be identified in the same time interval;

[0008] Extracting infrared image features of the person to be identified from the infrared image; extracting color image features of the person to be identified from the color image;

[0009] Calculating a plurality of inter-frame optical flow features of the plurality of color images;

[0010] The infrared image features, color image features and inter-frame optical flow features are fused to obtain fused features; the fused features are input into a preset classifier for processing, and a classification result is outputted as to whether the face of the person to be identified is a living face or a cheating face.

[0011] A face anti-cheating device, comprising:

[0012] An image acquisition module is used to acquire a plurality of infrared images and a plurality of color images of a person to be identified in the same time interval;

[0013] A feature extraction module, used to extract the infrared image features of the person to be identified from the infrared image; and to extract the color image features of the person to be identified from the color image;

[0014] A calculation module, used for calculating a plurality of inter-frame optical flow features of the plurality of color images;

[0015] The classification module is used to fuse the infrared image features, color image features and inter-frame optical flow features to obtain fused features; input the fused features into a preset classifier for processing, and output a classification result of whether the face of the person to be identified is a living face or a cheating face.

[0016] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-mentioned face anti-cheating method when executing the computer-readable instructions.

[0017] One or more readable storage media storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the above-mentioned face anti-cheating method.

[0018] The above-mentioned face anti-cheating method, device, computer equipment and storage medium obtain several infrared images and several color images of the person to be identified in the same time period; extract the infrared image features of the person to be identified from the infrared images; extract the color image features of the person to be identified from the color images; calculate several inter-frame optical flow features of the several color images; fuse the infrared image features, color image features and inter-frame optical flow features to obtain fused features; input the fused features into a preset classifier for processing, and output a classification result of whether the face of the person to be identified is a living face or a cheating face. The present invention can avoid the face cheating operation of the person to be identified during the identification process by collecting infrared images and color images of the person to be identified in the same time interval, so as to effectively prevent face cheating, and extract the infrared image features of the person to be identified (face area) in the infrared image and the color image features of the person to be identified (face area) in the color image. At the same time, the inter-frame optical flow features of the color image (which can represent the dynamic changes of the person to be identified in the above time interval, such as the deflection angle of the face, etc.) are calculated, and the above-mentioned infrared image features, color image features and inter-frame optical flow features (two static features and one dynamic feature) are integrated, so as to comprehensively judge whether the face of the person to be identified is a living face or a cheating face, and the recognition accuracy is high and the time consumption is short. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0020] Figure 1 Schematic diagram of the application environment of the face anti-cheating method in one embodiment of the present invention;

[0021] Figure 2 is a flowchart of a face anti-cheating method in one embodiment of the present invention;

[0022] Figure 3 is a schematic diagram of the structure of a face anti-cheating device in one embodiment of the present invention;

[0023] Figure 4 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.

[0025] Artificial intelligence is a branch of computer science, and research in this field includes robots, speech, biometrics (including face recognition, etc.), natural language processing and expert systems, etc. The present invention relates to face recognition in biometrics. The proposed face anti-cheating method can avoid face cheating operations of the person to be identified during the identification process by collecting infrared images and color images of the person to be identified in the same time interval, so as to effectively prevent face cheating, and extract infrared image features of the person to be identified (face area) in the infrared image and color image features of the person to be identified (face area) in the color image. At the same time, the inter-frame optical flow features of the color image are calculated (which can represent the dynamic changes of the person to be identified in the above time interval, such as the deflection angle of the face, etc.), and the above infrared image features, color image features and inter-frame optical flow features (two static features and one dynamic feature) are integrated, so as to comprehensively judge whether the face of the person to be identified is a living face or a cheating face, with high recognition accuracy and short time consumption.

[0026] The face anti-cheating method provided in this embodiment can be applied in the following aspects: Figure 1 In an application environment, a client communicates with a server. The client includes but is not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.

[0027] In one embodiment, if Figure 2 As shown, a face anti-cheating method is provided, and the method is applied in Figure 1 The server in the example is used as an example to illustrate the following steps:

[0028] Step S10: Acquire an infrared image and a color image of the person to be identified in the same time period.

[0029] Among them, the time interval can be set according to actual needs, such as 10s or 20s. The same time interval indicates that the time difference between the acquisition time of the infrared image and the acquisition time of the color image is less than the time length of the time interval. The acquisition time of the infrared image and the acquisition time of the color image may be equal or unequal. Exemplarily, the preset time interval is 10 seconds, the acquisition time of the infrared image is the 1st second within this time interval, and the acquisition time of the color image is the 5th second within this time interval. The time difference between the acquisition time of the infrared image and the acquisition time of the color image is 4 seconds, which is less than the time length of the time interval of 10 seconds.

[0030] As an example, an infrared image and a color image of a person to be identified can be simultaneously captured by a preset infrared camera device. For example, the infrared image and the color image of the person to be identified can be simultaneously captured at a capture rate of 25 frames / second, and 25 frames of infrared images and 25 frames of color images of the person to be identified can be obtained after 1 second.

[0031] As another example, the infrared image and color image of the person to be identified may be collected by different camera devices, for example, camera device A may be used to collect the infrared image of the person to be identified, and camera device B may be used to collect the color image of the person to be identified.

[0032] By acquiring the infrared image and color image of the person to be identified within the same time interval, the person to be identified can be prevented from performing facial cheating operations during the identity recognition process, because it is almost impossible to implement cheating actions in such a short time interval. This can effectively prevent facial cheating and impersonating others, and further greatly reduce the possibility of leakage of users' personal information, which is beneficial to protecting users' personal information security.

[0033] Step S20: extracting infrared image features of the person to be identified from the infrared image; and extracting color image features of the person to be identified from the color image.

[0034] Among them, the infrared image features can be obtained by inputting the infrared image into a preset convolutional neural network to obtain an N-dimensional vector (including N floating-point numbers). The N-dimensional vector may contain the color tone, clarity, facial condition, background condition, etc. of the infrared image.

[0035] The color image features can be obtained by inputting the color image into a preset convolutional neural network to obtain another N-dimensional vector (including N floating-point numbers). The N-dimensional vector may contain the color image's hue, clarity, facial condition, background condition, etc.

[0036] Step S30: Calculate the inter-frame optical flow features of the color image.

[0037] Among them, the inter-frame optical flow feature is a common feature in the field of image processing. It is used to indicate the direction of movement of an object. Usually, two frames of images are used to calculate the movement of the object. The two frames of images can be two consecutive frames or two frames separated by several frames. The relevant functions of the open source tool opencv (an open source function library for image processing, analysis, and machine vision) can be directly called to calculate the inter-frame optical flow features of several color images.

[0038] As an example, assume that in step S10, 25 color images of the person to be identified are acquired within 1 second, and the 25 color images are numbered in chronological order, marked as the 1st to 25th frames, and an inter-frame optical flow feature is calculated every 5 color image frames. Specifically, every 5 frames, the inter-frame optical flow features of the color images of the 1st and 5th frames, the 5th and 10th frames, the 10th and 15th frames, the 15th and 20th frames, and the 20th and 25th frames are calculated, and a total of 5 inter-frame optical flow features are obtained.

[0039] Step S40, the infrared image features, the color image features and the inter-frame optical flow features are fused to obtain fused features; the fused features are input into a preset classifier for processing, and a classification result of whether the face of the person to be identified is a living face or a cheating face is output.

[0040] Among them, the preset classifier (specifically the classification algorithm model) can be an algorithm model such as a decision tree, logistic regression, naive Bayes, or a neural network.

[0041] As an example, the infrared image features, color image features and inter-frame optical flow features can be input into a preset neural network model for fusion to obtain fusion features. The fusion features are input into a preset classifier for processing to calculate the probability value of the face of the person to be identified being a live face and the probability value of the face of a cheating person, and based on the two probability values, determine whether the face of the person to be identified is a live face or a cheating face (i.e., obtain a classification result).

[0042] The present invention can avoid the person to be identified from performing face cheating operations during the identification process by collecting infrared images and color images of the person to be identified in the same time interval, thereby effectively preventing face cheating, and extracting infrared image features of the person to be identified (face area) in the infrared image and color image features of the person to be identified (face area) in the color image. At the same time, the inter-frame optical flow features of the color image (which can represent the dynamic changes of the person to be identified in the above time interval, such as the deflection angle of the face, etc.) are calculated, and the above-mentioned infrared image features, color image features and inter-frame optical flow features (two static features and one dynamic feature) are integrated, so as to comprehensively judge whether the face of the person to be identified is a living face or a cheating face, with high recognition accuracy and short time consumption.

[0043] In one embodiment, in the above step S10, obtaining an infrared image and a color image of a person to be identified in the same time interval includes:

[0044] When the preset shooting device detects that an object enters the preset shooting area, infrared rays are emitted to the object, and diffuse reflection signals of infrared rays reflected by the object are received to form an infrared image; wherein the object includes a person to be identified;

[0045] Within a preset time interval, a color image of the object is collected.

[0046] The objects include a person to be identified (eg, employee A) and background objects around the person to be identified (eg, vehicles, indoor walls, etc.).

[0047] The preset shooting area may be an area within the shooting field of view of a camera device (such as an infrared camera).

[0048] As an example, when the preset shooting device detects that employee A enters its shooting field of view, it transmits infrared rays to employee A and receives the infrared diffuse reflection signal reflected by employee A to form an infrared image.

[0049] Here, the preset time interval refers to the time interval in the above step S10.

[0050] For example, assuming that the preset time interval is 10 seconds, when it is detected that employee A enters the shooting field of view of the preset shooting device, infrared rays are emitted to employee A, and the infrared diffuse reflection signal reflected by employee A is received, and the infrared image is formed at the 3rd second in the preset time interval, then the color image of employee A can be collected within these 10 seconds. For example, the color image of employee A can be collected at the 4th second in the preset time interval.

[0051] In one embodiment, the above steps of collecting a color image of the object within a preset time interval specifically include:

[0052] The weather information of the area where the shooting device is installed at the current shooting time, the time point when the infrared diffuse reflection signal reflected by the object is received, and the light intensity of the shooting area are collected.

[0053] Among them, weather information includes whether the weather is cloudy or sunny, ultraviolet intensity, etc.

[0054] The light intensity of the shooting area usually refers to the luminous flux of visible light in the shooting area, that is, a measure of the degree of illumination of the shooting area.

[0055] Generally, the effect of color images is related to the shooting weather, time, light intensity of the shooting area, etc. For example, when the weather is clear, the shooting area is well illuminated, and the shooting time is before 11 am and after 2 pm, the light is relatively soft, and the collected color images are more saturated and clear.

[0056] According to the weather information, time point and light intensity, a corresponding shooting mode is matched for the shooting device so that the shooting device starts the shooting mode and collects a color image of the object within a preset time interval.

[0057] As an example, a correspondence table of different weather information, time points, light intensity combinations and shooting modes may be constructed in advance. Specifically, a correspondence table as shown in Table 1 below may be constructed.

[0058] Table 1 Correspondence between different weather information, time points, light intensity and shooting modes

[0059]

[0060] It should be noted that the corresponding relationship between the above-mentioned different weather information, time points and light intensity combinations and shooting modes can be flexibly designed according to actual conditions and is not limited in this embodiment.

[0061] As an example, when the corresponding shooting mode is matched to shooting without fill light for the shooting device according to the weather information, time point and light intensity, the shooting device can be used to capture the color image of the object within a preset time interval.

[0062] By matching the corresponding shooting mode to the shooting device according to different weather information, time points and light intensities, the acquisition quality of color images can be improved, and the accuracy of subsequent face detection can be improved, thereby improving the recognition rate of face anti-cheating.

[0063] In one embodiment, in the above step S20, extracting the infrared image features of the person to be identified from the infrared image; and extracting the color image features of the person to be identified from the color image include:

[0064] A first size of an infrared face region of the person to be identified in the infrared image and a second size of a color face region in the color image are determined.

[0065] As an example, the infrared face area of ​​the person to be identified in the infrared image can be first detected and determined by a face detector, and then the coordinates of the boundary pixel points of the infrared face area can be obtained. According to the coordinates of the boundary pixel points, the size of the infrared face area (generally the width and height) can be calculated and determined.

[0066] Similarly, the size of the color face region can be determined by referring to the above method for determining the size of the infrared face region.

[0067] According to a preset size modification value, the first size is resized to obtain an adjusted infrared face area; and the second size is resized to obtain an adjusted color face area.

[0068] The preset size modification value refers to the modification value of the width and / or height. For example, the original size of the infrared face area is 700*1080 pixels (width*height), and the preset modification size may be 1400*2160 pixels (width*height).

[0069] As an example, combined with the above example, the original size of the infrared face area 700*1080 pixels (width*height) can be adjusted to 1400*2160 pixels (width*height) according to the preset modification size 1400*2160 pixels (width*height) to obtain the adjusted infrared face area.

[0070] Similarly, the size adjustment of the color face region can be performed by referring to the size adjustment method of the infrared face region, which will not be described in detail here.

[0071] As another example, a linear interpolation method may be used to enlarge or reduce the size of the infrared face region or the color face region.

[0072] As another example, you can also use preset image processing software (such as Photoshop software, etc.) to enlarge the infrared face area and the color face area according to a preset enlargement multiple (for example, 2 times, 3 times, etc.) to obtain an adjusted infrared face area and an adjusted color face area.

[0073] The infrared image features of the person to be identified are extracted from the adjusted infrared face area; and the color image features of the person to be identified are extracted from the adjusted color face area.

[0074] As an example, a preset neural network can be used to extract the infrared image features of the person to be identified from the adjusted infrared face area, and to extract the color image features of the person to be identified from the adjusted color face area. The specific implementation process can refer to the existing neural network implementation process for extracting facial features, and the details will not be repeated here.

[0075] In one embodiment, the above steps of extracting the infrared image features of the person to be identified from the adjusted infrared face area; and extracting the color image features of the person to be identified from the adjusted color face area include:

[0076] The coordinates of the boundary pixels of the adjusted infrared face area are marked to determine a first extraction area, and the coordinates of the boundary pixels of the adjusted color face area are marked to determine a second extraction area.

[0077] As an example, by marking the coordinates of the boundary pixel points of the adjusted infrared face area, the marking may be performed by highlighting the color or adding marking symbols (such as numbers, letters, etc.). The adjusted face area is a rectangular or square area. When marking, you can choose to only mark the pixel point coordinates of the four corner vertices of the infrared face area, and then connect the pixel point coordinates of the four corner vertices to determine the first extraction area. Of course, when marking, you can also mark the coordinates of each pixel point of the boundary of the infrared face area to determine the first extraction area.

[0078] Similarly, the method for determining the second extraction area can refer to the method for determining the first extraction area mentioned above, which will not be repeated here.

[0079] The first extraction area is extracted from the infrared image to obtain an infrared face image; and the second extraction area is extracted from the color image to obtain a color face image.

[0080] As an example, after the first extraction area in the infrared image is determined through the above operation, the infrared image can be segmented with the first extraction area as the boundary to obtain the partial image to be extracted within the first extraction area, i.e., the infrared face image, and other parts outside the first extraction area, i.e., the non-extracted partial image.

[0081] Similarly, the method for obtaining a color face image can refer to the above-mentioned method for extracting an infrared face image, which will not be described in detail here.

[0082] In one embodiment, in the above step S30, calculating the inter-frame optical flow features of the color image includes:

[0083] A first frame image and a second frame image are extracted from the plurality of color images at a preset time interval; face detection is performed on the first frame image and the second frame image to determine a first image region in the first frame image and a second image region in the second frame image of the same person to be identified.

[0084] In the embodiment of the present invention, the acquisition time of the color image is usually 25 frames / second, that is, one frame is acquired every 0.04 seconds. Therefore, the preset time interval here can be 0.04 seconds, 0.08 seconds, 0.12 seconds, 0.16 seconds, etc., that is, the first frame image and the second frame image can be two consecutive frames, or there can be several frames in between. For example, the first frame image can be a color image acquired at 0 seconds, and the second frame image can be a color image acquired at 0.04 seconds. For another example, the first frame image is a color image acquired at 0 seconds, and the second frame image is a color image acquired at 0.16 seconds.

[0085] Since the color image and the infrared image are acquired in the same time interval, the position of the same person to be identified in the color image and the infrared image is basically the same. Assuming that two face frames are detected in both the color image and the infrared image, and the two face frames are located at the upper left corner and the lower right corner of the image respectively, then the face frame at the upper left corner of the color image and the infrared image can be determined as the face image area of ​​one person to be identified, and the face frame at the lower right corner of the color image and the infrared image can be determined as the face image area of ​​another person to be identified.

[0086] By using the above method, the first image region of the same person to be identified in the first frame image and the second image region in the second frame image can be determined.

[0087] The first image region is enlarged, and the enlarged first image region is extracted from the first frame image to obtain a first enlarged image region.

[0088] As an example, the method for acquiring the first enlarged image area can be obtained by referring to the implementation of the above steps S201 and S202, which will not be described in detail here.

[0089] The second image region is enlarged, and the enlarged second image region is extracted from the second frame image to obtain a second enlarged image region.

[0090] As an example, the method for acquiring the second enlarged image area can be obtained by referring to the implementation of the above steps S201 and S202, which will not be described in detail here.

[0091] A first inter-frame optical flow feature of the first enlarged image region and the second enlarged image region is calculated; or a second inter-frame optical flow feature of the first image region and the second enlarged image region is calculated.

[0092] As an example, the calculation of the first inter-frame optical flow feature and the second inter-frame optical flow feature may refer to the implementation of the above step S30, which will not be described in detail here.

[0093] In one embodiment, in the above step S40, the infrared image features, the color image features and the inter-frame optical flow features are fused to obtain fused features; the fused features are input into a preset classifier for processing, and a classification result of whether the face of the person to be identified is a live face or a cheating face is output, including:

[0094] The infrared image features, color image features and inter-frame optical flow features are input into a preset feature fusion network to transform three N-dimensional vectors into an M-dimensional vector to obtain fusion features.

[0095] As an example, the preset feature fusion network is a convolutional neural network. The infrared image feature, the color image feature, and the inter-frame optical flow feature are each an N-dimensional vector. By inputting the three N-dimensional vectors of the infrared image feature, the color image feature, and the inter-frame optical flow feature into the convolutional neural network for processing, the three N-dimensional vectors can be converted into an M-dimensional vector to obtain the fusion feature.

[0096] The fusion feature is input into a preset classifier for processing, and a two-dimensional vector is output; the two-dimensional vector includes a first probability value that the face of the person to be identified is a living face, and a second probability value that the face is a cheating face.

[0097] As an example, the fusion features obtained above can be input into a softmax classifier to output a two-dimensional vector [A, B], where A represents the first probability value that the person to be identified is a live face, and B represents the second probability value that the person to be identified is a cheating face. The larger probability value in the two-dimensional vector can be used to determine which face the person to be identified is. For example, the output two-dimensional vector is [0.95, 0.05], where the probability value of the person to be identified being a live face is greater than the probability value of the person to be identified being a cheating face, then it can be finally determined that the face of the person to be identified is a live face.

[0098] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0099] In one embodiment, a face anti-cheating device is provided, which corresponds one-to-one to the face anti-cheating method in the above embodiment. Figure 3 As shown, the face anti-cheating device includes an image acquisition module 11, a feature extraction module 12, a calculation module 13 and a classification module 14. The detailed description of each functional module is as follows:

[0100] An image acquisition module 11 is used to acquire an infrared image and a color image of a person to be identified in the same time interval;

[0101] A feature extraction module 12 is used to extract the infrared image features of the person to be identified from the infrared image; and to extract the color image features of the person to be identified from the color image;

[0102] A calculation module 13, used for calculating the inter-frame optical flow features of the color image;

[0103] The classification module 14 is used to fuse the infrared image features, color image features and inter-frame optical flow features to obtain fused features; input the fused features into a preset classifier for processing, and output a classification result.

[0104] In one embodiment, the image acquisition module 11 includes:

[0105] The infrared image generating unit is used to emit infrared rays to the object and receive the infrared diffuse reflection signal reflected by the object to form an infrared image when the preset shooting device detects that an object has entered the preset shooting area; wherein the object includes a person to be identified;

[0106] The color image acquisition unit is used to acquire the color image of the object within a preset time interval.

[0107] In one embodiment, the color image acquisition unit is specifically used for:

[0108] Collecting weather information of the region where the camera is installed at the current shooting time, the time point when the infrared diffuse reflection signal reflected by the object is received, and the light intensity of the shooting area;

[0109] According to the weather information, time point and light intensity, a corresponding shooting mode is matched for the shooting device so that the shooting device starts the shooting mode and collects a color image of the object within a preset time interval.

[0110] In one embodiment, the feature extraction module 12 includes:

[0111] A size determination unit, used to determine a first size of an infrared face region of the person to be identified in the infrared image, and a second size of a color face region in the color image;

[0112] A size adjustment unit, configured to adjust the first size according to a preset size modification value to obtain an adjusted infrared face area; and to adjust the second size to obtain an adjusted color face area;

[0113] The feature extraction unit is used to extract the infrared image features of the person to be identified from the adjusted infrared face area; and to extract the color image features of the person to be identified from the adjusted color face area.

[0114] In one embodiment, the feature extraction unit is specifically used for:

[0115] Marking the coordinates of the boundary pixels of the adjusted infrared face area to determine a first extraction area, and marking the coordinates of the boundary pixels of the adjusted color face area to determine a second extraction area;

[0116] The first extraction area is extracted from the infrared image to obtain an infrared face image; and the second extraction area is extracted from the color image to obtain a color face image.

[0117] In one embodiment, the calculation module 13 includes:

[0118] An image region determination unit is used to extract a first frame image and a second frame image from the plurality of color images at a preset time interval; perform face detection on the first frame image and the second frame image to determine a first image region in the first frame image and a second image region in the second frame image of the same person to be identified;

[0119] A first enlargement processing unit is used to perform an enlargement process on the first image area, and extract the enlarged first image area from the first frame image to obtain a first enlarged image area;

[0120] A second enlargement processing unit is used to perform an enlargement process on the second image area, and extract the enlarged second image area from the second frame image to obtain a second enlarged image area;

[0121] The optical flow feature calculation unit is used to calculate the first inter-frame optical flow feature of the first enlarged image area and the second enlarged image area; or calculate the second inter-frame optical flow feature of the first image area and the second enlarged image area.

[0122] In one embodiment, the classification module 14 includes:

[0123] A feature fusion unit, used for inputting the infrared image features, color image features and inter-frame optical flow features into a preset feature fusion network to transform three N-dimensional vectors into one M-dimensional vector to obtain fusion features;

[0124] The classification unit is used to input the fusion feature into a softmax classifier for processing and output a two-dimensional vector; the two-dimensional vector includes a first probability value that the face of the person to be identified is a living face, and a second probability value that it is a cheating face.

[0125] For the specific definition of the face anti-cheating device, please refer to the definition of the face anti-cheating method above, which will not be repeated here. Each module in the above face anti-cheating device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0126] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer-readable instructions and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The database of the computer device is used to store data involved in the face anti-cheating method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a face anti-cheating method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0127] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer-readable instructions to implement the following steps:

[0128] Obtain infrared images and color images of the person to be identified in the same time period;

[0129] Extracting infrared image features of the person to be identified from the infrared image; extracting color image features of the person to be identified from the color image;

[0130] Calculating inter-frame optical flow features of the plurality of color images;

[0131] The infrared image features, color image features and inter-frame optical flow features are fused to obtain fused features; the fused features are input into a preset classifier for processing, and a classification result is outputted as to whether the face of the person to be identified is a living face or a cheating face.

[0132] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media store computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the following steps are implemented:

[0133] Obtain infrared images and color images of the person to be identified in the same time period;

[0134] Extracting infrared image features of the person to be identified from the infrared image; extracting color image features of the person to be identified from the color image;

[0135] Calculating a plurality of inter-frame optical flow features of the color image;

[0136] The infrared image features, color image features and inter-frame optical flow features are fused to obtain fused features; the fused features are input into a preset classifier for processing, and a classification result is outputted as to whether the face of the person to be identified is a living face or a cheating face.

[0137] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0138] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0139] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A face anti-cheating method, characterized in that: include: Obtain infrared images and color images of the person to be identified in the same time period; Extracting infrared image features of the person to be identified from the infrared image; Extracting color image features of the person to be identified from the color image; Calculating the inter-frame optical flow features of the color image; The infrared image features, the color image features and the inter-frame optical flow features are fused to obtain fused features; the fused features are input into a preset classifier for processing, and a classification result of whether the face of the person to be identified is a live face or a cheating face is output; The infrared image features, color image features and inter-frame optical flow features are fused to obtain fused features; The fusion feature is input into a preset classifier for processing, and a classification result of whether the face of the person to be identified is a live face or a cheating face is output, including: Inputting the infrared image feature, the color image feature and the inter-frame optical flow feature into a preset feature fusion network to transform three N-dimensional vectors into an M-dimensional vector to obtain the fusion feature; The fusion feature is input into the preset classifier for processing, and a two-dimensional vector is output; the two-dimensional vector includes a first probability value that the face of the person to be identified is a living face, and a second probability value that the face is a cheating face.

2. The face anti-cheating method according to claim 1, characterized in that: The step of obtaining an infrared image and a color image of a person to be identified in the same time interval includes: When the preset shooting device detects that an object enters the preset shooting area, infrared rays are emitted to the object, and diffuse reflection signals of infrared rays reflected by the object are received to form an infrared image; wherein the object includes a person to be identified; Within a preset time interval, a color image of the object is collected.

3. The face anti-cheating method according to claim 2, characterized in that: The step of collecting the color image of the object within a preset time interval includes: Collecting weather information of the region where the camera is installed at the current shooting time, the time point when the infrared diffuse reflection signal reflected by the object is received, and the light intensity of the shooting area; According to the weather information, time point and light intensity, a corresponding shooting mode is matched for the shooting device so that the shooting device starts the shooting mode and collects a color image of the object within a preset time interval.

4. The face anti-cheating method according to claim 1, characterized in that: extracting infrared image features of the person to be identified from the infrared image; Extracting color image features of the person to be identified from the color image includes: Determine a first size of an infrared face region of the person to be identified in the infrared image, and a second size of a color face region in the color image; According to a preset size modification value, the first size is resized to obtain an adjusted infrared face area; and the second size is resized to obtain an adjusted color face area; The infrared image features of the person to be identified are extracted from the adjusted infrared face area; and the color image features of the person to be identified are extracted from the adjusted color face area.

5. The face anti-cheating method according to claim 4, characterized in that: extracting infrared image features of the person to be identified from the adjusted infrared face area; Extracting the color image features of the person to be identified from the adjusted color face area includes: Marking the coordinates of the boundary pixels of the adjusted infrared face area to determine a first extraction area, and marking the coordinates of the boundary pixels of the adjusted color face area to determine a second extraction area; The first extraction area is extracted from the infrared image to obtain an infrared face image; and the second extraction area is extracted from the color image to obtain a color face image.

6. The face anti-cheating method according to claim 1, characterized in that: The calculating the inter-frame optical flow feature of the color image comprises: Extracting a first frame image and a second frame image from the color image at a preset time interval; performing face detection on the first frame image and the second frame image to determine a first image region in the first frame image and a second image region in the second frame image of the same person to be identified; Performing an enlargement process on the first image region, and extracting the enlarged first image region from the first frame image to obtain a first enlarged image region; Performing an enlargement process on the second image region, and extracting the enlarged second image region from the second frame image to obtain a second enlarged image region; A first inter-frame optical flow feature of the first enlarged image region and the second enlarged image region is calculated; or a second inter-frame optical flow feature of the first image region and the second enlarged image region is calculated.

7. A face anti-cheating device, characterized in that: include: An image acquisition module is used to acquire infrared images and color images of the person to be identified in the same time interval; A feature extraction module, used to extract the infrared image features of the person to be identified from the infrared image; and to extract the color image features of the person to be identified from the color image; A calculation module, used for calculating the inter-frame optical flow features of the color image; A classification module is used to fuse the infrared image features, color image features and inter-frame optical flow features to obtain fused features; input the fused features into a preset classifier for processing, and output a classification result of whether the face of the person to be identified is a live face or a cheating face; The classification module comprises: A feature fusion unit, used for inputting the infrared image feature, the color image feature and the inter-frame optical flow feature into a preset feature fusion network to transform three N-dimensional vectors into one M-dimensional vector to obtain the fusion feature; The classification unit is used to input the fusion feature into the preset classifier for processing and output a two-dimensional vector; the two-dimensional vector includes a first probability value that the face of the person to be identified is a living face, and a second probability value that it is a cheating face.

8. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the face anti-cheating method according to any one of claims 1 to 6 is implemented.

9. One or more readable storage media storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the face anti-cheating method according to any one of claims 1 to 6.