Face recognition method and device, equipment and storage medium
By performing face and body detection on the target image, combining the detection results to determine the target face area and perform deduplication processing, the omission problem in face recognition technology is solved and the recognition success rate and robustness are improved.
Patent Information
- Application Number
- CN202510860235.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-23
AI Technical Summary
Existing facial recognition technology is prone to omissions when recognizing faces, especially in crowded scenes where it cannot accurately identify every face.
By performing face detection and body detection on the target image, combining the detection results of the face and body areas, the target face area is determined, and the accuracy of each face area is ensured through deduplication processing, including determining the second face area of the body area and eliminating duplicate areas.
It improves the success rate of face recognition, avoids face omission, and significantly improves the robustness of recognition, especially in complex scenarios.
Smart Images

Figure CN120689920A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of image processing, and in particular to a face recognition method, apparatus, device, and storage medium. Background Art
[0002] Facial recognition technology is a biometric-based intelligent recognition technology that analyzes facial features for identity verification or identification. Existing facial recognition methods typically use algorithms (such as Haar cascades and deep learning models) to locate facial regions in images or videos, then perform face detection on these regions.
[0003] However, when there are a large number of faces in an image (such as images taken at a station or shopping mall), existing face recognition technology is prone to omissions in the face recognition process, resulting in the inability to recognize all faces. Summary of the Invention
[0004] The present application provides a face recognition method, apparatus, device and storage medium, which solves the technical problem that existing face recognition technology is prone to omissions during the face recognition process.
[0005] In a first aspect, the present application provides a face recognition method, the method comprising: Acquire the target image to be identified; Performing face detection and body detection on the target image to determine a first face region and a body region in the target image, wherein the body region includes a region where the face is located and regions where the trunk and limbs are located; determining a target face region corresponding to each face in the target image based on the first face region and the body region; Identify the face in each target face area.
[0006] The step of determining a target face region corresponding to each face in the target image based on the first face region and the body region includes: determining, in the target image, a second facial region corresponding to each of the body regions; Deduplication is performed on the first face region and the second face region to obtain a target face region corresponding to each face in the target image.
[0007] Wherein, determining the second face region corresponding to each of the body regions in the target image includes: Determine a trunk and limbs region in each of the body regions, wherein the trunk and limbs region includes a trunk region and limbs regions; Eliminating the trunk and limb regions in each of the body regions to obtain a candidate head region corresponding to each of the body regions; Perform face detection on each of the candidate head regions to determine a second face region corresponding to each of the body regions.
[0008] The performing face detection on each of the head candidate regions to determine a second face region corresponding to each of the body regions includes: Performing face detection on each of the head candidate regions to determine a candidate face region corresponding to each of the body regions; When the number of candidate human face regions corresponding to the body region is one and the candidate human face region satisfies a human body morphology constraint, determining the candidate human face region as a second human face region corresponding to the body region; In a case where the number of candidate human face regions corresponding to the body region is more than one, a candidate human face region satisfying the human body morphology constraint is determined among the candidate human face regions as a second human face region corresponding to the body region.
[0009] The step of determining a candidate human face region satisfying the human body shape constraint from the candidate human face region as the second human face region corresponding to the torso region includes: Determining a face distance range of the trunk and limb regions based on a standard head-to-body ratio and the height of the trunk and limb regions; Determining the center point of each candidate face region; Determining a human skeleton structure including joint points based on the trunk and limb regions, and determining a neck joint point based on the human skeleton structure; Determine the distance between the center point of each candidate human face region and the neck joint point, and determine a second human face region corresponding to the torso region based on the distance and the human face distance range.
[0010] The deduplication of the first face region and the second face region includes: Extracting a first facial feature vector from each of the first facial regions and a second facial feature vector from each of the second facial regions; Determining a similarity between a first facial feature vector of each of the first facial regions and a second facial feature vector of each of the second facial regions; In the case that there is a matching pair of the first face region and the second face region whose similarity is greater than a preset similarity threshold, the first face region or the second face region in the matching pair is removed.
[0011] The deduplication of the first face region and the second face region includes: determining an intersection-over-union ratio between each of the first facial regions and each of the second facial regions; If there is a matching pair of the first human face region and the second human face region whose IoU ratio is greater than a preset IoU threshold, the first human face region or the second human face region in the matching pair is eliminated.
[0012] In a second aspect, the present application provides a face recognition device, the device comprising: A target image acquisition module is used to acquire a target image to be identified; A face and body detection module is used to perform face detection and body detection on the target image to determine a first face region and a body region in the target image, wherein the body region includes a region where the face is located and regions where the trunk and limbs are located; a face region determination module, configured to determine a target face region corresponding to each face in the target image based on the first face region and the body region; A face recognition module is used to recognize the face in each target face area.
[0013] In a third aspect, the present application provides a face recognition device, the face recognition device comprising a processor and a memory; The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute the face recognition method as described in the first aspect according to the instructions in the computer program.
[0014] In a fourth aspect, the present application provides a storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the face recognition method as described in the first aspect.
[0015] As mentioned above, the present application provides a face recognition method, apparatus, equipment and storage medium. The present application simultaneously performs face detection and body detection on the target image, and determines the target face area corresponding to the face in the target image by combining the face detection results and the body detection results. It can detect each face in the target image, improve the success rate of face recognition, avoid missing faces, and solve the technical problem that omissions are prone to occur in the process of face recognition in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flowchart of a face recognition method provided by an embodiment of the present invention.
[0017] Figure 2A schematic diagram of a face region recognition result provided by an embodiment of the present invention.
[0018] Figure 3 A schematic diagram of a first face region and a second face region provided in an embodiment of the present invention.
[0019] Figure 4 A schematic flow chart of another face recognition method provided by an embodiment of the present invention.
[0020] Figure 5 A schematic diagram of constructing a head candidate region provided by an embodiment of the present invention.
[0021] Figure 6 A schematic diagram of a candidate face region provided by an embodiment of the present invention.
[0022] Figure 7 A schematic diagram of a target face region corresponding to each face provided by an embodiment of the present invention.
[0023] Figure 8 A schematic structural diagram of a face recognition device provided by an embodiment of the present invention.
[0024] Figure 9 A hardware framework diagram of a face recognition device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following description and accompanying drawings sufficiently illustrate specific embodiments of the present application to enable those skilled in the art to practice them. The examples represent only possible variations. Unless expressly required, individual components and functions are optional, and the order of operations may vary. Portions and features of some embodiments may be included in or replace portions and features of other embodiments. The scope of the embodiments of the present application includes the entire scope of the claims, as well as all available equivalents of the claims. Herein, each embodiment may be referred to individually or collectively by the term "invention," which is merely for convenience and is not intended to automatically limit the scope of the application to any single invention or inventive concept if more than one invention is in fact disclosed. Herein, relational terms such as first and second, etc., are used solely to distinguish one entity or operation from another, and do not require or imply any actual relationship or order between these entities or operations. Furthermore, the terms "comprise," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, or apparatus comprising a set of elements includes not only those elements, but also other elements not explicitly listed. The various embodiments herein are described in a progressive manner, with each embodiment focusing on the differences from the other embodiments. Reference can be made to the common and similar parts between the various embodiments. For structures, products, etc. disclosed in the embodiments, the description is relatively simple because they correspond to the parts disclosed in the embodiments. For relevant parts, refer to the method description.
[0026] Facial recognition technology is a biometric-based intelligent recognition technology that analyzes facial features for identity verification or identification. Existing facial recognition methods typically use algorithms (such as Haar cascades and deep learning models) to locate the face area in an image or video, and then perform face detection on that face area.
[0027] However, when there are a large number of people in the image (such as images taken in stations or shopping malls), the crowd will block each other when it is dense, especially in the case of side or partial occlusion, making it impossible for the face recognition algorithm to locate the face area, resulting in omissions in the face recognition process and the inability to accurately identify every face in the image.
[0028] Based on this, in order to solve the above technical problems, the embodiment of the present invention provides a face recognition technology, such as Figure 1 As shown, Figure 1The following is a flow chart of a face recognition method provided by an embodiment of the present invention. The face recognition method provided by an embodiment of the present invention can be performed by a face recognition device, which can be implemented through software and / or hardware. The face recognition device can be composed of two or more physical entities or a single physical entity. For example, the face recognition device can be a computer, a host computer, or a server. The face recognition method provided by an embodiment of the present invention includes the following steps: Step 101: Acquire a target image to be identified.
[0029] In this embodiment, the facial recognition device first needs to obtain the target image to be recognized. The target image can be a video frame image in a video stream or an independent frame image. In addition, when obtaining the target image, the facial recognition device can obtain it from a user-predefined address in local storage space or from a server. The specific setting can be set according to actual needs and is not specifically limited in this embodiment. For example, in a video security monitoring scenario at a station, when the camera and facial recognition device are deployed in a distributed manner, the camera can upload the collected surveillance video stream to the server, and the facial recognition device can obtain the surveillance video stream from the server and extract the target image.
[0030] Step 102: Perform face detection and body detection on the target image to determine a first face region and a body region in the target image. The body region includes the region where the face is located and the region where the trunk and limbs are located.
[0031] After acquiring a target image, the facial recognition device must simultaneously perform face detection and body detection on the target image to determine the first facial region corresponding to the human face, as well as the body regions corresponding to the human face, torso, and limbs. Exemplarily, when performing face detection, the facial recognition device first normalizes and compensates for illumination on the target image. It then uses Haar features or a convolutional neural network to perform a preliminary scan of the compensated target image for possible facial regions. It then uses a cascade classifier (such as MTCNN) or a deep learning model (such as RetinaFace) to precisely locate the facial bounding box of the facial region, and applies non-maximum suppression (NMS) to remove overlapping facial bounding boxes, thereby determining the first facial region corresponding to the human face in the target image. The principles of body detection are similar to those of face detection. The facial recognition device first performs preliminary detection on the target image using a deep learning model (such as YOLOv8 or Faster R-CNN) to generate candidate boxes containing the body region. Next, key features (such as the head, shoulder line, and hip outline) within the candidate frame are extracted, and the detection results are optimized using geometric constraints. Finally, non-maximum suppression (NMS) is used to select the optimal detection frame, outputting the precise body position and extent, thereby obtaining the body region. The specific implementation principles of face and body detection can be referenced in existing technologies and will not be further elaborated in this embodiment.
[0032] Step 103: Determine a target face region corresponding to each face in the target image based on the first face region and the body region.
[0033] After determining the first face area and body area in the target image, it is necessary to integrate the face detection results and the body detection results to identify the target area corresponding to each face in the image. The reason for integrating the face detection results and the body detection results to determine the target area corresponding to each face is that when performing face detection on an image, the proportion of the area of the face area in the face search area is the core influencing factor of the face detection success rate. The larger the proportion of the face area, the higher the face detection success rate. However, in the actual captured image, the proportion of the face area in the image may be small due to reasons such as the detection object lowering its head, turning its head, or the head being blocked, so it is easy to miss the detection. In this embodiment, by detecting the body area, the subsequent face search area can be greatly reduced, the interference of background noise can be reduced, and the face detection success rate can be improved. For example, as Figure 2 As shown, Figure 2 A schematic diagram of a face region recognition result provided by an embodiment of the present invention, Figure 2 The target image captured by the camera in the station scene. Figure 2For some passengers with their heads down or faces sideways in the target image, facial detection can easily miss them during recognition, so it is necessary to combine the body detection results for comprehensive recognition. In one embodiment, when determining the target facial area by combining the first facial area and the body area, the facial recognition device can identify the head position corresponding to each body area in the target image based on the human body morphological features to obtain the corresponding second facial area. The facial areas that overlap in the first facial area and the second facial area are then eliminated to obtain the target facial area corresponding to each face in the target image. For example, Figure 3 As shown, Figure 3 A schematic diagram of a first face region and a second face region provided in an embodiment of the present invention. Figure 3 In the figure, the solid line frame of the face is the first face area corresponding to the face detection, the dotted line frame with denser line points is the body area corresponding to the body detection, and the dotted line frame with sparser line points is the second face area predicted based on the body area. After eliminating the same face areas in the first and second face areas, the target face area corresponding to each face in the target face image can be obtained. It can be understood that for the convenience of observation, Figure 3 The range of the first face area is set to be larger than that of the second face area, but in actual detection, the range of the first face area is roughly the same as that of the second face area.
[0034] Step 104: Identify the face in each target face area.
[0035] After determining the target face area in the target image, face recognition can be performed on each target face area so that information extraction or coding can be performed on the recognized face according to business needs.
[0036] As described above, an embodiment of the present invention provides a face recognition method. The embodiment of the present invention simultaneously performs face detection and body detection on a target image, and determines a target face area in the target image corresponding to the face by combining the face detection results and the body detection results. In this way, each face in the target image can be detected, the success rate of face recognition can be improved, and the situation of missing faces can be avoided, thereby solving the technical problem that omissions are prone to occur in the process of face recognition in the existing technology.
[0037] The embodiment of the present invention also provides another face recognition method, such as Figure 4 As shown, Figure 4 A flowchart of another face recognition method provided by an embodiment of the present invention is shown below. Figure 4 The face recognition method shown is a specific embodiment of the above face recognition method. The face recognition method provided by the embodiment of the present invention includes the following steps: Step 201: Acquire a target image to be identified.
[0038] Step 202: Perform face detection and body detection on the target image to determine a first face region and a body region in the target image, where the body region includes a face region and a torso region.
[0039] Step 203: Determine a second facial region corresponding to each body region in the target image.
[0040] In this embodiment, after identifying the torso regions in the target image, it is necessary to further determine the second facial region within the target image, where the face corresponding to each torso region is located. For example, the facial recognition device may delineate candidate head regions within each torso region based on human anatomical proportions (e.g., a head-to-body ratio of 1:7), and perform face detection on the candidate head regions to determine the second facial region. Alternatively, the facial recognition device may detect key points (e.g., shoulders and neck) within the torso region, determine the orientation of the head by connecting the facial key points, and predict the coordinates of the head center point based on a regression model (e.g., CNN) to delineate candidate head regions. Finally, face detection is performed on the candidate head regions to determine the second facial region. In another embodiment, a multi-task network (e.g., Mask R-CNN) may be pre-trained. After the torso regions are annotated in the target image, the target image is input into the multi-task network, which then outputs the second facial region corresponding to each torso region.
[0041] Based on the above embodiment, determining the second face region corresponding to each body region in the target image in step 203 includes: Step 2031: Determine the trunk and limb regions in each body region, where the trunk and limb regions include the trunk region and the limb regions.
[0042] Step 2032: Eliminate the trunk and limb regions in each body region to obtain a candidate head region corresponding to each body region.
[0043] Step 2033: Perform face detection on each candidate head region to determine a second face region corresponding to each body region.
[0044] In one embodiment, the face recognition device first detects the trunk and limb regions in each body region in the target image. In this embodiment, the trunk and limb regions include the trunk region and the limb region. The detection method of the trunk and limb regions can be based on existing technology, which will not be described in detail in this embodiment. After detecting the trunk and limb regions in the body region, the face recognition device can directly eliminate the trunk and limb regions in each body region and use the remaining region in each body region as the candidate head region. For example, Figure 5 As shown, Figure 5 This is a schematic diagram of constructing a head candidate region according to an embodiment of the present invention. After detecting the body region Q1, the trunk and limb regions S1 within the body region Q1 are eliminated to obtain the head candidate region S2. It is understood that if the head candidate region corresponding to a body region exceeds the boundary of the target image, the body region can be ignored.
[0045] After determining the head candidate region corresponding to each body region, face detection can be further performed on each head candidate region based on the face detection algorithm to determine the second face region corresponding to each body region. Specifically, the face recognition device performs face detection on each head candidate region to determine the candidate face region corresponding to each body region, where one face corresponds to one candidate face region. Afterwards, when the number of candidate face regions corresponding to the body region is one and the candidate face region satisfies the human body morphology constraint, the candidate face region is determined as the second face region corresponding to the body region; and when the number of candidate face regions corresponding to the body region is more than one, a candidate face region that satisfies the human body morphology constraint is determined in the candidate face region as the second face region corresponding to the body region. It can be understood that when the target image contains a large number of people, candidate face regions corresponding to multiple faces may be identified in the same head candidate region. For example, if Figure 6 As shown, Figure 6 A schematic diagram of a candidate facial region provided in an embodiment of the present invention shows that within the head candidate region S2, candidate facial regions H1 and H2 corresponding to two faces can be identified. In this case, the facial recognition device must determine, based on human morphological features, a second facial region corresponding to the torso region within candidate facial regions H1 and H2. For example, the facial recognition device may establish spatial structural constraints between the torso and head based on the human morphological features, and limit the search range for faces based on these spatial structural constraints, thereby eliminating other irrelevant candidate facial regions.
[0046] In one embodiment, determining a candidate face region satisfying a human body shape constraint from the candidate face regions as the second face region corresponding to the torso region includes: Determine the face distance range of the trunk and limbs based on the standard head-to-body ratio and the height of the trunk and limbs. Determine the center point of each candidate face region; Determine the human skeleton structure including joint points based on the trunk and limbs regions, and determine the neck joint points based on the human skeleton structure; The distance between the center point of each candidate face region and the neck joint point is determined, and a second face region corresponding to the body region is determined based on the distance and the face distance range.
[0047] Specifically, the facial recognition device first determines a standard head-to-body ratio, which can be pre-set by the user. For example, the standard head-to-body ratio is 1:7 to 1:8. Then, based on the standard head-to-body ratio and the height of the torso and limbs, the face distance range for the torso and limbs is determined. For example, using the torso and limbs height Ht as a reference and combining it with the standard head-to-body ratio, the head length Lh ≈ Ht / N is calculated, where N∈[7,8]. The vertical distance from the face to the neck and shoulder is physiologically approximately 0.5 times the head length, i.e., the base distance Dbase = 0.5 × Lh. Furthermore, due to posture variations (such as neck extension and contraction caused by lowering or raising the head) and individual differences (such as gender and age), the base distance Dbase needs to be expanded within a floating range (±25%), i.e., the minimum distance Dmin = Dbase × 0.75, and the maximum distance Dmax = Dbase × 1.25. The final face distance range Drange = [0.375 × Lh, 0.625 × Lh].
[0048] After that, it is necessary to identify the center point of each candidate face region. The center point can be a geometric center point or a key point center point. For example, if the coordinates of the upper left corner of the candidate face region rectangle are (X1, Y1) and the coordinates of the lower right corner are (X2, Y2), then the coordinates of the geometric center point are for:
[0049] If facial key points (such as eyes, nose tip, mouth corners, etc.) have been detected, the key point center is the mean of all key point coordinates.
[0050] Next, the human skeleton structure must be determined based on the torso and limb regions. The human skeleton structure reflects human posture through the topological relationships between joints, providing structural constraints for linking the torso and head. Specifically, facial recognition equipment can use high-precision models such as HRNet to predict joint coordinates in the torso and limb regions. It then defines the joint connection relationship based on human anatomy (e.g., neck → shoulder → elbow), and uses a graphical model (e.g., a tree structure) to ensure spatial rationality between joints. The connected joints constitute the human skeleton structure.
[0051] After determining the human skeleton structure, the neck joint point Jneck needs to be further determined based on the human skeleton structure. The neck joint Jneck is the key hub connecting the torso and head. Its position can be uniquely determined by human anatomy and skeleton topology, providing a direct spatial reference for head positioning. For example, the neck length is typically 1 / 10 to 1 / 8 of the height of the torso and limbs. If the height of the torso and limbs is Ht, the neck joint point Jneck should be within 0.1Ht-0.125Ht above the top of the torso, and the angle between the neck direction and the main axis of the torso (such as the spinal column) is usually less than 15°.
[0052] Finally, the correlation between the torso and the head can be established through spatial distance measurement, and the unique corresponding face area can be selected by combining the human body shape constraints. Specifically, the face recognition device can calculate the center point of the face The straight-line distance from the neck joint Jneck is divided by the height Ht of the trunk and limbs to eliminate the scale effect. If the final calculation result is within the face distance range Drange and the face center point If the angle with the trunk main axis is less than 30°, the candidate face region to which the face center point belongs is determined to be the second face region corresponding to the trunk region.
[0053] In addition, if a candidate face region that meets the human body morphology constraints cannot be determined in the head candidate region, the head candidate region can be ignored.
[0054] Step 204: De-duplicate the first face region and the second face region to obtain a target face region corresponding to each face in the target image.
[0055] After determining the second facial region corresponding to each body region, the facial recognition device further deduplicates the first and second facial regions. After eliminating duplicated facial regions, the facial recognition device obtains a target facial region corresponding to each face in the target image. For example, the facial recognition device may determine the image similarity between each first facial region and each second facial region. When the image similarity exceeds a preset similarity threshold, the first facial region is determined to overlap with the second facial region, and the first or second facial region may be eliminated.
[0056] Based on the above embodiment, deduplication of the first face region and the second face region in step 204 includes: Step 2041: Extract a first facial feature vector from each first facial region and a second facial feature vector from each second facial region.
[0057] Step 2042: Determine the similarity between the first facial feature vector of each first facial region and the second facial feature vector of each second facial region.
[0058] Step 2043: If there is a matching pair of the first face region and the second face region whose similarity is greater than a preset similarity threshold, remove the first face region or the second face region from the matching pair.
[0059] In one embodiment, when deduplicating the first and second facial regions, it is necessary to extract the first facial feature vector from each first facial region and the second facial feature vector from each second facial region. Subsequently, the similarity between the first facial feature vector of each first facial region and the second facial feature vector of each second facial region is further determined. In one embodiment, to reduce the amount of computation, the similarity may be calculated only between the first facial feature vector of the first facial region and the second facial feature vector of a similarly located second facial region. Finally, if a matching pair of the first and second facial regions exists where the similarity of the facial feature vectors exceeds a preset similarity threshold (e.g., 98%), it indicates that the first and second facial regions correspond to the same face, and in this case, the first or second facial region in the matching pair needs to be removed.
[0060] Based on the above embodiment, deduplication of the first face region and the second face region in step 204 includes: Step 2044: Determine the intersection-over-union ratio of each first facial region and each second facial region.
[0061] Step 2045: If there is a matching pair of the first face region and the second face region whose IoU ratio is greater than a preset IoU threshold, remove the first face region or the second face region from the matching pair.
[0062] In another embodiment, the face recognition device may also determine the intersection-over-union (IOU) of each first face region and each second face region to quantify the spatial consistency between the first face region and the second face region through the IOU. If there is a matching pair of the first face region and the second face region whose IOU is greater than a preset IOU threshold, the first face region or the second face region in the matching pair is removed to complete deduplication. In one embodiment, if Figure 7 As shown, Figure 7 A schematic diagram of a target face region corresponding to each face provided by an embodiment of the present invention, for Figure 2 In the target image shown, after deduplication of the first face region and the second face region, the final target face region in the target image can be obtained.
[0063] Step 205: Identify the face in each target face area.
[0064] As described above, an embodiment of the present invention provides a face recognition method. After simultaneously performing face detection on a target image to determine a first face region and performing torso detection to determine a torso region, the embodiment of the present invention predicts a second face region corresponding to the torso region, and deduplicates the face region and the second face region, thereby determining a target face region corresponding to each face in the target image. The embodiment of the present invention combines direct face detection with prediction based on torso association to form a dual verification mechanism, effectively reducing missed and false face detections. Furthermore, by predicting the potential location of an occluded face through torso association, the embodiment avoids unreasonable detection results such as "floating faces," significantly improving robustness in complex scenarios. The method is particularly suitable for monitoring scenarios with dense traffic, and is more practical than single face detection.
[0065] The embodiment of the present invention also provides a face recognition device, such as Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of a face recognition device provided by an embodiment of the present invention. The face recognition device provided by an embodiment of the present invention includes: The target image acquisition module 301 is used to acquire the target image to be identified; A face and body detection module 302 is configured to perform face detection and body detection on a target image, and determine a first face region and a body region in the target image, where the body region includes the region where the face is located and the region where the torso and limbs are located; A face region determination module 303 is configured to determine a target face region corresponding to each face in the target image based on the first face region and the body region; The face recognition module 304 is configured to recognize a face in each target face region.
[0066] The face region determination module 303 includes: a face region prediction submodule, configured to determine a second face region corresponding to each body region in the target image; The deduplication submodule is used to deduplicate the first face region and the second face region to obtain a target face region corresponding to each face in the target image.
[0067] Among them, the face area prediction submodule includes: The trunk and limb area determination unit is used to determine the trunk and limb areas in each body area. The trunk and limb areas include the area where the trunk is located and the area where the limbs are located.
[0068] The region elimination unit is used to eliminate the trunk and limb regions in each body region to obtain a head candidate region corresponding to each body region.
[0069] The face detection unit is used to perform face detection on each candidate head region and determine a second face region corresponding to each body region.
[0070] Among them, the face detection unit includes: A face detection subunit, configured to perform face detection on each candidate head region and determine a candidate face region corresponding to each body region; The first facial region determining subunit is configured to determine the candidate facial region as the second facial region corresponding to the torso region when the number of candidate facial regions corresponding to the torso region is one and the candidate facial region satisfies the human body morphology constraint.
[0071] The second facial region determination subunit is used to determine a candidate facial region that meets the human body morphology constraint as the second facial region corresponding to the torso region when the number of candidate facial regions corresponding to the torso region exceeds one.
[0072] Among them, the second face area determination subunit is specifically used to determine the face distance range of the trunk and limb areas based on the standard head-to-body ratio and the height of the trunk and limb areas; determine the center point of each candidate face area; determine the human skeleton structure including joint points based on the trunk and limb areas, and determine the neck joint point based on the human skeleton structure; determine the distance between the center point of each candidate face area and the neck joint point, and determine a second face area corresponding to the body area based on the distance and the face distance range.
[0073] Among them, the deduplication submodule includes: A feature extraction unit, configured to extract a first facial feature vector from each first facial region and a second facial feature vector from each second facial region; a similarity determination unit, configured to determine a similarity between a first facial feature vector of each first facial region and a second facial feature vector of each second facial region; The first deduplication unit is configured to, when there is a matching pair of the first face region and the second face region whose similarity is greater than a preset similarity threshold, remove the first face region or the second face region from the matching pair.
[0074] Among them, the deduplication submodule includes: an IoU determining unit, configured to determine an IoU ratio between each first facial region and each second facial region; The second deduplication unit is configured to, when there is a matching pair of the first face region and the second face region whose IoU ratio is greater than a preset IoU threshold, remove the first face region or the second face region from the matching pair.
[0075] The face recognition apparatus provided in the embodiment of the present invention is included in a face recognition device and can be used to execute the face recognition method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0076] It is worth noting that in the embodiment of the above-mentioned face recognition device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0077] The embodiment of the present invention also provides a face recognition device, such as Figure 9 As shown, Figure 9 This is a hardware framework diagram of a face recognition device provided in an embodiment of the present invention. The face recognition device 40 includes a processor 400 and a memory 401; The memory 401 is used to store the computer program 402 and transmit the computer program 402 to the processor 400; The processor 400 is configured to execute the steps in the above-mentioned embodiment of the face recognition method according to the instructions in the computer program 402 .
[0078] For example, computer program 402 may be divided into one or more modules / units, one or more of which are stored in memory 401 and executed by processor 400 to implement the present application. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of computer program 402 in face recognition device 40.
[0079] The face recognition device 40 can be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The face recognition device 40 can include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will understand that Figure 9 This is merely an example of the face recognition device 40 and does not constitute a limitation of the face recognition device 40 . The face recognition device 40 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the face recognition device 40 may also include input and output devices, network access devices, buses, etc.
[0080] The processor 400 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0081] Memory 401 can be an internal storage unit of the facial recognition device 40, such as the hard drive or memory of the facial recognition device 40. Memory 401 can also be an external storage device of the facial recognition device 40, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, memory 401 can include both the internal storage unit of the facial recognition device 40 and an external storage device. Memory 401 is used to store computer programs and other programs and data required by the facial recognition device 40. Memory 401 can also be used to temporarily store data that has been output or is about to be output.
[0082] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0083] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0084] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0085] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0086] 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 computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion 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 for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the method of the present invention. The aforementioned storage medium includes various media that can store computer programs, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0087] An embodiment of the present invention further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, they are used to perform a face recognition method. The face recognition method includes the following steps: Acquire the target image to be identified; Performing face detection and body detection on the target image to determine a first face region and a body region in the target image, where the body region includes a region where the face is located and regions where the trunk and limbs are located; Determining a target face region corresponding to each face in the target image based on the first face region and the body region; Identify faces in each target face region.
[0088] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the embodiments of the present invention have been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the embodiments of the present invention, the embodiments of the present invention may also include more other equivalent embodiments, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.
Claims
1. A face recognition method, characterized in that: The method comprises: Acquire the target image to be identified; Performing face detection and body detection on the target image to determine a first face region and a body region in the target image, wherein the body region includes a region where the face is located and regions where the trunk and limbs are located; determining a target face region corresponding to each face in the target image based on the first face region and the body region; Identify the face in each target face area.
2. The face recognition method according to claim 1, characterized in that The determining, based on the first face region and the body region, a target face region corresponding to each face in the target image includes: determining, in the target image, a second facial region corresponding to each of the body regions; Deduplication is performed on the first face region and the second face region to obtain a target face region corresponding to each face in the target image.
3. The face recognition method according to claim 2, characterized in that The determining, in the target image, a second facial region corresponding to each of the body regions comprises: Determine a trunk and limbs region in each of the body regions, wherein the trunk and limbs region includes a trunk region and limbs regions; Eliminating the trunk and limb regions in each of the body regions to obtain a candidate head region corresponding to each of the body regions; Perform face detection on each of the candidate head regions to determine a second face region corresponding to each of the body regions.
4. The face recognition method according to claim 3, characterized in that: The performing face detection on each of the head candidate regions to determine a second face region corresponding to each of the body regions includes: Performing face detection on each of the head candidate regions to determine a candidate face region corresponding to each of the body regions; When the number of candidate human face regions corresponding to the body region is one and the candidate human face region satisfies a human body morphology constraint, determining the candidate human face region as a second human face region corresponding to the body region; In a case where the number of candidate human face regions corresponding to the body region is more than one, a candidate human face region satisfying the human body morphology constraint is determined among the candidate human face regions as a second human face region corresponding to the body region.
5. The face recognition method according to claim 4, characterized in that: The step of determining a candidate human face region satisfying the human body morphology constraint from among the candidate human face regions as a second human face region corresponding to the torso region includes: Determining a face distance range of the trunk and limb regions based on a standard head-to-body ratio and the height of the trunk and limb regions; Determining the center point of each candidate face region; Determining a human skeleton structure including joint points based on the trunk and limb regions, and determining a neck joint point based on the human skeleton structure; Determine the distance between the center point of each candidate human face region and the neck joint point, and determine a second human face region corresponding to the torso region based on the distance and the human face distance range.
6. The face recognition method according to claim 2, characterized in that: The deduplication of the first face region and the second face region includes: Extracting a first facial feature vector from each of the first facial regions and a second facial feature vector from each of the second facial regions; Determining a similarity between a first facial feature vector of each of the first facial regions and a second facial feature vector of each of the second facial regions; In the case that there is a matching pair of the first face region and the second face region whose similarity is greater than a preset similarity threshold, the first face region or the second face region in the matching pair is removed.
7. The face recognition method according to claim 2, characterized in that: The deduplication of the first face region and the second face region includes: determining an intersection-over-union ratio between each of the first facial regions and each of the second facial regions; If there is a matching pair of the first human face region and the second human face region whose IoU ratio is greater than a preset IoU threshold, the first human face region or the second human face region in the matching pair is eliminated.
8. A face recognition device, characterized in that: The device comprises: A target image acquisition module is used to acquire a target image to be identified; A face and body detection module is used to perform face detection and body detection on the target image to determine a first face region and a body region in the target image, wherein the body region includes a region where the face is located and regions where the trunk and limbs are located; a face region determination module, configured to determine a target face region corresponding to each face in the target image based on the first face region and the body region; A face recognition module is used to recognize the face in each target face area.
9. A face recognition device, characterized in that: The face recognition device includes a processor and a memory; The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the face recognition method according to any one of claims 1 to 7 according to instructions in the computer program.
10. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the face recognition method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Face detection method and device, electronic equipment and computer readable storage medium
CN114067386A
Image processing method, image processing device, storage medium and electronic equipment
CN114627014A