A high-precision face recognition method, device, equipment and medium

By employing a multi-frame stepped threshold post-processing method and target tracking and pedestrian re-identification modules, the accuracy and real-time performance issues of face recognition under motion conditions were resolved, achieving high-precision face recognition.

CN118072370BActive Publication Date: 2026-07-24恒鸿达(福建)体育科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
恒鸿达(福建)体育科技有限公司
Filing Date
2024-01-11
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In facial recognition while in motion, the low quality of facial images captured during movement makes recognition difficult. Existing technologies increase hardware costs or computing power requirements, making it difficult to meet real-time requirements.

Method used

A multi-frame stepped threshold post-processing method is adopted to perform face localization and recognition using existing models. Target tracking and pedestrian re-identification modules are used, combined with confidence threshold processing and a multi-frame relative value method to correct the recognition results.

Benefits of technology

It improves the accuracy of facial recognition, reduces the probability of missed and false detections, and meets real-time requirements without increasing hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118072370B_ABST
    Figure CN118072370B_ABST
Patent Text Reader

Abstract

The application provides a high-precision face recognition method, device, equipment and medium, the method first introduces a target tracking and pedestrian re-identification module, locates to an effective person through the technology, and then recognizes the collected effective face through a face recognition algorithm, and further corrects the recognition result by using a multi-frame and ladder threshold post-processing method, thereby avoiding the probability deviation caused by single-frame absolute output, reducing the missed detection and false detection probability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of facial recognition technology, and in particular to a high-precision facial recognition method, apparatus, device, and medium. Background Technology

[0002] Facial recognition technology, as a fundamental algorithm in AI-powered smart education systems, plays a crucial role in practical applications. Traditional facial recognition methods involve capturing facial images and directly feeding them into a recognition model for feature extraction, followed by face comparison, outputting the comparison result. However, in sports, which are typically dynamic and involve groups, captured faces often suffer from interference from numerous individuals, dynamic blurring, and low quality, making it difficult to locate the correct individuals. Furthermore, low-quality images significantly impact the facial recognition results. While using more advanced cameras or larger models can solve some problems, cost and real-time requirements often limit hardware and model improvements in practical project implementation.

[0003] Existing technologies include: 1. Using high-end cameras to solve motion-based projects; 2. Performing a series of image enhancements on the captured images; 3. Using deeper network structures and larger models.

[0004] Disadvantages: 1. Customized hardware is too expensive and difficult to implement; 2. Faces captured during motion are often blurry and small in size, and the face after image enhancement technology deviates greatly from the actual face, making recognition difficult; 3. Larger models require more computing power, increasing costs. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a high-precision face recognition method, device, equipment and medium, which uses a multi-frame, stepped threshold post-processing method to further correct the recognition results, avoids the probability deviation caused by the absolute output of a single frame, and reduces the probability of missed detection and false detection.

[0006] In a first aspect, the present invention provides a high-precision face recognition method, comprising:

[0007] Step 1: Locate faces of people in the video stream using existing models;

[0008] Step 2: Perform face recognition using a face recognition model, and output the three results with the highest confidence in the frame, along with their corresponding confidence scores; i.e., res11: conf11, res12: conf12, res13: conf13.

[0009] Step 3: If conf11 is greater than or equal to 0.6, output res11 as the recognition result and clear the preset valids_results sequence and temp_results sequence.

[0010] If conf11 is greater than 0.4 and less than 0.6, then res11 and conf11 are stored in the preset valids_results sequence; if conf11 is less than or equal to 0.4 and greater than 0.2, then res11:conf11, res12:conf12, and res13:conf13 are all stored in the preset temp_results sequence; if conf11 is less than or equal to 0.2, it means there is no recognition result; continue to acquire images of the set frame, repeat steps 1 to 3, until the valids_results sequence or the temp_results sequence contains three values;

[0011] If the valids_results sequence first collects three values, if the three recognition results are the same, then the recognition result is output; if two of the three recognition results are the same, then the recognition result is output; if the three recognition results are different, then the recognition result with the highest confidence is output.

