{"id":14977250,"url":"https://github.com/truongnmt/deepecg","last_synced_at":"2025-10-28T03:30:39.275Z","repository":{"id":113233484,"uuid":"131585924","full_name":"truongnmt/DeepECG","owner":"truongnmt","description":"Using deep learning to detect Atrial fibrillation","archived":false,"fork":false,"pushed_at":"2021-12-15T03:10:03.000Z","size":1175,"stargazers_count":31,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T10:41:37.312Z","etag":null,"topics":["atrial-fibrillation","cardio","csv","dataset","deep-learning","ecg","ecg-qrs-detection","electrocardiogram","gnuplot","ipynb","keras","mat","neural-network","python","rhythm","shell","signal","tensorflow","wfdb"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/truongnmt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-04-30T11:08:10.000Z","updated_at":"2024-06-27T06:57:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"10a686da-25ee-45b1-a241-9f3a4a41d0aa","html_url":"https://github.com/truongnmt/DeepECG","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truongnmt%2FDeepECG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truongnmt%2FDeepECG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truongnmt%2FDeepECG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/truongnmt%2FDeepECG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/truongnmt","download_url":"https://codeload.github.com/truongnmt/DeepECG/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238590593,"owners_count":19497351,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atrial-fibrillation","cardio","csv","dataset","deep-learning","ecg","ecg-qrs-detection","electrocardiogram","gnuplot","ipynb","keras","mat","neural-network","python","rhythm","shell","signal","tensorflow","wfdb"],"created_at":"2024-09-24T13:55:21.490Z","updated_at":"2025-10-28T03:30:38.816Z","avatar_url":"https://github.com/truongnmt.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DeepECG\n\n## Basic Overview\nAtrial Fibrillation detection with a deep probabilistic model. Backend for [Diagnose Report ](https://github.com/truongnmt/diagnose-report) app. Use [PhysioNet dataset](https://physionet.org/challenge/2017/) for model training and testing.\n\n## Dependencies\nThe following dependencies are required.\n* Python\n* [Tensorflow](https://www.tensorflow.org/install/)\n* [Keras](https://keras.io/)\n* [Cardio Framework](https://github.com/analysiscenter/cardio)\n\n\n## Demo\nDemo from the frontend: [Diagnose Report ](https://github.com/truongnmt/diagnose-report) app.\n\n|Sign Up|Dashboard|Report detail| Create report|\n|-|-|-|-|\n|![](https://github.com/truongnmt/diagnose-report/blob/master/screenshots/signup.png)|\u003cimg src=\"https://github.com/truongnmt/diagnose-report/blob/master/screenshots/dashboard.png\" width=\"850\" /\u003e|![](https://github.com/truongnmt/diagnose-report/blob/master/screenshots/report_detail.png)|![](https://github.com/truongnmt/diagnose-report/blob/master/screenshots/create_report.png)|\n\n\n## Usage\nI have already ran training for you. You can use the saved model in `dirichlet_model` folder to predict right away.\nBut make sure to change the path in `direchlet_model/checkpoint` according to your path.\n\nIf you want to train again by yourself, run this following notebook file: [dirichlet_model_training.ipynb](https://github.com/truongnmt/DeepECG/blob/master/dirichlet_model_training.ipynb), download the [dataset](https://physionet.org/challenge/2017/) and start training. Notice that on 1000 epochs, the training will take some time. Mine took about 8-9 hours on Tesla K80.\n\nFor the project I'm working on, I create some shell file and python files to convert and predict stuffs.\n\n* To predict whether an image is AF (Atrial Fibrillation) or not:\n```shell\npredict \u003cimage file path\u003e\n```\nIt will return something like this\n```js\n[{'target_pred': {'A': 0.021675685, 'NO': 0.9783243},\n  'uncertainty': 0.0073926448822021484}]\n```\nWhich `A` is – Atrial fibrillation\n`N` – Normal rhythm, `O` – Other rhythm, so `NO` is no problem.\n\nSee more in [test.ipynb](https://github.com/truongnmt/DeepECG/blob/master/test.ipynb) for more test case and example.\n\n* To generate image from csv:\n```shell\ngnuplot -e \"fileIn='csv/04015.csv'; fileOut='uploads/04015.png'\" csv2img.gnuplot\n```\n\n* To convert single file to csv and image:\n```shell\n./raw2img \u003cfilename without extension\u003e\n```\n\n* To convert image to csv:\n```shell\npython img2csv.py '\u003cfull path to file\u003e'\n```\n\n* To convert MAT to csv:\n```shell\npython mat2csv.py \"raw/A00001.mat\"\n```\n\n* To convert csv to signal, with Gain equal 1000, Frequency 300Hz. Notice that you can specify `-f` mean from which line (remove if from beginning of file) and also `-t` mean to which line.\n```shell\nwrsamp -i raw/A00001.csv -o raw/A00001-converted -G 1000 -F 300 -z\n```\n\n* To convert signal back to MAT:\n```shell\nwfdb2mat -r raw/A00001-converted\n```\n\n## License\nThis project is licensed under the terms of the **MIT** license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruongnmt%2Fdeepecg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftruongnmt%2Fdeepecg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftruongnmt%2Fdeepecg/lists"}