Hamza Ngadi
email: hamza.ngadi@univ-brest.fr

Ahcene Bounceur
email: ahcene.bounceur@kfupm.edu.sa

Madani Bezoui
email: mbezoui@cesi.fr

Laaziz Lahlou
email: laaziz.lahlou@etsmtl.ca

Mohammad Hammoudeh
email: m.hammoudeh@kfupm.edu.sa

Kara Nadjia

Laurent Nana

Toward a digital twin IoT for the validation of AI algorithms in smart-city applications

Keywords: Digital twin, Sumo simulator, Internet of Things, CupCarbon, MQTT communication protocol, Smart-city

The development of digital twins for road traffic has garnered significant attention within the scientific community, particularly in the realms of virtualization and the Internet of Things (IoT). The implementation of a digital twin for automobiles offers a virtual replica, capable of discerning the precise location, status, and real-time behavior of each vehicle present in the road traffic network. The primary objective of this endeavor is to create an advanced digital twin of cars that can seamlessly navigate through road traffic. To accomplish this, a meticulously selected technical approach involves employing a platform that simulates virtual sensor networks, accompanied by a purpose-built application that facilitates the access and dissemination of car-related data. Furthermore, this undertaking incorporates the utilization of an existing traffic simulator alongside a robust communication protocol to ensure seamless data transfer between the simulation environment and the sensors responsible for data collection from automobiles.

Introduction

The development of a digital twin aims to duplicate a real object or environment taking into account its behavior over time, and then project it into a virtual environment for the purpose of monitoring or collecting data from the real environment. Data collection offers a means approved by scientific research in this field, to understand and analyze the object or environment targeted, in order to create predictions and scenarios of activities, whether undesirable or not from the real source environment [START_REF] Alsbouí | An overview and classification of approaches to information extraction in wireless sensor networks[END_REF]. The main motivations for creating a digital twin in a specific domain [START_REF] Fuller | Digital Twin: Enabling Technologies, Challenges and Open Research[END_REF], can be driven by : ✓ Ensuring the reliability of behaviors and actions in an environment. ✓ Creating scenarios to guarantee stability in an environment. ✓ Guarantee the confidence of interaction with an object or an environment. ✓ Reducing and anticipating future failures of an object or environment.

From a technical point of view, a digital twin is a model that represents a description, a behavior and a state in time, updated with the shared data of an object, or an entity to be studied [START_REF] Epiphaniou | Digital twins in cyber effects modelling of iot/cps points of low resilience[END_REF]. Several scales of creation of a digital twin are possible, these depend on the complexity of the objects or environment to simulate. The scales can be varied between objects or equipment, complex systems, districts or cities up to the scale of a whole country, approached in the near future by the progress of scientific research [START_REF] Zou | A Preliminary Study on the Development and Application of Digital Twin Landscape Architectures in the Context of Smart City[END_REF].

To succeed in simulating the dynamics of road traffic that consists of at least one or more cars, the most common way in technical implementations is to equip one or more cars with sensors, thus, collecting their geolocation coordinates in real road traffic via these sensors, in order to use them to create or update the coordinates of the simulated cars in an application that implements a geographical map dedicated to visualization.

The technical implementation addressed in this work aims at using a Sumo road traffic simulator [START_REF] Saidallah | A Comparative Study of Urban Road Traffic Simulators[END_REF] [3], to extract geographic data and send it via a communication protocol to an IoT simulator [START_REF] Sanislav | Digital Twins in the Internet of Things Context[END_REF], which receives this data and updates the locations of the cars in the geographic area from which the cars are traveling. The presence of IoT sensors brings to life the digital twin of a city-related environment, providing a seamless and transparent means of exchanging data. Connected IoT objects offer the possibility for data to flow between real and virtual environments.

The collection and monitoring of data via connected sensors, give a global view of the interactions of an environment belonging to a city [START_REF] Sanislav | Digital Twins in the Internet of Things Context[END_REF][START_REF] Hammoudeh | Information extraction from sensor networks using the watershed transform algorithm[END_REF]. In this case, the construction of a twin with the behavior associated with each object of the targeted environment becomes possible, to simulate and study possible scenarios. The Sumo multimodal traffic simulator used in this work allows the creation and management of a large number of traffic networks, including the modeling and simulation of roads, vehicles and pedestrians. The data extracted from this tool belong to the simulations created from an OpenStreetMap geographical map, describing the behavior of cars in a road network.

OpenStreetMap (OSM) project [START_REF] Hadimlioglu | City Maker: Reconstruction of Cities from OpenStreetMap Data for Environmental Visualization and Simulations[END_REF] [24] aims to build an online mapping database using open source geographic data. Common uses of this data are route planning, making available geographic data of real addresses and places, and accessing already collected data of a region, city or country in the form of a map, via map editors, libraries or APIs. The data extracted from a Sumo simulation is intended to be sent to the CupCarbon IoT simulator [5][18] for visualization of the cars in the IoT geographic map generated by this tool.

The following sections of this paper will discuss the creation of the application for data extraction, the implemented means of data sharing, and the receipt of

Traffic Extractor Application

Internet of Things (IoT) simulation within digital twins enhances the efficiency and reliability of intelligent transport systems by enabling real-time data analysis and predictive modeling for optimized traffic management [START_REF] Hammoudeh | A service-oriented approach for sensing in the internet of things: Intelligent transportation systems and privacy use cases[END_REF]. To establish a comprehensive repository of geographical data intended for utilization in the CupCarbon tool, aiming to construct a digital twin of road traffic relying on Sumo simulations, the imperative lies in crafting an intermediary application. This application shall seamlessly facilitate the exchange of data between the Sumo dataset and the CupCarbon IoT platform, ensuring a smooth and coherent flow of information between these two distinct entities.

Access to the simulation file plays a pivotal role in effectively leveraging the valuable data contained within the Sumo files. In order to achieve seamless data transfer from Sumo to the CupCarbon tool, a carefully considered communication protocol is adopted. This protocol serves as the conduit through which the data is efficiently transmitted towards the CupCarbon platform. To enhance user experience and foster intuitive interactions, a user-friendly graphical interface is meticulously designed and integrated into the application. This interface empowers users with the freedom to customize and fine-tune various simulation parameters, enabling them to execute scenarios according to their specific requirements. The thoughtful incorporation of this graphical interface not only simplifies user interactions but also streamlines the process of scenario simulation, contributing to an optimized and sophisticated workflow.

Access to the scenario of a Sumo simulation: data extraction

The Sumo simulator serves as a powerful tool capable of generating simulation files that encapsulate scenario-specific parameters for our chosen road traffic setup. The tool's comprehensive documentation offers access to these files through a variety of programming languages, such as Python, C++, and Java.

In the context of this work, Java has been selected as the language of choice for developing the application. To access the simulation files effectively, Sumo provides several libraries, and for this particular application, the Libsumo library [START_REF] Müller | Towards Real-World Deployment of Reinforcement Learning for Traffic Signal Control[END_REF][16] [START_REF] Fin | Scenario Generation for Testing of Automated Driving Functions based on Real Data[END_REF] is employed, replacing the TraaS library [START_REF] Olaverri-Monreal | Connection of the SUMO Microscopic Traffic Simulator and the Unity 3D Game Engine to Evaluate V2X Communication-Based Systems[END_REF] [START_REF] Hakeem | DFPS: A Distributed Mobile System for Free Parking Assignment[END_REF], which relies on the TraCI (Traffic Control Interface) API [START_REF] Abdo | Cyber-security oriented co-simulation platform for connected and autonomous driving[END_REF] [START_REF] Olaverri-Monreal | Connection of the SUMO Microscopic Traffic Simulator and the Unity 3D Game Engine to Evaluate V2X Communication-Based Systems[END_REF] for accessing road traffic data from the simulation files. This ensures seamless and efficient retrieval of the required data for further processing within the application, thereby contributing to the successful realization of the project objectives.

The Libsumo library effectively fulfills the role previously performed by the TraCI API, serving as an intermediary interface between the Java application and the simulation. Within the developed Java application, it operates as a client, diligently querying the simulation to retrieve real-time information pertaining to the current states of the cars within the road environment specified by the generated Sumo file.

The Java application comprehensively captures the simulation by targeting the specific Sumo file, and in an iterative manner, it systematically traverses each round of the loop to extract pertinent data from one or more currently simulated cars. Subsequently, this extracted information is seamlessly transmitted to the CupCarbon tool, facilitating the visualization of the cars' movements and activities.

Upon completion of the scenario iterations, the Sumo simulation file is safely released, and the simulation itself is gracefully concluded. By effectively coordinating this process, the Java application successfully synchronizes data extraction and transmission, thereby optimizing the generation of the digital twin for road traffic in CupCarbon.

Fig. 2: The process of extracting geographical data from cars, from a Sumo simulation.

Data sharing: MQTT communication protocol

In our technical implementation, the crucial aspect of data sharing is facilitated by the MQTT protocol [25] [26]. This protocol is specifically designed for machine-to-machine communication, where relevant stakeholders subscribe to a centralized broker to facilitate a seamless and efficient exchange of data. The decision to adopt MQTT as the communication protocol is well-founded, owing to its user-friendly nature and streamlined implementation process.

One of the primary advantages of MQTT lies in its lightweight design, ensuring minimal energy consumption [START_REF] Holm | A comparative analysis of iot protocols for resource constraint devices and networks[END_REF] and bandwidth usage. This inherent efficiency makes it an ideal and well-suited choice for IoT applications, such as our digital twin system for road traffic. The utilization of MQTT significantly contributes to the optimization of data transmission, promoting a highly responsive and agile ecosystem, ultimately enhancing the overall performance and effectiveness of the digital twin implementation.

Ensuring robust communication security is paramount for IoT in digital twin simulations, as it safeguards sensitive data and critical infrastructure, mitigates cyber threats, and ensures the integrity and reliability of the simulation environment [START_REF] Carlin | Intrusion detection and countermeasure of virtual cloud systems-state of the art and current challenges[END_REF]. In our project's architecture, the local broker selected for implementation is Mosquitto [START_REF] Macheso | Design of ESP8266 Smart Home Using MQTT and Node-RED[END_REF][4] [START_REF] Gruener | Towards Resilient IoT Messaging: An Experience Report Analyzing MQTT Brokers[END_REF]. Mosquitto aligns with the inherent lightweight nature of the MQTT protocol, and it stands out for its effortless installation process and user-friendly operation. The advantage of Mosquitto lies in its ability to maintain the efficiency and responsiveness synonymous with MQTT, while simultaneously conserving system resources.

By incorporating Mosquitto as the local broker, we ensure seamless and efficient data communication between the various components of our digital twin system for road traffic. Its stability, ease of setup, and optimal utilization of machine resources make it an apt choice for facilitating reliable data exchange, thereby enhancing the overall performance and robustness of our IoT-based simulation.

A broker serves as an intermediary between clients utilizing protocols like MQTT, ensuring the reliable delivery and reception of messages, with adjustable quality of service in different shared topics. However, public and internet-accessible brokers may encounter challenges in message transmission and reception when facing saturation.

Apart from Mosquitto, there are several other alternatives that provide access to and utilization of the MQTT protocol. These widely used alternatives include: ActiveMQ [START_REF] Manuel | The analysis of the performance of RabbitMQ and Ac-tiveMQ[END_REF], Apache Kafka [START_REF] Vyas | Performance Evaluation of Apache Kafka -A Modern Platform for Real Time Data Streaming[END_REF], EMQX [START_REF] Bender | Open-Source MQTT Evaluation[END_REF][9], VerneMQ [START_REF] Bender | Open-Source MQTT Evaluation[END_REF] [START_REF] Gruener | Towards Resilient IoT Messaging: An Experience Report Analyzing MQTT Brokers[END_REF], RabbitMQ [START_REF] Manuel | The analysis of the performance of RabbitMQ and Ac-tiveMQ[END_REF], and HiveMQ [START_REF] Bender | Open-Source MQTT Evaluation[END_REF] [START_REF] Gruener | Towards Resilient IoT Messaging: An Experience Report Analyzing MQTT Brokers[END_REF]. Notably, HiveMQ is recognized for its stability and is often employed for online data sharing purposes. Each of these alternatives offers distinctive features and capabilities, allowing users to choose the most suitable broker based on their specific requirements and preferences.

The GUI interface of the application

A graphical interface, integrated to the Java application, has been developed to facilitate the management of the parameters dedicated to the examples of the simulations to be executed.

The various parameters available in the graphical interface can be adjusted according to the example scenario of the cars to be simulated, the characteristics of the available field parameters are : In addition, the graphical interface offers the possibility of launching a simulation or stopping it, with two distinct buttons, dedicated to these functions. A descriptive text, located after the buttons, indicates the current state of the simulation that is being executed. The possibility of choosing a maximum number of cars by the user gives us the interest to generate as many topics as cars to simulate. The objective of the creation of these topics is to assign, for each generated topic, a unique car which is in the course of simulation, thus, the data sharing of each car is ensured with their respective topics.

The CupCarbon tool chosen to process or visualize the coordinates of the cars shared via MQTT, needs to identify the geographical area, presented and covered by the simulation. The Libsumo library provides methods to retrieve and convert the boundary coordinates of the map proposed by Sumo, into latitude and longitude coordinates, which will allow it to be located in a geographical map of the CupCarbon IoT tool.

Digital twin construction with CupCarbon

The CupCarbon tool serves as an IoT simulator, integrating visualization capabilities through OpenStreetMap (OSM) maps to depict the geographical layout of a city. It employs both Python and the official SenScript.com language for scripting purposes.

By utilizing this tool, we gain access to a visualization interface for our MQTT-shared data. It facilitates the creation and manipulation of networks comprising nodes and virtual sensors. Furthermore, we can associate behaviors with these nodes through scripts, enabling seamless data accessibility via subscription to the relevant topic within our developed application.

The mechanism for data manipulation and treatment, as well as the subscription process, are effectively implemented to efficiently utilize the received data and provide real-time visualization of cars along with their updated coordinates.

Receiving geographical data and display of cars

The data retrieved from the topic shared with the Java application greatly facilitates data access. The Python scripts required for the retrieval and processing of the MQTT data, make the display of the geographical points of one or more cars, more dynamic as the data is extracted from the Sumo simulation, thus giving life to a digital twin of a road traffic whose source data to be collected belongs to the Sumo simulation.

The purpose of using Python in this tool is to retrieve the data emitted by the car using the MQTT protocol and then display the location of the car, in real time, on the virtual platform of CupCarbon. The data received can be saved to create complex road traffic scenarios exploring all possibilities to avoid collisions between vehicles and/or with pedestrians, or to reduce the load of road traffic in a traffic jam.

Conclusion and future work

In this article, we have introduced a novel approach to creating a digital twin of a car by harnessing data from an existing traffic simulator. The core objective of Fig. 6: Data processing integration scheme using artificial intelligence algorithms in future work.

this manoeuvre is to develop a Java application capable of extracting geographical data from simulated cars at specific time intervals. This extracted data is then seamlessly shared with the CupCarbon tool, enabling efficient processing and visualization of the available cars.

In our forthcoming research, we aim to advance our methodology by integrating artificial intelligence (AI) methods into the processing and display of cars in road traffic scenarios. From a technical perspective, we plan to implement AI and machine learning algorithms using the Python interpreter under Java. The Python interpreter provides us with the flexibility to harness the functionalities and libraries available in Python, making it an ideal choice for this work. The extensive range of stable and regularly updated libraries dedicated to AI/ML in Python, validated and supported by the scientific community and developers, further strengthens this decision.

To enable AI algorithms to efficiently process and manipulate car data, we intend to utilize the MQTT protocol for sharing the data with a supercomputer equiped with a graphical processing unit. Once the processing is done, the modified data will be sent back to the Python program. This will allow for in-depth analysis and organization of the newly acquired geographic car data.

The purpose of implementing this data processing layer is to impart intelligent and autonomous behaviors to the fleet of cars in various road traffic situations. This involves exploring ways to influence the overall behavior of the road traffic system. Through these efforts, our research endeavors to enhance traffic management strategies, promoting the evolution of smarter and more efficient road traffic systems.

Fig. 1 :

 1 Fig. 1: Global process map of the developed application.

Fig. 3 :

 3 Fig. 3: General operation of the MQTT protocol.

Fig. 4 :

 4 Fig. 4: Graphical interface of the application dedicated to accessing and sharing data of cars.

Fig. 5 :

 5 Fig. 5: Process of receiving data with the CupCarbon tool, for the display of cars with their respective coordinates.