Face pre-warning efficiency improving method and device

By combining hash algorithms and multi-level feature caching libraries with pipelined queues, the problems of low efficiency and insufficient accuracy of face warning under large data streams and large feature libraries are solved, achieving fast and accurate warning results.

CN117315747BActive Publication Date: 2026-06-26WUHAN CHINASOFT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN CHINASOFT TECH CO LTD
Filing Date
2023-09-20
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Current technologies suffer from low efficiency and insufficient accuracy in face detection under conditions of large data streams and large target feature databases, and are particularly affected by factors such as lighting.

Method used

By employing a hash algorithm combined with a multi-level feature cache library and a pipeline queue, and through feature extraction, comparison, and updating, the hash algorithm is used to quickly calculate similarity for early warning.

Benefits of technology

It improves the efficiency and accuracy of facial recognition, especially in the case of large data streams and large feature databases, reduces errors caused by factors such as lighting, and achieves fast and accurate comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117315747B_ABST
    Figure CN117315747B_ABST
Patent Text Reader

Abstract

The application provides a face early warning efficiency improving method and device, comprising: obtaining a to-be-compared face image and a face detection image; performing feature extraction and comparison on the to-be-compared face image, updating a flow queue, performing feature extraction and comparison on the face detection image, and updating a face early warning library; each feature and a label are contained in the flow queue and the face early warning library; taking a screenshot of the face detection image and performing feature extraction to obtain a first face feature, comparing the first face feature with all features in the flow queue to obtain a first label; performing calculation on the first label and all labels of all features in the face early warning library based on a hash algorithm to obtain a target face image, comparing the face detection image and the target face image to obtain a similarity, and performing early warning according to the similarity. The application achieves the purpose of improving the efficiency of face early warning.
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, specifically to a method and apparatus for improving the efficiency of facial recognition. Background Technology

[0002] Currently, conventional face detection technologies typically extract facial feature values ​​and then compare them to facial features in a target feature database. If the value exceeds a certain threshold, an alert is issued. However, this method is extremely time-consuming and cannot achieve real-time accuracy, especially with large data volumes and a large target feature database. Furthermore, features in the database can contain errors due to lighting conditions, further reducing the accuracy of the comparison.

[0003] Therefore, there is an urgent need to propose a method and device to improve the efficiency of face warning, and to solve the technical problems in the existing technology that the features in the target feature library may have errors, which may lead to a decrease in the accuracy of comparison. At the same time, it is impossible to quickly compare faces when the data flow is large and the target feature face library is large. Summary of the Invention

[0004] In view of this, it is necessary to provide a method and device for improving the efficiency of face warning, so as to solve the technical problems in the existing technology that the features in the target feature library may have errors, which may lead to a decrease in the accuracy of comparison, and at the same time, it is impossible to quickly compare faces when the data flow is large and the target feature face library is large.

[0005] On the one hand, the present invention provides a method for improving the efficiency of face warning, including:

[0006] Acquire the face image to be compared and the face detection image;

[0007] Feature extraction and comparison are performed on the face image to be compared, and the pipeline queue is updated. Feature extraction and comparison are performed on the face detection image, and the face warning database is updated. The pipeline queue and the face warning database contain each feature and its corresponding label.

[0008] The face detection image is cropped and its features are extracted to obtain a first face feature. The first face feature is compared with all features in the pipeline queue to obtain a first label.

[0009] The target face image is obtained by calculating all labels of all features in the first label and the face warning database based on the hash algorithm. The face detection image and the target face image are then compared to obtain the similarity score, and a warning is issued based on the similarity score.

[0010] In some possible implementations, the step of extracting and comparing features from the face image to be compared, and updating the pipeline queue, includes:

[0011] Create a first-level feature cache, a second-level feature cache, and a pipeline queue;

[0012] Feature extraction is performed on the face image to be compared to obtain the second face feature;

[0013] Obtain the historical facial feature library and cache the historical facial feature library to the secondary feature cache library in the form of key-value pairs;

[0014] The second face feature is judged based on the face threshold of the first-level feature cache and the second-level feature cache to obtain the judgment result. Based on the judgment result, the first-level feature cache, the second-level feature cache and the pipeline queue are updated.

[0015] In some possible implementations, the step of judging the second face feature based on the face thresholds of the first-level feature cache and the second-level feature cache to obtain a judgment result, and updating the first-level feature cache, the second-level feature cache, and the pipeline queue based on the judgment result, includes:

[0016] The second face feature is compared with all features in the first-level feature cache to obtain a first comparison result, and it is determined whether the first comparison result is greater than a first face threshold.

[0017] If not, the second face feature is judged according to the second face threshold of the second-level feature cache library to obtain the judgment result, and the second-level feature cache library and the pipeline queue are updated according to the judgment result;

[0018] If so, the first-level feature cache library is updated based on the first comparison result and the second facial features.

[0019] In some possible implementations, updating the first-level feature cache based on the first comparison result and the second facial features includes:

[0020] Based on the first comparison result, determine the third face feature in the first-level feature cache that matches the second face feature;

[0021] Determine the second label of the third facial feature, and set the second label as the label of the second facial feature;

[0022] The second facial feature and the second label are stored in the first-level feature cache, and the first-level feature cache is updated.

[0023] In some possible implementations, the step of judging the second face feature based on the second face threshold of the second-level feature cache, obtaining a judgment result, and updating the second-level feature cache and the pipeline queue based on the judgment result includes:

[0024] The second face feature is compared with all features in the second-level feature cache in a segmented, multi-threaded manner to obtain a second comparison result, and it is determined whether the second comparison result is greater than the second face threshold.

[0025] If so, based on the second comparison result, determine the fourth face feature that matches the second face feature in the second-level feature cache library, determine the third label of the fourth face feature, determine the third label as the label of the second face feature, store the second face feature and the third label in the second-level feature cache library, and update the second-level feature cache library.

[0026] If not, then update the first-level feature cache, the second-level feature cache, and the pipeline queue.

[0027] In some possible implementations, updating the first-level feature cache, the second-level feature cache, and the pipeline queue includes:

[0028] Based on all the tags in the first-level feature cache and the second-level feature cache, generate a fourth tag that is different from all the tags;

[0029] The fourth label is determined as the label of the second facial feature;

[0030] The second facial feature and the fourth tag are stored in the first-level feature cache, the second-level feature cache, and the pipeline queue, thereby updating the first-level feature cache, the second-level feature cache, and the pipeline queue.

[0031] In some possible implementations, the alert based on the similarity includes:

[0032] Determine the similarity level of the given similarity;

[0033] Output the corresponding warning message based on the similarity level.

[0034] In some possible implementations, obtaining the face image to be compared includes:

[0035] Perform face analysis on the video stream acquired by the electronic device to obtain at least one data frame;

[0036] The video stream is cropped based on at least one data frame to obtain a set of face images, and the face image to be compared is determined from the set of face images.

[0037] In some possible implementations, after performing feature extraction and comparison on the face image to be compared and updating the pipeline queue, the process further includes:

[0038] Determine whether there are any face images in the face image set that have not undergone feature extraction and comparison;

[0039] If so, the face image to be compared is redefined, features are extracted and compared on the face image to be compared, and the pipeline queue is updated.

[0040] On the other hand, the present invention also provides a face warning efficiency improvement device, comprising:

[0041] The image acquisition module is used to acquire the face image to be compared and the face detection image;

[0042] The queue update module is used to extract and compare features of the face images to be compared, update the pipeline queue, extract and compare features of the face detection images, and update the face warning database; the pipeline queue and the face warning database contain each feature and its corresponding label;

[0043] The feature extraction module is used to capture and extract features from the face detection image to obtain a first face feature, and compare the first face feature with all features in the pipeline queue to obtain a first label;

[0044] The feature calculation module is used to calculate all labels of all features in the first label and the face warning database based on a hash algorithm to obtain the target face image, compare the face detection image and the target face image to obtain the similarity, and issue a warning based on the similarity.

[0045] The beneficial effects of the above embodiments are as follows: The face warning efficiency improvement method provided by the present invention updates the pipeline queue by acquiring the face image to be compared from the electronic device, and then performs feature extraction and comparison on the face detection image, takes a screenshot, performs feature extraction again, and compares it with the updated pipeline queue. This avoids errors caused by factors such as the lighting of the electronic device, and improves the accuracy of feature extraction and comparison. Furthermore, a hash algorithm is used to calculate all labels of all features in the face warning database and the first label. This allows for rapid processing of all features in the face warning database, even when there is a large amount of feature data, to obtain the target face image, thus improving the efficiency of face warning. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 A schematic flowchart of an embodiment of the face warning efficiency improvement method provided by the present invention;

[0048] Figure 2 A schematic diagram of an embodiment of the updated first-level feature cache, second-level feature cache, and pipeline queue provided by the present invention;

[0049] Figure 3 A schematic diagram of an embodiment of the face warning efficiency improvement device provided by the present invention;

[0050] Figure 4 A schematic diagram of an embodiment of the electronic device provided by the present invention. Detailed Implementation

[0051] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0052] Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor systems and / or microcontroller systems.

[0053] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0054] This invention provides a method and apparatus for improving the efficiency of face warning, which will be described below.

[0055] Figure 1 A schematic flowchart of an embodiment of the face warning efficiency improvement method provided by the present invention is shown below. Figure 1 As shown, methods to improve the efficiency of face recognition early warning include:

[0056] S101. Obtain the face image to be compared and the face detection image;

[0057] S102. Perform feature extraction and comparison on the face images to be compared, update the pipeline queue, perform feature extraction and comparison on the face detection images, and update the face warning database; the pipeline queue and the face warning database contain each feature and its corresponding label;

[0058] S103. Capture and extract features from the face detection image to obtain the first face feature. Compare the first face feature with all features in the pipeline queue to obtain the first label.

[0059] S104. Calculate all labels of all features in the first label and the face warning database based on the hash algorithm to obtain the target face image, compare the face detection image and the target face image to obtain the similarity, and issue a warning based on the similarity.

[0060] Compared with existing technologies, the face warning efficiency improvement method provided by this invention updates the pipeline queue with the face image to be compared acquired by the electronic device, then performs feature extraction and comparison on the face detection image, takes a screenshot, performs feature extraction again, and compares it with the updated pipeline queue. This avoids errors caused by factors such as lighting conditions of the electronic device, thus improving the accuracy of feature extraction and comparison. Furthermore, a hash algorithm is used to calculate all labels of all features in the face warning database and the first label. This allows for rapid processing of all features in the face warning database, even with a large amount of feature data, to obtain the target face image, thereby improving the efficiency of face warning.

[0061] It should be understood that the face image to be compared obtained in step S101 can be a face image obtained from an electronic device, such as a camera, or a face image stored in history retrieved from a storage medium.

[0062] In a specific embodiment of the present invention, the face image to be compared can be an image acquired by an electronic device, which can be a camera. The face detection image can be an image that the user inputs on the system after logging in. The camera can acquire multiple face images by capturing images to obtain a face image set. Then, the face image to be compared is selected from the set. Feature extraction and comparison are performed on the face image to be compared. After updating the pipeline queue, the face image to be compared can be determined again from the face image set until the image processing in the face image set is completed.

[0063] It should be noted that the electronic device can be a video recording device capable of acquiring video streams. In some embodiments of the present invention, step S101 includes:

[0064] Perform face analysis on the video stream acquired by the electronic device to obtain at least one data frame;

[0065] The video stream is cropped based on at least one data frame to obtain a set of face images, and the face image to be compared is determined from the set of face images.

[0066] In a specific embodiment of the present invention, the electronic device can acquire a video stream, then perform face analysis on the video stream to obtain at least one data frame in the video stream where the face is located, and then crop the at least one data frame to obtain the face image corresponding to each data frame, thereby obtaining a face image set, and then determining the face image to be compared from the face image set.

[0067] In some embodiments of the present invention, step S102 includes:

[0068] Create a first-level feature cache, a second-level feature cache, and a pipeline queue;

[0069] Feature extraction is performed on the face images to be compared to obtain the second face features;

[0070] Obtain the historical facial feature database and cache it in the secondary feature cache database using key-value pairs;

[0071] The second face feature is judged based on the face threshold of the first-level feature cache and the second-level feature cache, and the judgment result is obtained. Based on the judgment result, the first-level feature cache, the second-level feature cache and the pipeline queue are updated.

[0072] It should be noted that the first-level feature cache, the second-level feature cache, and the pipeline queue are created before feature extraction is performed on the face images to be compared. Each image processing step updates the feature data in these three databases. The historical face feature database can contain feature data extracted and stored over a period of time, such as 30 days, 100 days, etc., and this embodiment of the method does not impose any limitations on this.

[0073] In a specific embodiment of the present invention, face recognition can be performed on the face images to be compared using a target detection algorithm (Cascaded CNN), and then face features can be extracted using a ResNet-50 network model to obtain the second face features. The subsequent feature extraction process is the same. Furthermore, historical face feature databases can be cached in a secondary feature cache database using key-value pairs, thereby improving the speed of feature data comparison.

[0074] In some embodiments of the present invention, the second face feature is judged based on the face threshold of the first-level feature cache and the second-level feature cache to obtain a judgment result. Based on the judgment result, the first-level feature cache, the second-level feature cache, and the pipeline queue are updated, including:

[0075] The second face feature is compared with all features in the first-level feature cache to obtain the first comparison result, and it is determined whether the first comparison result is greater than the first face threshold.

[0076] If not, the second face feature is judged according to the second face threshold of the second-level feature cache, and the judgment result is obtained. Based on the judgment result, the second-level feature cache and pipeline queue are updated.

[0077] If so, the first-level feature cache is updated based on the first comparison result and the second facial features.

[0078] In some embodiments of the present invention, updating the first-level feature cache based on the first comparison result and the second facial features includes:

[0079] Based on the first comparison result, a third face feature that matches the second face feature is determined in the first-level feature cache.

[0080] Determine the second label of the third facial feature, and set the second label as the label of the second facial feature;

[0081] Store the second facial features and the second label in the first-level feature cache, and update the first-level feature cache.

[0082] In some embodiments of the present invention, the second face feature is judged based on the second face threshold of the second-level feature cache to obtain a judgment result. Based on the judgment result, the second-level feature cache and the pipeline queue are updated, including:

[0083] The second face feature is compared with all features in the second-level feature cache in a segmented, multi-threaded manner to obtain the second comparison result, and it is determined whether the second comparison result is greater than the second face threshold.

[0084] If so, based on the second comparison result, determine the fourth face feature that matches the second face feature in the second-level feature cache, determine the third label of the fourth face feature, set the third label as the label of the second face feature, store the second face feature and the third label in the second-level feature cache, and update the second-level feature cache.

[0085] If not, then update the first-level feature cache, the second-level feature cache, and the pipeline queue.

[0086] In some embodiments of the present invention, updating the first-level feature cache, the second-level feature cache, and the pipeline queue includes:

[0087] Based on all the tags in the first-level feature cache and the second-level feature cache, generate a fourth tag that is different from all the tags;

[0088] The fourth label is identified as the label for the second facial feature;

[0089] The second facial feature and the fourth label are stored in the first-level feature cache, the second-level feature cache, and the pipeline queue, thereby updating the first-level feature cache, the second-level feature cache, and the pipeline queue.

[0090] In some embodiments of the present invention, step S102 is followed by:

[0091] Determine whether there are face images in the face image set that have not undergone feature extraction and comparison;

[0092] If so, then identify the third face image, perform feature extraction and comparison on the third face image, and update the pipeline queue.

[0093] In specific embodiments of the present invention, such as Figure 2 As shown, after determining the face image to be compared from the face image set and extracting features to obtain the second face feature, the second face feature can be compared with all features in the first-level feature cache to obtain the first comparison result. This allows us to determine whether the first comparison result is greater than the first face threshold. If the first comparison result is greater than the first face threshold, we can determine the third face feature in the first-level feature cache that matches the second face feature based on the first comparison result. We can also determine the second label of the third face feature and use the second label as the label of the second face feature. Thus, the second face feature and the second label can be stored in the first-level feature cache, which serves to update the first-level feature cache. If the first comparison result is not greater than the first face threshold, the second face feature can be compared with all features in the second-level feature cache in a segmented, multi-threaded manner to obtain the second comparison result. The segmented, multi-threaded comparison can be performed as follows: if the face recognition program identifies the age of the face image to be compared as around 20 years old, the error can be set to ±15 years. Then, the face features between 5 and 35 years old can be compared in 30 threads for each age. If the amount of data is still very large, 60 threads can be used for comparison based on gender, etc. Finally, the comparison results are merged, which can greatly improve efficiency. The specific segmented, multi-threaded comparison parameters can be set according to the actual situation, and this embodiment of the invention does not impose any limitations on them.

[0094] It can also determine whether the second comparison result is greater than the second face threshold. If the second comparison result is greater than the second face threshold, then based on the second comparison result, the fourth face feature matching the second face feature in the second-level feature cache can be determined, thereby determining the third label of the fourth face feature. The third label is then used as the label of the second face feature, and the second face feature and the third label can be stored in the second-level feature cache, thus achieving the purpose of updating the second-level feature cache. If the second comparison result is not greater than the second face threshold, then based on all the labels in the first-level and second-level feature caches, a new label can be generated. This new label is different from all the labels, and it can be used as the fourth label. The fourth label can also be used as the label of the second face feature. The second face feature and the fourth label can be stored in the first-level feature cache, the second-level feature cache, and the pipeline queue, thus achieving the purpose of updating the first-level feature cache, the second-level feature cache, and the pipeline queue.

[0095] After updating the first-level feature cache and / or the second-level feature cache and / or the pipeline queue, when there are multiple face images in the face image set, it can be determined whether there are any face images in the set that have not undergone feature extraction and comparison. If so, after performing feature extraction on the face image to be compared and updating the pipeline queue, a third face image can be determined from the face image set. This process of performing feature extraction and comparison on the face images to be compared and updating the pipeline queue is repeated. If not, the update is complete, and subsequent steps are performed.

[0096] It should be noted that during the initial feature extraction of the face detection image, there may be some errors due to camera angle and lighting conditions. Therefore, face recognition can be performed on the face detection image. If a matching face is found, a screenshot is taken, and feature extraction is performed on the screenshot to obtain the first face feature. This first face feature is then compared with all features in the updated pipeline to obtain the first label of the matching feature data. A hash algorithm is then used to calculate the target face image by combining the first label with all labels of all features in the face warning database. The principle of the hash algorithm is to calculate a large number, then take the modulo of the array length to obtain the index. The array can then be accessed using the index. The specific process can be set according to the actual situation, and this embodiment of the invention does not impose any limitations. Alternatively, the face detection image and the target face image can be compared to obtain the similarity score.

[0097] In some embodiments of the present invention, step S104 includes:

[0098] Determine the similarity level of the similarity;

[0099] Output the corresponding warning message based on the similarity level.

[0100] In a specific embodiment of the present invention, a similarity level can be set, the similarity level can be determined, the corresponding warning information can be obtained, and the similarity can be stored in a relevant alarm database, so that staff can view face warning information according to the relevant alarm database.

[0101] To better implement the face warning efficiency improvement method in the embodiments of the present invention, based on the face warning efficiency improvement method, the embodiments of the present invention also provide a face warning efficiency improvement device, such as... Figure 3 As shown, the face recognition efficiency improvement device includes:

[0102] The image acquisition module 301 is used to acquire a face image to be compared and a face detection image; the face image to be compared is an image obtained from an electronic device; the face detection image is an image input by the user.

[0103] The queue update module 302 is used to extract and compare features from the face images to be compared, update the pipeline queue, extract and compare features from the face detection images, and update the face warning database; the pipeline queue and the face warning database contain each feature and its corresponding label;

[0104] The feature extraction module 303 is used to capture and extract features from the face detection image to obtain the first face feature, and compare the first face feature with all features in the pipeline queue to obtain the first label;

[0105] The feature calculation module 304 is used to calculate all labels of all features in the first label and the face warning database based on the hash algorithm to obtain the target face image, and compare the face detection image and the target face image to obtain the similarity, and issue a warning based on the similarity.

[0106] The face warning efficiency improvement device provided in the above embodiments can realize the technical solutions described in the above face warning efficiency improvement method embodiments. The specific implementation principles of each module or unit can be found in the corresponding content in the above face warning efficiency improvement method embodiments, and will not be repeated here.

[0107] like Figure 4 As shown, the present invention also provides an electronic device 400. The electronic device 400 includes a processor 401, a memory 402, and a display 403. Figure 4 Only some components of the electronic device 400 are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.

[0108] In some embodiments, memory 402 may be an internal storage unit of electronic device 400, such as a hard disk or memory of electronic device 400. In other embodiments, memory 402 may also be an external storage device of electronic device 400, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. equipped on electronic device 400.

[0109] Furthermore, the memory 402 may include both internal storage units of the electronic device 400 and external storage devices. The memory 402 is used to store application software and various types of data installed on the electronic device 400.

[0110] In some embodiments, processor 401 may be a central processing unit (CPU), microprocessor or other data processing chip, used to run program code stored in memory 402 or process data, such as the face warning efficiency improvement method of the present invention.

[0111] In some embodiments, display 403 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. Display 403 is used to display information from electronic device 400 and to display a visual user interface. Components 401-403 of electronic device 400 communicate with each other via a system bus.

[0112] In some embodiments of the present invention, when the processor 401 executes the face warning efficiency improvement program in the memory 402, the following steps can be implemented:

[0113] Acquire the face image to be compared and the face detection image; the face image to be compared is an image obtained from an electronic device; the face detection image is an image input by the user;

[0114] Feature extraction and comparison are performed on the face images to be compared, and the pipeline queue is updated. Feature extraction and comparison are performed on the face detection images, and the face warning database is updated. The pipeline queue and the face warning database contain each feature and its corresponding label.

[0115] The face detection image is cropped and its features are extracted to obtain the first face feature. The first face feature is compared with all features in the pipeline queue to obtain the first label.

[0116] The target face image is obtained by calculating all labels of all features in the first label and the face warning database based on the hash algorithm. The face detection image and the target face image are then compared to obtain the similarity, and a warning is issued based on the similarity.

[0117] It should be understood that when the processor 401 executes the face warning efficiency improvement program in the memory 402, in addition to the functions mentioned above, it can also perform other functions, as can be found in the description of the corresponding method embodiments above.

[0118] Furthermore, this embodiment of the invention does not specifically limit the type of electronic device 400 mentioned. Electronic device 400 can be a mobile phone, tablet computer, personal digital assistant (PDA), wearable device, laptop computer, or other portable electronic device. Exemplary embodiments of portable electronic devices include, but are not limited to, portable electronic devices running iOS, Android, Microsoft, or other operating systems. The aforementioned portable electronic device can also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the invention, electronic device 400 may not be a portable electronic device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0119] Accordingly, this application also provides a computer-readable storage medium for storing computer-readable programs or instructions. When the programs or instructions are executed by a processor, they can implement the face warning efficiency improvement method steps or functions provided in the above-described method embodiments.

[0120] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.), and the computer program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0121] The above provides a detailed description of the face warning efficiency improvement method and device provided by the present invention. Specific examples have been used to illustrate the principle and implementation of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation and application scope based on the idea of ​​the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for improving the efficiency of face recognition early warning, characterized in that, include: Acquire the face image to be compared and the face detection image; the face detection image is the image that needs to be detected, which is entered into the system by the user after logging in. Feature extraction and comparison are performed on the face image to be compared, and the pipeline queue is updated. Feature extraction and comparison are performed on the face detection image, and the face warning database is updated. The pipeline queue and the face warning database contain each feature and its corresponding label. The face detection image is cropped and its features are extracted to obtain a first face feature. The first face feature is compared with all features in the pipeline queue to obtain a first label. The target face image is obtained by calculating all labels of all features in the first label and the face warning database based on the hash algorithm. The face detection image and the target face image are compared to obtain the similarity. The warning is then issued based on the similarity. The step of extracting and comparing features from the face images to be compared, and updating the pipeline queue, includes: Create a first-level feature cache, a second-level feature cache, and a pipeline queue; Feature extraction is performed on the face image to be compared to obtain the second face feature; Obtain the historical facial feature library and cache the historical facial feature library to the secondary feature cache library in the form of key-value pairs; The second face feature is judged based on the face threshold of the first-level feature cache and the second-level feature cache to obtain the judgment result. Based on the judgment result, the first-level feature cache, the second-level feature cache and the pipeline queue are updated. The acquisition of the face image to be compared includes: Perform face analysis on the video stream acquired by the electronic device to obtain at least one data frame; The video stream is cropped based on at least one data frame to obtain a set of face images, and the face image to be compared is determined from the set of face images.

