close-circle
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
close
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-circle
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

eye
Preview
download-circle
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-circle
Download

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

eye
Preview
download-circle
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 bit of Photoplethysmography

    Jean Pierre Le Rouzic16 minutes ago 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!

  • About usefulness of early detectors

    Jean Pierre Le Rouzic08/03/2017 at 07:39 1 comment

    When one claim to design an early detector of some illness, it is important to think about early detection in healthcare in general, what are the benefits, inefficiencies and the new problems it creates.

    As a personal anecdote about usefulness of early detectors, I had a skin carcinoma, that two doctors (the family and the company MDs) saw without reacting for years, one of them even asked me what it was. At the end it was a cardiologist who told me it was probably a carcinoma and that I had to consult quickly a specialist.
    MDs have to know what to make of the tests results of those devices. For example some medical organizations start to provide free kit for genetic screening for some conditions [0], as we know some drugs work well for some genomes but less for others, which is a concept a bit weird in itself but very fashionable at the moment.
    But those kits do not work the same way, so their results are not comparable with each others, some may analyze the DNA in blood, while others may take a sample with a biopsy needle. Neither can claim to capture the full picture of the tumor’s mutations. In addition tumors' genome evolves very quickly and is not homogeneous, it is as if many mutations are branching out quickly from a common ancestor cell. At some time later a tumor is the site of several unrelated mutations.
    Some tests sometimes provide conflicting or overlapping results from the same patient. Researchers at the University of California, San Diego, published a 168-patient study on discordance in early 2016 that shows there are overlap as well as differences, between DNA analyses from biopsies of tissue and blood samples.
    Some tests even make suggestions for drugs, studies have shown that different commercial solutions may in some cases suggest different drugs, or do not suggest drugs that a MD would have prescribed. Those commercial products need to improve, and doctors' professional bodies need to develop guidelines to teach how to cope with those new tools.

    Another thing is the false negative, the press reported recently an unfortunate case where a women felt something was wrong with her baby, in the last months of her pregnancy. She then used a fetal Doppler and found an heart beat, unfortunately the baby was stillborn. It is possible that if she had not used her fetal Doppler, she would have gone immediately to her hospital which may have saved the baby.
    False positive are another problem, as an older man I am regularly reminded to check for PSA by the state health insurance, PSA (prostate-specific antigen) is a marker of prostate cancer. I am aware of the risk of cancer, but two large studies, one in US and two in Europe told that for a thousand people screened positively, one man will probably be saved, but several dozens will suffer severe degradation in their life quality and health in general.

    The testing process may also induce traveling cost for the patient, lost of time and revenues, incomfort or even suffering, especially in women healthcare. Unnecessary biopsies and other medical procedures for people who are wrongly diagnosed or whose cancer might never have spread, can also hasten health problems.
    While early detectors might seem a good idea in general, one problem is the anxiety they generate, for example even if everything is right, it does not mean everything will stay right in the future so there is a constant urge to re-check. Even medical doctors could succumb to cognitive bias, when they find "something" in mammography, then ask for more tests which are negative but nevertheless urge to have more frequent testing in the future, creating unnecessary anxiety for the patient[1].

    What does all this mean for a designer of an early detector of heart failure? Certainly that there is a need to not make big unwise claims. There is also a need to collaborate with real doctors, not only scientists.
    At the same time how to attract attention of people to make them use it and finance R&D ?

    [0] http://www.xconomy.com/national/2017/05/31/in-maine-making-cancer-dna-tests-free-and-asking-tough-questions/...

    Read more »

  • Refactoring and randomness test

    Jean Pierre Le Rouzic07/12/2017 at 17:07 0 comments


    The first usable versions of our features detection code (findbeats.java) were full of hardwired constant and heuristics.

    The code has now been modularized with clean condition of method exit.
    We were proud that our design was able to look at each beat and heart sound, which is a far greater achievement than what ML code does usually. Something really interesting was how we used compression to detect heart sounds features automatically in each beat.
    Now we introduce something similar in spirit: Until now sometimes our code was unable to find the correct heart rate if the sound file was heavily polluted by noise. Now we use a simple statistical test akin to standard deviation, to test the randomness of beats distribution. If it is distributed at random, then it means our threshold is too low: We detect noise in addition to the signal.
    This helped us to improve the guessing of the heart rate.


    In an unrelated area, we also started to work on multi-HMM, which means detecting several, concurrent features. An idea that we toy with, would be to use our compression trick, at beat level, whereas now it is used at heart sound level. This is tricky and interesting in the context of a multi-HMM. Indeed it makes multi-HMM more similar to unsupervised ML algorithms.

View all 20 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