AI Decision System for Future Traffic Prediction — Based on Deep Learning Fusion with Physics and Shockwave Theory
Real-time demonstration of the traffic shockwave warning system in action
| Achievement | Event | Date |
|---|---|---|
| 🥈 2nd Place (1st Place Vacant) | National Expressway Intelligent Traffic Competition | Oct 2024 |
| 🎤 Invited Speaker | 2025 Chinese Institute of Transportation Annual Conference | Dec 2025 |
This project was presented at the 2025 Annual Meeting of the Chinese Institute of Transportation, sharing our innovative approach of combining deep learning with physics-based shockwave theory for highway traffic prediction.
|
Official Competition Poster |
2025 CIT Annual Conference |
Conference Presentation |
| Real-Time Monitoring | Shockwave Detection | AI Prediction | Smart Routing |
| 62 ETC stations across Taiwan | Sub-5 second alert latency | 10-60 min advance forecast | Dynamic route optimization |
| Level | Speed Drop | Visual | Action |
|---|---|---|---|
| 🟢 Mild | 10-20 km/h | Green | Minor delays expected |
| 🟡 Moderate | 20-30 km/h | Yellow | Consider alternative routes |
| 🔴 Severe | 30+ km/h | Red | Route change recommended |
Features Highlight
- Interactive traffic map with real-time congestion status
- Shockwave radar visualization with propagation animation
- AI-powered route suggestions
- Personalized departure time recommendations
Features Highlight
- Network-wide traffic monitoring
- MT-SWNet prediction visualization (90% confidence)
- AI decision support recommendations
- Historical trend analysis
┌─────────────────────────────────────────────────────────────────┐
│ Frontend Layer │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ Driver │ │ Admin │ │ Real-time Map │ │
│ │ Dashboard │ │ Control │ │ (React + Leaflet) │ │
│ └─────────────┘ └─────────────┘ └─────────────────────────┘ │
└───────────────────────────┬─────────────────────────────────────┘
│ WebSocket / REST API
┌───────────────────────────┼─────────────────────────────────────┐
│ Backend Layer │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ FastAPI Server (Port 8000) │ │
│ │ • /api/traffic • /api/shockwave • /api/prediction │ │
│ │ • /api/location • /api/rag • /api/admin │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │
│ ┌────────────────┐ ┌────────────────┐ ┌────────────────┐ │
│ │ MT-SWNet │ │ Shockwave │ │ RAG AI │ │
│ │ Predictor │ │ Detector │ │ Assistant │ │
│ │ (TensorFlow) │ │ (LWR Physics) │ │ (Ollama) │ │
│ └────────────────┘ └────────────────┘ └────────────────┘ │
└───────────────────────────┬─────────────────────────────────────┘
│
┌───────────────────────────┼─────────────────────────────────────┐
│ Data Layer │
│ ┌────────────┐ ┌────────────┐ ┌────────────────────────┐ │
│ │ TDX API │ │ TISC API │ │ SQLite + Graph Data │ │
│ │ (Real-time)│ │ (Real-time)│ │ (62×62 Adjacency) │ │
│ └────────────┘ └────────────┘ └────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
| Model | MAE (veh/5min) | RMSE | MAPE (%) | R² |
|---|---|---|---|---|
| MT-SWNet | 12.3 | 18.7 | 8.5 | 0.912 |
| Graph-WaveNet | 13.2 | 19.8 | 8.9 | 0.903 |
| AGCRN | 13.8 | 21.2 | 9.3 | 0.895 |
| DCRNN | 14.5 | 22.1 | 9.8 | 0.887 |
| LSTM | 18.9 | 28.7 | 13.5 | 0.798 |
| ARIMA | 21.3 | 32.1 | 15.7 | 0.721 |
- Python 3.11+
- Node.js 18.0+
- TDX API credentials (Apply here)
- Google Maps API key (Get here)
# Clone repository
git clone https://github.com/timwei0801/Highway_trafficwave.git
cd Highway_trafficwave
# Backend setup
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Frontend setup
cd frontend && npm install && cd ..
# Configure environment
cp .env.example .env
# Edit .env with your API credentials# Option 1: One-command deployment
./deploy.sh
# Option 2: Manual startup
# Terminal 1 - Backend
cd api && python main.py
# Terminal 2 - Frontend
cd frontend && npm run dev| Interface | URL | Description |
|---|---|---|
| 🚗 Driver Dashboard | http://localhost:3000/driver | Navigation & alerts |
| 🎛️ Admin Control | http://localhost:3000/admin | System management |
| 📚 API Docs | http://localhost:8000/docs | Swagger UI |
Get Active Shockwaves
import requests
response = requests.get('http://localhost:8000/api/shockwave/active')
shockwaves = response.json()
for sw in shockwaves['active_shockwaves']:
print(f"Severity: {sw['severity']}, Speed Drop: {sw['speed_drop']} km/h")Traffic Prediction
payload = {
"station_ids": ["01F0340N", "01F0360N"],
"prediction_steps": 12 # 60 minutes
}
response = requests.post('http://localhost:8000/api/prediction/traffic', json=payload)
predictions = response.json()AI Assistant Query
payload = {
"query": "Best time to travel from Taipei to Hsinchu?",
"context": {"origin": "Taipei", "destination": "Hsinchu"}
}
response = requests.post('http://localhost:8000/api/rag/chat', json=payload)
print(response.json()['response'])| Shockwave Detection Accuracy | Detection Latency | Prediction Confidence |
@article{zou2024mtstnet,
title={MT-STNet: A Novel Multi Task Spatiotemporal Network for Highway Traffic Flow Prediction},
author={Zou, Guojian and others},
journal={IEEE Transactions on Intelligent Transportation Systems},
year={2024},
doi={10.1109/TITS.2024.3411638}
}
@software{highway_shockwave_system,
title={Highway Intelligent Traffic Shockwave Warning System},
author={Wei, Tim},
year={2024},
url={https://github.com/timwei0801/Highway_trafficwave}
}Note: MT-SWNet is our team's enhanced version based on the original MT-STNet architecture.
This project is licensed under the MIT License - see LICENSE for details.
- MT-STNet Research Team - Original deep learning model architecture
- Taiwan Ministry of Transportation - TDX Open Data Platform
- TensorFlow, FastAPI, Next.js - Open source frameworks
AI-Powered Traffic Safety Based on Cutting-Edge Scientific Research













