Portrait recognition method, device, storage medium and electronic device
By searching for a set of portraits that meet preset conditions in the portrait feature library and calculating the degree of overlap, the problem of identifying the same person without training reference samples in the social field is solved, and efficient monitoring of illegal users is achieved.
Patent Information
- Application Number
- CN202311301682.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-09
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-10-09
AI Technical Summary
In the social field, due to the lack of training reference samples, incremental quasi-real-time clustering and high real-time requirements, it is difficult to effectively identify multiple portraits of the same person, and existing technologies cannot effectively solve this problem.
A first portrait set whose similarity with the portrait to be queried meets a preset condition is retrieved from the portrait feature library, and a second portrait set whose similarity meets a second preset condition is retrieved based on the portraits in the first portrait set. The recognition result is determined by calculating the overlap between the two portrait sets, and the portrait similarity is converted into a retrieval problem of vector space distance.
In the absence of training reference samples, it is possible to accurately identify multiple portraits of the same person, improving the ability to monitor illegal activities in the field of social risk control.
Smart Images

Figure CN117292425B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of image processing technology. More specifically, the embodiments of the present disclosure relate to a portrait recognition method, a portrait recognition device, a computer-readable storage medium, and an electronic device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims, and no statement herein is admitted to be prior art by inclusion in this section.
[0003] With the development of internet social networking products, illegal activities within these platforms have gradually become apparent. Criminals use multiple accounts, mobile phone numbers, ID cards, and other resources to conduct illegal activities in an attempt to circumvent common detection methods. This has necessitated the need for real-person facial recognition. Banning and cracking down on real-person criminals will effectively curb their activities.
[0004] Related technologies utilize portrait clustering capabilities. These capabilities utilize a large library of basic portrait samples (such as ID photos and headshots). Clustering training can be performed based on this library to determine the center point of the feature space as the portrait ID. However, the field of real-person authentication technology remains centered around a core issue: how to cluster and identify the same person across multiple portraits. Summary of the Invention
[0005] In the social field, due to the lack of training reference samples and the need for incremental quasi-real-time clustering and high real-time features, the technical problem of "how to cluster and identify the same person in different portraits" is more difficult to solve.
[0006] Therefore, an improved portrait recognition method is highly needed to recognize portraits in the absence of training reference samples.
[0007] In this context, embodiments of the present disclosure are intended to provide a human portrait recognition method, a human portrait recognition device, a computer-readable storage medium, and an electronic device.
[0008] According to a first aspect of the present disclosure, a portrait recognition method is provided, comprising: querying from a portrait feature library a first portrait set whose similarity to a portrait to be queried satisfies a first preset condition; based on a first portrait in the first portrait set, querying from the portrait feature library a second portrait set whose similarity to the first portrait satisfies a second preset condition; and in response to a degree of overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, taking a user corresponding to the first portrait set as a recognition result of the portrait to be queried.
[0009] In one embodiment, the step of searching from a portrait feature library for a first portrait set whose similarity with a portrait to be queried satisfies a first preset condition, comprises: obtaining the portrait to be queried; and searching from the portrait feature library for a first portrait set whose similarity with the portrait to be queried satisfies the first preset condition through a vector retrieval framework; wherein the first preset condition is that the similarity between the portraits in the portrait feature library and the portrait to be queried is greater than a first preset threshold, and / or the similarity between the portraits in the portrait feature library and the portrait to be queried is in the first N positions in a similarity sequence arranged from large to small.
[0010] In one embodiment, the method of querying a second portrait set from the portrait feature library based on the first portrait in the first portrait set, wherein the similarity between the first portrait and the second portrait set meets a second preset condition, includes: determining whether the number of first portraits in the first portrait set is greater than a fourth preset threshold; if it is greater than the fourth preset threshold, querying the portrait IDPID based on the user identity proof UID corresponding to the first portrait; if the PID is queried, querying a second portrait set from the portrait feature library based on the portrait corresponding to the PID, wherein the second preset condition is that the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is greater than the second preset threshold, and / or the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is located in the first N digits in a similarity sequence arranged from large to small.
[0011] In one embodiment, the step of searching the portrait feature library for a second portrait set that satisfies a second preset condition between the portraits corresponding to the PIDs based on the portraits corresponding to the PIDs includes: sorting the PIDs from largest to smallest based on the similarity between the first portrait in the first portrait set and the portrait to be queried to obtain a PID list; determining whether there are portraits in the portrait feature library that meet the second preset condition between the portraits corresponding to the first PID in the PID list; if so, obtaining from the portrait feature library portraits that meet the second preset condition between the portraits corresponding to the first PID in the PID list; determining whether there are portraits in the portrait feature library that meet the second preset condition between the portraits corresponding to the second PID in the PID list; if so, obtaining from the portrait feature library portraits that meet the second preset condition between the portraits corresponding to the second PID in the PID list; and using the portraits in the portrait feature library that meet the second preset condition between the portraits corresponding to the first PID in the PID list and the portraits corresponding to the second PID in the PID list that meet the second preset condition as the second portrait set.
[0012] In one embodiment, the method further includes: when there is no portrait in the portrait feature library corresponding to the PID ranked first in the PID list and the portrait does not meet the second preset condition, ending the process.
[0013] In one embodiment, the method further includes: assigning the PID as a portrait ID to the first portrait in the first portrait set and the portrait to be queried, to indicate that the first portrait in the first portrait set and the portrait to be queried are portraits corresponding to the same user.
[0014] In one embodiment, the method further includes: determining that the degree of overlap between the first portrait set and the second portrait set is less than the third preset threshold, and generating a portrait ID to be queried based on the portrait to be queried to indicate that the portrait to be queried is the portrait corresponding to the user to be queried.
[0015] In one embodiment, the method further includes: obtaining basic data; performing statistics on the basic data to determine the number of accounts registered and authenticated for each portrait ID within a preset time period; and when the number of accounts registered and authenticated for the portrait ID within the preset time period is greater than a fifth preset threshold, determining that the user corresponding to the portrait ID is an illegal user.
[0016] According to a second aspect of the present disclosure, a portrait recognition device is provided, comprising: a first portrait set determination module, configured to query a first portrait set from a portrait feature library for a similarity between the first portrait set and a portrait to be queried that satisfies a first preset condition; a second portrait set determination module, configured to query, based on a first portrait in the first portrait set, from the portrait feature library for a second portrait set for a similarity between the first portrait and the portrait to be queried that satisfies a second preset condition; and a coincidence determination module, configured to, in response to a coincidence between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, use a user corresponding to the first portrait set as a recognition result of the portrait to be queried.
[0017] In one embodiment, the first portrait set determination module is configured to: obtain the portrait to be queried; and query, through a vector retrieval framework, a first portrait set from the portrait feature library for a portrait that satisfies a first preset condition with the portrait to be queried; wherein the first preset condition is that the similarity between the portraits in the portrait feature library and the portrait to be queried is greater than a first preset threshold, and / or the similarity between the portraits in the portrait feature library and the portrait to be queried is in the top N positions in a similarity sequence arranged from large to small.
[0018] In one embodiment, the second portrait set determination module is configured to: determine whether the number of first portraits in the first portrait set is greater than a fourth preset threshold; if it is greater than the fourth preset threshold, query the portrait IDPID based on the user identity proof UID corresponding to the first portrait; if the PID is queried, query the portrait feature library for a second portrait set that meets a second preset condition between the portrait corresponding to the PID and the portrait; wherein the second preset condition is that the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is greater than the second preset threshold, and / or the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is located in the first N digits in the similarity sequence arranged from large to small.
[0019] In one embodiment, the second portrait set determination module is configured to: sort the PIDs from large to small according to the similarity between the first portrait in the first portrait set and the portrait to be queried to obtain a PID list; determine whether there are portraits in the portrait feature library that meet the second preset condition between the portraits corresponding to the PID ranked first in the PID list; if so, obtain from the portrait feature library the portraits that meet the second preset condition between the portraits corresponding to the PID ranked first in the PID list; determine whether there are portraits in the portrait feature library that meet the second preset condition between the portraits corresponding to the PID ranked second in the PID list; if so, obtain from the portrait feature library the portraits that meet the second preset condition between the portraits corresponding to the PID ranked second in the PID list; and use the portraits in the portrait feature library that meet the second preset condition between the portraits corresponding to the PID ranked first in the PID list and the portraits corresponding to the PID ranked second in the PID list that meet the second preset condition as the second portrait set.
[0020] In one embodiment, the second portrait set determination module is further configured to: end the process if there is no portrait in the portrait feature library corresponding to the PID ranked first in the PID list that does not meet the second preset condition.
[0021] In one embodiment, the overlap determination module is further configured to assign the PID as a portrait ID to the first portrait in the first portrait set and the portrait to be queried, to indicate that the first portrait in the first portrait set and the portrait to be queried are portraits corresponding to the same user.
[0022] In one embodiment, the overlap determination module is further configured to: determine that the overlap between the first portrait set and the second portrait set is less than the third preset threshold, and generate a portrait ID to be queried based on the portrait to be queried to indicate that the portrait to be queried is the portrait corresponding to the user to be queried.
[0023] In one embodiment, the device also includes an illegal identification module, which is configured to: obtain basic data; perform statistics on the basic data to determine the number of accounts registered and authenticated for each portrait ID within a preset time period; when the number of accounts registered and authenticated for the portrait ID within the preset time period is greater than a fifth preset threshold, determine that the user corresponding to the portrait ID is an illegal user.
[0024] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above methods is implemented.
[0025] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0026] According to the portrait recognition method, portrait recognition device, computer-readable storage medium, and electronic device of the embodiments of the present disclosure, a first portrait set whose similarity to the portrait to be queried satisfies a first preset condition is retrieved from a portrait feature library; based on the first portrait in the first portrait set, a second portrait set whose similarity to the first portrait satisfies a second preset condition is retrieved from the portrait feature library; and in response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, the user corresponding to the first portrait set is used as the recognition result of the portrait to be queried. In this way, the retrieval technology problem of converting portrait similarity into vector space distance can be solved by calculating the overlap between the two portrait sets without the need for training reference samples to determine the portrait recognition result. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood by reading the detailed description below with reference to the accompanying drawings, in which several embodiments of the present disclosure are shown by way of example and not limitation, wherein:
[0028] Figure 1 A schematic diagram of a portrait recognition process architecture in an embodiment of the present disclosure is shown;
[0029] Figure 2 A flowchart of a method for portrait recognition in an embodiment of the present disclosure is shown;
[0030] Figure 3 A schematic diagram illustrating a method for determining the degree of overlap in a portrait recognition method according to an embodiment of the present disclosure is shown;
[0031] Figure 4 A flowchart of determining a first portrait set in a portrait recognition method according to an embodiment of the present disclosure is shown;
[0032] Figure 5 A flowchart of determining a second portrait set in a portrait recognition method according to an embodiment of the present disclosure is shown;
[0033] Figure 6 A flowchart of determining a second portrait set in a portrait recognition method according to an embodiment of the present disclosure is shown;
[0034] Figure 7 A schematic diagram showing a face recognition method in an embodiment of the present disclosure is shown;
[0035] Figure 8 A schematic diagram showing a clustering method in a face recognition method according to an embodiment of the present disclosure is shown;
[0036] Figure 9 A schematic structural diagram of a portrait recognition device according to an embodiment of the present disclosure is shown;
[0037] Figure 10 A schematic structural diagram of an electronic device in an embodiment of the present disclosure is shown.
[0038] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts. DETAILED DESCRIPTION
[0039] The principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. Rather, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0040] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software.
[0041] According to an embodiment of the present disclosure, a human portrait recognition method, a human portrait recognition device, a computer-readable storage medium, and an electronic device are provided.
[0042] In this document, any number of elements in the drawings is for illustration and not for limitation, and any naming is for distinction only and does not have any limiting meaning.
[0043] The principles and spirit of the present disclosure are described in detail below with reference to several representative embodiments of the present disclosure. SUMMARY OF THE INVENTION
[0045] In related technologies, there is no specific portrait clustering capability in the field of social risk control. Among the general portrait clustering capabilities, the monitoring equipment field is more widely used, which basically uses multiple images captured by multiple devices for clustering.
[0046] The related technology includes a method, device and medium for portrait clustering, which relates to the field of image processing. It clusters facial features and human features through facial images collected by various image devices, and generates a face cluster set and a human cluster set when the cluster feature confidence is greater than or equal to a first threshold; when the preset requirements are met, the snapshots to be clustered other than the already clustered snapshots are clustered to determine a new face cluster set and a new human cluster set, and each new cluster set is merged into the face cluster set or the human cluster set, and finally the merged face cluster set and the merged human cluster set are fused and clustered as reference data for portrait recognition.
[0047] There is also a related technology that integrates multiple data sources for auxiliary judgment based on portrait features in monitoring scenarios, such as human body similarity, crowd flow, time span and other data.
[0048] The above-mentioned related technologies have the following problems:
[0049] 1) Clustering is performed based on the existing image set, and it is impossible to perform gradual portrait clustering on incremental data without a sample set;
[0050] 2) Risk control is rarely used in the field of Internet social networking, and there is no corresponding illegal control mechanism.
[0051] In view of the foregoing, the present disclosure provides a portrait recognition method, a portrait recognition device, a computer-readable storage medium, and an electronic device. The method comprises querying a portrait feature library for a first portrait set whose similarity to a portrait to be queried satisfies a first preset condition; based on a first portrait in the first portrait set, querying the portrait feature library for a second portrait set whose similarity to the first portrait satisfies a second preset condition; and, in response to a degree of overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, determining the user corresponding to the first portrait set as the recognition result for the portrait to be queried. In this manner, the retrieval technology problem of converting portrait similarity into vector space distance is solved. Without the need for training reference samples, the portrait recognition result can be determined by calculating the degree of overlap between the two portrait sets.
[0052] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0053] Application Scenario Overview
[0054] It should be noted that the following application scenarios are only provided to facilitate understanding of the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0055] The present disclosure can be applied to any portrait recognition scenario, such as face verification, querying a first portrait set from a portrait feature library for a portrait whose similarity to the portrait to be queried meets a first preset condition; querying a second portrait set from the portrait feature library for a portrait whose similarity to the first portrait meets a second preset condition based on the first portrait in the first portrait set; and selecting the user corresponding to the first portrait set as the recognition result of the portrait to be queried, in response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold. In this way, the retrieval technology problem of converting portrait similarity into vector space distance can determine the portrait recognition result by calculating the overlap between the two portrait sets without the need for training reference samples.
[0056] Exemplary Methods
[0057] The following combination Figure 1 The system architecture and application scenarios of the operating environment of this exemplary embodiment are exemplarily described.
[0058] Figure 1 A schematic diagram of a system architecture is shown. The system architecture 100 may include a portrait acquisition device 110 and a portrait recognition device 120. The portrait acquisition device 110 may be a terminal, such as a smartphone, tablet computer, or personal computer. The portrait acquisition device 110 may capture a portrait and send it to the portrait recognition device 120. The portrait recognition device 120 may generally refer to a backend system (such as a portrait recognition system) that provides portrait recognition-related services. The portrait recognition device 120 may query a portrait feature library for a first portrait set whose similarity to the portrait to be queried meets a first preset condition; based on the first portrait in the first portrait set, the portrait feature library may query a second portrait set whose similarity to the first portrait meets a second preset condition; and in response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, the user corresponding to the first portrait set is used as the recognition result of the portrait to be queried. The portrait recognition device 120 may be a single server or a cluster of multiple servers. The portrait acquisition device 110 and the portrait recognition device 120 can be connected via a wired or wireless communication link to perform data exchange.
[0059] An exemplary embodiment of the present disclosure first provides a method for portrait recognition, which may include:
[0060] Querying a first set of portraits from a portrait feature database, whose similarity to the portrait to be queried satisfies a first preset condition;
[0061] According to a first portrait in the first portrait set, searching from a portrait feature library for a second portrait set whose similarity with the first portrait meets a second preset condition;
[0062] In response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, the user corresponding to the first portrait set is used as the recognition result of the portrait to be queried.
[0063] Figure 2 The exemplary process of the portrait recognition method is shown below. Figure 2 Each step is described in detail.
[0064] refer to Figure 2 In step S210, a first portrait set whose similarity with the portrait to be queried meets a first preset condition is searched from the portrait feature library.
[0065] The "person to be queried" refers to a portrait image in an image. This can be an image captured by any surveillance device or other portrait image acquisition device; for example, images captured by surveillance equipment in public places, or images captured by mobile phones and other terminal devices, without limitation. When the person to be queried is an image captured by a mobile phone or other terminal device, the person to be queried can also be an image captured by a third-party platform, application, or other facial verification process.
[0066] In actual operation, one or more portraits to be queried can be input, and there is no limitation here. In the case of inputting multiple portraits to be queried, the multiple portraits to be queried can be portraits of the same person or portraits of different people, and there is no limitation here.
[0067] The first preset condition may be preset based on historical data or experience, and is not limited here. Here, each portrait in the first portrait set that satisfies the first preset condition is highly similar to the portrait to be queried.
[0068] The portrait feature library can be a feature library pre-constructed based on a large number of portraits of different people; specifically, the features of a large number of portraits of different people can be extracted first to obtain facial features and body features of a large number of different people, and then the facial features and body features of a large number of different people are used to form a portrait feature library; here, the facial features and body features are separated differently according to the different people.
[0069] The portrait features in the portrait feature library and the portrait features of the portrait to be queried can be obtained by inputting the portrait image into a feature extraction network under deep learning technology, so that the feature extraction network performs feature extraction processing on the portrait image to obtain the portrait features of the portrait image; the feature extraction network is a feature extraction network commonly used in related technologies and is not limited here.
[0070] The similarity can be calculated using Jaccard similarity coefficient, cosine similarity, Euclidean distance, Manhattan distance, Pearson correlation coefficient, etc. in related technologies, which are not limited here.
[0071] Continue to refer Figure 2 In step S220, based on the first portrait in the first portrait set, a second portrait set whose similarity with the first portrait meets a second preset condition is searched from the portrait feature library.
[0072] The first person portrait generally refers to any person portrait in the first person portrait set.
[0073] This step can traverse each portrait in the first portrait set, and query the portrait feature library for a set whose similarity with each portrait in the first portrait set is greater than a second preset threshold (for each portrait in the first portrait set, a corresponding set is queried from the portrait feature library), and a set corresponding to each portrait in the first portrait set constitutes the second portrait set.
[0074] The second preset condition may be pre-set based on historical data or experience, and is not limited here. Here, each portrait in the second portrait set that satisfies the second preset condition is highly similar to each portrait in the first portrait set.
[0075] At present, the more widespread and common facial feature recognition methods include the FaceNet system, the LBP algorithm, and algorithms based on machine learning or neural networks to extract facial features. This feature is often a multidimensional vector and can be regarded as a point in a multidimensional space. After the algorithm feature extraction, multiple faces will be mapped to the same multidimensional space, and the similarity of the faces is the relative distance between each face point in the space. Therefore, this exemplary embodiment converts the judgment of facial similarity into a retrieval technology problem of vector space distance. The human body verification link is similar to the face verification link and will not be repeated here.
[0076] Continue to refer Figure 2 In step S230, in response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, the user corresponding to the first portrait set is used as the recognition result of the portrait to be queried.
[0077] Among them, the Intersection of Union (IoU) is generally used as a measurement indicator to describe the overlap between two images or two frames (which can also be understood as the quality (accuracy) of the detection results). The overlap is widely used in the fields of object detection and semantic segmentation. It is equal to the intersection of two sets divided by their union; for example: Figure 3As shown, assuming that the rectangular box on the left is N, the coordinates of the upper left corner are (x1, y1), and the coordinates of the lower right corner are (x2, y2); the rectangular box on the right is M, the coordinates of the upper left corner are (a1, b1), and the coordinates of the lower right corner are (a2, b2); the intersecting rectangular box is assumed to be X, the coordinates of the upper left corner are set to point A, and the coordinates of the lower right corner are set to point B; then, IoU = area_X / (area_N+area_M-area_X).
[0078] The third preset threshold can be pre-set based on historical data or experience, and is not limited here. Here, if the degree of overlap is greater than the third preset threshold, it indicates that there are many identical portraits in the first and second portrait sets. A greater degree of overlap indicates that there are more identical portraits in the first and second portrait sets. The first portrait set can be considered a predicted result, and the second portrait set can be considered an actual result. Therefore, a greater degree of overlap indicates a more accurate predicted result.
[0079] In actual operation, the third preset threshold is usually set between 0.5 and 0.7. When the overlap exceeds 0.5, it is considered to have hit the target. When the overlap exceeds 0.7, it is considered to be an accurate detection result.
[0080] This step can also be understood as taking the user corresponding to the first portrait set as the recognition result (clustering result) of the portrait to be queried.
[0081] In one embodiment, the first portrait set can be determined by sorting by similarity and / or similarity size; specifically, refer to Figure 4 , the above step S210 may further include the following steps S410 and S420:
[0082] Step S410: Obtain the portrait to be queried.
[0083] The image to be queried may be a portrait obtained by a user input into a search platform (search framework); the portrait to be queried may be a face image, or a whole image including a face image and a body image, which is not limited here.
[0084] Step S420: using a vector search framework, searching the portrait feature library for a first set of portraits that meet a first preset condition with the portrait to be searched.
[0085] Among them, the first preset condition is that the similarity between the portraits in the portrait feature library and the portrait to be queried is greater than a first preset threshold, and / or the similarity between the portraits in the portrait feature library and the portrait to be queried is in the top N positions in a similarity sequence arranged from large to small.
[0086] Among them, the retrieval framework can be understood as the above-mentioned retrieval platform, and the vector retrieval framework can be understood as the vector retrieval platform.
[0087] In actual operation, before searching for a first set of candidate portraits whose similarity with the portrait to be queried is greater than a first preset threshold from the portrait feature library, it is necessary to perform feature extraction on the portrait to be queried to obtain a feature vector of the portrait to be queried; specifically, feature extraction can be performed on the portrait to be queried before the portrait to be queried is input into the vector retrieval framework, or feature extraction can be performed on the portrait to be queried after the portrait to be queried is input into the vector retrieval framework, and there is no limitation here.
[0088] The vector search framework can use existing vector search frameworks, such as kd-tree, LSH local sensitive hashing, elasticsearch, faiss, and milvus. It can also use a self-developed vector search framework, such as Company A's internal vector search framework Nsearch (its vector search capabilities are somewhat similar to the open source framework ES). This is not a limitation here.
[0089] In actual operation, the vector retrieval framework can directly output the top N portraits in the first candidate portrait set; it can also output the first candidate portrait set sorted by similarity, and then select the top N portraits from the first candidate portrait set; it can also directly output the first candidate portrait set, then sort the first candidate portrait set by similarity, and then select the top N portraits from the first candidate portrait set sorted in descending order of similarity. There is no limitation here.
[0090] The first preset condition is that the similarity between the portrait in the portrait feature library and the portrait to be queried is greater than a first preset threshold, and / or the similarity between the portrait in the portrait feature library and the portrait to be queried is in the top N positions in a similarity sequence arranged from large to small. The following three situations exist:
[0091] First, the number of portraits in the portrait feature database whose similarity to the portrait to be queried is greater than a first preset threshold is equal to the number of portraits in the portrait feature database whose similarity to the portrait to be queried is in the top N positions in the similarity sequence arranged from largest to smallest;
[0092] Second, the number of portraits in the portrait feature database whose similarity to the portrait to be queried is greater than a first preset threshold is greater than the number of portraits in the portrait feature database whose similarity to the portrait to be queried is ranked in the top N positions in the similarity sequence arranged from largest to smallest;
[0093] Third, the number of portraits in the portrait feature database whose similarity to the portrait to be queried is greater than a first preset threshold is less than the number of portraits in the portrait feature database whose similarity to the portrait to be queried is ranked in the top N positions in the similarity sequence arranged from largest to smallest;
[0094] For the first case mentioned above, it is possible to use the portraits in the portrait feature library whose similarity with the portrait to be queried is greater than the first preset threshold as the first portrait set, or to use the portraits in the portrait feature library whose similarity with the portrait to be queried is in the top N positions in the similarity sequence arranged from large to small as the first portrait set; for the second case mentioned above, use the portraits in the portrait feature library whose similarity with the portrait to be queried is in the top N positions in the similarity sequence arranged from large to small as the first portrait set; for the third case mentioned above, use the portraits in the portrait feature library whose similarity with the portrait to be queried is greater than the first preset threshold as the first portrait set.
[0095] In one embodiment, the second portrait set can be determined based on the first portrait set; specifically, refer to Figure 5 , the above step S220 may further include the following steps S510 to S530:
[0096] Step S510: Determine whether the number of first portraits in the first portrait set is greater than a fourth preset threshold.
[0097] The fourth preset threshold value can be pre-set based on historical data or experience, and is not limited here. Here, the more portraits in the first portrait set, the better; this is because if the number of portraits in the first portrait set is smaller, the calculation of the overlap degree is more likely to lose practical and statistical significance, and the accuracy of the final clustering result (recognition result) is lower.
[0098] Step S520: If the value is greater than a fourth preset threshold, query the PID according to the UID corresponding to the first portrait.
[0099] A User Identification (UID) is a numerical value automatically generated when registering on a network platform. In a computer system, each user has a unique UID, which is used to distinguish different user identities. A UID is typically a number and can be any non-negative integer, but duplicate UIDs cannot exist on the same system. UIDs are often used to control user access to system resources, such as files and directories.
[0100] In this exemplary embodiment, the PID designated represents a portrait's unique ID, equivalent to its identification number. Once this PID is generated, all portraits of the same user will be categorized under this PID. Therefore, the PID generation process can be considered a portrait clustering process. Once a PID is generated, subsequent photos of the same person will be categorized under the corresponding PID according to the method provided in this exemplary embodiment, ultimately forming a UID-PID mapping table. This mapping table is used to query the corresponding PID based on the UID corresponding to the portrait.
[0101] In actual operation, one user corresponds to one UID. Therefore, the portraits of the same user in the first portrait set correspond to the same UID. One UID corresponds to one PID or multiple PIDs. Here, the number of PIDs is determined according to the number of open processes. If one process is opened, there is one PID; if multiple processes are opened, there are multiple PIDs.
[0102] Step S530: When the PID is found, a second set of portraits that meet a second preset condition with the portrait corresponding to the PID is searched from the portrait feature library according to the portrait corresponding to the PID.
[0103] Among them, the second preset condition is that the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is greater than a second preset threshold, and / or the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is in the top N positions in the similarity sequence arranged from large to small.
[0104] The portrait corresponding to the PID can be understood as the portrait of the correct user.
[0105] For example, in the verification process, the portrait to be queried can be understood as the portrait to be verified. Therefore, the user corresponding to the portrait to be queried (the user corresponding to the first portrait) and the user corresponding to the portrait corresponding to the PID queried based on the UID corresponding to the first portrait may or may not be the same user. If the user corresponding to the portrait to be queried (the user corresponding to the first portrait) and the user corresponding to the portrait corresponding to the PID queried based on the UID corresponding to the first portrait are the same user, verification is successful (identification success / clustering success); otherwise, verification fails (identification failure / clustering failure).
[0106] In one embodiment, the second portrait set can be determined by traversing each portrait in the first portrait set; specifically, refer to Figure 6 The above step S530 of “searching for a second set of portraits from the portrait feature library based on the portrait corresponding to the PID, the second set of portraits having a similarity greater than a second preset threshold with the portrait corresponding to the PID” may further include the following steps S610 to S640:
[0107] Step S610: Sort the PIDs from largest to smallest according to the similarity between the first portrait in the first portrait set and the portrait to be queried, to obtain a PID list.
[0108] The similarity in this step refers to the similarity between the first portrait and the portrait corresponding to the PID queried based on the UID corresponding to the first portrait.
[0109] Step S620: Determine whether there is a portrait in the portrait feature library that meets the second preset condition between the portraits corresponding to the PID ranked first in the PID list; if so, obtain the portrait that meets the second preset condition between the portraits corresponding to the PID ranked first in the PID list from the portrait feature library.
[0110] The implementation method of this step is the same as that of the above step S210 and will not be repeated here.
[0111] Step S630: Determine whether there is a portrait in the portrait feature library that meets the second preset condition between the portraits corresponding to the second PID in the PID list; if so, obtain from the portrait feature library the portrait that meets the second preset condition between the portraits corresponding to the second PID in the PID list.
[0112] The implementation method of this step is the same as that of the above step S210 and will not be repeated here.
[0113] Step S640: The portraits in the portrait feature library that meet the second preset condition between the portraits corresponding to the first PID in the PID list and the portraits corresponding to the second PID in the PID list that meet the second preset condition are taken as a second portrait set.
[0114] The implementation method of this step is the same as that of the above step S210 and will not be repeated here.
[0115] In one embodiment, there is a situation where the second preset condition is not met; specifically, the above-mentioned portrait recognition method may further include the following steps:
[0116] If there is no portrait in the portrait feature library corresponding to the PID ranked first in the PID list and the portrait does not meet the second preset condition, the process ends.
[0117] Among them, since the PID list is arranged from large to small based on the similarity between the first portrait and the portrait corresponding to the PID queried according to the UID corresponding to the first portrait; therefore, when there is no portrait in the portrait feature library whose similarity with the portrait corresponding to the PID ranked first in the PID list is greater than the second preset threshold, there is a high probability that there is no portrait in the portrait feature library whose similarity with the portraits corresponding to the PIDs ranked elsewhere in the PID list is greater than the second preset threshold. Even if there is, using these portraits to calculate the overlap is likely to lose practical significance, and the accuracy of the final recognition result will be lower; therefore, the process can be ended directly.
[0118] In one embodiment, the portraits may be marked to distinguish portraits of different users; specifically, the portrait recognition method may further include the following steps:
[0119] The first portrait in the first portrait set and the portrait to be queried are assigned PIDs as portrait IDs, to indicate that the first portrait in the first portrait set and the portrait to be queried are portraits corresponding to the same user.
[0120] Among them, when the first portrait set is the clustering result of the portrait to be queried, it means that there is a high probability that the portraits in the first portrait set and the user corresponding to the portrait to be queried are the same user; therefore, corresponding PIDs are assigned to the portraits in the first portrait set and the portrait to be queried to indicate that these portraits are portraits of the same user.
[0121] In one embodiment, when there is no portrait similar to the portrait to be queried in the portrait feature library, the portrait to be queried is marked and saved; specifically, the above-mentioned portrait recognition method may further include the following steps:
[0122] It is determined that the overlap between the first portrait set and the second portrait set is less than a third preset threshold, and a portrait ID to be queried is generated according to the portrait to be queried, to indicate that the portrait to be queried is a portrait corresponding to the user to be queried.
[0123] Among them, the overlap between the first portrait set and the second portrait set is not greater than the third preset threshold, indicating that the first portrait set is not the clustering result of the portrait to be queried; that is, the probability that the portraits in the first portrait set and the user corresponding to the portrait to be queried are the same user is low; therefore, the portrait ID to be queried is generated based on the portrait to be queried to indicate that the user corresponding to the portrait to be queried is different from the user in the portrait feature library.
[0124] In one embodiment, after the portraits to be queried are clustered, how to use the portrait clustering results to crack down on illegal users is the last link in value output; for details, refer to Figure 6 The above-mentioned portrait recognition method may further include the following steps S610 to S630:
[0125] Step S610: Obtain basic data.
[0126] Among them, the basic data includes black and white lists, face image pipelines, body image pipelines, auxiliary data, etc. obtained from relevant databases; for example: the number of users who registered portrait A within three days.
[0127] Step S620: Count the basic data to determine the number of accounts registered and authenticated for each portrait ID within a preset time period.
[0128] Among them, since criminals will use multiple accounts, mobile phone numbers, ID cards and other resources to commit illegal acts in order to circumvent common means of detecting illegal activities, therefore, by determining the number of accounts registered and authenticated for each portrait ID within a preset period of time, it is possible to determine whether the user corresponding to the portrait ID is an illegal user.
[0129] Step S630: When the number of accounts registered and authenticated for the portrait ID within the preset time period is greater than a fifth preset threshold, the user corresponding to the portrait ID is determined to be an illegal user.
[0130] The fifth preset threshold may be preset based on historical data or experience, and is not limited here.
[0131] This exemplary embodiment also provides a face recognition method, specifically, refer to Figure 7 , the face recognition method may include the following steps:
[0132] Step S710: extract facial features through the model and store them in a database to obtain a feature vector database;
[0133] Among them, the feature vector library is equivalent to the above-mentioned portrait feature library.
[0134] Step S720: Determine the top 10 portraits in the feature vector library that are closest to the portrait to be queried by calculating relative distances;
[0135] Step S730: Obtain the portrait ID of the portrait to be queried from the top 10 portraits through a clustering process, and record it as the portrait ID to be queried;
[0136] Step S740: Store the ID of the person to be queried into a feature vector library for subsequent identification.
[0137] Among them, reference Figure 8 The clustering process in step S730 may include the following steps:
[0138] Step S810: Querying the face search platform for portraits that meet a first preset condition with the portrait to be queried, and obtaining a first portrait set;
[0139] Step S820: Determine whether the number of portraits in the first portrait set is greater than or equal to 2. If yes, execute step S830; otherwise, terminate the process.
[0140] Step S830: query the corresponding PID according to the UID corresponding to the first portrait in the first portrait set;
[0141] Step S840: Determine whether the corresponding PID exists; if yes, execute step S850; otherwise, end the process;
[0142] Step S850: Sort the PIDs from largest to smallest according to the similarity between the first portrait in the first portrait set and the portrait to be queried, to obtain a PID list;
[0143] Step S860: Searching the face search platform for a portrait that meets a second preset condition among the portraits corresponding to the PID. If a portrait is found, executing step S870; otherwise, determining whether the PID list has ended. If so, updating the PID record and storing it in the portrait ID management table; otherwise, executing step S870;
[0144] Step S870: Calculate the degree of overlap between the first portrait set and the second portrait set;
[0145] Step S880: Determine whether the degree of overlap between the first portrait set and the second portrait set is greater than a third preset threshold; if yes, execute step S890; otherwise, update the PID record and store it in the portrait ID management table.
[0146] Step S890: Assign PIDs to the first portrait in the first portrait set and the portrait to be queried, to indicate that the first portrait in the first portrait set and the portrait to be queried correspond to the same user.
[0147] Exemplary devices
[0148] After introducing the key processing method of the exemplary embodiment of the present disclosure, Figure 9 A human portrait recognition device according to an exemplary embodiment of the present disclosure will be described.
[0149] refer to Figure 9 As shown, the portrait recognition device 900 includes:
[0150] The first portrait set determining module 910 is configured to search the portrait feature library for a first portrait set whose similarity with the portrait to be queried meets a first preset condition;
[0151] The second portrait set determining module 920 is configured to query a portrait feature library for a second portrait set whose similarity with the first portrait satisfies a second preset condition based on the first portrait in the first portrait set;
[0152] The overlap determination module 930 is configured to, in response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, take the user corresponding to the first portrait set as the recognition result of the portrait to be queried.
[0153] In one embodiment, the first portrait set determination module 910 is configured to: obtain a portrait to be queried; and through a vector retrieval framework, query a first portrait set from a portrait feature library that satisfies a first preset condition with the portrait to be queried; wherein the first preset condition is that the similarity between the portraits in the portrait feature library and the portrait to be queried is greater than a first preset threshold, and / or the similarity between the portraits in the portrait feature library and the portrait to be queried is in the top N positions in a similarity sequence arranged from large to small.
[0154] In one embodiment, the second portrait set determination module 920 is configured to: determine whether the number of first portraits in the first portrait set is greater than a fourth preset threshold; if it is greater than the fourth preset threshold, query the PID based on the UID corresponding to the first portrait; if the PID is queried, query the second portrait set that meets the second preset condition between the portrait corresponding to the PID and the portrait corresponding to the PID from the portrait feature library; wherein the second preset condition is that the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is greater than the second preset threshold, and / or the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is located in the first N positions in the similarity sequence arranged from large to small.
[0155] In one embodiment, the second portrait set determination module 920 is configured to: sort the PIDs from large to small according to the similarity between the first portrait in the first portrait set and the portrait to be queried to obtain a PID list; determine whether there is a portrait in the portrait feature library that meets the second preset condition between the portraits corresponding to the PID ranked first in the PID list; if so, obtain the portraits corresponding to the PID ranked first in the PID list from the portrait feature library that meet the second preset condition; determine whether there is a portrait in the portrait feature library that meets the second preset condition between the portraits corresponding to the PID ranked second in the PID list; if so, obtain the portraits corresponding to the PID ranked second in the PID list from the portrait feature library that meet the second preset condition; and take the portraits corresponding to the PID ranked first in the PID list in the portrait feature library that meet the second preset condition and the portraits corresponding to the PID ranked second in the PID list that meet the second preset condition as the second portrait set.
[0156] In one embodiment, the second portrait set determination module 920 is further configured to end the process if there is no portrait in the portrait feature library corresponding to the PID ranked first in the PID list that does not meet the second preset condition.
[0157] In one embodiment, the overlap determination module 930 is further configured to assign PIDs as portrait IDs to the first portrait in the first portrait set and the portrait to be queried, to indicate that the first portrait in the first portrait set and the portrait to be queried are portraits corresponding to the same user.
[0158] In one embodiment, the overlap determination module 930 is further configured to: determine that the overlap between the first portrait set and the second portrait set is less than a third preset threshold, and generate a portrait ID to be queried based on the portrait to be queried to indicate that the portrait to be queried is the portrait corresponding to the user to be queried.
[0159] In one embodiment, the device also includes an illegal identification module, which is configured to: obtain basic data; perform statistics on the basic data to determine the number of accounts registered and authenticated for each portrait ID within a preset time period; when the number of accounts registered and authenticated for the portrait ID within the preset time period is greater than a fifth preset threshold, determine that the user corresponding to the portrait ID is an illegal user.
[0160] Exemplary Storage Media
[0161] The storage medium according to the exemplary embodiment of the present disclosure will be described below.
[0162] In this exemplary embodiment, the above method can be implemented by a program product, such as a portable compact disc read-only memory (CD-ROM) that includes program code and can be executed on a device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0163] The program product can be implemented in any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0164] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0165] The program code contained on the readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RE, etc., or any suitable combination of the foregoing.
[0166] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0167] Exemplary electronic devices
[0168] refer to Figure 10 An electronic device according to an exemplary embodiment of the present disclosure will be described.
[0169] Figure 10 The electronic device 1000 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0170] like Figure 10 As shown, electronic device 1000 is implemented as a general-purpose computing device. Components of electronic device 1000 may include, but are not limited to, at least one processing unit 1010, at least one storage unit 1020, a bus 1030 connecting various system components (including storage unit 1020 and processing unit 1010), and a display unit 1040.
[0171] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1010 can perform the following steps: Figure 1 The method steps shown, etc.
[0172] The storage unit 1020 may include a volatile storage unit, such as a random access memory unit (RAM) 1021 and / or a cache memory unit 1022 , and may further include a read-only memory unit (ROM) 1023 .
[0173] The storage unit 1020 may also include a program / utility 1024 having a set (at least one) of program modules 1025, such program modules 1025 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0174] The bus 1030 may include a data bus, an address bus, and a control bus.
[0175] The electronic device 1000 can also communicate with one or more external devices 2000 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), and such communication can be performed via an input / output (I / O) interface 1050. The electronic device 1000 also includes a display unit 1040, which is connected to the input / output (I / O) interface 1050 for display. In addition, the electronic device 1000 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0176] It should be noted that although several modules or submodules of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in a single unit / module. Conversely, the features and functions of a single unit / module described above can be further divided and embodied by multiple units / modules.
[0177] Furthermore, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all illustrated operations must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0178] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features in these aspects cannot be combined to benefit. Such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the appended claims.
Claims
1. A portrait recognition method, characterized in that: The method comprises: Querying a first set of portraits from a portrait feature database, whose similarity to the portrait to be queried satisfies a first preset condition; Determine whether the number of first portraits in the first portrait set is greater than a fourth preset threshold; if the number is greater than the fourth preset threshold, query the PID based on the user identity verification UID corresponding to the first portrait, where the PID represents the portrait ID; if the PID is found, query the portrait feature library for a second portrait set that satisfies a second preset condition with the portrait corresponding to the PID based on the portrait corresponding to the PID; wherein the second preset condition is that the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is greater than a second preset threshold, or the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is in the top N digits of a similarity sequence arranged from largest to smallest; In response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, the user corresponding to the first portrait set is used as the recognition result of the portrait to be queried.
2. The method according to claim 1, characterized in that The step of searching for a first portrait set from a portrait feature library, wherein the first portrait set has a similarity with the portrait to be queried that meets a first preset condition, includes: Obtaining the portrait to be queried; A first set of portraits that meet a first preset condition with the portrait to be queried is retrieved from the portrait feature library through a vector retrieval framework; wherein the first preset condition is that the similarity between the portraits in the portrait feature library and the portrait to be queried is greater than a first preset threshold, or the similarity between the portraits in the portrait feature library and the portrait to be queried is in the top N positions in a similarity sequence arranged from largest to smallest.
3. The method according to claim 1, characterized in that The step of searching, from the portrait feature library according to the portrait corresponding to the PID, for a second portrait set that satisfies a second preset condition and the portrait corresponding to the PID includes: Sort the PIDs from largest to smallest according to the similarity between the first portrait in the first portrait set and the portrait to be queried, to obtain a PID list; determining whether there exists in the portrait feature library a portrait that satisfies a second preset condition among the portraits corresponding to the first PID in the PID list; and if so, obtaining from the portrait feature library a portrait that satisfies the second preset condition among the portraits corresponding to the first PID in the PID list; determining whether there exists in the portrait feature library a portrait that satisfies a second preset condition among the portraits corresponding to the second PID in the PID list; and if so, obtaining from the portrait feature library a portrait that satisfies the second preset condition among the portraits corresponding to the second PID in the PID list; The portraits in the portrait feature library that meet the second preset condition among the portraits corresponding to the first PID in the PID list, and the portraits that meet the second preset condition among the portraits corresponding to the second PID in the PID list are taken as the second portrait set.
4. The method according to claim 3, characterized in that The method further comprises: If there is no portrait in the portrait feature library corresponding to the PID ranked first in the PID list and the portrait does not meet the second preset condition, the process ends.
5. The method according to claim 1, characterized in that The method further comprises: The PID is assigned to the first portrait in the first portrait set and the portrait to be queried as a portrait ID, to indicate that the first portrait in the first portrait set and the portrait to be queried are portraits corresponding to the same user.
6. The method according to claim 1, characterized in that The method further comprises: It is determined that the overlap between the first portrait set and the second portrait set is less than the third preset threshold, and a portrait ID to be queried is generated according to the portrait to be queried to indicate that the portrait to be queried is a portrait corresponding to the user to be queried.
7. The method according to claim 1, characterized in that The method further comprises: Get basic data; Collect statistics on the basic data to determine the number of accounts registered and authenticated for each portrait ID within a preset period of time; When the number of accounts registered and authenticated for the portrait ID within the preset time period is greater than a fifth preset threshold, the user corresponding to the portrait ID is determined to be an illegal user.
8. A portrait recognition device, characterized in that: The device comprises: A first portrait set determining module is configured to search the portrait feature library for a first portrait set whose similarity with the portrait to be queried meets a first preset condition; The second portrait set determination module is configured to determine whether the number of first portraits in the first portrait set is greater than a fourth preset threshold; if the number is greater than the fourth preset threshold, query the PID based on the user identity verification UID corresponding to the first portrait, wherein the PID represents the portrait ID; if the PID is found, query the portrait feature library based on the portrait corresponding to the PID for a second portrait set that satisfies a second preset condition with the portrait corresponding to the PID; wherein the second preset condition is that the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is greater than a second preset threshold, or the similarity between the portrait in the portrait feature library and the portrait corresponding to the PID ranked first in the PID list is in the top N digits of a similarity sequence arranged from large to small; The overlap determination module is configured to, in response to the overlap between the first portrait set and the second portrait set being greater than or equal to a third preset threshold, use the user corresponding to the first portrait set as the recognition result of the portrait to be queried.
9. The device according to claim 8, characterized in that The first portrait set determination module is configured to: Obtaining the portrait to be queried; A first set of portraits that meet a first preset condition with the portrait to be queried is retrieved from the portrait feature library through a vector retrieval framework; wherein the first preset condition is that the similarity between the portraits in the portrait feature library and the portrait to be queried is greater than a first preset threshold, or the similarity between the portraits in the portrait feature library and the portrait to be queried is in the top N positions in a similarity sequence arranged from largest to smallest.
10. The device according to claim 8, characterized in that The second portrait set determination module is configured to: Sort the PIDs from largest to smallest according to the similarity between the first portrait in the first portrait set and the portrait to be queried, to obtain a PID list; Determining whether there is a portrait in the portrait feature library that satisfies a second preset condition among the portraits corresponding to the PID ranked first in the PID list; If so, obtaining from the portrait feature library a portrait that satisfies a second preset condition among the portraits corresponding to the PID ranked first in the PID list; Determining whether there is a portrait in the portrait feature library that satisfies a second preset condition among the portraits corresponding to the second PID in the PID list; If so, obtaining from the portrait feature library a portrait that satisfies a second preset condition among the portraits corresponding to the second PID in the PID list; The portraits in the portrait feature library that meet the second preset condition among the portraits corresponding to the first PID in the PID list, and the portraits that meet the second preset condition among the portraits corresponding to the second PID in the PID list are taken as the second portrait set.
11. The device according to claim 10, characterized in that The second portrait set determination module is further configured to: If there is no portrait in the portrait feature library corresponding to the PID ranked first in the PID list and the portrait does not meet the second preset condition, the process ends.
12. The device according to claim 8, characterized in that The overlap determination module is further configured to: The PID is assigned to the first portrait in the first portrait set and the portrait to be queried as a portrait ID, to indicate that the first portrait in the first portrait set and the portrait to be queried are portraits corresponding to the same user.
13. The device according to claim 8, characterized in that The overlap determination module is further configured to: It is determined that the overlap between the first portrait set and the second portrait set is less than the third preset threshold, and a portrait ID to be queried is generated according to the portrait to be queried to indicate that the portrait to be queried is a portrait corresponding to the user to be queried.
14. The device according to claim 8, characterized in that The apparatus further includes a violation identification module, wherein the violation identification module is configured to: Get basic data; Collect statistics on the basic data to determine the number of accounts registered and authenticated for each portrait ID within a preset period of time; When the number of accounts registered and authenticated for the portrait ID within the preset time period is greater than a fifth preset threshold, the user corresponding to the portrait ID is determined to be an illegal user.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
16. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to perform the method according to any one of claims 1 to 7 by executing the executable instructions.
Citation Information
Patent Citations
Face recognition method, device, electronic device and computer-readable medium
CN109117808A
Face recognition method and device
CN110825765A