Multivariate Time series analysis: When is a CNN vs. LSTM appropriate?

4

1

I have multiple features in a time series and want to predict the values of the same features for the next time step. I have already trained an LSTM which is working okay, but takes a bit long to train.

So now my question: is it reasonable to use a CNN instead of an LSTM, even though it is a time series? Are there any indicators for when you should never switch to a CNN?

drops

Posted 2020-07-20T14:01:33.920

Reputation: 160

You can use both- First few Conv1D layers and then few LSTM layers. You can also put the LSTM layers into Bidirectional layers. Another option is ConvLSTM2D layers which combines both CNN and LSTM into a single layer. You can also try to create an auto-encoder. There are multiple options and you should try them to see what fits your data best. – David Arenburg – 2020-07-28T08:05:46.340

Answers

3

Is it reasonable to use a CNN instead of an LSTM, even though it is a time series?

Yes, it is. Convolutional Neural Networks are applied to any kind of data in which neighboring information is supposedly relevant for the analysis of the data.

CNN are very popular with images, where data is correlated in space, and in video, where correlation happens both in space and time.

Are there any indicators for when you should never switch to a CNN?

CNNs are limited in a sense: they have a rigid, forward structure.

If you are trying to perform:

  • classification in sequences that have varying length ($N$ to $1$);
  • trying to output another sequence which has no fixed proportion between their length and the length of the input ($N$ to $M$).

Simple feed-forward neural networks will fail (due to dimension inconsistency). So, in that case you should use a recursive neural network such as a LSTM.

Pedro Henrique Monforte

Posted 2020-07-20T14:01:33.920

Reputation: 1 366

0

A time series represents a temporal sequence of data - and generally for sequential data LSTM is the preferred DNN algorithm as it handles sequences much better . CNN generally becomes useful when you want to capture neighbourhood information like in an image.

having said this , please refer this article on how to use CNN for multivariate time series : [https://machinelearningmastery.com/how-to-develop-convolutional-neural-network-models-for-time-series-forecasting/#:~:text=%5B%5B101.67965%5D%5D-,Multivariate%20CNN%20Models,Multiple%20Parallel%20Series]

vivek

Posted 2020-07-20T14:01:33.920

Reputation: 47

"neighbourhood information like in an image" an image is a sequence (sequence = ordered data) – Chopin – 2020-07-27T14:48:50.830

0

In general you need to think about how your data behave. If your data depends on its neighbours, CNN could be a solution. If it’s like a sequence and closely relate to its neighbours then RNN could be good. If you instead see you need longer memory across, then LSTM is required. So it all depends on what you are working on.

user101428

Posted 2020-07-20T14:01:33.920

Reputation: