Temples and religious places frequently experience heavy crowd congestion, particularly during festivals, special events, and peak visiting hours. Managing such large gatherings manually is often difficult and inefficient, leading to long waiting times, overcrowding, and potential safety risks for devotees. Traditional queue management methods cannot provide real time monitoring or effective crowd control. Therefore, there is a growing need for an intelligent system that can monitor, analyse, and regulate crowd movement within temple premises. This research proposes a Smart Temple Crowd and Queue Management System using Artificial Intelligence (AI) and Internet of Things (IoT) technologies to improve crowd monitoring and ensure better management of temple visitors. The proposed system integrates computer vision techniques and sensor-based monitoring to accurately estimate the number of people inside the temple area. A camera placed within the temple environment captures live video feeds, which are processed using a YOLOv8-based deep learning model for real-time human detection and counting. The model identifies individuals in each video frame and calculates the number of people currently present in the monitored area. This allows the system to determine crowd density dynamically and update the status continuously. In addition to the camera-based monitoring system, IR sensors connected to an ESP32 microcontroller are installed at the temple entrance and exit points. These sensors detect the movement of devotees entering and leaving the temple. The sensor data helps maintain an accurate record of the number of people entering and exiting the premises. By combining the information from both the AI-based vision system and the sensor-based entry– exit monitoring system, the system can estimate the real-time crowd population more reliably. All collected data is transmitted to a Flask-based backend server, where it is processed and stored in a database for further analysis. The backend system categorizes the crowd density into different levels such as Low, Medium, and High based on predefined threshold values. This classification helps temple administrators understand the current crowd situation and make informed decisions regarding visitor management. The system also provides a web-based administrative dashboard where live crowd statistics, alerts, and camera feeds can be monitored in real time.
Introduction
To address this, the proposed Smart Temple Crowd and Queue Management System uses a combination of Artificial Intelligence (AI), Computer Vision, and IoT technologies. The system includes:
AI-based crowd detection using the YOLOv8 model to analyse live camera feeds and count people.
IoT-based monitoring using IR sensors and an ESP32 microcontroller to track entry and exit movements.
A Flask-based backend server and MySQL database to process and store real-time data.
A web-based admin dashboard for monitoring crowd levels and making decisions.
A smart token system that assigns time slots to visitors, reducing congestion.
The system architecture consists of multiple layers (data collection, processing, backend, and user interface) that work together to provide accurate crowd estimation and efficient control. The methodology involves collecting data from cameras and sensors, processing it using AI models, and regulating visitor flow through token-based scheduling.
Conclusion
Managing large crowds in temples is a challenging task, especially during festivals, weekends, and special religious events. Traditional crowd management methods mainly rely on manual supervision and conventional queue systems, which often result in overcrowding, long waiting times, and inefficient visitor flow. These limitations highlight the need for an intelligent and automated system capable of monitoring and controlling crowd density effectively. This research presented a Smart Temple Crowd and Queue Management System that integrates Artificial Intelligence, Computer Vision, and Internet of Things (IoT) technologies to improve temple crowd monitoring and queue management. The proposed system utilizes a YOLOv8-based computer vision model to detect and count people from live camera feeds, enabling real-time estimation of crowd density within temple premises. In addition, IR sensors connected to an ESP32 microcontroller monitor entry and exit movements at temple gates, allowing the system to maintain an accurate count of visitors entering and leaving the temple. The collected data from the AI detection module and sensor system is processed through a Flask-based backend server and stored in a MySQL database. Based on predefined thresholds, the system categorizes the crowd density into levels such as Low, Medium, and High, which helps administrators quickly understand the current crowd situation. A web-based administrative dashboard provides realtime visualization of crowd statistics, entry–exit counts, and live camera feeds, enabling temple authorities to monitor and manage the crowd effectively. Furthermore, the system incorporates a smart token-based queue management mechanism that regulates the flow of devotees entering the temple. When the crowd level becomes high, the system restricts immediate token generation and instead allows booking for future time slots. This approach helps distribute visitors more evenly throughout the day and prevents excessive crowd accumulation during peak hours.
Overall, the proposed system demonstrates how modern technologies can be effectively applied to improve temple crowd management. By combining AI based detection, IoT-based monitoring, and intelligent queue regulation, the system enhances safety, reduces waiting time, and provides a more organized experience for devotees. The research highlights the potential of smart systems in managing large gatherings and contributes toward the development of efficient crowd management solutions for religious places.
References
[1] YOLOv8. YOLOv8 Documentation. Ultrathick. Available: https://docs.ultralytics.com
[2] OpenCV. Open-Source Computer Vision Library. Available: https://opencv.org
[3] Flask. Flask Web Development Documentation. Available: https://flask.palletsprojects.com
[4] MySQL. MySQL 8.0 Reference Manual. Oracle Corporation. Available: https://dev.mysql.com/doc
[5] ESP32. ESP32 Technical Reference Manual. Expressive Systems. Available: https://www.espressif.com
[6] S. Zhang, R. Benenson, and B. Schiele, “City Persons: A Diverse Dataset for Pedestrian Detection,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
[7] N. Dalal and B. Triggs, “Histograms of Oriented Gradients for Human Detection,” in Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 2005.
[8] A. Krizhevsky, I. Stever, and G. Hinton, “ImageNet Classification with Deep Convolutional Neural Networks,” in Advances in Neural Information Processing Systems, 2012.
[9] M. Rouse and D. Wigmore, “Internet of Things (IoT): Definition and Applications,” TechTarget Research, 2021.
[10] J. Redmon et al., “You Only Look Once: Unified, Real-Time Object Detection,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.