<p>You may want to have a look at LSTNet, which does exactly that - <a href="https://arxiv.org/abs/1703.07015" rel="nofollow noreferrer">https://arxiv.org/abs/1703.07015</a> and <a href="https://github.com/laiguokun/LSTNet" rel="nofollow noreferrer">https://github.com/laiguokun/LSTNet</a></p>
How to combine LSTM and CNN in timeseries classification
<p>Most commonly CNN is used when there are images as data. However, I have seen that CNN are sometines used for timeseries. Therefore, I tried both LSTM and CNN models seperately for my timeseries classification problem. My two models are as follows.</p>

<p>LSTM:</p>

<pre><code>model = Sequential()
model.add(LSTM(200, input_shape=(25,3)))
model.add(Dense(100))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
</code></pre>

<p>CNN:</p>

<pre><code>model = Sequential()
model.add(Conv1D(200, kernel_size=3, input_shape=(25,3)))
model.add(Conv1D(200, kernel_size=2))
model.add(GlobalMaxPooling1D())
model.add(Dense(100))
model.add(Dense(1, activation='sigmoid'))
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])
</code></pre>

<p>I think LSTM and CNN has there unique characteristics and combining these two in my prediction will produce better results. However, I am struggling to find a suitable resource that suits my problem.</p>

<p>Is it possible to do this for my problem? If so how I can do it? Will it produce better results?</p>

<p>I am happy to provide more details if needed.</p>

<h2>EDIT:</h2>

<p>My problem setting is as follows. I have a dataset with about 5000 data points. Each data point has 3 time-series data that are exactly 25 in size. My labeled data is <code>1</code> or <code>0</code> (i.e. binary classification). More specifically my dataset looks as follows.</p>

<pre><code>node, time-series1, time_series2, time_series3, Label
n1, [1.2, 2.5, 3.7, 4.2, ... 5.6, 8.8], [6.2, 5.2, 4.7, 3.2, ... 2.6, 1.8], [1.0, 2.8, 3.9, 4.1, ... 5.2, 8.6] …, 1
n2, [5.2, 4.5, 3.7, 2.2, ... 1.6, 0.8], [8.2, 7.5, 6.7, 5.2, ... 4.6, 1.8], …, [1.2, 2.5, 3.7, 4.2, ... 5.2, 8.5] 0
and so on.
</code></pre>

<p>I input these data to my LSTM and CNN models.</p>