CN116258881A - Image clustering method, device, terminal and computer readable storage medium - Google Patents

Image clustering method, device, terminal and computer readable storage medium Download PDF

Info

Publication number
CN116258881A
CN116258881A CN202211600236.XA CN202211600236A CN116258881A CN 116258881 A CN116258881 A CN 116258881A CN 202211600236 A CN202211600236 A CN 202211600236A CN 116258881 A CN116258881 A CN 116258881A
Authority
CN
China
Prior art keywords
face
image
clustered
images
image set
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202211600236.XA
Other languages
Chinese (zh)
Inventor
王凯垚
陈立力
周明伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
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
Priority to CN202211600236.XA priority Critical patent/CN116258881A/en
Publication of CN116258881A publication Critical patent/CN116258881A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • G06V20/53Recognition of crowd images, e.g. recognition of crowd congestion
    • 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/103Static body considered as a whole, e.g. static pedestrian or occupant recognition
    • 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
    • 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
    • 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/172Classification, e.g. identification

Landscapes

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

Abstract

The invention provides an image clustering method, an image clustering device, a terminal and a computer readable storage medium, wherein images to be clustered and a historical image set are acquired in the image clustering method; dividing a body image set into at least two sub-image sets based on a photographing angle of a target in the body image; determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold; determining to attribute the face images to be clustered to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold; and merging the face images to be clustered and the updated image sets to which the body images to be clustered respectively belong based on the association relation between the face images to be clustered and the body images to be clustered. The image clustering method and device have the advantages that the image clustering accuracy is guaranteed, and meanwhile the recall rate of image clustering is improved.

Description

Image clustering method, device, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of image clustering technologies, and in particular, to an image clustering method, an image clustering device, a terminal, and a computer readable storage medium.
Background
With rapid development of technology, cameras in cities are spread over streets and lanes, and portrait files become an important means for solving a case. According to the portrait tracks in the portrait files, reproduction of all the portrait tracks in the area can be realized, so that the key area is monitored. Most of existing portrait clustering technologies are based on deep learning technology, body feature vectors of pictures are extracted, and the similarity between the pictures is calculated according to the body feature vectors to perform portrait clustering, but due to the fact that the snapshot angles and the snapshot definitions in different scenes are different, the phenomenon that the similarity between the portrait picture of the same person and historical pictures in files is low exists, most of existing strategies are based on the characteristics of all pictures in files to obtain average mass centers of the files, and similarity calculation is performed according to the average mass centers and the pictures which need to participate in clustering, but recall rate is low.
Disclosure of Invention
The invention mainly solves the technical problem of providing an image clustering method, an image clustering device, a terminal and a computer readable storage medium, and solves the problem of lower recall rate of portrait clustering in the prior art.
In order to solve the technical problems, the first technical scheme adopted by the invention is as follows: an image clustering method is provided, the image clustering method comprises the following steps:
acquiring an image to be clustered and a historical image set, wherein the image to be clustered comprises face images to be clustered and body images to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, and each body image set comprises body images of a plurality of targets;
dividing a body image set into at least two sub-image sets based on a photographing angle of a target in the body image;
determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold;
determining to attribute the face images to be clustered to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold;
and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
Wherein, based on the association relationship between the face image to be clustered and the body image to be clustered, before the step of merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs, the method further comprises:
determining an updated face centroid of the updated face image set based on the face images in the updated face image set and the face images to be clustered;
in response to the fact that the third similarity between the face image or the face image to be clustered and the updated face centroid is smaller than a third similarity threshold, removing the face image or the face image to be clustered corresponding to the third similarity;
determining an updated body centroid of the updated body image set based on the body images in the updated body image set and the body images to be clustered;
and in response to the fourth similarity between the body image or the body image to be clustered and the updated body centroid being less than the fourth similarity threshold, rejecting the body image or the body image to be clustered corresponding to the fourth similarity.
The method comprises the steps of obtaining an image to be clustered and a historical image set, wherein the image to be clustered comprises face images to be clustered and body images to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, each body image set comprises body images of a plurality of targets, and the method comprises the following steps:
Acquiring a plurality of human body images to be clustered, wherein the human body images to be clustered are images containing target objects;
and detecting and extracting the body and the face of the human body image to be clustered to obtain the human face image to be clustered and the body image to be clustered, which have association relations.
Wherein, based on the shooting angle of the target in the body image, divide the body image set into at least two sub-image sets, include:
dividing a body image in the body image set into three sub-image sets based on shooting angles of targets in the body image, wherein the shooting angles of the targets contained in each sub-image set are in a corresponding preset angle range; wherein the three sub-image sets include a front body sub-image set, a side body sub-image set, and a back body sub-image set.
Wherein determining that the body image to be clustered is attributed to the body image set to obtain an updated body image set in response to the first similarity between the body image to be clustered and the sub-image set exceeding a first similarity threshold comprises:
respectively extracting features of the body images to be clustered and the body images to obtain body feature information respectively corresponding to the body images to be clustered and the body images;
determining the body mass center corresponding to each sub-image set based on the body characteristic information of the body image contained in each sub-image set;
Comparing the first similarity corresponding to the body characteristic information of the body images to be clustered and the body mass center corresponding to each sub-image set with a first similarity threshold;
and determining that the body images to be clustered are attributed to the body image set to obtain an updated body image set in response to the first similarity between the body characteristic information of the body images to be clustered and the body centroid corresponding to the at least one sub-image set being not less than a first similarity threshold.
Wherein, based on the body characteristic information of the body image contained in each sub-image set, determining the body mass center corresponding to each sub-image set comprises:
based on the body characteristic information of each body image in the sub-image set, calculating to obtain the similarity between the body images;
the body centroid of the sub-image set is determined based on body characteristic information of each body image in the sub-image set and a similarity corresponding to the body image.
Wherein determining the body centroid of the sub-image set based on the body characteristic information of each body image in the sub-image set and the similarity corresponding to the body image comprises:
comparing the similarity between the body images to a similarity threshold;
deleting the similarity corresponding to the body image in response to the similarity being less than the similarity threshold;
Responding to the similarity not smaller than the similarity threshold, and reserving the similarity corresponding to the body image;
and determining the body mass center of the sub-image set according to the sum of products between the body characteristic information of each body image and the similarity reserved correspondingly for the body image.
Wherein determining that the face image to be clustered is assigned to the face image set to obtain an updated face image set in response to the second similarity between the face image to be clustered and the face image set exceeding a second similarity threshold comprises:
respectively extracting features of the face image and the face image to be clustered to obtain face feature information respectively corresponding to the face image and the face image to be clustered;
based on the face feature information of the face images in the face image set, determining the face centroid corresponding to the face image set;
comparing the face characteristic information of the face images to be clustered with a second similarity threshold value between the face centroid of the face image set;
and responding to the fact that the second similarity between the face characteristic information of the face images to be clustered and the face centroid of the face image set is not smaller than a second similarity threshold, determining that the face images to be clustered are attributed to the face image set, and obtaining an updated face image set.
The method for determining the face centroid corresponding to the face image set based on the face feature information of the face image in the face image set comprises the following steps:
in response to the face image set including a face image, face feature information of the face image is determined as a face centroid of the face image set.
The face centroid comprises a first centroid, a second centroid and a third centroid;
based on the face feature information of the face images in the face image set, determining the face centroid corresponding to the face image set comprises the following steps:
responding to the fact that the face image set contains two face images, determining face characteristic information corresponding to the two face images as a first centroid and a second centroid;
and carrying out differential processing on the face characteristic information corresponding to the two face images respectively to obtain a third centroid.
The differential processing is performed on face feature information corresponding to two face images respectively to obtain a third centroid, which comprises the following steps:
and carrying out averaging processing on face characteristic information corresponding to the two face images respectively to obtain a third centroid.
The face centroid comprises a first centroid, a second centroid, a third centroid and a fourth centroid;
based on the face feature information of the face images in the face image set, determining the face centroid corresponding to the face image set comprises the following steps:
Responding to the fact that the face image set contains at least three face images, and calculating to obtain the face similarity among the face images;
selecting face characteristic information corresponding to two face images corresponding to the minimum face similarity as a first centroid and a second centroid respectively;
selecting the face feature information of the face image with the sum of the face similarity corresponding to the first centroid and the face similarity corresponding to the second centroid as the minimum value as a third centroid;
and averaging the face characteristic information of all face images in the face image set to obtain a fourth centroid.
Wherein, in response to the second similarity between the face feature information of the face image to be clustered and the face centroid of the face image set being not less than the second similarity threshold, determining that the face image to be clustered is attributed to the face image set to obtain an updated face image set, including:
and responding to the fact that the second similarity between the face characteristic information of the face images to be clustered and any one of the face centroids is not smaller than a second similarity threshold value, determining that the face images to be clustered are attributed to the face image set, and obtaining an updated face image set.
In order to solve the technical problems, a second technical scheme adopted by the invention is as follows: there is provided an image clustering apparatus including:
The acquisition module is used for acquiring images to be clustered and historical image sets, wherein the images to be clustered comprise face images to be clustered and body images to be clustered of the same target object, the historical image sets comprise a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, and each body image set comprises body images of a plurality of targets;
the classification module is used for dividing the body image set into at least two sub-image sets based on the shooting angle of the target in the body image;
the body clustering module is used for determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the fact that the first similarity between the body images to be clustered and the sub-image set exceeds a first similarity threshold;
the face clustering module is used for determining that the face images to be clustered belong to the face image set to obtain an updated face image set in response to the fact that the second similarity between the face images to be clustered and the face image set exceeds a second similarity threshold;
the merging module is used for merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
In order to solve the technical problems, a third technical scheme adopted by the invention is as follows: there is provided a terminal comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor being adapted to execute program data to carry out the steps of the above image clustering method.
In order to solve the technical problems, a fourth technical scheme adopted by the invention is as follows: there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above image clustering method.
The beneficial effects of the invention are as follows: different from the situation of the prior art, the image clustering method, the device, the terminal and the computer readable storage medium provided by the invention are characterized in that images to be clustered and historical image sets are obtained in the image clustering method, wherein the images to be clustered comprise face images to be clustered and body images to be clustered of the same target object, the historical image sets comprise a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, and each body image set comprises body images of a plurality of targets; dividing a body image set into at least two sub-image sets based on a photographing angle of a target in the body image; determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold; determining to attribute the face images to be clustered to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold; and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered. In the method, the human face images to be clustered and the human body images to be clustered are clustered respectively, similarity calculation is carried out on the human body images to be clustered and the human body images with different shooting angles respectively, the fact that the human body images of the same target object belong to different image sets due to different shooting angles and different definition is avoided, the clustering accuracy of the human body images to be clustered is further improved, the updated human face image set and the updated human body image set corresponding to the same target object are combined based on the association relation between the human body images to be clustered and the human face images to be clustered, and the recall rate of image clustering is improved while the image clustering accuracy in the combined image set is guaranteed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of an image clustering method provided by the invention;
FIG. 2 is a schematic flow chart of an embodiment of an image clustering method provided by the invention;
FIG. 3 is a flowchart illustrating an embodiment of an image clustering method according to the present invention;
FIG. 4 is a flowchart illustrating a step S205 of the image clustering method of FIG. 2;
FIG. 5 is a undirected contour plot between body images in a frontal body image set in one embodiment;
FIG. 6 is a flowchart illustrating an embodiment of step S208 in the image clustering method shown in FIG. 2;
FIG. 7 is a undirected contour diagram of face images in a set of face images in one embodiment;
FIG. 8 is a schematic diagram of an embodiment of an image clustering apparatus according to the present invention;
FIG. 9 is a schematic diagram of another embodiment of an image clustering apparatus provided by the present invention;
FIG. 10 is a schematic diagram of a frame of an embodiment of a terminal provided by the present invention;
FIG. 11 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
The following describes the embodiments of the present application in detail with reference to the drawings.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the present application.
The term "and/or" is herein merely an association relationship describing an associated object, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship. Further, "a plurality" herein means two or more than two.
In order to enable those skilled in the art to better understand the technical scheme of the invention, the image clustering method provided by the invention is further described in detail below with reference to the accompanying drawings and the specific embodiments.
Referring to fig. 1, fig. 1 is a schematic flow chart of an image clustering method provided by the invention. In this embodiment, an image clustering method is provided, and includes the following steps.
S11: and acquiring images to be clustered and a historical image set.
Specifically, a plurality of human body images to be clustered are obtained, wherein the human body images to be clustered are images containing target objects; and detecting and extracting the body and the face of the human body image to be clustered to obtain the human face image to be clustered and the body image to be clustered, which have association relations. The method comprises the steps that images to be clustered comprise face images to be clustered and body images to be clustered of the same target object, a history image set comprises a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, and each body image set comprises body images of a plurality of targets.
S12: the body image set is divided into at least two sub-image sets based on a photographing angle of a target in the body image.
Specifically, based on the shooting angles of targets in the body images, dividing the body images in the body image set into three sub-image sets, wherein the shooting angles of the targets contained in each sub-image set are in a corresponding preset angle range; wherein the three sub-image sets include a front body sub-image set, a side body sub-image set, and a back body sub-image set.
S13: in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold, it is determined that attributing the body images to be clustered to the body image set results in an updated body image set.
Specifically, feature extraction is respectively carried out on the body images to be clustered and the body images to obtain body feature information respectively corresponding to the body images to be clustered and the body images; determining the body mass center corresponding to each sub-image set based on the body characteristic information of the body image contained in each sub-image set; comparing the body characteristic information of the body images to be clustered with the first similarity between the body centroids corresponding to the sub-image sets; and determining that the body images to be clustered are attributed to the body image set to obtain an updated body image set in response to the first similarity between the body characteristic information of the body images to be clustered and the body centroid corresponding to the at least one sub-image set being not less than a first similarity threshold.
In an embodiment, the similarity between the body images is calculated based on the body characteristic information of the body images in the sub-image set; the body centroid of the sub-image set is determined based on body characteristic information of each body image in the sub-image set and a similarity corresponding to the body image.
In one embodiment, the similarity between the body images is compared to a similarity threshold; deleting the similarity corresponding to the body image in response to the similarity being less than the similarity threshold; responding to the similarity not smaller than the similarity threshold, and reserving the similarity corresponding to the body image; and determining the body mass center of the sub-image set according to the sum of products between the body characteristic information of each body image and the similarity reserved correspondingly for the body image.
S14: and determining that the face images to be clustered belong to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold.
Specifically, respectively extracting features of the face image and the face image to be clustered to obtain face feature information respectively corresponding to the face image and the face image to be clustered; based on the face feature information of the face images in the face image set, determining the face centroid corresponding to the face image set; comparing the face characteristic information of the face images to be clustered with a second similarity between the face centroids of the face image sets; and responding to the fact that the second similarity between the face characteristic information of the face images to be clustered and the face centroid of the face image set is not smaller than a second similarity threshold, determining that the face images to be clustered are attributed to the face image set, and obtaining an updated face image set.
In a specific embodiment, in response to the set of face images including a face image, face feature information of the face image is determined as a face centroid of the set of face images.
In a particular embodiment, the face centroid includes a first centroid, a second centroid and a third centroid. Responding to the fact that the face image set contains two face images, determining face characteristic information corresponding to the two face images as a first centroid and a second centroid; and carrying out differential processing on the face characteristic information corresponding to the two face images respectively to obtain a third centroid. And carrying out averaging processing on face characteristic information corresponding to the two face images respectively to obtain a third mass center.
In a particular embodiment, the face centroid includes a first centroid, a second centroid, a third centroid and a fourth centroid. Responding to the fact that the face image set contains at least three face images, and calculating to obtain the face similarity among the face images; selecting face characteristic information corresponding to two face images corresponding to the minimum face similarity as a first centroid and a second centroid respectively; selecting the face feature information of the face image with the sum of the face similarity corresponding to the first centroid and the face similarity corresponding to the second centroid as the minimum value as a third centroid; and averaging the face characteristic information of all face images in the face image set to obtain a fourth centroid.
And responding to the fact that the second similarity between the face characteristic information of the face images to be clustered and any one of the face centroids is not smaller than a second similarity threshold value, determining that the face images to be clustered are attributed to the face image set, and obtaining an updated face image set.
In an alternative embodiment, an updated face centroid of the updated face image set is determined based on the face images in the updated face image set and the face images to be clustered; in response to the fact that the third similarity between the face image or the face image to be clustered and the updated face centroid is smaller than a third similarity threshold, removing the face image or the face image to be clustered corresponding to the third similarity; determining an updated body centroid of the updated body image set based on the body images in the updated body image set and the body images to be clustered; and in response to the fourth similarity between the body image or the body image to be clustered and the updated body centroid being less than the fourth similarity threshold, rejecting the body image or the body image to be clustered corresponding to the fourth similarity.
S15: and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
Specifically, because the face image to be clustered and the body image to be clustered belong to the same target object, the updated face image set to which the face image to be clustered belongs and the updated body image set to which the body image to be clustered belongs can be combined based on the association relationship between the face image to be clustered and the body image to be clustered, so as to obtain the body image set of the target object. The set of body images includes a face image and a body image of the target object.
In the image clustering method provided by the embodiment, an image to be clustered and a historical image set are obtained, wherein the image to be clustered comprises a face image to be clustered and a body image to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises a face image of at least one target, and each body image set comprises body images of a plurality of targets; dividing a body image set into at least two sub-image sets based on a photographing angle of a target in the body image; determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold; determining to attribute the face images to be clustered to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold; and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered. In the method, the human face images to be clustered and the human body images to be clustered are clustered respectively, similarity calculation is carried out on the human body images to be clustered and the human body images with different shooting angles respectively, the fact that the human body images of the same target object belong to different image sets due to different shooting angles and different definition is avoided, the clustering accuracy of the human body images to be clustered is further improved, the updated human face image set and the updated human body image set corresponding to the same target object are combined based on the association relation between the human body images to be clustered and the human face images to be clustered, and the recall rate of image clustering is improved while the image clustering accuracy in the combined image set is guaranteed.
Referring to fig. 2 and 3, fig. 2 is a schematic flow chart of an embodiment of an image clustering method provided by the present invention; fig. 3 is a schematic flow chart of an embodiment of an image clustering method provided by the present invention. In this embodiment, an image clustering method is provided, and includes the following steps.
S201: and acquiring a plurality of human body images to be clustered.
Specifically, an image near a preset position is acquired through an image acquisition device installed at the preset position, and a human body image to be clustered is obtained. The human body images to be clustered are images containing target objects. For example, the target object may be a pedestrian. The human body image to be clustered can contain one target object or a plurality of target objects.
S202: and detecting and extracting the body and the face of the human body image to be clustered to obtain the human face image to be clustered and the body image to be clustered, which have association relations.
Specifically, face part detection and body part detection are respectively carried out on the human body images to be clustered through a target detection network, so that the human body images to be clustered, which contain the human face images to be clustered corresponding to the faces and the body images to be clustered corresponding to the bodies, are obtained. The face images to be clustered are images of human faces, and the body images to be clustered are images of human trunk and limbs. That is, the body images to be clustered are images of other parts of the human body except the head. The human body images to be clustered may include human face images to be clustered and human body images to be clustered of a plurality of target objects. That is, the face image to be clustered and the body image to be clustered corresponding to the same target object have the same identification information, for example, ID. The face images to be clustered and the body images to be clustered corresponding to the same target object have an association relation.
In an embodiment, all face images to be clustered and body images to be clustered corresponding to the plurality of face images to be clustered are classified, so that all face images to be clustered are assigned to a face image set to be clustered, and all body images to be clustered are assigned to a body image set to be clustered.
S203: a set of historical images is obtained.
Specifically, a history image set is acquired, the history image set including a plurality of face image sets and a plurality of body image sets. In an embodiment, if the historical image set includes a plurality of face images and a plurality of body images, face clustering is performed on the plurality of face images to obtain a face image set, and body clustering is performed on the body images to obtain a body image set.
Each face image set includes at least one face image that contains a target. That is, a plurality of face images included in each face image set are face images of the same target. Each body image set includes body images of a plurality of objects. That is, the plurality of body images in each body image set are body images of the same object.
Since the change over time of the face of the target object is small with respect to the change of the body. The body of the target object may cause a decrease in the body similarity of the same target object according to wearing wear of the target object. Therefore, the images to be clustered can be compared with the body images with different angles, so that the accuracy of body clustering is improved.
S204: the body image set is divided into at least two sub-image sets based on a photographing angle of a target in the body image.
Specifically, the body image may be divided into two sub-image sets according to the photographing angle of the object in the body image. The sub-image sets may be a frontal body image set and a non-frontal body image set. Specifically, all body images in the body image set are divided into a frontal body image set and a non-frontal body image set based on whether an angle at which a target body front is located in the body image is within a preset angle range. In other embodiments, the number of sub-image sets may also be set according to the actual situation.
In an embodiment, in order to improve the clustering accuracy of the body images to be clustered, based on the shooting angles of the targets in the body images, the body images in the body image set are divided into three sub-image sets, and the shooting angles of the targets contained in each sub-image set are within a corresponding preset angle range; wherein the three sub-image sets include a front body sub-image set, a side body sub-image set, and a back body sub-image set. For example, the body image included in the frontal body sub-image set includes an angle at which the target body frontal surface is located within the range of [0 °,60 ° ]. That is, the body image contained in the front body sub-image set is an image of the target body that is front-captured. The angle at which the front of the target body is in the body image contained in the side body sub-image set is within the range of (60 DEG, 120 DEG).
S205: in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold, it is determined that attributing the body images to be clustered to the body image set results in an updated body image set.
Specifically, the method for clustering the body images to be clustered with the body image set in the history image set to obtain the updated body image set comprises the following steps.
Referring to fig. 4, fig. 4 is a flowchart illustrating an embodiment of step S205 in the image clustering method provided in fig. 2.
S2051: and respectively carrying out feature extraction on the body images to be clustered and the body images to obtain body feature information respectively corresponding to the body images to be clustered and the body images.
Specifically, feature extraction is carried out on the body images to be clustered and the body images in the body image set through the trained deep learning network, so that body feature information of the body images to be clustered and body feature information of the body images are obtained. Specifically, the body characteristic information is specifically a body characteristic map, i.e. the body characteristic information is a body characteristic vector.
S2052: and determining the body mass center corresponding to each sub-image set based on the body characteristic information of the body image contained in each sub-image set.
Specifically, based on the body characteristic information of each body image in the sub-image set, calculating to obtain the similarity between the body images; the body centroid of the sub-image set is determined based on body characteristic information of each body image in the sub-image set and a similarity corresponding to the body image.
In one embodiment, the similarity between the body images is compared to a similarity threshold; deleting the similarity corresponding to the body image in response to the similarity being less than the similarity threshold; responding to the similarity not smaller than the similarity threshold, and reserving the similarity corresponding to the body image; and determining the body mass center of the sub-image set according to the sum of products between the body characteristic information of each body image and the similarity reserved correspondingly for the body image.
In one embodiment, taking the frontal body sub-image set as an example, the body centroid of the frontal body sub-image set is calculated. The front body sub-image set comprises five body images, and the similarity between the body feature vectors of the body images is calculated according to the body feature vectors corresponding to the five body images respectively.
Referring to fig. 5, fig. 5 is a diagram illustrating undirected wiring between body images in a frontal body image set in an embodiment.
In order to improve the accuracy of the body centroids of the sub-image sets, the similarity between the body feature vectors of the body images is compared with a similarity threshold. If the similarity is greater than the similarity threshold, an undirected straight line is established between the body feature vectors of the two body images corresponding to the similarity. Wherein the undirected straight line represents the similarity between the body feature vectors of the two body images. For example, the five body images are S1, S2, S3, S4, and S5, respectively, and the similarity between S1 and S3, S4 and S3, and S2 and S4 is determined to exceed the similarity threshold by performing similarity comparison. Wherein, the similarity between S1 and S3 exceeding the similarity threshold indicates that the probability that the target body included in the corresponding body images corresponding to S1 and S3 is the same target is greater.
The more body images that are associated with each body image in the sub-image set, i.e., the more undirected straight lines that are connected by the body feature vectors of each body image on the undirected connection map, the more body images that represent the body image that are similar in the sub-image set, the more representative the body images, the more likely the body images are correctly clustered, and the more likely the body images that have only a small number of undirected straight lines are outliers, the weaker the representativeness.
In a specific embodiment, the body centroid of the frontal body sub-image set is calculated based on the following formula.
C=(d 13 +d 14 )*t 1 +(d 24 +d 25 )*t 2 +(d 13 +d 34 )*t 3 +(d 14 +d 34 +d 24 )*t 4 +d 25 *t 5 (equation 1)
Wherein: c is the mass center of the body; t is t a For body image S a A=1, 2,3,4,5; d, d xy For the similarity between the body feature vector x of the body image and the body feature vector y of the body image, both x and y can be takenThe values are 1,2,3,4, 5.
Through the step, the body mass center corresponding to each sub-image set can be calculated.
S2053: and comparing the body characteristic information of the body images to be clustered with the first similarity between the body centroids corresponding to the sub-image sets.
Specifically, based on the body mass centers respectively corresponding to the body feature vectors of the body images to be clustered and all the sub-image sets corresponding to the body image sets, a first similarity between the body feature vectors of the body images to be clustered and each body mass center is calculated. For example, a manhattan distance or euclidean distance may be calculated based on the body feature vector of the body image to be clustered and each body centroid to obtain a first similarity between the body feature vector of the body image to be clustered and each body centroid. In other embodiments, the first similarity between the body feature vector of the body image to be clustered and each body centroid may also be calculated in other ways.
A first similarity between the body feature vector of the body image to be clustered and each body centroid is compared to a first similarity threshold.
S2054: and determining that the body images to be clustered are attributed to the body image set to obtain an updated body image set in response to the first similarity between the body characteristic information of the body images to be clustered and the body centroid corresponding to the at least one sub-image set being not less than a first similarity threshold.
Specifically, if the first similarity between the body feature vector of the body image to be clustered and at least one body centroid in the body image set is not less than the first similarity threshold, it is determined that the body image to be clustered is attributed to the body image set.
Traversing all body images to be clustered corresponding to the body images to be clustered to attribute the body images to be clustered to corresponding body image sets so as to obtain updated body image sets. Wherein the updated body image set is composed of the body images to be clustered which have completed clustering and the body images in the history image set. Each updated body image set contains body images that are body images of the same target.
S206: an updated body centroid of the updated body image set is determined based on the body images in the updated body image set and the body images to be clustered.
Specifically, according to the body feature vectors of the body images contained in each updated body image set and the body feature vectors of the body images to be clustered belonging to the updated body image set, calculating the average centroid of each updated body image set, taking the average centroid as the updated body centroid, and further replacing the average centroid of the body image set in the history image set with the updated body centroid of the updated body image set.
S207: and in response to the fourth similarity between the body image or the body image to be clustered and the updated body centroid being less than the fourth similarity threshold, rejecting the body image or the body image to be clustered corresponding to the fourth similarity.
Specifically, to increase the recall rate of the updated body image set, a fourth similarity between the body images in the updated body image set, the body images to be clustered, and the updated body centroid, respectively, is calculated. Comparing the fourth similarity with a fourth similarity threshold to purify the images contained in the updated body image set, and rejecting body images which may not belong to the target corresponding to the updated body image set.
If the fourth similarity between the body image or the body image to be clustered and the updated body centroid is smaller than the fourth similarity threshold, determining that the body image or the body image to be clustered corresponding to the fourth similarity does not belong to the body image of the target corresponding to the updated body image set, and eliminating the body image or the body image to be clustered corresponding to the fourth similarity.
All body images contained in the body image set and all body images to be clustered are traversed and updated.
S208: and determining that the face images to be clustered belong to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold.
Specifically, the method for clustering the face images to be clustered and the face image set in the history image set to obtain the updated face image set comprises the following steps.
Referring to fig. 6, fig. 6 is a flowchart illustrating an embodiment of step S208 in the image clustering method provided in fig. 2.
S2081: and respectively extracting the characteristics of the face image and the face image to be clustered to obtain face characteristic information respectively corresponding to the face image and the face image to be clustered.
Specifically, feature extraction is carried out on face images to be clustered and face images in the face image set through a deep learning network which is completed through training, so that face feature information of the face images to be clustered and face feature information of the face images are obtained. Specifically, the face feature information is specifically a face feature map, that is, the face feature information is a face feature vector.
S2082: and determining the face centroid corresponding to the face image set based on the face characteristic information of the face images in the face image set.
In one embodiment, in response to the set of face images including a face image, face feature information of the face image is determined as a face centroid of the set of face images.
In another embodiment, the face centroid includes a first centroid, a second centroid and a third centroid; responding to the fact that the face image set contains two face images, determining face characteristic information corresponding to the two face images as a first centroid and a second centroid; and carrying out differential processing on the face characteristic information corresponding to the two face images respectively to obtain a third centroid. And carrying out averaging processing on face characteristic information corresponding to the two face images respectively to obtain a third centroid.
In another embodiment, the face centroid includes a first centroid, a second centroid, a third centroid and a fourth centroid. And responding to the fact that the face image set contains at least three face images, and calculating to obtain the face similarity between the face images. In order to enable the face centroid of the face image set to more comprehensively represent the face images in the face image set, the face centroid of the face image set is determined by utilizing the thought of a greedy algorithm. Specifically, face feature information corresponding to two face images corresponding to the minimum face similarity is selected to be used as a first centroid and a second centroid respectively; selecting the face feature information of the face image with the sum of the face similarity corresponding to the first centroid and the face similarity corresponding to the second centroid as the minimum value as a third centroid; and averaging the face characteristic information of all face images in the face image set to obtain a fourth centroid.
Referring to fig. 7, fig. 7 is a diagram illustrating undirected connection between face images in a face image set according to an embodiment.
In one embodiment, the set of face images includes four face images A 1 、A 2 、A 3 And A 4 And calculating the face similarity between the face images according to the face feature vectors of the face images. In response to A 1 And A 2 The human face image A is obtained if the human face similarity is minimum 1 And face image A 2 The face feature vectors respectively corresponding to the face feature vectors are determined as a first centroid and a second centroid. Face image A is calculated 3 With face image A 1 Face similarity and face image A between them 3 With face image A 2 The sum of the facial similarity between the two faces is 1.40; face image A is calculated 4 With face image A 1 Face similarity and face image A between them 4 With face image A 2 And adding the facial similarity between the two to obtain a second value of 1.55. Responding to the first value smaller than the second value, selecting a face image A corresponding to the second value in order to more comprehensively reflect the face characteristics of the face image set 3 As a third centroid. According to the face image A 1 、A 2 、A 3 And A 4 And adding and averaging the face feature vectors respectively corresponding to the face feature vectors to obtain a fourth centroid.
S2083: and comparing the face characteristic information of the face images to be clustered with the second similarity between the face centroids of the face image sets.
Specifically, based on the face feature vector of the face image to be clustered and the face centroid corresponding to the face image set, a second similarity between the face feature vector of the face image to be clustered and each face centroid is calculated. For example, the manhattan distance or euclidean distance may be calculated based on the face feature vector of the face image to be clustered and the respective face centroids to obtain a second similarity between the face feature vector of the face image to be clustered and the respective face centroids. In other embodiments, the second similarity between the face feature vector of the face image to be clustered and the centroid of each face may be calculated in other manners.
And comparing the second similarity between the face feature vector of the face image to be clustered and the mass centers of the faces with a second similarity threshold.
S2084: and responding to the fact that the second similarity between the face characteristic information of the face images to be clustered and the face centroid of the face image set is not smaller than a second similarity threshold, determining that the face images to be clustered are attributed to the face image set, and obtaining an updated face image set.
Specifically, in response to the fact that the second similarity between the face feature information of the face images to be clustered and any one of the face centroids is not smaller than a second similarity threshold, the face images to be clustered are determined to be attributed to the face image set, and the face image set is updated.
In an embodiment, if the second similarity between the face feature vector of the face image to be clustered and at least one face centroid in the face image set is not less than the second similarity threshold, it is determined that the face image to be clustered is assigned to the face image set.
Traversing all face images to be clustered corresponding to the face images to be clustered to attribute the face images to be clustered to corresponding face image sets so as to obtain updated face image sets. The updated face image set consists of face images to be clustered which are clustered and face images in the history image set. The face images contained in each updated face image set are face images of the same target.
S209: and determining the updated face centroid of the updated face image set based on the face images in the updated face image set and the face images to be clustered.
Specifically, according to the face feature vectors of the face images contained in each updated face image set and the face feature vectors of the face images to be clustered belonging to the updated face image set, calculating the average centroid of each updated face image set, taking the average centroid as the updated face centroid, and further replacing the average centroid of the face image set in the history image set with the updated face centroid of the updated face image set.
S210: and in response to the fact that the third similarity between the face image or the face image to be clustered and the updated face centroid is smaller than a third similarity threshold, eliminating the face image or the face image to be clustered corresponding to the third similarity.
Specifically, in order to improve the recall rate of the updated face image set, a third similarity between the face images in the updated face image set and the face images to be clustered and the updated face centroid is calculated. And comparing the third similarity with a third similarity threshold to purify the images contained in the updated face image set, and eliminating the face images which are possibly not in the targets corresponding to the updated face image set.
If the third similarity between the face image or the face image to be clustered and the updated face centroid is smaller than the third similarity threshold, determining that the face image or the face image to be clustered corresponding to the third similarity does not belong to the face image of the target corresponding to the updated face image set, and eliminating the face image or the face image to be clustered corresponding to the third similarity.
And traversing and updating all face images and all face images to be clustered contained in the face image set.
S211: and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
Specifically, since the face image to be clustered and the body image to be clustered of the same target object have the same identity information, the updated face image set to which the face image to be clustered of the same target object belongs and the updated body image set to which the body image to be clustered belongs can be combined based on the identity information, so as to obtain the body image set of the target object. The set of body images includes a face image and a body image of the target object.
In the image clustering method provided by the embodiment, an image to be clustered and a historical image set are obtained, wherein the image to be clustered comprises a face image to be clustered and a body image to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises a face image of at least one target, and each body image set comprises body images of a plurality of targets; dividing a body image set into at least two sub-image sets based on a photographing angle of a target in the body image; determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold; determining to attribute the face images to be clustered to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold; and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered. In the method, the human face images to be clustered and the human body images to be clustered are clustered respectively, similarity calculation is carried out on the human body images to be clustered and the human body images with different shooting angles respectively, the fact that the human body images of the same target object belong to different image sets due to different shooting angles and different definition is avoided, the clustering accuracy of the human body images to be clustered is further improved, the updated human face image set and the updated human body image set corresponding to the same target object are combined based on the association relation between the human body images to be clustered and the human face images to be clustered, and the recall rate of image clustering is improved while the image clustering accuracy in the combined image set is guaranteed.
Referring to fig. 8, fig. 8 is a schematic diagram of an image clustering apparatus according to an embodiment of the present invention. The present embodiment provides an image clustering apparatus 60, and the image clustering apparatus 60 includes an acquisition module 61, a classification module 62, a body clustering module 63, a face clustering module 64, and a merging module 65.
The obtaining module 61 is configured to obtain an image to be clustered and a historical image set, where the image to be clustered includes a face image to be clustered and a body image to be clustered of a same target object, the historical image set includes a plurality of face image sets and body image sets, each face image set includes a face image of at least one target, and each body image set includes body images of a plurality of targets.
The acquisition module 61 is configured to acquire a plurality of human body images to be clustered, where the human body images to be clustered are images including a target object; and detecting and extracting the body and the face of the human body image to be clustered to obtain the human face image to be clustered and the body image to be clustered, which have association relations.
The classification module 62 is configured to divide the body image set into at least two sub-image sets based on the photographing angle of the object in the body image.
The classification module 62 is configured to divide the body image in the body image set into three sub-image sets based on the shooting angles of the targets in the body image, where the shooting angles of the targets included in each sub-image set are within a corresponding preset angle range; wherein the three sub-image sets include a front body sub-image set, a side body sub-image set, and a back body sub-image set.
The body clustering module 63 is configured to determine that attributing the body images to be clustered to the body image set results in an updated body image set in response to a first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold.
The body clustering module 63 is configured to perform feature extraction on the body image to be clustered and the body image respectively, so as to obtain body feature information corresponding to the body image to be clustered and the body image respectively; determining the body mass center corresponding to each sub-image set based on the body characteristic information of the body image contained in each sub-image set; comparing the body characteristic information of the body images to be clustered with the first similarity between the body centroids corresponding to the sub-image sets; and determining that the body images to be clustered are attributed to the body image set to obtain an updated body image set in response to the first similarity between the body characteristic information of the body images to be clustered and the body centroid corresponding to the at least one sub-image set being not less than a first similarity threshold.
The body clustering module 63 is further configured to calculate, based on body feature information of each body image in the sub-image set, a similarity between each body image; the body centroid of the sub-image set is determined based on body characteristic information of each body image in the sub-image set and a similarity corresponding to the body image.
The body clustering module 63 is further configured to compare the similarity between the body images with a similarity threshold; deleting the similarity corresponding to the body image in response to the similarity being less than the similarity threshold; responding to the similarity not smaller than the similarity threshold, and reserving the similarity corresponding to the body image; and determining the body mass center of the sub-image set according to the sum of products between the body characteristic information of each body image and the similarity reserved correspondingly for the body image.
The face clustering module 64 is configured to determine, in response to a second similarity between the face image to be clustered and the face image set exceeding a second similarity threshold, to attribute the face image to be clustered to the face image set to obtain an updated face image set.
The face clustering module 64 is further configured to perform feature extraction on the face image and the face image to be clustered, so as to obtain face feature information corresponding to the face image and the face image to be clustered; based on the face feature information of the face images in the face image set, determining the face centroid corresponding to the face image set; comparing the face characteristic information of the face images to be clustered with a second similarity between the face centroids of the face image sets; and responding to the fact that the second similarity between the face characteristic information of the face images to be clustered and the face centroid of the face image set is not smaller than a second similarity threshold, determining that the face images to be clustered are attributed to the face image set, and obtaining an updated face image set.
In one embodiment, the face clustering module 64 is further configured to determine face feature information of the face image as a face centroid of the face image set in response to the face image set including one face image.
In a specific embodiment, the face feature information corresponding to the two face images is averaged to obtain a third centroid.
In an embodiment, the face centroid includes a first centroid, a second centroid and a third centroid. The face clustering module 64 is further configured to determine face feature information corresponding to two face images as a first centroid and a second centroid in response to the face images collectively including the two face images; and carrying out differential processing on the face characteristic information corresponding to the two face images respectively to obtain a third centroid.
In a particular embodiment, the face centroid includes a first centroid, a second centroid, a third centroid and a fourth centroid. The face clustering module 64 is further configured to calculate a face similarity between the face images in response to the face image set including at least three face images; selecting face characteristic information corresponding to two face images corresponding to the minimum face similarity as a first centroid and a second centroid respectively; selecting the face feature information of the face image with the sum of the face similarity corresponding to the first centroid and the face similarity corresponding to the second centroid as the minimum value as a third centroid; and averaging the face characteristic information of all face images in the face image set to obtain a fourth centroid.
In a specific embodiment, the face clustering module 64 is further configured to determine that the face image to be clustered is assigned to the face image set to obtain the updated face image set in response to the second similarity between the face feature information of the face image to be clustered and any one of the face centroids being not less than the second similarity threshold.
The merging module 65 is configured to merge, based on an association relationship between the face image to be clustered and the body image to be clustered, an updated face image set to which the face image to be clustered belongs and an updated body image set to which the body image to be clustered belongs.
Referring to fig. 9, fig. 9 is a schematic diagram of a frame of another embodiment of an image clustering apparatus according to the present invention.
In an alternative embodiment, the image clustering apparatus 60 further comprises a checking module 66, the checking module 66 being configured to determine an updated face centroid of the updated face image set based on the face images in the updated face image set and the face images to be clustered; in response to the fact that the third similarity between the face image or the face image to be clustered and the updated face centroid is smaller than a third similarity threshold, removing the face image or the face image to be clustered corresponding to the third similarity; determining an updated body centroid of the updated body image set based on the body images in the updated body image set and the body images to be clustered; and in response to the fourth similarity between the body image or the body image to be clustered and the updated body centroid being less than the fourth similarity threshold, rejecting the body image or the body image to be clustered corresponding to the fourth similarity.
The image clustering device provided in this embodiment is configured to obtain an image to be clustered and a history image set, where the image to be clustered includes a face image to be clustered and a body image to be clustered of a same target object, the history image set includes a plurality of face image sets and body image sets, each face image set includes a face image of at least one target, and each body image set includes body images of a plurality of targets; the classification module is used for dividing the body image set into at least two sub-image sets based on the shooting angle of the target in the body image; the body clustering module is used for determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the fact that the first similarity between the body images to be clustered and the sub-image set exceeds a first similarity threshold; the face clustering module is used for determining that the face images to be clustered belong to the face image set to obtain an updated face image set in response to the fact that the second similarity between the face images to be clustered and the face image set exceeds a second similarity threshold; the merging module is used for merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered. The human face images to be clustered and the human body images to be clustered are clustered respectively, similarity calculation is carried out on the human body images to be clustered and the human body images with different shooting angles respectively, the fact that the human body images of the same target object belong to different image sets due to different shooting angles and different definition is avoided, the clustering accuracy of the human body images to be clustered is further improved, the updated human face image set and the updated human body image set corresponding to the same target object are combined based on the association relation between the human body images to be clustered and the human face images to be clustered, and the image clustering accuracy in the combined image set is guaranteed, and meanwhile the recall rate of image clustering is also improved.
Referring to fig. 10, fig. 10 is a schematic diagram of a frame of a terminal according to an embodiment of the invention. The terminal 80 comprises a memory 81 and a processor 82 coupled to each other, the processor 82 being adapted to execute program instructions stored in the memory 81 for implementing the steps of any of the image clustering method embodiments described above. In one particular implementation scenario, terminal 80 may include, but is not limited to: the microcomputer, server, and the terminal 80 may also include mobile devices such as a notebook computer and a tablet computer, which are not limited herein.
In particular, the processor 82 is configured to control itself and the memory 81 to implement the steps of any of the image clustering method embodiments described above. The processor 82 may also be referred to as a CPU (Central Processing Unit ). The processor 82 may be an integrated circuit chip having signal processing capabilities. The processor 82 may also be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 82 may be commonly implemented by an integrated circuit chip.
The scheme is that the image clustering method comprises the following steps: acquiring an image to be clustered and a historical image set, wherein the image to be clustered comprises face images to be clustered and body images to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, and each body image set comprises body images of a plurality of targets; dividing a body image set into at least two sub-image sets based on a photographing angle of a target in the body image; determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold; determining to attribute the face images to be clustered to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold; and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
Referring to fig. 11, fig. 11 is a schematic diagram of a frame of an embodiment of a computer readable storage medium according to the present invention. The computer readable storage medium 90 stores program instructions 901 executable by a processor, the program instructions 901 for implementing the steps of any one of the image clustering method embodiments described above.
The scheme is that the image clustering method comprises the following steps: acquiring an image to be clustered and a historical image set, wherein the image to be clustered comprises face images to be clustered and body images to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, and each body image set comprises body images of a plurality of targets; dividing a body image set into at least two sub-image sets based on a photographing angle of a target in the body image; determining that the body images to be clustered belong to the body image set to obtain an updated body image set in response to the first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold; determining to attribute the face images to be clustered to the face image set to obtain an updated face image set in response to the second similarity between the face images to be clustered and the face image set exceeding a second similarity threshold; and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
In some embodiments, functions or modules included in an apparatus provided by the embodiments of the present disclosure may be used to perform a method described in the foregoing method embodiments, and specific implementations thereof may refer to descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
The foregoing description of various embodiments is intended to highlight differences between the various embodiments, which may be the same or similar to each other by reference, and is not repeated herein for the sake of brevity.
In the several embodiments provided in the present application, it should be understood that the disclosed methods and apparatus may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical, or other forms.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all or part of the technical solution contributing to the prior art or in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
If the technical scheme of the application relates to personal information, the product applying the technical scheme of the application clearly informs the personal information processing rule before processing the personal information, and obtains independent consent of the individual. If the technical scheme of the application relates to sensitive personal information, the product applying the technical scheme of the application obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of 'explicit consent'. For example, a clear and remarkable mark is set at a personal information acquisition device such as a camera to inform that the personal information acquisition range is entered, personal information is acquired, and if the personal voluntarily enters the acquisition range, the personal information is considered as consent to be acquired; or on the device for processing the personal information, under the condition that obvious identification/information is utilized to inform the personal information processing rule, personal authorization is obtained by popup information or a person is requested to upload personal information and the like; the personal information processing rule may include information such as a personal information processor, a personal information processing purpose, a processing mode, and a type of personal information to be processed.
The foregoing is only the embodiments of the present invention, and therefore, the patent protection scope of the present invention is not limited thereto, and all equivalent structures or equivalent flow changes made by the content of the present specification and the accompanying drawings, or direct or indirect application in other related technical fields, are included in the patent protection scope of the present invention.

Claims (16)

1. An image clustering method, characterized in that the image clustering method comprises:
acquiring an image to be clustered and a historical image set, wherein the image to be clustered comprises a face image to be clustered and a body image to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises a face image of at least one target, and each body image set comprises a plurality of body images of the target;
dividing the body image set into at least two sub-image sets based on a photographing angle of the target in the body image;
determining to attribute the body images to be clustered to the body image set to obtain an updated body image set in response to a first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold;
Determining that the face image to be clustered belongs to the face image set to obtain an updated face image set in response to the second similarity between the face image to be clustered and the face image set exceeding a second similarity threshold;
and merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
2. The method of image clustering according to claim 1, wherein,
before the step of merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relationship between the face image to be clustered and the body image to be clustered, the method further includes:
determining an updated face centroid of the updated face image set based on the face images in the updated face image set and the face images to be clustered;
in response to the face image or the face image to be clustered and the updated face centroid with a third similarity smaller than a third similarity threshold, eliminating the face image or the face image to be clustered corresponding to the third similarity;
Determining an updated body centroid of the updated body image set based on the body images in the updated body image set and the body images to be clustered;
and in response to a fourth similarity between the body image or the body image to be clustered and the updated body centroid being smaller than a fourth similarity threshold, eliminating the body image or the body image to be clustered corresponding to the fourth similarity.
3. The method of image clustering according to claim 1, wherein,
the method includes the steps that an image to be clustered and a historical image set are obtained, the image to be clustered comprises face images to be clustered and body images to be clustered of the same target object, the historical image set comprises a plurality of face image sets and body image sets, each face image set comprises face images of at least one target, each body image set comprises a plurality of body images of the target, and the method includes the steps of:
acquiring a plurality of human body images to be clustered, wherein the human body images to be clustered are images containing the target object;
and detecting and extracting the body and the face of the human body image to be clustered to obtain the human face image to be clustered and the body image to be clustered, which have association relations.
4. The method of image clustering according to claim 1, wherein,
the dividing the body image set into at least two sub-image sets based on the shooting angle of the target in the body image includes:
dividing the body image in the body image set into three sub-image sets based on the shooting angles of the targets in the body image, wherein the shooting angles of the targets contained in each sub-image set are in a corresponding preset angle range; wherein the three sub-image sets include a front body sub-image set, a side body sub-image set, and a back body sub-image set.
5. The method of image clustering according to claim 1, wherein,
the determining, in response to a first similarity between the body images to be clustered and the sub-image set exceeding a first similarity threshold, to attribute the body images to be clustered to the body image set to obtain an updated body image set, includes:
respectively extracting features of the body images to be clustered and the body images to obtain body feature information corresponding to the body images to be clustered and the body images respectively;
determining a body centroid corresponding to each sub-image set based on body characteristic information of the body image contained in each sub-image set;
Comparing the first similarity corresponding to the body characteristic information of the body images to be clustered and the body mass center corresponding to each sub-image set with the first similarity threshold;
and determining that the body images to be clustered are attributed to the body image set to obtain the updated body image set in response to the first similarity between the body characteristic information of the body images to be clustered and the body mass center corresponding to at least one sub-image set is not smaller than the first similarity threshold.
6. The method of image clustering according to claim 5, wherein,
the determining the body centroid corresponding to each sub-image set based on the body characteristic information of the body image contained in each sub-image set includes:
calculating to obtain the similarity between the body images based on the body characteristic information of the body images in the sub-image set;
a body centroid of the sub-image set is determined based on body characteristic information of each of the body images in the sub-image set and the similarity corresponding to the body image.
7. The method of image clustering according to claim 6, wherein,
The determining a body centroid of the sub-image set based on the body feature information of each of the body images in the sub-image set and the similarity corresponding to the body image includes:
comparing the similarity between the body images to a similarity threshold;
deleting the similarity corresponding to the body image in response to the similarity being less than the similarity threshold;
responding to the similarity not smaller than the similarity threshold, and reserving the similarity corresponding to the body image;
and determining the body mass center of the sub-image set according to the sum of products between the body characteristic information of each body image and the similarity correspondingly reserved by the body images.
8. The method of image clustering according to claim 1, wherein,
the determining, in response to the second similarity between the face image to be clustered and the face image set exceeding a second similarity threshold, to attribute the face image to be clustered to the face image set to obtain an updated face image set includes:
respectively extracting features of the face image and the face image to be clustered to obtain face feature information respectively corresponding to the face image and the face image to be clustered;
Determining a face centroid corresponding to the face image set based on face feature information of the face images in the face image set;
comparing the second similarity between the face feature information of the face images to be clustered and the face centroid of the face image set with the second similarity threshold;
and responding to the second similarity between the face characteristic information of the face images to be clustered and the face centroid of the face image set is not smaller than the second similarity threshold, and determining that the face images to be clustered are attributed to the face image set to obtain the updated face image set.
9. The method of image clustering according to claim 8, wherein,
the determining the face centroid corresponding to the face image set based on the face feature information of the face image in the face image set includes:
and in response to the face image set containing one face image, determining the face characteristic information of the face image as the face centroid of the face image set.
10. The method of image clustering according to claim 8, wherein the face centroids include a first centroid, a second centroid and a third centroid;
The determining the face centroid corresponding to the face image set based on the face feature information of the face image in the face image set includes:
responding to the fact that the face image set contains two face images, determining the face characteristic information corresponding to the two face images as the first centroid and the second centroid;
and carrying out differential processing on the face characteristic information corresponding to the two face images respectively to obtain the third mass center.
11. The method of image clustering according to claim 10, wherein,
the step of carrying out differential processing on the face characteristic information corresponding to the two face images respectively to obtain the third mass center comprises the following steps:
and carrying out averaging treatment on the face characteristic information corresponding to the two face images respectively to obtain the third mass center.
12. The method of image clustering according to claim 8, wherein the face centroids include a first centroid, a second centroid, a third centroid and a fourth centroid;
the determining the face centroid corresponding to the face image set based on the face feature information of the face image in the face image set includes:
Responding to the fact that the face image set contains at least three face images, and calculating to obtain the face similarity between the face images;
selecting face characteristic information corresponding to two face images with the smallest face similarity as the first centroid and the second centroid respectively;
selecting the face feature information of the face image with the sum of the face similarity corresponding to the first centroid and the face similarity corresponding to the second centroid as a minimum value as a third centroid;
and averaging the face characteristic information of all the face images in the face image set to obtain the fourth centroid.
13. The method for clustering images according to any one of claims 8 to 12, wherein,
and determining that the face image to be clustered is attributed to the face image set to obtain the updated face image set if the second similarity between the face feature information of the face image to be clustered and the face centroid of the face image set is not smaller than the second similarity threshold, including:
and responding to the fact that the second similarity between the face characteristic information of the face images to be clustered and any one of the face centroids is not smaller than the second similarity threshold, determining that the face images to be clustered are attributed to the face image set, and obtaining the updated face image set.
14. An image clustering device, characterized in that the image clustering device comprises:
the acquisition module is used for acquiring images to be clustered and historical image sets, wherein the images to be clustered comprise face images to be clustered and body images to be clustered of the same target object, the historical image sets comprise a plurality of face image sets and body image sets, each face image set comprises at least one face image of the target, and each body image set comprises a plurality of body images of the target;
a classification module for dividing the body image set into at least two sub-image sets based on a photographing angle of the object in the body image;
a body clustering module, configured to determine that the body image to be clustered is attributed to the body image set to obtain an updated body image set in response to a first similarity between the body image to be clustered and the sub-image set exceeding a first similarity threshold;
the face clustering module is used for determining that the face image to be clustered belongs to the face image set to obtain an updated face image set in response to the fact that the second similarity between the face image to be clustered and the face image set exceeds a second similarity threshold;
And the merging module is used for merging the updated face image set to which the face image to be clustered belongs with the updated body image set to which the body image to be clustered belongs based on the association relation between the face image to be clustered and the body image to be clustered.
15. A terminal comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor being adapted to execute program data to carry out the steps of the image clustering method according to any one of claims 1 to 13.
16. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the image clustering method according to any one of claims 1 to 13.
CN202211600236.XA 2022-12-12 2022-12-12 Image clustering method, device, terminal and computer readable storage medium Pending CN116258881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211600236.XA CN116258881A (en) 2022-12-12 2022-12-12 Image clustering method, device, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211600236.XA CN116258881A (en) 2022-12-12 2022-12-12 Image clustering method, device, terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116258881A true CN116258881A (en) 2023-06-13

Family

ID=86680015

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211600236.XA Pending CN116258881A (en) 2022-12-12 2022-12-12 Image clustering method, device, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116258881A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117745036A (en) * 2024-02-18 2024-03-22 四川金投科技股份有限公司 Livestock information management method and system based on feature recognition and near field communication

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117745036A (en) * 2024-02-18 2024-03-22 四川金投科技股份有限公司 Livestock information management method and system based on feature recognition and near field communication
CN117745036B (en) * 2024-02-18 2024-04-30 四川金投科技股份有限公司 Livestock information management method and system based on feature recognition and near field communication

Similar Documents

Publication Publication Date Title
CN111104867B (en) Recognition model training and vehicle re-recognition method and device based on part segmentation
WO2018099032A1 (en) Target tracking method and device
CN105279484A (en) Method and device for object detection
CN111429483A (en) High-speed cross-camera multi-target tracking method, system, device and storage medium
CN109510946B (en) HDR scene detection method and system
CN111667001B (en) Target re-identification method, device, computer equipment and storage medium
CN112016353A (en) Method and device for carrying out identity recognition on face image based on video
CN111104925A (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN112330715A (en) Tracking method, tracking device, terminal equipment and readable storage medium
JP2022540101A (en) POSITIONING METHOD AND APPARATUS, ELECTRONIC DEVICE, COMPUTER-READABLE STORAGE MEDIUM
CN113052008A (en) Vehicle weight recognition method and device
CN114783037B (en) Object re-recognition method, object re-recognition apparatus, and computer-readable storage medium
CN116258881A (en) Image clustering method, device, terminal and computer readable storage medium
CN111814612A (en) Target face detection method and related device thereof
CN111091041A (en) Vehicle law violation judging method and device, computer equipment and storage medium
CN111382606A (en) Tumble detection method, tumble detection device and electronic equipment
JPWO2018179119A1 (en) Video analysis device, video analysis method, and program
CN112927258A (en) Target tracking method and device
CN116258748A (en) Track tracking method
CN114387296A (en) Target track tracking method and device, computer equipment and storage medium
CN114937165A (en) Cluster merging method, device, terminal and computer readable storage medium
CN112818743B (en) Image recognition method and device, electronic equipment and computer storage medium
KR20230030996A (en) Object tracking apparatus and method
CN111597980B (en) Target object clustering method and device
CN113705329A (en) Re-recognition method, training method of target re-recognition network and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination