Online Unsupervised Anomaly Detection with Model Explainability and Human-in-the-Loop Feedback
Smart building IoT networks generate complex, continuous sensor streams that challenge traditional anomaly detection due to concept drift and limited interpretability. This project proposes and validates an online, unsupervised, and human-refinable anomaly detection architecture. The system uses a parallel inference engine to simultaneously run two models: a high-accuracy deep transformer and a lightweight spectral CNN, both deployed in a real-time Streamlit prototype with Kafka ingestion and edge hardware benchmarking. To ensure interpretability, the architecture integrates a realtime explainability module using Shapley Additive Explanations (SHAP) and a Human-in-the-Loop (HITL) feedback mechanism to validate detections. Experimental results from a controlled streaming simulation demonstrate that the Online Transformer adapts to distribution shifts via dynamic thresholding, achieving 93% precision. At the same time, the SR-CNN offers superior efficiency (< 10 ms latency) with 96% precision. The integration of SHAP achieved a 98.1% convergence rate within the 2-second transmission window, indicating that 68% of detected faults were “Contextual Anomalies”-subtle history conflicts that are invisible to static thresholds. Integrating online representation learning with HITL feedback creates a strong anomaly detection system for dynamic edge environments.