Anomaly Detection: IoT Measurements

July 27, 2019
Data collected through IoT Devkit MXChip AZ3166 connected to Azure IoT hub is used to detect anomalies by employing Azure ML
Various process involved in the creation of Azure Machine learning are detailed below. **Data** MXChip IoT DevKit was configured to measure temperature and humidity and connected to Azure IoT hub and data were collected using Azure Streaming Analytics Job. The data was collected at an interval of 500 ms into IoT hub and stored in Azure Data Lake Store Gen2. The process was run for few hours and the room temperature was intermittently increased. **Retrieve Data** Data was downloaded from Azure Blob storage using Azure Storage Explorer. **Prepare Data** The module “Apply SQL Transformation” was used to separate out the timestamps by date and time using SQLite (refer: https://sqlite.org/lang.html) Select messageId, temperature, humidity, EventProcessedUtcTime, PartitionId, EventEnqueuedUtcTime, IoTHub, ProcessedTime, [ProcessedTime] as RecordDateTS, date([ProcessedTime]) as Recorddate, Time([ProcessedTime]) as RecordTime, strftime('%H',Time([ProcessedTime])) as RecordTimeHr from t1; **Preprocess Data** Used Sweep Clustering to identify the number of centroids on the initial run and evaluated to be 5 which was applied to K-Means Clustering module. **Algorithm** Separate Anomaly Detection was applied for Temperature and Humidity (despite stronger correlation exists between the two), it was meant to identify the increase/decrease of each of these variables (due to manually created spike in temperature) and to evaluate against various parameters of the Anomaly Detection module. **Results** Several RScripts were created for visualization of the influence and behavior of the variables.