A web application for analyzing ECG (Electrocardiogram) signals and detecting cardiac rhythm patterns. This tool is designed for healthcare professionals, researchers, and data scientists working with ECG data, offering automated rhythm segmentation and comprehensive analysis capabilities.
- Automated Rhythm Detection: Identifies and segments different cardiac rhythms
- Arrhythmia Detection: Specialized detection of PAC (Premature Atrial Contractions) and PVC (Premature Ventricular Contractions)
- Customizable Segmentation: Flexible window sizes and step parameters for detailed analysis
- Real-time Processing: Instant analysis of uploaded ECG recordings
- Interactive Plots: Visual representation of rhythm distributions
- Statistical Summaries: Comprehensive statistics for each rhythm type
- Beat Annotation Display: Clear visualization of beat annotations and intervals
- MIT-BIH Arrhythmia Database: Access to 48 half-hour recordings
- Long-Term AF Database: Support for 84 long-term ECG recordings
- Custom Upload Support: Compatible with WFDB format files
- Python 3.11 or higher
- pip package manager
- Clone the repository:
git clone https://github.com/KhaingSuThway/ECG_Analysis_Rhythm_Segmentation_Tool.git
cd ecg-analysis-tool
- Create and activate virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the application:
streamlit run .\src\app\streamlit_app.py
- Select database (MIT-BIH or LTAF)
- Choose a record number
- View rhythm statistics and visualizations
- Export analysis results in JSON format
- Upload WFDB format files (.dat, .hea, .atr)
- Configure analysis parameters
- Generate rhythm segments and statistics
- Download results for further analysis
- Rhythm Segmentation: Custom algorithms for detecting rhythm boundaries
- Beat Segmentation: Based on custom window size, the signal within specific rhythm boundaries are segmented
- Statistical Analysis: Comprehensive metrics for rhythm characterization
project_root/
├── src/
│ ├── __init__.py
│ ├── app/
│ │ ├── __init__.py
│ │ └── streamlit_app.py
│ └── processing/
│ ├── __init__.py
│ ├── rhythm_segmentation.py
│ └── read_record.py
├── setup.py
└── requirements.txt
- Generation of annotated single lead ECG datasets for AI/ML training
- Visualization of data distribution within the original dataset
Contributions are welcome! Please feel free to submit pull requests or create issues for bugs and feature requests.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support, please open an issue