# Clustered Distributed Learning Exploiting Node Centrality and Residual Energy (CINE) in WSNs
## 4 Performance Evaluation
### Simulation Scenario  
For the simulation experiments, we considered a well-known data set containing air-quality sensor data measured by a sensor network consisting of 56 nodes deployed  
Figure 2: CINE protocol in action.  
in the city of Krakov [[https://www.kaggle.com/datascienceairly/air-quality-data-from-extensive-network-of-sensors](https://www.kaggle.com/datascienceairly/air-quality-data-from-extensive-network-of-sensors)]([https://www.kaggle.com/datascienceairly/air-quality-data-from-extensive-network-of-sensors](https://www.kaggle.com/datascienceairly/air-quality-data-from-extensive-network-of-sensors)) (accessed on 12 March 2023). We considered the 25 nodes that provided a complete set of sensor data for a period of one month.  
In Figure 3, we report the position of the nodes and the resulting topology of the WSN.  
The sensors collect one sample of measures every hour; therefore, the data set for one month (i.e., 30 days) for each of the 25 sensors consists of \(n_{k}~{}=~{}24\times 30~{}=~{}720\) entries, with \(k~{}=~{}1,2,\ldots,25\). Each entry includes seven values, representing the day; time; temperature; humidity; and PM1, PM2.5, and PM10 values. Note that the day and time values are not included for training the model, and thus the seven parameters reduce to five only. For the training in cluster heads, 25 days of data are considered for training. For the inference in both cluster heads and inference, the last 5 days of data are considered for inference. Thus, for training, the data set corresponding contains 25 (days) \(\times\) 24 (h) = 600 entries of temperature; humidity; and PM1, PM2.5, and PM10 values. For the inference, the data set corresponding to each sensor contains 5 (days) \(\times\) 24 (h) = 120 entries of temperature; humidity; and PM1, PM2.5, and PM10 values. The data chunk that has to be transmitted to the cluster head for retraining also comprises 5 days of data. Accordingly, the \(u\)-th entry in the data set of the \(k\)-th sensor, denoted as \(\mathbf{X}_{k,u}\), is:  
\[\mathbf{X}_{k,u}=(X_{k,u}^{(0)},X_{k,u}^{(1)},\ldots,X_{k,u}^{(4)}) \tag{3}\]  
CINE can been applied whatever the ML approach utilized. For our experiments, we considered the well-known convolutional autoencoders, which are usually applied for dimension reduction, denoising, and anomaly detection [35, 36, 37, 38, 39].  
They consist of convolutional neural networks (CNNs), both at the encoder and at the decoder. Readers interested in gaining a deeper understanding of convolutional autoconters can refer to [40, 41, 42, 43].  
We built a model with two convolutional layers in the encoder part and two deconvolutional layers in the decoder part. All the four layers were one-dimensional convolutional layers. The 8 \(\times\) 8 kernels and ReLU activations were used. The outer layers of the model consist of 32 filters, while the inner layers consist of 16 filters. The model takes the input of shape (batch_size, sequence_length, num_features) and returns the output of the same shape. In our experiments, we varied the sequence_length from 25 to 100, and num_features was set to 1. The sequences consisted of the timeseries sequences of the sensor values from the dataset.