IoT Edge Solutions for Cognitive Buildings 9783031151590, 9783031151606

293 117 12MB

English Pages [354] Year 2023

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

IoT Edge Solutions for Cognitive Buildings
 9783031151590, 9783031151606

Table of contents :
Preface
Contents
1 COGITO: A Platform for Developing Cognitive Environments
1.1 Introduction
1.2 The COGITO Platform
1.2.1 An Overview of the Platform
1.2.2 Developing an Application Over the COGITO Platform
1.3 Equipment Deployment
1.4 Cognitive Applications for Indoor Environments
1.4.1 Thermal Comfort
1.4.2 Occupancy Forecast
1.4.3 Air Quality
1.4.4 Smart Meeting Room
1.5 Cognitive Applications for Outdoor Environments
1.5.1 Smart Parking
1.5.2 Monitoring Weather Conditions
1.6 Conclusion
References
2 Cloud, Fog, and Edge Computing for IoT-Enabled Cognitive Buildings
2.1 Introduction
2.1.1 Background
2.2 Cloud Computing
2.2.1 Benefits of Cloud Computing
2.2.2 Cloud Computing Characteristics
2.2.3 Cloud Services Models
2.2.4 Cloud Deployment Models
2.2.5 Cloud Computing for Smart Building
2.3 Edge and Fog Computing
2.3.1 Edge Computing Characteristics
2.3.2 Fog Computing
2.3.2.1 Fog Computing Characteristics
2.3.2.2 Fog Computing Services and Deployment Models
2.3.3 Fog Computing Versus Edge Computing
2.3.4 Edge Computing Versus Cloud Computing
2.3.5 Edge and Fog Computing for Smart Buildings
2.4 IoT-Enabled Smart Buildings
2.4.1 IoT-Enabled Smart Building Model
2.4.2 IoT-Enabled Smart Building Components
2.4.3 IoT-Enabled Smart Building Design Framework
2.4.4 Sample IoT-Enabled Smart Building Scenarios
2.4.4.1 HVAC System
2.4.4.2 Health Monitoring System
2.4.4.3 Remote Monitoring System
2.5 Conclusion
References
3 Edge Caching in IoT Smart Environments: Benefits, Challenges, and Research Perspectives Toward 6G
3.1 Introduction
3.2 Content Distribution in Smart Environments
3.2.1 Peculiarities of IoT Contents and Devices
3.2.2 Benefits of Edge Caching
3.3 Conventional Edge Caching Designs
3.4 Disruptive Pervasive Edge Caching Solutions
3.4.1 NDN in a Nutshell
3.4.2 Popularity-Driven Approaches
3.4.3 Energy-Driven Solutions
3.4.4 Freshness-Driven Caching
3.4.4.1 Freshness-Based Only Solutions
3.4.4.2 Multi-Criteria Approaches
3.5 IoT Data Caching at the Edge Toward 6G
3.5.1 NDN and SDN Interplay
3.5.2 Joint Computing and Caching
3.5.3 AI-Based In-Network Caching Strategies
3.6 Conclusions
References
4 Needs Analysis, Protection, and Regulation of the Rights of Individuals and Communities for Urban and Residential Comfort in Cognitive Buildings
4.1 Introduction
4.2 New Technologies for Outdoor and Indoor Well-Being: The Legal Framework
4.3 Multiscalar Analysis of the City of Matera and the Demonstrators of the COGITO Project
4.4 An “Ideal” Technology: Reflections from Ethnographic Research
4.5 Need Assessment in the Design of a Cognitive System
4.6 Effectiveness of the GDPR in the Data Protection System Transformed by New Technologies
References
5 Real Case Studies Toward IoT-Based Cognitive Environments
5.1 Introduction
5.2 Wireless Sensor Networks and MANs for CoIoTEs
5.2.1 Wireless Sensor Networks
5.2.2 MAN
5.2.3 Applications and Design Challenges
5.3 Implementation of the Smart Street Network in the City of Cosenza
5.3.1 Description of the Communication Backbone
5.3.2 Implementation of the Final Solution
5.3.3 The Devices Involved in the Realization of the Smart Street
5.4 A VPN ``Hub and Spoke'' for Secure Interconnection of Geographically Distributed Sensor Networks
5.4.1 VPN Topology Overview
5.4.2 A Secure Sockets Layer VPN
5.4.3 Realization of the Peripheral Hub Nodes and the Master Server
5.5 Design and Implementation of an Intelligent Video Conferencing System for CoIoTEs
5.5.1 The Jitsi Video Conferencing System
5.5.2 A Web-Based File Manager
5.5.3 The Email Processing Component
5.6 Conclusions
References
6 Audio Analysis for Enhancing Security in Cognitive Environments Through AI on the Edge
6.1 Introduction
6.2 Approaches for Audio Recording
6.2.1 Array of Microphones
6.2.2 Recording Devices
6.3 Understanding Audio Recordings
6.4 AI in Audio Analysis
6.5 AI and Algorithms for Sample Normalization and Audio Understanding
6.6 Privacy Implications on Sensitive Data: Defining Minimum Information Content
6.7 Analyzing Hardware Devices
6.8 Reacting Based on the Information: Actuators
6.9 A Complete Implementation
6.10 Case Study
6.10.1 Free and Restricted Access Room
6.10.2 Residential Apartment
6.11 Further Improvements/Conclusions
References
7 Aggregate Programming for Customized Building Management and Users Preference Implementation
7.1 Introduction
7.2 Description of the Brescia Use Case
7.2.1 User Preferences and Feedback Collection
7.2.2 Sensor Integration Through IoT Paradigm
7.3 Aggregate Programming
7.4 Aggregate Programming for the Brescia Use Case
7.4.1 Users Localization
7.4.2 Porting Aggregate Programming to Embedded Systems
7.4.3 An AP Case Study Using RTLS
7.5 Simulation
7.6 Conclusions
References
8 IoT Control-Based Solar Shadings: Advanced Operating Strategy to Optimize Energy Savings and Visual Comfort
8.1 Introduction
8.2 Materials and Method
8.2.1 Sensors and Actuators
8.2.2 Operating Control Strategy for Venetian Blinds
8.2.2.1 Absence of Occupants
8.2.2.2 Presence of Occupants
8.3 Analysis of Results
8.3.1 Simulation Environment
8.3.2 Evaluation of Thermal Gains on an Hourly Basis
8.3.2.1 LED System
8.3.2.2 Fluorescent Lamps
8.3.3 Evaluation of Thermal Gains on a Monthly Basis
8.3.4 Evaluation of Annual Energy and Economic Savings
8.3.4.1 Energy Savings
8.3.4.2 Economic Savings
8.4 Conclusions
References
9 Room Occupancy Prediction Leveraging LSTM: An Approach for Cognitive and Self-Adapting Buildings
9.1 Introduction
9.2 Related Work
9.3 An Approach for Room Occupancy Prediction for Cognitive and Self-Adapting Building
9.3.1 Software Architecture
9.3.1.1 Components
9.3.1.2 Devices and Virtual Objects
9.3.1.3 Application Agents
9.3.2 Definition of the Prediction Tasks
9.3.3 Data Pre-processing
9.3.3.1 Transformation Approach for Non-homogeneous Time Series
9.3.4 Networks Training
9.3.4.1 LSTM Neural Network
9.3.5 Training
9.4 Experimental Results
9.4.1 Dataset
9.4.1.1 Dataset A: Occupancy Detection Dataset
9.4.1.2 Dataset B: Experimental Dataset
9.4.2 Evaluation Metrics
9.4.3 Imbalanced Classification Techniques
9.4.3.1 Focal Loss
9.4.3.2 Weight Balancing
9.4.4 Results
9.4.4.1 Task 1: Occupancy Detection
9.4.4.2 Task 2: Occupancy Prediction
9.5 Conclusion and Future Work
References
10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study
10.1 Introduction
10.2 Background and Enabling Technologies
10.2.1 ACOSO-Meth
10.2.2 Uppaal
10.2.3 DHT11
10.2.4 Arduino Uno
10.2.5 QR Code
10.2.6 Raspberry Pi
10.2.7 Node-RED
10.2.8 MQTT (Message Queue Telemetry Transport)
10.2.9 Long Short-Term Memory (LSTM)
10.2.10 Docker
10.2.11 DigitalOcean
10.3 Related Works
10.3.1 Monitoring at the End-Device Layer
10.3.2 Monitoring at the Edge Layer
10.3.3 Monitoring at the Cloud Layer
10.4 Project Development
10.4.1 Analysis Phase
10.4.2 Design Phase
10.4.3 Verification and Validation
10.4.4 Implementation Phase
10.4.5 Deployment and Orchestration
10.5 Conclusions
References
11 Structural Health Monitoring in Cognitive Buildings
11.1 Introduction
11.2 Structural Monitoring Techniques
11.3 Cognitive Buildings
11.4 Case Study
11.5 Conclusions and Future Activities
References
12 Development of Indoor Smart Environments Leveraging the Internet of Things and Artificial Intelligence: A Case Study
12.1 Introduction
12.2 Related Work
12.3 Smart Management of Indoor Spaces
12.4 Smart Meeting Room Application Components
12.4.1 Smart Objects
12.4.2 Software Components
12.5 Management of the Conference System in Indoor Environments
12.5.1 Management of the Booking of the Smart Meeting Room
12.5.2 Event Management in the Pre and Start Phases
12.5.3 Event Management
12.6 Conclusion
References
13 Human-Centered Reinforcement Learning for Lighting and Blind Control in Cognitive Buildings
13.1 Introduction
13.2 Reinforcement Learning in Control Systems
13.3 A Human-Centered RL with a Satisfaction-Based Visual Comfort Model
13.4 An RL Model for the Management of the Visual Comfort
13.4.1 The State Variables
13.4.2 The Decision Variables
13.4.3 The Reward Function
13.4.4 Q-Learning
13.5 Case Study
13.6 Conclusions
References
14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case
14.1 Introduction
14.2 Basic Concepts
14.2.1 The COGITO Platform
14.2.2 Reinforcement Learning
14.2.3 Markov Decision Process
14.2.4 The Load Scheduling
14.3 Integration Between the COGITO Platform and the Omnia Energia Equipment
14.4 The Case Study
14.4.1 The Case Study Equipment
14.4.2 The Functional Perspective
14.4.3 The Underpinning Software Infrastructure
14.4.4 Customization of the Omnia Meter
14.4.5 The Case Study Dashboard
14.5 Conclusion
References
15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings
15.1 Introduction
15.2 Related Work
15.3 A DRL Model for the Management of Indoor Environments
15.3.1 Thermal Model
15.3.2 Behavioral Model
15.3.3 Objective Function and Reward
15.4 Experimental Results
15.5 Conclusions
References
Index

Citation preview

Internet of Things

Franco Cicirelli Antonio Guerrieri Andrea Vinci Giandomenico Spezzano   Editors

IoT Edge Solutions for Cognitive Buildings

Internet of Things Technology, Communications and Computing

Series Editors Giancarlo Fortino, Rende (CS), Italy Antonio Liotta, Edinburgh Napier University, School of Computing, Edinburgh, UK

The series Internet of Things - Technologies, Communications and Computing publishes new developments and advances in the various areas of the different facets of the Internet of Things. The intent is to cover technology (smart devices, wireless sensors, systems), communications (networks and protocols) and computing (theory, middleware and applications) of the Internet of Things, as embedded in the fields of engineering, computer science, life sciences, as well as the methodologies behind them. The series contains monographs, lecture notes and edited volumes in the Internet of Things research and development area, spanning the areas of wireless sensor networks, autonomic networking, network protocol, agent-based computing, artificial intelligence, self organizing systems, multi-sensor data fusion, smart objects, and hybrid intelligent systems. Indexing: Internet of Things is covered by Scopus and Ei-Compendex **

Franco Cicirelli • Antonio Guerrieri • Andrea Vinci • Giandomenico Spezzano Editors

IoT Edge Solutions for Cognitive Buildings

Editors Franco Cicirelli ICAR-CNR Rende, Cosenza, Italy

Antonio Guerrieri ICAR-CNR Rende, Cosenza, Italy

Andrea Vinci ICAR-CNR Rende, Cosenza, Italy

Giandomenico Spezzano ICAR-CNR Rende, Cosenza, Italy

ISSN 2199-1073 ISSN 2199-1081 (electronic) Internet of Things ISBN 978-3-031-15159-0 ISBN 978-3-031-15160-6 (eBook) https://doi.org/10.1007/978-3-031-15160-6 © The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

Preface

The evolution of the Internet of Things (IoT) technologies and Artificial Intelligence techniques has introduced a new paradigm shift from smart buildings to cognitive buildings (CBs). CBs are able to exploit decentralized architectures where analytical processing and cognitive behaviors can be operated both at the edge and in the cloud so as to exploit the advantages of both of them. Besides the well-known benefits provided by the cloud, edge computing enables real-time intelligence at the edge of the network and greater agility of control while, at the same time, avoiding heavy communication traffic. By embedding intelligence on edge devices, the cognitive buildings can be more responsive to user preferences and needs. CBs are environments augmented with sensors and actuators that exploit the IoT paradigm and cognitive abilities altogether. They are able to learn, reason, adapt, and cooperate with each other to undertake context-dependent actions. A cornerstone characteristic of cognitive buildings is represented by the ability to collect and analyze sensor data and information coming from user habits to manage building resources and spaces efficiently. CBs can make their occupants more comfortable, productive, and healthy. They can sense their environments and also identify problems before they occur. They also combine detailed facility management capabilities and cognitive computing to drive toward better-managed buildings. Making cognitive a building can save energy, optimize spaces, and improve safety and security, while also allowing for customizations that suit each occupant’s needs. This book aims to offer a broad overview of cognitive buildings and gives insight into platforms, solutions, and applications in this field. In particular, the book mainly focuses on topics such as: (i) Self-learning and adaptive environments; (ii) Thermal, visual, and air-comfort management systems; (iii) Efficient energy management; (iv) Human-in-the-loop systems; (v) Analysis of building dwellers’ needs, requirements, and normative regulations. A brief introduction to the chapters is provided below. The Chapter “COGITO: A Platform for Developing Cognitive Environments,” by Marica Amadeo, Franco Cicirelli, Antonio Guerrieri, Giuseppe Ruggeri, Giandomenico Spezzano, and Andrea Vinci, introduces the concept of CBs and outlines v

vi

Preface

the challenges related to the development of such systems. After this, the COGITO platform is introduced and presented as an enabling technology for CB design and implementation. COGITO is an agent-based IoT platform tailored to the development of CBs in a heterogeneous continuum computing environment comprising cloud, fog, and edge resources. The practical use of the platform is demonstrated in the chapter through the discussion of some use cases developed at the ICAR-CNR headquarters at Rende (Italy). The Chapter “Cloud, Fog and Edge Computing for IoT-Enabled Cognitive Buildings,” by Erdal Ozdogan, starts with the idea that, in order to implement CBs and harness their potential, it is essential to exploit technologies such as the Internet of Things, cloud computing, fog computing, and edge computing. So, in this chapter, these key concepts are discussed. In addition, a modular design framework for CBs is also proposed in the manuscript, and in accordance with the proposed framework, some sample scenarios are finally presented. The Chapter “Edge Caching in IoT Smart Environments: Benefits, Challenges and Research Perspectives Towards 6G,” by Marica Amadeo, Claudia Campolo, Giuseppe Ruggeri, and Antonella Molinaro, overviews the literature related to edge caching for IoT CBs and identifies the most promising decision policies for caching together with its key benefits and open challenges. In particular, conventional caching techniques are first scanned, before delving into more disruptive in-network caching solutions built upon the Named Data Networking (NDN) paradigm. The focus of the chapter is then on the possible interplay of NDN-based edge caching policies with Software Defined Networking (SDN), as well as on the opportunities to leverage edge caching powered by AI techniques as a prominent sixth-generation (6G) enabler. The Chapter “Needs Analysis, Protection, and Regulation of the Rights of Individuals and Communities for Urban and Residential Comfort in Cognitive Buildings,” by Giovanna Iacovone, Gabriella Cerchiara, Lucia Cappiello, Giordana Strazza, Emanuela Sangiorgio, and Danila D’Eliso, presents a research work that has seen the contribution of jurists, geographers, engineers, and anthropologists who have jointly used their competencies to support the design of CBs. The aim is to make exportable the research results related to the knowledge of the regulatory framework on sustainable living and the efficient use of energy in living spaces. The chapter focuses on the relationship between people, living spaces, wellbeing, and technology. All of this allows to identify and analyze customers’ needs, translating them into a set of variables and parameters essential to the ex-ante design and ex-post evaluation of a CB. Finally, the chapter introduces a supranational (international) and national normative analysis of innovative technological models for the improvement of comfort. The Chapter “Real Case Studies Towards IoT-Based Cognitive Environments,” by Antonio Francesco Gentile, focuses on several approaches used in some Italian research projects with the aim of ensuring effective communications in the context of Cognitive IoT Environments, in general, and CBs in particular. The approaches above have been applied in some real case studies. These case studies overcome the challenges related to the heterogeneity of communication protocols, scalability

Preface

vii

(both geographic and in terms of connected nodes), security, and robustness. In particular, the considered scenarios comprehend the realization of some cognitive IoT infrastructures related to smart streets, smart buildings, and smart offices. The Chapter “Audio Analysis for Enhancing Security in Cognitive Environments Through AI on the Edge,” by Marco Antonio Mauro, aims to show a security system for CBs based on microphones. In particular, the chapter analyzes the information content of raw recording data obtained from microphones and their processability into audio events, with detailed, actionable human-readable information. The chapter also proposes a completely edge-based processing approach with special safeguards for data filtering and information control. All of this is to obviate any privacy concerns that might arise. Finally, the chapter introduces a complete implementation of the proposed system applied in two case studies, namely, a residential apartment and a free access room. The Chapter “Aggregate Programming for Customized Building Management and Users Preference Implementation,” by Giorgio Audrito, Ferruccio Damiani, Stefano Rinaldi, Lavinia Chiara Tagliabue, Lorenzo Testa, and Gianluca Torta, first of all introduces the eLUX Lab. The eLUX lab, at the Smart Campus of the University of Brescia (Italy), is the first Italian CB where educational spaces are monitored, and dashboards promote users’ awareness. There, a fixed IoT network allows gathering data to perform analytics for prompt fault detection and fine-tuning of the environmental conditions and, possibly, operating energy management. Then, the chapter shows how the eLUX Lab can be enhanced to support the aggregate programming paradigm for offering resilient distributed services (exploiting a real-time location system) that run on wearable devices without relying on the connection to a central server. The Chapter “IoT Control Based Solar Shadings: Advanced Operating Strategy to Optimize Energy Savings and Visual Comfort,” by Francesco Nicoletti, Cristina Carpino, and Natale Arcuri, involves the development of an advanced solar shading control algorithm with the aim of reducing energy requirements and improving visual comfort. The proposed control system is based on IoT devices that sense the environment and interact with it following real-time intelligence that allows adaptation to changing situations. The designed control strategy is aimed at adjusting the tilt angle of movable Venetian blinds to take the greatest advantage of natural light in the presence of occupants, avoiding glare, and ensuring energy savings. The study integrates the use of an artificial light management system, which is necessary to reach the setpoint illuminance. The results show that the control system can halve cooling energy demand and it can reduce the electricity used for artificial lighting. The Chapter “Room Occupancy Prediction Leveraging LSTM: An Approach for Cognitive and Self-Adapting Buildings,” by Simone Colace, Sara Laurita, Giandomenico Spezzano, and Andrea Vinci, aims to develop a data-driven model for occupancy prediction using machine learning techniques based on a combination of temperature, humidity, CO2 concentration, light, and motion sensors. The approach is designed and realized in a real scenario by leveraging the COGITO platform. The experimental results show that the proposed Long Short-Term Memory neural

viii

Preface

network is well suited to account for occupancy detection at the current state and occupancy prediction at the future state with good detection rates either in a simulated scenario, using a dataset known in the literature, or in a real one. These outcomes indicate the ability of the proposed model to monitor the occupancy information of spaces both in a real-time and in a short-term way. The Chapter “Edge Intelligence Against COVID-19: A Smart University Campus Case Study,” by Claudio Savaglio, Giandomenico Spezzano, Giancarlo Fortino, Mario Alejandro Paguay Alvarado, Fabio Capparelli, Gianmarco Marcello, Luigi Rachiele, Francesco Raco, and Samantha Genoveva Sanchez Basantes,” presents an example of a CB environment denominated Smart Cafeteria. It is a highly sensorand-actuators-augmented environment, aimed at monitoring the users’ presence in order to detect those dangerous situations for COVID-19 virus spreading. Driven by the development guidelines of the ACOSO-METH methodology, the Smart Cafeteria exploits a set of heterogeneous edge devices, IoT technologies, cloud services, and neural networks for acquiring, gathering, analyzing, and predicting temperature and humidity values, since the latest studies have recently suggested that cold, dry, unventilated air contributes to viruses transmission, especially in the winter season. The Smart Cafeteria has been designed within the campus of the University of Calabria, in Italy. The Chapter “Structural Health Monitoring in Cognitive Buildings,” by Raffaele Zinno, Giuseppe Guido, Francesca Salvo, Serena Artese, Manuela De Ruggiero, Antonio Francesco Gentile and Alessandro Vitale, tries to monitor the health status of real buildings through the joint use of IoT, structural health monitoring, and artificial intelligence techniques. In such a way, a building becomes a CB able to autonomously furnish information about its health. The use of the above techniques allows for identifying damages and anomalies in CB structures’ behavior and implementing early warning systems. In this case, the use of accelerometric sensors is key for identifying the representative parameters of the building structural behavior. All of this helps determine precious information comprehending, for example, damage location, damage assessment, and damage prediction. The chapter also presents a case study to highlight how the proposed approach applies to real cases. The Chapter “Development of Indoor Smart Environments Leveraging the Internet of Things and Artificial Intelligence: A Case Study,” by Michele De Buono, Nicola Gullo, Giandomenico Spezzano, Andrea Vennera, and Andrea Vinci, focuses on the development of an IoT application based on the COGITO platform for the intelligent management of meeting rooms in the context of CBs. By processing data collected from a set of IoT devices, cameras, and cognitive microphones, the developed prototype is able to autonomously monitor and make decisions about aspects that continuously affect environmental comfort, event management, and assessment of compliance with anti-contagious regulations. After reviewing the state of the art, the chapter describes the developed application. It highlights the features that turn a meeting room into a cognitive environment that is highly comfortable for users and effective in managing events such as meetings or lectures.

Preface

ix

The Chapter “Human-Centered Reinforcement Learning for Lighting and Blind Control in Cognitive Buildings,” by Emilio Greco and Giandomenico Spezzano, presents a human-centered reinforcement learning controller for visual comfort management in CBs. A satisfaction-based visual comfort model is coupled with a reinforcement learning (RL) algorithm to adapt the boundaries of the comfort zone in the presence of a group of occupants. Compared with more traditional control techniques, the proposal is personalized and human-centric since users’ perceptions of the surrounding environments are explicitly exploited in the RL feedback loop. A case study of an office room and its performance is also presented. The Chapter “Intelligent Load Scheduling in Cognitive Buildings: A Use Case,” by Franco Cicirelli, Vincenzo D’Agostino, Antonio Francesco Gentile, Emilio Greco, Antonio Guerrieri, Luigi Rizzo, and Giuseppe Scopelliti, proposes a case study in which a load scheduling for CBs of in-home appliances is used. In the last few years, in fact, many appliances are spreading into our houses and are daily used. Such equipment significantly improves the quality of life of people, but their use, when not well regulated, can bring a needless increment in the electricity bill. Such an increment could be mitigated by using cognitive scheduling policies that guide the users toward correct exploitation of electric devices so optimizing their use while, at the same time, saving energy, money, and time. Such a case study, implemented in the context of the COGITO project, is devoted to cognitively scheduling electric loads in houses according to user preferences, self-produced energy, and variable energy costs. The Chapter “Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings,” by Luigi Scarcello and Carlo Mastroianni, exploits cognitive technologies, based on Deep Reinforcement Learning (DRL), for automatically learning how to control the HVAC system in a CB office room. The goal is to develop a cyber-controller able to minimize both the perceived thermal discomfort and the needed energy. The learning process is driven through the definition of a cumulative reward, which includes and combines two reward components that consider, respectively, user comfort and energy consumption. Moreover, a human reward, inferred by the frequency with which a user interacts with an HVAC system, helps the DRL controller to learn users’ requirements and readily adapt to them. Simulation experiments are performed to assess the impact that the two components of the reward have on the behavior of the DRL controller and on the learning process. Rende, Cosenza, Italy

Franco Cicirelli Antonio Guerrieri Andrea Vinci Giandomenico Spezzano

Contents

1

COGITO: A Platform for Developing Cognitive Environments . . . . . . Marica Amadeo, Franco Cicirelli, Antonio Guerrieri, Giuseppe Ruggeri, Giandomenico Spezzano, and Andrea Vinci

2

Cloud, Fog, and Edge Computing for IoT-Enabled Cognitive Buildings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Erdal Özdo˘gan

3

4

Edge Caching in IoT Smart Environments: Benefits, Challenges, and Research Perspectives Toward 6G . . . . . . . . . . . . . . . . . . . . Marica Amadeo, Claudia Campolo, Giuseppe Ruggeri, and Antonella Molinaro Needs Analysis, Protection, and Regulation of the Rights of Individuals and Communities for Urban and Residential Comfort in Cognitive Buildings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Giovanna Iacovone, Gabriella Cerchiara, Lucia Cappiello, Giordana Strazza, Emanuela Sangiorgio, and Danila D’Eliso

1

23

53

75

5

Real Case Studies Toward IoT-Based Cognitive Environments . . . . . . . 103 Antonio Francesco Gentile

6

Audio Analysis for Enhancing Security in Cognitive Environments Through AI on the Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Marco Antonio Mauro

7

Aggregate Programming for Customized Building Management and Users Preference Implementation . . . . . . . . . . . . . . . . . . . 147 Giorgio Audrito, Ferruccio Damiani, Stefano Rinaldi, Lavinia Chiara Tagliabue, Lorenzo Testa, and Gianluca Torta

8

IoT Control-Based Solar Shadings: Advanced Operating Strategy to Optimize Energy Savings and Visual Comfort . . . . . . . . . . . . 173 Francesco Nicoletti, Cristina Carpino, and Natale Arcuri xi

xii

Contents

9

Room Occupancy Prediction Leveraging LSTM: An Approach for Cognitive and Self-Adapting Buildings . . . . . . . . . . . . . . . . . . 197 Simone Colace, Sara Laurita, Giandomenico Spezzano, and Andrea Vinci

10

Edge Intelligence Against COVID-19: A Smart University Campus Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 Claudio Savaglio, Giandomenico Spezzano, Giancarlo Fortino, Mario Alejandro Paguay Alvarado, Fabio Capparelli, Gianmarco Marcello, Luigi Rachiele, Francesco Raco, and Samantha Genoveva Sanchez Basantes

11

Structural Health Monitoring in Cognitive Buildings . . . . . . . . . . . . . . . . . . 245 Raffaele Zinno, Giuseppe Guido, Francesca Salvo, Serena Artese, Manuela De Ruggiero, Alessandro Vitale, and Antonio Francesco Gentile

12

Development of Indoor Smart Environments Leveraging the Internet of Things and Artificial Intelligence: A Case Study . . . . . . . . . . 263 Michele De Buono, Nicola Gullo, Giandomenico Spezzano, Andrea Vennera, and Andrea Vinci

13

Human-Centered Reinforcement Learning for Lighting and Blind Control in Cognitive Buildings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Emilio Greco and Giandomenico Spezzano

14

Intelligent Load Scheduling in Cognitive Buildings: A Use Case . . . . . 305 Franco Cicirelli, Vincenzo D’Agostino, Antonio Francesco Gentile, Emilio Greco, Antonio Guerrieri, Luigi Rizzo, and Giuseppe Scopelliti

15

Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 Luigi Scarcello and Carlo Mastroianni

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

Chapter 1

COGITO: A Platform for Developing Cognitive Environments Marica Amadeo, Franco Cicirelli , Antonio Guerrieri , Giuseppe Ruggeri, Giandomenico Spezzano , and Andrea Vinci

1.1 Introduction The buildings of the future [16] are complex systems that aim to improve the quality of life of their inhabitants while increasing the safety, protection, and efficiency of the building itself. A very important task is to ensure the environmental comfort (visual, thermal, etc.) to the inhabitants while guaranteeing, at the same time, the optimization of consumption in terms of energy. Moreover, it is important to preserve the functionalities of the systems and the equipment in the building. All the issues above are made even more complex considering that each inhabitant has his/her preferences, lifestyles, and needs that can dynamically change over time, e.g., according to the activities that are carried out at a given moment. As a consequence, a building needs to possess self-management, self-learning, and selfadaptation abilities. In other words, the new-generation buildings must possess what are defined as cognitive abilities [3]. The design and implementation of such cognitive environments (CEs) is a demanding task as it requires transversal technological and methodological skills. In addition, such CEs, which are inherently heterogeneous, must be pervasive and non-invasive. The COGITO platform [4], developed in the context of the

M. Amadeo · G. Ruggeri University Mediterranea of Reggio Calabria, Reggio Calabria, Italy e-mail: [email protected]; [email protected] F. Cicirelli () · A. Guerrieri () · G. Spezzano · A. Vinci ICAR-CNR, Rende, Cosenza, Italy e-mail: [email protected]; [email protected]; [email protected]; [email protected]

© The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_1

1

2

M. Amadeo et al.

COGITO1 project, has the objective of supporting the development of CEs. The platform, developed by leveraging the agent computing [13], provides ready-to-use components and useful abstractions that a software engineer can profitably exploit when designing and implementing intelligent and cognitive systems. Besides the agent metaphor [21], further enabling technologies in the COGITO platform are the edge/cloud computing [2, 9, 17, 23], machine learning [14], and the Internet of Things (IoT) [1, 22]. The edge computing paradigm has the aim to push the computation on acquired data away from the core of data centers to the outer edges of a network, close to the data sources. Side benefits of such computing paradigm include (i) a faster reactivity to events which can be managed where they occur; (ii) a better exploitation of communication bandwidth, as data are locally processed and only the aggregated required information is propagated across the system; (iii) an increase in reliability and scalability, since the paradigm fosters the use of distributed algorithms; and (iv) more natural preservation of privacy as data are elaborated locally. Together with the edge, COGITO takes also all the advantages of the cloud which is instead used for executing demanding tasks. By summarizing, COGITO is deployed on networked computing nodes spread over a CE (e.g., Raspberry Pi nodes) and in the cloud. The platform is able to manage physical IoT devices (i.e., sensors, actuators, or even complex objects) and hide both hardware and protocol heterogeneity. All the COGITO computing nodes are enabled to learn from the environment and adapt to it through the use of machine learning modules purposely designed and developed to speed up the realization of CEs. This chapter is organized as follows. In Sect. 1.2, after an overview of the COGITO platform, the chapter will analyze how an application can be implemented on top of the platform itself. Subsequently, the focus will be on the development of case studies realized within the ICAR-CNR headquarter located at Rende (Italy). More in particular, in Sect. 1.3, will be discussed the deployment of the equipment (e.g., sensors, actuator, and computing edge nodes) in the building. After that, in Sects. 1.4 and 1.5 will be shown, respectively, some significant services and applications realized by exploiting the equipment previously described. The chapter will end with some conclusions and future work.

1.2 The COGITO Platform The COGITO platform aims at developing CEs for the management and control of resources, spaces, infrastructures, and technological equipment in a building. The goal is that of offering cognitive services to the occupants of the buildings and to

1 COGITO project—A COGnItive dynamic sysTem to allOw buildings to learn and adapt—https://

www.icar.cnr.it/en/progetti/cogito-sistema-dinamico-e-cognitivo-per-consentire-agli-edifici-diapprendere-ed-adattarsi/.

1 COGITO: A Platform for Developing Cognitive Environments

3

the building itself. COGITO leverages abstractions, methodological approaches, and a middleware infrastructure that are able to reduce both design and implementation efforts in the development of CEs. In order to implement such CEs, it is necessary to create an ecosystem of well-weaved services and people. In this scenario, the emergent behavior deriving from the interactions among services and people has to be carefully considered. Safety, comfort, and energy optimization are among the main application fields in which COGITO wants to operate. In the following, first, a description of the platform is provided; subsequently, the steps required to set and execute a COGITO application are described.

1.2.1 An Overview of the Platform COGITO is based on a modular layered architecture (see Fig. 1.1) that allows the exploitation of heterogeneous distributed resources in a cloud/edge context. The platform is developed using Java-based technologies. All the platform modules highlighted in Fig. 1.1 are explained in the following. • Virtual Object (VO) Container—VOs are an effective tool for managing device’s heterogeneity and for fostering maintenance of the hardware and equipment. They provide transparent and common access to the physical devices by the exploitation of a well-established and common interface. The goal is to decouple, from a sensing/actuation point of view, the offered functionalities from the equipment offering them. Through VOs, it is possible to directly connect to a device without taking care of proprietary drivers and without dealing with fine-grained technological issues. The VOs are managed by the Virtual Object Container, which permits the dynamic deployment of new VOs and exposes them to the Multi-Agent Container.

Cloud Load Scheduling

Evacuation



Application Agents

Thermal Comfort

… Predictive Maintenance

System Agents

Multi- Agent Container Edge

Virtual Object Container VO

VO

Resource Management

Fig. 1.1 The architecture of COGITO

Learning

Control

Prediction Simulation Analytics

VO VO

Data Management

VO

Region

Mobility Management

Cognitive API

Reasoning

Users

4

M. Amadeo et al.

• Multi-Agent Container—Agents are autonomous entities running in the MultiAgent Container. An agent can use all the functionalities exposed by the VOs hosted in the same computing node in which the container is in running. The container offers services for supporting agent life cycle and allowing the dynamic creation of agents at runtime. Agents communicate through asynchronous message exchange. Messages can be scheduled at a given time or instantaneous. The COGITO platform provides acquaintance messages which are used for establishing direct acquaintance relationships among agents. A dynamic yellow-pages service is also implemented to establish dynamic acquaintance relationships among agents. • Cognitive API—For the implementation of cognitive behaviors, an agent must be able to use heterogeneous algorithms, libraries, and development environments that support real-time/off-line analytics, machine learning algorithms, simulation, and more. The Cognitive API module provides interaction mechanisms between heterogeneous software components by taking also into account specific needs in the cognitive entities’ life cycle. For instance, the Cognitive APIs take into account that, in the case in which algorithms are used for a training phase, such training can take place on a given computing node (e.g., in the cloud, where higher computational resources are available), while its execution can take place on a different node (e.g., in the edge, near to the data sources). • Region—The Regions arise from the need to have a layer of abstraction that facilitates the execution of recurring processing of the data produced in streaming by the sensor nodes connected to the platform. This layer also makes it possible to ease communications with the actuation nodes and the agents distributed in a CE. Some primitives that allow data aggregation (e.g., for the calculation of maximum, mean, and variance) and clustering are made available. Group communications are also admitted that do not require knowing the identity and location of the devices with which these communications are to be established. • Resource Management—In a multifaceted and dynamic context such as the one in which COGITO operates, it is extremely important to accurately manage the place of execution of a given task. In fact, it is necessary to avoid that a computation, perhaps onerous, is performed on a computation node with limited resources. At the same time, it is necessary to avoid maintaining excessively loaded nodes while others continuously unload, also for energy-saving reasons. The Resource Management module has the role of transparently establishing, with respect to the running application, the appropriate computing node where a given computation has to be performed. • Data Management—The Data Management module provides abstractions for managing the persistence of data by transparently deciding the location where the data has to be kept. In an edge context, this means appropriately choosing the set of computing nodes where the data both collected by sensors and produced by the application itself has to be stored. The set of these nodes must be chosen considering the computing resources available on the various nodes (in terms, e.g., of the amount and type of storage as well as the computing power) and the

1 COGITO: A Platform for Developing Cognitive Environments

5

distribution of agents/features that must access the data. This module needs to work in agreement with Resource Management to facilitate and make efficiently the access to data. • Mobility Management—The Mobility Management module provides interfaces for managing and solving problems affecting the naming and addressing policies of mobile devices. Moreover, Fig. 1.1 also highlights (on the left side) how all the components explained so far, depending on the application needs, can reside on nodes at different levels in the network hierarchy.

1.2.2 Developing an Application Over the COGITO Platform In order to develop an application using COGITO, it is necessary to undertake the following steps: • Preparing a network infrastructure, even hierarchical, which allows communication between the various involved entities. These entities can be run both on edge and cloud nodes; • Preparing and deploying the sensors and actuators needed for the specific applications; • Preparing and deploying the various computing nodes on which the COGITO platform will be installed along with the needed agents; • Developing the Virtual Objects that abstract the sensors and actuators already installed so as to make them usable by all the agents; • Developing agents that (i) mediate, using Virtual Objects, interactions with installed hardware components; (ii) interact with external third-party services; and (iii) implement the business logic of the specific application and are able to interact with each other, within the developed CE. As an example, Fig. 1.2 summarizes the steps for the development of a simple scenario in which data are collected from temperature sensors scattered in all the rooms of a building (i.e., a CE) by agents and stored in a database (DB) placed in the cloud. Here, three layers are highlighted, namely, the cloud, the edge, and the devices. The devices layer is composed of several temperature sensors sending the data produced to the edge. The edge layer contains the Virtual Objects, one for each sensor, that directly connect the COGITO platform with the IoT devices. Moreover, this layer hosts the Room Agents gathering and elaborating the temperature data. Following our scenario, such agents communicate with other agents deployed in the cloud. The cloud layer contains a Persistence Agent and a Building Agent that transparently store data and make cognitive elaborations by using, respectively, the Data Management module and the Cognitive APIs offered by COGITO and introduced above.

6

M. Amadeo et al.

Fig. 1.2 A simple deployment scenario of an application in COGITO

1.3 Equipment Deployment Many applications built on top of the COGITO platform are hosted in the ICARCNR building in Rende (Italy). In order to realize such applications, several sensors, actuators, and computing nodes have been deployed in the building. In Fig. 1.3, it is represented the floorplan of one of the floors of the ICAR-CNR with the sensors that have been scattered in all the rooms. In particular, this figure shows the deployment of the temperature, humidity, gas, carbon monoxide (CO), and smoke sensors on the ground floor. It’s worth noting that, in each room, the CO and smoke sensors are installed on the ceiling, while the temperature and humidity sensors are at man height. Besides this basic deployment of sensors for each room, in Figs. 1.4 and 1.5 are shown the pictures of a particular office in which a more complete set of sensors/actuators has been deployed. In particular, the following devices are highlighted: • A smoke sensor, which detects if there is smoke; • A CO sensor, which detects if there is a high concentration of CO; • A controllable ceiling light array, which is used to modulate the intensity of the light in the office; • A smart curtain, which is used to regulate the incoming light in the environment. Such curtain is controlled through a connected relay actuator; • A smart thermostat, useful to manage the temperature in the room according to several policies; • Two switch contact sensors, which can detect if and when the window or the door are opened/closed; • Two presence and light sensors, which gather data about movements in the room together with the light intensity;

Fig. 1.3 Floorplan of the ground floor at ICAR-CNR visualizing the basic deployment of sensors installed in all the rooms

1 COGITO: A Platform for Developing Cognitive Environments 7

8

M. Amadeo et al.

Fig. 1.4 Office with a wide set of sensors/actuators (west side)

Fig. 1.5 Office with a wide set of sensors/actuators (east side)

• A tilt sensor, useful to understand if someone sits and moves at the chair; • A temperature and humidity sensor, which senses the temperature and the relative humidity; • A gas sensor, which samples gas concentration; • A COGITO edge node, where some COGITO agents are deployed that gather all the data from the sensors in the room and make some elaborations on them.

1 COGITO: A Platform for Developing Cognitive Environments

9

Fig. 1.6 The sensors, actuators, and edge nodes involved in the case studied

Figure 1.6 shows most of the sensors/actuators listed above and installed in the ICAR-CNR building. Moreover, in such a figure, one of the COGITO edge nodes used is highlighted. It’s worth noting that all the sensors in the figure implement the Zigbee standard [7] and are produced by several different vendors; the relay is WiFi and interfaced through the MQTT protocol [18]; the ceiling light array for

10

M. Amadeo et al.

Fig. 1.7 The DALI to MQTT converter used in the ICAR-CNR building

communication purposes uses the DALI protocol [12], and, in order to communicate with it, a DALI-MQTT converter has been installed in the ICAR-CNR building (see Fig. 1.7). Finally, the COGITO edge nodes deployed in the building are all Raspberry Pi 4.2

1.4 Cognitive Applications for Indoor Environments This section describes some case studies realized on top of the COGITO platform that are devoted to offering cognitive services for the management and optimization of indoor environments. More in detail, the services are devoted to (i) ensure an adequate thermal comfort level in the office room while taking into account energysaving constraints, (ii) forecast indoor occupancy of people, (iii) manage indoor air quality, and (iv) accommodate and manage a (possibly) large number of people and satisfy the needs arising when organizing and running an event in a meeting room.

1.4.1 Thermal Comfort Maintaining adequate thermal comfort inside a building is a very complex task because it concerns the maintenance/achievement, among others, of temperature and humidity levels that are not predefined, as they depend on both subjective and objective parameters. In the context of the COGITO project, a system for achieving and maintaining thermal comfort was created [5, 6]. Such a system takes into account both the preferences of the inhabitants of a given CE and the energy consumption. The system uses a Deep Reinforcement Learning algorithm

2 Raspberry

Pi 4 website. https://www.raspberrypi.com/products/raspberry-pi-4-model-b/.

1 COGITO: A Platform for Developing Cognitive Environments

11

Thermostat

Three-way valve

Temperature and Humidity

Arduino + Flow and Temperature Sensors

Fig. 1.8 The equipment involved in the thermal comfort management

[15] to try to understand the degree of user satisfaction and balance it with objective environmental and energy consumption parameters. For this application, the deployed sensors/actuators are shown in Fig. 1.8. In particular, the involved equipment, managed through purposely developed COGITO agents, is: • A remotely controllable thermostat augmented with cognitive behaviors provided by a COGITO agent (installed on an edge node); • A three-way valve that manages the flow of the hot/cold water that reaches the fan coil of the heating, ventilation, and air conditioning (HVAC) system involved in the application; • An Arduino controlling a flow sensor and two temperature probes. This device measures the fan coil water flow and in/out water temperature; • A temperature and humidity sensor for gathering environmental conditions. The thermostat is also used to gather the interaction pattern that a user in the room has with the thermostat itself. This pattern is provided to the cognitive agent which uses such information to learn the comfort level of the user and subsequently to act a suitable control policy over the HVAC.

1.4.2 Occupancy Forecast This section overviews the activities carried out in order to create a solution capable of predicting the occupancy of a room inside a building starting from the measurements made by certain environmental sensors placed in some strategic points of the room itself. The prototype of the realized predictive system was deployed in an office room at ICAR-CNR and involved the use of a machine learning model developed on top of neural networks [11]. It was realized to work on the edge by using the COGITO platform. The application, using non-invasive environmental

12

M. Amadeo et al.

Fig. 1.9 Dashboard of the presence forecasting service

sensors, allows to constantly monitor the presence of people inside a CE in real-time and predict their presence in the near future. This information is a key to achieving specific goals such as: • Energy efficiency, to reduce energy waste from devices such as lighting systems or HVAC systems; • Well-being and safety, to ensure the healthiness of the environments; • Comfort by implementing automated procedures that allow the building to intelligently adapt to the needs of the occupants. For forecasting purposes, the cognitive algorithm implemented exploits environmental parameters tied to (i) the real presence of people in the office, (ii) the illuminance level, (iii) the relative humidity and temperature, and (iv) the carbon dioxide (CO2 ) gas concentration. The realized system relies on the two following agents: • A UserAgent that interacts with the final user of the system, sends all prediction requests to a cognitive OccupancyAgent, and shows the forecast received; • A OccupancyAgent agent that receives the requests by the UserAgent, calculates the forecasting, and sends it back to the UserAgent. Figure 1.9 shows the dashboard developed for the implemented system. In particular, at the top of the figure, the real presence together with the forecasted one is drawn. At the bottom, the values from the temperature, humidity, illuminance, and CO2 sensors are portrayed.

1 COGITO: A Platform for Developing Cognitive Environments

13

1.4.3 Air Quality The purpose of this application is the continuous control of the indoor air quality [19]. Indoor air quality depends on various factors, such as the concentration in the air of CO2 , CO, particulate matter (PM 2.5), formaldehyde, and volatile organic compound (VOC). For each of them, there are different tolerability thresholds. The current application is aimed at maintaining the pollutants below thresholds. To do this, a fan was installed to favor the exchange of air with the outdoor environment. The fan is activated/deactivated following the thresholds specified in Table 1.1. The used fan is shown in Fig. 1.10 together with all the sensors used to collect data on pollutants. In particular, Fig. 1.10b shows an implementation of CO and CO2 sensors built on top of the Libelium Waspmote architecture;3 Fig. 1.10c is a CO2 sensor built on top of the Arduino Uno WiFi Rev2 board with a Winsen MH-Z19B CO2 sensor. The device was built by installing a prototyping board, called ProtoShield, on the Arduino controller; Fig. 1.10d is a multi-sensor node (noise, light, formaldehyde, gas, particulate) also built on top of the Arduino Uno WiFi Rev2 board. The node is equipped with a ProtoShield and exposes the KY-037 sound detection, MS1100 VOC, ZE08-CH2O formaldehyde, ambient light BH1750, and Honeywell HPM particulate sensors. All the mentioned sensors have been integrated into the COGITO platform, and the related Virtual Objects have been created. Subsequently, some low-level agents were implemented with the purpose of making the data from the sensors available to the high-level agents having the task of managing the fan according to the thresholds (see Table 1.1). It’s worth noting that the negative effects on humans depend not only on the concentration of pollutants in the environment but also on the exposure time, so there is no precise threshold for which these pollutants become dangerous. Table 1.1 Tolerability thresholds Pollutant Formaldehyde CO VOC PM 2.5 CO2

3 Libelium

Activation threshold >0.1 ppm >7 mg/m3 >1 mg/m3 >20 μg/m3 >900 ppm

Deactivation threshold 300 W/m2 optimal Slat angle is β + 90◦ ; when G < 300 W/m2 blinds must be inclined to allow diffuse radiation to penetrate, regardless of the direction of the sun’s rays. To identify the latter condition, Fig. 8.3 shows the solar power transmitted as a function of Slat obtained with G values lower and higher than 300 W/m2 . Two maxima are observed: in correspondence of Slat equal to approximately 100◦ (diffuse radiation is favored and beam radiation is blocked) and at Slat equal to about 170◦ (diffuse radiation is blocked and beam radiation is favored). When a high incident irradiance is detected, the greatest transmitted power is obtained in the second peak. When the irradiance is not high, the maximum is provided by the first peak. In this latter case, in fact, to make the slats parallel to the sun’s rays, they must assume an almost closed position. Therefore, in order to let in a little amount of direct radiation, the entry of diffused solar radiation is prevented. The Slat angle in which the first peak is observed is not always the same; it depends on the solar altitude (Fig. 8.4). It is given by the following correlation: ◦

Slat = 120 − 0.66α

(8.3)

If the temperature is between 21 and 25 ◦ C, there is no need to shield nor to introduce solar power. A standard position is used for the slats, fixed at 80◦ . In the case of a temperature above the setpoint value of 25 ◦ C, solar gain must be limited. The shields must be completely closed as there are no occupants.

180

F. Nicoletti et al.

Fig. 8.3 Global irradiance transmitted for different Slat angle with the sun visible and β > 65◦

Fig. 8.4 Slat angle which gives maximum transmitted irradiance when β > 65◦ and G < 300 W/m2

8.2.2.2

Presence of Occupants

In case people are inside the room, the operation of the blind is again dependent on the temperature detected. When the internal temperature of the room is below 21 ◦ C, operation is in heating mode. It is necessary to distinguish two cases:

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

181

Fig. 8.5 Limit inclination for blocking direct radiation

• The window is not exposed to direct solar radiation: the optimal configuration is the one that lets in the maximum diffuse solar radiation, and it is obtained with a Slat value of 110◦ . • The sun is visible and, therefore, direct radiation could cause visual discomfort. The optimal configuration is the one that blocks the sun’s rays while keeping the slats as open as possible. Figure 8.5 shows the arrangement which guarantees this condition: the vertex A of the lower lamella, the vertex B of the upper lamella, and the point-like representation of the sun must be on the same line. With reference to Fig. 8.5, it results:

tan β =

yB d − L cos (Slat) = xB L sin (Slat)

(8.4)

After some mathematical steps, Slat is: ⎛ Slat = 2 tan−1 ⎝

tan β +

 ⎞  2 tan2 β − Ld + 1 ⎠ 1 + Ld

(8.5)

In the case of temperatures between 21 and 25 ◦ C, Slat is assumed equal to 80◦ if the external wall is not irradiated by the solar beams; in case of sun exposure, the optimal angle is determined by Eq. (8.5) to avoid glare. For temperatures above the setpoint value of 25 ◦ C, it is necessary to shield the solar radiation, but not completely, ensuring a minimum of natural illuminance, obtained with Slat equal to 45◦ .

182

F. Nicoletti et al.

8.3 Analysis of Results 8.3.1 Simulation Environment The smart control strategy is simulated for an example case in the EnergyPlus environment. This software can accurately simulate the energy performance of buildings, as well as to adequately integrate the shielding devices [14]. The calculation of the scattered radiation considers the anisotropic distribution of the sky’s radiance. The sky model used is “CIE sunny clear day,” with additional direct illumination from the sun. Hourly climate data for a whole year is taken from Meteonorm [24] for the city of Cosenza (Southern Italy). The building is a room of 25 m2 with a window on each vertical surface (Fig. 8.6). The windows represent 15% of the total walls area and are made up of double glazing (4-12-4) with a thermal transmittance of 1.91 W/m2 K. Venetian blinds are positioned in each window. The geometric dimensions of the slats are as follows: depth L = 25 mm; distance between adjacent slats d = 18.8 mm. Thermoregulation of the internal air is managed by a fan coil system, always on, set at 20 ◦ C for winter days and 26 ◦ C for summer days. Two types of artificial lighting systems will be analyzed: dimmable LEDs and fluorescent lamps. Both systems have been sized to ensure 500 lux in all points of the room in the absence of daylight.

Fig. 8.6 Test building

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

183

8.3.2 Evaluation of Thermal Gains on an Hourly Basis 8.3.2.1

LED System

This paragraph shows, for a winter day and a summer day, the heat gains deriving from solar radiation and artificial lighting. The thermal balance of the room, in fact, is also influenced also by the artificial lights. When lamps are turned on, they generate heat which is introduced into the environment. The results are averaged on an hourly basis, even if the simulation timestep is set at 1 minute.

Winter Operation The results for January 4 are shown as an example. This day represents a typical winter day. In the first case analyzed, the inhabitants are considered to be always present. Under these conditions, the temperature of the internal environment is kept by the air conditioning system at 20 ◦ C. Figure 8.7 shows the thermal contributions to the environment from solar radiation and internal lights, and the trend of natural illuminance (solar only) on the central point of the room, measured on a work surface placed 75 cm from the ground. In this condition the goal is to maximize the free thermal inputs, avoiding exposing occupants to glare. Therefore, the Venetian blinds avoid the introduction of sunlight. The thermal contribution from artificial lights is reduced to a minimum when natural lighting exceeds 500 lux. If, on the other hand, there are no occupants and visual comfort is not important, the behavior of the shields is different and is shown in Fig. 8.8. In this example,

Fig. 8.7 Thermal gains and natural lighting with mobile shields, occupants present 24 hours a day, artificial lighting with LED lamps, January

184

F. Nicoletti et al.

Fig. 8.8 Thermal gains and natural lighting with mobile shields, occupants absent between 08:00 and 14:00 artificial lighting with LED lamps, January

referring to the same day in January, the occupants are not at home in the period between 08:00 and 14:00. During this time, the blinds let in as much radiation as possible. The heat entering the windows is higher than in the previous case. When the room is not occupied, the lights are off and do not produce heat. The slats are arranged parallel to the sun’s rays, and the natural illuminance is even 6000 lux. The energy absorbed by the LEDs, and the heat they emit, is almost the same in the two cases examined. With people always present within the environment, the introduced free solar energy is 2.27 kWh throughout the whole day. In the event that, in the morning hours, there is no one at home, the daily solar energy is 3.46 kWh. Therefore, in this example, an increase of 52% is obtained.

Summer Operation In summer, the goal changes: solar gains must be minimized. Figure 8.9 shows the thermal gains and the trend of natural lighting with people always at home. The optimal angle of inclination from an energy point of view would be relative to the completely closed configuration. This type of solution, however, does not ensure a good visual comfort as it would eliminate daylight. The lamellae are then inclined at 45◦ . With this angle, the figure shows that the illuminance is higher than 500 lux for most of the day, avoiding the use of artificial lights. The daily heat input from the windows, in this case, is 3.80 kWh. The control method could be further improved by changing the 45◦ angle making it such as to never exceed the threshold of 500 lux.

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

185

Fig. 8.9 Thermal gains with mobile shields, occupants present 24 hours a day, artificial lighting with LED lamps, July

Fig. 8.10 Thermal gains with mobile shields, occupants absent between 08:00 and 14:00, artificial lighting with LED lamps, July

Figure 8.10 shows the case in which there are no occupants from 08:00 to 14:00. Completely closing the blinds in the morning hours reduces the daily solar gain to 2.07 kWh. In the example case in question, the percentage reduction is 46%.

186

F. Nicoletti et al.

Fig. 8.11 Thermal gains with mobile shields, occupants absent between 08:00 and 14:00, artificial lighting with fluorescent lamps, July

8.3.2.2

Fluorescent Lamps

Fluorescent lamps do not allow partial operation to adapt to the internal visual conditions of the environment. The system adopted for the shields will be the same as previously described. In conditions where natural lighting does not reach 500 lux on the work surface, the artificial lights turn on; if, on the other hand, there is an illuminance value higher than 500 lux, they completely turn off. As an example, Fig. 8.11 shows the thermal gains from the sun and artificial lights for the summer day, with occupants absent in the morning. The other cases analyzed for the LEDs will not be shown as they are easily deductible. It is possible to observe how the lights are completely off when the room is unoccupied and when the minimum illumination is guaranteed by sunlight. In the remaining hours, the lights are turned on at their maximum power. The solar gains are the same as in the previous cases as they depend exclusively on the operation of the Venetian blind, which is unchanged. The lighting system consumes more electricity than LEDs and, consequently, produces a greater heat input.

8.3.3 Evaluation of Thermal Gains on a Monthly Basis Based on the operating logic adopted for the activation of the shields and the lighting system, it is necessary to evaluate the results obtained also on a monthly basis to verify and estimate the economic weight of the chosen solution effectively.

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

187

Fig. 8.12 Monthly thermal gains, 24-hour occupancy schedule, LED lighting

Fig. 8.13 Monthly thermal gains, variable occupancy schedule, LED lighting

Figures 8.12, 8.13, 8.14, and 8.15 show the monthly thermal contributions with different occupancy profiles and with different types of lamps. Figures 8.12 and 8.14 show the case in which people are always present. Using LEDs, the savings in terms of electricity for artificial lighting are evident and are substantially determined by the ability of the LEDs to partialize the excitation current and, consequently, the luminous flux. The solar inputs are very similar in the two graphs, as the occupancy schedule is the same for both cases. There are, however, some differences in the spring and autumn months despite the logic of operation of the shielding adopted is the same. The differences are caused

188

F. Nicoletti et al.

Fig. 8.14 Monthly thermal gains, 24-hour occupancy schedule, fluorescent lamp lighting

Fig. 8.15 Monthly thermal gains, variable occupancy schedule, fluorescent lamp lighting

by different lighting systems, which have an influence on the heat balance of the environment and, accordingly, on the internal temperature of the room. The inclination of the slats, in fact, also depends on the temperature. The different internal temperature in the two simulations, therefore, is such as to generate different angular profiles on spring and autumn days. Solar energy introduced in March and April is higher with LEDs than with fluorescent lamps. LEDs heat the environment less than fluorescent lamps, and, consequently, in those months, the need to introduce solar heat is greater. The Venetian blind responds to this need and

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

189

Fig. 8.16 Monthly solar gain, comparison with a fixed inclination of 80◦

regulates the transmitted radiation to improve thermal comfort and reduce system consumption. Figure 8.13 shows the trends of thermal gains in the case of LED lighting with people absent between 08:00 and 14:00 every day of the year. In Fig. 8.15, the results with fluorescent lamp lighting are shown. With reference to solar gains, the comments made for 24-hour operation scenario are still valid. Comparing the thermal inputs from the artificial lighting of Figs. 8.12 and 8.13, in winter, as expected, the LEDs introduce more heat in the case in which people are always present, as they are switched on for longer time. In summer, although the occupancy profile is very different, the thermal inputs of artificial light are comparable. This means that the natural lighting is very satisfactory and the operation of the lights is optimized. This effect is less noticeable with fluorescent lamps. Figure 8.16 shows the monthly comparison of the solar gains introduced into the environment in three different conditions: • 24-hour Occupation – Movement of the Venetian blinds according to the algorithm in the case of continuous occupation for 24 hours a day (blue bars) • Variable Presence – Movement of the Venetian blinds according to the algorithm in the event of the absence of occupants between 08:00 and 14:00 (red bars) • Fixed inclination – Venetian blinds not moved, with a fixed inclination of the slats equal to 80◦ In all cases, artificial lighting is LED. The results for fluorescent lamps as artificial lighting are similar since it does not have much influence on solar contributions. The different type of lighting only slightly modifies the functioning of the blinds in the spring and autumn months.

190

F. Nicoletti et al.

In the summer months, there is a significant reduction in the energy introduced into the environment, with benefits on the cooling demand. This effect, however, causes a reduction in natural lighting; good visibility is however guaranteed by artificial lighting. In winter, the advantages are lower than in the summer case. When occupants are always present, thermal gains are approximately equal to the case in which the inclination is constant. The advantage is above all in terms of visual comfort since the phenomenon of glare is avoided. When people are not present (this happens in Variable Occupation schedule), in fact, it is possible to introduce an additional amount of solar thermal energy.

8.3.4 Evaluation of Annual Energy and Economic Savings To evaluate the actual global energy savings, comparisons are performed between the scenarios discussed in the previous paragraphs and a standard case. This latter is represented by the same building in which: • The venetian blinds are not automatically adjusted; the slats are fixed and have an angle of 80◦ . • Fluorescence lamps are used for artificial lighting and turned off when people are not at home.

8.3.4.1

Energy Savings

There are two types of energy savings: related to the reduction of energy requirements for the air conditioning system and related to the electricity saved for lighting. Table 8.1 shows that savings are almost always present, except in the case of winter air conditioning with occupants always present. In this situation, in fact, the angle taken by the shields must avoid glare, at any moment of the day, thus reducing the free solar gains. In the standard case, the solar gains are greater because the angle of blinds is fixed and, therefore, direct radiation can enter. The benefits in terms of visual comfort cause a slight increase in heating demand. In the case of “Variable Presence,” the energy savings for heating and cooling are the highest. In fact, in the hours of absence of occupants, the shields can arrange

Table 8.1 Annual energy saved, comparison with standard case

Thermal energy saved – heating Thermal energy saved – cooling Electrical energy saved – lighting

LEDs Variable Occupation 66.9 kWh 559.6 kWh 102.7 kWhe

24-hour Occupation −32.4 kWh 328.3 kWh 176.9 kWhe

Fluorescent lamps Variable 24-hour Occupation Occupation 57.4 kWh −52.8 kWh 561.9 kWh 329.4 kWh 32.2 kWhe 38.3 kWhe

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

191

Table 8.2 Percentage of energy saved annually, comparison with standard case

Thermal energy saved – heating Thermal energy saved – cooling Electrical energy saved – lighting

LEDs Variable Occupation (%) 10.0 50.3 23.3

24-hour Occupation (%) −6.1 26.0 29.0

Fluorescent lamps Variable 24-hour Occupation Occupation (%) (%) 8.6 −10.0 50.5 26.1 7.3 6.3

themselves as best as possible to maximize or minimize (depending on the season) the solar gains. The energy saved for lighting is lower than in the “24-hour Occupation” case. This happens because its use is limited to half a day. In the other half of the day (in the absence of occupants), the lights are off in all the cases examined, and there are no benefits deriving from lux control. The electrical savings for lighting are not relevant in the case of fluorescent lamps since the same system is also used in the standard case. The only difference consists in the automatic shutdown when the internal lighting is higher than 500 lux. The thermal-energy savings are almost the same as in the case of LEDs because the Venetian blinds are moved in a similar way. Table 8.2 shows the percentage savings for the different cases examined.

8.3.4.2

Economic Savings

The economic saving is evaluated by comparing each scenario with the standard case with the same occupancy schedule. The average cost of electricity is assumed to be 0.25 A C/kWh, and the air conditioning system is represented by a heat pump with an average annual COP in heating equal to 3.5 and an average annual EER in cooling equal to 3. Figure 8.17 shows that the shading control system associated with dimmable LEDs provides a total economic saving of 3 A C/m2 . The occupancy schedule has little influence on the total result. With fluorescent lamps, on the other hand, the total savings change according to the presence of the occupants; this is mainly due to the operating costs of the heat pump. For the use of the air conditioning system, a reduction of about 2.06 A C/m2 is estimated for the variable occupancy profile, regardless of the type of lighting. This result is higher than in the case in which there are always occupants (1 A C/m2 approximately) since the shields, during the absence of people, can operate in the best way. LEDs offer significant cost savings compared to fluorescent lamps. The advantage is due to the possibility of dimming the exciting current. Finally, Fig. 8.18 shows the percentage of economic savings. These data represent the economic savings compared to those sustained in the standard case

192

F. Nicoletti et al.

Fig. 8.17 Annual economic savings, comparison with the standard case “fixed blinds and fluorescent lamps.” Comparisons are made with the same occupancy

Fig. 8.18 Percentage economic savings, comparison with the standard case “fixed blinds and fluorescent lamps.” Comparisons are made with the same occupancy

with the same occupancy profile. In the case of a shading control system with LED lighting, the savings reach 30.8% with variable occupant presence. The savings are 23.4% in the hypothesis in which the occupation is continuous. In the case of fluorescent lamps, the economic savings are lower, which are approximately 23.5% with variable presence and 11.3% with continuous presence.

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

193

8.4 Conclusions In this work, a control logic for movable solar shadings was developed in order to optimize energy savings and visual comfort. The control algorithm was designed to identify the optimal tilt angle of the slats of a Venetian blind, dynamically determined according to the position of the sun, to ensure adequate exploitation of natural light, avoid glare, and contribute to energy savings for air conditioning and artificial lighting. The system is based on the use of sensors and actuators, able to detect from the environment the data needed for running the algorithm from the environment and to implement the actions necessary to achieve the desired conditions. The proposed solution is based on the use of cognitive IoT, which represents a significant evolution of building automation systems, as the decentralized architecture allows for the analysis of data at the edge of the network. Thanks to this strategy, it is possible to gain intelligence and reactivity in real time in control operations. This is achieved within a cognitive environment in which it is possible to observe a fluid exchange of data across space and time, connected with the computational layers to implement data-driven decision-making processes. The control logic can be applied for all exposures, for any latitude, and for any type of Venetian blind. The functioning of the algorithm was assessed on a test room with four windows, one for each exposure. The behavior of the control system was investigated assuming a continuous occupancy throughout the day, and regulated by a schedule, which also includes periods of non-occupancy. In addition, the effect of different types of lighting systems was examined. In particular, LED lamps and compact fluorescent lamps were considered. The control logic seems to work more effectively when a variable occupancy schedule is applied, because in the absence of occupants, the screens can operate freely, maximizing solar gains in winter and minimizing incoming radiation in summer, without considering the level of illuminance inside the room and not even the problem of possible glare phenomena. In the event that the occupation is continuous (24 hours a day), the control logic designed for moving the inclination angle of the slats still allows for significant advantages compared to a management of the shields with a fixed angle. Compared to the reference case, characterized by the use of fixed slat angle and compact fluorescent lamps, the smart system allows considerable savings of cooling energy (about 50% in the case of variable occupancy and about 26% in the case of continuous occupation). Heating savings are more limited. In the case of variable occupancy, they vary from 8.6% to 10% whether fluorescent or LED lamps are used, respectively. Instead, in the case of continuous occupation, a slight increase in heating demand is recorded, which increases by 10% in the case of fluorescent lamps and by approximately 6% in the case of LED, however, to the advantage of visual comfort. Concerning the saving of electricity for lighting, the maximum benefit is obtained in relation to the case of continuous occupation when LED lamps are used. Under these conditions, the electricity for lighting decreases by 30%. Even considering variable occupancy, the use of LEDs guarantees a saving

194

F. Nicoletti et al.

of 23.3%. If fluorescent lamps are used, electricity savings for lighting are equal to 7.3% in the case of variable occupancy and 6.3% for constant occupancy, thanks to the efficient management of the screens that allows the most appropriate utilization of daylighting. The lower energy demand is consistently translated into economic savings. The use of the control algorithm and LED lights allows a reduction of the energy expense by approximately 31% considering variable occupancy and by 23.4% in the case of constant occupancy. With fluorescent lamps, it is possible to reduce energy costs by 23.5% with variable occupancy and by 11.3% with constant occupancy. The results obtained proved the effectiveness of the smart management strategy designed. The system, based on IoT, can be integrated into cognitive buildings with the aim of providing occupants with both comfort and energy savings.

Acknowledgments The research is carried out within the project “COGITO – A COGnItive dynamic sysTem allOwing buildings to learn and adapt – PON Ricerca e Innovazione 20142020 – Italy”. The author F. Nicoletti thanks Regione Calabria (PAC CALABRIA 2014-2020 – Asse Prioritario 12, Azione B) 10.5.12) for funding his contribution for the research.

References 1. Evangelisti, L., Guattari, C., Asdrubali, F., de Lieto Vollaro, R.: An experimental investigation of the thermal performance of a building solar shading device. J. Build. Eng. 28, 101089 (2020). https://doi.org/10.1016/j.jobe.2019.101089 2. Rabani, M., Bayera Madessa, H., Nord, N.: Achieving zero-energy building performance with thermal and visual comfort enhancement through optimization of fenestration, envelope, shading device, and energy supply system. Sustain. Energy Tech. Assess. 44, 101020 (2021). https://doi.org/10.1016/j.seta.2021.101020 3. Skarning, G.C.J., Hviid, C.A., Svendsen, S.: The effect of dynamic solar shading on energy, daylighting and thermal comfort in a nearly zero-energy loft room in Rome and Copenhagen. Energy Build. 135, 302–311 (2017). https://doi.org/10.1016/j.enbuild.2016.11.053 4. Kuhn, T.E.: State of the art of advanced solar control devices for buildings. Sol. Energy. 154, 112–133 (2017). https://doi.org/10.1016/j.solener.2016.12.044 5. Tabadkani, A., Roetzel, A., Xian Li, H., Tsangrassoulis, A., Attia, S.: Analysis of the impact of automatic shading control scenarios on occupant’s comfort and energy load. Appl. Energy. 294, 116904 (2021). https://doi.org/10.1016/j.apenergy.2021.116904 6. Carletti, C., Sciurpi, F., Pierangioli, L., Asdrubali, F., Pisello, A.L., Bianchi, F., et al.: Thermal and lighting effects of an external venetian blind: Experimental analysis in a full scale test room. Build. Environ. 106, 45–56 (2016). https://doi.org/10.1016/j.buildenv.2016.06.017 7. Day, J.K., Futrell, B., Cox, R., Ruiz, S.N.: Blinded by the light: Occupant perceptions and visual comfort assessments of three dynamic daylight control systems and shading strategies. Build. Environ. 154, 107–121 (2019). https://doi.org/10.1016/j.buildenv.2019.02.037 8. Kim, J.H., Park, Y.J., Yeo, M.S., Kim, K.W.: An experimental study on the environmental performance of the automated blind in summer. Build. Environ. 44, 1517–1527 (2009). https:/ /doi.org/10.1016/j.buildenv.2008.08.006 9. Meerbeek, B.W., de Bakker, C., de Kort, Y.A.W., van Loenen, E.J., Bergman, T.: Automated blinds with light feedback to increase occupant satisfaction and energy saving. Build. Environ. 103, 70–85 (2016). https://doi.org/10.1016/j.buildenv.2016.04.002

8 IoT Control-Based Solar Shadings: Advanced Operating Strategy. . .

195

10. Hernández, F.F., Cejudo López, J.M., Peña Suárez, J.M., González Muriano, M.C., Rueda, S.C.: Effects of louvers shading devices on visual comfort and energy demand of an office building. A case of study. Energy Procedia. 140, 207–216 (2017). https://doi.org/10.1016/ j.egypro.2017.11.136 11. Yao, J.: An investigation into the impact of movable solar shades on energy, indoor thermal and visual comfort improvements. Build. Environ. 71, 24–32 (2014). https://doi.org/10.1016/ j.buildenv.2013.09.011 12. Hoffmann, S., Lee, E.S., McNeil, A., Fernandes, L., Vidanovic, D., Thanachareonkit, A.: Balancing daylight, glare, and energy-efficiency goals: An evaluation of exterior coplanar shading systems using complex fenestration modeling tools. Energy Build. 112, 279–298 (2016). https://doi.org/10.1016/j.enbuild.2015.12.009 13. de Loyola Ramos, D., Garcia, F.O.R.P.: Method application and analyses of visual and thermalenergy performance prediction in offices buildings with internal shading devices. Build. Environ. 198, 107912 (2021). https://doi.org/10.1016/j.buildenv.2021.107912 14. Al Touma, A., Ouahrani, D.: Quantifying savings in spaces energy demands and CO2 emissions by shading and lighting controls in the Arabian gulf. J. Build. Eng. 18, 429–437 (2018). https://doi.org/10.1016/j.jobe.2018.04.005 15. Choi, S.J., Lee, D.S., Jo, J.H.: Lighting and cooling energy assessment of multi-purpose control strategies for external movable shading devices by using shaded fraction. Energy Build. 150, 328–338 (2017). https://doi.org/10.1016/j.enbuild.2017.06.030 16. Hashemi, A.: Daylighting and solar shading performances of an innovative automated reflective louvre system. Energy Build. 82, 607–620 (2014). https://doi.org/10.1016/ j.enbuild.2014.07.086 17. Sadeghi, S.A., Karava, P., Konstantzos, I., Tzempelikos, A.: Occupant interactions with shading and lighting systems using different control interfaces: A pilot field study. Build. Environ. 97, 177–195 (2016). https://doi.org/10.1016/j.buildenv.2015.12.008 18. Dabbagh, M., Krarti, M.: Experimental evaluation of the performance for switchable insulated shading systems. Energy Build. 256, 111753 (2021). https://doi.org/10.1016/ j.enbuild.2021.111753 19. Luo, Z., Sun, C., Dong, Q., Qi, X.: Key control variables affecting interior visual comfort for automated louver control in open-plan office – A study using machine learning. Build. Environ. 207, 108565 (2021). https://doi.org/10.1016/j.buildenv.2021.108565 20. Katsifaraki, A., Bueno, B., Kuhn, T.E.: A daylight optimized simulation-based shading controller for venetian blinds. Build. Environ. 126, 207–220 (2017). https://doi.org/10.1016/ j.buildenv.2017.10.003 21. Chiesa, G., Di Vita, D., Ghadirzadeh, A., Muñoz Herrera, A.H., Leon Rodriguez, J.C.: A fuzzylogic IoT lighting and shading control system for smart buildings. Autom. Constr. 120, 103397 (2020). https://doi.org/10.1016/j.autcon.2020.103397 22. ASHRAE handbook, fundamentals. (1989). ASHRAE. 23. Nicoletti, F., Carpino, C., Cucumo, M.A., Arcuri, N.: The control of venetian blinds: A solution for reduction of energy consumption preserving visual comfort. Energies. 13(7), 1731 (2020). https://doi.org/10.3390/en13071731 24. Meteonorm. Meteonorm Global Meteorogical Database Version 7.1.8. (2017). Available online: https://meteonorm.com/en/. Accessed on 26 Mar 2020.

Chapter 9

Room Occupancy Prediction Leveraging LSTM: An Approach for Cognitive and Self-Adapting Buildings Simone Colace, Sara Laurita, Giandomenico Spezzano Andrea Vinci

, and

9.1 Introduction Recent studies have shown that knowing whether or not a room is occupied can bring advantages from the point of view of energy-savings and intelligentefficient management of buildings’ performance control systems [1, 6, 8, 9, 15]. Furthermore, room occupancy prediction can be exploited to control electrical appliances to reduce energy consumption, increase security, and bring convenience to the residents. For example, it can be used to turn on/off an air conditioner (a/c) or HVAC (heating, ventilation, and air conditioning) system according to occupancy forecasting or prediction of the entry/exit behavior of the residents. As an instance of such behavior, if the residents forget to turn off the a/c, and the occupancy prediction model forecasts that nobody would come back to the room for 15 min, it will turn off the a/c automatically. Instead, if it forecasts that someone will come within 10 min, it will keep the system on. This behavior leads to a reduction in electricity waste and residents’ expenditure without compromising occupants’ comfort. Furthermore, human presence in a space is of great concern in accommodating an optimal room environment (e.g., temperature, humidity, and lighting). For instance, studies by Peng et al. [16] showed occupancy predictionbased cooling control could save 7–52% of the energy used in office buildings compared to scheduled cooling operations. Foster et al. [19] used indoor positioning systems (IPS) to obtain accurate occupancy distribution information across multiple

S. Colace · S. Laurita WISH srls, Rende, Italy e-mail: [email protected]; [email protected] G. Spezzano · A. Vinci () Institute for High Performance Computing and Networking of the National Research Council of Italy (ICAR-CNR), Rende, Italy e-mail: [email protected]; [email protected] © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_9

197

198

S. Colace et al.

spaces and simulated energy-saving in building air-conditioning control systems, showing that about 22% of energy could be saved through the accurate occupancy information. This work proposes a building occupancy predictive approach based on long short-term memory (LSTM) neural networks [11] that infer the knowledge of human presence in a room by considering multivariate parameters. Related works are discussed in Sect. 9.2. Section 9.3 presents the approach and shows how it can be exploited in a real-world scenario by leveraging the edge-based COGITO platform. To assess the validity of the approach, we train the LSTM network using a dataset, available in the literature, consisting of readings of CO2, CO, temperature, humidity, relative humidity, light, and occupancy status of the room. For the prediction target variable, we concentrate on predicting the room occupancy state. Then we validate our approach by conducting experiments on real-world room usage data collected in the IoT Laboratory at ICAR-CNR for 1 month. Such results are given in Sect. 9.4, and we demonstrate that the approach is accurate in estimating occupancy in realtime and predicting room occupancy in future short-term time windows. Finally, Sect. 9.5 gives conclusions and discusses ongoing and future works.

9.2 Related Work In recent years, the study of the application of artificial intelligence to buildings has become an increasingly relevant trend. Energy-saving has become an important issue worldwide, as the building sector accounts for a large proportion of overall energy consumption [2, 14]. The status of specific environmental parameters such as indoor air quality, lighting levels, energy consumption, pollutant levels, and the number of occupants can be monitored, and decisions can be made based on these statuses to save energy without compromising occupant comfort. Occupancy forecasts can be generally based on time or non-time series. The nontime series forecast aims to provide the forecast result under certain “conditions” represented by a set of available values (also called model regressors). Conversely, time series forecasting approaches aim to predict future time series results based on current and previous conditions. Given certain predictor variables, non-time series forecasts include, for example, predicting the number of occupants in a room or predicting the room occupancy status at the current time, based on current values. Conversely, time series predictions refer to, e.g., predicting the number of occupants or the room occupancy status at a future time based on available historical data. In the scientific literature, the main occupancy studies are based on supervised learning, which is a data-driven learning technique searching for a function that approximates the dependencies between an input and its respective output, based on all input-output pairs (called training datasets) that serve as examples [7]. The predictive variables (input) and the response variables (output) are first collected to build the dataset, and, subsequently, the machine learning models are trained on this data structure.

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

199

Currently, several sensing systems are available for buildings [7], measuring CO2 concentration, temperature, relative humidity, light, sound, and motion. All these variables can be exploited to predict building occupancy. Das et al. [5] define an artificial neural network (ANN) model using the variables of temperature, light, humidity, and CO2 concentration as input and obtained a 95.6% accuracy level for occupancy detection. Razavi et al. [17] propose an approach for feature engineering and show how model performance can be significantly boosted when variables built from the others are included, such as the number of seconds from midnight derived from the detection timestamp. In some applications, it has been shown that the use of energy consumption or motion parameters can lead to more accurate predictions. In their work, Kim et al. [12] collect indoor temperature, relative humidity, CO2 concentration, illuminance, and electricity consumption in a private office and ranked the gain ratios for all parameters. The results showed that the first three improvements were related to electricity consumption or illuminance in all four seasons. Therefore, when selecting the input parameters for occupancy detection, the first choice could be electricity consumption and illuminance data. In [13], occupancy detection is estimated with electricity consumption, PIR sensors, and smart power outlets, observed over a period of 8 months. Results show that the support vector machine (SVM), K-nearest neighbor (KNN), thresholding (THR), and hidden Markov model (HMM) algorithms used for classification yield more than 80% occupancy detection accuracy. In [3], the authors propose a fusion framework for building occupancy estimation testing extreme learning machine (ELM), SVM, ANN, KNN, linear discriminant analysis (LDA), and classification and regression tree (CART). Their experiments show around 5–14% accuracy improvements using a particle filter algorithm. The work in [5], using data from light, temperature, humidity, and CO2 sensors, compares ANN with SVM, KNN, logistic regression, and Naive-Bayes, using confusion matrices to measure effectiveness. The results show that ANN performs the best in terms of accuracy. In their work [1], Candanedo et al. evaluate the occupancy prediction accuracy of many machine learning algorithms proving that the best accuracies (ranging from 95% to 99%) are obtained from training LDA, CART, and random forest (RF) models. Chen et al. [4] propose a convolutional deep bidirectional long short-term memory (CDBLSTM) approach that contains a convolutional network and a deep structure to automatically learn significant features from the sensory data without human intervention to predict a range of possible occupants, i.e., zero, low, medium, and high. The experimental results indicate the effectiveness of their proposed approach compared with the state-of-the-art methods.

200

S. Colace et al.

9.3 An Approach for Room Occupancy Prediction for Cognitive and Self-Adapting Building The methodology followed in this approach is summarized graphically in Figs. 9.1 and 9.2. In the following, the occupancy prediction and subsequently the study and development of the proposed LSTM room occupancy estimation approach are described.

9.3.1 Software Architecture This section presents the design of an application for occupancy prediction within the COGITO platform (introduced in Chap. 1) exploiting the approach presented in Fig. 9.1 Method approach—model development

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

201

Fig. 9.2 Method approach—model implementation

the paper. For the realization of such an application, the following functionalities need to be provided: • Acquisition of information from sensors in real time, both to populate the dataset used for training the predictor and for their use as input to the predictor, which, in real time, will be able to provide the platform with the calculated employment predictions. • Pre-processing of acquired information. • Historicization and persistence of the information from the sensors, for the generation of the dataset necessary for the training phase. • Training of an LSTM model, using the acquired historical data. • Real-time execution of the LSTM algorithm for prediction.

9.3.1.1

Components

The components required to implement the application are shown in Fig. 9.3. The application requires the deployment of two computing nodes and a set of sensor devices. Briefly, the sensor devices provide information to the agents [18] hosted in the first edge node, who perform both the data pre-processing task and the occupancy prediction in real time. The agents hosted in the second (edge or cloud) computing node are responsible for managing data persistence and (re)training the

202

S. Colace et al.

Fig. 9.3 Architecture of software components for occupancy estimation in an IoT-based environment. Devices are shown in orange, agents in blue, and cognitive entities in yellow

occupancy prediction model when new data are available. The prediction model is then made available to the proper agent hosted in the first computation node and exploited for occupancy prediction in real time. The listed devices are necessary to acquire the information described in the following sections. Thanks to the characteristics of the COGITO platform, sensor devices can be integrated through different protocols, such as Zigbee and Wi-Fi. Both computing nodes host the COGITO platform. Node 1 is intended to be placed at the edge and therefore co-located at the same level as the sensor devices, with available computing capacity comparable to a cheap single-board computer such as a Raspberry Pi. This node communicates directly with the physical devices by exploiting the Virtual Objects modules made available by the COGITO platform. Such modules are responsible for sensor virtualization, hiding the behavior and protocol heterogeneity of the physical devices to the agents using them. The agents hosted by Node 1 are in charge of performing information acquisition, pre-processing, and, given an LSTM network model, real-time occupancy prediction, as new data flow from the sensors. Node 2 is intended to have greater computational and memory capabilities and can be hosted either locally at the edge or remotely in the cloud. In addition to a Cogito Agent Server, it hosts a relational DBMS that stores the acquisition history over time. These are used to periodically retrain the LSTM model for occupancy prediction.

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

9.3.1.2

203

Devices and Virtual Objects

The sensor devices provide all the measures required for the application. The devices can be heterogeneous in terms of manufacturer, power supply, and communication protocol. For their integration, it is foreseen that Node 1, directly connected to them, supports both Zigbee and Wi-Fi protocols, possibly using appropriate USB dongles, such as the XSTICK ZB (XU-Z11) by DIGI International. Node 1 hosts a Virtual Object and a dedicated Mirror Agent for each sensor. The Virtual Objects are software entities that manage the specific communication protocol exploited by their associated sensor. The Mirror Agents use the Virtual Objects to provide other application agents with a consistent and common asynchronous message interface for the various measurements gathered, standardizing, for example, acquisition times and data types.

9.3.1.3

Application Agents

The information generated by the Mirror Agents is acquired by the Preprocessing Agent, which runs on Node 1. The Preprocessing Agent has the task of validating the acquired information, aggregating it into a single tuple, and sending it at a scheduled time (5 or 10 min) to both the Persistence Agent and the Predictor Agent. The Persistence Agent runs on Node 2, and it is a boundary agent, which makes available a message interface for the management of the RDBMS, present on the same node. The Persistence Agent manages the storage of received tuples in the RDBMS. The Trainer Agent manages the training and updating of an LSTM model for employment forecasting. For this purpose, it uses a specific cognitive entity, which acquires the historical data from the RDBMS, and trains a new LSTM network model. The Trainer Agent then makes this model available to the Predictor Agent. The Predictor Agent calculates real-time occupancy predictions from the tuples sent by the Preprocessor Agent and uses the model made available by the Trainer Agent through a specific cognitive entity. The predictions thus obtained are then made available to other third-party agents, to be used to create monitoring, comfort control, or safety applications. Both cognitive entities can be implemented in Python and use the TensorFlow libraries.

9.3.2 Definition of the Prediction Tasks Data collected from a room, like environmental data, can be exemplified as multivariate event time series. Precisely, at one-time point t ∈ 1, . . . , T , all detected variables can consist of a multivariate event record vector xt ∈ R nx where nx denotes the number of variables measured, so each timestamp detection can

204

S. Colace et al.

be viewed as an event record in a multivariate event time series. Collecting all detections throughout a time horizon with length T, we obtain a multivariate event time series that can be represented as X = (x1 , . . . , xT ). The prediction of room occupancy state can be divided into two experiments. The first one, Task 1, is the experimental detection of room occupancy at the same time t of sensor readings, whereas the second one, Task 2, regards the forecast of room occupancy state in the next time step t + 1. Task 1—Occupancy Detection Given a history of observations X, in Task 1 we generate a prediction for the value of the target variable at the same time step: yˆt . The target variable y is represented by room occupancy state (occupancy), and all other measured variables X are used as input to the model. So given a certain observation of environmental sensors to the time t, i.e., xt , we predict the occupancy of the room at the same time t, i.e., yt . To do so, we consider the multivariate event time series X and corresponding values of occupancy Y in the time horizon with length T , as a supervised machine learning problem. Task 2—Occupancy Prediction For this task, we consider all measured variables at time t (including occupancy variable) as input variable, i.e., xt , and as target variable, we consider the occupancy at time t + 1. So given an observation of the environmental sensors at the time t, i.e., xt , we predict the occupancy of the room at the next time step yˆt+1 . As for Task 1, we consider the multivariate event time series as a supervised ML problem but with the only difference that we lose the last observation of the original dataset.

9.3.3 Data Pre-processing Before passing the data to the LSTM network, all datasets are scaled and normalized in the range (0–1) and then transformed into three-dimensional arrays (3D configuration), with the structure [samples, time steps, features] where: • Samples are the observations, typically the rows of data. • Time steps are the time lags used to predict the target variable from the observed values. • Features represent the parameter that gives the number of variables detected for each observation.

9.3.3.1

Transformation Approach for Non-homogeneous Time Series

In order to obtain a data structure suitable for the application of the LSTM model, i.e., a multivariate time series homogeneous in the detection intervals and without missing values, studies were carried out on the possible approaches to be used.

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

205

Here, we propose a data transformation method suggested by sensors’ behavior, from which we also extrapolate the occupancy target variable. Transformation Approach: established a new data structure with equispaced intervals of 10 min, at each equispaced time step, the absolute last observed value is imputed, except for the movement variable from which we create the occupancy variable where value 1 (room occupied) is assigned if at least one movement was recorded in the room during the last 10 min observed, value 0 (room unoccupied) otherwise.

9.3.4 Networks Training 9.3.4.1

LSTM Neural Network

Due to its particular properties, among the recurrent neural networks (RNNs), LSTMs are considered the best suitable networks for time series data. Their main field of application is in the area of speech recognition and language translation [11]. LSTM overcomes the limitations of RNN in the exploitation of the backpropagation for their training. The training of an LSTM exploiting backpropagation avoids the propagated error to vanish (vanishing gradient) or blow-up (exploding gradient). Instead of classic neurons, LSTM networks have blocks of memory cells, as shown in Fig. 9.4, connected through layers. A common cell represents the current input Xt into a hidden state vector ht through linear projections and nonlinear activation functions. As Fig. 9.5 shows, LSTM cells are made of input-output vector operators and nonlinearities, responsible for keeping track of the dependencies between the elements in the input sequence. Each cell looks like a mini-state machine in which the gates of the units have weights learned during the training procedure. In every LSTM unit, there are four types of states: • Forget gate moves in the interval (1, 0) by establishing how much of cell state needs to be updated or forgotten. Fig. 9.4 General LSTM unit

206

S. Colace et al.

Fig. 9.5 LSTM cell gate relations

ft = σ (Wf · [ht−1 , xt ] + bf ) • Input gate is in charge of acquiring new information and decides which values received from the input: it = σ (Wi · [ht−1 , xt ] + bi ) • Candidate gate denotes what data to write to the cell state Ct : C˜ t = tanh (WC · [ht−1 , xt ] + bC ) • Output gate decides what to output based on the input xt and the memory of the block ct : ot = σ (Wo · [ht−1 , xt ] + bo )

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

207

The inputs of the unit are of three types: Ct−1 and ht−1 represent previous memory and output state, coming from the last LSTM unit, while Xt indicates the current data input. The outputs are of two varieties. The first indicates the new updated memory: Ct = ft · Ct−1 + it · C˜ t while the second represents the current LSTM unit state: ht = ot · tanh(Ct ) Three gates regulate the flow of information into and out of the cell. The ways in which data are read, stored, and deleted from memory are learned automatically from the data itself, and it is summarized in the process of weights learning Wf , Wi , WC , and Wo . LSTM models can be used for both classification and regression tasks. Points in yellow in Fig. 9.5 are like a sort of neural network with sigmoid activation function σ and output numbers between zero and one, describing how much each component should be let through. The second nonlinearity type is the tanh layer, which creates a vector of new candidate values, C˜ t , that could be added to the new state. While the third is model bias for each gate bf , bi , bC , and bo . Vector operations are scalar product “x” and sum “+”. In this context, we use multivariate time series to predict room occupancy state at the same time and at future time steps. The input of the model is provided by data features indicated with Xt = (x1 , x2 , x3 , x4 , . . .) where 1, 2, 3, 4, . . . represent levels of light, CO2, temperature, humidity, and so on, while the hidden state of memory block ht = (h1 , h2 , h3 , . . .) depends on the number of LSTM state network used with the real output sequence O = (o1 , o2 ) (where 1 and 2 denote occupant and time, respectively) being iteratively calculated. This work considers an LSTM neural network having three layers: one input layer, one hidden layer, and one output layer.

9.3.5 Training For a careful and detailed evaluation of the best model, several experiments were conducted using different values for the hyper-parameters of the LSTM model described above, consisting of an input layer, a single hidden layer consisting of the LSTM memory cells, and a final output layer. For the activation function of the single output neuron, because this is a prediction problem of a binary variable with values of either 0 or 1, we use the sigmoid function. As far as the loss function is concerned, the function “binary crossentropy” is used. In order to minimize the loss function, the ADAM optimizer was adopted, with a learning rate of 104. The proposed networks were implemented using the deep learning package

208

S. Colace et al.

“TensorFlow” with “keras” functions and a 2.3-GHz Intel Core i7 quad-core with 16 GB of RAM. A confusion matrix is calculated after the networks have been trained. They are evaluated by calculating model evaluation metrics. As the prediction of the following models is a value between 0 and 1, it is specified that for the comparison in the test phase between the predicted and the actual values, the following transformation was applied: class 1 (occupied room) for estimated values greater than or equal to 0.7 and class 0 (unoccupied room) for those with values less than 0.7.

9.4 Experimental Results 9.4.1 Dataset In this work, we lead experiments on two datasets: a literature dataset, i.e., Occupancy Detection Dataset [1], and an experimental dataset obtained from sensor readings conducted in the IoT Laboratory at ICAR-CNR. 02/02/2015 -> 04/02/2015 -> 10/0/2015 -> 11/02/2015 -> 18/02/2015 ->

9.4.1.1

Dataset A: Occupancy Detection Dataset

The Occupancy Detection Dataset [1] contains a series of some environmental sensors’ detections, collected in an office of about 20 m2 in February 2015. The dataset consists of the following sub-groups listed in order of time of detection: • Datatest: with detections starting from 14:19 on February 2, 2015 until 10:43 on February 4, 2015, consisting of 2665 observations • Datatraining: with detections starting at 17:51 on February 4, 2015 until 09:33 on February 10, 2015, consisting of 8143 observations • Datatest2: with detections starting at 14:48 on February 11, 2015 and ending at 09:19 on February 18, 2015, consisting of 9752 observations As can be seen, the three datasets are not contiguous in temporal order, i.e., there are some gaps between them in which no observations were made. The time between each sensor’s detection is 1 min. The variables, measured at a constant rate of 1 min, are: • • • • • •

Date identifies the timestamps. Humidity detects the humidity percentage in the room. Light finds the levels of lux. CO2 identifies carbon dioxide values. Temperature detects the degrees Celsius. Occupancy represents the presence/absence of people in the room.

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

209

24

Temperature

22 20 40 Humidity

30 20 Light

1000 0 2000

CO2

1000

0.006 0.004

HumidityRatio

1.0

Occupancy

0.5 0.0 -02

15

20

-02

15

20

-11 -02 15 date

-09

-07

-05

-03

-02

15

20

-02

15

20

20

-02

15

20

-19

-17

-15

-13

-02

15

20

-02

15

20

-02

15

20

Fig. 9.6 Distribution of multivariate time series of occupancy detection Dataset (A) in the all period of reference

The detection of the presence or absence of a person (occupancy variable) was conducted by taking photographs from a camera at regular intervals transcribing the following information into a binary numerical variable that assumed value 1 (room occupied) or value 0 (room not occupied). For a detailed description of the data, see [1]. Figure 9.6 shows the distribution of the Dataset A. Given the nature of Dataset A, no data cleaning or missing value procedures are required. In addition, the series are all homogeneous in the time-step detection (1 min of interval between each observation). Hereafter the dataset will be referred to as Dataset A.

9.4.1.2

Dataset B: Experimental Dataset

In order to validate our model on an experimental dataset, we obtained room usage information by collecting environmental sensor data in the IoT Laboratory at ICARCNR in Calabria (Italy) from September to October 2020. Given the circumstances of the historical period of interest, i.e., the health emergency linked to COVID19 and the consequent restrictions of the regulations in force that limited people’s movements, there were real difficulties in obtaining significant surveys. For the purpose of this work, it is only the period in which the highest influx of people was extracted from the recordings. The environmental data has been gathered by exploiting the sensor devices listed in Table 9.1 and depicted in Fig. 9.7.

210

S. Colace et al.

Table 9.1 Description of sensor devices exploited for producing Dataset B Sensors Motion, light Temperature, humidity CO2, CO

Model Philips Hue Motion Sensor Heiman HS1HT-E Waspmote Air Quality V2

Communication technology Zigbee Home Automation 1.2 Zigbee Home Automation 1.2 Wi-Fi

Power Battery Battery Mains

Fig. 9.7 Devices exploited in Dataset B. (a) Philips Hue Motion. (b) Heiman HS1HT-E. (c) Waspmote Air Quality V2

All the devices are heterogeneous in terms of manufacturer, power supply, and communication protocol. The dataset extracted consists of two groups: • Acquisitions_20201001_20201020.csv. It contains 74,312 observations recorded in the period from 10/01/2021 00:00:10 to 10/19/2021 23:59:34. • Acquisitions_20201020_20201101.csv. It contains 38,444 observations recorded in the period from 10/20/2021 00:00:37 to 10/31/2021 23:59:27. Due to the sensors’ nature, both the datasets are not temporally homogeneous, i.e., there is no constant survey rate in relation to time. Since the two groups are temporally contiguous, they have been merged in chronological order to create a unified dataset called Experimental Dataset B, consisting of 112,756 observations. The variables present in the dataset are: • • • • • • • •

Sent_time identifies the timestamps. Unixtimestamp identifies the timestamps related to the Unix format. Light finds the levels of lux. CO2 identifies carbon dioxide values. CO represents the level of carbon monoxide in the air. Temperature represents the degrees Celsius. Humidity_ratio detects relative humidity values. Motion, detected by a PIR sensor, reveals the presence of people’s movements.

Table 9.2 shows the first eight rows of Dataset B. Occupant detection is estimated through a passive infrared proximity sensor (motion sensor), and the procedure will be more explored later in this chapter. Results coming from the transformation approach described in Sect. 9.3.3.1 are shown in Table 9.3. The multivariate time series are graphically shown in Fig. 9.8. Hereafter the dataset will be referred to as Dataset B.

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

211

Table 9.2 Head rows of Dataset B Sent_time

Unixtimestamp Movement Temperature Light Humidity CO2

2020-10-01 00:00:10.0 1601503210 2020-10-01 00:00:10.0 1601503210

CO

76 0

2020-10-01 00:00:15.0 1601503215 2020-10-01 00:00:15.0 1601503215

24.7 47.1

2020-10-01 00:01:15.0 1601503275 2020-10-01 00:01:15.0 1601503275 2020-10-01 00:02:06.0 1601503326

0.024 391.456 75

2020-10-01 00:02:06.0 1601503326

0

Table 9.3 Head rows of Dataset B after transformation Sent_time

Unixtimestamp Movement Temperature Light Humidity CO2

CO

2020-10-01 00:10:00 1601503756 2020-10-01 00:20:00 1601504356

0 0

24.53 24.53

75 75

47.03 47.03

384.255 0.018 384.255 0

2020-10-01 00:30:00 1601504956 2020-10-01 00:40:00 1601505555

0 0

24.53 24.36

75 76

47.03 46.91

382.549 0 374.59 0.01

2020-10-01 00:50:00 1601506156 2020-10-01 01:00:00 1601506756 2020-10-01 01:10:00 1601507356

0 0 0

24.36 24.36 24.36

76 76 75

46.91 46.91 46.91

374.685 0 381.792 0 376.959 0.022

2020-10-01 01:20:00 1601507956

0

24.27

75

46.91

384.35

0.006

Ie9

1.604

unixtimestamp

1.602 1

occupancy

0 30

temperature

20 5000

light

0 60 40

humidity_ratio

CO2

600 400

CO

1 0 .01

.14

.07

.10

20

20

.10

20

20

.20

.21

.10

20

20

.10

20

sent_time

20

.10

20

20

Fig. 9.8 Distribution of multivariate time series of Experimental Dataset (B) in the reference period

212

S. Colace et al.

Fig. 9.9 Confusion matrix for a binary classification problem

9.4.2 Evaluation Metrics In order to assess the performance of a classification model, means measure how well a classifier makes a correct distinction between classes. Binary classification, or two-class classification, separates a given input into two opposing classes such as “presence” and “absence” of a disease or condition, “response” or “no response” for a treatment, “spam” versus “non-spam” for an email, and “malicious” versus “benign” for software. Based on the results of the model and an a priori known dataset (test set), a confusion matrix is created, i.e., a table in which predictions are represented in columns and the actual state is represented by rows (sometimes this is reversed, with actual instances in columns and predictions in rows). Figure 9.9 shows the generic confusion matrix for a binary classification problem for illustrative purposes, where class 0 is commonly referred to as a “negative” class and class 1 as a “positive” class. Two possible classes are provided: value 1, i.e., the “yes” class, and value 0, i.e., the “no” class. In this work, we consider value 1 as “room is occupied”, and 0 as “room is not occupied”. The basic values with which the performance indicators are calculated are: • True positives (TP): these are the cases in which the model has predicted a value equal to 1 (room occupied) and the room is actually occupied. • True negatives (TN): these are the cases in which the model has previewed a value equal to 0 (room not occupied) and the room is not occupied. • False positives (FP): these are the cases in which the model has previewed a value equal to 1 (occupied room), while the room effectively is not occupied (also known as “type 1 error”). • False negatives (FN): these are the cases in which the model has predicted a value equal to 0 (room not occupied), while the room is actually occupied (also known as “type 2 error”). Among the various performance and comparison metrics designed to assess the goodness of classification models, there are some widely used ones such as accuracy, precision, recall, and F1-score [10]: • Accuracy is defined as the degree of total correspondence of the theoretical data with the reference data, i.e., how often the classifier is correct:

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

accuracy =

213

(T P + T N) (T P + T N + F P + F N)

• Precision or positive predictive value (PPV) indicates, among all the values predicted as “yes” (target event), how many are actually “yes”. A prediction with high precision will almost always give the same result each time it is used. In other words, precision is a measure of the reliability and consistency of the model: precision =

(T P ) (T P + F P )

• Recall, or true positive rate (TPR) or sensitivity, is instead a measure of completeness. It represents the percentage of cases correctly predicted like “yes”, between all the real “yes”. It indicates how correct the model is: recall =

(T P ) (T P + F N)

• F1-score is constituted from the harmonic average of the precision and the recovery. It represents a general measure of accuracy: F1score = 2 ·

(precision · recall) (precision + recall)

The range of such measures varies between 0 (low performances) and 1 (high performances). The performance of a model will be estimated, therefore going to see the cases in which all the aforesaid measures turn out altogether nearer to the value of 1. Another useful measure to evaluate the predictive performance of a model is the RMSE (root mean square error). This measure is the square root of the root mean square error and is a measure of the error of the model predictions. The lower the prediction error, the better the model performs. Adding up the forecast errors made by squaring them, and then dividing the result obtained by the number of forecasts made, we obtain the MSE. To obtain the RMSE, it will be sufficient to apply the square root to this number.

9.4.3 Imbalanced Classification Techniques Starting from an initial network configuration, we conduct several experiments by modifying the neural network hyper-parameters and applying techniques to improve

214

S. Colace et al.

learning on datasets, especially in the case of imbalanced class dataset. In particular, we concentrate on focal loss and weight balancing techniques described below.

9.4.3.1

Focal Loss

This loss function generalizes the binary crossentropy function used in classification problems. Focal loss introduces a hyper-parameter called the focalization parameter, which allows examples that are difficult to classify to have greater importance in learning than examples that are easy to classify. In the application in question, the focal loss was implemented using the “focal_loss.BinaryFocalLoss” function of Keras in TensorFlow. In particular, we test different values for the gamma and “pos_weight” parameters.

9.4.3.2

Weight Balancing

To overcome the problem of imbalanced classes, it is also possible to modify the current training algorithm to consider the asymmetric distribution of classes. This can be achieved very simply by assigning different weights to both majority and minority classes, thus influencing the classification during the network learning phase. Normally, each example and class in the loss function has the same weight, i.e., 1. The whole purpose is to penalize misclassification by the minority class by setting a higher-class weight and, at the same time, reducing the weight for the majority class. In a multi-class or multi-label problem, the frequency needs to be computed for every class. For this purpose, TensorFlow in Python offers a parameter called “class_weight” in model.fit() that allows specifying the weights for each of the target classes directly. In this application, we carry out experiments on the “class_weight” parameter focusing on these two formulas: weight_class_0 =

1/num_0 ∗ sum 2

weight_class_1 =

1/num_1 ∗ sum 2

where num_0 and num_1 represent the number of cases where occupancy at time t + 1 has values 0 and 1, respectively, and sum represents the sum of num_0 and num_1 (i.e., the sample size).

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

215

9.4.4 Results 9.4.4.1

Task 1: Occupancy Detection

The LSTM approach was tested against Dataset A in Task 2: Occupancy Prediction at the current step t. Table 9.4 reports the different tested parameter settings. From Table 9.5, which reports the evaluation metrics on test set for each parameter setting, it is possible to see that the best performance can be obtained with 360 LTM units, “softsign” as LSTM layer activation function, 25 epochs, and a batch size of 20. In Table 9.6 we show how LSTM performances compare with other state-of-theart models presented in [1]. The trained LSTM model outperforms all the models presented in [1] in terms of accuracy. LSTM parameter settings and related results on Dataset B are reported in Tables 9.7 and 9.8. The model with ID 12 shows the best obtained performances, overall slightly lower than the best result obtained applying the approach to Dataset A (model ID 6).

9.4.4.2

Task 2: Occupancy Prediction

Tables 9.9, 9.10, 9.11, and 9.12 summarize the results achieved by the tests conducted in relation to the predicted room occupancy status at the time step

Table 9.4 Dataset A, Task 1: occupancy detection. Tested LSTM parameter settings ID 1 2 3 4 5 6

LSTM units 150 180 180 240 180 360

Activation function softsign softsign softsign softsign tanh softsign

Loss function Binary crossentropy Binary crossentropy Binary crossentropy Binary crossentropy Binary focal loss Binary focal loss

Epochs 20 20 20 20 20 25

Batch size 26 23 23 20 20 20

Dropout – – 0.2 – – –

Table 9.5 Dataset A, Task 1: occupancy detection. Performances on the test set for considered LSTM parameter settings ID 1 2 3 4 5 6

Evaluation metrics—test RMSE Accuracy 10.52% 98.89% 8.23% 99.32% 8.53% 99.27% 7.97% 99.36% 7.51% 99.44% 7.44% 99.45%

Precision 97.60% 97.65% 97.64% 97.70% 97.79% 97.80%

Recall 97.12% 99.17% 98.93% 99.32% 99.56% 99.61%

F1-score 97.36% 98.40% 98.28% 98.50% 98.67% 98.69%

216

S. Colace et al.

Table 9.6 Dataset A, Task 1: occupancy detection. Performances on test set for considered LSTM parameter settings

Model RFa GBMa CARTa LDAa LSTM a

Accuracy (%) 98.1 96.1 96.5 99.3 99.5

Implemented in [1]

Table 9.7 Dataset B, Task 1: occupancy detection. Considered LSTM parameter settings Activation function tanh softsign tanh

Loss function Binary focal loss Binary focal loss Binary crossentropy

10 50

softsign

Binary crossentropy 20

25

11 90

softsign

Binary crossentropy 20

25

12 90

softsign

Binary crossentropy 27

26

ID 7 8 9

LSTM units 50 50 50

Epochs 10 20 10

Batch size 25 25 25

Dropout FL WGT – gamma=0.05 – gamma=0.05 – class0=0.59 class1=3.40 – class0=0.59 class1=3.40 – class0=0.59 class1=3.41 – class0=0.59 class1=3.42

Table 9.8 Dataset B, Task 1: occupancy detection. Performances on test set for considered LSTM parameter settings ID 7 8 9 10 11 12

Evaluation metrics—test RMSE Accuracy 41.28% 82.96% 41.28% 82.96% 32.81% 89.24% 30.50% 90.70% 29.57% 91.26% 27.20% 92.60%

Precision 100.00% 75.00% 77.88% 84.47% 85.19% 86.67%

Recall 1.30% 1.95% 52.60% 56.79% 59.74% 67.53%

F1-score 2.56% 3.80% 62.79% 67.70% 70.23% 75.91%

following sensor detections (Task 2: Occupancy Prediction), by considering Dataset A (Tables 9.9 and 9.10) and Dataset B (Tables 9.11 and 9.12). It should be noted that, in this contest, a further variable enters into the model, i.e., occupancy variable at time t, as specified in Sect. 9.3.2. In both cases, valuable results are achieved, with very satisfactory levels of accuracy, with the best evaluation given by parameter settings 22 and 29.

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

217

Table 9.9 Dataset A, Task 2: occupancy prediction. Considered LSTM parameter settings ID 13 14 15 16 17 18 19 20 21 22

LSTM units 50 30 6 9 6 4 6 6 6 6

Activation function tanh tanh tanh tanh tanh tanh tanh tanh tanh softsign

Loss function Mae Mae Mae Binary crossentropy Binary crossentropy Binary crossentropy Binary crossentropy Binary crossentropy Binary crossentropy Binary crossentropy

Epochs 3 3 3 3 3 3 2 2 3 3

Batch size 30 30 30 30 30 30 30 22 22 22

Dropout – – – – – – 0.2 0.2 0.2 0.2

Table 9.10 Dataset A, Task 2: occupancy prediction. Performances on test set for considered LSTM parameter settings ID 13 14 15 16 17 18 19 20 21 22

Evaluation metrics RMSE Accuracy 6.238 99.61 6.238 99.61 8.326 99.31 6.335 99.60 6.238 99.61 7.479 99.44 12.080 98.54 36.147 86.91 6.240 99.61 6.140 99.62

Precision 99.76 99.76 99.32 99.71 99.76 99.51 98.37 85.91 99.76 99.76

Recall 99.76 99.76 99.82 99.79 99.76 99.79 99.82 99.95 99.76 99.77

F1-score 99.76 99.76 99.57 99.75 99.76 99.65 99.09 92.40 99.76 99.76

9.5 Conclusion and Future Work This chapter proposed a machine learning approach to detect human presence in a room and to predict future occupancy state, using privacy-preserving, environmental multi-sensor input data. We also propose an innovative software architecture that exploits the approach in an IoT environment to control electrical appliances to reduce energy consumption, increase security, and bring about convenience for the residents. For instance, LSTM model predictions can be used to regulate HVAC system demand by scheduling when a room will be occupied or not, instead of conventional rule-based controls. We conducted our experimentals on two datasets, a literature dataset and an experimental dataset, obtained from real room usage, i.e., the ICAR-CNR IoT Laboratory. We first demonstrated that LSTM could provide highly accurate detection of room occupancy states compared with state-of-the-art models. We showed how the LSTM can be configured to predict room occupancy states across the following time

218

S. Colace et al.

Table 9.11 Dataset B, Task 2: occupancy prediction. Considered LSTM parameter settings ID 23 24 25 26 27 28

LSTM units 50 50 50 50 50 50

29 50

Activation function softsign tanh tanh softsign softsign tanh

Loss function Binary crossentropy Binary focal loss Binary focal loss Binary focal loss Binary focal loss Binary crossentropy

softsign

Binary crossentropy 20

Epochs 20 10 10 20 20 10

Batch size 25 25 25 25 25 25

Dropout – – – – – –

25



FL WGT – – gamma=2.00 – gamma=0.05 – gamma=2.00 – gamma=0.05 – – class0=0.59 class1=3.40 – class0=0.59 class1=3.40

Table 9.12 Dataset B, Task 2: occupancy prediction. Performances on test set for considered LSTM parameter settings ID 23 24 25 26 27 28 29

Evaluation metrics—test RMSE Accuracy 26.36% 93.05% 40.32% 83.74% 24.38% 94.06% 40.87% 83.30% 24.38% 94.06% 24.14% 94.17% 24.14% 94.17%

Precision 85.94% 90.91% 83.01% 85.71% 83.01% 83.12% 83.12%

Recall 71.43% 6.49% 82.47% 3.90% 82.47% 83.12% 83.12%

F1-score 78.01% 12.12% 82.74% 7.45% 82.74% 83.12% 83.12%

steps and how it can be used to deal with heterogeneous multivariate time series and imbalanced datasets due to pandemic restriction. Future work includes the validation of the proposed approach in different realworld building/offices with further experiments concerning the time interval at which the network looks back to make the prediction and the extension of multiple time windows for future prediction. In addition, further studies will be carried out on transfer learning applied to other rooms in the building, estimation of the number of people in the room, and experiments in the contest of closed-loop predictive control approaches.

References 1. Candanedo, L.M., Feldheim, V.: Accurate occupancy detection of an office room from light, temperature, humidity and co2 measurements using statistical learning models. Energy Build. 112, 28–39 (2016) 2. Cao, X., Dai, X., Liu, J.: Building energy-consumption status worldwide and the state-of-theart technologies for zero-energy buildings during the past decade. Energy Build. 128, 198–213 (2016)

9 Room Occupancy Prediction Leveraging LSTM: An Approach for. . .

219

3. Chen, Z., Masood, M.K., Soh, Y.C.: A fusion framework for occupancy estimation in office buildings based on environmental sensor data. Energy Build. 133, 790–798 (2016) 4. Chen, Z., Zhao, R., Zhu, Q., Masood, M.K., Soh, Y.C., Mao, K.: Building occupancy estimation with environmental sensors via cdblstm. IEEE Trans. Ind. Electron. 64(12), 9549–9559 (2017) 5. Das, S., Swetapadma, A., Panigrahi, C.: Building occupancy detection using feed forward back-propagation neural networks. In: 2017 3rd International Conference on Computational Intelligence and Networks (CINE), pp. 63–67. IEEE (2017) 6. Delzendeh, E., Wu, S., Lee, A., Zhou, Y.: The impact of occupants’ behaviours on building energy analysis: A research review. Renew. Sustain. Energy Rev. 80, 1061–1071 (2017) 7. Dong, B., Prakash, V., Feng, F., O’Neill, Z.: A review of smart building sensing system for better indoor environment control. Energy Build. 199, 29–46 (2019) 8. Erickson, V.L., Carreira-Perpiñán, M.Á., Cerpa, A.E.: Observe: Occupancy-based system for efficient reduction of hvac energy. In: Proceedings of the 10th ACM/IEEE International Conference on Information Processing in Sensor Networks, pp. 258–269. IEEE (2011) 9. Erickson, V.L., Carreira-Perpinán, M.A., Cerpa, A.E.: Occupancy modeling and prediction for building energy management. ACM Trans. Sensor Netw. (TOSN) 10(3), 1–28 (2014) 10. Han, J., Pei, J., Kamber, M.: Data Mining: Concepts and Techniques. Elsevier (2011) 11. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Computation 9(8), 1735– 1780 (1997) 12. Kim, S., Kang, S., Ryu, K.R., Song, G.: Real-time occupancy prediction in a large exhibition hall using deep learning approach. Energy Build. 199, 216–222 (2019) 13. Kleiminger, W., Beckel, C., Staake, T., Santini, S.: Occupancy detection from electricity consumption data. In: Proceedings of the 5th ACM Workshop on Embedded Systems for Energy-Efficient Buildings, pp. 1–8 (2013) 14. Levesque, A., Pietzcker, R.C., Luderer, G.: Halving energy demand from buildings: The impact of low consumption practices. Technol. Forecast. Soc. Change 146, 253–266 (2019) 15. Molina-Solana, M., Ros, M., Ruiz, M.D., Gómez-Romero, J., Martín-Bautista, M.J.: Data science for building energy management: A review. Renew. Sustain. Energy Rev. 70, 598– 609 (2017) 16. Peng, Y., Rysanek, A., Nagy, Z., Schlüter, A.: Using machine learning techniques for occupancy prediction-based cooling control in office buildings. Applied Energy 211, 1343– 1358 (2018) 17. Razavi, R., Gharipour, A., Fleury, M., Akpan, I.J.: Occupancy detection of residential buildings using smart meter data: A large-scale study. Energy Build. 183, 195–208 (2019) 18. Savaglio, C., Ganzha, M., Paprzycki, M., B˘adic˘a, C., Ivanovi´c, M., Fortino, G.: Agent-based internet of things: State-of-the-art and research challenges. Futur. Gener. Comput. Syst. 102, 1038–1053 (2020) 19. Wang, W., Chen, J., Hong, T.: Occupancy prediction through machine learning and data fusion of environmental sensing and wi-fi sensing in buildings. Autom. Constr. 94, 233–243 (2018)

Chapter 10

Edge Intelligence Against COVID-19: A Smart University Campus Case Study Claudio Savaglio , Giandomenico Spezzano , Giancarlo Fortino , Mario Alejandro Paguay Alvarado, Fabio Capparelli, Gianmarco Marcello, Luigi Rachiele, Francesco Raco, and Samantha Genoveva Sanchez Basantes

10.1 Introduction The simultaneous monitoring of environmental parameters and inter-personal distancing is crucial in order to limit the COVID-19 virus spreading in every closed environment. From one side, it has been shown that both temperature and humidity impact on virus’ survival: therefore, relative humidity values between 45 and 55% associated with a 24◦ C indoor temperature represent a perfect healthy setting to aim for. On the other side, the World Health Organization and the governments have prescribed an inter-personal distance of 1.5/2 m from each other associated with the usage of masks in order to minimize the risk of contagion through the droplets that we usually disseminate around us from the nose and mouth. However,

This work was supported by the Italian MIUR, PRIN 2017 Project “Fluidware” (CUP H24I17000070001) and the “COGITO—Sistema dinamico e cognitivo per consentire agli edifici di apprendere ed adattarsi” Project, funded by the Italian Government, under Grant ARS01 00836. C. Savaglio () · G. Spezzano Institute for High Performance Computing and Networking (ICAR) of National Research Council (CNR) of Italy, Rende (CS), Italy e-mail: [email protected]; [email protected] G. Fortino Institute for High Performance Computing and Networking (ICAR) of National Research Council (CNR) of Italy, Rende (CS), Italy Department of Computer Science, Modeling, Electronics and Systems Engineering (DIMES) of the University of Calabria, Rende (CS), Italy e-mail: [email protected] M. A. P. Alvarado · F. Capparelli · G. Marcello · L. Rachiele · F. Raco · S. G. S. Basantes Department of Computer Science, Modeling, Electronics and Systems Engineering (DIMES) of the University of Calabria, Rende (CS), Italy © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_10

221

222

C. Savaglio et al.

in some contexts (e.g., restaurants and cafeterias where the majority of people do not wear a mask while drinking/eating or indoor spaces designed years ago without any monitoring infrastructure), the compliance with these conditions is particularly challenging. Cognitive buildings [25], one of the main application areas for IoT, edge computing, and artificial intelligence [8], can provide effective solutions for predicting, monitoring, and contrasting potentially dangerous situations related to humidity/temperature/overcrowded spaces and, finally, for fighting against the COVID-19 virus spreading [3]. Augmented with interconnected IoT devices supported by advanced AI techniques, cognitive buildings enable the efficient and economical use of resources while creating a safe and comfortable environment for occupants. According to these considerations, in our specific case, we designed a Smart Cafeteria, as part of a cognitive building located in the Unical (University of Calabria, in Italy) where the COVID-19 spreading is under control through the monitoring of humidity, temperature, and people occupancy values. We adopted an edge-based architecture and implemented some machine/deep learning models and data analysis algorithms to be executed directly on the edge devices so as to achieve lower latency, reduced bandwidth consumption, and higher reliability and privacy when transmitting data. Overall, the designed infrastructure is divided into three different layers, as shown in Fig. 10.1: • End-device layer, where the first sensor devices gather and forward the data (about humidity/temperature/occupants) to be uploaded to the next layer and then actuator devices receive actuation commands • Edge layer, where mini-computers receive, analyze, and pre-elaborate data and, in case of missing values or failures, exploit two neural networks, before sending the data to the cloud layer

Fig. 10.1 System architecture

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

223

• Cloud layer, where servers carry out decision-making processes aimed at notifying users in case of dangerous situations and at controlling the heating, ventilation, and air conditioning (HVAC) of the room through the actuators of the end-device layer, thus closing the loop The Smart Cafeteria has been designed according to the guidelines provided by ACOSO-Meth [13], a development methodology conceived for steering the analysis, design, and implementation of IoT systems. The latter phase has involved commercial and low-cost devices like Arduino Uno and Raspberry Pi, thus making the final prototype cheap yet interoperable and smart, exactly in the groove of cognitive buildings’ design principles [23, 28]. The rest of the chapter is organized as follows: in Sect. 10.2, the main enabling technologies exploited for the Smart Cafeteria are briefly introduced and their adoption motivated. An overview on COVID-19 monitoring systems related to our proposal is provided in Sect. 10.3. Section 10.4, instead, reports the main considerations about the analysis (10.4.1), design (10.4.2), validation and verification (10.4.3), implementation (10.4.4), and deployment and orchestration (10.4.5) phases of the Smart Cafeteria. The final remarks and future work conclude the chapter.

10.2 Background and Enabling Technologies In this section, we provide a brief background about the enabling solutions (hardware, software, and developing tools) we decided to rely on. They are reported in Table 10.1 and concisely introduced. For each solution, the peculiarities of particular interest for our Smart Cafeteria are highlighted in italic.

Table 10.1 Enabling technologies Name (subsection) ACOSO-Meth (10.2.1) UPPAAL (10.2.2) DHT11 (10.2.3) QR code (10.2.5) Arduino Uno (10.2.4) Raspberry Pi (10.2.6) Node-RED (10.2.7) MQTT (10.2.8) Long short-term memory (10.2.9) Docker (10.2.10) DigitalOcean (10.2.11)

Description Development methodology for cooperative smart objects Modeling tool for the verification and validation of concurrent systems Environmental sensor for measuring humidity and temperature Matrix bar code Open-source microcontroller board Single-board computers Open-source programming tool for IoT applications Open-source energy-efficient communication protocol Kind of recurrent neural network Container management system Cloud platform for creating virtual machines

224

C. Savaglio et al.

10.2.1 ACOSO-Meth The agent-oriented ACOSO-Meth methodology supports the engineering of SObased IoT systems of different complexities and scales during the whole development process. At the analysis phase, ACOSO-Meth provides a high-level smart object (SO) metamodel that shares the main features with emerging IoT architectural standards such as IEEE P2430, AIOTI, and IoT-A domain models. At the design phase, the agent-oriented ACOSO-based SO metamodel, derived from the highlevel SO metamodel, provides an agent-based modeling of functional system components, their relationships, and interactions. Finally, at the implementation phase, the designed agent-based system is realized through JEDI, a well-known agent platform. The guidelines and the high-level SO metamodel have been exploited for easily identifying entities and components involved in our Smart Cafeteria so as to steer the subsequent design and implementation phases.

10.2.2 Uppaal Uppaal is an integrated tool environment for modeling, simulation, verification, and validation of real-time concurrent systems. The tool is based on timed automata networks: it offers the possibility to model time-dependent systems with time constraints and properties, allowing to check the correctness and the synchronization among the templates and entities. Within a real IoT environment, in order to avoid possible process bottlenecks during the concurrent dynamic execution, the preliminary modeling and the verification of the multiple interactions among the different entities (starting from the device layer, passing through the edge and finally the cloud) have a paramount importance. The choice of Uppaal allows assessing the correct synchronization through all layers in our solution as well as the identification of possible points of delay or failure, within certain time constraints.

10.2.3 DHT11 DHT11 is an industrial sensor provided with a high-performance 8-bit microcontroller, ensuring high reliability and excellent long-term stability, with a calibrated digital signal output. By using the exclusive digital-signal-acquisition technique, its sensors include a resistive-type humidity measurement component and an NTC temperature measurement component, offering excellent quality, fast response, antiinterference ability, cost-effectiveness, as well as a simplified integration with Arduino boards.

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

225

10.2.4 Arduino Uno Arduino is a hardware and software platform aimed at making it easy to build applications on commercial microcontrollers. The Arduino framework is a set of software libraries that allow people to write simplified firmware for those target chipsets, without worrying about the complex architectural aspects of having to program bare metal MCUs. Arduino boards are ideal to build devices with sensing and actuation capabilities that may also be interconnected by using the on-board hardware communication ports through extension boards. Our approach contemplates an Arduino microcontroller unit together with two sensors for the acquisition of data about people count, temperature, and humidity.

10.2.5 QR Code QR codes codify data and information in an image made of white and black blocks, easily readable and interpretable by smartphone cameras and related applications. The nature of QR codes lends themselves to be easily used in contexts where a simple and quick interaction between people and machines is needed, for example, share information or on-site registrations. This can be achieved since there is a possibility of using QR-encoded URLs, linking to a specific website. We decided to use a QR code for keeping track of the people entering and exiting the monitored spaces since it is a simple yet effective way for occupancy monitoring.

10.2.6 Raspberry Pi Raspberry Pi is very likely the most popular and utilized single-board computer available in the market. Its wide and diverse range of peripherals and interfaces makes it easy to interact with as well as suitable for many application areas. Each Raspberry Pi device comprises a program memory (RAM), CPU, GPU, an Ethernet port, GPIO pins, XBee Socket, UART, and various interfaces for other external devices. For our purposes, we utilized Raspberry Pi as core of the edge layer: it supports the neural networks and shares data with the end-device layer through the serial communication and with the cloud layer through a Wi-Fi one.

10.2.7 Node-RED Node-RED is an open-source programming tool for the development of IoT applications. Based on a visual programming approach, Node-RED enables the

226

C. Savaglio et al.

simplified and intuitive development of such applications: a web-based editor is provided, and it allows combining several “nodes” into a flow to perform a given task. The Node-RED environment is built on Node.js, making it runnable even over low-cost hardware such as the Raspberry Pi. Such characteristic, along with the wide community providing support as well as new third-party nodes, motivated us in choosing Node-RED for the development of the edge layer platform.

10.2.8 MQTT (Message Queue Telemetry Transport) MQTT is a client/server communication protocol of primary importance in the IoT domain. Based on a publish-subscribe model for the transmission of messages, it provides valuable features for large-scale scenarios, including asynchronous communication and high scalability. In our system, MQTT is used by the devices of edge layer to send sensed data to a broker located in the cloud and vice versa.

10.2.9 Long Short-Term Memory (LSTM) We decided to rely on long short-term memory (LSTM) neural networks, a particular kind of recurrent neural networks (RNNs), which are well suited for making time series prediction: in such networks, each hidden unit has a more complex structure compared to that of RNNs, and this makes LSTMs able to catch long-term dependencies present in the input data. In the development of our LSTMs, as a design choice, we tried to keep them as much simple as possible, since they’re thought to be deployed on edge devices where very likely other smart services will be simultaneously deployed too.

10.2.10 Docker Docker is a container management system that enables containerized applications. Through a daemon process that is accessible via the Docker client CLI, the Docker engine manages containers, which are isolated applications including software distributions and dependencies for an application to run, and encapsulates the whole application environment in a single unit. The containerized applications share the same resource (i.e., the kernel of the operating system), so they are lighter when compared to traditional virtualization techniques. A particular modality to run Docker is called swarm mode: it enables the users to use different machines on one or more back-end server, to host the various containers of your stack. A swarm of machines running swarm mode must all have the Docker engine installed, with one machine acting as the swarm master for coordination purposes. Swarms can be set

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

227

up through YAML configuration files: once you write those, the deployment process is automatic. This feature can be used in combination with continuous integration and deployment pipelines to automate the deployment of the stack. The deployment of the cloud layer of our system has been done by using containerization technique and, in particular, Docker. The replication of the designed containers is possible since the applications are stateless, but they offload it onto databases and data store containers. Accordingly, we decided to run a number of containers exposing the same service without any issue, so gaining high scalability.

10.2.11 DigitalOcean DigitalOcean is a very popular cloud platform that enables users to create virtual machines, called Droplets, that are completely user customizable. This service is also compatible with Docker machine, a tool that enables setup and usage of local and remote Docker engine-based virtual machines. In such a way, it is possible to set up a swarm of virtual machines that can be used to achieve the implementation of a microservice-oriented containerized stateless infrastructure. DigitalOcean allowed us to implement a solid, durable infrastructure that can withstand many users at once. The latter is an important property since users in cafeterias generally use the system all at once.

10.3 Related Works This section shows similar approaches to the one we propose for solving the problem of the COVID-19 monitoring. The following related works are presented according to the level of the stack they mainly involve and that we also consider in our architecture (i.e., end-device, edge, cloud). Articles related to the same context (i.e., cognitive buildings in the COVID-19 era) but with different purposes (e.g., energy optimization [4], new case prediction [12], or hospital management [2, 26]), whereas interesting, are considered out of the scope and, hence, not considered in the following analysis.

10.3.1 Monitoring at the End-Device Layer The most common solution implemented at the end-device layer to perform presence detection or user registration contemplates the exploitation of RFID. In [31], for example, a RFID-based system is realized and techniques of artificial intelligence exploited for recognizing people and notifying dangerous situations of insufficient personal distancing. RFID can be also jointly used with humidity

228

C. Savaglio et al.

and temperature sensors so that distance between people may dynamically change according to the sensed value of humidity and temperature. Likewise, in [19], authors use electromagnetic fields to automatically identify and track tags attached to persons or objects to create a real-time location system. To avoid static RFID readers, other mobile end devices can be used in contactless monitoring applications [1]: such devices can directly interact with each other, but additional problems (related to energy consumption and required additional hardware, e.g., infrared cameras) would arise, thus making such a solution dynamic yet more expensive. Instead, in [9] and [21], QR codes are used not only to testify people health status but also as enablers for occupancy monitoring. Aiming to keep it as much thin as possible, in our Smart Cafeteria, we devoted the end-device layer exclusively devoted to sensing and actuation tasks, without any complex data processing operation. Moreover, we opted for QR-based occupancy monitoring since this technology is nowadays fully supported by the smartphones.

10.3.2 Monitoring at the Edge Layer COVID-19 indoor safety monitoring is carried out in [24] by the jointly exploitation of camera-equipped Raspberry Pi (with computer vision techniques for mask detection and social distancing) and Arduino Uno (using infrared sensor or thermal camera for contactless temperature sensing). A Raspberry Pi is also used in [6] to monitor the number of people entering and leaving a vicinity, to ensure physical distancing, to monitor body temperature, and to warn attendees and managers of violations. An alternative, interesting approach, similar to the one we propose in the Smart Cafeteria, exploits wearable devices with built-in BLE, Wi-Fi, and NFC capabilities in order to identify users when entering or leaving a certain place [11]. The obtained data is collected through MQTT and Node-RED flows in decentralized database where deep learning models can run for forecasting the COVID-19 virus diffusion. Along this line, in [34], various techniques (including recurrent neural networks RNNs, long short-term memory (LSTM) networks, bidirectional LSTMs (BiLSTMs), gated recurrent units (GRUs), and variational auto encoder VAE) have been exploited and related models built, trained, and tested using a small dataset containing data about six countries (viz., Italy, Spain, France, China, the United States of America, and Australia). A similar study [7] deals with a dataset regarding Canada’s confirmed cases until March 31, 2020, with a LSTM neural network that was developed for the forecasting of future values. Similarly to the aforementioned works, we decided to rely on some deep learning models directly at the edge layer, so to ensure the availability of data for feeding decision-making algorithms. Indeed, data retrieved from the environment which might get lost or corrupted will be replaced with the predictions of two LSTM networks, thus keeping the temperature and humidity of the monitored environment always consistent.

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

229

10.3.3 Monitoring at the Cloud Layer Cloud computing capabilities can greatly support IoT devices in defining a solid infrastructure for the management of huge data flows like the one related to COVID19 monitoring [5, 30]. In [32] a cloud-based IoT system using machine learning is presented, aimed at monitoring in real time the social distancing between people and controlling the capacity in common indoor spaces. Differently, in [18], a cloud-based geofencing monitoring solution allows creating virtual boundaries in maps and notifying users approaching a dangerous area. In [27], both face mask detection and physical distance recognition tasks are performed by Google Colaboratory, a cloud service that provides free access to different types of GPUs for executing machine learning and data analytics. Finally, in [16], a cloud server gathers heterogeneous data and combines them for monitoring the body temperature of people sharing indoor spaces. Summing up, cloud layer is widely exploited to perform high-resource demanding tasks like data analytics, also beyond the cognitive building domains [15, 22], but it inherently introduces drawbacks in terms of latency, privacy, and cost. Therefore, in our Smart Cafeteria, we promote the implementation of Edge Intelligence, thus aiming to streamline the computation burden of the cloud servers.

10.4 Project Development In this section we present the highlights about the analysis (10.4.1), design (10.4.2), verification and validation (10.4.3), implementation (10.4.4), and deployment and orchestration (10.4.5) phases of our Smart Cafeteria.

10.4.1 Analysis Phase Our Smart Cafeteria is a SO thought to be physically deployed in Unical (University of Calabria) cafeterias. Unical has four cafeterias based on Polifuzionale, Maisonettes (which has Area A and Area B), Martesson (also having Area A and Area B), and finally Piazza Vermicelli. We leveraged on ACOSO high-level SO metamodel at the analysis phase which results very helpful to firstly understand and show the entities and components involved in our Smart Cafeteria in a visual way. ACOSO-Meth offers a high-level metamodel that integrates in a single UML class diagram the following entities and their features, by considering both static and dynamic SO characteristics [13]. The main components identified by the ACOSO-Meth during the analysis phase are:

230

C. Savaglio et al.

• SO basic info: This comprises the basic SO information, its status, location, and physical properties. • SO user: This represents the final users or stakeholders of the SO, for example, humans, the SO it selves, physical entities, and so on. • Augmentation: This defines the hardware and software characteristics of a device that allows augmenting the physical object and making it smart. • SO service: This represents the SO service by means of its name, a freetext description, type (sensing or actuation), input, and return parameter type. Each service exploits one or more operations that can be viewed as its atomic constituent parts [17]. Figure 10.2 shows the high-level SO model of the Smart Cafeteria for the analysis phase, focusing on abstract functionalities and features and with no reference to any particular design paradigm.

Fig. 10.2 Smart Cafeteria analysis model

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

231

• SO basic info: We identified three macro-properties such as SC_L (Smart Cafeteria Location), SC_FP (Smart Cafeteria Fingerprint), and SC_PP (Smart Cafeteria Physical Properties). The SC_L provides, for each Unical Cafeteria, the GPS coordinates, and the city, namely, Rende (in Cosenza province, Italy). The SC_FP provides a unique ID for each cafeteria, the type of smart object, that is, in our case, a Smart Cafeteria, and finally the creator team. The last macro-property, the SC_PP, provides the size in terms of square meters and the capacity (i.e., number of seats) of a given cafeteria, so to possibly considering also temporary restrictions for COVID reasons. • SO user: We have identified students and professors as users of the Smart Cafeteria and employees as both users and administrators. Indeed, most of the employees only benefit of the provided services, but some of them also contribute in the service provision. • Augmentation: We identified the devices which augment the systems into the three macro-categories (i.e., sensors, actuators, and computers) defined in ACOSO-Meth. At the end-device level, the DHT11 temperature/humidity sensors are deployed into each cafeteria; the Arduino boards allow for direct controlling and retrieving values from the sensors; and finally, smartphones allow both for sensing and actuating. At the edge level, the Raspberry Pi works support computation for the Edge Intelligence, while at the cloud level, we use an online cloud platform (DigitalOcean) that is categorized always as a computer. • SO service: The services exposed by the Smart Cafeteria are mainly three. The first is the “Smart_Information,” aimed to notify users about the status of the cafeteria and rely on three operations, getTemeperature, getHumidity, and countPeople (which are sensing operations that return, respectively, the temperature, humidity, and the number of people inside the cafeteria where the users are currently in). The second and the third services share the same operation, that is, the valueAnalysis, and consist of returning values of the decision-making algorithm that runs on cloud/edge layer. The associated services are “Smart_Alert” and “Smart_Actuation”: the first is a generic alert message to the user or the administrator about possible contagion risks; the second is an action/actuation performed by the actuators installed in the cafeteria or directly by the administrator, who can open windows, suggest maintaining the proper inter-personal distance, open/close doors, etc.

10.4.2 Design Phase For the design phase, we have customized ACOSO-Meth, originally thought for “agentified” SOs, according to the flow-oriented constructs and concepts exposed by Node-RED. In such direction, we have provided a mapping between agent- and flow-oriented programming: in the place of behavior, tasks, and events, we have introduced, respectively, flow and message components, since (i) flows can be seen as tasks and behaviors exposed/executed by our system, and (ii) messages allow

232

C. Savaglio et al.

Fig. 10.3 Smart Cafeteria design model

packaging the information exchanged among the different entities in correspondence of some events, exactly as inputs or outputs of the different flows. As a result, we obtained the Smart Cafeteria design model shown in Fig. 10.3. • The MSG component includes different kinds of messages that are exchanged in our system. From the augmentation side, the “DeviceMsg” component contemplates three types of messages, aimed at supporting the decision-making algorithm for the virus spreading risk estimation: TemperatureMsg, HumidityMsg, and countPeopleMsg. The temperature and the humidity messages are either caught from the edge layer (that retrieves them from the Arduino platform and the DHT11 sensor of the end-device layer) or predicted by our Edge Intelligence system. The countPeopleMsg, instead, carries the information about the current number of people inside a cafeteria. Additional information about the service provision (e.g., user alert, administration report, etc.) flows by means of “ServiceMsg,” particularly through the “valueAnalysisMsg.” Finally, “InternalMsg” and “ExternalMsg” are exploited to, respectively, carry information relating to events raised within/outside the Smart Cafeteria. • The FLOW components describe all the Node-RED flows which are interacting in our system. We have identified three macro-flows, one for each provided service: the “SmartInformationFlow” manages the data flows for gathering temperature, humidity, and people count, namely, the “getTemperatureFlow,” “getHumidityFlow,” and “countPeopleFlow.” The other two macro-flows are the

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

233

Fig. 10.4 Scheme representing the use of neural networks

“SmartAlertFlow” and the “SmartAutomationFlow” which rely on the “valueAnalysisFlow” for the risk estimation. • Finally, we have some management components (interfaces, libraries, etc.) for direct connecting and handling the augmentation devices realizing our solution. With respect to Edge Intelligence, the local pre-elaboration of the data (i.e., data cleaning and aggregation) allows a reduction of the bandwidth consumption and the adoption of mechanisms for ensuring privacy and reliability against errors and missing values. In this direction, we designed two networks, respectively, aimed at predicting temperature and humidity values. Figure 10.4 clarifies the intended use of such networks. As already mentioned, we use two LSTM networks: their ability of catching long-term dependencies among data enabled us to choose even a large amount of samples for making the prediction. The networks have been trained and tested by using two datasets with timestamped values of temperature and humidity sensed within a closed environment. Such datasets have been pre-processed by removing some useless columns and by properly normalizing the remaining ones, with particular attention on periodic attributes such as day and minute, to cite two examples. Then, each dataset has been split in the usual 80:20 way: 80% for the training phase and the remaining 20% for the testing phase. As the final design choice, we have designed the cloud back-end as a stack of containerized applications: in particular, each component is a microservice running on a container and exposing a set of HTTP APIs to provide a means of communication and interfacing. The design of the cloud platform has been done as follows: each container exposes an HTTP-based set of APIs to allow an end user to interface with the provided services. These interactions are made easier through the Telegram and the QR reading camera applications that can be used via smartphone. A Telegram bot is used to request information about one of the monitored rooms— the cafeterias in our use case—with a simple command-based interface, native to the Telegram bots. At the same time, an end user can receive notifications about the state of the number of people in one room. The QR interface is used so that

234

C. Savaglio et al.

people coming in and out of a room can easily register their presence using their smartphone. An exception to the otherwise completely HTTP-based interface is the MQTTbased edge-cloud data flow. This choice has been done in order to exploit the publisher/subscriber paradigm, which perfectly fits the use cases of this kind of system.

10.4.3 Verification and Validation Uppaal has been exploited for checking the correct interaction and synchronization among the processes and messages exchanged among the main actors of our system, so to finally avoid possible bottlenecks or deadlocks. In particular, we have identified five templates, also called timed automata. Three of them represent the three layers involved in our architecture, i.e., the enddevice template, the edge template, and the cloud template. The last two templates represent the actors of the system: the user template for students, professors, and employees that access and consume inside the Smart Cafeteria; the administrator template, for administrators who receives advices and instructions in order to maintain the COVID risk under control within the Smart Cafeteria. End-Device Template (Fig. 10.5) This timed automaton is aimed at the synchronization between the end-device and the edge layer through the request[id]? Channel. When the Arduino is triggered for providing the updated humidity and temperature values, if it is online, it firstly sends an act to the Raspberry Pi of the edge level and then the new environmental data. Edge Template (Fig. 10.6) This timed automaton is pivoted around a Raspberry Pi that periodically asks to the Arduino the latest temperature and humidity values. In case of no response from the end-device layer (e.g., the Arduino is offline), the Raspberry Pi exploits the two neural networks and historic data for predicting current temperature and humidity values. These values are hence forwarded to the cloud layer for further processing.

Fig. 10.5 The end-device template

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

235

Fig. 10.6 The edge template

Fig. 10.7 The cloud template

Cloud Template (Fig. 10.7) This timed automaton is in charge of the data collection and of actuation measures aimed at reducing and avoiding the contagion in each Unical cafeteria. In its upper part, the template shows the environmental data/people count gathering and the actuation over the HVAC/user notification in the case of warning thresholds overcoming. In the lower part, it is shown the count people strategy, based on a QR code system monitoring the flow of users across the Smart Cafeteria. User Template (Fig. 10.8) This timed automaton handles the interaction between the QR code-based system and the cloud and vice versa, respectively, for notifying the entry or exit of users in the Smart Cafeteria, for querying the current Smart Cafeteria situation, and for alerting users if dangerous situations for virus spreading are detected. Administrator Template (Fig. 10.9) This timed automaton models the interaction between the administrator and devices of the end-user level. In particular, according to the current sensed values, the administrator orders the doors/windows opening or closing, manages (manually or automatically) the HVAC systems, etc.

236

C. Savaglio et al.

Fig. 10.8 The user template

Fig. 10.9 The administrator template

10.4.4 Implementation Phase Implementation choices performed at each stack level of our system are reported below. End-Device Layer An Arduino Uno board connected with DHT11 sensors allows sensing and transmitting the temperature and humidity values. The interaction between such two components has been implemented by using the Adafruit/DHTsensor-library, as shown in Fig. 10.10. The sensed values, formatted in JSON, reach the rest of the system through the Arduino’s USB port, and then they are processed by Node-RED flow running on the Raspberry PI.

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

237

Fig. 10.10 DHT11 wiring and function command

Edge Layer The communication between the Raspberry Pi and the cloud takes place through the MQTT protocol. A key role is played by the MQTT broker, relying on the cloud side of the system: it forwards first the data regarding temperature and humidity values toward the cloud, and then it sends actuation messages (i.e., command to implement) back to the edge layer. In order to forward correct and meaningful data to the cloud for the decision-making processes and implement effective actions to prevent the spreading of a virus, an Edge Intelligence service has been implemented as a RESTful HTTP-based service. This choice improves the robustness and the fault tolerance of the system by avoiding the transmission of meaningless data to the cloud. The Edge Intelligence service consists of two LSTM networks, implemented through the TensorFlow framework, which are utilized for replacing the missing or wrongly detected values with some predictions performed by using previously correctly sensed values. For training and testing of such networks, we utilized a dataset [20] containing records about weather conditions of the Weather Station at the Max Planck Institute for Biogeochemistry in Jena, Germany: such dataset contains 14 different types of environmental measurements, including temperature and humidity, recorded every 10 minutes. Starting from it, we derived two new datasets each aimed to be used for the training and testing our LSTM networks. In particular, in each dataset we added a new feature containing, for each record, its previous temperature/humidity value, in order to obtain better predictions. Both the storage and the forward of such values are performed by the Node-RED flow running on the Raspberry PI. The required number of samples for each network has been determined after testing different hyperparameter settings and by using the dropout technique for preventing the models’ overfitting during their training. Without going into details about the values of such hyperparameters, we report in Figs. 10.11 and 10.12 the achieved results, by comparing the predictions with the actual values. These results highlight that even a simple network allows predicting very good values and improving the system effectiveness, robustness, and fault tolerance. Cloud Layer The upper layer of our system has been implemented according to containerization principle and through the Docker engine. This allows for

238

C. Savaglio et al.

Fig. 10.11 Temperature predictions and true value comparison

Fig. 10.12 Humidity predictions and true value comparison

a separation-of-concerns-driven development, where every application is developed as a stateless microservice with HTTP APIs as communication interfaces (Fig. 10.13).

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

239

Fig. 10.13 A section of the edge-cloud interface flow

Indeed, the stateless property of these applications allows for easy replication of the internal services, thus obtaining a scalable infrastructure which is deployable onto a cloud platform with a series of virtual machines acting as virtual private servers. Therefore, a collection of cloud-based microservices has been implemented, which can be divided into exposed and internal ones. The first internal microservice consists of a Redis data store, which is utilized to store the data obtained by the before-mentioned QR codes which will be then forwarded to the decision-making algorithm, which is the second internal microservice. Beside the mechanism based on QR codes to count the people, Telegram notifications are used for warning the user about the presence of too many people inside the room, a situation which can increase the COVID spreading: an exposed microservice is hence implemented through a Python library to interact with Telegram bots and provide notifications to end users. Another exposed microservice is the MQTT broker, which is made publicly available in order to be reached by the edge device. Finally, the last microservice is both exposed and internal: it consists of the Node-RED flow for handling both the user registration process performed through the QR code and the publish/subscribe topics for the MQTT broker/clients (Fig. 10.14).

10.4.5 Deployment and Orchestration The deployment of the complete cloud back-end has been done by using Docker swarm mode, in combination with the Docker machine cli tool (see Fig. 10.15). Swarm mode allows the deployment of a stack of containerized applications across multiple machines over an interconnected network, so that the load of each service may be shared among the various servers. By using a YAML configuration

240

C. Savaglio et al.

Fig. 10.14 The cloud microservice infrastructure

Fig. 10.15 The deployed stack of microservices, managed by the swarm mode orchestrator

file, we have been able to create an infrastructure where the decision-making layer and the edge-cloud interface are replicated. This is achieved thanks to our stateless design. The architecture has been set up as using three virtual machines running

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

241

Linux Ubuntu 16.04, each with 1 GB of RAM and 25 GB of disk space. We used DigitalOcean to set up everything service-wise, with the virtual machine being hosted on their Frankfurt servers. One of these three machines is used as the master in the swarm, which is a special node that acts as a coordinator, with the other two being purely worker nodes. Additionally, a Nginx service has been set up as the entry point to the system, acting both as a reverse proxy and a load-balancer, thus spreading the incoming requests toward the virtual machines according to a roundrobin policy. In a fully deployed production-environment, a bigger architecture with at least three master nodes purely focused on managing the swarm would be preferable, but the presented approach has proven to be equally effective for the Smart Cafeteria and, in general, for this kind of medium-scale systems.

10.5 Conclusions Technology is, very likely, our best ally in the fight against COVID-19. Edge Intelligence, in particular, can help in reducing the virus spreading by providing effective solutions for both environmental and inter-personal distancing monitoring. In this chapter, we presented a Smart Cafeteria which exploits a set of heterogeneous edge devices, IoT technologies, cloud services, and two neural networks for promptly detecting and notifying dangerous situations for the users. The designed solution spans over the whole IoT stack and resulted in a fully functional prototype, based on cheap components and open-source technologies. As future work, we intend (i) testing alternative low-energy communication protocols and devices on large-scale scenarios as well as other computing paradigms like swarm intelligence [14, 33], and (ii) reasoning about the optimal deployment setting for the Smart Cafeteria, through a comprehensive simulation approach [10, 29].

References 1. Abirami, M., Saundariya, K., Yamuna, I., et al.: Contactless temperature detection of multiple people and detection of possible corona virus affected persons using ai enabled ir sensor camera. In: 2021 Sixth International Conference on Wireless Communications, Signal Processing and Networking (WiSPNET), pp. 166–170. IEEE (2021) 2. Akbarzadeh, O., Baradaran, M., Khosravi, M.R.: Iot-based smart management of healthcare services in hospital buildings during covid-19 and future pandemics. Wirel. Commun. Mobile Comput. 2021 (2021) 3. Al-Humairi, S.N., Kamal, A.A.A.: Opportunities and challenges for the building monitoring systems in the age-pandemic of covid-19: Review and prospects. Innov. Infrastruct. Solut. 6(2), 1–10 (2021) 4. Anastasi, G., Bartoli, C., Conti, P., Crisostomi, E., Franco, A., Saponara, S., Testi, D., Thomopulos, D., Vallati, C.: Optimized energy and air quality management of shared smart buildings in the covid-19 scenario. Energies 14(8), 2124 (2021)

242

C. Savaglio et al.

5. Balado, J., Díaz-Vilariño, L., González, E., Fernández, A.: An overview of methods for control and estimation of capacity in covid-19 pandemic from point cloud and imagery data. Smart and Sustainable Technology for Resilient Cities and Communities, 91–105 (2022) 6. Bashir, A., Izhar, U., Jones, C.: Iot based covid-19 sop compliance monitoring and assisting system for businesses and public offices (2020) 7. Chimmula, V.K.R., Zhang, L.: Time series forecasting of covid-19 transmission in canada using lstm networks. Chaos Solitons Fractals 135, 109864 (2020) 8. Cicirelli, F., Guerrieri, A., Mercuri, A., Spezzano, G., Vinci, A.: Itema: A methodological approach for cognitive edge computing iot ecosystems. Futur. Gener. Comput. Syst. 92, 189– 197 (2019) 9. Cisneros, B., Ye, J., Park, C.H., Kim, Y.: Covireader: using iota and qr code technology to control epidemic diseases across the us. In: 2021 IEEE 11th Annual Computing and Communication Workshop and Conference (CCWC), pp. 0610–0618. IEEE (2021) 10. D’Angelo, G., Ferretti, S., Ghini, V.: Simulation of the internet of things. In: 2016 International Conference on High Performance Computing & Simulation (HPCS), pp. 1–8. IEEE (2016) 11. Fernández-Caramés, T.M., Froiz-Míguez, I., Fraga-Lamas, P.: An iot and blockchain based system for monitoring and tracking real-time occupancy for covid-19 public safety. In: Engineering proceedings, vol. 2, p. 67. Multidisciplinary Digital Publishing Institute (2020) 12. Floris, A., Porcu, S., Girau, R., Atzori, L.: An iot-based smart building solution for indoor environment management and occupants prediction. Energies 14(10), 2959 (2021) 13. Fortino, G., Russo, W., Savaglio, C., Shen, W., Zhou, M.: Agent-oriented cooperative smart objects: From iot system design to implementation. IEEE Trans. Syst. Man Cybern. Syst. 48(11), 1939–1956 (2017) 14. Godio, A., Pace, F., Vergnano, A.: Seir modeling of the italian epidemic of sars-cov-2 using computational swarm intelligence. Int. J. Environ. Res. Public Health 17(10), 3535 (2020) 15. Hasan, M.W.: Covid-19 fever symptom detection based on iot cloud. Int. J. Electr. Comput. Eng. 11(2), 1823 (2021) 16. Hoang, M.L., Carratù, M., Paciello, V., Pietrosanto, A.: Body temperature—indoor condition monitor and activity recognition by mems accelerometer based on iot-alert system for people in quarantine due to covid-19. Sensors 21(7), 2313 (2021) 17. Leppänen, T., Savaglio, C., Fortino, G.: Service modeling for opportunistic edge computing systems with feature engineering. Computer Communications 157, 308–319 (2020) 18. Mallik, R., Hazarika, A.P., Dastidar, S.G., Sing, D., Bandyopadhyay, R.: Development of an android application for viewing covid-19 containment zones and monitoring violators who are trespassing into it using firebase and geofencing. Trans. Ind. Natl. Acad. Eng. 5(2), 163–179 (2020) 19. Mehta, S., Grant, K., Atlin, C., Ackery, A.: Mitigating staff risk in the workplace: the use of rfid technology during a covid-19 pandemic and beyond. BMJ Health Care Inf. 27(3) (2020) 20. Multivariate Temperature Forecasting.: https://www.kaggle.com/c/csc578f18-finalproj/data (2018), [Online] Accessed 12 April 2022 21. Nakamoto, I., Wang, S., Guo, Y., Zhuang, W., et al.: A qr code–based contact tracing framework for sustainable containment of covid-19: Evaluation of an approach to assist the return to normal activity. JMIR mHealth uHealth 8(9), e22321 (2020) 22. Nasser, N., Emad-ul Haq, Q., Imran, M., Ali, A., Razzak, I., Al-Helali, A.: A smart healthcare framework for detection and monitoring of covid-19 using iot and cloud computing. Neural Comput. Appl., 1–15 (2021) 23. Pasini, D., Ventura, S.M., Rinaldi, S., Bellagente, P., Flammini, A., Ciribini, A.L.C.: Exploiting internet of things and building information modeling framework for management of cognitive buildings. In: 2016 IEEE International Smart Cities Conference (ISC2), pp. 1–6. IEEE (2016) 24. Petrovi´c, N., Koci´c, Ð.: Iot-based system for covid-19 indoor safety monitoring. Preprint. IcETRAN 2020, 1–6 (2020) 25. Ploennigs, J., Ba, A., Barry, M.: Materializing the promises of cognitive iot: How cognitive buildings are shaping the way. IEEE Internet Things J. 5(4), 2367–2374 (2017)

10 Edge Intelligence Against COVID-19: A Smart University Campus Case Study

243

26. Ranaweera, P., Liyanage, M., Jurcut, A.D.: Novel mec based approaches for smart hospitals to combat covid-19 pandemic. IEEE Consum. Electron. Mag. 10(2), 80–91 (2020) 27. Razavi, M., Alikhani, H., Janfaza, V., Sadeghi, B., Alikhani, E.: An automatic system to monitor the physical distance and face mask wearing of construction workers in covid-19 pandemic. SN Comput. Sci. 3(1), 1–8 (2022) 28. Rinaldi, S., Bittenbinder, F., Liu, C., Bellagente, P., Tagliabue, L.C., Ciribini, A.L.C.: Bidirectional interactions between users and cognitive buildings by means of smartphone app. In: 2016 IEEE International Smart Cities Conference (ISC2), pp. 1–6. IEEE (2016) 29. Savaglio, C., Fortino, G.: A simulation-driven methodology for iot data mining based on edge computing. ACM Trans. Internet Tech. (TOIT) 21(2), 1–22 (2021) 30. Singh, R.: Cloud computing and covid-19. In: 2021 3rd International Conference on Signal Processing and Communication (ICPSC), pp. 552–557. IEEE (2021) 31. Torres, C.M.C., Gomez, J.F.V., Carvallho, J.J., Trujillo, E.L., Tinjaca, N.B.: Implementation of industry 4.0 technologies in embedded systems for contagion mitigation and covid-19 control in work areas. In: 2020 Congreso Internacional de Innovación y Tendencias en Ingeniería (CONIITI), pp. 1–6. IEEE (2020) 32. Yacchirema, D., Chura, A.: Safemobility: An iot-based system for safer mobility using machine learning in the age of covid-19. Procedia Comput. Sci. 184, 524–531 (2021) 33. Zedadra, O., Savaglio, C., Jouandeau, N., Guerrieri, A., Seridi, H., Fortino, G.: Towards a reference architecture for swarm intelligence-based internet of things. In: International Conference on Internet and Distributed Computing Systems, pp. 75–86. Springer (2017) 34. Zeroual, A., Harrou, F., Dairi, A., Sun, Y.: Deep learning methods for forecasting covid-19 time-series data: A comparative study. Chaos Solitons Fractals 140, 110121 (2020)

Chapter 11

Structural Health Monitoring in Cognitive Buildings Raffaele Zinno, Giuseppe Guido, Francesca Salvo, Serena Artese, Manuela De Ruggiero, Alessandro Vitale, and Antonio Francesco Gentile

11.1 Introduction Structural health monitoring (SHM) is based on the observation of structures and the periodic collection of measures that allow the identification and assessment of any damage. It makes it possible to establish the current state of health of buildings or infrastructure in order to assess the possibility to safe use them. The purpose of the SHM is, therefore, to acquire information about the structural behavior of a building and the consequent interactions with the surrounding structures and infrastructures. Damage can be defined as a change introduced in a structural system that adversely affects its current or future functioning. It can be identified and quantified through a comparison between two different system conditions, one of which is considered representative of the initial state, usually intact. For structures, the definition of damage is limited to changes in material and/or geometric properties, as well as boundary conditions and connectivity of the system, which adversely affect its performance. The effects of the damage are accentuated when the system is subjected to operating loads that cause the structure to lose efficiency. The damage can progressively increase over time, such as in the case of corrosion or stress phenomena, and also

R. Zinno () · F. Salvo · S. Artese · M. De Ruggiero University of Calabria, Department of Environmental Engineering, Rende, Italy e-mail: [email protected]; [email protected]; [email protected] G. Guido · A. Vitale University of Calabria, Department of Civil Engineering, Rende, Italy e-mail: [email protected]; [email protected] A. F. Gentile ICAR-CNR, Rende, Italy e-mail: [email protected] © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_11

245

246

R. Zinno et al.

lead to the collapse of the structure, or it can occur in short periods of time, as in the case of natural events such as earthquakes and landslides. Through the recognition, the simple observation, and the survey of the structures it is possible to detect, as an example, the cracking state, but it’s not possible to classify it as stabilized or in evolution, and, therefore, the damage cannot be quantified. Through the survey activities, through reverse engineering operations, it is possible to reconstruct the project data and then an as built model [1]. For this reason, it is useful to plan a continuous monitoring activity to observe over time the variation of the cracking state, the degradation of the materials, and the presence of failure. This activity also makes it possible to assess the performance of the building in the operating conditions or during unforeseeable or exceptional events. In this way, the full functionality of the structure can be monitored throughout its life cycle, the actual extent of any damage can be assessed, and any maintenance, seismic improvement, or structural reinforcement can be planned [2]. Data collected during monitoring activity, both static and dynamic ones, are compared with the results of an analysis based on a finite element model of the undamaged structure [3]. The quantification of the differences between the results allows to modify the input values of the parameters inserted in the finite element model (FEM) in order to obtain a representative model of the structure in a certain moment. According to Farrar et al. [4], the SHM can be summarized in four phases: (a) operational evaluation: it allows to outline the process of identifying the damage; (b) data acquisition, normalization, and cleaning: the acquisition concerns the selection of the solicitation method, the type of sensors to be installed, their number, their location, and data acquisition in hardware memories. The normalization of the data collected by the sensors according to results of same operating cycles and similar environmental conditions allow the comparison of the measurements carried out. Data cleaning is used to select the data to be passed to the next step; (c) feature section and information condensation: through the correlation of quantities measured by the system, such as the amplitude of the vibrations or the frequency, and the observation of the state of degradation, it is possible to distinguish between undamaged and damaged structures; (d) statistical model development for feature discrimination: the resolution of algorithms allows the quantification of the damage status of the structure. Regarding the identification of damage, Rytter proposes the following hierarchical structure [5]: (1) damage detection, returns qualitative information on the possible presence of damage on the structure; (2) damage location, returns information on the probable location of the damage; (3) damage assessment, returns information on the extent and/or location of the damage; and (4) prediction: returns information on structural safety such as the residual life of the structure. Moreover, monetary damage is configured as economic damage when the modification concerns the stock of capital and the flow of income [6]. Economic damage is at the same time loss of value concerning a certain stock of capital (damnum emergens, emerging damage) and alteration, or interruption, of a series of future income (lucrum cessans, loss of profit). The first type is attributable to

11 Structural Health Monitoring in Cognitive Buildings

247

the amount of expenses necessary to eliminate or contain the harmful effect; the second, on the other hand, concerns the decrease in utility due to the worsening of the qualitative/quantitative characteristics of the affected property. The cost of restoring the damaged asset represents the material damage, while the financial damage equals the present value of future lost income. In general terms, it is still possible to distinguish tangible damage from intangible damage. In principle, the damage manifests itself as: • Change in inputs (increase in costs) and/or in outputs (decrease in revenues) relating to the affected economic activities. The damage therefore derives from the compromise of productive resources. • Reduction of the degree of well-being in a broad sense. The damage derives from the alteration of nonproductive resources. Therefore, it’s necessary to identify structural parameters such as displacements, deformations, and tensional state. It is also important to determine, with a certain frequency, the actions and the loads applied to structural elements in order to identify the modal parameters of the structures in the operating conditions. It is extremely complex to have full and complete knowledge of all structures and components and, therefore, to make a reliable numerical assessment. For this reason, we use both instrumental approaches, determining the tensional state and deformative phenomena in the working state, and a historical-documentary investigation that allows to identify the structural supporting elements. The latest structural health monitoring systems are based on intelligent methods (intelligent-based structural health monitoring) [7]. These techniques allow damage identification with high precision and reliability, including the use of low-cost ad hoc sensors [8] and experimental techniques [9]. The various activities carried out in this direction will be described in the context of the PON – COGITO project, with which we have tried to achieve these goals. We will then add also estimative analyzes that lead to an evaluation of the economic damage that has occurred, or that could be generated, if the predictions of the SHM were not considered to implement adequate maintenance. The article is basically divided into four paragraphs, one consequent to the other. After this introduction, in fact, in Sect. 11.2 we will discuss the techniques for structural monitoring and the tools, hardware, and software, used to achieve the purpose; later in the third paragraph, we will explain how to pass from simple SHM to cognitive building, also through the use of AI. The fourth paragraph will detail a case study that will demonstrate how the whole is applicable to a concrete case. Finally, the last paragraph will draw the conclusions of the above and will project itself towards possible future activities.

248

R. Zinno et al.

11.2 Structural Monitoring Techniques The main aims of the SHM are to assess the risk to which the structure is exposed, to identify damage, and to predict the structure lifetime. Damage detection techniques can be grouped into (a) local monitoring techniques and (b) global monitoring techniques. Local damage detection methods provide point information of individual structural elements or their parts. Information about characteristics of the load-bearing elements, materials, and their state of alteration is obtained. Local monitoring techniques are based on nondestructive testing (NDT) [10, 11] ranging from visual inspection to more advanced methods. At the base of the visual inspection, there is a detailed description of the building and sufficient information about its history. It provides a general picture of the cracking state, deterioration of materials, and sources of damage. The damage cannot be detected in depth. The evaluation of the concrete compressive strength is carried out by sclerometric or pull-out tests, while the geometry of the steel reinforcing bars is measured using the magnetometric technique or x-ray and gamma radiography. The infrared thermography [12] allows to evaluate the materials heterogeneity, the diagnosis of building diseases, monitoring, and mapping the installations. Material defects can also be investigated by endoscopic testing. The ultrasonic technique is widely used for detecting defects (cracks, porousness) in compact materials such as stone, terracotta, wood, and concrete [13]. Global monitoring enables the analysis of the whole structure and the verification of its bearing capacity. A technique used to verify whether the structure is damaged or not is based on vibration [14]. This type of detector uses sensors to measure the modal properties of the structure like mode shapes and natural frequency. Changes in the modal properties correspond to changes in physical properties such as mass, stiffness, and damping. Vibrations from environmental noise (traffic, construction sites, etc.) or vibrations induced by the use of vibrodine [15] can be used. For the valuation of the structural damage induced by an event, several strategies exist such as (1) the comparison with the project ground acceleration, (2) the timehistory of acceleration during movement and nonlinear dynamic analysis of the structure by a posteriori FEM, and (3) the comparison of modal characters before, during, and after the event. All these strategies have certain limitations. For strategy (1) it is known that the dynamic response of a structure depends not only on the intensity of movement in terms of acceleration to the ground but also on the frequency characteristics of the input, information that is lost by monitoring only the maximum acceleration value applied. The strategy (2), which is certainly more in-depth, depends heavily on the structural model and hence the uncertainty of the method in determining the effects of the event. For the strategy (3), finally, it is stressed that the dynamic properties of a building are modified in case of major

11 Structural Health Monitoring in Cognitive Buildings

249

damage, while for limited damage, the variations in parameters can be confused with those induced by thermal variations. As stated in introduction, SHM can provide the current state and behavior of a structure through the analysis of a large amount of data acquired by devices and sensors installed in specific important locations across the structure. This characteristic allows the detection of anomalies, assessing the reliability of the structure after the catastrophic event, and identifying corrective measures before the damage escalates to more costly or riskier levels [16]. Such advantages of SHM and its application in various ambits (bridges, towers, tunnels, etc.) have led to acquiring big data, which, for their analysis and handling, requires powerful and sophisticated computational techniques. For these reasons, recently, the application of artificial intelligence (AI) in SHM problems has got a rapid growth. The AI application in computer science emerged between the 1950s and 1970s generating various successful applications in several subfields such as robotics [17, 18], data mining [19], and agent systems [20]. However, in civil engineering field, AI has been employed only in recent years in SHM applications dealing with knowledgebased systems [21], fuzzy logic algorithms [22], and artificial neural networks [23]. Among the AI approaches described before, machine learning (ML) algorithms are defined as a subset of AI methodologies that uses statistical models to improve the accuracy of machines by understanding the structure of data and then fitting it into models [21]. The different ways in which machine could learn are supervised, unsupervised, or reinforcement learning. Supervised learning approach (SL) joins labels or captions to the features of the objects, providing a learning scheme with labeled data, dealing with regression, and classification problems. In the SHM field, SL can be used, for example, to detect the type and severity of damage [24]. On the other end, unsupervised learning makes use of the unlabeled data as learning process. An example is the detection of the existence of damage through clustering structural response data. In summary, ML procedure is based on a series of iterations, involving the input (database), the selected algorithm, and the output. At the end of each iteration, researchers can decide to stop or restart the process by providing some feedback. The process finishes providing an accurate and wellpredicted result. In the next section, are described in detail the steps of ML process. In the last 10 years, different machine learning (ML) and deep learning (DL) algorithms were employed in SHM applications including bridges and high-rise buildings. A first group of approaches and techniques is based on artificial neural networks (ANN). Gonzalez et al. [25], in 2008, used a neural network (NN)-based model that was characterized by two main approaches. The calibration phase of the model was made on a healthy structure. The second approach consisted in the intend to identify the damage structure after a seismic event. Their output consists in a prediction of the mass and the stiffness of the structure to provide a damage indicator. The model performs very well and provide a robust and significative damage prediction. Chang et al. [26], in 2018, improved the approach of Gonzalez et al., developing a model useful not only to detect the damage but also to localize it and determine the overall severity for the estimation of the structural performance of

250

R. Zinno et al.

the damaged members. The case studies were a seven-story building with multiple damaged columns and a scaled twin tower with weak braces installed in some floors. Considering the bridges, ANN, were applied in California for the assessment of several indicators as aging, long-term structural parameters, mass, and stiffness [27]. Another group of studies used back-propagation neural networks (BPNNs). Considering buildings, a research developed by Fan et al. [28], in 2015, highlighted different applications of back-propagation (BP) algorithms for the detection and the identification of the severity of the damage. The first application considers the identification of the damage of a reinforced concrete frame structure through the use of the changing ratio of modal strain energy. The second one treated damage location and its degree in a simply supported beam, coupling BPNN with finite element simulation. Another application studied the damage degree in a four-story steel frame structure with a simulated wind load. A very interesting study in the bridge ambit developed a BP algorithm to monitor the variation of the deflection of Hubei Danjiangkou bridge deck in China [29]. In that study the BPNNs were employed also in the routine monitoring stage in pile settlement. This parameter was determined and predicted on the basis of pile placement sequence. Other two important applications of BP algorithm in bridges are for the Louisville, Kentucky, truss bridge in the USA [30] and for the Yangtze River Bridge in China [31]. In the first case, the bridge was interested by a massive monitoring campaign to measure different parameters (frequency, mode shapes, etc.) for the determination of damage potential of truss joints. In the second case, for the Yangtze Bridge, girder elevation changes were monitored taking the data of cables’ tension values and deflection parameters. More recently, respect ML approaches were developed DL approaches to perform more advanced tasks using innovative algorithms [32]. For the SHM applications, this kind of algorithms are applied for the detection of defects as cracks, efflorescence, steel exposure, fatigue in steel structures etc., using imagebased crack detection. This new approach, based on convolutional neural networks (CNNs), automatically, overcomes difficulties connected with the random nature of shapes, the irregular size of cracks, and different lighting conditions. The research progress gives the opportunity to find several pre-trained networks as GoogLeNet [33], ResNet [34], and VGG-16 [35]. Earliest studies, with the aim of classifying structures in damaged or not damaged through the presence of crack or not, used CNNs adding some features to pre-trained network transfer learning (TL) [36]. Using the output features of VGG-16, Dung et al. [37] (2019) earlier detected fatigue cracks in gusset plate joints of steel bridges. The authors employed the output features of VGG-16, pre-trained with the dataset called ImageNet, after fine-tuning the top layers of VGG-16 to achieve a better precision. There are, in literature, a lot of successful applications of this technique for crack detection [38–42]. A few numbers of CNN-based researches, instead, using images, detected cracks calculating also its width and length. For example, Kim et al. [43], in 2018, used CNNs with images captured by unnamed aerial vehicles (UAV) and determined the cracks’ dimensions using image pixels. Another algorithm typology is the support vector machine (SVM) which is particularly used in bridges’ health monitoring. In order to detect and localize

11 Structural Health Monitoring in Cognitive Buildings

251

damage, Li et al. [44], in 2018, used radial basis function for optimizing the input, obtaining a good accuracy. Chongchong et al. [45], in 2011, used SVM to determine damage in Hangzhou Bridge using strain vibration, distortion, and cable tension. SVM algorithms were applied also for the evaluation of the correct position of piers of California Bridge, in the Humboldt Bay [46].

11.3 Cognitive Buildings The significant cultural, economic, and social shift brought about by the Fourth Industrial Revolution has increased the value of information and communication technologies, models, strategies, and new paradigms characterized by a high degree of interconnection and automation useful to live a new human, social, and productive dimension. One of the main aspects of these new scenarios is the planning of physical or digital environments in which human beings and technological systems interact in increasingly connected, intelligent, and interactive ecosystems. You can see the perspective of spaces of the future: environments that, thanks to connected devices and networks, will improve the level of comfort and well-being, but also to work with greater productivity. The goal is to improve the quality of life of people in flexible and cognitive contexts. Smart spaces are physical or digital environments in which people and technologies interact in evolved and digital ecosystems and are characterized by openness, connection, coordination, and intelligence. They are developed thanks to products and systems (security, sensors, displays, cameras, energy monitoring, automation, lighting) and technologies (Internet of things, artificial intelligence, ICT, connectivity, basic technologies, and advanced software) that through their integration work together creating collaborative and responsive environments at the service of people. Digital spaces can be designed on different scales. On a large scale, we use to think of smart cities and urban spaces designed to improve and innovate public services, so as to connect physical infrastructure with human capital, thanks to the widespread use of technologies, aiming at improving the quality of life and meeting the needs of citizens, businesses, and institutions: intelligent spaces in which urban ecosystems interact virtuously. The next scale is that of cognitive buildings, whose systems are managed in an intelligent and automated way to ensure the efficient operation of the plants, reduction of energy consumption, reduction of operating costs, increase of safety, historical documentation, and more generally the welfare of the inhabitants. They are also more environmentally friendly: thanks to efficient energy management, waste and the emission of harmful substances into the air are reduced. Most multistorey green buildings are designed to house a BAS (building automation system) for the conservation of energy, air, and water, so cognitive buildings use IoT technologies that lead to major cost and efficiency savings. Increasing the safety of

252

R. Zinno et al.

a building means making sure that facilities and facility-structures work at their best by continuously monitoring its state and operating, for example, predictive maintenance. Through the digitization of buildings (building information modeling, BIM), it’s possible to implement the digital twin of the building. It will perfectly adhere to the technical information of the real building. Coupled to a system of sensors, it is able to communicate with users and provide data on the behavior of the building subject to exogenous or endogenous forcing, and it allows proper management and monitoring of the building. To provide a building of an instrumental monitoring system means to install in the structure a system, consisting of a number of sensors, that is, devices able to measure physical quantities, a data storage and processing unit, and data transmission elements. The system is managed in real time by a software, which allows not only the automatic operation of the components but also the extraction of the relevant features. Permanent monitoring systems may be used together with land-based seismic monitoring systems for the implementation of early seismic alarm systems (early warning) in order to increase seismic protection capacity [47]. The various research groups dealing with structural monitoring have made a considerable effort to identify better techniques and tools intended to improve both the reliability and the efficiency of the monitoring systems through solutions that increase the performance of the various components of the system. Schematically a permanent monitoring system consists of four elements: (a) a network of sensors of various types placed permanently on a structure and able to detect both the structural response to external stresses and both the environmental quantities that may affect it; (b) a data collection and transmission system that can operate via wired systems or not; (c) a procedure for data analysis for structural diagnosis; and (d) a decision-making and alert system for managing emergency situations. Type and density of the instrumentation that constitutes a seismic warning system depend on the objective of the system itself and on the detail with which the behavior of the structure is to be investigated. The architectures become, therefore, intelligent, active, and interactive. They are able to learn from the user behavior, the so-called deep learning [48], and to apply predictive engineering in order to optimize comfort and energy consumption and thereby reduce environmental impact. Buildings provided with monitoring system are also called smart homes, a residence that uses Internet-connected devices to enable the remote monitoring and management of appliances and systems, such as lighting and heating. It provides homeowners security, comfort, convenience, and energy efficiency. Population needs and habits have changed, and, in order to have a house that literally meets these trends, it is essential to install systems that are able to communicate with each other and meet the specific needs of each of us. This interconnection and exchange of data between objects is called machine learning, i.e., machines that learn. All these objects will begin, partly with the setting information provided directly, partly through a self-learning mechanism, to analyze habits, information, and data about people’s lifestyle. These objects not only observe

11 Structural Health Monitoring in Cognitive Buildings

253

Fig. 11.1 Building location

and learn but can be used as personal assistants to remember events or change the temperature of the house and lighting, insert an alarm system, and even order shopping online. Objects despite their impersonality and coldness try to make us feel more at ease, which serve and assist in all domestic activities. The cognitive capacity for the building can only be obtained by combining the innovative techniques of SHM with AI. Only through this synergy, in fact, it is possible to reach points 2, 3, and 4 of Rytter’s hierarchical scale. A neural network, trained with the damage cases studied computationally, may be able to provide information on the probable location of the damage and its extent and, by linking everything to a statistical analysis, lead to a prediction of the residual life of the structural element and of the structure as a whole.

11.4 Case Study About the case study, we have considered a building once used as an elementary school, now a congress center and headquarters of the Civil Protection. It’ s located in Scigliano, in the province of Cosenza in Calabria, Italy, with geographical coordinates: lat. 39 07 ‘39 “north, long. 16 18’ 47” east (Fig. 11.1). Diano is one of the nine historic villages of Scigliano, located in a panoramic position on the southern side of the Savuto valley; it’s characterized by alleys, wide streets, and squares. Ancient noble palaces and churches testify the importance it had in the past, in the period in which Scigliano was a Royal City of Naples Kingdom.

254

R. Zinno et al.

Fig. 11.2 First floor map

The building consists of two levels not internally connected: a first level, the basement, and a second level with porch, which is accessed through external staircase. The layout of the building is quite regular. The basement has a covered area of about 75 square meters, while the first floor has a surface of 487 square meters distributed on two staggered internal levels. The development in elevation is variously articulated, from a minimum of 3.00 m up to a peak of 5.80 m. The coverage is therefore made up of a set of slopes with variable inclination and orientation. The basement is currently unused and not yet completed in the finishes, while the first floor is finished in all its parts; the distribution of the spaces is organized with a large living room, on the sides of which several rooms and some toilets are located. On the first floor (Fig. 11.2), it is possible to enter through an external porch that can be reached by road ramp or by using an external staircase that leads to a partially covered balcony. The structure is made of reinforced concrete, and it is divided into two bodies separated by a technical joint. In particular, the frames are transversely connected by reinforced concrete beams with different cross-section, 30 × 40 cm, 40 × 40 cm, 35 × 45 cm, 40 × 65 cm, and 40 × 85 cm. The load-bearing framework is therefore composed of reinforced concrete pillars with constant section 40 × 70 cm except those arranged on the rear side, which have section 40 × 40 cm. A continuous direct foundation system has been used, consisting of a series of inverted beams placed below the load-bearing frames. It should be noted that the floor of the building, being the entire structure frames divided into two sections, is not unique. The building has recently been seismic improved through the insertion of steel elements (beams and columns sez. 14 × 14) placed in the basement and heightvariable reticular beams at the level of the cover floor (Fig. 11.3). We have decided to implement a BIM model in order to have the information models, which are the integration of design and construction processes and the interoperability. These advantages result in better quality at lower costs and reduced intervention times. Therefore, the digital reconstruction of the demonstrator was carried out, obtaining an accurate and complete virtual model.

11 Structural Health Monitoring in Cognitive Buildings

255

Fig. 11.3 Seismic improvement interventions

The digital twin contains a very precise geometry and a series of extremely important information necessary for the construction, manufacture, and management of the building process, as well as a series of functions that allow monitoring the life cycle of the building, providing the conditions for the feasibility of building interventions and a good working basis for experimental analysis. The existence of a BIM model has made it possible to improve the construction and decision-making process that characterizes the project, ensuring communicability and updating between the different working groups. The approach to existing structures requires the knowledge, as deep as possible, of their geometry to obtain the so-called as built, to be compared with the project. In the case of dated structures, usually it’s not possible to have complete design drawings; for this reason, it is essential to carry out a major activity aimed at reconstructing the execution methods and decomposing the building into the elements considered and dimensioned during the design phase. For the case study, once a part of the documentation was acquired at the Municipal Technical Office, it was necessary to carry out some surveys and to start a survey campaign to reconstruct geometries and to complete the available information. ® As for the surveying, a Disto Electronic Distance Measurer (EDM) was used. The instrument has a maximum range of 100 meters without reflector plate and 200 meters with reflector plate; the measurement accuracy is 1.0 mm. It is equipped

256

R. Zinno et al.

Fig. 11.4 Building fronts

with an integrated 360 degree tilt sensor; by combining the measurements of angles and inclined distances, other data can be obtained indirectly (horizontal distances, slopes). The EDM is also equipped with an integrated 4x camera, which allows to view the position of the laser point on the display and to materialize, consequently, the line of sight. The comparison between the dimensions of the design drawings and those obtained by the surveys showed a substantial correspondence, taking into account the building tolerances for the reinforced concrete structures (a few cm) and the thickness of the plaster. For this reason, the project drawings were considered geometrically correct for non-accessible areas, such as foundations and roofs. The reconstruction of the building facades (Fig. 11.4) was carried out using rectified images obtained with an analytical procedure. Using at least four known coplanar points with known coordinates, measured by total station, orthogonalized images were obtained. The rectified images of the facades can be used as a texture of the 3D model in order to make it more realistic. The position of the openings of the elevations was consistent with that obtained through the measurements carried out inside the building. Once all the building facades had been reconstructed and, therefore, all the respective orthogonalized images had been obtained, the state of decay was analyzed. The analysis showed that there were no cracks or signs of structural failure in the facades. In order to assess the presence of any failure due to ground movements, the verticality of the edges of the building was verified. Measurements were performed with a Leica 1200+ total station. The instrument was positioned on different point stations, so that it can optimally collimate all of the edges. For each edge, points were scanned, lying on a vertical plane passing through the axis of the station (z). For each scan, x and y mean values were obtained. For each surveyed point, the deviation from the mean coordinate was calculated both in orthogonal and tangential directions to the plane of the considered wall. The offset of each edge was plotted in a graph. We observe that all the edges are vertical. Deviations are contained within the building tolerances, i.e., less than one centimeter. The structural model of the building was then carried out (Fig. 11.5), taking into account the different structural frames as well as the level of the foundation. According to the structural model, the architectural one (Fig. 11.6) has been digitized and connected by BIM.

11 Structural Health Monitoring in Cognitive Buildings

257

Fig. 11.5 Structural model

Fig. 11.6 Architectural model

The BIM model is particularly useful for displaying and positioning sensors for simulating the seismic behavior of buildings. The availability of a three-dimensional model makes it possible to identify with greater precision the exact point of installation of the accelerometers on the structural element (base and/or top of the columns). In order to acquire structural health data, sensors were installed in the building. It is also possible to acquire data from remote sensors such as remote sensing satellites and drones, compatibly with atmospheric conditions. Accelerometric, inclinometric, and strain measurement (strain gauges) sensors are positioned on buildings. Accelerometric sensors are based on MEMS technology, while for inclinometric sensors, in addition to MEMS, electrolytic vials are used; they allow greater precision, even if the response times are longer. All the elementary sensors send their data to a hub, also equipped with a GNSS satellite positioning system, a processing unit, and a data transmission and reception system, connected to an operating center. There may also be cameras that provide images useful to assess any damage present on adjacent buildings. After a dynamic analysis of the structure, which made it possible to identify the main modes of vibration and vibration frequencies, the installation of eight accelerometers at the top and/or at the base of some pillars of the structure is planned; they are series connected, starting from a central unit placed in a room of the building with limited access. The dedicated room hosts the pc/controller, a switch, and a 4G router, kept inside a cabinet. As shown in Fig. 11.7, the positioning of the sensors follows a precise path; their serial connection is developed starting from the control unit.

258

R. Zinno et al.

Fig. 11.7 Positioning of sensors

The monitoring network includes the installation of a series of eight triaxial accelerometers MEMS low-noise and inclinometer Dewesoft IOLITE 3xMEMS-

11 Structural Health Monitoring in Cognitive Buildings

259

Fig. 11.8 Dewesoft accelerometer and inclinometer IOLITE 3xMEMS-ACC

ACC (Fig. 11.8), inserted in an advanced acquisition system with integrated accelerometer, an A/D converter and EtherCAT interface shared with the IOLITE DAQ platform. The system allows to record the accelerations along X, Y, and Z, and at the same time it is possible to calculate, in real time, derived quantities such as speed, displacement, and, thanks to the DC values of the accelerations, the inclinations.

11.5 Conclusions and Future Activities Continuing the research initiated by the previous PON-DOMUS research project which made it possible to enable the building to send warning signals if its behavior had changed so much as to presume damage and therefore a negative change in its structural health, sought in the PON-COGITO project to make the building cognitive. In the spirit of Ritter’s classification which sees four steps, damage detection, damage location, damage assessment, and damage prediction, we try to reach the last step. This work presented all the work that brought together the techniques of SHM with those of artificial intelligence and the generation of a digital twin through BIM. In particular, the monitoring techniques that refer to the determination of the dynamic characteristics of the building, whether intact or damaged, were described, and then the main AI techniques used in civil engineering were described; finally it was shown how has come, for a specific building located in the municipality of Scigliano, to the generation of a BIM model on which to integrate the various information and the various methods of analysis that will then produce the digital twin. Currently, as part of the PON COGITO project, the accelerometric network has been installed, and the first data are being acquired that will allow both to learn and to make the neural network that will lead to prediction operational. In a near future article, therefore, starting from what is illustrated in this chapter, the operation of

260

R. Zinno et al.

the whole system now developed and described to connect SHM, BIM, and AI will be shown. As for further activities, the realization of a dynamic GIS is planned, in order to collect data from sensors located on buildings and road structures. In each monitored building, sensors will transmit the acquired values to a data processing center with a fixed frequency. Among all sensors, accelerometers, inclinometers, and gyroscopes can be particularly useful for seismic emergency. The occurrence of significant events, such as an earthquake, activates the sensors that transmit their acquisitions in real time. The values sent by the sensors are stored in a database and compared with previously defined threshold values. The exceeding of a threshold activates a series of actions ranging from the verification of the data acquired to the activation of streaming videos provided by the web cameras positioned on the building and on the adjacent ones. This will be useful to verify if a harmful event occurs. Once the harmful event has been ascertained, a buffer with a width equal to the height of the damaged buildings will be generated, and the obstructions on the roads will be identified. The location of the obstacles will allow the updating of the road graph which will contain the roads that can actually be traveled and the identification of the paths that the emergency vehicles will have to follow. Drones will be activated for aerial shooting, compatibly with atmospheric conditions. The streaming of aerial shots will also allow to have a view of the damage and the location of the points which primarily intervene to rescue the inhabitants. As well as being disseminated to rescue vehicles, data on passable routes will be sent online to inform the inhabitants about the exodus routes, in order to move away from particularly devastated areas.

References 1. Artese, S., Lerma, J. L., Zagari, G., Zinno, R.: The survey, the representation and the structural modeling of a dated bridge – Proceedings of the 8th International Congress on Archaeology, Computer Graphics, Cultural Heritage and Innovation ‘Arqueológica 2.0’ in Valencia (Spain), Sept. 5–7, 2016 (2016) 2. Huston, D.: Structural sensing, health monitoring, and performance evaluation. CRC Press (2011) 3. Brownjohn, J.M.: Structural health monitoring of civil infrastructure. Philos. Trans. R. Soc. A Math. Phys. Eng. Sci. 365(1851), 589–622 (2007) 4. Farrar, C.R., Doebling, S.W., Nix, D.A.: Vibration–based structural damage identification. Philosophical transactions of the Royal Society of London. Series A: Math. Phys. Eng. Sci. 359(1778), 131–149 (2001) 5. Rytter, A.: Vibration based inspection of civil engineering structures. In: Ph.D. dissertation, Department of Building Technology and Structural Engineering. Aalborg University, Denmark (1993) 6. Artese, S., De Ruggiero, M., Salvo, F., Zinno, R.: Economic convenience judgments among seismic risk mitigation measures and regulatory and fiscal provisions: The Italian case. Sustainability. 13(6), 3269 (2021)

11 Structural Health Monitoring in Cognitive Buildings

261

7. Paul, S., Jafari, R.: Recent advances in intelligent-based structural health monitoring of civil structures. Adv. Sci. Technol. Eng. Syst. 3(5), 339–353 (2018) 8. Artese, G., Perrelli, M., Artese, S., Meduri, S., Brogno, N.: POIS, a low cost tilt and position sensor: Design and first tests, pp. 1424–8220. Sensors, ISSN (2015) 9. Artese, S., Zinno, R.: TLS for dynamic measurement of the elastic line of bridges. Appl. Sci. 10(3), 1182 (2020) 10. Hellier, C.J.: Handbook of nondestructive evaluation. McGraw-Hill Education (2013) 11. Maierhofer, C., Reinhardt, H.W., Dobmann, G.: Non-destructive evaluation of reinforced concrete structures: Non-destructive testing methods. Elsevier. (2010) 12. Bagavathiappan, S., Lahiri, B.B., Saravanan, T., Philip, J., Jayakumar, T.: Infrared thermography for condition monitoring–A review. Infrared Phys. Technol. 60, 35–55 (2013) 13. Rose, J.L.: Ultrasonic guided waves in structural health monitoring. In: Key engineering materials, vol. 270, pp. 14–21. Trans Tech Publications Ltd. (2004) 14. Carden, E.P., Fanning, P.: Vibration based condition monitoring: A review. Struct. Health Monit. 3(4), 355–377 (2004) 15. Zinno, R., Artese, S., Clausi, G., Magarò, F., Meduri, S., Miceli, A., Venneri, A.: Structural health monitoring (SHM). In: The internet of things for smart urban ecosystems, pp. 225–249. Springer, Cham (2019) 16. Flah, M., Nunez, I., Ben Chaabene, W., Nehdi, M.L.: Machine learning algorithms in civil structural health monitoring: A systematic review. Arch. Comput. Meth. Eng. 28, 2621–2643 (2021). https://doi.org/10.1007/s11831-020-09471-9 17. Brooks, R.A.: (a). Intelligence without representation. Artif. Intell. 47(1–3), 139–159 15 (1991) 18. Brooks, R.A.: (b). New approaches to robotics. Science. 253(5025), 1227–1232 (1991) 19. Wu, X.: Data mining: Artificial intelligence in data analysis. In: Proceedings. IEEE/WIC/ACM international conference on intelligent agent technology, (IAT 2004), p. 7. IEEE (2004) 20. Weiss, G.: Multiagent systems: A modern approach to distributed artifcial intelligence. MIT Press, Cambridge (1999) 21. Farrar, C.R., Worden, K.: Structural health monitoring: A machine learning perspective. Wiley, Hoboken (2012) 22. Omar, T., Nehdi, M.L.: Mat-713: evaluation of ndt techniques for concrete bridge decks using fuzzy analytical hierarchy process (2016) 23. Amezquita-Sanchez, J.P., Adeli, H.: Signal processing techniques for vibration-based health monitoring of smart structures. Arch. Comput. Meth. Eng. 23(1), 1–15 (2016) 24. Smarsly, K., Dragos, K., Wiggenbrock, J.: Machine learning techniques for structural health monitoring. In: Proceedings of the 8th European workshop on structural health monitoring (EWSHM 2016), Bilbao, Spain, pp. 5–8 (2016) 25. González, M., P, Zapico, J., L.: Seismic damage identification in buildings using neural networks and modal data. Comput. Struct. 86(3–5), 416–426 (2008) 26. Chang, C.M., Lin, T.K., Chang, C.W.: Applications of neural network models for structural health monitoring based on derived modal properties. Measurement. 129, 457–470 (2018) 27. Soyoz, S., Feng., M., Q.: Long-term monitoring and identification of bridge structural parameters. Computer-Aided Civil Infrastruct. Eng. 24(2), 82–92 (2009) 28. Fan, J., Yuan, Y., Cao, X.: Developing situation and research advances of structural damage detection using Bp network. In: 2015 4th national conference on electrical, electronics and computer engineering. Atlantis Press (2015) 29. Peng, J., Zhang, S., Peng, D., Liang, K.: Application of machine learning method in bridge health monitoring. In: 2017, 2nd international conference on reliability systems engineering (ICRSE), pp. 1–7. IEEE (2017) 30. Frangopol, D.M., Soliman, M.: Life-cycle of structural systems: Recent achievements and future directions. Struct. Infrastruct. Eng. 12(1), 1–20 (2016)

262

R. Zinno et al.

31. Yuansong, L., Xinping, L., Aiping, Y.: The prediction method of long-span cable-stayed bridge construction control based on bp neural network. In: Proceedings of the 9th WSEAS international conference on Mathematical and computational methods in science and engineering, pp. 217–222. World Scientific and Engineering Academy and Society (WSEAS) (2007) 32. LeCun, Y., Bengio, Y., Hinton, G.: Deep learning. Nature. 521(7553), 436 (2015) 33. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556 (2015) 34. Wu, Z., Shen, C., Van Den Hengel, A.: Wider or deeper: revisiting the resnet model for visual recognition. Pattern Recogn. 90, 119–133 (2019) 35. Jain, P.: Image classifcation w/ VGG16 weights. (2018). https:// www.kaggle.com/pankul/ image-classifcation-w-vgg16-weights/notebook. Accessed 11 Jan 2022. 36. Yang, X., Li, H., Yu, Y., Luo, X., Huang, T., Yang, X.: Automatic pixel-level crack detection and measurement using fully convolutional network. Computer-Aided Civil Infrastruct. Eng. 33(12), 1090–1109 (2018) 37. Dung, C.V., Sekiya, H., Hirano, S., Okatani, T., Miki, C.: A vision-based method for crack detection in gusset plate welded joints of steel bridges using deep convolutional neural networks. Autom. Constr. 102, 217–229 (2019) 38. Dorafshan, S., Thomas, R.J., Maguire, M.: Comparison of deep convolutional neural networks and edge detectors for image-based crack detection in concrete. Constr. Build. Mater. 186, 1031–1045 (2018) 39. Lee, D., Kim, J., Lee, D.: Robust concrete crack detection using deep learning-based semantic segmentation. Int. J. Aerospace Sci. 20(1), 287–299 (2019) 40. Li, S., Zhao, X., Zhou, G.: Automatic pixel-level multiple damage detection of concrete structure using fully convolutional network. Computer-Aided Civil Infrastruct. Eng. 34(7), 616–634 (2019) 41. Murao, S., Nomura, Y., Furuta, H., Kim, C.-W.: Concrete crack detection using uav and deep learning (2019) 42. Zhang, Y., Sun, X., Loh, K.J., Su, W., Xue, Z., Zhao, X.: Autonomous bolt loosening detection using deep learning. Struct. Health Monit. 1475921719837509 (2019) 43. Kim, I.-H., Jeon, H., Baek, S.-C., Hong, W.-H., Jung, H.-J.: Application of crack identification techniques for an aging concrete bridge inspection using an unmanned aerial vehicle. Sensors. 18(6), 1881 (2018) 44. Li, X., Xi, H., Zhou, C., Gu, W., Gao, T.: Damage degree identification of crane girder based on the support vector machine. In: 2018 prognostics and system health management conference (PHM-Chongqing), pp. 920–924. IEEE (2018) 45. Chongchong, Y., Jingyan, W., Li, T., Xuyan, T.: A bridge structural health data analysis model based on semi-supervised learning. In: 2011 IEEE international conference on automation and logistics (ICAL), pp. 30–34. IEEE (2011) 46. Bulut, A., Singh, A.K., Shin, P., Fountain, T., Jasso, H., Yan, L., Elgamal, A.: Real-time nondestructive structural health monitoring using support vector machines and wavelets. In: Advanced sensor technologies for nondestructive evaluation and structural health monitoring, pp. 180–189. International Society for Optics and Photonics (2005) 47. Wu, S., Beck, J.L.: Synergistic combination of systems for structural health monitoring and earthquake early warning for structural health prognosis and diagnosis. In: Kundu, T. (ed.) Health monitoring of structural and biological systems 2012 (2012) 48. Cicirelli, F., Fortino, G., Giordano, A., Guerrieri, A., Spezzano, G., Vinci, A.: On the Design of Smart Homes: A framework for activity recognition in home environment. J. Med. Syst. 40(9), 200:1–200:17 (2016)

Chapter 12

Development of Indoor Smart Environments Leveraging the Internet of Things and Artificial Intelligence: A Case Study Michele De Buono, Nicola Gullo, Giandomenico Spezzano Andrea Vennera, and Andrea Vinci

,

12.1 Introduction This study presents an innovative solution for the intelligent management of indoor environments intended to be occupied by a large number of people at the same time. The solution focuses primarily on the management of meeting rooms. It is based on a system that acquires and processes information to create a comfortable and efficient environment for the people who live in it every day. Meeting rooms are shared spaces in which it is possible to carry out events of different nature. They are usually designed to accommodate a large number of people and effectively meet all the needs of event organizers and participants. Generally, the management of events or meetings is characterized by a series of activities that are not automated, thus arising the occurrence of inconveniences that can negatively affect the management of the event. The activities that generally characterize an event can be divided into two macro-groups: • Activities related to the organization of the event • Activities related to the management of the event in progress In a standard meeting room, the operator in charge of managing the event performs all these activities simultaneously. He should coordinate the event while ensuring satisfactory comfort in the room regarding temperature and air quality. In addition, the Covid-19 pandemic has complicated the management of indoor

M. De Buono · N. Gullo · A. Vennera SCAI Lab srl, Rende, Italy e-mail: [email protected]; [email protected]; [email protected] G. Spezzano · A. Vinci () Institute for High Performance Computing and Networking of the National Research Council of Italy (ICAR-CNR), Rende, Italy e-mail: [email protected]; [email protected] © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_12

263

264

M. De Buono et al.

activities [3] by introducing new regulations and practices related to sanitizing rooms, safety distance, and limitations on the number of contemporary participants. These new requirements make the work of meeting room managers even more difficult. In order to meet these requirements, it is necessary to check sensors, actuators, and appliances frequently while taking into account the presence and correct arrangement of the participants in the room during an event [7]. The manager should also schedule events carefully, avoiding possible overlapping and also considering possible delays. This leads to the need to automate as much as possible the phases related to the organization and management of events in meeting rooms, thus simplifying and minimizing human intervention. In the case of the smart meeting room prototype proposed in this study, all activities concerning the efficient management of an indoor environment are automated by the implemented system that is responsible for integrating, processing, and analyzing the data provided by the set of smart objects installed in a meeting room. This system is fully autonomous and is able to understand, integrate, and communicate information from the smart devices in order to make decisions to manage the event and ensure a comfortable environment for users by actuating on the available devices and appliances. The rest of the chapter is organized as follows: Sect. 12.2 discusses related work; Sect. 12.3 presents the use cases and requirements defining a smart meeting room; Sect. 12.4 shows the design of the presented application, involving both hardware and software components; Sect. 12.5 discusses the implementation of the behaviors that meet the requirements previously given; and Sect. 12.6 concludes the paper and mention some ongoing and future works.

12.2 Related Work In recent years, the combined use of computer vision and IoT technologies has triggered a real revolution in various sectors and areas, introducing significant changes in the management of indoor environments such as offices or homes [4]. To date, several studies have been conducted in the IoT field focused on using smart objects to realize “smart” meeting rooms. These implementations have been enriched by integrating the advantages of using computer vision. The studies summarized below present a review of recent research that explores the different types of the use of IoT tools and applications developed for the intelligent management of indoor environments. The common goal of the considered studies is to transform traditional indoor environments into intelligent spaces, taking advantage of the latest developments recorded in the IoT and computer vision fields. In such aspects, the study in [10] presents an application whose primary goal is to transform a standard meeting room into a smart meeting room using sensing, processing, and actuation units. The state of the room is thus subject to monitoring and control operations to optimize consumption and remotely activate a series of

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

265

automatic processes that allow managing temperature, lighting, and the projection of multimedia content. The application also allows collecting various environmental measurements during the meeting, such as temperature, humidity, brightness, energy consumption, and presence. The services offered by the prototype described in the study can be classified into three distinct types: sensory measurement services, processing services, and implementation services. The scenarios defined by the application involve a meeting in the smart meeting room. When the first user enters the room, he is greeted by a synthetic voice from the speakers, and the lights turn on. The cameras estimate the number of people present, while environmental sensors measure temperature, humidity, brightness, and the possible presence of certain types of gases (e.g., CO2 , CO). When the meeting is about to start, the projector turns on, the intensity of the lights lowers, and a welcome announcement is played from the speakers. Throughout the meeting, the room sensors are monitored, and the AI application decides on its own if the status of the cooling/heating devices needs to be changed. When the meeting ends and no people are detected in the room, the lights, projector, and cooling/heating devices are turned off. The smart meeting room system defined by this study is based on automation and neglects the aspects that characterize a system that can be described as adaptive to the needs of the users, thus presenting obvious limitations. In addition, the solution cannot distinguish the type of user entering the room, while comfort levels are based solely on qualitative user ratings. At the same time, the video system does not provide for the recognition of gestures by users or assemblies that may be created within the room. The study published in [9] concerns the monitoring of smart homes and smart meeting rooms that has become possible thanks to advances in the use of IoT sensors, actuators, and communication protocols introduced in recent years. Through this research work, a case study is described in which four meeting rooms are monitored to obtain information about their use. The results show the possibility of implementing a simple sensing system whose output could be used to develop more advanced control strategies. In particular, the described methodology shows some of the possibilities that a simple IoT network installation can offer, and several usage models have been developed with satisfactory levels of accuracy. Comparing room bookings with actual usage shows that environments are often misused. The study focuses on the development of control strategies aimed at better resource management and does not involve the use of cognitive video sensors of any type. In this regard, the paper [11] presents an approach to counting and monitoring people attending a meeting in each smart room. The approach, based on IoT, proposes a motion detection module, a people counting module, and a monitoring module. The output provided by the individual modules is an input to a decision module that controls the environment autonomously. The study demonstrates satisfactory results using simple low-resolution cameras and presents a people counting and monitoring scheme adapted to the needs of a smart meeting room. However, the method works well in an office environment but lacks accuracy when used in a meeting room where cameras are placed farther away and often at unfavorable angles. The study has a future goal of testing the application in larger meeting rooms (auditoriums, theaters, cinemas) by adding more cameras.

266

M. De Buono et al.

The study in [1] asserts that the Internet of Things (IoT) has become an emerging research area thanks to the simplicity with which hardware and software components interact. The study proposes an IoT-based smart sensing system for meeting rooms, enabling real-time situation monitoring in the room. The system proposed in the study uses a temperature and humidity sensor, a barometric pressure sensor, and a gas sensor, communicating through Bluetooth. Specifically, the study aims to provide a prediction model that ensures a healthy environment for the smart meeting room. For this purpose, the implementation of five different classification algorithms has been considered. From the verification of the results, it is shown that the proposed models outperform the other classifiers considered in terms of accuracy. However, the study focuses exclusively on improving comfort within meeting rooms, neglecting all other aspects that characterize the behavior of a smart meeting room. The study described in [2] proposes a solution dedicated to educational spaces and oriented to the realization of a “smart classroom” through the use of IoT tools. The approach is based on the automated control and management of electrical equipment such as fans or lights, aiming to build a solution that can reduce energy exploitation. The authors tried to exploit PIR (passive infrared sensor) and tactile sensors to detect human presence in the classroom. However, due to the high cost of the tactile sensors and their expected wear and tear, they chose to exploit a detection based on cameras. This method provides the same information result but at a much lower economic and implementation cost. The paper presents a flexible, scalable, and low-cost solution for the intelligent management of a classroom. However, the solution has limitations in that the cognitive system only detects the presence and not the positioning of people inside the room and does not manage indoor comfort. Moreover, since it is a system designed for educational spaces, it focuses on energy saving by not considering important features that an intelligent system should consider, such as room reservation or management of an ongoing event. Interesting developments in this context are due to the Covid-19 phenomenon that has influenced the use of indoor environments. Creating a healthy environment has interested much research during the last years that mainly focuses on distinguishing between healthy and infected environments through sensory systems. In these respects, IoT technology has provided a big contribution due to the use of smart sensors capable of detecting the state of an enclosed environment in terms of air quality, presence of fumes, gases, carbon monoxide, and other substances that can harm the health of those who constantly occupy such environments. The paper in [5] focuses on creating an IoT and blockchain-based system for monitoring real-time occupancy of a room and for public safety concerning Covid19. The pandemic has caused several limitations, primarily physical distancing, to reduce the possibility of contracting the virus in private and public spaces. The study presents an IoT system based on autonomous wireless devices that allows a realtime estimation of occupancy levels in public spaces such as buildings, classrooms, businesses, or transportation. Unlike smartphone-based tracking applications, which require active user involvement (e.g., to launch a mobile app or enable Bluetooth communications), the study’s proposed system relies on wearable, autonomous

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

267

wireless devices that do not require user actions after power-up. The proposed solution has some limitations when building a smart meeting room system. For example, it focuses on room occupancy and the enforcement of anti-Covid-19 regulations but does not consider room comfort. In addition, wearable systems are not suitable for use in places with many people. They could be the cause of several inconveniences since there is uncertainty about the number of devices to have and the correct use of them. The Covid-19 phenomenon strongly influences the smart management of indoor spaces that are particularly characterized by the use of sensors that measure indoor air quality. The study described in [8] analyzes indoor air quality monitoring systems. As already specified, indoor air quality has been of concern to the international scientific community during this period so much that, to date, there are several sectors involved in the process of improving the comfort, safety, and overall well-being of people occupying buildings. Covid-19, however, is not the only problem. Repeated exposure to indoor air pollution is reported to be one of the potential causes of several chronic diseases, such as lung cancer, cardiovascular disease, and respiratory infections. The study presents a systematic review of the current state of the art in IoT air quality monitoring systems. It highlights critical implementation issues of studies published in the previous 5 years (2015–2020) and design issues for monitoring systems such as sensor types, micro-controllers, architecture, and connectivity. The results presented by the study show that 70%, 65%, and 27.5% of the studies focused on monitoring thermal comfort parameters, CO2, and PM levels, respectively. In addition, 37.5% and 35% of the systems are based on Arduino and Raspberry Pi controllers.

12.3 Smart Management of Indoor Spaces A smart meeting room (SMR) is an environment integrated with devices, hardware, and software tools that support smart technologies to create a highly productive experience for participants (remotely or in-person) [1, 9] and enable stakeholders to meet, collaborate in a synchronized manner, and work together effectively, no matter where they are. In many cases, this type of solution is also accompanied by automated reservation systems that provide information on the occupancy status of one or more rooms and facilitate the booking of available rooms [10]. In order to be defined as smart, a meeting room must be equipped with a series of intelligent devices capable of guaranteeing an effective level of communication or an integrated system that allows displaying time slots in which the room is available for booking, scheduling meetings, sending invitations to participants, providing realtime information on the status of the rooms, and constantly interacting with the installed devices in order to generate a comfortable environment. Innovative SMR applications acquire information through a system of sensors, integrating the use of microphones and cognitive cameras. The information provided by the cameras (sets of frames) is processed through computer vision techniques. Analyses of this type

268

M. De Buono et al.

are supported by the study of deep learning models that allow systems designed to classify images according to their characteristics. Among these, convolutional neural networks (CNN or ConvNet) are recognized to be suitable for detecting image features and details [12]. On the other hand, to make the planning of an event and its management more efficient, it is necessary to consider all the possible needs of both organizers and potential users to make the most of the network of smart devices available. The main requirements that characterize the management of a smart meeting room concern: • • • • • • • •

The detection of the number of accesses to the room Detection of attendance, distinguishing between speakers and listeners Identification of the arrangement of people in the room Recognition of the nature and origin of sounds Recognition of gestures of people in the room Checking the air quality in the room Recognition of possible discomfort situations Recognition of objects in the room

These needs can be met by interacting with a set of smart devices installed in the room. To understand the complexity and potential of a system based on the use of cognitive devices, we can consider the frames acquired by a cognitive camera installed in a meeting room. By means of computer vision techniques and people tracking, starting from these frames, it is possible to obtain different kinds of information: the number of people present in the room, the position in which they are, the free or occupied seats, the request for intervention through a hand raise and much other information that can support an intelligent system to verify that the people present in the room respect the pre-established rules and maintain a behavior appropriate to the environment in which they are, and simplifying the management of the event itself. An SMR can exploit such technology and IoT devices to optimize energy consumption, as well as to provide a comfortable environment in real time. The implementation of an SMR has potential impacts: • • • •

On operating costs On user satisfaction On meeting scheduled timelines On the use of resources

The SMR application here presented aims at managing three scenarios (see Fig. 12.1), which are described in the following. The first scenario focuses on the smart management of event creation activities. The scenario considers closed-number events (the number of speakers and listeners is defined) and open events (only the number of speakers is defined). The event creation phase is of interest to the user who intends to organize a meeting for a specific date and time. This phase can be managed at any time and is supported by a web application that allows booking the room and sending invitations to guests, distinguishing between speakers and listeners. Speakers can upload the attachments,

12 Development of Indoor Smart Environments Leveraging the Internet of. . . 1∞ Scenario

2∞ Scenario

3∞ Scenario

when the room is booked

time before the event

event in progress

Booking meeting room

Event Creation

Web App

Pre-Event

Start-Event

269

Event management

Smart Hostess

Fig. 12.1 Event planning

which will be discussed during the meeting. The use of a web application to create events minimizes human error by avoiding conflicts between event schedules. In addition, having a constantly updated overview of the occupancy of one or more meeting rooms, the sending of invitations, and the simultaneous collection of attachments simplify the organization of a meeting. This scenario for closed-number events provides space management compliant with anti-Covid-19 regulations. On the day before the event, the SMR checks if the number of seats available in the room is sufficient to ensure seating for all guests. If this is not the case, the system sends an e-mail in advance to the logistics office with a request to adjust the seating in the room within the maximum limits of its availability. The second scenario starts 10 minutes before the time for which the created event is set to start and focuses mainly on the registration of the event invitees and the start of the monitoring algorithms by the SMR, which will remain running until the end of the event. The registration of event attendees affects the beginning of the event. In this regard, two conditions have been identified for the event to start: • The presence of at least one speaker and 90% of the participants (closed event) • The presence of at least one speaker (open event) If the starting condition for the event is met, the system: • Communicates with the intelligent panel that updates the message displayed, specifying that the meeting is in progress • Adjusts the intensity of the lights • Starts the projector • Sends an e-mail to all guests who have not yet registered, containing a reminder message and a link to remotely follow the live streaming of the meeting (only for closed events) Before the event starts, the SMR checks the comfort in the room by monitoring the values provided by the temperature, humidity, and air quality sensors. If these values do not respect the pre-set thresholds, the system activates the respective actuators (thermostat or fans) to restore the comfort in the room.

270

M. De Buono et al.

The third scenario focuses on the management of the event in progress. For the entire duration of the event, the cognitive system manages the dimming of the lights, the control of gestures of the people present in the room, and the management of comfort levels. In particular, the lights in the room undergo continuous modulation of intensity and can be directed to the area in which there is the speaker or a possible interlocutor who has requested an intervention. As far as gestures are concerned, the cognitive system recognizes and distinguishes the gestures of the people present in the room, distinguishing between a request for a speech and a coffee break (the latter reserved exclusively for speakers). Comfort analyses and control are performed by the SMR, as specified in the previous scenario. As shown in Fig. 12.1, the first scenario includes the booking and the daybefore-event phases, the second scenario includes the pre-event management, and the third scenario includes the event management. Based on different types of information provided by the sensor system that characterizes the proposed solution, the intelligent monitoring system constantly processes statistics and indicators to support the management and monitoring of the smart meeting room. Specifically, a sensor system is composed of a set of sensors and actuators that constantly interface to retrieve data and manage situations that negatively affect environmental comfort. In the case of the proposed solution, a software component, namely, the smart hostess agent, is the core of the application and has the task of coordinating smart objects and external services for supporting the management of each phase of the event life cycle. In the specific case of the proposed application, the smart meeting room will perform the following behaviors: • Continuous verification of compliance with social distancing • Management of the gestures of people in the room (requests for intervention/coffee breaks) • Intelligent management of lighting • Management of environmental comfort • Continuous noise control • Verification of the invitees present at the event A description of the behaviors listed above follows. Continuous Verification of Compliance with Social Distancing Recent regulations regarding social distancing introduced due to Covid-19 prohibit gatherings in both indoor and outdoor locations. In the context of a smart meeting room, it is possible to constantly verify the presence of a crowd in the room using the detections provided by one or more cognitive cameras. Through innovative computer vision techniques, it is possible to process the measurements provided by these devices. In particular, by detecting the occupied seats, it is possible to verify that the safety distance is maintained, and, at the same time, it is possible to identify groups of people positioned at a close distance. In both cases, a crowd is identified if, from the last n surveys, the safety distance of at least 1 meter between the people

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

271

sitting is not respected or groups of several people positioned in an area that does not guarantee the distance are observed. The information processing will make it possible to label the seats in the room as free or occupied. This type of analysis will be affected by the fact that: • The camera views the room in perspective in three-dimensional space. • The view of seats further away from the camera may be obscured by objects closer to the camera. • The cognitive camera cannot always recognize the occupied seat. It is possible to overcome these drawbacks by jointly analyzing the information provided by multiple points of view (multiple cognitive cameras) positioned at different angles of the meeting room. In this way, considering, for instance, three cognitive cameras placed at different points of the room, a generic seat will be considered occupied if two out of three cognitive cameras identify the generic seat as such. Management of the Gestures Thanks to the application of computer vision techniques to the data provided by the cognitive cameras installed, it is also possible to monitor the gestures coming from both the participants and the speakers. In the proposed solution, a value is attributed to the raising of hands: • Request to speak, if the person raising his/her hand is in the audience • Coffee break request, if the person raising his/her hand is in the speakers’ row Intelligent Management of Lighting Another aspect that affects the optimal management of an event is the management of the intensity of the lights in the room. By using dimmable bulbs, it is possible to adjust the intensity of the light in different areas of the room, according to the meeting needs. In the context of a smart meeting room, the goal is to manage the intensity of the light beam produced by each bulb according to the needs dictated by the event, as specified below: • 100% intensity a few minutes before the start of the event • 90% intensity on the speakers and 10% on the audience as soon as the event starts • 90% intensity in the area from which a request for intervention originates and 10% in the remaining areas affecting the audience • 10% intensity at the end of the event Management of Environmental Comfort The analysis of environmental comfort in the room involves information from several smart devices, namely, smoke or gas sensors and air quality sensors. The sensor system provides a set of information to be analyzed in order to verify correspondence with predetermined comfort thresholds. If these parameters are not met, the following devices are appropriately activated:

272

M. De Buono et al.

• Thermostat (temperature control) • Fans or air extractors (air recirculation, presence of humidity, fumes, and gases) Noise Management The intelligent management of a meeting room should also consider the aspects related to the presence of noise in the room. By analyzing the information coming from a cognitive microphone (see Chapter 6), it is possible to monitor the noise in the room, in order to better manage the beginning and the course of the event. This device allows for distinguishing the direction, intensity, and nature of the noises coming from the audience. If a noise threshold is exceeded, those present in the room may be asked not to disturb, thus reducing the noise in the room generated by the participants. Verification of the Invitees Present at the Event The verification of the invitees present at the event is crucial, affecting the start of the event itself. By using a QR code reader, it is possible to verify the presence of the event participants among the guests. This device is installed at the entrance of the room and allows access to the meeting only to guests who register using a QR code received via e-mail and the invitation itself. In this way, the system is able to identify the number of people present among all the participants and trace the absentees, comparing the registered QR codes and those sent by invitation. This information is exploited to send a reminder e-mail with a link to the live meeting to the absent guests. The information about the present invitees is also used to evaluate the conditions that decree the start of the meeting.

12.4 Smart Meeting Room Application Components In this section, the design of the smart meeting room is given. Here, we present both the hardware and software components considered for the creation of the considered application, their relations, and the different communication protocol exploited among them. The considered meeting room is shown in Fig. 12.2.

12.4.1 Smart Objects The information needed to operate a smart meeting room system is mostly retrieved from a set of smart objects deployed in the room. Those smart devices are shown in Fig. 12.2 and listed in Table 12.1. Table 12.1 distinguishes between “sensors” and “actuators” smart objects. The term sensor here refers to smart objects that are active at any time with the task of

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

273

Fig. 12.2 The considered meeting room. The picture was taken by one of the deployed cognitive cameras Table 12.1 List of the deployed smart objects in SMR

Smart object Illuminance Temperature/humidity Smoke Gas CO/CO2 Doors/windows Cognitive camera QR code reader Cognitive microphone Presence Dimmable bulbs Thermostat Fans Smart panel Smart projector

Typology Sensor Sensor Sensor Sensor Sensor Sensor Sensor Sensor Sensor Sensor Actuator Actuator Actuator Actuator Actuator

collecting information and measures about the environment, while the term actuator refers to smart objects that are able to process requests for performing actions on the environment, thus changing its state. The available smart objects are coordinated by a system based on the COGITO platform (see Chapter 1); thus the main behavioral components, such as the previously introduced smart hostess, are implemented as

274

M. De Buono et al.

software agents. According to the COGITO platform, the communication between smart objects and agents is mediated by virtual objects. A description of the exploited smart objects follows: The illuminance smart object is used to ensure the efficient management of the lights in the room, detecting the illuminance in lux. In the context of the implemented solution, it is used by the smart hostess to verify the state of the light intensity in the room. The presence smart object is installed in the room for occupancy assessment. The smart hostess reads the measures detected by it (0 if there are no people, 1 if presence is detected) to verify the presence of people in the room. Other smart objects installed in the smart meeting room are the door/window smart objects. These devices can determine whether a door (or window) is correctly closed or not (0 if closed, 1 if open). The smart object used to monitor the temperature and humidity of the environment is suitable for indoor climate comfort management applications and ensures low power consumption. In the context of the proposed solution, the sensor has dual functionality. The smart hostess reads from the sensor the values of temperature (−5◦ C to 50◦ C) and relative humidity (0% to 100%) to perform the environmental comfort control. For air quality control, the proposed solution uses smart devices capable of detecting the presence of gases (combustible and polluting), fumes, CO, and CO2. Ensuring that there is no trace of combustible gases in the air is necessary for the evaluation of the healthiness of an indoor environment. The smart hostess reads the gas sensor readings (0 if absent, 1 if present) to verify its presence. The smart object used to detect the presence of polluting gases in the room, high concentrations of particulate matter (pm10, pm2.5), and formaldehyde is used by the smart hostess to verify the presence of polluting gases, attributing a value of 0 if there are no gases, 1 if there are gases in the environment. The smoke smart object monitors the presence of smoke in the environment and guarantees low consumption considering sporadic communications that signal the exceeding of some concentration thresholds. In the context of the implemented smart meeting room, the smart hostess reads the measures of the sensor to verify the presence of smoke. The CO smart object assesses if carbon monoxide is present in the air. As with the other smart object, the smart hostess analyzes the CO sensor readings (allowable values between 0 and 1) to verify the presence of an unsafe concentration of carbon monoxide in the environment. The cognitive camera is the smart object installed to monitor attendance, people’s behavior, and objects in the room. Two cognitive cameras have been installed without overlapping their visual range, one directed toward the audience and one toward the row of speakers. Each camera is connected via Ethernet cable and powered by PoE (Power over Ethernet). The smart hostess receives from the cognitive camera, every n seconds, and through an HTTP endpoint, an array of information related to identified objects/people. Based on this information, the system evaluates:

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

275

• The raising hand (for coffee break and intervention) • The social distancing • The available seats In particular, the smart hostess perceives, through the cognitive camera that frames the speakers, the request for a coffee break (raising of hands). If the same gesture is detected by the cognitive camera that points to the audience, the smart hostess perceives a request for intervention. In order to verify social distancing, the smart hostess reads from the cognitive camera the information about the people present and computes the distance between people, identifying possible gatherings. Using a similar technique, the number of available seats in the room is verified. A cognitive microphone (see Chap. 6) is a smart object used by the smart hostess to perform noise control in the room, useful for detecting sound sources. It is used to intercept the time when the speaker starts to speak or to detect the area where the noise in the room comes from. The smart hostess reads from the cognitive microphone the information related to noise sources in order to assess their intensity and origin. The thermostat is considered an actuator as it is used to set the temperature in the room. This smart object represents the control element of the fan coils present in the room. It is connected to the system through a Wi-Fi network. In this case, the smart hostess sends inputs to the thermostat to set the desired temperature, which varies between 10◦ C and 30◦ C. The suction fan belongs to the category of actuators and is activated to ensure the quality of the air in the rooms, performing recirculation with the outside to decrease the concentration of carbon monoxide or particulate matter. The fans installed in the smart meeting room, powered by the electrical network, are connected to a Wi-Fi network. The smart hostess in this case analyzes the readings of the humidity sensor and, if necessary, sends the input for the activation of the device. The smart panel is used in the implemented prototype to display the salient information of the event sent by the smart hostess in the form of human-readable messages. The smart projector installed in the room is used to start, view, and manage the presentations that the speakers intend to discuss during the event. The smart hostess can request the smart projector for managing the presentation uploaded for the current event. The documents shown by the smart projector are managed by an e-mail grabber software component (see Chap. 5), which is responsible for acquiring and making available the attachments uploaded by the speakers to the link received via e-mail. In particular, during the registration phase of an event through a web app, an e-mail is sent to the guests containing an identification code (QR code) and a link (only in the case of speakers) through which it is possible to upload the files to be shown during the meeting. In the implemented solution, a linear and two-dimensional QR code reader was used to verify the identity and number of guests attending the event. This tool interacts with the database where the QR codes sent to the guests are stored, in order to verify the correspondence between the scanned codes and those sent by invitation.

276

M. De Buono et al.

In particular, the tool captures the QR code shown by the participant who intends to register for the event and sends the information to an endpoint. The reading device used is wired with a USB cable and supports the automatic and sequential reading of different types of barcodes.

12.4.2 Software Components Figure 12.3 specifies the main software components and the communication protocols exploited between the components and the smart objects of the proposed SMR application. In the proposed solution, the software components are hosted on a set of Raspberry Pi 4 nodes, directly deployed in the meeting room environment. The core of the application is the smart hostess agent, which manages and coordinates all the other components of the smart meeting room. It is worth nothing that all the smart objects introduced in the previous section, and not depicted in Fig. 12.3, are managed by the so-called smart meeting room agent, which furnishes a set of message-based API to the smart hostess agent for interaction with them. This is due for separation of concerns; thus the smart hostess agent could be developed for implementing intelligent behaviors without bother to managing the deployment of the software components required to manage such set of heterogeneous smart objects. For executing its operation, the smart hostess agent directly exploits two software services, namely, (i) the booking web application, which provides a web interface

Fig. 12.3 Communication protocols between components. All the smart objects not depicted here are managed by the smart meeting room agent

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

277

Home

Booking

Consultation

Rooms

Support

My Booking

Fig. 12.4 Navigation diagram of the booking web application

frontend for users, and (ii) a relational database, which manages information and data persistence. Thesmart hostess agent manages the decision-making process by implementing several behaviors that analyze the information content provided by the other components of the SMR so as to make decisions and send actuation requests, in accordance. As instance, at each detection made by sensors, a behavior is undertaken in order to assess whether the value recorded by the sensor is admissible (on the basis of some predefined thresholds) or not. If it is not, the smart hostess undertakes specific behaviors and sends activation inputs to actuators in order to restore optimal conditions. In addition to monitoring the sensors in the room, the smart hostess also interfaces with the web application used for booking the meeting room for an event. In this case, the smart hostess receives the input relative to the creation of an event from the web application and sends the invitation mails to the addresses indicated during the creation of the event itself, distinguishing between speakers and participants. The booking web application supports the smart hostess as it allows the user to interface with the system. Through this web frontend, the system supports users in managing several aspects related to the organization of an event: • • • • • • •

Checking of the occupancy status of meeting rooms Automatic sending of e-mail invitations Collection of e-mail attachments for presenters’ discussions Access to the information about the events scheduled for the meeting rooms Access to the description of each meeting room Support to the user during the booking phase Monitor the status of the event through all its phases

The booking web application consists of five modules accessible from the home page, each of which allows you to perform operations related to the creation, booking, and consultation of an event (see Figs. 12.4 and 12.5).

278

M. De Buono et al.

Fig. 12.5 Booking web application home page

12.5 Management of the Conference System in Indoor Environments The solution implemented for the smart management of a meeting room satisfies different needs, identified by the three different scenarios introduced in Sect. 12.3. This section describes how the smart hostess agent coordinates the other application components in order to meet the requirements given by each scenario.

12.5.1 Management of the Booking of the Smart Meeting Room First scenario (see Fig. 12.6) concerns the creation of an event and the management of bookings in meeting rooms. This phase includes the analysis and verification of a number of aspects aimed at performing: • The booking of the room for a specific time • Verification of room availability • Verification of the capacity of the room The last case takes into consideration the recent regulations on social distancing and consists of a service that is activated the day before the event in order to send in time any notifications to the office that manages the furnishing of the smart meeting room. In the event that the number of available chairs is not sufficient to guarantee seating for all the guests, the system sends an e-mail in time to the logistics office with the request for adjustment of the room within the maximum

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

279

Fig. 12.6 First scenario: services and use cases

Fig. 12.7 Second scenario: services and use cases

capacity, specifying the number of participants in the event and the number of seats at the time of verification.

12.5.2 Event Management in the Pre and Start Phases Second scenario (see Fig. 12.7) involves the start of activities that affect the preevent and the start of the event. In this context, the terms pre and start refer to the 10 minutes leading up to an event and the start of the event itself. It is necessary to distinguish different use cases depending on whether the event is private or public. Pre-event Phase The service for the pre-event phase includes the management of all the activities carried out 10 minutes before the start of an event. Ten minutes before the start of the event, the panel of the smart meeting room shows a message announcing the approaching of the event. This behavior is managed autonomously by the smart hostess that activates and sends a message to the panel to inform the present people about the start of the event. This message remains visible until the actual start time of the event itself. Before accessing the smart meeting room, event participants must register by showing to the implemented reader the QR code received by the invitation e-mail. The registration is managed by the smart hostess that is activated when a guest shows his QR code to the special reader and verifies that this identifier can be traced back to one of the invited guests of the event. If the outcome of the verification is positive, a welcome message is displayed on the panel located at the entrance of the room; if not, a message is displayed on the panel inviting the user to verify the details (date, time, place) of the event for which he has been invited. In addition, the pre-event

280

M. De Buono et al.

service verifies a series of conditions that affect comfort and environmental safety as well as the proper management of the event. More in particular, the system checks and guarantees: • • • • • •

Environmental comfort in terms of temperature and humidity Environmental safety (absence of fumes, gas, or CO/CO2) Remodulation of the intensity of lights in the hall, according to the needs Noise control in the room that can create disturb People standing during the event Compliance with the rules imposed by the social distancing

The smart hostess acquires information from the sensory system and performs the specified actions by adopting specific behaviors. In particular, the verification of comfort in the room takes place by analyzing the values of temperature and humidity that affect the thermal comfort. The algorithm used for the evaluation of indoor environments is the “predicted mean vote” (PMV) defined by the international standard EN ISO 7730,1 starting from the assumption that the thermal sensation for human is mainly related to the balance of thermal energy over the whole human body. This can be influenced by several factors such as physical activity, clothing, temperature, or air humidity. These parameters can be used to predict the thermal sensation of the human body by calculating the PMV index. The PMV is an index that provides the average rating of a large group of people based on a scale of thermal sensation (+ 3 very hot; −3 very cold). In the case of the smart meeting room, the algorithm receives as input the values provided by the sensors of temperature and humidity and, by considering factors such as the current season and an average clothing worn by people present in the room, provides in output the PMV value of interest. It is verified that a comfort zone is reached when the PMV index falls within the range (−0.5; +0.5). If the values provided by the sensor generate a value of PMV out of this range, an activation input is sent to the thermostat, which will increase (or decrease) the temperature in the room. As for humidity, if the sensor provides a value out of the predefined range (40–60%), an activation input is sent to the fans. The verification that there is no smoke in the room and that the air quality is satisfactory is done by analyzing the information provided by the smoke/gas and CO2 sensor measurements. The algorithm analyzes a binary information according to which it sends a warning message to the projector/smart panel in case of the presence of smoke or carbon monoxide in the air, compromising its quality. The intensity of the lights in the room is managed by the smart hostess that adopts different behaviors aimed at resetting the intensity of the lights by analyzing the information provided by the camera and the cognitive microphone. In particular, when the cognitive microphone notices that one of the speakers has started to speak, the intensity of the lights in the room is lowered to 10%, and those pointing to the

1 EN ISO 7730:2005, Ergonomics of the thermal environment—Analytical determination and interpretation of thermal comfort using calculation of the PMV and PPD indices and local thermal comfort criteria. https://www.iso.org/standard/39155.html.

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

281

speakers remain on at 90%, while if the cognitive camera pointing to the audience perceives a request for intervention by a participant, the intensity of the lights in that area is temporarily remodulated to 90%. The cognitive microphone is also used by the smart hostess to manage any excess of noise in the room. The device hears all the noises coming from the audience, distinguishing them by type, direction, and intensity. If the intensity exceeds a predetermined threshold, a message is displayed on the information panels in the room, inviting present people not to disturb. With regard to the analysis of the information provided by the cognitive cameras, the system is able to distinguish between people who are standing and those who are sitting. If there are people standing during the event, a message is displayed on the information panels inviting them to sit down so as not to create disturbance. The same detections can be used to verify that those in the room maintain a safe distance of at least 1 meter. The cognitive camera captures frames on the basis of which the distance between people in the room is calculated. If the distance is less than the threshold established by the anti-contagiousness norms, a message is displayed on the information panels, inviting the participants to maintain the social distance and not to create gatherings in the room. Start-Event Phase The service for the start-event phase manages all the activities carried out by the smart hostess when the event is starting. It is divided into two distinct use cases, concerning, respectively, the start of the event and the management of the room at the beginning of the event itself. With regard to the start of the event, the smart hostess performs a check on the guests arrived and registered for the event. In the case of a private event, if among the registered guests there is at least one speaker and the 90% of the participants, the event can start. Otherwise, the start of the event is delayed by 10 minutes. In the case of a public event, if there is at least one speaker among the registered guests, the event can start. Otherwise, the start of the event is delayed by 10 minutes. Room management represents a further use case generated by the start-event service. In this case, the smart hostess will: • Send input to the panel to update the message to be displayed • Remodulate the intensity of the lights at 10% on the audience and 90% on the speakers • Control the noise in the room, alerting the audience if necessary • Start the projector for presentations • Share the link to the event with remote attendees

12.5.3 Event Management The last scenario identified (see Fig. 12.8) focuses on the management of the event through its whole duration. In this phase all the activities that characterize the

282

M. De Buono et al.

Fig. 12.8 Third scenario: services and use cases

management of presentations, coffee breaks, interventions, and more are started. The scenario consists of a single service for which it was possible to associate several use cases described with the following. Current Event Management The event management service guarantees the complete management of the event while the speakers explain their presentations to the participants. In particular, the smart hostess in this case undertakes to: • Remodulate, if necessary, the intensity of the lights that affect the speakers and the audience • Recognize the request for intervention by the participants and remodulate the intensity of the lights in that area of the room • Recognize the request for coffee break by the speaker who leads the meeting and manage the pause In addition, throughout the event, the smart hostess constantly performs some checks aimed at maintaining the comfort and safety of the meeting room and accepting any requests for intervention from participants. In the latter case, the system uses the cognitive camera to identify the position from which the request for intervention comes from and remodulates the intensity of the light in that area. Another use case concerns the request for a coffee break that can be made by a speaker through a gesture that attracts the attention of the cognitive camera. In this case, the smart hostess analyzes the information found, remodulates the intensity of the light in the room (bringing it to 100%), and sends an alert message for the start of the coffee break to the information panels. End Event The closing phase of the event represents a step that should not be neglected since it is necessary to ensure that all the services that characterize the event are terminated within the time set for the end of the event itself. The behaviors of the smart hostess that characterize the event closure are aimed at stopping the algorithms in execution during the event. At the time set for the end of the event, the intensity of all lights in the room is remodulated and set to 100%, indicating that the event is over. Subsequently, all behaviors started by the smart hostess in the pre-event phase are stopped and then reactivated 10 minutes before the start of the next event.

12 Development of Indoor Smart Environments Leveraging the Internet of. . .

283

12.6 Conclusion In this paper, the design and development of a smart meeting room prototype have been presented. The room used for the use case was equipped with all the necessary installations, i.e., the set of sensors connected with the appropriate processing units, the output of which enabled certain actuations. After completing several test sessions, some initial observations were reached that indicate the potential of the presented approach. In particular, the environmental comfort was monitored without any problems, and the smart hostess, through the COGITO platform, was able to autonomously manage all the deployed devices. It should be specified that the system development has involved several programming languages and different development boards in order to perfectly integrate the system with the COGITO platform. The improvements foreseen for this solution include the addition of other services to increase the ability to perceive the state of the room and the communication with the event participants, making the booking web application a tool through which to interact with the event, also improving the experience of users who follow the event remotely. In addition, with the aim of reducing the risks related to Covid-19, it is intended to improve the management and integration of services that guarantee comfort and environmental safety, trying to create a Covid-19free environment. In this regard, we intend to deepen the studies that analyze the correlation between the degree of humidity of an indoor environment and the mode of transmission of the virus, with the aim of developing a system that can restore environmental safety by activating specific actuators (e.g., humidifiers, fans) and send alerts to people present in the room, if the risk of infection becomes significant [6]. These measures would take on greater importance if integrated with models for the prediction of the occupation of the environments, able to recognize events on the basis of energy, video, temperature, and humidity data.

References 1. Al Marouf, A., Islam, S., Chakraborty, N.R.: Iot-based smart meeting room weather detection system using arduino and relative sensors. Int. J. Comput. Appl. 975, 8887 (2019) 2. Ani, R., Krishna, S., Akhil, H., Arun, U.: An approach towards building an iot based smart classroom. In: 2018 International Conference on Advances in Computing, Communications and Informatics (ICACCI), pp. 2098–2102. IEEE (2018) 3. Bashir, A., Izhar, U., Jones, C.: Iot-based covid-19 sop compliance and monitoring system for businesses and public offices. In: Engineering Proceedings, vol. 2, p. 14. Multidisciplinary Digital Publishing Institute (2020) 4. Cicirelli, F., Guerrieri, A., Mercuri, A., Spezzano, G., Vinci, A.: Itema: A methodological approach for cognitive edge computing iot ecosystems. Future Gener. Comput. Syst. 92, 189– 197 (2019) 5. Fernández-Caramés, T.M., Froiz-Míguez, I., Fraga-Lamas, P.: An iot and blockchain based system for monitoring and tracking real-time occupancy for covid-19 public safety. In: Engineering Proceedings, vol. 2, p. 67. Multidisciplinary Digital Publishing Institute (2020)

284

M. De Buono et al.

6. Moriyama, M., Hugentobler, W.J., Iwasaki, A.: Seasonality of respiratory viral infections. Annu. Rev. Virol. 7, 83–101 (2020) 7. Petrovi´c, N., Koci´c, Ð.: Iot-based system for covid-19 indoor safety monitoring. Preprint. IcETRAN 2020, 1–6 (2020) 8. Saini, J., Dutta, M., Marques, G.: Indoor air quality monitoring systems based on Internet of things: A systematic review. Int. J. Environ. Res. Public Health 17(14), 4942 (2020) 9. Saralegui, U., Antón, M.Á., Arbelaitz, O., Muguerza, J.: Smart meeting room usage information and prediction by modelling occupancy profiles. Sensors 19(2), 353 (2019) 10. Sfikas, G., Akasiadis, C., Spyrou, E.: Creating a smart room using an iot approach. In: Proceedings of the Workshop on AI and IoT (AI-IoT), 9th Hellenic Conference on Artificial Intelligence, Thessaloniki, Greece, pp. 18–20 (2016) 11. Sgouropoulos, D., Spyrou, E., Siantikos, G., Giannakopoulos, T.: Counting and tracking people in a smart room: An iot approach. In: 2015 10th International Workshop on Semantic and Social Media Adaptation and Personalization (SMAP), pp. 1–5. IEEE (2015) 12. Tan, Y.J.: Event detection for smart conference room using spatiotemporal convolutional neural network. Ph.D. thesis, UTAR (2020)

Chapter 13

Human-Centered Reinforcement Learning for Lighting and Blind Control in Cognitive Buildings Emilio Greco and Giandomenico Spezzano

13.1 Introduction Buildings of all sizes and functions, residential or commercial, are becoming connected smart ecosystems in which dedicated systems are devoted to monitor and maintain much more than climate control and lighting. Artificial intelligence (AI) and the Internet of Things (IoT) [1] are accelerating the advances in the field of smart buildings, which are becoming increasingly intelligent and are evolving toward learning buildings (LB) [2]. An LB is a cognitive building (CB) that can learn based on the information captured in real time by the numerous IoT sensors scattered within the building and the structural elements. Machine learning (ML) platforms understand and analyze the collected data in a CB to make reliable and repeatable decisions by learning from historical relationships and trends in data [3]. ML algorithms make the building progressively more informed and able to learn from experience, thus improving performance as information increases. Using these algorithms, CBs can offer increasing performance in line with user needs. CBs can better anticipate the needs of a workplace, such as reducing energy consumption in spaces that are not in use. In addition, CBs can self-organize the functionalities of the systems installed in the building [4]. In practice, they behave like real “assistants” at the service of residents: they remember the settings of equipment and instruments and adapt to the habits and preferences of users, with the result that they can constantly change over time. CBs know, for example, when it’s time to turn on the air conditioning. Not because the schedule has been set to a specific time, but because the IoT sensors detect when temperature and humidity exceed a certain threshold. Or, they can understand if a fire is in progress, even if the alarm system is faulty, and, of course, they react by alerting the fire brigade as well. And E. Greco () · G. Spezzano National Research Council of Italy—ICAR, Rende, Italy e-mail: [email protected]; [email protected] © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_13

285

286

E. Greco and G. Spezzano

again, thanks to machine learning, they know when the intensity of the light is such that they have to raise or lower the blinds. In this paper, we want to show how a CB can control lighting and blinds to improve user comfort while simultaneously reducing energy consumption in an office building. Modern lighting, blind, and window systems, usually considered as independent systems, when present, can significantly affect building energy use and, perhaps more importantly, user comfort in terms of thermal, air quality, and illumination conditions [5, 6]. For example, it has been shown that a blind system can provide 12% ∼ 35% reduction in cooling load in summer while also improving visual comfort. Furthermore, it’s well documented that lighting alone accounts for the most significant electricity consumption percentage in a commercial building— sitting at around 44%—but effectively controlling the lighting in combination with shading can eliminate 60% or more of those lighting energy costs. On top of this, controllable shades can reduce building heat loss by anywhere between 3 and 29% depending on the type of shades [7]. Different lighting and blind control strategies were presented using traditional or modern automatic control systems [8]. Still, they do not easily ensure comfort and energy savings simultaneously [9]. In recent years, ML has been used in the loop of the control systems to improve the performance of the control systems. Machine learning control (MLC) solves optimal control problems with machine learning methods. MLC comprises, for instance, neural network control, genetic algorithm-based control, and genetic programming control and has methodological overlaps with other data-driven controls, like artificial intelligence and robot control. In addition, reinforcement learning (RL) [10] is widely used for learning closed-loop control policies [11]. In this chapter, we propose a closed loop with a human-centered reinforcement learning approach used to design an integrated lighting and blind control system. In our system, the control policy will be determined by a Q-learning controller, which will be driven by a visual comfort model that uses the Pareto dominance relationship to dynamically determine comfort/discomfort zones for a group of occupants in an office room. The Pareto set is obtained from a collection of compliant samples containing the interior illuminance value provided by the environment and the feedback judgment provided by observing users integrated into the loop. The main contributions of this work are: (i) an integrated control model with reinforcement learning to define the optimal visual control in an environment equipped with artificial light and blind; (ii) a human-centered Q-learning strategy, in which an agent learns how to perform a task from a feedback signal delivered by a human observer; (iii) a visual comfort model based on Pareto dominance relation to individuate the comfort/discomfort zones to select the most promising actions and to adapt the system to changes in the environment and to the requirements of the subjects; and (iv) a reward function that takes into account the comfort and the energy used by the HVAC, lights, and ventilation system in an office room. The rest of this chapter introduces fundamental concepts of the RL in control systems in Sect. 13.2. Section 13.3 describes the visual comfort model coupled with a human-centered reinforcement learning algorithm. Section 13.4 describes the RL

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

287

algorithm proposed for visual control. A case study and its evaluation are provided in Sect. 13.5. Finally, Sect. 13.6 concludes the manuscript.

13.2 Reinforcement Learning in Control Systems The goal of RL is similar to the control problem [12]. However, it’s a different approach and uses other terms to represent the same concepts. With both methods, you want to determine the correct inputs into a system that will generate the desired system behavior. Figure 13.1 shows how to design the policy (or the controller) that maps the observed state of the environment (or the plant) to the best actions (the actuator commands). The state feedback signal is the observations from the environment, and the reference signal is built into both the reward function and the environment observations. The environment is everything that exists outside of the agent. It is where the agent sends actions, and it is what generates rewards and observations. RL, as an emerging control technique, has attracted growing research interest and demonstrated its potential to enhance building performance while addressing some limitations of other advanced control techniques, such as model predictive control [13, 14]. RL is concerned with how software agents have to take actions in an environment to maximize the concept of cumulative reward. RL algorithms learn to control policies, mainly when there is no a priori knowledge and training data [15]. However, RL algorithms suffer from some drawbacks, such as the high computational cost required to find the optimal solution, such that all states need to be visited to choose the optimal one. With model-free RL, you can put an RL-equipped agent into any system, and the agent will be able to learn the optimal policy. A model can complement the learning process by avoiding areas known to be wrong and

Fig. 13.1 Reinforcement learning in control systems

288

E. Greco and G. Spezzano

exploring the rest. Model-based reinforcement learning can lower the time it takes to learn an optimal policy because you can use the model to guide the agent away from areas of the state space that you know have low rewards [16]. The math behind reinforcement learning is called the Markov’s decision process (MDP). Typically, an MDP is defined by a five-tuple (S, A, P, R, γ ), where: • S is a set of states called state space • A is a set of actions called the action space (alternatively A is the set of actions available from state s) • Pa(s,s ) = Pr(st+1 = s | st = s, at = a ) is the probability that action a in state s will lead to state s at time t + 1 • Ra(s,s ) is the immediate reward (or expected immediate reward) received after the transition from state s to state s due to action a • γ ∈ [0,1] is a discount factor The agent’s objective is to maximize the sum of the rewards in the long term. The maximization is long term, meaning that we are concerned with taking actions that yield the highest immediate reward. More generally, the agent is trying to learn the best strategy that gives the best cumulative reward in the long run. This objective is described as maximizing the expected return, which is expressed as follows: Gt = Rt+1 + γ Rt+2 + γ 2 Rt+3 + . . . . . . =

+∞

γ k Rt+k+1

k=0

When γ is closer to 0, the agent is near-sighted (gives more emphasis on the immediate reward). If the discount factor is closer to 1, the agent is more farsighted. RL algorithms estimate the expected return when the agent takes action in a given state while following a policy. These are Q-values, and estimate “how good” it is for the agent to take action in a given state. Q-learning (QL) is one of the most popular RL algorithms. QL allows the agent to learn state-action pairs’ values through continuous updates. As long as each state-action pair is frequently visited and updated, QL guarantees an optimal policy. The equation for updating the values of state-action pairs in QL is given as Qnew (st , at ) = Q(st , at ) + α(rt + γ maxQ(st+1 , a) − Q(st , at ))

(13.1)

Note that, in QL, the agent observes the current state, st ; takes an action, at ; observes the reward, Rt ; observes the next st+1 ; and α determines the importance of future reward. While updating, QL considers the best possible action (the max operator) in the next state regardless of the action that the current policy will take, at + 1. Because of this rule, QL is known as an off-policy algorithm.

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

289

13.3 A Human-Centered RL with a Satisfaction-Based Visual Comfort Model Choosing the optimal combination of settings of the various devices that allows the satisfaction of the comfort specifications is a complex problem. For example, in the visual comfort control problem, there are many ways to combine the position of the blinds and the number/intensity of lights. A reinforcement learning algorithm that uses the knowledge of a human user about how to perform a task can be used in a way to reduce the agent’s exploration time and speed up its learning. Human-centered RL [17] uses human evaluative feedback to shape the agent learner. The objective is to facilitate the agent learning from a human observer and simultaneously speed up the learning process. In human-centered RL, every time the agent takes action in a state, the observing human teacher can provide evaluative feedback, which tells the quality of the selected action based on the teacher’s knowledge, as shown in Fig. 13.2. The agent then uses the evaluative feedback to update its policy. Therefore, the agent can learn to perform a task online by interacting with a human teacher and with the environment. It is the human evaluative feedback that decides the agent’s behavior. The RL can be driven by a visual comfort model which helps make the model adaptive [18, 19]. The visual comfort model defines the comfort zone by identifying two threshold values, namely, FL and FH, representing, respectively, the lower limit (dark threshold value) and the upper limit (glare threshold value) of admitted lightening conditions. These values are often set as constants according to some regulations. This solution is no longer valid in the presence of a group of people who may have different preferences or changes in environmental conditions. Consequently, we have added a comfort model that can classify the compliant samples for darkness or glare from the user’s feedback signal and environmental data. The comfort model uses the Pareto dominance relationship to define a personalized complaint-based interior illuminance control, where occupants only complain to the Fig. 13.2 Interaction in the human-centered reinforced learning framework

290

E. Greco and G. Spezzano

Table 13.1 Lighting condition perceived by a user

ID 1

USER user3

Table 13.2 Lighting conditions perceived by four users

ID 1 2 3 4

USER user1 user2 user3 user4

FL 151 ML 90 100 100 127

FH 500 MH 500 400 390 479

CFL 5

CFH 0

CMH 3 0 5 0

CMH 0 0 3 7

system via a human-machine interface (HMI) if they feel uncomfortable. A Pareto improvement can transform a situation H into H where the well-being of at least one of the subjects involved is greater in H than in H . No one has less well-being in H than in H . We define an initial setting of the comfort zone limits for a group of individuals. We can obtain a Pareto improvement if a change in brightness thresholds redefines the boundaries of the comfort zone and brings benefits to at least one person while harming no one else. These improvements can continue where the allocation is Pareto efficient also known as Pareto optimal. No more changes can be made to the setting at a Pareto optimum without making someone worse off. By aggregating the compliant samples, we can dynamically determine the new FL and FH thresholds that satisfy groups of users and optimize the system’s behavior by obtaining a Pareto improvement. If the initial condition is that of Table 13.1, then following a low light complaint, only the CFL counter is increased if the lux level is lower than the previously saved threshold value. Otherwise, the FL value is also updated. Considering a group of four people, an update of the comfort zone limits occurs if at least half of the occupants have made a complaint and if their sum is greater than or equal to 10. For example, in Table 13.2, two out of our users have complained of darkness or glare. In the event of darkness, the number of complaints is insufficient to proceed with an FL update, while for glare complaints, we can carry the update. The new value chosen for FH is the minimum FH values expressed by users who have indicated glare-type complaints. This choice provides a “strong” Pareto improvement because the user’s well-being of the user4 is greater than the previous situation and the well-being of all the other users hasn’t gotten worse.

13.4 An RL Model for the Management of the Visual Comfort Control systems equipped with a controller whose policy is defined by a QL algorithm are very popular for determining solutions to thermal, environmental, and visual comfort problems. The research on visual comfort is dominated by studies analyzing the presence of an adequate amount of light where discomfort can be

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

291

caused by either too low or too high light level. In particular, most of the studies are focused on the analysis of the presence of an adequate amount of light, measured by a dimensionless quantity F, called daylight factor. F is defined as the ratio between the illuminance E measured in a specific point of the internal environment and the illuminance measured outside E0 , on a horizontal surface that sees the entire celestial vault without obstructions and overcast conditions. The value di F is F=

E × 100 E0

The legislation establishes the admissibility limits of F for a space depending on how it is used. The main subsystems that can impact visual comfort are the lighting system and the window blind. For example, occupants can feel comfortable when the illuminance value F is within the interval [F L, F H ]. However, outside the range, the system exhibits discomfort due to situations with little or a lot of light. We formulate a reinforced learning model to capture the system dynamics for the management of the visual control in a building by using an illuminance sensor and the support of a human user who has the task of giving indications on the perception of brightness. Figure 13.3 shows a closed loop of a human-centered RL model applied to solve the visual comfort problem.

Fig. 13.3 The model-based luminous control

292

E. Greco and G. Spezzano

The indoor brightness, which is determined by the number and intensity of lights turned on in a room, and the positioning of the blind slats, guides the agent’s actions (controller). To judge the degree of brightness, the controller uses a complaint-based model that can adapt the limits of the comfort zone to the new situations when the sun position, weather, and subjects’ requirements are changed. The visual comfort model can evaluate whether the value is within the comfort zone or represents a lower or higher value. The measured brightness value and the user’s judgment feed the comfort model, which can evaluate if the situation is acceptable or if it is necessary to generate an event to start the update of the Q-learning policy. Following a discomfort event, the system can end up in the comfort zone. It must wait for another discomfort value to resume the learning phase in this state. However, the comfort zone is not entirely equivalent from an energy point of view, as different combinations of light and blind settings produce the same illuminance value. A typical situation is deciding whether to turn on all the lights or open the blind. At the same lux, there may be times when it is better to turn on the lights rather than the roller shutter because the heat entering from the window is so high that it activates the air conditioner with a consequent increase in the energy consumed. Therefore, to optimize this behavior, it is necessary to intervene even in a comfortable situation to evaluate the actions also based on the energy impact they produce. The solution is to insert a timer that defines how long the system can stay in the comfort zone before being awakened to find a new position in the comfort zone that is energetically more advantageous, assuming that no complaints will occur in this period. In the presence of a group of occupants, the set of complaints is analyzed through the Pareto model to dynamically define the boundary that most probably separated the complaint region and no-complaint region.

13.4.1 The State Variables The state of the system is represented by the triple: S = {I, L, B} • I: Human comfort status. This type of information represents the condition of perception I = {a, b, c} of the user, where “a” is to describe a situation of glare, “b” a sensation of darkness, and “c” a sensation of comfort. From a conceptual point of view, the comfort zone can be further divided into two zones: energysaving zone and energy-wasted zone. • L: Lights status. Provides information L = 0,1,2,3 . . . n on the number of lights on, n is the number of lights in the room. The lamps are all the same and can be controlled separately. The n-lamps are gradually switched on to achieve the desired brightness.

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

293

• B: Blind status. This status considers both the height and the opening angle of the blind. The values that we have assumed admissible in this first implementation are the following: (0, 25, 50, 75) × (0◦ , 30◦ , 60◦ , 90◦ ) + 100, where 100 describes the condition of the blind completely open and 0 that of the blind down. This type of representation is simplified to reduce the values taken into consideration but guarantees good functioning in practice.

13.4.2 The Decision Variables The actuators on which we can intervene on are essentially two: the lights and the blind. The set of possible actions that allow us to immediately pass from one state to another of the system, starting from any state, is in our case equal to a = L, B, |a| = 68. In this way, we would have an immediately reactive system. Still, at the same time, we would have a conspicuous set of actions, which leads us to have a higher dimension of the matrix Q (system memory) and, more importantly, a considerable increase in time required for the system training phase. The increase in training time is because there are many opportunities for exploration to pursue optimal action. Another way to proceed is to allow the system to make incremental choices. For example, we could consider the following actions a = increase/decreaselights, increase/decreaserollershutter with |a| = 4. In this way, we will obtain a significant reduction of the Q matrix and training times. However, given a generic state of discomfort, the system will have to perform a sequence of state transitions that can be quite long to reach a state of comfort as it has only available some incrementally actions. In other words, incremental actions can lead to a lazy system. Our solution is intermediate between the two choices, balancing the system’s reactivity with the need for short training times. The action defined for our controller will be as follows: a = (L, B) The action L = [turn − on, turn − off, hold] can be performed to turn on, hold, and turn off a light. The control of the blind has two fundamental aspects to consider, one is its position (P), including up and down, and the other is its angle (A), from 0◦ to 90◦ . Then B = {P,A} where P = { up,down,hold} can represent the variations in the height of the blind and A = { increase,decrease,hold} the changes of the angle of the slats. With this approach the total number of possible actions will be |a| = 27.

294

E. Greco and G. Spezzano

13.4.3 The Reward Function A reward function is a function that provides a numerical score based on the state of the environment. In our case, the reward function has two components: one relating to human comfort and the other relating to energy saving. We can express the reward as r = αc rc + αe re where for each action, rc provides an evaluation of the comfort obtained, while re calculates the energy saving. The constants αc and αe are defined on the basis of the incidence to be given to the two components. On the basis of previous studies, it is possible to fix the value of αc = 0.8 and that of αe = 0.2. The value of rc = {0, −1} where 0 indicates a comfort condition, while −1 indicates a discomfort condition. The value of rc is generated by the comfort model according to whether the brightness value Ic belongs to the interval {FH, FL} or is outside the limits. The normalized penalty (reward) function for visual comfort rc during a time slot is defined as ⎧ ⎨ −1, rc = 0, ⎩ −1,

Ic < FL FL ≤ Ic ≤ FH Ic > FH

The re component is used when the system is in its comfort zone. Multiple situations can provide the same brightness but have different energy consumption values in this situation. By activating a trigger, we can ask the system to evaluate a new solution at fixed intervals and adopt it if it is energetically more favorable. The total electrical power at instant t due to HVAC, lights, and ventilation is equal to P (t) = Pf ancoil (t) + Plight (t) + Pventilation (t) The normalized electrical power is Pm (t) =

Pf ancoil (t) + Plight (t) + Pventilation (t) Pmaxf ancoil (t) + Pmaxlight (t) + Pmaxventilation (t)

where Pmaxhvac, Pmaxlight, and PmaxVentilation represent the maximum value of electrical power that the devices can consume. The re component of the reward does not measure the energy consumed in the interval (t + t) but will be the difference of the total normalized electrical power measured in the state S and S relative to a transition (s, a, re, s ) which makes the system evolve in two states of the comfort zone:

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .



re (s, s ) =



295

Pm (t) − Pm (t + (t)), s , s ∈ S = (I,L,B) and I = "c" 0, elsewhere

13.4.4 Q-Learning The controller defines the policy to be adopted to regulate the state of the lights, the position of the slats, and the height of the blind. This policy is defined based on complaints that cause an update of the comfort model that recalculates the FL and FH thresholds, adapting the comfort zone to changes in the environment and the user’s judgment. In general, the comfort model intervenes to check whether the lux value, read by the sensors, falls within the comfort zone. If this does not happen, an event is generated, and the controller is started to search for an activity that brings the system back to a state of comfort. The comfort model generates the value of component I of the system state. The other components L and B are acquired directly by the controller by reading them in the environment variables. Once the system state has been built, it is archived and updated. After updating the system status, it is possible to calculate the reward. The Q-learning algorithm updates its knowledge base by adopting the following strategy. First, each state visited while exploring a solution updates using Eq. 13.1, the state-action pair that produces the maximum expected value regardless of the action, which is then chosen to explore the space of states. For the choice of action, we speak of -greedy policy to say that a certain percentage of actions taken are chosen based on previously acquired knowledge and a part of them are chosen from a knowledge base. The event-based proposed model establishes no timing or subdivision of time into time steps. The algorithm is of the time difference (TD) type. The flow of the QL is shown in Listing 13.1. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

set α, γ, initialize Q matrix initialize visual comfort model blackand set FL blackand FH read the current status s generated by the event E if E ∈ {compliant event} calculate the reward as rc=-1 blackand re=0 else calculate the reward as rc = 0 blackand re=P(t+(t) - Pm (t) update Q(s,a)=Q(s,a)+α[r(s,a) +γMaxQ(s,a ∗- Q(s,a))] calculate the eligible actions Ea in state s

select blackand perform the action a with -greedy policy from Ea s < −s

calculate blackand set P_m(t) a < −a

set timer(sec)

Listing 13.1 Q-learning algorithm

296

E. Greco and G. Spezzano

The QL is structured as follows: • Get current environment data from sensors, i.e., illuminance value in room and the status of the lights and blind, and initialize the Q matrix (1–2). • Build a comfort model according to the complaint data, and read the current comfort status of the user (3–4). • If a complaint event occurs, the previous action is not the optimal choice (5). • Calculate a negative reward (6). • Else an expired timer event occurs. S and s’ are two states of comfort zone (7). • Calculate the reward as the difference of the normalized electrical power (8). • Update the value of the pair (s, a) of the Q-table of the previous timestamp (9). • Find the possible actions (10). • Choose and perform one using the -greedy policy (11). • Fix state, action, and normalized electrical power (13–15). • Set a probable decision epoch (16).

13.5 Case Study The validation of the system was carried out using the office room (4m×5m×2.7m) shown in Fig. 13.4 where there are a window equipped with a motorized Venetian blind (2.78m×1.25m), three lamps for controlling the artificial light that act as an actuator, and a brightness sensor placed on the desk. The brightness sensor sends the value to the system after 1 minute if it detects a significant variation of the measured value (±5%); otherwise, it goes into a quiescent state and sends the measurement after 5 minutes. The VELUX Daylight Visualizer software, available online, was used to calculate the daily factor F as a function of the area of the room and the geometric dimensions of the window. F is equal to 3.6% with the blinds opened, and 1% with the blinds closed at 75%. This value is in line with the legislation that establishes that F must be greater than 1% for a space used as an office. The daily value of F as a function of the actuation performed on the blind is shown in Fig. 13.5. The index Fig. 13.4 The office room used for the case study

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

297

F = 0.9% between 2:00 p.m. and 6:00 p.m. is due to the presence of direct sunlight striking the glass surface. The blind is closed below 25%. The system was left to evolve freely for 5 days, considering the presence of only one user, at the end of which an initial evaluation was made. Subsequently, the Pareto improvement was applied so that the system could choose the best solution among those possible to obtain the best parameters of visual comfort that produce maximum energy saving. Figure 13.6 represents the trend of the interior illuminance measured on a sunny day. Figures 13.7 and 13.8, respectively, represent the state of the lights and the state of the blind. Given the low lux threshold applied F L = 80lux, the controller never activates the lights during the day because the daylight is sufficient. Activation between 6:30 a.m. and 7:00 a.m. is a manual activation performed by the cleaner. The shutter passes from the initial state completely open (100%) at 7:00 a.m. to the following states 75% at 9:00 am, 50% at 9:30 am, 25% at 11:00 a.m., and 0% at 1:00 pm, obtaining a good saving of the energy needed for cooling. At 12:00 a.m. the blind state is fully open (100%) with the slats at an angle of (90◦ ). It is the day with the highest thermal value. At 12:30 a.m., the controller still tries to reduce the access of light by lowering the inclination angle of the slats from 90◦ to 60◦ . We can see that after 5:30 p.m. the system does not activate the lights even if the lux level drops below the minimum threshold because there is no one in the room. The system’s behavior in the first two training days is shown in Fig. 13.9. On the first day, the policy uses a value of = 0.5 to alternate learning and exploitation with equal probability. Then, is gradually decreased. On the second day of learning, the system excludes all the actions that exceed the operating control limits on the first day.

Fig. 13.5 The average daylight factor

298

E. Greco and G. Spezzano

Fig. 13.6 The flux control

Fig. 13.7 The light control

Figure 13.10 highlights how the system responds to sudden changes in brightness between 12:00 a.m. and 1:00 p.m. that produces glare by completely lowering the blind and keeping the lights open. The system is updated every half an hour, trying to find a different solution that generates a profit. At 2:00 p.m. the bind is opened, and the lights are switched off, thus saving energy and having no glare. From the data collected during the training phase, the system behavior demonstrated to be aligned with expectations. By imposing the learning rate and the discount factor to a value equals to 1 in the value function, or by imposing a maximum learning index, we have obtained the desired effect. This introduces an

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

299

Fig. 13.8 The blind control

Fig. 13.9 The behavior of the system in the first 2 days

immediate reactivity of the system to changes, which is fundamental for online systems. By crossing the data coming from the graph (Fig. 13.11) and the complaints that reach the controller, we can denote two areas: • “0 compliant” area, a central part of the graph between 140 and 260 lux • Compliant area, part of the comfort region between 80–140 lux and 260–350 lux

300

E. Greco and G. Spezzano

Fig. 13.10 The system’s response to abrupt changes in brightness

environment control in sunny day actual

high

low

500

Illuminance/lux

450 400 350 300 250 200

Complaiant

150 100 50 0 6:00PM

10:00PM

2:00AM

6:00AM

10:00AM

2:00PM

Fig. 13.11 Zero-compliant and compliant area

The algorithm generates the “zero-compliant” zone in its “random” evolution when it evolves from a state of comfort to another state of comfort. In this case, the system’s reward is only re which is related to energy saving. This result generally occurs if you deviate a little from the average value of the comfort zone. This is a condition that is currently possible by switching on or off the lights that have a less incisive impact on brightness than the blind. Within this area, the algorithm, after

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

301

environment control in sunny day actual

high

low

Illuminance/lux

600 500 400 300 200 100 0 6:00PM

10:00PM

2:00AM

6:00AM

10:00AM

2:00PM

Fig. 13.12 Analysis on the reactions to external stresses

learning, “finds” a path that makes it evolve through successive states of comfort, avoiding overstepping the limits. The “compliant area” is generated by all those state-action pairs that create too sudden deviations of the system and therefore are more likely to have negative discomfort rewards. This last area is “cut” by the controller because the reward value associated with these states has a weight equal to 80%, which produces this gray area compared to the 20% of the energy reward. In conclusion, with the setting parameters supplied to the system, it is possible to reach an “optimal” operating condition from the point of view of visual comfort in a few days of learning. A second analysis on the reactions to external stresses was also carried out. For example, how does the controller react if the operator manually intervenes in the system to change its status? We have performed two types of tests to answer this question: • Variations in the angle of the slats of the blind and switching on lights so as not to generate an excessive increase in lux. The algorithm does not intervene to vary the user’s action because it remains in comfort. Only after 30 min the controller will change state. It is unclear whether the system “leaves” the current state toward an energetically more favorable one. • We intervene with actions that lead us to a state of discomfort. Figure 13.12 shows the outcome of the experiment. In most cases, see the first and last point shown in the image. The system returns to the “0 compliant” area. In only one case, the system remains in the “compliant” area but, in any case, manages in two steps to return to the “0 compliant” range. Due to the response times of the light sensor, spikes are visible on the image and not individual dots.

302

E. Greco and G. Spezzano

environment control in sunny day actual

high

low

400

Illuminance/lux

350 300 250 09:15:31

200

actual:143.6151 high:350 low:80

150 100 50 0

9:00AM

1:00PM

5:00PM

9:00PM

5:00AM

10:00AM

Fig. 13.13 Efficient control room

The response time of the sensor is in the order of 5 min. Therefore the outcome of the controller’s intervention is visible on the image because it intervenes only on receipt of the sensor feedback, taking a time that may seem excessive. The inclusion of other brightness sensors in the environment allowed us to improve response times by making the system more reactive, as can be seen from Fig. 13.13.

13.6 Conclusions This paper presented a human-centered reinforcement learning method for maximized occupant well-being and system efficiency by adopting a Q-learning strategy of control for lights and blinds. Our lights and blind control system can be integrated within working building management systems so as to improve energy-saving capabilities. We have coupled a visual comfort model with a Q-learning algorithm to obtain a system that integrates light control and blind control by using the brightness of the environment. In addition, a Pareto improvement has been considered to dynamically adapt the boundary of a comfort zone to the preference of a group of people. A real implementation of the system was carried out in an office room to validate the learning strategy and the ability to adapt to the brightness of the environment. The results show that the user’s presence in the feedback loop provides the system with adequate knowledge to make decisions with the help of only a light sensor. In addition, the system can explore the most energy-saving zones once it is in the comfort zone. Acknowledgments This work has been partially supported by the COGITO project, funded by the Italian Government (PON ARS01 00836).

13 Human-Centered Reinforcement Learning for Lighting and Blind Control. . .

303

References 1. Sutjarittham, T., Habibi Gharakheili, H., Kanhere, S.S., Sivaraman, V.: Experiences with IoT and AI in a smart campus for optimizing classroom usage. IEEE Internet Things J. 6(5), 7595– 7607 (2019). https://doi.org/10.1109/JIOT.2019.2902410 2. Ploennigs, J., Ba, A., Barry, M.: Materializing the promises of cognitive IoT: How cognitive buildings are shaping the way. IEEE Internet Things J. 5(4), 2367–2374 (2018) 3. Paul, D., Chakraborty, T., Datta, S.K., Paul, D.: IoT and machine learning based prediction of smart building indoor temperature. In: 2018 4th International Conference on Computer and Information Sciences (ICCOINS), pp. 1–6 (2018). https://doi.org/10.1109/ICCOINS.2018. 8510597 4. Spezzano, G.: COGITO: A Cognitive Dynamic System to Allow Buildings to Learn and Adapt, CSCE’19 - The 2019 World Congress in Computer Science, Computer Engineering, & Applied Computing (2019) 5. Valladares, I., Galindo, M., Gutiérrez, J., Wu, W.-C., Liao, K.-K., Liao, J.-C., Lu, K.-C., Wang, C.-C.: Energy optimization associated with thermal comfort and indoor air control via a deep reinforcement learning algorithm. Build. Environ. 155, 105–117 (2019). ISSN:0360–1323 6. Cicirelli, F., Guerrieri, A., Mastroianni, C., Scarcello, L., Spezzano, G., Vinci, A.: Balancing energy consumption and thermal comfort with deep reinforcement learning. In: 2021 IEEE 2nd International Conference on Human-Machine Systems (ICHMS), pp. 1–6 (2021). https://doi. org/10.1109/ICHMS53169.2021.9582638 7. Tzempelikos, A., Athienitis, A.K.: The impact of shading design and control on building cooling and lighting demand. Solar Energy (2007) 8. Cheng, Z., Xia, L., Zhao, Q., Zhao, Y., Wang, F., Song, F.: Integrated control of blind and lights in daily office environment. In: 2013 IEEE International Conference on Automation Science and Engineering (CASE), pp. 587–592 (2013). https://doi.org/10.1109/CoASE.2013.6653972 9. Gunay, H.B., O’Brien, W., Beausoleil-Morrison, I., Gilani, S.: Development and implementation of an adaptive lighting and blind control algorithm. Build. Environ. 113, 185–199 (2017). ISSN:0360–1323 10. Sutton, R.S., Barto, A.G.: Introduction to Reinforcement Learning. MIT Press (1998) 11. Ding, X., Du, W., Cerpa, A.: OCTOPUS: Deep reinforcement learning for holistic smart building control. BuildSys@SenSys 2019: 326–335 12. Mohammadi, M., Al-Fuqaha, A., Guizani, M.. Oh, J.-S.: Semisupervised deep reinforcement learning in support of IoT and smart city services. IEEE Internet Things J. 5(2), 624–635 (2018). https://doi.org/10.1109/JIOT.2017.2712560 13. Morari, M., Lee, J.H.: Model predictive control: past, present and future. Comput. Chem. Eng. 23(4), 667–682 1999. https://doi.org/10.1016/S0098-1354(98)00301-9 14. Wang, Z., Hong, T.: Reinforcement learning for building controls: The opportunities and challenges. Applied Energy 269, 115036 (2020). ISSN:0306-2619 15. Mason, K., Grijalva, S.: A review of reinforcement learning for autonomous building energy management. Comput. Electr. Eng. 78, 300–312 (2019). ISSN:0045-7906 16. May, R.: The reinforcement learning method : A feasible and sustainable control strategy for efficient occupant-centred building operation in smart cities (2019). Accessed 23 Dec 2019. [Online]. Available: http://urn.kb.se/resolve?urn=urn:nbn:se:du-30613 17. Li, G., Gomez, R., Nakamura, K., He, B.: Human-centered reinforcement learning: A survey. IEEE Trans. Human Mach. Syst. 49(4), 337–349 (2019). https://doi.org/10.1109/THMS.2019. 2912447 18. Zhao, Q.C., Zhao, Y., Wang, F.L., Jiang, Y., Jiang, Y., Zhang, F.: Preliminary study of learning individual thermal complaint behavior using one-class classifier for indoor environment control. Build. Environ. 72, 309–318 (2014) 19. Zhao, Q., Cheng, Z., Wang, F., Chen, Z., Jiang, Y., Zhong, Z.: Experimental assessment of a satisfaction based thermal comfort control for a group of occupants. In: 2015 IEEE International Conference on Automation Science and Engineering (CASE), pp. 15–20 (2015). https://doi.org/10.1109/CoASE.2015.7294034

Chapter 14

Intelligent Load Scheduling in Cognitive Buildings: A Use Case Franco Cicirelli , Vincenzo D’Agostino, Antonio Francesco Gentile, Emilio Greco, Antonio Guerrieri , Luigi Rizzo, and Giuseppe Scopelliti

14.1 Introduction Nowadays, appliances and electronic devices, paired with the Internet of Things (IoT) [2] and machine learning [14] technologies, are simplifying our life. They make it easier to execute in-house daily activities by guaranteeing a high level of comfort, safety, and energy saving. Different types of appliances are available in the house contexts. Their application spans from cooking to food production and from cleaning to entertainment and to the management of the indoor well-being and thermal comfort. If such devices are used inefficiently, a waste of time, energy, and/or money can occur. A practical method to lower energy consumption and efficiently exploit inhouse equipment consists of the application of demand-side management (DSM) techniques [17]. DSM permits users to make autonomous decisions about their energy consumption profiles. Automated scheduling of devices in residential and commercial buildings plays a key role in DSM [11]. DSMs are an essential element of the so-called cognitive buildings [18]. Such buildings are environments augmented with sensors and actuators that exploit the

F. Cicirelli · A. F. Gentile · E. Greco · A. Guerrieri () Institute for High Performance Computing and Networking of the National Research Council of Italy (ICAR-CNR), Rende, Italy e-mail: [email protected]; [email protected]; [email protected]; [email protected] V. D’Agostino · G. Scopelliti Omnia Energia Spa, Zumpano, Italy e-mail: [email protected]; [email protected] L. Rizzo AE Innovation Srl, Cosenza, Italy e-mail: [email protected] © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_14

305

306

F. Cicirelli et al.

IoT paradigm and cognitive abilities altogether. Cognitive buildings differ from smart buildings since they are able to learn, reason, adapt, and cooperate with each other to undertake context-dependent actions. A cornerstone characteristic of cognitive buildings is represented by the ability to collect and analyze sensor data and information coming from user habits in order to manage building resources and spaces efficiently. An effective DSM policy has to take into account variable price of energy [1] and the presence of renewable energy sources, such as photovoltaic (PV) solar panels, so managing the exchange of energy with the power grid [3]. A valuable way to apply DSM is to shift the execution of loads from peak to offpeak periods and/or to reduce the electricity consumption when its cost is higher and/or there is low production of green energy. All of this has to be done always considering users’ preferences in exploiting of in-house equipment. In such a scenario, reinforcement learning (RL) can help in the realization of a valuable and cost-effective load scheduling [24]. Moreover, DSM can take advantage of the use of the edge computing paradigm [5, 21]. The main advantage of edge computing is that of using computational power for processing information at the edge of a building network. The benefits of this paradigm applied to DSM are related to latency reduction, bandwidth savings, and privacy preservation [12, 13, 20]. In our previous work [7], we focused on the development of an IoT and agentbased load scheduling system for DSM based on RL and edge computing. Such load scheduling system was developed in the context of the COGITO project1 and becomes part of the related COGITO platform (see Chap. 1 of this book). The goal was that to plan the execution of household equipment to optimize the total cost of energy avoiding peaks and taking also into consideration user preferences. The planning process was modeled as an MDP [19], and RL was used to define a policy for managing the loads. As prosecution of the previous work, this chapter focuses on describing a specific realization of a more realistic case study developed at the Omnia Energia2 building. Omnia Energia is an Italian company that operates in the energy market. It participated at the COGITO project to experiment with some scheduling policies with the final purpose of offering novel services to its customers. The developed case study highlights how the scheduler, implemented in the COGITO project, can serve several buildings to schedule the available loads so reducing the amount of money spent on energy while relieving the users from manually switching on/off the loads. The rest of the chapter is structured as follows: Sect. 14.2 introduces some basic concepts helpful in understanding the rest of the chapter, Sect. 14.3 describes how the COGITO platform has been integrated to work with Omnia Energia equipment,

1 COGITO project—A COGnItive dynamic sysTem to allOw buildings to learn and adapt—https://

www.icar.cnr.it/en/progetti/cogito-sistema-dinamico-e-cognitivo-per-consentire-agli-edifici-diapprendere-ed-adattarsi/. 2 Omnia Energia S.p.A. https://www.omniaenergia.it/.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

307

and Sect. 14.4 shows in detail the developed case study. The chapter concludes with some final remarks.

14.2 Basic Concepts This section provides several elements for the comprehension of the chapter. In particular, the following subsection introduces the COGITO platform. Subsequently, the reinforcement learning technology is outlined. Then, the Markov decision process is sketched. Finally, the used load scheduling is detailed.

14.2.1 The COGITO Platform COGITO [6] is an agent-based IoT platform created for the design and implementation of cognitive environments. A cognitive environment extends the concept of the intelligent environment (smart environment) [4, 10] by exploiting cognitive-based technologies [16] for the creation of systems capable of automatically adapting to changes in user behavior and anticipating and predicting the activities and needs of the users themselves. COGITO is based on the metaphor of agents [23] and naturally allows to take advantage of both the edge and cloud computing paradigms. The agent paradigm favors the implementation of distributed and pervasive systems. Agents can run close to the devices they need to control/manage, thus implementing edge computing and allowing real-time analysis of the data collected on every node. Additionally, agents can implement out-of-the-edge functionalities (e.g., data mining or storage) by leveraging cloud capabilities. The COGITO platform uses virtual objects to hide the heterogeneity of physical devices and communication protocols. Also, COGITO promotes modularity and separation of concerns and offers some integrated features that can be exploited to aggregate/filter information at the edge and achieve data fusion on data from distributed sensors. Other primitives are made available to simplify the use of artificial intelligence libraries in a distributed and heterogeneous environment. The first chapter of this book provides more details on the COGITO platform.

14.2.2 Reinforcement Learning Reinforcement learning (RL) [22] is a useful technique for the training of decisionmaking agents. This technique is studied in various fields, such as game theory, optimization, and control theory. RL considers four essential components: agents, environment, reward, and actions. An agent can observe a dynamic environment

308

F. Cicirelli et al.

and interact with it by taking actions. A reward is given to the agent for each action it takes. Agents are trained by RL to make decisions that maximize (cumulative) rewards. RL algorithms are useful for training decision-makers that operate with limited knowledge of both the environment and the expected quality of each decision they make [24]. RL algorithms include state-action-reward-state-action (SARSA), Q-learning, deep Q-learning, and asynchronous advantage actor-critic (A3C) [8, 9, 15]. These algorithms are all based on the learning by experience approach. An agent is trained by running a set of simulations/real experiments in which it interacts with the surrounding environment. After each experiment, the agent incrementally updates its knowledge of the problem and, eventually, learns what actions to take to maximize the reward.

14.2.3 Markov Decision Process A Markov decision process (MDP) [19] is a discrete-time (time-stepped) stochastic control process. It furnishes a mathematical framework suited to model decisionmaking in specific scenarios in which results are all together or random or under the management of a controller. MDPs well suit for the study of optimization problems. More in detail, at each time step, the process finds itself in a state s, and the controller can adopt an action a allowable in the state s in which the process stays. At the next time step, the process randomly moves into a new state s , giving the controller a corresponding reward. The probability that the process moves into its new state s is influenced by the chosen action. Thus, the next state s depends on the current state s and the action undertaken by the controller. However, given a state s and an action a, the probability of moving into s is conditionally independent of all the previous states and actions. In other words, the state transitions of an MDP satisfy the Markov property. Given an MDP, it is possible to define a policy function that furnishes, for each state s, the action a to choose. A policy function is optimal if it maximizes the expected cumulative reward of an MDP. For MDPs with a finite state space, a finite action space, a fully defined probability transition function, and a fully defined reward function, it is possible to calculate an optimal policy using dynamic programming. Specific RL algorithms can be exploited to estimate effective criteria.

14.2.4 The Load Scheduling The considered load scheduling problem [7] focuses on the design and implementation of an IoT-based energy management system for DSM, which leverages reinforcement learning and is based on an edge computing infrastructure, namely, the COGITO platform. The goal is to plan the execution of in-house appliances

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

309

to minimize the total cost spent on energy by considering into account some user preferences and given constraints. More in detail, the planning process is modeled as an MDP [19], and the reinforcement learning is used to determine an effective policy for the management of the loads, i.e., to determine which loads have to be switched on/off and when. The computed load scheduling will consider altogether: • A time-varying profile for the energy cost. • A forecasted profile for the energy produced from available renewable sources (e.g., a photovoltaic panel system). • The energy consumption profiles for the appliances to be scheduled. • The time-span in which a load, once activated, has to be kept on. • The energy consumption profiles for loads that can’t be deferred or that are always on. These kinds of loads will be referred to hereafter as uncontrollable loads. • The deadline within which each load has to be performed. The system has been designed to be naturally distributed and able to be scattered on different edge nodes that can be spread in different parts of a building/apartment. The scheduling problem described above is reduced to an RL problem that exploits the agent-environment paradigm shown in Fig. 14.1 and progresses according to a time-step evolution. The agent, which in this case is a COGITO cognitive agent, is a decision-maker that, given an observed state of the environment, can perform a specific action on it. An observed state contains information about the current time step and which loads were activated before the current time. Given an observed state, an agent may request to activate a subset of new loads or do nothing. When the environment is asked to perform an action, it updates its internal state accordingly and produces a new observed state and reward value for the agent. For each instance of the problem, an agent is trained using RL. The environment provides a reward that awards rewards that increase as the overall energy cost decreases and provides penalties when previously defined constraints are violated. For a given problem instance, i.e., obtained by specifying the profile for both the user and loads, the

• Action

• Reward • NextState Fig. 14.1 The agent-environment model for reinforcement learning

310

F. Cicirelli et al.

agent runs a set of simulations with the same initial condition. Each simulation is called an episode. From each episode, the agent incrementally learns how to behave in order to maximize the cumulative reward by exploiting reinforcement learning. More details about the scheduler implemented can be taken from the paper [7].

14.3 Integration Between the COGITO Platform and the Omnia Energia Equipment The activity described in this section has been realized in the context of the COGITO project and has involved together ICAR-CNR and Omnia Energia S.p.A., which is an Italian company involved in the energy distribution market that also develops ICT solutions for energy efficiency. In this direction, one of the aims of Omnia Energia is the optimization of the energy usage within the houses of its customers. For this purpose, the company is proposing a device, called Omnia Meter, for the management and control of in-house electric equipment. Such a device helps people monitor their consumption and optimize their equipment utilization so to lower the final energy bill. For this reason, the collaboration between ICAR-CNR and Omnia Energia was finalized to demonstrate the ability to remotely manage a building through the COGITO platform, in particular as regards the scheduling of electrical loads for the reduction of energy costs and the limitation of withdrawal peaks below the maximum power allowed by the contractual profile. This is realized by executing the cognitive schedule, outputted by the COGITO platform, through the Omnia Meter device. For this purpose, an integration between COGITO and the Omnia Meter has been implemented and here described. The final aim of this integration will be that of offering a cognitive scheduling service to all the Omnia Energia customers through the Omnia Meter device. More in detail, the Omnia Meter is a gateway developed by Omnia Energia for Home Automation and Energy Management applications. It is a hardware device that integrates a series of electronic boards, designed and developed within the company, with various monitoring and control functions. The Omnia Meter is responsible for collecting data from several devices, making them available to the COGITO platform, and receiving from it the actuation commands to be sent to the connected devices. It is equipped with various communication interfaces, allowing communication with other devices. In particular, Omnia Meter is equipped with two wireless communication interfaces, namely, the XBee/ZigBee and the Wi-Fi, through which it is able to communicate with the devices deployed in a house and the COGITO platform. In addition, it integrates the MOME device,3 which is able to read the data relating to energy flows directly from the meters (both exchange

3 MOME

device. https://www.e-distribuzione.it/content/dam/e-distribuzione/documenti/progetti_ e_innovazioni/mome_e_smart_info/MOME_Specification_V4.4.pdf.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

311 CLOUD

Energy Meter

Buon

Smart Plug



COGITO/OMNIA ENERGIA MQTT SERVICES

REMOTE MQTT BROKER

Data response

XBEE – ZIGBEE 802.15.4

WIFI – IEEE 802.11

Driver Controller

LOCAL MQTT BROKER

Handler Event

SQLite DB

MQTT Client

Publish/Subscribe messaging (REMOTE) Publish/Subscribe messaging (LOCAL)

Send command Send data request

Push data

Configuration

ZIGBEE SENSOR NETWORK

Publish/Subscribe messaging

EMBEDDED LINUX GATEWAY (Omnia Meter)

OMNIA METER NETWORK

COGITO PLATFORM

Fig. 14.2 Omnia Meter software architecture

and production), via powerline communication, using the existing electrical system. Figure 14.2 focuses on the architecture designed for the Omnia Meter, which allows integration with the COGITO platform. On the left, the figure highlights the Omnia Meter Network which comprehends all the devices deployed in a house and locally controlled. On this side of the figure, it is highlighted both how the Omnia Meter is interfaced with the ZigBee devices and how it is connected through MQTT with the COGITO platform. Omnia Meter also uses an SQLite instance of a DB that permits to store data coming from sensors. On the right part of Fig. 14.2, it is shown how the COGITO platform can be interfaced with the Omnia Meter device. In particular, if there is an instance of the platform running in the same network of the Omnia Meter, the communication is local. Otherwise, if the referred COGITO platform runs in another network, the communication is mediated by an MQTT broker deployed in the cloud. The communication with sensor/actuator devices is based on the ZigBee protocol, Home Automation profile (HA 1.2).4 This protocol provides standardized procedures for the creation and management of a network of devices, where the Omnia Meter plays the role of coordinator of the network itself. Many devices have already been interfaced with the Omnia Meter. Among these, the main ones are: • Energy meters which are capable of measuring energy and other parameters related to the powerline on which it is installed

4 ZigBee

pdf.

Home Automation User Guide. https://www.nxp.com/docs/en/user-guide/JN-UG-3076.

312

F. Cicirelli et al.

• Smart plugs which can be used to control loads and measure the electricity they consume • Electrical sockets which, as for the smart plugs, provide the possibility to switch on/off the connected electrical loads and give information on the consumption • Controllable thermostats which allow to control the temperature within a house • Temperature and humidity sensors for monitoring indoor environmental conditions Instead, the communication with the COGITO platform takes place via Wi-Fi (Omnia Meter exploits such a protocol to connect itself to the Internet) and is based on the MQTT protocol. This protocol uses a publish-subscribe messaging model in which clients send their messages to a broker referring to different topics. The consumers can subscribe to these topics to receive the related messages. A particular client (which takes the name of publisher) sends messages to a specific topic, while other clients (consumers) receive it (they will be called subscribers). A further actor is added to the traditional publish-subscribe protocol, which is called broker. The broker is a kind of proxy client, able to filter and distribute communications between publishers and subscribers. In MQTT, the broker is the manager of the data flows: every time a new message is published on a specific topic, the broker distributes it to all the subscribed recipients. More details about the design of the Omnia Meter/COGITO platform are shown in Fig. 14.3. With respect to the Fig. 14.2, now it is better highlighted the presence of a multi-layered architecture comprehending physical devices, the edge layer, and the cloud layer. On the left side of the figure, a particular zoom on the COGITO platform is provided. Here, the focus is on the multi-agent framework and virtual object container. The figure clarifies how COGITO can communicate with the Omnia Meter device to take advantage of its interfaces to some types of sensors and send specific commands. The philosophy used is that of the creation, on the COGITO platform side, of a virtual object, namely, the Omnia Meter VO. This virtual object contains an MQTT client that allows communicating directly with the Omnia Meter, which implements both an MQTT client and an MQTT broker. The MQTT client is used to communicate with the COGITO platform. If the platform is running in a different network than the Omnia Meter one, an MQTT broker located in the cloud is used as an intermediary. On the other hand, if the COGITO platform and the Omnia Meter share the same network, COGITO communicates directly with the Omnia Meter through the broker implemented in the device itself. Some details on the MQTT protocol implemented for the communication between COGITO and the Omnia Meter are reported below. A typical use case scenario, regarding what has been introduced so far, is shown in Fig. 14.4. In particular, a user can select what appliances he/she wants to use during a day and send these selections to the developed COGITO cognitive scheduler through the so-called COGITO app. The scheduler calculates the schedule and sends it to the Omnia Meter through MQTT. Finally, the Omnia Meter actualizes the schedule received through MQTT messages.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

313

Fig. 14.3 Omnia Meter integration architecture—COGITO platform

Fig. 14.4 Omnia Meter system use diagram—COGITO platform

14.4 The Case Study The case study described in this section has multiple objectives. Firstly, we want to demonstrate the effectiveness and efficiency of the COGITO cognitive scheduler (see Sect. 14.2.4) for the management of (remote) electrical loads. For this purpose, a set of loads (i.e., some bulbs) have been deployed on a purposely built panel so to emulate the real equipment of a whole apartment. The scheduler also takes into account the production data of a real photovoltaic system, monitored in real time, and the forecasted hourly cost of energy. As a second objective, the particular

314

F. Cicirelli et al.

configuration of the case study allows analyzing how the COGITO platform can also be used out-of-the-edge (by offering cloud-based services), so as to provide scalable and extensible applications in the context of smart grids. The last objective is to test some Omnia Energia devices together with their integration with the COGITO platform. After an introduction about the equipment used for the case study, the current section describes the main characteristics of the case study itself and some software components used to realize it. It is worth noting that the case study always considers that a user wants to schedule all the available loads each day. In such a way, all the schedules obtained on different days can be compared and analyzed (see Sect. 14.4.5). Finally, this section details the customization done in the Omnia Meter and the dashboard realized to visualize how the system works.

14.4.1 The Case Study Equipment From a physical point of view, the devices composing the case study were placed, as introduced above, on a purposely built panel, as shown in the following figures. In particular, Fig. 14.5 shows the front view of the panel. The panel hosts the Omnia Meter (bottom) and a standard energy meter with a relay (bottom-left). All the bulbs in the top part of the panel are used to emulate the loads inside a house since they have all different loads which, proportionally, can represent different types of appliances. Some bulbs are monitored and controlled through the smart plugs at the center of the panel. More in particular, the plugs and the bulbs identified in the panel as CARICO 1, . . . , CARICO 5 represent, in our scheduling algorithm, the controllable loads, while CARICO 6, . . . , CARICO 8 represent the uncontrollable loads. The uncontrollable loads can be manually operated through three switches (bottom-right). More in detail, the correspondence between smart plug and connected load power is as follows: • • • • •

Smart plug 1 (load 1, namely, CARICO 1): 140 W Smart plug 2 (load 2, namely, CARICO 2): 28 W Smart plug 3 (load 3, namely, CARICO 3): 42 W Smart plug 4 (load 4, namely, CARICO 4): 52 W Smart plug 5 (load 5, namely, CARICO 5): 42 W The other uncontrollable loads are:

• Uncontrollable load 1 (namely, CARICO 6): 28 W • Uncontrollable load 2 (namely, CARICO 7): 52 W • Uncontrollable load 3 (namely, CARICO 8): 105 W Finally, the sockets at the bottom center of the panel is always powered and is used to power the Omnia Meter. Figure 14.6 presents another view of the panel, namely, an oblique one, which can be seen in the front part of the Omnia Meter where a green led highlights that everything is working fine.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

315

Fig. 14.5 The panel of the case study (front view)

Fig. 14.6 The panel of the case study (oblique view)

In order to consider the availability of renewable energy, the overall realized case study also exploits the photovoltaic system available on the roof at the Omnia Energia headquarter (see Fig. 14.7). Such a system offers a peak power of 19.32 kWp.

316

F. Cicirelli et al.

Fig. 14.7 The photovoltaic system installed on the roof of the Omnia Energia headquarter

In order to make the test case a real application case, also including the photovoltaic system installed at the Omnia Energia headquarter, it was necessary to perform a scaling both of the loads represented by the bulbs and of the real photovoltaic system. The goal is reaching a configuration in which the photovoltaic system can provide an appropriate contribution to the whole emulated system in the sense that the production was neither too high (thus covering the energy needs of the controllable loads in any condition and time of day) nor too low (thus being not able to cover under any conditions the requirement of controllable loads). Therefore, we scaled the loads and generated power in the system so reaching the following configuration: • Total power of controllable loads: 3.2 kW so distributed: – – – – –

Smart plug 1 (load 1, namely, CARICO 1): 1.5 kW Smart plug 2 (load 2, namely, CARICO 2): 300 W Smart plug 3 (load 3, namely, CARICO 3): 400 W Smart plug 4 (load 4, namely, CARICO 4): 550 W Smart plug 5 (load 5, namely, CARICO 5): 450 W

• Total power of non-controllable loads: 1.9 kW so distributed: – Uncontrollable load 1 (namely, CARICO 6): 300 W – Uncontrollable load 2 (namely, CARICO 7): 500 W – Uncontrollable load 3 (namely, CARICO 8): 1.1 kW • Peak power of the photovoltaic system: 5 kWp

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

317

14.4.2 The Functional Perspective The equipment described so far is a complete and independent system, which can emulate a whole apartment. It only requires an Internet connection to communicate with the remote COGITO platform, on which the scheduling algorithm is run and which receives values about the energy produced by the photovoltaic system and the energy consumed by all the loads. From a functional point of view, the case study has the following characteristics: • Remote management of loads. In devising the admissible scheduling, the system has to consider both controllable and uncontrollable loads. In the considered scenario, five electrical loads are controllable, and three are the uncontrollable loads. This mirrors the fact that, in an apartment, not all the loads can be scheduled at a specific time (e.g., a fridge has to be always on, or a hairdryer has to work each time a user needs it). • Measurement of energy flows. The developed scheduling system is able to sense and monitor (i) the overall energy withdrawn by the apartment through the energy meter; (ii) the overall injecting energy into the apartment’s network, that is, the energy produced by the photovoltaic system. Such energy is sampled by a dedicated energy meter; and (iii) the consumption of each electrical load made through the smart plug. • Local and remote system monitoring. It is obtained through a dashboard that provides real-time and historical data graphically.

14.4.3 The Underpinning Software Infrastructure The case study also consists of a software infrastructure, installed on a server at the Omnia Energia headquarter, which allows interaction with the COGITO platform and remote monitoring of the operating status of the system. For this purpose, the following software products were installed and configured: • An MQTT broker • A time series database • A composer system dashboard The MQTT broker takes care of filtering and distributing the communications among the publishers and subscribers. Through it, the Omnia Meter sends, on specific topics, the measures and status of the connected devices and the additional information necessary for the scheduling algorithm (such as the hourly cost of energy) and receives, from the COGITO platform, the computed scheduling of the controllable loads. The installed MQTT broker is Mosquitto,5 an Eclipse

5 Mosquitto

MQTT Broker. http://www.steves-internet-guide.com/mosquitto-broker/.

318

F. Cicirelli et al.

Foundation project, which provides server and client implementations compliant with the MQTT standard. The main topic structure used for sending data from the ZigBee devices is as follows: COGITO/MAC_Address_OmniaMeter/Tipologia_device_ZigBee/ IEEE_Address_device_ZigBee/Cluster_ZigBee/Attribute_ZigBee

The payload is written in JSON and consists of the “date” and “value” fields: {"Date": timestamp, "value": "value"}

For example, the topic used to send the measurement of the electrical power absorbed by a specific load connected to a smart plug is COGITO/70:f1:1c:0d:69:83/SMART_PLUG/00:0d:6f:00:0b:7a:78:a4/ smartenergy_metering/instantaneous_demand

The associated payload is instead {"Date": 1571235668, "value": "68.30"}

The information exchanged via the MQTT protocol between the Omnia Meter and the COGITO platform is stored on a time series database, i.e., a database optimized for working with information uniquely associated with a date. The used database is InfluxDB,6 born in 2013, which is the most widespread and used time series database, also thanks to its open-source nature and its great adaptability that makes it able to run on any operating system. For storing the data from MQTT to InfluxDB, a service has been developed. It behaves as an MQTT client, listens to various topics, processes the messages received, and saves the information on the database. The stored data are then taken from the database and displayed on a dashboard created by using Grafana,7 a dashboard composer system, which allows creating dashboards starting from the data in a database. Grafana allows to generate charts by querying different types of data sources such as InfluxDB, Graphite, OpenTSDB, and Elasticsearch and provides an interactive query generator tool for creating charts.

14.4.4 Customization of the Omnia Meter As highlighted above, the Omnia Meter is very important for the considered case study. In particular: • It interfaces, via MOME, with the energy meter installed upstream of all the loads, acquiring information on global energy flows. 6 InfluxDB. 7 Grafana

https://www.influxdata.com/products/influxdb/. Labs. https://grafana.com/.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

319

• It interfaces with all the smart plugs, acquiring energy information on individual loads, and activates/deactivates them. • It interfaces with the energy meter at the photovoltaic system (see Sect. 14.4.1), in order to collect, every 15 minutes, the information related to the average power produced by the system itself on the last 15 minutes. • It sends the information collected, in real time, through the MQTT broker, to the COGITO platform. • It receives and actualizes the daily scheduling of the loads. Such schedule, which is calculated by the COGITO platform, is composed of 96 tuples, each of them representing a system load configuration. A tuple states which load has to be on or off in a time interval of 15 minutes. All the tuples cover a whole day. In the specific case study, each tuple presents five values, one for each controllable load, which is controlled by acting on the related smart plug. Specifically, for the case study implementation, a customized version of the Omnia Meter has been released by Omnia Energia. More in particular, the firmware of the Omnia Meter was improved to add the following functionalities. • Acquisition of photovoltaic system production data. The implementation of this functionality required the development of an application on the Omnia Meter. Such an application wakes up every 15 minutes, through the use of the Linux cron service, and interfaces wirelessly with the data logger of the photovoltaic system. In such a way, the information of interest is requested. In particular, the data related to the average power produced by the system in the last quarter of an hour is retrieved. Furthermore, the Omnia Meter, based on this information, estimates the average power produced by the PV system in the next quarter of an hour. At this point, this information is sent via MQTT message to the COGITO platform. In order to interface the Omnia Meter with the data logger, a software application written in PHP language was also developed on the PV controller. Such an application receives the request from the Omnia Meter and returns the desired measurements. Figure 14.8 shows the python application that runs on the Omnia Meter, requests the data from the PV system, makes the average in the data collected, and publishes the elaborated results via MQTT. • Scaling of the energy data of the loads/photovoltaic system. As stated before, the data related to the energy consumption of the loads (from both the smart plugs and the energy meters) and those related to the photovoltaic production are appropriately scaled in order to reproduce the case of a real apartment. To this end, the data from various sources are multiplied by different scale factors to reach the final configuration shown above. • Management of uncontrollable loads. The Omnia Meter, through the smart plugs and the energy meter, is able to acquire all the data about energy consumption so to be able to define also the energy profile of the uncontrollable loads. Once acquired, such profiles are provided to the COGITO scheduler, which takes advantages of such information

320

F. Cicirelli et al.

Fig. 14.8 Code running on the Omnia Meter for the communication with the FV system

in the elaboration of the final loads’ schedule. Figures 14.9 and 14.10 portray two profiles built during the case study running.

14.4.5 The Case Study Dashboard This section provides a view of the dashboard purposely developed for the case study. Such a dashboard graphically presents all the data acquired by the sensors in the system. Moreover, it shows the scheduling that the COGITO platform sends to the Omnia Meter. Finally, it portrays data about the PV production and the

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

321

Fig. 14.9 Uncontrollable loads: A first daily profile

Fig. 14.10 Uncontrollable loads: A second daily profile

estimation of the money spent by using the energy needed for the scheduling. The various sections of the dashboard will now be described in more detail. The upper part of the dashboard is shown in Fig. 14.11 and is related to the scheduling of the controllable loads. In particular, there are two charts named: • Scheduling real: presents the scheduling of loads actually performed by the Omnia Meter, related to the topic: COGITO/70:f1:1c:0d:69:83/scheduling_real

322

F. Cicirelli et al.

Fig. 14.11 Dashboard: scheduling section

The power absorbed by the loads is displayed in the form of a histogram in which it is possible to distinguish the power of every single load (i.e., each smart plug has an associated color). • Scheduling updated every 15 m: displays the schedule of the loads, calculated by the algorithm and updated every 15 minutes during the day, related to the topic: COGITO/70:f1:1c:0d:69:83/scheduling

It is worth noting that this chart is only for visualization purposes, and its aim is only to show that the system can re-calculate the schedule every 15 minutes. In each of these charts, with timeslots of 15 minutes, are represented: • The cumulated power used by the scheduled loads. • The curve related to the power threshold, defined by the algorithm of scheduling. Such a curve determines the maximum power that the loads can withdraw from the energy network. It changes in the time since it is considered the presence of unschedulable loads, in the sense that it lowers as an uncontrollable load is forecasted to be active. • The curve related to the cost index (estimated_cost), also defined by the scheduling algorithm. Such a curve considers both the energy cost at a specific time of the day and the PV energy production. In fact, it lowers during the time of the day in which the PV production is high.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

323

Fig. 14.12 Dashboard: device measurements section

Another part of the dashboard, shown in Fig. 14.12, refers to the sensing features of the system and presents the following panels: • Smart Plug 1, . . . , Smart Plug 5, which are the smart plugs connected to the controllable loads. The panels, which are referred to the smart plugs, are shown: (i) the status of the plug (i.e., ON or OFF), (ii) the current, (iii) the total energy consumed in a configured time interval, and (iv) a graph of the absorbed power in the time. • Energy meter, which is the meter placed upstream of the case study. It gives the information regarding the power consumption of all the loads together, both controllable and uncontrollable, in the time. • PV plant, which shows the chart of the average electrical power produced by the photovoltaic system, updated every 15 minutes. Moreover, it reports the average, maximum, and current power-generated values related to a selected time interval. Another part of the dashboard reports the chart Not controllable loads and is shown in Fig. 14.13. It displays the power consumption related to the uncontrollable loads, averaged on a time interval of 15 minutes.

324

F. Cicirelli et al.

Fig. 14.13 Dashboard: profile section of uncontrollable loads

Fig. 14.14 Dashboard: exchange section with the network

The chart in Fig. 14.14, called Energy exchange with power grid, shows the balance of the exchange of energy with the electricity grid. In particular, the three curves in the chart are explained in the following: • consumed_power: is the curve of the overall power consumption of the case study and, therefore, coincides with the power needs of the emulated apartment • pv_power: is the production curve of the photovoltaic system • grid_energy_exchange: represents the exchange with the electricity grid, calculated on the basis of the energy needs, and the photovoltaic production; a positive value indicates a withdrawal of energy from the grid, and a negative one represents an injection into the grid of the production surplus.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

325

Fig. 14.15 Dashboard: energy cost section

Fig. 14.16 Dashboard: cost section of the loads that can be controlled in the various scenarios

The Energy cost panel displays, instead, the chart related to the hourly cost of the energy withdrawn from the network, together with measurements related to the minimum, maximum, and current price values, within a selected time interval (Fig. 14.15). Finally, the Scheduled loads daily cost chart shown in Fig. 14.16 presents an estimation, on a daily basis, of the costs spent for the energy used for the controllable loads, evaluated in the scenarios: worst case, best case, scheduling case, and random case. To evaluate the effectiveness of the scheduling algorithm in optimizing the energy costs concerning the management of controllable loads, this panel has been developed to simulate different load activation scenarios. The goal is to compare

326

F. Cicirelli et al.

the related energy costs with those obtained through the implemented scheduling. In particular, for each of the scenarios considered, a software module calculates the cost of energy for the selected days on a daily basis. Such calculation is based on the measurements received and logged in the database, coming from the installed devices. In detail, the information acquired by the smart plugs that manage the controllable loads are used, in addition to those related to the production of the PV system and the hourly cost of the energy. The costs in the various scenarios were calculated as follows: • Worst case is the total cost for activating all the loads in the most expensive period; for this curve, we also assume that the photovoltaic system is not producing energy. • Best case is the total cost for activating all the required loads in the case in which the PV system is producing at its higher level. The required energy for the loads that overflow the produced energy is supposed to be withdrawn from the power grid and to be paid at the lowest price. • Random case is the total cost for activating all the loads if they are all scheduled at 9:00 in the morning. • Scheduling case is the total cost for activating the loads according to the scheduling calculated by the COGITO platform. It is worth noting that the costs for executing the scheduling calculated by the COGITO platform are always lower than the random and the worst cases. The cost of the scheduling case is outperformed only by the best case, which is probably not feasible since, activating the loads only according to the PV production/energy costs can cause peaks in the energy consumption. Moreover, in this case, the temporal constraints requested by the users could not be respected. In the case in which no constraints were violated, the scheduling case is able to behave as the best case. This occurs, for example, on December 14.

14.5 Conclusion This chapter proposed a case study realizing the cognitive and automatic scheduling of in-house electric devices. Such a case study was implemented in the context of the COGITO project and was developed thanks to the partnership between ICARCNR and Omnia Energia S.p.A., which is an Italian energy provider. The scheduling service realized took user preferences, self-produced energy, and variable energy costs into account. Experimental outcomes show how the implemented system is able to avoid peak consumption, maximize the use of self-produced energy, and lower the use of withdrawn energy from the power grids with respect to some usage patterns chosen as a baseline.

14 Intelligent Load Scheduling in Cognitive Buildings: A Use Case

327

Acknowledgments This work has been partially supported by the COGITO (A COGnItive dynamic sysTem to allOw buildings to learn and adapt) project, funded by the Italian government (PON ARS01 00836) and by the CNR project “Industrial transition and resilience of post-Covid19 Societies—Sub-project: Energy Efficient Cognitive Buildings.”

References 1. Amjady, N., Hemmati, M.: Energy price forecasting - problems and proposals for such predictions. IEEE Power Energy Mag. 4(2), 20–29 (2006) 2. Atzori, L., Iera, A., Morabito, G.: The internet of things: A survey. Computer Networks 54(15), 2787–2805 (2010) 3. Belli, G., Giordano, A., Mastroianni, C., Menniti, D., Pinnarelli, A., Scarcello, L., Sorrentino, N., Stillo, M.: A unified model for the optimal management of electrical and thermal equipment of a prosumer in a dr environment. IEEE Trans. Smart Grid (2017). https://doi.org/10.1109/ TSG.2017.2778021 4. Cicirelli, F., Guerrieri, A., Spezzano, G., Vinci, A., Briante, O., Iera, A., Ruggeri, G.: Edge computing and social internet of things for large-scale smart environments development. IEEE Internet Things J. (99) (2017). https://doi.org/10.1109/JIOT.2017.2775739 5. Cicirelli, F., Guerrieri, A., Mercuri, A., Spezzano, G., Vinci, A.: Itema: A methodological approach for cognitive edge computing iot ecosystems. Future Gener. Comput. Syst. 92, 189–197 (2019). https://doi.org/10.1016/j.future.2018.10.003. http://www.sciencedirect.com/ science/article/pii/S0167739X17330224 6. Cicirelli, F., Guerrieri, A., Spezzano, G., Vinci, A.: A cognitive enabled, edge-computing architecture for future generation iot environments. In: 2019 IEEE 5th World Forum on Internet of Things (WF-IoT), pp. 35–40. IEEE (2019) 7. Cicirelli, F., Gentile, A.F., Greco, E., Guerrieri, A., Spezzano, G., Vinci, A.: An energy management system at the edge based on reinforcement learning. In: 2020 IEEE/ACM 24th International Symposium on Distributed Simulation and Real Time Applications (DS-RT), pp. 1–8. IEEE (2020) 8. Cicirelli, F., Guerrieri, A., Mastroianni, C., Spezzano, G., Vinci, A.: Thermal comfort management leveraging deep reinforcement learning and human-in-the-loop. In: Accepted for the Proc. of the 1st IEEE International Conference on Human-Machine Systems (ICHMS2020) (2020) 9. Cicirelli, F., Guerrieri, A., Mastroianni, C., Scarcello, L., Spezzano, G., Vinci, A.: Balancing energy consumption and thermal comfort with deep reinforcement learning. In: 2021 IEEE 2nd International Conference on Human-Machine Systems (ICHMS), pp. 1–6 (2021). https:// doi.org/10.1109/ICHMS53169.2021.9582638 10. Das, S., Cook, D.: Designing and modeling smart environments. In: International Symposium on a World of Wireless, Mobile and Multimedia Networks, 2006. WoWMoM 2006, pp. 5 pp.– 494. Buffalo-Niagara Falls, NY (2006). https://doi.org/10.1109/WOWMOM.2006.35 11. Fioretto, F., Yeoh, W., Pontelli, E.: A multiagent system approach to scheduling devices in smart homes. In: Workshops at the Thirty-First AAAI Conference on Artificial Intelligence (2017) 12. Li, T., Xiao, Y., Song, L.: Deep reinforcement learning based residential demand side management with edge computing. In: 2019 IEEE International Conference on Communications, Control, and Computing Technologies for Smart Grids (SmartGridComm), pp. 1–6. IEEE (2019) 13. Lin, Y.-H., Hu, Y-C.: Residential consumer-centric demand-side management based on energy disaggregation-piloting constrained swarm intelligence: Towards edge computing. Sensors 18(5), 1365 (2018)

328

F. Cicirelli et al.

14. Mahesh, B.: Machine learning algorithms-a review. Int. J. Sci. Res. (IJSR). [Internet] 9, 381– 386 (2020) 15. Mnih, V., Badia, A.P., Mirza, M., Graves, A., Lillicrap, T., Harley, T., Silver, D., Kavukcuoglu, K.: Asynchronous methods for deep reinforcement learning. In: International Conference on Machine Learning, pp. 1928–1937 (2016) 16. Noor, A.K.: Potential of cognitive computing and cognitive systems. Open Engineering 5(1) (2015) 17. Palensky, P., Dietrich, D.: Demand side management: Demand response, intelligent energy systems, and smart loads. IEEE Trans. Ind. Inf. 7(3), 381–388 (2011). https://doi.org/10.1109/ TII.2011.2158841 18. Ploennigs, J., Ba, A., Barry, M.: Materializing the promises of cognitive iot: How cognitive buildings are shaping the way. IEEE Internet Things J. 5(4), 2367–2374 (2017) 19. Puterman, M.L.: Markov Decision Processes: Discrete Stochastic Dynamic Programming. Wiley (2014) 20. Shahryari, K., Anvari-Moghaddam, A.: Demand side management using the internet of energy based on fog and cloud computing. In: 2017 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData), pp. 931– 936. IEEE (2017) 21. Shi, W., Cao, J., Zhang, Q., Li, Y., Xu, L.: Edge computing: Vision and challenges. IEEE Internet Things J. 3(5), 637–646 (2016) 22. Sutton, R.S., Barto, A.G.: Reinforcement Learning: An Introduction. MIT Press (2018) 23. Wooldridge, M.: An Introduction to Multiagent Systems. Wiley (2009) 24. Zhang, D., Han, X., Deng, C.: Review on the research and practice of deep learning and reinforcement learning in smart grids. CSEE J. Power Energy Syst. 4(3), 362–370 (2018)

Chapter 15

Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings Luigi Scarcello and Carlo Mastroianni

15.1 Introduction The management of the thermal comfort in indoor environments has now become an essential priority considering that, especially in industrialized countries, people spend about 90% of their time indoors. With this in mind, in recent years intelligent buildings are experiencing a growing success, since they are able to provide healthy and comfortable environments to occupants who use advanced technologies supported by the Internet of Things (IoT) and artificial intelligence (AI). Some of these technologies are managed autonomously and can rely on automatic learning methods: in other words, they learn independently, by interacting with users and with the environment, to control the different processes of a smart home, ranging from lighting and security to the management of the air conditioning system [13]. This guarantees positive effects in terms of thermal comfort and energy efficiency and allows people to approach new, smarter lifestyles [11]. The work presented here aims to identify innovative solutions, based on AI and directed to a better energy management in a “smart building” context. The basic idea is to use the potential of AI, and in particular of machine learning (ML), to define new cognitive devices that, equipped with the ability to adapt and learn autonomously, and by exploiting the potential of the Internet of Things ( IoT), are able to manage efficiently and sustainably the appliances of a building. In the context of ML, the following learning methodologies are generally identified: “supervised learning,” “unsupervised learning,” and “reinforcement learning.” Unlike the first two techniques, reinforcement learning is not based on a static dataset but operates in a dynamic environment and learns autonomously from the past experiences,

L. Scarcello () · C. Mastroianni ICAR-CNR, Rende, Italy e-mail: [email protected]; [email protected] © The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6_15

329

330

L. Scarcello and C. Mastroianni

without supervision. This reduces the need for data collection, preprocessing, and labeling, prior to the actual training. In recent years, various approaches have been proposed for the development of optimization algorithms for the management of smart buildings based on reinforcement learning algorithms [20]. The common difficulty that limits the adoption of these techniques concerns the extreme complexity related to the modeling phase of the building itself and of the adopted devices. However, current deep reinforcement learning (DRL) techniques make it possible to manage this complexity by exploiting the versatility and potential of artificial neural networks. In this regard, the deep reinforcement learning algorithms, including the Deep QNetwork, allow overcoming the limitations of traditional reinforcement learning methods. The work presented in this chapter uses cognitive technologies, based on DRL, to learn automatically how to control the heating system (HVAC) of an office space. The goal is to implement a cyber-controller capable of minimizing both the perceived thermal discomfort and the primary energy required by the HVAC system. The discomfort is minimized when the internal temperature of the room under consideration approaches the comfort temperature desired by the users. The learning process is driven by the definition of a cumulative reward, which includes and combines two reward components that consider, respectively, user comfort and energy consumption. To evaluate the effectiveness of the approach, a case study was considered that refers to the control of a fan coil installed in an office room. In this regard, a thermal model has been proposed to train the controller and compute both the energy consumption and the internal temperature trend. The experiments conducted through numerical simulations have shown that the adopted approach is able to influence the behavior of the DRL controller and of the learning process and thus balance the two required objectives. The implemented control system can be executed in real environments by exploiting IoT devices capable of controlling fan coils, interacting in real time with the reference environment, and processing the feedback provided by the sensors that monitor the consumption and the level of comfort perceived by users. The paper is organized as follows: Sect. 15.2 summarizes some related work; Sect. 15.3 introduces the general architecture and the simulated environment for which the proposed approach has been developed and tested; Sect. 15.4 discusses the simulation results and estimates the effectiveness in terms of the thermal comfort and energy consumed by the HVAC system; and finally Sect. 15.5 concludes the paper.

15.2 Related Work Nowadays, smart buildings require the use of Internet of Things (IoT) and artificial intelligence (AI) technologies to monitor and learn automatically how to optimize the building operations. Among all, the two most important aspects that must be

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

331

taken into consideration are the management of people’s comfort and the energy optimization. In a building, the comfort level is influenced by several parameters, including air quality, indoor temperature, brightness level, and relative humidity. Furthermore, the level of comfort also depends on the number of users and on the preferences and activities carried out by the people who live in the environment. It should be noted that the user comfort must be balanced with energy savings, as energy consumption in buildings represents approximately 30–40% of the total [9]. The demand for energy is constantly growing; therefore the environmental impact due, for example, to the increase in greenhouse gas emissions, is also increasing. For these reasons, it is very important to design and build buildings capable of reducing energy consumption while preserving their operations and ensuring user comfort. In recent years, new approaches have been proposed, based on cognitive paradigms and artificial intelligence techniques, for the development and management of efficient smart buildings. In particular, since the physical model of a building is extremely complex, deep reinforcement learning (DRL) techniques are suitable for addressing this complexity by exploiting the potential and versatility of artificial neural networks [9], thus favoring the development of cognitive controllers, which exhibit self-learning behaviors. A large amount of work has been done for the design and development of systems that exploit ML to maximize comfort in buildings while, possibly, trying to reduce energy consumption. For instance, the work in [12] offers a survey about the application of reinforcement learning (RL) for the realization of buildings’ energy management systems. In these systems, a number of agents act in an environment and learn how to interact, through specific actions, in the system, depending on the state of the environment state [17]. Such agents can learn how to interact with the environment by receiving positive or negative rewards depending on the actions they perform. The experimental results reported in [2] confirm that RL-based systems can achieve performances that are close to those obtained with rule-based systems, without requiring specific expert knowledge. DRL-based systems arise when RL agents learn and operate by exploiting a deep neural network. The main contribution of these systems for the control of buildings is that they are able to manage very large state and action spaces [16]. In [18], DRL is used to achieve comfort and efficient energy management in buildings. In [5], the authors present the OCTOPUS approach, which exploits DRL to manage together blinds, HVAC, window, and lighting systems, so to optimize the use of energy and keep a good human comfort in commercial buildings. The authors of [19] use the Deep Deterministic Policy Gradient (DDPG), a specific RL algorithm that continuously returns control actions, to schedule Energy Storage Systems (ESS) and HVAC together. In [7], the thermal/energy management in a building is defined as a problem of cost minimization. The work takes into consideration the energy usage of the HVAC and the thermal comfort of the building inhabitants. In this direction, [7] first uses a deep neural network-based approach to predict people’s thermal comfort and then adopts DDPG to understand the thermal control policy. Also in [8] and [10], the authors propose a DRL-based control to balance users’ comfort and energy savings. In the former paper, the action of the agent is set to one

332

L. Scarcello and C. Mastroianni

of two values: the DRL-based controller decides whether to switch on/off the heater. In the latter work, the optimization process is executed by performing actions when the photo-voltaic production is high; possible actions are related to three heat pump operation modes, which are heating on, domestic hot water on, and system on hold. All the introduced works are very interesting and tend to overcome the problem of finding an equilibrium between energy saving and people comfort. However, to the best of our knowledge, none of them considers user intervention on the HVAC system as an estimation of the degree of thermal comfort of the building inhabitants. This work tries to explore this research avenue in order to train a DRL system by considering both a standard environmental comfort and the actual comfort perceived by people, estimated by evaluating their feedback.

15.3 A DRL Model for the Management of Indoor Environments The approach based on DRL, presented in this chapter, falls within an emerging research area, which is devoted to the development of cognitive controllers that manage a general notion of comfort inside smart buildings [1, 3]. This notion takes into account both environmental parameters and feedback coming from the users that live in the environment. In particular, human feedback is combined with the automatic feedback provided by the environment, thus realizing the “human-in-theloop”1 concept. Figure 15.1 shows a schema of the approach. The goal is to learn from the past actions how to improve people’s comfort and at the same time limit the energy consumption. The DRL-based controller receives as input the state of the system along with two kinds of rewards that are given (i) by the dwellers of the environment (the “human reward”) and (ii) by the environment itself. The state of the system is defined as a set of parameters and variables that can be classified into three groups of data: • Environmental parameters including, for instance, the state of windows and doors in a room, and outdoor/indoor environmental parameters like temperature, humidity, and carbon dioxide concentration • Presence and activities providing information about the presence of people and their activities • Energy consumption giving insights about the amount of energy required, e.g., for heating and lighting the environment

1 Human-in-the-loop is an approach that places people’s knowledge and experience at the center of ML processes, which requires the mediation of users, who give computers access to knowledge of the real world and make sure that they are effectively capable of responding to real needs.

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

333

Fig. 15.1 The logical architecture of the DRL-based control cycle

The environmental reward is computed starting from the gap between the actual state of the environment and a reference state that is expected to ensure a good level of comfort and energy consumption. The human reward gives information about the comfort level perceived by the users; as an example, the manual intervention of a user on the HVAC system is considered as an evidence that the user comfort is not optimal and is considered by the controller as a negative reward. A reward function is defined to combine human and environmental rewards. The aim is to use a DRL technique, specifically, the Deep Q-Network (DQN) algorithm [15], to select the action that maximizes the overall reward expected in the future. Through the selected action, the controller operates on the environment—for example, on the HVAC system and on doors and windows—using a set of actuators. In accordance with the digital twin paradigm [6, 14], the control cycle can interact both with the real environment and with its digital counterpart. The digital counterpart of the system is composed of two components (depicted in red boxes in Fig. 15.1), namely, the simulator of the environment and a robot that simulates the human behavior. The simulator of the environment predicts the state evolution, for example, the expected values of temperature and humidity after the modification of the HVAC system state. The human interactions are simulated by a people behavioral model that, starting from the information about people’s perceptions and their interactions with the HVAC system, is able to predict the future user interactions. This model can either be taken from the literature or derived from the observation of real people (depicted in green boxes in Fig. 15.1) in the environment. Among the DRL approaches proposed in the literature, the DQN algorithm has been chosen, which implements an off-policy learning algorithm and Q-learning, whereas Sarsa is an on-policy learning algorithm. The main difference consists

334

L. Scarcello and C. Mastroianni

, ≔ Replay Buffer 1: , , ′ , 2: , , ′ , … N: , , ′ ,



DRL Controller

≔ ′

, ,

, , ′,



Real Environment



Reward Function Simulated Environment ′

Fig. 15.2 The deep reinforcement learning cycle

in the adopted optimal policies, which allow Sarsa and Q-learning to converge to different solutions: Sarsa converges to a solution that is optimal under the assumption that we keep following the same policy that was used to generate the experience. Q-Learning converges to a solution that is optimal under the assumption that, after generating experience and training, we switch over to a greedy policy. In other words, Q-learning is preferable in our situation where we do not care about the agent’s performance during the training process, but we just want it to learn an optimal greedy policy that we will switch to eventually. The steps of the DRL cycle are depicted in Fig. 15.2. The Replay Buffer stores the records that represent the system’s past behavior. Each record (s, a, s , r) includes the data related to the execution of a past action, where s is the state, a is the action, s is the next state (reached after the execution of a), and r is the reward. The state s includes the parameters that represent the model evolution and the states of the actuators, for example, the actuators (HVAC system and doors/windows) of Fig. 15.1. The DRL controller selects the action a and delivers it to the actuators. Figure 15.2 also shows that it is possible to execute the DRL cycle either in the real environment, by exploiting the human interactions, or on the simulated/digital counterpart. In the former case, the cycle performs a single action at each iteration, as shown in the top half of the figure. In the latter case, the simulator can perform multiple experiments in batch, as depicted in the bottom half of Fig. 15.2: this is represented using a vector notation for s, a, s , and r. The cycle begins by evaluating the state s and providing it as an input to the DRL controller. For each admissible action a, the DRL controller computes the Q(s, a) value, i.e., the estimation of how much profitable is the choice of a when the environment is in the state s, and selects the next action, based on the adopted policy, as better explained later in this section. After the execution of the chosen action, the new state s is evaluated and given to the controller as an input for the next iteration of the DRL cycle, and the reward r is computed. Figure 15.2 also represents the gradual composition of the

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

335

record (s, a, s , r), through the arrow bars located on the top and on the bottom, respectively. Finally, this record is added to the Replay Buffer. The choice to resort to DQN, a well-known DRL algorithm, derives from the observation that the state space is continuous: the cyber-controller is trained to approximate the value of Q(s, a) for every possible state s, using the parameters of the neural network. DQN [15] is a variation of the classical Q-learning algorithm that introduces two main elements: (i) a deep neural network for the approximation of the function Q(s, a) and (ii) a training dataset that is used to compute the model error and update the model parameters. The objective is to minimize the rootmean-square deviation (RMSD) between the current value of Q(s, a) and the value updated after obtaining the reward r, i.e., the loss defined as   r + γ max Q(s , a) − Q(s, a) a

(15.1)

where γ is the discount factor, used to weigh the current and past rewards. A DRL algorithm aims to find the optimal policy, i.e., the policy that determines, at each state, the action that maximizes the reward. During the execution of the algorithm, the choice of the action needs to balance two different needs: exploring all the possible actions and exploiting the action that in the past has given the best results in terms of the reward received from the environment, that is, the action for which the Q(s, a) assumes the largest value. These two needs are balanced by using a parameter , which is the probability of choosing a random action instead of the best action. Initially, is set to its maximum value max , to maximize exploration, and then it gradually decreases to zero, to obtain pure exploitation. The value of at the running time t is = max e−λ·t

(15.2)

where λ is the decay factor, with 0 < λ < 1. The approach described above can be tailored to several scenarios. For instance, the notion of comfort can consider different aspects, e.g., visual comfort, acoustic comfort, or air quality. In addition, the set of considered actuators can also be extended, e.g., with dimmable led lamps and automatic curtains. In this work, our primary goal is to show how the DRL controller can manage both thermal comfort and energy consumption and how such goals can be balanced by tuning the components that concur to define the reward function.

15.3.1 Thermal Model The environment taken into consideration for our study is a virtual office room equipped with a fan coil unit (FCU). The FCU can be switched on/off and, when

336

L. Scarcello and C. Mastroianni

activated, can be set to one of three levels of power. Hence, the possible actions are four and correspond to setting the FCU to one of its admissible states: [off, level 1, level 2, level 3]. Level 3 corresponds to the nominal power of the FCU, whereas level 1 and level 2 correspond to two different fractions of the nominal power. The model used to compute the evolution of the indoor temperature (Ti ) and the primary energy consumption (Qp ), that is, the energy supplied to the HVAC system, is described in the following. During a short time interval t (in which the indoor and outdoor temperatures can be considered constant), the amount of exchanged thermal energy Q is expressed in the energy balance of Eq. 15.3, where PF CU is the power supplied by the FCU and Pout is the power wasted toward the outdoor environment: PF CU · t − Pout · t = Q

(15.3)

The heating power supplied by the HVAC system at a given time t is obtained from the technical data sheet of the chosen FCU,2 which is a linear function of the air inlet temperature, i.e., the indoor temperature Ti of the room. As represented in Eq. 15.4, the power also depends on the parameters a and b, which are obtained by the data sheet of the FCU, and on the parameter c, which depends on the power-level set by the cyber-controller:   PF(t)CU = a · Ti(t) + b · c

(15.4)

In particular, in the considered scenario, the FCU is an Emmeti Silence IVO-30AF, designed for vertical wall installations and powered by a natural gas condensing boiler. For this FCU, the parameters a and b assume values equal to −182.86 and 10838, respectively. The parameter c assumes the values 1.00 (level 3), 0.91 (level 2), 0.74 (level 1), and 0.00 (off). As an example, in the standard conditions given by UNI EN 1397:2016, the considered FCU supplies a heating power PF CU equals to, respectively, 7.10 kW (level 3), 6.46 kW (level 2), 5.25 kW (level 1), and 0 kW (off). The power exchanged with the outside at time t is computed as follows:   (t) (t) Pout = V · U · Ti − To(t)

(15.5)

where V and U are the volume and the average transmittance of the considered room, respectively, and To(t) is the outside temperature at time t. According to the fundamental law of thermotics, the quantity of thermal energy Q that must be supplied to a volume V of air, having a specific heat capacity cp and a density ρ, to increase its temperature up to Ti(t+t) , is given by Eq. 15.6: 2 Emmeti

Silence fan coil: Technical data sheet. https://www.schede-tecniche.it/schede-tecnicheventilconvettori/EMMETI-scheda-tecnica-ventilconvettori-SILENCE.pdf. Last seen: 2021-12-27.

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

  (t+t) (t) Q = ρ · V · cp · Ti − Ti

337

(15.6)

From Eqs. 15.3 to 15.6, we obtain Eq. 15.7, through which we model the evolution of the room temperature: Ti(t+t)

=

Ti(t)

   (t) (t) (t)  t a · Ti + b c U · t Ti − To + + ρ · V · cp ρ · cp

(15.7)

In this model, the parameter U refers to old buildings with bad insulation, and its value is equal to 3.48 W/m3 K. The primary energy consumption Qp is given by Qp =

PF CU · t ηT

(15.8)

where ηT is the global efficiency of the whole heating system. It can be expressed as ηT = ηG · ηR · ηD · ηE

(15.9)

where ηG , ηR , ηD , and ηE are the generation, regulation, distribution, and emission efficiencies, which in our case assume constant values equal to 0.90, 0.96, 0.94, and 0.95, respectively. It is now possible to define the state and action of the DRL cycle in our scenario. The state s is < Ti , To , level >, where Ti and To are, respectively, the indoor and outdoor temperature and level is the power level of the FCU, which, as specified above, can assume one of four values. The action a is executed by the controller to set the FCU to one of these values.

15.3.2 Behavioral Model The presented DRL cycle exploits the “human-in-the-loop” paradigm in two ways: (i) the behavior of the user is modeled by taking into account his/her ability to tolerate a moderate thermal discomfort and speed up the learning process, and (ii) the frequency of user intervention on the HVAC system is taken as an estimation of his/her degree of thermal comfort; therefore it is exploited to provide a reward to the DRL controller. The probability of taking an intervention to change the state of the FCU during a time step (increase/decrease the FCU level) increases with the absolute value of the difference between the comfort temperature (Tc ) and the measured indoor temperature (Ti ), from now on referred to as T . To model the user behavior, and estimate this probability, we introduced the action probability as a smoothstep

338

L. Scarcello and C. Mastroianni

function of T , expressed as ⎧ T ≤ Tmin ⎪ ⎨ 0 2 3  T −T T −T min min P (T ) = 3 T −T − 2 Tmax −Tmin Tmin < T ≤ Tmax max min ⎪ ⎩ 1 T > Tmax (15.10) where Tmax and Tmin are the maximum and the minimum values of T that are tolerated, i.e., the action probability approaches 1 when T exceeds Tmax , while it is equal to 0 for values of T lower then Tmin [4].

15.3.3 Objective Function and Reward In our scenario, the goal is to minimize both the energy consumption and the thermal discomfort in the room. These two objectives are typically in contrast; therefore a balance between them is required. In order to assess the effectiveness of the control policy, we define the objective function as follows: fobj = αC ·

D EF CU + αE · Dmax Emax

(15.11)

with αC and αE non-negative values and αC + αE = 1. In Eq. 15.11, the quantity D measures the standard deviation, measured along one day, of the difference between the comfort temperature Tc and the measured indoor temperature Ti , while Dmax is the maximum possible deviation. The values EF CU and Emax are, respectively, the energy consumed by the FCU in a whole day, and the maximum possible consumption, obtained when the FCU is set to its maximum power in the considered scenario. EF CU and Emax are obtained, (t) respectively, by integrating PF CU and Pmax , the maximum power absorbed by the HVAC, during a day. The quantities Dmax and Emax are used to normalize the two terms of the objective function so as to permit their use in a single expression. The two parameters αC and αE are used to weigh the energy consumption and the discomfort. As described previously, an RL algorithm can be described in terms of abstract agents interacting with an environment. The main components of the algorithm, i.e., states, actions, rewards, and policy, are described in the following for our scenario. The environment is modeled by a state s ∈ S. At any given state, the agent can choose among a subset A of possible actions that can be performed in order to achieve a goal. After executing an action a ∈ A, the agent receives a reward r from the environment and moves to a new state s ∈ S. The reward is used by the agent to learn how to adapt its behavior in order to reach the desired goal: a positive reward means that the agent has chosen a good action, i.e., an action that allows it

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

339

to approach the goal. This behavior, or policy, consists in a rule that determines the best action at any possible state. In our scenario, the state is the representation of the environment by the cybercontroller and is defined as s =< Ti , To , level >, where Ti and To are, respectively, the indoor and outdoor temperature and a is the state of the HVAC system, as described in Sect. 15.3.1. The action is the position of the HVAC controller. The definition of the reward, used by the cyber-controller to improve its behavior, is related to the definition of the objective function of Eq. 15.11. In particular, the reward r (t) is computed at time t as 

r

(t)

P (t) D (t) = − αC · + αE · F CU Dmax Pmax

 (t)

(t)

= −αC · rC − αE · rE

(15.12)

where PF(t)CU is the power absorbed by the HVAC at time t and D (t) is the deviation at time t. The two components of the reward, corresponding to comfort and energy, (t) (t) are denoted by rC and rE , respectively.

15.4 Experimental Results The simulated environment modeled to test and train the DRL algorithm refers to the office room equipped with a fan coil unit (FCU), described in Sect. 15.3.1, whose users are modeled as in Sect. 15.3.2. In the considered scenario, the aim is to guarantee a satisfactory level of comfort for the users during the winter. This is accomplished by automatically controlling the HVAC in order to maximize the value of the objective function defined in Eq. 15.11, where the values of the weights of the two components can be tuned to give more or less importance to each of them. The adopted Deep Q-Network includes four fully connected layers of 50 neurons each, and a fifth layer having four neurons, which correspond to the four admissible states of the FCU. The Replay Buffer contains 200,000 records: when it is full, new records substitute the old ones in a random fashion. The training processes are performed by setting γ = 0.8 in Eq. (15.1), max = 1.0 and λ = 1.44 · 10−6 in Eq. (15.2). The value of λ is set so that decays to values lower than 0.01 after that 40% of the simulation length has elapsed. Each simulation includes 30,000 episodes, where an episode corresponds to a working day of 12 hours, and the evolution time step is set to 5 minutes. The neural network is re-trained at the end of each episode. Three performance indices have been used, namely: • The indoor temperature, Ti , to evaluate how it is near to the comfort temperature. This index is averaged over one episode. • The amount of primary energy, Qp , consumed in an episode. • The value of the overall reward, r, averaged over one episode.

340

L. Scarcello and C. Mastroianni

We performed a set of experiments in which: • The comfort temperature of the user, Tc , is equal to 20◦ C, and the values of Tmin and Tmax are set to 0◦ C and 5◦ C, respectively. • The starting value of the indoor temperature, Ti , varies randomly between 10◦ C and 20◦ C. • The outdoor temperature, To , varies randomly between 5◦ C and 15◦ C. • The maximum power of the FCU, Pmax , is set to 8900 W, that is, the power supplied when the indoor temperature is equal to 10◦ C, and the FCU is set to level 3. • The maximum possible deviation, Dmax , is set to 10◦ C. We tested different values of the α coefficients of Eq. (15.12) in order to assess the ability of the controller to balance the two objectives: • • • • •

set1 : αC =1.00, αE =0.00 set2 : αC =0.75, αE =0.25 set3 : αC =0.50, αE =0.50 set4 : αC =0.25, αE =0.75 set5 : αC =0.00, αE =1.00

The following figures show the results of the controller training process, i.e., the trends of the global reward, the indoor temperature, and the energy consumption. The trends are plotted versus the number of episodes. The first episodes refer to the exploration phase and therefore present an uncertain trend typical of the initial transient phase. After about 8000 episodes, the controller increasingly uses the experience provided by the previous results to correct its behavior and learns to choose the best action: in the last episodes, the trends get stabilized on almost constant values. The results are a confirmation that the learning process of the controller is successful. Figure 15.3 reports the trend of the cumulative reward over an entire episode. The figure shows that the third, fourth, and fifth sets of experiments—with weights αC and αE equal to [0.50,0.50], [0.25,0.75], and [0.00,1.00]—provide approximately similar results. Slight deviations are obtained only in the transient phase. The first and second sets of experiments—with weights αC and αE equal to [1.00,0.00] and [0.75,0.25]—provide different trends from the previous ones and also different from each other. In this case, the energy component of the reward function has a larger weight than the comfort component; indeed, as the weight αE increases, the contribution provided by the comfort component becomes negligible. The trend of the indoor temperature, averaged over an entire episode, is depicted in Fig. 15.4. In the first set of experiments—with weights αC and αE equal to [1.00,0.00]—the internal temperature almost coincides with the user’s comfort temperature: in this case, the user’s comfort conditions are satisfied, while the daily consumption of energy reaches the highest values, equal to about 32 kWh per episode, as shown in Fig. 15.5. The third, fourth, and fifth sets of experiments reach the same temperatures in a steady state, equal to about 18◦ C. In this context, the internal temperature does not drop beyond this value because it represents the

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

341

overall reward

0 -0.1 -0.2 -0.3

[1.00, 0.00] [0.75,0.25] [0.50, 0.50] [0.25,0.75] [0.00, 1.00]

-0.4 -0.5 0

5000

10000

15000

20000

25000

30000

episodes

indoor temperature [°C]

Fig. 15.3 Average value of the overall reward

24 23 22 21 20 19 18 17 16 15 14 13 12

[1.00, 0.00] [0.75,0.25] [0.50, 0.50] [0.25,0.75] [0.00, 1.00] 0

5000

10000

15000

20000

25000

30000

episodes Fig. 15.4 Average daily temperature

minimum threshold temperature accepted by the user: below this value, the user intervenes on the fan coil unit and modifies the power levels by-passing the action of the controller. At the end of the training process, the temperature reaches a value of 18◦ C, which differs from the comfort value indicated by the user (equal to 20◦ C), but this allows to obtain the minimum energy consumption, equal to about 25 kWh per episode, as reported in Fig. 15.5. The second set of experiments provides an intermediate temperature value, equal to 19.6◦ C. Figure 15.5 summarizes the trend of the daily energy consumption. Also in this plot, the third, fourth, and fifth sets

342

L. Scarcello and C. Mastroianni

energy consumption [kWh]

50 [1.00, 0.00] [0.75,0.25] [0.50, 0.50] [0.25,0.75] [0.00, 1.00]

45 40 35 30 25 20 15 10 0

5000

10000

15000

20000

25000

30000

episodes Fig. 15.5 Daily energy consumption

indoor temperature [°C]

30 25 20 15 1st 2000th 4000th 8000th 16000th 30000th

10 5

episode episode episode episode episode episode

0 12

24

36

48

60

72

84

96

108 120 132 144

steps (5 min) Fig. 15.6 Internal temperature evolution during the training phase

of experiments show comparable trends, while the first and second sets, as already mentioned, provide energy consumption equal to 32 kWh and 30 kWh, respectively. Figure 15.6 represents the internal temperature trend obtained during the learning process related to the first set of experiments. The temperature is plotted against the steps of a single episode, and different plots are related to different episodes. In the first episodes, the trends are still unstable: this confirms that the controller is in an exploration phase and performs actions for which the reward values are not yet known. The temperature ranges between 20◦ C and 25◦ C, values that are

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

343

FCU levels

30 26

3

22

2

18

1

14

0

10 0

12

24

36

48

60

72

84

indoor temperature [°C]

34 user intervention controller intervention indoor temperature

96 108 120 132 144

steps (5min) Fig. 15.7 User interventions on the fan coil unit in the 2000th episode

FCU levels

30 26

3

22

2

18

1

14

0

10 0

12

24

36

48

60

72

84

indoor temperature [°C]

34 user intervention controller intervention indoor temperature

96 108 120 132 144

steps (5min) Fig. 15.8 User interventions on the fan coil unit in the 16,000th episode

typical of the initial transient phase and too high when compared to the comfort temperature. Starting from the 8000th episode, a steady-state condition is reached: the temperature is stabilized around 20◦ C, with a few exceptions around the 100th step. The following episodes show stabilized trends: it can be deduced that in the middle of the learning process, i.e., starting from the 16,000th episode, the controller has completed its learning process. Figures 15.7 and 15.8 illustrate the actions performed by the user and the controller on the fan coil unit in order to control the internal temperature. Both

344

L. Scarcello and C. Mastroianni

figures refer to the set of experiments in which the weights αC and αE of the reward function are equal to [1.00,0.00]; in particular, the first figure shows the results of the 2000th episode, while the second figure shows the results of the 16,000th episode. It is observed that, during the transient phase (episode 2000th), the controller is not yet trained. Indeed, it performs actions on the fan coil that cause an excessive lowering of the indoor temperature, and, as a consequence, the user is forced to intervene by increasing the level of power. This does not happen in the steady phase (Fig. 15.8), in which the controller is autonomous and manages to regulate the power level of the fan coil: in this phase, the controller ensures an internal temperature that is very close to the comfort temperature desired by the user. All the results reported in this section have confirmed that, by acting on the values of the weights of the reward function, αC and αE , it is possible to give more or less importance to one of the two objectives: maximize user comfort or minimize energy consumption. It is worth noting that in the case study considered here, when setting αC to 0.75 and αE to 0.25, the cyber-controller shows a balanced behavior, i.e., the two objectives are balanced and intermediate values of temperature and consumed energy are reached, equal to about 19.6◦ C and 30 kWh.

15.5 Conclusions This chapter explores a feasible cognitive application and in particular a deep reinforcement learning algorithm, for managing user comfort and energy consumption in a smart building. A novel approach has been proposed, which aims to maximize thermal comfort by controlling the HVAC system, whose power can be set to one of four possible operating levels. The approach aims to minimize the amount of energy consumed by HVAC and optimize thermal comfort conditions. To pursue both the objectives, the DRL controller is trained through an environmental reward that includes two components, the former related to the standard deviation, measured along one day, of the difference between the comfort temperature Tc and the measured indoor temperature Ti , and the latter related to the amount of consumed energy. The two components can be balanced by the user through the use of two reward weights, αC and αE . Several sets of experiments were performed for a case study modeled on the physical and thermal characteristics of a real office room. The results showed that, for each set of experiments, the DRL controller learns to control the HVAC system autonomously and to achieve the thermal conditions that minimize the perceived thermal discomfort and/or the energy consumption, depending on the importance given to each of the two objectives. Future work aims to (i) extend the experimental scenario by considering other aspects of human comfort, e.g., visual comfort, air-quality comfort, or acoustic comfort, and (ii) improve the approach to take into account multiple interacting environments (e.g., several rooms sharing the same energy source).

15 Cognitive Systems for Energy Efficiency and Thermal Comfort in Smart Buildings

345

References 1. Alanne, K., Sierla, S.: An overview of machine learning applications for smart buildings. Sustain. Cities Soc. 76, 103445 (2022) 2. Avendano, D.N., Ruyssinck, J., Vandekerckhove, S., Van Hoecke, S., Deschrijver, D.: Datadriven optimization of energy efficiency and comfort in an apartment. In: 2018 International Conference on Intelligent Systems (IS), pp. 174–182. IEEE (2018) 3. Cicirelli, F., Guerrieri, A., Mastroianni, C., Spezzano, G., Vinci, A.: The Internet of Things for Smart Urban Ecosystems. Internet of Things. Springer International Publishing (2018) 4. Cicirelli, F., Guerrieri, A., Mastroianni, C., Spezzano, G., Vinci, A.: Thermal comfort management leveraging deep reinforcement learning and human-in-the-loop. In: 2020 IEEE International Conference on Human-Machine Systems (ICHMS), pp. 1–6 (2020). https://doi. org/10.1109/ICHMS49158.2020.9209555 5. Ding, X., Du, W., Cerpa, A.: Octopus: Deep reinforcement learning for holistic smart building control. In: Proceedings of the 6th ACM International Conference on Systems for EnergyEfficient Buildings, Cities, and Transportation, pp. 326–335 (2019) 6. Fuller, A., Fan, Z., Day, C., Barlow, C.: Digital twin: Enabling technologies, challenges and open research. IEEE Access 8, 108952–108971 (2020) 7. Gao, G., Li, J., Wen, Y.: Energy-efficient thermal comfort control in smart buildings via deep reinforcement learning. Preprint (2019). arXiv:1901.04693 8. Gupta, A., Badr, Y., Negahban, A., Qiu, R.G.: Energy-efficient heating control for smart buildings with deep reinforcement learning. J. Build. Eng. 34, 101739 (2021) 9. Jia, R., Jin, M., Sun, K., Hong, T., Spanos, C.: Advanced building control via deep reinforcement learning. Energy Procedia 158, 6158–6163 (2019) 10. Lissa, P., Deane, C., Schukat, M., Seri, F., Keane, M., Barrett, E.: Deep reinforcement learning for home energy management system control. Energy AI 3, 100043 (2021) 11. Martínez-Molina, A., Tort-Ausina, I., Cho, S., Vivancos, J.L.: Energy efficiency and thermal comfort in historic buildings: A review. Renew. Sustain. Energy Rev. 61, 70–85 (2016) 12. Mason, K., Grijalva, S.: A review of reinforcement learning for autonomous building energy management. Preprint (2019). arXiv:1903.05196 13. Panchalingam, R., Chan, K.C.: A state-of-the-art review on artificial intelligence for smart buildings. Intell. Build. Int. 13(4), 203–226 (2021) 14. Qi, Q., Tao, F., Hu, T., Anwer, N., Liu, A., Wei, Y., Wang, L., Nee, A.: Enabling technologies and tools for digital twin. J. Manuf. Syst. 58, 3–21 (2021) 15. Sewak, M.: Deep q network (dqn), double dqn, and dueling dqn. In: Deep Reinforcement Learning, pp. 95–108. Springer (2019) 16. Shen, Z., Yang, K., Du, W., Zhao, X., Zou, J.: Deepapp: a deep reinforcement learning framework for mobile application usage prediction. In: Proceedings of the 17th Conference on Embedded Networked Sensor Systems, pp. 153–165 (2019) 17. Sutton, R.S., Barto, A.G.: Reinforcement Learning: An Introduction. MIT Press, Cambridge, MA, USA (2011) 18. Wei, T., Wang, Y., Zhu, Q.: Deep reinforcement learning for building hvac control. In: Proceedings of the 54th Annual Design Automation Conference 2017, p. 22. ACM (2017) 19. Yu, L., Xie, W., Xie, D., Zou, Y., Zhang, D., Sun, Z., Zhang, L., Zhang, Y., Jiang, T.: Deep reinforcement learning for smart home energy management. IEEE Internet Things J. (2019) 20. Yu, L., Qin, S., Zhang, M., Shen, C., Jiang, T., Guan, X.: A review of deep reinforcement learning for smart building energy management. IEEE Internet Things J. (2021)

Index

A Aggregate programming (AP), vii, 147–168 Audio, vii, 15, 25, 41, 122, 127–145

C Case studies, vi–ix, 2, 9, 10, 16–20, 103–125, 128, 141–144, 156, 161–164, 176, 221–241, 247, 250, 253–259, 263–283, 287, 296–302, 306, 307, 313–326, 330, 344 Cloud computing for smart buildings, 31–32 COGITO application, 3 COGITO platform, v–viii, 1–21, 133, 198, 200, 202, 273, 274, 283, 306–308, 310–314, 317–320, 326 Cognitive buildings (CBs), v–ix, 4, 23–50, 53, 75–102, 128, 140, 141, 145, 147–149, 154, 168, 222, 223, 227, 229, 245–260, 285–302, 305–326 Cognitive controllers, 331, 332 Cognitive environments (CEs), v–viii, 1–21, 53, 69, 103–125, 127–145, 176, 193, 307 Cognitive objects, 84, 175 Cognitive systems, ix, 2, 76, 77, 92–95, 149, 266, 270, 329–344 Comfort, 1, 43, 75, 147, 173, 197, 222, 251, 263, 286, 305, 329 COVID-19, viii, 15, 87, 88, 209, 221–241, 263, 266, 267, 270, 283 Cybersecurity, 125

D Damage detection, 246, 248, 259 Deep reinforcement learning (DRL), ix, 11, 70, 330–339, 344 Demand-side management (DSM), 305, 306, 308 E Edge caching, vi, 53–71 Edge computing, v, vi, 2, 18, 23–50, 222, 306–308 Edge intelligence, viii, 221–241 Energy efficiency, ix, 12, 25, 34, 35, 40, 43, 58, 65, 80–82, 84, 93, 168, 174, 252, 310, 329–344 Energy management systems, 308, 331 Energy savings, vii, ix, 4, 10, 30, 60, 81, 83, 91, 103, 108, 147, 152–154, 168, 173–194, 197, 198, 266, 286, 292, 294, 297, 298, 300, 302, 305, 331, 332 H Hub & spoke, 104, 116–121 Human-in-the-loop, v, 332, 337 I Indoor environments, 10–16, 86, 147, 149, 152, 153, 167, 168, 176, 263, 264, 266, 274, 277–283, 312, 329, 332–339 Information centric networking (ICN), 55

© The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 F. Cicirelli et al. (eds.), IoT Edge Solutions for Cognitive Buildings, Internet of Things, https://doi.org/10.1007/978-3-031-15160-6

347

348 Intelligent load scheduling, ix, 305–326 Internet of Things (IoT), v–viii, 2, 5, 23–50, 53–71, 75, 76, 78, 88, 90, 92, 98, 103–125, 134, 147–149, 151, 154–158, 160, 168, 169, 173–194, 198, 202, 208, 209, 217, 222–226, 229, 241, 251, 263–283, 285, 305–308, 329, 330 IoT-enabled smart buildings, 40–50

L Long-short memory neural networks, vii–viii

M Machine learning (ML), vii, 2, 4, 11, 24, 42–43, 46–48, 50, 55, 60, 70, 75, 125, 129, 135, 137, 140, 141, 143, 144, 147, 175, 198, 199, 204, 217, 222, 229, 249, 250, 252, 285, 286, 290, 305, 329, 331, 332 MAN, 104, 106–108, 111, 119–121, 125 Message Queue Telemetry Transport (MQTT), 10, 45, 142, 155, 226, 228, 233, 234, 237, 239, 311, 312, 317–319 Monitoring techniques, 228, 248–251, 259

N Named data networking (NDN), vi, 54, 55, 59, 61–66, 68–70 Need analysis, vi, 75–102

O Occupancy prediction, vii, viii, 197–218

R Reactive systems, 293, 302 Real-time location systems (RTLS), vii, 148, 149, 160–164, 228 Recognition, 17, 43, 107, 133, 134, 137, 205, 229, 249, 265, 268 Regulation, v, vi, viii, 15, 75–102, 149, 176, 209, 264, 267, 269, 270, 278, 289, 337

Index Reinforcement learning (RL), viii, ix, 11, 249, 285–302, 306–310, 329–331, 338

S Security, v, vii, 24, 25, 29–32, 34–35, 39–41, 43, 45–46, 57, 76, 81, 87, 91, 93, 95–97, 101, 118, 120, 125, 127–145, 197, 217, 251, 252, 329 Smart building design, 43, 50 Smart building design framework, 43–46 Smart buildings, v, vii, ix, 23–25, 27, 30–32, 34, 35, 37, 40–50, 54, 57, 69, 92, 94, 147, 285, 306, 329–344 Smart environments, vi, 20, 53–71, 78, 263–283, 307 Smart meeting room (SMR), 14–16, 18, 264–280, 283 Smart video conference system, 104, 122 Software-defined networking (SDN), vi, 25, 54, 55 Solar gain, 173, 174, 179, 184–186, 189–191, 193 Structural health monitoring (SHM), viii, 245–260

U User comfort, 154, 286, 331, 333, 340, 344 User preferences, v, vii, ix, 53, 69, 70, 147–168, 175, 306, 309, 326

V Venetian blinds, vii, 176–183, 186, 188–191, 193, 296 Visual comfort, vii, ix, 173–194, 286, 289–297, 301, 302, 335, 344 Visual comfort control, 289 VPN, 31, 104, 111, 113, 116–121

W Well-being, 12, 76–91, 174, 247, 251, 267, 290, 302, 305 Wireless sensor networks (WSNs), 55, 104–109, 125