Skip to content

hr-hrv block fixes #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions novel-sensor-projects/ecg-hrv-block-arduino-portenta.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ The ECG signal can also be combined with data from an accelerometer for enhanced

The pads should be connected as follow:

Yellow pad to the left
Red pad to the right
Green pad below the red pad
- Yellow pad to the left.
- Red pad to the right.
- Green pad below the red pad.

> Note: Remember to disconnect the AC from the laptop before sampling.

Expand All @@ -80,7 +80,7 @@ Close the Serial Monitor and run `edge-impulse-data-forwarder`.

Select the Edge Impulse project and check that the frequency shows `[SER] Detected data frequency: 50Hz`.

Go to https://studio.edgeimpulse.com/studio/<Your-Project-ID>/acquisition/training
Go to [https://studio.edgeimpulse.com/studio/Your-Project-ID/acquisition/training](https://studio.edgeimpulse.com/studio/Your-Project-ID/acquisition/training)

Select **Length 120.000 ms** and take around 10 to 20 samples for each category to classify. For example, regular working versus stressed. Set aside 10% of the samples for testing.

Expand All @@ -102,8 +102,6 @@ Frequency-domain features are: Raw VLF Energy, Raw LF Energy, Raw HF Energy, Raw

I have used ECG, filter preset 1, window size 40 and no HRV features.

![](../.gitbook/assets/ecg-hrv-block-arduino-portenta/wearable-1.jpg)

## Model Training

The training could require some parameters to be modified from the defaults. I have found the following parameters to work well for my dataset, with a 89.3% accuracy. Training cycles **40**, learning rate **0.005**, bacth size **30** and no auto weight.
Expand All @@ -130,6 +128,8 @@ Now you will be able to use the model library with your own code. A sample ECG m

> Note: If Arduino Portenta shows `Exit status 74`, double click "Reset", and select the correct port.

![](../.gitbook/assets/ecg-hrv-block-arduino-portenta/wearable-1.jpg)

## Final Notes

Thanks to machine learning, monitoring ECG signals no longer requires transmitting data to a remote computer for expert analysis. Instead, subtle health conditions can be detected by small, offline, wearable devices equipped with machine learning capabilities. These devices can identify over-stressed workers who may be unable to perform their tasks effectively, thus preventing serious harm or consequences.
Expand Down
Loading