Close
0%
0%

Early and low cost detection of Heart Failure

Heart Failure is a debilitating condition that most old people encounters. A PoC uses coded signals, Doppler and a sound ML classifier.

Similar projects worth following
Heart failure (HF) is a complex heart syndrome. It prevents the heart from fulfilling the circulatory demands of the body. It takes 10 years to progress from Stage I to Stage IV (severe). There is no remedy. Being able to detect the development of chronic diseases at an early stage is instrumental to preventive care.

We propose to use a point of care device, composed of a low cost Doppler device with a trained classifier, to detect suspicion of HF in primary care.

In order to detect HF with a ML classifier, we train it to recognize features in sounds from the Physionet Cinc or similar competitions.

In our case, signals acquired with a low cost fetal Doppler, are connected to a Linux box hosting the classifier and user GUI. It records heart beats without needs of any gel. We will later code the Doppler signal to obtain more features, specially about fibrous tissues. In a further iteration we will implement the ML classifier on a low cost controller.

Short list of desired features:

* This device can measure the heart failure risk even in non medical environment, no need to move to a medical center.

* This device enable measurements by a home carer, without need for medical staff.

* It is very low cost: Certainly less than $150 in its final version.

* It can be used for a long time without creating skin problems, as it uses no gel and is easy to clean.


Hjerte_simple_v0.3.zip

This version 0.3 of Hjerte with a simple GUI, uses a HMM trained on near 400 heart sound files. As for previous versions, you have to record the heart sound by yourself and transfer it on the Raspberry Pi. A fetal Doppler (~$75) is perfect for this purpose but you can also use a microphone. In next days/weeks I intend to study a solution with a standard low cost USB microphone. Please remember that the way you record, the quietness of the environment and the how body is positionned, has a great influence on the record quality. Probably it is a good idea to make several trials at different times and by varying your position (supine, lateral decubitus, sitting, etc) Go to the ./dist folder and use Hjerte.sh (on Windows you may use the .bat file). There is only one button in the UI, push it to select the heart sound file that you want to classify. The outcome of the classification process appears after a few seconds, there is a message which tells you if the heart sound file is similar

Zip Archive - 7.30 MB - 09/23/2017 at 19:47

Download

Selecting a heart sound file in Simple_Hjerte.png

Here is a picture of the UI of the simplified version of Hjerte at version 0.1. There is only one button in the UI, push it to select the heart sound file that you want to classify. The outcome of the classification process appears after a few seconds, there is a message which tells you if the heart sound file is similar or not to the training set. A numeric indication is also provided, at "0" there is no similarity found with the training set, and at "one" there is a perfect similarity, whatever that really means. You can record the heart sound file with a fetal Doppler, or a direct recording. But the Doppler method gives better results (no ambient noises). You must record your heart sound file in WAV format. A test file is provided (heart_jp.aiff). A fetal Doppler costs $50 and the executable and sources are available below. It is written in Java so you need it on your machine.

Portable Network Graphics (PNG) - 36.21 kB - 07/26/2017 at 09:23

Preview
Download

Hjerte_simple_v0.1.zip

This is a PoC that uses HMM with near 300 heart sound files in the training set. Go to the ./dist folder and launch the jar file (on Windows you may use the .bat file). There is only one button in the UI, push it to select the heart sound file that you want to classify. The outcome of the classification process appears after a few seconds, there is a message which tells you if the heart sound file is similar or not to the training set. A numeric indication is also provided, at "0" there is no similarity found with the training set, and at "one" there is a perfect similarity, whatever that really means. Please send me your remarks or comments. (this is a crude hack intended to gather feedback, it is not a medical device, please do not use it for checking a health problem, if you have a health question, please ask it to your medical doctor)

Zip Archive - 594.12 kB - 07/26/2017 at 09:04

Download

Portable Network Graphics (PNG) - 139.30 kB - 06/08/2017 at 08:16

Preview
Download

  • 1 × A USB microphone or a 3 MHz low cost ultrasound probe It costs only $50, but indeed it does not offer beam forming!
  • 1 × A Raspberry Pi 3B or similar This is done with transistors and other discrete components!
  • 1 × ML classifier To detect features in the training set, I used a modified subset of jAudio. The training set comes from Physionet, but there are other freely accessible on the net. The classifier is a HMM derived from a speech processing project. I want to use a HMM because it is able to predit states and offer an explanation of the model (the probability of transitions between states)

  • A smart toilet seat to detect heart failure?

    Jean Pierre Le Rouzic03/23/2019 at 09:13 0 comments

    With my setup there are many problems, not in it's principle which is sound (well S4 sounds) but in practical:

    It has problems detecting heart sounds with obese people, women with ample breast.

    Some smart guys have a better proposal: A smart toilet seat!


    The toilet seat–based cardiovascular monitoring system is completely self-contained, battery-powered, wireless, and cleanable with all sensors and electronics instrumentation integrated inside of the seat. It can measure the electrocardiogram (ECG), photoplethysmogram (PPG), and the ballistocardiogram (BCG).

    https://mhealth.jmir.org/2019/1/e12419/


    I wish them a lot of success :-)

  • Update on Physionet 2017

    Jean Pierre Le Rouzic01/25/2018 at 11:12 0 comments

    Unfortunately I did not attend the Physionet conference even if it was in my home town, participants have to pay an entrance price, and for an individual it is just impossible.

    The competition was about: AF Classification from a short single lead ECG recording.

    75 International teams competed. It was not about heart sounds as in 2016, but given the high number of heart beats detectors in HaD, many people should be interested in this competition.

    What technology did dominated the competition, well most ML classifiers en vogue at the moment: Deep forest, XGBoost. A lot of teams used LASSO for feature selection.

    It can be seen as a success for ML, as it succeeds with far much less data than a practitioner access in a single day

    However Gari Clifford tells that there are signs of over training in the competition submissions (the model fits the data in a way that should not be expected if samples were distributed at random).

  • A bit of Photoplethysmography

    Jean Pierre Le Rouzic10/17/2017 at 16:39 0 comments

    I used the audio extracted from the video below. It was taken by a Logitech 270 webcam which was pressed against my finger, hence the strange red pulsating color.

    The audio was truncated as in the beginning the camera was moved a bit harshly and at the end the boiler used by my other self was creating an increasing white noise.

    I just used Hjerte 0.3 (available on this page) to classify the heart sound. It recognizes my heart beat quite well, and seems to find convincing S1 and S2 sounds.

    What are the take home points?

    - There is no need for a ultrasound Doppler to record heart sounds.

    - Heart sounds can be recorded on a finger!

    - The Hjerte algorithm works even in weird conditions (ordinary microphone, lot of noise).

  • What next?

    Jean Pierre Le Rouzic10/05/2017 at 07:48 0 comments

    This project is almost finished.

    What is envisioned next, is to provide a box, where all is ready to be used, on an online marketplace.

    The software will be what is available on this page and the hardware will be a SCB like the Raspberry Pi. Probably a USB Webcam an microphone will be included.
    The goal is a kind of social engineering, to accelerate evidence based medicine: Making guys copycat this device and sell it on Taobao or Aliexpress, in order to make this kind of point of care tools more common in doctors' office. Please pirate this as much as you can!

    After all, heart diseases are one of the two main causes of death, the other being cancer.

    A far more ambitious project is drafted on Padirac Innovation. It is about multi probes tooling and a software assistant for family doctors, all setup done automatically. All that the doctor will have to do is to buy the hardware and access codes online, and she will be able to use those probes in her office without any other installation or setup procedure.

    https://padiracinnovation.org/

  • Having multiple convergent information

    Jean Pierre Le Rouzic09/27/2017 at 07:08 0 comments

    When it comes to studying heart sounds with algorithms, it is important to not be naive, technology is a tool, not an oracle. Mastering what we do is of utmost importance and having multiple informations helps to gain confidence in the outcome of algorithms.

    One important information for segmenting the heart beat in sounds, is the heart rate, but it is much better to know approximatively when heart beats begins.
    Heart beat events are easy to recognize with ECG because there is a very distinctive figure, the "R" peak which signals the contraction of ventricles.
    However the ECG is difficult to sample and it does not give easily much other usable information. For example one has to interpret deflection of waves or figure out if missing beats are normal or not. Surprisingly our heart can miss beats, for example if we move during the sampling.
    Phonocardiograms are easier to sample and they give more trusty information.

    However automatically segmenting Phonocardiograms is not an easy task either. There is a well known challenge for heart specialists on this subject: Physionet/CINC and indeed there are the Kaggle challenges for the data scientists.

    Phonocardiograms are usually obtained with Doppler ultrasounds or with electronic stethoscopes. But it could be sampled with ordinary microphones as well, providing that ambient sounds are not too loud.

    As Webcams are often equipped with microphones and SBC like Raspberry Pi can use webcam out of the box I was thinking of using photoplethysmography to at least get the heart rate. This is an ongoing work but results are encouraging. I am using a Logitech 270 webcam.

    The result of this study is intended to be included in my Hjerte software package that now runs on a Raspberry Pi.

  • A video of the present state of Hjerte

    Jean Pierre Le Rouzic09/24/2017 at 08:22 0 comments

    This video shows Hjerte running on a off the shelf Raspberry Pi 3B.

    It was a pleasant surprise to see that I can directly use the Jar file produced on my Ubuntu laptop on the Raspberry without having to convert anything.


    For me it was a realization there was no need to search for a really lost cost version, as this Proof Of Concept costs less than $100 ($35 for RP, $35 for case, power unit, and an awful $25 for a USB Webcam having a microphone).

    Another thing is that I am changing my original goals that were more or less aligned with the requirements of a failed project for a pharmaceutical company.
    Now I think a much more reasonable discourse about Hjerte would be to help people manage their condition, and not detecting it.
    In order to enable that, it shows the percentage of S3 sounds with respect to the number of heart beats.

  • Hjerte on Raspberry Pi 3B

    Jean Pierre Le Rouzic09/21/2017 at 21:56 0 comments

    Hjerte is the name of this heart failure detector.
    It means "heart" in this beautiful language that is Norwegian. This word has the same origin than "heart" in English or "coeur" in French. It is a very old word that was born thousands years ago when the vast inlandsis that covered the North hemisphere, finally retreated and let humans start the neolithic revolution.

    Hjerte run without modification, as it is in the file section, on a Raspberry Pi 3B.
    This means there is no need to make a "C" version of this Java program, as the RP 3B, the case and the LCD touchscreen cost me only $90. If you add a microphone you are still below the $150 target price. A video will be provided soon.

    So the end of the project is close now. A new version of the software is available at :
    https://github.com/Hjertesvikt/Hjerte_Simple
    I will only make quality control on this software for now.

  • A beautiful article about early detection of cancer

    Jean Pierre Le Rouzic09/06/2017 at 19:54 0 comments

    Another excellent article in the New Yorker is about complexity management in cancer research.

    Cancer is studied as if it was a pathogen. "Cancer attacks you, cancerous cells invade you blood". It argues that oncology’s obsession with the cellular automaton and its genes exists only because it is easier to focus on the cell, than taking in account the terrain, the tissues in the host..

    It’s the host tissue and cancer cells complex assemblage of interactions. that determines the nature of the illness. There isn’t one factor but a series of factors that determined how and why the cancer took hold.

    It recalls the story of Thyroid cancer detection in South Korea 15 years ago. Many people were found having this kind of cancer, because of a new ultrasound device. By 2014, thyroid-cancer incidence was fifteen times what it was in 1993, making it the most commonly diagnosed cancer in the country. Yet the rate at which people died from thyroid cancer remained unchanged [0].

    This early detection is worse than useless as many people received surgery that was unnecessary.

    The article alludes to the fact that what we need is an early predictor of the patient's health, not of an early detection of diseases.


    [0] https://www.newyorker.com/magazine/2017/09/11/cancers-invasion-equation

  • Converting from Java to "C"

    Jean Pierre Le Rouzic09/06/2017 at 19:42 0 comments

    Some news: I am converting my Java program (the one you can find in the "files" section of this page) in a C program.  The rational is that, as I would have to explicitly manage memory in "C" language, then I could better fit my code in a low cost CPU.

    This is less easy than I envisioned. I supposed that by having a single gigantic class that incorporates other classes stripped down of their methods and having methods all belonging to this gigantic class, it would be easy to convert the "class" to "struct" and what remained would be to provide code for the JVM methods (like LinkedList or ArrayList). It is still ongoing, there is no reason I would fail, but it is a huge amount of code (2550 LoC in Java) and I will need time.

  • A shameless advert for the new Lung cancer challenge

    Jean Pierre Le Rouzic08/23/2017 at 12:47 0 comments

    Please check out the new challenge by the Bonnie J. Addario Lung Cancer Foundation to help radiologists detect lung cancer earlier without so much false positives.

    https://concepttoclinic.drivendata.org/

    They want to understand the best submissions to the last Data Science Bowl challenge which was about lung cancer detection and collaboratively improve them significantly.

    Please contribute by grabbing an issue from the project's GitHub repository and submitting a PR!

