Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

First answer:

The number of clusters does not need to be related to the number of images you create to train the K-Means algorithm (=BOWKMeansTrainer).

So assuming you have 100 images, each image has maybe 2000 descriptors (can of course be much more), then you randomly choose let's say 500 000 descriptors of all the descriptors and train k-Means w. 10000 clusters. The number of clusters here are not really related to the number of images. It's more important how diverse your dataset and thus your features are. There exist plenty of publications trying to find out if more clusters give always better accuracy (typically this is the case, but often they saturate). However, with more clusters you choose, your BoW-descriptor also grows, which makes a fast search maybe more difficult.

What wonders me: do you maybe misunderstood the usage of BOWKMeansTrainer here? How do you classify the image later? The BOWKMeansTrainer doesn't have anything to do with K-neirest neighbor classification (there you could compute k-means to get the k-neirest neighbors).

Second answer

1mio clusters = 1mio x feature dimension = 1mio x 128 (if SIFT) = 128mio bytes. 128mio bytes are about 122Mb.

First answer:

The number of clusters does not need to be related to the number of images you create to train the K-Means algorithm (=BOWKMeansTrainer).

So assuming you have 100 images, each image has maybe 2000 descriptors (can of course be much more), then you randomly choose let's say 500 000 descriptors of all the descriptors and train k-Means w. 10000 clusters. The number of clusters here are not really related to the number of images. It's more important how diverse your dataset and thus your features are. There exist plenty of publications trying to find out if more clusters give always better accuracy (typically this is the case, but often they saturate). However, with more clusters you choose, your BoW-descriptor also grows, which makes a fast search maybe more difficult.

What wonders me: do you maybe misunderstood the usage of BOWKMeansTrainer or mis-used the term BOWKMeansTrainer here? How do you classify the image later? The BOWKMeansTrainer doesn't have anything to do with K-neirest neighbor classification (there classification, there you could compute k-means to get the k-neirest neighbors).neighbors - however, I'd create just a kd-tree or use the great flann-library to find nearest neighbors.

Second answer

1mio clusters = 1mio x feature dimension = 1mio x 128 (if SIFT) = 128mio bytes. 128mio bytes are about 122Mb.