Add pipeline tag and sample usage
#1
by nielsr HF Staff - opened
12345678910111213141516171819202122232425262728291 unmodified line31323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917013 unmodified lines18418518618718818924 unmodified lines21421521621721821922050 unmodified lines27127227327427527627727827928028128228328428528628728828929029129212 unmodified lines3053063073083093103113123133143153163177 unmodified lines32532632732832933033111 unmodified lines343344345346347348349350351352353354355356357358359360361362363364365---license: cc-by-nd-4.0language:- enlibrary_name: pytorchtags:- eeg- biosignal- mamba- state-space-model- cross-attention- foundation-model- self-supervised- masked-modeling- lejepa- topology-invariant- neurosciencedatasets:- TUEG- TUAB- APAVA- TDBrain- MoBI- SEED-V- Mumtaz2016- MODMAmetrics:- balanced_accuracy- roc_auc1 unmodified line- r2- pearson_r- cohen_kappathumbnail: https://raw.githubusercontent.com/pulp-bio/BioFoundation/refs/heads/main/docs/model/logo/LuMamba_logo.pngmodel-index:- name: LuMamba-Tiny (LeJEPA-reconstruction pre-training)results:- task:type: time-series-classificationname: EEG Abnormality Detectiondataset:type: TUABname: TUH EEG Abnormal Corpus (TUAB)metrics:- type: balanced_accuracyvalue: 80.99name: Balanced Accuracy (%)- type: roc_aucvalue: 0.883name: AUROC- type: pr_aucvalue: 0.892name: AUC-PR- task:type: time-series-classificationname: Alzheimer's Disease Detectiondataset:type: APAVAname: APAVAmetrics:- type: roc_aucvalue: 0.955name: AUROC- type: pr_aucvalue: 0.970name: AUC-PR- task:type: time-series-classificationname: Parkinson's Disease Detectiondataset:type: TDBrainname: TDBrainmetrics:- type: roc_aucvalue: 0.961name: AUROC- type: pr_aucvalue: 0.960name: AUC-PR- task:type: time-series-classificationname: Major Depressive Disorder Detectiondataset:type: Mumtaz2016name: Mumtaz2016metrics:- type: roc_aucvalue: 0.931name: AUROC- type: pr_aucvalue: 0.952name: AUC-PR- name: LuMamba-Tiny (Reconstruction-only pre-training)results:- task:type: time-series-classificationname: EEG Slowing Event and Seizure Detectiondataset:type: TUSLname: TUH EEG Slowing Corpus (TUSL)metrics:- type: roc_aucvalue: 0.708name: AUROC- type: pr_aucvalue: 0.289name: AUC-PR- task:type: time-series-classificationname: EEG Artifact Detectiondataset:type: TUARname: TUH EEG Artifact Corpus (TUAR)metrics:- type: roc_aucvalue: 0.914name: AUROC- type: pr_aucvalue: 0.510name: AUC-PR- task:type: time-series-classificationname: Gait Prediction Regressiondataset:type: MoBIname: MoBImetrics:- type: r2value: 0.116name: R-squared- type: rmsevalue: 0.1482name: Root Mean Squared Error- task:type: time-series-classificationname: 5-class Emotion Detectiondataset:type: SEED-Vname: SEED-Vmetrics:- type: balanced_accuracyvalue: 35.0name: Balanced Accuracy (%)- type: cohen_kappavalue: 0.191name: Cohen's Kappa- task:type: time-series-classificationname: Major Depressive Disorder Detectiondataset:type: MODMAname: MODMAmetrics:- type: balanced_accuracyvalue: 59.5name: Balanced Accuracy (%)- type: roc_aucvalue: 0.448name: AUROC- type: pr_aucvalue: 0.420name: AUC-PR---<div align="center"><img src="https://raw.githubusercontent.com/pulp-bio/BioFoundation/refs/heads/main/docs/model/logo/LuMamba_logo.png" alt="LuMamba Logo" width="800"/><h1>LuMamba: Latent Unified Mamba for ElectrodeTopology-Invariant and Efficient EEG Modeling</h1></div><p align="center"><a href="https://github.com/pulp-bio/BioFoundation">13 unmodified lines---## 🔒 License & Usage Policy (Weights)**Weights license:** The released model weights are licensed under **Creative Commons Attribution–NoDerivatives 4.0 (CC BY-ND 4.0)**. This section summarizes the practical implications for users. *This is not legal advice; please read the full license text.*24 unmodified lines- **Goal:** Efficient and topology-agnostic EEG modeling with linear complexity in sequence length.- **Core idea:** **Channel-Unification Module** uses **learned queries** (Q) with **cross-attention** to map any set of channels to a fixed latent space. **bidirectional Mamba blocks** then operate on that latent sequence.- **Pre-training data:** TUEG, **>21,000 hours** of raw EEG; downstream subjects removed to avoid leakage.- **Downstream tasks:** **TUAB** (abnormal), **TUAR** (artifacts), **TUSL** (slowing), **SEED-V** (emotion; unseen 62-ch montage), **APAVA** (Alzheimer's disease; unseen 16-ch layout, **TDBrain** (Parkinson's disease; unseen 26-ch layout)---50 unmodified lines---## 🔧 How to UseLuMamba weights are organized by pre-training configuration:- **`Reconstruction-only`** → variants pre-trained with masked reconstruction exclusively- **`LeJEPA-reconstruction`** → variants pre-trained with a balanced mixture of masked reconstruction and LeJEPA losses. Variants exist for two different LeJEPA hyperparameters: 128 and 300 projection slices.- **`LeJEPA-only`** → variant pre-trained with LeJEPA exclusively.All variants are pre-trained on TUEG.LuMamba experiments are categorized by two Hydra configurations, in `BioFoundation/config/experiments`:- **`LuMamba_finetune.yaml`** → configuration for fine-tuning experiments.- **`LuMamba_pretrain.yaml`** → configuration for pre-training experiments.---## 🔧 Fine-tuning — General Checklist0. **Install & read data prep**: clone the [BioFoundation repo](https://github.com/pulp-bio/BioFoundation), set up the environment as described there, then open `make_datasets/README.md` for dataset-specific notes (naming, expected folder layout, and common pitfalls).12 unmodified lines6. **Trainer/optimizer**: adjust `gpus/devices`, `batch_size`, `max_epochs`, LR/scheduler if needed.7. **I/O**: set `io.base_output_path` and confirm `io.checkpoint_dirpath` exists.To launch fine-tuning (Hydra):```bashpython -u run_train.py +experiment=LuMamba_finetune```---## ⚖️ Responsible AI, Risks & Biases7 unmodified lines## 🔗 Sources- **Code:** https://github.com/pulp-bio/BioFoundation- **Paper:** LuMamba: Latent Unified Mamba for Electrode Topology-Invariant and Efficient EEG Modeling (arxiv:2603.19100)---11 unmodified linesprimaryClass={cs.AI},url={https://arxiv.org/abs/2603.19100},}```---## 🛠️ Maintenance & Contact- **Issues & support:** please open a GitHub issue in the BioFoundation repository.------## 🔗 Related Models- **[LUNA](https://huggingface.co/PulpBio/LUNA)** — Transformer-based topology-agnostic EEG foundation model (NeurIPS 2025). Source of the channel-unification cross-attention module that LuMamba reuses.- **[FEMBA](https://huggingface.co/PulpBio/FEMBA)** — Bidirectional Mamba foundation model for EEG. Source of the linear-complexity temporal backbone that LuMamba reuses.- **[TinyMyo](https://huggingface.co/PulpBio/TinyMyo)** — Tiny foundation model for flexible EMG signal processing at the edge.## 🗒️ Changelog- **v1.0:** Initial release of LuMamba model card with task-specific checkpoints and instructions.123456789101112131415161718191 unmodified line2122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117213 unmodified lines18618718818919019119219319419519619719819920020120220320420520620720820921021121224 unmodified lines23723823924024124224350 unmodified lines29429529629729829912 unmodified lines3123133143153163177 unmodified lines32532632732832933033111 unmodified lines343344345346---datasets:- TUEG- TUAB- TUSL- TUAR- APAVA- TDBrain- MoBI- SEED-V- Mumtaz2016- MODMAlanguage:- enlibrary_name: pytorchlicense: cc-by-nd-4.0metrics:- balanced_accuracy- roc_auc1 unmodified line- r2- pearson_r- cohen_kappa- rmsepipeline_tag: othertags:- eeg- biosignal- mamba- state-space-model- cross-attention- foundation-model- self-supervised- masked-modeling- lejepa- topology-invariant- neurosciencethumbnail: https://raw.githubusercontent.com/pulp-bio/BioFoundation/refs/heads/main/docs/model/logo/LuMamba_logo.pngmodel-index:- name: LuMamba-Tiny (Reconstruction-only pre-training)results:- task:type: time-series-classificationname: EEG Abnormality Detectiondataset:name: TUH EEG Abnormal Corpus (TUAB)type: TUABmetrics:- type: balanced_accuracyvalue: 80.99name: Balanced Accuracy (%)- type: roc_aucvalue: 0.883name: AUROC- type: pr_aucvalue: 0.892name: AUC-PR- task:type: time-series-classificationname: Alzheimer's Disease Detectiondataset:name: APAVAtype: APAVAmetrics:- type: roc_aucvalue: 0.955name: AUROC- type: pr_aucvalue: 0.97name: AUC-PR- task:type: time-series-classificationname: Parkinson's Disease Detectiondataset:name: TDBraintype: TDBrainmetrics:- type: roc_aucvalue: 0.961name: AUROC- type: pr_aucvalue: 0.96name: AUC-PR- task:type: time-series-classificationname: Major Depressive Disorder Detectiondataset:name: Mumtaz2016type: Mumtaz2016metrics:- type: roc_aucvalue: 0.931name: AUROC- type: pr_aucvalue: 0.952name: AUC-PR- task:type: time-series-classificationname: EEG Slowing Event and Seizure Detectiondataset:name: TUH EEG Slowing Corpus (TUSL)type: TUSLmetrics:- type: roc_aucvalue: 0.708name: AUROC- type: pr_aucvalue: 0.289name: AUC-PR- task:type: time-series-classificationname: EEG Artifact Detectiondataset:name: TUH EEG Artifact Corpus (TUAR)type: TUARmetrics:- type: roc_aucvalue: 0.914name: AUROC- type: pr_aucvalue: 0.51name: AUC-PR- task:type: time-series-classificationname: Gait Prediction Regressiondataset:name: MoBItype: MoBImetrics:- type: r2value: 0.116name: R-squared- type: rmsevalue: 0.1482name: Root Mean Squared Error- task:type: time-series-classificationname: 5-class Emotion Detectiondataset:name: SEED-Vtype: SEED-Vmetrics:- type: balanced_accuracyvalue: 35.0name: Balanced Accuracy (%)- type: cohen_kappavalue: 0.191name: Cohen's Kappa- task:type: time-series-classificationname: Major Depressive Disorder Detectiondataset:name: MODMAtype: MODMAmetrics:- type: balanced_accuracyvalue: 59.5name: Balanced Accuracy (%)- type: roc_aucvalue: 0.448name: AUROC- type: pr_aucvalue: 0.42name: AUC-PR---<div align="center"><img src="https://raw.githubusercontent.com/pulp-bio/BioFoundation/refs/heads/main/docs/model/logo/LuMamba_logo.png" alt="LuMamba Logo" width="800"/><h1>LuMamba: Latent Unified Mamba for Electrode Topology-Invariant and Efficient EEG Modeling</h1></div><p align="center"><a href="https://github.com/pulp-bio/BioFoundation">13 unmodified lines---## 🔧 Sample Usage### Download WeightsYou can download all pre-trained variants and safetensors programmatically using `huggingface_hub`:```pythonfrom huggingface_hub import snapshot_download# downloads all pre-trained variants and safetensors into ./checkpoints/LuMambasnapshot_download(repo_id="PulpBio/LuMamba", repo_type="model", local_dir="checkpoints/LuMamba")```### Fine-tuningInclude the safetensors checkpoint path as input and run fine-tuning in the command line:```bashpython -u run_train.py +experiment=LuMamba_finetune \pretrained_safetensors_path=/absolute/path/to/checkpoints/LuMamba/LuMamba.safetensors```---## 🔒 License & Usage Policy (Weights)**Weights license:** The released model weights are licensed under **Creative Commons Attribution–NoDerivatives 4.0 (CC BY-ND 4.0)**. This section summarizes the practical implications for users. *This is not legal advice; please read the full license text.*24 unmodified lines- **Goal:** Efficient and topology-agnostic EEG modeling with linear complexity in sequence length.- **Core idea:** **Channel-Unification Module** uses **learned queries** (Q) with **cross-attention** to map any set of channels to a fixed latent space. **bidirectional Mamba blocks** then operate on that latent sequence.- **Pre-training data:** TUEG, **>21,000 hours** of raw EEG; downstream subjects removed to avoid leakage.- **Downstream tasks:** **TUAB** (abnormal), **TUAR** (artifacts), **TUSL** (slowing), **SEED-V** (emotion; unseen 62-ch montage), **APAVA** (Alzheimer's disease; unseen 16-ch layout), **TDBrain** (Parkinson's disease; unseen 26-ch layout)---50 unmodified lines---## 🔧 Fine-tuning — General Checklist0. **Install & read data prep**: clone the [BioFoundation repo](https://github.com/pulp-bio/BioFoundation), set up the environment as described there, then open `make_datasets/README.md` for dataset-specific notes (naming, expected folder layout, and common pitfalls).12 unmodified lines6. **Trainer/optimizer**: adjust `gpus/devices`, `batch_size`, `max_epochs`, LR/scheduler if needed.7. **I/O**: set `io.base_output_path` and confirm `io.checkpoint_dirpath` exists.---## ⚖️ Responsible AI, Risks & Biases7 unmodified lines## 🔗 Sources- **Code:** https://github.com/pulp-bio/BioFoundation- **Paper:** [LuMamba: Latent Unified Mamba for Electrode Topology-Invariant and Efficient EEG Modeling](https://arxiv.org/abs/2603.19100)---11 unmodified linesprimaryClass={cs.AI},url={https://arxiv.org/abs/2603.19100},}```
README.md+171-190