1 Introduction

Transportation is one of the major parts of society. We all know we have three different categories of transportation systems. They are private, public, and intermediate systems. We all come across these transportation systems. The massive history behind the public transportation system, early days, people walk to different kinds of places, riding vehicles driven by animals, steam-powered trains, cable cars, motor coaches powered by internal combustion engines, these are different kinds of transportation where people are used in the 19th and 20th centuries.

Public transportation includes some features like passengers should get the ticket while traveling, source, destination, monthly pass and route numbers these all feature followed by all the transportation system. The traffic issue has become an increasing concern in our world. Passenger flow prediction plays an important role in the intelligent transportation system [22, 27]. This task aims to predict the number of passengers getting on the bus and certain bus stops during the given period. Stop during a given period generally can be applied for reducing time-consuming and traveling and providing better transportation control on bus resources it can be classified as long-term passenger floe and short-term passenger flow prediction [29]. A crucial idea in public transportation management and the agile city is the accurate forecast of bus passenger flow in the transportation system [13]. Passenger counting used to be done using Radio-Frequency Identification (RFID) technology [15, 28]. Surveillance picture capture techniques are also employed [34]. There are several challenges in forecasting bus passenger arrival times and dispatch times, as well as when the bus is overloaded, all of which contribute to a problem in predicting passengers [5]. In the transportation system, deep learning is an emerging technology [8]. Deep learning is a class of machine learning that is influenced by the human brain’s structure [35]. Voice synthesis and translation software, as well as self-driving automobiles, use a deep learning algorithm. Deep learning models learn by observing and only knowing what they’ve been taught. A deep learning model trained on a limited or irrelevant dataset would learn in ways that are ineffective for the job at hand [32, 36].

The Karnataka State Road Transport Corporation Bus Rapid Transit (KSRTC) has invested in new technology to upgrade its city bus services and make them more contemporary, safe, and efficient. Today, each KSRTC city bus is continually tracked by a GPS-enabled minicomputer, which allows the central control center to know the bus’s speed and location [21,22,23,24,25]. Buses are now on time. Today, it takes fewer buses and they are less crowded to go the same distance as before, and overtime payments travel has also decreased, and all of the protected data has been recorded. The benefit of this approach is that it has been utilized by traffic cops in accident situations [26].

The KSRTC dataset is used in our proposed technique to estimate passenger travel and the number of people traveling, as well as revenue earned for that year. This experimental outcome can be included in the KSRTC department’s income analysis for the next year. The remainder of this work is structured in the following manner. Section 2 contains reviews of similar approaches. The suggested technique’s processing stages are outlined in Section 3. Section 4 lists the simulation findings and performance comparisons, and Section 5 wraps up the study.

2 Related work

In this section, we briefly examine the existing techniques and their performance of passenger flow prediction in the transportation system. In the paper proposed by Chun-Wei Tsai et al. [29], they considered the major issues of solving the optimization problem to determine the number of passengers on a bus. For evaluating this problem they are used Simulated Annealing (SA), Deep Neural Network (DNN). By considering the dataset of Taichung Smart Transportation Big Data Research Center (TSTBDRC). In this research, the author used forecast methods such as support vector machine, random forest, extreme gradient boosting, and deep neural network to simulate the results.

Yong Han et al. [13] explained the passenger flow forecast can give necessary references for both public transportation administration and travelers, as well as help to the development of a smart city. A hybrid, optimized LSTM network using Nesterov accelerated adaptive moment estimation (Nadam) and the Stochastic Gradient Descent (SGD) technique is presented in this study [21, 23]. This method will improve the model’s accuracy of passenger flow forecasting the Qingdao, China. Dan Luo, Dong Zhao et al. [20] proposed fine-grained administration level of traveler stream forecast issue for transport travel frameworks. This paper contributes a methodology called Multitask Deep Learning of fine-grained Service-level Passenger Flow Prediction for bus transit systems (MDL-SPFP). Anticipate the showing up transport administration stream, line-level on-board traveler stream, and line-level boarding/landing traveler stream by utilizing all-around planned profound neural organizations called Attention mechanism, residual block, multi-scale convolution (ARM) [14].

