Algorithm of automated annotation of areas of roads with increased accidents

The paper describes the methodology of annotating of road accidents centres of interactive accidents map. Based on the statistical analysis of the traffic accidents database the range of accident risk zones of a roadmap of the city are allocated as well as cause of accidents. These information in the form of text messages is applied to a vector map of a geographical area, in this paper – the map of Nizhny Novgorod. The annotation algorithm also takes into account the data of the road infrastructure, the weather, the driver (the user of the interactive crash map). The method was tested during the creation of e-cards of Nizhny Novgorod.


Introduction
Before the driver leaves the line, the motor company must inform him about the weather and traffic conditions in accordance with the law No. 196-FZ of December 10, 1995. Such information is believed to increase the safety of traffic for professional drivers. Why not apply similar information to drivers of personal transport?
The paper considers an algorithm for the formation of text or sound messages that warn of the danger when driving a specific section of the road or approaching it. The initial data is information on road accidents (RA), weather data, and road infrastructure data. This algorithm is the core of the auto-annotation subsystem of the program complex Interactive Map of Accident (IMoA). For analysis, the apparatus of mathematical statistics is used, it is the standard approach for studying the patterns of accident rate ( [1][2][3][4]). This software package designed for comprehensive analysis of RA and organization of feedback with all participants of the road process. The IMoA considered in detail in the previous works of the authors (for example [5]). Other researchers also are developing systems aimed at improving road safety ( [6][7][8][9][10][11]).
• data on accidents and traffic flows comes to the IMoA monitoring subsystem that determines the factors on which greatly exceed the average rates of accident. At the outputa set of factors A1, A2,...An and the corresponding coefficients K1, K2,...Kn, reflecting the degree of danger and expert comments, if any. The work of this subsystem will be described in detail in the following publications of the authors.
• the weather data goes both to the monitoring system as well as to the subsystem for analyzing the weather factors of the IMoA, which verifies, according to the available criteria table, whether this combination of weather factors is an emergency. In the case of a positive response, this subsystem will indicate the types of danger as output data: ice cover, snow roll, fog, etc.
Thus, the subsystem of IMoA annotation receives information on the road infrastructure (road works, not working traffic lights, changes in driving modes, etc.), information from the annotation subsystem in the form of factors A1, A2, ... A and the corresponding coefficients K1, K2, ... Kn, as well as expert comments, weather data and driver data (driving experience, gender and age). The algorithm, described in detail below, compares the annotation (text or sound message) to each node of an accident.
Initially, the driver enters the starting and ending point of the route and the route is constructed by path construction subsystem (several options can be proposed, from which the driver chooses the suitable one). Before constructing a route, the user can specify his data about the gender, driving experience and age, then the IMoA system will accept this data for processing and will take it into account in constructing the path and further annotating. Also, it is possible to log in to the IMoA system and add this information to the profile, then the system will save it and will use it for subsequent requests to build the path. After the construction of the path, it is determined which nodes of the RA lie on the route and displays the annotations for them.
The logic of the IMoA subsystem auto-nomination operation is presented in the following scheme ( Figure 1). • on viewing detailed information on the node of RA ( Figure 3); • on the information display installed on the relevant road infrastructure site; • using the navigator or navigation software downloaded to a smartphone (is in development).
The first two ways of displaying are shown in the pictures below.  An annotated message is calculated from the following initial data: • node RA; • output parameters obtained after processing the source data (see the diagram in Figure   1). The formation of an annotated message for a specific node is carried out as follows ( Table  1).
1. If there is an expert comment, then it automatically has the highest priority: • on audio annotation plays only it, or this message is played first of all; • during video annotation, the expert's comment is displayed in a conspicuous place.
2. Executing analysis of weather data. The links between the number and nature of accidents and weather data are considered in a number of studies [12][13][14][15]. The author's technique is described in the work [16], short explanation: according to the table of criteria, it is checked whether the existing combination of weather factors meets at least one of the criteria, if yes, then this criterion will be included in the processing, if not, the weather data are not taken into account when forming the annotation.
3. The road infrastructure data tables are checked: road works, not working traffic lights, etc., if they contain the node data, then the relevant information is added to the message. 4. The data of the monitoring subsystem are checked, if f a sharp growth of accidents of certain categories is noticed in this node, then at the annotation this data has the following priority level.
5. If the last week and the month of a sharp increase in the number of accidents is not observed, then on annotation uses data for the last 3 years: the accident rate factors and categories of drivers are determined, for which the average accident rate has been significantly exceeded and a message is being built according on them. Road infrastructure 0-4 (the digit corresponds to the factor: 0 -factors are absent, 1road works, 2 -not working traffic light and etc.) 8 Monitoring data factor 0-9 (the digit corresponds to the factor: 0 -factors are absent, 1distance, 2 -priority and etc.) 9 Monitoring data driver category 0-10 (0 -not allocated categories, 1 -male, 2 -female, 3 -driving experience 0 full years and etc.) 10 General data factor 0-9 (the digit corresponds to the factor: 0 -factors are absent, 1distance, 2 -priority and etc.) 11 General data driver category 0-10 (0 -not allocated categories, 1 -male, 2 -female, 3 -driving experience 0 full years and etc.)

Theory
Let us dwell in more detail on the technique of calculations. The marker of the cause of the accident rate was calculated. This is a row matrix, the elements of which are the portions: where -total number of RA, -the number of RA with the i factor, -total number of RA in the node, -the number of RA in the node with the i factor. List of factorsconditions associated with RA or types of RA, is set in advance. When annotating the largest coefficients in groups are taken into account: driving experience, gender, driver age, concomitant factor, weather factor. In this case, weather factors are displayed only when the conditions of clause 2 are fulfilled, other factors only if their value is not less than the specified threshold, the latter is proposed to be taken equal to 1.2, i.e. the average accident rate is exceeded by 20%.
The meaning of the items is clear enough, so "Distance" means that an accident occurred because of a small distance between the cars, "Priority" -priority is not met when crossing the intersection, etc., "Speed" -selected speed mode, which not appropriate of situation on the road, etc. This list is not final and its composition is the topic of a separate study.
For the formation of visual annotated messages, the information window of the node is currently used (Figure. 4).
Each of the icons is active if the factor affects the accident. When creating audio messages, it is planned to use correspondence tables: for each combination of factors, a message is created. These tables are currently being developed by the authors. We give an example of such a correspondence ( Table 2).
It follows from the table that criterion 5 has been fulfilled -an increase in the number of RA is predicted due to the formation of snow roll and ice. Since the accident in this center is associated with a violation of priority in icy conditions, i.e. predictable and potentially dangerous factors coincide, then when approaching this node, drivers of all categories should receive an annotated message: • drivers following the main road: "When approaching the intersection with a street ____ slow down and be careful: the ice is possible"; • drivers following a secondary road: "When driving to the street ____ make sure in the safety of the maneuver, at the crossroads is possible ice".  Weather criteria 3 0 5 Weather criteria 4 0 6 Weather criteria 5 1 7 Road infrastructure 0 8 Monitoring data factor 0 9 Monitoring data driver category 0 10 General data factor 2 (priority), 6 (ice) 11 General data driver category 1 (male), 4 (driving experience 1-2 full years)

Results
The algorithm of automated annotation of areas of roads with increased accidents is developed.

Discussion
The algorithm considered in this paper creates messages about safe driving for drivers.
Messages are dynamically generated depending on the traffic situation, weather, time of the day and the driver's personality. The algorithm can be used in navigators or similar devices, as well as for machines with an autonomous control system. It is understood that this algorithm will be included in the traffic safety subsystem of the information and control transport system of a city. The transport system should also be integrated into the global information space -the "Smart City" and be its subsystem.

Conclusion
In the paper, an algorithm is considered that allows, on the basis of a road process information analysis, which dynamically loads to the database, to form text or sound messages for the participants of the road process. The algorithm of automated annotation is tested on the web resource "Interactive map of the accident rate of Nizhny Novgorod". In the future it is planned to use it in navigation applications for smartphones, with the function of informing the driver about accidents factors while driving along the route.