[0012] If three values ​​are collected from the valids_results sequence, and only one of the three values ​​appears two or three times or more, then that recognition result is output. If two or more of the three values ​​appear two or three times simultaneously, then a weighted average is calculated and compared, and the recognition result with the larger weighted average is output. If no one of the three values ​​appears two or three times, then there is no recognition result, and the valids_results and temp_results sequences are cleared.

[0013] Secondly, the present invention provides a high-precision face recognition device, comprising:

[0014] The positioning module uses existing models to locate faces of people in the video stream.

[0015] The recognition module uses a face recognition model to perform face recognition and outputs the three results with the highest confidence in the frame, along with their corresponding confidence scores; that is, res11:conf11, res12:conf12, res13:conf13.

[0016] The output module outputs res11 as the recognition result if conf11 is greater than or equal to 0.6, and clears the preset valids_results sequence and temp_results sequence.

[0017] If conf11 is greater than 0.4 and less than 0.6, then res11 and conf11 are stored in the preset valids_results sequence; if conf11 is less than or equal to 0.4 and greater than 0.2, then res11:conf11, res12:conf12, and res13:conf13 are all stored in the preset temp_results sequence; if conf11 is less than or equal to 0.2, it means there is no recognition result; continue to acquire images of the set frame, repeat steps 1 to 3, until the valids_results sequence or the temp_results sequence contains three values;

[0018] If the valids_results sequence first collects three values, if the three recognition results are the same, then the recognition result is output; if two of the three recognition results are the same, then the recognition result is output; if the three recognition results are different, then the recognition result with the highest confidence is output.

[0019] If three values ​​are collected from the valids_results sequence, and only one of the three values ​​appears two or three times or more, then that recognition result is output. If two or more of the three values ​​appear two or three times simultaneously, then a weighted average is calculated and compared, and the recognition result with the larger weighted average is output. If no one of the three values ​​appears two or three times, then there is no recognition result, and the valids_results and temp_results sequences are cleared.

[0020] Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect.

[0021] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.

[0022] One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:

[0023] This invention introduces target tracking and person re-identification modules from computer vision, and uses a multi-frame, gradient-based threshold post-processing method and a multi-frame relative value method to improve face recognition accuracy. Through this invention, recognition accuracy is significantly improved, and real-time industrial requirements are met without increasing hardware costs.

[0024] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0026] Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention;

[0027] Figure 2 This is a schematic diagram of the device in Embodiment 2 of the present invention. Detailed Implementation

[0028] Example 1

[0029] like Figure 1 As shown, this embodiment provides a high-precision face recognition method, including:

[0030] Step 1: Based on the open-source target tracking algorithm bytetrack, a human detection model is trained using the open-source target detection project yolov5. A person re-identification model with ResNet50 as the backbone is introduced to locate faces of people in the video stream. Frames are selected from the video stream, and the interval between frames can be selected, such as the first frame, the third frame, the fifth frame, etc.

[0031] Step 2: Perform face recognition using a face recognition model, and output the three results with the highest confidence in the frame, along with their corresponding confidence scores; i.e., res11: conf11, res12: conf12, res13: conf13.

[0032] Step 3: If conf11 is greater than or equal to 0.6, then output res11 as the recognition result and clear the preset valids_results and temp_results sequences; for example, if the confidence of res11 is 0.7, then the image corresponding to res11 is the recognition result, and it can be output.

[0033] If conf11 is greater than 0.4 and less than 0.6, then res11 and conf11 are stored in the preset valids_results sequence; if conf11 is less than or equal to 0.4 and greater than 0.2, then res11:conf11, res12:conf12, and res13:conf13 are all stored in the preset temp_results sequence; if conf11 is less than or equal to 0.2, it means there is no recognition result; continue to acquire images of the set frame, repeat steps 1 to 3, until the valids_results sequence or the temp_results sequence contains three values;

