I have a problem that doesn't seem to fall into a common machine learning category, and I was wondering if this still could potentially be solved with ML.

Problem: I have two signals recorded from two sensors, and would like to determine whether they are correlated (i.e. record the same physical event) or not.

The catch: I don't have access to the full signal time series of both sensors, but only one at a time - I can only exchange a small descriptor on the order of 32 bits to see if the signals match or not.

Our current approach is to calculate a bunch of numerical signal features such as mean, derivative, zero-crossings, FFT etc. and see which ones provide the best correlation - but that seems to be a lot of guesswork and doesn't work very well in any case.

So now I had the following idea:

  1. Start with a neural network which takes a fixed window out of the signal (+ possibly the FFT of that window) as an input, and produces a 32-bit output
  2. Pick two random correlated samples out of the pool of examples, and run the network twice, once with each sample (and its FFT)
  3. Take the difference between the two output values as error measure and perform backpropagation as usual
  4. Repeat from 2. until the difference for all examples is below a threshold

Here are my questions:

  1. Does this approach seem feasible at all?
  2. As someone relatively new to machine learning, how would I implement this?
  3. I've had a look at Keras - would this be a suitable starting point?

Thanks in advance, and best regards, Florian

Addendum: I've found this somewhat related post (Is it possible using tensorflow to create a neural network that maps a certain input to a certain output?), but I don't think that this is the same problem, as I don't actually care what the output looks like, just that it is as unique as possible for each matching pair of samples.


2 Answers 2


If I understood correctly your question, you want a function that takes a signal (a fixed window) and outputs a 32-bit representation in a way that the correlation between it and any other signal is preserved. Mathematically speaking given signals $s_1$ and $s_2$ in $S$ and a correlation function $corr(s_1, s_2)$ you want some function $f : S \rightarrow B$ (where $B$ is the space of 32-bit binary numbers) that you could use another correlation function for instance $corr_f(b_1, b_2) \approx corr(s_1, s_2)$.

If that is what you want you should at hashing techniques in particular learning to hash. Essentially in hashing want you do is you represent your input by binary numbers in a way that the hamming distance between the binary numbers preserves some target similarity (distance) function such as the correlation. In particular for cross-correlation (inner product) you have some methods based on random projections.

So once you have learned (designed) your hashing function $f$, what I would do is:

b1 = f(s1)
send b1
receive b1
b2 = f(s2)
return h(b2, b1) # this value is going to tell you if the signals are correlated
  • $\begingroup$ Many thanks for the pointer. After reading the introduction, I think that "DPSH: Feature learning based deep supervised hashing with pairwise labels" might be more or less exactly what I was thinking about. I'll have a closer look. $\endgroup$ Commented Dec 14, 2017 at 20:56
  • $\begingroup$ I've browsed through the paper, and the core idea is indeed exactly the same as in my original question. Beautiful :-) Thanks again for the answer. $\endgroup$ Commented Dec 14, 2017 at 21:11

For the record, the paper referred to from the comments above ("DPSH: Feature learning based deep supervised hashing with pairwise labels") is available on arXiv: https://arxiv.org/abs/1511.03855 The paper applies the same idea to images, but the principle is more or less exactly identical to my original proposal.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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