Neuromorphic Sensor Network Platform: A Bioinspired Tool to Grow Applications in Wireless Sensor Networks

Wireless Sensor Networks (WSNs) must face the challenge of producing a vast plethora of applications from the least possible number of distributed sensors. In this paper we describe the Neuromorphic Sensor Network (NSN) platform, which implements a bioinspired approach to the development of growing applications in WSNs. NSNs follow an analogy with the neurophysiology of vertebrates, compressing the information coming from sets of sensors in wireless nodes and processing it by means of a set of processing units (PUs) that perform individual general purpose functions. Applications are then constructed through specific connections of these PUs, generating application pathways that allow the reuse of the same distributed NSN to give response to any desired output, thus achieving an application scalability. We illustrate the detailed process of growing applications using the NSN platform through an object tracking tool that mimics the behavior of the vertebrates visual system to detect and track objects. Finally, we describe a real implementation of the NSN platform in a road traffic monitoring and information system currently in operation in the cities of Madrid and Seville (Spain).


Introduction
Wireless Sensor Networks (WSNs) are one of the hot topics for the research community in the past decade [1].This popularity is mainly due to the plethora of applications that WSN is able to address from an ambient intelligence point of view, that is, producing knowledge about the environment.
WSNs were traditionally designed to implement a highly dense surveillance of their surrounding environment in order to collect the information needed to provide a specific service.
Consequently, the first concern of the scientific community focused on developing technologies to handle networks with a large and growing number of distributed sensors [2] in an energy efficient way [3].This strand of research is currently mature and has contributed to the field with platforms like SenseWeb [4], P2P Bridge [5], Hourglass [6], or GSN [7] among others.These platforms are able to connect and manage thousands of sensors spread around different locations.Hence we can state that we have achieved the desired scalability of WSNs.
Despite the previous assertion, is this the only scalability we could achieve in WSNs?
The access to big data provided by WSNs is currently becoming a reality in smart cities [8].Sensors deployed throughout the city can be interconnected and managed, forming a set of WSNs each of which is tailored to provide a particular service.However, to actually build a fully functional smart city, these WSNs should be capable of sharing information with one another so that we could enhance the resulting knowledge.The processing of this shared information could reside in a centralized system, which would access every piece of data, but obviously this is not the best approach.At present, the processing of data retrieved by WSNs frequently relies on the cloud computing paradigm.Although cloud computing could be understood as a centralized system given that data are always pumped 2 International Journal of Distributed Sensor Networks into a unique entity, the cloud, it is actually a complex and distributed network of processors that are coordinated in order to share resources and achieve synergies.
To move from specific WSNs implementing specific functions towards a real smart city where we can grow applications on existing WSNs, we need to be able to connect any set of distributed processing elements to perform tasks that can evolve.Thus, each of these specific connections could eventually be used by other processing elements to generate further levels of meaning.This is what we call application scalability.
Some existing technologies like the semantic web or the Android [9] operating system explore different approaches to connect processing elements.The former describes the available information and services through ontologies [10] that represent data and knowledge in an interoperable way, allowing a program or intelligent agent to automatically process them.On the other hand, Android makes use of the Thread class [11], defined as a concurrent unit of execution, to link different applications for achieving new purposes.In addition, formal declarative languages have also been developed for WSNs.Works like SNACK [12] and DSN [13] provide software components to build WSN applications.These components are abstractions of the physical elements in the sensors, thus easing the development of tasks like routing, data retrieval, or localization, among others.
These technologies show two essential capabilities: (i) constructing sequences of processing elements and (ii) defining abstractions of physical sensors.However, in order to achieve the desired application scalability in WSNs, we require a novel approach that integrates these two strands of work.We need to dynamically connect series of elements to provide evolving information and knowledge.To establish these connections in a generalized and automated way, we need to use a single abstraction to represent any of these elements, which can be then considered as an information producer regardless of whether it captures the information from the environment (sensor) or generates it as a result of a particular process (processing element).
The actual implementation of this change of perspective is not evident from the point of view of traditional engineering techniques.Consequently we need to look for new sources of inspiration.Fortunately, animal sensory systems carry out a processing paradigm based on pathways that are built and reused to conform different functions.This optimally fits our requirement specification.In fact, we have previously used this same biological approach in order to construct an activity-dependent clustering method for organizing large arrays of artificial sensory receptors [14].
Hence, we use neurophysiology as a handbook for setting up the basis of a distributed processing and sensing system able to meet the requirements of application scalability needed in modern WSNs.Based on this inspiration, we propose the Neuromorphic Sensor Networks (NSNs) as a bioinspired approach to scalable applications in WSNs and provide a NSN platform that implements this approach allowing their actual development.

Visual Pathways and Growing Applications.
To actually construct a workable large scale WSN that is not dedicated to a single function, we have drawn inspiration from a system that has been performing similar tasks for hundreds of millions of years.The vertebrate sensory systems consist of a distributed array of actuators and sensors and have a processing system that is often called a central system but is in fact also quite distributed and relies significantly on parallel computation [15].The nervous system of such creatures holds many clues to the design of a workable artificial sensory system.For explanatory purposes, let us focus on the functionality and operation of the visual system as an illustrative example.
The visual system in vertebrates is a sophisticated distributed processing system.It consists of an array of sensor devices and a processing and communications network built within the retina itself to produce preprocessed data output based on the visual input.The brain receives stimuli based on both image intensity and a set of inputs from functional processing blocks that transform the data into related events which convey more easily digestible information about the image.
The nervous system must use dedicated network circuitry to perform computation.For this reason, to understand the processing function of a neural system, it is necessary to follow the pathway of excitations and try and associate each pathway with some kind of function [16].The pathways constitute not just a flow of information but also information extraction and transformation processes.These pathways perform basic functions and they often merge together to form more sophisticated functions [17].The result is a network of information flows and processing elements.Viewed from a particular perspective, the flow appears to be a hierarchical structure.For example, from the retina moving towards the brain, there appears to be a hierarchical arrangement [18], but a similar structure is observed when following the functionality from brain to retina [19].
The analogy with WSNs is obvious; thus we will now take a vertebrate sensory system as inspiration to build a NSN approach to designing and operating WSNs in order to achieve application scalability.We must then develop growing applications able to reach an overall objective through a set of functions that process the data in a series of levels of increasing meaning.The key to implement this kind of application development is the decomposition of the overall objective into a set of subobjectives and using specific functions to reach them.Analogue to the pathways of a sensory system, a particular sequence of functions will result in a specific application.Intermediate functions can be specifically developed for a certain application or taken from the already existing set.Note that an application can be further integrated as a function in another chain of a new application to reach a more complex purpose, thus generating growing applications.

Logical and Physical NSN Architectures.
From a software development perspective, the NSN approach implies the creation of interacting processing units (PUs), each of which is capable of performing a specific function.The inputs to every PU can be data monitored from the environment or the outputs of other PUs.Thus, PUs can be structured in different processing levels that are hierarchically interconnected.
Using this architecture, we can develop a particular application by just selecting the PUs and the pathway required to obtain the desired output.
This logical NSN architecture is composed of two systems for monitoring and processing the data.The monitoring system collects data from the environment whilst the processing system extracts meaning from them through specific pathways of PUs.
This logical architecture must be embedded into physical devices that could host one or a set of PUs and sensors.The resulting physical architecture includes sensors, which compile measurements from the environment, aggregating devices such as motes, which gather the information from the sensors, process it, and transmit it, base stations (BS), which act as data sinks coming from motes, process them, and bridge them to different networks, and any other device with computational capabilities like PCs or microcontrollers.
Consequently, sensors are both physical and logical entities, whilst PUs can be seen as SW modules that can reside in motes, BS, PCs, microcontrollers, or any other computational device.
Figure 1 shows a schematic architecture model of a generic NSN.
Processing in NSNs is performed throughout their different logical and physical components, thus reaching the wellknown benefits of in-network computing [20].Consequently, NSNs are able to solve the traditional issues in WSNs making use of application pathways to provide a growing number of services in an efficient way.

The NSN Platform
We must now face the issue of constructing a platform that allows the development of scalable WSNs using the NSN approach.We have built a NSN platform that provides the capability of reusing already existing PUs in order to construct new application pathways as its key contribution.Thus the NSN platform allows the interconnection of PUs, the information sharing among them and its storage, the bridge between different technologies, and the interaction with the end user.This section is devoted to the description of the required modules that fulfill these needs.

NSN Platform Design.
We have designed the NSN platform as an event-based distributed system.This allows us to decouple the data from their specific source.We aim to manage information in a transparent way, that is, independent of the type of source (sensors, PUs, or databases) that produced it.Consequently, we treat any new data obtained by a sensor, generated by a PU, or stored in a database as an event.This design principle perfectly fits the requirements imposed by a smart city paradigm, characterized by multiple sources of information that must be accessed to retrieve and share their data.
Each time an event is generated, it must be sent to every PU that needs it for performing its specific function.In order to efficiently implement this information transfer, the NSN platform includes a dispatcher.The dispatcher sends the relevant information to every PU following a subscription strategy.The inherent multicast communications preserve the NSN from being overloaded with transmissions of data that would be eventually discarded by the PUs that were not interested in them.
In addition, in order to provide the required interoperability, the NSN platform includes the bridge server, a specific module that connects devices based on different technologies with the NSN.
On the other end, the interaction between the end user and the NSN is performed by the object server, which builds and uses virtual instances of the devices.
Finally, given the distributed nature of the NSN, a network manager is needed to control the elements.Figure 2 shows a generic NSN platform.

Implementation of the NSN Platform.
Given the eventbased nature of the NSN platform, we need to employ programming tools for distributed computation.Specifically we used ZeroC Ice [21] technology, which provides the infrastructure required to manage distributed objects.Ice is an open-source object-oriented middleware faster and simpler than CORBA or SOAP, supporting many software platforms and languages such as C++, .net,Java, Python, Ruby, and PHP.Ice defines its own specification language, Slice, which helps in the definition of data types and interfaces.Ice performs the communications among objects within a TCP/IP network in a transparent way by defining the corresponding stubs and skeletons for each object.The piece of software that implements the functionality is called a servant object.A servant object has to be wrapped into a class that extends an automatically generated stub class.
Each module represented in Figure 2 publishes a set of interfaces (facets in this approach) to access the data and/or configuration they provide.Thus PUs in an application pathway use these facets to collect the data required for their specific function and return back the processed information through the dispatcher.
In addition, under this programming paradigm, each time the user accesses the system for data retrieval, a virtual instance of the target object is returned.We access the devices through their proxies which are locally instantiated and represent the real device running in a remote host.
Figure 3 shows the modules of the NSN platform and their public interfaces.Each module can make use of any of the public interfaces to perform its task.All the modules in the platform include a management facet.This facet allows us to access them directly and interact with them to change their working parameters or retrieve the required information.

Object Server.
Let us now start from the lower layer of the NSN logical architecture responsible for monitoring the environment.Following the design principle we established, any device in the NSN has its virtual representation on the NSN platform.In order to retrieve data, the user interacts with the device through the object server.This server provides connections to the physical devices.
The object server is an Ice application that instantiates the set of devices it manages.The list of devices is stored in a database.The object server has 3 specific public interfaces: Device, Type, and Region, which give access to the particular features of the device.
During the process of connecting a new device to the NSN, the object server performs the following set of tasks: (i) it establishes the connections with the devices and configures them to provide the required functionality; at this stage, the server defines the regions of operation of each set of devices and their bridge server; (ii) it discovers the dispatchers; the object server is able to generate events in the system as a result of actions performed on the devices; these actions are encapsulated as events and posted in the corresponding dispatcher components; (iii) it registers an event listener of some type of events; in this case, the object server can listen to management events in which the configuration parameters can be modified; and (iv) it listens to connections from other applications or users.
The definition of the object server can be observed in the snippet in Listing 1.

Dispatcher.
The dispatcher is key for the application scalability of the NSN.It notifies events to other interested modules.
The dispatcher is an Ice application, that is, a server that includes three facets.These facets are defined in the snippet in Listing 2. Each object producing events must instantiate the EventPoster facet in the dispatcher; thus it must get the EventPosterPrx object to invoke the postEvent( ) method.The dispatcher also implements the Register interface, which allows other components to subscribe to a certain type of events.Whenever they are required, specialized dispatchers can be defined to handle events of a specific type; then PUs producing this type of events would post them into the dispatcher using the EventPosterPrx.

Bridge Server.
The bridge server provides interoperability between the core system and a NSN of a specific type connected to it.It links the NSN with a generic IP network decoding the messages coming from the NSN translation following a specific protocol and reformatting them into IP packets.Thus each bridge server is built to implement a connection to a specific type of NSN considering its underlying technology.
The bridge server is an Ice application presenting several facets as shown in the snippet in Listing 3.
The control interface allows the system to perform requests directly to the bridge which are then translated into instructions to the NSN.On the other hand, the server must instantiate the EventPosterPrx object from the dispatcher to post the events coming from the sensors.The bridge servers retrieve information from the sensors and publish it in the NSN.That task is specific of the server and does not need to be specified by a given interface.

Network Manager.
The network manager provides mappings between a service name and its address in the network; that is, it is a registry entity system or naming service.In this way, it acts similarly to a Domain Name System (DNS).
The network manager scales following the same approach as DNS servers.Thus, a hierarchy of network managers can be deployed whenever the already existing servers cannot handle the whole address resolution.
The network manager allows an easy insertion of a new module in the NSN by simply registering the IP address where the server is located and the service name.The network manager can also perform load balancing among multiple modules offering the same service (e.g., multiple dispatchers) to avoid overloading.

Processing Units.
As we stated in Section 2, the PUs perform specific functions.PUs publish their own interfaces to interact with other modules.The particular definition of a PU includes its operation, the inputs required from devices or other PUs, and the outputs generated.

Growing Applications in NSNs
In order to illustrate the development of growing applications in NSNs, let us describe through an example how they are designed, built, and operated to achieve the desired scalability.

The NSN Analogy.
Let us start describing a general analogy between a neurological system and the NSN architecture.For the sake of clarity, we will use the vertebrates visual system that we took as an example in Section 2 to make this analogy concrete.The retina forms the base level of the system.It is composed of several layers of interconnected neurons.Rods and cones are photon intensity detectors distributed across a spatial grid.These sensors report their outputs through bipolar and amacrine cells to ganglion cells.Amacrine cells regulate bipolar cells and associate different ganglion cells.Ganglion cells represent the final stage of information processing within the vertebrate retina and connect it to the central nervous system.Different ganglion cells become selectively tuned to detect surprisingly subtle "features" of the visual scene, including color, size, and velocity of motion.These are called "trigger features" and they represent event information related to the visual image.The processing of this generated information that is required for a specific output takes place in the pathways between the ganglion cells and the brain.These pathways in some sense define the process of the computation that is performed.The pathways are typically built in terms of a tree of processing elements.The analogy between a neurological system like the vertebrates visual system and the object tracking NSN can be observed in Table 1.
In addition, the visual system pathway that is built for a specific purpose corresponds to the logical tree that must be constructed connecting different sensors and PUs to perform a particular application pathway of a NSN.

Problem Statement and NSN Architecture.
Let us consider the following problem: within a certain defined area (the monitoring region, denoted by R) there are rectangular objects moving in any of the four fundamental directions (North, East, South, or West).The objects are always sufficiently separated to keep their geometric identity.The task is to design a system capable of determining, at each moment in time, the number of objects present, their dimensions (hight and width), their location, and the direction they are moving in.
We address the problem of building a NSN capable of performing the desired object tracking application.Its logical architecture is structured as a tree that forms a 5-layer hierarchy that examines the monitoring region (layer 1) and accomplishes four specific functions: partial edge detection (layer 2), complete edge detection (layer 3), object detection (layer 4), and motion detection (layer 5).These functions are performed by a set of 4 PUs, namely, PU 1, PU 2, PU 3, and PU 4. The application pathway needed to implement the object tracking service will sequentially connect these 4 PUs in the previously specified order.
The physical architecture of this NSN is schematically shown in Figure 4.It consists of a single BS and a set of motes capable of communicating directly with the BS.Each mote is responsible for a region containing several optical sensors that can only communicate directly with their parent mote.Mote-to-mote and mote-to-BS communications are both wireless.For the sake of simplicity we use a regular square region and without loss of generality we also assume that the motes are uniformly distributed in the region and the sensors are uniformly connected to each mote.
Each optical sensor measures the light intensity in a certain position.The sensors detect whether there is an object covering them or not, operating in an on/off decision mode.In addition, we assume that a sensor only detects light from its own surrounding area and not from areas of other sensors.
For explanatory purposes, let us assume that PU 1 and PU 2 reside in motes.Using the values of all its sensors, a mote can only perform a partial edge detection (PU 1).Note that motes have incomplete information about the positions which delimit its periphery.To tackle this issue, a mote must communicate with its neighbors and request the values of the sensors on the other side of its periphery.This allows a complete edge detection performed by PU 2. Then the mote sends to the BS the positions of its local edges provided by PU 2.
The BS hosts PU 3 and PU 4, which complete the object tracking application pathway.PU 3 will take the outputs generated by PU 2 at the different motes to integrate them into the shape of the objects.Additionally, the BS stores timestamped positions of the objects that allows PU 4 performing the final object tracking function.
It is important to note that the described procedure implies a layered processing (partial edges, complete edges, objects, and motion) that only uses binary and local information, therefore being easily scalable.

Formal Description.
We now proceed to provide a formal mathematical description of the stated problem.First, we introduce the notation and basic definitions which will be used throughout the rest of the section.
We consider  2 motes deployed in the region R, each denoted by   , with 1 ≤ ,  ≤ .Every mote has  2 optical sensors.Motes and sensors are deployed in square lattice.
Let    denote the state of the sensor in position (, ) for the mote in position (, ).We will relax the notation when it does not lead to confusion and simply use   to refer to a sensor in a particular mote.Let  = [  ] 1≤,≤ be the sensing matrix for a given mote.If the sensor detects an object at position (, ), its state is set to active,   = 1; on the contrary, if it does not detect an object, its state is set to inactive,   = 0.The sensors on the boundaries of the mote form the periphery  of the mote; the remaining sensors form the inner area .In addition, we separate sensors in  as corner or lateral sensors.
The four nearest neighbors (up, right, down, and left) of a sensor form its neighborhood.The neighboring sensors of sensor   are denoted by   or  c  depending on whether they are connected to the same or different motes, respectively.If all the sensors in a neighborhood are active we write   = 1 (or  c  = 1).

Partial Edge Detection.
As said, a single mote can only achieve a partial edge detection through the function performed by PU 1.Consider the example shown in Figure 5.Given the object configuration in Figure 5(a), the corresponding values of the sensors are those indicated in Figure 5(b).The result of the partial edge detection in every mote is shown in Figure 5(c).Note that only sensors on the perimeter have incomplete edge information.
Let us provide a formal description of the algorithm that performs partial edge detection.Let  * = [ *  ] 1≤,≤ be the partial edge matrix calculated by a certain mote using only its own sensors.The elements are set to  *  = 1 if there is an edge at position (, ),  *  = 0 if there is no edge at position (, ), and  *  = 0.5 otherwise, that is, if the mote does not have sufficient information to decide on the presence of an edge.In order to obtain its partial edge matrix  * a mote executes Algorithm 1.

Complete Edge Detection.
In order to complete the information, motes communicate the detected partial edges to their neighbors and request the data needed to resolve the ambiguity.This way we can implement a complete local edge detection.
In the example in Figure 5, when the complete local edge detection has finished, the set of identified edges is showed in Figure 5(d).Note that, depending on the position occupied by the uncertain edge (lateral or corner), the mote will have to communicate with one or two motes.

