Introduction

With the increase in lane numbers and widths, pedestrian second crossing has gradually become an integral part of urban traffic systems at large signalized intersections. This traffic method divides pedestrian crossings into two stages, where pedestrians wait on a safety island after crossing one traffic direction until they receive signals to proceed further. In such scenarios, pedestrians exhibit unique behavioral characteristics during the two-stage crossing due to distinct signal timings and pedestrian facilities. However, in such complex environments, pedestrians need to process a large amount of information simultaneously, especially challenging under crowded interaction conditions. Therefore, a thorough understanding of pedestrian interaction behaviors and walking strategies is crucial in this context. This helps identify which information is useful for the design of pedestrian facilities and the patterns of pedestrian signals.

Since Jennie first proposed the concept of safety islands in 1903, ‘safety islands’ have gradually been promoted and applied1. Tarawneh2 collected data from nearly 3,500 pedestrian street-crossing maneuvers and conducted statistical analysis to identify factors that significantly affect pedestrian speed. King et al.3 quantitatively analyzed pedestrian speeds, flows, and travel times in New Jersey, using methods such as pedestrian tracking and video photography for qualitative analysis of pedestrian behavior. The study found that properly designed pedestrian facilities can effectively improve traffic conditions: reducing vehicle speeds by 2 km/h and reducing pedestrian risks by 28%. Wang et al.4 studied pedestrian crossing behaviors using detailed design concepts. Song et al.5 re-adjusted signal sequences to develop a new pedestrian second crossing pattern.

Currently, many scholars have integrated mechanical theories into pedestrian behavior research. They assume a certain average arrival rate of pedestrians based on pedestrian signal light restrictions and further use fluid dynamics theory to study pedestrian crossing times theoretically6. Additionally, gas dynamics models7 and social force models8 have been created to describe macro and micro behaviors of pedestrians, respectively. In social force models9, pedestrian movements are influenced by 'social forces' that measure intrinsic motivations for individuals to perform certain actions (movements), not directly exerted by the individual's personal environment.

Compared to micro pedestrian models, macro pedestrian models offer significant advantages in large-scale simulation, real-time state estimation, and crowd management. For example, Hoogendoorn et al.10 and Jiang et al.11 view crowds as continuous media, describing their characteristics through parameters such as flow, density, and speed, using the conservation laws of fluid dynamics to describe pedestrian movements. These models not only reduce computation time but also accurately predict crowd dynamics in large-scale simulations. Recent studies have shown that such macro pedestrian models can replicate various self-organizing phenomena observed in real crowds10. Furthermore, phenomena that cannot be modeled by simple summarization of individual influences (as in micro models) can be captured and described in this modeling paradigm. Compared to mathematical models, fluid dynamics models have significant advantages in explaining interactions between human psychological intentions and physical movement characteristics12, demonstrating traffic instability in pedestrian flows13, and simulating pedestrian movements in complex scenarios14.

Artificial Neural Networks (ANNs) have become an inevitable research topic in fields such as pattern recognition15, image processing16, classification17, segmentation18, and engineering sciences. However, traditional ANNs often lack physical constraints, cannot guarantee that their output complies with physical laws, and require a large amount of labeled data for training to achieve good performance. This can lead to inaccurate or unreliable results in applications involving physical phenomena. Physics-Informed Neural Networks (PINNs), by embedding physical laws (such as partial differential equations) directly into the network, can enforce physical constraints during the training process, addressing the problem of insufficient data by utilizing physical laws. In recent years, PINNs have gained increasing attention in various scientific and engineering fields, with new PINN architectures such as conservative19 and non-local20 being proposed to enhance their robustness and efficiency. So far, PINNs have successfully been applied to solve problems in fluid mechanics21, solid mechanics22, and materials science23. When functions are represented by partial differential equations, repeated solving of partial differential equations is required for reliable assessment. This leads to computational difficulties and inefficiencies. PINN is an effective black-box solution tool that avoids direct computation of different types of partial differential equations, ensuring effectiveness and efficiency. Therefore, the application of PINN in solving reliability assessment problems can expand the application scope and improve the performance of reliability calculation methods, especially for implicit partial differential equations. If PINNs are used, reliability assessment problems and partial differential equations can be integrated into a single training process, achieving high efficiency and accuracy.

