# Implementation of Driving Safety Early Warning System Based on Trajectory Prediction on the Internet of Vehicles Environment

Authors: Rongxia Wang; Zhifang Liu; Shufeng Yang; Jianxing Wang
Journal: Security and Communication Networks
 (2022)

---

## Abstract

Traffic accidents cause a large number of casualties and economic losses every year. The primary causes of traffic accidents are the inadvertent response and inappropriate disposal of drivers. The Internet of Vehicles system is a large network based on intranets, the Internet, and mobile Internet. It performs wireless communication and information exchange between vehicles and roadways in accordance with the agreed-upon communication protocol and data exchange standards. It provides technical assistance in the implementation of vehicle hazard detection and opens up new avenues for safety early warning. In this study, a driving safety early warning system is proposed based on trajectory prediction on the Internet of Vehicles environment. After analyzing the system requirements, the driving safety system based on trajectory prediction is designed according to the demand analysis and tested. The trajectory prediction error is detected, and the collected trajectory is predicted. Data are divided into 3 groups, and to validate the performance of the system, the experiment is repeated five times. The test results show that the trajectory prediction accuracy of the trajectory prediction system designed is 89.4%, as compared to the accuracy of existing driving safety early warning systems, most of which are concentrated at accuracy lower than 89%. The proposed early warning method has the potential to reduce vehicle collisions and road traffic accidents.


---

## Body

## 1. Introduction

People’s material living standards are improving. The progress of material demand makes people’s demand for cars increasing day by day. Convenient and fast travel has become a basic requirement. In terms of technology, the application degree of automobile automation system is also improving, which greatly meets people’s functional needs for automobiles [1]. According to the World Health Organization, 1.35 million people die each year as a result of traffic accidents, and a majority of the people are injured, resulting in economic and human losses. Human mistake is responsible for around 85% of all automobile accidents [2]. Many influencing factors can cause car accidents, such as mobile phone playback, passenger conversations, meals in the car, rear-seat pets, driver carelessness, driver fatigue, prolonged driving, drowsiness, discomfort, and closed-eye driving [3]. There are also traffic accidents caused by weather and road conditions. According to the statistics of the National Road Safety Administration, more than 80% of traffic accidents are caused by non-environmental factors and the driver himself. Therefore, the intelligent early warning system can apply the timely monitoring of driver data safety information to the car safety early warning system to reduce the occurrence of traffic accidents [4].The Internet of Vehicles (IoV) and the advanced technologies combined with intelligent vehicles guarantee road safety by detecting and preventing road accidents correctly. A vigorous personalized analysis of driving behavior is possible when traffic data are processed with advanced artificial intelligence (AI) technology [5]. To enhance the performance of intelligent transportation systems and reduce future driving risks, several researchers have presented a wide range of methods, in which automobile crashes, fires, head-on accidents, and roll-on occurrences can be correctly identified with the support of onboard sensors that are placed in the intelligent vehicles [6]. Some researchers studied the problem of curve driving safety early warning, designed the curve vehicle driving safety early warning system based on the cooperation of human and vehicle environment by using LabVIEW platform, used analytic hierarchy process, evaluated the vehicle safety based on vehicle dynamics, and then established the early warning model [7]. Wu et al. [8] focused on the modeling and application of driving safety field theory. A model is proposed that included driver behavior, vehicle characteristics, and road conditions. The virtual mass calculation method is used to calculate these data, and finally, a vehicle inflation warning algorithm is presented based on the driving safety model. Nugraha and Yudoko [9] proposed a vehicle safety warning system that warns against vehicle deviation. The system is composed of multiple sensors to collect data and then uses LCD, LED, seven-segment display, and other interfaces for display. Finally, the system was tested, and the test results showed that the maximum response time of the system is 3 ms. Deng et al. [10] designed a safe speed warning system with risk prediction when the vehicle is driving in a curve. This system comprehensively considers the addition of salt, vehicles, roads, and other static factors as well as the dynamics of the vehicle, then establishes a safe vehicle speed warning model, and calculates the road curvature through machine vision technology. Next, the maximum driving speed is calculated, a risk model is introduced to evaluate the state of the vehicle, and finally, the platform is used for system development. The authors in [11] used a multimodal Kalman filter to predict trajectory using the extended Kalman filter. The proposed Kalman filter model employs three distinct parameters including position, the velocity of the vehicle, and distance of the vehicle from the intersection, to develop the state vector matrix. For accident risk prediction, the trichotomy AdaBoost (AdaBoost-SO) technique was applied in [12]. The information used in this study is about the car and its path on the road. In smart city environments, where vehicle sensors collect and analyze data with the use of onboard units, an accident detection-based IoT system was proposed to notify incidents early. A threshold value is predefined for each sensor reading to detect system problems. To sum up, there are many research results on driving safety early warning systems, but there are few research studies on vehicle safety early warning systems based on trajectory prediction.In this study, the vehicle safety prewarning system based on trajectory prediction on the Internet of Vehicles environment is proposed. The trajectory prediction error is predicted, and the data are divided into 3 groups for experiments. Results show that the trajectory prediction accuracy of the proposed method is 89.4%, as compared to the accuracy of existing driving safety early warning systems most of which obtained accuracy lower than 89%.The rest of the paper is organized as follows. Section2 provides an overview of the early warning systems for vehicle collision detection. In Section 3, the proposed early warning system is described. Section 4 illustrates the obtained results, and Section 5 draws the conclusions.


