Skip to content

Nalina655/main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

73 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸšŒ Real-Time Bus Arrival Prediction Using LSTM with Traffic and Weather Integration ๐Ÿ“– Overview

This project was developed as part of the Machine Learning Internship at PESU Rapid Research Center, PES University (June 2025 โ€“ July 2025). The goal was to design a real-time bus ETA (Estimated Time of Arrival) prediction system that integrates live GPS data, traffic conditions, and weather context to enhance prediction accuracy.

The system employs a Long Short-Term Memory (LSTM) deep learning model, known for its strength in handling temporal dependencies and time-series data, and delivers real-time ETA updates through an interactive Streamlit web dashboard.

๐Ÿง  Key Contributions

๐Ÿ”น Developed an LSTM-based model to predict bus arrival times using sequential GPS data and contextual features.

๐Ÿ”น Integrated live traffic and weather data via APIs for real-time prediction refinement.

๐Ÿ”น Built a complete machine learning pipeline โ€” including preprocessing, feature engineering, model training, and evaluation.

๐Ÿ”น Deployed the system on Streamlit, enabling users to visualize ETA predictions in real time.

๐Ÿ”น Co-authored a research paper submitted to an international AI conference, presenting system design, methodology, and performance analysis.

โš™๏ธ Tools & Technologies

Programming Language: Python

Frameworks/Libraries: TensorFlow, Keras, Pandas, NumPy, Scikit-learn

Web Framework: Streamlit

Visualization: Matplotlib, Plotly

APIs: Google Maps API (Traffic), OpenWeatherMap API (Weather)

Development Environment: Jupyter Notebook / VS Code

๐Ÿ—๏ธ System Architecture +-------------------------------------------------------+ | Real-Time Data Sources | | (GPS Feeds) (Traffic API) (Weather API) | +-------------------------------------------------------+ โ†“ โ†“ โ†“ +-------------------------------------------------------+ | Data Preprocessing & Feature Engineering | | - Timestamp alignment | | - Speed & delay feature extraction | | - Context merging (traffic + weather) | +-------------------------------------------------------+ โ†“ +-------------------------------------------------------+ | LSTM-Based ETA Prediction Model | | - Sequence input (past GPS positions & times) | | - Contextual inputs (traffic, weather) | | - Output: Predicted ETA (minutes) | +-------------------------------------------------------+ โ†“ +-------------------------------------------------------+ | Streamlit Web Dashboard | | - Interactive ETA visualization | | - Real-time bus tracking | | - Weather & traffic overlays | +-------------------------------------------------------+

๐Ÿงฉ Model Summary

Architecture: LSTM layers with dropout regularization

Loss Function: Mean Absolute Error (MAE)

Optimizer: Adam

Evaluation Metric: MAE โ‰ˆ 4.27 minutes

Training Data: Historical GPS traces enriched with contextual data

๐Ÿงช Example Code Snippet import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dense, Dropout

LSTM Model

model = Sequential([ LSTM(64, return_sequences=True, input_shape=(time_steps, feature_dim)), Dropout(0.2), LSTM(32), Dense(1, activation='linear') ])

model.compile(optimizer='adam', loss='mae') history = model.fit(X_train, y_train, epochs=50, batch_size=32, validation_data=(X_val, y_val))

๐ŸŒ Streamlit Dashboard Features

๐ŸšŒ Live Bus Tracking: Displays real-time bus location updates.

๐Ÿ“… ETA Prediction: Shows expected arrival time based on model output.

๐ŸŒค๏ธ Weather Context: Integrates live weather conditions.

๐Ÿšฆ Traffic Visualization: Uses color-coded route congestion indicators.

๐Ÿ“Š Performance Metrics: Displays model evaluation results interactively.

๐Ÿ“ˆ Results Metric Value Mean Absolute Error (MAE) 4.27 minutes Model LSTM Deployment Streamlit App Integration Real-time Traffic + Weather APIs ๐Ÿš€ Future Work

Extend to multi-route and multi-city datasets.

Incorporate Graph Neural Networks (GNNs) for spatiotemporal modeling.

Optimize for edge deployment on onboard bus systems.

๐Ÿง‘โ€๐Ÿ’ป Developer & Research Intern

Nalina S D ๐ŸŽ“ Final-year ECE Student, PES University ๐Ÿ“ Internship: PESU Rapid Research Center (June 2025 โ€“ July 2025) ๐Ÿ“ Co-author: โ€œReal-Time Bus Arrival Prediction Using LSTM with Traffic and Weather Integrationโ€ (AIMLSystems 2025 Submission)

About

.....

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages