Keywords

1 Introduction

Traffic light plays a very important role in controlling the traffic flows and giving turn to each lane of vehicles to proceed [1]. The conventional traffic light control system is operating based on pre-set time for the lights to turn on. It is known as fixed-time traffic light control system [2]. Fixed time traffic system will be turned green after a given period of time, usually around 30 s. Fixed-time control system mostly integrated with timing plans which the traffic light is set according to the specific time of day [3]. For example, during morning and evening peak hours. Historical record or the traffic pattern have to be known in order to implement timely schedule. This type of control system is relatively stable, and one cycle length is optimal especially during two to three peak hours period. However, it is not so optimal when it comes to other periods. In fact, the traffic flow is continuous fluctuating throughout the year [4]. It makes the system of real-time traffic control less robust and scalable for today’s traffic conditions that vary from time to time. As a result, traffic lights could worsen the traffic condition due to its unresponsiveness and causing the car drivers wait even longer for their turn to proceed. The negative impact of using Fixed-time system was also being proved in [5]. It is difficult to improve the performance of the traffic signal control system effectively and efficiently using conventional and traditional methods. The logic of intelligence is the need to control the red and green light periods and the decisions in traffic light settings due to fuzziness, and time fluctuations in the system [6]. The need of implementing fuzzy logic in a traffic light system to enable the traffic lights react accordingly and varyingly depend on the traffic condition is highly needed when the traffic condition is bad.

Therefore, this study proposes a smart lighting control system to efficiently and effectively manage traffic lighting periods using a fuzzy logic approach. Fuzzy logic is optimized to determine changes in green light duration that consider the congestion and road time. Using this system, the green light period can be adjusted in response to road conditions and time types such as peak, normal or off peak. Database systems are provided to store variables, rules, parameter values and log information. This is important to store that information, as it can be modified as needed. Controlling systems are developed using web-based technology to support system mobility and eligibility. In the future, it can also be further enhanced to integrate with IoT and other trusted devices.

The rest of the paper is organized as follows: Part II discusses related work. Part III presents the methodology and subsequent implementation and results in Part IV. Part V is the conclusion for the study.

2 Literature Review

Fuzzy systems are very useful systems in real life applications, especially machine control. Fuzzy systems are very flexible and can assist in handling inaccurate and incomplete data. In traffic systems, especially in big cities surrounded by an increasing number of vehicles, adaptive handling methods are needed. Monitoring and controlling traffic in the city is an important task because of its ability to control roads that also affect the quality of life. Currently, traffic signal controllers use real-time data and advanced algorithms [7]. This algorithm uses simple mathematical rules that are suitable for lower intersection load purposes. However, these methods cannot address complex road networks and increase the number of vehicles [8]. The current algorithm needs to be able to cope with continuous and varied changes in traffic situations.

Fuzzy logic enables the implementation of rules that are very similar to the human thought process. It can make decisions even when information is incomplete. Previous work using fuzzy logic included congestion (density) and the number of inlet vehicles as fuzzy inputs [9]. It took several vehicles to wait and the number of vehicles passing between the two intersecting traffic due to fuzzy inputs shown in [10]. This method needs to consider the intersection between all roads involved in traffic. Another advanced method introduced in [11] is controlling based on receiving and analyzing traffic patterns and responding in real time. This method is a bit more efficient and advanced, but it is too complicated and expensive to implement. Giovanni Pau et al. [7] use a fuzzy-based approach to deal with the dynamic management of traffic lights in pedestrian crossing and provide some solution of possibility to change the phases of the traffic light taking into account the time of the day and the number of pedestrians about to cross the road. Patil et al. [8] use fuzzy to change the timing of the green signal with respect to the intensity of traffic and feed this to an Arduino microcontroller based fuzzy inference system which decides the duration of the green signal. This study uses the densities mentioned in [9] and time travel as a fuzzy input in implementing fuzzy light control systems.

According to [8], image processing along with fuzzy logic is found to be more efficient although it takes time to process. Hassan et al. [12] applied a type-2 fuzzy for city traffic networks where their proposed method could increase road network capacity in a timely manner and reduce congestion. Moreover, the method in [12] can optimize the queue length reduction and reduce the average wait time of cars in a queue. The techniques proposed by [13] have accelerated the development of emergency vehicles while avoiding the creation of congestion around their route by using Traffic Management System (TMS) tailored to fuzzy logic combinations. Cheng [14] used a neuro-fuzzy group junction control algorithm to subdivide vehicles in the same lane into small groups and to schedule vehicle groups via wireless communications instead of signal lights. Scheduling such vehicles can reduce wait times and increase justice, especially when traffic volume in different lanes is unbalanced. Some studies such as Suhail et al. [15] use hybrid algorithms using hybrid algorithms that combine Fuzzy Logic Controller (FLC) and Genetic Algorithm (GA) and its applications to signal light systems. Such techniques used by [15] can improve the performance of traffic light guards, reducing traffic congestion and timeout [16]. The next section describes the analysis and design of the proposed system.

3 System Design

The implementation of fuzzy coordination system for traffic light involves the development of fuzzy knowledge base that performs the action of inferencing on the inputs received. The knowledge base requires knowledge from experts of trusted sources that are reliable or else it will affect the accuracy of decision of a fuzzy system. The following part of this section explains the system analysis and design.

3.1 Input and Output Requirement

Every fuzzy system must have input to be processed to produce the output. This fuzzy system requires two inputs which are density and time of day.

For the first input density, the system will require users to input the number of inflow vehicles, number of outgoing vehicles, and the distance between the two sensors. The formula for density [9] is calculated as in Eq. (1). For the input time of day, the system requires users to input any time in a day.

$$\frac{{v_{i} - v_{o} }}{d}$$
(1)

where \(v_{i}\) is the number of inflow vehicle, \(v_{o}\) is the number of outflow vehicles, and \(d\) is the distance between the two sensors.

The output of this system after the inferencing process will be a change of green light period. The fuzzy system will determine the duration of the green light based on the conclusions received.

3.2 Fuzzy System Design

The fuzzy system consists of 3 main components namely fuzzification, inferencing, and defuzzification. Fuzzification is the process of converting crude values into fuzzy values. Inferencing is a process of mapping formulation that produces outputs based on fuzzy logic implemented on inputs. Defuzzification is the process of converting blurred values into complex values.

Fuzzification

In this fuzzy system, three variables are used, namely density, time_of_day, and green_light_duration (GLC). Each fuzzy variable has been assigned the following fuzzy values:

  • Input:Density {sparse, average,dense}.

  • Input:Time_of_day {off_peak, normal, peak}.

  • Output:Green_light_changes {decrease, remain, increase}.

The universe of for density are from 0 to 0.2 [5]. Meanwhile the universe discourse for time_of_day are from 00:00 to 23:59. Lastly the green_light_changes changes crisp values are from −10 to 10.

The universe of discourse for density ranges from 0 to 0.2 based on [5]. Meanwhile, the discourse of the universe for the time of day is from 00:00 to 23:59. The green_light_changes are from −10 to 10.

Membership Function Graph

Membership function graphs are produced based on the input and output variables using membership function formula. The membership function graph for density uses the linguistic values namely sparse, average, and dense. The membership function graph for time_of_day displays the off peak, normal and peak condition. Value from 00:30 to 05:30 is identified to be labelled as off peak in its fuzzy set. While the values from 06:00 to 07:00, 09:00 to 12:00, 14:00 to 16:30, 19:30 to 00:00, is labelled as normal. If the values are from 07:30 to 08:30, 12:30 to 13:00, 17:00 to 19:00, the fuzzy set is labelled as peak.

While the membership function graph for fuzzy variable green_light_changes is determined to have decrease, remain and increase condition. The decrease condition is given value by −10. If the value is 0, the fuzzy set is labelled as remain. If the value is 10, then the fuzzy set is labelled as increase.

Such fuzzy membership function graph is drawn in the developed system. The graph will react to the input value and the output.

Fuzzy inferencing

Inferencing is a process of resulting an output based on fuzzy logic formulating the mapping on the input. One of the main components in the process fuzzy inferencing is the knowledge base. Knowledge base is the combination of knowledge and a collection of rules. In this fuzzy system, Fuzzy Associative Matrix (FAM) is used for the knowledge base. Table 1 shows the FAM for the traffic fuzzy controller system. It shows the output of linguistic variable green light duration changes after combination of input linguistic variable density and time of day.

Table 1 Fuzzy associative matrix

The part of rule based are extracted from the FAM and is presented with IF/THEN statement such as follows:

  1. 1.

    IF density is sparse and time of day is off peak, then green_light_changes remains.

  2. 2.

    IF density is sparse and time of day is normal, then green_light_changes decreases.

  3. 3.

    IF density is sparse and time of day is peak, then green_light_changes decreases.

  4. 4.

    IF density is average and time of day is off peak, then green_light_changes increases.

The rule from FAM contains two input linguistic variable and the degree of membership of the two variables will undergo and operator by finding the minimum degree of membership or the intersection of two fuzzy sets for inferencing purpose. The formula of intersection written in Eq. (2), such that \(A\) and \(B\) are the fuzzy sets, u is an element in the universe, u:

$$\mu A \cap B\left( u \right) = \hbox{min} \left\{ {\mu A\left( u \right),\mu B\left( u \right)} \right\}$$
(2)

Defuzzification

Defuzzification is the process of converting fuzzy values found from inferencing phase into crisp value. In this system, the defuzzification is achieved by using the method Center of Area (COA). It is used to find the center of area under the curve of membership function. The formula of COA is as written in Eq. (3), where z* is the fuzzified output of the system, ui is a membership function and x is the output variable.

$$z^{ *} = \frac{\smallint \mu i\left( x \right) \cdot xdx}{\smallint \mu i\left( x \right)dx }$$
(3)

Database

Database is used to store the information used of the system. It stores the linguistic variables and linguistic values. The system database has tables which are daily_session, density, green_light_changes (glc), and time_of_day. Table daily_session stores the id whenever users enter a new range for each linguistic variable, table density stores the value for fuzzy value sparse, average and dense. Table glc stores the value for fuzzy value decrease, remain and increase while table time_of_day stores the value for fuzzy value off peak, normal and peak. Figure 1 shows the example of one of the tables which is table density.

Fig. 1
figure 1

Density table in database

4 Implementation

This section discusses program code writing to implement system and test results. The system was developed using HTML for mark-up design, JavaScript for injection functions, Hypertext Pre-processor (PHP) for database connection and MySQL as a database.

4.1 Fuzzification

The value of degree of membership of each fuzzy value for \(x\) can be found using if else statement. Figure 2 shows the coding of finding value of degree of membership for density fuzzy value.

Fig. 2
figure 2

Membership function for fuzzy variable density

4.2 Fuzzy Inferencing

This process takes input from the output of fuzzy sets from the fuzzification process. Equation (2) is used to find the minimum value between the two membership levels of each fuzzy input and all the minimum values for each rule combination are then used to construct the FAM table. Figure 3 shows the encoding to obtain the minimum value and returns a three-dimensional 3 × 3 dimension known as the FAM table.

Fig. 3
figure 3

Fuzzy inferencing and output FAM in array

4.3 Defuzzification

During this process, each rule in FAM is performed using its own function for each value in the green light duration changes. The de-fuzzification implementation is shown in Fig. 4. Each defuzzification function as shown in Fig. 5 is converted to crisp values as a return. Then in the final step, an optimum change of the green light in the crude value is obtained by computing Eq. (3).

Fig. 4
figure 4

Crisp value transformation

Fig. 5
figure 5

Defuzzification implementation

5 Result and Discussion

There are two main modules in the system that are configuration modules and simulation modules. Configuration modules are built to allow administrators to change firing values for each linguistic variable such as Density, Daylight Time, and green_light_changes or GLC. Figure 6 shows the design of the configuration module interface. System administrators can adjust values for fuzzy variables or use standards. Traffic control simulations can be performed in the simulation module.

Fig. 6
figure 6

Interface design of configuration module

To start simulation, user could enter number of in flow, number of outgoing vehicles, distance between sensor1 and sensor2 (e.g. default is set 100 m) and also the time of day in 24 hour format. Simulation is carried out based on several test cases as shown below with different user inputs to indicate the fuzzy system responses on different input.

The case study is presented to show the realization of the developed system. The output from the system is shown in the following. The input used is the number of inflow vehicles, number of outgoing vehicles, the distance between sensor 1 and sensor 2 in meters and Time of Day. The output is Green Light Duration changes in seconds as shown in Table 2. FAM table and each linguistic graph will reflect based on the input entered as well, as shown in Figs. 7, 8, 9 and 10.

Table 2 Test case
Fig. 7
figure 7

FAM table and crisp output

Fig. 8
figure 8

Density membership function graph

Fig. 9
figure 9

Time of day membership function graph

Fig. 10
figure 10

Green light duration changes membership function graph

Such coordination system is significant to assist traffic light formation monitoring. The database which kept the data and knowledge base efficiently supports any changes which necessary.

6 Conclusion

A fuzzy-based traffic light control system was developed to manage traffic with the ability to respond to daylight and traffic congestion and then determine optimal changes to green light periods. However, this system has its limits when it comes to situations with different peak sessions, regular sessions or off-peak sessions. Thus, future work can be focused on the development of features that allow for dynamic configuration of the number of sessions required and also add more vague variables such as the course of the week to integrate with the current density and time variables.