In summary, this paper addresses pedestrian second crossing behavior using a fluid dynamics model, developing a pedestrian fluid dynamics model based on the Navier–Stokes (N-S) equations to describe pedestrian group flow behavior during second crossings, and analyzing it using Physics-Informed Neural Networks to determine pedestrian fluid characteristics at signalized intersections during two-stage crossings.

Methods

Fluid dynamics equations and principles

Navïer-Stokes equations

The primary attributes analyzed in fluid flow are velocity, pressure, density, and viscosity. The Navier–Stokes (N-S) equations can be used to describe the relationships between these properties. In fluid flow, the equations can inform us about which forces dominate the flow field by examining the changes in properties during dynamic interactions. For compressible Newtonian fluids, Eq. (1) can be expressed as:

$$\rho \left( {\frac{\partial V}{{\partial t}} + V \cdot \nabla V} \right) = - \nabla p + \nabla \left( {\mu \left( {\nabla V + \left( {\nabla V} \right)^{T} } \right) - \frac{2}{3}\mu \left( {\nabla \cdot V} \right)I} \right) + {\text{F}}$$
(1)

Here, \(V\) represents the fluid velocity, \(p\) represents the fluid pressure, \(\rho\) represents the fluid density, \(I\) represents the identity tensor (or identity matrix), and \(\mu\) represents the fluid dynamic viscosity. Each term in the equation corresponds to different forces: inertial force \(\left( {\rho \left( {\frac{\partial V}{{\partial t}} + V \cdot \nabla V} \right)} \right)\), pressure force (\(- \nabla p\)), viscous force \(\left( {\nabla \left( {\mu \left( {\nabla V + \left( {\nabla V} \right)^{T} } \right) - \frac{2}{3}\mu \left( {\nabla \cdot V} \right)I} \right)} \right)\), and external force acting on the fluid (\(F\)). For incompressible fluids, where the velocity divergence is zero, the term can be removed. Therefore, the Navier–Stokes (N-S) equation for incompressible Newtonian fluids is defined as Eq. (2):

$$\left( {\frac{\partial V}{{\partial t}} + V \cdot \nabla V} \right) = - \nabla p + \mu \nabla^{2} V + F$$
(2)

The Navier–Stokes equations must be solved simultaneously with the continuity equation (Eq. 3):

$$\frac{\partial \rho }{{\partial t}} + \nabla \cdot \left( {\rho V} \right) = 0$$
(3)

The Navier–Stokes equations represent the conservation of momentum, while the continuity equation represents the conservation of mass.

Reynolds number

In the field of fluid dynamics, the Reynolds number is commonly used to classify different flow regimes. The Reynolds number is defined as the ratio of inertial forces to viscous forces within a fluid and is used to describe the transport characteristics of particles moving in the fluid. It helps determine whether the fluid flow is laminar or turbulent. Low Reynolds number flows are laminar, while high Reynolds number flows are turbulent. The \(Re\) (Reynolds number) is defined as in Eq. (4):

$$Re = \frac{\rho Vd}{\mu } = \frac{Vd}{v}$$
(4)

Here, \(\rho\) is the fluid density; \(V\) is the flow velocity; \(d\) is a characteristic linear dimension; \(\mu\) is the fluid dynamic viscosity; and \(v\) is the fluid kinematic viscosity.

Bernoulli’s equation with friction losses

The original Bernoulli equation with friction losses states that the total energy upstream is always equal to the total energy downstream plus the energy loss between two points in the fluid flow. The total energy at a location primarily includes kinetic energy, pressure energy, and elevation energy. The Bernoulli equation with friction losses can be written in the form of Eq. (5):

$$\frac{1}{2}u_{1}^{2} + \frac{{p_{1} }}{{\rho_{1} }} + gz_{1} = \frac{1}{2}u_{2}^{2} + \frac{{p_{2} }}{{\rho_{2} }} + gz_{2} + \varepsilon_{1 - 2}$$
(5)

Here, \(gz\) represents the elevation, and \(\varepsilon_{1 - 2}\) is the friction loss between position 1 and position 2. In pipe flow, the Darcy-Weisbach equation (Eq. 6) can be used to calculate friction losses:

$$\varepsilon_{1} = fL\frac{1}{2}\overline{u}^{2} \frac{\rho }{D}$$
(6)

Here, \(f\) is the Darcy friction factor, \(L\) is the length of the pipe between the two positions, \(\overline{u}\) is the average flow velocity, and \(D\) is the pipe diameter. The Darcy friction factor is a coefficient required to estimate frictional pressure drops. The friction factor is a function of the Reynolds number of the flow and the characteristics of the pipe. There are several methods to determine it, such as the Moody chart and the Colebrook equation. In the case of laminar flow, the friction factor can be obtained using Eq. (7):

$$f = \frac{64}{{Re}}$$
(7)

Pedestrian second crossing model based on fluid dynamics

Large intersections with multiple lanes often include pedestrian safety islands to ensure the safety of pedestrians crossing the street. Pedestrians cross the intersection in two stages, and the pedestrian traffic signals for opposing directions are generally designed not to be paired. As shown in Fig. 1, this is an example of a pedestrian second crossing design with unpaired traffic signals.

Fig. 1
figure 1

Pedestrian second crossing design.

During this process, we constructed a pedestrian second crossing model based on fluid dynamics, treating pedestrians as particles in a fluid (described using quantities such as flow rate, density, and velocity) and using the conservation laws of fluid dynamics to characterize pedestrian movement. We consider the movement of pedestrians as that of particles in a fluid, where at any point in the fluid, the mass conservation equation must be satisfied. This second crossing process is divided into two stages:

In the first stage, the pedestrian on Side A remains stationary, while the pedestrian on Side C crosses from C to B (see Fig. 2) and pauses at the safety island, waiting for the signal to change. In this phase, pedestrian flow is in a uniform fluid state, and the changes in speed, acceleration, and density can be neglected.

Fig. 2
figure 2

Pedestrian movement between Side B and Side C.

In the second stage, the pedestrian continues crossing from the central safety island (Section B) to the opposite side of the road (from B to A). Meanwhile, the pedestrian on Side A begins moving toward Side B. At this point, pedestrians from both sides interact between Points A and B. This stage can be further divided into periods before and after their interaction (see Fig. 3). Figure 3a represents the state before the interaction of pedestrians from both sides, while Fig. 3b represents the state when pedestrians from side B and side A interact.

Fig. 3
figure 3

Pedestrian interaction between Side A and Side B.

In the second phase, the interaction between pedestrians from both sides is the main focus of this study. Considering the large number of pedestrians continuously crossing the pedestrian crossing, the mass conservation equation (Eq. 8) must be satisfied at any point in the pedestrian flow. Reference11 utilized a Lagrangian coordinate system to solve a continuous crowd flow model.

$$\frac{D\rho }{{Dt}} = - \rho \left( {\frac{\partial u}{{\partial x}} + \frac{\partial v}{{\partial y}}} \right)$$
(8)

Here, \(\rho\) and \(t\) respectively represent pedestrian density and time, while \(x\) and \(y\) represent the positional components of pedestrians in two-dimensional space. \(u\) and \(v\) denote the velocity components of pedestrians in two-dimensional space.

Generally, pedestrian density \(\rho\) is determined by counting the total number of other pedestrians within the study area around a specific pedestrian (see Fig. 4a). However, our observations indicate that pedestrians generally pay less attention to those directly behind them. Additionally, the maximum horizontal field of view for humans is about 188°, rendering pressure from pedestrians directly behind as negligible. Therefore, in this study, we calculate pedestrian density \(\rho\) by assessing pedestrian influence within a 180° area directly in front of each pedestrian, as shown in Fig. 4b. We define the semicircular area with a 4-m diameter in front of a pedestrian as the region influenced by other pedestrians, denoted \(S_{j}\) (see Fig. 4c). The pedestrian is modeled as a circular particle with a 0.5-m diameter, with an influence range defined as a 2-m diameter circle centered on the pedestrian, denoted \(P_{i}\). We further define \(S_{ij}\) as the intersection of \(S_{j}\) and \(P_{i}\), representing the cumulative influence of other pedestrians on the studied pedestrian, with this influence being additive within the affected area.

Fig. 4
figure 4

Pedestrian density diagram.

The formula for pedestrian density is expressed as Eq. (9), with units of Ped/m2 (pedestrian influence per square meter)

$$\rho = \mathop \sum \limits_{i = 1}^{n} \frac{{S_{ij} }}{{S_{j} }}$$
(9)

In physics, static pressure is defined as the force exerted per unit area on fluid particles from all directions. In this pedestrian model, we apply this concept by defining pressure as the psychological discomfort caused by other pedestrians approaching. The proximity of surrounding pedestrians causes changes in pedestrian density, and pressure P is positively correlated with pedestrian density. Therefore, we define pressure P as a function of density (i.e., \(P = P\left( \rho \right)\)), with \(dP/d\rho\) > 0 for all \(\rho\)). This leads to the modified continuity equation (Eq. 10):

$$\frac{DP}{{Dt}} = - \left( {\frac{\partial u}{{\partial x}} + \frac{\partial v}{{\partial y}}} \right)$$
(10)

The updated Bernoulli equation (Eq. 11) with friction losses for pedestrian fluid flow situations, adapted to conditions where there is minimal elevation change along the pedestrian crosswalk, thus excluding the gravitational potential energy term gz, is expressed as:

$$\frac{1}{2}u_{1}^{2} + \frac{{p_{1} }}{{\rho_{1} }} + h_{A} = \frac{1}{2}u_{2}^{2} + \frac{{p_{2} }}{{\rho_{2} }} + \varepsilon_{{p\left( {1 - 2} \right)}}$$
(11)

In the equation, \(u\), \(p\), \(\rho\), \(\varepsilon_{{p\left( {1 - 2} \right)}}\) and \(h_{A}\) represent the velocity, pressure, density, friction loss, and energy input of the pedestrian flow on side B, respectively. This equation can be used to describe the total energy along a streamline of the pedestrian fluid (applied between any two points on the same streamline). The energy loss is based on the Darcy-Weisbach equation (Eq. 12), considering the characteristics of pedestrian flow measurements.

$$\varepsilon_{{p\left( {1 - 2} \right)}} = \alpha \left( {fs_{1 - 2} \frac{1}{2}\overline{u}^{2} } \right)$$
(12)

In this context, \(f\) represents the friction coefficient, \(s_{1 - 2}\) and \(\overline{u}\) denote the distance and average velocity between two locations. \(\alpha\) signifies a coefficient used to adjust the terms of energy loss to accommodate pedestrian flow. Therefore, by integrating the updated Bernoulli equation with the Navier–Stokes equation, one can determine the pressure of pedestrian flow at any point. It is assumed that pedestrian flow exists within a homogeneous fluid phase before interactions occur between individuals.

Physics informed neural networks

Definition of physics informed neural networks

PINN was initially proposed by Raissi et al.24 as a novel numerical solver applicable to various types of partial differential equations and an effective data-driven approach for solving inverse problems. From a mathematical perspective of function approximation, neural networks can be seen as universal nonlinear function approximators. Similarly, the modeling process of partial differential equations involves finding nonlinear functions that satisfy certain constraints. There is a similarity between these two concepts. Automatic differentiation techniques25 are widely used in deep neural networks, allowing us to incorporate differential constraints from partial differential equations into the design of neural network loss functions. Thus, using this approach, we can design neural networks that adhere to constraints imposed by physical models. This forms the fundamental design principle of Physics-Informed Neural Networks (PINNs).

The neural networks trained using this design philosophy can not only approximate observational data but also automatically satisfy the physical properties governed by partial differential equations (PDEs), such as symmetry, invariance, and conservation. This approach’s strength lies in simultaneously considering observational data and physical constraints, thereby enhancing the accuracy and reliability of the model. In summary, by integrating the constraints from PDEs into the design of the neural network's loss function and utilizing automatic differentiation techniques for training, we can obtain neural networks that adhere to physical model constraints. This method can better approximate the data and satisfy the physical properties of partial differential equations. The general form of a nonlinear PDE is described as in Eq. (13):

$$u_{t} + N\left( {u,\lambda } \right) = 0,x \in {\Omega },t \in \left[ {0,T} \right]$$
(12)

