This repository contains the code, notebooks, figures, and documentation for a machine learning framework that classifies upper-extremity rehabilitation activities from wearable IMU data using Random Forest and LSTM models. The project uses the PrimSeq (StrokeRehab) dataset and achieves 92.5% accuracy under LOSO validation.
Key features:
- Stratified sampling and feature engineering.
- Comparative analysis (RF vs. LSTM).
- Few-shot personalization.
- Interpretable insights (e.g., feature importance, ROC curves).
This is based on a 67-page research document (see /docs/) and Jupyter notebooks for full reproducibility.
- Python 3.8+
- Install dependencies:
pip install -r requirements.txt(Example contents: numpy, pandas, scikit-learn, tensorflow, matplotlib)
/notebooks/: Jupyter notebooks for data processing, model training, and evaluation./code/: Utility scripts./figures/: Generated plots (e.g., confusion matrices, ROC curves)./tables/: CSV/text files for results (e.g., performance metrics)./docs/: Full 67-page PDF report with embedded code and figures./data/: Small data samples; full data hosted externally (see below).
- Clone the repo:
git clone https://github.com/rudra496/Stroke.git - Install deps:
pip install -r requirements.txt - Download full data: Run
bash download_data.sh(links to Zenodo/Figshare). - Open notebook:
jupyter notebook notebooks/main_analysis.ipynb - Train model: Follow cells for sampling, training, and evaluation.
Example output: 92.5% accuracy on test set.
- Sample Data: In
/data/sample_data.csv(small subset for testing). - Full 1GB Dataset: Hosted on [Zenodo DOI: insert-your-DOI-here] (or Kaggle/Figshare link). Download and place in
/data/full/(ignored by .gitignore).- Why external? To keep repo lightweight; full data includes raw IMU readings from 40 subjects.
- See
/tables/performance.csvfor metrics. - Figures in
/figures/match the paper (e.g., ROC with AUC 0.95).
If using this work, cite: