Intelligent accident detection system by emergency response and disaster management using vehicular fog computing

Traffic has increased significantly over the past few years as a result of an increase in the number of vehicles using the common routes. It has been noted that manually operating signals has grown to be difficult. The difficulties encountered during an accident are the backed-up ambulances during emergencies caused by vehicle congestion and poor weather conditions like fog and haze. Considering this, the study focuses on the outcomes of an intelligent accident detection system using Vehicular Fog Computing (VFC). Automatic identification of crash spots and free flow of ambulances on roadways at peak hours of traffic. VFC has recently gained popularity as a useful tool for assisting vehicles in computing and storing service demands. Using the built-in sensors on a smartphone to monitor vehicular collisions and report them to the closest accessible first responder, as well as providing real-time location monitoring for paramedics and emergency victims would greatly improve the odds of recovery for emergency victims while saving time and money. This computing model guarantees the optimization of traffic congestion and energy consumption in the accident and foggy environment. This method also relies on delivering medical records to the closest hospital before the ambulance arrives, so pre-treatment can begin in the hospital.


Introduction
To improve the efficiency of the traffic system, a complex algorithm that must be automated and several sensors from which data will be gathered and communicated via the Internet of Things are required to improve the effectiveness of the traffic system.To be effective, the automated traffic control system must differ from the current approach [1].For each light, three colour patterns are fixed to a specific interval in this method.Using vehicular fog computing and taking into account the volume of traffic on the road, this needs to be made more adaptable.When heavy traffic is present in one direction, the system must be automated so that the green light remains on until the obstruction is cleared [2].When an ambulance needs to cross a traffic signal in an emergency, this method of signal maintenance might be more helpful.The traffic control system automatically stops all signals when it detects an ambulance, allowing the patient to reach the hospital in time to save a life.The limitations of the current traffic control techniques are overcome by this system.
Lack of emergency care results in a patient's death even after they have survived a car accident because emergency responders do not get timely reports about the accident.In accidents like car crashes, the emergency response time is crucial.According to studies, cutting crash reaction time by just one minute raises a person's chance of living up to 6%.According to a global survey conducted in 2017, 55% of the world's population lives in cities.It is predicted that the population will grow by 2 to 2.5% per year until 2025, resulting in more traffic on the roads.One thing to consider is that employees who live in cities may have to relocate to a location far from their workplace as the cost of living in cities rises [3].Naturally, this results in heavy traffic on the roads during rush hours, which causes congestion and makes it challenging for ambulance drivers to get through and reach the traffic signal.Additionally, officials use temporary fixes like adding lanes, raising the road level, constructing flyovers, and setting up detours during peak hours rather than coming up with a more cost-effective solution.The suggested approach gets around the aforementioned drawbacks by using vehicular fog computing to make traffic signals and the ambulance system smarter [4].
The major contribution of this paper is, (i) Directly notifies the closest available responder in an emergency, (ii) A Smartphone application for emergency responders that gets immediate updates of emergencies that occur near them and provides real-time location of the victim as well as information about the patient such as name, blood type, and address, (iii) Image defogging methodology based on wavelet decomposition and the Dragonfly Optimized Gamm algorithm, (iv) In the event of a medical emergency, gives instruction to the closest hospital.
The remaining paper is presented as follows: the Section II discusses the literature survey works and the proposed algorithm is presented in Section III.Results and simulation are presented in Section IV.Finally, the paper concludes in Section V.

Literature survey
In this paper, the general survey is taken from Coimbatore, Tamilnadu where the road traffic and the inefficiency of the convolutional method have been studied.Coimbatore cCty is southern part of Tamilnadu.After independence, the city had great growth due to an increase in industries.The city has been crowded in the past few years as rural migrants come seeking jobs in the city.

Population
From the Table 1, the surveys on the population of Coimbatore city in particular years are calculated [5].Coimbatore city has increased in population by around 0.0323 million.From the analysis, in 2022 it is expected around 2.08 million.
Figure 1 depicts the most common causes of car crashes involving a passenger vehicle.Furthermore, the driver and corresponding travellers in a car must obey some additional laws.
• All inhabitants inside a vehicle should wear safety belts, remembering those for the secondary lounge.• All kids who are 160 cm or less in stature should be set in a kid seat.• No calls or visit applications ought to be taken/utili zed while driving.• All speed limits on different sections of the road should be respected.• It is illegal to drive when under the influence of alcohol.
The most common cause of passenger car crashes is "the mistake when exiting the lane".When exiting the main road to enter a side street or passage, it often involves shifting into reverse or heading backwards.In the past ten years, it has been involved in almost 440,000 traffic collisions, accounting for 18.1 percent of all accidents.Inside any designated crosswalk, drivers of motor vehicles must always concede the right-of-way to a nearby pedestrian.Failure to do so is risky and can lead to serious injuries.Other causes of road crashes affecting 4-wheel vehicles include driver error, distance error, and inappropriate speed [6].
Figure 2 shows the survey on a number of accidents which occur in Coimbatore.According to the survey by the Hindu newspaper, Coimbatore ranks 23rd in fatal accidents in India.On average, 180 accidents occur in  peak hours.According to the survey done by Times of India, an average of 1 person dies in road accidents every 30 h.It is the greatest challenge for ambulance drivers to take the deceased to hospitals in traffic.So not only Coimbatore, but the entire nation is in need of an efficient smart automated system which controls the traffic signal as well as an ambulance which is connected to IoT to send information of patients to the nearby hospital [7].
Table 2 shows the survey on the composition of vehicles in India from 2014-2021.It is very clear that we have a gradual increase in population and transportation by road which will be increasing in the upcoming years.Ultimately it leads to huge traffic in cities like Coimbatore which further leads to increase in road accidents in mere future.
In Figure 3, the survey on number of accidents in Coimbatore from January 2020 to July 2021 is shown.From Figure 3 itself, it is clearly shown that the Ramanathapuram area in the city with the highest number of accidents from January to July.

Fog environment
Climate has a significant impact on human life.However, the extraordinary growth in automobile traffic and industry has impacted the freshness of fresh air and the ecosystem.The satellite weather report offers the present status of a certain location but not its exact status.Due to weather changes occurring many accidents.The majority of road accidents occur when vision is poor or the motorist is unable to apply the brakes in time.This problem occurs during the winter and rainy seasons when visibility is reduced to zero owing to fog and severe rains, respectively.
Poor weather conditions like fog and haze.The fog is known by people as a "mobile killer" .A haze is a little obscuration of the lower atmosphere that is created by aerosol, which is made up of suspended droplets and particles in the atmosphere.It occurs as a result of smoke, droplets, and dust in the atmosphere.Fog has the ability to drastically limit visibility, it is vital that drivers remain focused on the road in order to stay safe.Driving in poor weather appears to be an impossible undertaking because it impairs visibility.As a result, the number of traffic accidents has grown.It produces poor lighting, which has a negative impact on the quality of the supplied images.
Fog is one of the major problems we face in winter conditions that driver many people face.Driving in a foggy atmosphere may lead to dangerous accidents.Statistics show the average number of deaths in a single accident.Major traffic accidents occur from time to time caused by foggy days.On a sunny day is about 1.86 times increase than a single accident happening on a foggy day.
Fog has the greatest impact on transportation, primarily airport operations and highway travel, but also on seaborne and rail public transportation.The consequences might range from aggravation due to delayed travel to fatal multi-vehicle highway accidents.Persistent, dense fog has the potential to ground or severely

Simulation and prototype requirements
The below Table 3 shows the basic requirements for the prototype model which includes both hardware and software components for the design.Also, the specification of the components is detailed below.Cloud-based accident prevention and disaster recovery systems can experience latency and bandwidth issues due to the infrastructure's centralized nature.Fog computing, an evolving concept that promises lower latency, accessibility assistance, improved resilience, and scalability, will help solve these concerns [8].Furthermore, by using mobile sensors, the emergency warning and management systems in legacy vehicles can be made more inexpensive and simpler to install [9].

