I have a hyperspectral image where the pixels are 21 channels. So each pixel $\in \mathbb{R}^{21}$. I want to perform clustering on the pixels with similarity defined by two different measures, one how close the pixels are, and the other how similar the pixel values are.

Thus if $X_1$ and $X_2$ are the locations of pixels $p_1$ and $p_2$ I have: $$S_X = \|X_1-X_2\|^2_2$$ and $$S_p = \|p_1-p_2\|^2_2$$.

I have seen these measures combined into a single measure like this: $$ S= e^{-\frac{S_p}{\sigma^2_p}} \times \,\, e^{-\frac{S_X}{\sigma^2_X}} $$

My question: Is there a right way and a wrong way to combine measures like this, or if it improves my clustering can I combine the measures in any way that suits me?

My question is vaguely related to Combining multiple similarity measures.

  • 2
    $\begingroup$ It probably is so highly application and data dependant that we cannot answer this question. $\endgroup$ Jun 10, 2013 at 21:34
  • $\begingroup$ For reference, this similarity measure is the same as used in bilateral filtering, which is an edge-preserving smoothing filter commonly used in robust image denoising (e.g. for pre-processing in an image-segmentation pipeline). $\endgroup$
    – GeoMatt22
    Sep 18, 2016 at 16:01

1 Answer 1


Anony-Mousse is right. There is no universal optimal similarity measure and the benefit of each measure depends in the problem.

In order to evaluate the benefit of a similarity measure in a specific problem, I like to reduce it into a classification problem. Given the dataset of items you have create a new dataset of item pairs. The concept should be whether the two items in a pair are similar. Each similarity measure you have is a feature of the pair. Note that now you are in the good old classification framework. You can evaluate the similarity measures by computing the mutual information/accuracy/your chosen metric given the concept.

  • $\begingroup$ To be clear, doing so requires you to judge whether a given pair is similar or not for a potentially fairly large number of pairs. You'll also have to use a fairly consistent threshold for "yes, similar" vs "no, dissimilar" – so having multiple annotators, or doing the annotation over a length of time, can become problematic. $\endgroup$
    – Danica
    Aug 10, 2015 at 6:17
  • $\begingroup$ Sure, I agree. Classification requires labelling. Sometime you can use domain based knowledge in order to automatically classify but now we return to problem specific details. $\endgroup$
    – DaL
    Aug 10, 2015 at 6:25

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.