IoT-based traffic prediction and traffic signal control system for smart city

Because of the population increasing so high, and traffic density remaining the same, traffic prediction has become a great challenge today. Creating a higher degree of communication in automobiles results in the time wastage, fuel wastage, environmental damage, and even death caused by citizens being trapped in the middle of traffic. Only a few researchers work in traffic congestion prediction and control systems, but it may provide less accuracy. So, this paper proposed an efficient IoT-based traffic prediction using OWENN algorithm and traffic signal control system using Intel 80,286 microprocessor for a smart city. The proposed system consists of ‘5’ phases, namely IoT data collection, feature extraction, classification, optimized traffic IoT values, and traffic signal control system. Initially, the IoT traffic data are collected from the dataset. After that, traffic, weather, and direction information are extracted, and these extracted features are given as input to the OWENN classifier, which classifies which place has more traffic. Suppose one direction of the place has more traffic, it optimizes the IoT values by using IBSO, and finally, the traffic is controlled by using Intel 80,286 microprocessor. An efficient OWENN algorithm for traffic prediction and traffic signal control using a Intel 80,286 microprocessor for a smart city. After extracting the features, the classification is performed in this step. Hereabout, the classification is done by using the optimized weight Elman neural network (OWENN) algorithm that classifies which places have more traffic. OWENN attains 98.23% accuracy than existing model also its achieved 96.69% F-score than existing model. The experimental results show that the proposed system outperforms state-of-the-art methods.


Introduction
The current high level of increase in the number of vehicles without additional supporting transportation infrastructure is a major problem for the smart city growth. The endless amount of car, which is very crowded in urban areas, increase air pollution and sound pollution, and other causes, which reduce the fuel efficiency, encourage the intersection traffic, and raise the pace of traffic by major changes in the speed control framework in urban areas (Kumar et al. 2020). Owing to the pollution and traffic disruptions generated by these mechanisms (signal control), traffic management and logistics are often major problems that must be dealt with. Previously, the traffic signals controls device looked to be utilised as a traffic management system, but now that it is being used as a smart city's traffic management system, it plays an important part in traffic safety (Jin et al. 2017). As one of the main inputs for understanding and managing traffic, traffic data collections are quite important. Traffic counting is a common occurrence nowadays, since a traditional state or city government has some way to maintain track of traffic, such as speed guns, radar weapons, microwave sensors, and cameras (Lingani et al. 2019;Subbulakshmi and Prakash 2018). But, IoT-based data collection is the best way to collect traffic information in the smart city (Muthanna et al. 2020) because it collects real-time traffic information. On the other hands, traffic congestion detection (i.e. traffic management) is one of the problems in the efficient traffic signal control system. In certain areas, Communicated by Vicente Garcia Diaz.
Extended author information available on the last page of the article traffic congestion in main roads has been a big issue with the shortage and restricted provision of public transport. If there is no initiative, this dilemma would be unmanageable (Tchuitcheu et al. 2020;Pattanaik et al. 2016). Various alternatives to the traffic jam crisis in the smart cities have been suggested. In order to reduce congestion, certain strategies propose the best individual routes (Doolan and Muntean 2016), which may exacerbate congestion in other regions (Neelakandan and Paulraj 2020). Others have proposed some classification algorithms, say, fuzzy neural network (FNN), random forest, C4.5, K-nearest neighbour (KNN), etc. (Zhao et al. 2019). But, the existing algorithm does not overcome the current problems in smart city traffic. If once the system efficiently classifies the congestion or traffic, it could be easily controlled by the system (Chakraborty et al. 2019). This paper proposed an efficient approach to classify the traffic and control the traffic efficiently by optimizing the waiting time using a microprocessor for a smart city. The rest of the paper is organised as follows: Sect. 2 addresses related works in the traffic forecast and traffic management framework for the smart city. In Sect. 3, the traffic prediction and traffic control technique are defined. Section 4 deals with findings and ultimately, Sect. 5 ends work and possible directions for studies planned.

