Wednesday, September 10, 2008

Event Processing Example - Shoplifting

Perhaps shoplifting (or rather the prevention of shoplifting) is a good application of complex event processing (CEP).


Shoplifting prevention has a level of complexity that is absent from something like air traffic control (the subject of Tim's next post). The behaviour of aircraft is subject to the laws of physics, which (at least for the purposes of air traffic control) are pretty well understood and unlikely to change. Whereas the behaviour of shoplifters is (i) subject to the observation and confirmation of shoplifting patterns and (ii) subject to learning and innovation by the shoplifters themselves. Therefore the two cases aren’t the same: there is a form of flexibility I’d want to build into a shoplifting system that I wouldn’t need in the Air Traffic Control system.

I think we need to distinguish between modelling shoplifting (constructing a theory about the observable patterns associated with shoplifting) and modelling shoplift-detection (designing a system that will observe or infer these patterns). In the comments to Tim's blog, there is a discussion on the relative merits and technical feasibility of two mechanisms: image processing and RFID-based merchandise-object tracking. I think these two mechanisms belong to a model of shoplift-detection rather than a model of shoplifting; in discussing them we are not saying anything about the phenomenon of shoplifting itself.

Perhaps the reason I think this distinction might be important is that I’m coming at this from a service-oriented perspective, and so I’m always looking for ways to build solutions in a loosely coupled way, therefore decoupling the models. I accept that other people may not see this as (i) relevant or (ii) technically feasible at the current state-of-the-art.

There is of course an arms race between shoplifters and shoplifting detection systems. Shops fit cameras and RFID tags, shoplifters adopt new evasion tactics and carry cheap devices to reprogram the RFID tags. So both the shoplifting model and the shoplifting-detection models evolve over time.

The evolution of the shoplifting model sometimes affects the evolution of the shoplifting-detection model. Suppose we discover that professional shoplifters work in teams - one distracts the shop assistant, a second one puts the item into a bag, then switches bags with a third team member before leaving the store. So even if the theft was spotted on the cameras, the thief no longer has the goods, goes protesting to the manager's office to be searched, and then leaves the store with an apology. How are you going to build a system to detect that? It's no good just tracking individual shoppers and trying to determine which of them might be shoplifters (which is the form of simplistic event-response I criticized in my earlier posts). The granularity of the event-tracking system has to change in response to a new theory about the behaviour of shoplifters.

However, the shoplifting-detection model may evolve as a consequence of technological change - improved image processing, more sophisticated or widespread RFID. This change doesn't immediately affect the behaviour of shoplifters, although shoplifters may change their behaviour over time to respond to these advances in technology. Loosely coupled, therefore.

No comments:

Post a Comment