Multi-model strategy face recognition method and system based on full-color infrared black and white image switching camera

By using a camera that can switch full-color and infrared black and white images in the field of DMS, and combining strategies of multiple face feature models, the problem of low black and white image recognition rate in the prior art is solved, significantly improving the accuracy and success rate of face recognition.

CN119600664APending Publication Date: 2025-03-11SHENZHEN TIANSHUANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411665571.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the existing DMS field, near-infrared or infrared cameras are used to collect images, and face recognition can only be performed through black and white face images, resulting in a low recognition rate.

Method used

A camera that can switch full-color images and infrared black and white images is used to trigger the switch to full-color image mode when face recognition is performed, and face recognition is performed according to certain strategies using three trained face feature models.

Benefits of technology

By using full-color image data, the facial features are enriched, the face area is brightened and pre-processed and multiple model strategies are judged, which greatly improves the accuracy and success rate of face recognition in the DMS field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600664A_ABST
    Figure CN119600664A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-model strategy face recognition method and system based on a full-color infrared black-and-white image switching camera, the camera can freely switch a full-color image and an infrared black-and-white image according to high and low levels, when face recognition needs to be carried out, the full-color image mode is triggered and switched through a hardware level signal, and the full-color image mode is switched to the infrared black-and-white image mode. The face recognition is carried out by using three trained face feature models according to a certain strategy, the face features are enriched by using full-color picture data, and the face region is subjected to brightening preprocessing and multi-model strategy judgment, so that the accuracy and success rate of face recognition in the DMS field are greatly improved, and the method can be suitable for more scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a face recognition system, and in particular relates to a multi-model strategy face recognition method and system based on full-color infrared black-and-white image switching cameras, belonging to the technical field of face recognition. Background Art

[0002] In recent years, with the rapid development of artificial intelligence, facial image information processing and recognition technologies are also being updated day by day, among which facial recognition has also received considerable attention and development.

[0003] DMS (Driver Monitoring System) is an intelligent safety technology in modern cars. It aims to improve driving safety by monitoring the driver's behavior. The DMS system usually includes a variety of sensors and cameras. With the help of face recognition technology, it tracks the driver's facial features, eye status, head position, etc. in real time to detect whether the driver is concentrating, or whether he is tired, distracted or engaging in other dangerous behaviors.

[0004] In the prior art, in the DMS field, the cameras used are all near-infrared or infrared cameras. Therefore, the images they generate are all processed black-and-white images. Since the features contained in infrared black-and-white facial images are relatively monotonous, when performing face recognition, generally only black-and-white facial images can be used for feature extraction and face comparison. Compared with color facial images, more facial features are lost, which is bound to have a significant impact on the recognition rate. Summary of the invention

[0005] In view of the shortcomings of the prior art mentioned above that near-infrared or infrared cameras are used to collect images in the DMS field, and face recognition can only be performed through black and white face images, resulting in a low recognition rate, the present invention provides a multi-model strategy face recognition method and system based on full-color infrared black and white image switching camera. The camera can freely switch between full-color images and infrared black and white images according to high and low levels. When face recognition is to be performed, it is triggered to switch to full-color image mode through a hardware level signal, and then face recognition is performed according to a certain strategy using three trained face feature models, which greatly improves the success rate of face recognition in the DMS field.

[0006] The technical solution adopted by the present invention to solve the technical problem is: a multi-model strategy face recognition method based on a full-color infrared black-and-white image switching camera, the method is implemented based on a DMS camera capable of switching between full-color images and infrared black-and-white images, and the face recognition method comprises the following steps: Step S1, mode switching: triggering the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Step S2, setting the number of times: setting the number of cyclic capture times; Step S3, scaling preprocessing: obtaining a frame of original image data captured in step S2, and performing scaling preprocessing according to the same aspect ratio; Step S4, obtaining human faces: injecting the preprocessed image data obtained in step S3 into the face detection model Model_A to obtain the number of human face targets; Step S5, face screening: the number of face targets obtained in step S4 is screened by area, the target with the largest face area is selected, and it is judged whether the rectangular frame area of ​​the target reaches the appropriate threshold T0. If the rectangular frame area reaches the appropriate threshold T0, step S6 is entered, otherwise step S16 is entered; Step S6, posture angle acquisition: the largest rectangular frame obtained in step S5 is cut out on the original image data in step S3, and then scaling preprocessing is performed, and the scaled preprocessed image data is injected into the head posture detection model Model_B to obtain the posture angle data of the face; Step S7, frontal face judgment: according to the posture angle data obtained in step S6, judge whether the face is in the frontal face position, if it is in the frontal face position, proceed to step S8, otherwise proceed to step S16; Step S8, key point acquisition: the largest rectangular frame obtained in step S5 is cut out on the original image data in step S3, and then scaling preprocessing is performed, and the image data after scaling preprocessing is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S9, judging the state of eyes and mouth: selecting the mouth key points and eye key points of the 42 facial key points obtained in step S8, calculating the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, judging whether the eyes are open and the mouth is closed, if yes, proceeding to step S10, otherwise proceeding to step S16; Step S10, face image processing: the largest rectangular frame obtained in step S5 is used to obtain the center coordinates of the rectangular frame, and the upper, lower, left and right sides of the rectangular frame are expanded with the center coordinates as the center, and then the image is cut out, and the obtained image is brightened to restore the dim face to normal brightness, and the coordinates of the 42 facial key points obtained in step S8 are converted; Step S11, secondary processing: performing face recognition and face key point recognition on the image obtained in step S10, and performing face alignment and scaling processing; Step S12, a face comparison: the image data obtained in step S11 is fed into the face feature model Model_D1 to obtain the face feature data, which is cyclically compared with the face database, the top 20 faces with the highest scores are recorded, and the first face with the highest score FA and face label LA are saved; Step S13, secondary face comparison: the image data obtained in step S11 is fed into the face feature model Model_D2 to obtain the face feature data, which is compared with the first 20 faces obtained in step S12, and the face FB and face label LB with the highest score are saved; Step S14, three face comparisons: the image data obtained in step S11 is fed into the face feature model Model_D3 to obtain the face feature data, which is compared with the first 20 faces obtained in step S12, and the face FC and face label LC with the highest score are saved; Step S15, result judgment: the judgment conditions are "Condition 1: FA meets the threshold value 0.51, and FB meets the threshold value 0.51, and LA and LB are equal; Condition 2: FA meets the threshold value 0.51, and FC meets the threshold value 0.53, and LA and LC are equal; Condition 3: FB meets the threshold value 0.51, and FC meets the threshold value 0.53, and LB and LC are equal". If any one of the above three conditions is met, directly go to step S17, otherwise go to step S16; Step S16, loop count: the loop count is increased by 1. If the number of times is equal to the number of loop capture times, then go to step S17, otherwise go to step S3; Step S17, exit: When the conditions in step S15 are met, exit and report the face recognition result, triggering the DMS camera to switch from full-color image mode to near-infrared black-and-white image mode.

