Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Adaptive Crosswalk Timing System for Elderly Pedestrians

Research Status Phase Master's Thesis License

Research Project - Crosswalk Detection and Timing Optimization using Computer Vision

🎯 Project Overview

This research addresses a critical pedestrian safety issue in South Korea: elderly pedestrians walk significantly slower (0.54 m/s) than the standard timing assumes (1.0 m/s), leading to dangerous situations at crosswalks.

Our solution uses overhead CCTV cameras to:

  1. Detect crosswalk mask regions in real-time
  2. Track pedestrian crossing speeds
  3. Dynamically adjust signal timing for safer crossing

🧭 Research Roadmap Overview

Phase Objective Status
Phase 1 – Crosswalk Segmentation Build robust crosswalk detection from FPVβ†’CCTV βœ… COMPLETE
Phase 2 – Pedestrian Tracking Detect and track pedestrians, estimate walking speed ⏳ Up Next
Phase 3 – Signal Control Adaptive timing control and safety validation ⏳ Planned
Phase 4 – Deployment Implement Jetson-based prototype ⏳ Planned

πŸŽ‰ Phase 1 Complete - Major Achievement!

Final Results: 98.5% IoU on CCTV 🎯

We successfully adapted a first-person view (FPV) crosswalk segmentation model to overhead CCTV viewpoint using semi-supervised learning with minimal manual annotation.

Key Innovation: Data-Efficient Transfer Learning

✨ Only 241 manually labeled CCTV images
✨ Leveraged 5,926 unlabeled AI-Hub images via pseudo-labeling
✨ 5Γ— data efficiency compared to fully supervised approach
✨ Realtime capable: 77 FPS on 512Γ—512 resolution


πŸ“Š Phase 1 Results Summary

Stage 1: FPV Baseline

  • Model: U-Net with ResNet34 encoder
  • Dataset: 3,300 FPV crosswalk images
  • Performance: 93.05% IoU on FPV test set
  • Status: βœ… Complete

Stage 2: CCTV Adaptation (Two-Iteration Approach)

Iteration 1: Fine-Tuning on Labeled Data

  • Model: DeepLabV3 + ResNet50 (initialized from FPV weights)
  • Dataset: 241 manually labeled CCTV images (201 train / 40 val)
  • Training: 30 epochs, Dice+BCE loss, AdamW optimizer (lr=1e-4)
  • Result: 88.9% IoU

Iteration 2: Semi-Supervised Learning

  • Approach: Confidence-based pseudo-labeling
  • Pipeline:
    1. Generate predictions on 5,926 unlabeled AI-Hub images
    2. Score confidence (prediction certainty + geometric validation)
    3. Select top 1,000 high-confidence pseudo-labels (threshold: 0.7)
    4. Retrain on combined dataset (241 labeled + 1,000 pseudo)
  • Training: 20 epochs, lower learning rate (lr=5e-5)
  • Result: 98.5% IoU ⭐

Performance Comparison

Metric Iteration 1 Iteration 2 Improvement
Val IoU 88.9% 98.5% +9.6%
Train IoU 97.0% 98.8% +1.8%
Dataset Size 241 1,241 5Γ— larger
Inference Speed 77 FPS 77 FPS Maintained

πŸ”¬ Methodology

Transfer Learning Pipeline

FPV Model (93% IoU)
    ↓
Load Pre-trained Weights
    ↓
Fine-tune on 241 CCTV images β†’ Iteration 1 (88.9% IoU)
    ↓
Generate Pseudo-Labels on 5,926 unlabeled images
    ↓
Filter Top-1000 High-Confidence (Score > 0.7)
    ↓
Retrain on Combined Dataset β†’ Iteration 2 (98.5% IoU)

Pseudo-Label Quality Metrics

  • Average confidence score: 0.976
  • Geometric validation: 1.0 (perfect for top-1000)
  • Top score: 0.988

Architecture Details

  • Model: DeepLabV3 with ResNet50 backbone
  • Input: 512Γ—512 RGB images
  • Output: Binary segmentation mask
  • Parameters: ~39M
  • Inference speed: 77 FPS (exceeds 30 FPS requirement)

πŸ“ˆ Training Visualizations

Iteration 1: Initial Fine-Tuning

Training History Iter1

Key Observations:

  • Stable convergence after 20 epochs
  • Best validation IoU at epoch 28
  • Minimal overfitting (train: 97.0%, val: 88.9%)

Iteration 2: Semi-Supervised Learning

Final Results

Key Observations:

  • Rapid improvement with pseudo-labels
  • Best validation IoU at epoch 19
  • Strong generalization (train: 98.8%, val: 98.5%)

Sample Predictions

Predictions

Visualization showing ground truth (green) vs. model predictions (red) on validation samples. The model achieves near-perfect alignment with manual annotations.

Pseudo-Label Quality

Pseudo Labels

Top 9 pseudo-labeled samples showing high prediction confidence and accurate crosswalk detection across various weather conditions and camera angles.


πŸ“ Repository Structure

crosswalk-cctv/
β”œβ”€β”€ notebooks/
β”‚   β”œβ”€β”€ 01_extract_frames.ipynb          # Video to frames extraction
β”‚   β”œβ”€β”€ 02_prepare_fpv.ipynb             # FPV dataset preparation
β”‚   β”œβ”€β”€ 03_train_stage1_fpv.ipynb        # Stage 1: U-Net training on FPV
β”‚   └── cctv_finetuning.ipynb            # Stage 2: Transfer learning + pseudo-labeling
β”œβ”€β”€ outputs/
β”‚   β”œβ”€β”€ stage1_fpv/
β”‚   β”‚   β”œβ”€β”€ best_model.pth               # FPV baseline weights
β”‚   β”‚   β”œβ”€β”€ results.json                 # Training metrics
β”‚   β”‚   └── training_history.png         # Loss/IoU curves
β”‚   └── stage2_cctv/
β”‚       β”œβ”€β”€ best_model_cctv.pth          # Iteration 1 weights
β”‚       β”œβ”€β”€ best_model_cctv_iter2.pth    # Iteration 2 weights (final)
β”‚       β”œβ”€β”€ experiment_summary.json      # Complete metrics
β”‚       β”œβ”€β”€ training_history.png         # Iteration 1 curves
β”‚       β”œβ”€β”€ final_results.png            # Both iterations comparison
β”‚       β”œβ”€β”€ predictions_visualization.png
β”‚       └── pseudo_labels/
β”‚           └── iteration_1/
β”‚               β”œβ”€β”€ images/              # 1,000 pseudo-labeled images
β”‚               β”œβ”€β”€ masks/               # Generated masks
β”‚               └── metadata.json        # Confidence scores
β”œβ”€β”€ data/                                 # (not in repo - too large)
β”‚   β”œβ”€β”€ fpv_processed/                   # 3,300 FPV samples
β”‚   β”œβ”€β”€ finetuning/                      # 241 labeled CCTV samples
β”‚   └── AI-hub_dataset/                  # 5,926 unlabeled CCTV images
β”œβ”€β”€ requirements.txt                      # Python dependencies
β”œβ”€β”€ environment.yml                       # Conda environment
└── README.md                            # This file

πŸš€ Getting Started

Prerequisites

# Create conda environment
conda env create -f environment.yml
conda activate crosswalk

# Or use pip
pip install -r requirements.txt

Running the Complete Pipeline

Step 1: Train FPV Baseline (Stage 1)

jupyter notebook notebooks/03_train_stage1_fpv.ipynb

Step 2: CCTV Adaptation (Stage 2)

jupyter notebook notebooks/cctv_finetuning.ipynb

This notebook runs the complete two-iteration pipeline:

  • Iteration 1: Fine-tuning on 241 labeled CCTV images
  • Pseudo-labeling: Generate and filter high-confidence labels
  • Iteration 2: Retrain on combined dataset

πŸ“Š Detailed Metrics

Stage 1: FPV Baseline

{
  "model": "U-Net + ResNet34",
  "dataset_size": 3300,
  "final_val_iou": 0.9305,
  "best_epoch": 20,
  "total_epochs": 30
}

Stage 2: CCTV Adaptation

Iteration 1 (Fine-Tuning)

{
  "model": "DeepLabV3 + ResNet50",
  "labeled_samples": 241,
  "train_samples": 201,
  "val_samples": 40,
  "epochs": 30,
  "best_val_iou": 0.8891,
  "final_train_iou": 0.9702
}

Pseudo-Labeling

{
  "total_unlabeled": 5926,
  "generated_labels": 5926,
  "high_confidence_labels": 1000,
  "confidence_threshold": 0.7,
  "top_score": 0.988,
  "average_score": 0.976
}

Iteration 2 (Semi-Supervised)

{
  "combined_dataset": 1241,
  "train_samples": 850,
  "val_samples": 150,
  "epochs": 20,
  "best_val_iou": 0.9852,
  "final_train_iou": 0.9884,
  "improvement_over_iter1": 0.0961
}

Inference Performance

{
  "resolution": "512x512",
  "inference_time_ms": 12.98,
  "fps": 77.03,
  "realtime_capable": true
}

πŸ† Key Achievements (Phase 1)

✨ 98.5% IoU on CCTV - Excellent segmentation accuracy
✨ 5Γ— data efficiency - Only 241 manual labels needed (vs 1,200+ for fully supervised)
✨ 77 FPS inference - Exceeds real-time requirement (30 FPS)
✨ Robust pseudo-labeling - 98.8% top-1000 confidence score
✨ Domain adaptation success - FPVβ†’CCTV transfer works
✨ Research novelty - Confidence-based filtering + geometric validation


πŸ”¬ Research Contributions

1. Data-Efficient Transfer Learning

  • Demonstrated effective FPVβ†’CCTV domain adaptation
  • Achieved near-perfect performance with minimal manual annotation
  • Validated semi-supervised learning for crosswalk detection

2. Confidence-Based Pseudo-Labeling

  • Novel scoring: (Prediction Confidence + Geometric Validation) / 2
  • Geometric validation: Checks crosswalk area ratio (5-40% of frame)
  • Automatic quality filtering without human intervention

3. Real-Time Deployment Ready

  • 77 FPS on standard GPU (512Γ—512 resolution)
  • Suitable for edge deployment (Jetson platforms)
  • Maintains accuracy while meeting speed requirements

πŸ”„ Next Steps: Phase 2

Pedestrian Tracking & Speed Estimation

Objectives:

  1. Multi-object tracking of pedestrians within crosswalk region
  2. Walking speed estimation for each tracked individual
  3. Elderly pedestrian detection (walking speed < 0.6 m/s)

Approach:

  • Use Phase 1 model to extract crosswalk mask as ROI
  • Apply YOLO + DeepSORT for pedestrian tracking
  • Estimate speed using pixel-to-meter calibration
  • Classify pedestrians by walking speed

Target Metrics:

  • Tracking accuracy: MOTA > 70%
  • Speed estimation error: < 0.1 m/s
  • Real-time performance: 30+ FPS

πŸ“š Research Context

Problem Statement

  • South Korean elderly walk at 0.54 m/s (vs assumed 1.0 m/s)
  • Current crosswalk timing is insufficient
  • Risk of accidents increases with aging population

Proposed Solution

  • Real-time CCTV-based pedestrian tracking
  • Dynamic signal timing adjustment
  • Privacy-preserving (no facial recognition)
  • Edge deployment on Jetson platforms

Research Progress

  • βœ… Phase 1: Crosswalk segmentation (98.5% IoU achieved)
  • ⏳ Phase 2: Multi-object tracking & speed estimation
  • ⏳ Phase 3: Signal control logic & SUMO simulation
  • ⏳ Phase 4: Real-world Jetson deployment

πŸ“– Citation

@mastersthesis{omar2025crosswalk,
  title={Adaptive Crosswalk Timing System for Elderly Pedestrians using Semi-Supervised Learning},
  author={Omar Abdirashid},
  year={2025},
  school={Kookmin University},
  type={Master's Thesis},
  advisor={Prof. Jonghyuk Park},
  note={Phase 1: 98.5\% IoU CCTV segmentation with 5x data efficiency}
}

πŸ“§ Contact

Researcher: Omar Abdirashid
Institution: Kookmin University
Advisor: Prof. Jonghyuk Park
GitHub: @rashiedomar


πŸ“„ License

This project is part of academic research. Please contact for usage permissions.


Last Updated: November 2025
Status: Phase 1 Complete βœ… | Phase 2 Starting πŸš€
Performance: 98.5% IoU @ 77 FPS

About

Vision-based adaptive crosswalk system that extends pedestrian green time using YOLO tracking, homography speed estimation, and safety logic to protect elderly and slow walkers in real time.

Topics

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages