Zing Forum

Reading

TCN+BiLSTM+Attention Mechanism: A Deep Learning Approach for Multivariate Time Series Pain Classification

This deep learning course project from Politecnico di Milano proposes a hybrid architecture integrating Temporal Convolutional Network (TCN), Bidirectional LSTM (BiLSTM), and attention mechanism. It ranked 32nd among 193 teams, fully demonstrating the entire workflow from data exploration to model training and providing a reproducible reference solution for time series classification tasks.

时间序列分类TCNBiLSTM注意力机制深度学习多变量时间序列疼痛预测Kaggle竞赛PyTorch
Published 2026-06-06 17:15Recent activity 2026-06-06 17:19Estimated read 7 min
TCN+BiLSTM+Attention Mechanism: A Deep Learning Approach for Multivariate Time Series Pain Classification
1

Section 01

Introduction: Application of TCN+BiLSTM+Attention Mechanism in Multivariate Time Series Pain Classification

A deep learning course project from Politecnico di Milano proposes a hybrid architecture integrating Temporal Convolutional Network (TCN), Bidirectional LSTM, and attention mechanism for multivariate time series pain classification tasks. This project achieved the 32nd place on the private leaderboard among 193 participating teams, fully demonstrating the entire workflow from data exploration to model training and providing a reproducible reference solution for time series classification tasks.

2

Section 02

Project Background and Challenges

This project comes from the 2025/2026 academic year competition of the "Artificial Neural Networks and Deep Learning" course at Politecnico di Milano (AN2DL Challenge1 on Kaggle platform). The task is to predict pain levels based on multivariate time series data. A total of 193 teams participated, with evaluation using public + private leaderboards (final ranking based on the private leaderboard). The team "I Neuroni Ribelli" did not use external data or pre-trained models, finally ranking 32nd on the private leaderboard and 131st on the public leaderboard. The dataset is "The Pirate Pain Dataset", including multi-dimensional time series data such as pain perception, subject characteristics, and joint angles. The target classification has three categories: no pain, mild pain, and severe pain.

3

Section 03

Core Model Architecture: PainTCNBiLSTMAttn

The hybrid architecture designed by the team integrates three time-series modeling techniques:

  1. TCN: Extracts multi-scale local features through causal convolution, dilated convolution, and residual connections, supporting parallel computing;
  2. BiLSTM: Bidirectional design captures historical and future contexts, modeling long-term dependencies;
  3. Attention Mechanism: Adaptively weights different time steps to improve key frame recognition ability and interpretability. Fusion strategy: Raw time series → TCN → BiLSTM → Attention → Classifier. The hierarchical design balances efficiency and sequence modeling capabilities.
4

Section 04

Experimental Methodology and Best Practices

The experiment adopts reasonable validation strategies: time series cross-validation, stratified sampling, and subject-level division to avoid data leakage. Feature engineering includes time-domain statistics (mean, variance, etc.), frequency-domain features (FFT transformation), difference features, and window aggregation. Model training uses cross-entropy loss, Adam/AdamW optimizers, combined with Dropout, weight decay regularization, and early stopping strategies to prevent overfitting.

5

Section 05

Competition Results and Performance Analysis

The team ranked 131st on the public leaderboard and jumped to 32nd on the private leaderboard, showing strong generalization ability. Reasons include: robust model architecture, effective regularization, reasonable validation strategy, and no external data to avoid distribution shift. This result reveals that the public leaderboard does not equal final performance in competitions, and reasonable validation is more important than parameter tuning.

6

Section 06

Technical Highlights and Extension Directions

Highlights: Complementary design of hybrid architecture (TCN for local extraction + BiLSTM for long-term modeling + Attention for focus), complete educational value (full workflow reproduction, modular code), practical toolchain (Git LFS, Jupyter, etc.). Application scenarios can be migrated to human action recognition, medical monitoring, industrial equipment monitoring, etc. Improvement directions: Introduce Transformer, multi-scale fusion, time-series data augmentation, and ensemble learning.

7

Section 07

Summary and Reflections

This project demonstrates the quality of an excellent course assignment: clear thinking, complete implementation, detailed documentation, and reproducible results. Technically, the hybrid architecture has excellent generalization ability in time series classification tasks; educationally, it provides an excellent reference case for beginners. The project is neither too simple nor too complex, and its effectiveness is verified by the competition results.