WO2023284181A1 - Method for filtering face images, electronic device, and computer-readable non-transitory storage medium - Google Patents

Method for filtering face images, electronic device, and computer-readable non-transitory storage medium Download PDF

Info

Publication number
WO2023284181A1
WO2023284181A1 PCT/CN2021/128514 CN2021128514W WO2023284181A1 WO 2023284181 A1 WO2023284181 A1 WO 2023284181A1 CN 2021128514 W CN2021128514 W CN 2021128514W WO 2023284181 A1 WO2023284181 A1 WO 2023284181A1
Authority
WO
WIPO (PCT)
Prior art keywords
face
face image
face images
representative
images
Prior art date
Application number
PCT/CN2021/128514
Other languages
French (fr)
Inventor
Dening DI
Mingwei Zhou
Huadong PAN
Jingsong HAO
Shulei ZHU
Original Assignee
Zhejiang Dahua Technology Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co., Ltd. filed Critical Zhejiang Dahua Technology Co., Ltd.
Publication of WO2023284181A1 publication Critical patent/WO2023284181A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying
    • G06F16/535Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/762Arrangements for image or video recognition or understanding using pattern recognition or machine learning using clustering, e.g. of similar faces in social networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular to a method for filtering face images, an electronic device, and a computer-readable non-transitory storage medium.
  • placement areas for static face images need to be manually marked, so as to ignore the face images in the placement areas; however, this requires updating and maintaining the placements areas manually, and faces of living bodies in the placement areas would be ignored as well, such that a process of face-image filtering becomes inaccurate.
  • how to automatically generate and update a blacklist database corresponding to the face images without value for analysis in the database and filter face images similar to representative face images in the blacklist database based on the blacklist database becomes an urgent problem to be solved.
  • the present disclosure provides a method for filtering face images, an electronic device, and a computer-readable non-transitory storage medium, which automatically generate and update a blacklist database corresponding to a database, and filter face images similar to representative face images in the blacklist database.
  • the present disclosure provides a method for filtering face images according to a first aspect of the present disclosure, the method includes: acquiring a database storing face images, wherein each of a plurality of data sets in the database stores all face images belonging to one face; in response to a number of face images of at least one of the plurality of data sets being greater than a first threshold, extracting a representative face image from a data set with the number of face images being greater than the first threshold, and importing the representative face image to a blacklist database; acquiring a first position deviation by comparing, in response to acquiring a to-be-recognized face image, positions of the to-be-recognized face image and the representative face image in the blacklist database; determining whether the first position deviation being less than a second threshold; in response to the first position deviation being less than a second threshold, discarding the to-be-recognized face image; in response to the first position deviation being greater than or equal to a second threshold, adding the to-
  • the present disclosure provides an electronic device according to a second aspect of the present disclosure, the electronic device includes: an electronic device comprising a processor and a memory coupled with each other, wherein the memory stores program data, and the processor executes the program data to perform the methods in the above described first aspect.
  • the present disclosure provides a computer-readable non-transitory storage medium according to a third aspect of the present disclosure, wherein the computer-readable non-transitory storage medium stores program data, when the program data is executed by a processor, performs the methods in the above described first aspect.
  • a face-clustered database is acquired, and each of multiple datat sets in the database stores all face images belonging to one face; since a number of static face images is large and features of the static images are very similar, when a number of face images of any one of the data sets is greater than a first threshold, a representative face image in the data set with the number of face images being greater than the first threshold is extracted, and imported to a blacklist database, so that the representative face image corresponding to static face images is acquired, and the blacklist database is generated; when a to-be-recognized face image is acquired, the to-be-recognized face image and the representative face image are compared, to acquire first position deviations; when at least one first position deviation is less than a second threshold, the representative face image are very similar to the to-be-recognized face image, and the to-be-recognized face image is discarded, to filter static face images; when all first position deviations are greater than
  • FIG. 1 is a flow chart of a method for filtering face images according to an embodiment of the present disclosure.
  • FIG. 2 is a flow chart of a method for filtering face images according to another embodiment of the present disclosure.
  • FIG. 3 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural view of a computer-readable non-transitory storage medium according to an embodiment of the present disclosure.
  • Terminologies such as “system” and “network” may be used exchangeably in the present disclosure; “and/or” is only used for a description of a relationship for related objects, to represent there may be three kinds of relationships, for example, A and/or B, may represent: individual A present, co-existing A and B, individual B present.
  • a symbol “/” in the present disclosure usually represents “or” relationship between a front and a back objects which are related.
  • “multiple” or “a plurality of” means two or more than two.
  • FIG. 1 is a flow chart of a method for filtering face images according to an embodiment of the present disclosure. The method includes actions or operations at blocks illustrated in FIG. 1.
  • a face-clustered database is acquired, the database stores multiple data sets, and each data set stores at least one face image corresponding to one face.
  • face clustering is performed on newly-added face images and existing face images in the database, face images belonging to one face are stored in one same data set; a data set is built individually for a unique face image, so that one face corresponds to one data set.
  • a spokesperson endorses a variety of products, advertising posters corresponding to the variety of products are posted in a city.
  • Posted face images on the advertising posters correpsonding to the variety of products are collected by cameras, different posted face images of the same spokesperson are stored in a corresponding data set.
  • the cameras collect face images of a living-body spokesperson, and the face images of the living-body spokesperson are also stored in the data set corresponding to the spokesperson, such that one face corresponds to one data set.
  • At block S102 in response to a number of at least face images of one of the plurality of data sets being greater than a first threshold, extracting a representative face image from a data set with the number of face images being greater than the first threshold, and importing the representative face image to a blacklist database.
  • a frequency for collecting static face images for advertisement is relatively high, and a number of the collected static face images is relatively large; and the static face images are targets of non-living-body, a same static face image when being collected has difference in angles and lighting, but features of the same static face image are very similar. Therefore, when static face images are placed in a surveillance area, cameras may collect a large number of static face images.
  • the data set may include a huge number of static face images and causes the number being greater than the first threshold. Comparisons between face images are performed in the data set with the number being greater than the first threshold, such that a representative face image is extracted and added to a blacklist database.
  • the first threshold may be any integer between 100 to 1000, such as 100, 500, or 1000, etc., which will not be limited by the present disclosure, and the first threshold may be customized by a user.
  • face angles of every two face images of all face images in the data set are compared, to acquire angle comparison results.
  • Face images with angle comparison results less than an angle threshold are clustered into one static face cluster, to cluster at least some face images of the data set into one static face cluster, and a face image is selected from the static face cluster as a representative face image.
  • key-point positions of all face images in the data set are extracted, wherein the key points at least include at least part of a mouth, a tip of a nose, corners of eyes on both sides, and auricles.
  • Key-point coordinates corresponding to face image are constructed based on the key points of every face image, and perspective transformations are performed on key-point coordinates of every two face images respectively, to allow key-point coordinates to be of same size after zooming and shifting.
  • Two face images are compared based on and after the perspective transformations, to acquire a second position deviation between every two face images.
  • face images of advertisement have characteristics of large number and widespread, and a same batch of advertising face images uses a same static face image.
  • the frequency of collecting advertising face images for the cameras may be very high, so that the number of face images corresponding to the advertising face images in the data set may very soon be greater than the first threshold; and when the number of face images in the data set is greater than the first threshold, positions of key points between every two face images in the data set are compared, and the face images with position comparison results being less than a position threshold, are clustered to one static face cluster.
  • static face images on the advertisement A and the advertisement B are usually not the same poster.
  • Positions of key points of the face images corresponding to advertisement A and advertisement B respectively must be varied greatly, such that after positions of key points of every two face images in the data set being compared, the face image corresponding to advertisement A may be clustered into one static face cluster, and the face image corresponding to advertisement B may be clustered into another static face cluster.
  • a face image is extracted from each static face cluster as a representative face image, and then imported to a blacklist database, for the purpose of filtering face images later.
  • At block S103 acquiring a first position deviation by comparing, in response to acquiring a to-be-recognized face image, positions of the to-be-recognized face image and the representative face image in the blacklist database.
  • the to-be-recognized face image is acquired after the blacklist database is generated, and then perspective transformation and position comparison are performed based on the key points of the to-be-recognized face image and the key points of the representative face image in the blacklist database, so as to acquire the first position deviation.
  • key points of to-be-recognized face image and key points of all representative face images in the blacklist database are extracted, to perform comparisons on the positions of key points, and to acquire the first position deviations of the to-be-recognized face image relative to all representative face images.
  • position information of all face images in the static face cluster corresponding to the representative face image and the representative face image are added to the blacklist database, to acquire distance difference between the position of the to-be-recognized face image and the position of the representative face image.
  • Representative face images with distance differences being within a distance threshold are extracted, and comparisons positions of key points between the to-be-recognized face image and the extracted representative face images are performed.
  • the first position deviations of the to-be-recognized face image respectively relative to at least some representative face images could be acquired, thereby reducing the number of times for comparisons, and increasing comparing efficiency.
  • positions of key points of the representative face image and the to-be-recognized face image are very close; the to-be-recognized face image and the corresponding representative face images are determined to be from a same static face image, so that the current to-be-recognized face image is blocked and filtered.
  • the current to-be-recognized face image is not added to the database, and face images without value for analysis are reduced for the database.
  • the current to-be-recognized face image is added to the database, and is clustered with the face images in the database, to maintain the database in a status of having all face images corresponding to one face are clustered into one data set.
  • the blacklist database may automatically add a representative face image corresponding to the newly placed static face image, to realize filtering the static face images continuously.
  • a face-clustered database is acquired, and each of the plurality of datat sets in the database stores all face images belonging to one face. Since a number of static face images is large and features of the static images are very similar, when a number of face images of at least one of the plurality of data sets is greater than a first threshold, a representative face image in the data set with the number of face images being greater than the first threshold is extracted, and imported to a blacklist database, so that the representative face image corresponding to static face images is acquired, and the blacklist database is generated.
  • the to-be-recognized face image and the representative face image are compared to acquire a first position deviation.
  • the representative face image is very similar to the to-be-recognized face image, and the to-be-recognized face image is discarded, to filter static face images.
  • face clustering is performed after the to-be-recognized face image is added to the blacklist database; in response to a newly placed static face image exsiting, after the number of face images corresponding to the newly placed face image being greater than thre first threshold, the blacklist database is updated automatically, such that automatic generation and update of the blacklist database corresponding to the database is realized, and filtering out face images similar to the representative face images in the blacklist database.
  • FIG. 2 is a flow chart of a method for filtering face images according to another embodiment of the present disclosure. The method includes actions or operations at blocks illustrated in FIG. 2.
  • face clustering is performed on the newly added face image and the existed face images in the databse, such that all face images corresponds to one face are always clustered into one data set.
  • At block S202 in response to a number of face images of at least one of the plurality of data sets being greater than a first threshold, acquiring a plurality of second position deviations by comparing positions for every two face images in the data set with the number of face images being greater than the first threshold.
  • key points of every two face images are extracted to acquire key-point coordinates corresponding to the every two face images; perspective transformations are performed on the key-point coordinates corresponding to the every two face images respectively to acquire the plurality of second position deviations between the every two face images.
  • key-point coordinates corresponding to the face image is constructed.
  • perspective transformations are performed on the key-point coordinates corresponding to the every two face images respectively, to allow key-point coordinates to be of same size after zooming and shifting; two face images are compared based on and after the perspective transformations, to acquire a second position deviation between the two face images.
  • the data set may include a static face image that has been collected repeatedly; since the same static face image, when being collected by cameras, may have varied features due to angles and lighting, etc., face images may be analyzed by face feature matching, but in comparison to the face feature matching, position comparison has better robustness with respect to angles and lighting, etc., based on the key points of the face images, and the processing time is far lower than the processing time of using face feature matching.
  • a third threshold corresponding to the plurality of second position deviations is set; the plurality of second position deviations are used as distances, and clustering is performed on the face images in the data set with number of face images being greater than the first threshold by applying a clustering algorithm, to acquire multiple face clusters; a face cluster with multiple face images is used as a static face cluster, and the plurality of second position deviations between the face images in the same static face cluster are less than the second threshold.
  • the clustering algorithm includes, but not limited to, hierarchical clustering and density clustering.
  • face images with second position deviations less than the third threshold are clustered to one face cluster, to acquire at least one face cluster; a face cluster with the number of face images greater than or equal to a fourth threshold in face clusters is used as a static face cluster, such that at least some face images in the data set are clustered into one static face cluster.
  • face images with second positions less than the third threshold are clustered into one face cluster, to allow the face cluster to include multiple face images; when the number of face images in the face cluster is greater than the fourth threshold, the face cluster with the number of face images greater than the fourth threshold is used as the static face cluster.
  • the number of face images in the face cluster corresponding to the living-body face images is far less than the number of face images in the face cluster corresponding to static face images, and if the number of face images in the face cluster corresponding to static face images is large, then it may be greater than the fourth threshold; such that a face cluster with the number of face images greater than the fourth threshold in the face clusters is used as the static face cluster, such that at least some face images in the data set are clustered into one static face cluster.
  • the fourth threshold is set to be an integer greater than or equal to 2, such as 4; when the number of face images in one face cluster is 5, then the face cluster is determined to include multiple face images belonging to one static face image, and the face cluster is used as static face cluster.
  • the fourth threshold may be self-adjusted according to the first threshold, for example, when the first threshold is less than or equal to 100, the fourth threshold is set to be 5; when the first threshold is greater than 1000, the fourth threshold is set to be 50; when the first threshold is between 100 and 1000, the fourth threshold is set to be one twentieth of the first threshold.
  • face images from different static face images may be clustered to their corresponding face clusters, and the number of face images in the face clusters may be greater than the fourth threshold, and may be used as static face clusters; and face clusters corresponding to the face images of living-body face images, are filtered out because the number of the face images is less than or equal to the fourth threshold.
  • face images from the advertisement A and the advertisement B are clustered into one face cluster, and the number of face images of the face cluster is greater than the fourth threshold, then the face cluster is used as a static face cluster.
  • one face image is extracted from the static face cluster as a representative face image, and imported to the blacklist database, to block and filter face images that show up later with a high resemblance.
  • first position information of all face images in the static face cluster is extracted; a sum of second position deviations of any one of face images relative to other face images in the static face cluster is acquired for every face image; the face image with the least sum is used as a representative face image, and the representative face image and the first position information of the static face cluster corresponding to the representative face image are imported to the blacklist database.
  • an addition is performed on the plurality of second position deviations of any one of face images relative to every other face image in the static face cluster, to acquire a sum of the plurality of second position deviations, and the face image with the least sum is used as a representative face image corresponding to the static face cluster, wherein the face image with the least sum is equivalent to a face image that has the least sum of deviations relative to other face images with different angles and lighting, thus, the face image with the least sum as a representative face image is the most representative, and filtering for the subsequent face recognition is more accurate.
  • position information of all face images in the static face cluster is extracted respectively, to acquire first position information corresponding to the static face image, wherein the first position information includes position information of all cameras for collecting face images in the static face cluster, such as a serial number of a camera; the representative face image and first position information of all the face images in the static face cluster corresponding to the representative face image are imported to the blacklist database together.
  • At block S205 deleting all face images of the at least one static face cluster from the database.
  • Second position deviations between face images in the static face cluster are less than the third threshold, and the number of face images in the static face cluster is greater than the fourth threshold.
  • key points of the to-be-recognized face image and the representative image in the blacklist database are extracted, so as to acquire key-point coordinates corresponding to the to-be-recognized face image and the representative image; perspective transformations are performed on key-point coordinates of the to-be-recognized face image and the representative image respectively, to acquire the first position deviation between the to-be-recognized face image and the representative image.
  • the operation furhter before acquiring a first position deviation by comparing positions of a to-be-recognized face image with the representative face image in the blacklist database, in response to acquiring the to-be-recognized face image, the operation furhter includes: second position information of the to-be-recognized face image is acquired; the first position information matching with the second position information is searched for; a representative face image corresponding to the first position information matching with the second position information is extracted from the blacklist database.
  • the second position information of the to-be-recognized face image is acquired, the second position information includes position information of the cameras for collecting the to-be-recognized face image, the first position information matching with the second position information is searched for, all representative face images in the blacklist database coorespoding to the camera are extracted, the first position information of the camera matches with the second position information.
  • first position information and second position information are represented using longitudes and latitudes.
  • the first position information corresponds to different cameras in different longitudes and latitudes.
  • One camera may correspond to multiple representative face images.
  • the second position information of the to-be-recognized face image is extracted, the second position information is matched with all first position information to acquire the matched first position information and a first camera corresponding to the matched first position information. All representative face images corresponding to a first camera are extracted from the blacklist database, to realize performing position comparisons on some selected representative images according to position information, and improve comparison efficiency and reduce consumption during the comparison process.
  • operation S208 follows, when all first position deviations are greater than or equal to the second threshold, the to-be-recognized face image is not similar to any representative face image in the blacklist database, and operation S209 follows.
  • the to-be-recognized face image is blocked and discarded, to filter out the to-be-recognized face image and avoid adding a face image without value for analysis to the database.
  • the to-be-recognized face image is discarded; a representative face image with position comparison result within the first position deviations is extracted, the position comparison result is acquired by comparing the discarded to-be-recognized face image to the representative face image, and the representative face image is used as a first matching representative face image; discarding time corresponding to the discarded to-be-recognized face image is recorded, and the discarding time is used as a first time of a last appearance of the first matching representative face image.
  • the representative face image with position comparison result within the first position deviation is extracted, the position comparison result is acquired by comparing the discarded to-be-recognized face image to the representative face image, and the representative face image is marked as the first matching representative face image; discarding time corresponding to the discarded to-be-recognized face image is recorded.
  • the discarding time is used as the first time of the last appearance of the first matching representative face image.
  • the discarding time of the to-be-recognized face image is close to the time of the to-be-recognized face image being collected.
  • the discarding time is used as the first time of the last appearance of the first matching representative face image, thus, a frequency of the first matching representative face image being collected is counted, and it is determined that at least part of positions in the first position information may still collect face images very similar to the first matching representative face image.
  • the first matching representative face image corresponds to at least one camera that may collect the first matching representative face image.
  • the first time of the last appearance of the first matching representative face image corresponds to the camera that collects the current to-be-recognized face iamge, and the camera corresponds to and has the first position information; and thus the first time is corresponded to the first position information and updated.
  • the operation furhter includes: in response to a time difference between the current time and the first time being greater than a preset period, the current database is acquired, a position of the first matching representative face image with a time difference greater than the preset period is compared to positions of all face images in the current database, to acquire multiple third position deviations.
  • the first matching representative face image with time difference greater than the preset period is maintained, and the first position information corresponding to the first matching representative face image with time difference greater than the preset period is updated; or, in response to all third position deviations being greater than or equal to the second threshold, the first matching representative face image with time difference greater than the preset period is deleted from the blacklist database.
  • the time difference between the current time and the first time is greater than the preset period, such as 7 days, 15 days, or 30 days, etc., which means that face images similar to the first matching representative face image has not been blocked again for a long time, and a static face image as a source of the first matching representative face image may have been removed.
  • the timeliness of the advertisement may make a spokesperson shoot different promotional posters, and the spokesperson may be changed. Therefore, with the time difference between the current time and the first time being greater than the preset period, the first matching representative face image may be deleted from the blacklist database, theoretically.
  • the representative face image collected by the cameras corresponding to the position is corrected, and the first position information corresponding to the first matching representative face image is updated; so that the camera corresponding to the position having not collected the first matching representative face image for a period over the preset period no longer blocks the first matching representative face image.
  • the blacklist database in order to improve rigor and accuracy of the face images in the blacklist database, if all cameras of the first position information corresponding to the first matching representative face images, have not collected the to-be-recognized images for a period over the preset period, wherein the to-be-recognized images have first position deviations less than the second threshold and are matched with the first matching representative face images, then before deleting the first matching representative face image, position comparison is performed on the face images in the database and the first matching representative face images, to acquire multiple third position deviations, and it is determined that whether at least one of the multiple third position deviations is less than the second threshold.
  • the first matching representative face image with a time difference greater than the preset period is maintained, and the first position information corresponding to the first matching representative face image is updated by position information corresponding to the face image with the third position deviation less than the second threshold. Therefore, it is applicable to the application scenario where the position information is used to extract part of the representative face images before the position comparison between the to-be-recognized face image and the representative face image.
  • the static face image moving a position or adding a position continue to keep the corresponding first matching representative face image in the blacklist database for filtering the face images; if all the third position deviation is greater than or equal to the second threshold, which means that the first matching representative face images have been removed or replaced, the first matching representative face image with time difference greater than the preset period are deleted from the blacklist database, to update the blacklist database continuously and reduce the storage pressure of the blacklist database.
  • the blacklist database may automatically add a representative face image corresponding to the newly placed static face image, to filter the static face images continuously.
  • first position information and the representative face image are extracted from the static face cluster for filtering the to-be-recognized face image during face recognition.
  • Position information is used to improve comparison efficiency, and first position information of the representative face images and the representative face images in the blacklist database are updated continuously, to keep the continuality of face recognition filtering.
  • FIG. 3 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
  • the electronic device 30 includes a memory 301 and a processor 302 that are mutually coupled, wherein the memory 301 stores program data (not shown in the figure) , the processor 302 invokes the program data to realize the method for filtering face images of any one of the above embodiments, please refer to the detailed description of the above methods and embodiments for the related statement, which will not be repeated herein.
  • FIG. 4 is a schematic structural view of a computer-readable non-transitory storage medium according to an embodiment of the present disclosure.
  • the computer-readable non-transitory storage medium 40 stores program data 400, the program data 400, when executed by a processor, implements the method for filtering face images of any one of the above embodiments please refer to the detailed description of the above methods and embodiments for the related statement, which will not be repeated herein.
  • the units illustrated as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, i.e., they may be located in one place or may be distributed to a plurality of network units. Some or all of these units may be selected according to practical needs to achieve the purpose of this implementation scheme.
  • each functional unit in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may be physically existed separately, or two or more units may be integrated into a single unit.
  • the above integrated units may be implemented either in the form of hardware or in the form of software functional units.
  • the integrated unit when implemented as a software functional unit and sold or used as a separate product, may be stored in a computer-readable non-transitory storage medium. It is understood that the technical solution of the present disclosure, or that part or all or part of the technical solution that essentially contributes to the prior art, may be embodied in the form of a software product that is stored in a storage medium and includes a number of instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc. ) or processor to perform all or some of the steps of the various implementations of the methods of the present disclosure.
  • a computer device which may be a personal computer, a server, or a network device, etc.
  • the aforementioned storage media include a USB flash drive, a removable hard disk, a read-only memory (ROM, Read-Only Memory) , a random access memory (RAM, Random Access Memory) , a disk, or a CD-ROM, and other media that may store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

