change point detection in python with ruptures
play

Change point detection in Python with ruptures Digital French-German - PowerPoint PPT Presentation

Change point detection in Python with ruptures Digital French-German Summer School with Industry 2020 Charles Truong 1 1Centre Borelli Universit Paris-Saclay ENS Paris-Saclay, CNRS Wednesday 24 th June Introduction Change point detection


  1. Change point detection in Python with ruptures Digital French-German Summer School with Industry 2020 Charles Truong 1 1Centre Borelli Université Paris-Saclay ENS Paris-Saclay, CNRS Wednesday 24 th June

  2. Introduction ◮ Change point detection is a common task when dealing with non-stationary time series. ◮ Application example: automatic diagnosis of neurologically impaired patients [Truong et al., 2019a]. Healthy and pathological subjects underwent a fixed Protocol schema protocol: - standing still, - walking 10m, - turning around, - walking back, Angular velocity (lower back sensor, sampling 100 Hz) - standing still. ◮ Can also be applied to finance, industrial monitoring, public health monitoring, etc. [Truong et al., 2020]. 1/12

  3. Introduction ◮ Change point detection is a common task when dealing with non-stationary time series. ◮ Application example: automatic diagnosis of neurologically impaired patients [Truong et al., 2019a]. Healthy and pathological subjects underwent a fixed Protocol schema protocol: - standing still , - walking 10m, - turning around, - walking back, Angular velocity (lower back sensor, sampling 100 Hz) - standing still. ◮ Can also be applied to finance, industrial monitoring, public health monitoring, etc. [Truong et al., 2020]. 1/12

  4. Introduction ◮ Change point detection is a common task when dealing with non-stationary time series. ◮ Application example: automatic diagnosis of neurologically impaired patients [Truong et al., 2019a]. Healthy and pathological subjects underwent a fixed Protocol schema protocol: - standing still, - walking 10m , - turning around, - walking back, Angular velocity (lower back sensor, sampling 100 Hz) - standing still. ◮ Can also be applied to finance, industrial monitoring, public health monitoring, etc. [Truong et al., 2020]. 1/12

  5. Introduction ◮ Change point detection is a common task when dealing with non-stationary time series. ◮ Application example: automatic diagnosis of neurologically impaired patients [Truong et al., 2019a]. Healthy and pathological subjects underwent a fixed Protocol schema protocol: - standing still, - walking 10m, - turning around , - walking back, Angular velocity (lower back sensor, sampling 100 Hz) - standing still. ◮ Can also be applied to finance, industrial monitoring, public health monitoring, etc. [Truong et al., 2020]. 1/12

  6. Introduction ◮ Change point detection is a common task when dealing with non-stationary time series. ◮ Application example: automatic diagnosis of neurologically impaired patients [Truong et al., 2019a]. Healthy and pathological subjects underwent a fixed Protocol schema protocol: - standing still, - walking 10m, - turning around, - walking back , Angular velocity (lower back sensor, sampling 100 Hz) - standing still. ◮ Can also be applied to finance, industrial monitoring, public health monitoring, etc. [Truong et al., 2020]. 1/12

  7. Introduction ◮ Change point detection is a common task when dealing with non-stationary time series. ◮ Application example: automatic diagnosis of neurologically impaired patients [Truong et al., 2019a]. Healthy and pathological subjects underwent a fixed Protocol schema protocol: - standing still, - walking 10m, - turning around, - walking back, Angular velocity (lower back sensor, sampling 100 Hz) - standing still . ◮ Can also be applied to finance, industrial monitoring, public health monitoring, etc. [Truong et al., 2020]. 1/12

  8. What is change point detection? ◮ Change point detection consists in finding the temporal boundaries between homogeneous time periods. ◮ Informally: “multivariate signal − → list of change point indexes” x y z 8.139 8.337 -21.055 6.964 9.881 -20.693 4.317 9.993 -19.309 1.752 8.950 -16.941 -0.305 7.356 -13.143 [ t 1 , t 2 , t 3 , …] -2.320 7.384 -7.361 -3.312 8.467 -2.530 -3.697 10.891 2.523 -2.622 13.363 5.863 -2.728 11.761 4.473 2/12

  9. What is change point detection? ◮ Change point detection consists in finding the temporal boundaries between homogeneous time periods. ◮ Informally: “multivariate signal − → list of change point indexes” x y z 8.139 8.337 -21.055 6.964 9.881 -20.693 4.317 9.993 -19.309 1.752 8.950 -16.941 -0.305 7.356 -13.143 [ t 1 , t 2 , t 3 , …] -2.320 7.384 -7.361 -3.312 8.467 -2.530 -3.697 10.891 2.523 -2.622 13.363 5.863 -2.728 11.761 4.473 2/12

  10. ruptures : a Python library Documentation Github page ( github.com/deepcharles/ruptures ) How to install Links and information on the Github page. Associated publication [Truong et al., 2020] 3/12

  11. Table of contents 1. Introduction 2. What is change point detection? 3. General principle of ruptures 4. ruptures in action A simple example Gait analysis 5. Supervised change point detection General principle Deep detection 6. Conclusion 3/12

  12. General principle ruptures : a Python library How to choose a segmentation? The “best segmentation” is the minimizer, denoted � T , of a criterion V ( T ) : K � V ( T ) := c ( y t k .. t k + 1 ) . k = 0 Cost example: c ( y ) = � = { t 1 , t 2 , t 3 } y ) 2 . t ( y t − ¯ V ( ) = c ( y 0. . t 1 ) + c ( y t 1 . . t 2 ) + c ( y t 2 . . t 3 ) + c ( y t 3 . . T ) Problem 1 . Problem 2 . Fixed number K of change points: Unknown number of change points: � � T := arg min V ( T ) s.t. |T | = K . T := arg min V ( T ) + pen ( T ) T T where pen ( T ) measures the complexity of a segmen- tation T . 4/12

  13. General principle ruptures : a Python library Detection methods are the combination of three elements [Truong et al., 2020]. Cost function Search method Constraint K � Criterion V ( T ) to minimize: V ( T ) := c ( y t k .. t k + 1 ) . k = 0 Problem 1 . Problem 2 . Fixed number K of change points: Unknown number of change points: � T := arg min V ( T ) + pen ( T ) � T := arg min V ( T ) s.t. |T | = K . T T where pen ( T ) measures the complexity of a segmen- tation T . 5/12

  14. General principle ruptures : a Python library ◮ A modular architecture. First import and data loading. Choosing the cost function . y ) 2 . Here, c ( y ) = � t ( y t − ¯ Choosing the search method . Here, binary segmentation. Fiting the algorithm. Choosing the constraint . Then detecting the change points (“predict”). Measuring the detection accuracy. 6/12

  15. Table of contents 1. Introduction 2. What is change point detection? 3. General principle of ruptures 4. ruptures in action A simple example Gait analysis 5. Supervised change point detection General principle Deep detection 6. Conclusion 6/12

  16. A simple example ruptures in action Import and generate signal Choose a method and detect change points Measure accurary 7/12

  17. Gait analysis ruptures in action ◮ To simplify the detection task, the signal is transformed (here, short-term Fourier transform). ◮ Then mean-shifs are detected. Angular velocity (lower back sensor, sampling 100 Hz) Signal transformation 8/12

  18. Gait analysis ruptures in action ◮ To simplify the detection task, the signal is transformed (here, short-term Fourier transform). ◮ Then mean-shifs are detected. Angular velocity (lower back sensor, sampling 100 Hz) Signal transformation 8/12

  19. Table of contents 1. Introduction 2. What is change point detection? 3. General principle of ruptures 4. ruptures in action A simple example Gait analysis 5. Supervised change point detection General principle Deep detection 6. Conclusion 8/12

  20. Supervised change point detection General principle ◮ How to integrate expert knowledge to calibrate the change point detection? [Truong et al., 2019b] The expert provides the target segmentation: either Labels are transformed into constraints. Intuitively, full or partial label. the problem is: ◮ Learn a transformation Ψ such that Full label d (Ψ( x t ) , Ψ( x s )) ≤ u if x t and x s similar d (Ψ( x t ) , Ψ( x s )) ≥ l if x t and x s dissimilar ( u > 0 and l > 0) Two samples are similar if they belong to the same regime. The exact change point locations are provided. Two samples are dissimilar if they belong to consecu- Partial label tive regimes. Only homogeneous periods (hatched areas) are provided (weakly super- vised). 9/12

  21. Deep change point detection Supervised change point detection This seting can be used to learn a deep representation. Here, two layers of temporal separable convolutions and max- Prediction phase pooling (with tensorflow ). Learning phase Epoch by epoch (epoch 0) Max error: 9.08 sec (epoch 0) 0.2 0.0 0.2 0.4 0 500 1000 1500 2000 True segmentation: alternating colors. Predicted segmentation: dashed lines. 10/12

  22. Deep change point detection Supervised change point detection This seting can be used to learn a deep representation. Here, two layers of temporal separable convolutions and max- Prediction phase pooling (with tensorflow ). Learning phase Epoch by epoch (epoch 10) Max error: 6.80 sec (epoch 10) 0.02 0.00 0.02 0.04 0.06 0.08 0 500 1000 1500 2000 True segmentation: alternating colors. Predicted segmentation: dashed lines. 10/12

Recommend


More recommend