## 1 Introduction
It is important to predict passenger flow, which is constantly changing, to forecast abnormal events and avoid the consequences of risky scenarios at an early stage (phenomena of congestion). Because of the dynamic and free-flowing nature of the system, flow clogging, narrow paths, and congestion may lead to crowd accidents such as stampede. It is necessary to monitor the movement flow and behaviour of pedestrians in stations to anticipate the risks of overcrowding in real-time during operations, and to predict areas where congestion may occur to implement safety measures [15]. Therefore, forecasting the flow in stations in normal situations and considering emergency events by relying on timely robust data is urgently required. In recent years, many studies have been conducted to assess passenger infrastructure within railway facilities by monitoring and modelling pedestrian flows (\"crowd dynamics\" models). However, the management of railway stations requires reconsideration in light of new technologies [9; 13; 16]. In this study, we propose a method for limiting overcrowding and improving the management process. Our model uses an adaptive neuro-fuzzy inference system (ANFIS) for the short-term prediction of risk level relating to overcrowding. This type of fuzzy neural network has been proven to be an effective tool in many fields. Moreover, the use of an artificial neural network (ANN) combines the learning ability, robustness, and extensive parallelism with the fuzzy system to reduce uncertainty in the prediction process. Additionally, this study evaluates a case study using passenger flow data--the transfer efficiency and the retention rate of the platform--from a station in China, as in [17]. The former is related to the passenger in waiting and the latter depends on the transfer distance and transfer time. The proposed method is beneficial to the station design and layout, crowd management, emergency planning, route scheduling, and improvement of health and safety in similar environments, which reflect positively on the industry and raise service satisfaction. Specifically, the novelty of this study lies in the following points. First, unlike most models that rely on simulation data, our model uses real data collected from stations for the prediction of overcrowding. The data include important factors, such as peak time and walking velocity which varies for different equipment (e.g., stairs and escalators) and are used to calculate the transfer efficiency. Second, a learning-based method has been introduced for crowd management in stations and particularly on platforms that are a hot spot in terminals. Then, a smart framework has been presented, which can be generalised for many locations and fields for managing overcrowding. Other contributions of this study are as follows:  
* Many models consider the total number of passengers entering a station. However, overcrowding may occur only on one platform. In our study, we consider the number of passengers on a single platform that is determined by the passengers in waiting and the flow from the station to the platform through the escalators or other channels. Additionally, we assume that the delay of one train can affect only one platform. The information fed to the model can be captured from images in the station that include the spatial and temporal dependence of the crowd. * The ANFIS model used in this study can learn and specify a threshold for the risk level depending on location and crowd standards from accurate real-time data. * Estimating the risk level is an important outcome of our prediction, unlike traditional prediction studies that focus only on station-level or route-level forecasting (time series).