K-Means Clustering in WSN with Koheneon SOM and Conscience Function

Wireless Sensor Networks (WSNs) are broadly utilized in the recent years to monitor dynamic environments which vary in a rapid way over time. The most used technique is the clustering one, such as Kohenon Self Organizing Map (KSOM) and K means. This paper introduces a hybrid clustering technique that represents the use of K means clustering algorithm with the KSOM with conscience function of Neural Networks and applies it on a certain WSN in order to measure and evaluate its performance in terms of both energy and lifetime criteria. The application of this algorithm in a WSN is performed using the MATLAB software program. Results demonstrate that the application of K-means clustering algorithm with KSOM algorithm enhanced the performance of the WSN which depends on using KSOM algorithm only in which it offers an enhancement of 11.11% and 3.33% in terms of network average lifetime and consumed energy, respectively. The comparison among the current work and a previous one demonstrated the effectiveness of the proposed approach in this work in terms of reducing the energy consumption.


Introduction
The recent developments in microelectronics offered light weight, cheap and small sensor nodes that have small batteries.The main concern behind the development of Wireless Sensor Networks (WSNs) is to offer a continuous and efficient monitoring of environments which cannot be accessed by human being or cannot be accessed for long times (Enami et al, 2010).
WSNs composed of numerous sensor nodes that are distributed autonomously in order to monitor various environmental or physical states, as temperature, vibration, sound and pressure.Each one of the network nodes is equipped with four components; sensor, wireless communication device, battery and microcontroller.Since those nodes are battery operated, energy is a critical issue in those networks.WSNs are used on various applications, such as in air pollution detection and area monitoring for military field (Singh and Sharma, 2014).In those applications, the replacement of dead nodes with new ones to offer energy is very difficult.Thus, the best solution is enhancing the lifetime of sensor nodes to enhance the lifetime of networks.However, since the consumed energy by sensor node resulted from long distance data transmission, efficient techniques must be used to enhance those networks.(Kannammal et al., 2014) Clustering is one of the well-organized used approaches to extend and enhance the network lifetime.It offers effective communication among the sink node and other used nodes in the network.This technique divides the used nodes into several groups and assigns one sensor from each one of those groups to be the cluster head.That sensor will be the responsible one for the communication among the sink node and the cluster (group) members.This has a high effect on the amount of both consumed power and redundant messages which can be produced from the residing sensors in near proximity.Various clustering techniques have been proposed for WSNs, Kohenon Self Organizing Map (SOM) and K means are the most common clustering techniques where both are effective techniques when they combined with conscience function of Neural Networks (Ramadan et al., 2013).
The main purpose of clustering is to reduce the topology control overhead and keep both the channel bandwidth and node energy.Kohenon Self Organizing Map (KSOM) is an unsupervised approach that includes a number of neurons which organized in a regular grid (Samarasinghe, 2016).Each one of the neurons is a weight vector with n dimension which is the same as the one of input vectors which connect the input layer to the output one.K-means clustering technique is mainly used to decide a set of k clusters in a certain d-dimensional space from a specific set of nodes in order to reduce the mean squared distance among each node and its nearest center (Kannammal et al., 2014).
In this work, the performance of WSN is evaluated using a combined clustering approach of both KSOM and K means algorithms with conscience function of Neural Networks.

Research Scope
The aim of this paper is to investigate and assess the performance of WSN using a combined clustering approach of both Kohenon Self Organizing Map (KSOM) and novel K means algorithms with conscience function of Neural Networks.The performance of the network is measured and assessed with the use of energy and lifetime criteria

Related Work
Several clustering protocols have been proposed to get efficient energy consumption in WSNs.Hong et al (Hong et al., 2016) proposed an algorithm that is based on clustering-tree topology control built using the energy forecast (CTEF) where the cluster head nodes were chosen by evaluating a cost function that considers energy, link quality and packet loss rate, in a ddistion to nodes' distance from the Cluster Head.Lung and Zhou (2010) proposed a Distributed Hierarchical Agglomerative Clustering (DHAC) model which categorizes sensor nodes into a number of clusters rather than gathering nodes to randomly chosen cluster heads.Ramadan et al, (2014) proposed clustering techniques in multimodal WSN where each sensor node in this network is able to sense more than one feature from the target field.K means clustering technique has been proposed as a main clustering algorithm where various k means variations have been proposed for effective clustering in the network.Results demonstrated that the proposed algorithm outperformed the Low Energy Adaptive Clustering Hierarchy Centralized (LEACH-C).Shahbazi et al., (2008) developed an advanced approach depending on Self Organizing Map (SOM) which optimizes the routing as a function of both energy conversation and computation power of the network nodes in a WSN.The SOM technique was applied to determine the nodes that contain the data packet from those which dropping the packet.Rakocevic (2013) proposed the application of Kohonen SOM in a WSN.This method offers a complete distributed operation with a limited number of messages which must be exchanged.The nodes of the SOM model make local predictions of the distance among them and the winning node instead of finding it through the communication with the whole network.The proposed approach deals with two types of variability in sensor data; the one which results in state or event in the environment and the one that presented in the origin location.Results demonstrated that the proposed solutions for variability in sensor data are efficient to be applied in the organization of data with no need to communicate with the whole network.Chang et al., (2010) developed a clustering technique for WSN that supports the cell combination in the network.With the use of this technique, the observance region is divided into polygon cells based on taking into account the geographic location data of the network nodes.Each cluster includes a small number of polygonal shape cells.Nodes that have specific cluster identity and cluster heads are elective from the middle cell in each one of the clusters.The cell form enhances both the energy consumption and channel recycles.Patra et al., (2011) proposed the application of KSOM technique to cluster nodes in a heterogeneous sensor network that enhanced the node transmission power to enhance the energy saving in the network.Chen et al., (2014) proposed that the well-constructed network topology offers a vital support for target tracking, data fusion and routing in WSNs.The Self Organization Feature Map (SOFM) technique is a type of artificial neural networks that has self-learning and self-organizing features.Authors introduced a cluster dependent topology control technique for WSN with the use of SOFM algorithm to generate a hierarchical network structure.The proposed technique completes the choice of cluster heads using the competitive learning between nodes as well as considers both the residual energy and the distance among nodes and their neighbor ones in the clustering process.Furthermore, an adjustment approach for the cluster head nodes transmission power was used in order to optimize the topology of networks.Results demonstrated that the proposed technique had an enhanced energy performance as well as it offered more balanced consumption of energy in comparison with other available algorithms that applied in WSNs.Singh and Al-Turjman, (2016) developed an algorithm that insures Quality of Service (QoS) in routing depending on using SOM algorithm for WSN.Local Cognitive Nodes (LCNs) were developed as a knowledge representation.They used the Quality of Information (QoI) to assign data paths for information delivery in a WSN by calculating priorities of information to be delivered according to some attributes like latency, reliability, and throughput.Patra (2010) demonstrated that clustering is an efficient algorithm which can be utilized to categorize objects.One of the most successful applied classification tools in several fields, such as sensor networks, ad hoc networks and robot control is the Kohonen's SOM.However, the potential of this technique as a robust substitute in clustering analysis still need to be studied more.Thus, the author proposed the use of Kohonen's SOM technique to cluster sensor nodes that dispersed in heterogeneous space in WSN to make effective transmission power management of nodes.Naoum et al., (2014) dedicated that various procedures can be used in order to improve the performance of WSNs in terms of energy consumption and the lifetime for the WSNs.During their researches; they evaluated and investigated the performance of WSNs considering KSOM as a clustering technique.The evaluation was performed within two stages; the first stage considered the clustering using KSOM technique and the second stage consider the clustering using KSOM in addition to utilizing the conscience function of Neural Network.MATLAB software program was employed to simulate the proposed scheme and ensure it is validity; the lifetime and consumed energy were used as performance criteria during the evaluation.The results confirmed the effectiveness of KSOM as clustering technique.Furthermore, adding the conscience function of NNs results in 3.03% and 9.1% enhancement in terms of the energy consumption and lifetime respectively.

