Method and apparatus and electronic device for clustering
AssigneeBeijing Sensetime Technology Development Co., Ltd.
InventorXinyu Pan
Life of this patent
Estimating the term…
Abstract
The present disclosure provides a clustering method and apparatus and an electronic device. The method includes: acquiring an inter-sample similarity between every two pieces of sample data in M pieces of sample data, where M is a positive integer; merging the M pieces of sample data into N initialization clustered clusters according to the acquired inter-sample similarity, where N is a positive integer smaller than M; and clustering and merging the N initialization clustered clusters to obtain multiple clustered clusters corresponding to the M pieces of sample data.
Claims16
A method for image clustering, comprising:
- acquiring an inter-sample similarity between every two pieces of sample data in M pieces of sample data, where M is a positive integer and the M pieces of sample data are M images;
- merging the M pieces of sample data into N initialization clustered clusters according to the acquired inter-sample similarity, where N is a positive integer smaller than M and each of the N initialization clustered clusters comprises at least one piece of sample data;
- and
- clustering and merging the N initialization clustered clusters to obtain multiple clustered clusters corresponding to the M pieces of sample data;
- wherein the acquiring an inter-sample similarity between every two pieces of sample data in the M pieces of sample data comprises:
- for each of the M images, performing feature extraction to obtain a feature vector of the image;
- and
- determining an inter-sample similarity between every two of the M images based on feature vectors of the two images;
- and
- wherein the merging the M pieces of sample data into N initialization clustered clusters according to the acquired inter-sample similarity comprises:
- for any two pieces of sample data in the M pieces of sample data, merging the two pieces of sample data into a suspected initialization clustered cluster when the inter-sample similarity of the two pieces of sample data is greater than a first threshold, so as to obtain multiple suspected initialization clustered clusters;
- and
- for the obtained multiple suspected initialization clustered clusters, merging at least two of the suspected initialization clustered clusters, both comprising a same subset having a number of pieces of sample data, which is greater than or equal to a second threshold, into an initialization clustered cluster.
An apparatus for image clustering, comprising:
- a processor;
- and
- a memory for storing instructions executable by the processor;
- wherein the processor is configured to:
- acquire an inter-sample similarity between every two pieces of sample data in M pieces of sample data, where M is a positive integer and the M pieces of sample data are M images;
- merge the M pieces of sample data into N initialization clustered clusters according to the acquired inter-sample similarity, where N is a positive integer smaller than M and each of the N initialization clustered clusters comprises at least one piece of sample data;
- and
- cluster and merging the N initialization clustered clusters to obtain multiple clustered clusters corresponding to the M pieces of sample data;
- wherein in acquiring an inter-sample similarity between every two pieces of sample data in the M pieces of sample data, the processor is further configured to:
- for each of the M images, perform feature extraction to obtain a feature vector of the image;
- and
- determine an inter-sample similarity between every two of the M images based on feature vectors of the two images;
- and
- wherein in merging the M pieces of sample data into N initialization clustered clusters according to the acquired inter-sample similarity, the processor is further configured to:
- merge, for any two pieces of sample data in the M pieces of sample data, the two pieces of sample data into a suspected initialization clustered cluster when the inter-sample similarity of the two pieces of sample data is greater than a first threshold, so as to obtain multiple suspected initialization clustered clusters;
- and
- merge, for the obtained multiple suspected initialization clustered clusters, at least two of the suspected initialization clustered clusters, both comprising a same subset having a number of pieces of sample data, which is greater than or equal to a second threshold, into an initialization clustered cluster.
A non-transitory computer-readable medium having stored therein instructions that, when executed by a processor, causes to perform the method comprising
- acquiring an inter-sample similarity between every two pieces of sample data in M pieces of sample data, where M is a positive integer and the M pieces of sample data are M images;
- merging the M pieces of sample data into N initialization clustered clusters according to the acquired inter-sample similarity, where N is a positive integer smaller than M and each of the N initialization clustered clusters comprises at least one piece of sample data;
- and
- clustering and merging the N initialization clustered clusters to obtain multiple clustered clusters corresponding to the M pieces of sample data;
- wherein the acquiring an inter-sample similarity between every two pieces of sample data in the M pieces of sample data comprises:
- for each of the M images, performing feature extraction to obtain a feature vector of the image;
- and
- determining an inter-sample similarity between every two of the M images based on feature vectors of the two images;
- and
- wherein the merging the M pieces of sample data into N initialization clustered clusters according to the acquired inter-sample similarity comprises:
- for any two pieces of sample data in the M pieces of sample data, merging the two pieces of sample data into a suspected initialization clustered cluster when the inter-sample similarity of the two pieces of sample data is greater than a first threshold, so as to obtain multiple suspected initialization clustered clusters;
- and
- for the obtained multiple suspected initialization clustered clusters, merging at least two of the suspected initialization clustered clusters, both comprising a same subset having a number of pieces of sample data, which is greater than or equal to a second threshold, into an initialization clustered cluster.
Dependencies are inferred from the claim text.