2. The method for improving the efficiency of face early warning according to claim 1, characterized in that, The step of judging the second face feature based on the face thresholds of the first-level feature cache and the second-level feature cache to obtain a judgment result, and updating the first-level feature cache, the second-level feature cache, and the pipeline queue based on the judgment result, includes: The second face feature is compared with all features in the first-level feature cache to obtain a first comparison result, and it is determined whether the first comparison result is greater than a first face threshold. If not, the second face feature is judged according to the second face threshold of the second-level feature cache library to obtain the judgment result, and the second-level feature cache library and the pipeline queue are updated according to the judgment result; If so, the first-level feature cache library is updated based on the first comparison result and the second facial features.

3. The method for improving the efficiency of face early warning according to claim 2, characterized in that, The step of updating the first-level feature cache based on the first comparison result and the second facial features includes: Based on the first comparison result, determine the third face feature in the first-level feature cache that matches the second face feature; Determine the second label of the third facial feature, and set the second label as the label of the second facial feature; The second facial feature and the second label are stored in the first-level feature cache, and the first-level feature cache is updated.

4. The method for improving the efficiency of face early warning according to claim 2, characterized in that, The step of judging the second face feature based on the second face threshold of the second-level feature cache, obtaining a judgment result, and updating the second-level feature cache and the pipeline queue based on the judgment result includes: The second face feature is compared with all features in the second-level feature cache in a segmented, multi-threaded manner to obtain a second comparison result, and it is determined whether the second comparison result is greater than the second face threshold. If so, based on the second comparison result, determine the fourth face feature that matches the second face feature in the second-level feature cache library, determine the third label of the fourth face feature, determine the third label as the label of the second face feature, store the second face feature and the third label in the second-level feature cache library, and update the second-level feature cache library. If not, then update the first-level feature cache, the second-level feature cache, and the pipeline queue.

5. The method for improving the efficiency of face early warning according to claim 4, characterized in that, The update of the first-level feature cache, the second-level feature cache, and the pipeline queue includes: Based on all the tags in the first-level feature cache and the second-level feature cache, generate a fourth tag that is different from all the tags; The fourth label is determined as the label of the second facial feature; The second facial feature and the fourth tag are stored in the first-level feature cache, the second-level feature cache, and the pipeline queue, thereby updating the first-level feature cache, the second-level feature cache, and the pipeline queue.

6. The method for improving the efficiency of face early warning according to claim 1, characterized in that, The alert based on the similarity includes: Determine the similarity level of the given similarity; Output the corresponding warning message based on the similarity level.

7. The method for improving the efficiency of face early warning according to claim 1, characterized in that, After performing feature extraction and comparison on the face images to be compared, and updating the pipeline queue, the process further includes: Determine whether there are any face images in the face image set that have not undergone feature extraction and comparison; If so, the face image to be compared is redefined, features are extracted and compared on the face image to be compared, and the pipeline queue is updated.

8. A face detection efficiency improvement device, characterized in that, include: The image acquisition module is used to acquire the face image to be compared and the face detection image; The face detection image is the image that the user inputs into the system after logging in, and that needs to be detected. The queue update module is used to extract and compare features of the face images to be compared, update the pipeline queue, extract and compare features of the face detection images, and update the face warning database; the pipeline queue and the face warning database contain each feature and its corresponding label; The feature extraction module is used to capture and extract features from the face detection image to obtain a first face feature, and compare the first face feature with all features in the pipeline queue to obtain a first label; The feature calculation module is used to calculate all labels of all features in the first label and the face warning database based on a hash algorithm to obtain the target face image, and compare the face detection image and the target face image to obtain the similarity, and issue a warning based on the similarity. The step of extracting and comparing features from the face images to be compared, and updating the pipeline queue, includes: Create a first-level feature cache, a second-level feature cache, and a pipeline queue; Feature extraction is performed on the face image to be compared to obtain the second face feature; Obtain the historical facial feature library and cache the historical facial feature library to the secondary feature cache library in the form of key-value pairs; The second face feature is judged based on the face threshold of the first-level feature cache and the second-level feature cache to obtain the judgment result. Based on the judgment result, the first-level feature cache, the second-level feature cache and the pipeline queue are updated. The acquisition of the face image to be compared includes: Perform face analysis on the video stream acquired by the electronic device to obtain at least one data frame; The video stream is cropped based on at least one data frame to obtain a set of face images, and the face image to be compared is determined from the set of face images.