[0007] A multi-model strategy face recognition system based on full-color infrared black-and-white image switching camera, the camera used in the system is a camera capable of switching between full-color image and infrared black-and-white image, and the face recognition system includes the following unit modules: Mode switching unit: used to trigger the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Setting times unit: used to set the number of cycle capture times; Scaling preprocessing unit: used to obtain the original image data captured by the unit for a set number of times in one frame, and perform scaling preprocessing according to the same aspect ratio; Obtaining face unit: used to inject the pre-processed image data obtained in the scaling pre-processing unit into the face detection model Model_A to obtain the number of face targets; Face screening unit: used to screen the number of face targets obtained by the face acquisition unit by area, select the target with the largest face area, and judge whether the rectangular box area of ​​the target reaches the appropriate threshold T0. If the rectangular box area reaches the appropriate threshold T0, it enters the posture angle acquisition unit, otherwise it enters the loop counting unit; Posture angle acquisition unit: used to cut out the largest rectangular frame obtained in the face screening unit on the original image data in the scaling preprocessing unit, and then perform scaling preprocessing, and then inject the image data after scaling preprocessing into the head posture detection model Model_B to obtain the posture angle data of the face; Frontal face judgment unit: used to judge whether the face is in the frontal face position according to the posture angle data obtained by the posture angle acquisition unit. If it is in the frontal face position, it enters the key point acquisition unit, otherwise it enters the loop counting unit; Key point acquisition unit: used to cut out the largest rectangular frame obtained by the face screening unit on the original image data of the scaling preprocessing unit, and then perform scaling preprocessing, and inject the image data after scaling preprocessing into the 42 face key point detection model Model_C to obtain 42 key points of the face; Eye and mouth state judgment unit: used for selecting the mouth key points and eye key points of the 42 face key points obtained by the key point acquisition unit, calculating the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, judging whether the eyes are open and the mouth is closed, if yes, entering the face image processing unit, otherwise entering the loop counting unit; The face image processing unit is used to obtain the center coordinates of the largest rectangular frame obtained in the face screening unit, expand the pixels of the upper, lower, left and right parts of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 face key points obtained by the key point acquisition unit; Secondary processing unit: used for performing face recognition and 42 face key point recognition, face alignment and scaling processing on the image obtained by the face image processing unit; Primary face comparison unit: used to input the image data obtained by the secondary processing unit into the face feature model Model_D1, obtain the face feature data, perform a circular comparison with the face database, record the top 20 faces with the highest scores, and save the first face with the highest score FA and face label LA; Secondary face comparison unit: used to input the image data obtained by the secondary processing unit into the face feature model Model_D2, obtain the face feature data, compare it with the first 20 faces obtained by the primary face comparison unit, and save the face FB and face label LB with the highest score; The third face comparison unit is used to input the image data obtained by the second processing unit into the face feature model Model_D3 to obtain the face feature data, compare it with the first 20 faces obtained by the first face comparison unit, and save the face FC and face label LC with the highest score; Result judgment unit: used for condition judgment, the judgment condition is "Condition 1: FA meets the threshold value 0.51, and FB meets the threshold value 0.51, and LA and LB are equal; Condition 2: FA meets the threshold value 0.51, and FC meets the threshold value 0.53, and LA and LC are equal; Condition 3: FB meets the threshold value 0.51, and FC meets the threshold value 0.53, and LB and LC are equal". If any of the above three conditions is met, it directly enters the exit unit, otherwise it enters the loop counting unit; Loop counting unit: used to add 1 to the loop count. If the number of times is equal to the number of loop capture times, the exit unit is entered, otherwise the zoom preprocessing unit is entered; Exit unit: When the conditions in the result judgment unit are met, it exits and reports the face recognition result, triggering the DMS camera to switch from full-color image mode to near-infrared black and white image mode.

[0008] A storage medium stores a program which can realize the above-mentioned multi-model strategy face recognition method based on full-color infrared black and white image switching camera when running.

[0009] An electronic device, when used, can implement the above-mentioned multi-model strategy face recognition method based on full-color infrared black and white image switching camera.

[0010] The technical solution adopted by the present invention to solve the technical problem further includes: The step S12 of obtaining face data by capturing a picture with a camera for face registration includes the following sub-steps: Step S12-1-1, mode switching: triggering the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Step S12-1-2, setting the number of times: setting the number of cyclic captures to ensure that the number of successful captures is at least 3 times; Step S12-1-3, scaling preprocessing: obtaining a frame of original image data captured in step S12-1-2, and performing preprocessing of scaling according to the same aspect ratio; Step 12-1-4, obtaining human faces: injecting the pre-processed image data obtained in step S12-1-3 into the face detection model Model_A to obtain the number of human face targets; Step S12-1-5, face screening: perform area screening on the face targets obtained in step S12-1-4, select the target with the largest face area, and determine whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. If the rectangular frame area reaches an appropriate threshold value T0, proceed to step S12-1-6, otherwise proceed to step S12-1-17; Step S12-1-6, posture angle acquisition: the largest rectangular frame obtained in step S12-1-5 is cut out on the original image data in step S12-1-3, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the head posture detection model Model_B to obtain the posture angle data of the face; Step S12-1-7, frontal face judgment: according to the posture angle data obtained in step S12-1-6, judge whether the face is in the frontal face position, if it is in the frontal face position, proceed to step S12-1-8, otherwise proceed to step S12-1-17; Step S12-1-8, key point acquisition: the largest rectangular frame obtained in step S12-1-5 is cut out on the original image data in step S12-1-3, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S12-1-9, judging the state of eyes and mouth: Select the mouth key points and eye key points of the 42 facial key points obtained in step S12-1-8, calculate the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, and judge whether the eyes are open and the mouth is closed. If yes, proceed to step S12-1-10, otherwise proceed to step S12-1-17; Step S12-1-10, face image processing: obtain the center coordinates of the largest rectangular frame obtained in step S12-1-5, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 facial key points obtained in step S12-1-8; Step S12-1-11, secondary processing: the image obtained in step S12-1-10 is processed into a face and 42 face key points, and face alignment and scaling are performed; Step S12-1-12, a facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D1 to obtain facial feature data TData_1; Step S12-1-13, secondary facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D2 to obtain facial feature data TData_2; Step S12-1-14, three times of facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D3 to obtain facial feature data TData_3; Step S12-1-15, temporary entry of face data: entering the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into a temporary face database; Step S12-1-16, formal entry of face data: the successful capture count is increased by 1. If it is 3, the temporary face database is merged into the formal face database, and the process goes to step S12-1-17; Step S12-1-17, loop count: the loop count is increased by 1. If the number of times is equal to the number of loop capture times, then go to step S12-1-18, otherwise go to step S12-1-3; Step S12-1-18, reporting: reporting the face registration result. If the successful capture count meets 3 times, the report is successful, otherwise, the report fails; Step S12-1-19, exit: After reporting the face registration result, exit, trigger the DMS camera to switch from full-color image mode to near-infrared black and white image mode, and exit face registration.

[0011] In step S12, obtaining face data by importing an external full-color image to perform face registration includes the following sub-steps: Step S12-2-1, picture input: input N pictures of faces to be registered, the number of pictures is at least one, and the subscript count is set to 0; Step S12-2-2, scaling preprocessing: read a picture into the memory and perform scaling preprocessing according to the same aspect ratio; Step S12-2-3, obtaining human faces: injecting the preprocessed image data obtained in step S12-2-2 into the face detection model Model_A to obtain the number of human face targets; Step S12-2-4, face screening: perform area screening on the face targets obtained in step S12-2-3, select the target with the largest face area, and determine whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. If the rectangular frame area reaches an appropriate threshold value T0, proceed to step S12-2-5, otherwise proceed to step S12-2-13; Step S12-2-5, key point acquisition: the largest rectangular frame obtained in step S12-2-4 is cut out on the original image data in step S12-2-2, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S12-2-6, face image processing: obtain the center coordinates of the largest rectangular frame obtained in step S12-2-4, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform cutout to restore the dim face to normal brightness, and convert the coordinates of the 42 facial key points in step S12-2-5; Step S12-2-7, secondary processing: perform face recognition and 42 face key point recognition on the image obtained in step S12-2-6, and perform face alignment and scaling processing; Step S12-2-8, first facial feature data collection: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D1 to obtain facial feature data TData_1; Step S12-2-9, secondary facial feature data collection: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D2 to obtain facial feature data TData_2; Step S12-2-10, three facial feature data collections: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D3 to obtain facial feature data TData_3; Step S12-2-11, temporary entry of face data: entering the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the formal face database; Step S12-2-12, face data entry: add 1 to the subscript count, report that the face registration of the current picture is successful, if it is the last picture, go to step S12-2-14, otherwise go to step S12-2-2 to read the next picture; Step S12-2-13, face data registration failure: add 1 to the subscript count, and report that the face registration of the current picture has failed. If it is the last picture, go to step S12-2-14, otherwise go to step S12-2-2 to read the next picture; Step S12-2-14, exit: After reporting the face registration result, exit the face registration.

[0012] The face comparison unit obtains face data by capturing a picture with a camera to perform face registration, and includes the following subunits: Mode switching subunit: used to trigger the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Setting times subunit: used to set the number of cyclic capture times; Scaling preprocessing subunit: used to obtain the original image data captured by the subunit for a set number of times in one frame, and perform preprocessing for scaling according to the same aspect ratio; Obtaining face subunit: used to inject the preprocessed image data obtained by the scaling preprocessing subunit into the face detection model Model_A to obtain the number of face targets; Face screening subunit: used to screen the number of face targets obtained by the face acquisition subunit by area, select the target with the largest face area, and judge whether the rectangular box area of ​​the target reaches the appropriate threshold T0. If the rectangular box area reaches the appropriate threshold T0, it enters the posture angle acquisition subunit, otherwise it enters the loop counting subunit; Posture angle acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the head posture detection model Model_B to obtain the posture angle data of the face; Frontal face judgment subunit: used to judge whether the face is in the frontal face position according to the posture angle data obtained by the posture angle acquisition subunit. If it is in the frontal face position, it enters the key point acquisition subunit, otherwise it enters the loop counting subunit; Key point acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the 42 face key point detection model Model_C to obtain 42 key points of the face; The eye and mouth state judgment subunit is used to select the mouth key points and eye key points of the 42 face key points obtained by the key point acquisition subunit, calculate the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, and judge whether the eyes are open and the mouth is closed. If so, it enters the face image processing subunit, otherwise it enters the loop counting subunit; The face image processing subunit is used to obtain the center coordinates of the largest rectangular frame obtained by the face screening subunit, expand the pixels of the upper, lower, left and right parts of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 face key points obtained by the key point acquisition subunit; Secondary processing subunit: used to process the image obtained by the face image processing subunit into a face and 42 face key points, and to perform face alignment and scaling processing; The primary facial feature data acquisition subunit is used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D1 to obtain facial feature data TData_1; Secondary facial feature data acquisition subunit: used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D2 to obtain facial feature data TData_2; The third facial feature data acquisition subunit is used to input the image data obtained by the second processing subunit into the facial feature model Model_D3 to obtain facial feature data TData_3; The face data temporary entry subunit is used to enter the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the temporary face database; The face data formal entry subunit is used to add 1 to the successful capture count. If it reaches 3, the temporary face database is merged into the formal face database and enters the loop counting subunit. Cycle counting subunit: used to add 1 to the cycle count. If the number of times is equal to the number of cycle capture times, it enters the reporting subunit, otherwise it enters the scaling preprocessing subunit; Reporting subunit: used to report face registration results. If the successful capture count meets 3 times, the report is successful, otherwise, the report fails. Exit subunit: After reporting the face registration result, exit, trigger the DMS camera to switch from full-color image mode to near-infrared black-and-white image mode, and exit face registration.

[0013] The face comparison unit obtains face data by importing an external full-color picture to perform face registration, and includes the following subunits: Image input subunit: used to input N images of faces to be registered. The number of images must be at least one, and the subscript count is set to 0; Scaling preprocessing subunit: used to read an image into memory and perform preprocessing of scaling it according to the same aspect ratio; Obtaining face subunit: used to inject the preprocessed image data obtained by the scaling preprocessing subunit into the face detection model Model_A to obtain the number of face targets; Face screening subunit: used to screen the number of face targets obtained by the face acquisition subunit by area, select the target with the largest face area, and judge whether the rectangular box area of ​​the target reaches the appropriate threshold T0. If the rectangular box area reaches the appropriate threshold T0, enter the key point acquisition subunit, otherwise enter the face data registration failure subunit; Key point acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the 42 face key point detection model Model_C to obtain 42 key points of the face; The face image processing subunit is used to obtain the center coordinates of the largest rectangular frame obtained by the face screening subunit, expand the pixels of the upper, lower, left and right parts of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 face key points of the key point acquisition subunit; Secondary processing subunit: used for performing face recognition and 42 face key point recognition, face alignment and scaling processing on the image obtained by the face image processing subunit; The primary facial feature data acquisition subunit is used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D1 to obtain facial feature data TData_1; Secondary facial feature data acquisition subunit: used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D2 to obtain facial feature data TData_2; The third facial feature data acquisition subunit is used to input the image data obtained by the second processing subunit into the facial feature model Model_D3 to obtain facial feature data TData_3; The face data temporary entry subunit is used to enter the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the formal face database; Face data entry subunit: used to add 1 to the subscript count and report that the face registration of the current picture is successful. If it is the last picture, it enters the exit subunit, otherwise it enters the scaling preprocessing subunit to read the next picture; Face data registration failure subunit: used to add 1 to the subscript count and report that the face registration of the current picture has failed. If it is the last picture, it enters the exit subunit, otherwise it enters the scaling preprocessing subunit to read the next picture; Exit subunit: used to exit face registration after reporting the face registration result.

[0014] The beneficial effects of the present invention are as follows: the camera in the present invention can freely switch between full-color images and infrared black-and-white images according to high and low levels. When face recognition is to be performed, the camera is switched to full-color image mode through a hardware level signal trigger, and then face recognition is performed according to a certain strategy using three trained face feature models, and full-color image data is used to enrich the features of the face, and brightening preprocessing and multiple model strategy judgments are performed on the face area, which greatly improves the accuracy and success rate of face recognition in the DMS field and can be applied to more scenarios.

[0015] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 This is a flow chart of face comparison in the present invention.

[0017] Figure 2 This is a flow chart of face registration (camera capture) in the present invention.

[0018] Figure 3 This is a flow chart of face registration (external full-color image import) in the present invention. DETAILED DESCRIPTION

[0019] This embodiment is a preferred implementation mode of the present invention. All other embodiments whose principles and basic structures are the same or similar to those of this embodiment are within the protection scope of the present invention.

[0020] Please refer to the attached Figure 1 The present invention mainly protects a multi-model strategy face recognition method based on a full-color infrared black-and-white image switching camera, which is implemented based on a camera capable of switching between full-color images and infrared black-and-white images. In this embodiment, when the camera switches between full-color images and infrared black-and-white images, it is implemented according to the level of the control. The face recognition method mainly includes the following steps: Step S1, mode switching: triggering the DMS camera to switch from the near-infrared black-and-white image mode to the full-color image mode. In this embodiment, the switching operation is controlled by the sent level signal. In specific implementation, it can be triggered by a high level trigger or a low level trigger, or it can also be triggered by a specific trigger signal; Step S2, setting the number of times: setting the number of cyclic captures. In this embodiment, the default number of main images is 10 times, and the capture interval is set to 300 milliseconds. During specific implementation, the number of captures and the capture interval can also be set according to actual conditions; Step S3, scaling preprocessing: obtaining a frame of original image data captured in step S2, and performing scaling preprocessing according to the same aspect ratio. In this embodiment, scaling is performed to the input size of the face detection model Model_A, i.e., "1×3×256×256"; Step S4, obtaining a face: the pre-processed image data obtained in step S3 is fed into the face detection model Model_A to obtain the number of face targets (in this embodiment, multiple face targets may be detected, and the largest face target is used in the next step to determine the most likely target face); Step S5, face screening: the number of face targets obtained in step S4 is screened by area, the target with the largest face area is selected, and it is judged whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. In this embodiment, the default threshold value T0 is 6400 pixels. During specific implementation, the value of the threshold value T0 can also be selected according to actual needs. If the rectangular frame area reaches the appropriate threshold value T0, step S6 is entered, otherwise step S16 is entered; Step S6, posture angle acquisition: the largest rectangular frame obtained in step S5 is cut out on the original image data in step S3, and then scaling preprocessing is performed. In this embodiment, the scaling is performed on the previous cutout to the input size "1×3×64×64" of the head posture detection model Model_B, and the scaled preprocessed image data is injected into the head posture detection model Model_B to obtain the posture angle data of the face; Step S7, frontal face judgment: according to the posture angle data obtained in step S6, judge whether the face is in the frontal face position, if it is in the frontal face position, proceed to step S8, otherwise proceed to step S16; Step S8, key point acquisition: the largest rectangular frame obtained in step S5 is cut out on the original image data of step S3, and then scaling preprocessing is performed. In this embodiment, the scaling is performed on the previous cutout, and the image data after scaling preprocessing is scaled to the input size "1×3×112×112" of the 42 face key point detection model Model_C. The image data after scaling preprocessing is poured into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S9, judging the state of eyes and mouth: selecting the mouth key points and eye key points of the 42 facial key points obtained in step S8, calculating the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, judging whether the eyes are open and the mouth is closed, if yes, proceeding to step S10, otherwise proceeding to step S16; Step S10, face image processing: the maximum rectangular frame obtained in step S5 is used to obtain the center coordinates of the rectangular frame, and the upper, lower, left and right sides of the rectangular frame are expanded with the center coordinates as the center, and then the image is cut out. In this embodiment, the maximum rectangular frame R0 obtained in step S5 is obtained using “L=MAX(W, H) / 2 + 80" is used to calculate the outward expansion length L, where W and H are the width and height of R0, and the center coordinate C0 of R0 is calculated. With the center coordinate as the center, the up, down, left and right outward expansion lengths L are calculated to obtain a new rectangular frame R1 and cut out the image, and scale it to "160×160". In this embodiment, the rectangular frame is expanded to "160×160", and the obtained image is brightened to restore the dim face to normal brightness. In this embodiment, the "160×160" image is processed by combining Gamma correction and Retinex algorithm. Since the image may be dim due to light obstruction during use in actual environments, Gamma correction and Retinex algorithm can be used here to brighten the image. The face is clear to the naked eye, even if it is normal brightness. Because all faces will have this brightening operation, it can be considered that all faces are in the same brightness range. The 42 facial key point coordinates obtained in step S8 are converted to obtain the upper left corner coordinates (x1, y1) of the rectangular frame R1. Assuming (x', y') are the coordinates of the facial key points obtained in step S8, and the coordinates are transformed according to "(x, y) = (((x', y') - (x1, y1)) / (2L, 2L)) * (160, 160)" to obtain the coordinates of 42 facial key points based on the "160×160" image; Step S11, secondary processing: perform face recognition and 42 face key point recognition on the image obtained in step S10, perform face alignment and scaling processing, use the latest 42 face key point coordinates obtained in step S10 to calculate the similarity transformation matrix between these key points (eyes, nose, mouth) and the reference key points, this matrix includes parameters such as rotation, scaling and translation, transform the face image to the position and posture of the reference face, so that the facial feature points coincide with the feature points of the reference face, thereby achieving the alignment effect; Step S12, a face comparison: the image data obtained in step S11 is fed into the face feature model Model_D1 to obtain feature data of the face, which is compared with the face database in a loop, the top 20 faces with the highest scores are recorded, and the first face with the highest score FA and face label LA are saved; in this embodiment, the data in the face database is obtained through face registration, and the face registration process can obtain face data by capturing a picture with a camera for face registration, or by importing an external full-color picture to obtain face data for face registration, which are described below as sub-steps of step S12.

