Public safety crowd flow early warning method and system fusing spatio-temporal residual learning
By integrating spatiotemporal residual learning and combining multi-source data with topology graph construction, high-precision prediction and risk identification of crowd flow in public areas are achieved. This solves the problems of insufficient data utilization and insufficient risk identification in existing technologies and improves the emergency response capability of public safety management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN URBAN PLANNING & DESIGN INST
- Filing Date
- 2026-05-07
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies for monitoring and early warning of crowd flow in public areas are unable to effectively utilize multi-source heterogeneous data, lack separate modeling of crowd flow evolution trends and abnormal deviations in complex scenarios, resulting in insufficient risk identification capabilities. Furthermore, fixed threshold early warning methods have poor adaptability and are unable to accurately reflect the spatial transmission process of crowd flow risks.
By collecting video perception data, traffic counting data, and wireless dwell migration data, and combining building floor plans and BIM models, a region-channel directed topology map is constructed. Baseline traffic prediction is performed using trend cycle decomposition and neural controlled differential equations. Residual learning is performed based on fractional-gated temporal convolution and hypergraph attention propagation to generate future crowd state prediction values and output early warning levels.
It improves the accuracy and adaptability of crowd flow early warning, enabling early identification of potential risk areas and transmission paths, reducing false alarms and missed alarms, and enhancing the emergency response capabilities of public safety management.
Smart Images

Figure CN122153808A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of public safety monitoring and intelligent video analysis and early warning technology, specifically to a public safety crowd flow early warning method and system that integrates spatiotemporal residual learning. Background Technology
[0002] With the continuous increase in pedestrian density in urban rail transit hubs, railway passenger stations, airport terminals, large commercial complexes, sports stadiums, performance venues, tourist attractions, and urban public open spaces, monitoring and risk warning of crowd flow in public areas has become an important technological direction for public safety management. During peak hours, emergencies, event dispersal, equipment malfunctions, temporary traffic control, severe weather, or emergency evacuations, crowd flow may rapidly accumulate, cause localized congestion, channel blockage, two-way conflicts, and overflow from bottlenecks within a short period. If these phenomena are not identified and intervened in advance, they can easily lead to safety risks such as congestion, stampedes, and evacuation imbalances. Therefore, how to continuously perceive, predict trends, and provide tiered early warnings of changes in crowd flow in target public areas has become a key issue in smart security and urban operation management.
[0003] Existing technologies for monitoring and early warning of crowd flow in public areas mainly include the following types of solutions: One type is crowd counting, density estimation, and congestion detection methods based on camera video. These methods obtain information on the number of people, density, or speed within a specific area by performing target detection, target tracking, or density regression on the monitored footage. Another type is crowd flow statistics methods based on devices such as turnstiles, access control systems, ticketing systems, WiFi probes, and Bluetooth probes. These methods analyze the traffic conditions in a localized area by recording data on people entering, exiting, staying, and migrating. A third type is crowd flow prediction methods based on time series models, graph neural networks, or deep learning models. These methods are used to predict the trend of crowd flow changes over a future period. While these solutions have improved the automation level of crowd monitoring to some extent, they still have significant shortcomings in complex public safety scenarios.
[0004] First, existing solutions are often based on a single data source or a single camera perspective. While they can reflect changes in the number of people or density in a local area, they lack the ability to comprehensively represent the driving factors of crowd flow evolution by combining heterogeneous information such as gate counting, dwell time migration, activity timelines, weather conditions, and temporary control measures. Second, existing technologies mostly use rule-based threshold judgments or short-term window prediction methods, which do not fully utilize the spatial structure of the scene. In particular, they lack explicit modeling of the passage relationships between functional areas such as entrance areas, gate areas, escalator areas, corridor areas, station hall areas, waiting areas, and distribution areas, making it difficult to describe the propagation path of risks between multiple areas and channels. Third, for the common "gradual gathering - local overload - channel spillover" process in public safety scenarios, traditional methods focus more on current state identification and lack separate modeling of normal flow evolution trends and abnormal deviations, resulting in insufficient early identification capabilities for slowly accumulating risks and sudden disturbance risks. At the same time, fixed threshold-based early warning methods are difficult to adapt to the differences in crowd flow fluctuations under different time periods, activity levels, weather conditions, and scene capacities, which easily leads to false alarms or missed alarms.
[0005] Furthermore, in public areas, multiple areas often share the same turnstile group, escalator group, security checkpoint group, or main evacuation route. The relationships between these areas are not simply pairwise adjacencies, but rather exhibit many-to-many coupling propagation characteristics caused by bottleneck facilities. Existing conventional graph modeling methods typically only describe the connections between adjacent nodes, failing to adequately characterize the flow propagation mechanism under shared constraints and thus struggling to accurately reflect the spatial transmission process of crowd flow risks. Therefore, there is an urgent need for a crowd flow early warning method that can integrate multi-source heterogeneous sensing data, combine area-channel topology, and simultaneously consider both normal trend modeling and anomaly residual learning to improve the accuracy, lead time, and scenario adaptability of crowd risk identification in public areas. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention discloses a public safety crowd flow early warning method and system integrating spatiotemporal residual learning. The method includes collecting video perception data, passage counting data, wireless dwell migration data, and scene context data of the target public area, and performing time synchronization and spatial mapping. Based on building floor plans, BIM models, CAD drawings, or electronic maps, a directed topological graph of the area and passageways is constructed, node features and edge features are extracted, and a node-edge joint spatiotemporal state tensor is generated. Baseline flow prediction results are obtained based on trend periodic decomposition and neural controlled differential equations. Then, residuals are modeled based on fractional-gated temporal convolution and hypergraph attention propagation to generate predicted crowd state values within the future prediction window. Risk indicators are calculated, and early warning levels, risk areas, and handling suggestions are output. This invention can improve the accuracy and adaptability of crowd flow early warning in complex public scenarios.
[0007] A public safety crowd flow early warning method integrating spatiotemporal residual learning includes the following steps:
[0008] S1. Collect multi-source heterogeneous sensing data of the target public area, including video sensing data, access counting data, wireless dwell migration data and scene context data, and perform time synchronization and spatial mapping.
[0009] S2. Based on the building floor plan, BIM model, CAD drawings or electronic map, divide the entrance area, turnstile area, escalator area, corridor area, station hall area, waiting area and distribution area into area nodes. Define the connection between nodes with passable boundaries and satisfying the one-step reachability relationship as directed passage edges, and construct the area-passage directed topology graph.
[0010] S3. Extract the number of people, density, inflow, outflow, average speed, dwell time, directional entropy, queue length, and the throughput, passage time, saturation, and reverse conflict coefficient of each node to generate a node-edge joint spatiotemporal state tensor.
[0011] S4. Input the node-edge joint spatiotemporal state tensor into the baseline flow prediction model, decompose the node-edge joint spatiotemporal state tensor using the trend period decomposition unit to obtain the trend component, period component and context perturbation prior component, and then input the trend component, period component and context perturbation prior component into the node-edge neural controlled differential equation unit to perform continuous time trajectory modeling, and output the baseline flow prediction results of each region node and directed channel edge within the future prediction window;
[0012] S5. Construct a residual sequence based on the difference between the current observation state and the corresponding baseline flow prediction result. Input the residual sequence into the temporal residual branch and the spatial residual branch. The temporal residual branch uses fractional-gated temporal convolution to extract temporal residual features, and the spatial residual branch uses hypergraph attention propagation to extract spatial residual features. Then, use a capacity-aware asymmetric gated activation function to fuse the temporal residual features and the spatial residual features to obtain the residual correction representation.
[0013] S6. Based on the baseline traffic prediction results and the residual correction representation, generate the predicted population status values of each regional node and directed channel edge within the future prediction window, and calculate the predicted peak density, density growth rate, cumulative residence index, bottleneck saturation, queuing spillover probability and prediction uncertainty accordingly. Combine the dynamic early warning threshold to output the early warning level, risk area and disposal suggestions.
[0014] Preferably, the video perception data consists of personnel location points, trajectory segments, velocity vectors, and area population and density heatmaps obtained after pedestrian detection, cross-frame tracking, and homography mapping of surveillance video; the passage counting data consists of the number of people entering and exiting, passage duration, and queue number output by turnstiles, access control devices, security inspection devices, or ticketing devices; the wireless dwell migration data consists of the number of dwellers, dwell duration, and cross-area migration counts obtained based on WiFi, Bluetooth, or UWB anonymous probes; and the scene context data includes weather, time period, holidays, activity start and end times, train or flight arrival and departure times, temporary control status, and equipment start / stop status.
[0015] Preferably, in the region-channel directed topology graph, each directed channel edge is associated with at least four attributes from the following: channel width, channel length, allowed passage direction, maximum passage capacity, slope or elevation difference, facility opening / closing status, and passage impedance coefficient, and the edge weight is determined based on the attributes.
[0016] Preferably, the node-edge joint spatiotemporal state tensor is formed by stacking the data from the most recent L sampling periods in chronological order, and includes at least node feature tensors, edge feature tensors, and context feature tensors, wherein the context feature tensor includes one or more of time period codes, weekday codes, holiday codes, weather codes, activity status codes, and temporary control status codes.
[0017] Preferably, the baseline flow prediction is achieved through a trend periodic decomposition unit and a node-side neural controlled differential equation unit. The trend periodic decomposition unit is used to decompose the long-term trend component, the periodic fluctuation component, and the event disturbance prior component. The node-side neural controlled differential equation unit is used to model the continuous time trajectory of multi-source observations under different sampling frequencies and irregular time intervals.
[0018] Preferably, the fractional-gated temporal convolution is used to extract the long memory accumulation features of the residuals in the time dimension to characterize the processes of gradual aggregation, slow congestion formation, and short-term explosive traffic growth.
[0019] Preferably, the hypergraph attention propagation is modeled as many-to-many by constructing hyperedges, whereby the hyperedges are used to characterize the coupling relationship between multiple regional nodes or directed channel edges that share the same turnstile group, the same escalator group, the same security check channel group, the same evacuation main path, or the same bottleneck constraint area.
[0020] Preferably, in step S5, a capacity-aware asymmetric gating activation function is used to fuse temporal residual features and spatial residual features. The capacity-aware asymmetric gating activation function uses the load rate of regional nodes or directed channel edges, the reverse conflict index, and the residual sign as gating inputs to enhance positive overload residuals and suppress negative non-risk residuals.
[0021] Preferably, the dynamic early warning threshold is adaptively generated based on the scene category, time period category, event category and historical statistical distribution of similar scenes, and the threshold is corrected based on the prediction uncertainty; the handling suggestions include one or more of the following: flow restriction, one-way passage, opening more evacuation channels, broadcast guidance, security reinforcement and temporary lockdown.
[0022] This application also provides a public safety crowd flow early warning system that integrates spatiotemporal residual learning, including:
[0023] The data acquisition module collects multi-source heterogeneous sensing data of the target public area, including video sensing data, access counting data, wireless dwell migration data and scene context data, and performs time synchronization and spatial mapping.
[0024] The topology construction module divides the entrance area, turnstile area, escalator area, corridor area, station hall area, waiting area, and distribution area into regional nodes based on the building floor plan, BIM model, CAD drawings, or electronic map. The connection between nodes with passable boundaries and satisfying the one-step reachability relationship is defined as a directed passage edge, thus constructing a region-passage directed topology graph.
[0025] The state tensor generation module extracts the number of people, density, inflow, outflow, average speed, dwell time, directional entropy, queue length, and the throughput, passage time, saturation, and reverse conflict coefficient of each node to generate a node-edge joint spatiotemporal state tensor.
[0026] The baseline prediction module inputs the node-edge joint spatiotemporal state tensor into the baseline flow prediction model, decomposes the node-edge joint spatiotemporal state tensor using a trend-period decomposition unit to obtain trend components, periodic components, and context perturbation prior components, and then inputs the trend components, periodic components, and context perturbation prior components into a node-edge neural controlled differential equation unit to perform continuous time trajectory modeling, and outputs the baseline flow prediction results for each region node and directed channel edge within the future prediction window;
[0027] The residual learning module constructs a residual sequence based on the difference between the current observation state and the corresponding baseline flow prediction result. The residual sequence is then input into a temporal residual branch and a spatial residual branch. The temporal residual branch uses fractional-gated temporal convolution to extract temporal residual features, and the spatial residual branch uses hypergraph attention propagation to extract spatial residual features. The temporal residual features and spatial residual features are then fused using a capacity-aware asymmetric gated activation function to obtain a corrected residual representation.
[0028] The risk assessment module is used to generate predicted population status values for each regional node and directed channel edge within the future prediction window based on the baseline traffic prediction results and residual correction representation, and to calculate the predicted peak density, density growth rate, cumulative residence index, bottleneck saturation, queuing spillover probability, and prediction uncertainty.
[0029] The early warning decision module is used to output the early warning level, risk area, and handling suggestions by combining dynamic early warning thresholds.
[0030] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0031] (1) This invention, by jointly collecting video perception data, traffic counting data, wireless dwell migration data, and scene context data, and performing time synchronization and spatial mapping on data from different sources, can overcome the limitations of a single camera or single counting device reflecting only a local state, and incorporate the number of people, density, inflow and outflow, dwell time, directional distribution, passage conditions, and external event disturbances in a unified analysis framework. Furthermore, by constructing a directed topology map of the area and passage based on building floor plans, BIM models, CAD drawings, or electronic maps, the actual passage relationships, boundary relationships, and bottleneck relationships between functional areas within the public area can be explicitly expressed, thereby enabling the system to have higher accuracy in depicting the spatiotemporal distribution of crowd flow in complex public scenes and better scene adaptability.
[0032] (2) This invention does not directly predict future pedestrian flow. Instead, it first establishes a baseline flow prediction result using trend cycle decomposition and neural controlled differential equations. Then, it constructs a residual sequence based on the deviation between the observed values and the baseline prediction values, and performs joint modeling using fractional-gated temporal convolution and hypergraph attention propagation. This approach can simultaneously characterize normal regular fluctuations and abnormal disturbances, and is particularly suitable for identifying risk evolution processes such as slow accumulation, local overload, short-term outbreaks, and cross-regional diffusion commonly found in public areas. Compared to schemes that rely solely on fixed thresholds or short-term windows for judgment, this invention can identify potential risk areas and propagation paths earlier, providing more time for flow control, diversion, and emergency dispatch.
[0033] (3) In the fusion stage of temporal residual features and spatial residual features, this invention introduces a capacity-aware asymmetric gating activation function. The load rate of regional nodes or directed channel edges, the reverse conflict index, and the residual sign are used as gating inputs to enhance positive overload residuals and suppress negative non-risk residuals. Compared with the conventional activation method that treats positive and negative residuals equally, this structure is more in line with the actual needs of public safety scenarios where "overload risks need to be amplified and ordinary fluctuations should be moderately suppressed." It can improve the sensitivity of risk identification under high load, strong conflict, and critical saturation conditions, and reduce false alarms caused by normal fluctuations. At the same time, combined with risk indicators such as predicted peak density, bottleneck saturation, and queuing spillover probability, the early warning results can have stronger interpretability and higher engineering application value. Attached Figure Description
[0034] Figure 1 This is a flowchart of a public safety crowd flow early warning method that integrates spatiotemporal residual learning according to the present invention;
[0035] Figure 2 This is a schematic diagram of the region-channel directed topology constructed by the present invention;
[0036] Figure 3 This is a structural diagram of a public safety crowd flow early warning system module that integrates spatiotemporal residual learning according to the present invention. Detailed Implementation
[0037] Those skilled in the art will understand that, in order to make the above-mentioned objects, features, and beneficial effects of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Figure 1 This application illustrates a public safety crowd flow early warning method that integrates spatiotemporal residual learning, including the following steps:
[0038] A public safety crowd flow early warning method integrating spatiotemporal residual learning includes the following steps:
[0039] S1. Perform multi-source heterogeneous sensing data acquisition and spatiotemporal alignment; acquire multi-source heterogeneous sensing data of the target public area within a continuous time period, wherein the multi-source heterogeneous sensing data includes at least two of the following types of data:
[0040] a) Video perception data, which is the location points, trajectory segments, velocity vectors, number of people in the area, and density heatmap of the surveillance video after pedestrian detection, cross-frame tracking, and scene homography mapping.
[0041] b) Passage counting data, which is the number of people entering and exiting, the passage time, and the number of people queuing, output by turnstiles, access control equipment, security inspection equipment, or ticketing equipment;
[0042] c) Wireless dwell migration data, which is the number of dwellers, dwell time and cross-region migration count obtained based on WiFi, Bluetooth or UWB anonymous probes;
[0043] d) Scene context data, which includes weather, time period, holidays, activity start and end time, train or flight arrival and departure time, temporary control status, and equipment start and stop status;
[0044] The multi-source heterogeneous sensing data is time-synchronized at a preset sampling interval, and spatial mapping is performed based on camera calibration parameters, scene plane coordinate system and region mask to form an original monitoring dataset under a unified time reference.
[0045] S2. Construct a directed topology graph of regions and channels and generate a node-edge joint spatiotemporal state tensor. Based on the building floor plan, BIM model, CAD drawings, or electronic map of the target public area, divide the scene into several functional sub-regions, including entrance area, exit area, turnstile area, security check area, staircase area, escalator area, corridor area, waiting area, station hall area, distribution area, and buffer zone, and define each functional sub-region as a region node. For any two region nodes, if there is a passable boundary between them and they satisfy a one-step reachability relationship, then establish a directed channel edge between them, and assign the directed channel edge attributes such as channel width, channel length, allowed passage direction, maximum passage capacity, slope or elevation difference, facility opening and closing status, and passage impedance coefficient, thereby constructing a directed topology graph of regions and channels.
[0046] Based on the original monitoring dataset, node features of each region node at each sampling time and edge features of each directed channel edge at each sampling time are extracted. The node features include at least five items from the following: number of people, density per unit area, inflow, outflow, average moving speed, average dwell time, motion direction entropy, queue length, and area occupancy. The edge features include at least three items from the following: edge traffic volume, main direction traffic ratio, average passage time, channel saturation, and reverse conflict coefficient. The node feature matrix, edge feature matrix, and scene context feature vector of the most recent L sampling periods are stacked in chronological order to generate a node-edge joint spatiotemporal state tensor.
[0047] S3. Baseline flow prediction based on trend cycle decomposition and neural controlled differential equations; the node-edge joint spatiotemporal state tensor is input into the baseline flow prediction model, which includes a trend cycle decomposition unit and a node-edge neural controlled differential equation unit; wherein, the trend cycle decomposition unit is used to decompose the trend component, cycle component and context perturbation prior component from the node-edge joint spatiotemporal state tensor, and the node-edge neural controlled differential equation unit is used to model the continuous time evolution trajectory after decomposition and output the baseline flow prediction results of each regional node and each directed channel edge within the future prediction window;
[0048] S4. Spatiotemporal residual learning is performed based on fractional-gated temporal convolution and hypergraph attention propagation; a residual sequence is constructed based on the difference between the actual observed state and the baseline flow prediction result; the residual sequence is input into the temporal residual branch and the spatial residual branch, wherein the temporal residual branch uses a fractional-gated temporal convolution unit to extract the long memory accumulation feature of the residual in the time dimension, and the spatial residual branch uses a hypergraph attention propagation unit to extract the propagation feature of the residual in the multi-region coupled topology; wherein the hypergraph attention propagation unit constructs hyperedges in the following way: multiple region nodes and / or directed channel edges sharing the same gate group, the same escalator group, the same security check channel group, the same evacuation main path, or the same bottleneck constraint area are grouped into the same hyperedge; and the capacity-aware asymmetric gated activation function is used to fuse the output of the temporal residual branch and the output of the spatial residual branch to obtain the residual correction representation;
[0049] S5. Perform future risk state inference and extract risk-related indicators; based on the baseline flow prediction results and the residual correction representation, generate the predicted population state values for each regional node and each directed channel edge within the future prediction window; calculate the risk-related indicators based on the predicted population state values, wherein the risk-related indicators include at least three of the following: predicted peak density, density growth rate, cumulative stay index, bottleneck saturation, reverse conflict index, queuing spillover probability, and prediction uncertainty score.
[0050] S6. Conduct dynamic graded early warning; construct a comprehensive risk score based on the risk-related indicators, and determine the dynamic early warning threshold according to the scenario category, time period category, event category, and historical distribution of similar scenarios; compare the comprehensive risk score with the dynamic early warning threshold, and output the corresponding early warning level, risk area, risk propagation path, and handling suggestions.
[0051] In some embodiments, step S1, the process of acquiring video perception data includes: performing pedestrian target detection on the monitoring video frames to obtain human body bounding boxes; performing cross-frame association on the human body bounding boxes in consecutive video frames to obtain pedestrian trajectory segments; mapping the pedestrian position in the image coordinates to the scene plane coordinate system through camera intrinsic and extrinsic parameter calibration and homography transformation; and statistically analyzing the distribution of the number of people, density heatmap, average speed, and trajectory direction in each functional sub-region based on the region mask.
[0052] In some embodiments, step S2, the process of constructing the region-channel directed topology graph includes: using functional sub-regions as nodes; using the connection relationship between adjacent functional sub-regions that share a passage boundary and satisfy the passage rules as directed edges; if the channel has a one-way passage rule, then only the directed edges in the allowed direction are retained; if the channel is a two-way passage channel, then two directed edges in opposite directions are established; and the edge weights are determined according to the channel width, channel length, maximum passage capacity, slope or elevation difference, facility opening and closing status, and passage impedance coefficient.
[0053] In some embodiments, in step S2, the node-edge joint spatiotemporal state tensor is composed of data from the most recent L sampling periods. The tensor includes at least: a node feature tensor, whose feature dimensions include number of people, density per unit area, inflow, outflow, average moving speed, average dwell time, movement direction entropy, queue length, and area occupancy; an edge feature tensor, whose feature dimensions include edge traffic volume, main direction traffic ratio, average passage time, channel saturation, and reverse conflict coefficient; and a context feature tensor, whose feature dimensions include time period encoding, weekday encoding, holiday encoding, weather encoding, activity status encoding, and temporary control status encoding.
[0054] In some embodiments, in step S3, the trend period decomposition unit is used to decompose the node-edge joint spatiotemporal state tensor into long-term trend components, periodic fluctuation components, and event perturbation prior components; the node-edge neural controlled differential equation unit uses the long-term trend components, periodic fluctuation components, and event perturbation prior components as control paths to perform continuous time trajectory modeling for multi-source observations under different sampling frequencies and irregular time intervals, and outputs the baseline flow prediction results of each regional node and each directed channel edge within the future prediction window.
[0055] In some embodiments, in step S4, the fractional-gated temporal convolutional unit introduces fractional-order memory parameters into the temporal convolution kernel to weight the residual accumulation at different time scales, thereby enhancing the ability to represent gradual aggregation, slow congestion formation, and short-term explosive traffic growth.
[0056] In some embodiments, in step S4, the hypergraph attention propagation unit does not only model the pairwise relationship between two adjacent nodes, but organizes multiple regional nodes and / or directed channel edges that are affected by the same bottleneck, the same service facility or the same evacuation main path into the same hyperedge, and assigns attention weights based on the coupling strength between multiple entities inside the hyperedge to obtain the residual space propagation characteristics under many-to-many propagation relationship.
[0057] In some embodiments, in step S4, the capacity-aware asymmetric gating activation function uses the load rate, inverse conflict index, and residual sign of a node or directed channel edge as gating inputs, satisfying the following: when the load rate is below a first threshold, a linear fidelity mapping is applied to the residual; when the load rate is between the first and second thresholds, a smooth gain mapping is applied to the positive residual; when the load rate is above the second threshold and the residual is positive, a strong gain mapping is applied to the positive residual; and when the residual is negative, a suppression mapping is applied to the negative residual; in order to enhance the abnormal response of the adjacent overload area and weaken the interference of non-risk fluctuations on the early warning results.
[0058] In some embodiments, in step S5, the predicted peak density represents the maximum number of people per unit area in the regional nodes within the future prediction window; the density growth rate represents the growth slope of regional density between adjacent prediction times; the dwell accumulation index represents the combined effect of average dwell time and cumulative number of people in the target area; the bottleneck saturation represents the ratio of predicted throughput to maximum throughput capacity of a directed channel edge; the reverse conflict index represents the degree of conflict between opposite directions of pedestrian flow within the same channel; the queue overflow probability represents the probability that the queue length exceeds the buffer length; and the prediction uncertainty score represents the variance or confidence interval width of the model for future prediction results.
[0059] In some embodiments, in step S6, the dynamic warning threshold is not a fixed threshold, but a quantile threshold that is adaptively generated based on scene category, time period category, event category and historical statistical distribution of similar scenes, and the threshold is corrected according to the prediction uncertainty score. When the prediction uncertainty score increases, the trigger threshold is increased or the warning level jump speed is reduced accordingly.
[0060] In some embodiments, the comprehensive risk score is obtained by weighted fusion of the predicted peak density, density growth rate, cumulative dwell index, bottleneck saturation, reverse conflict index, queue spillover probability, and predicted uncertainty score, and the disposal recommendations include at least one or more of the following: flow restriction, one-way passage, opening more evacuation channels, broadcast guidance, security reinforcement, and temporary lockdown.
[0061] In some embodiments, after outputting the warning level, the on-site handling results and subsequent real traffic data are received, and the trend cycle decomposition unit, node-edge neural controlled differential equation unit, fractional-order gated temporal convolution unit, hypergraph attention propagation unit, and dynamic warning threshold are updated based on the on-site handling results and subsequent real traffic data.
[0062] S1. Collect multi-source heterogeneous sensing data of the target public area, including video sensing data, access counting data, wireless dwell migration data and scene context data, and perform time synchronization and spatial mapping.
[0063] In this embodiment, the target public area is the public passage area of a subway transfer station in a certain city, covering Entrance A, security checkpoint, turnstile area, concourse gathering area, transfer corridor area, upward escalator area, downward escalator area, and platform waiting area. The system connects video acquisition equipment, passage counting equipment, wireless probe equipment, and scene management interface in the above-mentioned area to form a unified multi-source heterogeneous sensing dataset.
[0064] First, video sensing data is collected. Top-mounted or side-mounted cameras are deployed in the entrance area, security checkpoint area, turnstile area, station hall distribution area, transfer corridor area, escalator entrance, and platform area. Each camera continuously collects surveillance video at a frequency of 25 frames / second or 15 frames / second. The system performs pedestrian detection, cross-frame tracking, and trajectory association processing on the collected video streams to obtain the image coordinates, trajectory segments, movement directions, movement speeds, and population statistics of pedestrians in the area at each time point. Furthermore, based on the camera calibration parameters and scene reference points, the positions of people in the image coordinates are mapped to a unified scene plane coordinate system within the station to generate video-derived data such as area population, density heatmaps, average speed, and trajectory direction distribution.
[0065] Secondly, traffic counting data is collected. The turnstile control system is integrated into the turnstile area to obtain the number of people entering and exiting each turnstile, the release timestamp, and the instantaneous throughput rate. Security screening machines and queue management equipment are integrated into the security checkpoint area to obtain the number of people queuing at security checkpoints, average passage time, and congestion level. Access control or ticketing equipment is integrated into some key entrances and exits to obtain the direction of passage, the number of people passing through, and records of abnormal congestion. All of the above data includes equipment numbers and collection timestamps to characterize the pedestrian flow capacity and real-time load status of key bottleneck channels.
[0066] Next, wireless dwell and migration data is collected. Anonymous WiFi / Bluetooth probe devices are deployed in the entrance area, concourse area, transfer corridor area, escalator area, and platform area to anonymously collect broadcast signals from mobile terminals within these areas, obtaining the number of devices in each area, average dwell time, and migration counts between adjacent areas. To protect privacy, this embodiment only retains the statistical results after anonymization and desensitization processing, and does not retain the original terminal identifiers that can identify individuals. For scenarios with higher accuracy requirements, UWB positioning base stations can also be connected to further obtain more detailed dwell and migration statistics in key areas.
[0067] Finally, scenario context data is collected. Weather information, time period information, day of the week information, holiday markers, train arrival and departure times, temporary control status, equipment start / stop status, and information on sudden events or large passenger flow incidents are obtained through the station management platform, environmental monitoring interface, and operation scheduling interface. For example, when there are temporary flow restrictions, escalator shutdowns, train delays, or large event dissipation at a certain time, the system writes the corresponding events into the context data in a structured, tagged form.
[0068] After completing the multi-source data acquisition, the system performs time synchronization processing. Specifically, a preset sampling period is used as a unified time reference; in this embodiment, the sampling period is set to 5 seconds. For video perception data, the number of people, average speed, and direction distribution in the area are counted in 5-second windows; for turnstile, security check, and access control data, the number of people passing through and the average passage time are accumulated in 5-second windows; for wireless dwell migration data, the number of dwellers and the number of cross-region migrations are counted in 5-second windows; for scene context data, the corresponding time window is assigned a value according to the event's effective interval. If there is a deviation in the original time of each device, it is corrected based on the central server clock, and missing windows are uniformly processed using methods such as preserving previous values, interpolating neighboring windows, or filling missing flag bits.
[0069] After time synchronization, the system performs spatial mapping processing. Specifically, a unified scene plane coordinate system is established within the station based on building floor plans, BIM models, or electronic maps, and the boundaries of the entrance area, turnstile area, escalator area, corridor area, concourse area, and platform area are pre-marked. For video trajectory points, homography transformation is used to map them to the unified plane coordinates; for turnstiles, security inspection equipment, and wireless probe equipment, they are bound to the corresponding functional areas according to their installation location and coverage area; for cross-area migration data, inter-area migration records are generated based on the starting area and the target area. After spatial mapping, data from different sources can be unified to a unified area node or inter-area connection relationship.
[0070] Through the above processing, a raw monitoring dataset under a unified time benchmark is formed. The raw monitoring dataset includes at least: timestamp, area number, equipment number, number of people in the area, density heat value, average speed, movement direction distribution, number of people entering and exiting the turnstile, number of people queuing for security checks, number of people staying, stay duration, cross-regional migration count, and context fields such as weather, time period, holidays, train arrivals and departures, temporary control, and equipment status. This provides a data foundation for subsequent construction of the area-channel directed topology graph, generation of node-edge joint spatiotemporal state tensors, and baseline traffic prediction and residual modeling.
[0071] S2. Based on the building floor plan, BIM model, CAD drawings or electronic map, divide the entrance area, turnstile area, escalator area, corridor area, station hall area, waiting area and distribution area into area nodes. Define the connection between nodes with passable boundaries and satisfying the one-step reachability relationship as directed passage edges, and construct the area-passage directed topology graph.
[0072] In some embodiments, after completing the multi-source heterogeneous sensing data acquisition, time synchronization and spatial mapping described in S1, the system further divides the target public area into functional zones based on the building plan, BIM model, CAD drawings and electronic map of the subway transfer station, and constructs a region-channel directed topology map to represent the accessibility relationship, traffic direction relationship and bottleneck constraint relationship between different functional areas.
[0073] First, the system reads spatial outline information, passageway boundary information, stair and escalator locations, turnstile layout, security checkpoint locations, and functional area usage labels from the station's building floor plan and BIM model. Then, in conjunction with station management rules, it functionally partitions the target public areas. In this embodiment, as... Figure 2 As shown, the public area is divided into four zones: A (Entrance Area), B (Security Check Area), C (Turret Gate Area), D (Station Hall Gathering Area), E (Transfer Corridor Area), F (Upward Escalator Area), G (Downward Escalator Area), and H (Platform Waiting Area). Each functional area corresponds to a zone node. For areas that are too large or have significant differences in internal flow, they can be further subdivided into multiple sub-zone nodes. For example, the station hall gathering area can be divided into a left-side gathering sub-zone, a central buffer sub-zone, and a right-side gathering sub-zone based on its relative position to the turnstile area, escalator area, and transfer corridor area, to improve the accuracy of subsequent modeling.
[0074] Subsequently, the system determines whether a connection relationship is established between nodes based on whether there are actual passable boundaries between functional areas. A "passable boundary" refers to a boundary between two functional areas where personnel can directly pass through, such as doorways, turnstiles, corridor openings, stairwells, escalator entrances, or continuous ground transitions, rather than merely adjacent boundaries on drawings that are blocked by walls, fences, glass partitions, or equipment areas. A "one-step reachability relationship" means that, under the current scenario rules, personnel can directly enter another target area from one area node without traversing a third intermediate area. For example, if entrance area A leads directly to security checkpoint B, then entrance area A and security checkpoint B satisfy a one-step reachability relationship; however, if reaching the concourse distribution area D from entrance area A requires passing through security checkpoint B and turnstile area C, then entrance area A and concourse distribution area D do not satisfy a one-step reachability relationship and are not directly connected.
[0075] After determining the connection relationships, the system defines the connections between nodes that satisfy the passable boundary and the one-step reachability as directed channel edges. If only one-way flow is allowed between two areas, such as when temporary flow control is implemented within the station, only entry from the station hall to the turnstiles is allowed and reverse flow is not permitted, then only one-way directed edges are established; if two-way flow is allowed between two areas, then two directed channel edges with opposite directions are established respectively. For example, in this embodiment, the system establishes the following directed channel edges: A entrance area → B security check area, B security check area → C turnstile area, C turnstile area → D station hall distribution area, D station hall distribution area → E transfer corridor area, D station hall distribution area → F upward escalator area, H platform waiting area → G downward escalator area, G downward escalator area → D station hall distribution area; for corridor areas and station hall distribution areas that allow two-way transfers, two directed channel edges, D→E and E→D, are established simultaneously. If the escalator only travels upwards during a certain period, only the D→F edge is retained, and the F→D edge is not established; if the escalator changes to bidirectional traffic during a special period, the reverse edge is dynamically added according to the equipment status.
[0076] Furthermore, the system configures channel attributes for each directed passageway. These attributes include, but are not limited to: passageway width, passageway length, permitted passage direction, maximum design capacity, slope or elevation difference, whether it passes through a turnstile or security checkpoint, facility opening / closing status, passageway impedance coefficient, and current temporary control markers. The passageway width can be directly extracted from CAD drawings or BIM models; the passageway length can be calculated from the shortest actual walking distance between the center points of the area boundaries; the maximum capacity can be determined based on design specifications, passageway width, and historical peak passage data; the facility opening / closing status is provided in real-time by the turnstile control system, escalator control system, and station management system; and the passageway impedance coefficient comprehensively reflects the passageway's tortuosity, slope, obstacle distribution, and the degree of reverse passage restriction. For example, the passageway connecting the D station hall distribution area and the F upward escalator area, in addition to its associated width and length, also has the attributes of "one-way upward passage" and "elevation difference constraint"; the passageway connecting the B security checkpoint area and the C turnstile area has the attributes of "queue buffer length" and "turntile group throughput capacity".
[0077] After constructing the nodes and directed channel edges, the system generates a region-channel directed topology graph. This topology graph can be jointly represented by a node set, an edge set, and an edge attribute table. The node set records the functional area number, area name, area area, area type, maximum capacity, and area boundary; the edge set records the starting node number, target node number, edge type, direction attribute, edge length, and edge width; the edge attribute table records channel capacity, facility status, impedance coefficient, and temporary control status. Furthermore, the system can generate corresponding adjacency matrices and edge weight matrices for subsequent spatial propagation modeling. The adjacency matrix indicates whether a direct passage relationship exists between any two nodes, while the edge weight matrix characterizes the passage efficiency and propagation influence intensity between different channel edges. For example, a narrow, long channel edge constrained by security checks or turnstiles has a higher impedance coefficient and lower passage efficiency; a wide channel edge without significant obstacles and allowing bidirectional passage has a lower impedance coefficient and higher weight.
[0078] Furthermore, in this embodiment, the region-channel directed topology is not fixed but supports dynamic updates. When the station management system detects temporary closures, escalator shutdowns, one-way flow restrictions, fence installations, or changes in emergency evacuation strategies, the system modifies the direction attributes, edge weights, and open / closed states of the directed channel edges in real time according to the new traffic rules. For example, during peak evening passenger flow control, if an escalator is changed from bidirectional to down-only, the system deletes the up-direction edge and retains only the down-direction edge; if an entrance is temporarily closed due to construction, the system marks the directed channel edge between the corresponding entrance node and its adjacent nodes as invalid. In this way, the constructed region-channel directed topology can reflect the current real-time traffic structure of the public area, providing an accurate spatial structural foundation for subsequent node-edge joint spatiotemporal state tensor generation, baseline traffic prediction, and residual propagation modeling. Through the above implementation methods, the original spatial structure, traffic rules, and facility constraints can be transformed into a computable and updatable directed topology graph of regions and channels. This enables subsequent models to not only identify which areas the crowds gather in, but also to identify which channels the risks will spread to which areas, thereby improving the spatial precision and engineering applicability of public safety crowd flow early warning.
[0079] In some embodiments, taking a transfer station as an example, the system defines the entrance area (A), security check area (B), turnstile area (C), concourse distribution area (D), transfer corridor area (E), upward escalator area (F), downward escalator area (G), and platform waiting area (H) as nodes N1 to N8, respectively; and establishes directed edges E12, E23, E34, E45, E54, E46, E73, and E78, where E46 represents the upward channel from the concourse distribution area to the upward escalator area, and E54 represents the reverse return channel from the transfer corridor area to the concourse distribution area. If the upward escalator is out of service during a certain period, the edge status of E46 is changed from "valid" to "closed"; if unidirectional flow is implemented in the transfer corridor during the evening peak, only E45 is retained, and E54 is deleted. This results in a directed topology graph of regions and channels that can dynamically change with equipment status and control strategies.
[0080] S3. Extract the number of people, density, inflow, outflow, average speed, dwell time, directional entropy, queue length, and the throughput, passage time, saturation, and reverse conflict coefficient of each node to generate a node-edge joint spatiotemporal state tensor.
[0081] In some embodiments, after completing the acquisition of multi-source heterogeneous sensing data, time synchronization and spatial mapping, and the construction of regional-channel directed topology graphs, the system further extracts features from each regional node and each directed channel edge according to a unified sampling period, and generates a node-edge joint spatiotemporal state tensor as input data for subsequent baseline flow prediction and residual modeling.
[0082] In some embodiments, a subway transfer station is used as an example for illustration. The target public areas of this transfer station include the entrance area, security check area, turnstile area, concourse gathering area, transfer corridor area, upward escalator area, downward escalator area, and platform waiting area. The system treats these areas as area nodes and defines the connection relationships between adjacent areas that meet the passage conditions as directed passage edges. The system uniformly uses a 5-second sampling period and uses the data from the most recent 12 sampling periods as a time-series window for state modeling.
[0083] First, node features are extracted for each region node. For any given node, the system counts the real-time number of people within its range during the current sampling period. The number of people is primarily counted based on pedestrian detection and tracking results from the video perception data, i.e., the number of targets currently within the node's boundary. When the video has partial occlusion, blind spots, or short-term loss of view, the system further refines the count by incorporating wireless dwell migration data or traffic counting data to improve the stability of the people count.
[0084] After obtaining the number of people at each node, the system further calculates the density of that node. Density represents the number of people per unit area. Specifically, it compares the current number of people at a node with the actual area corresponding to that node in the building floor plan or BIM model, thus determining the level of crowding in that area. For regular areas, the area can be directly referenced from the drawings; for irregular areas, area parameters can be pre-configured based on the node boundary range.
[0085] For inflow and outflow, the system analyzes the cross-zone movement of people's trajectories between adjacent nodes to generate statistics. If a person's trajectory enters the target node from another node within the current sampling period, it is counted as inflow to that target node; if a person's trajectory leaves the target node and enters another node within the current sampling period, it is counted as outflow to that target node. For key nodes such as turnstile areas, security checkpoints, and ticket checking areas, the system can also supplement and correct by combining the number of people passing through the turnstiles, security checkpoints, or access control devices to reduce errors caused by relying solely on video statistics.
[0086] For average speed, the system statistically analyzes the trajectories of all valid individuals located at that node within the current sampling period. Specifically, it first obtains the displacement distance and corresponding time of each individual within the current sampling period, then calculates the movement speed of each individual, and finally takes the average value as the average speed characteristic of that node. If the overall movement of people in a certain area is slow or frequently pauses, the average speed is low; if the flow of people in the area is smooth, the average speed is high.
[0087] For dwell time, the system calculates it based on the timestamps of pedestrians entering and leaving the node. For those still within the node, their current dwell time is accumulated; for those who have left the node, their total dwell time is calculated. The system can use average dwell time, median dwell time, or weighted dwell time as the dwell characteristic of the node within the current sampling period. For station halls, waiting areas, and queuing areas, this characteristic can effectively reflect the degree of pedestrian congestion.
[0088] For directional entropy, the system first statistically analyzes the distribution of movement directions of individuals within the current sampling period. Specifically, directions can be divided into multiple preset directional intervals, such as forward, backward, left, right, and several diagonal intervals, and then the proportion of individuals within each interval is calculated. When individuals in an area mainly move in the same direction, the directional distribution is relatively concentrated, and the directional entropy is low; when there is multi-directional cross-flow within an area, the directional distribution is relatively dispersed, and the directional entropy is high. This feature can be used to reflect the degree of pedestrian mixing and order in corridor areas, station hall areas, and transfer areas.
[0089] Regarding queue length, the system primarily extracts data from turnstile areas, security checkpoints, ticket checking areas, and other areas with significant service bottlenecks. Specifically, the system identifies continuous areas of low-speed targets, determines the positions of the front and back of the queue, and estimates the queue length based on the planar distance between them. For locations with queue management equipment, the queue length or number of people data output by the relevant equipment can also be directly used. A longer queue length indicates higher service pressure at that node and a greater risk of localized congestion.
[0090] After extracting the node features mentioned above, the system generates a set of node status records for each regional node. These node status records include at least the node number, sampling time, number of people, density, inflow, outflow, average speed, dwell time, directional entropy, and queue length.
[0091] Secondly, edge features are extracted for each directed channel edge. For any directed channel edge, the system first counts the passage volume. The passage volume represents the number of people entering the target node from the starting node along the directed edge within the current sampling period. This statistical process is mainly based on cross-node trajectory traversal events, and can also be verified and corrected by combining turnstile records, access control records, or channel counter records.
[0092] Regarding transit time, the system records the time taken for each person from entering the starting boundary of the directed channel to reaching the target node boundary. It also summarizes and statistically analyzes the transit times of all persons passing through the channel within the current sampling period to obtain the average transit time. A longer transit time generally indicates lower channel efficiency, potentially indicating congestion, slowdown, or interference.
[0093] The saturation level is determined by the system based on the relationship between the current actual traffic load of a directed channel edge and its designed maximum traffic capacity. Specifically, the traffic volume or traffic rate per unit time in the current sampling period can be compared with the maximum carrying capacity set in the building design parameters, historical operating data, or management rules to obtain the saturation level of the channel. If the saturation level of a channel edge remains high, it indicates that the edge is approaching a bottleneck state, and subsequent congestion spread is highly likely.
[0094] For the reverse conflict coefficient, the system focuses on calculating physical passageways such as two-way corridors, staircases, and transfer corridors. Specifically, the system statistically analyzes the scale of pedestrian flow in both directions, the frequency of trajectory intersections, the proportion of head-on encounters, and the characteristics of mutual avoidance behavior within the physical passageway to obtain the degree of reverse conflict. When there are many people in both directions simultaneously in a passageway, and the intersection interference is significant, the reverse conflict coefficient is high; when the passageway has almost unidirectional flow or relatively orderly bidirectional flow, the reverse conflict coefficient is low. If a passageway is strictly limited to unidirectional passage, this feature can be set to zero or a default low value.
[0095] After extracting the aforementioned edge features, the system generates a set of edge state records for each directed channel edge. These edge state records include at least the edge number, starting node number, target node number, sampling time, throughput, passage duration, saturation, and reverse conflict coefficient. After obtaining the node and edge state records, the system begins generating a node-edge joint spatiotemporal state tensor. Specifically, the system first arranges the state records of all nodes within the current sampling period according to their node numbers, forming the node state set for the current moment; then, it arranges the state records of all edges within the current sampling period according to their edge numbers, forming the edge state set for the current moment. Simultaneously, the system also incorporates the corresponding scene context information within the current sampling period, including time period category, weekday category, holiday markers, weather status, activity status, and temporary control status.
[0096] Subsequently, the system stacks and organizes the node state sets, edge state sets, and context information from the most recent consecutive sampling periods in chronological order to form a node-edge joint spatiotemporal state tensor. In other words, this tensor not only preserves the state of each region and each channel at a certain moment, but also preserves the dynamic changes of these states over consecutive sampling periods, thus simultaneously reflecting both "state changes within a region" and "state changes propagating between channels".
[0097] To facilitate subsequent model training and inference, the system can preprocess various features before tensor generation. For continuous numerical features such as number of people, traffic volume, queue length, and passage time, normalization or standardization can be performed; for discrete features such as time period, weather, holidays, and activity status, encoding can be performed; for missing data items, methods such as preserving previous values, nearest neighbor interpolation, or supplementing with missing markers can be used to ensure the integrity of the tensor structure and consistency of temporal alignment.
[0098] For example, if, during a certain sampling period, the station concourse gathering area is found to have 186 people, high density, 42 inflows, 37 outflows, low average speed, long dwell time, and dispersed directional distribution with significant queuing, then the state record of this node during that sampling period will fully reflect its congestion and mixed traffic status. Conversely, if the directed passageway from the station concourse gathering area to the transfer corridor shows high throughput, longer transit time, increased saturation, and some reverse conflicts, it indicates that the passageway is approaching a congestion bottleneck. After continuously collecting similar states over multiple sampling periods, the system can form a complete node-edge joint spatiotemporal state tensor, which can be used by subsequent baseline traffic prediction models and residual learning models.
[0099] Through the above implementation methods, the system can uniformly represent the changes in the state of people in each functional area of the public area and the propagation state of the channels between areas as structured and time-series input data. It can not only describe whether a certain area is currently crowded, but also describe how the flow of people is transmitted between areas, which channels are approaching bottlenecks, and which areas have lingering accumulation and directional conflicts. This provides a more complete, detailed and reliable data foundation for subsequent trend prediction, residual analysis and risk warning.
[0100] S4. Baseline flow prediction results are obtained based on trend cycle decomposition and neural controlled differential equations;
[0101] In this embodiment, after completing the acquisition of multi-source heterogeneous sensing data, time synchronization and spatial mapping, construction of region-channel directed topology graphs, and generation of node-edge joint spatiotemporal state tensors, the system further performs trend periodic decomposition on the node-edge joint spatiotemporal state tensors and establishes a baseline traffic prediction model by combining neural controlled differential equations. This model outputs the baseline traffic prediction results for each region node and each directed channel edge within the future prediction window. The baseline traffic prediction results are used to characterize the natural evolution trend of crowd traffic under the current scenario conditions without significant abnormal disturbances, thereby providing a reference benchmark for subsequent residual sequence construction and abnormal risk identification.
[0102] This embodiment still uses a subway transfer station as an example for illustration. The system uses the most recent 12 consecutive sampling periods as the input time window, with each sampling period being 5 seconds, to perform baseline prediction of the crowd flow status for the next 6 consecutive sampling periods. The input data includes a node-edge joint spatiotemporal state tensor and synchronized scene context information, which includes time period category, weekday category, holiday status, weather status, activity status, train arrival and departure rhythm, temporary control status, and facility start / stop status, etc.
[0103] First, the system performs trend-periodic decomposition on the input node-edge joint spatiotemporal state tensor. Trend-periodic decomposition refers to breaking down the historical state changes of nodes and edges into a relatively stable long-term trend component, a periodic component reflecting cyclical fluctuations, and a context-modulated component reflecting prior external disturbances. For the long-term trend component, the system mainly focuses on the slow changes in features such as the number of people in a region, region density, passageway traffic volume, queue length, and passageway saturation over multiple consecutive sampling periods. For example, the continuous increase in the number of people in a station hall area after the start of the morning rush hour, or the gradual increase in traffic volume in a transfer corridor as trains arrive consecutively, all belong to long-term trend information. For the periodic component, the system mainly identifies recurring change patterns related to time regularity, such as weekday morning and evening rush hour cycles, passenger flow fluctuations caused by train intervals, and periodic clearing patterns before and after shopping mall closures. For the context-modulated component, the system transforms external factors such as weather, holidays, event closing, train delays, escalator shutdowns, and temporary flow control into corrective priors for the trend and periodic results, used to characterize the background changes of the current scenario relative to the normal state.
[0104] During the trend cycle decomposition process, the system does not treat all nodes and edges as completely homogeneous time series. Instead, it performs hierarchical processing based on the regional and channel attributes of each node and edge. For large area nodes such as entrance areas, concourse areas, and waiting areas, the system pays more attention to the changes in number of people, density, dwell time, and directional entropy over time. For bottleneck area nodes such as turnstile areas, security checkpoints, and escalator areas, the system pays more attention to the evolution of queue length, average speed, and inflow-outflow difference. For directed channel edges, the system focuses on the changes in throughput, passage time, saturation, and reverse conflict coefficient within the historical window. This hierarchical processing method avoids mutual interference between different types of features within the same decomposition framework, improving the targeting of subsequent baseline modeling.
[0105] After completing the trend cycle decomposition, the system inputs the obtained long-term trend information, periodic fluctuation information, and context modulation information into the neural controlled differential equation model. The core function of the neural controlled differential equation model is to model the evolution trajectory of multi-source heterogeneous data over continuous time, which is particularly suitable for handling scenarios with inconsistent sampling frequencies, irregular data arrival times, and missing or abrupt changes in local time windows. In this embodiment, although the system ultimately unifies to a 5-second sampling cycle, data from different sources still have different update rhythms at the original level. For example, video streams arrive frame by frame, gate records arrive by event, WiFi dwell migration data arrives by scan cycle, and scene context data is updated by event triggers. Therefore, directly using ordinary discrete-time prediction methods can easily lose the change information of various types of data over continuous time. The neural controlled differential equation model can treat these asynchronous observations as a gradual driving force for the continuous potential state trajectory, thus more naturally describing the continuous evolution process of crowd flow in real-world scenarios.
[0106] Specifically, the system first constructs continuous-time input paths for each node and edge based on the results of trend period decomposition. For continuously changing features such as number of people, density, inflow, outflow, traffic volume, and saturation, the system forms smooth input trajectories in chronological order. For discrete contextual features such as holidays, activity status, temporary flow control, and equipment start / stop status, the system embeds them into the continuous input path using piecewise constants or state switching. Subsequently, the neural controlled differential equation model maintains a potential state representation describing the overall operating state of the current region-channel within each sampling window and continuously updates this potential state based on the input path. Because this update method does not simply differ between adjacent moments but continuously tracks state evolution along the time axis, it can better preserve the mutual influence relationships between different data sources. For example, when a train enters the station, it first causes an increase in the number of people in the platform waiting area, then an increase in the traffic volume in the downstairs escalator area, and subsequently causes fluctuations in the number of people in the concourse gathering area. This type of dynamic process with temporal transmission characteristics can be well represented in this model.
[0107] To enhance the model's adaptability to different areas and passageways, the system can also introduce area type labels and passageway type labels at the input of the neural controlled differential equation model. For example, different category codes can be assigned to the entrance area, station hall area, waiting area, escalator area, and transfer corridor area, and different edge type codes can be assigned to the turnstile edge, escalator edge, corridor edge, and security check edge. In this way, when learning the continuous-time evolution trajectory, the model not only considers historical numerical changes but can also learn the evolution patterns of the pedestrian flow baseline under different scenarios by combining the functional attributes of the area and passageway.
[0108] During the model training phase, the system uses historical operational data as samples for supervised learning. Specifically, it takes the node-edge joint spatiotemporal state tensor and corresponding contextual information from multiple consecutive sampling periods over a past period as input, and the actual observed node and edge states from several future sampling periods as the target output, enabling the model to gradually learn the normal variation patterns of crowd flow under different scenario conditions. During training, the system focuses on constraining the baseline prediction results' ability to fit key features such as regional population, regional density, inflow, outflow, channel throughput, and channel saturation. Furthermore, it improves the model's generalization ability to various operational conditions by performing mixed training on weekdays, holidays, days with high passenger flow, and days with abnormal equipment status.
[0109] During the model inference phase, the system receives the latest node-edge joint spatiotemporal state tensor and scene context information. It first performs trend period decomposition, then uses a neural controlled differential equation model to extrapolate the state along a continuous time trajectory, outputting baseline flow prediction results for each region node and each directed channel edge within the future prediction window. These baseline flow prediction results can include predicted number of people, predicted density, predicted inflow, predicted outflow, predicted average speed, predicted dwell time, predicted queue length, predicted throughput, predicted passage time, and predicted saturation for several future sampling periods. Since this result primarily describes the natural changing trend of pedestrian flow under normal conditions, it essentially constitutes a "normal reference trajectory." The system then compares the actual observations with this baseline prediction result to identify abnormal residuals that deviate from the normal trajectory.
[0110] For example, during the evening rush hour on a weekday, the system inputs the node-edge joint spatiotemporal state tensor of the station concourse, transfer corridor, upward escalator area, downward escalator area, and platform waiting area over the past 60 seconds, combined with contextual information such as an approaching train, rainy weather, and current peak flow control. After trend periodic decomposition, the system identifies a periodic pattern in the platform waiting area where the number of passengers fluctuates with train intervals, a trend of continuous growth in the station concourse during the evening rush hour, and a rise in the overall passenger baseline at the entrance and turnstile areas due to rainfall. Subsequently, a neural controlled differential equation model, incorporating this information, predicts that the traffic volume in the downward escalator area will continue to increase in the next 30 seconds, the number of passengers in the station concourse will increase briefly, and the saturation of the transfer corridor area will approach the warning threshold but not yet significantly exceed the limit. This prediction result serves as the baseline flow prediction result, used for comparison with subsequent actual observations.
[0111] Through the above implementation methods, the system can construct a relatively stable baseline traffic reference result with context-aware capabilities without directly mixing short-term abnormal fluctuations into the long-term prediction target. The advantages of this approach are twofold: firstly, it can fully utilize trend cycle decomposition to extract normal, regular changes, avoiding misjudging predictable changes such as weekday peak hours and train arrival fluctuations as abnormalities; secondly, it can use neurally controlled differential equations to model asynchronous, multi-source, and continuous-time evolution processes, improving the adaptability and stability of the baseline prediction results to complex public scenarios. The resulting baseline traffic prediction result can effectively reflect the expected state of the target public area under the natural evolution of crowd flow, providing a reliable foundation for subsequent residual sequence construction, abnormal disturbance identification, and risk warning.
[0112] S5. Construct a residual sequence based on the observed values and baseline predicted values, and obtain the residual correction representation based on fractional-gated temporal convolution and hypergraph attention propagation;
[0113] In this embodiment, after completing the acquisition of multi-source heterogeneous sensing data, time synchronization and spatial mapping, construction of region-channel directed topology graphs, generation of node-edge joint spatiotemporal state tensors, and obtaining baseline flow prediction results based on trend periodic decomposition and neural controlled differential equations, the system further constructs a residual sequence based on the current actual observation state and the corresponding baseline flow prediction results. It then uses fractional-gated temporal convolution and hypergraph attention propagation to jointly model this residual sequence, obtaining a residual correction representation for a future prediction window. This residual correction representation characterizes the abnormal deviation of the target public area from its normal evolutionary trajectory, thus providing a basis for subsequent population state correction prediction and risk warning.
[0114] This embodiment still uses a subway transfer station as an example for illustration. The system simultaneously acquires two types of data in each sampling period: one is the actual observation status directly extracted from on-site monitoring data, and the other is the baseline flow prediction result output in step S4. The actual observation status includes the number of people, density, inflow, outflow, average speed, dwell time, directional entropy, and queue length of each area node in the current sampling period, as well as the throughput, passage time, saturation, and reverse conflict coefficient of each directed channel edge; the baseline flow prediction result represents the expected changes in these node and edge characteristics under the current scenario conditions, without significant abnormal disturbances.
[0115] First, the system constructs a residual sequence. Specifically, the system compares the actual observed state with the baseline traffic prediction results according to the node number and edge number, extracts the degree of deviation between the two, and forms a residual state record for the current sampling period. If the actual number of people at a node in a certain area is significantly higher than the baseline predicted number, it indicates that there is an unusual accumulation of people in that area; if the actual average speed at a node in a certain area is significantly lower than the baseline predicted speed, it indicates that there may be abnormal deceleration or a precursor to congestion in that area; if the actual passage time of a directed channel edge is significantly higher than the baseline predicted passage time, it indicates that the passage efficiency of that channel is decreasing; if the reverse conflict coefficient of a certain edge is significantly higher than the baseline predicted value, it indicates that the bidirectional flow conflict in that channel is intensifying. The system organizes these deviation information at the node level and the deviation information at the edge level into the residual state at the current moment, and stacks the residual states from the most recent consecutive sampling periods in chronological order to form a residual sequence.
[0116] When constructing the residual sequence, the system retains not only the magnitude of the deviation but also its direction. In other words, the system can distinguish between positive deviations "above the baseline" and negative deviations "below the baseline." For example, positive deviations in numbers, density, dwell time, queue length, passage time, and saturation generally indicate increased risk, while negative deviations in average speed may also correspond to increased risk. Therefore, when generating the residual sequence, the system uniformly encodes the deviation directions of different features, enabling the subsequent residual learning model to correctly understand which deviations represent abnormal increases, which represent abnormal decreases, and how different deviations contribute to risk evolution.
[0117] After obtaining the residual sequence, the system first uses fractional-gated temporal convolution to model the residual sequence in the time dimension. Fractional-gated temporal convolution differs from conventional temporal convolution in that it focuses not only on extracting local fluctuations between adjacent sampling periods, but also on enhancing the ability to characterize long-term memory and gradual accumulation effects. In public safety crowd flow scenarios, many risks are not instantaneous, but rather undergo a gradual process of "local deceleration—short-term stagnation—continuous accumulation—queue lengthening—channel saturation." Using only ordinary convolution or ordinary moving average methods can easily confuse this slow accumulation process with ordinary fluctuations. Fractional-gated temporal convolution, by introducing a temporal convolution mechanism with memory decay characteristics, ensures that abnormal signs from earlier times are not completely ignored, while automatically adjusting the degree of residual information retention at different time scales through the gating mechanism.
[0118] Specifically, the system inputs the node residual sequence and the edge residual sequence into a fractional-gated temporal convolutional unit, respectively. For the node residual sequence, the model focuses on the cumulative trends over continuous time of changes such as abnormal growth in the number of people in a region, abnormal increase in density, abnormal decrease in average speed, abnormal lengthening of dwell time, and abnormal increase in queue length. For the edge residual sequence, the model focuses on the evolution over continuous time of changes such as abnormal increase in traffic volume, abnormal increase in transit time, abnormal increase in saturation, and abnormal enhancement of reverse conflict. The gating structure automatically determines which historical residuals should be retained and which short-term disturbances should be weakened based on the persistence, stability, and suddenness of residual changes. For example, if the residual of the number of people in a station hall distribution area is continuously positive for several consecutive sampling periods, and the queue length residual increases synchronously, the gating structure will increase the weight of this trend in the time dimension; if a corridor area only experiences a slight speed fluctuation in a single sampling period but recovers quickly, the gating structure will reduce the impact of this short-term residual.
[0119] After completing the temporal dimension modeling, the system further utilizes hypergraph attention propagation to perform spatial propagation modeling of the residual sequence. Unlike ordinary graph propagation, which only describes the relationship between two adjacent nodes, hypergraph attention propagation can simultaneously model the many-to-many coupling relationships between multiple region nodes and multiple directed channel edges. This is particularly important for scenarios in public areas where "multiple regions share the same bottleneck facility" or "multiple channels jointly serve the same distribution area." In this embodiment, the system pre-constructs multiple hyperedges based on the region-channel directed topology graph and the constraints of facilities within the station. Each hyperedge connects not only two objects but also a group of region nodes and directed channel edges that share the same physical facility, the same evacuation main path, or the same bottleneck constraint.
[0120] For example, in a subway transfer station, the concourse gathering area, the upward escalator area, the downward escalator area, and the adjacent passageways between the concourse and escalator can collectively form an "escalator service hyperedge"; the security check area, the turnstile area, and their adjacent passageways can collectively form an "entry bottleneck hyperedge"; and the transfer corridor area, the concourse gathering area, the platform waiting area, and their connecting edges can collectively form a "transfer propagation hyperedge". When a significant residual anomaly occurs at a node or passageway within a hyperedge, the system not only analyzes the changes in that object itself but also uses a hypergraph attention mechanism to determine whether the anomaly is propagating to other areas or passageways within the same hyperedge, and the contribution of different objects to the overall risk propagation.
[0121] During the hypergraph attention propagation process, the system assigns different attention weights to different objects based on the current residual strength, historical persistence, load status, channel impedance, and facility attributes of each node and edge within the hyperedge. If a channel edge is close to saturation and its residual remains positive, the system will assign it a higher propagation weight; if a region experiences fluctuations in the number of people but surrounding channels are unobstructed and the dwell time is normal, its weight in the overall risk propagation is lower. In this way, the system can more precisely identify "where the anomaly is most likely to amplify," "which areas it will preferentially spread to," and "which bottleneck facilities are becoming the core of risk propagation."
[0122] After performing fractional-order gated temporal convolution and hypergraph attention propagation, the system obtains two types of intermediate results: one is temporal residual features describing how residuals accumulate, amplify, or decay over time; the other is spatial residual features describing how residuals propagate across regions under shared facilities, shared paths, and shared bottleneck constraints. Subsequently, the system fuses these two types of features to form a corrected residual representation. In this embodiment, a capacity-aware asymmetric gating activation mechanism can be further employed during fusion to make the fusion result more consistent with the risk characteristics in public safety scenarios. Specifically, when a node in a region or a directed channel edge is under high load and its residual is a positive overload residual, the system enhances this residual feature; when an object has a slight negative deviation but does not cause significant risk, the system suppresses this residual feature. Through this asymmetric processing method, the system can avoid equating general fluctuations with abnormal risks while highlighting key residual signals under critical saturation or overload conditions.
[0123] After obtaining the residual correction representation, the system outputs it to the subsequent state correction prediction module. This residual correction representation is not a simple single error value, but a structured result that comprehensively characterizes the future abnormal deviation trend. It includes which areas have a persistent overload tendency, which channels have a persistent efficiency decline tendency, which shared facilities are causing multi-regional linkage risks, and the possible evolution direction and relative intensity of these abnormal deviations within the future prediction window.
[0124] For example, during the evening rush hour on a weekday, the system, based on baseline traffic predictions, predicted that the number of people in the station concourse should be increasing slowly and the escalator traffic should remain stable. However, actual observations showed that the number of people in the concourse was higher than the baseline for three consecutive sampling periods, the average speed was lower than the baseline, and the queue length continued to increase. Simultaneously, the transit time and saturation at the edge of the escalator passage from the concourse were also significantly higher than the baseline. Based on this, the system generated a residual sequence. Fractional-order gated temporal convolution identified that this anomaly was not a single instantaneous fluctuation, but a continuous, cumulative, and gradual congestion process. Hypergraph attention propagation further identified that the anomaly was related to multiple areas and passages in the escalator service hyperedge, indicating that the risk was spreading from the escalator bottleneck to the station concourse and waiting area. The resulting fused residual correction clearly indicated that the risk deviation between the station concourse and the escalator connection passage would continue to increase in the near future, thus providing a basis for subsequent early warning decisions.
[0125] Through the above implementation methods, the system can extract, amplify, and propagate abnormal deviation information independently outside the normal evolutionary baseline. This ensures that the model neither misjudges regular growth during normal peak periods as risk nor ignores genuine anomalies caused by continuous accumulation, cross-regional transmission, and coupling of shared facilities. Compared to directly predicting the original pedestrian flow status end-to-end, this embodiment first predicts the baseline and then learns the residuals. This not only improves the targeting of anomaly identification but also enhances the model's ability to characterize progressive, transmissive, and bottleneck risks in complex scenarios.
[0126] S6. Based on the baseline traffic prediction results and the residual correction representation, generate the predicted population status values of each regional node and directed channel edge within the future prediction window, and calculate the predicted peak density, density growth rate, cumulative residence index, bottleneck saturation, queuing spillover probability and prediction uncertainty accordingly. Combine the dynamic early warning threshold to output the early warning level, risk area and disposal suggestions.
[0127] In this embodiment, after completing the acquisition of multi-source heterogeneous sensing data, time synchronization and spatial mapping, construction of regional-channel directed topology graphs, generation of node-edge joint spatiotemporal state tensors, baseline traffic prediction, and generation of residual correction representations, the system further generates the predicted values of the population status of each regional node and each directed channel edge within the future prediction window based on the baseline traffic prediction results and residual correction representations. On this basis, risk indicators are calculated, and the warning level, risk area, and handling suggestions are output in combination with dynamic warning thresholds.
[0128] In some embodiments, a subway transfer station is still used as an example for illustration. The system predicts the future for six consecutive sampling periods starting from the current time. Each sampling period is 5 seconds, so the total length of the future prediction window is 30 seconds. The prediction objects include area nodes such as the entrance area, security check area, turnstile area, station hall gathering area, transfer corridor area, upward escalator area, downward escalator area, and platform waiting area, as well as the directed passage edges between the above areas.
[0129] First, the system generates predicted population status values within the future prediction window based on the baseline flow prediction results obtained in step S4 and the residual correction representation obtained in step S5. Specifically, the system processes each regional node and each directed channel edge separately. For regional nodes, the system obtains state values such as predicted number of people, predicted density, predicted inflow, predicted outflow, predicted average speed, predicted dwell time, and predicted queue length for each future sampling period; for directed channel edges, the system obtains state values such as predicted throughput, predicted passage time, predicted saturation, and predicted reverse conflict level for each future sampling period. The predicted values are not simply based on the baseline results, but rather, based on the baseline flow prediction results, a residual correction representation is introduced to correct for possible abnormal increases, abnormal decreases, local accumulation, channel deceleration, and cross-regional propagation effects, so that the final predicted population status values reflect both the normal evolutionary pattern and the abnormal deviation trends that have already occurred.
[0130] For example, if the station concourse area shows positive residuals for the number of people, negative residuals for the average speed, and positive residuals for the queue length for three consecutive sampling periods at the current moment, the system will adjust the predicted number of people and density, and the predicted average speed for that area in the future predictions, while simultaneously adjusting the predicted dwell time and queue length. Similarly, if the directed passageway from the station concourse area to the upward escalator area shows residual characteristics of increased passage time and increased saturation at the current moment, the system will correspondingly increase the predicted passage time and predicted saturation for that passageway in the future prediction window. Thus, the system obtains future crowd state predictions that reflect the "normal trend plus anomaly correction."
[0131] After obtaining the predicted crowd status within the future prediction window, the system further calculates risk indicators. These risk indicators include at least predicted peak density, density growth rate, cumulative dwell time index, bottleneck saturation, queue overflow probability, and prediction uncertainty. Among these, predicted peak density characterizes the highest level of congestion a node in a given area may reach within the future prediction window. The system reads the predicted density values for that area over multiple future sampling periods and selects the maximum value as the predicted peak density for that area. If an area experiences a significant increase in density within a short period in the future, it indicates a risk of rapid congestion in that area. For areas such as station concourses, waiting areas, and transfer corridors, predicted peak density is a crucial indicator for assessing the risk of localized overload.
[0132] The density growth rate characterizes how quickly the density of nodes in a given area changes within a future prediction window. The system compares the magnitude of density changes in the same area across adjacent prediction sampling periods to reflect whether congestion is accelerating. If the current density of an area has not yet reached the maximum threshold, but shows a sustained and rapid upward trend in the next few sampling periods, the system can still consider it a potentially high-risk area and issue an early warning. This indicator is particularly suitable for identifying risk scenarios that have not yet erupted but are rapidly accumulating.
[0133] The cumulative dwell time index is used to characterize the risk of people accumulating in a certain area. The system comprehensively considers the predicted dwell time, predicted number of people, and dwell time duration in the area within a future prediction window to determine whether there is a phenomenon of prolonged stagnation and continuous accumulation of people in the area. If the number of people in a certain area continues to rise and the average dwell time increases simultaneously, it indicates that people cannot be evacuated or pass through in a timely manner, and stagnation-type congestion may be forming. For waiting areas, security checkpoints, and turnstile areas, the cumulative dwell time index can effectively characterize the risk of queue backlog and service bottlenecks.
[0134] Bottleneck saturation characterizes the degree to which the load on a directed passageway approaches or exceeds its design capacity within a future prediction window. The system reads the predicted traffic volume and predicted saturation of the passageway over multiple future sampling periods to determine if it is approaching its design limit. If the predicted saturation of a passageway remains consistently high, it indicates that the passageway has become a critical bottleneck restricting the evacuation and flow of people between areas. For turnstiles, escalators, security checkpoints, and transfer corridors, bottleneck saturation is a core indicator for assessing passageway-level risk.
[0135] Queue overflow probability characterizes whether queues in a queuing area are likely to exceed their preset buffer range and expand into adjacent areas. The system combines the predicted queue length within the future prediction window with the corresponding area's buffer length or queue capacity boundary to determine the possibility of queues exceeding the buffer range in future sampling periods. When the predicted queue length in the turnstile area, security check area, or ticket check area approaches or exceeds its buffer boundary, the system increases the queue overflow probability for that area and further determines whether this overflow will have a cascading effect on adjacent corridor areas, concourse areas, or entrance areas. This indicator helps identify risk scenarios of "local queues spreading to surrounding areas."
[0136] Prediction uncertainty is used to characterize the confidence level of future prediction results. Since future crowd flow changes are affected by various factors such as train arrivals and departures, weather changes, event dispersal, temporary flow control, and equipment status changes, the system simultaneously evaluates the stability of prediction results for each regional node and each directed channel edge when generating future crowd state predictions. Specifically, the system can assign an uncertainty level to future prediction results based on the output differences of multiple prediction branches within the model, the distribution of prediction errors in similar historical scenarios, or the consistency between multiple consecutive rolling predictions. When the prediction results for a certain region fluctuate significantly or exhibit strong uncertainty, the system can indicate the confidence level of the risk assessment for that region when outputting a warning and make corrections in the threshold determination, thereby avoiding false alarms caused by a single unstable prediction.
[0137] After calculating the aforementioned risk indicators, the system further conducts a comprehensive risk assessment. Specifically, for each regional node and each directed passage edge, the system generates corresponding comprehensive risk characterization results by combining indicators such as predicted peak density, density growth rate, cumulative dwell time index, bottleneck saturation, queuing spillover probability, and prediction uncertainty. For regional nodes, the system places greater emphasis on predicted peak density, density growth rate, and cumulative dwell time index; for directed passage edges, the system places greater emphasis on bottleneck saturation, the trend of passage time changes, and queuing spillover risk; for corridors and staircases with obvious bidirectional flow, the prediction results related to reverse conflict can also be referenced simultaneously.
[0138] Subsequently, the system combines dynamic warning thresholds to determine the warning. Unlike traditional fixed threshold methods, the dynamic warning thresholds in this embodiment are not constant across all scenarios, but are adaptively adjusted based on scenario category, time period category, event category, and historical statistical distribution of similar scenarios. For example, during weekday evening rush hours, the baseline number of people and density in the station concourse is already higher than during off-peak hours, so the corresponding density threshold and queuing threshold are increased accordingly. When events end on holidays, the normal fluctuation range in transfer corridors and entrance areas is larger, so the system will adjust the growth rate threshold based on historical event day data. In rainy weather or escalator shutdown scenarios, the system will appropriately lower the allowable threshold for certain key bottleneck channels to improve warning sensitivity. If the prediction uncertainty of a certain area or channel is high, the system can also appropriately increase the threshold required to trigger a high-level warning, or output an intermediate-level warning in the form of "suggested attention" to enhance the robustness of the overall judgment.
[0139] Regarding the classification of early warning levels, this embodiment can adopt a three- or four-level early warning mechanism. For example, it can be set to four levels: Attention Level, Early Warning Level, Severe Level, and Emergency Level. If the predicted peak density of a certain area is close to the preset capacity limit, but the growth rate is not high and the accumulation of queuing is relatively light, it can be determined as Attention Level; if the density of a certain area continues to increase, the accumulation of queuing is obvious, and it is accompanied by an increase in the saturation of bottlenecks on adjacent channels, it can be determined as Early Warning Level; if the predicted peak density of a certain area has obviously exceeded the limit, the probability of queuing spillover is high, and the risk has spread to adjacent nodes, it can be determined as Severe Level; if the system determines that a local area and a key channel will simultaneously enter a high-load state in the near future, and may trigger cross-regional chain congestion, it can be determined as Emergency Level.
[0140] After determining the warning level, the system outputs the risk area. The risk area can be a single node or a continuous risk band composed of multiple adjacent nodes and passageways. For example, the system can identify "station hall assembly area – upward escalator area – escalator connecting passage" as the same high-risk link, or "security check area – turnstile area – station hall area" as the same bottleneck risk link at the entrance. To facilitate understanding and handling by on-site personnel, the system can highlight the risk area on an electronic map, monitoring screen, or digital twin interface, and provide explanations of the main risk sources, such as "rapid accumulation of people," "obvious trend of queue overflow," "continuous increase in escalator passage saturation," and "increased reverse conflict in the corridor."
[0141] Simultaneously, the system outputs response suggestions based on the risk type. If the risk is mainly caused by queuing congestion at the entrance, the response suggestions may include opening more security checkpoints, adjusting the direction of turnstiles, extending buffer queuing areas, or implementing temporary flow control. If the risk is mainly caused by saturation of the connecting passage from the station hall to the escalator, the response suggestions may include adjusting the direction of escalator operation, increasing on-site guidance, dispersing passenger flow to alternative passages, or staggering entry times. If the risk is mainly caused by two-way conflicts in the transfer corridor area, the response suggestions may include implementing one-way flow guidance, setting up temporary isolation zones, optimizing broadcast guidance, or deploying security personnel for on-site guidance. If the risk is mainly concentrated in the platform waiting area, suggestions may include controlling the downward passenger flow, dispersing waiting areas, or coordinating with train dispatching for temporary evacuation arrangements. Thus, the system not only indicates "where the risk is," but also "how the risk may develop" and "what measures should be taken."
[0142] For example, during a certain evening rush hour, the system predicted that the peak density in the station concourse gathering area would continue to rise within the next 30 seconds, with a rapid density growth rate and a significant increase in the cumulative dwell time index. Simultaneously, the bottleneck saturation along the escalator passageway from the station concourse to the escalator was consistently higher than normal, increasing the probability of queue overflow. The prediction uncertainty was low, indicating that the assessment was relatively reliable. Based on this, the system identified the "station concourse gathering area – escalator connection passageway" as a severe risk area and provided station staff with the following recommendations: "limit the flow of people entering the escalator from the station concourse, guide some passengers to use alternative staircases, increase the number of guides at the escalator entrance, and activate temporary one-way traffic flow." If subsequent rolling predictions showed that the risk further spread to the transfer corridor, the system could automatically raise the warning level to a higher level and simultaneously expand the risk area labeling range.
[0143] Through the above implementation methods, the system can unify the "baseline prediction results" and "abnormal residual corrections" into predicted population status values for future prediction windows. Based on this, it comprehensively assesses risks from multiple dimensions, including regional congestion, growth trends, lingering accumulation, channel bottlenecks, queue spillover, and prediction confidence levels, thereby outputting more proactive, targeted, and actionable early warning results. Compared to methods that trigger alarms based solely on a single population threshold at the current moment, this embodiment can more accurately identify potential risks that have not yet fully erupted but have already shown a clear trend of deterioration, and can provide risk area location and handling suggestions that are more consistent with on-site operational logic.
[0144] Preferably, the video perception data consists of personnel location points, trajectory segments, velocity vectors, and area population and density heatmaps obtained after pedestrian detection, cross-frame tracking, and homography mapping of surveillance video; the passage counting data consists of the number of people entering and exiting, passage duration, and queue number output by turnstiles, access control devices, security inspection devices, or ticketing devices; the wireless dwell migration data consists of the number of dwellers, dwell duration, and cross-area migration counts obtained based on WiFi, Bluetooth, or UWB anonymous probes; and the scene context data includes weather, time period, holidays, activity start and end times, train or flight arrival and departure times, temporary control status, and equipment start / stop status.
[0145] Preferably, in the region-channel directed topology graph, each directed channel edge is associated with at least four attributes from the following: channel width, channel length, allowed passage direction, maximum passage capacity, slope or elevation difference, facility opening / closing status, and passage impedance coefficient, and the edge weight is determined based on the attributes.
[0146] Preferably, the node-edge joint spatiotemporal state tensor is formed by stacking the data from the most recent L sampling periods in chronological order, and includes at least node feature tensors, edge feature tensors, and context feature tensors, wherein the context feature tensor includes one or more of time period codes, weekday codes, holiday codes, weather codes, activity status codes, and temporary control status codes.
[0147] Preferably, the baseline flow prediction is achieved through a trend periodic decomposition unit and a node-side neural controlled differential equation unit. The trend periodic decomposition unit is used to decompose the long-term trend component, the periodic fluctuation component, and the event disturbance prior component. The node-side neural controlled differential equation unit is used to model the continuous time trajectory of multi-source observations under different sampling frequencies and irregular time intervals.
[0148] Preferably, the fractional-gated temporal convolution is used to extract the long memory accumulation features of the residuals in the time dimension to characterize the processes of gradual aggregation, slow congestion formation, and short-term explosive traffic growth.
[0149] Preferably, the hypergraph attention propagation is modeled as many-to-many by constructing hyperedges, whereby the hyperedges are used to characterize the coupling relationship between multiple regional nodes or directed channel edges that share the same turnstile group, the same escalator group, the same security check channel group, the same evacuation main path, or the same bottleneck constraint area.
[0150] Preferably, in step S5, a capacity-aware asymmetric gating activation function is used to fuse temporal residual features and spatial residual features. The capacity-aware asymmetric gating activation function uses the load rate of regional nodes or directed channel edges, the reverse conflict index, and the residual sign as gating inputs to enhance positive overload residuals and suppress negative non-risk residuals.
[0151] Preferably, the dynamic early warning threshold is adaptively generated based on the scene category, time period category, event category and historical statistical distribution of similar scenes, and the threshold is corrected based on the prediction uncertainty; the handling suggestions include one or more of the following: flow restriction, one-way passage, opening more evacuation channels, broadcast guidance, security reinforcement and temporary lockdown.
[0152] This application also provides a public safety crowd flow early warning system that integrates spatiotemporal residual learning, preferably deployed in public areas such as subway stations, railway passenger stations, airport terminals, large stadiums, scenic spots, or large commercial complexes. Figure 3 The system includes at least: video sensing hardware, access counting hardware, wireless dwell migration acquisition hardware, scene status acquisition hardware, edge computing hardware, central computing hardware, storage hardware, network transmission hardware, display and alarm hardware, and on-site linkage control hardware. The video sensing hardware includes top-mounted or side-mounted network cameras installed in entrance areas, security checkpoints, turnstile areas, escalator areas, corridor areas, station halls, waiting areas, and distribution areas. These network cameras are used to acquire surveillance video streams and send them to the edge computing hardware. Preferably, the network cameras are connected to the edge computing hardware via PoE switches or industrial Ethernet switches, or they can be connected to a local area network via fiber optic transceivers.
[0153] The access counting hardware includes a gate controller, access control reader / writer, security screening machine counting terminal, ticketing terminal, passenger flow counter, or infrared beam counting device. This hardware is used to output the number of people entering and exiting, passage time, queue length, and channel throughput status. The access counting hardware connects to edge computing hardware or central computing hardware via RS485 bus, CAN bus, Modbus bus, industrial Ethernet, or TCP / IP interface.
[0154] The wireless dwell time and migration data acquisition hardware includes WiFi probes, Bluetooth probes, or UWB positioning base stations; it is used to collect data on the number of dwell times, dwell duration, and cross-regional migration counts within a given area. The wireless dwell time and migration data acquisition hardware is connected to edge computing hardware via wired Ethernet or wireless LAN, and the edge computing hardware performs anonymized statistical processing.
[0155] The scene status acquisition hardware includes environmental sensors, equipment status acquisition terminals, and operation interface terminals. The environmental sensors collect environmental information such as temperature, humidity, rainfall, and visibility. The equipment status acquisition terminals collect information on escalator start / stop status, turnstile opening / closing status, fence activation status, and temporary control status. The operation interface terminal receives information on train arrival / departure times, flight schedules, event start / end times, and holidays. The scene status acquisition hardware connects to the central computing hardware via industrial Ethernet, serial communication interfaces, or API interfaces; alternatively, it can be connected to edge computing hardware first and then uploaded.
[0156] The edge computing hardware includes an edge computing gateway, an edge server, or an industrial computer, and internally includes at least a processor, memory, a network interface, and local cache storage; preferably, it also includes a GPU or NPU acceleration board. The edge computing hardware is used to receive raw data uploaded by cameras, counting devices, wireless probes, and some scene terminals, and performs pedestrian detection, cross-frame tracking, trajectory association, preliminary people counting, time synchronization, spatial mapping, and local feature extraction. The edge computing hardware is connected to the central computing hardware via Gigabit Ethernet, 10 Gigabit Ethernet, fiber optic links, or a 5G private network.
[0157] The central computing hardware includes a central server cluster or cloud computing server, internally comprising at least a central processing unit (CPU), a graphics processing unit (GPU), RAM, and a high-speed bus. The central computing hardware is used to perform tasks such as region-channel directed topology graph construction, node-edge joint spatiotemporal state tensor generation, trend period decomposition, baseline prediction of neural controlled differential equations, fractional-gated temporal convolution residual extraction, hypergraph attention propagation, risk indicator calculation, dynamic early warning threshold determination, and generation of handling suggestions. Preferably, the central computing hardware and storage hardware are deployed in the same data center and directly connected via a high-speed local area network.
[0158] The storage hardware includes relational database servers, time-series database servers, file storage arrays, or network-attached storage devices, used to store raw video indexes, device count records, wireless residency migration records, scene context data, topology graph parameters, historical node features, historical edge features, model parameters, prediction results, and alarm logs. The storage hardware is connected to the server's internal disk controller via SATA, SAS, or PCIe buses, or to the central computing hardware via NAS, SAN, iSCSI, or Fibre Channel.
[0159] The network transmission hardware includes access switches, aggregation switches, core switches, routers, firewalls, fiber optic links, and clock synchronization devices; these are used to establish data transmission channels between various acquisition hardware, edge computing hardware, central computing hardware, and display / alarm hardware. Preferably, the network transmission hardware also includes an NTP clock server or a GPS timing module to provide a unified time reference to the cameras, edge servers, and central server, ensuring multi-source data alignment.
[0160] The display and alarm hardware includes a large monitoring screen, a duty workstation, a dispatch terminal, a mobile handheld terminal, and an audible and visual alarm. This hardware is used to display risk areas, warning levels, risk propagation paths, and handling suggestions. The display and alarm hardware is connected to the central computing hardware via a local area network, and the central computing hardware pushes warning results and visual interface data to it.
[0161] The on-site linkage control hardware includes a broadcast controller, a turnstile controller, an access control controller, a flow guidance screen controller, a variable sign controller, an escalator control interface, and a perimeter fence control interface. When the central computing hardware determines that the warning conditions are met, it can send control commands to the on-site linkage control hardware to execute broadcast reminders, turnstile flow restriction, one-way passage, flow guidance display switching, escalator direction adjustment, or temporary closure. The on-site linkage control hardware is connected to the central computing hardware via an industrial control bus or industrial Ethernet.
[0162] In a preferred embodiment, the system adopts a four-layer architecture: "Front-end Acquisition Layer—Edge Processing Layer—Central Analysis Layer—Display and Linkage Layer". The front-end acquisition layer includes network cameras, gate controllers, access control equipment, security inspection machine counting terminals, WiFi / Bluetooth probes, UWB base stations, environmental sensors, and equipment status acquisition terminals; the aforementioned front-end acquisition hardware is connected to the edge processing layer via PoE switches, industrial switches, RS485 buses, TCP / IP networks, or wireless LANs.
[0163] The edge processing layer includes one or more edge computing gateways or edge servers. The edge computing gateway receives raw data from the front-end acquisition layer, performs object detection and tracking on the video stream, timestamp normalization on the event stream, performs preliminary cleaning and local caching on multi-source data, and then uploads the structured feature data to the central analysis layer. The edge processing layer and the central analysis layer are connected via a core switch, fiber optic link, or 5G private network upload channel.
[0164] The central analysis layer includes a central server, GPU computing nodes, and a database server. The central server receives structured feature data from the edge processing layer and reads building plans, BIM models, CAD drawings, electronic maps, and historical statistical data from the database server. It then completes the construction of a directed topology graph of the region and channel, the generation of a joint spatiotemporal state tensor of nodes and edges, baseline traffic prediction, residual correction, and risk warning determination. The database server is connected to the central server via a high-speed Ethernet or a dedicated storage network.
[0165] The display and linkage layer includes a large monitoring screen, a dispatch terminal, mobile terminals, a broadcast controller, a turnstile controller, a flow control screen controller, and an audible and visual alarm. The central server sends early warning results to the large monitoring screen and dispatch terminal for display, and simultaneously sends linkage commands to the broadcast controller, turnstile controller, and flow control screen controller to achieve coordinated on-site response. The display and linkage layer is connected to the central analysis layer via a local area network, industrial Ethernet, or a dedicated control bus.
[0166] In some embodiments, taking a subway transfer station as an example, cameras are installed at the entrance, turnstiles, concourse, escalators, and platform areas. The cameras are connected to the station's access switch via a PoE switch. Turnstile controllers, security screening machines, and access control terminals are connected to the same access switch via an RS485-to-Ethernet gateway. WiFi probes are directly connected to the access switch via Ethernet. Environmental sensors and escalator status acquisition terminals are connected to an edge industrial computer via an industrial bus. The access switch is connected to an aggregation switch, which is then connected to the core switch in the central computer room via fiber optic cable. The core switch connects to the GPU server, database server, monitoring workstation, and large-screen controller. After completing risk prediction, the GPU server sends alarm results to the workstation and large screen, and simultaneously issues flow limiting or diversion commands to the broadcast controller and turnstile controller via the control interface.
[0167] This application combines neural controlled differential equations with hypergraph attention networks. The neural controlled differential equations are used for baseline traffic flow prediction. Their principle is to avoid simply discretizing multi-source data such as video, turnstiles, wireless probes, and equipment status into a fixed step size and rigidly stitching them together. Instead, they treat various asynchronous observations as driving inputs to continuous potential state trajectories, characterizing the natural evolution of crowd flow from a continuous-time perspective. This better handles issues such as different sampling frequencies from different sensors, inconsistent reporting times, local missing measurements, or sudden event insertions, resulting in smoother baseline traffic flow results that better reflect real-world operational patterns. Simultaneously, the hypergraph attention network is used for residual space propagation modeling. Its principle is to move beyond the pairwise connections of nodes in a typical graph structure. Instead, it uses hyperedges to simultaneously connect multiple area nodes and passage edges that "share the same turnstile group, the same escalator group, the same security checkpoint group, and the same main evacuation route," thereby modeling a many-to-many coupling relationship where multiple areas are constrained by the same bottleneck. Its beneficial effects are that it can improve the robustness of baseline prediction in asynchronous multi-source scenarios and more accurately characterize the propagation path of risks in shared bottleneck facilities. Compared with the common combination of traditional TCN and GCN, it can better reflect the special design for the topological characteristics of public scenarios.
[0168] Secondly, this application introduces fractional-gated temporal convolutional units into the residual temporal branch. The principle is that congestion anomalies in public places are often not instantaneous, but rather undergo a gradual evolutionary process of "local deceleration—short-term stagnation—queue growth—regional accumulation—bottleneck outbreak." Traditional integer-order convolutions tend to extract local short-term patterns, while fractional-order convolutions have stronger long-memory representation capabilities, preserving the lasting impact of earlier anomaly signs on the current risk state. Combined with a gating mechanism, it can further distinguish between persistently accumulating anomalies and occasional disturbances, automatically adjusting the degree of residual information retention at different time scales. Its beneficial effects include the ability to identify high-risk situations of "slow accumulation followed by sudden outbreak" earlier, improving sensitivity to gradual congestion, persistent queuing, and latent anomalies, and reducing false negatives caused by relying solely on short-window analysis.
[0169] A capacity-aware asymmetric gating activation function is introduced into the fusion layer of temporal and spatial residual features. The principle is that in public safety scenarios, not all positive and negative residuals carry equal risk. When a region or passage is nearing its capacity limit, positive deviations in the number of people, density, passage duration, or saturation usually indicate a rapid increase in risk and should be amplified; while some negative deviations only represent normal declines or random fluctuations and should not be mistakenly amplified. Therefore, this activation function uses the load rate of nodes or edges, the degree of reverse conflict, and the direction of residuals as gating criteria, asymmetrically amplifying positive overload residuals and selectively suppressing non-risk negative residuals. The beneficial effect is that it allows the model to focus more on abnormal signals that may truly lead to escalation of congestion, reducing the interference of ordinary fluctuations on the judgment results, thereby improving the advance warning, stability, and interpretability of the warning results.
[0170] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0171] (1) This invention introduces a modeling approach combining trend periodic decomposition and neural controlled differential equations (NeuralCDE) in the baseline traffic flow prediction stage. Trend periodic decomposition is used to separate long-term trends, periodic fluctuations, and prior event disturbances, while NeuralCDE is used to model the continuous-time trajectory of multi-source observation sequences with different sampling frequencies, irregular time intervals, and missing or asynchronous arrivals. Compared with traditional discrete-time series models, this structure can more accurately depict the natural evolution of public area traffic flow over continuous time, reduce prediction bias caused by asynchronous sampling, data sparsity, or external event insertion, thereby improving the stability and accuracy of baseline prediction results and providing a more reliable reference benchmark for subsequent abnormal residual identification.
[0172] (2) In the residual learning stage, this invention employs a structure combining fractional-gated temporal convolution and hypergraph attention propagation. Fractional-gated temporal convolution leverages fractional-order memory characteristics to enhance long-memory representation capabilities for gradual aggregation, slow congestion formation, and short-term sudden flow fluctuations. Hypergraph attention propagation overcomes the limitation of ordinary graph structures that only describe pairwise adjacent relationships, enabling many-to-many coupling propagation modeling of multiple regional nodes and directed channel edges sharing the same turnstile group, escalator group, security checkpoint group, or bottleneck constraint area. Therefore, this invention can not only identify local anomalies but also more accurately reveal the diffusion direction and propagation path of risks in the crowd flow link, improving the advance warning and spatial positioning capabilities in complex public scenarios.
[0173] (3) In the fusion stage of temporal residual features and spatial residual features, this invention introduces a capacity-aware asymmetric gating activation function. The load rate of regional nodes or directed channel edges, the reverse conflict index, and the residual sign are used as gating inputs to enhance positive overload residuals and suppress negative non-risk residuals. Compared with the conventional activation method that treats positive and negative residuals equally, this structure is more in line with the actual needs of public safety scenarios where "overload risks need to be amplified and ordinary fluctuations should be moderately suppressed." It can improve the sensitivity of risk identification under high load, strong conflict, and critical saturation conditions, and reduce false alarms caused by normal fluctuations. At the same time, combined with risk indicators such as predicted peak density, bottleneck saturation, and queuing spillover probability, the early warning results can have stronger interpretability and higher engineering application value.
[0174] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products, and therefore this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects.
[0175] While the present invention has been disclosed above, it is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of the invention; therefore, the scope of protection of the present invention should be determined by the scope defined in the claims.
Claims
1. A public safety crowd flow early warning method integrating spatiotemporal residual learning, characterized in that, Including the following steps: S1. Collect multi-source heterogeneous sensing data of the target public area, including video sensing data, access counting data, wireless dwell migration data and scene context data, and perform time synchronization and spatial mapping. S2. Based on the building floor plan, BIM model, CAD drawings or electronic map, divide the entrance area, turnstile area, escalator area, corridor area, station hall area, waiting area and distribution area into area nodes. Define the connection between nodes with passable boundaries and satisfying the one-step reachability relationship as directed passage edges, and construct the area-passage directed topology graph. S3. Extract the number of people, density, inflow, outflow, average speed, dwell time, directional entropy, queue length, and the throughput, passage time, saturation, and reverse conflict coefficient of each node to generate a node-edge joint spatiotemporal state tensor. S4. Input the node-edge joint spatiotemporal state tensor into the baseline flow prediction model, decompose the node-edge joint spatiotemporal state tensor using the trend period decomposition unit to obtain the trend component, period component and context perturbation prior component, and then input the trend component, period component and context perturbation prior component into the node-edge neural controlled differential equation unit to perform continuous time trajectory modeling, and output the baseline flow prediction results of each region node and directed channel edge within the future prediction window; S5. Construct a residual sequence based on the difference between the current observation state and the corresponding baseline flow prediction result. Input the residual sequence into the temporal residual branch and the spatial residual branch. The temporal residual branch uses fractional-gated temporal convolution to extract temporal residual features, and the spatial residual branch uses hypergraph attention propagation to extract spatial residual features. Then, use a capacity-aware asymmetric gated activation function to fuse the temporal residual features and the spatial residual features to obtain the residual correction representation. S6. Based on the baseline traffic prediction results and the residual correction representation, generate the predicted population status values of each regional node and directed channel edge within the future prediction window, and calculate the predicted peak density, density growth rate, cumulative residence index, bottleneck saturation, queuing spillover probability and prediction uncertainty accordingly. Combine the dynamic early warning threshold to output the early warning level, risk area and disposal suggestions.
2. The public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, The video perception data consists of personnel location points, trajectory segments, velocity vectors, and area population and density heatmaps obtained after pedestrian detection, cross-frame tracking, and homography mapping of surveillance video; the passage counting data consists of the number of people entering and exiting, passage duration, and queue number output by turnstiles, access control devices, security inspection devices, or ticketing devices; the wireless dwell migration data consists of the number of dwellers, dwell duration, and cross-area migration counts obtained based on anonymous probes using WiFi, Bluetooth, or UWB; the scene context data includes weather, time period, holidays, activity start and end times, train or flight arrival and departure times, temporary control status, and equipment start / stop status.
3. The public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, In the region-channel directed topology graph, each directed channel edge is associated with at least four attributes, including channel width, channel length, allowed passage direction, maximum passage capacity, slope or elevation difference, facility opening / closing status, and passage impedance coefficient, and the edge weight is determined based on these attributes.
4. The public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, The node-edge joint spatiotemporal state tensor is formed by stacking the data from the most recent L sampling periods in chronological order, and includes at least node feature tensors, edge feature tensors, and context feature tensors. The context feature tensor includes one or more of the following: time period code, weekday code, holiday code, weather code, activity status code, and temporary control status code.
5. The public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, The baseline flow prediction is achieved through a trend period decomposition unit and a node-side neural controlled differential equation unit. The trend period decomposition unit is used to decompose the long-term trend component, the periodic fluctuation component, and the event disturbance prior component. The node-side neural controlled differential equation unit is used to model the continuous time trajectory of multi-source observations under different sampling frequencies and irregular time intervals.
6. The public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, The fractional-gated temporal convolution is used to extract the long memory accumulation features of the residuals in the time dimension, so as to characterize the process of gradual aggregation, slow congestion formation and short-term explosive traffic growth.
7. The public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, The hypergraph attention propagation model is achieved by constructing hyperedges to model many-to-many propagation. The hyperedges are used to represent the coupling relationship between multiple regional nodes or directed channel edges that share the same turnstile group, the same escalator group, the same security check channel group, the same evacuation main path, or the same bottleneck constraint area.
8. The public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, In step S5, a capacity-aware asymmetric gating activation function is used to fuse temporal residual features and spatial residual features. The capacity-aware asymmetric gating activation function uses the load rate of regional nodes or directed channel edges, the reverse conflict index, and the residual sign as gating inputs to enhance positive overload residuals and suppress negative non-risk residuals.
9. A public safety crowd flow early warning method based on spatiotemporal residual learning according to claim 1, characterized in that, The dynamic early warning threshold is adaptively generated based on scene category, time period category, event category and historical statistical distribution of similar scenes, and the threshold is corrected based on prediction uncertainty; the handling suggestions include one or more of the following: flow restriction, one-way passage, opening more evacuation channels, broadcast guidance, security reinforcement and temporary lockdown.
10. A public safety crowd flow early warning system integrating spatiotemporal residual learning, characterized in that, include: The data acquisition module collects multi-source heterogeneous sensing data of the target public area, including video sensing data, access counting data, wireless dwell migration data and scene context data, and performs time synchronization and spatial mapping. The topology construction module divides the entrance area, turnstile area, escalator area, corridor area, station hall area, waiting area, and distribution area into regional nodes based on the building floor plan, BIM model, CAD drawings, or electronic map. The connection between nodes with passable boundaries and satisfying the one-step reachability relationship is defined as a directed passage edge, thus constructing a region-passage directed topology graph. The state tensor generation module extracts the number of people, density, inflow, outflow, average speed, dwell time, directional entropy, queue length, and the throughput, passage time, saturation, and reverse conflict coefficient of each node to generate a node-edge joint spatiotemporal state tensor. The baseline prediction module inputs the node-edge joint spatiotemporal state tensor into the baseline flow prediction model, decomposes the node-edge joint spatiotemporal state tensor using a trend-period decomposition unit to obtain trend components, periodic components, and context perturbation prior components, and then inputs the trend components, periodic components, and context perturbation prior components into a node-edge neural controlled differential equation unit to perform continuous time trajectory modeling, and outputs the baseline flow prediction results for each region node and directed channel edge within the future prediction window; The residual learning module constructs a residual sequence based on the difference between the current observation state and the corresponding baseline flow prediction result. The residual sequence is then input into a temporal residual branch and a spatial residual branch. The temporal residual branch uses fractional-gated temporal convolution to extract temporal residual features, and the spatial residual branch uses hypergraph attention propagation to extract spatial residual features. The temporal residual features and spatial residual features are then fused using a capacity-aware asymmetric gated activation function to obtain a corrected residual representation. The risk assessment module is used to generate predicted population status values for each regional node and directed channel edge within the future prediction window based on the baseline traffic prediction results and residual correction representation, and to calculate the predicted peak density, density growth rate, cumulative residence index, bottleneck saturation, queuing spillover probability, and prediction uncertainty. The early warning decision module is used to output the early warning level, risk area, and handling suggestions by combining dynamic early warning thresholds.