Replacing public transportation information tables using AI and mechine learning with the goal of simplyfing embdeded device implementation, reducing internet traffic and carboon footprint by replacing live tram and bus data with one predicted by model trained on historic schedule information.
\caption{Information table with nearest departures}
\Description{Enjoying the baseball game from the third-base
seats. Ichiro Suzuki preparing to bat.}
\label{fig:teaser}
\end{teaserfigure}
\received{20 February 2007}
\received[revised]{12 March 2009}
\received[accepted]{5 June 2009}
%%
%% This command processes the author and affiliation and title
%% information and builds the first part of the formatted document.
\maketitle
\section{Disclaimer}
This article is written for educational purpose. Any and all opinions and information listed in this article should be considered as not representative of me, my university and my employer. Reader discretion is advised.
\section{Introduction}
Public transportation systems are an essential part of modern city infrastructure, providing reliable and efficient transportation for millions of people every day.
However, the reliability of public transport services can often be compromised due to a variety of factors such as traffic congestion, weather conditions, and unexpected events.
Devices showing nearest public transport arrivals on given stop (like one on figure \ref{fig:teaser}), often require Internet access, introducing unnessesary network traffic and increasing city carbon footprint.
To combat climate change and reduce noise introduced by network traffic with devices syncing current tram and bus positions, change is required.
We propose to replace network-enabled embeded systems with networkless devices that contain prediction model described by this paper.
By reducing complexity of device by reduction of it's capabilities we can reduce production costs and availability of new devices.
We can additionally reduce device shown on figure \ref{fig:teaser} by displaying only the direction for the nearest tram or bus arrival.
This allows to reduce problem into multiclass classification.
\section{Related work}
Most of AI usage inside the public transportation context is concerned with optimization of schedules.
Searching for work that uses AI in interaction between passenger and public transport system is rather difficult.
Strongest connection can be found with general AI in public transport articles, especially ones overwieving applications of AI in public transport \cite{ai_in_transport}.
\section{Method}
\subsection{Dataset}
Dataset from which train and test data were created is publicly accessible public transport schedule information of ZTM Poznań \cite{ztm_dataset}.
Due to storage limit, few files from last few months are selected, resulting in \SI{400}{\mebi\byte} initial dataset size.
Then data is transformed from CSV format to TSV format, which is more suitable for standard shell text utilities consumption. Utility is written in Go for both performance and ease of use thanks to builtin CSV parser \cite{go_csv}.
Next, data is normalized using hand-written tool in C++: data notation is changed from \texttt{HH:MM} format to floating point representation when span from \texttt{00:00} to \texttt{23:59} is mapped to span $\left[0, 1\right]$.
If row doesn't contain all required information then it's rejected.
All columns that are not nessesary are removed.
This results in \SI{176}{\mebi\byte} (originally \SI{400}{\mebi\byte}).
Training, validation and test data are extracted from normalized file using scikit-learn \cite{scikit_learn} function \texttt{train\_test\_split}.
All classes in dataset are extracted from normalized dataset using standard POSIX utilities: \texttt{cut}, \texttt{uniq}, \texttt{sort}.
\subsection{Model}
Model is implemented using Tensorflow \cite{tensorflow2015-whitepaper} framework, both to develop and evaluate.
Design of the model is driven by the computational capabilities of Lenovo Thinkpad x270 with i5-7300U processor and 8GB of RAM.
Model is constructed as shown below:
\begin{lstlisting}[language=Python]
from tf.keras import Sequential
from tf.keras.leyers import Input, Dense
model = Sequential([
Input(shape=(2,)),
Dense(4*num_classes,activation='relu'),
Dense(4*num_classes,activation='relu'),
Dense(4*num_classes,activation='relu'),
Dense(num_classes,activation='softmax')
])
\end{lstlisting}
Notable used activation function is softmax, defined as: $\sigma(z)_i =\frac{e^{z_i}}{\sum_{j=1}^{K} e^{z_j}}$ for $ i =1, \dots, K$ and $z =(z_1, \dots, z_K)$.
\section{Results}
Accuracy while training for 2 epochs, epoch size is 1024.
\begin{table}
\caption{Accuracy of trained model}
\label{tab:freq}
\begin{tabular}{c}
\toprule
Accuracy\\
\midrule
$0.20598010947207804$\\
$0.20598010947207804$\\
$0.18560214941090175$\\
$0.19518890350138754$\\
$0.19516771079968306$\\
\bottomrule
\end{tabular}
\end{table}
Further evaluation and model training is required.
\section{Conclusions}
Due to available computational power (or lack there off) any conclusions about the solution are limited.
However, with model defined as above we can efficiently compress information - timetables storing required information for a month are \SI{62}{\mebi\byte} and stored model occupies only \SI{19}{\mebi\byte}.
Due to greater space-efficiency of AI powered solution, test deployment may be tested in the near future.
%%
%% The next two lines define the bibliography style to be used, and