GithubHelp home page GithubHelp logo

benjamin-walker / heart-murmur-detection Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 3.0 2.45 MB

Dual Bayesian ResNet: A Deep Learning Approach to Heart Murmur Detection (Physionet Challenge 2022)

License: MIT License

Python 7.11% Jupyter Notebook 86.94% Shell 5.95%
bayesian-networks convolutional-neural-networks deep-neural-networks heart-disease-prediction physionet2022

heart-murmur-detection's Introduction

License: MIT PWC

Heart Murmur Detection using Bayesian Residual Neural Networks

This is the extension of our entry to the George B. Moody PhysioNet Challenge 2022: Heart Murmur Detection from Phonocardiogram Recordings

When using this code, please cite the challenge paper as well as the journal paper.

This repository contains our solution to the first task from the PhysioNet Challenge 2022: Design an algorithm to classify the present, absent, or unknown cases of heart murmurs from heart sound recordings [1,2].

Two models are implemented:

  • A Dual Bayesian ResNet (DBRes), where overlapping log mel spectrograms of the heart sound recordings undergo two binary classifications simultaneously: present versus unknown or absent, and unknown versus present or absent.
  • The output from DBRes integrated with demographic data and signal features using XGBoost.

Challenge performance for murmur task on held-out subset

Using this code, we reached the following performance:

Model Accuracy Murmur
DBRes 0.762 0.780
DBRes with XGBoost 0.820 0.749

Data

The challenge dataset can be downloaded via this link or using the following command.

wget -r -N -c -np https://physionet.org/files/circor-heart-sound/1.0.3/

Dependencies

Install using conda on cuda device

conda create -n myenv python=3.9
conda activate myenv
conda install pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch
pip install tqdm==4.64.1 scipy==1.9.2 resampy==0.4.2 scikit-learn==1.1.2 pandas==1.5.0 xgboost==1.6.2 librosa==0.9.2

Install using pipenv (mps enabled)

pipenv install

Running Experiments

You can run all steps using the template files in run_files.`

A full experiment consists of four steps:

  1. Splitting the data into stratified train, test, and validation sets (data_split.py).
  2. Training the Bayesian ResNets on their respective binary classification tasks (train_resnet.py).
  3. Calculating and evaluating the output from DBRes (dbres.py).
  4. Calculating and evaluating the output from DBRes with XGBoost integration (xgboost_integration.py).

These steps can be run independently using the relevant script, or sequentially using main.py,

CUDA_VISIBLE_DEVICES=0 python main.py --full_data_directory physionet.org/files/circor-heart-sound/1.0.3/training_data --stratified_directory data/stratified_data --vali_size 0.2 --test_size 0.2 --random_state 14 --recalc_features --spectrogram_directory data/spectrograms --model_name resnet50dropout --recalc_output --dbres_output_directory outputs

Affiliations

Ben Walker1, Felix Krones2, Ivan Kiskin3,4, Guy Parsons5, Terence Lyons1, Adam Mahdi2,3

  1. The Mathematical Institute, University of Oxford, Oxford, UK,
  2. The Oxford Internet Institute, University of Oxford, Oxford, UK,
  3. The People-Centred AI Institute, University of Surrey, Surrey, UK,
  4. The Surrey Sleep Research Centre, University of Surrey, Surrey, UK,
  5. The Intensive Care Registrar, Thames Valley Deanery, NIHR Academic Clinical Fellow at University of Oxford, Oxford, UK.

Acknowledgment

This work was supported by the Hong Kong Innovation and Technology Commission (InnoHK Project CIMDA) and the Friedrich Naumann Foundation.

Bibtex Citation

@article{walker2022DBResNet,
    title={Dual Bayesian ResNet: A Deep Learning Approach to Heart Murmur Detection},
    author={Benjamin Walker and Felix Krones and Ivan Kiskin and Guy Parsons and Terry Lyons and Adam Mahdi},
    journal={Computing in Cardiology},
    volume={49},
    year={2022}
}

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.