1 Introduction

An urban area is a densely populated city with visible and invisible infrastructures such as water supply, energy networks and Information and Communication Technology (ICT) [1, 2]. Population in urban areas has spiked as never before, which introduces numerous challenges that span across several domains, such as transportation, health, and environment [1, 2]. Urbanization and the wide spread of ICT transform urban cities into big data pools. There has been a proliferation of research in urban analytics that analyze data to tackle the aforementioned challenges and help to make decisions [1].

One of the integral tasks of city management is planning, monitoring and managing crowds [3]. Crowd management is evolving as a field of interest to a variety of specialists such as computing, health and police force. Mecca confronts crowds regularly. Mecca is located in Saudi Arabia, and is one of the holiest cities in the world due to the existence of the holy mosque, which, Muslims visit for prayers and practice throughout the year (Fig. 1). The Hajj is an annual ritual where Muslims go to Mecca to perform acts of worship in several sacred rituals. Muslims are committed to perform the Hajj at least once in their lives and many of them are keen to repeat the Hajj experience more than once, leading to a recurring mass gathering that is often beyond the estimated crowd [47].

Fig. 1.
figure 1

The geographical location of Mecca, the site for the annual Hajj

Recent statistics provided by the General Authority for Statistics in Kingdom of Saudi Arabia (GASTAT) showed that the number of pilgrims reach 3 million Muslims in 2012 and by 2019, this number is expected to increase to reach 3.75 million [8, 10]. To perform Hajj, all pilgrims need to congregate in several holy places over several days where the movement of pilgrims at the same time makes managing the hajj crowd a very critical operation. Other complicating factors include heterogeneous population, varying velocity of pilgrims, and different motion flows [4, 12]. Thus, avoidance of safety hazards, calls for real-time information about the facilities, density and behavior of the crowd.

In this paper we review a number of urban data collection and analysis studies. Moreover, we illustrate how new trends can be effective to manage crowded areas. Subsequently, we provide a number of suggestions to customize these works based on Hajj characteristics.

This paper is structured as follows: Sect. 2 provides an overview of background research on crowd analytics in the broad scope of events and the scope of cultural and religious events such as Hajj. Section 3 describes the trends and challenges in urban analytics for Hajj. We conclude in Sect. 4 with key insights and future directions for research.

2 Background

Nowadays, the world is witnessing the largest wave of urbanization in world history. In 2050, as per the United Nation’s (UN)’s forecast, around 66 % of the world’s population will be intensified in urban centers, as compared with 54 % in 2014 and 30 % in 1950 [13].

Understanding and managing crowd behavior is a critical mission in several application domains such as religious events, sports and festivals. Kumbh Mela, an Indian event, takes place every 12 years and gathered tens of millions Hindus in the same time-frame [9]. Incidents can occur when crowds of massive scale are not managed properly, such as the New Year celebrations on the Bund, a waterfront promenade in Shanghai, China, overcrowding on a staircase to an observation platform left 36 people dead and 49 more injured. In the city of Duisburg in Germany, a parade music festival, around 1 million festival goers crowded into a venue that could only hold 250,000. As a result, 21 died from suffocation and more than 510 were injured [14].

Crowd management is a practice that is used to control crowd events before, during, and after events, which include dealing with all elements of an event such as people, sites, facilities, data and technology. The key requirements in mass gathering and successful crowd management are ensuring the safety and security of people in the crowd and the facilities, and avoiding stampedes and loss of public life [3].

2.1 Crowd Management in the Hajj

According to the Pew Research Center [15], as in 2010 23 % of world population is Muslims, which is approximately 1,599,700,000 people, live in more than 100 countries. Annually, Mecca draws millions of Muslims to perform the Hajj ritual. In 2015, the number of pilgrims reached 1,952,817 [16] and as mentioned in the introduction, this number is expected to increase in the following years. Therefore, authorities in Saudi Arabia need to address and manage not just the growing numbers of pilgrims’, but also challenges relating to safety, security, and culture differences. The Saudi authorities has provided wide infrastructure to support Hajj but significant problems of crowding still result in catastrophe such as stampedes, fires and spread of diseases [17].

Fig. 2.
figure 2

The Annual pilgrim number [16]

2.2 The Hajj and Social Computing

