kvuvuv
ecg-research-skill
A DeepSeek Harness research skill for ECG signal processing, experiment design, reproducibility, scientific visualization and paper writing.
- Stars
- 0
- Language
- —
- Created
- Aug 15, 2026
- Updated
- Aug 15, 2026
Introduction
ECG Research Skill
A research-grade operating standard for electrocardiogram (ECG) signal processing, designed for graduate-level research in biomedical signal analysis, machine learning, scientific visualization, and academic writing.
The purpose of this project is not merely to provide ECG-related knowledge. It defines a structured research workflow and a set of methodological constraints that enable ECG research to be conducted in a rigorous, reproducible, and scientifically responsible manner — whether executed by a researcher directly or delegated to an AI-assisted research workflow.
Overview
ecg-research is intended for biomedical engineering and physiological signal processing research involving topics such as:
- ECG preprocessing
- Baseline wander removal
- Power-line interference suppression
- Signal quality assessment
- R-peak detection
- QRS detection
- P-QRS-T delineation
- Heartbeat segmentation
- Heart rate variability (HRV)
- Arrhythmia classification
- Atrial fibrillation detection
- PVC / PAC detection
- Morphological ECG analysis
- Time-domain analysis
- Frequency-domain analysis
- Time-frequency analysis
- Classical machine learning
- Deep learning
- 1D CNN
- RNN / LSTM / GRU
- Transformer-based ECG models
- Self-supervised learning
- Single-lead ECG
- Multi-lead ECG
- Wearable ECG
- PhysioNet datasets
- Scientific visualization
- Statistical evaluation
- Reproducible experiments
- Academic paper writing and review
Design Philosophy
This project follows several core principles:
- Scientific correctness is more important than simply producing runnable code.
- Patient-level data leakage must be actively prevented.
- Experimental parameters must be recorded and reproducible.
- Preprocessing must be justified according to the ECG task.
- Test data must never be used for hyperparameter optimization.
- Statistical conclusions must match the experimental design.
- Figures should be publication-ready rather than merely visually attractive.
- Literature references must not be fabricated.
- Experimental results must never be invented.
- AI-generated ECG analysis should be treated as research assistance, not clinical diagnosis.
Key Research Safeguards
Patient-level splitting
One of the most important rules of this project is preventing subject leakage.
For ECG datasets containing multiple beats or segments from the same patient, avoid naive beat-level random splitting such as:
train_test_split(all_beats)
when beats from the same subject may appear in both training and test sets.
Prefer strategies such as:
- patient-wise split
- subject-wise split
- record-wise split
GroupKFoldStratifiedGroupKFold
The standard encourages researchers to explicitly ask:
Can data from the same patient appear in both the training and test sets?
If the answer may be yes, the experiment design should be reviewed before continuing.
ECG Processing Workflow
A typical ECG workflow supported by this project is:
Raw ECG
↓
Dataset inspection
↓
Signal quality assessment
↓
Baseline / noise processing
↓
Filtering
↓
R-peak / QRS detection
↓
Beat segmentation / delineation
↓
Feature extraction or representation learning
↓
Model training
↓
Patient-level validation
↓
Statistical evaluation
↓
Publication figures
↓
Research interpretation
Each important processing step should record its parameters and rationale.
Recommended Python Stack
The project encourages the use of established scientific libraries whenever appropriate:
NumPy
SciPy
Pandas
Matplotlib
scikit-learn
WFDB
NeuroKit2
PyWavelets
statsmodels
PyTorch
Typical roles include:
- WFDB — PhysioNet ECG and annotation handling
- SciPy — filtering, resampling, spectral analysis
- NeuroKit2 — ECG preprocessing and physiological signal analysis
- scikit-learn — traditional ML and grouped validation
- PyTorch — deep learning
- Matplotlib — publication-quality scientific visualization
Publication Figure Guidelines
The project includes rules for producing publication-ready ECG figures.
Typical figures include:
- Raw vs. filtered ECG
- Baseline wander removal
- R-peak detection
- P-QRS-T delineation
- Beat morphology comparison
- RR tachogram
- HRV visualization
- Power spectral density
- Time-frequency analysis
- Feature distributions
- Confusion matrix
- ROC curve
- Precision-recall curve
- Ablation study
- Model architecture
- Research workflow diagrams
Figures should generally include:
- clear axis labels
- physical units
- readable font sizes
- consistent model colors
- controlled line widths
- accessible visual encoding
- vector export when possible
Recommended output formats:
PDF
SVG
PNG
Repository Structure
ecg-research/
├── LICENSE
├── README.md
├── SKILL.md
└── references/
├── ecg-signal-processing.md
├── experiment-design.md
├── statistics.md
├── publication-figures.md
├── paper-writing.md
└── reviewer-checklist.md
SKILL.md
The main entry point.
It defines:
- when the standard should be activated
- core ECG research rules
- research workflow
- methodological safeguards
- which reference documents should be loaded for different tasks
references/ecg-signal-processing.md
Detailed ECG signal-processing guidelines, including:
- sampling rate
- filtering
- baseline wander
- power-line interference
- QRS detection
- delineation
- heartbeat segmentation
- HRV
- spectral analysis
references/experiment-design.md
Guidelines for:
- dataset splitting
- leakage prevention
- baselines
- model training
- ablation studies
- external validation
- reproducibility
references/statistics.md
Guidelines for:
- statistical tests
- confidence intervals
- effect sizes
- multiple comparisons
- model evaluation metrics
references/publication-figures.md
Scientific visualization rules for ECG research and manuscript preparation.
references/paper-writing.md
Guidelines for writing:
- Methods
- Results
- Discussion
- Limitations
- figure captions
- scientific claims
references/reviewer-checklist.md
A reviewer-style checklist for identifying problems in:
- signal processing
- experimental design
- machine learning
- statistics
- reproducibility
- manuscript claims
Example Research Workflow
For a project such as:
Patient-level atrial fibrillation detection using single-lead ECG
the standard may guide the research process through:
Research Question
↓
Literature Review
↓
Dataset Inspection
↓
Patient-level Split
↓
ECG Preprocessing
↓
Baseline Models
↓
Proposed Model
↓
Training
↓
Internal Validation
↓
External Validation
↓
Statistical Analysis
↓
Ablation Study
↓
Publication Figures
↓
Manuscript
↓
Reviewer-style Audit
Multi-Agent Research
The project is designed to work well with multi-agent research systems.
A possible ECG research team is:
PI / Research Planner
│
├── Literature Agent
├── ECG Signal Processing Agent
├── Machine Learning Agent
├── Statistics Agent
├── Reproducibility Agent
├── Figure Agent
└── Paper Reviewer
This separation helps reduce the risk of allowing the same agent to design, execute, evaluate, and review its own experiment without independent checks.
Example Prompt
Use the ECG Research Skill to design a rigorous experiment for
single-lead atrial fibrillation detection.
Dataset: PhysioNet ECG data.
Please first create:
1. Research question
2. Hypothesis
3. Dataset inspection checklist
4. Patient-level split strategy
5. ECG preprocessing pipeline
6. Baseline models
7. Proposed model
8. Evaluation metrics
9. Statistical analysis plan
10. Ablation study
11. Publication figure plan
12. Reproducibility checklist
Do not implement the model until the experimental design has been reviewed.
Research Integrity
This project explicitly discourages fabricating:
- experimental results
- statistical significance
- confusion matrices
- model performance
- citations
- DOI numbers
- PMID numbers
- datasets
- clinical conclusions
When an experiment has not actually been executed, outputs should be clearly labeled as:
Expected output
or:
Illustrative example
rather than presented as real experimental evidence.
Clinical Disclaimer
This project is intended for research and educational use.
ECG-related model predictions generated with this standard should not be interpreted as clinical diagnoses or used as a substitute for qualified medical assessment.
Any translation of an ECG algorithm into a clinical system requires appropriate clinical validation, regulatory evaluation, and professional oversight.
Status
This project is under active development.
Planned improvements may include:
- additional ECG dataset guidelines
- PhysioNet workflow templates
- PTB-XL research templates
- MIT-BIH evaluation templates
- HRV-specific workflows
- ECG foundation model guidelines
- additional publication figure styles
- manuscript reviewer templates
- automated reproducibility checks
Contributing
Suggestions, corrections, ECG research workflows, and methodological improvements are welcome.
When proposing changes, preference should be given to:
- scientifically justified recommendations
- reproducible methods
- established ECG processing practices
- reliable primary literature
- clear separation between research use and clinical claims
License
This project is released under the MIT License.