[0034] If the valids_results sequence first collects three values, and the three recognition results are the same, then that recognition result is output; if two of the three recognition results are the same, then that recognition result is output; if the three recognition results are all different, then the recognition result with the highest confidence is output; for example:

[0035] valids_results = [res1:0.5, res1:0.46, res1:0.45]; if res1 appears 3 times in the valids_results sequence, then the image output corresponding to res1 is the recognition result.

[0036] valids_results = [res1:0.5, res1:0.46, res2:0.45]; if res1 appears twice in the valids_results sequence, then the image output corresponding to res1 is the recognition result.

[0037] valids_results = [res1:0.5, res3:0.46, res2:0.45]; The recognition results are different at this time, so the output with the highest confidence, that is, the image corresponding to res1 with 0.5, is the recognition result.

[0038] If three values ​​are collected in the `temp_results` sequence, and only one of these three values ​​appears two or three times or more, then that recognition result is output. If two or more of these three values ​​appear two or three times simultaneously, a weighted average is calculated and compared, and the recognition result with the larger weighted average is output. If no one of the three values ​​appears two or three times, then no recognition result is found, and the `valids_results` and `temp_results` sequences are cleared. The weights of the weighted average are set as follows:

[0039] When the same recognition result appears three times, the weights of the three recognition results are 0.25, 0.35 and 0.4 respectively, according to the sequence order.

[0040] When the same recognition result appears twice, the weights of the three results are 0.15, 0.35 and 0.5 respectively, according to the sequence order; and the result with no confidence is calculated with a fixed value of 0.5.

[0041] For example, the output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0042] The output of frame 3 is: res21:conf21, res12:conf22, res23:conf23;

[0043] The output of frame 5 is: res31:conf31, res32:conf32, res12:conf33;

[0044] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0045] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res21: conf21, res22: conf12, res23: conf23], [res31: conf31, res32: conf32, res12: conf33]; In this case, res12 appears 3 times in the sequence, and the number of times other results appear is less than that of res12. Therefore, the image corresponding to res12 is taken as the output result.

[0046] The output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0047] The output of frame 3 is: res21:conf21, res12:conf22, res23:conf23;

[0048] The output of frame 5 is: res31:conf31, res32:conf32, res33:conf33;

[0049] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0050] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res21: conf21, res22: conf12, res23: conf23], [res31: conf31, res32: conf32, res33: conf33]; In this case, res12 appears twice in the sequence, and the number of occurrences of other results is less than that of res12. Therefore, the image corresponding to res12 is taken as the output result.

[0051] The output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0052] The output of frame 3 is: res11:conf21, res12:conf22, res23:conf23;

[0053] The output of frame 5 is: res31:conf31, res12:conf32, res11:conf33;

[0054] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0055] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res11: conf21, res12: conf22, res23: conf23], [res31: conf31, res12: conf32, res11: conf33]; In this case, res11 and res12 both appear 3 times in the sequence.

[0056] Then a weighted average calculation is needed, and the value of res11 is conf. a = 0.25*conf11 + 0.35*con f21 + 0.4*conf33; the value of res12 is conf b = 0.25*conf12 + 0.35*conf22 + 0.4*conf32; then change conf a and conf b The comparison is performed, and the image corresponding to the larger value is output as the output result; if they are equal, a random image is output.

[0057] The output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0058] The output of frame 3 is: res21:conf21, res12:conf22, res23:conf23;

[0059] The output of frame 5 is: res31:conf31, res32:conf32, res11:conf33;

[0060] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0061] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res21: conf21, res12: conf22, res23: conf23], [res31: conf31, res32: conf32, res11: conf33]; In this case, res11 and res12 both appear twice in the sequence.

[0062] Then a weighted average calculation is needed, at which point: the value of res11 is conf a = 0.15 * conf11 + 0.35 * 0.5 + 0.4 * conf33; The value of res12 is conf b = 0.25 * conf12 + 0.35 * conf22 + 0.4 * 0.5; then change conf a and conf b The comparison is performed, and the image corresponding to the larger value is output as the output result; if they are equal, a random image is output.