View all 22 project logs

  • 1
    Step 1

    All you need is to buy a good microphone or Fetal Doppler to record the heart beats and to connect it to a Linux box (Raspberry Pi), where you will have downloaded and decompressed the Hjerte_simple_v0.3.zip that you can find in the "Files" section of this page.

    As for previous versions, you have to record the heart sound by yourself and transfer it on the Raspberry Pi. A fetal Doppler is perfect for this purpose but you can also use a microphone. In next days/weeks I intend to study a solution with a standard low cost USB microphone.

    Please remember that the way you record, the quietness of the environment and how body is positioned, has a great influence on the record quality.
    Probably it is a good idea to make several trials at different times and by varying your position (supine, lateral decubitus, sitting, etc)

  • 2
    Step 2

    There is a Github repository which contains various software and documentation used to design Hjerte including the source code of Hjerte_simple_v0.3.
        The Github is:https://github.com/Hjertesvikt/

    Download Hjerte_simple_v0.3.zip from the Raspberry and decompress it where you see it fits the best for you.

    This version 0.3 of Hjerte with a simple GUI, uses a HMM trained on near 400 heart sound files.

    Go to the ./dist folder and use Hjerte.sh (on Windows you may use the .bat file).
    There is only one button in the UI, push it to select the heart sound file that you want to classify.
    The outcome of the classification process appears after a few seconds, there is a message which tells you if the heart sound file is similar or not to the training set.
    In addition to previous versions, there are now information about the possible S3 and S4.
    S3 heart sounds are good markers for heart failure. The ratio of S3/#beats is provided to enable to track ilness' evolution.
    S4 sounds are markers for other heart conditions. No numeric information is provided as it is much more complex than the relation between S3 and heart failure prognosis.




  • 3
    Step 3

        About copywrites, licenses, regulations and safety:
         - The current hardware (phase 0: Fetal doppler and Linux box), you have to buy it somewhere as I do not provide it, so if they have licenses, you are responsible to behave accordingly.
        - The phase 1 device, that I will design (a combo of a 3Mhz ultrasound probe and associated software providing roughly the same services as the fetal doppler, the Linux box and the code of Potes and Parvaneh) is provided under a liberal open source license, the Mozilla license. Basically you can do anything you want including replicating this and selling it on Aliexpress, at the sole condition that you credit this work. You can credit as this way "Copyright Jean-Pierre Le Rouzic, 2017, Early and low cost heart failure detector, Hackaday 2017".
        - About regulations: In most countries you cannot use this project in a medical context. It as to be approved beforehand by regulators. I will probably apply in EU for a device *helping to* and not *making* a diagnosis. It will be in a year or two and I will need lot of money and help from people at that time. Be careful, even if my organization obtain someday an EU authorization, that will not grant any authorization to other makers except the current right to study this device and for personal usage.
        - About safety, be careful, piezo-electric drivers have voltages in the hundred range. If they are not isolated (battery/transformer) they are dangerous. Same for any gel that you could buy by yourself. Another thing is about the outcome of the device, it may vary depending on the gender, age, weight, ambient noises, etc... It is not safe to assume that it is correct if you are not trained.

View all 4 instructions

Enjoy this project?

Share

Discussions

Jean Pierre Le Rouzic wrote 08/03/2017 at 17:30 point

Thanks Transcendence, it is very kind!

  Are you sure? yes | no

Transcendence wrote 08/03/2017 at 09:57 point

Inspiring work jean!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates