1 Introduction

Unsignalized intersections are the most common form of intersections in a road network. Unsignalized intersections include “priority unsignalized intersections” where priority is indicated by signs and “uncontrolled intersections” where no explicit priorities exist. Most of the studies on unsignalized intersections have been carried out assuming that the law of priority is fully respected. The traffic flow situations in India are considerably different from those in developed countries. There exist a mix of various types of vehicles with wide variations in their sizes and operating conditions. Priority rules are not respected and vehicles do not follow the lane movement. However, at a few intersections, where a minor road is joining a major road, the vehicles on the minor road will perceive higher priority for the major road vehicle, not because of signs but due to the existing traffic and geometric characteristics. This will result in observing partial priority by vehicles even in the absence of stop and yield signs. These cases of uncontrolled and partially controlled intersections are not well studied in the literature. Unlike highway capacity manual (HCM) 2010, there is no standard procedure available to evaluate the intersections in India. One of the main reasons for relatively less work on unsignalized intersection in India is the complex vehicle interactions resulting from heterogeneous traffic, aggressive drivers’ behavior, and inefficient enforcement of traffic rules. Fuzzy theory—widely used to model human behavior at situations involving uncertainty and imprecision—can be a good tool to evaluate and model driver’s behavior at uncontrolled or partially controlled intersections.

Gap acceptance is an important objective characteristic of the behavior of drivers and it has influence on capacities, delays, and road safety at unsignalized intersections. The HCM uses gap acceptance concept for determining the capacity of unsignalized (sign controlled) intersections. Gap acceptance behavior is a choice by a driver to accept or reject a gap of particular size, and it is the result of a decision process of human brain. The choice usually depends on the driver’s characteristics in addition to various external factors related to vehicles, traffic, and environment. The assessment of these factors is subject to uncertainty and imprecision. Fuzzy logic has been widely used to model human decisions in an environment of uncertainty and imprecision. Adaptive neuro-fuzzy interface system (ANFIS) combines the abilities of fuzzy set theory and neural network and provides an optimization scheme to find the parameters in the fuzzy system that best fit the data.

Gap acceptance at intersection is the process in which a vehicle in the secondary access accepts gaps available in the primary traffic stream. Thus, a vehicle at intersection intending to take right turn requires choosing between two alternative actions: to accept or reject an available gap. This decision is affected by driver characteristics and also by characteristics of the gap and the choice situation. The driver characteristics that affect the gap acceptance decision may include gender, age, driving skill, etc. [13]. Gap and choice situation factors may include gap size, speed of vehicles, type of subject and conflicting vehicle types, waiting time, type of sign control, etc. [16]. Many researchers dealt with gap acceptance at unsignalized intersections with the assumption that priority is fully respected, such as Hawkes [7], Ashworth [8, 9], Ashton [10], Miller [11], Polus et al. [12], Davis and Swenson [13], Xu and Tian [14].

Fuzzy logic and ANFIS have been successfully used in many engineering areas, for example, pedestrian behavior [15], capacity estimation [16], driving situation recognition [17], collision avoidance support system [18], traffic signal control at isolated intersection [19], rainfall prediction, signal co-ordination, and highway accident analysis [20]. Work related to application of fuzzy set theory for gap acceptance at priority intersection has been done by Rossi et al. [21], Rossi and Meneguzzer [22], and Rossi et al. [23]. Rossi and Meneguzzer [22] modeled the gap acceptance behavior at priority intersections using neuro-fuzzy system. In their work, the input variables considered are (i) if driver is facing gap or lag (binary variable), (ii) gap/lag size in seconds, and (iii) type of maneuver; the output variable is driver’s decision to accept or reject the gap/lag. Further Rossi et al. [23] used data from driving simulator to develop gap acceptance fuzzy model. In another study, Rossi et al. [21] analyzed and compared random utility models and fuzzy logic models for representing gap acceptance behavior using data from driving simulator experiments. However, other parameters which affect the divers’ decision such as vehicle type, geometry, and composition of vehicle type were not considered in these studies.

Most of the above studies are based on the assumption that the law of priority is fully respected. Limited work has been done for gap acceptance at unsignalized intersections with no priority or limited priority, which are prevalent in India. A few studies conducted for such conditions include Ashalatha and Chandra [24], Rao and Rengaraju [25, 26], etc. However, these studies do not focus on gap acceptance behavior at intersection. Kanagaraj et al. [27] developed probit-based gap acceptance models merging vehicles. Four different types of merging has been considered, namely, normal merging, forced merging, group merging, and vehicle cover merging for left-turning vehicles at uncontrolled T-intersection. The gap acceptance behavior of right-turning vehicles which involve crossing of major road through vehicles is not considered.

The literature discussed above shows that more studies are required for proper understanding of gap acceptance behavior at uncontrolled intersections. The traffic flow characteristics at intersection are the result of complex interactions between drivers, vehicles, transport facilities, and the environment, which are not easy to model. Considering the capabilities of ANFIS and some of its applications to traffic flow modeling, we adopted the ANFIS proposed by Jang [28] to model the gap acceptance behavior of right-turning vehicles at partially controlled T-intersections in this study. Vehicles are driven on the left side in India, thus right turns are critical. Here, we are considering gap acceptance of two right turning movements at T-intersection, one from major to minor approach and the other from minor to major approach. When a vehicle is taking right turn, it conflicts with the through vehicles on the major approach. Note that there is a possibility of conflicts between right-turning vehicles of major and minor approaches. However, in this study, we did not observe many such instances. Moreover, we did not select such data for analyzing gap acceptance behavior. Gap is defined as the time interval between passing of the rear bumper of a leading vehicle and front bumper of the immediate following vehicle at a point. Lag is defined as the time elapsed after a right turn intended vehicle reaches the stop line until a major approach conflicting vehicle reaches the conflict point. Details of gap/lag measurement at intersections can be referred to in [29].

2 Data collection

Four T-intersection sites were selected for this study: three in Aurangabad city (intersection 1, 2, 4) and one in Thane city (intersection 3). Both cities are in Maharashtra state; Thane city is in Mumbai region, where two-wheelers composition is less compared to other cities in India. Intersections are selected such that at each site a nearby building is available to place a camera. Other points considered were plain terrain, adequate sight distance at intersection, no parking, no bus bays, and sufficient distance from adjacent intersections. Geometry of intersection is as shown in Fig. 1. Geometry of all intersections is similar except intersection 2, where minor road is two-lane divided. However, since the major roads to be crossed by the right turning movements are 4-lane divided at all intersections, the gap acceptance behavior is expected to be similar. Data were collected during morning hours (approximately between 10:00 to 11:00 am) of typical weekdays. Video recording was done for about 60 min at each intersection covering all three approaches. Data was extracted in laboratory by playing the video on computer screen. Data extracted include gap/lag in seconds, subject vehicle type (vehicle intending to take right turn) and conflicting vehicle type. The vehicles are divided into 4 categories: two-wheeler, auto-rickshaw, car, and bus/truck. Extracted data include observations of 384 and 530 vehicles for major and minor road right turning movements, respectively. The total lags/gaps (both accepted and rejected) are 722 for major road right turning movements (WS movement in Fig. 1). For minor road right turning (SE movement), the total lags/gaps (both accepted and rejected) are 1,066.

Fig. 1
figure 1

Geometry of intersections

3 Preliminary data analysis

Table 1 shows the traffic composition at all intersections as well as the mode-wise share (in  %). It can be observed that the proportion of two-wheelers at all intersections is much higher than other modes. This proportion is significantly high at the three intersections in Aurangabad city (74.47 %, 69.93 %, and 78.76 %, respectively, at intersections 1, 2, and 4). At the intersection in Thane city (intersection 3), the proportions of auto-rickshaws and cars are nearly close to two-wheelers proportion. Thane city is within the Mumbai Metropolitan Region (MMR) where public transport is heavily used, thus has relatively less proportion of two-wheelers compared to other three intersections.

Table 1 Traffic composition and mode-wise share at all intersections

Figure 2 through Fig. 4 shows the cumulative percentage of gap accepted and rejected by right turning two-wheelers, auto-rickshaws, and cars (called as subject vehicle type) with other conflicting vehicle types (the major road through vehicle type which may conflict with right-turning vehicles). Buses and trucks constitute a very small fraction of the total traffic as subject vehicle type and are not included in the vehicle type to vehicle type interaction analysis. Note that in the cumulative accepted gap graphs, the curves do not reach 100 % on y-axis. This is because the gaps more than 8 s are not plotted on x-axis. It is clear from these graphs that the conflicting vehicle types affect the gap acceptance behavior. As seen in Fig. 2, for a gap of 3 s, about 22 % of two-wheelers are accepting the gaps if the conflicting vehicles are two-wheelers, but the percentage drops to about 10 % if the conflicting vehicles are cars. An interesting revelation from this analysis is that less percentage of cars or three-wheelers accepts a given gap if the conflicting vehicle is a two-wheeler compared to when conflicting vehicles are cars or three-wheelers. For example, in Fig. 3, about 30 % of three-wheelers accept a gap of 3 s when the conflicting vehicles are cars; but the acceptance rate is only about 10 % when the conflicting vehicles are two-wheelers. Similarly, as seen in Fig. 4, about 35 % of cars accept gaps of 3 s when the conflicting vehicles are three-wheelers, but the percentage reduces to about 18 % acceptance when two-wheelers are conflicting. This behavior of three-wheelers and cars when the conflicting vehicle is a two-wheeler may be because of the general perception that two-wheelers require less time to clear the intersection, they are aggressive, and their actions are unpredictable. Another reason for the pessimistic behavior from cars and three-wheelers toward two-wheelers is that in case of collision, often, bigger vehicles are held responsible.

Fig. 2
figure 2

Cumulative  percentage of no. of gaps accepted and rejected for two-wheelers with other conflicting vehicle types

Fig. 3
figure 3

Cumulative  percentage of no. of gaps accepted and rejected for auto-rickshaw with other conflicting vehicle types

Fig. 4
figure 4

Cumulative  percentage of no. of gaps accepted and rejected for car with other conflicting vehicle types

4 Development of ANFIS models

The gap acceptance of the right turning movement from major to minor approach (WS) and the right turning movement from minor to major approach (SE) movements are the focus in this study (see Fig. 1). The conflicting movement for both WS and SE is the through traffic from east to west on the major road (EW). Based on the preliminary analysis, we identified three input variables: size of gap (s), subject vehicle type, and conflict vehicle type for developing ANFIS. The output variable is driver’s decision—a binary variable indicating acceptance or rejection of the gap. The Fuzzy Logic toolbox available in MATLAB is used for developing the model. The variable size of gap is a fuzzy variable, and is divided into three linguistic variables: small gap, medium gap, and large gap. In fuzzy logic, a fuzzy variable is the variable which takes a quantity that can take on linguistic rather than precise numerical values. Initially, a membership function of input variables is supplied exogenously. This membership function will get tuned or adjusted during backward learning process of ANFIS to minimize the training error. Tuned membership function for gap, which defines the range of linguistic terms, is as shown in Fig. 5. The remaining two input variables, subject vehicle type and conflicting vehicle type, are considered as crisp variables. Variables that are measured precisely are called crisp variables. These crisp variables require the same treatment as a fuzzy variable to introduce them in neuro-fuzzy system. For these variables, two-wheeler is coded as 1, auto-rickshaw as 2, and car as 3. Observations for heavy vehicles (bus/truck) as subject vehicle type are very less and are not considered. However, a few observations are available for heavy vehicles as conflicting vehicle type; this category is considered for conflicting vehicle type and coded as 4.

Fig. 5
figure 5

Membership function of gap/lag for major and minor road vehicle model

ANFIS usually consists of a six-layer feedforward neural network structure. Figure 6 shows the ANFIS architecture for a model with two inputs: gap size (GAP or x1) and subject vehicle type (SVT or x2), and one output: possibility of accepting gap (y) (for detailed structure of ANFIS see Jang et al. [20] ). Brief explanation of each layer is as discussed below:

Fig. 6
figure 6

Structure of ANFIS

Layer 1 is called the input layer. In this layer, neurons pass the input signals (also known as crisp) to next layer. Layer 2 is known as the fuzzification layer. The fuzzification is a process in which the variable is divided into linguistic variables defined by membership function. Layer 3 is the rule layer. In this layer, each neuron corresponds to a Sugeno-type fuzzy rule [30]. Rules are defined as follows:

If GAP is Small and SVT is CAR then possibility of accepting gap is 0

If GAP is High and SVT is CAR then possibility of accepting gap is 1

and so on.

The layer 3 neurons receive inputs from the layer 2 neurons and calculate the output of the layer known as the firing strength of the rule. The output of neuron i in Layer 3 is obtained as

$$y_{i}^{(3)} = \mathop \prod \limits_{j = 1}^{k} x_{ji}^{(3)} ,$$
(1)

where x (3) ji is the input from neuron j located in layer 2 to neuron i in layer 3; k is the number of fuzzy set neurons; and y ( i 3) is the output of rule neuron i in layer 3 (i.e., firing strength). In layer 4, called the normalization layer, each neuron receives inputs from all neurons in the rule layer, and calculates the normalized firing strength—the ratio of the firing strength of a given rule to the sum of firing strengths of all rules—of a given rule. Layer 5 is the defuzzification layer. Defuzzification is the process in which the weighted consequent value is determined for a given rule. Layer 6 is the output layer having single neuron. In this layer, overall output y is determined by summing all the outputs from layer 5. As in neural network, the learning algorithm of ANFIS includes a forward pass and a backward pass. In the forward pass, a set of input parameters is presented to ANFIS and outputs are calculated layer by layer. If we have a training set of P input–output patterns, the output can be represented in matrix notation as below [28]:

$$\varvec{y}_{\text{d}} = \varvec{Ak},$$
(2)

where yd is a P × 1 output vector used for training; A is a P × n(1 + m) matrix and k is a n(1 + m) × 1 vector of unknown consequent parameters; m is the number of input variables; and n is the number of neurons in the rule layer. Generally the elements in yd are much larger than the number of unknowns, that is P is greater than n(1 + m). Thus, exact solutions to Eq. (2) may not exist and a least-square estimate of k, k*, is obtained that minimizes the squared error (Ak-yd)2. It is done by using the pseudo-inverse technique [28]:

$$\varvec{k}^{\varvec{*}} = (\varvec{A}^{\text{T}} \varvec{A})^{ - 1} \varvec{A}^{\text{T}} \varvec{y}_{\text{d}} ,$$
(3)

where AT is the transpose of A and (ATA)−1AT is the pseudo inverse of A, if (ATA) is non-singular. Once the consequent parameters are obtained, an actual network output vector, y, can be computed and the error vector, e, is determined by

$$\varvec{e} = \varvec{y}_{\text{d}} - \varvec{y }.$$
(4)

The back-propagation algorithm is used for backward pass and antecedent parameters are updated. All extracted data are converted to a desired format required for ANFIS; about 80 % of the data is used for training purpose and the rest are kept for validation. For a given set of inputs, the ANFIS gives output in the range of 0–1. The training prediction is calculated to know how well the model is trained with given input training data. Different combinations of input variables are used to develop four different models for major and minor road right-turning vehicles. Separate models are developed for major road right turning and minor road right-turning vehicles (see Tables 2 and 3). The number of rules created and training predictions are presented in the Tables. It can be observed that the prediction accuracy by all models is greater than 70 %.

Table 2 Models for major road right-turning vehicles
Table 3 Models for minor road right-turning vehicles

5 Validation and comparison of models

As mentioned above, about 20 % of the data are randomly selected and kept for the validation of the various models developed (see Table 4). Provost et al. [31] suggested the use of receiver operator characteristic (ROC) curves for binary decision problem, because simply using prediction by model can be misleading. ROC curve shows how correct predictions of model vary with incorrect predictions of model. Precision-recall (PR) curve is an alternative to ROC curves, and can be used if data are highly skewed. In ROC curves, data should be present in the upper left-hand corner, and in PR curves, it should be in the upper right-hand corner [31]. The output of ANFIS model is the possibility of accepting the lag/gap and it varies from 0 to 1. If the possibility of accepting lag/gap is greater than 0.5, then the particular lag/gap is taken as accepted.

Table 4 Data for model validation

From the validation results, we need to group the responses into the following categories: (i) true positive (TP) (response correctly labeled as positives), (ii) false positives (FP) (response incorrectly labeled as positive), (iii) true negatives (TN) (negatives correctly labeled as negative), and (iv) false negatives (FN) (response incorrectly labeled as negative). For gap acceptance problem, gap accepted is considered as condition positive and gap rejected is considered as condition negative. Calculations are done by considering three cut-off points for gap: (i) less than or equal to 5 s, (ii) greater than 5 s and less than or equal to 10 s, and (iii) greater than 10 s and less than or equal to 21 s (see Table 4). The false positive rate (FPR) is the proportion of negative responses that are misclassified as positive, whereas the true positive rate (TPR) is the proportion of positive responses that are correctly labeled [31]. Recall used in the PR curves is the same as TPR, and the precision is the fraction of responses classified as positive that are truly positive, i.e., positive predictive value.

The ROC and PR curves for major road right turning model are shown in Fig. 7 and for minor road right turning in Fig. 8. The ROC curves clearly show that they are dominating upper-left corner side; it is 1 for minor road right-turning vehicles. Also PR curves show that all data points tend toward right upper corner. Comparison of predictions of ANFIS models with field observations for major and minor right-turning vehicles are presented in Fig. 9 and Fig. 10, respectively. The percentages of correct predictions by ANFIS range from 75.17 % to 82.16 % for major road right turning and 87.20 % to 88.62 % for minor road right turning. For major road, ANFIS model A4 gives the highest prediction rate. For minor road, ANFIS model B4 has maximum predicated rate.

Fig. 7
figure 7

ROC curve and PR curve for major road right-turning vehicles. a ROC curve. b PR Curve

Fig. 8
figure 8

ROC curve and PR curve for minor road right-turning vehicles. a ROC curve. b PR Curve

Fig. 9
figure 9

Prediction of major road models

Fig. 10
figure 10

Prediction of minor road models

6 Summary and conclusions

Unlike in developed countries, the unsignalized intersections in India are not properly controlled; that is, the priorities of different movements are not fully respected. At a few intersections, limited priorities are observed where the right-turning vehicles look for suitable gaps in through vehicles. The primary focus of this paper is to model the gap acceptance behavior of vehicles at partially controlled intersections in India with the application of ANFIS. Gap acceptance data are collected at four T-intersections with the help of video camera. From preliminary analysis of data, it is found that less percentage of cars or three-wheelers accepts a given gap if the conflicting vehicle is a two-wheeler compared to when conflicting vehicles are cars or three-wheelers.

An ANFIS is developed for the extracted data considering various input variables (gap size, subject vehicle type, and conflicting vehicle type). Four different combinations of input variables have been considered for major and minor road right turnings separately. Training prediction accuracy by all models is greater than 70 %. ANFIS models also predicted well for the 20 % data kept for validation. Predictions of minor road models are slightly better than major road models.

ANFIS modeling can easily be generalized to various gap acceptance situations such as four-legged intersections including variables related to geometry, by changing if…then rules or form of membership functions. The model can be a potential supplement to microscopic traffic simulators. The results indicate that the ANFIS can be used to model the gap acceptance behavior at partially controlled intersections. In this study, we have considered only right turning movement at T-intersection; the study can be extended to four-legged intersections and more movements can also be studied. Effect of some other parameters such as approach speed, geometric characteristics, driver’s characteristics, etc. will further increase the understanding of the traffic behavior at uncontrolled intersections.