Many researchers from different fields have contributed to the management of the pilgrimage. Among them are computer scientists, whose contributions comprise computer vision and location-based techniques (Fig. 2).

2.2.1 Computer Vision-Based Technique

As the name indicates, these techniques depend on detecting and counting the individuals [3]. According to Saudi Press Agency (SPA) in the last Hajj season, Saudi Authorities increase the number of surveillance cameras used by television surveillance department, to exceed 7,000 digital cameras from the 4200 cameras that were used in the past two years to monitor pilgrims, throughout Mecca in the Hajj time-frame, focusing on the holy sites [18].

In [19], the Forward-Looking Infrared (FLIR) technique determined the crowd density by using the output of thermal cameras and producing an estimation of the crowd. The FLIR images are affected by the time of capturing the image (day or night), ground temperature and the crowed density. Moreover, in [20], several thermal cameras are deployed as sensors at points of some roads, especially those considered access roads that suffer from congestion. The developed system acquires and processes data via thermal cameras linked to an analysis module. The module measures crowd flow and density in real time and thus determines the priority of roads with respect to widths and lengths. The roads priority is based on the road width, length, and the crowd density on the road. The system then sends its recommendations to authorities.

Extracting some useful parameters from videos (such as speed of the pilgrims) was the main purpose in [8]. To understand very high dense crowd phenomena, cameras focused on a gate of the holy mosque. Using image processing and computer vision, the developed system succeeded in tracking pedestrians, to calibrate simulation models that will disperse crowds.

2.2.2 Location-Based Techniques

Location-based applications leverage the power of smartphones technology such as GPS, AGPS, Wi-Fi, and cameras. The authors of [11] proposed two different location-based approaches to monitor the Hajj and minimize crowd turbulence. The first includes software that would need to be downloaded to all the pilgrims’ mobile phones when they arrive in Mecca. In addition, a Radio Frequency Identification (RFID) tag should be attached to pilgrims’ phones. Each RFID tag offers a unique identifier that is sent via radio wave to the RFID reader. The mobile phone will send its location information to the authority server and to the leader of that pilgrim’s group. However, if the connection dies, the mobile can store the recent location information and send it when the connection is restored. The pilgrims also can request help via this service from the leader of that pilgrim’s group in case of emergency.

The second approach offered by [11] is a system of Wireless Sensor Network (WSN) and pilgrims’ mobiles. The WSN is a network consisting of distributed sensors, nodes that aim to monitor a physical environment. A pilgrim’s mobile transmit his/her location to nearby fixed sensors. Data collected from the sensors is then transmitted to a WSN server ready for authorities to use for crowd detection.

3 Urban Analytics Trends and Challenges

As we race towards fully connected living environments, urban stakeholders and authorities are exacting analytic solutions that provide actionable insights about citizens and their interactions with these environments. Information gathering and data collection play an important role in the crowd management. Following are trends of crowd monitoring and detection of potential hazards from different dimensions such as human, data and resources, their applicability, and challenges.

3.1 Data Collection and Information-Gathering

Different methods play key roles in crowds’, data collection and information gathering. Classical methods, such as surveillance cameras, helicopters, and government entities responsible for the security, compliance with safety regulations and emergency response eco-systems (e.g. Municipalities, Red Crescent, and Ministry of the Interior) face challenges in scalability, the need for human intervention, and robustness [21]. Following is different methods that employ machine intelligence for scalable, robust, and effective crowd management.

3.1.1 Unmanned Aerial Vehicles

Unmanned Aerial Vehicles (UAVs) are increasingly used as tools to different systems, such as transportation, military, and reconnaissance, because of its low manufacturing cost and its ability to go far into remote and hazardous locations [22, 23]. UAVs have different degrees of autonomy, from Remote-Piloted Vehicles (RPVs) to intelligent, autonomous UAVs which control the flight, collect data, and make decisions [23]. UAVs operated by humans might be prone to errors because of human distractibility and is often associated with an increase in the operating cost. However, autonomous UAVs might require multiple hardware and software components and machine intelligence in many fields, such as computer vision, machine learning, and natural processing language [22]. Table 1 compares UAVs to surveillance cameras. Surveillance cameras requires human intervention for periodic maintenance and installation, since they are distributed in different places, while, as we know, UAVs, like any hardware, need periodic maintenance but no installation. Surveillance cameras are fixed and cannot move; UAVs can, and can thus cover more ground. Surveillance cameras are connected to electrical power whereas UAVs lives on battery. Many research studies use wireless power transfer for UAVs. The study in [24] proposes an application to recharge UAV, using Wireless Energy Transfer (WET). Moreover, there have been multiple research studies to automate UAVs such as [20]. It proposes a planning and control framework based on Dynamic-Data-Driven, Adaptive Multi-scale Simulation (DDDAMS). The simulation system is fed by dynamic data to use alternative control policies. It also claims that the higher the number of crowds, the better the result. The authors in [25] propose an agent-based hardware-in-the-loop simulation framework to model the UAV surveillance and crowd control system. It contains sensors to collect dynamic data, in order to track and detect crowds. It finds out that finer grid scale and larger vehicle detection range generate a better crowd coverage percentage.

Table 1. Comparison between surveillance camera and UAVs

3.1.2 Mobile Crowd Sensing and Computing

Mobile Crowd Sensing and Computing (MCSC) is a new sensing paradigm based on collecting real-time data from two participatory sources: sensing and social media. Therefore, it allows ordinary users to contribute with data sensed or generated from their mobile devices, aggregates and processes heterogeneous crowdsourced data in the cloud for intelligent service provision to control and monitor the crowd [21, 26]. MCSC collects data from devices to analyze them and identify spatiotemporal patterns [21, 30, 31].

Smartphones, tablets, and wearable devices are equipped with many sensors such as GPS, microphones and cameras, along with data information trail (such as social media posts) generated by users explicitly and implicitly, to integrate Human and Machine Intelligence (HMI) into sensing and computing process [27].

The advantage of MCSC is that the data collection is usually very short and less expensive than traditional methods such as surveillance cameras, which need humans, expensive utilities and sensors installations. In this model, collecting data manually will consume crowds’ time, which might reduce its effectivity. The study in [6] suggests a centralized platform that has a comprehensive database that holds information related to pilgrims, medical, health care, emergency centers, educational contents about the hajj in different languages, and guidance model. However, in disaster situation, [29] claims that decentralized data from crowdsourcing applications might be more useful for gathering information about the disaster than the centralized platform, even though the data might not be accurate. It suggested an approach that enables collaborations amongst organizations to provide disaster relief using crowdsourcing applications.

Ushahidi [28] is a Web 2.0 site that uses crowdsourcing in crisis management works. It is based on allowing users to report a specific story using various methods such as SMS, email, web-form, and social media and accompanied by GPS location when it is possible. It shows each report on a map. Another example is the Large Emergency Event Digital Information Repository (LEEDIR) [26] launched recently by the US law enforcement agencies which was designed to collect video and images from crowds about an incident. The application receives the image/video and the metadata related to it such as GPS.

4 Conclusion and Future Directions for Research

Recently, interest has grown in urban analytics researches for the Hajj. Furthermore, researchers in [8, 11, 19, 20] have developed methodologies and techniques for controlling crowds in the context of the annual pilgrimage to Mecca. In this paper we reviewed different techniques that have been used in the Hajj. Computer vision-based techniques were used in the Hajj such as CCTV surveillance cameras that transmit the videos and audios. Moreover, many researchers used FLIR techniques to detect crowd density and then take the corresponding action accordingly. In addition to the former, different location-based techniques were proposed, such as attaching RFID tags in pilgrims’ phones which will allow to follow-up the pilgrims.

In recent years, different techniques were developed to help avoid accidents that may result from the sense of urgency causing a rush toward an entry or exit point in the holy sites at the same time. However, there are precise crowd management trends in data and information gathering that are applicable for the Hajj context. Due to the location of Mecca, where it is located in a valley surrounded by mountains, such as Arafat Mountain that pilgrims need to visit to complete their Hajj, recent developments in UAV technologies suggest that they can be considered remote monitoring of mountainous contexts. Although the pictures provided by UAVs might not be stable but the UAVs will be able to move to new places without the need for installation. Moreover, with the raise of wireless networking, and mobile social techniques, MCSC based applications were developed in [6, 28]. MSCS web such as [28] might help pilgrims and authorities to avoid a crisis.