scieee AI-readable full text Open interactive document viewer

Smart human mobility in smart cities

Rosa, Luís Miguel Ferreira

Abstract

In our modern world, technology is present everywhere in our lives, from our community to our workplaces, and even our homes. In fact, our decisions are increasingly influenced by technological gadgets. Governments also see them as valuable allies in improving the quality of life in cities, providing solutions for the management and sustainability of human mobility. As urban populations continue to grow, smart cities must find smarter ways to utilize existing resources. Smart cities are generating real-time aggregate data, and the Internet of Things has contributed to a strong connection between thousands of devices. This integration allows cities to connect disparate utility, infrastructure, and public service grids. To analyse the vast amounts of data generated, Artificial Intelligence empowers decision-makers to understand their surroundings to help them make humanized decisions, and take efficient actions in order to maximize the chances of successfully accomplishing a desired task or goal. Although current solutions offer tools to tackle mobility challenges and address urban mobility problems (traffic congestion, transport systems, parking, and environmental issues), there is a lack of a comprehensive platform that adapts the service to the diverse mobility needs of citizens. Others (public and private sectors) are investing in infrastructures—physical and digital—to support innovative mobility solutions but, despite being filled with many functionalities, many fall short in effectively leveraging the principles of big data and machine learning to improve human mobility. To address this challenge, the main objective of this doctoral work is to propose an architecture that integrates Internet of Things, Artificial Intelligence, Cloud technology, and smart city planning to optimize people’s mobility. The preliminary results of this architecture, named WalkingStreet, offer a set of personalized recommendations using intelligent interpretability tools for individual’s daily lives, and potential risks to individuals or to the community. Therefore, this document serves as a guide for the area of human mobility in smart cities.

Full text

