Anomaly Detection with Raw Data

Question/Issue: I have a CNN which is working quite well for classifying gestures when IMU detects movement above a certain g force in the sense that when performing a gesture, it classifies it correctly. Given this is a gesture recognition scenario, and based on this discussion I am inputting raw data to the NN rather than spectral analysis. For context it’s a gesture recognition device where classes are distinct “movements” eg a punch and windows are about 1s long.

However, the problem is that it is incorrectly labelling random non gesture movements with very high confidence levels. I thought one way of dealing with this might be anomaly detection (based on an Edge Impulse blog post I read) but I don’t know if it’s possible with raw data?

My understanding is that this is somewhat expected in part due to the softmax activation. I’d like to get some idea of “uncertainty” which is where the anomaly detection would come in. Or is a decent alternative to add a “noise” class which is just a bunch of random samples in an effort to capture OOD examples?

Hi @ontheedge,

You can use the anomaly detection block with the raw data block, however you won’t get the added value of the “Select suggested axes” button and will need to select from an array of unknown features yourself:

From one of my accelerometer data projects here: Fan Monitoring - ST BlueTile - Dashboard - Edge Impulse
And changed to the raw data block here: Fan Monitoring - ST BlueTile - Raw Data - Dashboard - Edge Impulse

Thanks @jenny ! How do you decide which features to pick? I’m not quite sure what they represent.

Have you tried having an extra class for OOD samples? I imagine the performance would be poor given the random nature of “noise”.

@shawn_edgeimpulse do you have any methods for reducing the number of random movements being wrongly classified as a gesture (punch).

When you choose Raw data your features no longer have labeled information, so in order to get the most value out of the anomaly detection block you’ll need to create a custom block that has features you have specifically defined and labeled, see here: https://docs.edgeimpulse.com/docs/edge-impulse-studio/processing-blocks/custom-blocks

1 Like

Thanks @jenny

I’m not sure I have enough domain knowledge to write a custom processor - bit of an ML n00b. As an alternative, do you think it would be feasible to include a “noise” class which attempts to capture random movements?

My goal is to only use the classification output if something is indeed a punch hence investigating anomaly detection