How to perform Anomaly Detection on a force profile?

I have a set of force profiles of an industrial machine. I'm trying to develop an algorithm that tries to understand when a new profile is anomalous with respect to the ones in normal operating conditions.

In the picture below you can see the force profiles (function of time). I want the blue curve found checked as anomalous.

What approaches do you suggest? I'm thinking about using some statistical distance (like mahalanobis) to check the similarity of a new curve to the mean of the others.

Another point: it can be useful to use approaches like PCA in this case? Then I can try to use clustering techniques to separate anomalous profile from normal ones. I'm not sure since I have a great number of observations but of the same variable and PCA is a multivariate technique.

]1

Topic anomaly pca anomaly-detection clustering

Category Data Science


I strongly recommend to start with a simple statistical data analysis. In this approach you take the Moving Average/Median of signals and if one signal shows a magnitude -/+ 3 times standard deviation, you mark it as anomaly. Please have a look at this answer for Python code.


Trust me and use the Isolation Forest from scikit-learn, and if you want to have more options with Isolation Forese use the library PYOD.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.