Proposed methodology
This segment describes the technique of fog-based application which uses the benefits of fog computing to diminish the general framework delays [10].The solution relies on the sensors found in modern smartphones to gather and process data, eliminating the need for an internal processing unit and extra sensors while also reducing the price of the device.The typical model of VANETs introduced in the literature includes two important components, which are On Board Units (OBUs), fixed on vehicles, and Road Side Units (RSUs) deployed on the roadside to help in establishing the infrastructure required for deploying VANETs [11].Every vehicle is presumed to be fixed with a bunch of sensors to gather the parameters around the vehicle; the OBU performs processing of the information that the sensors gather and transmits/receives them to/from other associated vehicles either directly or via RSUs that are close.The RSUs may also be connected to the Internet to yield the services required by the vehicles.Two main types of communication, as shown in Figure 4, can enable a wide range of applications: (i) infrastructure-based communication Vehicle to Infrastructure (V2I) communication; and (ii) direct communication between vehicles, Vehicle to Vehicle (V2V) communication.
Even though there has been a growth in the fascination around the probable advantages of VANETs, the dynamic characteristic of VANETs (vehicles can attach and detach as and when they wish) in addition to various system and application-based needs render it a huge challenge to develop effective techniques to ensure the privacy of vehicles.Privacy indicates the privacy of the vehicles (drivers) and the position of the vehicles [12].If a vehicle transmits a message, no one (with the corresponding management as an exception) must have the capability of deciding the identity or position of the vehicle from the messages that are transmitted by a vehicle.Simultaneously, the messages that a vehicle sends must be authenticated prior to its processing.Till these issues are resolved and the users are satisfied, the broad-level implementation of VANETs is not possible.Authentication has to be attained at two levels -first at the node level, known as node authentication and the second one at the message level, called message authentication.The fundamental concept of message authentication can be simply said to be the sender signing a message and later the verification of the authenticity and integrity of the message when the receiver gets it.A few authentications like reduced computational overhead, powerful and flexible authentication, and effective and scalable certificate revocation have to be dealt with and resolved to guarantee that the communication is secured in VANETs.
One of the primary challenges is guaranteeing the privacy of vehicles (drivers) and it needs an effective solution to be devised due to the fact that a malicious user could snoop on the travelling paths of a vehicle by acquiring and evaluating its messages and finding the vehicle (driver) leading to harmful incidents over the drivers.To deal with this problem, a few protocols in which vehicles make use of pseudonyms rather than their original IDs during communication are used when simultaneously facilitating the authorities to obtain the actual IDs from pseudonyms so that tracking and penalizing malicious vehicles is made possible [13].These protocols are known as conditional privacy-preserving protocols.Assignment of pseudonyms to vehicles and varying them often is one of the mechanisms utilized for guaranteeing the privacy of vehicles.To improve privacy, vehicles should alter the pseudonyms more often even though the number of times these alterations are done stays a question.Aspects including availability and storage size have a significant part to play in deciding the rate at which the change in pseudonyms must be done.A large number of the research in the literature dealing with security, authentication, and privacy employ a TA to obtain and load the OBUs and RSUs using security parameters like keys, certificates, and pseudonyms as shown in Figure 5.
It is also a huge challenge to provide security to VANETs against attacks due to intrusive vehicles owing to the dynamic characteristics of the network.Few of these attacks may be launched by nodes present in the network (i.e.nodes, which have been earlier authenticated to become a member of the VANET) [14] few other attacks may be initiated by vehicles not from the VANET group.Besides this, the data redundancy model is studied in the section that follows.

