How to segment a time series based on pattern changes?

341 Views Asked by At

I have a time series which shows activity and rest segments. The picture below shows the first three segments (activity, rest, activity). Activity segments always show some form of periodic oscillation, while rest segments do not show any pattern at all. However, I plotted the vertical lines in order to make the segments more visible.

enter image description here The activity segments, as well as the rest segments have different lengths, of course, so segmenting based on length does not work.

What I tried/thought of:

  1. There is an amazing library called matrixprofile which is pretty powerful for such tasks. I played around with it but it has some package requirements that messed up other packages that I am using: It requires protobuf>=3.11.2,<4.0.0, which caused my tensorflow to not work anymore. Took my hours to get it to work again, so I cannot use matrixprofile.

  2. Convolutional Neural Networks worked well for me for other anomaly detection tasks. But in this case I do not know how to use them. It would maybe be some form of regression, predicting the length of an anomaly (=activity segment). But I am not sure if this makes sense here.

Do you know a python-based approach that could segment the time series as done in the picture (e.g. by automatically finding the borders of the segments and returning the x-values of the borders)?

Any recommendations are welcome. The less assumptions/hyperparameters they require, the better.

0

There are 0 best solutions below