arXiv:2610.34163cs.CVOct 2026

Manuscript Offprint

arXiv:2610.34163

Reinforcement Learning for Adaptive Crowd Flow Control Using Dynamic Barriers

Alhanof Alolyan, He Wang, Amani Alonayzan

Abstract

Crowd barriers are widely used to regulate pedestrian movement during large public events such as pilgrimages. However, fixed barrier layouts often create unnecessary stopping and local congestion even when they successfully control the overall crowd flow. Finding better barrier configurations is difficult because there is no dataset that provides the best barrier placement for a given crowd scene. We address this challenge by introducing a simulation-driven reinforcement learning framework that learns barrier configurations without requiring labelled training data. Starting from a segmented crowd scene, we construct a realistic simulation environment that reproduces the observed pedestrian distribution. This environment is then used to train a Soft Actor-Critic (SAC) agent that continuously adjusts barrier positions to improve pedestrian movement. Unlike supervised approaches, the proposed framework allows the agent to explore barrier configurations that have never been observed in real data. We evaluate the learned policy under unseen numbers of pedestrians. The learned policy consistently outperforms the existing manually designed barrier configuration by reducing pedestrian stops while maintaining effective flow regulation. These results demonstrate that combining computer vision, crowd simulation, and reinforcement learning provides an effective framework for optimizing crowd control infrastructure. The source code is available on GitHub: https://github.com/HanoCat/RLForHajjProject

Keywords: crowd simulation; reinforcement learning; Soft Actor-Critic; barrier optimisation; pedestrian flow; crowd management.

1 Introduction

Crowd barriers are commonly used to regulate pedestrian movement in dense public spaces. However, manually designed layouts can create unnecessary stopping behaviour and local congestion. This is especially problematic when barriers are intended to regulate the overall crowd flow.

while avoiding inefficient movement locally. Existing crowd simulation methods mainly focus on modelling pedestrian behaviour or providing interactive tools for manually designing crowd control layouts rather than learning barrier configurations automatically (Montana Gonzalez and Maddock, 2021; Charalambous et al., 2023). Reinforcement learning has also been applied to crowd simulation and evacuation planning by learning pedestrian behaviours or tuning simulation parameters (Zhao and Geraerts, 2022; Zhang et al., 2024). However, learning how to optimize physical barrier configurations from an observed crowd scene has less attention.

We propose a simulation-driven framework for adaptive crowd barrier control. Starting from a segmented crowd image, we construct a pedestrian simulation that reproduces the observed crowd distribution. This simulation serves as the environment for Soft Actor-Critic (SAC) that learns continuous barrier configurations. The reward encourages smooth pedestrian movement by reducing stopping behaviour and local congestion while preserving the intended flow regulation of the barriers. Unlike supervised learning, our framework does not require labelled examples of optimal barrier placements and allows exploration beyond manually designed layouts. Experiments demonstrate that the learned policy consistently outperforms the existing ground-truth configuration and generalizes to unseen crowd sizes.