A C++17 project that explores AI-based traffic management, written from scratch without an external machine learning framework. It covers object detection, object tracking, accident and weather classification, and reinforcement learning for signal control, plus a traffic simulation you can run to watch the pieces work together.
This is a research and learning project. The networks, training loops, and math are all hand-written, so treat it as experimental rather than a finished product.
- TACSNet: a small YOLO-style detector for vehicles, pedestrians, and cyclists
- MemoryTracker: multi-object tracking with an Extended Kalman Filter and Hungarian assignment
- AccidentNet: a convolutional plus GRU classifier over short frame windows
- WeatherNet: a compact image classifier for weather conditions
- RLPolicyNet: an advantage actor-critic (A2C) policy for signal phase control
- Plugin learning: a feature extractor plus shallow classifier for adding new object classes
- Simulation: an SDL2 traffic simulation frontend (optional, built when SDL2 is found)
- Supporting code for layers, training, federated aggregation, drones, and utilities
Source lives under src/ and include/, grouped by area (layers, tracking, rl, training, plugin, simulation, federated, drone, utils).
- A C++17 compiler (GCC 8+, Clang 10+, or MSVC 2019+)
- CMake 3.16+
- OpenMP (optional, used when available)
- OpenCV (optional)
- SDL2 (optional, needed for the simulation frontend)
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -jThe build produces several executables in build/:
phase1_validationthroughphase10_validation: validation programs for each part of the systemphase10_console_demo: a console demo of the full pipelinetacs_simulation: the SDL2 simulation (only built when SDL2 is available)tacs_edge_runtime: the edge runtime entry pointtrain_tacsnetandtrain_tacsnet_dataset: detector training programscreate_pretrained_weights: generates starter weight files
For example:
./build/phase10_console_demo
./build/tacs_simulationA default configuration file is in config/.
train.py and train_tacsnet.cpp drive detector training. Weights can be generated with create_pretrained_weights. Training is CPU-based by default.
Released under CC BY-NC-SA 4.0 (see LICENSE). Noncommercial use with attribution and share-alike.