Design Neural Wireless Sensor Network Using FPG A

Wireless sensor networks(WSN) are an exiting emerging technology that scientists believe to become a part of every day life in the next few years. However, at this time many issues in wireless sensor networks remain unresolved. This paper studies the architecture of a neural wireless sensor network designed to identify technical condition of the base station of wireless sensor networks ,and this work presents an on-chip artificial neural networks(ANN) in a Field Programmable Gate Arrays (FPGA) system. In order to take maximum advantage of the distributed architecture of multiple NN systems is to providing a high degree of parallelism between NNs and, hence, a higher speed-up in relation to a sequential implementation. The goal of this work is to realize the hardware implementation of the base station of neural wireless sensor network using FPGAs to measure hamidi ty, temperature and light for the security system of an office.


INTRODUCTION
ireless communication is one of the most vibrant research areas in the communication field today.While it has been a topic of study since the 60's, the past decade has seen a surge of research activities in the area.This is due to a confluence of several factors.First is the explosive increase in demand for connectivity, driven so far mainly by cellular telephony but is expected W https://doi.org/10.30684/etj.30.9.15 2412-0758/University of Technology-Iraq, Baghdad, Iraq This is an open access article under the CC BY 4.0 license http://creativecommons.org/licenses/by/4.0 to be soon eclipsed by wireless data applications.Second, the dramatic progress in VLSI technology has enabled small-area and low-power implementation of sophisticated signal processing algorithms and coding techniques.[1] With the requirements for advanced integration, intensive onboard processing, and low power consumption, FPGAs emerge as a technology of choice that strikes an optimal balance between processing power, energy requirements, and flexibility.Through the power of reconfigurability, wireless sensor network designs containing reprogrammable logic can be upgraded, errors can be fixed, and limitedresource applications can be dynamically reprogrammed in the field.[1] The programmability of reconfigurable FPGAs yields the availability of fast special purpose hardware for wide applications.Its programmability could set the conditions to explore new neural network algorithms and problems of a scale that would not be feasible with conventional processor.
The concept of ANNs is emerged from the principles of brain that are adapted to digital computers.The first works of ANNs were the models of neurons in brain using mathematics rule [2].These works show that each neuron in ANNs take some information as an input from another neuron or from an external input.This information is propagated as an output that are computed as weighted sum of inputs and applied as non-linear function.
Architectural ANNs parameters such as number of inputs per neuron and each neuron's conductivity change remarkably from one application to another.Thus, for special purpose network architectures parameters must be carefully balanced for efficient implementation.[3] Neural Network (NN) Implementation in hardware using FPGAs are chosen for implementation ANNs with the following reasons: 1.They can be applied a wide range of logic gates starting with tens of thousands up to few millions gates.2. They can be reconfigured to change logic function while resident in the system.3. FPGAs have short design cycle that leads to fairly inexpensive logic design.4. FPGAs have parallelism in their nature.Thus, they have parallel computing environment and allows logic cycle design to work parallel.5.They have powerful design, programming and syntheses tools.At the first step of FPGAs system design, the architecture of ANNs must be specified with either schematic or algorithmic [3].The idea of using FPGA in WSN have been used by Jorge P. , and other [4], design a modular architecture for nodes in WSN, the architecture is made up of four layers, these layers are ( communication, processing, power supply and sensing/actuating ).A set of such layers used to create the node for a specific application.Changing of application implies changing the layers or redesigning one or some of them from scratch all the system, which drives to high cost and time inefficiency.Other trend have been used by Stephen J. , and other [5], there work partitions the wireless sensor module into a series of layers with area (25 mm X 25 mm), The modulehas resulted in the specification of a series of layers including a FPGA for signal processing.Forming the initial elements of the 25 mm sensor node toolkit that can be programmed for use with different sensors and application.Freek Z. [6], shows that WSN and NNs can be combined into a PDF created with pdfFactory Pro trial version www.pdffactory.comworking system, in this case, the system tries to detect the shadows of clouds as they drift over a field.From the above works, a new trend can be used that combine NN with WSN for asecurity system and implement the system using FPGA.

