Online Adaptive Kalman Filtering for Real-Time Anomaly Detection in Wireless Sensor Networks
Abstract
:1. Introduction
- Optimize an Online Adaptive Kalman Filtering (OAKF) framework for real-time anomaly detection within WSNs: This work focuses on dynamically adjusting the filtering parameters to better adapt to the evolving data dynamics and noise characteristics inherent in WSN environments, ensuring enhanced precision and reliability in the detection of anomalies.
- Enhance the accuracy and computational efficiency of anomaly detection in WSNs while keeping the sensor’s cost low: This goal is centered on reducing false positives and negatives, enabling the precise identification of anomalies while ensuring the AKF algorithm remains lightweight and viable for deployment on resource-constrained sensor nodes.
- Validate the AKF framework’s performance across a variety of WSN datasets, demonstrating its versatility and effectiveness in accurately detecting anomalies under diverse environmental conditions and in different application scenarios ranging from industrial monitoring to environmental sensing.
2. Related Work
- Unlike traditional Kalman filters with fixed parameters, OAKF dynamically adjusts for noise variations in the process and measurement in real time. This ensures a high filtering performance even under different environmental conditions and sensor noise characteristics.
- The OAKF framework is specifically designed for real-time applications. It can quickly adapt to changing data streams, ensuring accurate and timely anomaly detection without significant computational costs.
- The OAKF algorithm is optimized for use in resource-constrained sensor nodes, making it highly scalable and computationally efficient. It can be deployed in large-scale wireless sensor networks without compromising the detection accuracy or response time.
3. Proposed Model
Algorithm 1: OAKF |
1. Start 2. Set to the first sensor measurement or a known initial condition 3. Initialize , , and based on prior knowledge or estimation 4. Define thresholds for anomaly detection and adaptive adjustment 5. Read sensor data periodically () 6. While do 7. Prediction: 7.1 Predicated State Estimate 7.2 Update State Covariance 8. Update: 8.1 Find 8.2 Update the state estimate with the new measurement 8.3 Update the estimate covariance 9. Adaptive Adjustment: 9.1 Calculate the innovation 9.2 Adjust and based on Equation (6) 10. Anomaly Detection: 10.1 for each 10.2 10.3 Flage = −1 10.4 else if 10.5 Flage = 1 10.6 end if 10.7 end for 11. end while 12. threshold = std(window_innovations) * 2 // set threshold as twice the moving standard deviation 13. End |
4. Results and Discussion
4.1. Dataset Collection
4.2. Incidence of Deviations
4.3. Detection Procedure
5. Conclusions and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Ahmad, R.; Hämäläinen, M.; Wazirali, R.; Abu-Ain, T. Digital-Care in next Generation Networks: Requirements and Future Directions. Comput. Netw. 2023, 224, 109599. [Google Scholar] [CrossRef]
- Alhasan, W.; Ahmad, R.; Wazirali, R.; Aleisa, N.; Abo Shdeed, W. Adaptive Mean Center of Mass Particle Swarm Optimizer for Auto-Localization in 3D Wireless Sensor Networks. J. King Saud. Univ. Comput. Inf. Sci. 2023, 35, 101782. [Google Scholar] [CrossRef]
- Ahmad, R.; Rinner, B.; Wazirali, R.; Abujayyab, S.K.M.; Almajalid, R. Two-Level Sensor Self-Calibration Based on Interpolation and Autoregression for Low-Cost Wireless Sensor Networks. IEEE Sens. J. 2023, 23, 25242–25253. [Google Scholar] [CrossRef]
- Jhin, S.Y.; Lee, J.; Park, N. Precursor-of-Anomaly Detection for Irregular Time Series. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Long Beach, CA, USA, 6–10 August 2023; ACM: New York, NY, USA, 2023; pp. 917–929. [Google Scholar]
- Wang, S.; Li, C.; Lim, A. A Model for Non-Stationary Time Series and Its Applications in Filtering and Anomaly Detection. IEEE Trans. Instrum. Meas. 2021, 70, 6502911. [Google Scholar] [CrossRef]
- Le, K.N.T.; Dang, T.B.; Le, D.T.; Raza, S.M.; Kim, M.; Choo, H. VEAD: Variance Profile Exploitation for Anomaly Detection in Real-Time IoT Data Streaming. Internet Things 2024, 25, 100994. [Google Scholar] [CrossRef]
- Gu, J.; Peng, Y.; Lu, H.; Chang, X.; Chen, G. A Novel Fault Diagnosis Method of Rotating Machinery via VMD, CWT and Improved CNN. Measurement 2022, 200, 111635. [Google Scholar] [CrossRef]
- Blázquez-García, A.; Conde, A.; Mori, U.; Lozano, J.A. A Review on Outlier/Anomaly Detection in Time Series Data. ACM Comput. Surv. 2021, 54, 1–33. [Google Scholar] [CrossRef]
- Tama, B.A.; Comuzzi, M.; Rhee, K.H. TSE-IDS: A Two-Stage Classifier Ensemble for Intelligent Anomaly-Based Intrusion Detection System. IEEE Access 2019, 7, 94497–94507. [Google Scholar] [CrossRef]
- Ahmad, R.; Sundararajan, E.A.; Abu-Ain, T. Analysis the Effect of Clustering and Lightweight Encryption Approaches on WSNs Lifetime. In Proceedings of the 2021 International Conference on Electrical Engineering and Informatics (ICEEI), Kuala Terengganu, Malaysia, 12–13 October 2021; IEEE: Selangor, Malaysia, 2021; pp. 1–6. [Google Scholar]
- Ahmad, R.; Wazirali, R.; Abu-Ain, T.; Almohamad, T.A. Adaptive Trust-Based Framework for Securing and Reducing Cost in Low-Cost 6LoWPAN Wireless Sensor Networks. Appl. Sci. 2022, 12, 8605. [Google Scholar] [CrossRef]
- Ashrif, F.F.; Sundararajana, A.E.; Hasan, M.K.; Ahmad, R.; Hashim, A.-H.A.; Abu Talib, A. Provably Secured and Lightweight Authenticated Encryption Protocol in Machine-to-Machine Communication in Industry 4.0. Comput. Commun. 2024, 218, 263–275. [Google Scholar] [CrossRef]
- Cauteruccio, F.; Cinelli, L.; Corradini, E.; Terracina, G.; Ursino, D.; Virgili, L.; Savaglio, C.; Liotta, A.; Fortino, G. A Framework for Anomaly Detection and Classification in Multiple IoT Scenarios. Future Gener. Comput. Syst. 2021, 114, 322–335. [Google Scholar] [CrossRef]
- Ashrif, F.F.; Sundararajan, E.A.; Ahmad, R.; Hasan, M.K.; Yadegaridehkordi, E. Survey on the Authentication and Key Agreement of 6LoWPAN: Open Issues and Future Direction. J. Netw. Comput. Appl. 2024, 221, 103759. [Google Scholar] [CrossRef]
- Zakrzewski, R.; Martin, T.; Oikonomou, G. Anomaly Detection in Logical Sub-Views of WSNs. In Proceedings of the IEEE Symposium on Computers and Communications, Rhodes, Greece, 30 June–3 July 2022; IEEE: New York, NY, USA, 2022. [Google Scholar]
- Aboah Boateng, E.; Bruce, J.W.; Talbert, D.A. Anomaly Detection for a Water Treatment System Based on One-Class Neural Network. IEEE Access 2022, 10, 115179–115191. [Google Scholar] [CrossRef]
- Mare, D.S.; Moreira, F.; Rossi, R. Nonstationary Z-Score Measures. Eur. J. Oper. Res. 2017, 260, 348–358. [Google Scholar] [CrossRef]
- Golgowski, M.; Osowski, S. Anomaly Detection in ECG Using Wavelet Transformation. In Proceedings of the 2020 IEEE 21st International Conference on Computational Problems of Electrical Engineering (CPEE), Online, 16–19 September 2020; IEEE: New York, NY, USA; pp. 1–4. [Google Scholar]
- Wang, L.; Zhang, X. Anomaly Detection for Automated Vehicles Integrating Continuous Wavelet Transform and Convolutional Neural Network. Appl. Sci. 2023, 13, 5525. [Google Scholar] [CrossRef]
- Gou, L.; Li, H.; Zheng, H.; Li, H.; Pei, X. Aeroengine Control System Sensor Fault Diagnosis Based on CWT and CNN. Math. Probl. Eng. 2020, 2020, 5357146. [Google Scholar] [CrossRef]
- Ping, L.; Chun-Guang, Z.; Xu, Z. Improved Support Vector Clustering. Eng. Appl. Artif. Intell. 2010, 23, 552–559. [Google Scholar] [CrossRef]
- Knorn, F.; Leith, D.J. Adaptive Kalman Filtering for Anomaly Detection in Software Appliances. In Proceedings of the IEEE INFOCOM 2008—IEEE Conference on Computer Communications Workshops, Phoenix, AZ, USA, 13–18 April 2008; IEEE: New York, NY, USA, 2008; pp. 1–6. [Google Scholar]
- Singh, R.; Mehra, R.; Sharma, L. Design of Kalman Filter for Wireless Sensor Network. In Proceedings of the 2016 International Conference on Internet of Things and Applications (IOTA), Pune, India, 22–24 January 2016; IEEE: New York, NY, USA, 2016; pp. 63–67. [Google Scholar]
- Kumar, D.; Rajasegarar, S.; Palaniswami, M. Automatic Sensor Drift Detection and Correction Using Spatial Kriging and Kalman Filtering. In Proceedings of the 2013 IEEE International Conference on Distributed Computing in Sensor Systems, Cambridge, MA, USA, 20–23 May 2013; pp. 183–190. [Google Scholar] [CrossRef]
- Moustafa, N.; Slay, J. The Evaluation of Network Anomaly Detection Systems: Statistical Analysis of the UNSW-NB15 Data Set and the Comparison with the KDD99 Data Set. Inf. Secur. J. Glob. Perspect. 2016, 25, 18–31. [Google Scholar] [CrossRef]
- Beg, O.A.; Nguyen, L.V.; Johnson, T.T.; Davoudi, A. Cyber-Physical Anomaly Detection in Microgrids Using Time-Frequency Logic Formalism. IEEE Access 2021, 9, 20012–20021. [Google Scholar] [CrossRef]
- Oreilly, C.; Gluhak, A.; Imran, M.A.; Rajasegarar, S. Anomaly Detection in Wireless Sensor Networks in a Non-Stationary Environment. IEEE Commun. Surv. Tutor. 2014, 16, 1413–1432. [Google Scholar] [CrossRef]
- Huang, X.; Zhang, F.; Wang, R.; Lin, X.; Liu, H.; Fan, H. KalmanAE: Deep Embedding Optimized Kalman Filter for Time Series Anomaly Detection. IEEE Trans. Instrum. Meas. 2023, 72, 3537211. [Google Scholar] [CrossRef]
- Kim, J.; Song, M.; Kim, D.; Lee, D. An Adaptive Kalman Filter-Based Condition-Monitoring Technique for Induction Motors. IEEE Access 2023, 11, 46373–46381. [Google Scholar] [CrossRef]
- Chen, J.; Chen, K.; Ding, C.; Wang, G.; Liu, Q.; Liu, X. An Adaptive Kalman Filtering Approach to Sensing and Predicting Air Quality Index Values. IEEE Access 2020, 8, 4265–4272. [Google Scholar] [CrossRef]
- Forti, N.; Millefiori, L.M.; Braca, P.; Willett, P. Bayesian Filtering for Dynamic Anomaly Detection and Tracking. IEEE Trans. Aerosp. Electron. Syst. 2022, 58, 1528–1544. [Google Scholar] [CrossRef]
- Salem, O.; Serhrouchni, A.; Mehaoua, A.; Boutaba, R. Event Detection in Wireless Body Area Networks Using Kalman Filter and Power Divergence. IEEE Trans. Netw. Serv. Manag. 2018, 15, 1018–1034. [Google Scholar] [CrossRef]
- Maghfiroh, H.; Nizam, M.; Anwar, M.; Ma’Arif, A. Improved LQR Control Using PSO Optimization and Kalman Filter Estimator. IEEE Access 2022, 10, 18330–18337. [Google Scholar] [CrossRef]
- Martí, L.; Sanchez-Pi, N.; Molina, J.M.; Garcia, A.C.B. Anomaly Detection Based on Sensor Data in Petroleum Industry Applications. Sensors 2015, 15, 2774–2797. [Google Scholar] [CrossRef] [PubMed]
- Intel Berkeley Research Lab Intel Lab Data. Available online: http://db.csail.mit.edu/labdata/labdata.html (accessed on 12 April 2022).
- Yu, X.; Yang, X.; Tan, Q.; Shan, C.; Lv, Z. An Edge Computing Based Anomaly Detection Method in IoT Industrial Sustainability. Appl. Soft Comput. 2022, 128, 109486. [Google Scholar] [CrossRef]
- Wu, D.; Jiang, Z.; Xie, X.; Wei, X.; Yu, W.; Li, R. LSTM Learning with Bayesian and Gaussian Processing for Anomaly Detection in Industrial IoT. IEEE Trans. Ind. Inf. 2020, 16, 5244–5253. [Google Scholar] [CrossRef]
Symbol | Description |
---|---|
Sensor measurement | |
Time step | |
Estimate covariance | |
Process noise covariance | |
Kalman Gain | |
Actual measurement | |
Increment for process noise covariance | |
Increment for measurement noise covariance | |
Maximum value for measurement noise covariance | |
Difference anomaly detection threshold | |
Predefined anomaly detection threshold |
Variable | Value |
---|---|
initial_estimate_covariance | 1 × 10−4 |
initial_Q | 1 × 10−5 |
initial_R | 1 × 10−5 |
Initial_threshold_ detect_anomalies | 2.0 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Ahmad, R.; Alkhammash, E.H. Online Adaptive Kalman Filtering for Real-Time Anomaly Detection in Wireless Sensor Networks. Sensors 2024, 24, 5046. https://doi.org/10.3390/s24155046
Ahmad R, Alkhammash EH. Online Adaptive Kalman Filtering for Real-Time Anomaly Detection in Wireless Sensor Networks. Sensors. 2024; 24(15):5046. https://doi.org/10.3390/s24155046
Chicago/Turabian StyleAhmad, Rami, and Eman H. Alkhammash. 2024. "Online Adaptive Kalman Filtering for Real-Time Anomaly Detection in Wireless Sensor Networks" Sensors 24, no. 15: 5046. https://doi.org/10.3390/s24155046
APA StyleAhmad, R., & Alkhammash, E. H. (2024). Online Adaptive Kalman Filtering for Real-Time Anomaly Detection in Wireless Sensor Networks. Sensors, 24(15), 5046. https://doi.org/10.3390/s24155046