Skip to Content
ElectronicsElectronics
  • Article
  • Open Access

30 November 2026

34 Pages

CrowdH-Edit: Reference-Guided Instruction-Based Synthetic Hajj Crowd Image Generation for Crowd Counting

,
and
1
Information Systems Department, Faculty of Computing and Information Technology, King Abdulaziz University, Jeddah, Saudi Arabia
2
Department of Information Systems, College of Computer and Information Sciences, Jouf University, Sakaka, Saudi Arabia
3
Computer Science Department, Faculty of Computing and Information Technology, King Abdulaziz University, Jeddah, Saudi Arabia
*
Author to whom correspondence should be addressed.

Abstract

The scarcity of domain-specific annotated images remains a major limitation for developing computer-vision systems for Hajj crowd analysis. Existing crowd-counting datasets and unconstrained generative models do not capture Hajj-specific visual conditions, including sacred-site geometry, white-clothed pilgrim crowds, and indoor/outdoor illumination variation. This study presents CrowdH-Edit, a reference-guided, instruction-based framework for synthetic Hajj crowd-image generation. Real Hajj images provide structural references, while textual instructions guide changes in crowd conditions and illumination and help preserve the main scene layout. Stable Diffusion 2.1 and Stable Diffusion XL 1.0 with low-rank adaptation were evaluated as comparative baselines. Qwen Image Edit was used without additional training within a ComfyUI workflow and selected for final dataset construction. The workflow produced CrowdH-Edit, a cleaned pool of 6122 synthetic images, from which 387 images were selected and annotated to construct CrowdH-Edit-Ann-387. Among the evaluated generation pipelines, Qwen Image Edit achieved the highest semantic-alignment score and the lowest distributional and perceptual distances. Downstream evaluation across five crowd-counting models showed mixed results. Adding CrowdH-Edit-Ann-387 reduced both MAE and RMSE for MCNN and APGCC, reduced MAE but increased RMSE for CSRNet and P2PNet, and increased both errors for DM-Count. These findings indicate that reference-guided synthetic Hajj imagery can support crowd-counting training, although its benefits depend on the model and evaluation metric.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.