Every year, the Hajj concentrates more than two million people into a few square kilometres over five days. No stadium, transport network or event on earth compresses that many people into that little space and time. Managing it safely is one of the hardest crowd-engineering problems in the world — and it is where I have spent much of my career as an applied AI researcher and Hajj technology innovator in Saudi Arabia.
Crowd management is a data problem
The instinct is to treat crowd safety as a matter of barriers and marshals. At Hajj scale it is really a crowd-intelligence problem: you have to predict where density will build, when a corridor will saturate, and how to reschedule movement before a crush can form rather than after. That means fusing spatial data, real-time sensing and scheduling algorithms into a single operational picture.
My doctoral and applied research has focused on exactly this — spatio-temporal analysis of large crowds, congestion detection, and capacity-constrained scheduling. Several of these methods are protected by granted and published patents, and the underlying framework earned the KAUST Challenge Grand Prize of SAR 1 million for Hajj and Umrah innovation, reported by the press at the time.
Tafweej: scheduling two million pilgrims
The clearest example is Tafweej, the pilgrim-scheduling platform deployed with the Ministry of Hajj and Umrah. Rather than letting movement to the Jamarat and between the holy sites happen organically, Tafweej assigns time-and-route slots so that flow stays within the physical capacity of each corridor. It was the first successful implementation of scheduling for around two million pilgrims and has been recognised among the Kingdom’s best digital-transformation projects — coverage in Arab News, with the Ministry itself stressing the importance of adhering to the schedule.
From computer vision to command-and-control
Scheduling is only half of it. The other half is seeing what is actually happening on the ground. Computer-vision models for congestion detection, spatial analysis of Mina, mobile applications for group leaders, and a command-and-control dashboard for the Ministry together turn raw camera and location feeds into decisions an operations room can act on in seconds. The value of a crowd-intelligence researcher is in closing that loop — sense, predict, reschedule, verify — fast enough to matter.
Why the Hajj is a proving ground for applied AI
Solutions that work at Hajj tend to generalise. A system robust enough for two million people, extreme heat, and zero tolerance for failure is more than robust enough for a stadium, a transit hub or a smart-city district. That is why the Hajj has become a genuine proving ground for applied AI research in Saudi Arabia, and why the same spatio-temporal methods now inform national capability-building and smart-city work.
Frequently asked questions
What is crowd intelligence?
Crowd intelligence is the use of data, sensing and algorithms to understand and manage large crowds — predicting density, detecting congestion and scheduling movement to keep flow within safe capacity.
What is Tafweej?
Tafweej is a pilgrim-scheduling platform used during Hajj that assigns time-and-route slots to pilgrims so movement stays within the physical capacity of each corridor. It was the first large-scale scheduling of around two million pilgrims.
How is AI used in Hajj crowd management?
AI is used to detect congestion from camera and sensor feeds, predict where density will build, and reschedule pilgrim movement in advance — combining computer vision, spatial analysis and capacity-constrained scheduling in a single operational system.
Dr Faizan Ur Rehman is an applied AI and crowd-intelligence researcher whose Hajj-technology work includes Tafweej and the KAUST Challenge Grand Prize. See the full Hajj Profile, the press coverage, or the patents.