WSN and NN
WSNs are an emerging technology which holds the potential to revolutionize everyday life [7,8].Continuous advances in semiconductor technology have enabled miniaturization of radios and mechanical structures and deployment of very cost-efficient wireless sensor nodes.
The number of applications which can take advantage of wireless sensor networks is huge.Among these multiple applications we have: A sensor node basically consists of a microcontroller (processor and memory), sensors, analog-to-digital converter (ADC), transceiver (sender and receiver) and power supply.The abstract architecture of a sensor node and the dependencies of its units are depicted in fig.(1).
The structure of neural networks and wireless sensor networks can both be described as a collection of interconnected simple components.Both kinds of networks are also similar in that they implement a function that maps input values to output values.These similarities between wireless sensor networks and neural networks led to the construction and investigation of a system that combines both technologies.Physical limitations however complicate straightforward combination of both technologies.[6] For example, neural-network theory usually assumes data transport to be free, but in wireless sensor networks input and output are usually geographically separated.The cost of the connection is not the only issue, neural networks are very sensitive to faulty connections; wireless sensor networks usually have unreliable radio links.Another difference is in the structure of the network.The random distribution of components, and tree-like topology in wireless sensor networks, is not necessarily a suitable neural network topology for the application at hand.With an unsuitable topology, the redundancy in wireless sensor networks could lead to overtraining in the neural network, and make it more sensitive to noise [1].Physical limitations however complicate straightforward combination of both technologies.
In general Artificial Neural Networks (ANN) show characteristics such as distributed representation and processing, massive parallelism, learning and generalization ability, adaptively, inherent contextual information processing, fault tolerance and low computation.Many of those characteristics are either inherent or desirable for WSNs as well.As shown in fig.2, we transfer the perception of a biological neuron via an artificial neuron to the sensor node.The functionality h(x) is basically a weighted sum over all inputs.The sensor converts the physical world PDF created with pdfFactory Pro trial version www.pdffactory.comto an electrical signal which is filtered or preprocessed corresponding to weighting/synapse.The subsequent processing within the processor corresponds to the chemical processing accomplished by the soma or applying the particular functionality h(x), respectively.
Finally, the sensor node sends out the modified sensor reading via the radio link.This strong analogy shows that the sensor node itself can be seen as a biological and artificial neuron, respectively.
Therefore, efficient neural network implementations using simple computations can replace traditional signal processing algorithms to enable sensor nodes to process data by using less resources [9].
In general, the NN approach can potentially achieve increased reliability, dimension reduction, error correction and sensor validation [10].Scientists believe that this process is similar to what happens in the nervous system.The decentralized structure and emergent behavior of neural networks closely resembles how we would want wireless sensor networks to work.This inspired us to see if neural network techniques can indeed solve some of the problems in wireless sensor networks.
The most basic element of the neural network, the neuron, transforms its inputs in the feed forward stage of operation according to the steps in (1) as shown in Fig. (3). 1) Multiply each input by its corresponding weight.
2) Sum the multiplication results.
3) "Squash" the sum using a transfer function.[11] This concept of neuron structure is used in the NN that design in this paper.

SYSTEM DESIGN
Any system consisting of computer nodes that sense, reason about and act upon their environment may be called an ambient intelligence system.One major distinction that can be made is between single sensor systems and sensor networks, where data from multiple, and possibly different sorts of sensors is fused.The tasks our system has to perform clearly demand that multiple sensors are spread throughout the environment, and so we must use a sensor network.Note that since we do not focus on the acting capabilities of the system, we shall from now on speak of our system as a sensor network.
The aim of this paper is design security system using neural wireless sensor network.This security system offer suitable environments for an office.The system consists of several neural network modules operate in parallel [12].Each module is a three-layer neural network and has its own training data set.A high speed back propagation learning algorithm has been used to train the networks.Before learning starts, tolerances are defined for the output units.During learning, the weights are updated only when the output errors exceed the tolerances.The learning data for which the output errors do not exceed the tolerances are eliminated from the training data sets [10].Parameter selected and used for :-1.Determine the learning algorithm (back propagation algorithm).
2. Determine the structure of input, hidden and output nodes of the network.The number of input neurons equals the number of bits that use from all sensors.To be more precise, this paper use the following number of bits related to the particular sensors (7 bits for temperature (the measure range 0-100 C ), 7 bits for humidity (the measure range 0-100% ) , and 7 bits for each light sensor, with the TSR and PAR measure range 0-100% .
Also this paper use a offline learning method, the software that chosen for offline training is MATLAB.The MLP neural network with one hidden layer is used for every sub-neural networks system .Fig. 4 shows the default three layers MLP sub-neural network which is designed by MATLAB in this research.Each layer includes some subblocks .
The security system that design in this research working by controlling four neural networks modules in base system of wireless sensor network as depicted in fig. 5.The details of neural WSN design:-1-Select the number of input neuron for each sub neural network :(7 input neurons for temperature , 7 input neurons for humidity , 7 input neurons for TSR , 7 input neurons for PAR).2-Select the number of neuron in hidden layer for each sub neural network :(3 input neurons for temperature , 3input neurons for humidity , 3 input neurons for TSR , 3 input neurons for PAR).3-Select the number of output neuron for each sub neural network :(1 input neurons for temperature , 1 input neurons for humidity , 1 input neurons for TSR , 1 input neurons for PAR).Then detail of the complete neural network is shown in figure (6).The system take extremely short training times.The network runs entirely autonomously ; it does not need any outside control, it can operate at the same time, provides fast access to match results, and is designed to work with infinite stream of data.All these features make it an excellent choice for applications in wireless sensor networks.The initial parameters of the NWSN used in this research are given in table (1) .These parameters are used in MATLAB program to obtain the final correct weights of NN, which will be used in the hardware design of NWSN.Then these weights be converted to binary form, and save these binary weights in a file for transmitting it to the Xilinx program.By using the method of conversion fractional decimal to fractional binary number as in the following example which convert 0.95 to its binary equivalent [13] The procedure design of NWSN as seen in figure (7) consist of two parts: The first part is learning and training of NN which implemented by using Matlab software.The second part is hardware design of NWSN which its implemented by using Xilinx program.The second part receive file of binary weights from the first part.Back-propagation algorithm is the most popular approach to implement learning in neural networks (also called generalized gradient descent and generalized delta rule) [14,15].This algorithm is a multi-layer network using a weight adjustment based on the sigmoid function; The sigmoidal function is very popular for neural networks, because it performs very similar to a step function, but it is everywhere differentiable.The standard form of the sigmoidal is: Where fis the transfer function.
sumt: is the summation of multiplying the input and the weight.Xj : is the input .W j : is the weight associated to each input .b: is the biased.[16] This equation was selected because it provides the necessary limiting of the outputs while having some properties, which are useful in the learning phase of the algorithm.
Unfortunately, this equation contains the transcendental function (exponential term, exp), which is somewhat difficult to calculate.Nordstrom and Svensson [16], list several functions, which may be used as an approximation to the function used by McClelland and Rumelhart.These functions all have the same general characteristics.They are continuously increasing, approach 0 at -∞ and 1 at + ∞ , and have a continuous first derivativeThe approximation that used in this neural network is given by the function: This equation is convert to hardware and name it a transfer function block in Figure (8).The activation Block in Figure (8), which performs the multiplications X j W j and the summation of these multiplied terms as in Equation ( 2), is always on the neuro-chip (or the processing element of the neurocomputer).The data flow between these blocks is controlled by the Control Unit that is always on the chip.The data flow is such that the weights from the Weights Block and the inputs PDF created with pdfFactory Pro trial version www.pdffactory.com1647 from outside or from the outputs are multiplied and the products are summed in the Activation Block, then the outputs are obtained in the Neuron State Block from the transferred sum of the products .Neuron states and weights can be stored in digital form.Weights can be stored in registers if it is little numbers of weights or stored in RAM .
Figure (9) represent overall hardware design of NWSN which explained as a block diagram in figure (5)that represents ((temperature NWSN, humidity NWSN ,and light(TSR-NWSN , PAR-NWSN)), for the base station of WSN.The figure (10) explain the details of hardware design for each module (sub-neural network)which contain multiple HIDDENNEURON block (neuron which explained as a block diagram in figure (8) for each NN module.
The details of hardware design for each neuron (containing the design of the activation function according to equation 3 ) is shown in figure (11).

RESULT AND DISCUSSION
The process of training is shown in the following figures (12,13,14,15) in which training curves is approaching its goal through readjustment of weights and biases using MATLAB program.Figure (16) shows the comparison between Matlab results and Xilinx results for the outputs of NWSN, they are very close.
The result sample of the system shown in table 2 is the correct results as in fact.The result of FPGA , for an example the humidity sub-neural network that built above, and after specified input values of the weights, and the input values to the neuron, shown in fig.17, and the result of complete operation of the total NN is presented in fig.18 .Where:-h39.out7: is the output result for temp., h41.out7: is the output result for PAR , h42.out7 : is the output result for TSR .

CONCLUSIONS
A modular architecture for the network shown that the analogy between WSNs and ANNs is not only theoretical, but can be also used to actually implement this paradigm efficiently into real WSNs.It is important to stress that ANNs exhibit exactly the same architecture as WSNs, and it is shown that implementation of neural networks using FPGAs.The resultant neural networks are modular, compact, and efficient and the number of neurons, number of hidden layers and number of inputs are easily changed.
The choice of precision and arithmetic hardware architecture used in neural networks application has a direct impact on the processing density achieved.Using suitable precision arithmetic design, one can achieve adequately high speed and small size for real time ANNs implementations.
In order to validate this work, the results are compared with the reported by Frank O. and Petri M¨ah [10] which use Hopfield network (HN) with a lot of neurons (480 neurons)to get stable HN with single layer that will increase the hardware that use to the hardware design and decrease the speed , and the result recognition rate is 83% .
The agreement is found to be acceptable in this work, which validates the present recognition rate is 98 % with the facility of using sub-NN that use BP of multiple layers and decreasing the number of neurons and increase the speed of the system that design in FPGA.

3 . 5 .
Determine the activation function (log-sigmoid function).4. Determine the learning rate.The learning rate is set to 0.1.PDF created with pdfFactory Pro trial version www.pdffactory.comEng.& Tech.Journal, Vol.30 , No.Determine the number of iterations.Itdepends on the error generated fromBPNN.The base station system is design to received signals from multiple sensors (temperature sensors, humidity sensors ,and light sensors), which measure the total solar radiation (TSR) and the photo synthetically active radiation (PAR).