Citation: Monti, L.; Tse, R.; Tang,
S.-K.; Mirri, S.; Delnevo, G.;
Maniezzo, V.; Salomoni, P.
Edge-Based Transfer Learning for
Classroom Occupancy Detection in a
Smart Campus Context. Sensors 2022,
22, 3692. https://doi.org/10.3390/
s22103692
Academic Editors: Fabio Salice
and Sara Comai
Received: 11 April 2022
Accepted: 9 May 2022
Published: 12 May 2022
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
Copyright: © 2022 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/).
Article
Edge-Based Transfer Learning for Classroom Occupancy
Detection in a Smart Campus Context
Lorenzo Monti
1
, Rita Tse
2
, Su-Kit Tang
2
, Silvia Mirri
3,
* , Giovanni Delnevo
3
, Vittorio Maniezzo
3
and Paola Salomoni
3
1
INAF—Istituto di Radioastronomia, 40127 Bologna, Italy; lorenzo.monti@inaf.it
2
Faculty of Applied Sciences, Macao Polytechnic University, Macao, China; ritatse@ipm.edu.mo (R.T.);
sktang@ipm.edu.mo (S.-K.T.)
3
Department of Computer Science and Engineering, University of Bologna, 40126 Bologna, Italy;
giovanni.delnevo2@unibo.it (G.D.); vittorio.maniezzo@unibo.it (V.M.); paola.salomoni@unibo.it (P.S.)
* Correspondence: silvia.mirri@unibo.it
Abstract:
Studies and systems that are aimed at the identification of the presence of people within
an indoor environment and the monitoring of their activities and flows have been receiving more
attention in recent years, specifically since the beginning of the COVID-19 pandemic. This paper
proposes an approach for people counting that is based on the use of cameras and Raspberry Pi
platforms, together with an edge-based transfer learning framework that is enriched with specific
image processing strategies, with the aim of this approach being adopted in different indoor envi-
ronments without the need for tailored training phases. The system was deployed on a university
campus, which was chosen as the case study. The proposed system was able to work in classrooms
with different characteristics. This paper reports a proposed architecture that could make the system
scalable and privacy compliant and the evaluation tests that were conducted in different types of
classrooms, which demonstrate the feasibility of this approach. Overall, the system was able to count
the number of people in classrooms with a maximum mean absolute error of 1.23.
Keywords:
Internet of Things; smart buildings; smart environments; deep learning; transfer learning;
occupancy detection; smart sensing; ambient intelligence
1. Introduction
The monitoring of the flow and presence of people, the counting of individuals in
indoor environments (including means of transport) and the detection of whether people
are present in a building or specific place have always been strategic goals within different
contexts. In fact, such activities are able to provide information that can be useful and can
be exploited for different purposes [
1
]. A few examples from the context of smart building
management include the configuration settings of heat, ventilation and air conditioning
(HVAC), alarms, lighting and building security systems [2].
After 2020, these monitoring actions have become vital. They represent a means to
control and guarantee the realization of everyday activities in many contexts due to the
need for social distancing in most public places, such as schools and universities, malls and
stores, offices and workplaces, tourism and cultural entities and activities, etc., because of
the ongoing COVID-19 pandemic [
3
]. In fact, social distancing has proven to be an effective
measure for the reduction in contact between individuals and, consequently, the limitation
of the spread of the virus [4].
In this context, the Internet of Things paradigm [
5
], together with the diffusion and
availability of sensors and smart objects, can provide great support in the monitoring and
detection of daily life activities within various situations. Examples include activitieshat
are related to education and learning [
6
–
8
], those in the health and medical fields [
9
,
10
],
Sensors 2022, 22, 3692. https://doi.org/10.3390/s22103692 https://www.mdpi.com/journal/sensors