Squeeze-and-excitation meets LSTM for multivariate time series
A Keras implementation that bolts attention-style gating onto LSTM-FCN models for classifying multi-sensor data.

What it does
This repo implements MLSTM-FCN and MALSTM-FCN, neural architectures for time series classification when you have multiple input variables (think: several sensors, several stock tickers). It wraps the LSTM-FCN and ALSTM-FCN models from prior work with a squeeze-and-excitation block that learns to reweight channels. Four model variants are included, each toggled by uncommenting a different generate_model_*() line.
The interesting bit
The squeeze-and-excitation block is the twist: it adds a lightweight attention mechanism across variable channels, letting the model learn which sensors matter and when. The README also notes a deliberate tensor shuffle in the input pipeline—variables and timesteps are swapped going into LSTM versus CNN branches, which is equivalent to the paper’s formulation but keeps the Keras implementation cleaner.
Key highlights
- Four model variants: MLSTM-FCN, MALSTM-FCN, plus the original LSTM-FCN and ALSTM-FCN baselines
- Pre-trained weights and per-dataset training scripts provided for benchmark evaluation
- Multivariate datasets available via GitHub Releases (with academic citation requirements)
- TensorFlow-only Keras backend; Theano and CNTK explicitly not supported
- Results tables included for comparison across multiple benchmark datasets
Caveats
- No support for modern Keras 3.x or PyTorch; this is legacy TF-Keras code
- The “???????” weight prefix strings in training scripts are described as “already provided”—unclear if this means hardcoded or placeholder
- Installation is manual (
pip install -r requirements.txt); no PyPI package
Verdict
Worth a look if you’re reproducing the 2018 paper or need a baseline for multivariate time series classification. Skip it if you want a maintained, modern framework—this is reference code that has aged in place.