A method for filtering face images, an electronic device, and a computer-readable non-transitory storage medium are provided by the present disclosure, including: acquiring a database storing face images, wherein each of a plurality of data sets in the database stores all face images belonging to one face; in response to a number of face images of at least one of the plurality of data sets being greater than a first threshold, extracting a representative face image from a data set with the number of face images being greater than the first threshold, and importing the representative face image to a blacklist database; acquiring a first position deviation by comparing, in response to acquiring a to-be-recognized face image, positions of the to-be-recognized face image and the representative face image in the blacklist database; determining whether the first position deviation being less than a second threshold; in response to the first position deviation being less than a second threshold, discarding the to-be-recognized face image; in response to the first position deviation being greater than or equal to a second threshold, adding the to-be-recognized face image to the database, and performing face clustering.

Description

METHOD FOR FILTERING FACE IMAGES, ELECTRONIC DEVICE, AND COMPUTER-READABLE NON-TRANSITORY STORAGE MEDIUM TECHNICAL FIELD
The present disclosure relates to the technical field of image processing, and in particular to a method for filtering face images, an electronic device, and a computer-readable non-transitory storage medium.
BACKGROUND
With the coming information age, an increasing number of static face images are present for advertisement on streets, such as advertising face images on posters are around every corner of a city; in a wide-open surveillance area, cameras would often collect a lot of static face images that are used for advertisement, and the static face images would be saved to a database; such that the database would store a huge number of static images without corresponding living bodies and without value for analysis.
In related arts, placement areas for static face images need to be manually marked, so as to ignore the face images in the placement areas; however, this requires updating and maintaining the placements areas manually, and faces of living bodies in the placement areas would be ignored as well, such that a process of face-image filtering becomes inaccurate. In view of this, how to automatically generate and update a blacklist database corresponding to the face images without value for analysis in the database and filter face images similar to representative face images in the blacklist database based on the blacklist database, becomes an urgent problem to be solved.
SUMMARY
The present disclosure provides a method for filtering face images, an electronic device, and a computer-readable non-transitory storage medium, which automatically generate and update a blacklist database corresponding to a database, and filter face images similar to representative face images in the blacklist database.
To solve the above problem, the present disclosure provides a method for filtering face images according to a first aspect of the present disclosure, the method includes: acquiring a database storing face images, wherein each of a plurality of data sets in the database stores all face images belonging to one face; in response to a number of face images of at least one of the plurality of data sets being greater than a first threshold, extracting a representative face image from a data  set with the number of face images being greater than the first threshold, and importing the representative face image to a blacklist database; acquiring a first position deviation by comparing, in response to acquiring a to-be-recognized face image, positions of the to-be-recognized face image and the representative face image in the blacklist database; determining whether the first position deviation being less than a second threshold; in response to the first position deviation being less than a second threshold, discarding the to-be-recognized face image; in response to the first position deviation being greater than or equal to a second threshold, adding the to-be-recognized face image to the database, and perfroming face clustering.
To solve the above problem, the present disclosure provides an electronic device according to a second aspect of the present disclosure, the electronic device includes: an electronic device comprising a processor and a memory coupled with each other, wherein the memory stores program data, and the processor executes the program data to perform the methods in the above described first aspect.
To solve the above problem, the present disclosure provides a computer-readable non-transitory storage medium according to a third aspect of the present disclosure, wherein the computer-readable non-transitory storage medium stores program data, when the program data is executed by a processor, performs the methods in the above described first aspect.
The benefits of the present disclosure is: in the present disclosure, a face-clustered database is acquired, and each of multiple datat sets in the database stores all face images belonging to one face; since a number of static face images is large and features of the static images are very similar, when a number of face images of any one of the data sets is greater than a first threshold, a representative face image in the data set with the number of face images being greater than the first threshold is extracted, and imported to a blacklist database, so that the representative face image corresponding to static face images is acquired, and the blacklist database is generated; when a to-be-recognized face image is acquired, the to-be-recognized face image and the representative face image are compared, to acquire first position deviations; when at least one frist position deviation is less than a second threshold, the representative face image are very similar to the to-be-recognized face image, and the to-be-recognized face image is discarded, to filter static face images; when all first position deviations are greater than or equal to the second threshold, face clustering is performed after the to-be-recognized face image is added to the blacklist database; in response to a newly placed static face image exsiting, after the number of face images corresponding to the newly placed face image being greater than thre first threshold, the blacklist database is updated automatically, such that automatic generation and update of the blacklist database corresponding to the database is realized, and filtering out  face images similar to the representative face images in the blacklist database.
BRIEF DESCRIPTION OF THE DRAWINGS
In order to make the technical solution described in the embodiments of the present disclosure more clear, the drawings used for the description of the embodiments will be briefly described. Apparently, the drawings described below are only for illustration but not for limitation. It should be understood that, one skilled in the art might acquire other drawings based on these drawings, without paying any creative efforts.
FIG. 1 is a flow chart of a method for filtering face images according to an embodiment of the present disclosure.
FIG. 2 is a flow chart of a method for filtering face images according to another embodiment of the present disclosure.
FIG. 3 is a schematic structural view of an electronic device according to an embodiment of the present disclosure.
FIG. 4 is a schematic structural view of a computer-readable non-transitory storage medium according to an embodiment of the present disclosure.
DETAILED DESCRIPTION
Technical solutions of the embodiments of the present disclosure may be clearly and comprehensively described by referring to accompanying figures of the embodiments. Obviously, embodiments to be described are only a part of, but not all of, the embodiments of the present disclosure. Any ordinary skilled person in the art may obtain other embodiments based on the embodiments of the present disclosure without any creative work, and the other embodiments should be included in the scope of the present disclosure.
Terminologies, such as “system” and “network” may be used exchangeably in the present disclosure; “and/or” is only used for a description of a relationship for related objects, to represent there may be three kinds of relationships, for example, A and/or B, may represent: individual A present, co-existing A and B, individual B present. In addition, a symbol “/” in the present disclosure, usually represents “or” relationship between a front and a back objects which are related. Also, “multiple” or “a plurality of” means two or more than two.
Please refer to FIG. 1, FIG. 1 is a flow chart of a method for filtering face images according to an embodiment of the present disclosure. The method includes actions or operations at blocks illustrated in FIG. 1.
At block S101: acquiring a database storing face images, wherein each of a plurality of  data sets in the database stores all face images belonging to one face.
Specifically, a face-clustered database is acquired, the database stores multiple data sets, and each data set stores at least one face image corresponding to one face.
In an application method, face clustering is performed on newly-added face images and existing face images in the database, face images belonging to one face are stored in one same data set; a data set is built individually for a unique face image, so that one face corresponds to one data set.
In a specific application scenario, a spokesperson endorses a variety of products, advertising posters corresponding to the variety of products are posted in a city. Posted face images on the advertising posters correpsonding to the variety of products are collected by cameras, different posted face images of the same spokesperson are stored in a corresponding data set. When the spokesperson comes to the city for events, the cameras collect face images of a living-body spokesperson, and the face images of the living-body spokesperson are also stored in the data set corresponding to the spokesperson, such that one face corresponds to one data set.
At block S102: in response to a number of at least face images of one of the plurality of data sets being greater than a first threshold, extracting a representative face image from a data set with the number of face images being greater than the first threshold, and importing the representative face image to a blacklist database.
Specifically, a frequency for collecting static face images for advertisement is relatively high, and a number of the collected static face images is relatively large; and the static face images are targets of non-living-body, a same static face image when being collected has difference in angles and lighting, but features of the same static face image are very similar. Therefore, when static face images are placed in a surveillance area, cameras may collect a large number of static face images.
Furthermore, when face images in the database are clustered, and a number of face images corresponding to one face in the data set is greater than the first threshold; then, the data set may include a huge number of static face images and causes the number being greater than the first threshold. Comparisons between face images are performed in the data set with the number being greater than the first threshold, such that a representative face image is extracted and added to a blacklist database. The first threshold may be any integer between 100 to 1000, such as 100, 500, or 1000, etc., which will not be limited by the present disclosure, and the first threshold may be customized by a user.
In an application method, when the number of face images in the data set is greater than the first threshold, face angles of every two face images of all face images in the data set are compared,  to acquire angle comparison results. Face images with angle comparison results less than an angle threshold are clustered into one static face cluster, to cluster at least some face images of the data set into one static face cluster, and a face image is selected from the static face cluster as a representative face image.
In another applicaiton method, when the number of face images in the data set is greater than the first threshold, key-point positions of all face images in the data set are extracted, wherein the key points at least include at least part of a mouth, a tip of a nose, corners of eyes on both sides, and auricles. Key-point coordinates corresponding to face image are constructed based on the key points of every face image, and perspective transformations are performed on key-point coordinates of every two face images respectively, to allow key-point coordinates to be of same size after zooming and shifting. Two face images are compared based on and after the perspective transformations, to acquire a second position deviation between every two face images.
In an application scenario, face images of advertisement have characteristics of large number and widespread, and a same batch of advertising face images uses a same static face image. When advertising face images are around every corner of the city, the frequency of collecting advertising face images for the cameras may be very high, so that the number of face images corresponding to the advertising face images in the data set may very soon be greater than the first threshold; and when the number of face images in the data set is greater than the first threshold, positions of key points between every two face images in the data set are compared, and the face images with position comparison results being less than a position threshold, are clustered to one static face cluster.
Specifically, assuming a spokesperson endorses an advertisement A and an advertisement B, then static face images on the advertisement A and the advertisement B are usually not the same poster. Positions of key points of the face images corresponding to advertisement A and advertisement B respectively must be varied greatly, such that after positions of key points of every two face images in the data set being compared, the face image corresponding to advertisement A may be clustered into one static face cluster, and the face image corresponding to advertisement B may be clustered into another static face cluster. A face image is extracted from each static face cluster as a representative face image, and then imported to a blacklist database, for the purpose of filtering face images later.
At block S103: acquiring a first position deviation by comparing, in response to acquiring a to-be-recognized face image, positions of the to-be-recognized face image and the representative face image in the blacklist database.
Specifically, the to-be-recognized face image is acquired after the blacklist database is  generated, and then perspective transformation and position comparison are performed based on the key points of the to-be-recognized face image and the key points of the representative face image in the blacklist database, so as to acquire the first position deviation.
In an application method, key points of to-be-recognized face image and key points of all representative face images in the blacklist database are extracted, to perform comparisons on the positions of key points, and to acquire the first position deviations of the to-be-recognized face image relative to all representative face images.
In another application method, after adding the representative face image to the blacklist database, position information of all face images in the static face cluster corresponding to the representative face image and the representative face image are added to the blacklist database, to acquire distance difference between the position of the to-be-recognized face image and the position of the representative face image. Representative face images with distance differences being within a distance threshold are extracted, and comparisons positions of key points between the to-be-recognized face image and the extracted representative face images are performed. As a result, the first position deviations of the to-be-recognized face image respectively relative to at least some representative face images could be acquired, thereby reducing the number of times for comparisons, and increasing comparing efficiency.
At block S104: determining whether the first position deviation being less than a second threshold.
Specifically, when the first position deviation is less than the second threshold, go to operation of block S105; when the first position deviation is greater than or equal to the second threshold, go to operation of block S106.
At block S105: discarding the to-be-recognized face image.
Specifically, when the the first position deviation is within the second threshold, positions of key points of the representative face image and the to-be-recognized face image are very close; the to-be-recognized face image and the corresponding representative face images are determined to be from a same static face image, so that the current to-be-recognized face image is blocked and filtered. The current to-be-recognized face image is not added to the database, and face images without value for analysis are reduced for the database.
At block S106: adding the to-be-recognized face image to the database, and performing face clustering.
Specifically, when the first position deviation is greater than or equal to the second threshold, the current to-be-recognized face image is added to the database, and is clustered with the face images in the database, to maintain the database in a status of having all face images  corresponding to one face are clustered into one data set.
Understandably, when a new static face image is placed for promotional purposes, the number of face images in the data set corresponding to the newly placed static face image may be accumulated and very soon be greater than the first threshold, and the blacklist database may automatically add a representative face image corresponding to the newly placed static face image, to realize filtering the static face images continuously.
In the above method, a face-clustered database is acquired, and each of the plurality of datat sets in the database stores all face images belonging to one face. Since a number of static face images is large and features of the static images are very similar, when a number of face images of at least one of the plurality of data sets is greater than a first threshold, a representative face image in the data set with the number of face images being greater than the first threshold is extracted, and imported to a blacklist database, so that the representative face image corresponding to static face images is acquired, and the blacklist database is generated. When a to-be-recognized face image is acquired, the to-be-recognized face image and the representative face image are compared to acquire a first position deviation. When the frist position deviation is less than a second threshold, the representative face image is very similar to the to-be-recognized face image, and the to-be-recognized face image is discarded, to filter static face images. When the first position deviation is greater than or equal to the second threshold, face clustering is performed after the to-be-recognized face image is added to the blacklist database; in response to a newly placed static face image exsiting, after the number of face images corresponding to the newly placed face image being greater than thre first threshold, the blacklist database is updated automatically, such that automatic generation and update of the blacklist database corresponding to the database is realized, and filtering out face images similar to the representative face images in the blacklist database.
Please refer to FIG. 2, FIG. 2 is a flow chart of a method for filtering face images according to another embodiment of the present disclosure. The method includes actions or operations at blocks illustrated in FIG. 2.
At block S201: acquiring a database storing face images, wherein each of a plurality of data sets in the database stores all face images belonging to one face.
Specifically, for every newly added face image in the database, face clustering is performed on the newly added face image and the existed face images in the databse, such that all face images corresponds to one face are always clustered into one data set.
At block S202: in response to a number of face images of at least one of the plurality of data sets being greater than a first threshold, acquiring a plurality of second position deviations by  comparing positions for every two face images in the data set with the number of face images being greater than the first threshold.
Specifically, when the number of at least one of the data sets is greater than the first threshold, key points of all face images in the data set with the number of face images being greater than the first threshold are extracted. Position comparison is performed on the key points of every two face images to acquire second position deviations, wherein the position of key points at least includes at least part of a mouth, a tip of a nose, corners of eyes on both sides, and auricles.
In an application method, key points of every two face images are extracted to acquire key-point coordinates corresponding to the every two face images; perspective transformations are performed on the key-point coordinates corresponding to the every two face images respectively to acquire the plurality of second position deviations between the every two face images.
Specifically, after acquiring a face image, key points of the face image are extracted, and the top left corner of the face image is used as an origin, key-point coordinates corresponding to the face image is constructed. After acquiring key-point coordinates corresponding to every two face images, perspective transformations are performed on the key-point coordinates corresponding to the every two face images respectively, to allow key-point coordinates to be of same size after zooming and shifting; two face images are compared based on and after the perspective transformations, to acquire a second position deviation between the two face images.
Furthermore, when the number of face images in the data set is greater than the first threshold, then the data set may include a static face image that has been collected repeatedly; since the same static face image, when being collected by cameras, may have varied features due to angles and lighting, etc., face images may be analyzed by face feature matching, but in comparison to the face feature matching, position comparison has better robustness with respect to angles and lighting, etc., based on the key points of the face images, and the processing time is far lower than the processing time of using face feature matching.
At block S203: clustering, based on the plurality of second position deviations, face images into at least one static face cluster by applying a clustering algorithm, wherein the face images belong to the data set with the number of face images being greater than the first threshold.
Specifically, a third threshold corresponding to the plurality of second position deviations is set; the plurality of second position deviations are used as distances, and clustering is performed on the face images in the data set with number of face images being greater than the first threshold by applying a clustering algorithm, to acquire multiple face clusters; a face cluster with multiple face images is used as a static face cluster, and the plurality of second position deviations between the face images in the same static face cluster are less than the second threshold. The clustering  algorithm includes, but not limited to, hierarchical clustering and density clustering.
In an application method, by applying the clustering algorithm, face images with second position deviations less than the third threshold are clustered to one face cluster, to acquire at least one face cluster; a face cluster with the number of face images greater than or equal to a fourth threshold in face clusters is used as a static face cluster, such that at least some face images in the data set are clustered into one static face cluster.
Specifically, by applying the clustering algorithm, face images with second positions less than the third threshold are clustered into one face cluster, to allow the face cluster to include multiple face images; when the number of face images in the face cluster is greater than the fourth threshold, the face cluster with the number of face images greater than the fourth threshold is used as the static face cluster.
Furthermore, since there is a possibility for face images of living body having second position deviations between each other being within the third threshold; however, though living-body face images are clustered into one face cluster, the number of face images in the face cluster corresponding to the living-body face images, is far less than the number of face images in the face cluster corresponding to static face images, and if the number of face images in the face cluster corresponding to static face images is large, then it may be greater than the fourth threshold; such that a face cluster with the number of face images greater than the fourth threshold in the face clusters is used as the static face cluster, such that at least some face images in the data set are clustered into one static face cluster.
In an application scenario, the fourth threshold is set to be an integer greater than or equal to 2, such as 4; when the number of face images in one face cluster is 5, then the face cluster is determined to include multiple face images belonging to one static face image, and the face cluster is used as static face cluster.
In another application scenario, the fourth threshold may be self-adjusted according to the first threshold, for example, when the first threshold is less than or equal to 100, the fourth threshold is set to be 5; when the first threshold is greater than 1000, the fourth threshold is set to be 50; when the first threshold is between 100 and 1000, the fourth threshold is set to be one twentieth of the first threshold.
Specifically, when the data set includes face images of a plurality of static face images, based on the second position deviations, face images from different static face images may be clustered to their corresponding face clusters, and the number of face images in the face clusters may be greater than the fourth threshold, and may be used as static face clusters; and face clusters corresponding to the face images of living-body face images, are filtered out because the number  of the face images is less than or equal to the fourth threshold. For example, when a spokesperson endorses advertisement A and advertisement B, face images from the advertisement A and the advertisement B are clustered into one face cluster, and the number of face images of the face cluster is greater than the fourth threshold, then the face cluster is used as a static face cluster. Even living-body face images corresponding to the spokesperson are clustered into the face cluster, the number of face images in the face cluster would be less than or equal to the fourth threshold, and the face cluster is not used as a static face cluster, so that an accuracy of acquiring static face images such as advertising face images is increased.
At block S204: extracting the representative face image from the at least one static face cluster, and importing the representative face image to the blacklist database.
Specifically, one face image is extracted from the static face cluster as a representative face image, and imported to the blacklist database, to block and filter face images that show up later with a high resemblance.
In an application method, first position information of all face images in the static face cluster is extracted; a sum of second position deviations of any one of face images relative to other face images in the static face cluster is acquired for every face image; the face image with the least sum is used as a representative face image, and the representative face image and the first position information of the static face cluster corresponding to the representative face image are imported to the blacklist database.
Specifically, an addition is performed on the plurality of second position deviations of any one of face images relative to every other face image in the static face cluster, to acquire a sum of the plurality of second position deviations, and the face image with the least sum is used as a representative face image corresponding to the static face cluster, wherein the face image with the least sum is equivalent to a face image that has the least sum of deviations relative to other face images with different angles and lighting, thus, the face image with the least sum as a representative face image is the most representative, and filtering for the subsequent face recognition is more accurate.
Furthermore, position information of all face images in the static face cluster is extracted respectively, to acquire first position information corresponding to the static face image, wherein the first position information includes position information of all cameras for collecting face images in the static face cluster, such as a serial number of a camera; the representative face image and first position information of all the face images in the static face cluster corresponding to the representative face image are imported to the blacklist database together.
At block S205: deleting all face images of the at least one static face cluster from the  database.
Specifically, after acquiring first position information corresponding to the static face cluster and selecting a representative face image, all face images in the static face cluster are deleted, to optimize the data in the database.
Second position deviations between face images in the static face cluster are less than the third threshold, and the number of face images in the static face cluster is greater than the fourth threshold. Thus, there are multiple face images of one static face image in the static face cluster; all face images in the static face cluster are deleted from the database, such that when a user invokes the database, a large number of face images without value for analysis is avoided to be seen.
At block S206: acquiring a first position deviation by comparing positions of a to-be-recognized face image with the representative face image in the blacklist database, in response to acquiring the to-be-recognized face image.
Specifically, key points of the to-be-recognized face image and the representative image in the blacklist database are extracted, so as to acquire key-point coordinates corresponding to the to-be-recognized face image and the representative image; perspective transformations are performed on key-point coordinates of the to-be-recognized face image and the representative image respectively, to acquire the first position deviation between the to-be-recognized face image and the representative image.
Optionally, before acquiring a first position deviation by comparing positions of a to-be-recognized face image with the representative face image in the blacklist database, in response to acquiring the to-be-recognized face image, the operation furhter includes: second position information of the to-be-recognized face image is acquired; the first position information matching with the second position information is searched for; a representative face image corresponding to the first position information matching with the second position information is extracted from the blacklist database.
Specifically, the second position information of the to-be-recognized face image is acquired, the second position information includes position information of the cameras for collecting the to-be-recognized face image, the first position information matching with the second position information is searched for, all representative face images in the blacklist database coorespoding to the camera are extracted, the first position information of the camera matches with the second position information.
In an application method, first position information and second position information are represented using longitudes and latitudes. The first position information corresponds to different cameras in different longitudes and latitudes. One camera may correspond to multiple  representative face images. The second position information of the to-be-recognized face image is extracted, the second position information is matched with all first position information to acquire the matched first position information and a first camera corresponding to the matched first position information. All representative face images corresponding to a first camera are extracted from the blacklist database, to realize performing position comparisons on some selected representative images according to position information, and improve comparison efficiency and reduce consumption during the comparison process.
At block S207: determining whether the first position deviation being less than a second threshold.
Specifically, when the first position deviation is less than the second threshold, the to-be-recognized face image is very similar to a representative face image, the to-be-recognized face is within the blocking range of the blacklist database, operation S208 follows, when all first position deviations are greater than or equal to the second threshold, the to-be-recognized face image is not similar to any representative face image in the blacklist database, and operation S209 follows.
At block S208: discarding the to-be-recognized face image.
Specifically, the to-be-recognized face image is blocked and discarded, to filter out the to-be-recognized face image and avoid adding a face image without value for analysis to the database.
In an application method, the to-be-recognized face image is discarded; a representative face image with position comparison result within the first position deviations is extracted, the position comparison result is acquired by comparing the discarded to-be-recognized face image to the representative face image, and the representative face image is used as a first matching representative face image; discarding time corresponding to the discarded to-be-recognized face image is recorded, and the discarding time is used as a first time of a last appearance of the first matching representative face image.
Specifically, when the to-be-recognized face image is discarded, the representative face image with position comparison result within the first position deviation is extracted, the position comparison result is acquired by comparing the discarded to-be-recognized face image to the representative face image, and the representative face image is marked as the first matching representative face image; discarding time corresponding to the discarded to-be-recognized face image is recorded.
Furthermore, the discarding time is used as the first time of the last appearance of the first matching representative face image. The discarding time of the to-be-recognized face image is  close to the time of the to-be-recognized face image being collected. The discarding time is used as the first time of the last appearance of the first matching representative face image, thus, a frequency of the first matching representative face image being collected is counted, and it is determined that at least part of positions in the first position information may still collect face images very similar to the first matching representative face image.
In an application scenario, the first matching representative face image corresponds to at least one camera that may collect the first matching representative face image. In response to the first position deviation between the current to-be-recognized face image and the first matching representative face image being less than the second threshold, the first time of the last appearance of the first matching representative face image corresponds to the camera that collects the current to-be-recognized face iamge, and the camera corresponds to and has the first position information; and thus the first time is corresponded to the first position information and updated.
Optionally, after discarding the to-be-recognized face image, the operation furhter includes: in response to a time difference between the current time and the first time being greater than a preset period, the current database is acquired, a position of the first matching representative face image with a time difference greater than the preset period is compared to positions of all face images in the current database, to acquire multiple third position deviations. In response to at least one third position deviation being less than the second threshold, the first matching representative face image with time difference greater than the preset period is maintained, and the first position information corresponding to the first matching representative face image with time difference greater than the preset period is updated; or, in response to all third position deviations being greater than or equal to the second threshold, the first matching representative face image with time difference greater than the preset period is deleted from the blacklist database.
If the time difference between the current time and the first time is greater than the preset period, such as 7 days, 15 days, or 30 days, etc., which means that face images similar to the first matching representative face image has not been blocked again for a long time, and a static face image as a source of the first matching representative face image may have been removed. Taking advertisement placement as an example, the timeliness of the advertisement may make a spokesperson shoot different promotional posters, and the spokesperson may be changed. Therefore, with the time difference between the current time and the first time being greater than the preset period, the first matching representative face image may be deleted from the blacklist database, theoretically.
In an application scenario, based on the first position information corresponding to the first time, it is determined that the camera corresponding to a position have not collected the first  matching representative face image for a period over the preset period, then the representative face image collected by the cameras corresponding to the position is corrected, and the first position information corresponding to the first matching representative face image is updated; so that the camera corresponding to the position having not collected the first matching representative face image for a period over the preset period no longer blocks the first matching representative face image. Further, in order to improve rigor and accuracy of the face images in the blacklist database, if all cameras of the first position information corresponding to the first matching representative face images, have not collected the to-be-recognized images for a period over the preset period, wherein the to-be-recognized images have first position deviations less than the second threshold and are matched with the first matching representative face images, then before deleting the first matching representative face image, position comparison is performed on the face images in the database and the first matching representative face images, to acquire multiple third position deviations, and it is determined that whether at least one of the multiple third position deviations is less than the second threshold.
Specifically, if at least one of the multiple third position deviations is less than the second threshold, which means that the database has a face image that are missed and similar to the first matching representative face image, the first matching representative face image with a time difference greater than the preset period is maintained, and the first position information corresponding to the first matching representative face image is updated by position information corresponding to the face image with the third position deviation less than the second threshold. Therefore, it is applicable to the application scenario where the position information is used to extract part of the representative face images before the position comparison between the to-be-recognized face image and the representative face image. After the static face image moving a position or adding a position, continue to keep the corresponding first matching representative face image in the blacklist database for filtering the face images; if all the third position deviation is greater than or equal to the second threshold, which means that the first matching representative face images have been removed or replaced, the first matching representative face image with time difference greater than the preset period are deleted from the blacklist database, to update the blacklist database continuously and reduce the storage pressure of the blacklist database.
At block S209: adding the to-be-recognized face image to the database, and performing face clustering.
Specifically, perform face clustering on the current to-be-recognized face image and face images in the database, to maintain the database in a status of having all face images corresponding to one face being clustered into one data set. According to the method of the present embodiment,  when a new static face image is placed for promotional purposes, the number of face images in the data set corresponding to the newly placed static face image may be accumulated and very soon be greater than the first threshold, and the blacklist database may automatically add a representative face image corresponding to the newly placed static face image, to filter the static face images continuously.
In the present embodiment, when the number of face images of a data set in the database is greater than the first threshold, perspective transformation is performed on the key-point coordinates of the face images in the data set, to accurately acquire face images belonging to the same static face image in the data set, and add the face images to a static face cluster; first position information and the representative face image are extracted from the static face cluster for filtering the to-be-recognized face image during face recognition. Position information is used to improve comparison efficiency, and first position information of the representative face images and the representative face images in the blacklist database are updated continuously, to keep the continuality of face recognition filtering.
Please refer to FIG. 3, FIG. 3 is a schematic structural view of an electronic device according to an embodiment of the present disclosure. The electronic device 30 includes a memory 301 and a processor 302 that are mutually coupled, wherein the memory 301 stores program data (not shown in the figure) , the processor 302 invokes the program data to realize the method for filtering face images of any one of the above embodiments, please refer to the detailed description of the above methods and embodiments for the related statement, which will not be repeated herein.
Please refer to FIG. 4, FIG. 4 is a schematic structural view of a computer-readable non-transitory storage medium according to an embodiment of the present disclosure. The computer-readable non-transitory storage medium 40 stores program data 400, the program data 400, when executed by a processor, implements the method for filtering face images of any one of the above embodiments please refer to the detailed description of the above methods and embodiments for the related statement, which will not be repeated herein.
It should be noted that, the units illustrated as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, i.e., they may be located in one place or may be distributed to a plurality of network units. Some or all of these units may be selected according to practical needs to achieve the purpose of this implementation scheme.
In addition, each functional unit in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may be physically existed separately, or two or more units may be integrated into a single unit. The above integrated units may be  implemented either in the form of hardware or in the form of software functional units.
The integrated unit, when implemented as a software functional unit and sold or used as a separate product, may be stored in a computer-readable non-transitory storage medium. It is understood that the technical solution of the present disclosure, or that part or all or part of the technical solution that essentially contributes to the prior art, may be embodied in the form of a software product that is stored in a storage medium and includes a number of instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc. ) or processor to perform all or some of the steps of the various implementations of the methods of the present disclosure. The aforementioned storage media include a USB flash drive, a removable hard disk, a read-only memory (ROM, Read-Only Memory) , a random access memory (RAM, Random Access Memory) , a disk, or a CD-ROM, and other media that may store program code.
The above are only embodiments of the present disclosure, and not to limit the scope of the present disclosure. Any equivalent structure or equivalent process transformation using the specification of the present disclosure and the accompanying drawings, or applied directly or indirectly in other related technical fields, are included in the scope of patent protection of the present disclosure.