[0021] Please refer to the attached Figure 2 In this embodiment, obtaining face data by capturing a picture with a camera for face registration includes the following sub-steps: Step S12-1-1, mode switching: In this embodiment, when the camera is used to switch between full-color image and infrared black-and-white image, it is achieved according to the level of the control level, triggering the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode. In this embodiment, the switching operation is controlled by the level signal sent. When it is implemented, it can be triggered by a high level trigger or a low level trigger, or it can also be triggered by a specific trigger signal; Step S12-1-2, set the number of times: set the number of loop captures. In this embodiment, the default number of main images is 10 times, and the capture interval is set to 300 milliseconds. During implementation, the number of captures and the capture interval can also be set according to the actual situation. It is necessary to ensure that the number of successful captures is at least 3 times. If it does not reach 3 times, the number of captures can be increased accordingly. After entering "Step S12-1-16", it is considered that the capture is successful, and the count will increase by 1. The default value is 0; Step S12-1-3, scaling preprocessing: obtain a frame of original image data captured in step S12-1-2, and perform preprocessing of scaling according to the same aspect ratio. In this embodiment, it is scaled to the input size of the face detection model Model_A "1×3×256×256"; Step 12-1-4, obtaining a face: injecting the pre-processed image data obtained in step S12-1-3 into the face detection model Model_A to obtain the number of face targets (in this embodiment, multiple face targets may be detected, and the largest face target will be used in the next step to determine the most likely target face); Step S12-1-5, face screening: the number of face targets obtained in step S12-1-4 is screened by area, the target with the largest face area is selected, and it is determined whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. In this embodiment, the default threshold value T0 is 6400 pixels. During specific implementation, the value of the threshold value T0 can also be selected according to actual needs. If the rectangular frame area reaches the appropriate threshold value T0, step S12-1-6 is entered, otherwise step S12-1-17 is entered; Step S12-1-6, posture angle acquisition: the largest rectangular frame obtained in step S12-1-5 is cut out on the original image data in step S12-1-3, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the head posture detection model Model_B to obtain the posture angle data of the face; Step S12-1-7, frontal face judgment: according to the posture angle data obtained in step S12-1-6, judge whether the face is in the frontal face position, if it is in the frontal face position, proceed to step S12-1-8, otherwise proceed to step S12-1-17; Step S12-1-8, key point acquisition: the largest rectangular frame obtained in step S12-1-5 is cut out on the original image data in step S12-1-3, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S12-1-9, judging the state of eyes and mouth: Select the mouth key points and eye key points of the 42 facial key points obtained in step S12-1-8, calculate the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, and judge whether the eyes are open and the mouth is closed. If yes, proceed to step S12-1-10, otherwise proceed to step S12-1-17; Step S12-1-10, face image processing: obtain the center coordinates of the largest rectangular frame obtained in step S12-1-5, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform cutout. In this embodiment, the rectangular frame is expanded to "160×160", and the obtained image is brightened to restore the dim face to normal brightness, and the coordinates of the 42 facial key points obtained in step S12-1-8 are converted; Step S12-1-11, secondary processing: the image obtained in step S12-1-10 is processed into a face and 42 face key points, and face alignment and scaling are performed; Step S12-1-12, a facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D1 to obtain facial feature data TData_1; Step S12-1-13, secondary facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D2 to obtain facial feature data TData_2; Step S12-1-14, three times of facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D3 to obtain facial feature data TData_3; Step S12-1-15, temporary entry of face data: entering the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into a temporary face database; Step S12-1-16, formal entry of face data: the successful capture count is increased by 1. If it is 3, the temporary face database is merged into the formal face database, and the process goes to step S12-1-17; Step S12-1-17, loop count: the loop count is increased by 1. If the number of times is equal to the number of loop captures, then go to step S12-1-18, otherwise go to step S12-1-3. In this embodiment, since the number of loop captures set in step S12-1-2 is 10 times, the loop count number is also 10 times; Step S12-1-18, reporting: reporting the face registration result. If the successful capture count meets 3 times, the report is successful, otherwise, the report fails; Step S12-1-19, exit: After reporting the face registration result, exit and trigger the DMS camera to switch from full-color image mode to near-infrared black-and-white image mode. In this embodiment, the switching operation is controlled by the sent level signal. In specific implementation, it can be triggered by a high level or a low level, or it can also be triggered by a specific trigger signal to exit face registration.

[0022] Please refer to the attached Figure 3 In this embodiment, face data is obtained by importing external full-color images to perform face registration, which includes the following sub-steps: Step S12-2-1, picture input: input N pictures of faces to be registered, the number of pictures is at least one, set the subscript count to 0, load N pictures into the memory in the form of an array, and traverse the images with the subscript in the memory as the count, starting from 0 to N-1; Step S12-2-2, scaling preprocessing: read a picture into the memory and perform scaling preprocessing according to the same aspect ratio; Step S12-2-3, obtaining human faces: injecting the preprocessed image data obtained in step S12-2-2 into the face detection model Model_A to obtain the number of human face targets; Step S12-2-4, face screening: the number of face targets obtained in step S12-2-3 is screened by area, the target with the largest face area is selected, and it is determined whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. In this embodiment, the default threshold value T0 is 6400 pixels. During specific implementation, the value of the threshold value T0 can also be selected according to actual needs. If the rectangular frame area reaches the appropriate threshold value T0, step S12-2-5 is entered, otherwise step S12-2-13 is entered; Step S12-2-5, key point acquisition: the largest rectangular frame obtained in step S12-2-4 is cut out on the original image data in step S12-2-2, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S12-2-6, face image processing: obtain the center coordinates of the largest rectangular frame obtained in step S12-2-4, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform cutout. In this embodiment, the rectangular frame is expanded to "160×160", and the obtained image is brightened to restore the dim face to normal brightness, and the coordinates of the 42 facial key points in step S12-2-5 are converted; Step S12-2-7, secondary processing: perform face recognition and 42 face key point recognition on the image obtained in step S12-2-6, and perform face alignment and scaling processing; Step S12-2-8, first facial feature data collection: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D1 to obtain facial feature data TData_1; Step S12-2-9, secondary facial feature data collection: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D2 to obtain facial feature data TData_2; Step S12-2-10, three facial feature data collections: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D3 to obtain facial feature data TData_3; Step S12-2-11, temporary entry of face data: entering the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the formal face database; Step S12-2-12, face data entry: add 1 to the subscript count, report that the face registration of the current picture is successful, if it is the last picture, go to step S12-2-14, otherwise go to step S12-2-2 to read the next picture; Step S12-2-13, face data registration failure: add 1 to the subscript count, and report that the face registration of the current picture has failed. If it is the last picture, go to step S12-2-14, otherwise go to step S12-2-2 to read the next picture; Step S12-2-14, exit: After reporting the face registration result, exit the face registration.

[0023] Step S13, secondary face comparison: the image data obtained in step S11 is fed into the face feature model Model_D2 to obtain the face feature data, which is compared with the first 20 faces obtained in step S12, and the face FB and face label LB with the highest score are saved; Step S14, three face comparisons: the image data obtained in step S11 is fed into the face feature model Model_D3 to obtain the face feature data, which is compared with the first 20 faces obtained in step S12, and the face FC and face label LC with the highest score are saved; Step S15, result judgment: the judgment conditions are "Condition 1: FA satisfies a threshold greater than or equal to 0.51, and FB satisfies a threshold greater than or equal to 0.51, and LA and LB are equal; Condition 2: FA satisfies a threshold greater than or equal to 0.51, and FC satisfies a threshold greater than or equal to 0.53, and LA and LC are equal; Condition 3: FB satisfies a threshold greater than or equal to 0.51, and FC satisfies a threshold greater than or equal to 0.53, and LB and LC are equal". If any one of the above three conditions is met, directly go to step S17, otherwise go to step S16; Step 16, loop count: the loop count is increased by 1. If the number of times is equal to the number of loop captures, the process proceeds to step S17, otherwise the process proceeds to step S3. In this embodiment, since the number of loop captures set in step S2 is 10 times, the loop count is also 10 times. Step S17, exit: When the conditions in step S15 are met, exit and report the face recognition result, triggering the DMS camera to switch from full-color image mode to near-infrared black and white image mode. In this embodiment, the switching operation is controlled by the sent level signal. In specific implementation, it can be triggered by a high level trigger or a low level trigger, or it can also be triggered by a specific trigger signal.

[0024] The present invention also protects a multi-model strategy face recognition system based on a full-color infrared black-and-white image switching camera. The camera used in the system is a camera capable of switching between full-color images and infrared black-and-white images. In this embodiment, when the camera switches between full-color images and infrared black-and-white images, it is achieved according to the level of the control. The face recognition system mainly includes the following unit modules: Mode switching unit: used to trigger the DMS camera to switch from the near-infrared black-and-white image mode to the full-color image mode. In this embodiment, the switching operation is controlled by the sent level signal. In specific implementation, it can be triggered by a high level or a low level, or it can also be triggered by a specific trigger signal; The setting number unit is used to set the number of loop captures. In this embodiment, the default number of main images is 10 times, and the capture interval is set to 300 milliseconds. During specific implementation, the number of captures and the capture interval can also be set according to actual conditions; Scaling preprocessing unit: used to obtain the original image data captured by the one-frame setting number of times unit, and perform scaling preprocessing according to the same aspect ratio. In this embodiment, it is scaled to the input size of the face detection model Model_A "1×3×256×256"; Obtaining face unit: used to inject the pre-processed image data obtained in the scaling pre-processing unit into the face detection model Model_A to obtain the number of face targets (in this embodiment, multiple face targets may be detected, and the largest face target will be used in the next step to determine the most likely target face); Face screening unit: used to screen the number of face targets obtained by the face acquisition unit by area, select the target with the largest face area, and judge whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. In this embodiment, the default threshold value T0 is 6400 pixels. During specific implementation, the value of the threshold value T0 can also be selected according to actual needs. If the rectangular frame area reaches the appropriate threshold value T0, the posture angle acquisition unit is entered, otherwise the loop counting unit is entered; The posture angle acquisition unit is used to cut out the largest rectangular frame obtained in the face screening unit on the original image data in the scaling preprocessing unit, and then perform scaling preprocessing. In this embodiment, the scaling is performed on the previous cutout image to the input size "1×3×64×64" of the head posture detection model Model_B, and the scaled preprocessed image data is injected into the head posture detection model Model_B to obtain the posture angle data of the face; Frontal face judgment unit: used to judge whether the face is in the frontal face position according to the posture angle data obtained by the posture angle acquisition unit. If it is in the frontal face position, it enters the key point acquisition unit, otherwise it enters the loop counting unit; Key point acquisition unit: used to cut out the largest rectangular frame obtained by the face screening unit on the original image data of the scaling preprocessing unit, and then perform scaling preprocessing. In this embodiment, the scaling is to the previous cutout, which is scaled to the input size "1×3×112×112" of the 42 face key point detection model Model_C, and the scaled preprocessed image data is poured into the 42 face key point detection model Model_C to obtain 42 key points of the face; Eye and mouth state judgment unit: used for selecting the mouth key points and eye key points of the 42 face key points obtained by the key point acquisition unit, calculating the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, judging whether the eyes are open and the mouth is closed, if yes, entering the face image processing unit, otherwise entering the loop counting unit; The face image processing unit is used to obtain the center coordinates of the largest rectangular frame obtained in the face screening unit, expand the pixels of the upper, lower, left and right parts of the rectangular frame with the center coordinates as the center, and then perform cutout. In this embodiment, the largest rectangular frame R0 obtained in step S5 is obtained by using “L=MAX(W, H) / 2 + 80" to obtain the outward expansion length L, where W and H are the width and height of R0, and the central coordinate C0 of R0 is calculated. With the central coordinate as the center, the upper, lower, left and right outward expansion lengths L are obtained to obtain a new rectangular frame R1 and cut out the image, and scale it to "160×160". In this embodiment, the rectangular frame is expanded to "160×160", and the obtained image is brightened to restore the dim face to normal brightness. In this embodiment, the "160×160" image is processed by combining Gamma correction and Retinex algorithm. Since the image may be dim due to light obstruction during use in an actual environment, Gamma correction and Retinex algorithm can be combined here for brightening. The face is clear to the naked eye, even if it is normal brightness. Because all faces will have this brightening operation, it can be considered that all faces are in the same brightness range. The 42 facial key point coordinates obtained by the key point acquisition unit are converted to obtain the upper left corner coordinates (x1, y1) of the rectangular frame R1. Assuming (x', y') are the coordinates of the facial key points obtained in step S8, and the coordinates are transformed according to "(x, y) = (((x', y') - (x1, y1)) / (2L, 2L)) * (160, 160)" to obtain the coordinates of 42 facial key points based on the "160×160" image; Secondary processing unit: used to perform face recognition and 42 face key point recognition on the image obtained by the face image processing unit, perform face alignment and scaling processing, use the latest 42 face key point coordinates obtained in step S10 to calculate the similarity transformation matrix between these key points (eyes, nose, mouth) and the reference key points, this matrix includes parameters such as rotation, scaling and translation, transform the face image to the position and posture of the reference face, so that the facial feature points coincide with the feature points of the reference face, thereby achieving the alignment effect; Primary face comparison unit: used to input the image data obtained by the secondary processing unit into the face feature model Model_D1, obtain the face feature data, perform a circular comparison with the face database, record the top 20 faces with the highest scores, and save the first face with the highest score FA and face label LA; Secondary face comparison unit: used to input the image data obtained by the secondary processing unit into the face feature model Model_D2, obtain the face feature data, compare it with the first 20 faces obtained by the primary face comparison unit, and save the face FB and face label LB with the highest score; The third face comparison unit is used to input the image data obtained by the second processing unit into the face feature model Model_D3 to obtain the face feature data, compare it with the first 20 faces obtained by the first face comparison unit, and save the face FC and face label LC with the highest score; Result judgment unit: used for condition judgment, the judgment condition is "Condition 1: FA satisfies a threshold greater than or equal to 0.51, and FB satisfies a threshold greater than or equal to 0.51, and LA and LB are equal; Condition 2: FA satisfies a threshold greater than or equal to 0.51, and FC satisfies a threshold greater than or equal to 0.53, and LA and LC are equal; Condition 3: FB satisfies a threshold greater than or equal to 0.51, and FC satisfies a threshold greater than or equal to 0.53, and LB and LC are equal". If any of the above three conditions is met, it directly enters the exit unit, otherwise it enters the loop counting unit; Cycle counting unit: used to count the cycle plus 1. If the number of times is equal to the number of cycle captures, the exit unit is entered, otherwise the scaling preprocessing unit is entered. In this embodiment, since the number of cycle captures set in the setting number unit is 10 times, the cycle counting number is also 10 times; Exit unit: When the conditions in the result judgment unit are met, it exits and reports the face recognition result, triggering the DMS camera to switch from full-color image mode to near-infrared black and white image mode. In this embodiment, the switching operation is controlled by the sent level signal. In specific implementation, it can be triggered by a high level or a low level, or it can also be triggered by a specific trigger signal.

[0025] In this embodiment, the face comparison unit obtains face data by capturing a picture with a camera to perform face registration, and includes the following subunits: Mode switching subunit: used to trigger the DMS camera to switch from the near-infrared black-and-white image mode to the full-color image mode. In this embodiment, the switching operation is controlled by the sent level signal. In specific implementation, it can be triggered by a high level or a low level, or it can also be triggered by a specific trigger signal; The setting times subunit is used to set the number of loop captures. In this embodiment, the default number of main images is 10, and the capture interval is set to 300 milliseconds. In specific implementation, the number of captures and the capture interval can also be set according to the actual situation. It is necessary to ensure that the number of successful captures is at least 3 times. If it does not reach 3 times, the number of captures can be increased accordingly. After entering the "face data formal entry subunit", it is considered that the capture is successful, and the count will increase by 1. The default value is 0; Scaling preprocessing subunit: used to obtain the original image data captured by the subunit of a set number of frames, and perform preprocessing of scaling according to the same aspect ratio. In this embodiment, it is scaled to the input size of the face detection model Model_A, "1×3×256×256"; Obtaining face subunit: used to inject the pre-processed image data obtained by the scaling pre-processing subunit into the face detection model Model_A to obtain the number of face targets (in this embodiment, multiple face targets may be detected, and the largest face target will be used in the next step to determine the most likely target face); The face screening subunit is used to screen the number of face targets obtained by the face acquisition subunit by area, select the target with the largest face area, and judge whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. In this embodiment, the default threshold value T0 is 6400 pixels. During the specific implementation, the value of the threshold value T0 can also be selected according to actual needs. If the rectangular frame area reaches the appropriate threshold value T0, the posture angle acquisition subunit is entered, otherwise the loop counting subunit is entered; Posture angle acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the head posture detection model Model_B to obtain the posture angle data of the face; Frontal face judgment subunit: used to judge whether the face is in the frontal face position according to the posture angle data obtained by the posture angle acquisition subunit. If it is in the frontal face position, it enters the key point acquisition subunit, otherwise it enters the loop counting subunit; Key point acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the 42 face key point detection model Model_C to obtain 42 key points of the face; The eye and mouth state judgment subunit is used to select the mouth key points and eye key points of the 42 face key points obtained by the key point acquisition subunit, calculate the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, and judge whether the eyes are open and the mouth is closed. If so, it enters the face image processing subunit, otherwise it enters the loop counting subunit; The face image processing subunit is used to obtain the center coordinates of the largest rectangular frame obtained by the face screening subunit, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform a cutout. In this embodiment, the rectangular frame is expanded to "160×160", and the obtained image is brightened to restore the dim face to normal brightness, and the coordinates of the 42 facial key points obtained by the key point acquisition subunit are converted; Secondary processing subunit: used to process the image obtained by the face image processing subunit into a face and 42 face key points, and to perform face alignment and scaling processing; The primary facial feature data acquisition subunit is used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D1 to obtain facial feature data TData_1; Secondary facial feature data acquisition subunit: used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D2 to obtain facial feature data TData_2; The third facial feature data acquisition subunit is used to input the image data obtained by the second processing subunit into the facial feature model Model_D3 to obtain facial feature data TData_3; The face data temporary entry subunit is used to enter the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the temporary face database; The face data formal entry subunit is used to add 1 to the successful capture count. If it reaches 3, the temporary face database is merged into the formal face database and enters the loop counting subunit. Cycle counting subunit: used to add 1 to the cycle count. If the number of times is equal to the number of cycle captures, the reporting subunit is entered, otherwise the scaling preprocessing subunit is entered. In this embodiment, since the number of cycle captures set in the setting number subunit is 10 times, the cycle counting number is also 10 times; Reporting subunit: used to report face registration results. If the successful capture count meets 3 times, the report is successful, otherwise, the report fails. Exit subunit: used to exit after reporting the face registration result, triggering the DMS camera to switch from full-color image mode to near-infrared black-and-white image mode. In this embodiment, the switching operation is controlled by the sent level signal. During specific implementation, it can be triggered by a high level or a low level, or it can also be triggered by a specific trigger signal to exit face registration.

[0026] In this embodiment, the face comparison unit obtains face data by importing an external full-color image to perform face registration, which includes the following sub-steps: Image input subunit: used to load N images of faces to be registered. The number of images is at least one. The subscript count is set to 0. N images are loaded into the memory in the form of an array. The traversal of images is counted by the subscript in the memory, starting from 0 to N-1. Scaling preprocessing subunit: used to read an image into memory and perform preprocessing of scaling it according to the same aspect ratio; Obtaining face subunit: used to inject the preprocessed image data obtained by the scaling preprocessing subunit into the face detection model Model_A to obtain the number of face targets; The face screening subunit is used to screen the number of face targets obtained by the face subunit by area, select the target with the largest face area, and determine whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. In this embodiment, the default threshold value T0 is 6400 pixels. During the specific implementation, the value of the threshold value T0 can also be selected according to actual needs. If the rectangular frame area reaches the appropriate threshold value T0, the key point acquisition subunit is entered, otherwise, step S12-2-13 is entered; Key point acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the 42 face key point detection model Model_C to obtain 42 key points of the face; The face image processing subunit is used to obtain the center coordinates of the largest rectangular frame obtained by the face screening subunit, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform a cutout. In this embodiment, the rectangular frame is expanded to "160×160", and the obtained image is brightened to restore the dim face to normal brightness, and the coordinates of the 42 face key points of the key point acquisition subunit are converted; Secondary processing subunit: used for performing face recognition and 42 face key point recognition, face alignment and scaling processing on the image obtained by the face image processing subunit; The primary facial feature data acquisition subunit is used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D1 to obtain facial feature data TData_1; Secondary facial feature data acquisition subunit: used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D2 to obtain facial feature data TData_2; The third facial feature data acquisition subunit is used to input the image data obtained by the second processing subunit into the facial feature model Model_D3 to obtain facial feature data TData_3; The face data temporary entry subunit is used to enter the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the formal face database; Face data entry subunit: used to add 1 to the subscript count and report that the face registration of the current picture is successful. If it is the last picture, it enters the exit subunit, otherwise it enters the scaling preprocessing subunit to read the next picture; Face data registration failure subunit: used to add 1 to the subscript count and report that the face registration of the current picture has failed. If it is the last picture, it enters the exit subunit, otherwise it enters the scaling preprocessing subunit to read the next picture; Exit subunit: used to exit face registration after reporting the face registration result.

[0027] The present invention also protects a storage medium, which stores a program that can implement the above-mentioned multi-model strategy face recognition method based on full-color infrared black and white image switching camera when running.

[0028] The present invention also protects an electronic device which, when in use, can implement the above-mentioned multi-model strategy face recognition method based on full-color infrared black and white image switching cameras.

[0029] The camera in the present invention can freely switch between full-color images and infrared black-and-white images according to high and low levels. When face recognition is to be performed, it is switched to full-color image mode through hardware level signal triggering, and then face recognition is performed according to a certain strategy using three trained face feature models. The full-color picture data is used to enrich the features of the face, and the face area is brightened pre-processed and multiple model strategy judgments are performed, which greatly improves the accuracy and success rate of face recognition in the DMS field and can be applied to more scenarios.

Claims

1. A multi-model strategy face recognition method based on a full-color infrared black-and-white image switching camera, the method is implemented based on a DMS camera capable of switching between full-color images and infrared black-and-white images, and is characterized by: The face recognition method comprises the following steps: Step S1, mode switching: triggering the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Step S2, setting the number of times: setting the number of cyclic capture times; Step S3, scaling preprocessing: obtaining a frame of original image data captured in step S2, and performing scaling preprocessing according to the same aspect ratio; Step S4, obtaining human faces: injecting the preprocessed image data obtained in step S3 into the face detection model Model_A to obtain the number of human face targets; Step S5, face screening: the number of face targets obtained in step S4 is screened by area, the target with the largest face area is selected, and it is judged whether the rectangular frame area of ​​the target reaches the appropriate threshold T0. If the rectangular frame area reaches the appropriate threshold T0, step S6 is entered, otherwise step S16 is entered; Step S6, posture angle acquisition: the largest rectangular frame obtained in step S5 is cut out on the original image data in step S3, and then scaling preprocessing is performed, and the scaled preprocessed image data is injected into the head posture detection model Model_B to obtain the posture angle data of the face; Step S7, frontal face judgment: according to the posture angle data obtained in step S6, judge whether the face is in the frontal face position, if it is in the frontal face position, proceed to step S8, otherwise proceed to step S16; Step S8, key point acquisition: the largest rectangular frame obtained in step S5 is cut out on the original image data in step S3, and then scaling preprocessing is performed, and the image data after scaling preprocessing is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S9, judging the state of eyes and mouth: selecting the mouth key points and eye key points of the 42 facial key points obtained in step S8, calculating the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, judging whether the eyes are open and the mouth is closed, if yes, proceeding to step S10, otherwise proceeding to step S16; Step S10, face image processing: the largest rectangular frame obtained in step S5 is used to obtain the center coordinates of the rectangular frame, and the upper, lower, left and right sides of the rectangular frame are expanded with the center coordinates as the center, and then the image is cut out, and the obtained image is brightened to restore the dim face to normal brightness, and the coordinates of the 42 facial key points obtained in step S8 are converted; Step S11, secondary processing: performing face recognition and face key point recognition on the image obtained in step S10, and performing face alignment and scaling processing; Step S12, a face comparison: the image data obtained in step S11 is fed into the face feature model Model_D1 to obtain the face feature data, which is cyclically compared with the face database, the top 20 faces with the highest scores are recorded, and the first face with the highest score FA and face label LA are saved; Step S13, secondary face comparison: the image data obtained in step S11 is fed into the face feature model Model_D2 to obtain the face feature data, which is compared with the first 20 faces obtained in step S12, and the face FB and face label LB with the highest score are saved; Step S14, three face comparisons: the image data obtained in step S11 is fed into the face feature model Model_D3 to obtain the face feature data, which is compared with the first 20 faces obtained in step S12, and the face FC and face label LC with the highest score are saved; Step S15, result judgment: the judgment conditions are "Condition 1: FA meets the threshold value 0.51, and FB meets the threshold value 0.51, and LA and LB are equal; Condition 2: FA meets the threshold value 0.51, and FC meets the threshold value 0.53, and LA and LC are equal; Condition 3: FB meets the threshold value 0.51, and FC meets the threshold value 0.53, and LB and LC are equal". If any one of the above three conditions is met, directly go to step S17, otherwise go to step S16; Step 16, loop count: the loop count is increased by 1. If the number of times is equal to the number of loop capture times, then go to step S17, otherwise go to step S3; Step S17, exit: When the conditions in step S15 are met, exit and report the face recognition result, triggering the DMS camera to switch from full-color image mode to near-infrared black-and-white image mode.

2. The multi-model strategy face recognition method based on full-color infrared black and white image switching camera according to claim 1 is characterized in that: The step S12 of obtaining face data by capturing a picture with a camera for face registration includes the following sub-steps: Step S12-1-1, mode switching: triggering the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Step S12-1-2, setting the number of times: setting the number of cyclic captures to ensure that the number of successful captures is at least 3 times; Step S12-1-3, scaling preprocessing: obtaining a frame of original image data captured in step S12-1-2, and performing preprocessing of scaling according to the same aspect ratio; Step 12-1-4, obtaining human faces: injecting the pre-processed image data obtained in step S12-1-3 into the face detection model Model_A to obtain the number of human face targets; Step S12-1-5, face screening: perform area screening on the face targets obtained in step S12-1-4, select the target with the largest face area, and determine whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. If the rectangular frame area reaches an appropriate threshold value T0, proceed to step S12-1-6, otherwise proceed to step S12-1-17; Step S12-1-6, posture angle acquisition: the largest rectangular frame obtained in step S12-1-5 is cut out on the original image data in step S12-1-3, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the head posture detection model Model_B to obtain the posture angle data of the face; Step S12-1-7, frontal face judgment: according to the posture angle data obtained in step S12-1-6, judge whether the face is in the frontal face position, if it is in the frontal face position, proceed to step S12-1-8, otherwise proceed to step S12-1-17; Step S12-1-8, key point acquisition: the largest rectangular frame obtained in step S12-1-5 is cut out on the original image data in step S12-1-3, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S12-1-9, judging the state of eyes and mouth: Select the mouth key points and eye key points of the 42 facial key points obtained in step S12-1-8, calculate the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, and judge whether the eyes are open and the mouth is closed. If yes, proceed to step S12-1-10, otherwise proceed to step S12-1-17; Step S12-1-10, face image processing: obtain the center coordinates of the largest rectangular frame obtained in step S12-1-5, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 facial key points obtained in step S12-1-8; Step S12-1-11, secondary processing: the image obtained in step S12-1-10 is processed into a face and 42 face key points, and face alignment and scaling are performed; Step S12-1-12, a facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D1 to obtain facial feature data TData_1; Step S12-1-13, secondary facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D2 to obtain facial feature data TData_2; Step S12-1-14, three times of facial feature data collection: the image data obtained in step S12-1-11 is fed into the facial feature model Model_D3 to obtain facial feature data TData_3; Step S12-1-15, temporary entry of face data: entering the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into a temporary face database; Step S12-1-16, formal entry of face data: the successful capture count is increased by 1. If it is 3, the temporary face database is merged into the formal face database, and the process goes to step S12-1-17; Step S12-1-17, loop count: the loop count is increased by 1. If the number of times is equal to the number of loop capture times, then go to step S12-1-18, otherwise go to step S12-1-3; Step S12-1-18, reporting: reporting the face registration result. If the successful capture count meets 3 times, the report is successful, otherwise, the report fails; Step S12-1-19, exit: After reporting the face registration result, exit, trigger the DMS camera to switch from full-color image mode to near-infrared black and white image mode, and exit face registration.

3. The multi-model strategy face recognition method based on full-color infrared black and white image switching camera according to claim 1 is characterized in that: In step S12, obtaining face data by importing an external full-color image to perform face registration includes the following sub-steps: Step S12-2-1, picture input: input N pictures of faces to be registered, the number of pictures is at least one, and the subscript count is set to 0; Step S12-2-2, scaling preprocessing: read a picture into memory and perform scaling preprocessing according to the same aspect ratio; Step S12-2-3, obtaining human faces: injecting the preprocessed image data obtained in step S12-2-2 into the face detection model Model_A to obtain the number of human face targets; Step S12-2-4, face screening: perform area screening on the face targets obtained in step S12-2-3, select the target with the largest face area, and determine whether the rectangular frame area of ​​the target reaches an appropriate threshold value T0. If the rectangular frame area reaches an appropriate threshold value T0, proceed to step S12-2-5, otherwise proceed to step S12-2-13; Step S12-2-5, key point acquisition: the largest rectangular frame obtained in step S12-2-4 is cut out on the original image data in step S12-2-2, and then scaled and pre-processed, and the scaled and pre-processed image data is injected into the 42 face key point detection model Model_C to obtain 42 key points of the face; Step S12-2-6, face image processing: obtain the center coordinates of the largest rectangular frame obtained in step S12-2-4, expand the pixels on the top, bottom, left and right of the rectangular frame with the center coordinates as the center, and then perform cutout to restore the dim face to normal brightness, and convert the coordinates of the 42 facial key points in step S12-2-5; Step S12-2-7, secondary processing: perform face recognition and 42 face key point recognition on the image obtained in step S12-2-6, and perform face alignment and scaling processing; Step S12-2-8, first facial feature data collection: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D1 to obtain facial feature data TData_1; Step S12-2-9, secondary facial feature data collection: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D2 to obtain facial feature data TData_2; Step S12-2-10, three times of facial feature data collection: the image data obtained in step S12-2-7 is fed into the facial feature model Model_D3 to obtain facial feature data TData_3; Step S12-2-11, temporary entry of face data: entering the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the formal face database; Step S12-2-12, face data entry: add 1 to the subscript count, report that the face registration of the current picture is successful, if it is the last picture, go to step S12-2-14, otherwise go to step S12-2-2 to read the next picture; Step S12-2-13, face data registration failure: add 1 to the subscript count, and report that the face registration of the current picture has failed. If it is the last picture, go to step S12-2-14, otherwise go to step S12-2-2 to read the next picture; Step S12-2-14, exit: After reporting the face registration result, exit the face registration.

