Leveraging Machine Learning for Optimal Pilgrim Crowd Management
The Hajj pilgrimage involves high crowd density within limited time and space, making traditional crowd control methods insufficient for real-time alerts or predictive safety measures. This research proposes a machine learning-based system to enhance crowd management by detecting abnormal behavior and forecasting future conditions. The study utilizes the Hajjv2 dataset, which consists of annotated video frames capturing various crowd behaviors across multiple Hajj locations. After data preprocessing and feature extraction, including crowd density, speed, direction, and object area, two models are employed: the Isolation Forest algorithm for anomaly detection and a Long Short-Term Memory (LSTM) neural network for forecasting crowd behavior. The system integrates the results of both models to issue real-time alerts based on predefined thresholds. Evaluation results indicate that the Isolation Forest model achieved an average accuracy of 91% across all test sets, effectively identifying abnormal movement patterns. The LSTM model produced reliable predictions of average crowd speed with a low Mean Squared Error (MSE) of 0.000439. Together, these models form a robust alert mechanism that enables early identification of risks. In summary, this study presents an intelligent, scalable solution for enhancing crowd safety during the Hajj. It illustrates the practical value of machine learning in enabling proactive and informed crowd management strategies.
Authors
- Nahlah Algethami
- RAMI ALZAHRANI (ORCID: https://orcid.org/0009-0008-5098-4083)
Institutions
- Saudi Electronic University (SA)
Publication Details
- Journal
- Electronics
- Published
- 2025-06-20
- DOI
- https://doi.org/10.3390/electronics14132507
- Citations
- 3
- Primary Topic
- Traffic Prediction and Management Techniques
- Type
- article
- Field-Weighted Citation Impact
- 3.02