All posts

Crowd-density safety AI for Middle East operations teams (Fruin LOS, Hajj, mosque venues)

Context: why I am writing this now

Every Hajj season I get into the same conversations with operations teams in the Kingdom and their technology partners — the General Presidency for the Affairs of the Two Holy Mosques, Hajj authorities, large mall operators, stadium teams — around the same question: “How do we measure crowd density precisely enough to prevent a disaster?”

The question carries an assumption. Many teams imagine the problem is “a better camera” or “a newer computer-vision model.” The real problem is: a lack of training data annotated for Arabic operational context. Off-the-shelf open-source crowd-counting models are trained on public benchmark datasets that do not include the operational scenes that matter here — a person wearing ihram, a crowd moving in a circumambulation pattern, a density threshold in a Saudi mall corridor.

A note: I am not a certified crowd-safety expert. My background is AI data. This piece is written from the data-team angle: what needs to be annotated. For actual operational crowd planning, refer to licensed crowd-safety engineers and to the academic literature referenced later in this article.

Fruin LOS crowd density levels: operational walk-through

Fruin’s LOS is a six-level academic scale (A through F).1 For operations-team work, Keith Still3 and UK HSE practice commonly collapse the upper half into a four-band danger grid. The numbers below are the operational four-band view; see Fruin 1971 for the original six-level scale.1 Numbers are people per square meter.

Operational bandDensityOperational stateControllability
A< 2 ppl/m²Comfortable, normal flowFull control, natural movement
B2 - 4 ppl/m²Crowded but acceptable, partial slowdownPartial control, light intervention possible
C4 - 6 ppl/m²Dangerous packing, motion near-stoppedUrgent intervention required
D> 6 ppl/m²Critical, risk of crowd collapse, asphyxia, domino fallsIntervention often too late — disaster

Points that the public conversation underplays:

One: the B-to-C transition is fast and non-linear. Helbing and colleagues showed in “Crowd disasters as systemic failures: analysis of the Love Parade disaster” (Helbing & Mukerji 2012)4 and earlier in “The Dynamics of Crowd Disasters: An Empirical Study” (Helbing et al. 2007)2 that the move from crowded movement to “crowd turbulence” can happen on sub-minute timescales — see the timeline reconstructions in Helbing & Mukerji 2012.4

Two: density alone is not enough. The real risk feature is density × variance (how much movement direction fluctuates). A static crowd at 5 ppl/m² is less dangerous than one at the same density where some people push north and others push south. This shapes what must be annotated.

Three: local density diverges from average density. The model needs to operate at the cell level, not just at the camera level — averages hide hotspots.

The historical record: what disasters teach us

Reading the academic literature and the official reports on major Middle East crowd incidents is mandatory for anyone building technology in this space:

All of these incidents confirm the same pattern: a non-linear shift from safe movement to collapse within seconds. A usefully safety-oriented computer-vision model must detect the transition, not the state after it.

Distinguishing pre-incident data from incident-time data

This is the most important operational detail when building a training set:

The problem: pre-incident data is acutely scarce, especially in Arabic context. Serious teams therefore build their datasets this way:

  1. Collect historical footage of high-risk areas (Grand Mosque entry points, Jamaraat Bridge pre- and post-expansion, Mina intersections, stadium gates)
  2. Annotate every frame with the actual Fruin LOS level + per-cell density + dominant motion direction per cell
  3. Compile published historical incident footage (Jamaraat 2006, Mina 2015, Love Parade, Hillsborough — available in the academic literature)
  4. Annotate the temporal sequence with the transition event (the B → C moment, the C → D moment)
  5. Build a model that recognizes pre-transition signals

Video annotation modality, bounding box templates, and keypoint templates all feed into this.

What needs annotation in a crowd-safety video

From practical experience, the annotation layers that feed a production density and crowd-motion model:

Annotation layerDescriptionOutputTool
Head dotsEach person marked with a dot on their headCount + densitykeypoint
Bounding boxes for individualsEach separable person in a boxDetection + trackingbounding box
Density maps2D distribution of density over a frameDensity model trainingdensity heatmap
Cell-level segmentationFrame divided into cells with density per cellHotspot detectiongrid annotation
Motion vectorsDominant motion direction per cellCrowd turbulence detectionoptical flow + manual review
Clothing + context labelsIhram / regular clothing / stadium kit / mall wearScenario understanding + personalizationclassification
Physical critical pointsPillar, staircase, gate, choke pointStructural alignmentsemantic segmentation
Event labelsMoment of fall, point of collapse, motion stopGround truth for event-detection modeltemporal annotation
Per-frame Fruin LOS labelA / B / C / DGround truth for the modelclassification

The devil is in the detail:

Why Western models fail in the Grand Mosque and the Prophet’s Mosque

Off-the-shelf open-source crowd-counting models are trained on public benchmark datasets dominated by stadiums, streets, and protests. A model trained on them fails on:

The fix is not “a better model” — the fix is to build local training data with Grand Mosque, Prophet’s Mosque, and large Saudi venue context. That requires Arabic annotation teams, partnership with the General Presidency and the Presidency of Affairs for the Two Holy Mosques, and an academic partner. Read Hajj and crowd safety solutions for government for the operational model we recommend.

How to build a crowd density ground-truth dataset

Operational guidance from experience:

  1. Collect data from four pilot sites before scaling — for example: the Grand Mosque plaza during prayer, Jamaraat Bridge on a stoning day, a Saudi mall entrance on peak day, a stadium entrance
  2. Capture in different conditions — night/day, summer/winter, weekday/holiday, near-miss/normal day
  3. Use multiple synchronized cameras — overhead camera, frontal camera, oblique camera. The final model must work from any angle.
  4. Layer three annotation passes — head dots + individual bounding boxes for separable persons + a full density map per frame
  5. Inspect productivity with a golden set — clips annotated by a certified crowd-safety expert, against which every annotator is checked monthly
  6. Maintain a full audit trail — government agencies, Saudi authorities, and academic partners may later request a record of who annotated what, when, and under what guidance
  7. Build held-out test partitions — clips the model never sees during training, used for independent evaluation

The glossary covers definitions of every technical term mentioned in this list.

Responsibility and privacy

A point that cannot be skipped:

What Annota8 does — and does not do

We do:

We do not:

What this means for the buyer

Discuss crowd-safety data for your program → 30-minute call Read Hajj and crowd safety solutions

References

Footnotes

  1. Fruin J.J. “Designing for Pedestrians: A Level-of-Service Concept,” Highway Research Record 355 (1971), Transportation Research Board. Also published as the book “Pedestrian Planning and Design” (1971). https://onlinepubs.trb.org/Onlinepubs/hrr/1971/355/355-001.pdf 2 3

  2. Helbing D., Johansson A., Al-Abideen H.Z. “Dynamics of crowd disasters: An empirical study,” Physical Review E 75:046109 (2007). DOI: 10.1103/PhysRevE.75.046109. https://arxiv.org/abs/physics/0701203 2 3 4

  3. Keith Still — formerly Professor of Crowd Science at Manchester Metropolitan University (2014–2020); developed and led the MSc in Crowd Safety and Risk Analysis. https://www.gkstill.com/CV/References.html 2

  4. Helbing D., Mukerji P. “Crowd disasters as systemic failures: analysis of the Love Parade disaster,” EPJ Data Science 1:7 (2012). https://epjdatascience.springeropen.com/articles/10.1140/epjds7 2 3

  5. “2006 Hajj stampede” — 12 January 2006 incident at Jamaraat Bridge during the stoning ritual. https://en.wikipedia.org/wiki/2006_Hajj_stampede

  6. “Jamaraat Bridge” — New Jamaraat Bridge expansion completed in stages through 2010 (ground and first levels operational by 2007 Hajj, full five-level completion by 2010). https://en.wikipedia.org/wiki/Jamaraat_Bridge

  7. “2015 Mina stampede” — 24 September 2015 incident at the intersection of streets 204 and 223 leading to Jamaraat Bridge. https://en.wikipedia.org/wiki/2015_Mina_stampede

  8. Daily Sabah, “At least 769 dead, 934 injured in stampede at Mina during Hajj pilgrimage in Saudi Arabia,” 24 September 2015. The 769 figure is the official Saudi government figure; independent tallies by AP (2,411), AFP (2,236), and others are substantially higher. https://www.dailysabah.com/mideast/2015/09/24/at-least-769-dead-934-injured-in-stampede-at-mina-during-hajj-pilgrimage-in-saudi-arabia

  9. Love Parade disaster, Duisburg, 24 July 2010 — 21 deaths and 500+ injured. See Helbing & Mukerji 2012 abstract.

  10. Stadium disasters cited: Hillsborough (1989), Port Said (2012), Kanjuruhan (2022) — see “Kanjuruhan Stadium disaster” and related entries. https://en.wikipedia.org/wiki/Kanjuruhan_Stadium_disaster

  11. Saudi Personal Data Protection Law (PDPL) entered into force 14 September 2023; one-year transition period ended 14 September 2024. Biometric data is classified as “sensitive personal data” under PDPL. Morgan Lewis, “Saudi Arabia Personal Data Protection Law Transition Period Ends September 14, 2024.” https://www.morganlewis.com/pubs/2024/09/saudi-arabia-personal-data-protection-law-transition-period-ends-september-14