High dynamic range face detection and recognition methods, devices and computer equipment

CN119559677BActive Publication Date: 2025-10-28SHENZHEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411601571.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-10-28
Estimated Expiration
2044-11-11

AI Technical Summary

Technical Problem

但是随着现代化科技的发展,传统的人脸识别系统在识别精度、单位时间检测识别的人数、系统的集成规模也已经无法满足进一步的需求

Benefits of technology

[0047]本发明的有益效果在于:将初步的人脸检测模型通过TensorRT加速及进行权重量化,得到权重量化后的人脸检测模型,优化了人脸模型的运行速度和资源消耗,能够在有限算力资源下,在大规模人群中实时进行高精度的人脸检测识别。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559677B_ABST
    Figure CN119559677B_ABST
Patent Text Reader

Abstract

This invention provides a high-dynamic face detection and recognition method, apparatus, and computing device. The method includes: training a YOLOv8 model using a face dataset to obtain a preliminary face detection model; accelerating the preliminary face detection model using TensorRT and performing weight quantization to obtain a weighted face detection model; inputting the video stream to be detected into the weighted face detection model for face detection, and cropping and aligning the detected faces according to their coordinates; extracting features from the aligned faces using a face recognition model, and matching the extracted features with face features in a face database to identify the face. The advantages of this invention are: optimizing the running speed and resource consumption of the face model, enabling high-precision face detection and recognition in real time in large crowds with limited computing resources.
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 dynamic facial detection and recognition method, device, and computer equipment. Background Technology

[0002] With the rapid development of modern information technology, biometric identification technology has been widely used in access control systems, with facial recognition being one of the most common. Facial recognition technology boasts advantages such as speed, intuitiveness, and non-contact operation, making it a mainstream technology for identity verification and playing a crucial role in access control systems. However, with the advancement of modern technology, traditional facial recognition systems can no longer meet the demands in terms of recognition accuracy, the number of people detected per unit time, and the scale of system integration. Therefore, in high-traffic areas such as communities, streets, schools, public transportation, and train stations, it is particularly urgent to fully utilize emerging technologies such as big data, artificial intelligence, deep learning, and facial recognition to provide a large-scale, highly dynamic, and high-speed biometric identification system for facial recognition. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a high dynamic face detection and recognition method, device and computer equipment, which aims to improve the face recognition speed and recognition accuracy in high dynamic situations.

