I'm currently working on access control project, Smart Lock to be more spesific. Like the other smart lock system, the system required user's authentication to open the door. I'm using RFID as authentication method.

to make my product be more secure, i want to equip my system with 'Machine Learning' to learn the user's behaviour on unlocking the door. shortly, the system will store user's history when unlocking the door (Timestamp). with those data, the system will recognize the patterns of user so it will identify everytime user open the door whether it is normal or anomaly.

for example if the user is usually open the door at 6 a.m and 6 p.m but at one point the system detects there is an attempt to open the door at the middle of the night, it will considered as an anomaly.

i've been reading any literature and realizing that to resolve this case, i have to use unsupervised learning for clustering and they said that K-Means is suitable for clustering. but my question is how to use K-Means if my data is only timestamp?

  • $\begingroup$ Did you try a rule-based system first? Sometimes the best "machine learning" algorithm is to simply encode your personal knowledge about a problem in code. $\endgroup$ – shadowtalker Oct 4 '18 at 13:24
  • $\begingroup$ If you insist on K-Means, I recommend Ckmeans.1D.DP which is globally-optimal K-means clustering for 1-dimensional data. However, choosing K remains a problem, and the cluster assignments must "learn" to update as user behavior shifts over time. You will need an automated way to select K (e.g. the gap statistic), or something like Mean Shift or HDBSCAN that doesn't need K. $\endgroup$ – shadowtalker Oct 4 '18 at 13:32
  • $\begingroup$ @shadowtalker i think ruled based system is not really suitable for my project since the behavior of every users are different. $\endgroup$ – Baso Ahmad Oct 5 '18 at 8:01
  • $\begingroup$ @shadowtalker you have any recommendation about clustering unsupervised beside k-means? i found density based clustering, do you think it's a good idea? $\endgroup$ – Baso Ahmad Oct 5 '18 at 8:06
  • $\begingroup$ Mean Shift and HDBSCAN are both density-based $\endgroup$ – shadowtalker Oct 5 '18 at 13:44

You dont need K-means, you need to build a time series/ state based model based on history that predicts the probability of opening door in next time stamp.So steps would be-

1) build an expected relation using time series/regression/ state based model.[like for regression you can have variables- day or night, hour of the day, weekday weekend, difference of time in opening gate again etctec.)

2) forecast door opening probability in next time stamp.

3) compare with actual data( door open or not).

4) difference of 2 and 3 is 'degree of abnormal behaviour'

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.