Lijuan Liu et al. [19] proposed three stages of deep learning architecture to forecast the regular-based passenger flow. The Stack Auto Encoder (SAE) model and supervised deep neural network the combination of a pre-trained unsupervised SAE model and a supervised DNN model can forecast passenger flow for any given hour of the week. And some temporal characteristics consist of a day of a week, hours of a day, holidays, tickets, cards, real-time passenger flow of a Bus rapid transit stations of Xiamen.

Jaeyoung Jung et a1. [18] Proposed a technique called smart-card and land used characteristics for analyzing the passenger flow in Seoul metropolitan area. They are developing a deep-learning model to determine the destinations of bus passengers based on both entry-only smart-card data and land-use characteristics. For getting the exact information of boarding and alighting, they used a supervised machine-learning model.

Bowen Du et a1. [6] proposed a deep irregular convolutional residual LSTM model [6] for forecasting crowd movements in city transit routes. This model combines multi-channel traffic representations with an irregular convolution residual network for learning complicated traffic spatial characteristics and LSTM units based on an important sampling method for learning temporal rules. They are conducting these experiments in Beijing and bike flow in New York City, this result shows that the proposed DST-ICRL performs both standard and deep learning-based techniques for predicting urban traffic passenger flows.

Zhao Huang et a1. [17] considered the major issues of dispatching and arrival time of a passenger flow in Guangzhou city of China. To investigate this problem, the Dynamic bus-dispatching model based on Arrival Time prediction and Passenger Flow (D-ATPF model) and the genetic algorithm-based bus dispatching are used. Dynamic bus-dispatching model based on Arrival Time prediction and Passenger Flow (D-ATPF model) considers the passenger flow and bus arrival times to adopt a “stay” strategy at the transfer station. The stay method is a popular dynamic bus dispatching approach that takes into account trip intervals and vehicle schedules Passengers will spend less time waiting for thanks to the D-ATPF model. This method’s reduced waiting time is enhanced by 5.94% when compared to the real-time data stay technique.

Yun Bai et a1. [5] proposed a Multi-Pattern Deep Fusion (MPDF) technique. In this technique, the Affinity Propagation (AP) algorithm is used to describe the passenger flow in Guangzhou city of and the DBN framework for learning advanced flow characteristics is merged. The results show that the proposed model surpasses all peer approaches in terms of prediction and that it varies significantly from the comparable models.

Yong Zhang et a1. [34] proposed passenger flow prediction based on the surveillance video, this helps to count the number of passengers on the bus. Passenger flow prediction based on Single Shot multibox Detector (SSD) algorithm and Kalman filter is used. Considering some features like entryway state gauge, traveler location, and traveler following were all important for the traveler including the framework set up in this examination.

Ya-Wen Hsu et a1. [15] proposed the concept of surveillance cameras on buses. This experiment is carried out in the real city of Kaohsiung Taiwan. The deep learning concept was used to identify the passenger on a bus and for forecasting, a single shot multibox detector model is used. Passenger tracking is very important in prediction; here tracking can be done through a particle filter. This performance gives a score up to 91.95%.

Many existing works like Long Short-Term Memory (LSTM) and Convolutional Neural Network (CNN) are used to explore spatial and temporal relations. These methods outperform the traditional methods [7]. Ut it is difficult to model both correlations jointly. To overcome this model, the authors have proposed DHSTNet to find out the traffic flows in all the regions. It also uses four components like an external branch, daily volume, closeness volume and trend volume. It assigns various weights to different branches and adds the output of all the properties to get the final prediction. Here the authors have applied the exaggeration method based on an attention model called AAtt-DHSTNet [3].

Precision traffic flow forecasting is critical for intelligent transportation systems because it allows them to better serve their customers [24]. Traffic flow analysis may be complicated, however, because it is impacted by a variety of complex elements, such as regional spatial and temporal interdependence and external causes. DHSTNet [2] is a deep hybrid spatiotemporal dynamic neural network that is proposed in this study for forecasting inflows and outflows in each region of a metropolis. It is possible to combine the result of core components of this model to generate a single result by assigning different weights to different trunks and branches. In terms of accuracy, our model beats existing state-of-the-art techniques, as demonstrated by experimental findings focused on two large-scale data sets [9, 10].

Intelligent transportation systems rely on the ability to estimate urban traffic and passenger patterns to function well (ITS). While it is possible to describe several sophisticated geographical linkages across distinct locations, it is more challenging to depict dynamic temporal ties between different periods. In this paper, the authors have proposed DHSTNet [4]. It is a new deep Spatial-temporal neural network for anticipating the flow of traffic in a crowd to address this problem. The four components of our proposed strategy are as follows: (1) the closeness element takes into account spontaneous depending on the traffic crowd flows; (2) the period impact element, which frequently characterizes variations in daily flows;[3] the factor of weekly influence that distinguishes crowd flow patterns on a week-to-week basis. [4] a component of the external branch that detects a wide range of external impacts [2]. The attention-based mechanism is combined with another previously suggested mechanism to perform an additional check on the universality of the proposed system. This results in the creation of a blended process known as AttDHSTNet, which also predicts brief crowd flows [1].

With its greater efficiency in representing spatial relationships, the Graph Convolutional Neural Network (GCN) has been effectively used for traffic forecasting, and it may be used in other applications as well. Most existing approaches represent geographical relationships in the traffic network using a fixed adjacency matrix, which is known as GCN modeling [12]. The spatial dependencies, on the other hand, alter over time in the real world. The authors propose a graph learning-based spatial-temporal graph convolutional neural network for traffic forecasting, which is founded on graph learning (GLSTGCN) [16]. A graph training component is intended to learn the dynamic spatial connections inside the traffic network to acquire the dynamic spatial dependencies that exist between different nodes in the traffic. In this work, the findings of extensive experiments were conducted using two actual traffic datasets [30, 31, 33]. As per the findings of the trials, the proposed GLSTGCN beats all state-of-the-art benchmarks in all categories. Table 1 gives the comparisons between the above approaches by considering various parameters.

Table 1 Comparisons between DHSTNet and Att-DHSTNet

3 The proposed method

The suggested approach is a real-time application that assists in the detection of passenger movement at a different location. This strategy also includes a resource planning forecast and income forecast for the KSRTC department.

The architectural diagram of the passenger flow is shown in Fig. 1. The data is supplied as Comma–Separated Values (CSV). That data is uploaded into the application which has a neural network pattern recognition mechanism domestically, where this will establish a cluster using a greedy approach, after its synthesis in long short-term memory and wraps the synthesis data to the recurrent neural network to give output visual analysis and statistical modeling of passenger forecasting.

Fig. 1
figure 1

Architecture diagram of passenger flow

3.1 Methodology

Deep learning algorithms fall into the category of unsupervised algorithms, and they rely on a neural network to achieve their impressive outcomes. Image rearrangement, voice reorganization, and prediction are all areas where deep learning is used. As a result, we use deep learning using three unique algorithms in our suggested method: long short-term memory, recurrent neural network, and greedy layer-wise algorithm.

3.1.1 Greedy-layer algorithm

The greedy layer-wise algorithm always works bit by bit and it consistently picks the steps which give quick benefits. And the alternative, the decision of the greedy approach does not think about future data and choices. Greedy algorithms are the best solution for an immediate result. Because the model is trained one layer at a time, the process is known as “layer-wise.” Because of the layer-wise approach to handling the more difficult challenge in deep network and this can be referred to be “greedy.”

Here, this algorithm work on collecting all the dataset and extracting the data in a region-wise manner. Then all region-wise data should be formed as a cluster with numerical data as primary parameters then it sends the data to LSTM prediction.

Greedy Layer-wise Algorithm.

Step 1: Obtain all data.

Step 2: Identify the region using a geo-coder.

Step 3: Crop the data from the original data.

Step 4: Drop the column which not contains a numerical value.

Step 5: Send the data for Prediction.

3.1.2 Long short-term memory (LSTM)

Long short-term memory is a new intermediate network design that uses a gradient-based learning method to suit the data. Backflow difficulties are solved with LSTM. And LSTM was created to address the problem of blunder discharge.

In Recurrent Neural Network (RNN), St-1 is fed along with xt to a cell whereas in LSTM St-1 is transformed to ht-1 using another vector Ot-1. This process is called selective write. Mathematical equations for selective write are as below:

$$ {\displaystyle \begin{array}{c}{O}_{t-1}=\sigma \left({U}_0{x}_{t-1}+{W}_0{h}_{t-2}+{b}_0\right),\\ {}{h}_{t-t}={S}_{t-1}{O}_{t-1},\kern7.5em \\ {}{O}_t=\mathrm{Output}\ \mathrm{gate}.\kern7em \end{array}} $$
(1)

Here, ht-1 is added with xt to produce st. Then product of written stc and it is made to obtain st. This is called an input gate. In st, only selective information goes and this process is called selective read. Mathematically, equations for selective read are as below:

$$ {\displaystyle \begin{array}{c}{i}_t=\sigma \left({U}_i{x}_t+{W}_i{h}_{t-1}+{b}_i\right),\\ {}\mathrm{selective}\ \mathrm{read}={s}_t.{oi}_t.\end{array}}\kern0.5em $$
(2)

Figure 2 shows the processing of passenger flow prediction in bus transportation using the long short-term memory algorithm. After considering the primary parameters in the greedy approach it moves to the long short-term memory, in this model, redundant data, duplicate data, and identical index values are removed. Using the XOR gate, the resulting dataset is divided into batches. After this procedure, the remaining data is transferred to the forget gate, which then processes the data and sends it to the neural network for prediction.

Long Short-Term Memory Algorithm.

Step 1: Fetch legacy bus transit dataset. The first step in the LSTM is to decide which information should be omitted from the cell in that particular time step. The sigmoid function identifies the routes and transit passenger data.

Step 2: Extraction of day-wise and region-wise transit data. In the second layer, there are two parts. One is the sigmoid function, and the other is the function. In the sigmoid function, it decides which values to let through (0 or 1). The function gives weightage to the values which are passed, deciding their level of importance (−1 to 1).

Step 3: To specify an output, data the current region transit cell status. The third stage is to determine what will be the output. First, a sigmoid layer is used to determine whether elements of the cell state make it to the output. Then, to categorize the bird voice frequency, we put the cell state through to push the values to be between −1 and 1 and multiply it by the output of the sigmoid gate.

Fig. 2
figure 2

processing of long short-term memory algorithm

3.1.3 Recurrent neural network (RNN) algorithm

The recurrent neural network is one of the groups of neural networks. In this, the output of the earlier step is taken as an input of the present step. The major advantage of a recurrent neural network it consists of a secret stage which used to catch data about a sentence. RNNs have a memory, which is utilized to catch data about the estimations made up until this point. In principle, RNNs can utilize data in self-assertive long arrangements, yet basically, they are restricted to think back a couple of steps [11]. It is well known for handling sequential information.

As discussed inside the first heading, the output is influenced by both current and previous inputs. Let I1 be the first input of bus transit whose dimension is n × 1 where n is the length of the column. S0 be the hidden state of the first RNN cell having four neurons. For each cell, the input hidden state should be one prior. For the first cell initialize S0 with zeros or some random integer because no previous state is seen. U is the dimensional matrix of dimension d × n where d is the number of neurons in the first RNN cell and n is the input columns of data. W is another matrix of the data frame of KSRTC data whose dimension is d × d. b is biased whose dimension is d × 1.

Mathematically, outputs from the first RNN cell are as below.

$$ {S}_1={UI}_1+{WS}_0+b. $$
(3)
$$ {O}_1={VS}_1+c. $$
(4)

Parameters in the RNN are U, V, b, c. We are shared among all the RNN cells. Parameters are learnable and are responsible for training the model. At each time step, the loss is computed and is backpropagated through the gradient descent algorithm [11].

Gradient represents the slope of tangent and points in the direction of the greatest rate of increase of function. From the loss, it means cost function or error. The move is made opposite to the direction of the gradient of the loss concerning V. Mathematically new value of V can be calculated according to the following equation.

$$ {V}_{new}={V}_{old}-n\frac{d(L)}{d(V)}, $$
(5)

Where d (L)/d (V) is the sum of all losses obtained from time steps.

W is multiplied by S. To calculate the derivative of loss to weight at any time step, the chain rule is applied to take into consideration all the paths to reach W from Sn to S0. This means that due to any of the wrong Sn, W is affected. In other words, some wrong information came from some hidden state which leads to loss. Mathematically, weight is updated as below:

$$ {W}_{new}={W}_{old}-n\frac{d(L)}{d(W)}. $$
(6)

Figure 3 shows the processing of recurrent neural networks for passenger prediction in a bus transportation system. Here the passenger datasets collect from the KSRTC department. Hereafter removing the similar index in LSTM then data will move to recurrent neural network here it consider as iteration based factors such as region-wise prediction, passenger count, revenue generated, year-wise prediction.

Fig. 3
figure 3

Processing of the recurrent neural network algorithm

After collecting the dataset, extract the dataset based on features like a holiday, weekdays, passenger travel from different areas, processing the dataset for prediction of passenger flow in the transportation system.

Recurrent Neural Network Algorithm.

Step1: Start with the selection of random samples from a given dataset.

Step2: Create a decision tree by defining each sample’s condition. The prediction result from each decision element in the neural network will then be obtained.

Step3: For each centroid, calculate the distance between each data point and the nearest cluster Assign each data point to the closest cluster by calculating its distance for each centroid.

Step4: Calculate cluster centroids in this step, the bus transit characteristics are used to determine the centroid of data points.

Step5: Re-assign each point to the closest cluster centroid: Note that only the data point at the bottom is assigned to the cluster even though it’s closer to the centroid of the cluster. Thus, we assign that data point into the cluster.

Step6: At last, select the most voted prediction result as the final prediction result.

4 Result analysis

In this paper, all the below-obtained figures refer to as an outcome of our proposed methodology. For predicting the passenger flow in the bus transportation system, we are using deep learning methods to perform more accurately. In our proposed method we used three algorithms to predict the passenger flow. Using a Greedy layer-wise Algorithm, we first evaluate the data before partitioning is based on characteristics and clustering it. Then we use long short-term memory to remove duplicate data and similar indexes, and then we use a recurrent neural network to find iteration factors such as passenger counts, year-by-year predictions, region-by-region predictions, and revenue produced by evaluating all the input data.

Figure 4 shows the dataset of KSRTC bus passenger flow. The above dataset consists of some parameters like Bid, Btype, date, source, destination, and passenger counts, these parameters are processed using the greedy layer-wise algorithm. These parameters are used for prediction and revenue analysis for next year.

Fig. 4
figure 4

KSRTC bus passenger flow dataset

4.1 Passenger prediction for 2022

In this proposed system, we are using a large amount of dataset of KSRTC. This dataset is based on all days in a week, which is consists of parameters like bus id, Bus type, date, source, destination, trip route, passenger count, slot number, adults, and child. These parameters are considered in the prediction of passenger flows in a different source and destination. Here the KSRTC dataset is used to analyze the flow of passengers and also prediction. This prediction in KSRTC has generated revenue for next year, also we can find the existing years of revenue in a distinct sector. The below snapshots are an output of our proposed method in passenger prediction.

Figure 5 depicts the prediction of a passenger flow of the Mysuru region based on the existing dataset. Using the greedy layer-wise, LSTM and RNN, these models predict the flow of a passenger in the Mysuru region. The revenue of the Passenger prediction is obtained in the foram of a graph, here it shows by analyzing 5 years of data for prediction in 2022 and also the revenue generated in 2022 and by this graph, we can understand 375 k of revenue generated on the month October in the upcoming year of 2022.

Fig. 5
figure 5

Ksrtc bus passenger prediction and revenue for 2022 of Mysuru region

Figure 6 shows the graphical representation of a passenger flow prediction of a Bengaluru region. In our proposed method the revenue calculation is considered for the month of passenger travel, and the department of Ksrtc can take this year’s revenue to analyze for the next year. Here we can predict the 2022 passenger flow of revenue. This graph shows the 631 k revenue is generated in March.

Fig. 6
figure 6

Ksrtc bus passenger prediction and revenue for 2022 of Bengaluru region

Figure 7 shows the graphical representation of passenger prediction. This graph represents the upcoming year 2022 passenger flow in the Belagavi region, by tacking the count passenger travel of the region. The graph shows the revenue, which will be going to generate in 2022 in the Belagavi region. The December month of revenue is Rs. 258 k in the 2022 year.

Fig. 7
figure 7

Ksrtc bus passenger prediction and revenue for 2022 of Belagavi region

Figure 8 depicts the graphical representation of a passenger flow of the Dakshinakannada region, this above graphical representation shows the upcoming passenger flow in Dakshinakannada. In August 2022, up to 381 thousand amount revenue is generated.

Fig. 8
figure 8

Ksrtc bus passenger prediction and revenue for 2022 of Dakshinakannada region

Figure 9 shows the difference between before prediction and after the prediction of a passenger flow with revenue calculation. The first image depicts the situation before the forecast of passenger flow, while the second image depicts the forecast of passenger flow. Revenue will be produced as a result of the forecast. This produced money is utilized to assess revenue for future years by the transportation system.

Fig. 9
figure 9

Comparisons between before and after predictions

Figure 10 depicts a graphical depiction of the passenger’s forecast. Revenue will be created by utilizing long short-term memory and recurrent neural networks. This can be used as a guide for KSRTC’s passenger forecasting for the coming year.

Fig. 10
figure 10

Passenger prediction with revenue generation of next year

4.2 Performance analysis of passenger prediction for 2020

In this section, we are tacking only 2020 datasets to analyze the resent passenger prediction flow, and it helps to understand the nearest year of passenger flow for upcoming year predictions. In 2020 very few numbers of the bus are available. By considering this issue of transportation got less profit due to covid-19. This dataset for prediction helps to understand next year’s passenger flow. The below snapshots is providing the existing data of 2020 for prediction of the nearest year, it represents the complete 2020 passenger prediction is obtained.

We are finding year-wise prediction in forecast year step, by giving the year with a region; it shows the particular year passenger flow in the region. This year’s result shows the current year’s revenue generated and passengers traveling from the region.

Figure 11 shows the KSRTC dataset of 2020. Here for analysis of an individual year prediction of passengers, we are using a one-year dataset among all the datasets. By considering the 2020 dataset as a one-year dataset we can predict the accurate passenger flow by using the greedy layer-wise, LSTM, and RNN algorithms. The above snapshots are consisting only of the 2020 dataset with respect to year and region we can predict the flow of passengers and also revenue will be generated for that year.

Fig. 11
figure 11

KSRTC bus datasets of 2020

Figure 12 depicts the graphical representation of passenger prediction in the year 2020. By tacking the one-year dataset we can predict the numbers of passengers traveling from one location to another location. This figure shows in October 2020 the highest revenue was generated in the Mysuru region.

Fig. 12
figure 12

2020 passenger prediction and revenue of Mysuru region in 2020

Figure 13 depicts the passenger prediction in the year 2020. Here we consider only the 2020 dataset for analyzing the prediction in Dakshinakannada region. This helps to understand the nearest year data to predict the passenger flow. In the year 2020 in Dakshinakannada, 315 thousand amount of revenue is generated.

Fig. 13
figure 13

2020 passenger prediction and revenue in Dakshinakannada region in 2020

Fig. 14 shows the graphical representation of passenger flow and revenue generated in Karwar region. Here we consider the dataset of 2020 to find out the nearest value of passengers traveling from one point to another point in Karwar, this helps to understand the concept of revenue analysis of the current year. The January month 332 thousand amount of revenue is generated.

Fig. 14
figure 14

2020 passenger prediction and revenue in Karwar region in 2020

Figure 15 shows the passenger prediction of Bengaluru region and this prediction is based on considering the recent dataset that has been generated from the Kaggle. Here we consider the 2020 dataset to predict the nearest passenger floe in Bangalore region. In December, 892 thousand amount of revenue is generated.

Fig. 15
figure 15

2020 passenger prediction and revenue in Bengaluru region in 2020

4.3 Analysis of the existing methods

Table 2 shows the performance of existing techniques. In these ten techniques, eight different data sets are used. Among them, the published work [5, 17, 34] used the same data set. Different neural network models are used in these techniques. Both the published techniques [15, 34] employ single shot multibox detector.

Table 2 Performance analysis of the existing methods

4.4 Analysis of the proposed method

In our proposed method we used deep learning algorithms of LSTM and RNN to predict the passenger flow in the bus transportation system. In our proposed system we have done an experiment based on the greedy layer-wise, LSTM, and RNN algorithms.

First, we take the Ksrtc dataset and run it through a greedy layer-wise method, which changes the dataset based on the parameters and creates a cluster of numerical data before going on to the LSTM model and eliminating any comparable indices with redundant information. All of the data from the LSTM is generated as iterations factors in a recurrent neural network based on the prediction that will provide a pictorial depiction and numerical values.

This prediction is done through various types, first one is we can predict the passenger based on the five-year dataset and the second one is, we can predict the particular year. Both types of prediction are used to generate revenue. And it can be considered for upcoming years.

In this paper, we have completed several years of prediction. Every prediction is various based on the dataset which we used.

4.4.1 Mean absolute error (MAE)

It is one of several metrics for describing and evaluating a machine learning model’s quality. This prediction error is calculated for each entry, after which the error is converted to a positive value. This is accomplished by calculating the exact value of each fault as shown below:

$$ mae=\frac{\sum_{i=1}^n abs\left({y}_i-\leftthreetimes \left({x}_i\right)\right)}{n} $$
(7)

4.4.2 Mean square error (MSE)

The mean of square error, or the average of the squares distance among predicted and reliable products, is measured by an estimate. It’s a threat function that corresponds to the squared error loss’s predicted value.

$$ mse=\frac{1}{n}{\sum}_{i=1}^n{\left({y}_i-{\hat{y}}_i\right)}^2 $$
(8)

4.4.3 Root mean square error (RMSE)

The root mean square error is a standard method of calculating a model’s error in predicting quantitative data. Formally it is defined as follows:

$$ RMSE=\sqrt{\frac{1}{n}}\sum \limits_{j=1}^n{\left({y}_{j-}\hat{y_j}\right)}^2 $$
(9)

y1,y2,y3,………………. yn = observed values.

\( \hat{y_1},\hat{y_2},\hat{y_3}\dots \dots \dots \dots \dots \dots .\hat{y_n} \) = forecasting values.

n is the number of observations.

By understanding the model performance of predicting the passenger flow and revenue of the proposed method, the below snapshots show the values of Mean Absolute Error (MAE), Mean Square Error (MSE), Root Mean Square Error (RMSE), Accuracy of our proposed system, and the result are shown in Table 3.

Table 3 Performance analysis of the Proposed method

Figure 16 shows the mean absolute error calculation of our proposed method. In our implementation, prediction of passengers based on the year wise like 2016 to 2020 and another method is a prediction based on the complete dataset. Both the form of method gives MAE value up to 5.886.

Fig. 16
figure 16

Results of mean absolute error (MAE)

Figure 17 shows the mean square error calculation for passenger flow in the bus transportation system. Here calculation can be done for all the year and Particular year. This result can be used for 2022 passenger prediction and revenue generation. In our proposed method Overall value of MSE is 5.365.

Fig. 17
figure 17

Results of mean square error (MSE)

Figure 18 depicts the results of the root mean square error of our proposed system. This calculation will help for further future use. In our implementation RMSE value of the overall prediction is 2.344.

Fig. 18
figure 18

Results of root mean square error (RMSE)

Figure 19 shows the accuracy of our proposed method. In this implementation accuracy is generated year-wise and overall year, this can be taken as the performance of algorithms in our implementation. Both the algorithms effectively predict the passenger in Bus transportation system. The highest accuracy is generated by our proposed method is 92.976%.

Fig. 19
figure 19

Accuracy of the proposed method.

5 Conclusion

Short-term passenger flow forecasting is essential for the operation and management of passenger transit in the KSTRC. People are facing so many issues while they are traveling from one place to another place. Problems are occurred due to the heavy flow of passengers at the stop, bus delay, and periodicity. To overcome these problems, we consider the concept of passenger prediction based on some parameters like bus id, number of adults in the bus, number of children’s in the bus, source, destination, passenger count, slot number, revenue generated for next year. In our proposed system prediction is based on deep-learning with LSTM, RNN, and greedy layer-wise algorithm. We are taken a KSRTC dataset to predict the passenger by using a greedy layer-wise algorithm and for prediction; we used greedy layer-wise, LSTM, and RNN algorithms. These three algorithms are effectively predicting the passenger flow in KSRTC buses and generate revenue for KSRTC buses from every location. This can be helpful for the KSRTCBRT department for analyzing next year’s revenue.