A Distributed Emergency Vehicle Transit System Using Artificial Intelligence of Things (DEVeTS-AIoT)

The advent of the 4th industrial revolution has realized smart environments composed of cloud and fog. These have been improved to enable intelligence at the fog, where numerous, inexpensive devices communicate with each other and provide computation capabilities to solve domain-speci ﬁ c problems in a distributed fashion. One of these domains is smart tra ﬃ c ﬂ ow with a focus on emergency vehicle (EV) transit. The increase in tra ﬃ c congestion in third-world countries is a hindrance in EV transit to save human lives. This paper proposes an Arti ﬁ cial Intelligence of Things – (AIoT – ) based, distributed, EV transit system developed on Raspberry PI as a rule-based system with minimal sensors. The sensors include an infrared sensor to detect emergency light and directional microphones to detect siren. The departure direction of the EV is shared with adjacent intersections to further reduce the transit time.


Introduction
The rapid urbanization of the modern world has created many challenges for developing nations. The high volume of vehicles moving about the city leads to traffic congestion. This not only burns precious fuel but also intoxicates the environment, leading to non-green cities [1]. Traffic congestion also creates an obstacle for emergency vehicles (EVs): including ambulances, fire tenders, and security vehicles, consequently wasting valuable time. In 2017, 20 percent of patient deaths were caused by traffic jams where ambulances either could not reach the patient in time or could not reach a trauma center [2]. This percentage is higher in the developing world where there are weak traffic monitoring and a lack of emergency lanes. However, an emergency lane is a partial solution since it may have to cross a busy intersection. The presence of traffic sergeants at different intersections improves the situation. In the absence of a traffic sergeant, the transit is dependent on the distributed intelligence of commuters. Among many solutions is the use of cameras installed at all intersections monitored remotely by humans. This setup creates a large amount of data in the form of video feeds. A further improvement is the use of cloud for automatic EV detection and control of traffic signals. These systems are centrally controlled and dependent on the amount of bandwidth available for uploading video feeds. It is natural to note that a central traffic monitoring system is prone to single-point failure as has been highlighted in crime thriller movies like The Italian Job [3]. The traffic signal is connected with video cameras as well as microphones to detect the arrival of an EV [4]. This creates an Internet of Things (IoT) environment at a traffic intersection. IoT is the realization of the 4th industrial revolution which connects ordinary sensors seamlessly to provide better services as well as monitor activities [5]. IoT solutions have been developed for all walks of life including home automation, industrial automation, and smart cities [6]. IoT Analytics has reported 12.3 Billion connected devices worldwide with an industry worth $160 Billion by the end of 2021 [7].
Traditionally, IoTs are connected with a cloud interface to provide storage as well as computation capabilities. This arrangement is inherently centralized and is a combination of IoT-based edge components and service providing cloud components.
An IoT system when connected with legacy applications, remote services, and available appliances via the Internet gives birth to the concept of the Internet of Everything (IoE) [8]. An IoE system is a generalization of wireless sensor networks (WSN), focused on higher availability of services, ease of use, and seamless integration but at the cost of increased security vulnerabilities [9]. With the continuous evolution in technology and progressive development of 5G and 6G networks, IoT is transforming into IoE. IoE applications tend to offer an extensive assortment of interconnections of things and space applicability for various domains [10]. Smart wearable devices, smart cars, smartphones, and smart home appliances are interconnected making relevant information accessible and life intelligent [11]. The increasing need for self-sustainable systems and autonomous sensor services in smart environments had resulted in the amalgamation of AI coupled with highly available communication technologies termed as AIoT [12]. An AIoT system includes a cloud computational server that gathers, stores, processes, and analyzes the data that further control services as well as nano-and microsystems. Recent developments have combined Artificial Intelligence (AI) with IoT to evolve IoT into autonomous and futuristic architectures characterized by higher computation at the edge known as Artificial Intelligence of Things (AIoT), alternatively termed as fog computing [13,14]. The presence of sensors, microcomputers, or system on a chip (SoC) machines and GSM, 5G, or Wi-Fi communication modules allow faster processing at the edge and reduce the communication overhead [15]. AIoT has been employed in all industrial domains including smart homes, healthcare, automation, education, and traffic congestion monitoring [16].
DEVeTS-AIoT is an AIoT-based distributed EV transit system envisaged to deliver an open passage for an EV arriving at an intersection. The system detects the arrival of an EV by listening to the siren via microphones and detecting the emergency light (red) emitted by the EV using an Infrared (IR) sensor. After the departure of the EV from an intersection, the intended direction is transmitted to the next intersection using a communication module. This allows prior information to be considered by the next intersection for traffic signal  (i) This article presents design and implementation details based on Raspberry Pi, for the traffic management system and EV transition through the intersections (ii) EV detection is carried out using a microphone and an IR sensor that detects siren and red emergency light (iii) EV transition through adjacent intersections is managed by using multiple rules in a distributed fashion (iv) Departure lane information of EV is shared with the adjacent nodes through GSM/4G/5G as prior information for smooth transit The rest of the paper is organized as follows. Section 2 presents related literature with a comparison highlighting the contribution. Section 3 presents the design and the process model using BPMN. Section 4 outlines the implementa-tion details and the evaluation is carried out in Section 5. Section 6 concludes this research work.

Literature Review
With fast-growing trends and technology-embedded urbanization, multiple solutions have been proposed for making cities smart by overcoming traffic congestion. Cities are shifting towards smart concepts by offering optimal traffic management resulting in resource maximization and cost reductions. Similarly, new technologies and trends have also been embedded in cities to offer optimal solutions based on various technologies.
Elmrini and Amrani as well as Hilmani et al. propose solutions based on employing wireless sensor networks (WSN) [17,18]. Pawłowicz et al. have developed a solution on radio frequency identification (RFID) [19].
Javaid et al. have proposed a smart traffic management system using IoT along with a decentralized approach to augment traffic using intelligent algorithms [20]. This system inputs sensor data from traffic density through digital image processing (DIP) and outputs signals operation management. Their work also predicts the traffic density which minimizes traffic bottlenecks. RFID tags are used to prioritize emergency vehicles.
The use of artificial neural network (ANN) has been reported by Brzozowska et al. [21]. ANN is a classificationbased technique that suffers from large training times. Adaptations and adjustments can also result in high training times.
One of the commonly applied solutions for traffic management to support emergency vehicles is the application of IoT [22]. IoT provides a rational solution to the urban traffic congestion problem. This problem results in increased depression, higher carbon emissions, deterioration in health, wastage of fossil fuels, as well as unwanted delays in EV transit [23]. The architecture of IoT is composed of multiple interconnected equipment including sensors and smart devices via the Internet. IoT devices use global system for mobile communication (GSM), Bluetooth, Wi-Fi, etc.
Lalitha and Pounambal as well as Elkin and Vyatkin have used IoT as an enabler of smart traffic management systems [22,24]. Bellini et al. have introduced IoE to the smart traffic management problem and proposed a full stack approach to realizing IoE [12]. Zafarullah et al. and Mondal and Rehena have recommended AIoT as the building block for smart traffic management systems [25,26].
Soni and Saraswat have reviewed different methods for IoT-based traffic management and controlling system [27]. Lavanya has presented different IoT-based traffic control systems with their hardware and software implications as well as their pros and cons [28]. Wani et al. have proposed a hardware-based traffic management system designed for ambulances [29]. These techniques employ machine learning to optimize and reroute traffic, using both hardware and software components.
Juric and Madland have proposed an IoE solution based on semantics, stored for the environment, and generating reasoning suitable for the vehicles [30]. The proposed solution tuned conventional computational algorithms through  The amount of data generated in an IoT environment is large. The centralized solutions are limited and discard data that can be utilized for classification as well as prediction. To overcome the limitations of local storage, an efficient cloud computing solution is required that can process information [31].
Wang and Hsu have proposed an intelligent solution to enhance traffic quality, reduce carbon emission, and maximize energy saving through AIoT technology [32]. The authors used deep learning methods to resolve traffic scheduling and road safety issues, enabling the concept of a smart city vision. Wang has highlighted the concept of power awareness in smart traffic control. Power awareness is the ability of a smart machine to provide services while consuming less power and reducing carbon emissions [33].
Due to the amalgamation of AI in urban intelligent transportation, Guillen-Perez and Cano have proposed an innovative opportunity for a more viable urban transport agility [34]. The authors proposed a random early detection (RED) for dynamic behaviors of vehicles as a basis. The RED algorithm detects signaled intersections to proactively detect emerging congestion and models unknown traffic scenarios.
Ali et al. overcame the issue of traffic congestion and challenges by implementing a support vector machine-(SVM-) based model [35]. This model further optimized the configuration signal of high-traffic zones to medium or low-traffic zones.
Sharma et al. have developed a detection system, for traffic control, that provides input on basis of the patterns extracted from dynamic traffic density [36]. Using this technique, traffic signal switching is improved by the street limit thus saving voyaging time and preventing traffic congestion.
Sankar and Voorandoori have designed an intelligent traffic control systems using mobile ad-hoc networks (MANET), allowing communication among vehicles termed as vehicular ad hoc networks (VANETs) [37]. The authors have implemented a frequency and protocol-based solution for effective traffic management in the Indian context.
Cheng has designed a mathematical model for the efficient traffic of autonomous vehicular devices, based on a high traffic light [38]. The model calculated the traffic efficiency based on the time consumed by a certain vehicle passing over. In the case of emergency vehicles, the model utilized dynamic planning.
Beg et al. investigated the inadequacies of current traffic policing and handling emergency response systems [39]. The authors further proposed an autonomous and intelligent UAV-enabled solution. The proposed system prioritized the traffic signal for ground emergency response units, thus reducing the delays on congested traffic routes.
Wang et al. have proposed an intelligent traffic control and monitoring system based on the dynamic Level-k model and game theory [40]. The proposed system also studied the impact of multi-agent vehicle joint and achieved decisionmaking process through disturbance of group behavior on system state.
Kumar et al. have designed an intelligent and dynamic traffic light control system that inputs real-time traffic data and adjusts the traffic lights' duration dynamically [41]. A deep reinforcement learning model was also proposed for the switching of traffic lights and a fuzzy inference system was applied for traffic data inference.
Sadhukhan and Gazi have proposed an approach to measure the urban traffic density based on particular junctions by setting time-based signal functional and using ultrasonic proximity sensor (UPS) for dense traffic congestion [42]. The proposed approach is hardware based comprises microcontrollers, Wi-Fi module, signal LEDs, and ultrasonic sensors node (USN). The authors have implemented two modules, one monitored traffic density and the other managed the traffic congestion.
Masum et al. have designed an IoT-based smart traffic management system (TMS) in the context of Bangladesh [43]. The system is hardware based where the conventional traffic signal is controlled by utilizing Artificial Intelligence and sensors. The hardware components include Arduino mega controller, ultrasonic sensors, RFID module, Wi-Fi module, and signal LEDs.   [44]. The system incorporates ZigBee for communication among vehicles and provides ambulance information as soon as the patient is boarded on the stretcher due to the pressure sensors. Information is transmitted resulting in clearing the heavy traffic congested lanes on the travel route.
Madisa and Joseph have designed a traffic control system for preventing and handling traffic congestion, resulting in delays in emergency vehicles for the urban transport system [45]. The system is based on android based hardware controller and cloud computing. Rani, et al. have developed an IoT-based TMS using a GSM module and infrared (IR) sensors [46]. This system is hardware based and uses cheap and easily accessible sensors.
Ramaprasad and Kumar have designed an intelligent traffic control system based on GSM technology at traffic junctions [47]. An IR sensor is deployed in signal junctions for the estimation of vehicles based on the traffic density across all the junctions. Avatefipour and Sadry have compared different TMS presented in the literature [48]. The comparison comprised of several traffic controller systems like RFID systems, green wave system, WSN systems, IR systems, and GSM systems applicability along with their merits and demerits.
Using WSN or radio frequency identification (RFID) requires hardware installation on all vehicles. This is not suitable for third-world counters, where the sheer number of vehicles makes it an impractical solution [49]. Using IoT/IoE or AIoT to overcome the deployment cost of WSN or RFID can connect with the cloud to enhance services and provide high computation capability while employing the low-power device, in the fog. The evidences in the literature address traffic management and traffic flow with no focus on EV transit. Since the scope is smooth traffic flow, the solutions are complex and require large hardware resources. There is a need to develop low powered, smart, inexpensive, fast, scalable, fog-oriented, and simple system to ensure EV transit. Table 1 compares the evidences in literature for traffic management systems and the technique employed. The comparison is based on low-power, scalability, fog-oriented distributed intelligence, EV transit, and the use of AIoT. The use of IoT is recommended for low-power setup. Scalability refers to cost-effective deployment. Fogoriented distributed intelligence refers to real-time localized solutions with less dependency on centralized cloud-based setups. Fog can be provided through both IoT as well as vehicle-2-vehicle (V2V) communication.

DESIGN of DEVeTS-AIoT
An intersection is characterized by multiple lanes going in different directions, where a lane is a unique road converging at an intersection. There could be many lanes in an intersection but a 4-way intersection is usually found in cities. The lane at which an EV arrives is termed as the arrival lane, while the lane on which the EV departs is termed as departure lane. This is shown in Figure 1. The state of the intersection when an EV arrives is shown in Figure 2

TS-Mod engine
This is the heart of the TS-Mod. It is responsible for implementing the logic of TS-Mod. The EV detection module sends the arrival lane information once an EV is detected to the next TS-Mod installed at the next intersection A TS-Mod that receives the departure lane information from another TS-Mod increases the duration of the green signal on the arrival lane. This is carried out until the EV arrives and is detected on the arrival lane, after which the signal is turned green till the EV departs Traffic signal controller unit This module interfaces with the traffic lights and interrupts normal operation when an EV is detected. Once the EV has departed the normal operation is resumed.

Microphone
Microphones are used to detect the siren of an EV. A microphone is installed at each incoming lane. The detection of a siren and its intensity helps in identifying the transit of an EV. Once an EV transits an intersection, the intensity of the siren at the arrival lane decreases but at the same time, it increases on the microphone installed at the departure lane. This is then used to determine the departure lane.

