# Adaptive Behaviour for a Self-Organising Video Surveillance System Using a Genetic Algorithm
## 1 Introduction  
The Internet of Things (IoT) frequently involves retrofitting existing infrastructure with \"intelligent\" capabilities, see, e.g., in [1]. In turn, this requires identifying methods for turning an ad hoc collection of newly \"connected\" devices [2] into a cohesive whole capable of providing a better service than was previously achievable, due to the isolation of its various components [3]. This is often a challenging proposition and it could be argued that the IoT has so far failed to deliver on some ambitious promises of seamless interoperability and a step-change in how connected devices interact with their users and/or with each other. At least part of the reason is that the \"augmentation\" of pre-existing \"things\" with advanced communication and machine learning abilities is not enough. To recycle an iconic IoT meme: it is not because your fridge is now connected to the Internet that it will spontaneously enter a mutually beneficial relationship with the application responsible for monitoring the stock of fresh milk at your local supermarket. Even when possible in principle, useful interactions between \"things\" need to be identified and established carefully to provide any tangible benefits, which is far from trivial. In this article, we are focusing using a genetic algorithm to engineer self-organisation into a population of devices which (a) were previously fulfilling a dedicated function (that might be impacted (positively or negatively) [1] by their new status as parts of a bigger whole) and which (b) could belong to different actors or organisations (that had never before cooperated and therefore may not have any agreement in place to realize this cooperation on an operational level, e.g., to share any resulting additional cost). To illustrate this, we chose to investigate a specific--if hypothetical--scenario in which CCTV cameras in a shopping mall or retail space (street market, etc.) are being networked to provide an integrated video surveillance system [2]. The protection of public places through surveillance measures has been a concern for decades [4] and using the IoT to use existing infrastructure is a sustainable and cost-efficient approach. Our hypothetical cameras belong to different shops where they were installed with the primary (and thus far only) objective to monitor the respective shops' sensitive areas. There are solutions proposed in the literature to determine beneficial location, orientation and timing for integrated video surveillance systems (see, e.g., in [5]); however, in our case, the cameras' locations and orientations are optimised subjectively by the shop owners without any organised pattern, resulting in partial overlap of coverage. Using a genetic algorithm, we aim to optimise the system's performance (i.e., the cost for--and the benefit generated from--operating it) by scheduling the individual camera's activation. This is similar to solving a multi-objective optimisation problem:  
* The cameras must spent as little time as possible in the \"active\" state [2] in which they are consuming resources such as power, network bandwidth, disk storage, screen space on the monitoring workstation, etc. * The fraction of the shopping mall surface that is not being monitored (i.e., \"blind spots\") should be minimised. * The overlap between \"active\" cameras (i.e., zones that are being shown on several concurrent video feeds) is wasteful and must also be minimised. We will show that once the alternative schedules are suitably encoded and a weighted fitness function has been specified, this multi-objective optimisation problem is easily and quickly solved by a genetic algorithm. Genetic Algorithms (GAs) [6] are a nature-inspired [7] heuristic [8], i.e., an approach to _find_ or _estimate_ good solutions to a problem, as opposed to reliably determine the best one. Bio-inspired approaches apply principles found in nature [9] to improve algorithms [10]--often with very good results [11].