Object Detection.
Once the motes have their complete edge information they send the positions of the obtained local edges to the BS, to trigger the next PU to perform its object detection function.Note that PU 1 and PU 2 that reside in a mote cannot implement this object detection because they only have some pieces of the puzzle (depending on its size, an object can occupy positions corresponding to several adjacent motes).When the BS has gathered the positions of all edges in the monitoring region, the object detection begins.
Since the detection is restricted to rectangular objects, a simple tour through the edge positions allows the determination of the object's features.PU 4 runs Algorithm 3 to perform the desired object detection.end if (10) end for (11) return  (12) end procedure Algorithm 2: PU 2: Complete edge detection.

Motion Detection.
Finally, PU 4 will perform the motion detection from the temporal information of the detected objects.Motion detection relies on two consecutive object detections.For an object detected at , the PU searches its copy in the surroundings of its current location at  − 1.From both positions (current and previous) it establishes the motion vector of the object.
Let Object() and Object( + 1) be two structures with all the information related to the objects in the monitoring region at the times  and  + 1. PU 4 in the BS performs object tracking by means of Algorithm 4.
To illustrate its operation we will again use a simple example.Consider a square moving diagonally (from the upper left to the lower right corner) and a smaller square moving East.The complete application pathway for the object tracking (including partial and complete edge, object, and motion detection) is graphically and numerically shown in Figure 6 and Table 2.
The observed results show that the NSN approach is a viable proposal to achieve application scalability in WSNs.It shows how applications can be constructed in a hierarchical, distributed, and scalable way in order to reuse already existing processing units in many different applications within a set of existing WSNs.

Real Deployment of the NSN Platform
We have implemented the NSN platform described in Section 3 in a real application deployed in the cities of Madrid and Seville (Spain) which monitors road traffic based on detecting Bluetooth devices.

Bluetooth-Based Vehicle Detection.
Novel intelligent transportation systems (ITS) include automatic vehicle identification (AVI) platforms capable of detecting a vehicle in different points of a road or a city.These AVI systems provide detailed information like travel times (TTs) of road segments, origin-destination matrices, and so forth, highly useful for traffic managers, municipalities, and drivers.
In collaboration with Sociedad Ibérica de Construcciones Eléctricas (SICE), worldwide leader in ITS, we developed     parameters will then be correlated with traffic measurements in order to construct the empirical impact of traffic on the city.The main contribution of this new type of information will be its spatial density (much larger than the one reached by the current meteorological stations) and its continuous monitoring in time.

Conclusions
WSNs can currently use many different clustering approaches in order to group together their sensors in a hierarchical and more efficient way to scale in size and number.However, the application scalability, that is, developing a growing set of applications that can be performed by a single WSN, is yet unresolved.
The operation of vertebrate sensory systems, which creates pathways to build specific functions, provides an optimal approach to achieve this goal.The processing architecture and communications in a WSN can be designed to mimic this operation.Consequently, we have constructed a NSN platform that provides the capability of creating pathways of already existing PUs to perform specific functions and reach the desired application scalability.
This NSN platform is currently implemented as the basis of a traffic monitoring and information system, deployed in a real scenario in the cities of Madrid and Seville.Following the NSN principle, the NSN platform allows us to construct new applications on top of the already existing physical sensor network to create the empirical connection between traffic and environment in a city.

Figure 3 :
Figure 3: Modules and interfaces in the NSN platform.

Figure 4 :
Figure 4: Network deployment over a monitoring region.Base stations, motes, and sensors are represented by blue, red, and empty circles, respectively.Solid lines indicate wired (sensor-to-motes) and wireless (mote-to-mote and mote-to-BS) communication links.
(a) Objects in monitoring region (b) Sensor states (c) Partial edge detection (d) Complete edge detection

Figure 5 :
Figure 5: Illustrative example of the object detection pathway.(a) Objects in monitoring region.(b) Sensor states (full and empty circles express active and inactive sensors, resp.).(c) Partial edge detection in every mote from local information (red crosses represent uncertain edges).(d) Complete edge detection after intermote communication.(e) Information about detected objects.

Figure 6 :
Figure 6: Illustrative example of the object tracking application.

Figure 8 :
Figure 8: NSN traffic monitoring and information web page.
/ ** The EventPoster interface allows a client to post an event to the * dispatcher, who will then broadcast it to all registed listeners.

Table 1 :
Correspondence between visual system and NSN elements and functions.