1
$\begingroup$

I have some face images(of a single person), which I ran through an embedding generator to get 128-dimensional embedding.

I have 1000 such embedding (shape of the dataset (1000, 128)). I have a restriction on the number of embeddings that can be used to train the model (100 embeddings). I want to pick 100 embeddings from all 1000 which will represent all 1000 embeddings.

My question is, how can I choose the best 100 embeddings which will represent the entire 1000 embeddings.

Some things I have tried out.

  1. Picking the 100 farthest points in the cluster. (all the images are edge cases like blurred image, improper pose e.t.c)
  2. Random sampling ( works ok but sometimes pick embeddings which were calculated from a face which was having some problem, like blurred e.t.c.)

There is one more thing, I have thought of but not tested. Sampling with probability. Probability = 1/(euclidean_distance of point from cluster centroid).

I wanted to know if there are any alternatives, that I can look into which can provide better results.

$\endgroup$
1
  • 1
    $\begingroup$ Welcome to DataScience. It's not my domain but my intuition would be to first clean up the dataset, i.e. remove all the "bad" images (you might be able to use the same technique as point 1 in order to find them more easily). Once this is done any random sample should work. $\endgroup$ – Erwan Jan 29 at 0:40
0
$\begingroup$

One option is to use something like seeding technique of k-means++ to pick representative sample of data points. K-means++ picks each subsequent cluster center from the remaining data points with probability proportional to its squared distance from the point's closest existing cluster center.

$\endgroup$
0
$\begingroup$

One approach will be to run an unsupervised clustering algorithm of your choosing, parameterized to return a 100-cluster solution. If there are indeed groups of images, you should see that similar images fall into the same cluster. You can then select a representative image from each cluster, perhaps identified as the image with the highest average correlation with or lowest average distance from other images in the same cluster. This will help you avoid oversampling images that have high similarity, although you may want to look out for highly distinct singleton clusters - those might be useful datapoints, or just outliers that you might not want to train on at all.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.