1 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, 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.

2 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 real-world 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).

3 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.

Fig. 1
figure 1

The system model

3.1 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,

$$ \overline{A}_{ID}{^{\prime\prime}} = \left\{ {\overline{a}_{1}{^{\prime\prime}} ,\overline{a}_{2}{^{\prime\prime}} ,\overline{a}_{3}{^{\prime\prime}} ,\ldots\overline{a}_{n}{^{\prime\prime}} } \right\} $$
(1)

where \(\overline{A}_{ID}{^{\prime\prime}}\) represents the traffic IoT dataset for further processing, and \(\overline{a}_{n}{^{\prime\prime}}\) indicates the \(n\)-number of traffic-related information in the dataset.

3.2 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.

3.2.1 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:

$$ \overline{B}_{ti}{^{\prime\prime}} = \left\{ {\overline{b}_{1}{^{\prime\prime}} ,\overline{b}_{2}{^{\prime\prime}} ,\overline{b}_{3}{^{\prime\prime}} ,\ldots \overline{b}_{n}{^{\prime\prime}} } \right\} $$
(2)

where \(\overline{B}_{ti}{^{\prime\prime}}\) indicates the extracted traffic information features, and \(\overline{b}_{n}{^{\prime\prime}}\) signifies the \(n\)-number of features.

3.2.2 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:

$$ \overline{C}_{wi}{^{\prime\prime}} = \left\{ {\overline{c}_{1}{^{\prime\prime}} ,\overline{c}_{2}{^{\prime\prime}} ,\overline{c}_{3}{^{\prime\prime}} ,\ldots\overline{c}_{k}{^{\prime\prime}} } \right\} $$
(3)

where \(\overline{C}_{wi}{^{\prime\prime}}\) represents the extracted weather information feature, and \(\overline{c}_{k}{^{\prime\prime}}\) indicates the \(k\)-number of feature.

3.2.3 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,

$$ \overline{D}_{di}{^{\prime\prime}} = \left\{ {\overline{d}_{1}{^{\prime\prime}} ,\overline{d}_{2}{^{\prime\prime}} ,\overline{d}_{3}{^{\prime\prime}} ,\ldots\overline{d}_{m}{^{\prime\prime}} } \right\} $$
(4)

where \(\overline{D}_{di}{^{\prime\prime}}\) denotes the extracted direction information feature, and \(\overline{d}_{m}{^{\prime\prime}}\) indicates the \(m\)-number of feature. These aforementioned features are extracted from the database; it is commonly denoted as \(\overline{E}_{fs}{^{\prime\prime}}\), which is used for further processing.

3.3 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 \(\overline{E}_{fs}{^{\prime\prime}} = \left\{ {\overline{e}_{1}{^{\prime\prime}} ,\overline{e}_{2}{^{\prime\prime}} ,\overline{e}_{3}{^{\prime\prime}} ,\ldots\overline{e}_{k}{^{\prime\prime}} } \right\}\) is 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:

$$ \overline{F}_{hl}{^{\prime\prime}} \left( l \right) = g\;\left( {\kappa_{1} \,\overline{H}_{cu}{^{\prime\prime}} \left( l \right) + \kappa_{2} \,\overline{E}_{fs}{^{\prime\prime}} \,\left( {l - 1} \right)} \right) $$
(5)

where \(\overline{F}_{hl}{^{\prime\prime}} \left( l \right)\) indicates the \(l^{ - th}\) output of the hidden unit, \(\overline{H}_{cu}{^{\prime\prime}} \left( l \right)\) signifies the context unit that is described below,

$$ \overline{H}_{cu}{^{\prime\prime}} \left( l \right) = \overline{F}_{hl}{^{\prime\prime}} \left( {l - 1} \right) $$
(6)

where \(g\,\left( . \right)\) indicates the transfer function of the hidden layer, \(\kappa_{1}\) and \(\kappa_{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,

$$ \kappa_{m} \sim U_{d} \,\left[ { - \frac{1}{\sqrt k },\frac{1}{\sqrt k }} \right] $$
(7)

where \(\kappa_{m}\) signifies the weight value (\(m = 1,2,3,\ldots,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,

$$ I\left( l \right) = \phi \,\left( {\kappa_{3} \;\overline{F}_{hl}{^{\prime\prime}} \left( l \right)} \right) $$
(8)

where \(I\,\left( l \right)\) signifies the output layer, \(\phi \,\left( . \right)\) signifies the transfer function of the output layer, and \(\kappa_{3}\) represents the weight of the hidden layer to the output layer. The pseudo-code 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.

3.4 Optimize traffic IoT values

In this section, the IoT traffic values (\(\overline{A}_{ID}{^{\prime\prime}}\)) 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 \(\overline{A}_{ID}{^{\prime\prime}} = \left\{ {\overline{a}_{1}{^{\prime\prime}} ,\overline{a}_{2}{^{\prime\prime}} ,\overline{a}_{3}{^{\prime\prime}} ,\ldots.\overline{a}_{n}{^{\prime\prime}} } \right\}\). Then, the fitness value of each beetle position (i.e. vehicle) is calculated. The speed of the \(m^{ - th}\) beetle is described as \(\overline{J}_{sb}{^{\prime\prime}} = \left\{ {\overline{j}_{1}{^{\prime\prime}} ,\overline{j}_{2}{^{\prime\prime}} ,\overline{j}_{3}{^{\prime\prime}} \ldots \overline{j}_{m}{^{\prime\prime}} } \right\}\). The individual extremity of the beetle is described as \(\overline{K}_{eb}{^{\prime\prime}} = \left\{ {\overline{k}_{1}{^{\prime\prime}} ,\overline{k}_{2}{^{\prime\prime}} ,\overline{k}_{3}{^{\prime\prime}} \ldots..\overline{k}_{m}{^{\prime\prime}} } \right\}\), and the group extreme value of the population is expressed as \(\overline{L}_{ge}{^{\prime\prime}} = \left\{ {\overline{l}_{1}{^{\prime\prime}} ,\overline{l}_{2}{^{\prime\prime}} ,\overline{l}_{3}{^{\prime\prime}} ,\ldots \overline{l}_{m}{^{\prime\prime}} } \right\}\). The mathematical model for simulating its behaviour is as follow:

$$ \overline{M}_{m}^{z + 1} = \overline{M}_{m}^{z} + \mu \;\overline{j}_{m}{^{\prime\prime}} + \left( {1 - \mu } \right)\,\rho_{m}{^{\prime\prime}} $$
(9)

where \(m = 1,2,\ldots, n\), \(z\) indicates the current number of iterations, \(\overline{j}_{m}{^{\prime\prime}}\) indicates the speed of the beetles, \(\mu\) denotes the positive constants, and \(\rho_{m}{^{\prime\prime}}\) describes the increase in beetle position movement. Thus, the speed formula is written as follows:

$$ \left( {\overline{J}_{sb}{^{\prime\prime}} } \right)^{z + 1} = \varphi \,\left( {\overline{J}_{sb}{^{\prime\prime}} } \right)^{z} + \alpha_{1} \;\beta_{1} \,\left( {\left( {\overline{K}_{eb}{^{\prime\prime}} } \right)^{z} - \left( {\overline{M}_{m}{^{\prime\prime}} } \right)^{z} } \right) + \alpha_{2} \;\beta_{2} \,\left( {\left( {\overline{L}_{ge}{^{\prime\prime}} } \right)^{z} - \left( {\overline{A}_{ID}{^{\prime\prime}} } \right)^{z} } \right) $$
(10)
$$ \varphi \,\left( {\overline{J}_{sb}{^{\prime\prime}} } \right)^{z} \sim\eta = z^{{ - 1 - \overline{J}_{sb}{^{\prime\prime}} }} ,\quad 0 \le \overline{J}_{sb}{^{\prime\prime}} \le 2 $$
(11)

where \(\alpha_{1}\) and \(\alpha_{2}\) denote two positive constants, \(\beta_{1}\) and \(\beta_{2}\) indicate two random functions in the range [0, 1], \(\varphi\) signifies the levy flight to select optimal weight, \(\eta\) indicates the standard normal distribution, and \(z\) indicates the current number of iterations. After that, update the incremental function by using,

$$ \rho_{m}{^{\prime\prime}} = \chi^{z} *\,\left( {\overline{J}_{sb}{^{\prime\prime}} } \right)^{z} *\left( {f\left( {N_{lm}^{z} } \right) - \left( {N_{rm}^{z} } \right)} \right) $$
(12)
$$ N_{lm}^{z + 1} = N_{lm}^{z} + \left( {\overline{J}_{sb}{^{\prime\prime}} } \right)*{\raise0.7ex\hbox{$d$} \!\mathord{\left/ {\vphantom {d 2}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{$2$}} $$
(13)
$$ N_{rm}^{z + 1} = N_{rm}^{z} - \left( {\overline{J}_{sb}{^{\prime\prime}} } \right)*{\raise0.7ex\hbox{$d$} \!\mathord{\left/ {\vphantom {d 2}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{$2$}} $$
(14)

where\(N_{lm}^{z + 1}\) and \(N_{rm}^{z + 1}\) 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\left( . \right)\) signifies the fitness value. High fitness value is taken as optimal values, which are used for further processing.

3.5 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.

4 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.

4.1 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).

Fig. 2
figure 2

Pseudo-code for the OWENN algorithm

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).

Fig. 3
figure 3

Accuracy and f-measure analysis

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.

Fig. 4
figure 4

a MAE and b RMSE analysis with different time intervals

5 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.