Neural Networks and Energy Conservation of WSNs
A Neural Network (NN) is normally a huge system with parallel processing components known as neurons that take the graph topology.Synapses connections are the main systems that are used to connect the neurons.These synapses connect both the input and output layers.Furthermore, the knowledge of neural networks is normally obtained on the connection weights where no data storage is needed.Artificial neural network can be referred to as arithmetic structures that can be used to learn difficult mappings in between the inputs and the outputs in reference to the supervised training.The most difficult issue with NNs is the identification of a good topology (Shahbazi et al., 2008).Several problem properties are involved in this selection with several solving methods of NN.In addition, different training rules exist in the inspiration from different fields such as biology science that acts as the determining factor neural networks leaning.Learning by example is the most applied training technique that uses a set of input-output data in a correct way identified by the network through the use of examples that enables change of weight values.Though the input of new data on the network enables it to give correct answers in the output section known as learning.Among the basic crucial properties of neural networks is the ability to identify the affected data by either noise or intentional change and later removing the discovered variations after learning is complete.There are different types of NN's topologies, each have different capabilities according to the application needed.

Reduction of Energy Consumption in Sensor Networks
With renovations of the microelectronics sensor nodes became cheaper lighter and smaller and third batteries became lesser in size and even more efficient and reliable.The supreme reason of developing the wireless sensor networks is for the monitoring of the human environment where it is very hard for the monitoring and to stay in the access for a longer time Monitoring of the environments such as a head of an active volcano is like doing something very impossible it is very difficult to observe the movement of the butterflies in the forests and observing the terrains of the borders, bridges.This becomes even difficult to replace or even to recharge the dead nodes as well.The important thing with the wireless of the sensor networks is that it enables the observations and the continuous monitoring of the life time.This enables the monitoring and the research easier and less troublesome is very well considered.
The first step to making the monitoring reliable is to have the solution of the WSN is to have the solution to the power conservation and maintaining its longevity of the power for a longer lifetime.This is done by maintaining of lesser pats of the appropriate methods thus it is very important to the communications sub systems (Samarasinghe, 2016).
The idea is to share and equalize the running of the energy between the transmitting of the bit of data and the other amount of instructions thus by equalizing of the tasks and the thousands of the instructions of the system.
Energy consumption is very reliable to consumption of the radio part of different magnitudes of transmission.Most researches in the world have proven that there is efficient approaches of reducing energy consumption and conservation schemes that are proposed in the literature.

Use of Neural Network in WSNs
In the industrial military environments and domestic sensors are widely used in the sensing of the parameters of the environment.The sensors are used to control the systems of the useful work of the environment the size of the sensors units decreases as the time pass by the advancement of the process of the manufacturing and also microelectronics thus making the completion of the unis more easily to be utilized in the efficiently in the other locations (Shahbazi et al., 2008).

Routing and Energy Saving
Routing is the communication of the router and the nodes associated to the verified consumers of the energy and due to the balanced loss of the energy it becomes more efficient.There are relevant issues that are very promising when it comes to the application of the WSN and the management of the energy distribution determines the different users.Such as Self Organizing Map.by applying the possibilities of artificial interagency that is seeking to look into manage the consumption of the energy and the transmitting of the self-organizing map.These types of the networks create the constraint of the neighborhood on the output.

Routing Path Discovery Using Self Organizing Map (SOM)
Possibility of using artificial intelligence with tradeoff between consumption of energy in processing and in transmission gave a chance of using Self Organizing Map or Kohonen self-organizing Networks concept.This is competition-based network paradigm for data clustering.Networks of this type the learning procedure of the Kohonen feature maps or SOM is similar to that of unsupervisedcompetitive learning networks (Gao, et al., 2016).That is a similarity measure is selected and the wining unit is considered to be the one with the largest activation.A node which is connected to base station and in routing path of the other nodes is termed as hotspot.