4. A multi-model strategy face recognition system based on full-color infrared black-and-white image switching camera, the camera used in the system is a camera that can switch between full-color images and infrared black-and-white images, and its characteristics are: The face recognition system includes the following unit modules: Mode switching unit: used to trigger the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Setting times unit: used to set the number of cycle capture times; Scaling preprocessing unit: used to obtain the original image data captured by the unit for a set number of times in one frame, and perform scaling preprocessing according to the same aspect ratio; Obtaining face unit: used to inject the pre-processed image data obtained in the scaling pre-processing unit into the face detection model Model_A to obtain the number of face targets; Face screening unit: used to screen the number of face targets obtained by the face acquisition unit by area, select the target with the largest face area, and judge whether the rectangular box area of ​​the target reaches the appropriate threshold T0. If the rectangular box area reaches the appropriate threshold T0, it enters the posture angle acquisition unit, otherwise it enters the loop counting unit; Posture angle acquisition unit: used to cut out the largest rectangular frame obtained in the face screening unit on the original image data in the scaling preprocessing unit, and then perform scaling preprocessing, and then inject the image data after scaling preprocessing into the head posture detection model Model_B to obtain the posture angle data of the face; Frontal face judgment unit: used to judge whether the face is in the frontal face position according to the posture angle data obtained by the posture angle acquisition unit. If it is in the frontal face position, it enters the key point acquisition unit, otherwise it enters the loop counting unit; Key point acquisition unit: used to cut out the largest rectangular frame obtained by the face screening unit on the original image data of the scaling preprocessing unit, and then perform scaling preprocessing, and inject the image data after scaling preprocessing into the 42 face key point detection model Model_C to obtain 42 key points of the face; Eye and mouth state judgment unit: used for selecting the mouth key points and eye key points of the 42 face key points obtained by the key point acquisition unit, calculating the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, judging whether the eyes are open and the mouth is closed, if yes, entering the face image processing unit, otherwise entering the loop counting unit; The face image processing unit is used to obtain the center coordinates of the largest rectangular frame obtained in the face screening unit, expand the pixels of the upper, lower, left and right parts of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 face key points obtained by the key point acquisition unit; Secondary processing unit: used for performing face recognition and 42 face key point recognition, face alignment and scaling processing on the image obtained by the face image processing unit; Primary face comparison unit: used to input the image data obtained by the secondary processing unit into the face feature model Model_D1, obtain the face feature data, perform a circular comparison with the face database, record the top 20 faces with the highest scores, and save the first face with the highest score FA and face label LA; Secondary face comparison unit: used to input the image data obtained by the secondary processing unit into the face feature model Model_D2, obtain the face feature data, compare it with the first 20 faces obtained by the primary face comparison unit, and save the face FB and face label LB with the highest score; The third face comparison unit is used to input the image data obtained by the second processing unit into the face feature model Model_D3 to obtain the face feature data, compare it with the first 20 faces obtained by the first face comparison unit, and save the face FC and face label LC with the highest score; Result judgment unit: used for condition judgment, the judgment condition is "Condition 1: FA meets the threshold value 0.51, and FB meets the threshold value 0.51, and LA and LB are equal; Condition 2: FA meets the threshold value 0.51, and FC meets the threshold value 0.53, and LA and LC are equal; Condition 3: FB meets the threshold value 0.51, and FC meets the threshold value 0.53, and LB and LC are equal". If any of the above three conditions is met, it directly enters the exit unit, otherwise it enters the loop counting unit; Loop counting unit: used to add 1 to the loop count. If the number of times is equal to the number of loop capture times, the exit unit is entered, otherwise the zoom preprocessing unit is entered; Exit unit: When the conditions in the result judgment unit are met, it exits and reports the face recognition result, triggering the DMS camera to switch from full-color image mode to near-infrared black and white image mode.

5. The multi-model strategy face recognition system based on full-color infrared black and white image switching camera according to claim 4 is characterized in that: The face comparison unit obtains face data by capturing a picture with a camera for face registration, and includes the following subunits: Mode switching subunit: used to trigger the DMS camera to switch from near-infrared black-and-white image mode to full-color image mode; Setting times subunit: used to set the number of cyclic capture times; Scaling preprocessing subunit: used to obtain the original image data captured by the subunit for a set number of times in one frame, and perform preprocessing for scaling according to the same aspect ratio; Obtaining face subunit: used to inject the preprocessed image data obtained by the scaling preprocessing subunit into the face detection model Model_A to obtain the number of face targets; Face screening subunit: used to screen the number of face targets obtained by the face acquisition subunit by area, select the target with the largest face area, and judge whether the rectangular box area of ​​the target reaches the appropriate threshold T0. If the rectangular box area reaches the appropriate threshold T0, it enters the posture angle acquisition subunit, otherwise it enters the loop counting subunit; Posture angle acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the head posture detection model Model_B to obtain the posture angle data of the face; Frontal face judgment subunit: used to judge whether the face is in the frontal face position according to the posture angle data obtained by the posture angle acquisition subunit. If it is in the frontal face position, it enters the key point acquisition subunit, otherwise it enters the loop counting subunit; Key point acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the 42 face key point detection model Model_C to obtain 42 key points of the face; The eye and mouth state judgment subunit is used to select the mouth key points and eye key points of the 42 face key points obtained by the key point acquisition subunit, calculate the average width-to-height ratio R1 of the eyes and the width-to-height ratio R2 of the mouth, and judge whether the eyes are open and the mouth is closed. If so, it enters the face image processing subunit, otherwise it enters the loop counting subunit; The face image processing subunit is used to obtain the center coordinates of the largest rectangular frame obtained by the face screening subunit, expand the pixels of the upper, lower, left and right parts of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 face key points obtained by the key point acquisition subunit; Secondary processing subunit: used to process the image obtained by the face image processing subunit into a face and 42 face key points, and to perform face alignment and scaling processing; The primary facial feature data acquisition subunit is used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D1 to obtain facial feature data TData_1; Secondary facial feature data acquisition subunit: used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D2 to obtain facial feature data TData_2; The third facial feature data acquisition subunit is used to input the image data obtained by the second processing subunit into the facial feature model Model_D3 to obtain facial feature data TData_3; The face data temporary entry subunit is used to enter the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the temporary face database; The face data formal entry subunit is used to add 1 to the successful capture count. If it reaches 3, the temporary face database is merged into the formal face database and enters the loop counting subunit. Cycle counting subunit: used to add 1 to the cycle count. If the number of times is equal to the number of cycle capture times, it enters the reporting subunit, otherwise it enters the scaling preprocessing subunit; Reporting subunit: used to report face registration results. If the successful capture count meets 3 times, the report is successful, otherwise, the report fails. Exit subunit: After reporting the face registration result, exit, trigger the DMS camera to switch from full-color image mode to near-infrared black-and-white image mode, and exit face registration.

6. The multi-model strategy face recognition system based on full-color infrared black and white image switching camera according to claim 4 is characterized in that: The face comparison unit obtains face data by importing an external full-color picture to perform face registration, and includes the following subunits: Image input subunit: used to input N images of faces to be registered. The number of images must be at least one, and the subscript count is set to 0; Scaling preprocessing subunit: used to read an image into memory and perform preprocessing of scaling it according to the same aspect ratio; Obtaining face subunit: used to inject the preprocessed image data obtained by the scaling preprocessing subunit into the face detection model Model_A to obtain the number of face targets; Face screening subunit: used to screen the number of face targets obtained by the face acquisition subunit by area, select the target with the largest face area, and judge whether the rectangular box area of ​​the target reaches the appropriate threshold T0. If the rectangular box area reaches the appropriate threshold T0, enter the key point acquisition subunit, otherwise enter the face data registration failure subunit; Key point acquisition subunit: used to cut out the largest rectangular frame obtained by the face screening subunit on the original image data of the scaling preprocessing subunit, and then perform scaling preprocessing, and then inject the scaled preprocessed image data into the 42 face key point detection model Model_C to obtain 42 key points of the face; The face image processing subunit is used to obtain the center coordinates of the largest rectangular frame obtained by the face screening subunit, expand the pixels of the upper, lower, left and right parts of the rectangular frame with the center coordinates as the center, and then perform a cutout operation to brighten the obtained image, restore the dim face to normal brightness, and convert the coordinates of the 42 face key points of the key point acquisition subunit; Secondary processing subunit: used for performing face recognition and 42 face key point recognition, face alignment and scaling processing on the image obtained by the face image processing subunit; The primary facial feature data acquisition subunit is used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D1 to obtain facial feature data TData_1; Secondary facial feature data acquisition subunit: used to input the image data obtained by the secondary processing subunit into the facial feature model Model_D2 to obtain facial feature data TData_2; The third facial feature data acquisition subunit is used to input the image data obtained by the second processing subunit into the facial feature model Model_D3 to obtain facial feature data TData_3; The face data temporary entry subunit is used to enter the face feature data TData_1, face feature data TData_2 and face feature data TData_3 together with the label into the formal face database; Face data entry subunit: used to add 1 to the subscript count and report that the face registration of the current picture is successful. If it is the last picture, it enters the exit subunit, otherwise it enters the scaling preprocessing subunit to read the next picture; Face data registration failure subunit: used to add 1 to the subscript count and report that the face registration of the current picture has failed. If it is the last picture, it enters the exit subunit, otherwise it enters the scaling preprocessing subunit to read the next picture; Exit subunit: used to exit face registration after reporting the face registration result.

7. A storage medium, characterized in that: The storage medium stores a program that can implement the multi-model strategy face recognition method based on full-color infrared black and white image switching camera as described in any one of claims 1 to 3 when running.

8. An electronic device, characterized in that: When used, the electronic device can implement the multi-model strategy face recognition method based on full-color infrared black and white image switching camera as described in any one of claims 1 to 3.