Git Product home page Git Product logo

antonior92 / ecg-age-prediction Goto Github PK

View Code? Open in Web Editor NEW
48.0 3.0 23.0 14 KB

Scripts and modules for training and testing neural network for age prediction from the ECG. Companion code to the paper "Deep neural network-estimated electrocardiographic age as a mortality predictor".

Home Page: https://www.nature.com/articles/s41467-021-25351-7

License: MIT License

Python 100.00%
deep-learning convolutional-neural-networks neural-networks machine-learning pytorch ecg ecg-signal age-prediction biological-age ecg-records

ecg-age-prediction's People

Contributors

antonior92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ecg-age-prediction's Issues

About exam.csv in CODE-15% cohort

Hi, thank you for sharing the amazing research!

I tried to reproduce the result of fig 2 (Adjusted survival curves) in paper with exam.csv in CODE-15% cohort (https://zenodo.org/record/4916206#.Yib1gRPP30o)

I calculated "diff" columns by

total_data = pd.read_csv('exams_CODE15.csv')
total_data['diff'] = total_data['nn_predicted_age'] - total_data['age']

And I separate the dataset into 3 groups as i1, i2, and i3. I1 was the group that nn_predicted_age is 8 years greater than age, I2 was the one that nn_predicted_age is 8 years smaller than age, I3 was the one within a range of 8 years from their age

from lifelines import KaplanMeierFitter
i1 = (total_data['diff'] > 8)      
i2 = (total_data['diff'] < -8)

i3 = i1+i2
i3 = ~i3
 
durations = total_data['timey']
event_observed = total_data['death'].astype('int')
kmf_old = KaplanMeierFitter() 
kmf_young = KaplanMeierFitter() 

kmf = KaplanMeierFitter() 

kmf_old.fit(durations[i1], event_observed[i1],label='ECG_age_Old_abs')
a1 = kmf_old.plot()

kmf_young.fit(durations[i2], event_observed[i2],label='ECG_age_Young_abs')
a2 = kmf_young.plot()

kmf.fit(durations[i3], event_observed[i3],label='ECG_age_similar_abs')

kmf.plot(ax=a1) 

However, the result that I got from the above code is opposite from your result of the paper.

image

Can you check the exam.csv in CODE-15% cohort has all right value?

Thank you for reading
Best Regards,
Gun Ahn

Scale Factor?

I'm having trouble figuring out how to scale our data to input to this model.

The statement: " All signal are represented as 32 bits floating point numbers at the scale 1e-4V: so if the signal is in V it should be multiplied by 1000 before feeding it to the neural network model." Just doesn't make any sense to me. Does "at scale 1e-4" mean your A/D converter has a resolution (LSB) at the electrode of 0.1 milli-Volt (100 uV)? What is its bit depth?

We have ECG recordings in units of milli-Volts, what do I multiply by before inputting into your model? Our recordings are done at 1000 Hz and are 10 seconds long, resampling to 400 Hz and zero-padding to 4096 samples is not an issue.

Reading some tracings from your exams_part0.hdf5 database, there seems to be a large amount of baseline offset and "wander" within the traces. For example record ID 214626 (hdf5 index 1) Lead I starts at about 4.6 and drifts downward to about 3.2 whereas the maximum peak-to peak signal amplitude is about 1.4, are these units milli-Volts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.