Professional Documents
Culture Documents
Ad Hoc Networks
journal homepage: www.elsevier.com/locate/adhoc
Keywords: Water pollution is a critical issue that affects the entire ecosystem, with non-negligible consequences on
Sigfox humans’ health, thus inducing economic and social concerns. This paper focuses on an Internet of Things water
Internet of Things quality prediction system, namely WaterS, that remotely communicates gathered measurements leveraging the
Water quality
Sigfox communication technology. The solution addresses the water pollution problem while considering the
Deep learning
peculiar Internet of Things constraints such as energy efficiency and autonomy. The proposal demonstrateshow
it is possible to detect and predict water quality parameters such as pH, conductivity, oxygen, and temperature
by using WaterS, the Tiziano Project dataset, and a Deep Learning algorithm based on a Long Short-Term
Memory recurrent neural network. The discussed water quality measurements are referred to the dataset that
belongs to the Tiziano Project, in a period of time spanning from 2008 to 2012. The Long Short-Term Memory
applied to predict the water quality parameters achieves high accuracy and a low Mean Absolute Error of
0.20, a Mean Square Error of 0.092, and finally a Cosine Proximity of 0.94. The obtained results are analyzed
in terms of protocol suitability of the current architecture toward large-scale deployments. From a networking
perspective, with an increasing number of Sigfox-enabled end-devices, the Packet Error Rate increases as well
up to 4% with the largest envisioned deployment. Finally, the source code of WaterS ecosystem has been
released as open-source, to encourage and promote research activities from both Industry and Academia.
1. Introduction WaterS [15] has been already proven to be able to provide remote mon-
itoring capabilities for some of the most representative water quality
The Internet of Things (IoT) is a well-known paradigm that turns indicators (i.e., temperature and turbidity) [16]. At the same time, the
devices into interconnected smarter objects. IoT devices are generally WaterS architecture provides an energy-harvesting and an ultra-low-
characterized by low computational power, networking limitations, power Sigfox-compliant radio interface to keep track of the continuous
and communication capabilities. As a matter of fact, IoT devices have monitoring activities carried out by the IoT architecture. Even though
to deal with issues related to data exchange while optimizing the the monitoring activities are of utmost importance to grant fine-grained
communication protocols in terms of latencies, bandwidth, security, sampling of the parameters of interest, water pollution, and other
and energy consumption [1–3]. Despite their intrinsic limitations, IoT long-lasting phenomena could still be detected. In fact, since a large
devices are now part of continuous monitoring processes in several
portion of the world’s freshwater lies underground, infiltration into
fields, from industrial applications [4], to monitoring activities con-
the ground could be underestimated. Therefore, a system like WaterS
nected to air quality and environmental parameters in the most modern
could be more and more useful if it was able to carry out a prediction
smart cities [5].
analysis of water quality parameters. Such an advancement could lead
Among the many fields that could benefit from the introduction
of IoT technologies, water quality monitoring is undoubtedly one of to the massive adoption of smart and energy-efficient sensing units
the most relevant and recently investigated [6–14]. In this context, to be employed in hostile areas, for example, subject to massive and
∗ Corresponding author.
E-mail addresses: pietro.boccadoro@poliba.it (P. Boccadoro), vitanio.daniele@sitael.com (V. Daniele), pietrodig@live.com (P. Di Gennaro),
domenico.lofu@poliba.it, domenico.lofu@exprivia.com (D. Lofù), ptedeschi@hbku.edu.qa (P. Tedeschi).
https://doi.org/10.1016/j.adhoc.2021.102749
Received 14 July 2021; Received in revised form 8 November 2021; Accepted 11 November 2021
Available online 23 November 2021
1570-8705/© 2021 Elsevier B.V. All rights reserved.
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
pervasive pollution phenomena such as the spillage of toxic waste into be successfully involved. In this regard, a deep learning solution based
the aquifers where water infiltration is a crucial task [17]. on LSTM will be discussed with a focus on the analysis of multivariate
WaterS is proposed as a stand-alone, energy-efficient and standard- datasets with specific reference to water quality testing, monitoring,
compliant system for measuring and forecasting water quality parame- and predicting capabilities.
ters.
The system was tested close to the seaside in the city town of Bari, 2.1. Related work
Italy. The dataset involved in this study is one of the main outcomes
of the Tiziano project [18], and it has been fully exploited to train The employment of machine learning has been recently proposed
a deep learning model for forecasting, i.e., in our case a Long Short- for several applications and research fields, such as environmental mon-
Term Memory (LSTM) neural network. WaterS has been developed by itoring, smart grid, water treatment facilities, and power plants [22–
adopting open-source hardware/software (with a focus on the energy 24], to name a few. Some of these contributions also consider using
harvesting [19] capabilities of our solution) and a standardized wireless deep learning, a subset of machine learning that allows unsupervised
protocol to push the innovation further, as well as to allow researchers learning. The main difference between these two relies on the way
and academia to further use our code as a ready-to-use basis for further data is presented in the system. In fact, unlike machine learning, deep
software development [20]. learning does not need structured input data. So, human intervention is
Contribution. This work aims at integrating an advanced deep not always mandatory, as multilevel layers of artificial neural networks
learning technique, namely LSTM within WaterS to improve the current can automatically recognize common features and learn from data
solution by providing additional features like the water quality pre-
without external help.
diction. Specifically, we provide an experimental evaluation where we
Manu et al. [25] provides an overview of the design and im-
show how the adoption of LSTM can effectively predict the reference
plementation of water quality monitoring systems. Furthermore, it
data by assessing the results accordingly the Mean Square Error, Mean
discusses wireless technologies and their adoption at each stage of
Absolute Error and Cosine Proximity metrics. In particular, the neural
the monitoring processes. Sammoudi et al. [11] characterized a water
network has been configured to search for correlations on multivariate
quality assessment system through the analysis of physicochemical and
time series on surface water. Indeed, the experimental results demon-
bacteriological water properties. Furthermore, the authors adopted the
strated that some degree of correlation exists and this proves that it is
Principal Component Analysis (PCA) technique to identify potential
worth pursuing estimations on the proposed variables. In addition, the
water quality measurement indicators. Liu et al. [13] introduced a
achieved results show that the adoption of Recurrent Neural Network
water quality prediction model leveraging LSTM deep neural networks.
(RNN) for the analysis of water quality is a winning solution for the
They collected data by using third-party water monitoring stations.
study of multivariate time series [21]. Comparisons against competing
The results demonstrated that the model can predict water quality
solutions show the viability and efficiency of our proposal. Finally,
over a 6 months period. Even though the results are of relevance,
WaterS has been fully implemented as the first open hardware/software
the main limitations of the proposed prediction model are related to
solution, and the source code has been released as open-source [20].
1-dimensional inputs and limited dataset.
This permits the research community and companies to reproduce our
The research activities carried out on the theme also had business
results, use the solution on top of existing Sigfox transceivers, adopt
counterparts, with many different industrial-grade solutions. In partic-
the released code as a ready-to-use basis for further improvements
and comparison and, finally, allow the interested readers to verify our ular, those solutions took into account diversified sensing units, preci-
claims. sions, and capabilities to provide detailed analysis on peculiar water
Roadmap. The remainder of the present work is as follows: Sec- parameters (e.g., pH, water level, turbidity, carbon dioxide, and tem-
tion 2 is three-folded, since it introduces the reference background perature) [6–8]. In these solutions, acquired data are remotely transmit-
on (i) water quality monitoring IoT systems, (ii) Low-Power Wide ted thanks to some of the main short-range IoT protocol (i.e., Zigbee)
Area Networks (LPWANs) technologies, with a focus on the Sigfox and stored within the server that received the messages to be investi-
protocol, and (iii) a thorough analysis on LSTM. Section 3 describes gated and elaborated, as needed. Kamaludin et al. [9] discussed the
the operating scenario in which WaterS is adopted, as well as the implementation of water monitoring IoT system platform for water
envisioned architecture and the proposed prediction system. Section 4 quality monitoring IoT system working in the sub-GHz bands to gather
summarizes both the leading criteria and methodological approach. On the pH of waters as well as environmental temperature values. Wang
top of that, Section 5 presents the experimental campaign while Sec- et al. [12] envisaged a LoRa based IoT system that leverages ultrasonic
tion 6 discusses the obtained results. Possible strategies for improving water meters, data centralizers, and intelligent remote valves to detect
the WaterS systems are proposed in Section 7 together with the main and predict system leaks and prevent water theft. In [10], a remote
findings, limitations, and future research directions. Finally, Section 8 water level monitoring system is proposed. Gathered data communi-
tightens the conclusions and discusses future work directions. cations are enabled thanks to the employment of NB-IoT, a choice
motivated by the fact that narrowband technology proposes several
2. Background and related work advantages in terms of optimized data rate and enlarged coverage
area. Mukta et al. [14], instead, proposed the development of an IoT
This section provides the background on IoT systems specifically system specifically designed for monitoring the physical parameters of
designed for environmental monitoring activities. Some of them are drinking water. In this case, the system is used to measure temperature,
focused on water quality control, whereas some others are devoted to pH, electrical conductivity, and turbidity locally. The system is also in
air quality. In almost all of them, one of the key features is commu- charge of using a binary classifier to state the quality of the water.
nicating with remote users/base stations. This data-gathering activity Thanks to peculiar parameters, all the previously introduced so-
usually enables advanced analysis possibilities. The largest majority of lutions were designed to address water quality monitoring/detection.
the surveyed contribution deals with LPWAN communications, lever- Nevertheless, despite the importance of the surveyed solutions, none
aging some of the newest standardized solutions/protocols, focusing of them thoroughly fulfilled the key requirements and challenges of
on Sigfox. Since the IoT domains/applications are usually aimed at the IoT domain. Counterwise, the WaterS system [15] proposes itself
improving sensing, elaboration, and communications, what data can as a thorough, stand-alone, energy-efficient, and standard-compliant
be used for is still left unspoken. Nevertheless, the data-gathering prototype. It envisages a real experimental testbed for measuring and
phase can be considered a prerequisite for analyzing simple and/or forecasting water quality parameters. Table 1 summarizes the main
complex phenomena. In this context, machine learning techniques can findings.
2
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
Table 1
Comparison between concepts, devices, systems and prototypes for Water quality measurements and analysis. A symbol indicates the fulfillment of a particular feature, a ✕
symbol denotes the miss of the feature or that the feature is not applicable.
Feature [6] [7] [8] [9] [10] [11] [12] [13] [14] WaterS
Preliminary mathematical formulation ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✓
Simulation Validation ✓
Experimental Validation ✕ ✕ ✕ ✓
Open Source Hardware ✕ ✕ ✕ ✕ ✓
Open Source Code ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✓
Energy Harvesting ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✓
Radio Frequency (RF) communications ✕ ✕ ✕ ✓
Standard-compliance ✕ ✕ ✕ ✓
Cloud-based monitoring ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✓
Available Application Programming Interfaces (APIs) ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✕ ✓
Prediction Capabilities with Machine Learning ✕ ✕ ✕ ✕ ✕ ✕ ✓
Table 2
Comparison of the main features of the LPWAN technologies.
Sigfox LoRa NB-IoT
Modulation Binary Phase Shift Keying (BPSK) Chirp Spread Spectrum (CSS) Quadrature Phase Shift Keying (QPSK)
Frequency Unlicensed ISM bands sub-GHz Unlicensed ISM bands sub-GHz Licensed Long-Term Evolution (LTE)
Bandwidth 100 Hz 125, 250, 500 kHz 200 kHz
Network Topology Star Star on Star Star
DataRate 100 bps 50 kbps 200 kbps
Message/day (MAX) 140 (UL), 4 (DL) Unlimited Unlimited
Payload length (MAX) 12 B (UL), 8 B (DL) 243 B 1.6 kB
Range 10 km (Urban)40 km (Rural) 5 km (Urban)20 km (Rural) 1 km (Urban)10 km (Rural)
End-node Roaming Yes Yes Yes
Licensed use No No Yes
2.2. The Sigfox technology wide. According to the European Telecommunications Standards Insti-
tute (ETSI) 300−220 regulation, in Europe, the frequency band adopted
LPWANs are widely conceived as the winning solution in multi- is 868 MHz, while in North America according to the FCC part 15 reg-
ple IoT applications/domain [26]. This is motivated by the fact that ulations is 902 MHz. Uplink messages are modulated with Differential
those technologies jointly optimize the amount of transmitted data Binary Phase-Shift Keying (DBPSK), while downlink messages are mod-
while maximizing coverage area. LPWANs are taken into consideration ulated with a Gaussian Frequency Shift Keying (GFSK). The adoption
because of the enhancements they propose, such as the friendly up- of these modulation schemes, enables the devices to communicate in a
scaling. It is worth noting that these advantages are achievable while range between 10 to 50 km with low power consumption (the maximum
lowering the energy footprint, as required by IoT networks. uplink and downlink transmission power are set to 25 mW and 500 mW
Sigfox is a narrow-band LPWAN proprietary protocol that uses in Europe, while it is set to 158 mW and 4 W in the USA).
the unlicensed Industrial, Scientific and Medical (ISM) frequencies Medium Access Control Layer. The Sigfox Medium Access Control
bands [26]. When compared to other LPWAN technologies, namely (MAC) layer is based on the unslotted Aloha MAC protocol. Access to
Long Range (LoRa) and Narrow-Band IoT (NB-IoT), Sigfox allows min- the wireless medium channel relies on Random Frequency and Time
imizing the exchange of packets, reducing bandwidth consumption, Division Multiple Access (RFTDMA). According to the standard Sigfox,
and limiting the energy consumption during radio communications. In each message can be sent up to 3 times on different frequencies to
Table 2, a summary of the main features and functional features of the improve reliability. As shown in Fig. 2, Sigfox uplink frames have an
cited LPWAN technologies is given. Nowadays, Sigfox technology en- overall size of 232 bits, while Sigfox downlink frames have an overall
ables several IoT applications, such as remote tracking, smart parking, size of 224 bits. The uplink frame starts with a preamble of 19 bits of
waste management, environmental monitoring, real-time health, and predefined symbols, used to identify an upcoming Sigfox message and
fitness monitoring, and public safety, to name a few. As depicted in from the receiver side to synchronize with the symbols sent by the
Fig. 1 the standard Sigfox network architecture envisages four layers: transmitter. The frame synchronization field of 29 bits specifies the type
(i) end user devices, (ii) one or more Sigfox base station(s), (iii) the of the frames to be transmitted, while the end-device-id of 32 bits is a
Sigfox cloud architecture and finally (iv) the application server(s). The unique identifier for each Sigfox device that is adopted for routing and
end devices are connected with the gateway in a star topology, by signing frames. The payload field ranges up to 96 bits are devoted to the
leveraging radio frequency links. Besides, there is a secure link between data, while the Message Authentication Code that spans from 16 to 40 bits
the base station(s) and the cloud infrastructure. Finally, the communi- and provides the frame authenticity. Finally, the last 16 bits identify
cation between the cloud architecture and the application server(s) can the Frame Check Sequence intending to detect communication errors.
be established leveraging different protocols such as Simple Network On the other hand, the downlink frame starts with a preamble of 91 bits
Management Protocol (SNMP), MQ Telemetry Transport (MQTT), and and the frame synchronization field of 13 bits. The Error-Correcting-Code
HyperText Transfer Protocol (HTTP). of 32 bits is used to detect errors in the data payload, and finally, the
The Sigfox standard supports up to 140 uplink messages a day (duty payload field up to 64 bits, the Message Authentication Code of 16 bits
cycle of 1%, 6 messages/hour), each with an uplink payload of 12 bytes and the Frame Check Sequence of 16 bits are used in the same way as
and an 8 bytes one in downlink. The data rate goes up to 100 bps specified for the uplink data structure [27].
in uplink and 600 bps in downlink. Each data transmission requires Frame Layer. This layer allows the generation of the radio frames
approximately 6 seconds. The Sigfox protocol stack consists of different starting from the Application Layer. Further, it attaches a sequence
layers described as follows. number during data transmission.
Physical Layer. Sigfox technology is an Ultra Narrow Band (UNB) Application Layer. This layer is devoted to managing functionality
deployed over a bandwidth of 192 kHz with each transmission 100 Hz like messaging and web-services.
3
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
𝑓𝑡 = 𝜎(𝐖𝑓 ⋅ [ℎ𝑡−1 , 𝑥𝑡 ] + 𝑏𝑓 ) (1) The reference background and the requirement analysis discussed
in the previous sections allow us to describe the operating scenario
𝑖𝑡 = 𝜎(𝐖𝑖 ⋅ [ℎ𝑡−1 , 𝑥𝑡 ] + 𝑏𝑖 ) (2)
in which the WaterS system is at work, as well as the envisioned
𝐶̃𝑡 = 𝑡𝑎𝑛ℎ(𝐖𝑐 ⋅ [ℎ𝑡−1 , 𝑥𝑡 ] + 𝑏𝑐 ) (3) architecture and the proposed deep learning solution.
4
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
5
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
granting data availability, reliability, and consistency. More in detail, approach to extract richer features and increase model capacity [39]
every hour the prototype is woken up to (i) measure the values of also providing a type of representational optimization [40].
interest, (ii) pre-elaborate the data, (iii) prepare the packets to be sent, Before the training, the whole dataset was analyzed to investigate
and finally (iv) transmit them. Those transmissions are carried out if there was any possible correlations among data. To this aim, the
thanks to the Sigfox BS that mainly acts as a relay toward the Sigfox Pearson correlation coefficient was computed by considering all the
Cloud. The Sigfox Cloud-based core network works to control and 3280 samples in the dataset.
manage the BSs and IoT devices. At the same time, it guarantees data By following a typical machine learning model training, the net-
connectivity between the BSs and the Internet, thus allowing gateway work’s hyperparameters have been set, based on evaluation on a valida-
functionalities relying on back-hauling systems. The following logical tion set, while weights and deviations are updated by using algorithms
node involved in data processing and usage is the application server. that minimize a loss function. When the training process ends, final
The front-end of the WaterS system, i.e., the end-user applica- weights and training data are saved for later use and analysis.
tion is conceived to monitor the water quality parameters [15]. In- The created routine is conceived to periodically train the system
deed, once the required authentication procedure by the end-user when there is an aggregation of new samples of at least one year
to the application server is concluded, the latter is in charge of ei- and to provide the prediction related to the water quality parameters.
ther authorizing/denying access to information by accepting/rejecting The system has no real-time training or model development capability,
requests. given the huge amount of resources and information required for
Protocol Compliance and Main Features. Leveraging the com- training and deploying the prediction network.
pliance to the Sigfox standard, WaterS transmits the sensed data to
the Sigfox Base Station. Concerning the main protocol features, every 5. Experimental evaluation
time a message is sent from WaterS to the Sigfox BS, immediately
transmitted to the Sigfox Cloud infrastructure. The aforementioned This Section describes the detail of the conducted experimental
communication is, in fact, straightforward, since the Sigfox BS mainly evaluations. In particular, it is herein discussed the structure of the
act as the reference Radio Access Network (RAN) for the Sigfox devices reference dataset, the metrics used to evaluate the model, and the
toward the cloud infrastructure. Once data reach the Sigfox Cloud, experimental settings.
this component is in charge of executing specific callbacks so that
the information coming from the IoT device can be properly stored,
5.1. Dataset
leveraging dedicated.
It is worth noting that, once data are in the Sigfox Cloud, and hence
This section has been divided into three parts: (i) Dataset Char-
made available for the Application Server, the dedicated processing
acteristics, (ii) Survey Campaign, and (iii) Preprocessing. It is worth
logic is triggered to properly handle the messages and the informa-
remarking that all the available water quality features have been used
tion within them. Without loss of generality, two custom routines are
developed to forward a message received by the Sigfox Cloud to the in the design of the 2-layers stacked LSTM network.
Application Server. In particular, two different kinds of messages (from
now on, also referred to as frames) are defined: 5.1.1. Dataset characteristics
The dataset was initially published as a technical report of the
• Frame Type 0, containing measured values coming from the moni- Tiziano Project [18]. The latter is an underground waters monitoring
toring sensors (temperature, 32 bits sized float number; pH, 16 bits system that collects qualitative and quantitative information for the
long integer number; turbidity, 16 bits long integer number); Apulia region, in the southern part of Italy. This system consists of
• Frame Type 1, containing information about GPS information, several monitoring network stations used for data gathering. It is worth
such as latitude and longitude, both in the form of 32 bits sized noting that Project Tiziano’s dataset represents an extensive dataset
float numbers. regarding the water quality parameter samples collection (see Fig. 5).
Deep Learning applied to WaterS. The prediction capabilities of The dataset contains water quality information, collected employing
WaterS are enabled by a RNN namely LSTM. In a nutshell, the amount surveys, each one containing different parameters, such as: (i) average
of data gathered transmitted from the Sigfox Cloud to the Application temperature, (ii) electric conductivity, (iii) medium dissolved oxygen,
Server is filtered and processed based on the year the surveys belong to. and (iv) pH. Data gathering activities were carried out over five years
The proposed RNN can be easily integrated as part of the cloud-based (from 2008 to 2012) at a fixed pace, i.e., one sample per hour.
services. This choice is motivated by the fact that, while at work, it
can be expensive in terms of required computational capabilities, thus 5.1.2. Organization criteria
increasing energy consumption and sensibly lowering the lifetime of The surveys were selected and filtered according to the following
the IoT device. From this point on, our work will discuss the details on criteria:
the leading design criteria and the methodological approach. On top of
• Reference place of the probe: city town of Bari: This choice is
that, we will present the experiments as well as a thorough analysis of
motivated by the fact that this is the measurement point closest
the obtained results.
to the place in which the WaterS prototype has been tested.
• Hours of the survey: 9 am, 12 pm, 6 pm: The rationale lies
4. Proposed approach
in data availability. During the cleaning phase, a preliminary
evaluation demonstrated that no relevant improvements in the
The problem was modeled as a multivariate time series forecasting forecasting activities could be achieved due to limited variations
with stacked LSTM networks. The LSTM network architecture has been of the surveyed variables.
selected based on its effectiveness in time series prediction and in
• Year for the surveys: from 2009 to 2011: This time interval has
learning long-term dependencies [30,33–35]. The gating mechanism
been verified to be the longest time period available with contigu-
that controls the information flow in the cells can resolve the van-
ous information and no missing data. Indeed, the years 2008 and
ishing or exploding gradients training problem with common RNN
2012 were excluded since some months had missing information.
networks [36]. Evidence has also proved that LSTM networks are more
effective than the conventional RNN [37] [38]. The stacked LSTM The resulting dataset is composed of 3280 samples and is characterized
structure has been chosen because adding depth is a more efficient by four different features, as stated in 5.1.1).
6
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
Fig. 5. Region of interest for the Tiziano Project and data source identification.
7
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
Fig. 6. Inference model performed on every triple (𝑇 𝑆𝑖 , 𝑇 𝑆𝑖+1 , 𝑇 𝑆𝑖+2 to predict the tuple 𝑇 𝑆𝑖+3 .
Table 6 Table 7
A part of the Tiziano Project dataset that includes the following features: Timestamp, Pearson correlation coefficient matrix of water quality parameters.
Water Temperature, Water Ph, Water Conductivity and Water Oxygenation. Water Parameters Temperature Conductivity Oxygen pH
Timestamp 𝑋𝑖
Temperature 1.00000 −0.20676 −0.18213 −0.17926
Water Water Water Water Conductivity 1.00000 −0.17549 0.24709
Temperature Ph Conductivity Oxygenation Oxygen 1.00000 −0.33209
pH 1.00000
𝑇 𝑆𝑖 17.72 2.80 12.00 7.10
𝑇 𝑆𝑖+1 17.73 2.80 12.00 7.20
𝑇 𝑆𝑖+2 17.71 2.79 13.00 7.10
𝑇 𝑆𝑖+3 17.70 2.80 13.00 7.10
𝑇 𝑆𝑖+4 17.71 2.81 12.00 7.20 returns the results of the network, providing a 1 × 4 multidimensional
array with the 4 different forecasted features. Basically, the purpose of
the network is to predict the features of the timestamp following the
three input ones given to the network and, the smaller the error we got,
used as an output feature, so, because of the proposed Many-To-One
the better the prediction.
LSTM network architecture, it is needed to perform a data aggregation
Both the input and the hidden layers use the Rectified Linear Unit
of timestamps to form the 𝑥 input array by simply scrolling through
(ReLU) functions as the activation function. The model uses the Adam
the list with an index and creating sets of 3 timestamps, associating to
algorithm [44] as an optimization algorithm; the choice is motivated by
each input set another timestamp, the 𝑦 array, to form samples. These
the fact that this solution is meant explicitly for optimization and can
samples are then provided to the network during the training phase. be used instead of the classical stochastic gradient descent procedure to
In our case, 𝑥 describes a [1 × 4 × 3] multidimensional input array. update network weights iteratively based on the training data [45,46].
In particular, 4 is referred to the different water quality parameters The number of units of the hidden and output state of every cell,
probed, and 3 is the number of the different surveys preceding the referring to the number of times that the entire training set was pro-
forecasting value in time series. On the other hand, 𝑦 is a [1 × 4] cessed by the LSTM network, was made dynamic, in order to estimate
dimensional output array, with the single survey succeeding the first the optimal training values for the hyperparameters. The maximum
3. In the proposed solution, for every 3 survey there is a timestamps values for the number of state units and epochs were set to 100 and
aggregation, thus allowing the creation of the 𝑥 input array and binding 1000, respectively. When designing this kind of network, the challenge
to it the 𝑦 output array, which represents the first survey of the dataset is to find out the optimal trade-off in tuning the number of training
following the last timestamp in the 𝑥 input group. epochs and the particular parameters of the LSTM cells, i.e., the hidden
In particular, Table 6 shows a part of the Tiziano Project dataset and the output state vector size. This results to be challenging since the
to describe the features (e.g., water temperature, water Ph, water number of cells must be kept constant.
conductivity, and water oxygenation) adopted in our solution. Each
record of the dataset is stored with the respective timestamp 𝑇 𝑆. A 6. Results
mathematical representation of the dataset aggregation procedure is
described in Eq. (11), where 𝑖 is the index of the processed dataset, Table 7 shows the Pearson correlation between the considered
𝑗 is the index of the aggregated dataset so that (𝑥𝑗 , 𝑦𝑗 ) represents the parameters. Specifically, the water temperature negatively correlates
𝑗th sample, and 𝑁 is the total number of subset samples related to with conductivity, oxygen, and pH at the significant level of 0.01.
the considered dataset (e.g., train set, validation set/test set). Fig. 6 Conductivity has a negative correlation with oxygen and has a positive
depicts the inference model executed on every triple (𝑇 𝑆𝑖 , 𝑇 𝑆𝑖+1 , 𝑇 𝑆𝑖+2 , correlation with pH at a significant level of 0.01. Moreover, based on
where 𝑖 ∈ {0, … , 𝑁 − 3} and 𝑁 is the total number of the samples) available data, conductivity, and pH have shown a positive correlation.
that predicts the output tuple (𝑇 𝑆𝑖+3 ). The Figure also reports the Finally, oxygen and pH show the highest correlation value (i.e., a
computation of the Mean Squared Error (MSE) used for updating the negative correlation of −0.33209).
model parameters. After the preprocessing phase, the LSTM network has been defined
{
𝑥𝑗 = [𝑥𝑖 , 𝑥𝑖+1 , 𝑥𝑖+2 ], for 𝑖, 𝑗 ∈ 1..𝑁 − 3 and trained to predict water parameters. To verify if the training is
(𝑥𝑗 , 𝑦𝑗 ) = (11) consistent and the design phase is completed, we decided to tune the
𝑦𝑗 = [𝑥𝑖+3 ]
two main hyperparameters, the number of state units of the hidden
As for the definition of the LSTM network, as shown in Fig. 7, vector of each LSTM cell, and the number of epochs, in order to
three different layers were created: (i) the input layer, (ii) the hidden choose the optimal configuration. At first, training performances were
layer, and (iii) the output layer. In a nutshell, the input layer accepts evaluated for every configuration using the validation set and only
the [1 × 4 × 3] multidimensional arrays representing the water quality considering the loss function. The final generalization error was then
surveys that precede the forecasting. The hidden layer is designed as computed using the three main considered metrics on the surveys of the
the middle layer (i.e., core) of the network, with a 2-layers stacked test set. The optimal configuration with the lowest MSE and MAE and
LSTM configuration and a variable number of units of the hidden state the highest CP was found with 70 state units in the cells of the hidden
for each cell, according to the training parameters. The output layer layer and 40 training epochs (see Fig. 8).
8
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
Fig. 9. Comparison between the observed and the predicted values of Conductivity.
Fig. 8. Comparison between the loss of training and validation set, on increasing
epochs.
9
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
10
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
11
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
not exist in the literature. The idea has been proven of interest since
a neural network can be used to process gathered data and promote
water quality analysis. The LSTM applied to our ecosystem achieves
a MAE as low as 0.20, a MSE of 0.092 and a CP equal to 0.94.
Further, this work demonstrated an interesting networking perspective,
since an increasing number of Sigfox-enabling end-devices may lead
to PER values as low as 4% in the largest envisioned deployment,
which includes more than 500 end devices. Even though the results are
noticeable, in the near future, WaterS could be adopted as a system to
identify potential waters’ anomalies. One of the most thrilling research
perspectives is the development of a federated machine learning ap-
proach. This approach could sensibly improve data analysis in case of
missing data/surveys or transmission losses and errors while preserving
forecasting capabilities. Finally, the source code of WaterS has been
released as open-source [20]. This enables the research community to
verify our claims, and use the released code as a ready-to-use basis for
further protocol improvement and comparison.
Although the proposed results are of relevance, it is worth specifying
that the analysis could be strengthened by including the depth of the
probing point as a parameter. In fact, from a hydrogeological point
Fig. 17. Network performance with 520 Sigfox-compliant devices.
of view, such detail on well waters represent an important variable in
establishing correlations between variables, since the electrical conduc-
tivity and the salinity are strictly bounded one with the other. In terms
of the neural network, this aspect could be dealt with by including
some non-linear or, in general, more complex correlation functions.
Therefore, the proposed results must be considered as an interesting
preliminary result, which, at the same time, demonstrates that the
applicability of the method must be extended to wider information
frameworks. Lastly, the reported results are obtained on a dataset which
contains information related to coastal waters. It would be important to
investigate if such a solution could be applied to a continental aquifer
to double-proof the quality of the obtained results. Hence, in the near
future, we plan to carry on with our analysis on different, yet extensive,
datasets available in the form of open data to further analyze water
quality in different contexts.
Acknowledgments
Fig. 18. Cumulative Distribution Function for the five network configurations.
The authors would like to thank Prof. D. Fidelibus, Prof. T. Di Noia,
C. Pomo, and W. Anelli for their contributions and support to this work.
Lastly, in Fig. 18, the Cumulative Distribution Function (CDF) val-
ues of PER are shown for the proposed network configurations. Between References
the 70th and the 80th percentile, it is shown that the increasing number
of devices leads to an increase in the PER. With a number of 14, 56, [1] J. Lin, W. Yu, N. Zhang, X. Yang, H. Zhang, W. Zhao, A survey on inter-
net of things: Architecture, enabling technologies, security and privacy, and
and 200 devices, in fact, the 70th percentile is reached with PER equal applications, IEEE Internet Things J. 4 (5) (2017) 1125–1142.
to 90%. With larger deployments, e.g., 300 or 520 devices, the 80th [2] P. Tedeschi, S. Sciancalepore, A. Eliyan, R. Di Pietro, Like: Lightweight certifi-
percentile is reached for values that are greater than 80%. cateless key agreement for secure IoT communications, IEEE Internet Things J.
7 (1) (2020) 621–638.
[3] M. Pulpito, P. Fornarelli, C. Pomo, P. Boccadoro, L. Grieco, On fast prototyping
8. Conclusion
LoRaWAN: a cheap and open platform for daily experiments, IET Wirel. Sens.
Syst. 8 (8) (2018) 237–245.
This work presented the WaterS architecture, an IoT solution that [4] E. Sisinni, A. Saifullah, S. Han, U. Jennehag, M. Gidlund, Industrial internet of
leverages the water monitoring capabilities, and the compliance to one things: Challenges, opportunities, and directions, IEEE Trans. Ind. Inf. 14 (11)
(2018) 4724–4734.
of the most promising candidates in the context of LPWANs. Leveraging
[5] F. Montori, L. Bedogni, L. Bononi, A collaborative internet of things architecture
its prototypical nature, the WaterS system has been proposed for an for smart cities and environmental monitoring, IEEE Internet Things J. 5 (2)
enhancement based on the employment of neural network solutions. (2018) 592–605.
Therefore, the proposed system uses the IoT paradigm for the data [6] C.Z. Myint, L. Gopal, Y.L. Aung, Reconfigurable smart water quality monitoring
collection and processing phase and the application of a Deep Learning system in IoT environment, in: 2017 IEEE/ACIS 16th International Conference
on Computer and Information Science, ICIS, 2017, pp. 435–440.
algorithm on the IoT system for data prediction. Specifically, a problem [7] A.A. Pranata, J.M. Lee, D.S. Kim, Towards an IoT-based water quality moni-
known in the literature has been solved, but on the dataset of Apulian toring system with brokerless pub/sub architecture, in: 2017 IEEE International
waters, an analysis that had never been done before and that does Symposium on Local and Metropolitan Area Networks, LANMAN, 2017, pp. 1–6.
12
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
[8] N.A. Cloete, R. Malekian, L. Nair, Design of smart sensors for real-time water [37] H. Palangi, L. Deng, Y. Shen, J. Gao, X. He, J. Chen, X. Song, R. Ward,
quality monitoring, IEEE Access (2016) 3975–3990. Deep sentence embedding using long short-term memory networks: Analysis
[9] K.H. Kamaludin, W. Ismail, Water quality monitoring with internet of things and application to information retrieval, IEEE/ACM Trans. Audio, Speech, Lang.
(IoT), in: 2017 IEEE Conference on Systems, Process and Control, ICSPC, 2017, Process. (2016).
pp. 18–23. [38] H. Palangi, R. Ward, L. Deng, Distributed compressive sensing: A deep learning
[10] S. Anand, R. Regi, Remote monitoring of water level in industrial storage tanks approach, IEEE Trans. Signal Process. (2016).
using NB-IoT, in: 2018 International Conference on Communication Information [39] H. Sadreazami, M. Bolic, S. Rajan, On the use of ultra wideband radar and
and Computing Technology, ICCICT, 2018, pp. 1–4. stacked LSTM-RNN for at home fall detection, in: 2018 IEEE Life Sciences
[11] R. Sammoudi, A. Chahlaoui, A. Kharoubi, I. Taha, A. Taouraout, Development Conference, LSC, 2018.
of a quality index model of spring waters: case study of the springs waters in
[40] R. Pascanu, C. Gulcehre, K. Cho, Y. Bengio, How to construct deep recurrent
Taanzoult plain (Aguelmam Sidi Ali RAMSAR site), Draa Tafilalt region, Morocco,
neural networks, in: Proceedings of the Second International Conference on
in: Proceedings of the 4th International Conference on Smart City Applications,
Learning Representations, ICLR 2014, 2014.
2019, pp. 1–9.
[41] Y. Liu, L. Guan, C. Hou, H. Han, Z. Liu, Y. Sun, M. Zheng, Wind power short-term
[12] J.-x. Wang, Y. Liu, Z.-b. Lei, K.-h. Wu, X.-y. Zhao, C. Feng, H.-w. Liu, X.-h.
prediction based on LSTM and discrete wavelet transform, Appl. Sci. 9 (6) (2019)
Shuai, Z.-m. Tang, L.-y. Wu, S.-y. Long, J.-r. Wu, Smart water lora IoT system, in:
1108.
Proceedings of the 2018 International Conference on Communication Engineering
and Technology, 2018, pp. 48–51. [42] S. Marsland, Machine Learning: An Algorithmic Perspective, CRC Press, 2015.
[13] P. Liu, J. Wang, A.K. Sangaiah, Y. Xie, X. Yin, Analysis and prediction of water [43] T. Beysolow II, Introduction To Deep Learning using R: A Step-By-Step Guide To
quality using LSTM deep neural networks in IoT environment, Sustainability Learning and Implementing Deep Learning Models using R, A Press, 2017.
(2019) 2058. [44] D.P. Kingma, J. Ba, Adam: A method for stochastic optimization, 2014, arXiv:
[14] M. Mukta, S. Islam, S.D. Barman, A.W. Reza, M.S. Hossai Khan, Iot based smart arXiv:1412.6980.
water quality monitoring system, in: 2019 IEEE 4th International Conference on [45] Z. Zhang, Improved adam optimizer for deep neural networks, in: 2018
Computer and Communication Systems, ICCCS, 2019, pp. 669–673. IEEE/ACM 26th International Symposium on Quality of Service, IWQoS, 2018,
[15] P. Di Gennaro, D. Lofú, D. Vitanio, P. Tedeschi, P. Boccadoro, Waters: A sigfox- pp. 1–2.
compliant prototype for water monitoring, Internet Technol, Lett. 2 (1) (2019) [46] H. Shao, L. Wang, Y. Ji, Link prediction algorithms for social networks based on
e74, http://dx.doi.org/10.1002/itl2.74. machine learning and HARP, IEEE Access 7 (2019) 122722–122729.
[16] S. Tyagi, B. Sharma, P. Singh, R. Dobhal, Water quality assessment in terms of [47] A. Gulli, S. Pal, Deep Learning with Keras, Packt Publishing Ltd, 2017.
water quality index, Am. J. of Water Resour. 1 (3) (2013) 34–38.
[48] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S.
[17] S.D. Richardson, T.A. Ternes, Water analysis: Emerging contaminants and current
Ghemawat, G. Irving, M. Isard, et al., Tensorflow: A system for large-scale
issues, Anal. Chem. 90 (1) (2018) 398–428.
machine learning, in: 12th {USENIX} Symposium on Operating Systems Design
[18] R. Puglia, Progetto tiziano—Sistema di monitoraggio acque sotterranee, 2006.
and Implementation, {OSDI} 16, 2016, pp. 265–283.
[19] P. Tedeschi, S. Sciancalepore, R.D. Pietro, Security in energy harvesting networks:
[49] D. Merkel, et al., Docker: lightweight linux containers for consistent development
A survey of current solutions and research challenges, 2020, arXiv:2004.10394.
[20] P. Di Gennaro, D. Lofú, V. Daniele, P. Tedeschi, P. Boccadoro, Open-source code and deployment, Linux J. 2014 (239) (2014) 2.
of the implementation of WaterS, https://github.com/pdigennaro/WaterS20, [50] A. Policriti, N. Prezza, LZ77 Computation based on the run-length encoded BWT,
(Accessed: 15 May 2020). Algorithmica 80 (7) (2018) 1986–2011.
[21] J. Zhang, Y. Zhu, X. Zhang, M. Ye, J. Yang, Developing a long short-term memory [51] SigFox, SigFox Build, 2021, https://build.sigfox.com/study#direct-cost (Ac-
(LSTM) based model for predicting water table depth in agricultural areas, J. cessed: 11 May 2021).
Hydrol. 561 (2018) 918–929.
[22] X. Wang, F. Zhang, J. Ding, Evaluation of water quality based on a machine
learning algorithm and water quality index for the Ebinur Lake Watershed, China,
Sci. Rep. 7 (1) (2017) 1–18. Pietro Boccadoro received the Dr. Eng. degree (with hon-
[23] W. Zhang, W. Guo, X. Liu, Y. Liu, J. Zhou, B. Li, Q. Lu, S. Yang, LSTM-Based ors) in electronic engineering from ‘‘Politecnico di Bari’’,
analysis of industrial IoT equipment, IEEE Access 6 (2018) 23551–23560. Bari, Italy, in July 2015. From Nov. 2015 to Oct. 2017,
[24] Y. Wang, Y. Shen, S. Mao, X. Chen, H. Zou, LASSO And LSTM integrated temporal he collaborated as a researcher with Consorzio Nazionale
model for short-term solar intensity forecasting, IEEE Internet Things J. 6 (2) Interuniversitario per le Telecomunicazioni (CNIT) at Po-
(2019) 2933–2944. litecnico di Bari and collaborated to research activities for
[25] K.S. Adu-Manu, C. Tapparello, W. Heinzelman, F.A. Katsriku, J.-D. Abdulai, the H2020 BONVOYAGE project.
Water quality monitoring using wireless sensor networks: Current trends and He got the Ph.D. in 2021 at Politecnico di Bari.
future research directions, ACM Trans. Sensor Netw. 13 (1) (2017).
[26] A. Al-Fuqaha, M. Guizani, M. Mohammadi, M. Aledhari, M. Ayyash, Internet
of things: A survey on enabling technologies, protocols, and applications, IEEE Vitanio Daniele received the bachelor’s degree in Computer
Commun. Surv. Tutor. 17 (4) (2015) 2347–2376. Science Engineering at the Polytechnic University of Milano
[27] J.C. Zuniga, B. Ponsard, SIGFOX System Description, LPWAN@ IETF97, (Italy) with a thesis based on the development of a large-
Nov. 14th, 25, 2017 URL https://tools.ietf.org/html/draft-zuniga-lpwan-sigfox- scale distributed application RPC based, and the master’s
system-description-04. degree (Hons.) in Computer Engineering at the Polytechnic
[28] S. Hochreiter, J. Schmidhuber, Long short-term memory, Neural Comput. 9 (8) University of Bari (Italy) with a thesis on the Application of
(1997) 1735–1780. Software Engineering in the Embedded-IoT domain. Since
[29] B. Lindemann, B. Maschler, N. Sahlab, M. Weyrich, A survey on anomaly 2018 he works at the Laboratory of Connected Vehicle &
detection for technical systems using LSTM networks, Comput. Ind. 131 (2021) Micro Mobility at Sitael S. p. A. where he mainly deals
103498. with the design and development of embedded applications
[30] I. Goodfellow, Y. Bengio, A. Courville, Deep learning, MIT Press, 2016, pp.
for payment and automotive field. Further areas of interest
397–400, http://www.deeplearningbook.org.
concern Machine Learning, Computer Security and all the
[31] R. Jozefowicz, W. Zaremba, I. Sutskever, An empirical exploration of recurrent
Security related aspects of the Internet of Things (IoT).
network architectures, in: Proceedings of the 32nd International Conference on
International Conference on Machine Learning, ICML’15, vol. 37, 2015, pp.
2342–2350.
[32] K. Greff, R.K. Srivastava, J. Koutník, B.R. Steunebrink, J. Schmidhuber, LSTM: Pietro Di Gennaro received the bachelor’s degree in
A Search space odyssey, IEEE Trans. Neural Netw. Learn. Syst. 28 (10) (2017) Computer Science and Automation engineering with an
2222–2232. experimental thesis in Automation, ‘‘Distributed Optimized
[33] K. Chen, Y. Zhou, F. Dai, A LSTM-based method for stock returns prediction: A Algorithms for charging electrical vehicles’’ at the Polytech-
case study of China stock market, in: 2015 IEEE International Conference on Big nic University of Bari.
Data (Big Data), 2015. He is currently pursuing the 2nd Degree Master Course
[34] R. Fu, Z. Zhang, L. Li, Using LSTM and GRU neural network methods for traffic Computer Science Engineering at the Polytechnic University
flow prediction, in: 2016 31st Youth Academic Annual Conference of Chinese of Bari and working as a Software Developer for Fincons
Association of Automation, YAC, 2016. S.p.a. for ‘‘Progetto Corner’’.
[35] L. Yunpeng, H. Di, B. Junpeng, Q. Yong, Multi-step ahead time series forecasting His research interests span over Artificial Intelli-
for different data patterns based on LSTM recurrent neural network, in: 2017 gence, Machine Learning, the Internet of Things (IoT),
14th Web Information Systems and Applications Conference, WISA, 2017. cybersecurity, cryptography and mobile development.
[36] R. Pascanu, T. Mikolov, Y. Bengio, On the difficulty of training recurrent neural
networks, in: International Conference on Machine Learning, 2013.
13
P. Boccadoro et al. Ad Hoc Networks 126 (2022) 102749
Domenico Lofù received the master’s degree in Computer Pietro Tedeschi is currently a Ph.D. Student in Computer
Science Engineering at the Polytechnic University of Bari Science and Engineering (Cybersecurity) at the Hamad Bin
(Italy), with full marks. His thesis, which had an industrial Khalifa University (HBKU), Doha, Qatar. He is an active
characterization, addressed the application of Deep Learning member of the HBKU Cyber-Security Research Innovation
techniques to Aerial Images. Lab. He received his Bachelor’s degree in Computer and
He is currently Ph.D. student in Computer Science at Automation Engineering in 2014 with a thesis on the
the Polytechnic University of Bari. His research interests are Analysis of Security Protocols for the Internet of Things,
related to Artificial Intelligence, Adversarial Machine Learn- in IEEE 802.15.4e Networks, and his Master’s degree (with
ing, and Machine Learning for Cyber Security. The specific honors) in Computer Engineering both from the ‘‘Politecnico
topic of his Ph.D. research is ‘‘Artificial Intelligence in Cyber di Bari’’, in 2017 with a thesis on the Development of Se-
Security’’. He is member of the Laboratory of Information curity Architectures in Intelligent Transport Systems for EU
Systems (SisInfLab) at the Polytechnic University of Bari. He Horizon 2020 BONVOYAGE project. From 2017 to 2018, he
is also member of the Research and Development Laboratory worked as Security Researcher at CNIT (Consorzio Nazionale
of Exprivia S.p.A., where he is involved in Cyber Security Interuniversitario per le Telecomunicazioni), Italy, for the
research projects. EU H2020 SymbIoTe project. His research interests span
over UAV/Drone Security, Wireless Security, Internet of
Things (IoT), Applied Cryptography, and Cyber–Physical
Systems.
14