On device classification perform different compared to live

Classification gives very different results when running live classification in edge impulse versus on the STM32. I generate the Cube-MX pack as in the instructions provided in the cube-mx cmsis pack deployment documentation.

I tried both the regular and continuous classification function, and both the float32 and int8 optimization. In all cases the classification gives a different result compared to the live classification. The particular example here is with float32 and continous classification.

Live classification left, stm32 result on the right

The impulse consists of an MFE processing block and a 1D conv classifier. The processed features are already different on device, so the problem seems to be MFE related.

Any help would be apreciated.

Hi @nsterenborg

Thank you for reporting this, can you share the project ID? Need to check what your MFE settings are.

Eoin

Hi Eoin,

Thanks, of course!
Project ID: 238073

Niek

Hi @Eoin,

I am from the same team working on this project. We would really appreciate if you could help us out on this matter. Thank you for your time!

Carsten

Hi @Eoin,

We tried the classifier block separate from the MFE processing block (with the run_inference function) and that works as expected. Putting in the processed features as produced by the live classification in edgeimpulse yields the expected classification results.

This seems to indicate that the issue lies withing the MFE block, as I suspected already.

This was tested with a new project, ID 245077, since we also noticed an error in the samplerate of the previous project.

Niek

Hi @CVoort @nsterenborg

Checking out the latest project now, can you try setting the high frequency to 1000hz, it seems to be left blank. Not sure if this is something we do intentionally, will check with the DSP team.

Then see how on device performs compared to studio? If there are similar results we can file a bug with the DSP team. Iā€™m trying to test here too but with a different device.

High Freq Blank

High Freq 1000hz

Hi @Eoin,

Thanks for having a look at it. For me, the high frequency was already at 1000Hz. To be sure I regenerated the CMSIS pack and tried again but the results are still wrong.

An additional comment that might interest you, the processed features that are generated during run_classifier are (very) different from the features generated during run_classifier_continuous.

We also tried replacing the MFE block with a spectral analysis block to see if the same issue occurs there, but that seems to work fine. The MFE performs much better on our problem though.

Niek

Thanks @nsterenborg

Let me note and check with the DSP team, when someone is available to discuss, and get back to you. It could be the end of this week.

Best

Eoin

Thank you so far @Eoin, looking forward to a reply :slight_smile:
Niek

1 Like

Hi @nsterenborg

Discussed with the team and we have filed a bug for this, will post here once we have a resolution.

Best

Eoin

Hi @Eoin,

Thank you for getting back to us quickly. Any idea on the lead time on this?
Do you have any indication that the spectrogram block has this bug as well as this block could be a potential backup for us in the mean time. I already made a project with the spectrogram block (ID 245847). Thanks!

Best,

Carsten

Hi @Eoin,

We tested the spectrogram, which seems to work as expected.
Any updates on the MFE block?

Carsten

Hi @Eoin,

Any news on the MFE block? Thanks!

Best,

Carsten

1 Like