Development of intelligent system for automated traffic control

. This article is devoted to the issue of regulating traffic congestion in major cities of the world using artificial neural networks. Research is aimed at developing import – substituting automated intelligent system that uses artificial neural network to make decisions to optimize traffic congestion by changing the duration of light phases of traffic lights. Multilayer perceptron with sigmoidal activation function is used as neural network. The article describes developing stages of intelligent automated traffic control system that using artificial neural networks allows making informed decisions based on extensive analysis of available information, as well as constantly adapt it to incoming external influences that lead to non – equilibrium state. Practical application of the proposed system is expressed in unloading road sections adjacent to highway; reducing the number of traffic jams in the lanes or reducing the length of the car queue; automating traffic control and reducing the number of emergency cases that require inspection personnel to leave for manual control. System allow improving overall traffic situation by avoiding cascading traffic jams on adjacent sections; prevention of accidents and conflicts between motorists and pedestrians; improving the reliability of adjustment and reducing cost of maintenance infrastructure.


Introduction
The XXI-st century is the period of active development of technologies. Enterprises are built in megacities, road infrastructure is improved, new highways and road forks are created, etc. Almost every family has own vehicle -personal car. According to data for 2019 in Russia, there are about 305 motor vehicles per 1000 people living in the country [1]. This indicator is level of motorization; it is ratio of number of personal cars to population in selected area [2].
Often there is problem of increased traffic congestion. When cars are moving on roads, congestion can form, which is large accumulation of cars -traffic jam. The reasons for this may be accidents, repairs, incorrectly configured traffic lights, weather conditions, and other factors. Main tool for regulating road traffic is traffic light. However, the common problem is inadequate operation and incorrect setting of traffic lights that regulate traffic flow [3]. In the case of traffic light devices failure, the adjustment function is taken over by specially trained human traffic controllers, who is subject to human errors and cannot work for a long time by nature.
In Russia, the common method is to set switching of traffic lights on timer, that is, after the fixed period. Such system is the simplest and its main disadvantage is the inability to adapt to the current road situation, including various incidents.
Despite on enough large amount of research in the field of automation of traffic systems, the issues of intelligent adaptive regulation using artificial neural networks are currently insufficiently studied. Thus, further investigation of the problem of increased traffic congestion is actual question and urgent issue, so there is need to develop the system of automatic adaptive traffic light control, the implementation of which will significantly improve the existing situation.
Scientific novelty of this work is that automated intelligent system has been developed that can produce corrective effect on the group of traffic lights in the section to regulate the traffic intensity. Method of model simulation was used to provide configuration and debugging of neural network, which uses the multi-layer perceptron with sigmoidal activation function.
Object of research: processes of preparation and decision-making on traffic congestion regulation on the roads.
Subject of research: traffic congestion control on the roads using artificial neural networks.
Purpose of study is developing the method of artificial neural network using to make decisions to optimize traffic congestion by changing the duration of light phases of traffic lights. To achieve the set goal of investigation, it is necessary to solve the following research problems: -Analysis of the subject area, highlighting the main tools and methods used to track traffic congestion.
-Studying the problems contributing the traffic congestion; Consideration of traffic light phase regulation features; Development and testing of intelligent system. Research methods of decision-making theory and artificial neural networks are used to solve the research problems.
Theoretical significance of research: problem of traffic congestion is investigated; and new approach to optimizing traffic using artificial neural network is developed.
Because there may be various causes that contribute to the formation of congestion, several methods are used in the work based on collecting information about the number of vehicles on the selected section, allowing optimizing traffic by changing the duration of the phase intervals.
Practical significance of research: information obtained can be used for implementing or making amendments to the existing transport system controlling. Use of developed adaptive adjustment method will have positive impact on improving the environmental situation, economic benefits and will help in studying the existing problem of traffic congestion.

Traffic light adjustment techniques
In the existing methods of management and traffic control, there are the following general concepts [4]: -Interval (control cycle): the specific duration of a certain combination of light waveforms of traffic signal.
-Signal phase (regulation phase): the defined combination of current and next clock cycle.
-Signal cycle (control cycle): set of certain phases that repeat in time at a given frequency.
-Section of the regulation: the percentage of the control cycle assigned to each of the control phases. By changing the percentage of time per phase, you can control the duration of the green signal in a particularly busy direction of travel. This reduces delays at a particular intersection.
-Offset: the time difference (measured in seconds or percentages of signal cycle) between the clock at a particular intersection and the main clock (in a network of intersections).
Usually there are next types of traffic light adjustment [5]: -Constant regulation (traffic light regulation mode does not change; traffic light regulation mode changes during the day and / or depending on the day of the week).
-Adaptive regulation of traffic light adjustment (partially or completely dependent on the traffic flow).
Separately, we should mention the mode of traffic lights coordination "green wave" type. Implementation is possible only with constant mode of traffic light adjustment and adaptive control of traffic lights with variable duration of phases, called pulse green waves [6].

Methods for collecting traffic data
In the most cases, process of data collection precedes any data processing, which is subject to careful transformation and systematization. Solving the issue of improving the efficiency of traffic congestion control is also no exception. Before operating with information about number of cars at each particular intersection, it must be somehow collect and prepare material in the form that can be used by next operator in the chain. There are several main ways to accumulate data [7]: -Detection by processing video recordings (photos) from the Closed Circuit Television (CCTV) cameras.
-Detection using infrared sensors and induction loops embedded in the roadbed for the traffic control.
-Detection using Internet of things technology. In the video detection method, data is received by taking video signal from placed traffic cameras that provide the view within certain radius. The conversion takes place in three stages (which are shown in figure 1) [8]: -Splitting recording into frames.
-Discoloration of the image.
-Detection of vehicle edges. The resulting recording is divided, at first, into frames-separate images. After extracting the frame, you can apply various processing methods required to transform the original fragment into a view that can be perceived by the next computational element in the traffic optimization chain.
More stationary solution is to equip traffic lights with infrared motion sensors and install induction loops that are mounted in the asphalt pavement of the road [9].
The infrared signal is not subject to electromagnetic interference, which allows it to be used in such conditions. Disadvantages include the need for optical windows on the equipment and correct mutual orientation of devices [10].
The most commonly used traffic detectors are inductive loops located under the roadway (figure 2). The inductive sensing element is frame consisting of one or two turns, as well as insulated and protected from possible mechanical influences of the wires [11].
The loop detector is located under the road surface at depth of 5 to 8 cm. When passing or stopping a car with metal "mass", the inductance changes, and the car is fixed. -Vehicle classifications (division into passenger, cargo, and public types of transport). The advantages of infrared traffic light sensors and induction loops are the accuracy of the received data and the lack of need for additional conversion of the received information to identify the required useful information. Disadvantages include difficulties in installing and debugging the system, which entails significant monetary costs [12].
It is advisable to develop an intelligent system based on a neural network, as well as use the "green wave" method, taking into account third-party reasons that directly affect the decision -making of the neural network, listed earlier: Current workload. Statistical data (average number of cars on the site of the road in the certain period). Other factors (for example, whether the flow of cars from one intersection will create congestion at the next cross -road, and other reasons).
The introduction of an adaptive method for traffic lights controlling, taking into account the factors listed above, is the modern and optimal solution that will significantly improve the existing transport situation, bringing the permissible capacity of the roadway to its theoretical maximum, and as result, get positive economic, social and environmental result.

Conceptual design of the method
The task of designing switching signals for traffic light objects includes determining the number and sequence of control stages, calculating the duration of cycles and phases that together form control cycles [13].
The developed adjustment method implies that traffic congestion optimization uses several sources of information (current traffic status and statistics) that directly affect the adjustment process. The advantage of this method is that the analysis and decisionmaking is carried out more consciously and accurately, thereby minimizing the number of possible errors, which positively affects the overall performance of the optimized road network.
The main source of information about the current state of traffic congestion is data on the number, location and speed of vehicles on the working section of the roadway [14].
To implement the control method, it is necessary to keep this information up-to-date, which is achieved by frequently interviewing sensors that can collect such information by analyzing the environment using built-in hardware capabilities.
In order to meet sufficiently the informative needs of the system, the data must be reliable, up-to-date, and provided with the necessary frequency. As part of the development of this method, it is assumed that the system receives information that fully meets the requirements listed above.
An important factor is taking into account the available statistical information about the most busy and problematic sections of the road network. Analysis of such information will allow you to predict in advance the possible consequences of daily activity of vehicles based on information that has been verified repeatedly by time [15]. This source of information is auxiliary, since it reflects only an approximate position on the issue of traffic management, so it can be used only in conjunction with information that reflects the real situation at particular time.
Do not forget about other factors that can provoke situation of difficult traffic on the roadbed, which can include weather conditions, road accidents, violations of the rules by traffic participants, and so on. This group of factors also can be attributed to the information collection about current workload, taking into account the suddenness of these situations [16].
At output, the algorithm calculates the values of numerical corrections necessary to make to the parameters of traffic light groups operating at intersections, which are used as an extreme control link in the task of optimizing road traffic [17].

Algorithm description
To solve the task of ensuring traffic congestion control using traffic lights, an algorithm was developed that uses up-to-date information received at the input to make informed decisions on optimization.
The general dependence of the system parameters taken into account can be expressed as follows: Optimization solution = Total flow size × Throughput × Flow Rate × Forecast × Excess.
Throughput is coefficient that reflects the maximum number of vehicles that can cover the allotted section per unit of time. The speed of the flow reflects the average rate of movement of groups of cars along the roadbed on the selected section.
Forecast -represents numerical values about the expected number of vehicles, calculated based on statistics on traffic congestion during a weekly, monthly, or annual cycle.
The rational solution is to use averaged values for a given time period. Taking into account the factors listed above, the forecast value can be calculated using the expression: where avg vaverage speed indicator; avg xnumber of statistical time sections taken in the calculation; avg Gvalue of the average speed at the time of observation; k -initial traffic intensity. Forecasting process has number of possible disadvantages. For example, set of statistical data may not be available for the required period, due to technical problems with equipment that collects information or data availability with high level of error.
Excess represents the percentage of the excess number of vehicles relative to the calculated expected figure. Based on this indicator, corrective effect is made to improve efficiency of traffic optimization. Calculations were fulfilled by expression: where is value of initial traffic intensity; Ft predicted value of expected traffic intensity; Pk is indicator of the site capacity.
After entering the information, you need to pay attention to the pre-processing of information. The algorithm in question implies the following operations ( figure 3).
Preprocessing -casting of the original data types is performed. It can be used to convert source values of a real type to values of an integer type (for example, from 10.0 to 10).
Next, the data is cleared, including the identification and elimination of errors and inconsistencies found. After cleaning, the set must be consistent with other existing data sets in the system. In fact, the cleanup process may include deleting typos, correcting values, and cross -checking data. The next step is the feature selection process, which is an operation to reduce the size of the data, in which the original values are reduced to more manageable, while maintaining a sufficient level of accuracy and completeness of information content of the original data set.
Normalization method used for averaging the set of uniform numeric values to one that can describe the set used by a single number. Calculations were fulfilled by expression: where n -the number of numeric values; xi -another number from the list.

Fig. 3. Optimization solution calculation scheme.
Normalization is the final preparatory step, which means rounding numeric values with a large number of decimal places, sorting data, and placing them in the appropriate variables, class fields, and arrays.
To ensure proper functioning of the artificial neural network, it is necessary to compare the output data with the expected results, and then calculate the total network error. To reduce the error value, learning phase is required. During this phase, network configuration is performed in order to determine the appropriate value of connection weights, so that the network result is as close as possible to the actual result. Usually, the Levenberg -Marquardt algorithm is used to select the values of a neural network, which is designed to optimize the parameters of nonlinear r regression models [18].
It is assumed that the mean square error of the model on the training sample is used as the optimization criterion [19]. The standard error is calculated using the known expression: where n is the sample size; x is the arithmetic average value of the sample; i x is the i-th element of the selection. Algorithm consists in sequential approximation of specified initial parameter values to the desired local optimum. The value of artificial neural network error is shown in expression: where k  is the desired result; k  is the value obtained at the output of the neural network.
The adjustment of weight coefficients between the input and hidden layers can be represented at the expression (6): , , where λ is the learning rate coefficient of the neural network. Output data of algorithm are calculated the numerical combinations of signal clock durations of traffic light phases, which represent some optimization solution aimed at adjusting the speed of switching light phases. Using the obtained data sets will allow controlling effectively the mutual movement of traffic flows on the selected target section of the roadway.
The result of using the obtained optimization solutions, taking into account the features of the transport infrastructure, is manifested particularly well when using the algorithm for a long period and can be recorded qualitatively by tracking the trend of changes in numerical statistics that reflect the effectiveness of optimization. The overall interaction of the developed system can be represented as diagram in the figure 4.
The interaction of the system is based on the principle of feedback. Feedback is a process that leads to the fact that the result of the functioning of a system affects the parameters on which the functioning of this system depends [19]. This is done intentionally to affect dynamics of the system's functioning. In this case, after entering the initial parameters, the system is entered into non-equilibrium state, from which it tries to successfully exit independently, graphically demonstrating its behavior in the program interface.
Result of using the obtained optimization solutions, taking into account the features of the transport infrastructure, is well manifested particularly when using the algorithm for the long period, and can be recorded qualitatively by tracking the trend of changes in numerical statistics that reflect the effectiveness of optimization.
Based on described above algorithm, program application implementation of an intelligent traffic control system was performed. The C# programming language was chosen as the language for writing the software system, and Visual Studio was chosen as the development environment. To calculate the optimal solution, the structure of multilayer artificial neural network with a sigmoid activation function was used [19].
The figure 5 below shows the interface of the program. In the upper-left corner of the interface, there are two functional intersection templates that differ in road markings. The main workspace has grid structure with numbered labels horizontally (A, B, C, D) and vertically (1,2,3). The user can interact with templates by holding down the left mouse button, which allows you to move them to the workspace, making up various combinations of road markings. The slide shows several templates placed on the working canvas.

Fig. 5. Program application interface.
After pressing the "Start" button, the system is initialized to start working, which randomly creates a certain number of cars that start moving in a random direction, while observing the rules of the road. To make it easier to control traffic optimization, we have implemented a form of statistics that is called by clicking on the button of the same name. Window that opens shows the grid structure of canvas containing current number of vehicles and load factor for each of sections. It is possible using "Threshold value" field to set the maximum number of vehicles, after which all sections with large number of vehicles will be highlighted in red (figure 6).

Conclusion
Scientists and developers around the whole world have been working on the problems of automated traffic control in the terms of megacities for more than 50 years. It is known, that similar system was used first in 1959 in Toronto city, in Canada. In Russia, the first automated traffic control system was introduced in 1968, in Moscow. Today, such systems ensure safety on roads all over the world, as well as the speed of movement on urban roads in compliance with local traffic rules.
The most prominent foreign developers of intelligent automated traffic control systems are: M. Karlaftis, M. Drechny, T. Pamula, K. Chan, J. Naranjo, L. Deka, S. Durduran, whose work laid the foundation of this scientific direction. Among domestic authors whose works are devoted to the working out of adaptive traffic control systems, it must pay tribute to the works of A.S. Golubkov, V.G. Kocherga, E.V. Kobzar, Yu.A. Vrubel, A.S. Gerasimov, I.A. Evstigneev Yu.A. Kremenets, and others.
Regulated cross-road is the most important element of the street-and-road network, so now the world has enough large number of developed computer programs for analyzing and modeling both existing and predicted regulated intersections ("SymTraffic", "SEDRA", "Passer V", "Transyt-7F", "Oscady", "Svetofor" ("Traffic light"), etc. This software performs the similar functions -the evaluating existing traffic signals, the calculating load levels, delays, and service levels [4].
However, foreign automated control systems are not adapted to the problems of Russian roads. Therefore, before using the foreign software, you need to make sure that the simulation is configured for the domestic traffic rules [19].
Imported software has the significant drawback: it allows to model only separate crossroads or intersections without seeing the entire road network. The real situation is that intersections should be considered as elements of controls for the entire city's road network. In addition, it often happens that the features inherent in modern intelligent transport systems are not included in standard licenses, and can only be implemented by encoding in their own internal programming languages. This also applies to modelling the "green wave" and using the adaptive traffic light control algorithms [4].
There are many reasons why it is necessary to develop new modern import-substituting traffic control systems that designed by domestic authors and comply with Russian traffic regulations. In order to use the system on real road objects, the software application needs to be improved further in order to adapt it to the existing urban transport infrastructure.
Despite on fairly large amount of researches in the field of transport system automation, the issues of intelligent adaptive regulation using artificial neural networks are, currently, studied insufficiently. Further investigation of the problem of high traffic congestion is very urgent issue, so there is necessity to develop an automatic adaptive traffic light control system, the implementation of which will significantly improve the current situation. This is relevance and actuality of presented research.
The scientific novelty of this work is that the automated intelligent import-substitutive system has been developed that can have corrective effect on the group of traffic lights in the traffic intensity regulating area. To provide configuration and debugging of the neural network, the method of the object simulating was used. In these investigations, the multilayer perceptron with sigmoid activation function was used as artificial neural network, which led to the possibility of making decisions to optimize traffic congestion by changing the duration of light phases of traffic lights. Ready-to-implementation system was developed that allows analyzing incoming data and then making decision on traffic load regulation based on it.
The advantages of the developed system are the ability to make informed decisions based on extensive analysis of available information, as well as the ability to adapt the system constantly to external influences that entering non -equilibrium state, from which it is necessary to get out by solving problems. The developed intelligent system has practical significance: -Unloading of adjacent sections.
-Reducing the number of traffic jams in the lanes or decreasing the length of the car queue.
-Automation of traffic control and reduction of the set of emergencies that require the departure of inspection personnel for manual regulation of road traffic.
-Improving the overall situation with congestion by preventing cascading traffic jams on neighboring sections.
-Prevention of road accidents and conflicts between motorists and pedestrians.
-Improving the reliability of the commissioning system and reducing the cost of infrastructure maintenance.
The well -known classical formulas given in the work for solving the task of ensuring traffic congestion control using traffic lights, allow revealing the essence of the mathematical apparatus as a tool for achieving the set purpose [19] - [21].
As part of the work, the developed system was debugged using computer simulation on the tested model. Unfortunately, the automated intelligent system developed by the authors has not been tested yet on real transport facilities in the city of Rostov-on-Don due to quarantine measures in 2020 caused by the coronavirus pandemy.