Universidade do Minho Escola de Engenharia Luís Miguel Ferreira Rosa Smart Human Mobility in Smart Cities October, 2023 UMinho | 2023 Luís Miguel Ferreira Rosa Smart Human Mobility in Smart Cities Universidade do Minho Escola de Engenharia Luís Miguel Ferreira Rosa Smart Human Mobility in Smart Cities Doctoral Thesis Doctorate in Informatics Work supervised by Cesar Analide Rodrigues Fábio André Souto da Silva October, 2023 ii COPYRIGHT AND TERMS OF USE OF THIS WORK BY A THIRD PARTY This is academic work that can be used by third parties as long as internationally accepted rules and good practices regarding copyright and related rights are respected. Accordingly, this work may be used under the license provided below. If the user needs permission to make use of the work under conditions not provided for in the indicated licensing, they should contact the author through the RepositóriUM of Universidade do Minho. License granted to the users of this work Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en Acknowledgements Writing this acknowledgments section feels like one of the toughest parts of my entire PhD journey – a paradox, right? The journey so far has not been easy at all. It might sound weird, but these four years have been a wild mix of triumphs and setbacks, highs and lows. I would like to express my profound gratitude to my supervisor, Professor Cesar Analide, and my co-supervisor, Professor Fábio Silva, for their unwavering support, guidance, and invaluable teachings, which laid the crucial foundations for the successful completion of my PhD. Equally significant are my heartfelt thanks to the members of the ’ISLAB family’ at the ALGORITMI Center, particularly Professor Paulo Novais, Professor Dalila Durães, Pedro, António, Bruno, Dalila, Ricardo, João, Benjamin, Francisco, and many others who have been an integral part of the laboratory. Their mentorship and readiness to assist have been invaluable throughout this journey. To my family. They’ve been my lifeline during those late-night study sessions after long workdays. I am deeply grateful to my father, Francisco, who encouraged me to embark on this adventure, even when I was initially scared witless. My mother, Marinha, was always there with cups of coffee and sandwiches so I wouldn’t pass out in front of the computer. My brother, Francisco, proudly celebrating his brother’s achievement from afar, was always ready to offer his assistance whenever needed. And to my sister-in- law Patrícia, her sister Claúdia, and her parents Mrs. Fátima and Mr. Hélder, as well as, our new family member and my godson, ’Miguelito’. I extend my gratitude to my godparents, Uncle Alfredo and Aunt Adília, and my cousins, Ana and Anabela, for their unwavering support and kind words. Special thanks to Aunt ’São’ and my cousin Carla, with whom I’ve shared countless Christmases, and now, look, the once rebellious kid has got a PhD. Time really does heal, doesn’t it? To those who may no longer be with us but are undoubtedly watching from above. I pay tribute to my paternal and maternal grandparents, whom I have never had the privilege to meet (except for my maternal grandfather), but who, I am confident, are observing their grandchild forging his own path with fearlessness and optimism. I remember Mr. Sérvio, my Aunt São’s father-in-law, who was the life of our childhood Christmas dinners for many years. My Uncle Antonio, Mr. Sérvio’s son and Aunt São’s husband, may have been sparce with words but had a unique sense of humour. We’ve lost some great people along the way. iii To my friends – ’Marquito’, ’Italiano’, ’Huguinho’, ’Limiano’, Luísa, Miguel, Vítor, Pedro, Paula, ’Bifes’, ’Chiquinho’, ’Fred’, Gabriel, and Catarina – your presence has been a cornerstone of support throughout this journey. You showed me that life isn’t all work and study; there’s time for fun and hanging out. Having a small, tight-knit crew of friends is the real deal. I would like to extend my sincere appreciation to Johnson Controls Company. My special thanks go to Isabel Casaca, Nuno Caleira, and João Sousa (my ‘boss’ at the time), who, during my tenure, were instrumental in creating an environment within the company that allowed me to embark on this academic endeavour without imposing constraints or barriers. I am grateful to Tiago Lagarto, who, despite becoming the ’Dono Disto Tudo’ [Owner of Everything] within the company, always had some wise advice. To my Project Manager, Hugo Ribeiro, I am thankful for his patience, words of encouragement, and genuine concern. Lastly, to Xpand IT company. Ricardo Pires (my current Project Manager) as well as to all the colleagues, directors and staff of the company, many thanks for the support! iv Abstract Smart Human Mobility in Smart Cities In our modern world, technology is present everywhere in our lives, from our community to our workplaces, and even our homes. In fact, our decisions are increasingly influenced by technological gadgets. Governments also see them as valuable allies in improving the quality of life in cities, providing solutions for the management and sustainability of human mobility. As urban populations continue to grow, smart cities must find smarter ways to utilize existing resources. Smart cities are generating real-time aggregate data, and the Internet of Things has contributed to a strong connection between thousands of devices. This integration allows cities to connect disparate utility, infrastructure, and public service grids. To analyse the vast amounts of data generated, Artificial Intelligence empowers decision-makers to understand their surroundings to help them make humanized decisions, and take efficient actions in order to maximize the chances of successfully accomplishing a desired task or goal. Although current solutions offer tools to tackle mobility challenges and address urban mobility problems (traffic congestion, transport systems, parking, and environmental issues), there is a lack of a comprehensive platform that adapts the service to the diverse mobility needs of citizens. Others (public and private sectors) are investing in infrastructures—physical and digital—to support innovative mobility solutions but, despite being filled with many functionalities, many fall short in effectively leveraging the principles of big data and machine learning to improve human mobility. To address this challenge, the main objective of this doctoral work is to propose an architecture that integrates Internet of Things, Artificial Intelligence, Cloud technology, and smart city planning to optimize people’s mobility. The preliminary results of this architecture, named WalkingStreet, offer a set of personalized recommendations using intelligent interpretability tools for individual’s daily lives, and potential risks to individuals or to the community. Therefore, this document serves as a guide for the area of human mobility in smart cities. Keywords: Artificial Intelligence, Crowdsensing, Human Mobility, Smart Cities vi Resumo Mobilidade Humana Inteligente nas Cidades Inteligentes Atualmente, a tecnologia está presente em toda parte, na nossa comunidade, no nosso local de trabalho ou mesmo nas nossas casas. Na verdade, as nossas decisões são cada vez mais suportadas pela tecnologia. Por outro lado, as autoridades governamentais vêem-na como aliada para melhorar a qualidade de vida dos seus cidadãos nas cidades. Esta realidade, juntamente com o aumento da população na área urbana, significa que as cidades precisam de se tornar mais inteligentes na gestão dos seus recursos. As cidades inteligentes geram dados em tempo real e a Internet das Coisas contribui para uma forte conexão entre milhares dispositivos. Esta fusão está a ajudar as cidades a conectarem diferentes infraestruturas e serviços públicos. Para analisar os dados gerados, a Inteligência Artificial capacita os agentes a entender os ambientes ao redor para ajudá-los a aplicar decisões humanizadas e, em seguida, ações eficazes para maximizar as hipóteses de realizar com êxito a tarefa ou objetivo. Embora as soluções atuais ofereçam ferramentas para enfrentar os desafios da mobilidade e resolver problemas de mobilidade urbana (ou seja, sistemas de transporte, estacionamento ou questões ambientais), não possuem uma plataforma que adapte o serviço à mobilidade do individuo. Outros, seja do setor público ou privado, constroem infraestruturasfísicas e digitais -para suportar soluções inovadoras, mas, apesar de estarem repletos de funcionalidades, apresentam uma visão geral da aplicabilidade dos princípios de big data eaprendizagem automática para melhorar a mobilidade humana. Como meio para resolver estes desafios, o principal objetivo deste trabalho de doutoramento é propor uma arquitetura que combine Internet das Coisas, tecnologia Cloud, Inteligência Artificial e planeamento de cidade inteligentes para ajudar a mobilidade das pessoas. Os resultados preliminares desta arquitetura, chamada WalkingStreet, fornecem um conjunto de recomendações personalizadas usando ferramentas inteligentes de interpretabilidade sobre a mobilidade do indivíduo ou comunidade. Portanto, este documento apresenta-se como um guia para a área de mobilidade humana nas cidades inteligentes. Palavras-chave: Cidades Inteligentes, Inteligência Artificial, Mobilidade Humana, Sensorização vii List of Tables 1 Dimensions of a Smart City and related aspects of urban life (adapted from [125]). . . . . 24 2 A table of the errors of prediction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 3 Data Mining tools comparative analysis. . . . . . . . . . . . . . . . . . . . . . . . . . 51 4 LinkNYC Kiosks locations dataset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 5 The human mobility modeling results (best values in bold). . . . . . . . . . . . . . . . . 96 xiv Listings 1 Request and response for the creation of a new device. . . . . . . . . . . . . . . . 114 2 Registering device location. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 3 Parameters and response for bicycle counts. . . . . . . . . . . . . . . . . . . . . . 116 4 Syncronization API service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 5 Configuration file of local server. . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 6 Syncronization AI service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7 Syncronization XAI service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 8 Message sender service of synchronization Cloud micro-service. . . . . . . . . . . . 121 9 Output channel (publisher) of synchronization Cloud micro-service. . . . . . . . . . . 121 10 YAML file of synchronization Cloud micro-service. . . . . . . . . . . . . . . . . . . 122 11 YAML file of synchronization Cloud SQL micro-service. . . . . . . . . . . . . . . . . 123 12 AIMessage receiver of synchronization Cloud SQL micro-service. . . . . . . . . . . . 125 13 AIMessageController class of Back-End micro-service. . . . . . . . . . . . . . . . . 126 14 WebSecurityConfigure class of Back-End micro-service. . . . . . . . . . . . . . . . 127 15 YAML file of Front-End micro-service on Cloud Kubernetes. . . . . . . . . . . . . . . 128 16 Extract human-readable rules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 17 Rules of Decision Tree. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 18 Select 20𝑡ℎ instance................................. 145 19 List the feature values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146 xv Acronyms AI Artificial Intelligence AMQP Advanced Message Queuing Protocol API Application Programming Interface ARIMA Autoregressive Integrated Moving Average ARIMAX Autoregressive Integrated Moving Average with Explanatory Variable ASCII American Standard Code for Information Interchange BaaS Backend-as-a-Service BLSTM Bidirectional LSTM CART Classification and Regression Trees CCTV Closed-circuit Television CDRs Call Data Records CNN Convolutional Neural Network CNN-LSTM Convolutional Neural Network-Long Short Term memory CoAP Constrained Application Protocol CSV Comma-Separated Values DARPA Defense Advanced Research Projects Agency DL Deep Learning DM Data Mining DNN Deep Neural Network xvi ACRONYMS DT Decision Tree EC European Commission ESP Extended Service Providers EU European Union FaaS Functions as a Service GCP Google Cloud Platform GKE Google Kubernetes Engine GNSS Global Navigation Satellite System GPS Global Positioning System gRPC Remote Procedure Call GUI Graphical User Interface HCI Human Computer Interaction HTTP Hypertext Transfer Protocol ICT Information and Communication Technology IoT Internet of Things ISLab Synthetic Intelligence group IT Information Technology JSON JavaScript Object Notation KDD Knowledge Discovery in Databases LIME Local Interpretable Model-Agnostic Explanation LSTM Long Short-Term Memory MaaS Mobility as a Service MAE Mean Absolute Error ML Machine Learning xvii ACRONYMS MQTT Message Queuing Telemetry Transport MSE Mean Squared Error MTA Metropolitan Transportation Authority MVC Model-View-Controller MVT Model-View-Template NN Neural Network NYC New York City NYPD New York Police Department O-D Origin-Destination ODBC Open Database Connectivity OLE DB Object Linking and Embedding Database PhD Doctor of Philosophy PoC Proof of Concept POI Points of Interest POJO Plain Old Java Object Pub Publish REST Representational State Transfer RMSE Root Mean Square Error S2 aaS Sensing as a Service SARIMA Seasonal Autoregressive Integrated Moving Average SARIMAX Seasonal Autoregressive Integrated Moving Average with Exogenous factors SC Smart City SHAP Shapley Additive Explanations SLSTM Stacked LSTM xviii ACRONYMS SM Statistical Method SODA Socrata Open Data Application Programming Interface SoQL Socrata Query Language SP Service Provider Sub Subscribe TCP Transmission Control Protocol UI User Interface URL Uniform Resource Locator XAI Explainable Artificial Intelligence XML Extensible Markup Language YAML Yet Another Markup Language xix C h a p t e r 1 Introduction The development of technology, specifically Artificial Intelligence (AI), has allowed us to design solutions for the most diverse areas. Since its appearance, its capabilities have been molded to the most different needs of humanity. An example of this is its applicability by governmental and non-governmental authorities in support of their decisions. On the other hand, human mobility is increasingly both a challenge and an opportunity for cities. This type of mobility will be a central topic in the next chapters. In this chapter, we begin to highlight some examples of how the potential of AI, when combined with well-implemented Data Mining (DM) policies within Big Data infrastructures, and transparently supported by Explainable Artificial Intelligence (XAI) models, has long served as an ally in improving the lives of citizens in cities. Investment in these tools and adequate infrastructure make Smart City (SC). In particular, we will present the percentage of internet users in the world who access the internet on device handles, along with a description of the gradual attractiveness of cities. The easy access to this type of infrastructure in areas with a higher concentration of people is a crucial aspect that will be explored in this work. It is, therefore, important to understand these phenomena to demonstrate that cities are no longer just places that concentrate people, but have also transformed into rich spaces that produce the most vital raw material for this work: data. In this chapter, we utilize various definitions and characteristics of human mobility as presented by researchers and authors, who offer different perspectives on the subject. Some of them delve into the interactions between these properties that contribute to accelerating the digital transformation of cities. As cities progress towards digitization, the elements constituting them take on new roles, and human mobility is a significant phenomenon in this context. Finally, we carefully select the most appropriate method and research strategy for studying on human mobility in a technological environment such as SC. The enhance the quality of the work, we include a 1 CHAPTER 1. INTRODUCTION comprehensive plan of activities and outline the main objectives to be developed and achieved over the next 5 years. This chapter ends with a description of the organizational structure of this document. 1.1 Background and Motivation The world is witnessing continuous technological development, and each day brings forth revolutions in internet, mobile and machine-to-machine technologies. This revolution, coupled with the rapid expansion of cities, has posed challenges governance and authorities to make better decisions for their citizens. Historically speaking, cities have been regarded as the pinnacle of economic and sociocultural achievements in human civilization, and the location of non-primary economic activities [49]. Thus, we need to talk about anew urban agenda in the age of information and terms such as SC, Internet of Things (IoT) or AI have been widely cited in the scientific community as they illustrate the convergence of these two phenomena. In recent years, there has been a significant surge in the volume of literature dedicated to SC and understanding their implications. For example, Alexander Pando—Forbes Council—said ”implementing smarter cities is a necessary step to prepare for future urban growth. The population will only increase in the foreseeable future, and technology provides the opportunity for cities to flourish” [154]. However, this type of cities need the integration of various resources, such as data storage, information services, and algorithms. These resources may be distributed across different units within the same organization, other external organizations, or even sourced from the vast expanse of the Internet. Figure 1: Daily time that internet users aged 16 to 64 spend using the internet on mobile phones as a percentage of total daily internet time (adapted from [55]). Figure 1 provides valuable insights into the interconnection between technologies and individuals/organizations. This digital transformation empowers citizens to engage with their ecosystems, ultimately 2 CHAPTER 1. INTRODUCTION cutting costs and enhancing the human mobility within the city. Furthermore, forward-thinking governments leverage this information to fuel invention and solutions to optimize their cities. Nonetheless, the increasing volume of information generated in IoT poses significant challenges concerning its representation, storage, searchability, and interconnectedness. As a consequence, all this is going to change the way in which big data is handled. Big data is not a new concept or idea. With recent developments in technologies such as sensors and cloud computing, along with the generation of data from various sources (sensors, humans, applications), organizations tend to store data for extended periods due to the availability of inexpensive storage and processing capabilities [157]. Once big data is stored, a number of challenges arise, especially concerning data processing and analysis. Thus, big data has become an increasingly significant challenge for the industry. Developments in the world of AI with Machine Learning (ML) approaches have given businesses a way to enhance the analysis of big data [26]. Big data encompasses the type of data which can be supplied into the analytical system so that a ML model could ”learn”to improve the accuracy of its predictions. Moreover, when combined with predictive analytics, big data enables pattern recognition, data mining and knowledge discovery. One of the key ML techniques—and the main approach we will work with—is Deep Learning (DL). Through it, computers will learn how to think for themselves, in a way which will resemble how we, as humans, learn during our early years. Although there is ongoing debate surrounding DL and whether it is the future of AI or not, it is clear that the potential for future applications is massive, given the rapid evolution of these technologies in a relatively short period of time. In one way or another, technologies are being widely used, as they are applied to various problems across different domains. Major companies such as Microsoft, Amazon, Google and Facebook are investing millions into DL research, making it an increasingly significant part of our everyday lives. It is expected that ML will become a fundamental component of most software applications in the near future. 1.2 Human Mobility In historical terms, cities have been regarded as the highest forms of economic and sociocultural achievements in human civilization [157]. However, this fact is challenging if we analyze the growth of the urban population. Today, approximately 359 million Europeans—72% of the total European Union (EU) population—live in cities, towns, and suburbs, with 26 cities having more than 1 million inhabitants. Additionally, only 7% of the EU population lives in cities with over 5 million inhabitants compared to 25% in the USA. Projections indicate that by 2050, more than 6.3B people—60% of the global population—will be living in cities [32]. Actually, according to the United Nations, in mid-2023 approximately 4.6 of the more than 8 billion people worldwide lived in towns or cities. This represents 57% of the global population. 3 CHAPTER 1. INTRODUCTION Simultaneously, the gentrification1of cities has led the authorities to adopt laws and policies to address issues related to planned and sustainable development and efficient management of cities. One of the primary objectives is, for example, to increase the efficiency of public transportation, accessibility and overall mobility of people. Notwithstanding, Figure 2 reveals more details about the population living in urban areas, categorized by region. Figure 2: Percentage of population living in urban areas by region (adapted from [127]). In the same way, a SC serves as a high-speed communication hub equipped with a strong and modern infrastructure making use of Information and Communication Technology (ICT) to establish real-time connections with other cities all over the world [58]. Quite simply, SC uses IoT devices (e.g., connected sensors, lights and meters) to collect and analyze data, and then use this data to improve environmental efficiency and an intelligent use of resources. Thus, the IoT enables the city’s infrastructure to be intelligent. The aforementioned topics (i.e., SC and IoT) pose several challenges and they are the reason why we provide a new approach to address human mobility within cities. Our approach involves selecting a human mobility prediction model and examining the role and potential of sensing devices as a crucial component of smart mobility management. To achieve this, we intend to conduct a set of distribution analyses in order to gain a deeper understanding of human mobility behaviour. By describing the overall human mobility pattern, it is possible to compare the outcomes from many locations, cities or even countries, thereby enabling the analysis of potential differences in trends related to human displacements. With rapid growth economic came equally rapid industrialization and urbanization. In the process of urgently ensuring the city’s competitiveness, a car-oriented transportation system was established. However, the automobile-centred lifestyle created too many problems, including traffic jams and environmental pollution. Walking emerged as the most basic and ecological means of transportation for humans, promoting 1result of wealthier people moving into a specific area 4 CHAPTER 1. INTRODUCTION areas and paradigms, including SC, IoT, Human Mobility and AI, among others. With this in mind, the broad goal of this work is to expand technologies and mobility services to assist both public and private stakeholders in making well-informed decisions regarding human mobility within a SC. In the same way, another contribution of this research is to foster increased discussion on human mobility issues among key stakeholders. Once we have completed a literature review, and before formulating a specific hypothesis, it is essential to formulate potential discussion topics. What are the requirements, limitations and challenges of current human mobility in the context of developing cities? How can ML principles applied in big data be aligned with the management of human mobility? Which DM tools can be adapted to research human mobility patterns effectively? How to solve the discrepancy between real issues and the way authorities have addressed human mobility in their cities? What is the nature of the collaboration between the multiple stakeholders (i.e., community and local authorities) and what role is played by each? How can the human mobility service be useful for various applications in modern days? Based on these reformulated questions, the specific research hypothesis can be framed as follows: ”A Mobility as a Service (MaaS) architecture that uses Cloud tools to store large amounts of data and Explainable Artificial Intelligence (XAI) techniques to explain AI models improve human mobility and capture real models for better plans of cities” However, to be more organized and clearer, we reformulate these preliminary questions according to the objectives that we intend to achieve with the work. Therefore, we present the following Research Questions: Research Question 1 - Can sensorization techniques such as crowdsensing and computing, taking into consideration the monitoring of a large number of individuals within a city, be facilitated from a MaaS architecture? With the fast proliferation of handled devices, humans are not only data consumers, but also data producers with their objective or subjective sensing needs. This computing paradigm, along with an increasing number of mobile phone users, promotes participatory sensor networks. However, the integration and study of the data collected by this wide range of devices are challenging, and the application of adoption concepts and sensing techniques is fundamental to ensure that the intended result remains not distorted. This research question will be answered through example scenarios and specifications of Open-Data Application Programming Interface (API) services available for local authorities of SC. Research Question 2 - Can we conceive and define an innovative MaaS architecture that allows gathering, addressing, and monitoring data from several open-source platforms located in SC environments? Collecting big data from heterogeneous Open-Data API services is essential in order to efficiently process and analyze it, which is a crucial aspect of becoming our work a truly data-driven study. All 11 CHAPTER 1. INTRODUCTION service data should be integrated under one roof (also called a ”data hub”). This research question can be demonstrated by developing a centralized data infrastructure that synchronizes multi-services API, collects processes, and stores data. Research Question 3 - Can a MaaS architecture that uses ML algorithms to discover and describe human mobility patterns in urban spaces help the authorities in better city planning? ML is a multidisciplinary field which can be proposed for modelling and predicting human mobility. In its turn, multi-source heterogeneous data provide a new driving force for exploring urban human mobility patterns from a quantitative and microscopic perspective. The studies of human mobility modelling and prediction will play a vital role in a series of applications within cities. The validation of this research question can be obtained through the applicability of DL algorithms, characterizing human mobility patterns from individual, collective and hybrid levels. Research Question 4 - Is planning and execution of a Proof of Concept (PoC) important to understand if the proposed goals can be reached? This PoC assesses the ability of ML regression to predict the presence of human mobility in New York City. Through the analysis of a dataset generated from free public data published by New York City agencies and other partners, we answer this research question. Therefore, deep learning is a promising method for analyzing the mobility patterns of pedestrians and urban residents, extracting and embedding patterns from complex large-scale data. Research Question 5 - Does the participation of the community foster the development Decision- Support Services to support decision-making by the authorities that govern the SC? To integrate different open-source data levels and convert captured data into knowledge we develop a Decision-Support for the design of smart human mobility policies in the case of emerging cities. The main goal is to improve the livability of crowded pedestrian spaces through the provision of decision support for the management of pedestrian flows. The first objective is to operate the WalkingStreet service in the living lab, which will demonstrate we can manage crowded pedestrian spaces. Therefore, a pilot is organized in the Department of Informatics, University of Minho (Braga) which features state-of-the-art crowd capturing, monitoring systems, and analysis techniques. The methodology to answer these questions is Action Research. We aim to demonstrate through collaborative communicative processes and small scientific studies to reveal new information with respect to the reliability of the human mobility applications. This theory, along with a continuous improvements approach of practical projects, supports decision-makers in cities with valuable human mobility information. In addition, each one of these goals focuses on Computer Science and Data Science areas, but we also conducted our research taking other fields into consideration. Therefore, the research could be enriched with solutions coming from other areas, such as Psychology, Sociology, and Mobility. 12 CHAPTER 1. INTRODUCTION 1.4 Research Strategies and Methods In this step, we outline the research procedure that encompasses various stages, starting from general assumptions to detailed methods for data collection, analysis, and interpretation. The plan will involve making several decisions, one of which involves selecting the appropriate approach to address the research problem. To aid in this decision-making process, we bring to the study procedures of inquiry (called research designs), and specific research methods for data collection, analysis, and interpretation. The selection of a research approach will be guided by the nature of the research problem or issue being investigated. For conducting rigorous research and taking informed action the approach to be used is Action Research. The choice of using Action Research instead of the Scientific Method is based on its ability to complement the features of the work. This research approach incorporates both quantitative and qualitative information. When conducting qualitative research, the goal is to gain a deep understanding of the topic, issue, or problem from an individual perspective. This will involving an in-depth literature review on the hot topics mentioned in Chapter 2 and collecting data from the community in order to get valid findings. On the other hand, the quantitative approach involves systematically investigating phenomena by gathering quantifiable data. In this stage, we will categorize and conceptualize the information. However, we believe that there is potential to further enhance the proposed research methodology. Therefore, we will develop new prototypes and conduct experiments in a laboratory setting, via computer and simulated experiments. To increase community engagement, we will also conduct field tests in a real environment with remote monitoring. In both research methods, the PoC will serve as research-support solutions to provide insights, data, and strategies for developing a concept. Based on the analysis of SC experiments, Action Research is also characterized as participative. For instance, in [35], the authors extend the concept of action research to participatory action research (or collaborative action research). In this work, the members of the organization under study should actively participate throughout the research process, instead of merely being subjects, and there is an intention to take action. Another distinguishing property, that differentiates it from Research Methodology, is its open-mindedness. In [36], the researchers adopted an action research-driven progressive and exploratory approach based on six digital rights-related factors. These properties are some of the reasons why Action Research should be chosen over a traditional research method. Additionally, during the initial context analysis, some questions arise early on, as shown in Section 1.3. 1.4.1 Proof of Concept In the action-research approach, the PoC is considered the most effective way of meeting requirements for human mobility research. This process allows researchers to explore and experiment with innovative ideas and experiences in the development phase, ensuring that solutions are suitable for their intended purposes. Most importantly, it tests the technical feasibility and practicability of a product idea through 13 CHAPTER 1. INTRODUCTION the design concept and functionality of prototypes. Over the last decades, with the increasing adoption of mobile devices, the emergence of mobile ubiquitous technologies, and the growth of the IoT infrastructures, the study of human mobility in cities has attracted more and more attention from academic entities. Several researchers have used the features of PoC to map the huge availability of technology in cities and its interactions with human mobility. In its turn, PoC is commonly applied in multi-scale procedures, involving the extraction and analysis of crowdsensing data, converting it into meaningful information through models and algorithms, and finally sharing the insights with the community. My research plan intends to follow up this kind of approach. The planned activities will focus on identifying the opportunities and potential of open-source data API design, as well as describing key data analysis techniques to gain an advanced understanding of the movement patterns of pedestrians. The main objective of my research is to develop a platform design that enables the execution and calculation of in a Machine Learning environment. This platform will facilitate the interaction and contribution of individuals and the community. 1.4.2 Data Collection Data collection is also another research method to be employed during the research plan [83, 141]. Its purpose is to collect human mobility data related to the phenomenon under investigation, using multiple devices available within cities (from individual mobile phones to interactive devices accessible to the general community). Regardless of the kind of data, when collecting data, a prior evaluation should be conducted to validate which attributes are most relevant for each data collection, thereby enhancing accuracy and expanding the scope of data analysis. Subsequently, after selecting the most important attributes, a system should be built to integrate and aggregate the generated data from multiple sources [13, 140]. The data integration process involves gathering datasets from several API services and gaining insights to determine their future business operations. Following this, the same system conducts data aggregation, wherein the primary goal is to combine these multiple datasets. Through data aggregation, we can determine the origin of the datasets and gain insights from a summarized version of the data. Therefore, the quality of data collection depends on the accuracy and thoroughness of these processes. 1.4.3 Experimental Case The experimental case is another interesting research method with the purpose of demonstrating the impact of one single factor on another, but there is always a risk that other factors might come into play and invalidate the results of the experiment. For example, it can investigate how weather conditions influence human mobility in the city centre. Additionally, it promotes individual or community-level contributions in the experiments. 14 CHAPTER 1. INTRODUCTION To ensure precise measurements and thorough control over the various factors influencing experiments, laboratory experiments are conducted in the field of Computer Science, where human mobility behaviour of both individuals and communities is studied in a controlled environment. Notwithstanding, this kind of environment may not fully represent the complexities of human mobility and behaviour that arise from human interactions across space over time. Moreover, it allows exploration of scenarios with intervention strategies associated with complex human movement dynamics and evaluates the effectiveness of interventions in a local context. Our experiments aim to provide a theoretical and practical contribution to the evolving role of human mobility within cities. These developments intend to prove that, through a set of open-source public services, we can understand behavioural geography, complex systems, and human spatial movements. What is proposed in this research methodology is to explore human behaviours and dynamics and how their direct and indirect participation can acquire a new role within the cities. 1.5 Research Plan The proposed work serves as an interface between several scientific disciplines, such as SC, IoT, AI, Human Mobility and Big Data. The results of the intersection of scientific fields are interesting for numerous stakeholders, ranging from the general public to municipalities and governments. Over the course of the next three years of doctoral studies, we aim to accomplish our goals through a series of key tasks. The primary objective of this Doctor of Philosophy (PhD) is to design an architecture (called WalkingStreet) that places the mobility of the individual (pedestrian) at the centre of the solution, while seamlessly integrating into a SC. However, to realize this vision, we must outline a serious of concrete steps to be undertaken throughout the PhD journey. Keeping this in mind, we present a Gantt chart outlining the project timeline consisting of seven main tasks. A Gantt chart is a common tool used in the project management field and provides a preliminary time schedule for the completion of the doctoral degree program. The schedule indicates the plans to complete the educational component, the field and laboratory work, the data analysis, and the writing and submission of scientific articles and presentations. To summarize, our Gantt chart shows what has to be done (the activities) and when (the schedule). Therefore, we enter the data to create a chart represented in Figure 5. Task #1 - Research of the State of the Art The initial phase of the research will involve conducting a thorough review of existing literature in the following areas: SC, IoT, Big Data, Sensor Fusion, Cloud Computing and AI. This review will be based on the title, abstract and the introduction of articles in the Web of Science database. Additionally, the list of keywords used in the search included combinations of these areas. Based on the highly relevant contents of the abstract and citation, we have gathered multiple papers that introduce various architectures aimed ate improving the accuracy of deep learning and smart cities. The literature review process was 15 CHAPTER 1. INTRODUCTION PhD Planning 2018/2019 (1𝑠𝑡 Year) 2019/2020 (2𝑛𝑑 Year) 2020/2021 (3𝑟𝑑 Year) 2021/2022 (4𝑡ℎ Year) 2022/2023 (5𝑡ℎ Year) S1 S2 S1 S2 S1 S2 S1 S2 S1 S2 Task #1 Task #2 Task #3 Task #4 Task #5 Task #6 Task #7 Figure 5: Schedule of activities in semesters. conducted by consulting several websites, namely the institutional repository of the University of Minho, Elsevier Journal Finder, Google Scholar, Scimago Journal & Country Rank, Semantic Scholar, and Scopus, as well as scientific databases such as ACM Digital Library and Springer Link. Following this process, we have selected relevant works for full reading and analysis to gain a comprehensive understanding of the current state of research in these areas. Duration: September 2018 - April 2019 Task #2 - Experiments with Tools and other Resources Smart human mobility can be characterized by different adjectives, such as technological and interconnected, but also sustainable, comfortable, attractive and safe. Our focus will be on demonstrating how innovative IoT technologies can address mobility issues in smart cities. An extensive analysis will be performed to evaluate the performance of mobility prediction algorithms. We will assess the influence of different data features on the effectiveness of these algorithms. Citizen participation is essential not only for developing efficient livable cities, but also for sourcing valuable data from diverse contexts. Basically, the more data we collect, the better our understanding of smart cities. Duration: February 2019 - September 2019 Task #3 - Integration of open-data multi-sources with Machine Learning algorithms To ensure better human mobility we need to understand mobility behaviour. We want to promote more benefits in human mobility, which is a particularly demanding task in urban areas, where people frequently interact and share common spaces. By analyzing the social information database from municipal departments and studying the daily behaviour patterns of urban residents, we aim to identify the reasons that motivate citizens to visit city centers. The spatial distribution and the urban inner space structure can 16 CHAPTER 1. INTRODUCTION provide decisive support for authorities in providing social management content based on urban management. Therefore, ML and DM of human activities will play a pivotal role in our research. Duration: June 2019 - July 2020 Task #4 - Design and computing of Human Mobility metrics In this task, we focus on preparing our prototype for a high level of optimization and sophistication. Based on the type of involvement from users, we apply sensorization techniques which can be categorized into opportunistic crowdsensing, where data is automatically sensed, collected, and shared without user intervention and, in some cases, even without the user’s explicit knowledge, and participatory crowdsensing, where users voluntarily contribute information. Regarding the last classification type, we believe that by utilizing both approaches, we can adapt our decisions and solutions to different populations within SC. It is important to recognize that mobility within a SC is not the same for every citizen (e.g., old people or people with reduced mobility). This is the main reason to track human activity: to better understand its impact on urban space. For a SC to work it needs people. The data generated by citizens provide valuable feedback that is essential to both diagnose problems and find appropriate solutions for sustainable urban development. Duration: May 2020 - June 2021 Task #5 - Decision Support System based on Participatory Sensing Research from Cisco has found that 60% of IoT initiatives face challenges and stall at the PoC stage, with only 26% of businesses considering their IoT initiative to be a complete success [47]. While these statistics might be concerning for some in the industry, they present an opportunity for academics and researchers. In particular, in the context of SC initiatives, which incorporate multiple stakeholders, utility providers, and citizens themselves, it is important to incorporate a pilot phase into any IoT project. With the promise of improved mobility for the population, multiple stakeholders must work collaboratively to achieve common goals and benefits. This collaborative community approach ensures that largescale operations are credible, well-planned, and effectively structured to deliver the desired outcomes and benefits to the citizens, such as quantifying the number of people in a particular area. The primary goal in this phase is to provide services that enhance urban living by making it safer, more affordable and more mobility-friendly. Understanding repetitive behaviour patterns is especially useful for offering real-time recommendations tailored to individual users. MaaS initiatives should be focused first and foremost on the citizen experience. Duration: March 2021 - July 2022 17 CHAPTER 1. INTRODUCTION Task #6 - Human Mobility Explanation System Design, Conception and Implementation In this phase of the PhD programme, our main focus is on incorporating explainability as a means of understanding human mobility behaviours. To achieve this, we propose a set of XAI models for viewing and interpreting the outcomes of the implemented AI system. Explainability is a crucial aspect of our proposed architecture, especially when dealing with complex black box models that may be difficult to interpret in the context of human mobility phenomena. By using explainable AI models, we aim to create a proactive pipeline that can effectively identify and analyze human mobility patterns and behaviours. Basically, it is a task-specific approach to human mobility analysis. However, these algorithms are specifically designed for human mobility analysis but are also versatile enough to be applied to various AI system working with diverse human mobility datasets. Duration: July 2021 - January 2023 Task #7 - Thesis Writing and Scientific Dissemination In conclusion, our work plan involves several key steps: we are currently focused on writing the thesis, and presenting the results of our research through workshops and targeted presentations. We are also actively publishing articles in peer-reviewed conferences and journals. These publications not only support our research but, also disseminate our work. Additionally, as part of our research journey, we actively participate in scientific events and collaborate with fellow researchers. Ultimately, after completing the thesis and obtaining authorisation from the academic committee of the PhD programme we must deposit the thesis in an academic repository to ensure community and public access. Duration: July 2019 - July 2023 1.6 Synthesis The introduction section of our dissertation has defined the scope and focus of our research, providing a preliminarily overview of the area of our dissertation. We have also highlighted the background and motivation behind our research, offering insights into the main topics of interest. Moreover, our work aims to meet the expectations set forth in the introduction, and, therefore, we have formulated research hypotheses and questions which will guide our investigations throughout the study. Through comprehensive research strategies and methods, we address these research questions. But, first of all, based on a thorough literature review, we analyze the advancements and drawbacks of each methodology. By combining different approaches, we aim to enhance the quality of our research outcomes. 18 CHAPTER 1. INTRODUCTION After, considering these combinations, we identify and describe the PoC. In this step, we pay special attention to the kind of services associated with capturing and aggregating data. Then, we employ an experimental case to gain deeper insights to the AI models that benefit from the collected data, allowing us to validate and verify the consistency and reliability of our results concerning the XAI models we employ. Finally, we design a plan to describe the objectives and significance of our proposed research, as well as how it will be conducted. The aim of this research plan is to employ effective strategies and methodologies to extract and analyze outcomes, including the impact that human mobility results will exert on the relevant research fields. Therefore, through a meticulous planning of activities, we antecipate discussing potential problems and alternative strategies to achieve our research objectives. 1.7 Document Structure This document is structured into seven chapters, each serving a specific purpose. The first chapter addresses the context of the research and outlines the main objectives. The background and motivation section highlights the potential of massive device adoption and increased human mobility in an urban area as a unique opportunity to elevate cities into an unprecedented technological level. To ensure effective research planning, we carefully consider the planning activities, including specific dates for each task. This helps us maintain a clear idea of our progress and provides a structured framework for the dissertation. For each task, we define clear objectives, describe the contents, identify the main deliverables and foresee potential difficulties and challenges. A detailed description is provided in the form of a Gantt’s diagram. During our study of the state of the art and literature review, we have identified significant and recent contributions in various areas, namely the conceptual, methodological and application levels. Some topics such as SC, IoT, Big Data, Sensorization, DM and AI, XAI are mentioned. We also discuss the new role of cities equipped with advanced information infrastructures. Numerous experiments have been conducted, resulting in in scientific contributions in terms of human mobility metrics and a detailed understanding of human behaviour phenomena. However, these promising results can be improved with the support of advanced storage tools and the use of forecasting models. To ensure clarity and transparency regarding the outcome of these sophisticated AI techniques for end users, some projects explain the human mobility results obtained from ”smart”context via XAI models. In the upcoming chapter, ”Related Work and Projects”, we delve into several SC projects involving other hot topics such as city planning, citizen-centred services, MaaS and XAI. The fundamental concepts and principles of smart human mobility align closely with those of SC technologies and infrastructure, presenting a large number of business opportunities and vast potential for growth. This means that urban environments planned on a citizen-centred approach invest in innovation to enhance services, reduce costs, and improve communication and interaction between local authorities and citizens. 19 CHAPTER 1. INTRODUCTION In the ”Innovation and Research”chapter, we explore the human mobility infrastructures. Moreover, sensing the environment around us and objects populating this environment became synonymous with the concept of pervasive or ubiquitous computing. Participatory sensing has emerged as a valuable tool, providing valuable metrics and community patterns that shed light on the complex and diverse nature of human behaviour in our daily activities. Controlling and understanding human activities pose a big challenge. It essentially recognises different activities at the same time, overlaps with others or is performed in parallel by multiple citizens. Finally, preliminary results highlight the potential role of IoT in a SC for implementing ML techniques in predicting human mobility. These findings not only validate the future developments outlined in the research plan but also emphasize the importance of IoT in shaping the future of urban mobility. The WalkingStreet platform is covered in our work as we aim to develop human mobility solutions in the age of SC. This platform comprises many different components, each playing a crucial role in the project plan and implementation plan. The project plan provides an architecture overview, encompassing a solution from infrastructure to application levels. These multiple levels propose decentralized, central and cloud modules. While the decentralized approach offers flexibility, it requires careful attention to infrastructure challenges, especially in extreme scenarios involving data capturing, storage and processing. The implementation plan, a key part of the ”Design and Implementation”chapter, delves into different processes within each module, such as data collection, communication, processing, management, and monitoring of human mobility data. Streamlining these processes not only optimizes the implementation plan but also contributes to cost savings that can be allocated to address other challenges faced by the platform. In the closing sections of this chapter, we emphasize the importance of acknowledging the challenges and issues that may arise in the building of this system. The discussion of the research outcomes has provided valuable insights into human mobility, particularly, understanding that the management of human mobility is influenced by citizen participation. However, it is essential to interpret the results with caution, considering the limitations of the current research. This chapter provides a reflection on the research process, acknowledging and discussing. the limitations and potential consequences of the design, as well as the implications of the interpretation of the results. Finally, the last chapter of this document serves as a comprehensive summary of the work accomplished and highlights the main conclusions to be drawn. Additionally, the chapter discusses potential avenues for future work. 20 CHAPTER 2. REVIEW OF THE STATE OF THE ART Finally, the Soft Infrastructure layer is responsible for providing new services to the city based on effective and advanced technology. Standardized frameworks are essential to support the integration of ICT services provides the SC with an adaptive capability. This adaptability is achieved by offering flexible control for the configuration of relevant data sources and context-driven filtering of relevant events to support decision-making. The system considers usage patterns and users profiles to suggest optimal configurations for smart city applications. The SC infrastructure places significant emphasis on role of ICT components, which play individual roles within the system (i.e., communication, authentication, data repositories, etc.), as well as on the ways that all these components interact to create a comprehensive intelligent city scope [99]. Moreover, by integrating the physical, institutional, and digital aspects of the city, it enables cities and communities to find the best combination of the different intelligent city components based on their needs and objectives. In this sense, if authorities want to offer a variety of SC services, they should apply this architecture to achieve their goals effectively. 2.2.1 Multi-source Environment Understanding human mobility behaviour allows for better urban planning. By treating mobility as a service, data on human activities is collected, enabling better estimation of demands and provision of adequate services. Thus, in our work, we employ a combination of two sensorization environment processes to capture human mobility data: location-oriented and location-enabled. The location-oriented data collection process involves capturing human movements as they pass through a predefined location [93]. It includes several input/output points dispersed geographically to cover the target area and the target part of the network (e.g., train stations, etc.). The most straightforward way is to manually note the number of pedestrians passing a predefined location within a specific time interval. As an alternative, advanced infrastructures like LinkNYC and PLASMV allow the New York, in USA, or Aveiro, Portugal, authorities to communicate with residents and visitors in real-time [95, 152]. Content can be targeted by neighbourhood, proximity to Points of Interest (POI), or other custom attributes, and can be responsive to the surrounding environment and time of day. The different types of data recorders and sensors placed on or under the traffic network surface benefit the data collection. On the other hand, location-enabled devices rely on the Global Navigation Satellite System (GNSS). to track movement in different locations. A constellation of satellites, wearable devices (e.g., smartwatches) and smartphones provide global coverage transmitting positioning and timing data [89, 105, 107]. This type of system also allows small electronic receivers to determine their location (longitude, latitude, and altitude) and calculate the current local time to high precision, which allows time synchronization. Additionally, these technologies simplify daily activities for individuals. While location-enabled devices offer a comprehensive approach to track mobility behaviour, respondents must carry the handheld GNSS devices 27 CHAPTER 2. REVIEW OF THE STATE OF THE ART continuously for accurate data collection as forgetting it would result in unreported gaps in trip data. Furthermore, to evaluate the success rates of such data collection methods, respondents often needed to manually note their trips, requiring significant effort and discipline. 2.2.2 Sensor Networks Architecture To build interconnected and interoperable smart objects, the adoption of standard communication protocols is essential. These protocols contribute significantly to the majority of the aspects of sensor network architecture. The fundamental concepts and ideals of this architecture are closely aligned with those of SC technologies and infrastructure, presenting numerous business opportunities and potential for extensive growth. Additionally, this integration enables the management of the networks through remote monitoring, empowering IoT innovation to enhance services, reduce costs, and improve communication and interaction within smart cities. In the following sections, we review the IoT architecture and a service model specifically designed to support acquisition of human mobility information. 2.2.2.1 IoT Architecture Figure 9: Four stages of Internet of Things architecture (adapted from [25]). The IoT is on the verge of revolutionize the way we interact with ”things”. It goes beyond Internetconnected consumer devices and encompasses the technology to create autonomous systems that sense and respond to real-world without human intervention. However, the IoT architecture can vary depending on the specific solution being developed. Therefore, we need to develop a process flow for a definite framework over which an IoT architecture varies from solution to solution, based on the type of solution which we intend to build. Therefore, we need to develop a process flow for a definite framework over which an IoT solution is built. In Figure 9, we present a general IoT architecture comprising 4 stages: •Stage 1 (Sensors, Actuators or Devices): A thing, in the context of IoT, should be equipped with sensors and actuators that enable them to emit, accept, and process signals; 28 CHAPTER 2. REVIEW OF THE STATE OF THE ART •Stage 2 (Data Acquisition Systems): The data collected by the sensors starts is initially the analogue form, and it needs to be aggregated and converted into digital streams for further processing. Data acquisition systems perform these functions of aggregation and conversion; •Stage 3 (Pre-Processing, Edge Analytics): Once IoT data has been digitized and aggregated, it may require further processing before it enters the data center, and this is where Edge Analytics comes into play; •Stage 4 (Cloud Analytics): Data that requires more in-depth processing, and where immediate feedback is not necessary, gets forwarded to a physical data center or cloud-based systems. In these more powerful IT systems, the data is analyzed, managed, and securely stored. The IoT architecture involves designing and integrating these various elements to create a robust service delivery network, which can cater to future needs. Just like the architecture of our buildings, factories, roads, bridges, towns and commercial hubs, the architecture serves as the backbone and should be carefully crafted to ensure functionality, scalability, availability, maintainability, and other essential criteria are met. 2.2.2.2 Human Mobility as a Service model In the context of sensor architecture, the timely acquisition, transmission, and processing of data play a crucial role in today’s world. The sensing as a service model aims to aggregate measures and information collected by sensors in a specific environment (e.g., a city) and share them within a larger context (e.g., a neighbourhood). This data, measurements, and information can be used to derive valuable knowledge, such as pattern analysis, to better understand how an environment operates [159]. Figure 10: Sensing as a service model (adapted from [1]). 29 CHAPTER 2. REVIEW OF THE STATE OF THE ART An important feature of this service model is encouraging users and owners of sensor networks to agree to share data within a larger community. By accessing and utilizing data from various sensors in different administrative domains (e.g., homes, companies, public administration and government, and social networks), this model facilitates valuable insights and cooperation among diverse sensor networks. This service demonstrates how large and independent sensor networks can collaborate effectively to serve the needs of larger communities. In addition, the open data policy adopted by these administrative entities has made petabytes of remote sensing data, with different spatial, spectral, and temporal resolutions, accessible. To effectively manage and analyze these vast amounts of data, a novel service provider platform, namely the cloud computing model where a third-party provider delivers hardware and software tools, offers highly scalable and networking services as a viable option. Once we can categorise this service a ownership of the data, we can also use it to become ”IOT-as-a- Service”that provides a free or chargeable service to any person to view or manipulate the data. Figure 10 summarises our discussion so far. The Sensing as a Service (S2 aaS) model proposes four main barriers: •Sensors and sensor owners/Sensor gateway capture the information about, for example, user behaviour or user preferences more accurately; •Service Provider (SP) detect available sensors, communicate with sensor owners, and get permission to publish the sensors in the cloud; •Extended Service Providers (ESP) the most intelligent among all the four layers which embed intelligence into the entire service model. Each SP has access to the sensors which are registered with it. And ESP communicate with multiple SP regarding sensor data acquisition on behalf of the sensor data consumer; •European Commission (EC) need to register themselves and obtain a valid digital certificate from an activity in order to access consumer sensor data. Sensor consumers can register their interests with both SP and ESP. Sensor consumers define what kind of sensor data they want and how much are they willing to offer. To overcome these barriers, the S2 aaS model is a visionary business model that facilitates data exchange (i.e., trading) between data owners and data consumers. In this world, data owners (who own IoT solutions) are rewarded (e.g., money, loyalty points, gifts, vouchers, bitcoin, actionable advice, etc.) for sharing (i.e., trading) their personal data collected by IoT products [156]. On the other hand, companies, as data consumers, gain a better understanding of their customers, data owners. As a result, companies will be able to optimize their business operations by reducing costs and develop new products and services to meet individual customer needs. Data consumers may recover their data acquisition costs through business process optimization and increased customer (i.e., data owners) satisfaction. Data consumers 30 CHAPTER 2. REVIEW OF THE STATE OF THE ART can include governments or entities. Thus, the S2 aaS model offers convenience and efficiency, making it a compelling reason for adopting an IoT solution. 2.2.3 Human Mobility Tracking Human mobility tracking involves objects equipped with sensors, actuators, and middleware communicating to serve a meaningful purpose. The actuators and sensors enable interaction with the physical world [205]. Various types of sensors can be used in multiple ways to measure the same environmental aspects. In addition, sensor boards can use be customized for IoT applications or to build specific boards for different uses, allowing the addition of any sensors we want. These technologies collect substantial data, which becomes valuable and useful once stored, organized, and processed. However, as discussed in the following sections, human mobility tracking is not just a single technology but a combination of interconnected technologies. 2.2.3.1 Networking Protocol SC has the capacity to provide unprecedented data about urban activities, transforming the way we can understand, manage, and study cities. Access to such information about their city, enhances citizen engagement [132]. Here are some examples: •Sensing Pedestrians: using sensors to count people in high streets and city centres; •Sensing Bicycles: monitoring and promoting healthy travelling, while assessing the availability of green or pollution-free areas in a city centre; •Counting on Public Transport: beyond city streets; buses, trains, and trams can also benefit from data collection; •Sensing Passengers on Buses: enables revenue protection by –reconciling tickets bought with passenger numbers -and supports effective fleet bus management with services around the city centre; •Sensing the users of Trains and Trams: monitors the number of people arriving on platforms and provides vital information on the use of routes by time of day. As already stated, sensors have been ubiquitous in many industries long before someone even heard the term IoT. Today, with the rise of smart buildings, Industry 4.0 projects in smart factories, and IoT-driven smart city initiatives, sensors have become even more essential, with advancements in their capabilities and applications. Just like sensors, actuators are transducers, and just like them, they have been in use for quite some time and even before the emergence of IoT. Actuators receive a signal and initiate actions to interact with 31 CHAPTER 2. REVIEW OF THE STATE OF THE ART and influence an environment. In a sense, an actuator can be seen as the opposite of a sensor, and it is importance is comparable. However, while most companies focus on acquiring and analyzing data, far fewer use data as triggers to make something happen in the physical world, where significant value can be found. This application extends beyond the scope of automation and is also relevant in consumer IoT applications. Some examples of actuators include: •Google Assistant: a virtual personal assistant that supports both text and voice input and adapts to user conversations regardless of the input method; •Google Home, Home Mini, and Home Max: Wi-Fi speakers which double up as smart home control hubs and personal assistants, allowing users to playback entertainment throughout their home, manage everyday tasks and ask Google things; •Apple HomeKit: enables users to set up their iOS Devices to configure, communicate with, and control smart-home appliances. In the scope, actuators are primarily about turning something on or off by applying force. However, actuators have plenty of applications, including in industrial fields or robotics, where they are used for grippers. They also play a role in smart consumer devices, where they work in conjunction with sensors to improve experiences, for instance enhancing sleep quality. At times, other pieces of technology are needed such as middleware. Middleware is a software that serves as a bridge between operating systems or databases and applications, especially on a network. It facilitates the connection and management of autonomous IoT components. A middleware devoted to sensor and actuator resources management, like S2 aaS Cloud [69], enables the establishment of higherlevel services, by addressing challenges such as dynamic resources provisioning, sensor virtualization, load balancing and multitenancy mechanisms [24]. S2 aaS Cloud, as a sensing-as-a-service middleware, offers sensor consumers a web application, hosted on a server instance, through which they can create virtual sensors to access sensor data that is placed in a cloud database. Moreover, when. It provides sensor consumers with a web application, hosted on a server instance, through which they can create virtual sensors to access sensor data that is placed in a cloud database. Moreover, when S2 aaS Cloud handles sensing requests through, its load balancer, which selects the server instance with the smallest outstanding request queue. 2.2.3.2 Human-Device Interaction This type of tracking allows human interaction with small devices like smartphones, smartwatches, or any other hand-held device, opening up possibilities for sensing human mobility behaviour. Carrying a smartphone has become a habit, and is therefore considered less of a burden, reducing the risk of nonreported trips. In addition, the use of sensors provide a solid foundation for required data interpretations 32 CHAPTER 2. REVIEW OF THE STATE OF THE ART (e.g., using the accelerometer to determine travel mode) and improves location precision. There are three ways to sense mobile phone data: 1. Call detail record and network signalization data are standardized data collected by mobile network operators for billing purposes. Such data includes records of all user-initiated activities such as calls, internet usage, and data services, and provides spatial and temporal parameters [29, 226]. Moreover, the telecom operator’s base station points allow for the high-precision collection of users to move from one area covered to another. Therefore, the frequency of data collection varies based on the device, network, and user activity. 2. ”Passive”tracking involves using dedicated applications that run as GNSS-based data loggers in the background on smartphones. It is employed to investigate individual mobility patterns [33, 116], analyze speed [94], monitor traffic [88] and enable large-scale sensing of human behaviour for smart city-oriented applications [123]. Data collected provides higher spatial and temporal resolution information on the context of travel activities, allowing for the extraction of time-relevant insights. 3. ”Active”and/or ”interactive tracking” utilizes interactive mobile applications where respondents can report additional trip data at the start of the trip or transport mode. It is also used as ground truth for the development of supervised machine learning models in order to replace parts of traditional travel surveys [146]. Data collected provides higher spatial and temporal resolution information on the context of travel activities and, consequently, extraction of time-relevant insights. Crowd-oriented sensing offers multiple advantages compared to traditional data collection approaches. It reduces the number of unreported trips that were common in travel diaries and surveys, as users tend to postpone completing them. Thus, the use of devices can support more balanced sensing of human mobility behaviour. 2.2.4 Participatory Sensing In recent times, there has been a significant contribution of sensing by individuals, groups of people, or social networks to gather sensory information. This paradigm involves the use of evermore-capable mobile phones and cloud services to create a collaborative sensor network. The network’s purpose is to collect, share, and analyze data, enabling the extraction of vital community information and constructing a spatiotemporal assessment of the phenomenon of interest [145, 164]. In essence, given the widespread use of smartphones and the mass of people in urban areas, participatory sensing reaches an extraordinary level of granularity both in time and space. This allows for a deeper understanding of human mobility phenomena occurring in the city. However, it is vital to understand the specific role of each level of granularity in participatory sensing. 33 CHAPTER 2. REVIEW OF THE STATE OF THE ART 2.2.4.1 Individual Data Level At an individual level, participatory sensing fosters community engagement by enabling participants to document their neighbourhood’s strengths and needs. It also promotes the distribution and decentralization of collected data so that participants can access, analyze, and make observations about the data. Moreover, this paradigm is complemented by management, mapping, visualization, and social networking through a web-based data platform [166]. This web-based platform combines data exploitation and analysis with a community-driven approach, facilitating the mapping of specialist knowledge and skills alongside relevant use cases from non-specialists. 2.2.4.2 Community Data Level This level of granularity in participatory sensing is probably extensive, given the potential number of participants. It is environmentally focused on a group of personal devices that offers valuable learning opportunities about the human mobility context. Moreover, this approach empowers communities to actively engagement with the ordinary and everyday, enabling individuals to critically and conscientiously act on the submitted and collected data in a campaign to influence policymakers and effect changes in local and personal environments [87]. Through web-based resources, remote policy decision can be made by configuring, aggregating, comparing, and interpreting data obtained through this community-level campaign. Thus, by putting sensors into people’s hands, participants can understand the significance of their individual data-sensing contributions at a community level. 2.2.4.3 Social Network Data Level The rapid advancement of mobile Internet and social network services has led to the integration of online interactions with physical elements, facilitating new possibilities [153]. For example, a group of citizens can capture geo-tagged images while moving about town, and when uploaded and displayed in a community context, these images can promote neighbourhood identity and local services. Moreover, the same images can be used to prioritize maintenance services. Pedestrians could use similar techniques to document and select scenic and shaded walking routes away from roadways and combine their shared data with POI. 2.3 Human Mobility Data Analysis As was the case for SC and IoT, there have been many attempts to define human mobility data, resulting in varying degrees of popularity and citation. However, none of these proposals has deterred authors of Big Data-related works from proposing new definitions or building upon existing ones. In 2010, Apache Hadoop defined big data as ”...datasets, which could not be captured, managed, and processed by general 34 CHAPTER 2. REVIEW OF THE STATE OF THE ART computers within an acceptable scope”[42]. The International Data Corporation later defined ”big data technologies as a new generation of technologies and architectures, designed to economically extract value from very large volumes of a wide variety of data, by enabling high-velocity capture, discovery, and/or analysis” [74]. Big data is not a new concept, initially limited to a few organizations such as Google, Yahoo, Microsoft, and the European Organization for Nuclear Research. Nevertheless, advancements in technologies such as sensors, computer hardware, and Cloud storage, have increased storage and processing capabilities while rapidly reducing costs. As a result, many sources (sensors, humans, applications) have started generating data. Organizations now have the ability to store this data for a long time due to the affordability of storage and processing capabilities. Once stored, the role of big data in IoT is to process this large amount of data in real-time, followings three sequential steps as shown in Figure 11. Figure 11: Internet of Things big data processing (adapted from [208]). A large volume of unstructured data is generated by IoT devices and collected within the big data system. This IoT generated big data is heavily influenced by the 9V factors discussed in Section 2.3.1 2.3.1, namely volume, velocity, and variety. In the big data system, which operates as a shared distributed database, a huge amount of data is stored in big data files. To analyze this stored data, we would use analytic tools like the KNIME Platform. As IoT unstructured data is collected via the internet, big data for the IoT need lightning-fast analysis with large queries to gain rapid insights from the data and make quick decisions. Hence the need for big data in IoT is compelling. 2.3.1 Characteristics Various academics have out forth different definitions of Big Data, Del Mauro’s proposal defines it as ”the Information assets characterized by such a High Volume, Velocity, and Variety to require specific Technology and Analytical Methods for its transformation into Value” [56]. Ed Dumbill, the program chair at the O’Reilly Strata Conference, describes Big Data as ”...data that exceeds the processing capacity of conventional database systems. The data is too big, moves too fast, or doesn’t fit the strictures of our database architectures. To gain value from this data, we must choose an alternative way to process it” 35 CHAPTER 2. REVIEW OF THE STATE OF THE ART [60]. Finally, Doug Laney introduces the widely spread idea of three vectors [57], stating that: ”Big data is high-volume, high-velocity and/or high-variety information assets that demand cost-effective, innovative forms of information processing that enable enhanced insight, decision making, and process automation”. Figure 12: Big data: 9V characteristics (adapted from [51]). As mentioned in Section 2.3, there is no clear definition for ’Big Data’. Big data, as its name indicates, represents massive amounts of data, and in addition to volume, it exhibits characteristics of variety, velocity and veracity. In Figure 12, three characteristics are used to define big data, also known as 9V’s [71, 137]: •Volume relates to the size of data, often measured in terabytes, petabytes, zettabytes, etc. The data is so large and complex that conventional data processing methods are inadequate for storing and analyzing it. •Variety refers to the diversity of data types and data sources. In addition, different sources will produce big data such as sensors, devices, social networks, the web, mobile phones, etc, and can include weblogs, Radio-Frequency Identification sensor readings, unstructured social networking data, streamed video, and audio. Approximately 80 percent of the data in the world today is unstructured, meaning it lacks a predefined data model or organization. •Velocity refers to the speed at which data is generated, analyzed, and reprocessed. Today this is mostly possible within a fraction of a second, known as real-time. For example, every 60 seconds, there are 72 hours of footage uploaded to YouTube, 216,000 Instagram posts, and 204 million emails sent. •Veracity relates to the unreliability associated with data sources. For instance, sentiment analysis using social media data (e.g., Twitter, Facebook) is subject to uncertainty. It is essential to distinguish reliable data from uncertain and imprecise data and manage the uncertainty associated with the data. 36 CHAPTER 2. REVIEW OF THE STATE OF THE ART 2.4 Smart Human Mobility The increased prevalence of IoT sensors present both opportunities and potential risks in terms of infringing citizen sovereignty [21]. On one hand, IoT sensors can be used to identify and address certain issues in a community, allowing residents to have a say in what problems are prioritized for resolution. But even then, there is also a risk of infringing on citizen sovereignty if the deployment of IoT sensors is biased, focusing only on certain areas or relying too heavily on historical data from specific locations. Biases in the data can lead to unequal representation and may impact the effectiveness of the approach. On other hand, the possibilities and problems of human mobility data mean developers are facing the challenge of bridging the gap between technology and the humanities [163]. As technology becomes more sophisticated, designer hold a key role in customizing such concepts for mass use. Additionally, as the focus shifts from technological solutions to considering the citizen’s experiences, the impact of different political and cultural systems in various countries will become more pronounced. The old adage that ”all politics is local”will be reinforced. 2.4.1 Constraints Address Human mobility data indeed presents several challenges that span theoretical, technical, technological and practical aspects. Classify this data is not straightforward due to its multidimensional nature, comprising a combination of many aspects to reveal the whole picture. Moreover, the term ”human mobility data”it is a buzz phrase widely used in different contexts and continues to evolve over. One of the primary challenge lies in data collection. It is important to capture the context in which the data has been generated and to filter out the noise during pre-processing and compressing. Data pre-processing is a complex and timeconsuming, especially when dealing with big volumes of unstructured and structured data originating from a large number of sources. Handling such data continuously requires innovative technologies and architectures, designed to efficiently extract value from very large diverse datasets, by enabling highvelocity capture, discovery, and/or analysis. Different data aggregation and representation strategies may be needed for different data analysis tasks. To effectively work with that data, a streamlined approach is essential, combining powerful analytics tools with efficient data movement from its source to an analytics platform quickly. Both big data and IoT technologies are continuously evolving to meet the changing requirements of the information technology field. However, several requirements and challenges must be addressed to capture and use human mobility data effectively [158, 199]. These challenges are as follows: -Privacy Issues: Concerns about personal privacy have escalated due to the proliferation of online platforms: the internet is booming with social networks, e-commerce, forums and blogs. Because 43 CHAPTER 2. REVIEW OF THE STATE OF THE ART of privacy issues, people are apprehensive about their personal information being collected and used in unethical ways that can potentially cause them a lot of trouble. -Security issues: Data security is a major concern, especially as businesses own sensitive information about their employees and customers, including their social security number, birthday, payroll, etc. Instances of data breaches and hacking have raised questions about the proper collection and protection of such data. There have been a lot of cases where hackers have accessed and stolen customer data from big corporations such as Ford Motor Credit Company and Sony. -Mining different kinds of knowledge databases: Data Mining (DM) should encompass a wide range of tasks, including data characterization, discrimination, association, classification, clustering, trend and deviation analysis, and similarity analysis. -Interactive mining of knowledge at multiple levels of abstraction: The DM process should be interactive, allowing users to refine their search for patterns based on returned results. -Incorporation of background knowledge: Utilizing background knowledge can guide the discovery process and enable patterns to be expressed concisely and at different levels of abstraction. -Efficiency and scalability of DM algorithms: To effectively extract information from a huge amount of data in databases, DM algorithms must be efficient and scalable. -Parallel, distributed, and incremental mining algorithms: Given the huge size of many databases, the wide distribution of data, and the computational complexity of some DM methods, algorithms that can be processed in parallel are essential for handling the computational complexity of DM methods. Some of the challenges have been addressed in recent DM research and development, but some are still at a research stage. 2.4.2 Data Mining Data Mining (DM) is a fundamental technology that forms the basis for AI. It is a process to extract implicit information and knowledge which is potentially useful but not known in advance from vast, incomplete, noisy, fuzzy, and random data [5]. The key distinction between DM and data analysis (as discussed in Section 2.3) is that DM aims to uncover information and discover knowledge without relying on clear assumptions. This technology, also referred to as Knowledge Discovery in Databases (KDD), employs various methodologies to analyze data from different dimensions and perspectives. It seeks to reveal previously unknown 44 CHAPTER 2. REVIEW OF THE STATE OF THE ART hidden patterns, classify and group data, and summarize identified relationships. Figure 13 shows DM as a crucial step in an interactive knowledge discovery process. Figure 13: Knowledge discovery from data process (adapted from [75]). It envolves the non-trivial extraction of implicit, previously unknown, and potentially valuable information from data stored in databases. While DM and KDD are often used interchangeably, data mining is actually just one step within the broader knowledge discovery process. In DM, large datasets are analyzed to identify patterns, and it relies significantly on statistical methods. The tasks are twofold: • Creating predictive models to predict unknown or future values of the same or other features; • Creating descriptive patterns that are interesting and interpretable to humans, providing insights into the data. This process uses automated data analysis techniques to uncover previously undetected relationships among data items and is commonly applied to data stored in data warehouses. In this context, clustering and regression are two of the major DM techniques used in the development of this thesis. 2.4.2.1 Clustering Clustering is the process of identifying similar classes of objects [59, 92]. By using clustering techniques, we can group data objects into clusters based on their similarity, revealing overall distribution patterns and correlations among data attributes. They can be used as a pre-processing approach for attribute subset selection and classification. The different types of clustering methods are: •Partitioning Method: Suppose we are given a database of 𝑛objects and the partitioning method constructs 𝑘partition of data. Each partition will represent a cluster and 𝑘≤𝑛. It means that it will classify the data into 𝑘groups, satisfying the following requirements: 45 CHAPTER 2. REVIEW OF THE STATE OF THE ART –Each group contains at least one object. –Each object must belong to exactly one group. For a given number of partitions (say 𝑘), the partitioning method will create an initial partitioning. Then it uses the interactive relocation technique to improve the partitioning by moving objects between groups. •Hierarchical Methods: This method creates a hierarchical decomposition of the given set of data objects. We can classify hierarchical methods on the basis of how the hierarchical decomposition is formed: –Agglomerative Approach: Also known as the bottom-up approach, it starts with each object forming a separate group and the repeatedly merges objects or groups that are close to one another until all of the groups are merged into one or until the termination condition holds. –Divisive Approach: Also known as the top-down approach, it starts with all objects in the same cluster and then iteratively splits clusters into smaller ones until each object is in its own cluster or the termination condition holds. This method is rigid, i.e., once a merging or splitting is done, it can never be undone. •Model-based Method: This method hypothesizes a model for each cluster to find the best fit of data for the given model. It locates clusters by clustering the density function, which reflects the spatial distribution of data points. This method can automatically determine the number of clusters based on standard statistics, considering outliers or noise, leading to robust clustering. •Constraint-based Method: In this method, clustering is performed by incorporating user or application-oriented constraints. A constraint refers to the user expectation or the desired properties of clustering results and provide an interactive way of communicating with the clustering process. Constraints can be specified by the user or the application requirement. 2.4.2.2 Regression The regression technique can be adapted for prediction. Regression analysis helps model the relationship between one or more independent variables and dependent variables [7, 65, 180]. In DM, independent variables are attributes already known, while the response variables are the ones we want to predict. Unfortunately, certain real-world problems are not easy to predict. For instance, sales volumes, stock prices, and product failure rates may be difficult to predict due to the complex interactions of multiple predictor variables. In such cases, more complex techniques (e.g., logistic regression, Decision Tree (DT), or Neural Network (NN)) may be necessary to forecast future values accurately. The same model types can often be used for both regression and classification. The types of regression methods are: 46 CHAPTER 2. REVIEW OF THE STATE OF THE ART •Non-linear Regression: The simplest way of modelling a non-linear relationship is to transform both the forecast variable 𝑦and/or the predictor variable 𝑥before estimating a regression model. This transformation creates a non-linear functional form, although the model itself remains linear in its parameters. A 𝑙𝑜𝑔 −𝑙𝑜𝑔 functional form is specified as: log𝑦=𝛽0+𝛽1log𝑥+𝜀. (8) In Equation 8, the slope 𝛽1can be interpreted as an elasticity: 𝛽1is the average percentage change in 𝑦resulting from a 1% increase in 𝑥. Other useful forms can also be specified. The log-linear form is specified by only transforming the forecast variable and the linear-log form is obtained by transforming the predictor. One of the simplest specifications is to make 𝑓piecewise linear (Equation 9). That is, we introduce points where the slope of 𝑓can change, called knots. This can be achieved by letting 𝑥1,𝑡 =𝑥and introducing variable 𝑥2,𝑡 . 𝑥2,𝑡 =(𝑥−𝑐)+=(0𝑥<𝑐 (𝑥−𝑐)𝑥≥𝑐(9) The notation (𝑥−𝑐)+means the value 𝑥−𝑐if it is positive and 0 otherwise. This forces the slope to bend at point c. Additional bends can be included in the relationship by adding further variables of the above form. An example of this follows by considering 𝑥=𝑡and fitting a piecewise linear trend to a time series. Piecewise linear relationships constructed in this way are a special case of regression splines. In general, a linear regression spline is obtained using Equation 10. 𝑥1=𝑥 𝑥2=(𝑥−𝑐1)+. . . 𝑥𝑘=(𝑥−𝑐𝑘−1)+(10) where 𝑐1, . . . ,𝑐𝑘−1are the knots (the points at which the line can bend). Selecting the number and position of knots (𝑘−1) can be challenging and somewhat arbitrary, though some software offers automatic knot selection algorithms but are not yet widely used. For smoother results, piecewise cubics can be used instead of piecewise lines, ensuring continuity and smoothness (so that there are no sudden changes of direction, as we see with piecewise linear splines). In general (Equation 11), a cubic regression spline is written as: 𝑥1=𝑥 𝑥2=𝑥2𝑥3=𝑥3𝑥4=(𝑥−𝑐1)+. . . 𝑥𝑘=(𝑥−𝑐𝑘−3)+(11) 47 CHAPTER 2. REVIEW OF THE STATE OF THE ART Cubic splines usually provide a better fit to the data, though forecasting 𝑦becomes less reliable when 𝑥goes beyond the range of historical data. •Linear Regression: In simple linear regression, the goal is to predict scores on one variable based on the scores of a second variable. The variable being predicted is called the criterion variable (𝑌), while the variable used for prediction is called the predictor variable(𝑋). When there is only one predictor variable, this method is know as simple regression. In Figure 14, we can see that there is a positive relationship between 𝑋and 𝑌. Figure 14: A linear regression scatter plot of the example data. The essence of linear regression involves finding the optimal straight line that best fits the data points. This line is referred to as the regression line. The black diagonal line represents this regression line, offering predicted 𝑌scores for each conceivable 𝑋value. The vertical lines drawn from the data points to the regression line represent the errors of prediction. The error of prediction for a specific point is calculated as the difference between the point’s value and the predicted value (the value on the line). Notably, the red point is very near the regression line, implying a small prediction error. By contrast, the yellow point is much higher than the regression line, indicating a large prediction error. As demonstrated in Table 2, the predicted values (𝑌′)and the errors of prediction (𝑌−𝑌′)are showcased. For example, the first point has a 𝑌value of 1.00 and a predicted 𝑌(called 𝑌′) of 1.21, resulting in an error of prediction of −0.21. It’s worth noting that the term ”best-fitting line”requires clarification. Typically, the most commonlyused criterion for determining the best-fitting line is the line which minimizes the sum of squared prediction errors. This criterion was employed to derive the line depicted in Figure 14. The final column in Table 2 shows the squared errors of prediction. The sum of the squared errors of prediction is lower for this specific regression line than for any other alternative line. Equation 12 presents the formula for a regression line. 48 CHAPTER 2. REVIEW OF THE STATE OF THE ART 𝑿 𝒀 𝒀 ′𝒀−𝒀′(𝒀−𝒀′)2 1 1 1.210 -0.210 0.044 2 2 1.635 0.365 0.133 3 1.3 2.060 -0.760 0.578 4 3.75 2.485 1.265 1.600 5 2.25 2.910 -0.660 0.436 Table 2: A table of the errors of prediction. 𝑌′=𝑏𝑋 +𝐴(12) where Y’ is the predicted score, b is the slope of the line, and A is the Y-intercept. The equation for the line showcased in Figure 14 is: 𝑌′=0.425𝑋+0.785 (13) For X = 1, 𝑌′=(0.425)(1) + 0.785 =1.21.(14) •Multivariate Non-linear Regression: The term multivariate non-linear regression refers to nonlinear regression involving two or more predictors (𝑥1,𝑥2, ..., 𝑥𝑛). When multiple predictors are involved, the non-linear relationship can no longer be visualized with a two-dimensional space [53]. •Multivariate Linear Regression: In the context of sample data, we measured variables𝑌, 𝑋1, 𝑋2 and 𝑋3.𝑌is the continuous response variable (often called ”dependent”), while 𝑋1, 𝑋2, ..., 𝑋𝑝 is the predictor variable (commonly referred to as ”independent”) [8]. Usually, the key questions revolve around predicting 𝑌on the basis of the 𝑋′𝑠and determining the ”independent”influence of wind speed. These inquiries can be addressed using multiple linear regression analysis. In the multiple linear regression model (Equation 15), 𝑌follows a normal distribution with a mean: 𝑌=𝛽0+𝛽1𝑋1+... +𝛽𝑝𝑋𝑝+𝜎(𝑌)(15) The model parameters 𝛽0+𝛽1+ ... + 𝛽𝑝and 𝜎must be estimated from data where 𝛽0cor- responds to the intercept, 𝛽1...𝛽𝑝are the regression coefficients and 𝜎=𝜎𝑟𝑒𝑠 represents the residual standard deviation. In addition to the regression model, although not used in this project, NN also performs classification tasks involving datasets that exhibit non-linear and intricate relationships. However, for these models to 49 CHAPTER 2. REVIEW OF THE STATE OF THE ART outperform conventional machine learning models such as SVM’s, decision trees, logistic regression, and naive Bayes, a lot more data is needed. Fortunately, with the current abundance of datasets on the magnitude of thousands and even millions of data points and the advancements in parallel computing, training NN for regression models has generally achieved better results in smart city projects compared to other model types [10, 188]. 2.4.2.3 Types of Data Mining Tools Undoubtedly, the adage ”data is money”rings true in today’s world. Along with the transition to an appbased world comes the exponential growth of data. However, a significant portion of this data is unstructured, needing a systematic approach to extract useful information from data and transform it into a comprehensible and actionable format. This is where DM comes into the picture. With plenty of tools available, using AI, and other advanced techniques, the process of extracting insights from data becomes achievable. The selection of a DM system depends on several features, including data types, system issues, data sources, functions and methodologies, query language, and graphical user interface. Each of these features plays a vital role in determining the suitability of the system. The data types feature corresponds to the system’s ability to handle different data formats, such as formatted text, record-based data, and relational data. It’s essential to ensure compatibility with specific data formats like American Standard Code for Information Interchange (ASCII) text, relational database or data warehouse. Then, in system issues, we must consider the compatibility of a system with different operating systems. One system may run on only one operating system or on several. It is also worth considering systems with web-based interfaces that support Extensible Markup Language (XML) data as input. Data sources refer to the data formats in which systems will operate. While some systems might only work on ASCII text files, others can handle multiple relational sources. Compatibility with Open Database Connectivity (ODBC) connections or Object Linking and Embedding Database (OLE DB) for ODBC connections is also important. Moreover, functions and methodologies are features that provide only one function such as classification, while some provide a broader array of capabilities. These could include concept description, discovery-driven Online Analytical Processing analysis, association mining, linkage analysis, statistical analysis, classification, prediction, clustering, outlier analysis, and similarity search. Finally, query language and the graphical user interface are a Graphical User Interface (GUI), important to promote user-guided, interactive DM model. Unlike relational database systems, DM systems often lack a shared underlying query language. There are numerous DM tools available in the market, but choosing the most suitable one is not simple [20, 214]. Moreover, Data Scientists employ a variety of techniques for different types of tasks, such as cleaning, organizing, structuring, analyzing, and visualizing data. In this topic, we present a series of factors that should be considered before investing in any proprietary solution. Table 3 lists the market’s top seven DM tools: 50 CHAPTER 2. REVIEW OF THE STATE OF THE ART Tool Name Type Language Features KNIME - Enterprise Reporting - Business Intelligence - Data Mining Java • Scalability and high extensibility. • Well-defined API for plugin extensions. • Import/export of workflows. • Intuitive GUI. Weka - Machine Learning Java • Classification and regression. • Three graphical user interfaces. • Poor documentation. Rapid Miner - Statistical Analysis - Data Mining - Predictive Analytics Language Independent • Data handling and aggregation functions. • File operators to operate. • Intuitive GUI. Orange - Machine Learning - Data Mining - Data Visualization Python and C • Visual programming and data analytics. • Large toolbox and scripting interface. • Extendable documentation. R Language - Statistical Computing C and R • Clustering and time series analysis. • Parallel computing. • Intuitive GUI Keel - Machine Learning Java • Classification and cluster discovery. • Regression and association discovery. • Intuitive GUI. DataMelt - Data Mining Java • Statistics and numeric computations. • Linear regression and neural networks. • Used in Windows and Android platforms. • Intuitive GUI. Table 3: Data Mining tools comparative analysis. Comparing the features of previous analytic platforms, KNIME provides the IT infrastructure for easy and secure deployment in the present work. It also doesn’t require coding effort, making it ideal for the proposed PoC that is built by NN and DL architectures. Covering the main data wrangling and ML techniques, a key feature of the KNIME Analytics Platformis visual programming. This visual programming involves a workflow of dedicated nodes, where each node implements a specific task. With this workflow, there’s no need to write code. In extreme contexts where KNIME Analytics Platform and its extensions cannot reach, there are integrations with other scripting and programming languages, such as Python, R, Java, and JavaScript. Its flexible nodes can be combined within a component, and consequently, the component has the views (for example, a selection and visualization in one chart) of the contained nodes and connects them. Another important integration is the KNIME Deep Learning – TensorFlow Integration. This extension allows the conversion of Keras models into TensorFlow models. This enables the reading, writing, creation, training, and execution of DL without writing code. 51 CHAPTER 2. REVIEW OF THE STATE OF THE ART 2.4.2.4 Deep Learning ML technique is currently the major application of AI. It uses algorithms to glean insights from data. Moreover, it gives systems the ability to learn from experience autonomously, without being explicit programming. In other words, the goal is to devise algorithms capable of automatic learning, without human intervention or assistance [183]. In ML, algorithms receive input values and use historical data to predict corresponding outputs. This is particularly relevant when analyzing urban human mobility datasets extracted from relevant locations in a Smart City, utilizing access points (e.g., bluetooth, wi-Fi direct access points, cellular tower or information LED screens), Global Positioning System (GPS) information by individual devices, and aggregated GPS points recorded by devices such as smartwatches or smartphones. This data should be processed to extract several variables, aiming to find human mobility patterns in the data. These patterns can inform decisions about security within specific urban areas. The search for these patterns involves ML methods and they are, often categorized as Supervised Learning algorithms. These algorithms require input and desired output data for training and provide feedback on the accuracy of predictions during algorithm training. They identify which variables or features, the model should analyze to generate predictions. Once training is complete, the algorithm will apply learned insights to new data. Deep Learning (DL), a subset of ML, diverges from traditional shallow ML in its capabilities, allowing computers to solve a host of complex problems that couldn’t otherwise be tackled. In 1950, Alan Turing said ”While successes have been achieved in modelling biological neural systems, there are still no solutions to the complex problem of modelling intuition, consciousness, and emotion - which form integral parts of human intelligence”. Based on the structure and functionality of biological neural networks, DL emulates the workings of the human brain. Neurons in a biological neural network are connected via axons, and DL replicates this communication process [2]. Urban human mobility can already use deep learning to build data-based models and figure out the expected performance of a given mobility network. The studies of human mobility modelling and prediction play a vital role in a series of applications such as urban planning, epidemic control, location-based services, traffic forecasting systems, intelligent transportation management and, more recently, various mobile and network applications. DL models incorporate scheduling optimization engines, suggesting more efficient schedules automatically. For instance, they can predict the likelihood of a given trip adhering to a timetable. If buses are unlikely to stick to the timetable, optimization can improve on-time performance. In the same way, optimization models enhance the accuracy and efficiency of citywide human mobility predictions. Moreover, a spatial-temporal mobility event prediction framework based on NN is a general and effective method for representing mobility events. This approach trains deep networks to derive detailed results for citywide prediction scenarios. In Section 4.2.3.1, we outline the definitions and differences of models employed 52 CHAPTER 2. REVIEW OF THE STATE OF THE ART 2.5.2.1 Decision Tree Based on Classification and Regression Trees (CART), this particular tree structure deals with all kinds of variables and predicts both numerical and categorical attributes. For our purposes, we employ a DT API developed by [38]. Inspired by the ML library, scikit-learn has an optimized version of the CART algorithm despite not yet supporting categorical variables. Demonstrating its explanatory potential, Miguel Guimarães et al. have implemented a scratch of a DT. An example of the execution of a DT via the Command-Line Interface is shown in Figure 18. Figure 18: The generated Decision Tree from the command line. The developed DT script is available as open-source, permitting programmers to freely download the source code and modify it, without necessarily depending on the API. Either through the API or executed using the DT script, the model training is not allowed if the settings given by the user are invalid. The user is also informed if there are possible improvements to be made in the settings. 2.5.2.2 LIME This framework generates prediction explanations for any classifier or ML regressor. It manipulates the input data and creates a series of artificial data points containing only a subset of the original attributes [168]. It also provides local model interpretability. Essentially, this approach involves altering the values of features within a single data sample, then observing the resulting impact on the output. A notable feature of this technique is its ability to explain at the dataset level, discerning the importance of different features and elucidating the outcomes of models that operate on text, tabular, and image data. It accomplishes this by fitting the model using sample data points which are similar to the observation being explained. The explanations provided by Local Interpretable Model-Agnostic Explanation (LIME) for each observation 𝑥is obtained as shown in Equation 16: Φ(𝑥)=𝑎𝑟𝑔𝑚𝑖𝑛𝑔∈𝐺𝐿(𝑓 ,𝑔, 𝜋𝑥) + Ω(𝑔)(16) 59 CHAPTER 2. REVIEW OF THE STATE OF THE ART where 𝐺is the class of potentially interpretable models, including linear models and decision trees, 𝑔∈𝐺: an explanation considered as a model. 𝜋𝑥(𝑧)denotes the proximity measure between an instance 𝑧and 𝑥.Ω(𝑔)quantifies the complexity of the explanation 𝑔∈𝐺. The goal is to minimize the localityaware loss 𝐿without making any assumptions about 𝑓since a key property of LIME is that it is model agnostic. The measure 𝐿gauges how well 𝑔approximates 𝑓within the locality defined by 𝜋(𝑥). 2.5.2.3 SHAP The Shapley Additive Explanations (SHAP) library, introduced by Lundberg and Lee [121], is a tool that draws inspiration from game theory. . It incorporates many attractive properties to explain the output of ML models. Additionally, it provides a means to estimate and demonstrate the influence of each feature’s contribution to the model’s output, allowing us to ”debug”our model and observe how it arrived at a certain prediction. In its most general form, the Shapley value is the average marginal contribution of a feature value across all possible coalitions. If there are 𝑁features, the computation of Shapley values involves considering 𝑁different order combinations. From a computational perspective, it has been demonstrated that the only additive method that satisfies the properties of local accuracy, missingness, and consistency can be achieved by attributing to each variable 𝑥′𝑖an effect 𝑖as defined by Equation 17: 𝜙𝑖(𝑓 , 𝑥)=Õ 𝑧′⊆𝑥′ |𝑧′|!(𝑀− |𝑧′| − 1)! 𝑀!𝑓𝑥(𝑧′) − 𝑓𝑥(𝑧′\𝑖)(17) where 𝑓is the model, 𝑥are the available variables, and 𝑥are the selected variables. The quantity 𝑓𝑥(𝑧′) − 𝑓𝑥(𝑧′\𝑖)expresses, for every single prediction, the deviation of Shapley values from their mean: the contribution of the 𝑖−𝑡ℎ variable. 2.5.2.4 Seldon Alibi This XAI technique is an open-source Python library designed for inspecting and interpreting ML models. It provides high-quality implementations of black-box and local explanation methods for both classification and regression models. Alibi boasts a selection of 8 different algorithms for model explanations, including popular algorithms like anchors, counterfactuals, integrated gradients, Kernel SHAP and Tree SHAP. For our work, we have opted for the Kernel SHAP algorithm. Incorporating Alibi into the workflow necessitates the provision of training data and the invocation of the fit method. Then, the explain method is called to calculate an explanation for a singular instance or a set of instances. The outcome of this process is an Explanation object, which contains both metadata (e.g., hyper-parameter settings, names) in the meta dictionary, as well as the explanation data itself in the data dictionary. The structure of the Explanation object enables straightforward serialization in production systems, facilitating further processing tasks, such as logging or visualization. 60 CHAPTER 2. REVIEW OF THE STATE OF THE ART 2.6 Summary The presentation of several concepts such as smart city hub, human mobility metrics, infrastructure for information acquisition, ML and XAI methods serves to demonstrate how cutting-edge technology incorporated into cities can significantly enhance human mobility in urban areas. From this human mobility topic, this work has discussed the potential of hub technology city indicators using a dense infrastructure network, and complemented by digital technologies that control and manage city services and systems. Furthermore, the realization of interconnected and interoperable smart objects necessitates the establishment of information acquisition infrastructure. Once this type of infrastructure operates in smart spaces, using intelligent interfaces to connect and communicate across social, environmental, and user contexts. This infrastructure creates a worldwide network of objects based on a multi-source environment in cities, generating vast data streams. Part of this data is produced by interacting directly or indirectly with humans, depending on citizens’ level of participation. This level of contribution can be used to appropriately model human mobility solutions. Accurate characterization of data is important to adopt a better strategy to store all this information. From point of view of human mobility, cloud storage emerges as a suitable environment for managing this vast amount of data. Nonetheless, this database stores big data in a primary instance that must be analyzed. Metrics and exploratory analysis are valuable tools to unearth insights from human mobility data. As the investigation delves deeper into the collected and stored data, some constraints should be considered, such as data anonymization of citizens and the security of open-data source API. These constraints are a relevant step to ensure they don’t compromise DM process or the diffusion of forecasts and predictions from ML models’ outcomes. Finally, given that many AI implementations deal with personal data, customers need to know that this data is being handled with the utmost care and sensitivity. This entails providing customers with an explanations for decisions made. With explainable AI systems, customers can understand exactly where data is coming from and how it’s being used, meeting these regulatory requirements and building trust and confidence over time. 61 C h a p t e r 3 Related Work and Projects This chapter highlights a selection of the many projects that have been developed in Smart City (SC). As previously mentioned, a city’s classification as ”smart”hinges on the evaluation of specific indicators. At the same time, any initiative that aims to make it smart depends on its unique attributes. In other words, city planning is shaped by the execution of intelligent projects. This requirement also extends to the human mobility project outlined in this doctoral thesis. The architecture of human mobility proposed in this document is designed to meet citizens’ needs. To this end, a detailed description of the potentialities and characteristics of Mobility as a Service (MaaS) is presented. We also highlight the interaction between the components comprising this service. The MaaS provider infrastructure has the ability to be integrated into solutions that align with a citizen-centered approach to cities. Therefore, this service is well-suited for application in the human mobility project put forth by this doctoral program. 3.1 City Planning and Development to Human Mobility SC represents a significant breakthrough in contemporary urban development and planning processes. Three major driving forces sustain the paradigm shift towards intelligent cities. Firstly, the continuous urban population growth both sustains and challenges authorities to adopt contemporary policies for the effective city management worldwide. In its turn, the ubiquity and influence of the Internet and the web, as major technological innovations of our era, foster both voluntary and involuntary human participation. This participatory sensing can mean the acquisition of data about mobility contexts. These two views, supported by Artificial Intelligence-Driven Decision Making, have inspired the community to develop projects to revolutionize the future urban environment. 62 CHAPTER 3. RELATED WORK AND PROJECTS Various smart city projects offer solutions for city management wile incorporating architecture design, helping to identify main city components and their interactions. For example, Nominet, a company involved in nearly 150 projects [147], notably the Portuguese-engineered PlanIT Urban Operating System. This project converges and manages an infrastructure with a world of sensors, devices, and people across developments of scale and entire cities. Another smart city project that is being implemented in many countries is the mobile application TransitApp developed by a Canadian company. It aims to be a partner for transit agencies and provide users with a seamless transit experience, through the fusion of high-quality data, great design, and thoughtful features [148]. Among governmental initiatives, the ”Digital Catapult: Things Connected”in the United Kingdom stands out [48]. Supported by $3.8 million in research funding, the Digital Catapult has collaborated with over 2,000 small businesses to push forward more than 40 projects aimed at digitizing business processes in London. In Japan, the collaboration between the Fujisawa City local government and Panasonic addresses energy issues and encourages the country to become more sustainable. Several projects have envisioned the concept of a smart city from different perspectives, taking advantage of existing knowledge and experience. Collectively, these analyses offer a ”snapshot”of the evolution of smart cities. 3.2 Mobility as a Service In recent years, MaaS has gained significant traction, particularly with the generalization of shared mobility solutions that prioritize individuals and their needs [86, 165]. MaaS operates by tailoring real-time information to users, offering a range of mobility solutions supported by different modes of transportation. While its role in changing the population’s mobility patterns is not yet fully understood, the commitment of some of the main players (academic entities, private enterprises and governments organizations) suggests the rapid expansion and advancement of this concept [22, 27, 195]. These players, along with other enthusiasts, have contributed to addressing this knowledge gap and, furthering our comprehension of how end-users perceive and use this service. More specifically, they list core MaaS propositions, identified the key stakeholders involved in its development, elucidated potential ways for management (or, in other words, business models), and MaaS topologies. 3.2.1 MaaS Features In the literature review, we have examined a comprehensive list of available MaaS definitions and similar concepts [34, 39, 216]. Researchers have explored various perspectives on relevant aspects of MaaS, analyzing existing MaaS services or analogous ones based on these aspects, outlining its distinguishing 63 CHAPTER 3. RELATED WORK AND PROJECTS characteristics, defining and detailing MaaS levels, and aligning services with appropriate levels. While these perspectives may vary, they also share common features that characterize MaaS features: •Transport Mode Supporting: Within an integrated MaaS system, the number of alternative modes of transportation’s operators tends to increase. This expansion enhances the service’s potential by optimizing resource allocation based on users’ necessities, thereby reducing inefficiencies within the transportation system [15]. From the user’s viewpoint, this will mean that, based on realtime information, he will be capable of optimizing their travel resources. •Technologically-based Platform: The MaaS paradigm adopts a technologically-based definition, where MaaS is a technical system (a digital platform) accessible via web or (most likely) smartphone applications. This platform facilitates the seamless integration of the purchase process of several distinct journeys and/or travel elements and processes of transport integration and the commoditization of transport infrastructure [162]. •Multimodal Trip Planning: From the citizen’s point of view, the journey planning tool, which interfaces with Information and Communication Technology (ICT) is central to MaaS [136]. This tool facilitates real-time information exchange between users and service providers, aiding trip planning, execution and problem-solving along the route. •Bundles of Products and Services: Utilizing bundled offerings is a strategy commonly employed to enhance user acceptance and promote underutilized products and services [130]. In the context of MaaS bundle may combine less popular modes, such as bike sharing and car sharing with public transport, with the hope that this will result in increased adoption of these modes. As such, MaaS can be viewed as a soft mobility management tool, which aims to ”repackage”travel services to cater to specific pedestrian needs. •Payment Plans: MaaS embraces various payment plans and options. Periodic plans tailored to users’ transportation needs, such as urban commuter, family, business, or casual plans, fall under the ”Pay Option”category. Alternatively, ”Pay on demand”allows users to pay per trip, where the entire journey is charged as a single payment, regardless of the transport means used, processed automatically via smartphone. •Decision-making Support: MaaS resources are needed to produce, manage and optimize transport infrastructures and services, but also influence citizens’ trip decisions, promoting environmentally friendly travel choices and minimizing the environmental impact of commutes. •Extra Services Add-on: MaaS offers value-added services that enhance, the attractiveness and benefits of transportation choices for users. 64 CHAPTER 3. RELATED WORK AND PROJECTS •Partnerships Promotion: MaaS becomes even more robust when there is collaborative decisionmaking and cooperation among multiple stakeholders. While added values offer theoretical potential, practical implementation can be subject to technical and methodological challenges. •Smart Cities Promotion: MaaS finds a natural fit in cities that use technology to improve services and the well-being of their inhabitants. Such SC is prepared to explore all the possibilities of MaaS. Derived from these characteristics, MaaS emerges as a user-centered service which tailors itself to individual needs. Furthermore, according to Hensher, it has three structural properties: Broker (i.e., acting as the public/private sector’s intermediary), Bundle (i.e., forming travel plans) and Budget (i.e., ensuring the most cost-effective trip). They are represented on Figure 19. Figure 19: Main Mobility as a Service structural characteristics (adapted from [215]). Brokers serve as intermediaries, facilitating access to different modes of transportation. These are bundled together into travel plans, referred to as Bundle. The collective strength of user demand for similar trips empowers negotiations for reduced fees. Therefore, mobility brokers aggregates different suppliers and deliveries, offering and integrated service to demanders. Moreover, this transformation necessitates authorities to reconsider their relationship with operators, influencing the design of transport modes and business models. 3.2.2 MaaS Components As previously mentioned, MaaS is gaining significant attention in studies related to Human Mobility, Technology, and Smart Cities. Various strategies have been adopted. However, it’s essential for each city considering a MaaS initiative to evaluate its local context and future strategic challenges. For these reasons, cities should prepare an infrastructure that involves its components, including both public and private devices. Simultaneously, this infrastructure should be relevant to various stakeholders, such as citizens, 65 CHAPTER 3. RELATED WORK AND PROJECTS local authorities, and enterprises. Figure 20 illustrates a set of recommendations for developing a MaaS programme in cities. Figure 20: The interaction of Mobility as a Service components (adapted from [215]). In the domain of smart cities, MaaS projects stand as strategic solutions, capable of identifying and adopting suitable business models tailored to specific applications or locales. These projects not only cater to diverse stakeholders but also foster user adoption while promoting environmental sustainability. Definitions of the ”new”MaaS concept also include other significant elements, such as customer needs, personalized or tailored and comprehensive solutions, and user interfaces. MaaS outlines their main key components: •Information Technology Providers: They offer on-demand cloud computing or fog computing services, enabling real-time transport planning, modelling and performance indicators, and environmental measures. This technology expansion translates into more efficient infrastructure utilization and innovative city development. •Customers: They provide personal information, make reservations, payments, and give feedback. Despite payment and reservation being operations that occur on use-case specifics, the user interface typically facilitates information sharing and user feedback. In addition, customers expect hassle-free experiences, adjusted prices, and personalized services. •Operators: These actors access their data and, at the same time, try to expand their market share. MaaS providers strive to on-board as many operators as possible to join their platform, ensuring a 66 CHAPTER 3. RELATED WORK AND PROJECTS seamless integration of services. •Operations System: MaaS facilitates various operations such as ticketing and payments, ensuring the availability of a high and varied number of services to the user. Consequently, it may attract new markets and revenues. Inversely, from these operations, the user can access a diverse range of services through a single ticket. •Data Providers: MaaS platforms focus on matching individuals with suitable mobility options while expanding datasets over time to provide further details about both the individual and the transportation assets. Along with this expansion, operators and platforms envision a gradual and well-defined roadmap. They undertake a thorough evaluation of their current positions, guiding their subsequent actions, directing investing towards new markets, and capturing revenue opportunities. •Journey Planner: This MaaS actor offers efficient multimodal/intermodal dynamic journey planning, utilizing user location and demand data. Mobility intelligence planning leverages user location data to analyze multiple factors such as population density, traffic patterns, trip parameters (origin, destination, distance, duration), driver intent, proximity to home/work or adjacent Points of Interest (POI) •Authorities: They regulate data standards, and policy frameworks, increase accessibility and inclusiveness, improve service quality and reliability, and integrate tariffs. They also enable systemlevel optimization of mobility planning (and associated investments), real-time mobility flows, asset utilization, and achieve sustainable goals. •Investors: MaaS platforms development relies on a ”national”agenda, drawing attention to the concept and making it easier for start-ups to find investors and to convince mobility service providers to jump on the bandwagon. In other words, infrastructure and public policies should encourage people to opt out of traditional models of mobility. However, this migration to digital mobility platforms is only possible with players available to invest in public mobility solutions. •Regulators and Unions: MaaS emerges as a user-centric, multi-modal alternative to conventional commuting practices and has harnessed the attention of the public and private sectors alike. However, regulators and unions require city authorities to recognize the balance of priorities in the new transportation mix and act as facilitators of partnerships, innovation, and uphold the interests of cities and citizens. •Academic Institutions: Academic researchers have looked into the intricacies of MaaS, yielding valuable research findings that contribute to a better understanding of human mobility behaviours. Their insights aid policy makers in defining context-appropriate measures. In addition, their research 67 CHAPTER 3. RELATED WORK AND PROJECTS can be published in journals, conferences, and media outlets, leading to revenue generations, innovation credit, and prestige. •Insurance Companies: With many MaaS solutions available in cities around the world, insurance companies play a central role in the lives and mobility of transit users. They need to evolve to accommodate users’ need for multimodality while also meeting the needs of service providers. Through their products, insurance companies can explore new markets and revenue streams. •ICT Infrastructure: MaaS agglomerates heterogeneous displacement modes, physical infrastructure, and ICT tools. These components synergize to provide citizens to with high-speed Internet connectivity, extensive coverage, and efficient access to their destinations. Additionally, these infrastructures aim to create public value that in turn improves citizens’ quality of life and contributes to market expansion and revenue growth. These MaaS components offer a number of opportunities and challenges. They represent emerging human mobility models with considerations spanning technical, regulatory, and workforce domains. Mobility technology is also a space where insurance and actuarial sciences have an important role to play, contributing to safer mobility experiences. While it reduces driver-related mistakes, and the complexity of this evolving ecosystem requires careful management, the open market nature of MaaS providers offers cities intelligent possibilities for the future. 3.3 Citizen-centred approach to cities As previously mentioned, studies on human mobility within urban areas are known to explore datasets containing thousands, and even millions, of data points. To address this challenge, conventional Machine Learning (ML) models (e.g., Deep Learning (DL), Decision Tree (DT), etc.) are commonly employed. Additionally, the advancements in parallel computing, and the training of Neural Network (NN) for classification and regression tasks have generally achieved superior results compared to other models. On the other hand, the essence of the smart city concept lies in the established functional cycle of human engagement, particularly involving mobility, while fostering active participation within the cities. Numerous projects have used technology to enhance the quality of life inherent to this functional cycle, thereby moving closer to the optimal realization of a smart city. Below, we provide an overview of the issues and solutions pertaining to human mobility , enabled by Artificial Intelligence (AI) technology, that positions citizens as engaged and cooperative agents within smart cities. 68 CHAPTER 4. INNOVATION AND RESEARCH mobility, human mobility, safety). Consequently, in this new phase, attention shifted to the relevant role of the citizen in building smarter cities [110, 142]. In the third stage, the citizen is instilled with the will to co-create, marking a pivotal shift in smart city strategies where citizen participation has become essential for achieving success [184]. However, merely involving citizens collaboratively is no longer enough, it is necessary to turn cities into sustainable spaces [46]. In the context of human mobility, several international entities have provided guidelines. The European Union’s Europe 2020 strategy focused on three priorities [44]: sustainable growth (low-carbon economy), smart growth (education, research, and innovation), and inclusive growth (jobs and wealth). In the context of human mobility in cities, there are several ongoing initiatives. One of them involves implementing a strategy for smart and sustainable mobility in order to enhance the sustainability, intelligence, and healthiness of urban and interurban transportation networks. The European Commission (EC) is proposing revised transport guidelines for this purpose. The proposal envisions major European cities establishing public transport connection nodes and formulating urban sustainability plans by 2025, based on a set of criteria [64]. Similarly, internationally renowned entities such as the International Telecommunication Union, International Electrotechnical Commission or International Organization for Standardization set up a ”task force”to align the Information and Communication Technology (ICT) with urban sustainability. This initiative includes implementing key performance indicators, encompassing human mobility [198]. Several frameworks pertaining to human mobility have been developed to make cities smarter and can be found in literature [11, 12, 111, 172, 211, 225]. However, it is important to study the best practices for establishing an infrastructure for continuous human mobility monitoring. Such an infrastructure would contribute a standardized basis for policy decisions, fostering the progress of cities without jeopardizing privacy and citizen security. 4.1.1 Functional Smart City architecture In the digital age, technologies have improved people’s lives, serving as tools for both leisure and work. This merger has made services more available to citizens. On the other hand, the influx of populations into cities requires a constant restructuring of communication infrastructures due to the growing interconnectivity of diverse sensors. Therefore, the evolution of ICT has led to the proliferation of devices, transforming the physical world itself into a knowledge and information-sharing system. In human mobility, the incorporation of Internet of Things (IoT) and communication networks within cities has led to various infrastructure proposals. These infrastructures cater to pedestrians and runners by providing highquality applications/services. In addition to this, government authorities are invested in making the infrastructure not only appealing but also accessible any time and anywhere thereby fostering active citizen participation and aligning with the attributes of a smart city 4.0. In this context, we propose the following functional organization for the construction of smart cities: 75 CHAPTER 4. INNOVATION AND RESEARCH Figure 21: Functional layers of a Smart City. Figure 21 illustrates the functional organization of a smart city, demonstrating the importance of ICT in each layer. Amidst ongoing discussions around this architectural framework, the data and information layer takes a prominent stance. Research work, demonstrations, and projects within this layer strive to address concerns of privacy, reliability, information sharing, standardization, Application Programming Interface (API), and commercialization. However, preceding these endeavours, it is necessary to facilitate comprehensive understanding among various stakeholders regarding the data they intend to collect, interpret, enrich, analyze, and effectively use in real-world scenarios. While acknowledging the significance of the data, the layer dedicated to communication networks among digital objects also stands out. This layer is important to ensuring that the different layers are interconnected, through Local Area Network or Wide Area Network. This constitutes the main conduit for information transmission and serves as the central structure for modelling applications and services that can communicate with one or several networks simultaneously. It defines how data should be used within smart city tools. In other words, the implementation of ICT, supported by a scalable network, facilitates the modulation of the construction of smart cities. 4.1.2 Scalable Network and Internet of Things Infrastructures To comprehensively address the study of human mobility within the functional architecture of a smart city, it becomes necessary to add a detailed design of a structure. This structure is engineered to accommodate a set of sensors or digital objects that interconnect and share data in real-time via a responsive communication network. Furthermore, the architecture presented in Section 4.1.1, which relies on the capabilities of ICT, is not intended as a single solution; rather, it provides an initial perspective of a viable solution needed to make a change for an application that uses the latest tools and technologies. In essence, with the incorporation of this infrastructure, the intention is for stakeholders to maximize the potential afforded by the sensor network at their disposal. Through the data harnessed by this network, solutions that acter 76 CHAPTER 4. INNOVATION AND RESEARCH to the community’s needs are envisaged. Therefore, the authors of a given article [120] propose an IoT architecture (Figure 22) that helps to understand how pedestrian-oriented applications are supported in smart cities: Figure 22: Architecture proposal for pedestrian-oriented applications. Within the IoT Device layer, two distinct sub-layers operate: the Sensing Layer and the Application Layer. In the ”sensing layer”, components like IoT Device Data and Commands for IoT Devices are encompassed. They can be independent or connected to a system that aggregates them (i.e., IoT Middleware). Human mobility sensing entails a range of sensor types, such as smartphones, smartwatches, body sensors (e.g., temperature, movement), or other wireless and/or Bluetooth-enabled devices that facilitate synchronization among mobile devices and/or transfer data. On the other hand, the Application Layer is responsible for capturing the physical environment and building applications that can be accessed through various digital platforms by pedestrians. This layer is the Human-Technology Interaction illustrated in the scheme drawn in Section 1.2.2. The IoT Middleware layer incorporates the Network Layer and allows users to control the devices individually and quickly. Although not explicitly described in the proposed architecture, the devices can communicate through different protocols (i.e., CoAP, MQTT and HTTP). REST API can facilitate the integration of other applications with the platform. Additionally, this layer serves as a central entity to support applications that use Fog and Cloud Computing architectures. Figure 22 also shows the ”Dataprocessing Layer”layer. The role of this layer is to use data collected 77 CHAPTER 4. INNOVATION AND RESEARCH from IoT sensors, and other data sources that have been sent to Fog or Cloud services. Storage provisions within this segment of the architecture facilitate the development of interfaces for pedestrian to receive information, recommendations, and suggestions. Through these interfaces, users can make informed decisions or request additional information from the application. The organization of this architecture aims that applications or services are supported by an open data model. That is, citizens must have access to applications that use real-time data from different sources, which in turn improve the overall effectiveness of city services. By opening up data and sharing information, both pedestrians and authorities can gain insights and address issues proactively, mitigating their potential escalation. Therefore, the foundation of a smart city necessitates an agile and scalable connection to integrate different data sources, enabling prompt responses to requests and/or phenomena. 4.1.3 Smart City Architecture Models Naturally, the evolution of communication technologies has prompted cities to adapt and keep citizens connected with faster access to services. The architecture that we will propose in Chapter 5 will be inspired by existing architectures and, based on the results, will allow us to better serve the different stakeholders (from the pedestrian to the ruler) within the city more effectively. One such is the LinkKiosk initiative [31, 118, 192] in New York City. These pluggable terminals provide citywide connectivity, ensuring citizens’ mobile devices remain connected. In addition to this reason, it is important for this governmental entity to connect, directly or indirectly, the environment around the user in order to become aware of ongoing phenomena and anticipate the best political decisions. With the connectivity of LinkKiosks, a pedestrian moving within the city stays up-to-date through the technological services provided by local authorities. In the context of human mobility, this showcases how a terminal can serve as a data source about its surroundings, its contribution depending on interactions with nearby tourists or citizens throughout the day. At the service level, each LinkKiosks offers a Wi-Fi hotspot with approximately a 50-meter radius, delivering internet speeds of up to 1 gigabit per second. Additionally, these kiosks provide national calling, a 911 button, mobile device charging ports, and access to maps, 311 services, and more, thereby increasing fast broadband access in many neighbourhoods of the city. Another project that offers insights relevant to your thesis involves the utilization of call logs. Harvard researchers used location or movement information derived from telecommunications data, such as Call Data Records or x-Data Records (the latter generated with a mobile device connected to the Internet; smartphone application data), vehicle Global Positioning System (GPS) devices, Bluetooth exchanges, and social network data with location information, to study population movement and the evolution of the pandemic [52]. Subsequently, the survey results were made public, ranking neighbourhoods or districts based on their mobility patterns. 78 CHAPTER 4. INNOVATION AND RESEARCH In the sensor domain, a project focused on the study of human mobility, such as PASMO project in Aveiro, Portugal, stands out. PASMO, an Open Platform for the development and experimentation of Mobility Solutions, covered road and urban areas with OVER 15 km of roads. This equipment included fixed radars and cameras, for traffic counting and classification, road and on-board communication stations, various sensors (i.e., parking lot, meteorological stations), LoRa gateways, public Wi-Fi, and Big Data Platform for IoT data aggregation [67]. To facilitate access to historical and real-time data from parking sensors and radars, an API was made available for public access. The project continues to improve, integrating new sensors, applications, and access to an experimental 5G network. Currently, the PASMO platform already supports other projects in the field of human mobility. 4.2 Participatory Sensing, Metrics and Community Patterns As already mentioned, the study of human mobility within a SC depends on the production and analysis of data sourced from diverse sensors that detect various types of information, from weather conditions to human activities in public spaces. However, the concept of a ”Smart City”can be extended to the allocation of participation civic resources through the use of digital devices [138]. While sensors tell part of the story, citizens tell the other part of the narrative that shapes a city: they know the real needs of the city and the emergence of certain phenomena. Sharing this valuable information is essential for designing a more human-centric, pedestrian-friendly urban environment, consequently enhancing the quality of life in the community [23, 124, 207, 213]. The perspective of citizens and their insights, combined with technological advancements, must be part of the process that allows them to express their concerns or needs concerning smart city initiatives. Therefore, in the study of human mobility within urban areas and with the purpose of fostering civic participation, Goldman categorized sensory participation into three different types: 1. Design and research collective: In this category, citizens are not just data collectors, but active participants throughout the investigation. They participate in the different stages of the project, contributing to the definition of the objective(s), sensing and analysis of the samples, and make decisions about data processing and management; 2. Community contribution: This category involves citizens actively participating in the data collection phase, but not necessarily being part of the group that defines the objective(s) of the investigation and manages the sensors and data infrastructure; 3. Personal use: Here, the focus is on individual self-discovery or constant improvement: the citizen engages with the technology primarily for personal benefits. 79 CHAPTER 4. INNOVATION AND RESEARCH In this investigation the individual is considered an integral part of a larger whole – an active agent within a city. That is, based on the categorization proposed by Goldman, our study aims at community contribution, which means citizens can play a pivotal role in collecting data about human mobility.. Consequently, collectively gathered data can then be made accessible to, the municipality, driving city innovation. This approach transforms citizens into key contributors to a better understanding of human mobility patterns, enabling the creation of data-driven solutions for human mobility that benefit the entire community. 4.2.1 Key Principles to Community Contribution As previously discussed, in the context of human mobility research, the SC foresees the creation of IoT and big data-connected infrastructures that offer benefits to local authorities, citizens, and companies. In addition, this approach plays an important role in addressing the ecological impact of urban centers, as optimized resources use can cater to pedestrians’ preferences and lead to cost reductions. However, the dynamics of smart cities, spanning the areas of design, organizational conception and community engagement [30, 155], consistently incorporate sensory participation grounded in five core principles: •Active Citizens: users work collectively for the common good; •Building Capacities: promoting the digital transformation of cities involves cultivating active participation and digital transition among citizens; •Build infrastructure: the construction and availability of infrastructure allows for citizen participation and impact; •Community Engagement: a community-centric approach facilitates the implementation of city solutions and acts as a catalyst for large-scale transactions; •Encourage creation and innovation: a smart city must have a dynamic community that can actively contribute to innovation and creativity. Cities that implement these principles progressively transition into as environment characterized by cutting-edge technology and dynamic citizens. In it, authorities will be able to provide free access to public data sources, fostering city innovation. Collaborative partnerships with private entities that share a mutual vision for the future of cities enable the development of data-driven services and applications tailored to the city’s requirements and its citizens [63, 217]. Cities that harness collective involvement from diverse stakeholders adopt a strategic approach to smart city development, fostering improved human mobility quality. In the next sections, we will explore solutions for cities arising from the collective contributions of citizens. 80 CHAPTER 4. INNOVATION AND RESEARCH 4.2.1.1 Participatory Sensing: a crowd-sensing paradigm The concept of SC envisions the creation of urban spaces that are not only more environmentally friendly and healthier but also capable of accommodating the rapid population growth [4]. Currently, different stakeholders are tasked with understanding how people use the city, creating better access to services through digital solutions, providing data-driven operations and supervision, and building detailed maps, such as those detailing pedestrian-perceived temperatures across different city zones. Therefore, with the objectives of smart cities in mind, a group of researchers from the University of Minho proposes a pedestrian-oriented architecture approach. This innovative framework allows citizens to actively engage in measuring both body and environmental temperatures through a dedicated mobile application [171]. Promoting people’s participation in providing relevant data for urban planning services or analysis of human behaviour patterns forms an integral part of this project. The project’s driving force was to showcase the potential of the participatory sensing paradigm—a practical example of urban sensing—in illustrating the ambient temperature in different areas of the city. Hence, the features of this paradigm can hold valuable insights for the crowd sensing needed for this scientific work. 4.2.1.2 Understanding dynamic urban areas from human behaviours perspective Supporting ”quality of life”implies a particular focus on citizens and their surroundings. Nonetheless, most smart city sensors, along with the quantitative and abstract data they produce, only tell part of the story of what is being measured [70]. The data collected by these sensors fails to elucidate how individuals perceive certain events in cities or the reason for the concentration of people in a certain area of the city; it merely informs us of their presence and reasons for being there. Therefore, this citizencentered perception, facilitated through participatory sensing services or intelligent applications, facilitates the gathering of data that enhances the comprehension of ongoing events in their surroundings. Through the collection of data concerning citizens’ perceptions, several research projects have been carried out so that the results are the subject of discussion on the phenomena of human mobility. In this project undertaken by Synthetic Intelligence group (ISLab), at Centro ALGORITMI, University of Minho, researchers make predictions of time series related to individuals’ sentiments in a certain Points of Interest (POI) of New York City by employing Machine Learning (ML) models [169]. The extensive results obtained from the dataset collected from LinkNYC Kiosk devices illustrate that the Long Short-Term Memory (LSTM) model significantly enriches the understanding of population sentiments within the analyzed location. The same group of researchers improved their investigation with additional indicators: well-being and comfort. In their publication [173], they leverage smart urban development strategies and digital tools to magnify geolocalized social issues. This research incorporates data not only from an external environment (i.e., LinkNYC Kiosk), but also from an internal environment, the Metropolitan Transportation Authority (MTA) of New York City. The integration of these datasets aims to examine the influence of comfort and 81 CHAPTER 4. INNOVATION AND RESEARCH well-being indicators on human mobility. By comparing predictions from Statistical Method (SM) and Deep Learning (DL) models using aggregated mobile data, the study reveals that Deep Neural Network (DNN) models exhibit a reduced maximum forecast error. These projects collectively illustrate that the use of technological resources, coupled with the direct or indirect contributions of citizens, help to overcome the challenges that local or governmental authorities face, whether they pertain to social, environmental, or mobility-related concerns. 4.2.2 Human Mobility Metrics Overview The data collected from participatory citizens serves as a valuable source for measuring the performance of a smart city. Along-side all the indicators enumerated in Table 1, metrics can be analyzed to address specific urban challenges or contribute to city development [117, 175, 219]. The various metrics can be examined within several contexts, detailed in the following segments: •Individual Mobility: Understanding the dynamics of individual human movements is important to understand the relationship between the effort individuals invest in travelling and the underlying purpose of those journeys. This involves several mechanisms that interact across different spatial and temporal scales [177]. Many of these mechanisms have been explained by the ”Lévy Flight”model, as formulated by the French mathematician Paul Pierre Lévy. This model has three fundamental properties: (i) similar to the Gaussian law, this model is formed by the sum of random variables; (ii) presents fluctuation processes characterized by bursts or large outliers; (iii) meets the description of random fractal processes. Therefore, this underscores that individual mobility motivations may differ due to real issues, objective circumstances, or social and environmental implications. •Collective Mobility: The study of large agglomerations of people combines aspects of long-range human mobility with location-specific pedestrian dynamics [221]. Recently, some researchers have used the Origin-Destination (O-D) matrix to investigate group mobility in a given area. Each O-D matrix corresponds to a cell associated with a trip between an origin and a destination. The density of these trips directly correlates with the density of routes. With this method, it is possible to make full use of spatio-temporal information to predict pedestrian flow based on various mobility patterns. Within the realm of smart city metrics, georeferencing data collected from millions of mobile devices assumes a prominent role. Benefitting from their widespread adoption, these metrics can be categorized based on their geographic attributes (global vs. local) and network characteristics (returner vs. explorer), yielding four distinct categories. In Figure 23, the categories of Global returner and Global explorer depict data obtained from geographically remote and dispersed sources. While in the first category, the mobility of individuals is based 82 CHAPTER 4. INNOVATION AND RESEARCH on international travel (the destination is outside the country), in the second category, international travel is still a factor, but the places visited are distributed in a more decentralized manner. Conversely, Local Returner and Local Explorer contrast with the previous categories, as the georeferenced information is not geographically remote or dispersed. The Local Returner category typically involves individuals who visit nearby locations or a frequently visited center. On the other hand, the Local Explorer category comprises places that are visited more frequently than others, despite being relatively far from each other, resulting in significant travel distances. Furthermore, the places visited in this category are less centralized. Figure 23: Network visualisation of four typical individual trajectories (adapted from [114]). Following each metric outlined in Section 2.3.3.2, a set of solutions or policies were preventively adopted. That is, many institutions, organizations, and political authorities have actively engaged with these potential solutions. Notably, a project prepared by a group of researchers from the University of Minho [174], associated with the ISLab laboratory has presented a comprehensive analysis. In its initial phase, this project introduces metrics commonly associated with human mobility. Subsequently, it compares additional metrics such as resilience, displacement, interval, and duration from different types of data (i.e., CDRs, GPS and Social Media) collected by two individuals. Another project that has been working towards the challenges of human mobility is the C2SMART Center at New York University [108]. By harnessing anonymous spatial and temporal information from mobile devices, this centre strives to estimate real-time urban populations. Using metrics, they differentiate between various types of populations, assess individual or collective mobility patterns, and quantify historically challenging-to-measure human activities. Finally, [202] quantifies the effect of a new metric on predictability and evaluate the routine of a predictably typical individual. In doing so, they employ previously proposed metrics, alongside this new metric, to understand factors influencing the predictability of an individual’s routine. Although with different purposes, to be successful, all these projects take into account the needs of all actors, especially those of citizens. As any approach aiming to improve human mobility within smart cities must be centered on the individual and transition towards collective good. 83 CHAPTER 4. INNOVATION AND RESEARCH 4.2.3 Representing Human Mobility Patterns Alongside metrics, the study of human mobility patterns constitutes another field of study that requires citizen initiative to create and implement an ecosystem of smart city solutions, ultimately generating added value for the community. This area is focused on the application of forecasting models to address urban challenges. 4.2.3.1 Deep Learning and Statistical Models As previously discussed in Section 2.4, the exploration of such patterns necessitates the creation of models capable of forecasting individual whereabouts at specific instances, along with other individual or collective phenomena. This facilitates the extraction of valuable insights, with practical applications in different contexts such as traffic management, disease contagion control, and recommendation systems in advertising and marketing [40, 133, 175, 218]. Crucially, these models operate on the premise that the abundance of data on pedestrian movement directly corresponds to the precision of the predictions. Therefore, we use a set of algorithms based on Neural Network (NN) to carry out an experimental study of human mobility patterns: •Long Short-Term Memory (LSTM): This model has a specific architecture from Recurrent Neural Network developed for sequential data forecasting. It excels in analyzing time series data over extended periods and defines optimal time intervals. The training of the model can be carried out with be univariate or multivariate data. •Convolutional Neural Network (CNN): This model is used to capture spatial patterns in data, especially in crowd flow prediction where the distribution of people in a geographic region is represented as an image. •Convolutional Neural Network-Long Short Term memory (CNN-LSTM): This model combines the ability of CNN to process population movement maps and the ability of LSTM to handle sequences. This amalgamation facilitates the swift calculation of the downstream flow through maps and the upstream flow sequence. •Bidirectional LSTM (BLSTM): This model applies the concept of incremental learning and deals with long-range contextual processing. In addition, compared to Unidirectional LSTM, it tends to show better accuracy results in recognizing human activity [169]. •Stacked LSTM (SLSTM): This model acts as a reliable technique in solving prediction problems in human mobility. Its architecture consists of multiple LSTM layers, where each layer produces string outputs, rather than single-valued outputs, which are then employed by subsequent LSTM 84 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.1.1 Materials and Methods We used a sample spanning the last 3 years, between 2016 and 2018, with a monthly interval of 1. The original dataset consisted of the count of registered individuals at specific kiosks for each day of the month, within a 12-hour interval. As a result, we had a set of 1739 links measured between 01-2016 and 12-2018, located in different locations across New York City (Table 4). Borough Date Location Census Temp (◦C) Humidity (%) Precip Press (Pa) Dew-point (◦F) Wind (MPH) 1 2018-02-12 (40.71, -73.95) 514260 12 50.3 0 30.3 13 2 2 2018-05-17 (40.85, -74.10) 2208318 14 59.8 0 29.9 12 2 1 2018-03-08 (40.71, -73.95) 3387972 13 61.2 0 30.6 11 3 Note: We ignored Wi-Fi, Tablet and Phone features because they present constant values. Table 4: LinkNYC Kiosks locations dataset. The collected data provides a wealth of insights. It not only allows us to detect devices within specific areas but also facilitates the monitoring of human activity. Furthermore, the data grants us control over authorized individuals connecting to these devices, and by utilizing multiple Wi-Fi sensors, we gain the capability to track real-time movement. Additionally, these findings are further refined through pre-processing techniques. During the data pre-processing phase, data gathering methods are often loosely controlled, resulting in missing attribute values (e.g., install date, active date) or certain attributes of interest (e.g., Wi-Fi status, Tablet status, Phone status), impossible data combinations (e.g., install date: yes; activate date: yes), or data only presented in aggregated form. Thus, a thorough analysis of data quality and representation is essential prior to conducting any analysis. For pre-processing we are encouraged to use a list of tools but assuming that data pre-processing has three main components like extraction, transformation and loading, we opted for the KNIME [194]. As we mentioned in Section 2.4.2.3, this open-source data analytics, reporting, and integration platform gives us a graphical user interface to allow for the assembly of nodes for data processing. It encompasses modular data pipelining, leveraging ML and Data Mining (DM) concepts, and is versatile for building business intelligence reports. Figure 24 shows the workflow of data precessing. Figure 24: The process of data pre-processing. 91 CHAPTER 5. DESIGN AND IMPLEMENTATION In the first nodes are responsible for importing the original data from the LinkNYC Kiosks and Weather Conditions Comma-Separated Values (CSV) files. Since there are missing values in the imported data, these are excluded in node 1. In Node 5, the data gaps in weather information are addressed by filling them with the most frequent value. Node 2 trims the dataset to include only the most important columns, specifically 𝐵𝑜𝑟𝑜𝑢𝑔ℎ,𝐷𝑎𝑡𝑒,𝐿𝑜𝑐𝑎𝑡𝑖𝑜𝑛, and𝐶𝑒𝑛𝑠𝑢𝑠. Node 3 and node 6 serve to standardize the column names across both datasets. In node 4 and node 7, the process changes the date format to facilitate data aggregation. Node 8 conducts the calculation of feature importance, an essential phase where datasets are merged based on the date. At the same time, it filters the unnecessary columns to reduce the noise. In node 10, the outcome includes the calculation of the number of people living in a particular place by data aggregation such as region, geo-coordinates, and date, calculating the mean for all numeric features (e.g., temperature, humidity). Notably, this calculation takes place postcategorical to numerical conversion (e.g., weather description), in node 9. Node 11 converts the date string to datetime format. In node 12, the process extracts the datetime fields to 𝑌𝑒𝑎𝑟 and 𝑀𝑜𝑛𝑡ℎ(𝑜𝑓 𝑌𝑒𝑎𝑟). Prior to data export, a final adjustment to the columns and the removal of redundant features from the merged data is performed. Node 16 writes the samples into a CSV file in order to use the Deep Learning (DL) algorithms. During feature extraction, census figures within the same time interval are summed, and a distance threshold is applied, taking into consideration the maximum length of each borough for better visualization. Points mapped to the same street are unified under one density colour, and the location is illustrated through the density colour segment. To enhance clarity, after the feature extraction, the location sequence is represented between blue and green points. The visualization output is depicted on the map showcased in Figure 25. Figure 25: Density of tracked people in New York City and the city of Manhattan via LinkNYC kiosks over the past 3 years. We solely consider filtered data from the city of Manhattan to evaluate human mobility predictions. As detailed in Section 5.1.2, we transform the LinkNYC kiosks dataset to render it compatible with the Long Short-Term Memory (LSTM), Convolutional Neural Network (CNN) and Convolutional Neural Network-Long Short Term memory (CNN-LSTM) models. Firstly, we split the supervised data into two matrices: the 92 CHAPTER 5. DESIGN AND IMPLEMENTATION training matrix 𝑋, encompassing the first 24 months, and the testing matrix 𝑌, containing the remaining data. Matrix 𝑋facilitates model training, while 𝑌is used to evaluate and validate its accuracy. Just as with the training set, we need to scale our test data. Subsequently, we use Keras library to build and train our model. The exploration of user patterns involves an analysis of data trends over a specific time span. As exemplified in Table 4, the number of people who access the kiosk located at lat 40.71 and long -73.95 varies in different time series. The utilization of time series data is recommended for the prediction of the future value of an item based on its past values, with the help of DL algorithms like LSTM and CNN. We will be predicting the future number of people in New York City based on the number of tracked people via LinkNYC kiosks over the past 3 years. The calculations were conducted within the Python environment using the main packages pandas,sklearn,numpy,keras,matplotlib,seaborn. Figure 26 shows typical time series graphs depicting kiosk foot traffic, with values normalized using log10 units. Figure 26: Number of tracked people via LinkNYC kiosks over the past 3 years. The depicted trend exhibits a pronounced non-linear nature, characterized by its multiscale and longrange dependence. Capturing this intricate trend proves to be a challenging endeavor with the available information. Hence, the requirement for an apt model for time series forecasting becomes evident. This is where the combined power of CNN and LSTM (or CNN-LSTM model) comes into play. While the former is adept at forward-looking predictions through its self-learning method, ensuring more realistic forecasts, the latter excels in memorizing past data, facilitating the prediction of tracked foot traffic over an extended sequence of time steps. 5.1.2 Experimental Protocol To robustly assess the accuracy of the prediction model, the Root Mean Square Error (RMSE) metric proves invaluable. The main benefit of using RMSE is that it penalizes large errors. Moreover, its score scaling aligns with the forecast values’ units (i.e., per month, for this study). After, we repeat the model construction and prediction several times. The average RMSE is an indication of how well our configuration would 93 CHAPTER 5. DESIGN AND IMPLEMENTATION be expected to perform on unseen real-world LinkNYC kiosks data. Finally, we compare our predictions with actual trends in human mobility which can be inferred from historical data. The LSTM model was trained with an 80 batch size, 100 nodes, 200 epochs, and Adam optimization. Moreover, to develop a robust result, we repeat the experiment 20 times, a number deemed sufficient to provide a good distribution of RMSE scores. The outcome comprises a line plot that juxtaposes the test data (blue) and the predicted values (red), contextualizing the model’s skill. Additionally, a box-and-whisker plot encapsulating the distribution is presented for further visualization. Figure 27: Plot of Loss on the Train and Test datasets and Root Mean Square Error score in a box and whisker plot from LSTM model. As observed in Figure 27, the left side shows the printing of train and test loss after each training epoch; the right side summarizes the distribution of RMSE scores. The first chart is important for predicting human mobility based on the train-line chart and test-line chart results. Interestingly, we can see that the test loss drops below the training loss, potentially indicating the model’s overfitting to the training data. To be more precise, the chart exhibits a substantial exponential reduction up until the 30th epoch, where—after 50 epochs—the lines tend to run parallel. Concerning the measurement and plotting of RMSE during training, as outlined in Table 5, we can see that the mean and standard deviation stand at 106.16 and 100.04 respectively for the monthly number of connected individuals. Correspondingly, the RMSE value tallies at 100.18. Furthermore, it shows that this model is the second lowest among the human mobility RMSE chart representations. In the CNN algorithm, we develop a suite of CNN models with layers, represented in Figure 28. In other words, we choose an one-dimensional CNN design, featuring a convolutional hidden layer that operates over a 1D sequence. This is followed by a potential pooling layer, responsible for condensing the convolutional layer’s output to essential elements. Subsequently, the convolutional and pooling layers are followed by a dense fully connected layer which interprets the features extracted by the convolutional part of the model. A flat layer serves as an intermediary between the convolutional layers and the dense layer, reducing the feature maps into a single one-dimensional vector. 94 CHAPTER 5. DESIGN AND IMPLEMENTATION Figure 28: Plot of Loss on the Train and Test datasets and Root Mean Square Error score in a box and whisker plot from CNN model. Training data involves 64 filters, 5 kernel sizes, 80 batch sizes, and 200 epochs. To find a good result, the experiment is repeated the same number of times as the previous model. Evaluating the out-of-sample results, they are gauged by the 100.23 RMSE, alongside a mean of 106.02 and a standard deviation of 100.05. As a result, we see in Figure 28 that the model chart has a worse performance than that of the LSTM chart. This illustrates the superiority of LSTM model over the CNN model in the context of predicting human mobility. For a mixed CNN-LSTM model, we define the CNN model first, then add it to the LSTM model by wrapping the entire sequence of CNN layers within a TimeDistributed layer. The idea is to merge the two models, creating a third model. Through experiments with this fusion model, we can draw performance comparisons. The construction of this model assumes that the parameters used are the same as the previous models. Figure 29: Plot of Loss on the Train and Test datasets and Root Mean Square Error score in a box and whisker plot from CNN-LSTM model. The loss values represented in Figure 29 show that there is a good overfit model up to 125 epochs. During this period, the model presents good performance on the training set, steadily improving and 95 CHAPTER 5. DESIGN AND IMPLEMENTATION resulting in a decrease in RMSE. Simultaneously, the model’s performance on the validation set demonstrates initial improvement followed by degradation. Next, we check which model is more appropriate for predicting human mobility. Transitioning to Section 5.1.3, our approach involves dissecting the models, first the LSTM model, followed by the CNN model, and finally the CNN-LSTM model approach. The objective is to provide the best model for time series forecasting of our survey. 5.1.3 Preliminary Results and Discussion Our survey findings are concisely summarized in Table 5, offering an overview of out-of-sample results of experiments with human mobility density in the city of Manhattan. We evaluated three different models. First, we determined the RMSE using the LSTM model to predict human mobility. Second, we showed that the CNN model performs worse than LSTM and CNN-LSTM models. Lastly, we needed to make sure that our proposed merged CNN-LSTM model is meaningful. Thus, such as in previous results, we resort again to the RMSE equation but add other performance metrics. Model LSTM CNN CNN-LSTM Mean 6.16 6.02 6.14 Standard deviation 0.04 0.05 0.10 Minimum 6.07 5.93 6.02 Maximum 6.29 6.07 6.21 Accuracy∗ 𝑇=25 (%) 6.00 5.97 6.10 Accuracy∗ 𝑇=50 (%) 6.02 6.02 6.18 Accuracy∗ 𝑇=75 (%) 6.05 6.01 6.20 RMSE (𝑙𝑜𝑔10)0.18 0.23 0.14 * Train set size percentage. Table 5: The human mobility modeling results (best values in bold). The results reveal a general trend of improved prediction accuracy across all three models as the dataset size increases. In terms of model comparison based solely on metrics, the out-of-sample outcomes indicate that the CNN-LSTM surpasses both the LSTM and CNN models in accuracy and the variation between maximum and minimum values. This validates our proposed CNN-LSTM model as a superior choice, demonstrating heightened accuracy compared to the other models. 5.2 The WalkingStreet Platform: Project Plan The WalkingStreet platform is designed to make use of human mobility in a computing environment. Built upon the architecture of Mobility as a Service (MaaS), this platform is composed of different components, 96 CHAPTER 5. DESIGN AND IMPLEMENTATION each contributing to a specific step in the workflow. This workflow is characterized by the involvement and process of sensor infrastructure, data acquisition, treatment and storage of data via fusion method, data acquisition based on the performance of mining and modelling data, the integration process of compatible services, including predictable data, and its interpretation, explanation, and visualization in explainable data. Predictive and explainable processes are executed using sophisticated DL methods hosted on the MaaS core. Within the SC assessment system, these and other tasks focusing on human mobility, are analyzed by measuring a set of key human mobility metrics. These metrics are are also showcased in practical examples provided for a comprehensive investigation of their properties and potentialities, although, they were designed to be also used in generic applications. However, the degree of citizen participation can significantly impact the outcomes, as many implementations rely on metrics influenced directly by the level and quality of user engagement. Therefore, this MaaS platform has a generic structure, customizable for specific applications, and is open to the active participation of different players. This platform operates as an intelligent environment, with certain core modules functioning independently of firect user control. This autonomy extends from a dense sensor network embedded in physical objects and infrastructures to background processes such as ML models or XAI methodologies. Additionally, these components are developed for continuous adjustment to user requirements and environmental conditions. This means that the adjustment process often begins with the collection of user environment data, behavioural monitoring, as well as other associated workflows. This MaaS project, beyond its adaptability for different functions, it also authorizes the installation of external devices, even those not initially envisioned by the developer but introduced by users. Additionally, its open architecture enables data exchange between multi-device applications, without proprietary restrictions. This seamless communication across heterogeneous systems is only possible through unlocked network capabilities with other domains, such as cloud and web services. This means that this open approach adopts an interoperable infrastructure capable of aggregating bulk data from diverse domains and tailoring them to specific urban scenarios. The architectural overview, main components, and additional services of this MaaS application are described in the following sections. This Proof of Concept (PoC) needs to be built using available technologies or deliver value to various human mobility actors. From the specification of individual sensors for detecting and responding to some type of input from the physical environment to the modules for metric analysis and predictive modeling that generate humanreadable outputs, this platform encompasses a comprehensive data storage system and interpretable policies. These collectively facilitate the understanding and explanation human mobility phenomena based on Artificial Intelligence (AI) outputs. The chapter concludes by illustrating how the research was conducted and the PoC deployed. 97 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.2.1 Architecture Overview The elucidation of smart human mobility elements in Chapter 4 resulted in the conceptualization of the WalkingStreet platform. This platform combines structures from a hub technology with an infrastructure for information acquisition, sensing, and tracking supported by a sensor network architecture, exploratory analysis of human mobility data employing a set of metrics, the engagement of smart device users in participatory sensing tasks to derive value-sensitive applications, and the integration of XAI to make an AI platform more transparent and understandable to end-users. The selected software development approach breaks the process of developing this platform application into modular units. Each module represents the whole iteration development process. With the core platform module, the AI system resides, alongside an API service defined by a set of protocols and access permissions based on user roles, as well as a data storage infrastructure. Other modules can function independently or dynamically combine as needed. Moreover, this development approach specifically recognizes that modules will require adjustments over time, with these considered integral to the platform’s lifecycle. It particularly emphasizes the organization and integration of different developments into system integration modules, where hardware is an essential part of the solution. For example, it involves creating an intelligent module focused on data-driven decision-making [62]. This leads to gathering all relevant available data and then implementing modern tools for monitoring and assessing different human mobility indicators [200]. Figure 30 illustrates the physical representation of the WalkingStreet platform. Figure 30: WalkingStreet components platform. 98 CHAPTER 5. DESIGN AND IMPLEMENTATION At the infrastructure level, this platform intends to collect human mobility information from different sensor network sources, such as individual data sources like smartwatches, tablets, smartphones, and more (referred to as People as Sensors), as well as community-level data sources (e.g., Public Information Displays, Interactive Urban Connectivity, etc.). Each sensor requires fast and reliable connectivity to efficiently contribute raw data, which is then stored in local servers (or decentralized modules). These decentralized modules manage data communication between sensors (or devices) and the local servers within a sophisticated network infrastructure. Each local server is accessible remotely through a central server (or core module) via a REST API. This server centralizes all data, including personal user-to-environment information generated at each local server. Additionally, leveraging the capabilities of a fog computing architecture, the central server sends the consolidated data to a cloud-based server. Then, in a cloud environment, AI-Driven Big Data is processed and made accessible through restful web services and APIs, providing services related to human mobility for the city. At the application level, the core module takes advantage of infrastructure-level technologies to support efficient sensor data aggregation mechanisms and semantic web technologies for unified data representation. Simultaneously, an ML kit on a cloud server employs predictive mechanisms and renders outcomes that are explainable and comprehensible to end-users. Moreover, this explicability can be manages through an authentication system or made openly accessible to encourage community collaboration and knowledge sharing regarding intelligent solutions. 5.2.2 Decentralized Module As depicted in Figure 30, the decentralized module includes a multi-sensor network system that operates at both individual data and community data levels. In this system, each group of sensors located in various positions transmit data to a local server, where this data is stored. Furthermore, the server can be accessed by multiple external applications via web servers. To provide a user-friendly interface for viewing and analyzing stored data, a web application is also included in this module. As discussed in Section 2.2.2, the sensor network is an important module to support any server application, ranging from monitoring a single device, such as a smartphone, to tracking different modes of transportation or interactive public displays. In other words, these sensors facilitate the monitoring of the environment. Moreover, they are responsible for ensuring the privacy and security of the targeted public data. To achieve this, communication protocols are developed by establishing a connection between the sensor and the local server. The following sub-sections detail the architecture and features, communication, and storage within the decentralized module. 99 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.2.2.1 Components and integration As previously mentioned, SiteWhere employs a fully distributed architecture using Kubernetes and a variety of micro-services to construct the system. Figure 31 illustrates how these micro-services enable well-defined interactions between multiple areas of the system, facilitating independent scaling of individual functional areas or their exclusion as needed. Moreover, Istio provides a service mesh for the system’s micro-services, providing a more robust, fault-tolerant system, and providing detailed monitoring and tracing of data flow between micro-services [100]. Figure 31: Local server architecture (central server transition). SiteWhere also includes technologies such as Apache Zookeeper. Its configuration management is centralized, but it can be externalized for scalable configuration management. ZooKeeper also contains a hierarchical structure that represents configuration data for one or more SiteWhere instances, with this configuration data being replicated across all micro-services. For scalable storage, SiteWhere uses Rook.io. Rook distributes and replicates block storage, making it resilient to hardware failures. As storage and throughput requirements increase over time, new storage devices can be dynamically added. This platform also supports various databases including MongoDB, InfluxDB, Cassandra, and other supporting technologies such as Message Queuing Telemetry Transport (MQTT) brokers. To facilitate data movement between micro-services, SiteWhere uses Apache Kafka. Micro-services process data asynchronously through pipelines, reading data from well-known inbound topics, processing 100 CHAPTER 5. DESIGN AND IMPLEMENTATION we calculate some of the fundamental representations used to characterize human mobility and extract relevant information from the data storage. Interpretable and Explainable Intelligent Environment As previously mentioned, these XAI models are important for end-users to have a full understanding of the AI decision-making processes. The models proposed in Section 2.5.2 are crucial for promoting AI explainability while assessing the human mobility impact of using such algorithms, helping stakeholders understand the behaviours of AI models. models. By displaying positive and negative values, we intend for these models to generate real-time explanation model evaluations. This means that the WalkingStreet platform will generate feature attributions for model predictions, enabling users to visually explore model behaviour through interactive charts. 5.2.3.4 Sync Cloud Engine This sync process works by aligning data, which is primarily (managed by the Data Storage micro-service, with a predefined set of queries, and subsequently transmitting this data to a cloud server. In addition, it can compare, analyze, and synchronize data schemas, streamlining group collaboration and refining query results. The synchronization process is also automated via a Config file. As previously mentioned, this project has at least two distinct server environments: one local and one in the cloud. The same duality is mirrored in the database infrastructures. Initially, data is stored in a MySQL database and then stored in a cloud-based database. Thus, to facilitate the maintenance of the cloud database, it is advisable to conduct periodic synchronizations with the local database. This entails the centralization of data from numerous local databases into the cloud database. From a synchronization methodology perspective, this micro-service assures data availability and accuracy. Over time, MySQL databases will have scenarios in which database schema and data should be synchronized with the cloud server. When this happens, the SyncCloudEngine tool can be used, configured with a specific time range for job execution. In essence, this proposed micro-service is responsible for managing the new content to ensure synchronization with a centralized repository, like a cloud server. Moreover, it supports a synchronization mechanism that is based on timing and includes a transaction queue to address situation in which many users attempt to access the shared data concurrently. These approaches are designed to mitigate issues related to data consistency when multiple users and devices interact with shared data across diverse environments. 5.2.3.5 REST API This container plays a crucial role in interacting with the Data Storage module. In other words, its primary responsibility is to facilitate the transmission of data from the Data Storage micro-service to the Client, 107 CHAPTER 5. DESIGN AND IMPLEMENTATION without giving the user direct access to stored data content. Essentially, it serves as the server-side component of a Front-End End micro-service, encompassing all the aspects that the user doesn’t see [210]. Moreover, it empowers the web application that is based on the Front-End. As shown in Figure 35, the communication between the Front-End and Back-End is implemented using a REST API. Figure 35: REST API application architecture with Spring Boot. On the front-end side, HTTP Client communicates with the Back-End, which handles these HTTP requests through a Spring REST Controller. The Angular application on the front-end side creates a fully -functional User Interface (UI) that enables users to manage posts, including tasks like (adding, editing, and searching). Thus, this REST API service delivers relevant information about the health database. The requests are prepared to be translate into a format that clients can easily interpret, offering insights into metrics and predictions that have been previously calculated by the AI Engine and XAI Engine, in addition to other parameters that may be relevant to understand the remaining stored data in the Data Storage. All data is securely stored in the PostgreSQL database and is integrated into the application using a repository that is implemented from an abstraction of data persistence (i.e., Data Access Object). 5.2.3.6 Front-End This micro-service hosts a website that functions as a back office for administration. It provides users with the tools to efficiently manage the stored data. The website is developed in Angular, and is tightly integrated with the Back-End are connected with each other through a REST API micro-service structured in Java Spring Boot code. 108 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.2.4 Cloud Module In addition to the core module, the WalkingStreet platform includes a complementary module known as the Cloud Server. This module is hosted on the Google Cloud Platform and leverages the Internet to store, manage, process, and integrate data collection from different remote local server sources for future use. Additionally, the Cloud Server can facilitate the integration of several applications, optimizing cloud computing-related business processes. Real-time dataset integration is employed to facilitate data exchanges among the components illustrated in Figure 36 that are involved. Figure 36: Cloud server architecture (central server transition). The architecture of the Cloud Server is designed to integrates applications, improve workflows, and store insight-based data models. These models encompass predictions of future behaviour using AI and ML, as well as their explainability through XAI. This setup modernizes, the infrastructure of the platform, allowing to remain adaptable and scalable. Cloud-based servers offer virtually unlimited scalability in terms of increasing storage space and provide a stable environment for any component, in which any issue detected remoting doesn’t affect another person co-renting the server. Furthermore, as a service offered by a third-party, users can access a series of resources accessible on the cloud from anywhere, enabling fully online operations. 5.2.4.1 Stream Processing The WalkingStreet platform comprises independent modules, and to facilitate their development, deployment, and maintenance, the architecture of the cloud server incorporates several blocks. One of these key blocks is the Google Cloud Publish (Pub)/Subscribe (Sub) block, which serves to disseminate messages asynchronously across different parts of systems, specifically within a cloud server. In other words, the Pub/Sub allows messages to flow between different system components without these components needing to know each other’s identities. Our simulator will read data from the events table in Cloud SQL and then publish messages to Cloud Pub/Sub. The architecture of this messaging system is shown in Figure 37. 109 CHAPTER 5. DESIGN AND IMPLEMENTATION Figure 37: Google Cloud Pub/Sub architecture. The Pub/Sub functionality is used for streaming processing and data integration pipelines in Cloud Server Architecture. It operates as a message-oriented middleware for services integration and establishes a framework involving event producers and consumers known as publishers and subscribers. Compared to older design patterns like message queuing and event brokers, Pub/Sub is more versatile and scalable. This stream processing tool handles data from multiple sources and streams it simultaneously to Cloud SQL databases. 5.2.4.2 Cloud SQL Sync App This micro-service primarily focuses on synchronizing Pub/Sub information with Cloud SQL. From a structural viewpoint, this module contains a set of Continuous Integration/Continuous Deployment pipelines responsible for publishing events. These events are then subscribed to and acted upon by other services. However, its primary role lies in data processing. When a Local Server places information on the Data Storage (hosted on the Central Server), the Sync Cloud Engine service comes into play. It synchronizes the information, carries out some preliminary processing, and then sends the event to Google Cloud Pub/Sub. Within the Cloud Server environment, the Cloud SQL Sync service, subscribed to the events generated by the Sync Cloud Engine service, starts the synchronizing process for the information with Cloud SQL. Thus, this micro-service extends cloud support for the existing modular data processing infrastructure. To summarise, the Cloud SQL Sync app is deployed on Google Kubernetes Engine (GKE), where it connects to a Cloud SQL database. 110 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.2.4.3 Cloud SQL Cloud SQL of Google Cloud Platform (GCP) is a fully managed relational database service for PostgreSQL, boasting a wide range of configuration flags and developer ecosystems. One of the standout features that makes it an integral part of the Cloud Server architecture is its graphical User Interface. This interface simplifies the process of creating a database instance, including setting up a network firewall, as well as storing and managing data with a high level of security [54]. However, although Cloud SQL supports private connectivity through Virtual Private Cloud, it also allows public network access to database instances. WalkingStreet architecture allows real-time data pipelines for Google Cloud SQL. These pipelines facilitate low-impact, real-time data ingestion from several on-premises to cloud systems. This process is executed and logged without causing downtime or data loss. It serves the purpose of offloading operational workloads to GCP, ensuring that data is available at the right time and in the right format for operational decisionmaking. 5.2.4.4 Back-End and Front-End App As depicted in Figure 38, these services collectively create an infrastructure that allows web and mobile applications to connect to backend cloud storage (i.e., Cloud SQL service). This infrastructure offers a range of features such as user management, instant messaging, remote updating, and hosting, to name a few. In addition, it provides a highly flexible environment with minimal interface restrictions and a large stack of resources to build a variety of applications and appropriate widget integration. Therefore, the Back-End and Front-End services within the Cloud Server are characterized by their flexibility. Figure 38: Back-End and Front-End architecture. Inspired by Backend-as-a-Service (BaaS) service, the API micro-service serves as a third-party service that offers several advantages over Front-End development. It provides an additional layer of security during information exchange and manages infrastructures around data and resources. This cloud-based microservice operates at scale, bringing together the proper resources into meaningful sets. This allows for 111 CHAPTER 5. DESIGN AND IMPLEMENTATION efficient application development without the need to source individual components from around the web and other information repositories. On the other hand, the Front-End micro-service is the user-facing part of the cloud computing architecture. This is where end-users interacts with cloud computing. It includes a web browser that allows users to access the data provided by the Back-End architecture as a whole. At the applicability level, the architecture can leverage serverless applications or Functions as a Service (FaaS), due to their auto-scaling capabilities, cost-effectiveness, and flexibility. However, as with other similar projects, the main components of this micro-service are made up of three parts: •User Interface: In this component, end-users directly interact with the cloud system.s It encompasses all the elements that end-users access to send requests or perform any task in the Cloud Server. •Software: This component runs from the user’s side and often takes the form of a web browser application. In fact, it is the software that runs on the user’s device to enable interaction with the cloud-based resources. •Client Device or Network: These client-side components are integral to the front-end architecture and include the client-side hardware, such as the user’s PC or other devices. These devices do, not require exceptional processing capabilities, as most of the heavy lifting happens on the cloud server. The separation between Back-End and Front-End applications allow for scalability. When the system needs to migrate to a different database or change API-based BAAS endpoints, it can do so without disrupting data consistency. In addition, it enables the seamless switching of Front-End frameworks. Finally, this setup also ensures that cloud computing services can be accessed across multiple platforms, offering these services to end-users via public networks. 5.3 The WalkingStreet Platform: Implementation Plan In the implementation phase of the WalkingStreet platform, we present a detailed description of the data flow, from the data capture process to the end user. This step is crucial as it transforms our project plan (Section 5.2) into actionable steps to achieve the goals of this thesis. In fact, it serves as the where we execute the planned strategy, outlining the tasks needed to complete the project, identifying necessary resources, and ensuring alignment with our strategic goals [109]. Therefore, while data capture is a standard procedure for many data sources, such as private or public platforms, tendering innovative human mobility products often requires careful consideration of the local, core, and cloud environments. This is essential to ensure the successful launch of this novel service, like MaaS, and its adoption by stakeholders. This is the main goal of our implementation plan. 112 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.3.1 Decentralized Module As we mentioned in Section 5.2.2, this module represents the deepest node within the WalkingStreet architecture. In detail, it is characterized by its granularity, containing a network of devices and REST API services linked to the edge of the local server, web server software, databases, and various tools designed to handle remote requests. These remote entities are also supported by a solid IoT infrastructure, which is physically located elsewhere. Thus, the local server establishes separate connections to the services and machines, with their identities determined by configuring files. In essence, all configurations for connected clients are centrally managed, ensuring secure remote access to these services and devices. In Section 5.2.1, the local server interconnects different types of smart applications (or devices), such as smartwatches, smartphones, or a Web Server hosted on a remote server (Section 2.2.1). These sensors and technologies create the infrastructure upon which the IoT thrives. They gather sensory information and monitor changes in local environments, measuring specific parameters related to their physical surroundings, and producing outputs, often in the form of electrical signals, for further processing. This section provides a fundamental understanding of which sensors and servers work and what roles they will fulfill within the local server. This local server hosts a SiteWhere (version 2.0) platform. Therefore, the following sections outline the implementation flow and communication between these diverse devices and this platform. 5.3.1.1 SiteWhere on Docker SiteWhere 2.0 adopts Docker as its core deployment model, streamlining the installation of the application into a container for efficient resource deployment. In addition, Docker simplifies the process by allowing all micro-services to be deployed collectively, eliminating the need for manual individual deployments. For local installations, Docker Compose is a convenient tool, providing a straightforward method for deploying the entire service in one go, while also aggregating logs to facilitate easier debugging. Thus, the SiteWhere 2.0 recipe acts as a starting point for building instances. Once cloned, one can access the sitewhererecipes/docker-compose sub-directory, which contains configurations for the SiteWhere 1deployment scenario. 5.3.1.2 Remote Server In Figure 31, we discussed the integration of IoT devices into the WalkingStreet platform using the Site- Where infrastructure. This infrastructure is hosted on a remote server, situated outside the scope of the elements that comprise the proposed thesis platform. The SiteWhere application is designed to manage 1Command line to clone of the SiteWhere repository: git clone https://github.com/sitewhere/ sitewhere-recipes.git 113 CHAPTER 5. DESIGN AND IMPLEMENTATION extensive sensor deployments and facilitate the seamless addition of new devices. It introduces microservices, where each one is a Spring Boot application encapsulated within a Docker container, specializing in a specific task. Many of the process pipelines are supported by Apache Kafka. In addition, certain microservices can access external service functionalities solely only via well-defined API. Below is an example, presented in Listing 1, demonstrating the creation of a new device endpoint: Listing 1: Request and response for the creation of a new device. 1PATH: /devices 2METHOD: POST 3REQUEST BODY SCHEMA: application/json 4{ 5”comments”: ”string”, 6”deviceElementMappings”: [ 7{ 8”deviceElementSchemaPath”: ”string”, 9”deviceToken”: ”string” 10 } 11 ], 12 ”deviceTypeToken”: ”string”, 13 ”metadata”: { 14 ”property1”: ”string”, 15 ”property2”: ”string” 16 }, 17 ”parentDeviceToken”: ”string”, 18 ”removeParentHardwareId”: true, 19 ”status”: ”string”, 20 ”token”: ”string” 21 } 22 23 RESPONSE SCHEMA: 24 { 25 ”comments”: ”string”, 26 ”deviceElementMappings”: [ 27 { 28 ”deviceElementSchemaPath”: ”string”, 29 ”deviceToken”: ”string” 30 } 31 ], 32 ”deviceTypeToken”: ”string”, 33 ”metadata”: { 34 ”property1”: ”string”, 35 ”property2”: ”string” 36 }, 114 CHAPTER 5. DESIGN AND IMPLEMENTATION 37 ”parentDeviceToken”: ”string”, 38 ”removeParentHardwareId”: true, 39 ”status”: ”string”, 40 ”token”: ”string” 41 } An alternative communication method supported by SiteWhere for handling device events is the MQTT protocol, using JavaScript Object Notation (JSON) format. In the example provided, payloads are published to the MQTT topic and transmitted as JSON as per the tenant configuration. The Listing 2 illustrates an example of sending a device location: Listing 2: Registering device location. 1{ 2”type”: ”string”, 3”originator”: ”string”, 4”deviceToken”: ”string”, 5”request”: { 6”latitude”: ”double”, 7”longitude”: ”double”, 8”elevation”: ”integer”, 9”updateState”: boolean, 10 ”eventDate”: ”timestamp” 11 } 12 } The JSON object contains fields such as 𝑡𝑦𝑝𝑒, which provides a description of the device location, latitude, longitude, elevation of the location, and updateState, which, when set to true, updates the DeviceState of the assignment, as well as eventDate and associated metadata for the event. The Android app serves as an IoT gateway and/or client device for SiteWhere. If configured as an IoT gateway, it can send location and measurement events and register the Android device. When operating as an IoT client, it can receive real-time event pushes from SiteWhere. The configuration for pushing data to a specific device is done using server-side filters and Groovy scripts. From an infrastructure perspective, this remote platform deploys and orchestrates micro-services from a set of Kubernete infrastructures, ensuring highly-availability in a distributed system. These kinds of infrastructures can be deployed on-premise or on various cloud services like Microsoft Azure, Amazon Web- Service, Google Cloud, or OpenShift. To simplify installation and configuration, Helm is used to supply both the micro-services and the necessary dependencies for a complete SiteWhere deployment. Additionally, there is an administrative application based on Electron that remotely manages SiteWhere instances. 115 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.3.1.3 Open-Source API Services While the previous paragraph focuses on data communication elements between a remote device and a local server, this one groups a set of open-Source REST API designed to support the monitoring of human mobility conditions. Some of these services, as presented in Section 2.4.3.1, involve sharing data either through nodes that consolidate information at a remote server. This server acts as a centralized point, connecting local sensors and hosting a REST API Infrastructure. As we mentioned in Section 5.2.2.2, other experimental environments can be an opportunity to engage citizens in the human mobility information that is used by multiple stakeholders. One such environments has been the subject of study in various scientific articles. We believe that every citizen can benefit from Open Data and Open Data can benefit every. An example of this is the New York City (NYC) Open Data service, managed by the Open Data Team at the NYC Office of Technology and Innovation. This service offers a wealth of datasets covering many aspects of life in New York City, ranging from the New York Police Department (NYPD) to the Metropolitan Transportation Authority (MTA). These datasets are accessed through the Socrata Open Data Application Programming Interface (SODA). This API identifies and retrieves data from the NYC OpenData platform by, applying filters stacking parameters in the Uniform Resource Locator (URL) and Socrata Query Language (SoQL) queries to search and change the results. For example, one can filter the Bicycle Counters dataset using a query similar to Listing 3. Listing 3: Parameters and response for bicycle counts. 1DATA_URL: ”data.cityofnewyork.us” 2DATA_SET: ”uczf-rk3c” 3APP_TOKEN: ”app token created” 4 5RESPONSE SCHEMA: 6[ 7{ 8”countid”: ”10014848”, 9”id”: ”100009425”, 10 ”date”: ”2022-06-24T00:00:00.000”, 11 ”counts”: ”15”, 12 ”status”: ”0” 13 }, 14 { 15 ”countid”: ”10014849”, 16 ”id”: ”100009425”, 17 ”date”: ”2022-06-24T00:15:00.000”, 18 ”counts”: ”12”, 19 ”status”: ”0” 20 } 21 ] 116 CHAPTER 5. DESIGN AND IMPLEMENTATION 5.3.3 Cloud Module This module centralizes all information from multiple Central Servers. As discussed in Section 5.2.4, it allows for the creation of multiple Pub/Sub clients during the Stream Processing step. In this step, Java uses separate client classes for each Pub/Sub server connection, which are then used to create clients for both publishing and subscription. Thus, stream processing enables applications to collect and process data immediately as it’s generated. As mentioned in Section 5.2.4, this module also leverages the Java Spring language for micro-services, Kubernetes, and the cloud using Pipeline. For an application server, the GCP lets Kubernetes resize clusters based on different metrics and resource requests. At the micro-service level, the Cloud Server also provides a listener annotation to convert incoming messages without the need to specify the content type of an input channel. During the dispatching process, methods with this annotation automatically apply the message where it is required. After passing through the preceding architecture components, the data is stored in the database service for later access by all end users. This access is only possible from the other two platforms within the cloud architecture: Back-End and Front-End. These cloud infrastructures support everything that the end-user interacts with, forming an essential part of how end-users connects to the cloud computing infrastructure. Subsequent sections provide detailed insights into the connectivity and functionality of these cloud components for web applications. 5.3.3.1 Stream Processing and Cloud SQL Sync This section includes a Spring Cloud application with stream processing, operating within thr Spring Cloud Kubernetes environment, which is advantageous for building cloud-native applications. Additionally, it also effectively manages the available messaging service, which automatically scales with demand and is known as Google Cloud Stream. To understand the Cloud SQL Sync service, we must familiarize ourselves with four key components: topics, subscriptions, subscriber clients, and Cloud SQL. This service receives messages from subscriptions using Spring Cloud Stream, which spans across different processes. The typical scenario for Stream involves the creation of multi-application pipelines, where micro-service applications exchange data with each other. As demonstrated in Listings 9 and 12, this scenario establishes a correlation between the output and input destinations of adjacent applications. Its turn, Listing 11 presents the design of Stream design responsible with the Time Source application (output) sends data to the Log Sink application (input), referencing a common destination named 𝑎𝑖_𝑚𝑒𝑠𝑠𝑎𝑔𝑒_𝑜𝑢𝑡𝑝𝑢𝑡 (AI message) or 𝑥𝑎𝑖_𝑚𝑒𝑠𝑠𝑎𝑔𝑒_𝑜𝑢𝑡𝑝𝑢𝑡 (XAI message) for bindings within both applications. Listing 11: YAML file of synchronization Cloud SQL micro-service. 1spring: 123 CHAPTER 5. DESIGN AND IMPLEMENTATION 2profiles: 3#profiles parameters 4datasource: 5#database configuration parameters 6cloud: 7gcp: 8logging: 9enabled: true 10 pubsub: 11 enabled: true 12 project-id: walking-street-app 13 credentials: 14 location: file: #credential file location 15 stream: 16 default-binder: pubsub1 17 bindings: 18 aiMessageInput: 19 destination: ai_message_output 20 group: ai_message_output_consumer 21 content-type: application/json 22 binder: pubsub1 23 consumer: 24 concurrency: 20 25 xaiMessageInput: 26 destination: xai_message_output 27 group: xai_message_output_consumer 28 content-type: application/json 29 binder: pubsub1 30 consumer: 31 concurrency: 20 32 binders: 33 pubsub1: 34 type: pubsub The Listing 12 introduces the AIMessage class, one of two receiver classes in the synchronization Cloud SQL micro-service (the other being XAIMessage). It uses the @StreamListener and @Payload annotations to handle incoming messages by specifying the content type of the input channel, such as aiMessageInput. Moreover, during the dispatching process, the argument of the receive method’s argument will be automatically populated with POJO containing the unmarshalled form of the JSON String. In other words, this application processes incoming messages with a String content and a content-type header of application/json are received on the input channel. The following application exemplifies a sink application that receives external messages: 124 CHAPTER 5. DESIGN AND IMPLEMENTATION Listing 12: AIMessage receiver of synchronization Cloud SQL micro-service. 1import org.springframework.cloud.stream.annotation.EnableBinding; 2import org.springframework.cloud.stream.annotation.StreamListener; 3import org.springframework.messaging.handler.annotation.Payload; 4 5@EnableBinding(InputChannels.class) 6public class AIMessageSink { 7 8private static final String AI_MESSAGE_INPUT = ”aiMessageInput”; 9 10 @StreamListener(AIMessageSink.AI_MESSAGE_INPUT) 11 public void receive(@Payload String message) { 12 #save the 'message' on Cloud SQL (PostgreSQL relational database) 13 } 14 } After the applications receive external messages, they are stored at the expense of a relational database, such as PostgreSQL Database. However, as previously discussed in Section 5.2.4.3, we use thirdparty software to run a SQL database provided by the GCP. One notable feature of this platform is the Cloud SQL environment. Which offers a straight-up PostgreSQL relational database. In essence, the PostgreSQL functionality provided by a Cloud SQL instance is on par with that of a locally-hosted PostgreSQL instance. This setup optimizes database operations, allowing more time for application-related tasks. 5.3.3.2 Back-End and Front-End App In this section, we will outline the development of the Web Back-End in three steps: choosing the framework, programming, and building the Back-End and Front-End. Throughout this process, these components are hosted on two distinct micro-services. As already mentioned in Section 5.2.4.4, during the framework selection phase, we opted for Java Spring for the Backend-as-a-Service (BaaS). Spring offers a comprehensive platform with various components highly helpful for the Front-End application. For example, Spring security is instrumental in robust access control, while Spring data aids in connecting with databases. For the Front-End, we chose the opensource Angular framework. Back-End App To start, we initiated a Maven Project for the Back-End application. Maven is a tool that automates the build process of the Back-End application. Additionally, dependencies are later manually added to the project. Then, within the Java Spring context, we selected Spring Boot 4.0.0 version. Basically, we use spring to program the application and Spring Boot to handle the application’s runtime intricacies. The Front-End project is developed using TypeScript, a JavaScript-based language. TypeScript eliminates unnecessary features and code, resulting in a faster application. 125 CHAPTER 5. DESIGN AND IMPLEMENTATION With the frameworks for the Back-End and Front-End micro-services in place, we proceed to program them in separate subparts. In the Back-End, we begin by adding the following libraries to develop web functionalities in the POM.xml file of the Java Spring project: • spring-boot-starter-web • spring-boot-starter-test The inclusion of spring-boot-starter-web provides us with additional libraries, including dependencies like spring-boot-starter, jackson, spring-core, spring-mvc, and spring-boot-starter-tomcat. In the next step, we define endpoints, often referred to as controllers in the Spring Web MVC Framework. These controllers fetch data by referencing the model and provide the viewer with the necessary information for the Front-End micro-service. In other words, these endpoints essentially act as controllers, responding to web-requests. Thus, based in Listing 13, we define a set of endpoints for the main controller, named by AIMessageController, in the Back-End micro-service. Listing 13: AIMessageController class of Back-End micro-service. 1import org.springframework.web.bind.annotation.GetMapping; 2import org.springframework.web.bind.annotation.RestController; 3 4@Api 5@RestController 6@RequestMapping(value = ”/api/walkingstreet/aimessage”) 7@Validated 8public class AIMessageController { 9 10 @Autowired 11 private MobilityAreaService mobilityAreaService; 12 13 @GetMapping(value = ”/{areaKms}/{rangeDates}”) 14 @ResponseStatus(HttpStatus.OK) 15 public MobilityAreaResponse getMobilityArea( 16 @PathVariable(”areaKms”) Integer areaKms, 17 @PathVariable(”rangeDates”) String rangeDates) { 18 return mobilityAreaService.getMobilityArea(areaKms, rangeDates); 19 } 20 } First, to make this micro-service function with data, it must be connected to a database. As detailed in Section 5.3.3.1, for the sake of simplicity and to maximize the potential of GCP, we will work with Cloud SQL for the relational database called PostgreSQL. Here are the steps involved: 126 CHAPTER 5. DESIGN AND IMPLEMENTATION Step 1: Create a Repository. Start by creating a repository to interact with the PostgresSQL database. Using Spring’s features, we simply create an interface that extends the BaseRepository. Step 2: Create a Service. After addressing the database component of the micro-service, create a new class as a service and annotate it with @Service annotation. As Listing 13 shows—using the annotation @Autowired to make sure the Spring runtime an instance—a service, named MobilityAreaService, was implemented in the Back-End application. This is where business logic happens and works with data stored on Cloud SQL,using the repository as a private property. In this specific case, the service retrieves information about the density of human mobility in a specific area and within a range of dates. Step 3: Declare Controllers. Declare classes such as AIMessageController class, XAIMessage- Controller as controllers for the micro-service. Annotate these controllers with @RestController. This annotation, a specialization of the @Controller annotation, simplifies the setup of the application, avoiding explicitly the need to use the @ResponseBody annotation for endpoints. Furthermore, these controllers have an annotation called @RequestMapping. For example, in the case of AIMessageController case, all endpoints are mapped at ”/api/walkingstreet/aimessage”. Then, we create a set of endpoints. As shown in the previous listing, we create a method, the path and a get request under getMobilityArea to be mapped to the ”/areaKms/rangeDates” variables and the @PathVariable annotation in the method header. This endpoint is responsible for filtering the predictions within a radius of areaKms kilometres and a range of rangeDates dates. Step 4: Implement Security. To ensure the security of endpoints, implement a security service in the Back-End. This can be achieved using a configuration class called WebSecurityConfiguration and adding the dependency called spring-boot-starter-security dependency to the POM file. In the configuration class, use the @Configuration annotation from Spring to define access management. Within this class, configure HttpSecurity (an instance of HTTP) in the configure method. This method helps secure the endpoints. There’s an example of how the configure method from the WebSecurityConfigure class might look in Listing 14. Listing 14: WebSecurityConfigure class of Back-End micro-service. 1@Configuration 2@EnableWebSecurity 3public class WebSecurityConfig extends WebSecurityConfigurerAdapter { 4 5@Autowired 6private LoginSuccessHandler loginSuccessHandler; 7 8@Override 9protected void configure(HttpSecurity http) throws Exception { 10 http 11 .authorizeRequests().antMatchers(”/api/**”) 127 CHAPTER 5. DESIGN AND IMPLEMENTATION 12 .authenticated() 13 .and() 14 .httpBasic() 15 .and() 16 .exceptionHandling() 17 .authenticationEntryPoint(restAuthenticationEntryPoint) 18 .and() 19 .formLogin() 20 .loginProcessingUrl(”/api/login”) 21 .successHandler(loginSuccessHandler) 22 .failureHandler(new SimpleUrlAuthenticationFailureHandler()); 23 } 24 } Regarding security, it’s important to note that the request endpoints need to be authorized under ”/api/”. In this configuration, any HTTP request is authenticated using a HTTP-basic authentication. Otherwise, if a user doesn’t have the necessary privileges, the entry point should send back a 401 Unauthorized response. Additionally, to facilitate user sessions and avoid the need for credentials with every request, it’s common to use tokens. These tokens can be automatically set in the header of HTTP requests after the initial authentication. This allows for easy identification of each user session. The Front-End micro-service can then use the token stored in the header, often in the form of a cookie, to maintain user sessions without requiring users to repeatedly enter their credentials for each request. Front-End App Before building the Back-End micro-service, it is essential to develop a Front-End application. This application is hosted on the Google Cloud Platform. There are many examples of the successful building of this paradigm of application [186]. Its resources are deployed, scaled and updated on a thirdparty cloud service, spending a smaller amount of time configuring and stress-testing applications. To do this, the following processes should be implemented to integrate an Angular application into the cloud. This Front-End application is executed using the GKE Frameworks. These frameworks are capable of running Angular and versions of the NodeJS version at runtime. At the architectural level, these frameworks function as a container orchestration system. They allow you to containerize both the Back-End and Front- End applications using declarative configurations specified in YAML files. For a more detailed view of how the Front-End development version is controlled, you can refer to the YAML file provided in Listing 15. Listing 15: YAML file of Front-End micro-service on Cloud Kubernetes. 1apiVersion: apps/v1beta1 2kind: Deployment 3metadata: 4name: front-end-development 5spec: 128 CHAPTER 5. DESIGN AND IMPLEMENTATION 6replicas: 1 7template: 8metadata: 9labels: 10 label-key : label-value 11 spec: 12 containers: 13 - name: front-end-development-container 14 image: inyee/walking-street-app-demo:v1 15 imagePullPolicy: Always 16 ports: 17 - containerPort: 80 To deploy the Angular application in the Kubernetes environment, the deployment manifest for angular is listed above. Even before deploying the application, we can modify the manifest file, named walkingstreet-development.yaml. For instance, we can change the name of the Deployment, adjust labels, specify the Docker registry, and set the image tag accordingly. Additionally, two other YAML files, namely walkingstreet-service.yaml and walking-street-load-balancer-service.yaml, were created to facilitate internally and external access to the application within the Kubernetes cluster. Figure 40: Element of the Front-End application. 129 CHAPTER 5. DESIGN AND IMPLEMENTATION With all this information, Figure 40 shows part of the Front-End application with the help of the Angular framework. This kind of application is a complex client-side application where a significant portion of the code runs on the client’s web browser. As mentioned in Section 5.2.4.4, this approach offers several advantages. The basic building blocks of the Angular framework are Angular components that are organized into NgModules.NgModules group together related code into functional sets, and an Angular application is formed by a collection of these NgModules. Every application has at least one root module that facilitates bootstrapping and often includes multiple feature modules. Based on the same figure, the Human Mobility XAI section of the application is responsible for explaining predictions related to human mobility phenomena in different scenarios. In this scenario, users can select a set of settings to see the multiple predictions generated by a Decision Tree (DT) model stored on Google Cloud SQL. The model consists of various decision nodes, each characterized by a field and threshold values. The selected information is presented in a straightforward text format on the web platform. The final node indicates whether there will be a concentration of people in the NYC center at a specific hour. The user’s decision path through the model is highlighted in black. With the decision tree model, it is possible to identify the factors contributing to the density of people in NYC, as well as the associated threshold values. For example, if the user’s decision path goes through a node marked as ”average density level”with a threshold value of 1200, this suggests that a density level of more than 1200 in the city center is likely to attract citizens. This information can be valuable for advising authorities on managing and potentially reducing population density to levels below 899. 5.4 Summary The architecture presented in this archetype is the result of a collaborative effort involving laboratory experiments and contributions from master’s students. Through these experiments, we have designed an infrastructure capable of integrating new data sources, combining multiple devices, and enriching the dataset related to human mobility. Additionally, master’s students have also played a crucial role in the course of this doctoral program. They were dedicated to researching different testing scenarios and disseminating scientific knowledge about the WalkingStreet Platform. These combined efforts have resulted in a robust architecture that aligns with both current and future human mobility demands of citizens, namely trends of human spatiotemporal movement. The WalkingStreet infrastructure is composed of a set of components that are instrumental in transforming cities as they help to enhance the quality of human mobility, improving the performance and interactivity of urban services, and optimizing resource allocations. These components urge in sophisticated computing structures and operate within intelligent environments that can interact with smartphones or smartwatches like data sources. The combination of intercommunication technologies with an affordable distributed system that acts both locally, centrally and in cloud environments, enables the platform to 130 CHAPTER 5. DESIGN AND IMPLEMENTATION collect and provide data for a wide range of applications. Devices, whether installed or carried by individuals, capture data and send it to the local server using IoT services such as SiteWhere platform. This local server employs basic functions such as data collection and synchronization with the central server. This central node, an approach developed within the WalkingStreet platform, facilitates the scalable transfer of human mobility data to a cost-effective cloud environment, striking a balance between local control and the advantages of storing data in larger databases. Users can interact with this central component using a Web application, and the cloud serves as the ideal environment for continuously storing the data transmitted via the central server. This data includes predictions, metrics related to human mobility, and other features, all of which can be accessed through a responsive browser on devices like smartphones. The WalkingStreet platform is designed to actively engage users as contributors to improving the quality of mobility in their community. It goes beyond simply observing and analyzing citizen movements in a SC; it encourages user participation by responding to citizens’ needs and feedback. In other words, this strategy involves users actively interacting with devices, whether individual devices or those integrated into city infrastructure, and providing instantaneous and real-time feedback. This user involvement is complemented by suggestive algorithms, which assist authorities in enhancing or developing existing smart city products while empowering citizens to propose strategies for improving mobility in their city. One of the key contributions of the WalkingStreet platform is its adaptability to address human mobility challenges in urban environments. The presented case study shows that within the technology ecosystem, it is feasible to provide MaaS with a focus on assessing and understanding human mobility behaviour. The platform not only produces results from laboratory experiments but also houses AI that are valuable assets for addressing mobility-related issues. 131 Chapter 6 Discussion of Results In this chapter, we present prototypes designed to demonstrate the versatility of the proposed architecture, addressing a variety of challenges related to human mobility. These projects are also equally important to instill confidence that the components that make up this proposed service can effectively tackle issues even on a smaller scale. Additionally, these prototypes reveal the diverse facets of human mobility, spanning from predictions based on cognitive interactions to infrastructures that analyze the number of people located in a certain location of a smart city. Furthermore, we emphasize the interconnected nature of this architecture, showcasing its bidirectional nature. Our aim is to demonstrate that several scenarios are possible to implement, ranging from the evocation of Application Programming Interface (API) and external services to the capillary integration of a heterogeneous set of sensors and mobile devices. On the other hand, we describe the project’s evolution, highlighting its substantial potential impact among stakeholders within Smart City (SC). At the same time, over the course of these 5 years, we have collaborated with diverse scientific entities to establish the merits of this thesis as a recommended solution for solving the multifaceted challenges related to human mobility. 6.1 Prototypes and Case Studies Within the context of this thesis, relevant studies take the form of prototypes. This section provides a brief overview of the development of experiments and highlights the advantages and disadvantages of the employed approaches. Additionally, it delves into the preliminary studies carried out on each module constituting the WalkingStreet platform architecture. 132