Efficient Clustering of Images Using VNFeaturePrintObservation.computeDistance

Hi everyone,

I'm working with VNFeaturePrintObservation in Swift to compute the similarity between images. The computeDistance function allows me to calculate the distance between two images, and I want to cluster similar images based on these distances.

Current Approach Right now, I'm using a brute-force approach where I compare every image against every other image in the dataset. This results in an O(n^2) complexity, which quickly becomes a bottleneck. With 5000 images, it takes around 10 seconds to complete, which is too slow for my use case.

Question Are there any efficient algorithms or data structures I can use to improve performance?

If anyone has experience with optimizing feature vector clustering or has suggestions on how to scale this efficiently, I'd really appreciate your insights. Thanks!

Efficient Clustering of Images Using VNFeaturePrintObservation.computeDistance
 
 
Q