A deep learning framework that uses Graph Attention Networks (GAT) for time series classification. This project implements a novel approach to transform time series data into graph structures, enabling geometric deep learning techniques for analysis and classification.
- Time series are converted into graphs where:
- Each timestep becomes a node
- Edges connect neighboring timesteps within a window
- Node features include the time series value and normalized position
- Self-loops are added to allow nodes to maintain their own information
The GNNTimeSeriesClassifier
architecture includes:
- Input projection layer
- Two GAT layers with attention mechanisms
- Layer normalization for stability
- Global mean pooling for graph-level representations
- Final classification layers
- K-fold cross validation for reliable evaluation
- Early stopping to prevent overfitting
- Class weighting for imbalanced datasets
- Per-fold data normalization to prevent leakage
- Attention weights visualization
- Saliency maps
- ROC curves with confidence intervals
- Confusion matrices
- Time series examples
- Attention visualization for important timesteps
- Saliency analysis for feature influence
- Attention weight distributions
- Average attention profiles across samples
- Metrics:
- Accuracy
- Balanced accuracy
- Matthews Correlation Coefficient (MCC)
- AUC-ROC (for binary classification)
- Per-class metrics
- Bootstrap confidence intervals
- Support for UCR/UEA time series datasets
- Graph structure conversion
- Proper train/validation/test splitting
- Leakage-free data normalization
Saves detailed results including:
- Metrics with confidence intervals
- Visualizations
- Per-fold performance
- Classification reports
- Summary statistics (CSV/JSON)
*.ipynb
: Jupyter notebooks containing experimentsplots/
: Generated visualizationsresults/
: Experimental results and metrics
See requirements.txt
for detailed package dependencies.
- Clone the repository
git clone https://github.com/salilp42/TRAGIC.git
cd TRAGIC
- Install dependencies
pip install -r requirements.txt
- Run experiments through Jupyter notebooks
This project is licensed under the MIT License - see the LICENSE file for details.