Rule system for speed limit determination on national roads in Poland

. Nowadays, in the majority of cases, speed limits are defined by experts, who take into account the qualitative and quantitative parameters of the examined roads. The process of setting speed limits is often complex, because technical, social, and legal aspects should be taken into account. The paper presents a developed rule-based system for setting maximum speed limits, and results of the research with an unified data model describing roads and their surroundings. Analysis of the possibility of obtaining relevant data and automation of the process of their collection are also described. The set of the rules was developed on the basis of the methodologies used in Poland, United States, Germany, and New Zealand.


Introduction
The process of setting speed limits is often complex and in many cases specified in detail by numerous technical and legal standards. Hence, when designing rules for speed limit selection, not only technical, but also social and legal aspects should be taken into account . There are several methods for setting speed limits: engineering approach (the operating speed method, the road risk method), expert method, optimal speed and injury minimization. They lead to different outcomes [1].
The main objective of this article is to describe an automatic system supporting determining speed limits for selected road section. It is an expert system that using the defined set of rules establishes speed limits for road sections. Other purposes include development of a unified data model describing roads and their surroundings, taking into account identification of key factors influencing speed limits and the analysis of the possibility of obtaining relevant data and automation of the process of their collection. Data should be appropriate, complete and accurate. Collecting and analysing data that can be useful for determining rules in the proposed system helps to indicate an appropriate value of the speed limit on given road section.
2 Speed limit setting system 2.1 The scheme of proposed system Figure 1 shows the overall architecture of the system for the setting speed limits. Its central element is a Rule System, which suggests the speed limits decision for a road section based on data originating from the Static Map. It should be noted that in setting appropriate speed limits we need information about the main determinants of the speed limit such as legal aspects and speed management guidelines, parameters describing road sections and roadside, the characteristics of the traffic, weather conditions. Methods for collecting data are varied and depend on their sources.
Further description will focus on how static data on road and environment conditions are collected and how the rule on speed limit is obtained.

Determining speed limits -factors
The expert system inferences on the basis of rules and data gathered in the Static Map. The rules can be defined by experts [2], extracted using machine learning methods or created on the basis of the state law. As mentioned above, several factors can be used in the rules as the facts during inferencing: − legal aspects and developed in state law speed management guidelines. They specify limits in residential areas, on one-lane roadways and two-lane roadways in locations other than urban districts, on express roadways in locations other than urban districts and on highways, − properties of the road section -road class, road characteristics (e.g. the number of lanes), the surface quality, number of intersections, junctions, exits, entrances and geometric parameters (the size of the arc, slope of the road), − characteristics of the traffic which includes traffic intensity, structure of the traffic (e.g. 85th speed percentile, percentage of cars and trucks), number of pedestrians and bicycles − risk of accidents, − type of adjacent land use, − typical weather conditions, − any planned modification to the road.
This data are stored in the Static Map and attached to the geometric objects as a node, an edge and a polygon. Moreover, all these geometrical object are described by geographic coordinates (latitude and longitude) and tagged using concepts defined in the ontology. It enables freely to expand a scope of information stored in the Static Map which are used in the process of speed determining. Fig. 2 presents a part of the upper ontology used in the Static Map. Classes defined in the ontology enable describing in detail data included in the database. For example, osmcore:Node defines nodes which can be used for tagging of the physical objects e.g. road sign, tree or column. Fig. 3 presents an example of the graphical interpretation of the objects included in the Static Map and the example of data attached to them. This part of the map includes the segment (one-way road), the tree (node) and the school (polygon) near of the road segment. Each object has the geographical position (lon, lat) and the reference to the concept in the ontology (OntoRef). If the object is the directed segment then it has defined startId and endId and V85 -the 85th speed percentile. It should be noted that lon, lat, startId, endId, V85 are concepts defined in the ontology and OntoRef is unique identifier of the concept or properties of the concept.

Extraction and representation of the road sections
Basic information about road network originates from the Open Street Map (OSM) [3]. OSM is a map of world developed as a community project. The map is a valuable source of information: it provides full coverage of Polish road networks, including geometry, crossing points, number of lanes and road restrictions. This information is often supplemented by such parameters as widths, road signs, speed limits, etc. An advantage of OSM is also the fact that the map is continuously updated by community members.
As the basic goal of the project is determination of speed limits that apply to road sections, we proposed data representation that has several elements common with OSM, however introduces new data structures, namely connections, sections and their properties (cf. Fig 3,  4). In OSM a basic linear element is called way. Ways may be used to represent roads, but also building contours, rivers, fences, boundaries etc. Because roads in OSM may extend over several crossroads, they are split into connections, i.e. parts of roads linking two crossroads. Further, connections are divided into directed sections ( taking into account one-way and two-way roads). Sections are attributed with information on geometry and other road properties such as signs and surroundings. Each section has a uniform set of attributes along the entire length. As speed limits often take effect on a part of roads between certain point and the next crossroad, connections can contain more than one section in a given direction.  These numbers describe data resulting from extraction and transformation. New records can be added manually by an operator or imported from external systems.

Data Acquisition for learning systems
At the current state of the project, the expert system uses two categories of rules: defined by experts and extracted from a set of observations. However, it is planned to add the functionality of creating the rules by users of the system. The first category of rules is result of research carried out in INPREDO project. Expert rules were extracted from US, New Zealand, Austrian, German and Polish speed limits guidelines and scientific studies. The set of original rules was very large. Some rules from different sources were conflicting, others were not applicable to Polish roads. Therefore, the selection and adaptation process has been carried out. The next category of rules used by expert system were rules generated by various types of machine learning methods. The list of applied methods included decision trees and association rules algorithms. In order to ensure representativeness of learning sample all roads are divided into several types and for each type a list of parameters influencing on a speed limit was identified. A specially developed application was used to collect learning sample (Fig.6). The application allows to collect parameters values from selected road segments. The starting and ending point of the segment can be set by the user. Furthermore, segments can be divided into smaller ones. Parameters values can be obtained automatically (from files, databases, webservices and maps), semi-automatically (from the same sources but with user assistance) and manually (from documents, reports or Google Map inspection).

Inferencing and Anomaly Detection
A rule engine should integrate a data repository for storing rules, a rule editor that allows to define and manage rules and should deliver verification of existing rules, and inference algorithms. The rule engine provided with the Drools package was used to accomplish the task, which includes the Rete, ReteOO, and PHREAK algorithms. A detailed description of these algorithms can be found in [4]. According to the on-line documentation of Drools environment, Drools is a business rule management system with a forward-chaining and backward-chaining inference based rules engine, and allows fast evaluation of business rules. Moreover, the rules defined in Drools Workbench were used to implement the logic of selecting speed limits on roads.

Inferencing and harmonisation example
Many rules have been identified as possible speed limits on the road [5,6]. Now, we consider here the following test case: a section of the intersection of the main road with access roads. We assume that the intersection is equipped with traffic lights, as was shown in Fig. 7. Note that, for the sake of the simplicity, only local information about built-up area and the number of vehicles entering traffic is considered here.
The question is to determine the speed limit in the considered section. To do that, we assume that the boundary area is given and the parameters in a road section, for the two cases of roads: main road and access road, are known. Fig. 7. Example of inferencing: (a) situation before inferencing (b) assignment of the speed limits to the segments using inferencing.
After assignment of the speed limits to the segments, the obtained speed values are optimized in order to the speed harmonization of the neighboring segments. The harmonization process is carried out on the basis of the criterial function: ( 1 , … , ) = ∑ ( 1 1 ( ) + 2 2 ( ) + 3 3 ( ) + 4 4 ( )) =1 (1) where: -the number of the segments, 1 , … , -vector of the speeds (decision), 1 ( ) -exploitation cost of the segment, 2 ( ) -average time cost for the user, 3 ( ) -average accident cost including different accidents categories, 4 ( ) -average environmental cost including noise and emissions, -weights defined by the expert or the learning system. The function 1 , 2 , 3 and 4 are obtained on the basis of [5]. Moreover, the optimization process takes into consideration the speed difference between the neighboring segments and the minimum length of zone [6][7][8]. Fig. 8 presents the result of the harmonization process for 50 segments. The angled part of the chart correspond to the buffer segments between the different speeds. It can be noted reduction of the number of the segments with the different speeds.

Anomaly detection
Anomaly detection aims at finding inconsistent speed limits. It is assumed that using a deterministic set of rules the same limits should be set for similar combinations of road parameters, e.g. road class, curvature, density of driveways, class of crossing road, presence of specific objects like schools or worship places [1,2]. Let = { 1 , . . . , } be a set of road segments with assigned speed limit . If there exist a segment that is far (according to selected metric) from other segments in , it can be considered a anomaly.
We formalize this approach by building a Gaussian Mixture Model (GMM) [9] with Expectation Maximization (EM) algorithm for each class of segments , where = 30, 40, 50, . . .140. GMM assigns probability density to each point in the feature space being a sum of densities, whose sources are = 1, . . , model components (multivariate Gaussian distributions) with separate mean values and covariance matrices . A data point that is far from other frequently appearing observations is assigned with low probability density (such points are marked with red arrows in Fig. 9. The developed anomaly models depend on two parameters that need to be selected: -number of model components . GMM components estimate probability that a certain road segment does not represent an anomaly. Depending on the number of components, the boundaries may be sharp (if is high) or blurred (if is low). We establish the number of components testing various models and calculating Akaike information criterion [10].

Conclusion
The designed rule system allows to establish speed limits. Due to the lack of accuracy and consistency of data stored in heterogeneous databases, it was necessary to create a centralized data repository, in which a broad spectrum of data describing the road and its surroundings can be stored and accessed. A modular system design, representation of the knowledge in the form of rules, which can be further modified and tuned assure great flexibility and the ability to adapt the system to particular deployments, e.g. setting dynamic speed limits based on weather or traffic parameters originating from various types of sensors installed locally.
Another direction of research is the speed control based on variable speed signs. In addition to control commands, received from the monitoring center, it is planned to be used local analysis of traffic parameters, carried out by a low-cost device, mounted together with a road sign.
It will provide information to reduce the speed of vehicles depending on the locally computed traffic volume and atmospheric conditions -mainly fog.
Work has been co-financed by the National Centre for Research and Development and General Directorate for National Roads and Motorways, Programme Smart Infrastructure Road Innovation (RID) project no. DZP/RID-I-68/14/NCBIR/2016.