Reinforcement Learning for Adaptive Crowd Flow Control Using Dynamic Barriers

Alhanof Alolyan, He Wang, Amani AlonayzanarXiv 2026

TL;DR

This paper introduces a simulation-driven reinforcement learning (RL) framework to optimize crowd barrier configurations without requiring labeled training data. By training a Soft Actor-Critic (SAC) agent within a realistic simulation environment reconstructed from real-world images, the authors achieved a 30% reduction in pedestrian stopping and a 10% increase in throughput compared to traditional manual designs.

What Problem Does This Paper Address?

Crowd barriers are essential for safety and flow regulation at massive public events, such as the Hajj pilgrimage. However, designing these layouts is currently a manual, trial-and-error process. Fixed barrier configurations often solve one problem (regulating overall flow) while creating others, such as local bottlenecks and unnecessary stopping behavior.

The core challenge is a lack of data: there is no "gold standard" dataset that maps specific crowd scenes to their mathematically optimal barrier placements. Consequently, supervised learning—the workhorse of modern AI—cannot be easily applied here. The authors set out to bridge this gap by using reinforcement learning to "discover" better configurations through autonomous exploration in a simulated environment.

Methods

The authors propose a two-stage pipeline that transitions from static computer vision to dynamic reinforcement learning:

  1. Simulation Environment Construction: The framework starts with a real-world image of a crowd. They use CVAT for semantic segmentation to identify walkable regions and obstacles, and P2PNet (a point-based head detection network) to identify initial pedestrian positions. This geometry is then ported into JuPedSim, an open-source pedestrian dynamics simulator.
  2. Reinforcement Learning via SAC: A Soft Actor-Critic (SAC) agent is trained to manage the barriers.
  3. State: Includes the number of pedestrians, current barrier positions, and the positions/velocities of all agents.
  4. Action: The agent can translate ($\Delta x, \Delta y$) and rotate ($\Delta \theta$) pairs of barriers.
  5. Reward: The reward function is designed to penalize two things: the proportion of stopped pedestrians and the deviation from the maximum desired walking speed.
Figure 1: Overview of the approach. (a) CVAT annotations and P2PNet pedestrian detections are used to construct a JuPedSim simulation. (b) A reinforcement learning policy adjusts barriers and receives feedback from the simulated crowd.

Datasets

The study does not rely on a standard public dataset but rather a "simulation-from-observation" approach. They used real-world frames from crowd scenes to extract the environment geometry. For evaluation, they tested the learned policy across a range of crowd densities, from sparse (10 agents) to extremely dense (1,500 agents), to test the policy's ability to generalize beyond its training range (100–700 agents).

Key Insights and Ideas

  • Bootstrapping from Vision: The most clever aspect is using computer vision not just for analysis, but to generate the training ground. This allows the system to be tailored to specific, real-world locations without needing a pre-existing 3D model.
  • The "Middle Ground" Policy: The RL agent effectively found a compromise. While an "All Open" configuration (no barriers) technically yields the highest speed, it fails the primary goal of crowd regulation. The RL policy maintained the regulatory function of the barriers while significantly smoothing out the local flow compared to the human-designed "Ground Truth" (GT).
  • Zero-Shot Generalization: Even though the agent was trained on moderate crowd sizes (100-700), it successfully generalized to 1,500 agents, suggesting that the learned spatial relationships for barrier placement are robust across different densities.
Figure 3: Qualitative comparison of barrier configurations for 10, 300, and 1,500 pedestrians. The policy was trained on crowd sizes from 100 to 700; the 10- and 1,500-pedestrian cases are outside this training range. Colour indicates pedestrian speed.

Key Results

The RL-optimized policy was compared against the original manual layout (GT), an "All Open" baseline, and an "All Closed" baseline.

  • Throughput: Increased by 10.73% (from 4.604 to 5.098 agents/s) over the manual GT design.
  • Pedestrian Speed: The mean normalized speed improved by 6.20%.
  • Congestion Reduction: The "stopped ratio" (the percentage of people stuck at a standstill) dropped by 30.77% (from 0.104 to 0.072).

Limitations and Future Work

While promising, the authors highlight several hurdles before real-world deployment:

  • Pixel-to-Meter Calibration: The current model relies on image pixels; more accurate scene calibration (using known corridor widths or site maps) is needed to ensure the simulation matches real-world physics.
  • Computational Cost: Training RL agents in high-fidelity crowd simulators is slow. The authors suggest investigating faster simulation engines or more sample-efficient RL algorithms.
  • Real-World Validation: The findings are currently limited to the JuPedSim environment. Future work involves testing these configurations in live, observed scenarios to see if the simulated improvements translate to actual human behavior.

Summary updated

BibTeX
@misc{alolyan2026reinforcement,
  author = {Alhanof Alolyan and He Wang and Amani Alonayzan},
  title = {{Reinforcement Learning for Adaptive Crowd Flow Control Using Dynamic Barriers}},
  year = {2026},
  eprint = {2610.34163},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.34163},
}

Loading related content...

Figure