Detecting accident
The identification process is concerned with deciding whether or not a casualty (accident) has happened.In this methodology, three in-built sensors have been used in the smartphone such as accelerometer, GPS sensor and microphone.Figure 6 shows the block diagram of the proposed methodology for automated detection of casualty [15,16].
With the aid of IoT, details about the occurrence of any fatal crash on the roadways can be sent to the closest hospital, police department and fire station [17,18].The ambulance driver will be given the shortest and safest route to take in order to get to the casualty location as quickly as possible once the information is shared.In the meantime, after picking up the patient, the patient's health condition is referred to the nearest medical clinic, so that pre-treatment plans can be made earlier.
The following is the protocol for the detection phase: Before beginning a journey, the car owner must open the application and a specific identification (ID) code is assigned to each car.The sensor data is constantly tracked by the programme.If the accident detection value is greater than or equal to 1, it identifies an accident has occurred, and a warning is generated and shown to the user for 10 s.A false alert  is registered and stored in the archives if the warning is cancelled.The warning process continues if the alarm is not cancelled.For this, a system known as Emergency Response and Disaster Management System has been initiated [19].This system is based on fog computing which has less access time since it can access the data using smartphone sensors and communicate.As the sensors in the system need not be manipulated separately, it is a cost-effective method that can replace all conventional methods.Figure 7 shows the system flow of ERDMS and also Table 4 depicts ERDMS's advantage over the conventional method.
Each sensor's threshold is defined in order to determine whether or not a calamity has occurred.The force of gravity is measured using an accelerometer and Positioning System (GPS).If the value is greater than 4, crash the scene.Subsequently, by means of this value  alone generates a large number of false positives.This also includes the speed of the vehicle and the sudden variation of the speed along with sensors values such as accelerometer sensor; microphone as well as GPS are used for precise calculation of the spot.If the vehicle speed variation is more than 2.07, then the vehicle is considered as a crashed state.Equation ( 1) is used to determine the detection of a casualty (accident) situation.

Android APP and WEB server design
Since the fog-based system is based on smartphones, it is important to build an application to enhance the system's efficacy.All users will be directed to a login tab, where they must enter all of their personal information during the sign-up process.As seen in Figure 6, your mobile gets tracked after the login process.When the smartphone detects a casualty (accident), it sets a timer for 25 s.This functionality is used to prevent crash fault detection.If there is no crash, the user may manually stop the timer, or the device can transmit the accident reports to the closest police department, fire station, and ambulance using IoT.On arriving at the casualty spot, the ambulance would transfer the patient's details to a local hospital.The hospital can access the information through a website created with Angular JavaScript.The patient's name, phone number, email ID, crash venue, blood group, car number, date, and time will be listed on the website dashboard as shown in Figure 8.When an error is discovered, the next step is to formulate a suitable course of action.This includes using the Google Maps Application Software Interface to assess the site of the crash and the closest hospital.If the victim's place is determined, a nearby ambulance is notified by a message sent from the victim's smartphone, along with the necessary details.Furthermore, when a person uses the app, they are asked to provide details about any two of their friends or family members who might be called in the event of an emergency [20][21][22].As a result, anytime an injury occurs, a Short Messaging Service is launched, and information about the injured patient and hospital is communicated to the family members or friends.When the whole course of action has been carried out, the evidence is saved in a single archive.

Automated traffic signal
The proposed method uses Vehicular Fog Computing to effectively manage the traffic during peak hours.LEDs are used to denote traffic light and ultrasonic sensors are used for sensing the vehicles in the signal.This system is managed by automatically reducing the congestion in the signal.The timing of traffic light signals is determined by real-time traffic data.If one lane is heavily congested, the signal length will be prolonged before the traffic is cleared.The cloud would receive all of the data obtained from the signal.This can shorten the time it takes an ambulance to arrive at the hospital, saving a lot of lives.Figure 9 represents a traffic signal automation scheme.In the event of an emergency, if lane 1 is open, lane(s) 2, 3, and 4 will be blocked before the ambulance reaches the signal.

Algoritham for counting vehicles
Assume that the IR sensor is detecting only vehicles int count = 0; int hit = not true; int sensor; Step 1: if the car is detected, the sensor gives 0 or else 1; Step 2: if sensor = = 0 and hit = not true, then count++ and hit = true else if sensor = =1 and hit = true, then hit = not true Step 3: repeat from step 1

Accident prevention technique in FOG environment
Outdoor pictures suffer from poor visibility due to light diffraction and absorption of airflow in fog.Images taken outside are affected by a variety of variables, including lower contrast and colours caused by fog, rain, haze, and so on.Because of bad weather conditions over the winter, drivers have found it difficult to distinguish barriers and other vehicles, resulting in road accidents.This scientific initiative has the potential to tackle this problem and save many lives.In this section, the suggested system has been described in detail.In foggy conditions during a car, while driving, a car front camera gathers real-time videos.The camera sends the real-time videos to the big data processor Spark.In the Spark separate the videos into small -small frames.Then the Spark send the frame to the image processor, which processes the image in foggy image to de foggy image [23,24].Accident Prevention Technique (APT) in foggy conditions is proposed for efficaciously retrieving the fog-free image and preventing accidents.The foggy image is divided into high and low-frequency sub-images using DWT (Discrete Wavelet Transform), which has the advantage of preserving temporal features so that information loss can be stopped.Then the low-frequency and high-frequency images are processed with defogging and denoising modules to remove fog and noise respectively.The DOG (Dragonfly optimal Gamma) algorithm and Bilateral Filter defogging module dynamically enhanced the colour detail information without human intervention so that observed scene contrast and visibility are well preserved.Lastly, a fog-free image is reconstructed from sub-enhanced images [25,26].After completing all the processes images are sent to Artificial Intelligence (AI) engine, which will control the vehicle's speed.Figure 10 shows the schematic representation of the accident prevention technique in a fog environment.

Successive vehicle distance calculation in defogging
Every vehicle on the highway can receive the GPS information of the other vehicles, and the distance (D) between its vehicle and the other vehicles calculates the distance using the below formula.Consider two vehicles A1 and A2, where A1 is the vehicle in front and A2 is the vehicle behind travelling at a higher velocity than A1 shown in Figure 11.
Where, lat1, lon1 -latitude and longitude of A1 vehicle, lat2, lon2 -latitude and longitude of A2 vehicle, After calculate the vehicle distance, which gives the AI engine it decides to control the vehicle.This process is very useful in bad weather condition, which avoids accidents.

Result and discussion
The built-in sensor will repeatedly detect the traffic accident and send an emergency message to the nearby emergency responder, giving the possibility of saving the victim's life in situations where victims are unable to call an ambulance on their own during fatal collisions.Sending an emergency message is much easier and more secure now that all crucial features are housed in one place.The tool aids in faxing a request to the appropriate ambulance department in the event of any emergencies.From the standpoint of an emergency responder, the programme can provide them with information about nearby emergencies, enabling them to quickly identify patients and evacuate them, making better use of the resources available for emergency response.We carried out some experiments by falling a smartphone from heights 15, 25, 35 and 45 cm, recording the g-force values, which are seen in Table 5.We dropped and checked a smartphone up to ten times and reported the findings.We discovered that accidentally dropping a smartphone would not allow the device to trigger an alarm.In our research, the highest g-force value obtained by a falling smartphone from a height of 45 cm was 2.528542508.If the g-force value exceeds 4 g, our system will generate an alert.
The proposed approach is examined in a cloudbased setting where the smartphone sends data to the cloud for processing.The above Figure 12(a,b) shows the stepwise function of accident detection.
Table 6 expresses the device configuration for fog, smartphone and proxy based on testing in the environment with the appropriate devices.Table 7 signifies the comprehensive system configuration predicated on the smartphone and user count.
Where, Figure 13(a) represent an Experimental setup for the detection of an accident automatically, Figure 13(b) represent a Model of Automated traffic control.As seen in Figure 9, the device is made up of on-board sensors.The in-vehicle onboard unit (OBUs) constantly monitors the vehicle's acceleration and orientation in order to detect collisions.When a collision occurs, the most important details are sent to a local Edge node, including geographical location (latitude and longitude), the date and time, vehicle interior temperature and chassis number.The proposed model defogging performance on the road is shown in Figure 14.Here to analyse the performance some images is collected from publicly available  dataset.The results reveal that the APT model is suitable for various scenario defogging.Most of the existing techniques were developed only to process the homogeneous fog, but the proposed model DOG can adaptively clear all fog, and enhance and brighten the color in the image.
Figure 15 shows the network usage of fog and Figure 16 shows the comparison of cloud and execution time.It compares the execution time of a fog node to that of a cloud server.It's worth remembering that the assistances of fog-based ERDMS become additionally apparent as the number of devices grows, so transmission occurs with lower average latency and bandwidth utilization.It is obvious that fog computing saves power, while cloud computing uses more network data while transmitting them.Both tasks are diverted to the cloud data centres by using the cloud for computing and storage.These employees travel the whole network from point origin to point endpoint.Thus, fog computing increased the performance by up to 21% compared with other existing techniques.

Conclusion
Fog computing enables localized, reliable data processing, which is particularly advantageous in applications that require quick response times.Low delay, regional distribution, and mobility assistance are the advantages of the proposed system.Lower response times are regarded as an especially significant requirement in calamity prevention and emergency warning systems, as delays can result in fatalities.In contrast to cloud-based systems, the fog-based ERDMS optimized the latency, network utilization, and execution time, according to the test results.The assessment of the planned scheme in a virtual world is one of our study's weaknesses.Traffic delays that block ambulances during emergencies put patients' lives in danger and are a threat to ambulances in accidents.This research concept (ERDMS) will reduce the traffic issue and death rate using Vehicular Fog Computing by automatically detecting the accident spot and passing information to nearby hospitals for prior arrangements based on the health condition of the patient.This method also focuses on the free movement of vehicles during peak hours without getting stuck in traffic.

Disclosure statement
No potential conflict of interest was reported by the author(s).

Figure 1 .
Figure 1.The most common causes of passenger car crashes demonstrated with an example of pie diagram (1991-2021).

Figure 2 .
Figure 2. Survey number of accidents demonstrated with an example using image of road traffic of Coimbatore city in 2021.

Figure 3 .
Figure 3. Survey on number of accidents with an example in Coimbatore from January 2020 to July 2021.

Figure 6 .
Figure 6.Example of system architecture of ERDMS -automated detection of casualty.

Figure 7 .
Figure 7. Example of flow diagram of emergency response and disaster management system.

Figure 8 .
Figure 8. Patient's details demonstrated with example using system architecture of ERDMS.

Figure 9 .
Figure 9. Method which use vehicular fog computing illustrates with an example to automate the traffic signal.

Figure 10 .
Figure 10.Schematic representation of the accident prevention technique in fog environment.

Figure 11 .
Figure 11.Safety distance is provided to the near vehicle in real-time.

Figure 13 .
Figure 13.(a) Illustrates with an example for the detection of accident automatically and (b) Illustrates with an example of automated traffic control.

Figure 14 .
Figure 14.Pictorial representation of fog image to de-fog image.

Table 1 .
Survey on population of Coimbatore city.

Table 2 .
Composition of vehicles in India from 2014-2021.

Table 3 .
Simulation and prototype requirements.
S.No Components Type Configuration 1 Arduino Mega 2560 AT mega 2560 4 UARTs, 16 analog inputs, 54 digital input/output pins, a 16 MHz crystal oscillator 2 Arduino Uno ATmega328P 6 Analog pins, 14 Digital pins, type B USB cable 3 Arduino IDE Any application supports cross-platform Programming languages such as C, C++, Java etc., 4 Proteus Design Suite Proprietary software tool suite Electronic design automation impede air transport.Fog can impair your sight on the road, preventing you from spotting automobiles or other landmarks directly ahead of you.

Table 5 .
Gravitational force during dropping the smart phone.

Table 6 .
Device configuration for fog.

Table 7 .
Detailed configuration of the system.