TS-Mod. TS-Mod is a Raspberry Pi-based SoC installed as an add-on black box at a traffic signal. A Raspberry Pi is suitable for TS-Mod as it is a SoC and provides
more computing power as well as parallel processing than an Arduino device. As compared with FPGA-based devices, Raspberry Pi is a low-powered device. TS-Mod has directional microphones as well as IR sensors to detect the arrival and exit of an EV. The prime task of TS-Mod is to identify the arrival lane as well as the departure lane of an EV using directional microphones that matches the siren. In addition, to confirm the detection the light emitted by an EV is also detected using an IR sensor. A Raspberry Pi SoC is used to connect the sensors and to implement the software program. A TS-Mod has an interface that allows it to connect with the traffic lights installed at an intersection. The TS-Mod changes the traffic signal of the arrival lane of an EV to green until the EV has successfully crossed the intersection. After the transit, the departure direction of the EV can be determined by the increase in sound detected by a microphone on the departure lane. The departure lane as well as the type information is used by a TS-Mod to inform the next TS-Mod installed at the next intersection in the direction of the EV's route. The next TS-Mod can then adjust the signal to green before the arrival of EV on the expected lane. This ensures a green signal throughout the route of the EV. However, a guard timer is set within which the EV is expected to arrive. This allows resuming normal operation if the EV does not arrive at the next intersection. The details of each submodule are given in Table 2.

Cl-Mod.
The second component is Cl-Mod which gathers data from all TS-Mods installed on a road network. The Cl-Mod provides a dashboard for an admin that plots the latest situation on a digitized map of a road network. Information shared by a TS-Mod to its neighbor is also shared with the Cl-Mod. The Cl-Mod provides long-term data storage as well as analytics that can be drawn using history. Since the major computation is performed by TS-Mod, the information is shared directly with the next neighbors creates a distributed solution based on AIoT. Figure 5 shows the concept diagram of DEVeTS-AIoT.

Process Model of DEVeTS-AIoT.
DEVeTS-AIoT is developed as a structured system using business process model and notation (BPMN) following BPMN 2.0 standard [50,51]. BPMN is an abstract design method suitable for modeling flow and control information among participating objects. BPMN shows tasks, gateways, and events including parallel activities. BPMN is used to model business processes among participating entities. The tasks of the BPMN model of DEVeTS-AIoT are given in Table 3. Figure 6 shows the BPMN model of DEVeTS-AIoT.
The BPMN model of DEVeTS-AIoT has two participating objects that are shown as the swim lanes. These participants are the interacting modules. The mechanism starts with TS-Mod operating normally and executing three simultaneously threads. Its job is to detect an EV arriving at the intersection. In addition to this, it can also receive information about a departing EV at an adjacent intersection. Once an EV is detected using a microphone and IR sensor, the arrival lane is determined, and the signal is turned green for the arrival lane. The signal remains green until EV has successfully crossed an intersection. The departure lane is then determined by detecting the increased volume of the siren. The information is then shared with the adjacent node and TS-Mod resumes normal operation. It also uploads the information to the CL-Mod.
Cl-Mod then records history on the cloud and updates the map. This is used to track an EV transiting through city by city officials. The recorded history is also used to generate insights. The insights include asking how many EVs were detected correctly and how much time it took for an EV to safely transit over a month or year.

Implementation of DEVeTS-AIoT
In this section, the implementation details of the DEVeTS-AIoT system are being presented. The architecture of the DEVeTS-AIoT is presented in Figure 7. The system is divided into two main components as already mentioned in Section 3.
The TS-Mod component consists of sensory hardware and software solutions with a traffic control mechanism to prioritize traffic flow for EVs. The details of the hardware used in this work are presented in Table 4. The specifications include the power consumption of a TS-Mod. Overall, a single intersection consumes less than 2 Watts. Since, during a 24-hour day, traffic congestion mostly occurs during work hours, a sleep-scheduling policy can be implemented as a supplementary rule [54]. The sleep mode would let reduce power consumption over a 24-hour period. For an adaptive sleep-scheduling mechanism, a dataset must be compiled after deployment [55].

Evaluation
DEVeTS-AIoT is developed as a rule-based system. Rulebased systems are simple to implement and have the fastest rule-firing time [61], while classification-based systems have been developed that consider the context for activity recognition, thus making it a context-aware system [62]. A context-aware system is an overfit for DEVeTS-AIoT [63].
The input to DEVeTS-AIoT is primarily based on two sensors, i.e., light sensor and microphone, which is then further converted to two inputs, i.e., red light and siren. The red light and siren are the only two facets that describe the state or more appropriately the context of an intersection [64]. The information of the departure lane can also be provided as prior information to an adjacent intersection. This means that there are no more than 3 input variables and has a single class outcome, i.e., if EV is detected or not. The size of a truth table is no more than 8 for each arrival lane. These rules are used to determine the state of an individual intersection among three options that are normal, caution, and emergency. In a caution state, an EV is expected though it 6 Wireless Communications and Mobile Computing Prior information is received using the GSM module. This information is then subject to a counter within which the EV should be detected. If the EV is not detected, this information is then discarded. The counter is similar to the metric of age of information (AoI) [52]. Since the distance is known, the Peak AoI (PAoI) is hard coded to the system [53]. There is no need for a classification system here as the nodes are fixed and the maximum time to travel to an adjacent node would be a constant     Wireless Communications and Mobile Computing needs to be confirmed that it will arrive at the intersection. In the emergency state, an EV has arrived and should transit quickly. Table 5 shows the truth table that is used to construct the rules for DEVeTS-AIoT. Since the space is small, there is no need to employ a classification-based approach. The recommended mechanism is to increase the green time on an expected arrival lane to ensure a faster transit. However, an associated timer is necessary to revert to a normal state if the EV does not arrive at all. There are two cases when an intersection is in an emergency state and three cases when it is in a caution state. The caution state increases successful EV transit from 25% to 62.5%.

Conclusion
Traffic management in developing countries is a challenging issue. Traffic management systems as well as human resources are utilized to manage the traffic flow. Traffic congestion results in resource wastage in the form of fossil fuel, pollutes the urban environment, and creates annoying delays. These delays hamper quick EV transit through traffic intersections which can end in a fatal outcome. This work proposes a distributed AIoT-based EV transit system, built on Raspberry PI with minimal sensors including infrared sensors for detecting emergency lights and directional  EV arriving and has been detected now Emergency 9 Wireless Communications and Mobile Computing microphones for detecting sirens. This system makes decisions based on rules to ensure that an EV moves smoothly through crossings. Once an EV is detected on an incoming lane, the traffic signal is turned to green until the time the EV has successfully passed through the intersection. The departure lane is detected, and this information is shared with adjacent intersections to further reduce the transit time. As a result of the system, successful EV transit has increased from 25% to 62.5 percent.

Data Availability
The authors confirm that the data generated or analyzed and supporting the findings of this study are available within the article.

Conflicts of Interest
The authors declare that they have no conflicts of interest.