Use machine learning to find anomalies in a smart lock

Want to get started with machine learning on ARTIK cloud services, but aren’t sure how it works? We have published a tutorial that should answer your most commonly asked questions. This interactive web sample detects anomalies in a smart lock device, using Rules and its integration with our machine learning APIs. Read our tutorial or go right to the sample on GitHub, which includes step-by-step instructions. Below is a quick overview of how it works.

To begin using this sample, you’ll create a virtual device type that emulates a smart lock, using a JSON Manifest that we provide. The Manifest defines locked and unlocked states for the device.

After connecting a new “smart lock” device to your account, you can use the sample to generate 30 days of locked and unlocked events for the device. These occur at time points predetermined for this sample and are meant to reflect a typical real-world scenario: the door is locked while the owner is at work from around 9 am to 6 pm on weekdays, and briefly unlocked before and after.

You will then write a Rule based on an anomaly detection condition. This Rule will send you an email when it detects any anomaly in the behavior of the smart lock device. We suggest setting the confidence level of the Rule to “High” to minimize the occurrence of false alerts.

Machine learning models on ARTIK cloud services are continuously trained on a 30-day sliding window of historical data. By generating the event data, the model learns to associate “locked” and “unlocked” states with certain time periods. As seen in the above timetable, there are also times during which the state is “unknown” to the machine learning model. Because your Rule has a “High” confidence level, during these times neither a locked nor an unlocked event will be read by your Rule as an anomaly.

Finally, you can use the web sample to manually send “locked” or “unlocked” events from your device at various times. If any of these are found to be anomalies, this will trigger your Rule and you will receive an email from ARTIK cloud services.

Interested in trying out Samsung ARTIK cloud services? Sign up for a developer account and connect devices and services while bypassing silos. We look forward to seeing your IoT solutions!