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 SeriesEditors GiancarloFortino,Rende(CS),Italy AntonioLiotta,EdinburghNapierUniversity,SchoolofComputing,Edinburgh,UK The series Internet of Things - Technologies, Communications and Computing publishesnewdevelopmentsandadvancesinthevariousareasofthedifferentfacets oftheInternetofThings.Theintentistocovertechnology(smartdevices,wireless sensors, systems), communications (networks and protocols) and computing (the- ory, middleware and applications) of the Internet of Things, as embedded in the fieldsofengineering,computerscience,lifesciences,aswellasthemethodologies 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,artificialintelligence,selforganizingsystems,multi-sensordatafusion, smartobjects,andhybridintelligentsystems. Indexing:InternetofThingsiscoveredbyScopusandEi-Compendex** Franco Cicirelli • Antonio Guerrieri • Andrea Vinci • Giandomenico Spezzano Editors IoT Edge Solutions for Cognitive Buildings Editors FrancoCicirelli AntonioGuerrieri ICAR-CNR ICAR-CNR Rende,Cosenza,Italy Rende,Cosenza,Italy AndreaVinci GiandomenicoSpezzano ICAR-CNR ICAR-CNR Rende,Cosenza,Italy Rende,Cosenza,Italy ISSN2199-1073 ISSN2199-1081 (electronic) InternetofThings ISBN978-3-031-15159-0 ISBN978-3-031-15160-6 (eBook) https://doi.org/10.1007/978-3-031-15160-6 ©TheEditor(s)(ifapplicable)andTheAuthor(s),underexclusivelicensetoSpringerNatureSwitzerland AG2023 Thisworkissubjecttocopyright.AllrightsaresolelyandexclusivelylicensedbythePublisher,whether thewholeorpartofthematerialisconcerned,specificallytherightsoftranslation,reprinting,reuse ofillustrations,recitation,broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,and transmissionorinformationstorageandretrieval,electronicadaptation,computersoftware,orbysimilar ordissimilarmethodologynowknownorhereafterdeveloped. Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant protectivelawsandregulationsandthereforefreeforgeneraluse. Thepublisher,theauthors,andtheeditorsaresafetoassumethattheadviceandinformationinthisbook arebelievedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsor theeditorsgiveawarranty,expressedorimplied,withrespecttothematerialcontainedhereinorforany errorsoromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictional claimsinpublishedmapsandinstitutionalaffiliations. ThisSpringerimprintispublishedbytheregisteredcompanySpringerNatureSwitzerlandAG Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland Preface TheevolutionoftheInternetofThings(IoT)technologiesandArtificialIntelligence techniques has introduced a new paradigm shift from smart buildings to cognitive buildings(CBs).CBsareabletoexploitdecentralizedarchitectureswhereanalytical processingandcognitivebehaviorscanbeoperatedbothattheedgeandinthecloud so as to exploit the advantages of both of them. Besides the well-known benefits providedbythecloud,edgecomputingenablesreal-timeintelligenceattheedgeof the network and greater agility of control while, at the same time, avoiding heavy communication traffic. By embedding intelligence on edge devices, the cognitive buildingscanbemoreresponsivetouserpreferencesandneeds. CBsareenvironmentsaugmentedwithsensorsandactuatorsthatexploittheIoT paradigmandcognitiveabilitiesaltogether.Theyareabletolearn,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 resourcesandspacesefficiently. CBscanmaketheiroccupantsmorecomfortable,productive,andhealthy.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 customizationsthatsuiteachoccupant’sneeds. 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 bookmainlyfocusesontopicssuchas:(i)Self-learningandadaptiveenvironments; (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,andnormativeregulations.Abriefintroductiontothechapters isprovidedbelow. The Chapter “COGITO: A Platform for Developing Cognitive Environments,” by Marica Amadeo, Franco Cicirelli, Antonio Guerrieri, Giuseppe Ruggeri, Gian- domenicoSpezzano,andAndreaVinci,introducestheconceptofCBsandoutlines v vi Preface thechallengesrelatedtothedevelopmentofsuchsystems.Afterthis,theCOGITO platformisintroducedandpresentedasanenablingtechnologyforCBdesignand implementation. COGITO is an agent-based IoT platform tailored to the develop- ment of CBs in a heterogeneous continuum computing environment comprising cloud,fog,andedgeresources.Thepracticaluseoftheplatformisdemonstratedin thechapterthroughthediscussionofsomeusecasesdevelopedattheICAR-CNR headquartersatRende(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 InternetofThings,cloudcomputing,fogcomputing,andedgecomputing.So,inthis chapter,thesekeyconceptsarediscussed.Inaddition,amodulardesignframework for CBs is also proposed in the manuscript, and in accordance with the proposed framework,somesamplescenariosarefinallypresented. The Chapter “Edge Caching in IoT Smart Environments: Benefits, Challenges and Research Perspectives Towards 6G,” by Marica Amadeo, Claudia Campolo, GiuseppeRuggeri,andAntonellaMolinaro,overviewstheliteraturerelatedtoedge cachingforIoTCBsandidentifiesthemostpromisingdecisionpoliciesforcaching together with its key benefits and open challenges. In particular, conventional cachingtechniquesarefirstscanned,beforedelvingintomoredisruptivein-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 policieswithSoftwareDefinedNetworking(SDN),aswellasontheopportunities toleverageedgecachingpoweredbyAItechniquesasaprominentsixth-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,”byGiovannaIacovone,GabriellaCerchiara,LuciaCappiello,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 regulatoryframeworkonsustainablelivingandtheefficientuseofenergyinliving spaces.Thechapterfocusesontherelationshipbetweenpeople,livingspaces,well- being,andtechnology.Allofthisallowstoidentifyandanalyzecustomers’needs, translatingthemintoasetofvariablesandparametersessentialtotheex-antedesign and ex-post evaluation of a CB. Finally, the chapter introduces a supranational (international) and national normative analysis of innovative technological models fortheimprovementofcomfort. The Chapter “Real Case Studies Towards IoT-Based Cognitive Environments,” byAntonioFrancescoGentile,focusesonseveralapproachesusedinsomeItalian researchprojectswiththeaimofensuringeffectivecommunicationsinthecontext ofCognitiveIoTEnvironments,ingeneral,andCBsinparticular.Theapproaches above have been applied in some real case studies. These case studies overcome thechallengesrelatedtotheheterogeneityofcommunicationprotocols,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 IoTinfrastructuresrelatedtosmartstreets,smartbuildings,andsmartoffices. TheChapter“AudioAnalysisforEnhancingSecurityinCognitiveEnvironments ThroughAIontheEdge,”byMarcoAntonioMauro,aimstoshowasecuritysystem forCBsbasedonmicrophones.Inparticular,thechapteranalyzes theinformation 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 residentialapartmentandafreeaccessroom. 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 allowsgatheringdatatoperformanalyticsforpromptfaultdetectionandfine-tuning oftheenvironmentalconditionsand,possibly,operatingenergymanagement.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 connectiontoacentralserver. TheChapter“IoTControlBasedSolarShadings:AdvancedOperatingStrategy toOptimizeEnergySavingsandVisualComfort,”byFrancescoNicoletti,Cristina Carpino,andNataleArcuri,involvesthedevelopmentofanadvancedsolarshading 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.Thestudyintegratestheuseofanartificiallightmanagementsystem,which is necessary to reach the setpoint illuminance. The results show that the control systemcanhalvecoolingenergydemandanditcanreducetheelectricityusedfor artificiallighting. The Chapter “Room Occupancy Prediction Leveraging LSTM: An Approach for Cognitive and Self-Adapting Buildings,” by Simone Colace, Sara Laurita, GiandomenicoSpezzano,andAndreaVinci,aimstodevelopadata-drivenmodelfor occupancypredictionusingmachinelearningtechniquesbasedonacombinationof temperature,humidity,CO2concentration,light,andmotionsensors.Theapproach is designed and realized in a real scenario by leveraging the COGITO platform. TheexperimentalresultsshowthattheproposedLongShort-TermMemoryneural 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 informationofspacesbothinareal-timeandinashort-termway. TheChapter“EdgeIntelligenceAgainstCOVID-19:ASmartUniversityCampus Case Study,” by Claudio Savaglio, Giandomenico Spezzano, Giancarlo Fortino, Mario Alejandro Paguay Alvarado, Fabio Capparelli, Gianmarco Marcello, Luigi Rachiele,FrancescoRaco,andSamanthaGenovevaSanchezBasantes,”presentsan example of a CB environment denominated Smart Cafeteria. It is a highly sensor- and-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 thatcold,dry,unventilatedaircontributestovirusestransmission,especiallyinthe winter season. The Smart Cafeteria has been designed within the campus of the UniversityofCalabria,inItaly. TheChapter“StructuralHealthMonitoringinCognitiveBuildings,”byRaffaele 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 techniquesallowsforidentifyingdamagesandanomaliesinCBstructures’behavior and implementing early warning systems. In this case, the use of accelerometric sensorsiskeyforidentifyingtherepresentativeparametersofthebuildingstructural behavior. All of this helps determine precious information comprehending, for example,damagelocation,damageassessment,anddamageprediction.Thechapter also presents a case study to highlight how the proposed approach applies to real cases. The Chapter “Development of Indoor Smart Environments Leveraging the InternetofThingsandArtificialIntelligence:ACaseStudy,”byMicheleDeBuono, NicolaGullo,GiandomenicoSpezzano,AndreaVennera,andAndreaVinci,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 comfortableforusersandeffectiveinmanagingeventssuchasmeetingsorlectures. Preface ix TheChapter“Human-CenteredReinforcementLearningforLightingandBlind 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 reinforcementlearning(RL)algorithmtoadapttheboundariesofthecomfortzone in the presence of a group of occupants. Compared with more traditional control techniques,theproposalispersonalizedandhuman-centricsinceusers’perceptions of the surrounding environments are explicitly exploited in the RL feedback loop. Acasestudyofanofficeroomanditsperformanceisalsopresented. TheChapter“IntelligentLoadSchedulinginCognitiveBuildings:AUseCase,” 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 dailyused.Suchequipmentsignificantlyimprovesthequalityoflifeofpeople,but theiruse,whennotwellregulated,canbringaneedlessincrementintheelectricity 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,implementedinthecontextoftheCOGITOproject,isdevotedtocognitively scheduling electric loads in houses according to user preferences, self-produced energy,andvariableenergycosts. 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 developacyber-controllerabletominimizeboththeperceivedthermaldiscomfort 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,inferredbythefrequencywithwhichauserinteractswithanHVACsystem, helps the DRL controller to learn users’ requirements and readily adapt to them. Simulationexperimentsareperformedtoassesstheimpactthatthetwocomponents of the reward have on the behavior of the DRL controller and on the learning process. Rende,Cosenza,Italy FrancoCicirelli AntonioGuerrieri AndreaVinci GiandomenicoSpezzano