Skip to content

Master’s thesis project on AI-based crowd evacuation modeling using the SWIM algorithm, integrating simulation data and neural network surrogates.

License

Notifications You must be signed in to change notification settings

Cagataygultekin/Predicting-Macroscopic-Crowd-Properties-Using-the-SWIM-Algorithm

Repository files navigation

Predicting Macroscopic Crowd Properties Using the SWIM Algorithm

This repository contains the implementation and experiments from my Master’s thesis at the Technical University of Munich, focusing on predicting macroscopic evacuation properties using the SWIM algorithm.
The project integrates crowd:it simulation data with neural network surrogates to predict evacuation times efficiently without running full simulations.


Overview

The work is organized into three main parts:

  1. Scenario 1 - Predicting evacuation time from synthetic 3-room configurations (N1, N2, N3).
  2. Scenario 2 - Predicting evacuation time from architectural parameters (E: floors, T: stair width, P: people per floor).
  3. Sampling Experiments - Comparing Quasi Monte Carlo (QMC), Randomized QMC (RQMC), Sparse Grids, Informative/Entropy, and K-Means sampling strategies for minimal yet accurate training sets.

All models are trained using the SWIM network, which constructs neural network weights based on pairwise sample relationships instead of random initialization.


Repository Overview

Category Main Files / Purpose
Scenario 1 – Data & Model data_preparation/simulation_automation.py (run crowd:it batch simulations) · model_training/swim_reg_simulation.ipynb (SWIM regression)
Scenario 2 – Data & Models sc2_data_preparation/sc2_data_preparation.py (aggregate *-stat.csv) · sc2_model_training/ (SWIM + Vanilla NN experiments, plots)
Scenario 2 – Sampling sc2_sampling/ (QMC, RQMC, KMeans, Entropy, Uncertainty, Sparse Grid experiments + visualizations)
Configs & Docs minimal_requirements.txt · README.md · USAGE.md

Python Environment

Use Python ≥ 3.9 (tested with 3.10–3.11)

pip install -r minimal_requirements.txt


Install Dependencies

Make sure datafold >= 2.0.0 is available.

Install SWIM libraries directly from source (not PyPI): SWIMNetworks (core algorithm) pip install git+https://gitlab.com/felix.dietrich/swimnetworks.git

SWIMRNN (optional, for recurrent extensions) pip install git+https://gitlab.com/felix.dietrich/swimrnn.git

(Optional) Jupyter pip install jupyterlab


Notes & Limitations

Several scripts/notebooks use absolute Windows paths (e.g., C:\Users\cagat...). → Please edit the path variables at the top of each script/notebook to match your machine.

crowd:it and SWIM libraries are not actually included; please install them separately as noted above.

Scaling of X and y is applied in most experiments to stabilize model performance.


Citation

Gültekin, Çağatay (2025).
Predicting Macroscopic Crowd Properties Using the SWIM Algorithm.
Master’s Thesis, Technical University of Munich (TUM).


License

Code in this repository is provided under the MIT License.

Third-party tools (e.g., crowd:it, swimnetworks, swimrnn) are subject to their own licenses and are not distributed here.

About

Master’s thesis project on AI-based crowd evacuation modeling using the SWIM algorithm, integrating simulation data and neural network surrogates.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published