Here, \(N\left( {u,\lambda } \right)\) is a functional that depends on the parameter \(\lambda\) and involves the differential operation of \(u\), \(x\) is a spatial variable, \(t\) is a temporal variable, where \({\Omega }\) is a subset of the Euclidean space \(R\), and \(T\) is the terminal time. Traditional physics models typically predict \(u\left( {t,x} \right)\) at arbitrary spatiotemporal points by solving partial differential equations given initial and boundary conditions of \(N\left( {u,\lambda } \right)\) and physical parameter \(\lambda\). When analytical solutions are unavailable, numerical methods such as finite differences or finite elements are used for solving. PINNs approximate solutions of partial differential equations by constructing a neural network. After inputting spatial and temporal data, they first approximate the function using fully connected neural networks. Subsequently, leveraging automatic differentiation techniques, they compute residuals of the partial differential equations and initial-boundary value constraints, incorporating them as regularization terms in the loss function. Finally, optimization algorithms like gradient descent are used to adjust the neural network’s weight parameters and the physical parameters of the partial differential equations.

Physics Informed Neural Networks based on fluid dynamics

From the above text, the network architecture and loss function of Physics Informed Neural Networks (PINNs) need to be tailored according to the form of partial differential equations. This differs from existing work in computational physics that directly applies machine learning algorithms. In this paper, a fluid dynamics-based PINN model is developed using the PyTorch deep learning framework to analyze pedestrian crossing behaviors.

The pedestrian model in this paper takes the positional information \(\left( {x,y} \right)\) of pedestrian trajectories and time \(t\) as inputs to the Physics Informed Neural Network (PINN). After fitting, the network utilizes a loss function composed of partial differential equations from fluid mechanics to output the desired features (See Fig. 5).

Fig. 5
figure 5

Physics Informed Neural Networks model based on fluid mechanics.

As shown in Fig. 5, the solution to the differential equation is obtained through a fully connected network. When the input variables approach the function, automatic differentiation is used to calculate the residuals of the partial differential equations and initial-boundary value constraints, which are then included as regularization terms in the loss function. In this study, the Navier–Stokes (N-S) equation (Eq. 14) and the continuity equation (Eq. 10) are used as loss functions in the neural network. In Eq. (14), \(\lambda_{2}\) is related to \(\rho\) and is expressed as \(\lambda_{2} = f\left( {Re,\rho } \right)\).

$$\left\{ {\begin{array}{*{20}c} {u_{t} + \lambda_{1} \left( {uu_{x} + vu_{y} } \right) + p_{x} = \lambda_{2} \left( {u_{xx} + u_{yy} } \right)} \\ {v_{t} + \lambda_{1} \left( {uu_{x} + vu_{y} } \right) + p_{x} = \lambda_{2} \left( {u_{xx} + u_{yy} } \right)} \\ \end{array} } \right.$$
(14)

Data collection and processing

This study employed a video recording method to collect pedestrian characteristic data under real traffic conditions. The chosen experimental location was the intersection of Nanjing Road and Gongqingtuan West Road in Zibo, China, focusing on the pedestrian crossings in the east–west directions in two areas, as shown in Fig. 6a. The pedestrian crosswalk is 32 m long with a 4-m-wide safety island in the middle. The study specifically investigates the pedestrian behaviors in the congested interaction zones (AB zones) of the crosswalk, where pedestrians from side A cross for the first time and pedestrians from side B cross for the second time.

Fig. 6
figure 6

Selected pedestrian two-stage crossing road geometry and signal cycle.

As shown in Fig. 6b, the selected intersection’s pedestrian signal cycle length is 169 s, encompassing phases for two crossings. Within this signal cycle, the pedestrian signals exhibit a bi-directionally asymmetric distribution. Specifically, during phase bc, the green light first illuminates for pedestrians from side B. After some time, the green light then lights up for pedestrians in phase ab, serving both directions. This signal timing allows pedestrians from side B to cross the central zone when the green light is on, then wait on the safety island for a period before proceeding. Conversely, pedestrians from side A do not need to wait on the safety island during phase ab.

During weekday peak hours, a drone was used to collect and record pedestrian data when a large number of pedestrians were crossing. In total, 244 signal cycles were recorded, including 4102 pedestrians from side A and 3356 pedestrians from side B. The pedestrian movement characteristics were measured using the yolov5_deepsort algorithm, primarily by extracting pedestrian speeds and trajectories.

The selected signalized intersection is located near the gate of a university campus, so most pedestrians crossing this intersection are young adults and middle-aged individuals. Based on the characteristics of bidirectional pedestrians, the AB zone is divided into five sections using four lines, S1, S2, S3, and S4, as shown in Fig. 7.

Fig. 7
figure 7

Walking directions and interaction behaviors on four crossing sections.

At cross-section S1, when the first row of pedestrians from direction B has just passed the edge of the safety island, the first row of pedestrians from direction A arrives at this point. Most pedestrians face forward, maintaining a relatively consistent direction.

At cross-section S2, pedestrians from both sides begin to converge bidirectionally. From this position onwards, pedestrians from side A gradually slow down and increase their variation in walking direction. From this moment, pedestrian particles from side A start flowing within the pedestrian fluid from side B. This change is mainly influenced by the pedestrians from side B.

At cross-section S3, pedestrians from both sides undergo the longest interaction at this stage. After passing this point, both sides increase their crossing speed.

At cross-section S4, the interacting pedestrians from both sides completely separate. All pedestrian particles from side A have disengaged from the pedestrian flow of side B.

The partial pedestrian flow data from side B is shown in Tables 1, and 2 displays the partial data of pedestrian particles from side A. Each data entry is extracted from pedestrian particles along the streamline and includes elements such as position, velocity, acceleration, and pressure. (The starting point for pedestrians on side A is 0m, and the starting point for pedestrians on side B is 14 m).

Table 1 Partial pedestrian data from side A.
Table 2 Partial pedestrian data from side B.

Results

Model training

This study, the PINN is built on the PyTorch deep learning framework. This model consists of two parts: a fully connected neural network and a partial differential equation part containing physical functions. Neural networks are powerful machine learning models that have achieved significant success in various tasks. However, the design of neural networks must carefully consider the impact of depth and breadth on model performance. Too many layers and neurons can lead to overfitting, where the model learns noise in the data. Conversely, too few layers and neurons may fail to capture the complex structures in the data, resulting in underfitting.

Therefore, determining the appropriate depth and breadth of the network is crucial for designing high-performance neural networks. To ensure that the PINN network has an optimal structure, it is necessary to empirically test the number of layers and neurons per layer in the fully connected neural network using data. This ensures that the model neither overfits nor underfits during the learning process, thereby achieving optimal performance.

To determine the optimal structure of the fully connected neural network in this study, a learning rate Lr = 0.01 was set, ReLU function was used as the activation function, and the Adam algorithm was employed as the optimization algorithm. The MSE under different hidden layers and neurons per layer are shown in Table 3. It can be demonstrated that the optimal structure for the FCNN (fully connected neural network) is 6 hidden layers with 40 neurons per layer.

Table 3 MSE between predicted and actual values on validation set for different layers and neurons.

To demonstrate the superiority of PINNs over traditional deep learning methods, we will utilize the fully connected neural network obtained from the above steps. It will be split into two networks: one incorporating a physics-informed loss function and another without. Both networks will be trained using the same dataset and other network parameters.

In Fig. 8, it can be observed that as the number of epochs increases, both the fully connected neural network and the Physics Informed Neural Network (PINN) exhibit a decreasing trend in Mean Square Error (MSE). However, compared to the optimal training performance of the fully connected neural network with an MSE of 7.561 × 10–7, the Physics Informed Neural Network, which incorporates the physical equations as a loss function, achieves a much lower MSE of 9.35 × 10–8. This indicates that the predictions of the Physics Informed Neural Network are more accurate than those of the fully connected neural network. Additionally, we also compared the MAE, RMSE, and MSE of other models, as shown in Table 4.

Fig. 8
figure 8

MSE comparison between the FCNN and the PINN.

Table 4 Comparison of errors between models.

Pedestrian fluid analysis

Through the previous section of model training, we have obtained a physically informed neural network with excellent performance. In this section, we will analyze pedestrian fluid dynamics during a two-stage crossing using the trained model, exploring changes in fluid properties such as velocity, acceleration, density, and others.

It is noted that the flow pattern is related to four main variables: speed, pedestrian group length, density, and viscosity. For pedestrian flow, laminar flow occurs when Re < 2.4. Figure 9a–d show the correlation between the four variables and the Reynolds number. It is observed that for this laminar pedestrian flow, the Reynolds number ranges from 0.5 to 1.7.

Fig. 9
figure 9

Correlation between four variables and reynolds number, and changes in reynolds number along the study section.

In Fig. 9a, it can be observed that Reynolds numbers increase with increasing velocity. This suggests that higher speeds of pedestrian particle movement create larger disturbances in the pedestrian fluid. Specifically, as velocity increases, the influence area around pedestrian particles expands, potentially unsettling the pedestrian fluid more significantly. In Fig. 9b, Reynolds numbers are noted to increase with the length of pedestrian groups. This reflects that longer groups of pedestrians take more time for the pedestrian fluid to return to its original state after being separated. Figure 9c highlights that an increase in pedestrian fluid density leads to a corresponding linear increase in Reynolds numbers. Density evidently generates inertial forces (and notably does not invoke viscous forces), thus increasing the Reynolds number. In Fig. 9d, it is observed that Reynolds numbers decrease with increasing viscosity and nonlinearly decrease with increased viscosity. Higher fluid viscosity results in greater resistance to particles, requiring more energy from pedestrian particles to alter the state of pedestrian fluid under these conditions.

Figure 9e shows the variation of the Reynolds number for pedestrian flow along the study section. The model's output for the Reynolds number of pedestrian flow closely matches the actual Reynolds numbers we calculated. The trend of Reynolds number changes in the previously divided stages is consistent with the real situation. This indicates that the model fits the pedestrian data well and accurately reflects the trend of Reynolds number changes.

In the study section, the changes in pedestrian Reynolds number are mainly influenced by pedestrian speed and density. In the 2 m to 8 m section, the Reynolds number generally shows a decreasing trend. This is because pedestrians gradually observe oncoming pedestrians approaching, causing them to slow down, which results in a decrease in the Reynolds number. However, during the initial deceleration process, pedestrian density increases, causing the Reynolds number to decrease slowly and sometimes even increase. Eventually, when pedestrian density reaches its maximum, the Reynolds number decreases further with the continued reduction in pedestrian speed.

In the 8–11 m section, the Reynolds number exhibits a trend of sudden increase followed by a decrease. This is due to the convergence of pedestrians from both sides, where pedestrian speed remains almost constant, but density suddenly increases, leading to a rise in the Reynolds number. Subsequently, as pedestrians disperse, the density decreases, causing the Reynolds number to fall.

Finally, in the 8–14 m section, after the pedestrians from both sides separate, their speed gradually increases, resulting in a rise in the Reynolds number.

In addition, the outputs of real pedestrian fluid from the Physically Informed Neural Network are shown in Figs. 10 and 11 (where pedestrians from point A start at 0m, and from point B at 14 m). These images respectively depict the changes in pedestrian velocity, acceleration, and density after being processed by the neural network.

Fig. 10
figure 10

Velocity and acceleration variation of pedestrians on the road longitudinal section.

Fig. 11
figure 11

Heat map of pedestrian density across four stages.

From Figs. 10 and 11, it can be observed that the outputs of the Physically Informed Neural Network for pedestrians at points A and B align with the attributes (velocity, acceleration, and density) of the fluid-based pedestrian crossing model described in sections “Pedestrian second crossing model based on fluid dynamics” and “Physics informed neural networks”. In the first stage, as pedestrians from the first row on side B just pass the boundary of the safety island, pedestrians from the first row on side A arrive at this point. As most pedestrians face forward and move in relatively consistent directions, the velocity of the pedestrian fluid continues to increase, and pedestrians adjust their paths in advance to avoid collisions. In the second stage, pedestrians from both sides begin to converge bidirectionally. From this point on, pedestrians from both sides gradually slow down as they notice pedestrians approaching from the opposite direction. In the third stage, pedestrians from both sides experience the longest interaction, resulting in the lowest speeds. In the fourth stage, pedestrians from both sides completely separate: pedestrians from side A continue to cross the remaining pedestrian crosswalk after reaching the safety island, while pedestrians from side B reach their destination after this stage.

We analyzed the speeds of pedestrians on both sides (see Fig. 10a). Pedestrians on side A start at 0 m, while those on side B start at 14 m. It can be observed that the speed range of the pedestrian fluid on both sides is between 1 and 1.9 m/s. Since pedestrians on side B stop at the safety island, mainly comprising stationary pedestrian particles, while pedestrians on side A include both moving and stationary particles, the initial speed of the pedestrian fluid on side A is higher than that on side B.

By the time the pedestrian fluid on side A reaches 4.5 m, the speeds of both pedestrian fluids reach their maximum. Referring to the pedestrian fluid acceleration graph (see Fig. 10b), at this point, the acceleration of both pedestrian fluids is 0 m/s2, and it gradually decreases, resulting in a decline in the pedestrian fluid speed. This is because pedestrians on both sides have noticed the approach of pedestrians from the opposite direction, increasing the pressure within the pedestrian fluid, and pedestrians are preemptively choosing paths to avoid collisions.

When the pedestrian fluid on side A reaches 7.1 m, interactions between pedestrians from both sides begin, causing the speed of the pedestrian fluid to continue decreasing to a minimum, at which point the density of the pedestrian fluid reaches its maximum. From the pedestrian fluid density map (see Fig. 11), it can be observed that after interactions begin, the density of the pedestrian fluid gradually increases from its initial range of 0.5–1.5 Ped/m2 to 1.5–2.5 Ped/m2.

By the time the pedestrian fluid on side A reaches 10.4 m, pedestrians from both sides have completely separated, and the speed of the pedestrian fluid gradually increases. Initially, the speed of pedestrians on side B increases and then gradually decreases as they approach their destination. Due to pedestrians on side A needing to cross the entire intersection within the same signal cycle, the average speed of the pedestrian fluid on side A is greater than that on side B.

Conclusion

This study established a model for pedestrians crossing intersections bidirectionally, exploring the main characteristics of pedestrian flow using a Physically Informed Neural Network. The model integrates equations for Reynolds number calculation, Navier–Stokes equations, and Bernoulli's equation. The main findings of this study are summarized as follows.

  1. 1.

    Comparison between Physically Informed Neural Network (PINN) and traditional deep learning in pedestrian crossing models showed that PINN exhibits better performance in calculating and predicting pedestrian fluid properties, with a mean square error as small as 10–8.

  2. 2.

    This study demonstrated the accuracy and applicability of analyzing pedestrian fluid through Physically Informed Neural Network simulations. The model shows consistency with real-world conditions in simulating changes in pedestrian velocity, acceleration, density, and Reynolds number, particularly in pedestrian interaction and segment analysis. These results indicate that the proposed model not only effectively captures dynamic characteristics of pedestrian fluid but also provides insights into the impact of pedestrian behavior on pedestrian flow.

  3. 3.

    During bidirectional interaction processes, the velocity of pedestrian fluid varies as pedestrians approach each other, while fluctuations in density and Reynolds number reflect the interaction effects among pedestrians. Specifically, near safety islands and intersections, pedestrian fluid behavior shows a noticeable trend of decreasing velocity and increasing density. The speed range of pedestrian fluids on both sides is from 1 to 1.9 m/s, with side A exhibiting higher speeds than side B.

The findings of this study contribute to a profound and accurate understanding of the interaction characteristics of pedestrian crossings for transportation researchers and scholars. These results are instrumental in optimizing pedestrian signal timing and upgrading pedestrian facilities at signalized intersections, aiming to enhance pedestrian mobility and safety, particularly in busy urban areas. Furthermore, by integrating physical equations into neural networks through Physically Informed Neural Networks (PINN), where data holds physical significance, these discoveries can aid in enhancing the capability of autonomous vehicles to interpret pedestrian intentions within the context of smart traffic and connected vehicles. Future research should focus on pedestrian crossing behaviors during non-peak hours and utilize dynamic fluid density and resistance coefficients to predict resistance more accurately.