Research Method
As proposed earlier, the purpose of this paper is to investigate the performance of WSN with the use of two algorithms; Kohenon Self Organizing Map (SOM) and novel K means algorithms with conscience function of Neural Networks.The following figure illustrates the main stages of the conducted methodology.The most commonly used distance in the clustering process is the Euclidean distance.It studies the root of square differences between the coordinates of two objects as illustrated below: (2) In the Kohenon SOM algorithm, two parameters are used as inputs for this approach; energy level and network space which called x and y.This resulted in a matrix with nx3 dimensions; this matrix is called D. The normalization process is then applied due to the use of several types of parameters in the approach.In this process, the Min-Ma is applied in which each element a has two values; maximum value max a and minimum value min a , where the value v is related to normalized change of the velocity of sensor which can be mapped among (0,1) based on using the following formula (Patra, 2010) Based on this formula, the matrix D can be represented as follows: Where;   : represents the X coordinate maximum value within network space.
: represents the Y coordinate maximum value within network space.
: represents the energy that remains from the maximum node energy.When the algorithm begins; this value is symbolized as  .
The second stage represents the determination of the head of each cluster.In this stage, heads of clusters are selected based on using three criteria in order to efficiently choose them; sensors which characterized with maximum energy level, sensors which have shortest distance to centroids and sensors which have shortest distance to the defined network base station.Thus, the replacement of the defined cluster head in clusters is allowed in equally distributed procedure.Those three criteria are used together to offer optimal cost function for the nodes in networks.
In the final stage, the transmission phase is applied where the determined heads of clusters gather the received sensed information from nodes and then send them to the defined network base station.The consumed energy by the network nodes is computed.The required energy amount to carry out this stage for k bits that travel in distance d is demonstrated using the following formulas: (,)=   ()+ − (,) ( (,) = { .  (, ) + .   2  <   .  (, ) + . −− . 4  (6) The following formula is utilized in the calculation of the required energy in the receiving process for K bits and d distance   (, ) =  _ () = .  (7) To effectively conduct the proposed methodology, the following assumptions are taken into account:  Nodes are randomly distributed in 2D WSNs


The network sensors recognize the location of base station  There are no limitations concerning the base station computation capabilities as well as an enhanced communication is given for the base station where this qualifies it to be dominant node


All the network sensors have the ability to perform the transmission process with the use of various changeable levels of power, where those levels are chosen depending on the distance separating nodes from the base station


Nodes have the ability to assess the distance approximately depending on the potency of the received signal, in which the transmitted power level must be define as well as no fading should be assumed to be occurred due to the transmission channel between sensor nodes.


The network operation model is assumed to be round which starts with clustering phase and then followed by data collection phase which represents gathering data from the network sensor nodes


Each sensor node is assumed to have two modes; active and sleep.Thus, the amount of consumed energy for message of k bits over d distance among nodes can be calculated using the following formula: .   + .  . 2 ; ℎ 0 <  <   .  + .  . 4 ; ℎ  >   (8) Whereε mp represents the required amount of energy to transfer the data over a distance d bigger thand crossover It is mainly assumed that the communication process in WSNs is attained at constant level of power.Thus, the required messages to manage clusters are assumed to be transmitted at constant level of power.Concerning the CH choice phase, it is a very critical issue because the choice process offers an indication concerning the consumed energy among in networks.With choosing a head of cluster, it must be ensured that it can cover the related cluster in a uniform and effective way.A random number of K opt CHs is chosen previously as a way to have a random energy distribution in networks.The following formula is used to find the K opt value (Patra, 2010).
Where N represents the number of sensor nodes in WSNs and M 2 represents the area of deployment.Mainly, d 4 can be calculated using the following double integral In this equation; the best value for the competition radius of the CH can be computed using the following formula:

The Results and the Discussions
The proposed methodology in the previous section is performed using the MATLAB program.As proposed, the main concern of this work is to compare the performance of the combined clustering approach of both Kohenon Self Organizing Map (SOM) and novel K means algorithms with the performance of Kohenon SOM only in terms of both the use of energy and lifetime criteria.The WSN is assumed in this work to have 700m*700m area in which the users' sensors positions are then applied in this area.The following figure illustrates an example of the obtained users' locations.
Figure 3. simulation scenario In the figure above, the bold blue points (sensors) are randomly distributed in the network area.The calculation of both the consumed energy and WSN lifetime depends on assuming that the network sensors will be died when the energy reaches 10 J. the distance that separate each node from the base station is computed until the number of sensors is equal to 5% of the total initial number of sensors.In addition, the distance that separates each node from other nodes in the network is computed in each round, where nodes then start exchanging and routing data among each other and the base station.On the other hand, the distance among the sensor and sink is computed as well as the energy of this sensor is continuously updated till it becomes less than 10J where in this point, the sensor energy is set to zero and it is considered as a died one.
The following figure illustrates the average lifetime versus the number of nodes for both the combined clustering algorithm; KSOM with k-clustering and the KSOM algorithms.As shown, the network lifetime is improved due to the use of novel k-means clustering algorithm in combination with the KSOM as a comparison with that of using KSOM algorithm only.As shown, the network average lifetime is inversely related to the f network nodes number.It can be concluded that the network maximum lifetime happens when the number of nodes in the network equals to 200 where the maximum reached network lifetime with the use of the current combined clustering algorithm is 275s, while it is 250s for KSOM algorithm.On the other hand, the minimum reached network average lifetime for both algorithms is with 1000 nodes, where it is 70s for the combined clustering algorithm and 62s for the KSOM one.As shown from above figure at 200 nodes, life time will be better in general compared with 1000 nodes this is due that, by increasing number of nodes with specific area, it increases percentage of collision and packet drop, so resend of packet made lifetime worst.The following table shows a comparison among those two algorithms.The error among both techniques as a function of network average lifetime when the number of nodes equal to 800 can be computed as follows: Thus, the application of the combined algorithm offers an enhancement of 11.11%.Thus, this algorithm outperforms the KSOM one in terms of average lifetime of the network.
The performance of both algorithms is evaluated also in terms of the average consumed energy where results are illustrated in the following figure.As shown in the figure above, the average of consumed energy for both algorithms is relative to the nodes number in the network.As shown, the current combined algorithms of both KSOM and novel k-means clustering outperforms the KSOM one.The minimum reached average consumed energy of both algorithms is when the number of nodes is 200, where it is equal to 1325 nJ/bit for the KSOM algorithm and 1300nJ/bit for the combined algorithm.Conversely, the maximum reached average consumed energy of both algorithms is when the number of nodes is 1000, where it is equal to 1630 nJ/bit for the KSOM algorithm and 1580nJ/bit for the combined algorithm.As shown above, at 200 nodes, energy consumption is lower than 1000 nodes; this is due that collision at constant area increased with more number of sensors so energy consumption will be increased.
The following table shows a comparison among those two algorithms.The error among both algorithms as a function of network average consumed energy when the number of nodes equal to 800 can be computed as follows: Therefore, the application of the combined algorithm offers an enhancement of 3.33%.Thus, this algorithm outperforms the KSOM one in terms of average consumed energy of the network.

Comparison with Previous Work
Yupho and Kabara, (2007) studied the performance of a WSN network in terms of network life time and energy consumption based on the nodes objective topology.This in turn depends on both the network size and the broadcast range of network nodes.The analysis depended on both the highest gossip sleep probability (p) and gossip period (Gp) to determine both the network lifetime and residual energy.
The network lifetime was evaluated as a function of the gossip periods number as shown in the following figure, where the proposed work in this research is represented in a blue color where p=0.6 and Gp=30s.The following table illustrates an evaluation of the network performance in terms of the relation among the average lifetime and number of nodes for the current work and the work performed by (Yupho and Kabara, 2007) after adding 800 nodes for each network.The reduction in the network lifetime for the current work when the number of nodes increased by 800 can be computed as follows: reduction in the network lifetime = 275s − 70s 275s * 100% = 74.54%Thus, 74.54% of the network lifetime was consumed with the raise in the nodes number.The reduction in the network lifetime for the proposed work by Yupho and Kabara (2007) when the number of nodes increased by 800 can be computed as follows:  The figure above shows the minimum consumed energy is 0.2 Joules when the number of nodes is 100, while the maximum consumed energy is 1 joule when the number of nodes in 900.The following table illustrates an evaluation of the network performance in terms of the relation among the consumed energy and number of nodes for the current work and the work performed by (Yupho and Kabara, 2007) after adding 800 nodes for each network.Thus, there an increase in the consumption of energy about 21.53% with the raise in the nodes number The increase in the energy consumption for the proposed work by Yupho and Kabara (2007) when the number of nodes increased by 800 can be computed as follows: increase in energy consumption = | 0.2Joules − 1Joules 0.2 Joules | * 100% = 40% Thus, there is an increase in the consumption of energy about 40% with the raise in the nodes number.There is a noticed enhancement in the power consumption for the current work in comparison with the proposed work by Yupho and Kabara, (2007).
The current combined algorithm; KSOM with k clustering was also compared with the results obtained by Naoum et al., (2014).The comparison results at 800 nodes are summarized in table below.

Summary and Concluding Remarks
Recently, Wireless Sensor Networks (WSNs) are broadly utilized in various fields and applications, such as in the military fields.The performance of those networks can be investigated and evaluated using several criteria.In this paper, both the average lifetime and consumed energy are used for this issue.It can be concluded that the use of clustering algorithms within those networks can enhance both their lifetime and consumption of energy.
The most commonly applied clustering technique in WSN is the KSOM.This technique depends on choosing the head of cluster for each cluster of sensor nodes in each round time.In this paper, this technique is improved base on combining it with the novel k-means clustering one in order to offer more enhancements for both the lifetime and consumption of energy within WSNs.The obtained results demonstrate that the proposed combined algorithm outperforms the KSOM one as a function of network lifetime and consumption of energy.
Based on comparing the current work with a previous work concerning the WSN performance as a function of network lifetime and consumption of energy, it was demonstrated that the current work outperforms the previous one in terms of reducing the energy consumption, while both approaches are nearly the same in terms of enhancing the network lifetime.
The proposed work in this paper can be enhanced in the future based on using other clustering algorithms in combination with the KSOM one to choose the most optimal clustering algorithm.

Figure 1 .
Figure 1.Stages of the conducted methodologyInitially, both the Kohenon SOM algorithm and novel K-means clustering algorithms are applied.Initially, a novel k-means clustering technique is used to train the Kohenon SOM technique to offer low dimensional representation of input space, which is called map.This is performed to categorize the network nodes into homogenous k-clusters, where nodes which similar to each other are grouped in the same cluster.For a set of nodes x 1 , x 2 , … ., x n , where each one is a d-dimensional real vector, the novel k means clustering algorithm divides those nodes into k clusters; K ≤ N: S = {S 1 , S 2 , … ., S K }.The in-cluster um of squares can be minimized using the following expression:(Bhan and Mehrotra, 2013).

Figure 4 .
Figure 4. Average lifetime for both algorithms

Figure 5 .
Figure 5. Average consumed energy for both algorithms

Figure 6 .
Figure 6.network lifetime versus the number of nodes As shown in the figure above, the highest gossip periods number; 155 is obtained with 100 nodes, while the lowest number; 40 is obtained when the number of nodes is 900.
.2% of the network lifetime in terms of gossip periods was consumed with the raise in the nodes number.Thus, there is a slight difference in the percentage of network average lifetime for both networks.The following figure illustrates the obtained relation among the consumed energy and number of network nodes.This relation is represented in a blue color in the following figure.

Figure 7 .
Figure 7. average energy consumption versus number of nodes

Table 1 .
comparison among algorithms in terms of the network average lifetime

Table 2 .
comparison among algorithms in terms of the network average consumed energy

Table 3 .
comparison between both works in terms of network lifetime

Table 4 .
comparison between both works in terms of average energy consumption