## 2. Driving Safety Early Warning System

### 2.1. Demand Analysis of Driving Safety Early Warning

(i)
Demand for dynamic traffic information collection: the dynamic traffic information collection system uses onboard units and on-road static units for data collection [13]. Due to the complex capabilities of the highway early warning system, the collection requirements are very large, covering a wide range of fields, including dynamic traffic data collection for real-time traffic monitoring status. The data mainly include traffic volume, vehicle speed, vehicle density, and other data, and these data determine whether there is a traffic accident or traffic jam and provide traffic accident rescue and traffic control data support. Moreover, it provides early warning to car owners about the possible poor condition of the vehicle or possible safety issues.(ii)
Information transmission and interaction requirements: information transmission is the process of sending the data collected by each subsystem to the processing center for processing [14, 15]. After the processing is completed, the processed information is sent to different users. To maximize the overall benefits and functions of the highway network and improve the management level and quality of highway services by improving the highway monitoring and management system, the highway safety early warning system is a multifunctional network that must meet transmission requirements and support simultaneous access to early warning system and multiunit information interaction capabilities. For example, when a traffic jam occurs, the traffic control department and individual users can simultaneously receive information such as the location of the traffic jam, the distance of the traffic jam, and the expected mitigation conditions [16].


### 2.2. Application of Internet of Vehicles

The Internet of Things (IoT) builds a communication network between vehicles and between vehicles and road equipment to acquire traffic efficiency and reduce traffic accidents so that all traffic members in the network can interchange information. Road vehicles collect vehicle information via onboard sensors and create links between vehicles and vehicles and road equipment through wireless network systems, and the vehicles are associated with the vehicle itself and other surrounding vehicles, and this information is sent to the road equipment in real time. Finally, by connecting the equipment to the roadside and the control center, transferring information between them, the control center saves and computes all vehicle information on the road, provides service information for vehicles, reinforces traffic administration, increases road efficiency, and enhances traffic safety [17].


### 2.3. Trajectory Prediction Algorithm

Presently, many research studies on orbit prediction and prediction algorithms are based on Bayesian conclusions, and suborbit prediction algorithms are no exception [18]. Assuming a map grid, n is a map grid node, and the condition for being considered a destination is that the destination location l is within the width of the grid node n. Assume that the user’s current trajectory is T, and the Bayesian equation indicates that the probability that the user’s destination is grid node n is(1)Pd∈nT=PT|d∈nPd∈n∑k=1g2PT|d∈nPd∈n,where g is the detail of the map grid. If the map is a grid, the latitude and longitude are the same, so the entire map must contain g grid nodes. In addition, P(d ∈ n) is the previous probability, the grid node n is the destination, and the expression is expressed as shown in the following equation:(2)Pd∈n=Td∈nD,where |D| represents the total number of past trajectories used to build the prediction model and the numerator represents the total number of past trajectories with a destination at grid node n. It can be seen from the definition in (2) that only the prior probability of the grid node that the user reaches is not zero. In other words, only the grid node that the user arrives at can be predicted as the user’s current destination.


## 2.1. Demand Analysis of Driving Safety Early Warning

(i)
Demand for dynamic traffic information collection: the dynamic traffic information collection system uses onboard units and on-road static units for data collection [13]. Due to the complex capabilities of the highway early warning system, the collection requirements are very large, covering a wide range of fields, including dynamic traffic data collection for real-time traffic monitoring status. The data mainly include traffic volume, vehicle speed, vehicle density, and other data, and these data determine whether there is a traffic accident or traffic jam and provide traffic accident rescue and traffic control data support. Moreover, it provides early warning to car owners about the possible poor condition of the vehicle or possible safety issues.(ii)
Information transmission and interaction requirements: information transmission is the process of sending the data collected by each subsystem to the processing center for processing [14, 15]. After the processing is completed, the processed information is sent to different users. To maximize the overall benefits and functions of the highway network and improve the management level and quality of highway services by improving the highway monitoring and management system, the highway safety early warning system is a multifunctional network that must meet transmission requirements and support simultaneous access to early warning system and multiunit information interaction capabilities. For example, when a traffic jam occurs, the traffic control department and individual users can simultaneously receive information such as the location of the traffic jam, the distance of the traffic jam, and the expected mitigation conditions [16].


## 2.2. Application of Internet of Vehicles

The Internet of Things (IoT) builds a communication network between vehicles and between vehicles and road equipment to acquire traffic efficiency and reduce traffic accidents so that all traffic members in the network can interchange information. Road vehicles collect vehicle information via onboard sensors and create links between vehicles and vehicles and road equipment through wireless network systems, and the vehicles are associated with the vehicle itself and other surrounding vehicles, and this information is sent to the road equipment in real time. Finally, by connecting the equipment to the roadside and the control center, transferring information between them, the control center saves and computes all vehicle information on the road, provides service information for vehicles, reinforces traffic administration, increases road efficiency, and enhances traffic safety [17].


## 2.3. Trajectory Prediction Algorithm

Presently, many research studies on orbit prediction and prediction algorithms are based on Bayesian conclusions, and suborbit prediction algorithms are no exception [18]. Assuming a map grid, n is a map grid node, and the condition for being considered a destination is that the destination location l is within the width of the grid node n. Assume that the user’s current trajectory is T, and the Bayesian equation indicates that the probability that the user’s destination is grid node n is(1)Pd∈nT=PT|d∈nPd∈n∑k=1g2PT|d∈nPd∈n,where g is the detail of the map grid. If the map is a grid, the latitude and longitude are the same, so the entire map must contain g grid nodes. In addition, P(d ∈ n) is the previous probability, the grid node n is the destination, and the expression is expressed as shown in the following equation:(2)Pd∈n=Td∈nD,where |D| represents the total number of past trajectories used to build the prediction model and the numerator represents the total number of past trajectories with a destination at grid node n. It can be seen from the definition in (2) that only the prior probability of the grid node that the user reaches is not zero. In other words, only the grid node that the user arrives at can be predicted as the user’s current destination.


## 3. Implementation of Driving Safety Early Warning System Based on Trajectory Prediction

### 3.1. Overall System Architecture

According to the basic functions of the road traffic safety early warning system and the composition of the Internet of Things, we divided the road traffic safety early warning system into the following levels: data perception layer, network transmission layer, data support layer, application service layer, and command and decision layer.


### 3.2. Trajectory Collection

In this case, a track point acquisition module is implemented. While using the application, when the user walks after logging in, the application backend calls the Baidu Eagle Eye mount unit to return the user’s current location (x, y) to the system, and the system formats the data and stores it in the cloud database, where x represents longitude and y represents latitude.


### 3.3. Trajectory Data Processing

During trajectory data processing, it is essential to reduce the errors. The error point refers to the positioning error caused by the geographic location of the city, such as tunnels, mountain areas, and so on, or the detection error caused by the cold start of the GPS locator during the GPS positioning process. These errors appear as obvious position point errors in the trajectory historical data, which occur because the time interval between the trajectory points is too long or the distance is too long.For the trajectory dataset, it is essential to create a data index structure to provide basic support for accessing trajectory data. This study proposed the following main requirements for access tracking data:(i)
To obtain the time series track, the track data need to traverse the track, obtain all the track points on the track, and obtain the time, longitude, and latitude information of the track point for each track point.(ii)
Save track grouping and grouping results. In the data integration stage, the grouping information of each track needs to be saved after grouping. In other words, a lot of collections need to be stored, and each collection has a lot of subtracks.(iii)
Enter the track point in the track sequence. After the trajectory data are completed, the complete trajectory points need to be entered into the original trajectory sequence to create a complete subtrajectory sequence.


### 3.4. Vehicle Distance Prediction

The system’s ability to measure distance is to use images to measure the distance between vehicles using machine vision technology [18, 19]. There are two methods for calculating the distance based on machine vision: monocular vision and multieye vision [20]. Choosing to measure distance based on multiple visions requires multiple cameras to construct a 3D scene and then calculate the distance between vehicles [21]. This process requires a lot of computation and processing power. Therefore, most of the time, the field of view of one eye is currently used. That is, only one camera is used, and the way of calculating the distance between vehicles is realized through the first subtraction. The monocular vision includes inverse perspective measurement, back-projection conversion measurement, geometric relationship combined with camera calibration measurement, hybrid geometric model measurement, and data regression measurement [22, 23]. In this study, the distance measurement method is used, which is a combination of geometric relations and camera calibration methods, that is, the “calibration object calibration method.”


### 3.5. Recognition of Dangerous State of Road Section

Different from the traditional method of predicting traffic accidents from historical accident data, the use of safety signs to predict collisions is more in line with the application requirements of assisted safe driving [25]. Safety signs usually refer to a measure of the probability of an accident, mainly based on time or space parameters, and are used to reflect the proximity of the vehicle to the collision area. Its main advantage is that the dangerous situations represented by safety signs occur more frequently in the actual traffic environment than in traffic accidents. In two-dimensional traffic, that is, at the intersection of roads, there are factors such as driving direction and vehicle-to-vehicle driving. There are accidents due to vehicle collisions. However, the time traveling through the collision area is represented by a time interval, not a point in time, according to the collision area analysis. This interval is connected to the time it takes for the vehicle to reach the collision region, as well as the time it takes for the vehicle to exit the collision area, and is dependent on the vehicle’s speed and size.


## 3.1. Overall System Architecture

According to the basic functions of the road traffic safety early warning system and the composition of the Internet of Things, we divided the road traffic safety early warning system into the following levels: data perception layer, network transmission layer, data support layer, application service layer, and command and decision layer.


## 3.2. Trajectory Collection

In this case, a track point acquisition module is implemented. While using the application, when the user walks after logging in, the application backend calls the Baidu Eagle Eye mount unit to return the user’s current location (x, y) to the system, and the system formats the data and stores it in the cloud database, where x represents longitude and y represents latitude.


## 3.3. Trajectory Data Processing

During trajectory data processing, it is essential to reduce the errors. The error point refers to the positioning error caused by the geographic location of the city, such as tunnels, mountain areas, and so on, or the detection error caused by the cold start of the GPS locator during the GPS positioning process. These errors appear as obvious position point errors in the trajectory historical data, which occur because the time interval between the trajectory points is too long or the distance is too long.For the trajectory dataset, it is essential to create a data index structure to provide basic support for accessing trajectory data. This study proposed the following main requirements for access tracking data:(i)
To obtain the time series track, the track data need to traverse the track, obtain all the track points on the track, and obtain the time, longitude, and latitude information of the track point for each track point.(ii)
Save track grouping and grouping results. In the data integration stage, the grouping information of each track needs to be saved after grouping. In other words, a lot of collections need to be stored, and each collection has a lot of subtracks.(iii)
Enter the track point in the track sequence. After the trajectory data are completed, the complete trajectory points need to be entered into the original trajectory sequence to create a complete subtrajectory sequence.


## 3.4. Vehicle Distance Prediction

The system’s ability to measure distance is to use images to measure the distance between vehicles using machine vision technology [18, 19]. There are two methods for calculating the distance based on machine vision: monocular vision and multieye vision [20]. Choosing to measure distance based on multiple visions requires multiple cameras to construct a 3D scene and then calculate the distance between vehicles [21]. This process requires a lot of computation and processing power. Therefore, most of the time, the field of view of one eye is currently used. That is, only one camera is used, and the way of calculating the distance between vehicles is realized through the first subtraction. The monocular vision includes inverse perspective measurement, back-projection conversion measurement, geometric relationship combined with camera calibration measurement, hybrid geometric model measurement, and data regression measurement [22, 23]. In this study, the distance measurement method is used, which is a combination of geometric relations and camera calibration methods, that is, the “calibration object calibration method.”


## 3.5. Recognition of Dangerous State of Road Section

Different from the traditional method of predicting traffic accidents from historical accident data, the use of safety signs to predict collisions is more in line with the application requirements of assisted safe driving [25]. Safety signs usually refer to a measure of the probability of an accident, mainly based on time or space parameters, and are used to reflect the proximity of the vehicle to the collision area. Its main advantage is that the dangerous situations represented by safety signs occur more frequently in the actual traffic environment than in traffic accidents. In two-dimensional traffic, that is, at the intersection of roads, there are factors such as driving direction and vehicle-to-vehicle driving. There are accidents due to vehicle collisions. However, the time traveling through the collision area is represented by a time interval, not a point in time, according to the collision area analysis. This interval is connected to the time it takes for the vehicle to reach the collision region, as well as the time it takes for the vehicle to exit the collision area, and is dependent on the vehicle’s speed and size.


## 4. Detection of Driving Safety Early Warning System Based on Trajectory Prediction

### 4.1. Trajectory Prediction Error Detection

In this experiment, the vehicle safety early warning system based on trajectory prediction is tested, the trajectory prediction error is detected, and the collected trajectory is predicted. For better experimental analysis, the data are divided into 3 groups and the experiment is repeated 5 times, and the prediction error is recorded. The prediction accuracy of three groups of data is shown in Table1. The results of five experiments are averaged for all of the three groups of data. The trajectory prediction accuracy obtained for Data 1, Data 2, and Data 3 is 89.0%, 89.2%, and 89.4%, respectively.Table 1
Trajectory prediction error detection.
ExperimentData 1 (%)Data 2 (%)Data 3 (%)18788892929190387908849087895919091Ave89.089.289.4It can be seen from Figure1 that the accuracy of the trajectory prediction in this study is quite high, most of which are concentrated around 89%, the highest is 91%, and the lowest is 87%.Figure 1
Trajectory prediction error detection.


### 4.2. Early Warning Rate

In this experiment, the early warning rates are detected. Three traffic sections are randomly selected, and early warning detection is carried out for these three traffic sections. The results are recorded, and the warning rates are measured for each road section. The results are shown in Table2. The early warning rate of the proposed system is compared with the actual warning rates. Figure 2 depicts the early warning rates for better analysis.Table 2
Early warning rate.
System warningActual warningSection 11517Section 21718Section 31415Figure 2
Early warning rate.It can be seen from Figure2 that the early warning accuracy rate of the early warning system is still relatively high. On the first road section, 17 relevant obstacle points are set, and the proposed system provides 15 early warnings. In the second road section, the actual number is 17, and the system also provides 15 early warnings. Likewise, in the third road section, the actual warning is 15, whereas the early warning reported by the proposed system is 14. This shows that the proposed system reports early warning very close to the actual warning on road traffic accidents.


## 4.1. Trajectory Prediction Error Detection

In this experiment, the vehicle safety early warning system based on trajectory prediction is tested, the trajectory prediction error is detected, and the collected trajectory is predicted. For better experimental analysis, the data are divided into 3 groups and the experiment is repeated 5 times, and the prediction error is recorded. The prediction accuracy of three groups of data is shown in Table1. The results of five experiments are averaged for all of the three groups of data. The trajectory prediction accuracy obtained for Data 1, Data 2, and Data 3 is 89.0%, 89.2%, and 89.4%, respectively.Table 1
Trajectory prediction error detection.
ExperimentData 1 (%)Data 2 (%)Data 3 (%)18788892929190387908849087895919091Ave89.089.289.4It can be seen from Figure1 that the accuracy of the trajectory prediction in this study is quite high, most of which are concentrated around 89%, the highest is 91%, and the lowest is 87%.Figure 1
Trajectory prediction error detection.


## 4.2. Early Warning Rate

In this experiment, the early warning rates are detected. Three traffic sections are randomly selected, and early warning detection is carried out for these three traffic sections. The results are recorded, and the warning rates are measured for each road section. The results are shown in Table2. The early warning rate of the proposed system is compared with the actual warning rates. Figure 2 depicts the early warning rates for better analysis.Table 2
Early warning rate.
System warningActual warningSection 11517Section 21718Section 31415Figure 2
Early warning rate.It can be seen from Figure2 that the early warning accuracy rate of the early warning system is still relatively high. On the first road section, 17 relevant obstacle points are set, and the proposed system provides 15 early warnings. In the second road section, the actual number is 17, and the system also provides 15 early warnings. Likewise, in the third road section, the actual warning is 15, whereas the early warning reported by the proposed system is 14. This shows that the proposed system reports early warning very close to the actual warning on road traffic accidents.


## 5. Conclusions

In recent years, with the increasing number of cars, road traffic safety issues have gradually aroused widespread concern in society. Intelligent car safety-assisted driving systems have become a current research hotspot. In this study, the driving safety early warning system is presented based on trajectory prediction on the Internet of Vehicles environment. Based on the demand analysis of the early warning system, the trajectory-based driving safety early warning system was designed. This system mainly realized the early warning of vehicle distance by calculating the vehicle trajectory. The data are separated into three groups to compute vehicle trajectory and predict the collision, and the experiment was carried out five times. Results showed that the trajectory prediction accuracy of the designed trajectory prediction system is 89.4%, which is higher than the accuracy of existing driving safety early warning systems. For collision detection, the accuracy of the early warning system is relatively high, which meets the requirements of the real-time early warning system.



---

*Source: 2922507-2022-05-19.xml*