Kalman Filter and Data Streaming Presented By :- Ankur Jain Department of Computer Science 7/21/03
Outline Kalman Filters Introduction to Kalman Filter (KF) Introduction to Kalman Filter (KF) Common Applications Common Applications The Discrete Kalman Filter The Discrete Kalman Filter Example and Common Results Example and Common Results Pros and Cons Pros and Cons Application of KF in Data Streaming Issues in Data Streaming Issues in Data Streaming Recap – Adaptive filters for Data Streaming Recap – Adaptive filters for Data Streaming Can KF be a solution ? Can KF be a solution ? A possible approach A possible approach Challenges and Issues Challenges and Issues
Introduction to Kalman Filter KF was developed in 1960 by R.E. Kalman A prediction/correction algorithm typically used over linear systems KF finds applications in :- Prediction of time varying variable based on a linear state model (based on previous measurements) Prediction of time varying variable based on a linear state model (based on previous measurements) Estimation of a value where measurements are made in noisy environments (noisy input is converted to less noisy data) Estimation of a value where measurements are made in noisy environments (noisy input is converted to less noisy data) Data fusion (Used for obtaining an estimate of a value whose measurement is obtained from different sources) Data fusion (Used for obtaining an estimate of a value whose measurement is obtained from different sources)
Common applications of the KF Tracking Missiles Tracking moving objects Tracking moving objects Computor Vision Extracting lip motion from video Extracting lip motion from video Data Smoothing and Curve fitting Fitting bezier patches to point data Fitting bezier patches to point data Data Fusion/Integration Integration of spatio-temporal video segments Integration of spatio-temporal video segmentsRobotics Robust estimation and sensor data noise reduction Robust estimation and sensor data noise reduction Many Others
The Discrete Kalman Filter (DKF) State Model F : State Transition x: State Vector v: Gaussian Noise (0, Q) Measurement Model Measurement Model H: Observation Relation w: Gaussian Noise (0,R) z: Observation
DKF cont… Prediction Predicted state at the next observation: State prediction covariance: Observation prediction
Kalman Gain Innovation Innovation covariance Kalman Gain DKF cont…
Correction Corrected state estimate Corrected state covariance DKF cont…
Performance of the filter Results obtained on prediction of ordinate value of motion of track ball (Siggraph 2001)
Performance of the filter The latency observed in the above result can be avoided by incorporating a better state model
Performance of the filter Tracking a table tennis ball video sequence (Workshop on Image Analysis for Multimedia Interactive Services 1997)
Interesting Properties of KF from the perspective of data streams The filter exhibits robustness in presence of occlusions (when the measurements are not available) DKF along with extended Kalman filter (for non linear systems) can be used to model wide range of state transition functions Errors in measuring devices, clock incoherencies, network behaviors etc can be modeled in a single error matrix The errors in the estimations can used to adaptively change the sampling rate of a stream to allow for sensitivity in the final result
Data Sources V 1 updates V 2 updates V n updates.. Filters Bound Shrinking [L 1, H 1 ].. Bound Shrinking [L n, H n ] CQ Evaluator Stream Processor [L 1, H 1 ] [L i, H i ] … [L n, H n ] Bound Cache Precision Manager Bound shrinking Selective growing Intercepts update streams, and forwards those that fall outside its bound Bounded Answers Registers Queries Queries + precision constraints Generates streams of updates Recap …(adaptive filters to save communication resource ) Maintains copy of bound for each object updates Periodically shrinking bound Reallocates bound width and sends growth messages updates User
Drawbacks of this approach Not sensitive to the input stream Need for adaptive sampling rate Need for adaptive sampling rate Network characteristics are assumed be constant and clock incoherence is not handled efficiently Network dynamics should be incorporated Network dynamics should be incorporated Seems unsuitable for sensor data Most of the stream data will show some trend which can be estimated and only critical values be updated Most of the stream data will show some trend which can be estimated and only critical values be updated The model does not allow for sensor measurement error The model does not allow for sensor measurement error
The Kalman Filter Approach Two Kalman Filters can be installed at each source KF 1 (Sensitivity) Every time the prediction is larger than a specified threshold δ the sampling rate is increased KF 1 (Sensitivity) Every time the prediction is larger than a specified threshold δ the sampling rate is increased KF 2 (estimation) This filter works in the same way as the filter at main processor and updates only critical values when the prediction error at the main processor is larger that a threshold KF 2 (estimation) This filter works in the same way as the filter at main processor and updates only critical values when the prediction error at the main processor is larger that a threshold The Kalman Filter at the main processor estimates based on the critical update values Network characteristics and clock mismatches can be modeled in one single matrix which can be updated at the remote source each time significant changes are observed (too many updates will degrade performance !)
Advantages of Using KF Increased sensitivity in the results Adaptive sampling rate If the source values do not show frequent variations in values significant network bandwidth can saved (growth messages are avoided !) Linear as well as non linear systems can be modeled Dynamic Network behavior can be incorporated at some cost of network bandwidth
v2v2 v1v1 V n-1 VnVn CQ Evaluator User Update of critical values when estimation error is large Data Sources User registers queries Results are updated to the user continuously values from estimation Main Stream Proc. changes sampling rate if prediction error is large Periodic update of network condition and clock skews (rare updates)
Issues and challenges Construction of matrices for modeling the network behavior Selecting sampling rates and thresholds We intend to start conducting with static thresholds We intend to start conducting with static thresholds However we lose adaptivity for precision but still hope to gain on usage of resources within a specified precision However we lose adaptivity for precision but still hope to gain on usage of resources within a specified precision Avoiding too much computation at the remote source location as typically sensors have limited computational and power resources Once the above issues are resolved we would like to extend it to answer aggregate queries such has MAX, AVG, VAR etc. and integration of data from multiple sources Sensitivity vs Precision vs Adaptation !