I have a vector, here is a sample of some data from some heat flow data:enter image description here

I would like to identify features in this image. In the example above I have identified one feature I would like to automatically recognize. There are others I would like to identify. In this example, the data in all four vectors moves up at the same time, however this can happen at different rates and sometimes it can be delayed.

Like this one: enter image description here

My regular set of tools is inadequate for this type of problem. I have no problem detecting peaks or using thesholding. This is the first time I've had to do this with multi dimensional data. The other problem is the data is very noisy so peak detection and thresholding yeilds false positives.

I would like to plug this into a neural network and classify it, but the problem is in this 4x3000 vector I might only have 4 or 5 examples of features that I could train with. So it might be hard to train a CNN if I don't have many examples.

There are many tools that work with 1x(n col) vectors, but I need to detect patterns that coincide in all four vectors. Another problem I have is

How can I compare a 4x5 section of the 4x3000 matrix and find similarities?

The think I would really like to do is take a 4x5 matrix and compare it with the rest of the vector and see if and where it matches (so really there would be 2995 matrices of size 4x5). Are there neural networks that can make multidimensional comparisons like this?

  • 2
    $\begingroup$ You are mainly referring to supervised learning, (labeling the data and training the algorithm to learn to distinguish this categories). There is also unsupervised learning which you could apply. This family of algorithms tries to cluster the data into different groups. A comment from a naive person to your data: I have no idea which patterns you see in this example ;) ! $\endgroup$ Commented Oct 13, 2017 at 7:25

1 Answer 1


Assuming your time series are the same length, take your data and produce spectrograms, $S_k$, for each row of the $4 \times 3000$ data matrix $D$ that you have. Since these individual time series should be similar, this means you can try to extract features by stacking these spectrograms next to each other horizontally into a large matrix. So if you have $S_k$ as the spectrogram for row $k$, you can create the overall spectrogram as $S = \left[ S_1, \cdots, S_4\right]$.

From here, find the modulus of the elements (since they will be complex), and define the result as $\bar{S} = |S|$. Then I recommend performing a Non-negative Matrix factorization on $\bar{S}$ such that you get the low-rank approximation $\bar{S} \approx FW$ with some small specified number of features. $F$ in this case will be your features (they will be column vectors in $F$) and $W$ will be your new data in feature-space. You can look at $W$ to see where a given feature from $F$ appears. Given you've generated $F$, all you need to do to do to find $W$ for individual/new time series results is compute the spectrogram for that time series, call it $\hat{S}$, and then do $\hat{W} = F^{+} |\hat{S}|$ where $F^{+}$ is the pseudo inverse of $F$. Now you can look at $\hat{W}$ to get an idea of where certain features are being used and also build models using this lower dimensional representation.

Note that the number of features you use will have to be played with. I would look at the modulus of a sample spectrogram to get a feel for how much the frequencies are changing over time and consider roughly how many dominant features you think could be used to approximate it and then set the number of features as that to start. As an example, I have done this stuff above to identify different sounds in an audio clip and I only had to reduce it to the number of dominant sounds (there were 3 of them) so that hugely minimized my dataset size. Images from this example are shown below:

Spectrogram Modulus of Audio Sample

NMF Features

NMF Data in Feature Space - Weights

One thing you might consider as well is taking the separate data streams and trying to fuse them using some sort of filtering algorithm or using Hidden Markov Models. Then just perform the above spectrogram computations on the filtered result.

  • $\begingroup$ I will try this, this might be a good way to generate training data for a neural network. $\endgroup$ Commented Oct 13, 2017 at 18:37
  • $\begingroup$ @laptop2d it should be! $\endgroup$
    – spektr
    Commented Oct 13, 2017 at 18:55
  • $\begingroup$ @spektr, Is there a more concrete example of the idea? I had hard time to follow the steps. $\endgroup$ Commented Feb 16, 2023 at 19:01
  • $\begingroup$ @EricJohnson: sure, take a look at MP2 at this old github repo of mine. You can find the code and write up of what I did. Note that there are probably better tools now to achieve such a thing. github.com/choward1491/cs598PS_fall2017 $\endgroup$
    – spektr
    Commented Feb 17, 2023 at 18:43

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.