Conventional surveillance systems primarily detect human presence and provide limited capability to interpret contextual security conditions. This study developed an automated contextual security system integrating YOLOv8n-based human detection, HSV-based clothing analysis, database-based identity verification, and temporal reasoning. A formalized rule-based mechanism mapped identity, clothing, and operational time into VALID, VIOLATION, GUEST, or INTRUDER categories, transmitted results to ThingsBoard via message queuing telemetry transport (MQTT), and selectively stored evidence for VIOLATION and INTRUDER events. The system was evaluated using 170 annotated samples from 27 controlled indoor simulation sessions involving three participants under normal and low-light conditions at distances of 1–3 m. Clothing classification achieved 27.06% accuracy and a 21.33% macro F1-score, identity verification achieved 100.00% across all metrics, temporal classification obtained 77.65% accuracy and a 77.58% macro F1-score, and contextual status achieved 55.29% accuracy and a 45.96% macro F1-score. The results identified HSV-based clothing analysis as the main performance bottleneck. The primary contribution was a traceable perception–context–decision–action mechanism that transforms heterogeneous observations into context-dependent security decisions, real-time monitoring, and automated evidence management rather than relying on a single visual attribute.
Copyrights © 2026