Atrial Fibrillation detection with a deep probabilistic model. Backend for Diagnose Report app. Use PhysioNet dataset for model training and testing.
The following dependencies are required.
Demo from the frontend: Diagnose Report app.
Sign Up | Dashboard | Report detail | Create report |
---|---|---|---|
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.
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.
gnuplot -e "fileIn='csv/04015.csv'; fileOut='uploads/04015.png'" csv2img.gnuplot
./raw2img <filename without extension>
python img2csv.py '<full path to file>'
python mat2csv.py "raw/A00001.mat"
-f
mean from which line (remove if from beginning of file) and also -t
mean to which line.wrsamp -i raw/A00001.csv -o raw/A00001-converted -G 1000 -F 300 -z
wfdb2mat -r raw/A00001-converted
This project is licensed under the terms of the MIT license.