Using convolutional neural networks on ECG data to see if it is a valid candidate for biometric authentication.
Make sure you have the following items installed:
- python2.7
- wfdb package using
pip install wfdb
- keras
- pandas
- numpy
python data_processing.py
: Converts all .dat files indata/
to .csv. Extract labels and features from individual .csv files. Outputs the following files in theprocessed_data/
folder:ecgdblabels.csv
: labels [person, age, gender, date record was collected]filecgdata.csv
: filtered ecg signalsunfilecgdata.csv
: unfiltered ecg signals [noisy]new_data.csv
: signals aligned by first positive maximum peak [so that all signals start at the same point]rsampled_data.csv
: signals aligned peak to peak and resampled to maintain width [generating more data to solve the problem of overfitting]
[Note]: If the folder, processed_data/
, does not exist in your working directory on your local machine, create it. You can either run data_processing.py to generate the .csv files mentioned above or download them from the links provided.
-
python model_personid.py
: Train and evaluate model for person identification. See line 370 indata_processing.py
on specific instructions for data setup. -
python model_genderid.py
: Train and evaluate model for gender identification.
This project uses the ECG-ID Database from
Physionet. It can be found
in the data/
folder. [Note: the original database does not include .csv files.
See class csvGenerator
in data_processing.py
to learn more about how the .dat files were converted to
csv using rdsamp]