[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a high dynamic face detection and recognition method, comprising:

[0005] A preliminary face detection model was obtained by training a YOLOv8 model using a face dataset.

[0006] The initial face detection model is accelerated using TensorRT and weighted to obtain a weighted face detection model.

[0007] The video stream to be detected is input into the face detection model after weight quantization for face detection, and the detected faces are cropped and aligned according to coordinates.

[0008] The corrected and aligned face is then subjected to feature extraction using a face recognition model, and the extracted features are matched with face features in a face database to identify the identity of the face.

[0009] Furthermore, the step of accelerating the initial face detection model using TensorRT and performing weight quantization to obtain a weighted face detection model includes:

[0010] The preliminary face detection model is converted into ONNX format, and the preliminary face detection model is FP32 weighted.

[0011] Load the initial face detection model in ONNX format and create the corresponding TensorRT execution engine;

[0012] Select a subset from the validation set as the calibration dataset;

[0013] The calibration dataset is input into the initial face detection model, and the activation statistics of the face detection model are collected, including the maximum and minimum activation values ​​of each neural network layer.

[0014] The activation statistics are input into the calibration algorithm to calculate the optimal scaling factor;

[0015] Based on the optimal scaling factor, the FP32 weights of the face detection model are converted into INT8 weights using symmetric linear quantization to generate the quantized face detection model.

[0016] Furthermore, the formula used for symmetric linear quantization is:

[0017]

[0018] in:

[0019] X int This represents the quantized INT8 integer value;

[0020] X represents the original FP32 value;

[0021] clip(x; a, c) represents the clip function; a = -2 b-1 c = 2 b-1 -1;

[0022] Z represents the zero point of the mapping, used to adjust the offset;

[0023] S represents the scaling factor;

[0024] It represents a mathematical function that approximates the integer part;

[0025] x represents the value before quantization;

[0026] 'a' represents the upper limit of quantization, a = -128;

[0027] c represents the lower limit of quantization, c = 127;

[0028] b represents the number of bits in the data type. For INT8, b = 8.

[0029] Furthermore, the step of inputting the video stream to be detected into the weighted face detection model for face detection includes:

[0030] After the video stream to be detected is input into the face detection model after weight quantization, the faces in each frame of the video stream are detected, and the faces in each frame of the video stream are selected by bounding boxes.

[0031] Furthermore, the process of cropping and aligning the detected face using coordinates includes:

[0032] Based on the coordinates of the target bounding box, the faces in each frame of the video stream are cropped.

[0033] The cropped face is rotated and translated so that the key points of the face can be matched to the predefined standard positions.

[0034] Furthermore, the step of extracting features from the corrected and aligned face using a face recognition model, and matching the extracted features with face features in a face database to identify the identity of the face includes:

[0035] The corrected and aligned face is then processed by a face recognition model to extract features, outputting a multi-dimensional feature vector.

[0036] Calculate the Euclidean distance between the multidimensional feature vector and all face feature vectors in the face database;

[0037] If the Euclidean distance is less than a preset threshold, the face is determined to belong to the corresponding user in the face database; if the Euclidean distance is greater than the preset threshold, the face is determined not to belong to the user in the face database.

[0038] Furthermore, high dynamic range face detection and recognition methods also include:

[0039] Faces that are determined not to belong to the face database, along with their corresponding usernames, will be stored in the face database.

[0040] The present invention also provides a high dynamic face detection and recognition device, comprising:

[0041] The face detection model training module is used to train the YOLOv8 model using a face dataset to obtain a preliminary face detection model.

[0042] The model acceleration and quantization module is used to accelerate the initial face detection model through TensorRT and perform weight quantization to obtain a weighted face detection model.

[0043] The face detection and preprocessing module is used to input the video stream to be detected into the face detection model after weight quantization to perform face detection, and to perform coordinate cropping and alignment correction on the detected faces;

[0044] The facial recognition module is used to extract features from the corrected and aligned face using a facial recognition model, and then match the extracted features with facial features in the facial database to identify the identity of the face.

[0045] The present invention also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the high dynamic face detection and recognition method as described in any of the preceding claims.

[0046] The present invention also provides a storage medium storing a computer program, which, when executed by a processor, can implement the high dynamic face detection and recognition method as described in any of the preceding claims.

[0047] The beneficial effects of this invention are as follows: the preliminary face detection model is accelerated by TensorRT and weighted to obtain a weighted face detection model, which optimizes the running speed and resource consumption of the face model, and enables high-precision face detection and recognition in real time in large-scale crowds with limited computing power resources. Attached Figure Description

[0048] The specific structure of the present invention will now be described in detail with reference to the accompanying drawings.

[0049] Figure 1 This is a flowchart of the high dynamic range face detection and recognition method according to an embodiment of the present invention;

[0050] Figure 2 This is a block diagram of a high dynamic range face detection and recognition device according to an embodiment of the present invention;

[0051] Figure 3 This is a schematic diagram illustrating the INT8 quantization principle based on the Min-Max calibration algorithm in an embodiment of the present invention.

[0052] Figure 4 This is a schematic block diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0053] 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 some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0054] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0055] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0056] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0057] like Figure 1 As shown, an embodiment of the present invention is: a high dynamic range face detection and recognition method, comprising the following steps:

[0058] S10. Train the YOLOv8 model using the face dataset to obtain a preliminary face detection model.

[0059] In this embodiment, the YOLOv8 model is trained using the publicly available face dataset (VGGFace2). VGGFace2 is a large-scale face recognition dataset developed by the Visual Geometry Group (VGG) at Oxford University. It contains more than 3 million face images of over 9,000 subjects. Using this large-scale face dataset for model training results in a face detection model with higher generalization ability and detection accuracy.

[0060] S20. Accelerate the initial face detection model using TensorRT and perform weight quantization to obtain a weighted face detection model.

[0061] In this embodiment, TensorRT is a deep learning inference acceleration library provided by NVIDIA, which can significantly improve the inference speed of deep learning models. It also supports quantization, which can further reduce the size of the face detection model and improve its running efficiency. INT8 quantization is a symmetric signed quantization type. In this quantization strategy, the Float32 (FP32) data range is -3.4 × 10⁻⁶. Λ 38~+3.4×10 Λ38-dimensional linear quantization to the INT8 range: -128 to 127. This reduces the system memory usage of the face detection model and converts a large number of Float32 multiplications in the network into INT8 multiplications, significantly improving the inference speed of the face detection model. Using TensorRT's optimization and quantization capabilities enhances the speed and efficiency of face detection inference, achieving high dynamic range. Using TensorRT to accelerate the initial face detection model with INT8 quantization is a highly effective method, greatly improving inference speed, especially on edge devices with limited computing power.

[0062] In one specific embodiment, the step of accelerating the initial face detection model using TensorRT and performing weight quantization to obtain a weighted face detection model includes the following steps:

[0063] S21. Convert the preliminary face detection model into ONNX format. The preliminary face detection model is FP32 weighted.

[0064] In this embodiment, the trained face detection model is usually in .pt format, i.e., a PyTorch model. Converting it to ONNX format ensures that the face detection model can be more widely used on different platforms and tools, including TensorRT.

[0065] S22. Load the preliminary face detection model in ONNX format and create the corresponding TensorRT execution engine.

[0066] In this embodiment, the corresponding TensorRT execution engine is created as a .engine file.

[0067] S23. Select a subset from the validation set as the calibration dataset.

[0068] In this embodiment, a subset is selected from the validation set as the calibration dataset, which can cover various situations that the face detection model may encounter in actual use.

[0069] S24. Input the calibration dataset into the preliminary face detection model and collect the activation statistics of the face detection model, including the maximum and minimum activation values ​​of each neural network layer.

[0070] In this embodiment, the activation statistics of the face detection model are collected to provide a data basis for calculating the scaling factor. The purpose of data calibration is to find an optimal quantization parameter that minimizes the error between the data represented by INT8 and the original Float32 data, thus maintaining the accuracy of the quantized model.

[0071] S25. Input the activation statistics into the calibration algorithm to calculate the optimal scaling factor.

[0072] In this embodiment, as Figure 3 As shown, the collected activation statistics are used to run a calibration algorithm (Min-Max calibration) to calculate the optimal scaling factor. The scaling factor is used to quantize the FP32 weights and activations to INT8.

[0073] S26. Based on the optimal scaling factor, convert the FP32 weights of the face detection model into INT8 weights using symmetric linear quantization to generate the quantized face detection model.

[0074] In one specific embodiment, the formula used for symmetric linear quantization is:

[0075]

[0076] in:

[0077] X int This represents the quantized INT8 integer value;

[0078] X represents the original FP32 value;

[0079] clip(x; a, c) represents the clip function; a = -2 b-1 c = 2 b-1 -1;

[0080] Z represents the zero point of the mapping, used to adjust the offset;

[0081] S represents the scaling factor;

[0082] It represents a mathematical function that approximates the integer part;

[0083] x represents the value before quantization;

[0084] 'a' represents the upper limit of quantization, a = -128;

[0085] c represents the lower limit of quantization, c = 127;

[0086] b represents the number of bits in the data type. For INT8, b = 8.

[0087] S30. Input the video stream to be detected into the face detection model after weight quantization to perform face detection, and perform coordinate cropping and alignment correction on the detected faces.

[0088] In one specific embodiment, step S30, inputting the video stream to be detected into the weighted face detection model for face detection, includes the following steps:

[0089] S31. After inputting the video stream to be detected into the face detection model after weight quantization, the face in each frame of the video stream is detected, and the face in each frame of the video stream is selected by the target box.

[0090] In this embodiment, a TensorRT-accelerated quantized face detection model is used to perform high dynamic range face detection on the input video stream. Each frame prediction output of the YOLOv8 algorithm returns a result object. The result object has a `boxes` attribute, representing each detected bounding box (in this case, each detected face). Each `boxes` attribute has an `xyxy` attribute, representing the coordinates (xmin, ymin, xmax, ymax) of the four points of the bounding box. Based on these xyxy coordinates, the position of each face on the image can be located at these four positions. Cropping the face image according to these coordinates yields the face image in the image.

[0091] In one specific embodiment, step S30, which involves cropping and aligning the detected face according to its coordinates, includes:

[0092] S32. Based on the coordinates of the target bounding box, crop the faces in each frame of the video stream;

[0093] S33. Rotate and translate the cropped face so that the key points of the face can be matched to the predefined standard positions.

[0094] In this embodiment, the cropped face is rotated and translated to accurately match the key points of the face (such as eyes, nose, mouth, etc.) to predefined standard positions. Extracting the facial feature vector requires an input image of 112×112×3, therefore the image needs to be resized.

[0095] S40. The corrected and aligned face is subjected to feature extraction by a face recognition model, and the extracted features are matched with the face features in the face database to identify the identity of the face.

[0096] In this embodiment, InSightFace is a deep learning-based face recognition library that provides various state-of-the-art face recognition models and methods, such as deep learning-based face recognition models (Convolutional Neural Networks, CNNs) for extracting facial features. Its unique ArcFace face recognition model uses an improved loss function, corner margin loss, to optimize the discriminative power of facial features. The ArcFace face recognition model is particularly effective for large-scale crowd face recognition because it provides a compact and highly discriminative feature space, resulting in greater distances between feature vectors of different people and closer feature vectors of the same person under different conditions. Furthermore, the ArcFace face recognition model has high feature extraction efficiency because its unique network structure and the high optimization capabilities of GPU devices support large-scale, high-dynamic face recognition.

[0097] In one specific embodiment, step S40 includes:

[0098] S41. After correction and alignment, the face is processed by a face recognition model to extract features and output a multi-dimensional feature vector.

[0099] In this embodiment, calling the `insightface.app.FaceAnalys is()` method loads a face recognition model. The loaded ArcFace face recognition model extracts features from the aligned and corrected face image, outputting a 512-dimensional feature vector.

[0100] S42. Calculate the Euclidean distance between the multidimensional feature vector and all facial feature vectors in the face database.

[0101] S43. If the Euclidean distance is less than a preset threshold, then the face is determined to belong to the corresponding user in the face database; if the Euclidean distance is greater than the preset threshold, then the face is determined not to belong to the user in the face database.

[0102] In one specific embodiment, the high dynamic range face detection and recognition method further includes the following steps:

[0103] S44. Store the faces that are determined not to belong to the face database and their corresponding usernames into the face database.

[0104] In this embodiment, the `face_recognit io.register(img,user_name="")` method is called to add a new face to the face database, and the feature vector of the face and the corresponding username are stored in the database as a dictionary data type.

[0105] In summary, in terms of face detection, the face detection model, after being accelerated and quantized by TensorRT, achieves 150-175 FPS on edge mobile devices such as NVIDIA Jetson Orin NX, thus realizing the system's high dynamic face detection characteristics.

[0106] In terms of face recognition, the ArcFace face recognition model is used to extract features. By outputting high-dimensional feature vectors and normalizing and adding additive angular intervals to the feature vectors, the decision boundary in the feature space is increased, which effectively enhances the intra-class compactness and inter-class separability, thereby realizing the characteristics of large-scale and high-precision face recognition of the system.

[0107] like Figure 2 As shown, another embodiment of the present invention is: a high dynamic range face detection and recognition device, comprising:

[0108] The face detection model training module 10 is used to train the YOLOv8 model using a face dataset to obtain a preliminary face detection model.

[0109] The model acceleration and quantization module 20 is used to accelerate the initial face detection model through TensorRT and perform weight quantization to obtain a weight-quantized face detection model.

[0110] The face detection and preprocessing module 30 is used to input the video stream to be detected into the face detection model after weight quantization for face detection, and to perform coordinate cropping and correction alignment on the detected faces.

[0111] The face recognition module 40 is used to extract features from the corrected and aligned face using a face recognition model, and to match the extracted features with face features in the face database to identify the face's identity.

[0112] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned high dynamic face detection and recognition device can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.

[0113] The aforementioned data encryption device based on encryption algorithms can be implemented as a computer program, which can be used in, for example... Figure 4 It runs on the computer device shown.

[0114] Please see Figure 4 , Figure 4This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.

[0115] See Figure 4 The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0116] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a high-dynamic face detection and recognition method.

[0117] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0118] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a high-dynamic face detection and recognition method.

[0119] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0120] The processor 502 is used to run a computer program 5032 stored in the memory to implement the high dynamic face detection and recognition method described above.

[0121] It should be understood that, in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0122] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0123] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the high-dynamic face detection and recognition method described above.

[0124] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0125] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0126] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0127] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0128] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0129] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A high dynamic range face detection and recognition method, characterized in that, include: A preliminary face detection model was obtained by training a YOLOv8 model using a face dataset. The initial face detection model is accelerated using TensorRT and weighted to obtain a weighted face detection model. The video stream to be detected is input into the face detection model after weight quantization for face detection, and the detected faces are cropped and aligned according to coordinates. The corrected and aligned face is then subjected to feature extraction using a face recognition model, and the extracted features are matched with face features in a face database to identify the identity of the face. The step of accelerating the initial face detection model using TensorRT and performing weight quantization to obtain a weighted face detection model includes: The preliminary face detection model is converted into ONNX format, and the preliminary face detection model is FP32 weighted. Load the initial face detection model in ONNX format and create the corresponding TensorRT execution engine; Select a subset from the validation set as the calibration dataset; The calibration dataset is input into the initial face detection model, and the activation statistics of the face detection model are collected, including the maximum and minimum activation values ​​of each neural network layer. The activation statistics are input into the calibration algorithm to calculate the optimal scaling factor; Based on the optimal scaling factor, the FP32 weights of the face detection model are converted into INT8 weights using symmetric linear quantization to generate the quantized face detection model. The formula used for symmetric linear quantization is: in: X int This represents the quantized INT8 integer value; X represents the original FP32 value; clip(x; a, c) represents the clip function; a = -2 b-1 c = 2 b-1 -1; Z represents the zero point of the mapping, used to adjust the offset; S represents the scaling factor; It represents a mathematical function that approximates the integer part; x represents the value before quantization; 'a' represents the upper limit of quantization, a = -128; c represents the lower limit of quantization, c = 127; b represents the number of bits in the data type. For INT8, b = 8.

2. The high dynamic range face detection and recognition method as described in claim 1, characterized in that, The step of inputting the video stream to be detected into the weighted and quantized face detection model for face detection includes: After the video stream to be detected is input into the face detection model after weight quantization, the faces in each frame of the video stream are detected, and the faces in each frame of the video stream are selected by bounding boxes.

3. The high dynamic range face detection and recognition method as described in claim 1, characterized in that, The process of cropping and aligning the detected face using coordinates includes: Based on the coordinates of the target bounding box, the faces in each frame of the video stream are cropped. The cropped face is rotated and translated so that the key points of the face can be matched to the predefined standard positions.

4. The high dynamic range face detection and recognition method as described in claim 1, characterized in that, The step of extracting features from the corrected and aligned face using a face recognition model, and matching the extracted features with face features in a face database to identify the identity of the face includes: The corrected and aligned face is then processed by a face recognition model to extract features, outputting a multi-dimensional feature vector. Calculate the Euclidean distance between the multidimensional feature vector and all face feature vectors in the face database; If the Euclidean distance is less than a preset threshold, the face is determined to belong to the corresponding user in the face database; if the Euclidean distance is greater than the preset threshold, the face is determined not to belong to the user in the face database.

5. The high dynamic range face detection and recognition method as described in claim 4, characterized in that, Also includes: Faces that are determined not to belong to the face database, along with their corresponding usernames, will be stored in the face database.

6. A high dynamic range face detection and recognition device, characterized in that, include: The face detection model training module is used to train the YOLOv8 model using a face dataset to obtain a preliminary face detection model. The model acceleration and quantization module is used to accelerate the initial face detection model through TensorRT and perform weight quantization to obtain a weighted face detection model. The face detection and preprocessing module is used to input the video stream to be detected into the face detection model after weight quantization to perform face detection, and to perform coordinate cropping and alignment correction on the detected faces; The facial recognition module is used to extract features from the corrected and aligned face using a facial recognition model, and then match the extracted features with facial features in the facial database to identify the identity of the face. The model acceleration and quantization module is specifically used for: The preliminary face detection model is converted into ONNX format, and the preliminary face detection model is FP32 weighted. Load the initial face detection model in ONNX format and create the corresponding TensorRT execution engine; Select a subset from the validation set as the calibration dataset; The calibration dataset is input into the initial face detection model, and the activation statistics of the face detection model are collected, including the maximum and minimum activation values ​​of each neural network layer. The activation statistics are input into the calibration algorithm to calculate the optimal scaling factor; Based on the optimal scaling factor, the FP32 weights of the face detection model are converted into INT8 weights using symmetric linear quantization to generate the quantized face detection model. The formula used for symmetric linear quantization is: in: X int This represents the quantized INT8 integer value; X represents the original FP32 value; clip(x; a, c) represents the clip function; a = -2 b-1 c = 2 b-1 -1; Z represents the zero point of the mapping, used to adjust the offset; S represents the scaling factor; It represents a mathematical function that approximates the integer part; x represents the value before quantization; 'a' represents the upper limit of quantization, a = -128; c represents the lower limit of quantization, c = 127; b represents the number of bits in the data type. For INT8, b = 8.

7. A computer device, characterized in that: The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the high dynamic face detection and recognition method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, can implement the high dynamic face detection and recognition method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Model quantification processing system and model quantification processing method

    CN114298291A

  • Image deep false detection acceleration method and system based on quantization technology

    CN115719520A