2. Smart ECG
The idea
A system to detect fibrillations in athletes using a
heartbeat sensor, like a heart rate monitor.
The athletes is notified if he is affected by atrial
fibrillation.
2
3. Smart ECG 3
What is a heart rate monitor?
A heart rate monitor is an electronic
device capable of measuring the
heartbeat and, from this, determining
the heart rate in real time during a
training.
It measures alarm threshold for the
aerobic zones on the basis of data on
the physiology of the user.
4. Smart ECG
The components
4
5
1. STM32 Nucleo F401RE board
2. Pulse sensor
3. Bluetooth module X-NUCLEO-IDB05A1
4. Arduino IDE to programming the board
5. Android application
321
4
6. Smart ECG
1. The STM32 Nucleo board detects the heartbeats through
the pulse sensor. The data are pre-processed and then
submitted to the machine learning algorithm
2. In case of atrial fibrillation, a notification is sent to the mobile
app via the Bluetooth board. Otherwise the device only sends
to the smartphone the heart beats.
6
How does SmartECG work?
7. Smart ECG
How to identify a heartbeat?
Based on:
โ Threshold
โ Time
Every heartbeat is defined
as the time between the
current heartbeat and the
previous one
7
8. Smart ECG
Heartbeat pre-processing
The heartbeats are pre-processed by obtaining five values that will be submitted
to the machine learning algorithm:
1. The average of the last three beats
2. The last beat
3. The second to last beat
4. The third to last beat
5. The average of the last ten beats
8
Mar, T., Zaunseder, S., Martínez, J. P., Llamedo, M., & Poll, R. (August 01, 2011). Optimization of ECG
Classification by Means of Feature Selection. Ieee Transactions on Biomedical Engineering, 58, 8, 2168-2177.
9. Smart ECG
Bluetooth communication
โ Service, with universally unique identifier (UUID), exposes heartbeats data to
nearby devices
โ Every service defines or more characteristic
โ Characteristic, with another UUID, implemented as a notification system.
Sends pre-processed heartbeats to the Android application
9
10. Smart ECG
Machine learning Algorithm
The Machine Learning algorithm used is K-nearest neighbor (KNN).
The algorithm was implemented in Java by Amazon Software Engineer Li Gong.
The algorithm was later slightly modified by us to be adapted to this project.
10
www.linkedin.com/in/gonglited
github.com/wihoho/KNN
11. Smart ECG
K-nearest neighbor (KNN) Algorithm
The KNN algorithm itself is fairly straightforward following these steps:
1. Choose the number of k and a distance metric.
2. Find the k nearest neighbors of the sample that we want to classify.
3. Assign the class label by majority vote
The class label of the new data point is then determined by a majority
vote among its k nearest neighbors.
11
Raschka, S. (2015). Python machine learning. Birmingham: Packt.
12. Smart ECG
Example of pre-processing Dataset
12
Dataset obtained from real
values.
Over 3000 instances,
already pre-processed
13. Smart ECG
Result of KNN
13
The accuracy of prediction is
always about 94%-97%
In this example it is
97.463768%
17. Smart ECG
Links
โ Github repository at https://github.com/dariolitardi/smartecgrepo
โ http://www.st.com/en/evaluation-tools/nucleo-f401re.html
โ http://www.st.com/en/ecosystems/x-nucleo-idb04a1.html
โ https://pulsesensor.com/
17
Contacts
Andrea Lisanti at linkedin.com/in/andrea-lisanti
Dario Litardi at linkedin.com/in/dario-litardi-84851915b/
David Buscema at linkedin.com/in/david-buscema