SMARTMOVE

hackathonproject-description2nd-place

What is smartmove?

smartmove is an artificial intelligence-based system developed to predict and analyze passenger density in the Ankara Metro system. The project was developed by the Cyberia team for the Ostimtech AI Competition 2024. The system combines real-time passenger counting capabilities with predictive analytics to optimize metro operations and improve the passenger experience.

Purpose of smartmove

The primary purpose of smartmove is to address the challenges of passenger congestion in Ankara's metro system. By providing accurate predictions of passenger density across different stations, times, and conditions, the system helps both metro operators and passengers make informed decisions. Metro management can optimize train schedules and resource allocation, while passengers can plan their journeys to avoid overcrowded times.

This solution aims to enhance the efficiency of public transportation by leveraging artificial intelligence and computer vision technologies. The system takes into account various factors such as time patterns, station types, weather conditions, and service frequency to generate realistic forecasts, making it a comprehensive analysis tool for urban mobility optimization.

Core Functions

1. Passenger Counting Module (counter.py)

  • Real-time passenger counting from video feeds using YOLOv8-based human detection
  • Direction determination capability for entrance/exit analysis
  • Line crossing analysis for direction detection
  • Video recording and visual analysis capabilities
  • Visualization and statistics with OpenCV
  • Configurable counting zones and boundaries

2. Data Generation Module (generate.py)

  • Creates synthetic passenger data for Ankara Metro lines
  • Considers various factors in data generation:
    • Time (hour, day, weekend/weekday)
    • Station type and location
    • Weather conditions
    • Service frequency
  • Produces realistic data patterns (rush hours, weekend/weekday differences)
  • Supports all metro lines (M1-2-3, M4, A1)
  • Classification of station types (central, transfer, peripheral)

3. Prediction Module (predict.py)

  • Machine learning-based passenger density prediction
  • Multiple model type options (Random Forest, Gradient Boosting)
  • Station-based, time-based, and weather factor-based predictions
  • Model training and evaluation tools
  • Feature engineering for improved accuracy
  • Density status interpretation (Empty, Normal, Crowded, Very Crowded)

4. Command Line Interface

  • User-friendly CLI for all system components
  • Parameter configuration for model training
  • Visualization options for predictions and counting
  • Output formatting and reporting tools
  • Integration capabilities with other systems

Technical Requirements

System Architecture

Passenger Counting System

  • YOLOv8 for object detection (person class)
  • OpenCV for image processing
  • Line crossing algorithm for direction detection
  • Visual reporting and configurable counters
  • Real-time processing capabilities

Data Generation System

  • Comprehensive data generation for all Ankara Metro lines
  • Realistic station type classification (central, transfer, peripheral)
  • Weather factor integration (Sunny, Rainy, Snowy, etc.)
  • Time-based patterns (rush hours, weekday/weekend)
  • Special event impact simulation

Prediction System

  • Different model types (Random Forest, Gradient Boosting)
  • Feature engineering for enhanced predictions
  • Model training and evaluation metrics
  • Station-based and time-based predictions
  • Density status interpretation

Project Structure

.
├── data/               # Data files and demo videos
├── generator/          # Synthetic data generation modules
│   ├── station_config.py  # Station information
│   ├── time_patterns.py   # Time-based patterns
│   ├── event_patterns.py  # Special event patterns
│   ├── metro_generator.py # Metro data generator
│   └── utils.py           # Helper functions
├── train/              # Model training modules
│   ├── data_preprocessing.py # Data preprocessing
│   ├── evaluation.py        # Model evaluation
│   ├── predictor.py         # Prediction class
│   ├── station_config.py    # Station configuration
│   └── utils.py             # Helper functions
├── cli.py              # Command line interface
├── counter.py          # Passenger counting main module
├── generate.py         # Data generation main script
└── predict.py          # Prediction main script

Usage Examples

1. Data Generation

python generate.py --lines M1,M2,M3,A1 --days 30 --output data/synthetic_data.csv

2. Model Training

python predict.py train --input data/synthetic_data.csv --model random_forest --output models/rf_model.pkl

3. Making Predictions

python predict.py predict --station Kızılay --time "2024-06-10 18:00" --weather Sunny

4. Passenger Counting

python counter.py --input data/metro_video.mp4 --output results/ --display

Future Features

  • Integration with ride-sharing platforms like Uber
  • Alternative route recommendation mechanism
  • Shared journey options for carpooling
  • Real-time density map visualization
  • Station-based travel time estimates
  • Analysis of special events' impact on density
  • Mobile application for passenger notifications
  • Integration with smart city infrastructure

smartmove is a comprehensive passenger analysis solution for the Ankara Metro system. With real-time passenger counting and machine learning-based density predictions, it aims to optimize metro operations and enhance the passenger experience. The project demonstrates how artificial intelligence technologies can be leveraged to increase the efficiency of public transportation systems, contributing to smarter urban mobility.

Source Codes

smartmove