I want to know whether there are some common best practices for unsupervised detection of clusters / colors in images, in order to avoid spurious artifacts. To understand what I mean by 'spurious', here's an example.

Consider the following image:

Bart van der Leck, Composition #7

A "reasonable" human would infer 5 statistically significant colors in this image (4+background).

However, it may not be that simple for a computer to reach the same conclusion. For example here's what I get when I apply k-means clustering with the elbow method:

k-means clustering with elbow method

The method detects 8 colors instead of the expected 5. Upon inspection of the clusters, one finds that k-means finds 2 different backgrounds:

k-means spurious background

I suspect that this has to do with a slight color variation in the background which nevertheless gains statistical significance due to the fact that the image is mostly background.

Secondly, another 2 of the detected clusters have to do with edge artifacts. Here's one of them:

k-means edge artifacts

I hypothesize that this occurs due to aliasing, but I am not certain.

After manually disregarding the spurious clusters, one finally gets the expected answer, which is 5 clusters. However, this manual pruning may not be feasible in images with a larger number clusters.

My question therefore is: Are there common or "standard" best practices to avoid the above (or other commonly encountered) artifacts in automatic image cluster / color detection?


Your Answer

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

Browse other questions tagged or ask your own question.