Claims (11)

  1. A method for filtering face images, comprising:
    acquiring a database storing face images, wherein each of a plurality of data sets in the database stores all face images belonging to one face;
    in response to a number of face images of at least one of the plurality of data sets being greater than a first threshold, extracting a representative face image from a data set with the number of face images being greater than the first threshold, and importing the representative face image to a blacklist database;
    acquiring a first position deviation by comparing, in response to acquiring a to-be-recognized face image, positions of the to-be-recognized face image and the representative face image in the blacklist database;
    determining whether the first position deviation being less than a second threshold;
    in response to the first position deviation being less than a second threshold, discarding the to-be-recognized face image; in response to the first position deviation being greater than or equal to a second threshold, adding the to-be-recognized face image to the database, and perfroming face clustering.
  2. The method as claimed in claim 1, wherein the in response to a number of face images of at least one of the plurality of data sets being greater than a first threshold, extracting a representative face image from a data set with the number of face images being greater than the first threshold, and importing the representative face image to a blacklist database comprises:
    acquiring a plurality of second position deviations by comparing positions for every two face images in the data set with the number of face images being greater than the first threshold;
    clustering, based on the plurality of second position deviations, face images into at least one static face cluster by applying a clustering algorithm, wherein the face images belong to the data set with the number of face images being greater than the first threshold;
    extracting the representative face image from the at least one static face cluster, and importing the representative face image to the blacklist database.
  3. The method as claimed in claim 2, wherein the acquiring a plurality of second position deviations by comparing positions for every two face images in the data set with the number of face images being greater than the first threshold comprises:
    acquiring key-point coordinates corresponding to the every two face images by extracting key points of the every two face images;
    acquiring the plurality of second position deviations between the every two face images by performing a perspective transformation on the key-point coordinates corresponding to the every two face images respectively.
  4. The method as claimed in claim 2, wherein the clustering, based on the second position deviations, face images into at least one static face cluster by applying a clustering algorithm, wherein the face images belong to the data set with the number of face images being greater than the first threshold comprises:
    acquiring at least the one face cluster by clustering face images with the second position deviations less than a third threshold into one face cluster by applying the clustering algorithm;
    clustering at least some face images in the data set into the at least one static face cluster by taking a face cluster with a number of face images being greater than a fourth threshold as a static face cluster.
  5. The method as claimed in claim 2, wherein the extracting the representative face image from the at least one static face cluster, and importing the representative face image to the blacklist database comprises:
    extracting first position information of all the face images in the static face cluster;
    acquiring a sum of the second position deviations of each of the face images relative to the other face images in the at least one static face cluster;
    taking a face image with a least sum as the representative face image, and importing the representative face image and the first position information of the static face cluster corresponding to the representative face image to the blacklist database.
  6. The method as claimed in claim 2, after the extracting the representative face image from the at least one static face cluster, and importing the representative face image to the blacklist database further comprising:
    deleting all face images of the at least one static face cluster from the database.
  7. The method as claimed in claim 5, before the acquiring a first position deviation by comparing, positions of the to-be-recognized face image and the representative face image in the blacklist database, further comprising:
    acquiring second position information corresponding to the to-be-recognized face image;
    searching for first position information matching with the second position information, and extracting a representative face image corresponding to the first position information matching with the second position information from the blacklist database.
  8. The method as claimed in claim 5, wherein the discarding the to-be-recognized face image comprises:
    discarding the to-be-recognized face image, extracting a representative face image having a position comparison result with the discarded to-be-recognized face image within the first position deviation; and taking the representative face as a first matching representative face image;
    recording a discarding time of the discarded to-be-recognized face image, and taking the discarding time as a first time of latest appearance of the first matching representative face image.
  9. The method as claimed in claim 8, after the discarding the to-be-recognized face image further comprising:
    in response to a time difference between a current time and the first time being greater than a preset period, acquiring a current database, comparing first matching representative face images having time differences being greater than the preset period with all face images in the current database, to acquire a plurality of third position deviations;
    in response to some of the third position deviations being less than the second threshold, retaining the first matching representative face image with a time difference being greater than the preset period; or, in response to all the third position deviations being greater than or equal to the second threshold, deleting the first matching representative face image with a time difference being greater than the preset period from the blacklist database.
  10. An electronic device comprising a processor and a memory coupled with each other, wherein the memory stores program data, and the processor executes the program data to perform the method of any one of claims 1 to 9.
  11. A computer-readable non-transitory storage medium storing program data, wherein the program data, when executed by a processor, performs the method of any one of claims 1 to 9.
PCT/CN2021/128514 2021-07-13 2021-11-03 Method for filtering face images, electronic device, and computer-readable non-transitory storage medium WO2023284181A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110791776.X 2021-07-13
CN202110791776.XA CN113255621B (en) 2021-07-13 2021-07-13 Face image filtering method, electronic device and computer-readable storage medium

Publications (1)

Publication Number Publication Date
WO2023284181A1 true WO2023284181A1 (en) 2023-01-19

Family

ID=77191177

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/128514 WO2023284181A1 (en) 2021-07-13 2021-11-03 Method for filtering face images, electronic device, and computer-readable non-transitory storage medium

Country Status (2)

Country Link
CN (1) CN113255621B (en)
WO (1) WO2023284181A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113255621B (en) * 2021-07-13 2021-11-16 浙江大华技术股份有限公司 Face image filtering method, electronic device and computer-readable storage medium
CN114067421B (en) * 2022-01-17 2022-04-19 广东中运信息科技有限公司 Personnel duplicate removal identification method, storage medium and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017162409A (en) * 2016-03-11 2017-09-14 ヤンマー株式会社 Recognizing device, and method, for facial expressions and motions
CN111401300A (en) * 2020-04-07 2020-07-10 浙江大华技术股份有限公司 Face clustering archiving method and device and storage medium
CN111639689A (en) * 2020-05-20 2020-09-08 杭州海康威视系统技术有限公司 Face data processing method and device and computer readable storage medium
CN113255621A (en) * 2021-07-13 2021-08-13 浙江大华技术股份有限公司 Face image filtering method, electronic device and computer-readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017162409A (en) * 2016-03-11 2017-09-14 ヤンマー株式会社 Recognizing device, and method, for facial expressions and motions
CN111401300A (en) * 2020-04-07 2020-07-10 浙江大华技术股份有限公司 Face clustering archiving method and device and storage medium
CN111639689A (en) * 2020-05-20 2020-09-08 杭州海康威视系统技术有限公司 Face data processing method and device and computer readable storage medium
CN113255621A (en) * 2021-07-13 2021-08-13 浙江大华技术股份有限公司 Face image filtering method, electronic device and computer-readable storage medium

Also Published As

Publication number Publication date
CN113255621B (en) 2021-11-16
CN113255621A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
WO2023284181A1 (en) Method for filtering face images, electronic device, and computer-readable non-transitory storage medium
CN109376596B (en) Face matching method, device, equipment and storage medium
CN110704411B (en) Knowledge graph building method and device suitable for art field and electronic equipment
CN110083639B (en) Intelligent data blood source tracing method and device based on cluster analysis
US9665773B2 (en) Searching for events by attendants
CN105550375A (en) Heterogeneous data integrating method and system
CN111709303A (en) Face image recognition method and device
WO2023236514A1 (en) Cross-camera multi-object tracking method and apparatus, device, and medium
CN115858861A (en) Video compression method, electronic device and computer-readable storage medium
CN115982346A (en) Question-answer library construction method, terminal device and storage medium
US10007692B2 (en) Partition filtering using smart index in memory
CN115544214B (en) Event processing method, device and computer readable storage medium
CN112446361A (en) Method and equipment for cleaning training data
WO2018222072A1 (en) Method of indexing video data for faceted classification
CN111190902A (en) Medical data structuring method, device, equipment and storage medium
CN114333039B (en) Method, device and medium for clustering human images
CN115082999A (en) Group photo image person analysis method and device, computer equipment and storage medium
CN111242978A (en) Biological behavior track analysis system based on infrared camera technology
CN107704609B (en) Video content retrieval method and device, computer-readable storage medium and terminal
CN107809613B (en) Video index creation method and device, computer readable storage medium and terminal
CN111209330A (en) Method and system for identifying consistent actor
CN111680059B (en) Analysis method and system for active personnel and resident personnel based on specific area
CN107766422A (en) A kind of mapping method and equipment of data of registering
CN111949839B (en) Data association method, electronic device and medium
Gao et al. An efficient video indexing and retrieval algorithm using the luminance field trajectory modeling

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE