Detecting human activities in retail surveillance using hierarchical finite state machine | Synapse