[0063] Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2.

[0064] Example 2

[0065] like Figure 2 As shown, this embodiment provides a high-precision face recognition device, including:

[0066] The localization module is based on the open-source target tracking algorithm bytetrack and uses the open-source target detection project yolov5 to train a human detection model. It introduces a person re-identification model with ResNet50 as the backbone to locate faces in the video stream. It selects frames from the video stream, and can select intervals of two frames, such as the first frame, the third frame, the fifth frame, etc.

[0067] The recognition module uses a face recognition model to perform face recognition and outputs the three results with the highest confidence in the frame, along with their corresponding confidence scores; that is, res11:conf11, res12:conf12, res13:conf13.

[0068] The output module outputs res11 as the recognition result if conf11 is greater than or equal to 0.6, and clears the preset valids_results sequence and temp_results sequence.

[0069] If conf11 is greater than 0.4 and less than 0.6, then res11 and conf11 are stored in the preset valids_results sequence; if conf11 is less than or equal to 0.4 and greater than 0.2, then res11:conf11, res12:conf12, and res13:conf13 are all stored in the preset temp_results sequence; if conf11 is less than or equal to 0.2, it means there is no recognition result; continue to acquire images of the set frame, repeat steps 1 to 3, until the valids_results sequence or the temp_results sequence contains three values;

[0070] If the valids_results sequence first collects three values, and the three recognition results are the same, then that recognition result is output; if two of the three recognition results are the same, then that recognition result is output; if the three recognition results are all different, then the recognition result with the highest confidence is output; for example:

[0071] valids_results = [res1:0.5, res1:0.46, res1:0.45]; if res1 appears 3 times in the valids_results sequence, then the image output corresponding to res1 is the recognition result.

[0072] valids_results = [res1:0.5, res1:0.46, res2:0.45]; if res1 appears twice in the valids_results sequence, then the image output corresponding to res1 is the recognition result.

[0073] valids_results = [res1:0.5, res3:0.46, res2:0.45]; The recognition results are different at this time, so the output with the highest confidence, that is, the image corresponding to res1 with 0.5, is the recognition result.

[0074] If three values ​​are collected in the `temp_results` sequence, and only one of these three values ​​appears two or three times or more, then that recognition result is output. If two or more of these three values ​​appear two or three times simultaneously, a weighted average is calculated and compared, and the recognition result with the larger weighted average is output. If no one of the three values ​​appears two or three times, then no recognition result is found, and the `valids_results` and `temp_results` sequences are cleared. The weights of the weighted average are set as follows:

[0075] When the same recognition result appears three times, the weights of the three recognition results are 0.25, 0.35 and 0.4 respectively, according to the sequence order.

[0076] When the same recognition result appears twice, the weights of the three results are 0.15, 0.35 and 0.5 respectively, according to the sequence order; and the result without confidence is calculated with a fixed value of 0.5.

[0077] For example, the output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0078] The output of frame 3 is: res21:conf21, res12:conf22, res23:conf23;

[0079] The output of frame 5 is: res31:conf31, res32:conf32, res12:conf33;

[0080] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0081] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res21: conf21, res22: conf12, res23: conf23], [res31: conf31, res32: conf32, res12: conf33]; In this case, res12 appears 3 times in the sequence, and the number of times other results appear is less than that of res12. Therefore, the image corresponding to res12 is taken as the output result.

[0082] The output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0083] The output of frame 3 is: res21:conf21, res12:conf22, res23:conf23;

[0084] The output of frame 5 is: res31:conf31, res32:conf32, res33:conf33;

[0085] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0086] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res21: conf21, res22: conf12, res23: conf23], [res31: conf31, res32: conf32, res33: conf33]; In this case, res12 appears twice in the sequence, and the number of occurrences of other results is less than that of res12. Therefore, the image corresponding to res12 is taken as the output result.

