Contents

Abstract

This document entails a progressive report on the design and implementation of a bus tracking and monitoring system . This report has its contents within the limits of five chapters with each concisely exploring their various objectives. Chapter one is the introductory chapter. It entails a brief description of a bus tracking and monitoring system ,the need and the aims and objectives of this project. Chapter two consists the literature review of this project. This entails the critical analysis of previous related research and projects undertaken by other people. The merits and demerits of the various implementations.Chapter three consists of theory and design considerations of the proposed system for Kwame Nkrumah University campus. Chapter four talks about the methods used to collect data and the approach and technology stack adopted to build the proposed system.Chapter five concludes the thesis and discusses the results of test and deployment of the proposed system on Kwame Nkrumah University of Science and Technology campus.

Smart bus tracking and monitoring systems

-

An Artificial Intelligence based approach to

estimating time of arrival and bus occupancy

for public transport systems in Africa

A thesis submitted for the degree of

Bachelor of Science (BSc.)

in Electrical and Electronic Engineering

by

Appau Ernest Kofi Mensah

Principal Supervisor: Mr. Emmanuel Addo

Department of Electrical and Electronic Engineering

College of Engineering

KNUST, Kumasi

June, 2020

“Creativity is just connecting things.”

― Steve Jobs.

Declaration

We hereby declare that this project “Smartphone based bus tracking and monitoring system with estimated time of arrival and bus occupancy count using linear regression model and Neural Networks” is our submission as the original work done by us through research and under the supervision of Mr Emmanuel Addo for the reward of a degree in BSc Electrical/Electronic Engineering. All sources of information ad literature in this work has been referred.

Name: Appau Ernest Kofi Mensah

Signature:  

Date: June, 2020.

Acknowledgements

“Its the not the Destination, It’s the journey” - Ralph Waldo Emerson. Embarking on a four year journey back in April 2016 which has been filled with moments of joy,discovery as well as the tough days filled with frustration, in the heat of all these roller coaster moments, I have come to realise life is a journey one cannot embark on alone but with the help of others along the way.The lessons I have learnt through this journey are gems and will forever cherish with it and grow. I never would have made it this far without the great advise and mentorship of these great people part of my journey over the years. To all these people I would like to express my profound gratitude.

Contents

Chapter 1 Introduction

1.1 Background

The real-time update is very essential in the design and operation of an efficient bus tracking and monitoring system. However, due to the lack of information on the accurate bus estimated time of arrival (ETA), current location and occupancy (congestion and number of seats available), students find a lot of issues using public transport systems on Kwame Nkrumah University of Science and Technology campus. Vehicle Location and tracking systems, have been adopted by many companies such as Uber, Bolt, and transit agencies in major cities and university campuses which allows riders to track their transit vehicles in real-time. While the provision of real-time information, such as bus location using GPS coordinates, is relatively straightforward, predicting transit information, such as when a bus will arrive at a particular bus stop and the occupancy, is significantly more complex, because of the complexity of the inputs and the multivariate, non-linear and parametric nature. To predict travel time, in an accurate and timely manner, the consideration of driving footprint unique to a particular driver and traffic is and other parameters are essential. The buses on KNUST campus have helped general users and students in their daily commute from their various central bus stop to their faculty and college areas on campus where they have their lectures and back. Due to the lack of a bus monitoring and tracking system, students find it hard to get real-time updates on the route, location, occupancy, estimated time of arrival of the buses which would enable them to make decisions related to their commute on campus. The lack of such a system also creates this problem where the campus bus management team is unable to forecast the future demand and use of the buses which would help in the future policies in making provision and allocating resources related to bus commute on KNUST campus.

The study in this report focuses on the design and implementation of a bus tracking and monitoring system that can provide students with a real-time update on the route, location of a bus, estimated time of arrival of the buses at each stop using machine learning techniques using regression models and provide the occupancy of a bus using a computer vision-based convolutional neural network. This tracking and Monitoring system will consist of an app for the driver which will track the bus using GPS and google maps and one for the students who want the real-time update of the bus’s location, estimated time of arrival, and occupancy. There will be a microcontroller fitted with a camera on-board the bus which will use a pre-trained convolutional neural network architecture to provide the occupancy of a bus at certain time intervals. The web application is designed and developed as an alternative of a graphical user interface to assist students in monitoring the real-time location of the bus and plan their journey based on information provided such as bus routes, bus stop number and bus arrival time and bus occupancy.

1.1.1 Why the need for a bus tracking System on campus

  1. The bus Tracking system is needed on campus to help students :

    • Get access the time of arrival of the bus at the various stops close to them to get to the bus stop on time to commute to and from class

    • To get information about bus schedules so that they plan their commute on campus for the day

    • To get alerts and monitor the arrival of the bus at certain dedicated bus stops on campus

    • To get access to information about bus seat availability and occupancy on campus to make data-driven decisions about commute on campus.

  2. University Administration and transport department:

    • The bus tracking system is needed on campus to aid both the administration in making data-driven decisions about the convenience and other matters related to students’ well-being as far as a commute on campus is of concern.

    • Maintenance department need the bus monitoring system to aid them in predictive maintenance of the buses on campus

1.1.2 Problems students faced without a bus monitoring system available on campus

Due to the lack of bus tracking system students were;

  • Late for lectures due to missing the buses when they arrived at the stops, and due to the lack of a bus schedule.

  • Unable to plan their commute properly in a day due to the lack of such a system in place

  • Unable to get knowledge about the occupancy of buses thus would always rush to board overcrowded buses which poses a danger to all passengers on board, health-wise and safety-wise.

1.1.3 The measure put in place hitherto and results

Unfortunately, there were no efficient measures put in place. The busing system had not been around for very long thus it was a matter of adaptation. The maintenance department placed strict policies on drivers of campus bus to pick an acceptable number of students on the buses which proved availed to nothing. Students board the overcrowded bus and it became a culture amongst them. When we got into contact with the maintenance and transport department of the school, they had been testing out an upcoming system to ease the problem of the commute of students.

1.1.4 Benefits of our proposed system

  • Our system will be able to provide students and staff that patronize campus buses with the advantage of getting access to information about bus routes, locations, alerts as to when a bus arrives at a bus stop on campus.

  • Our system will help the university on making data-driven decisions and policies from data mined from our system and can also help the maintenance department in predictive maintenance of buses

1.2 Aim

To design and implement a bus tracking and monitoring system that can help students get real-time updates of the planned bus routes, location of buses on a map, estimated time of arrival between bus stops and provide the level of occupancy(seats available) in a bus to enable a student make informed decisions on the KNUST campus.

1.3 Objectives

  1. Develop and optimize a machine learning regression model to help predict the estimated time of arrival of a bus on the KNUST campus based on parameters logged from the driver’s app

  2. Develop and deploy a pre-trained convolutional neural network on a microcontroller coupled with a camera to help determine the occupancy of buses

  3. Develop a mobile app to track and log the GPS coordinates of the bus drivers and other parameters using GPS and google maps

  4. Develop a mobile app and a web app as an alternative for students on the KNUST campus to get real-time updates of location, routing, estimated time of arrival and occupancy (number of seats available) of the busses

Chapter 2 Literature Review

In this chapter, we review and discuss the existing works related to our research objectives.

2.1 Introduction

Many vehicle tracking systems make uses of a GPS tracking component. There are many device specifications and types based on system requirements and architecture specifications. Some of the GPS tracking components are already built by manufacturers and can be assembled using hardware-based components; microcontrollers, a GSM module, and a GPS shield. These three components are basic components needed to put together a fairly efficient tracking unit to be installed in vehicles. The workflow after installation involves the administrator receiving logs (coordinates, timestamps, and other parameters) that are streamed and stored in a central database and used to track the current location of devices. Such an architecture provides an interface where assets can be tracked without the knowledge of a driver and would be suitable in the use case where the administrator needs to track a few devices and assets without the knowledge of others. In the case of fleet management, such an architecture is bound to face issues such as scalability, cost of hardware, Network latency, device computation, and power constraints due to the fairly high number of vehicles and assets hence the word “fleet”. In our use case, our proposed system deals with the issue of deployment, implementation, scalability, faster computations with no power constraints, and easily integrated into a large user base on the KNUST campus. We intend to model our system after the very best in the transport arena which is a company called Uber which uses mobile-based apps for tracking and providing other related services, and in the age where we find ourselves with improvements in technology and the availability of computing devices that generate a lot of data, our proposed system intends to develop a pipeline to make eta predictions based on machine learning algorithms such as light trees from Microsoft and Cat boost algorithm recently developed by Yandex. In the following section, we review the related work done in this field and observe the strengths, weaknesses, how these observations will be factored into our system to improve the efficiency to solve the issue of bus tracking and monitoring with a commute on KNUST Campus.

2.2 Related Works

2.2.1 Real-Time Campus University Bus Tracking Mobile Application by Sarah et al

In this paper, the authors in review built an android based app for the student and one for a driver was used to track the location of the bus by sending the bus coordinates on a specific route to a central database hosted online. The got real-time updates of the bus location at regular intervals as well as the timeline schedule of the buses and used a raspberry pi microcontroller coupled with a webcam to enable the counting of people on a specific bus in real-time. Based on their evaluation and tests they were able to achieve the aim of providing a real-time update of the location of the bus for students on campus.

Strengths
  1. They were able to achieve the aim of providing real-time location, coupled with a graphical user interface to prove updates of the schedule and movement of the buses

  2. An IOT based people counting module provided an add on feature to improve bus monitoring

  3. Their software-based approach makes their solution high scalable

Weaknesses
  1. Unfortunately, their paper had little detail about the evaluation and implementation of the estimated time of arrival of the buses

  2. Their paper had little details about the performance evaluation of their image processing people counter and the architectures used to implement such a model

  3. Traffic was not factored into their estimated time of arrival

2.2.2 Real-time on-Campus Public Transportation Monitoring System by Sarah Amid Sahal et al

In this paper, the authors in review proposed system included a tracker made from an ESPRESSO lite V.2 board, a WIFI module and GPS module which was embedded into a bus to send real-time location data to a database, a web application to show the users the location of the buses and Estimated time of arrival of buses function based on the haversine great circle formula.

Strengths
  1. The Espresso v.2 board is fast enough to stream the location data to the central database

  2. They provided a function to estimate the time of arrival using the haversine great circle formula

Weaknesses
  1. Their proposed estimated time of arrival function would not provide the accurate time of arrival of buses

  2. The Wi-Fi-based model module would be useless and ineffective in the case where the is no WIFI reception in an area of their campus

  3. Due to the movement of the buses, the bus IOT Tracker would suffer physical damage and stop the transmission of data if the road network on campus has a lot of bumps

  4. Their system wouldn’t be able to scale in the case where there is an increase in the number of buses due to the cost of the hardware units of the GPS tracker

2.2.3 College bus tracking system by Sangavi et al

In this paper, the authors in the review used an Arduino based tracker coupled to a WIFI module and a GPS based module was used. The Arduino based tracking unit transmits the coordinates of the bus location to a server and the location of the buses is displayed on a website which can be assessed on the phones and laptops of students

Strengths
  1. The Arduino Uno board meets the specifications of their system design to and connections to log location coordinates to a server

Weaknesses
  1. There was no proposed estimated time of arrival function or system

  2. The Wi-Fi-based model module would be useless and ineffective in the case where the is no WIFI reception in an area of their campus

  3. Due to the movement of the buses, the bus IOT Tracker would suffer physical damage and stop the transmission of data if the road network on campus has a lot of bumps

2.2.4 College bus tracking system (TRAVELINE) by Sultana et al

In this paper, the authors in review built an app for a student is used to request the location of a bus. The driver has an app that streams its location to a database. The student signs up and his or her information is stored in a database. The used an android Software development kit to develop the mobile app. The driver app-enabled him to select which bus he or she is driving.

Strengths
  1. The software design of their database enables the school management to keep track of the number of students signed up onto the service

  2. Their proposed systems enable students to get information related to bus locations and routes in real-time.

  3. The design of the driver’s app enables them to collect information on the driver’s habit which provides them the avenue to predict the eta in the future

Weaknesses
  1. No provisions were made to predict the estimated time of arrival, and Bus occupancy

  2. Their system was not well modeled and would raise issues related to scalability

2.2.5 IoT based school bus tracking and arrival time prediction by Jisha et a

In this paper, the authors in the review used three layers to implement their system, a hardware layer, a communication layer, and an application layer. The hardware layer consisted of a microcontroller connected to a GPRS /GSM modem, RFID reader, and a SIM28ML GPS module for transmitting location coordinates, RFID ID data, and using the GPRS/GSM modem in the communication layer. The application layer involved a cloud server for storing the logged data, a graphical user interface for displaying the location of the school bus, and a prediction engine that made uses of Kalman filters to predict the estimated time of arrival of the buses.

Strengths
  1. The proposed system catered for the estimated time of arrival of buses using Kalman filters

  2. Their system provides SMS alerts including other channels of notification of bus locations

Weaknesses
  1. The performance metric of their Kalman filters can be improved with artificial neural networks and other machine learning techniques.

2.2.6 Design and Implementation of Vehicle Tracking System Using GPS/GSM/GPRS Technology and Smartphone Application by SeokJu Lee et al

In this paper, the authors in the review used a location tracking device made of a microcontroller, a GPS module, an AT and T sim card, a GPRS/GSM module, and a quad-band antenna was used to track the location of the bus which was streamed to a database and accessed by students from a mobile application.

Strengths
  1. Their proposed system can track the location of the buses

  2. The sim-based module attached to the microcontroller is better than a WIFI module, in the sense that, it would help transmit the location coordinates even if there is no WIFI reception in the area

Weaknesses
  1. No provisions were made for the estimated time of arrival and vehicle occupancy count

  2. Their hardware tracking device is prone to physical damage and failure due to bumps if the road network on campus is not good.

2.2.7 Vehicle Tracking and Alert System for Mini Buses on the University of Ghana, Legon Campus by Boateng Rene Korankye et al

In this paper, the authors in the review used tracking hardware (made up of an Arduino Uno Microcontroller, a Sim 900 GSM/GPRS module, and a GPS shield) is placed on a minibus to log the coordinates of the bus into a database. It also has a web server then calls the data and plots it on an embedded Google Map. The system administrator views the location of the minibus, registers new drivers, and assigns buses to them.

Strengths
  1. To provide the user with the location of the bus and the distance between the bus and the user.

Weaknesses
  1. The system does not provide any information on the estimated time of arrival of the minibus.

  2. The congestion level in each bus cannot be determined by the user. Hence, students waiting for the bus are usually disappointed especially when the arriving bus is full

2.2.8 College Bus Tracking System Using Android by M. Krihika et al

In this paper, the authors in the review provided each college bus is provided with an android phone with a tracking application installed in them. A similar application is installed on the user’s phone. The android mobile tracks the location of the bus using GPS and gives the exact location of the bus. The GPRS receiver modem retrieves the latitudes and longitudes from the sender. The location details such as bus number and its route are stored in the database. The system is based on a GPRS modem and is a web application integrated with the mobile device to transfer the data and the student can view the report through the mobile application.

Strengths
  1. The system provides information on the estimated time of arrival of each bus.

  2. It also verifies that a student has boarded the bus by sending SMS to their registered mobile numbers.

Weaknesses
  1. Traffic congestion was not factored in deriving the estimated arrival of the buses.

  2. The application is not online so the live location of the bus cannot be tracked.

2.2.9 Implementation of a Smart Bus Tracking System Using Wi-Fi by Ravi Kiran et al

In this paper, the authors in review decided to implement a system for buses using Wi-Fi and real-time tracking mobile application; where the buses arrive at the bus terminal, the bus’s Wi-Fi module connects to the router and sends the address of the bus (location of the bus in longitudes and latitudes) to the cloud and the data is retrieved from the cloud and displayed to the user via the mobile application.

Strengths
  1. Real-Time tracking of the bus using google location (latitudes and longitudes)

Weaknesses
  1. There were connectivity limitations to the router at bus stops due to peak periods.

  2. There was always a lag in the real-time location because the buses only uploaded their location when at the bus stops.

  3. No estimated time of arrival (ETA)

2.2.10 College Bus Tracking System by Yadav et al

In this paper, the authors in the review’s system were based on GPS technology which enabled the college management team to keep a better eye on the activity of college buses and manage schedule as well as provide real-time bus locations for students. The project proposed the use of an android mobile phone application using JAVA programming language.

Strengths
  1. Their proposed system can track the location of the buses

  2. The system provides information on the estimated time of arrival of each bus.

Weaknesses
  1. The congestion level in each bus cannot be determined by the user.

  2. There was no proposed estimated time of arrival function or system.

Chapter 3 Theory and design considerations of our proposed system

3.1 Introduction

A general bus tracking system consists of a GPS based device for logging the location coordinates to a database, a graphical user interface to view the location of the bus, and other components and layers ranging from the hardware to communicate and software-based layers. This system can be deployed with a wide range of technologies and architectural designs which include a client-side model and a server-side model. The estimated time of arrival prediction consists of a time series model based on machine learning. The bus occupancy involves the use of artificial neural networks coupled with computer-vision libraries. We explain the theory behind the various technology components in a bus tracking and monitoring system, time series-based machine learning approaches, and computer vision-based object detection edge devices.

3.2 Overview of a Global Positioning system

GPS, the main component of every device tracking and mapping system is defined by Joel McNamara (McNamara 2004) as a smart satellite system that can pinpoint a position anywhere on planet Earth. GPS is a radio receiver measuring the distance from a given location to satellites that orbit the Earth broadcasting radio signals. The GPS receiver needs to get the location from a minimum of three satellite signals. Moreover, it requires four satellite signals to get a position in three dimensions (i.e., latitude, longitude, and elevation). GPS is used for navigation and location positioning by the military, the government, and civilians; however, radio signals have been used for navigation since the 1920s.

3.3 How the location of a position is done with GPS

The distance between the position of the GPS satellite and the GPS receiver is calculated by using Equation 1.1 (Corvallis Microtechnology 2000; McNamara 2004; Raju 2004; TTU 2012). Distance =speed x time In other words, a GPS receiver determines the amount of time it takes the radio signal (i.e., GPS signal) to travel from the GPS satellite to the GPS receiver. The GPS signal travels at the speed of light (186 thousand miles per second). Both the GPS satellite and the GPS receiver generate an identical pseudo-random code sequence. When the GPS receiver receives this transmitted code, it determines how much the code needs to be shifted for the two code sequences to match. Therefore, the shift is multiplied by the speed of light to determine the distance from the GPS satellite to the GPS receiver. GPS satellites are orbiting the Earth at an altitude of 11 thousand miles (Corvallis Microtechnology 2000; Raju 2004; TTU 2012). Assuming that the GPS receiver and the satellite clocks are precisely and continually synchronized, the GPS receiver uses three satellites to triangulate a 3D position, then the GPS provides coordinates (X, Y, Z) for a calculated position. However, a GPS receiver needs four satellites to provide a 3D position. Since the GPS receiver clock is not as accurate as of the atomic clocks in the satellites, then a fourth variable T for time is determined in addition to the three variables (X, Y, and Z). The Global positioning system was initially made for military purposes but as time passed by, it was made open for public use by the Americans. There 2 major vendors that provide map services using GPS through application programming interfaces and they are Google with google maps, Apple with map kit with google being the most popular and commonly used mapping system with GPS

3.3.1 Segments of GPS

The global positioning system can be distinguished into three segments that are the space segment, control segment and user segment as shown in the diagram above. The space segments consist of the satellites in orbit around the earth at an altitude of 20,200 km in space. Each satellite transmits a signal which contains a sine wave with carrier frequencies, two digital codes, digital codes, and a navigation message which helps to tell the location of the satellite to the earth. The control segment of the GPS is controlled by the U.S. Army. It consists of a worldwide network of tracking stations, with a Master Control Station (MCS) located in the United States. The control segment aims to operate and monitor the GPS. The main objective of the control segment is to track the GPS satellites to determine and predict satellite locations. The user segment includes all military users of the secure GPS Precise Positioning Service, all civilian users, all GPS receivers and processing software, and commercial and scientific users of the Standard Positioning Service. Currently, the GPS service is free with no direct charge

3.3.2 The transportation model of a GPS

GPS receivers are applied for fleet management in terrestrial systems (e.g., road and rail) to track the location of vehicles. GPS receivers can allow real-time tracking, detect when a vehicle is outside of the predefined defense, save fuel consumption costs by helping the driver to choose the optimal route, store up a certain number of tracking records when a connection is lost, remotely power off a vehicle, control fuel consumption, and temperature, detect when a vehicle is driven over the speed limit, monitor voices, and other activities. Moreover, GPS receivers are used to secure vehicles from theft by informing the concerned users via an alert message

3.4 Artificial Intelligence and machine learning

Recent years have seen significant advances in the potential and capabilities of artificial intelligence techniques. Various applications can be observed all around us where many people interact and AI-enabled systems such as image recognition systems in our social media platform for face tagging, autonomous vehicles popular among them are self-driving cars as well as natural language processing virtual assistants and recommender systems based on online services such as YouTube and Amazon.

3.4.1 A general overview of Artificial Intelligence

Artificial intelligence is an umbrella term that refers to a suite of technologies in a computer system programmed to exhibit complex behavior similar to one that humans and animals would display when faced with challenges in an environment. Artificial intelligence is under a bigger umbrella of computer science with an intersection of mathematics and statistics. The various sections and fields under artificial intelligence include machine learning which has deep learning embedded within. Data science is also a field that intersects with artificial intelligence. Due to the availability of human and machine-generated data, this field coupled with artificial intelligence helps determine insights and make predictions based on historical data.

3.4.2 Machine learning

Machine learning as the term goes is a subfield embedded within artificial intelligence and computer science that is concerned with building algorithms that can be useful to the prediction and classification of a phenomenon or process. It involves the processing of solving a problem by gathering a dataset and algorithmically building a statistical model on that dataset. Machine learning can be supervised, unsupervised, and reinforcement. Supervised is a machine learning approach that involves a dataset that has a set of labels or outputs on which an algorithm would generate a statistical model based on a mapping sequence. Supervised machine learning algorithms include classification models that can help predict a category and regression models that can provide statistically estimated value based on a model generated on a dataset. Some classification models include linear regression, support vector machines, gradient boosting and classification models include Naïve bays, k-nearest neighbor, logistic regression, and decision trees. Unsupervised learning involves generating models on a collection of datasets that have unlabeled examples or results. Reinforcement learning involves the creation of an agent that traverses a computational environment based on rewards. A subfield of machine learning is deep learning which is, the application of state of the art perception’s called neural networks to solve computational problems. Neural networks are fashioned after the architecture of the neurons in the human body which help humans in performing tasks among many others .deep learning has seen massive adoption in the field of computer-vison, natural language processing among many others. The popular algorithms under deep learning are recurrent neural networks used for solving text-based problems and convolutional neural networks used for image processing use cases

3.4.3 Computer vision-based edge devices

An edge device is a term used for an internet of things microcontroller with sensors used to collect data. It is a device that lives at the edge of a network and performs work or inference in the exact location. The traditional flow of data through a machine learning system involves a process where; Information is collected from the environment by a device, the resulting data is sent via a network connection to a hosted backend server which performs an inference or prediction based on a machine learning model and if necessary the server then sends the results back to the device or other devices subscribed to receive information on that inference. In the case where we can perform inference on the device collecting the data itself, we can skip a lot of steps which provides a lot of added advantages as follows;

1-Bandwidth In our case we are checking for bus occupancy count, when our edge device counts the number of people using a machine learning model hosted on it, it can use tiny amounts of bandwidth to send back the count of the people without the need of having to stream a video.

2-Latency Sending data to a server involves a round trip delay which gets in the way when working with real-time data. This is no longer an issue in our case when using an edge device to perform inference, and in this case, the inference is superfast based on the architecture and specifications of the device.

3-Cost and reliability Hosting a machine learning model on a server in the cloud comes with a cost when an endpoint is called to perform inference but with our model hosted on our edge device, we cut down cost. And by simplifying our backend server, we improve reliability.

4-Privacy and security When data stays on the device for inference, a user benefits from the increased privacy and security since personal information never leaves the edge device. This enables new privacy-aware conscious applications that analyze metrics without sending data to the cloud.

3.5 Our proposed solution for the bus tracking and monitoring problem

Our proposed system of a bus tracking and monitoring system includes three sections which are server-side section, client-side section, and monitoring section.

3.5.1 Server-side

This includes a hosted cloud platform on a server that has the backend, the database to store several fields, and a frontend which is a website of a map interface that can be accessed using a website address by any student or general user of the bus system on campus. It can help the students and general users track the location of a bus and get information if the estimated time of arrival and bus occupancy. The server side also includes the platform which will host the time ,sub-components include the following:

Database This is a firebase database from google which is based on a NoSQL document object model that makes use of JavaScript object notation and can be used to stream real-time dynamic location logs from the tracking device onto the map as markers

Backend This is the section hosted on the server that contains code that runs the logging of location coordinates from the database onto the map of the frontend and other functions such as the estimated time of arrival and bus occupancy count. It is based on a JavaScript framework called Node.js.

Frontend This section includes code hosted on the server based on hypertext mark-up language, cascading style sheets, and JavaScript framework. It is the graphical user interface which depicts the map of KNUST campus with the various markers including the bus for tracking the location of the bus on various routes

Server It is the cloud software platform on which the various components such as the frontend are hosted on and connected to a network that can be accessed by a website address to view the graphical user interface. We will use a metered server provided by the google cloud platform service to host our server.

Regression machine learning model This is a model hosted on IBM Watson machine learning server which uses an automated architecture to perform feature engineering, scaling and selection of various models, train them on the dataset provided tunes the various hyperparameters and provides various scores of models with the best which are ranked based on the metrics such as the root mean square error, mean average error and mean squared error among many others. It generates an application programming interface that will be integrated into the mobile application of the students to predict the estimated time of arrival of the bus.

3.5.2 Client-side

Drivers app This app will log the location coordinates and other parameters to help users such as students track the bus and get information related to the estimated time of arrival of the bus and bus routes. This app is being built on an android studio software standard development kit from Google.

Student and general users’ app This mobile application is built using the android studio.it will help students track bus, get real-time updates of bus routes and locations as well as get information related to the estimated time of arrival

3.5.3 Monitoring section

Edge device This device is an inference device which consists of a raspberry pi microcontroller which is WIFI enabled, that is connected to a pi camera.it has a machine learning model hosted on it which would be used for inference (counting people on the bus and checking seat availability) and contains a message layer for transmitting the statistical message of people count to a graphical user interface. The edge device is made up of the following components with their specifications and requirements for our proposed system

pi camera
raspberry pi 3 micro-controller board

3.5.4 computer vision inference model

This model uses pre-trained neural networks from the open vino library provided by Intel and OpenCV, computer vision (CV) library filled with many different computer vision functions, and other useful image and video processing and handling capabilities to process and count the number of people in the bus.

Message and video transport protocol

MQTT-message queuing telemetry transport MQTT-message queuing telemetry transport A publisher-subscriber protocol often used for IoT devices due to its lightweight nature. The paho-MQTT library is a common way of working with MQTT in Python. The publisher-subscriber protocol is a messaging architecture whereby it is made up of publishers, which send messages to a central broker, without knowing of the subscribers themselves. These messages can be posted on some given “topic”, which the subscribers can then listen to without having to know the publisher itself, just the “topic”

FFMPEG-fast forward Mpeg It’s a Software that can help convert or stream audio and video. In our proposed system, the related server software is used to stream to a web server, which can then be queried by a Node server for viewing in a web browser.

Node.js server- A web server built with Node.js that can handle HTTP requests and/or serve up a webpage for viewing in a browser.

3.6 Why we chose raspberry pi as our edge device

A lot of consideration was taken into mind in selecting a suitable microcontroller that would enable us to achieve the objective of bus occupancy count which are as follows:

  1. Power consumption

    • From the image above, it can be observed that the raspberry pi is the microcontroller with the moderate power consumption that suits the specifications of a platform to support a bus occupancy count computer vision model

  2. Price of the microcontroller

    • From the image above, it can be observed that the raspberry pi is the microcontroller with the moderate power consumption that suits the specifications of a platform to support a bus occupancy count computer vision model

  3. Processing power

    • It can be observed that the raspberry pi has a suitable processing power that meets our edge device specifications.

  4. Connection Interface and features

    • It can be observed that the raspberry pi has interfaces that can support connections for a camera for bus occupancy count. .

3.7 Why we chose firebase as our database platform

Firebase is a robust free tier and popular database platform that is easy to integrate with apps and software. Thus, it will aid us in building our proposed system

Chapter 4 Methodology

This chapter expands more on the methods used in collecting data and the approach we took towards building our bus tracking and monitoring system .

4.1 Data collection

We visited the vehicle maintenance department of KNUST, spoke with the engineer in charge, who provided us with information on the schedules, routes, the number of buses, and drivers dedicated to these buses. We collected data based on the routes the bus we scheduled to move on. We had a total of two routes linking major destinations on the KNUST campus students commuted to and from every day for their lectures.

4.1.1 Main Bus routes on the KNUST campus.

  • Commercial area to business school

  • Brunei Hostel to business School

4.1.2 Dedicated bus stops on routes .

  • Commercial area bus stop

  • main Library bus stop

  • Katanga Bus stop

  • Brunei Bus Stop

Based on the information collected from the vehicle and transport maintenance department of the school, and based on the procedure used by Jisha et al, we each took a dedicated bus and record data regarding the following fields which would help us in preparing a machine learning model to estimate the time of arrival of the buses at the various bus stops.

  1. Routes

  2. Bus stops

  3. Time of departure from a bus stop

  4. Time of arrival at a bus stop

  5. Total time travel

  6. Total time spent waiting in traffic

  7. Total time traveled between various stops

4.2 Estimated Time of Arrival (ETA) using machine learning

We used IBM Watson studio which had a suite of machine learning tools to help us determine the best machine learning model to help us predict the estimated time of arrival of the bus at a particular bus stop based on a time series and other factors that influence the prediction of estimated to of arrival of the bus. We cleaned the data to make sure our model would not be introduced to inappropriate forms of characters or data that would cause it to either make our model underfit or overfit. After, we then uploaded our data to the studio and used the auto ml feature in the studio to determine the best machine learning model. Below is a diagram displaying the various stages in which auto ml finally settled on a Light regressor from the research team at microsoft

4.3 Bus occupancy count

We collected video recordings of the occupancy in buses in their commute on campus to enable us to develop a neural network-based bus occupancy counter using the computer vision library OpenCV and other modules.

4.4 Android application, for tracking and monitoring buses

We developed an android based app for both the driver of a bus and the students’ version for tracking. We incorporated a GPS software kit from google to enable us to track the coordinates of the driver of dedicated bus whiles they commute on campus. Both applications were built using android studio software. The bus counts and GPS coordinates were transmitted from the drivers’ app to the database in the cloud called firebase which then stored and help transmit the traced location of the drivers on the student version to enable them to get notifications of buses the subscribe to and monitor the occupancy and movements of the various buses

Chapter 5 Results and Analysis

5.1 Results of the machine learning model for ETA prediction

After using auto ml to train our model, we got a few metrics back from IBM Watson console to measure the effectiveness of our training, testing, and validation process on our data using the LGBM regressor. The metric of focus was the r squared value which was 0.83, thus approaching 1 indicates that our model has a high accuracy between the observed value and predicted value. Hence we can use this machine learning model to predict the estimated time of arrival of our bus on campus. This model, unfortunately, will require retraining, due to the variable conditions that affect the estimated time of arrival of bus day in day out on the KNUST campus. We were able to test our model as well using a generated application programming interface provided by Watson console, and in most cases, we got an average of 2 minutes for commute between various bus stops on campus

5.2 Android application for tracking buses performance

After developing the versions of the driver and the student’s app, we tested it on campus several times to check if we were able to track the location of the buses based on the driver’s app, which was then displayed in the student’s app. Also, we tested out the vision model to check the bus occupancy count of the various buses. After all these tests, we were able to conclude that, the apps worked very well, including the trigger functions we had set up in the cloud which provided notifications whenever a bus got in range of a dedicated bus stop. Below are images of results from our tests.

5.3 Occupancy count performance using a deep neural network

In the area of bus occupancy count, we tested out the raspberry pi with the vision model on many video streams including one containing students in a bus understudy commuting to their classes for lectures. Our model was able to count the number of faces in the video frame with an accuracy of 0.7 due to the angle of the camera on the bus

Chapter 6 Conclusion

In this thesis, we investigated the problem lack of bus tracking and onitoring systems on Kwame Nkrumah University of Science and Technology Campus.We have developed a smartphone basede bus tracking and monitoring system to address the issue faced by Students on University campus. The tracking and monitoring system developed has been been validated through test and deployment on campus . In our journey to see this project through to success, we have been able to develop and test an app that can help students monitor, get updates of bus occupancy, and check the proximity of time within which a bus will arrive at a bus stop on the KNUST campus. We have also deployed it on Google play store for the patronage of students to test it out and eventually end up using it to help them on their commute on campus making it easier and faster. We also believe that data is key and in all, School authorities can use the data of bus occupancy counts to make data-driven decisions as to whether students need more buses among many others. We believe our research into building a resilient system to ease the whole problem of decision-based commute on campus for students is a stepping stone for other researchers who would dive deeper into building more efficient systems as the solution

References

Comments 0
Request Comment
You are adding the first comment!
How to quickly get a good reply:
  • Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
  • Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
  • Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
""
The feedback must be of minimum 40 characters and the title a minimum of 5 characters
   
Add comment
Cancel
Loading ...
426443
This is a comment super asjknd jkasnjk adsnkj
Upvote
Downvote
""
The feedback must be of minumum 40 characters
The feedback must be of minumum 40 characters
Submit
Cancel

You are asking your first question!
How to quickly get a good answer:
  • Keep your question short and to the point
  • Check for grammar or spelling errors.
  • Phrase it like a question
Test
Test description