Article
Memory-Based Pruning of Deep Neural Networks for IoT
Devices Applied to Flood Detection
Francisco Erivaldo Fernandes Junior
1,
* , Luis Gustavo Nonato
2
, Caetano Mazzoni Ranieri
2
and Jó Ueyama
2
Citation: Fernandes Junior, F.E.;
Nonato, L.G.; Ranieri, C.M.; Ueyama,
J. Memory-Based Pruning of Deep
Neural Networks for IoT Devices
Applied to Flood Detection. Sensors
2021, 21, 7506. https://doi.org/
10.3390/s21227506
Academic Editor: Nunzio Cennamo
Received: 27 September 2021
Accepted: 5 November 2021
Published: 12 November 2021
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
Copyright: © 2020 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).
1
SIDIA R&D Institute, Manaus 69055-035, Brazil
2
Institute of Mathematical and Computer Sciences, University of São Paulo (USP), São Carlos 13566-590, Brazil;
gnonato@icmc.usp.br (L.G.N.); cmranieri@alumni.usp.br (C.M.R.); joueyama@icmc.usp.br (J.U.)
* Correspondence: francisco.junior@sidia.com
Abstract:
Automatic flood detection may be an important component for triggering damage control
systems and minimizing the risk of social or economic impacts caused by flooding. Riverside images
from regular cameras are a widely available resource that can be used for tackling this problem.
Nevertheless, state-of-the-art neural networks, the most suitable approach for this type of computer
vision task, are usually resource-consuming, which poses a challenge for deploying these models
within low-capability Internet of Things (IoT) devices with unstable internet connections. In this
work, we propose a deep neural network (DNN) architecture pruning algorithm capable of finding a
pruned version of a given DNN within a user-specified memory footprint. Our results demonstrate
that our proposed algorithm can find a pruned DNN model with the specified memory footprint
with little to no degradation of its segmentation performance. Finally, we show that our algorithm
can be used in a memory-constraint wireless sensor network (WSN) employed to detect flooding
events of urban rivers, and the resulting pruned models have competitive results compared with the
original models.
Keywords:
deep neural networks; semantic segmentation; random pruning; Internet of Things; flood
detection; user preference
1. Introduction
Flood risk is the probability that exposure to flooding will cause negative conse-
quences, ranging from economic losses to social and health issues [
1
]. When this risk is not
negligible, flood management solutions become of paramount importance, and different
types of technologies have been proposed for this aim [
2
]. Within this context, automatic
flood detection may be important to trigger alerts or damage control systems.
A method commonly applied to measure the water level of a river is the implantation
of gauges at different locations of its course [
3
–
5
]. Although well-established and suitable
for most situations, this solution is unable to detect uncommon events, such as extreme
flooding. Other approaches rely on satellite or airborne images [
6
,
7
], which can provide
good predictions when fed to state-of-the-art machine learning techniques. However,
data from these sources are not suitable for real-time predictions, since it depends on the
overpasses of satellites or other devices, which sometimes happens only as often as once or
twice a day.
An alternative is the placement of still cameras at the basin of a river [
8
]. Although
each particular camera has limited coverage, which means that multiple cameras at dif-
ferent locations may be needed to cover a broader area, this approach has low cost of
implementation and does not require a sophisticated infrastructure for deployment: a
set of low-end Internet of Things (IoT) devices may be sufficient for data gathering. In
Vandaele et al. [
8
], opportunistic data from a network of cameras placed throughout the
courses of two rivers were employed to detect flooding based on deep learning approaches
Sensors 2021, 21, 7506. https://doi.org/10.3390/s21227506 https://www.mdpi.com/journal/sensors