Research map / Time series / Foundation models for time series
Medformer: A Multi-Granularity Patching Transformer for Medical Time-Series Classification
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes Medformer, a transformer for medical time series classification that uses cross-channel multi-granularity patching and two-stage intra/inter-granularity attention, evaluated on five EEG/ECG datasets against ten time-series transformer baselines.
Problem
Medical time series (EEG, ECG) classification has been dominated by handcrafted features and CNNs; existing time-series transformers use token embeddings that miss multi-timestamp, cross-channel, and multi-scale patterns needed for MedTS diagnosis.
Approach
Embed patches spanning all channels (cross-channel patching) at multiple patch lengths (granularities), then apply a router-based two-stage self-attention: intra-granularity attention within each scale and inter-granularity attention among per-scale router tokens, plus embedding augmentation.
Key results
- Under the subject-independent setup, Medformer achieves the top F1 on 4 of 5 datasets (e.g., 76.31% F1 on APAVA, 50.65% on ADFTD per Table) and the best average rank across six metrics.
- Under the subject-dependent setup on ADFTD, Medformer reaches 97.62% accuracy and 97.50% F1, top-1 on all six metrics.
- Module study: removing multi-channel patching reduces F1 by about 6.10% on average; removing embedding augmentation about 4.46%; removing inter-granularity attention about 3.64%.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add inter-granularity self-attention (ablation) | Medformer · Five datasets | F1 score: 3.64% | Helped |
| add embedding augmentation (ablation) | Medformer · Five datasets | F1 score: 4.46% | Helped |
| use cross-channel rather than single-channel patching (ablation) | Medformer · Five datasets | F1 score: 6.10% | Helped |
| use repeated patch lengths instead of one patch length (ablation) | Medformer · APAVA | Performance across evaluated metrics | Mixed |
| mix different patch lengths (for example, {2,2,4,16,32}) (ablation) | Medformer · APAVA | Performance across evaluated metrics | Mixed |
| vary the patch length configuration (ablation) | Medformer · MedTS classification | Performance | Mixed |
Surprising findings
- Subject-dependent results (ADFTD F1 97.50%) are far higher than subject-independent results (50.65%), showing that subject leakage inflates reported performance.
- Mixing different patch lengths does not guarantee improvement; some multi-granularity configurations perform worse than uniform patch lengths.
Limitations
- Performance depends on careful tuning of patch length lists; some combinations underperform uniform lengths.
- No mechanism specifically designed for subject-independent generalization; subject-independent scores remain low (e.g., ADFTD F1 50.65%).
- Evaluation restricted to 5 EEG/ECG datasets and the subject-independent setup emphasis.
Experimental setup
Datasets: APAVA TDBrain ADFTD PTB PTB-XL UEA human activity recognition datasets
Benchmarks: APAVA TDBrain ADFTD PTB PTB-XL
Metrics: accuracy macro precision macro recall macro F1 macro AUROC macro AUPRC
Baselines: Autoformer Crossformer FEDformer Informer iTransformer MTST Nonformer PatchTST Reformer Transformer
Builds on: PatchTST Crossformer Time-Series-Library scaled dot-product attention transformer
Closest papers by meaning
- GEM: Empowering MLLM for Grounded ECG Understanding with Time Series and Images (NeurIPS 2025 · similarity 0.85)
- Revitalizing Medical Time Series with Vision-Informed Retrieval: A Vision-Language Perspective (NeurIPS 2026 · similarity 0.85)
- XTSFormer: Cross-Temporal-Scale Transformer for Irregular-Time Event Prediction in Clinical Applications (AAAI 2025 · similarity 0.84)
- From Token to Rhythm: A Multi-Scale Approach for ECG-Language Pretraining (ICML 2025 · similarity 0.84)
- MPTSNet: Integrating Multiscale Periodic Local Patterns and Global Dependencies for Multivariate Time Series Classification (AAAI 2025 · similarity 0.84)
- JoLT: Jointly Learned Representations of Language and Time-Series for Clinical Time-Series Interpretation (Student Abstract) (AAAI 2024 · similarity 0.84)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
