DeepECG
Using deep learning to detect Atrial fibrillation
Install / Use
/learn @truongnmt/DeepECGREADME
DeepECG
Basic Overview
Atrial Fibrillation detection with a deep probabilistic model. Backend for Diagnose Report app. Use PhysioNet dataset for model training and testing.
Dependencies
The following dependencies are required.
- Python
- Tensorflow
- Keras
- Cardio Framework
Demo
Demo from the frontend: Diagnose Report app.
|Sign Up|Dashboard|Report detail| Create report|
|-|-|-|-|
|
|<img src="https://github.com/truongnmt/diagnose-report/blob/master/screenshots/dashboard.png" width="850" />|
|
|
Usage
I have already ran training for you. You can use the saved model in dirichlet_model folder to predict right away.
But make sure to change the path in direchlet_model/checkpoint according to your path.
If you want to train again by yourself, run this following notebook file: dirichlet_model_training.ipynb, download the dataset and start training. Notice that on 1000 epochs, the training will take some time. Mine took about 8-9 hours on Tesla K80.
For the project I'm working on, I create some shell file and python files to convert and predict stuffs.
- To predict whether an image is AF (Atrial Fibrillation) or not:
predict <image file path>
It will return something like this
[{'target_pred': {'A': 0.021675685, 'NO': 0.9783243},
'uncertainty': 0.0073926448822021484}]
Which A is – Atrial fibrillation
N – Normal rhythm, O – Other rhythm, so NO is no problem.
See more in test.ipynb for more test case and example.
- To generate image from csv:
gnuplot -e "fileIn='csv/04015.csv'; fileOut='uploads/04015.png'" csv2img.gnuplot
- To convert single file to csv and image:
./raw2img <filename without extension>
- To convert image to csv:
python img2csv.py '<full path to file>'
- To convert MAT to csv:
python mat2csv.py "raw/A00001.mat"
- To convert csv to signal, with Gain equal 1000, Frequency 300Hz. Notice that you can specify
-fmean from which line (remove if from beginning of file) and also-tmean to which line.
wrsamp -i raw/A00001.csv -o raw/A00001-converted -G 1000 -F 300 -z
- To convert signal back to MAT:
wfdb2mat -r raw/A00001-converted
License
This project is licensed under the terms of the MIT license.
Related Skills
openai-image-gen
330.3kBatch-generate images via OpenAI Images API. Random prompt sampler + `index.html` gallery.
claude-opus-4-5-migration
81.3kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
330.3kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
49.6k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
