Update

I had two emails about my ECG classifier Github repo from graduate students after I opened the source code. Please use the issue page of the repo if you have any question or an error of the code.

I myself found some errors due to the version change of Python libraries, so I updated the codes. In the near future, I would update the Python codes suitable for upgraded libraries (won’t be posted).

Flask web app

At the first post of this series, I had commented my last goal would be making an web app for the ECG classifier, but I did not do it last March. I had to go out of the town, and when I came back I was sick and the ECG plan was forgotten.

The wep app is updated at the repo. You can git clone the source and setup the app.

I also docker-pushed the container image of the web app at docker hub. You can docker-pull the app from my docker repo.

Open at http://localhost:5000

choose

I gained some random heart beat csv file and put the sampling rate of the new signals for the first value. The model will read the number and interpret as a sampling rate.

result

Here, 360 is different from the default sampling rate (240, maybe) of the model. Other numbers around 900 are the amplitudes(V) of the signal with some scale.

Then let us see the result of the predictions from uploaded csv formatted heart beat signals

result

Analyze the result

In the above image, the signals have 57 peaks, and the signal of each peak was estimated by the trained model. Then the whole signals consist of 27 normal beats, 6 venticular beats, 2 atrial beats, and 22 noises signals. If the signals represent noise, the most of the signals should have been estimated as noise. Then, the patient with the signals must be healthy or possibly have venticular contraction.