Related work
Haipeng Yao et al. (2019) have proposed a traffic classification mechanism for the networking Internet of Things (IoT) capsule for cities with integrated extraction, practical collection, and classification model functionality. The technology also removed the manual selection method for traffic and extended in particular to smart city scenarios. In the sense of traffic classification, the capsule networks were included. Experimental findings showed the system's viability and efficacy which resulted in high-ranking accuracy, although the system's measurement costs and training time were high. Mengting Bai et al. (2020) implemented a forecast of traffic congestion using a relative congestive tensor in smart cities. First, a congestion matrix on regional traffic networks focused on the notion of relative places for the road nodes has been created. The machine then used a long-term memory network approach for forecasting congestion on all places of the road network. Experiments have shown that the device has greatly outperformed baseline models at any point where congestion sometimes exists. The spatial matrix designed therefore had such sparseness, and where there were a few road nodes in the regional road network, the usage of space was inadequate. The road network must then be fairly separated. Mondal and Rehena (2019) presented smart classification method of congestion traffic dependent on artificial neural network presented (ANN). The traffic congestion condition designation was performed using the ANN-based method. The ITS framework automatically updates the traffic laws, as adjusts the queue long in traffic signal signals, recommending alternative paths, depending on traffic congestion status. The consequence was that for various types of road segments of variable lane width, the machine specifically defined the congested status provided the model is thoroughly trained with appropriate traffic data sets. However, the machine has an overhead storage issue and the system's training period was longer. Joo et al. (2020) recommended reinforcement learning centred traffic signal management for smart cities. The device primarily maximises the amount of cars that reach a crossroads and balances road signals with Q-learning (QL). The configuration of the framework was adaptive and could be changed to suit improvements in the initial intersection structure. In comparison to other QL-based systems, the framework has done well as shorter queue duration and waiting time with a normal deviation in queue length. However, a traffic signal may not be operated more accurately by the machine. Albert Rego et al. (2018) introduced a framework for the effective handling of emergencies in smart towns, with a software-determined network-based control systems. This design has been developed upon a series of IoT networks consisting of illumination, traffic cameras, and an algorithm. The algorithm tracked resource demand and route shift to promote the deployment of emergency services vehicles (Neelakandan 2016). Experiments also shown that when the algorithm applied and the device could be scaled the emergency traffic delay increased by 33%. But, the system is not suitable for another kind of smart city realworld scenarios. The data collected using this system are uploaded to the cloud using a mobile application and then transferred to the field-programmable gate array (FPGA) analysis system. The raw data are computed and processed by the FPGA system, and pathological conditions are displayed on the patient's wearable IoT device (Satpathy et al. 2020). Major analysis necessitates a decent understanding of traffic operations management, but new developments like the Internet of Things (IoT) and artificial intelligence call for fresh and well-targeted effort, such that improvements can be made, such as traffic modelling and simulation and analytics (AI) (Sarrab et al. 2020). With intelligent traffic signal management (IS-), further transportation applications include public transit prioritisation (TSP), emergency vehicle prioritisation (EV), adaptative traffic signal control (ATSC), environmentally friendly modes of operation, eco-conscious modes of operation, and message control, and urban bus transportation promotion (Lee and Chiu 2020). While the new traffic signal control situation is challenging, this remains one of the main concerns. Traffic flows in these situations at 60-s intervals, and you are thus bound to see that each has a 60-s turn at least once on each segment (Janahan et al. 2018).

Proposed methodology
Today, traffic management has developed into one of the metropolitan city's main issues. The steady rise in vehicle numbers contributes to a repetitive traffic control crisis. The introduction and applicability of the Internet of Things in smart cities provide a great forum to cope with traffic challenges and thus build intelligent traffic management systems (ITMS). This paper proposed an efficient OWENN algorithm for traffic prediction and traffic signal control using a Intel 80,286 microprocessor for a smart city. Figure 1 presents the proposed traffic prediction and traffic signal control system. This model mainly consists of three phases, namely IoT data collection, traffic prediction, feature selection, and traffic signal control. Each phase is briefly explained in the below subsections.

IoT data collection
The initial process will be to collect the data from the public repository. The traffic IoT data, such as traffic-related information, weather-related information, and direction-related information, are extracted and get saved in the database for further process. The dataset is expressed as follows, A ID 00 ¼ a 1 00 ; a 2 00 ; a 3 00 ; . . .a n 00 f g ð1Þ where A ID 00 represents the traffic IoT dataset for further processing, and a n 00 indicates the n-number of traffic-related information in the dataset.

Feature extraction
In this phase, the feature extraction process is carried out. Once a specific function has been applied, subsequent development diminishes the data resources that are required to display the dataset. Redundant data are discarded, and an array of data with similar or equivalent data is generated instead. The data set has exactly one function, and one derived metric for each class of traffic information sets. Here, the system extracts traffic information, weather information, and direction information features. These features are explained briefly in the below section.

Traffic information
Traffic information gives the basis for traffic signal control systems. It covers data, policies, rules, and temporary measures. The important traffic information is extracted from the database is speed, the total number of vehicles, travel time, position, and street lighting features. These characteristics are used to define the service quality, the congestion quantity, and the steps to be implemented to mitigate circumstances. It is evaluated as follow: where B ti 00 indicates the extracted traffic information features, and b n 00 signifies the n-number of features.

Fig. 1 The system model
IoT-based traffic prediction and traffic signal control system for smart city 12243

Weather information
The weather information at this intersection was installed to warn drivers of conditions and reduce accidents. Here, the system extracts the weather information, such as snow, summer, and rainy, reduces roadway capacity. Hither, the system extracts these common features from the dataset. Mathematically, it is expressed as follow: where C wi 00 represents the extracted weather information feature, and c k 00 indicates the k-number of feature.

Direction information
The direction-based information is used to find the traffic and control the traffic signal effectively. Here, the system extracts the direction-based information as north, east, west, and south. These features are described mathematically as, where D di 00 denotes the extracted direction information feature, and d m 00 indicates the m-number of feature. These aforementioned features are extracted from the database; it is commonly denoted as E fs 00 , which is used for further processing.

Classification
After extracting the features, the classification is performed in this step. Hereabout, the classification is done by using the optimized weight Elman neural network (OWENN) algorithm that classifies which places have more traffic. Elman neural network (ENN) is an effective algorithm to classify objects. In a normal ENN, only one hidden layer is built, but, hither more number of hidden layers is utilized and each classification algorithm has the weight initialization problem, which also affects the system fastness and accuracy. So, here, a new weight initialization method is used, which will give a better result. So, the term is called an OWENN algorithm. The steps involved in the OWENN algorithm are explained below: First, the extracted feature set E fs 00 ¼ e 1 00 ; e 2 00 ; e 3 00 ; . . .e k 00 f gis given as input to the OWENN algorithm. The weight is calculated for the input value and that is given to the hidden layer. The hidden layer is mathematically described as follows: where F hl 00 l ð Þ indicates the l Àth output of the hidden unit, H cu 00 l ð Þ signifies the context unit that is described below, where g : ð Þ indicates the transfer function of the hidden layer, j 1 and j 2 indicate the connection weight of the input layer to the hidden layer and the context unit to the hidden layer, thus, context unit is also useful for weight calculation but, hither the Glorot weight-based weight value is calculated, which is stated as follows, where j m signifies the weight value (m ¼ 1; 2; 3; . . .; n), U d indicates the uniform distribution, and k indicates the size of the previous layer. Thus, the hidden layer output is given as the input to the output layer. The output calculation is formulated as follows, where I l ð Þ signifies the output layer, / : ð Þ signifies the transfer function of the output layer, and j 3 represents the weight of the hidden layer to the output layer. The pseudocode for the proposed algorithm is elucidated in the below figure.
It identifies which places have more traffic accurately. Once it finds one direction of the place that has more traffic, it optimizes the traffic IoT values, and it increases the waiting time of the vehicle by using the Intel 80,286 microprocessor; otherwise, it sets the default time of the traffic signal.

Optimize traffic IoT values
In this section, the IoT traffic values (A ID 00 ) are given as input to the improved beetle swarm optimization (IBSO) algorithm. The beetle swarm algorithm (BSO) is a powerful algorithm that is suggested by improving the efficiency of swarm optimization by implementing the concepts of beetle forage. But, the conventional BSO algorithm has a convergence problem and less optimization accuracy. So, this paper proposed an IBSO algorithm that selects the high fitness value from the gathered IoT data. The procedures included in the IBSO algorithm are explained below: Initialize the traffic IoT values as A ID 00 ¼ a 1 00 ; a 2 00 ; a 3 00 ; . . .:a n 00 f g . Then, the fitness value of each beetle position (i.e. vehicle) is calculated. The speed of the m Àth beetle is described as J sb 00 ¼ j 1 00 ; j 2 00 ; j 3 00 . . .j m 00 È É . The individual extremity of the beetle is described as K eb 00 ¼ k 1 00 ; k 2 00 ; k 3 00 . . .::k m 00 È É , and the group extreme value of the population is expressed as L ge 00 ¼ l 1 00 ; l 2 00 ; l 3 00 ; . . .l m 00 È É . The mathematical model for simulating its behaviour is as follow: where m ¼ 1; 2; . . .; n, z indicates the current number of iterations, j m 00 indicates the speed of the beetles, l denotes the positive constants, and q m 00 describes the increase in beetle position movement. Thus, the speed formula is written as follows: where a 1 and a 2 denote two positive constants, b 1 and b 2 indicate two random functions in the range [0, 1], u signifies the levy flight to select optimal weight, g indicates the standard normal distribution, and z indicates the current number of iterations. After that, update the incremental function by using, whereN zþ1 lm and N zþ1 rm indicate the search behaviour of position of the vehicle (i.e. direction of the vehicle), respectively, d signifies the distance between the vehicles and f : ð Þ signifies the fitness value. High fitness value is taken as optimal values, which are used for further processing.

Traffic signal control system
After optimizing the traffic IoT values, traffic signals are controlled by using the Intel 80,286 Microprocessor in this phase. It controls the traffic signal automatically (i.e. increase the waiting time of the vehicle) based on the IoT values. The Intel 80,286 is an advanced microprocessor, and it is a 16-bit microprocessor. It provides special operations to allow effective operating system deployment and execution. For example a command may stop the output of a task, save its status, turn to another task, load its state, and start the performance of the new task. It also helps virtual memory structures by offering an exception and restartable guidance for segments not current. It consists of '4' sectional blocks, namely address unit, bus unit, instruction unit, and an execution unit. The working principles of these blocks are separately explained below: Address Unit Initially, the address unit is computed for the physical address where the data or directions are to be fetched (i.e. optimised Traffic IoT values). The determined address shall then be passed to the bus unit after measurement of the physical address.
Bus Unit The data were collected from the memory via the data bus. The bus unit can fetch the instructions from the memory in advance and save them in the queue for the smoother implementation of the instruction. It then sends them on the command unit.
Instruction Unit The instruction unit now decodes the instructions. When instructions are extracted from a queue, the decoder constantly pays attention to the instructions and stores the instructions into a properly decoded list. In this instruction unit, the proposed system sets the waiting time of the vehicle based on the IoT values. For example, for 100 IoT values, it sets one waiting time, for 200 IoT values, it sets another one waiting time, etc.
Execution Unit The instructions from the decoded instruction queue are fed to the execution unit. Here, suppose, one direction of the place has more traffic, then it increases the waiting time based on the optimized traffic IoT values to provide sophisticated control and coordination to confirm that traffic moves as smoothly and safely as possible.

Results and discussion
In this section, the performance of the proposed IoT-based traffic prediction and traffic signal control system for a smart city is analyzed. The proposed system collects the data from the Kaggle dataset, which is the publically available dataset. The system is implemented in the working platform of JAVA. The performance of the proposed system is validated through the performance analysis section.

Performance analysis
In this performance analysis, the performance of the proposed OWENN algorithm is compared with some traditional techniques, namely Elman neural network (ENN), convolutional neural network (CNN), neural network (NN), and adaptive neuro-fuzzy inference system (ANFIS) techniques. The scheme utilises four estimation metrics used for classification problems to assess the efficiency of the proposed procedure, i.e. precision, f-measurement, mean absolute error (MAE), and root mean square error (RMSE). When the MAE calculates the average magnitude of all predictions is assumed to be right, it does not regard the position of the errors. Accuracy for continuous data is reported as well as infrequently as event-related data. It is calculated as the mean square error of the overall measurement samples, which represents the overall standard deviation of the prediction versus the actual observation. The root mean square error (RMSE) squares are a type of scoring law that computes the average magnitude of the error. Once the average has been expanded, the square root is found. Big errors are multiplied until they are averaged, making the RMSE a higher-weight to large-error parts of the score than it does to small ones. These analyses are shown in the figure below (Fig. 2).
Discussion The above figure indicates the performance of the proposed OWENN algorithm with conventional ENN, CNN, NN, and ANFIS methods in terms of accuracy and f-measure metrics. Concerning the accuracy metric, the proposed one attains 98.23% accuracy, but the existent ENN, CNN, NN, and ANFIS achieved accuracy of 95.12%, 94.77%, 91.53%, and 90.01%, respectively, which is very lower when compared to the proposed one. Concerning the f-measure metric, the existing ANFIS achieved lower performance than the proposed one. Also, the existing ENN, CNN, and NN offer low-level performance than the proposed one. But, the proposed OWENN achieved f-measure of 96.69%, which is higher than all the existing methods. Thus, the discussion concludes that the proposed one attains better results (Fig. 3).
Discussion The above figure evinces the performance of the proposed OWENN algorithm with the prevailing techniques, say, ENN, CNN, NN, and ANFIS techniques in terms of (a) MAE and (b) RMSE performance metrics. The MAE and RMSE are two important metrics to measure accuracy for continuous variables. The performance is centred on the number of time intervals (5 min-25 min). From Fig. 4a, for 5 min interval, the proposed one has an MAE value of just 0.107, which is lower than the conventional ENN, CNN, NN, and ANFIS methods. For, the remaining time interval also, the proposed one attains better performance than the existing methods. From  Fig. 4b, the existing ANFIS proffers high RMSE. Also, the existing ENN, CNN, and NN proffer high RMSE, but the proposed one offers RMSE of 5 min-25 min time interval is 0.203, 0.234, 0.218, 0.324, and 0.345, respectively, which is very lower than all the existing methods. Also, OWENN produced least incorrect classification compared to existing model. Overall, the discussion shows that the performance of the proposed system gradually decreases, while the time interval increases, and also, the proposed one attains better performance than the conventional methods.

Conclusions
There are also drawbacks to handle existing traffic efficiently in the conventional framework. This paper introduced an effective OWENN algorithm to effectively forecast traffic and a proposal to enhance and improve performance in Intel 80,286 Microprocessor traffic management. The proposed system comprises of '5' phases, namely IoT data collection, feature extraction, classification, optimized traffic IoT values, and traffic signal control system. The performance of the proposed system is compared with the existent ENN, CNN, NN, and ANFIS methods in terms of accuracy, f-measure, MAE, and RMSE metrics. Here, the proposed model OWENN achieved 98.23% accuracy and 96.69% measure. And also, the proposed one offers an average MAE and RMSE of 0.254 and 0.345, respectively, which is lower when contrasted to the existing techniques. Overall, the test findings revealed the high degree of efficiency of the suggested relative to traditional approaches. The future enhancement of the proposed system uses WiFi connectivity to communicate among the end users, but its energy usage and recharging solutions are considered in future work. Also to control the energy efficient based for smart city will be considered in future.
Authors contributions SN, MAB contributed to technical and conceptual content and architectural design and ST, VBD contributed to guidance and counselling on the writing of the paper. IB and AN contributed for testing and validation of outcomes.

Declarations
Conflict of interest The authors declare that they have no conflict of interest.