[0087] The output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0088] The output of frame 3 is: res11:conf21, res12:conf22, res23:conf23;

[0089] The output of frame 5 is: res31:conf31, res12:conf32, res11:conf33;

[0090] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0091] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res11: conf21, res12: conf22, res23: conf23], [res31: conf31, res12: conf32, res11: conf33]; In this case, res11 and res12 both appear 3 times in the sequence.

[0092] Then a weighted average calculation is needed, and the value of res11 is conf. a = 0.25*conf11 + 0.35*con f21 + 0.4*conf33; the value of res12 is confb = 0.25*conf12 + 0.35*conf22 + 0.4*conf32; then change conf a and conf b The comparison is performed, and the image corresponding to the larger value is output as the output result; if they are equal, a random image is output.

[0093] The output of the first frame is: res11:conf11, res12:conf12, res13:conf13;

[0094] The output of frame 3 is: res21:conf21, res12:conf22, res23:conf23;

[0095] The output of frame 5 is: res31:conf31, res32:conf32, res11:conf33;

[0096] If the confidence levels mentioned above are all greater than 0.4 and less than 0.6, then the temp_results sequence will be as follows:

[0097] temp_results = [[res11: conf11, res12: conf12, res13: conf13], [res21: conf21, res12: conf22, res23: conf23], [res31: conf31, res32: conf32, res11: conf33]; In this case, res11 and res12 both appear twice in the sequence.

[0098] Then a weighted average needs to be calculated, at which point the value of res11 is:

[0099] conf a = 0.15 * conf11 + 0.35 * 0.5 + 0.4 * conf33; The value of res12

[0100] conf b = 0.25 * conf12 + 0.35 * conf22 + 0.4 * 0.5; then change conf a and conf b The comparison is performed, and the image corresponding to the larger value is output as the output result; if they are equal, a random image is output.

[0101] Since the apparatus described in Embodiment 2 of the present invention is an apparatus used to implement the method of Embodiment 1 of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in Embodiment 1 of the present invention, and therefore will not be described again here. All apparatuses used in the method of Embodiment 1 of the present invention fall within the scope of protection of the present invention.

[0102] Based on the same inventive concept, this application provides an electronic device embodiment corresponding to Embodiment 1, as detailed in Embodiment 3.

[0103] Example 3

[0104] This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can implement any of the implementation methods in Embodiment 1.

[0105] Since the electronic device described in this embodiment is the device used to implement the method in Embodiment 1 of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in Embodiment 1 of this application. Therefore, how the electronic device implements the method in the embodiment of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in the embodiment of this application falls within the scope of protection of this application.

[0106] Based on the same inventive concept, this application provides a storage medium corresponding to Embodiment 1, as detailed in Embodiment 4.

[0107] Example 4

[0108] This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it can implement any of the implementation methods in Embodiment 1.

[0109] The technical solution provided in this application embodiment has at least the following technical effects or advantages: This invention introduces a target tracking and pedestrian re-identification module from computer vision, and uses a multi-frame, gradient threshold post-processing method and a multi-frame relative value method to improve face recognition accuracy. Through this invention, recognition accuracy is significantly improved, and real-time industrial requirements are met without increasing hardware costs.

[0110] Table 1 Comparison of Experimental Results

[0111]

[0112] The experiments demonstrate that, on our proprietary dataset, by incorporating target tracking, a pedestrian re-identification module, and a multi-frame, stepped threshold post-processing method, we significantly improved the accuracy of face recognition, albeit at the cost of some speed, while still meeting real-time requirements. This experiment included a human detection dataset of 86,450 images, a face database of 8,364 images, and 734 face verification videos.

[0113] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0117] While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the present invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A high-precision face recognition method, characterized in that, include: Step 1: Locate faces of people in the video stream using existing models; Step 2: Perform face recognition using a face recognition model, and output the three results with the highest confidence in the frame, along with their corresponding confidence scores; i.e., res11: conf11, res12: conf12, res13: conf13. Step 3: If conf11 is greater than or equal to 0.6, output res11 as the recognition result and clear the preset valids_results sequence and temp_results sequence. If conf11 is greater than 0.4 and less than 0.6, then res11 and conf11 are stored in the preset valids_results sequence; if conf11 is less than or equal to 0.4 and greater than 0.2, then res11:conf11, res12:conf12, and res13:conf13 are all stored in the preset temp_results sequence; if conf11 is less than or equal to 0.2, it means there is no recognition result; continue to acquire images of the set frame, repeat steps 1 to 3, until the valids_results sequence or the temp_results sequence contains three values; If the valids_results sequence first collects three values, if the three recognition results are the same, then the recognition result is output; if two of the three recognition results are the same, then the recognition result is output; if the three recognition results are different, then the recognition result with the highest confidence is output. If the temp_results sequence first collects three values, and only one of the three values ​​appears two or three times or more, then that recognition result is output; if two or more of the three values ​​appear two or three times simultaneously, then a weighted average is calculated and compared, and the recognition result with the larger weighted average is output; if no one of the three values ​​appears two or three times, then there is no recognition result, and the valids_results and temp_results sequences are cleared. The weights of the weighted average are set as follows: When the same recognition result appears three times, the weights of the three recognition results are 0.25, 0.35 and 0.4 respectively, according to the sequence order. When the same identification result appears twice, the weights of the three results are 0.15, 0.35 and 0.5 respectively, according to the sequence order; and the result with no confidence is calculated with a fixed value of 0.

5. Step 1 is further specified as follows: Based on the open-source object tracking algorithm bytetrack, a human detection model was trained using the open-source object detection project yolov5. A pedestrian re-identification model with ResNet50 as the backbone was introduced to locate faces of people in the video stream.

2. A high-precision face recognition device, characterized in that, include: The positioning module uses existing models to locate faces of people in the video stream. The recognition module uses a face recognition model to perform face recognition and outputs the three results with the highest confidence in the frame, as well as... The corresponding confidence levels; that is, res11:conf11, res12:conf12, res13:conf13; The output module outputs res11 as the recognition result if conf11 is greater than or equal to 0.6, and clears the preset valids_results sequence and temp_results sequence. If conf11 is greater than 0.4 and less than 0.6, then res11 and conf11 are stored in the preset valids_results sequence; if conf11 is less than or equal to 0.4 and greater than 0.2, then res11:conf11, res12:conf12, and res13:conf13 are all stored in the preset temp_results sequence; if conf11 is less than or equal to 0.2, it means there is no recognition result; continue to acquire images of the set frame, repeat steps 1 to 3, until the valids_results sequence or the temp_results sequence contains three values; If the valids_results sequence collects three values ​​first, and the three recognition results are the same, then the recognition result is output. like If two of the three recognition results are the same, then that recognition result is output; if the three recognition results are different, then the recognition result with the highest confidence is output. If the temp_results sequence first collects three values, and only one of the three values ​​appears two or three times or more, then that recognition result is output; if two or more of the three values ​​appear two or three times simultaneously, then a weighted average is calculated and compared, and the recognition result with the larger weighted average is output; if no one of the three values ​​appears two or three times, then there is no recognition result, and the valids_results and temp_results sequences are cleared. The weights of the weighted average are set as follows: When the same recognition result appears three times, the weights of the three recognition results are 0.25, 0.35 and 0.4 respectively, according to the sequence order. When the same identification result appears twice, the weights of the three results are 0.15, 0.35 and 0.5 respectively, according to the sequence order; and the result with no confidence is calculated with a fixed value of 0.

5. The positioning module is further specifically defined as follows: Based on the open-source object tracking algorithm bytetrack, a human detection model was trained using the open-source object detection project yolov5. A pedestrian re-identification model with ResNet50 as the backbone was introduced to locate faces of people in the video stream.

3. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in claim 1.

4. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in claim 1.