cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure the embedded pedometer inside the SensorTile.box (STEVAL-MKSBOX1V1 ) to be less sensitive?

KWern.1
Associate II

Greetings,

I have been working on the SensorTile.box and specifically the pedometer functionality (worn on wrist) for a while now and I am stuck right now.

I want to optimize the algorithm to reliably count steps. To achieve this, I began optimizing it for myself, using Unico GUI, just to see, if it is possible the way I intended.

For this purpose, I wrote a datalogger, which I pretty much confirmed to work in the way intended, I cut the accelerometer data using Matlab to verify, that I only use actual walking footage for the regression tool in Unico GUI and in the end got an error average of 0 when I fed new data to the tool. 

I also checked, if the accelerometer configuration is the same in the logger firmware, as well as in the step counter firmware. The data was collected at 104 Hz and sampled down to 26 Hz.

I am forced to work with a full-scale setting of 16g because of other projects running on the same device. 

Using the C code generator inside Unico GUI, I turned the ucf files into C headers and copied them into my data logger, where a simple for-loop wrote them to the registers.

Then I collected new data using the configuration and fed it again, to a total of 5 rounds.

This was the point, the tool said, it would have a 100% accuracy for my standard walk, which is a pretty even pattern. Maybe a bit overtrained, but it should work great for my personal walking data.

The problem is: When I load the configuration into my step counting firmware, it still is way too sensitive and false positive rejection seems to fail in most cases, as steps are counted 

when I pick the box up, or it counts on when I am not longer walking, but simply moving my arm. 

In the end, after short walks, I have 50-75% too many steps shown in the register.

Implementing the algorithm myself is no option, because we depend on battery life, which would dramatically decrease, if we would have to run the software all the time on the main processor. 

Now I would like to know, of I made a fatal error in the optimizing process, or if there are ways to configure the sensitivity and accuracy of the device, I did not know yet.

If there are additional questions, go ahead, I will answer them asap.

Best Regards,

K. Werner

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Niccolò @niccolo.ruffini​ ,

I think you were right. I've tested many variations of my data and I came to the conclusion, that it must have been overfitting.

In fact, I get the best results from 1 or 2 iterations, with some variance in cadence and lenght of steps.

It is still not 100% accurate for false positives, but I think that is pretty much impossible with just an accelerometer without further sensors.

I will mark this answer as best, because it summarizes my findings, but very much thanks for the right direction.

Thanks and with best regards,

Kai.

View solution in original post

6 REPLIES 6
niccolò
ST Employee

Hi K. Werner @KWern.1​ ,

may I ask you if the full scale of the datalog is 16g too?

a difference there can lead to errors in the algorithm.

Niccolò

KWern.1
Associate II

Hi Niccolò,

thanks for the reply.

Yes, I checked again and it is. The internal sensitivity factor is 0.488.

Kai.

Hi Kai @KWern.1​ ,

seeing that the sensitivity is the same, I think it is an overfitting error, but I can't be sure.

does random movements result in steps?

Niccolò

KWern.1
Associate II

Hi @niccolo.ruffini​,

I also thought about that and tried some configurations from earlier regression runs, but I can try to do a new regression from scratch, if you think that this may be helpful.

Yes, random movements result in steps, this is the main problem I guess.

Kai.

Hi Kai @KWern.1​ ,

I would try to do that from scratch, if I were you.

don't worry if the accuracy of the network is not 100%, it is normal to have some errors.

Let me know if it works

Niccolò

Hi Niccolò @niccolo.ruffini​ ,

I think you were right. I've tested many variations of my data and I came to the conclusion, that it must have been overfitting.

In fact, I get the best results from 1 or 2 iterations, with some variance in cadence and lenght of steps.

It is still not 100% accurate for false positives, but I think that is pretty much impossible with just an accelerometer without further sensors.

I will mark this answer as best, because it summarizes my findings, but very much thanks for the right direction.

Thanks and with best regards,

Kai.