# TabNet Deep Model for Tachycardia Detection (MIMIC-IV ECG) This repository hosts a TabNet deep learning model trained to classify episodes of **tachycardia** based on ECG-derived measurements from the MIMIC-IV ECG dataset. ## ๐Ÿ” Problem Tachycardia is defined here as a **RR interval < 600ms**, derived directly from the `rr_interval` column. The goal is to predict the presence of tachycardia using temporal, positional and axis-based ECG features. ## ๐Ÿ“Š Dataset - Original Source: [MIMIC-IV ECG (v1.0)](https://physionet.org/content/mimic-iv-ecg/1.0/) - Processed via pandas and sklearn (see notebook). - Train/Val/Test split: - **Train**: 560,003 samples - **Val**: 120,026 samples - **Test**: 120,006 samples - Tachycardia distribution: ~17% Positive class (imbalanced) ## ๐Ÿง  Model - Architecture: [PyTorch TabNet](https://dreamquark-ai.github.io/tabnet/) - Type: Deep Tabular Neural Network - Framework: PyTorch - Training details: - Early Stopping: 27 epochs - Best Validation Accuracy: **98.67%** - Final Test Accuracy: **99.0%** - Precision (tachycardia): **1.00** - Recall (tachycardia): **0.90** - F1 Score (tachycardia): **0.95** ## ๐Ÿงช Results | Metric | Value | |---------------|----------| | Accuracy | 99.0% | | F1 Score | 0.95 | | Precision | 1.00 | | Recall | 0.90 | ## ๐Ÿ“ Files Included - `tabnet_deep_model.zip` โ†’ Trained TabNet model - `MIMIC_ECG_Tachycardia_Analysis.ipynb` โ†’ Full preprocessing + metrics ## ๐Ÿ›  How to Use ```python from pytorch_tabnet.tab_model import TabNetClassifier model = TabNetClassifier() model.load_model("tabnet_deep_model.zip") preds = model.predict(X_test) ``` ## โš ๏ธ License & Data Use This model was trained on the MIMIC-IV ECG dataset, which requires credentialed access via PhysioNet. Please ensure compliance with [PhysioNet's data use policy](https://physionet.org/about/policies/). --- Trained and released by [Mic52](https://huggingface.co/Mic52).