Giter Site home page Giter Site logo

ifran-rahman / heartisan Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 24.97 MB

An ECG monitoring, data collection and annotation tool with an integrated incremental learning-based model upgradation system.

Jupyter Notebook 99.32% Python 0.68%
arrhythmia-classification dataset-generation ecg monitoring-tool webapp incremental-learning

heartisan's Introduction

Heartisan: An Incremental Learning Based Arrhythmia Detection, Data Collection, and Monitoring System.

An ECG monitoring, data collection and annotation tool with an integrated incremental learning-based model upgradation system.

Abstract

Cardiac disease is the leading cause of death worldwide, which is why the importance of early heart disease prediction is rising daily. Patient data from modern ECG systems can be utilized to improve such machine-learning models. Here, a system has been proposed that aids in early arrhythmia prediction using a convolutional neural network and continuously improves the model using incremental learning utilizing patient data from a web application. The web app comes with a patient and a doctor’s portal. Patients can view heart conditions and send ECG beats and predictions for verification. Whereas the doctor’s portal is used to annotate the model’s falsely predicted heartbeats. The system continuously updates the model using newly annotated data following an incremental learning approach.The proposed incremental learning strategy was simulated using the MIT BIH dataset, and the approach demonstrated a promising result as the overall accuracy and AUC improved as well as the F1 score of individual classes showed a notable shift. The system is expected to contribute to building a novel large arrhythmia dataset in an efficient strategy, as well as provide patients with a heart condition monitoring system employing a highly accurate arrhythmia classifier in the long run.

Contributions

In this work, it was hypothesized that with the help of incremental learning, an ECG monitoring system could be used to efficiently create a generalized arrhythmia detection dataset and continually update an arrhythmia detection model via new patient data. Therefore a novel system was proposed that works as an ECG monitoring, data collection and annotation tool with an integrated incremental learning-based model upgradation system. Patients can view ECG signals and arrhythmia prediction; they can send reports, which consist of their processed and extracted ECG heartbeats labeled by a CNN-based arrhythmia prediction model. Using the doctor’s portal, a professional doctor or expert must analyze the reports to re-annotate the falsely annotated heartbeats. The system then uses scheduled incremental learning to train the pre-trained model using old and new data to upgrade it to a better version. The key features of our work are listed as follows,

  1. The proposed ECG monitoring web app is equipped with a patient’s portal, a doctor’s portal, and a convolutional neural network so patients can get early arrhythmia prediction and send their diagnosed reports (processed heartbeats labeled by the model) for further analysis. The doctor's portal of the web app allows professionals to label falsely annotated reports conveniently.
  2. The system can collect the verified heartbeats from the web app to create a new balanced, generalized dataset and train the pre-trained model using old and new data following incremental learning methods on a scheduled basis.
  3. We simulated the proposed incremental learning method using the MIT BIH dataset. The dataset was divided into two portions, assuming the first as the primary and the rest as a newly collected dataset. The model's overall accuracy improved, particularly the F1 score on classes with fewer signals showed a noticeable advancement (4% and 8%). The primary model could correctly annotate more than 98% of the new dataset. During training, the new model converged in only half of the epochs as the primary model.

System

The system is built using Django and Firebase is used as the database.

Alt text

Database

Firebase Realtime Database is used to store data. Firebase In the ”Realtime Database”, we can store data in JSON format. The structure of our database is illustrated in figure 4. Alt text

Data Process

The arrhythmia classification model classifies arrhythmia from heartbeat. It is necessary to extract beats from ECG signals. For inferences, beats get extracted from ECG signals.

Alt text

Incremental Learning

The proposed incremental learning method to apply on the system is demonstrated below.

Alt text

Application

Alt text

Alt text

Alt text

Alt text

How to run?

Alt text

  • pip install -r requirements.txt # install
  • cd Demo
  • py manage.py runserver # start server
  • Create a doctor's account manually from firebase
  • Create an account in the database according to the image below and replace the UID

Alt text

  • Create a patient's account from the website
  • Push data to the patient's node.

Alternatively for testing purpose, edit the given sample database "db_json.json" and import in firebase-realtime database.

  • Create a sample doctor account in firebase.
  • Replace the doctor's UID in the db_json.json file.
  • Create a sample patient account in firebase.
  • Replace the patient's UID in the db_json.json file.
  • Import the file in firebase-realtime database

To push data from hardware,

  • Use user credentials to get access
  • Push data in list format. There should be two lists. One consists of ECG values, another consists of seconds where each second presents an ECG value
    ecg = [0.7732789441406522, 0.6836692935784979, 0.5320130856048167, 0.3407086606118426]
    timeframe = [0, 0.001, 0.002,0.003, 0.004]

Contributors

heartisan's People

Contributors

anan-ghosh avatar hasibul-00-hassan avatar ifran-rahman avatar

Watchers

 avatar  avatar

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.