Urban street space safety prediction method based on human-vehicle collision risk assessment
By combining data collected from smart devices to construct an undirected graph model and train a graph neural network, the problems of low efficiency and poor accuracy in urban street safety assessments have been solved, enabling real-time and accurate risk warnings and renovation suggestions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-07
AI Technical Summary
Existing methods for assessing the safety of urban street spaces suffer from low efficiency and poor accuracy. In particular, traditional models struggle to effectively uncover the complex coupling relationships between multiple data sources, making it impossible to achieve real-time and accurate risk warnings.
By collecting dynamic and static security features in real time through smart cameras, LiDAR, and GIS systems, an undirected graph model is constructed and a Gaussian mixture model is used to fit the feature data distribution. Monte Carlo sampling is combined to estimate mutual information, and a domain adaptive graph neural network is established for training to generate a security assessment model suitable for the target city.
It enables efficient and accurate prediction of urban street space safety assessment, can quickly identify high-risk areas, provide interpretable renovation suggestions, and improve the accuracy of assessment and the pertinence of decision-making.
Smart Images

Figure CN121809829A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of smart city and public safety technology. Background Technology
[0002] As the core carrier of the transportation system, urban streets inevitably face multiple challenges during long-term use, including the impact of dynamic traffic flow, environmental erosion, and design flaws. If these safety hazards are not identified and addressed in a timely manner, they can easily lead to traffic accidents, resulting in injuries, traffic paralysis, and huge socio-economic losses. Urban street space safety assessment, by integrating multi-dimensional data to identify high-risk road sections, is of great significance for improving the resilience of the transportation system and ensuring public safety.
[0003] Current mainstream street safety assessment methods mainly rely on historical accident statistical analysis and single sensor monitoring. The former is based on traffic accident data recorded by traffic police departments and uses regression models to locate high-incidence road sections. However, this method is heavily dependent on the completeness and timeliness of historical data, cannot provide early warning of potential risk areas where no accidents have occurred, and is difficult to explain the causes of accidents. The latter collects real-time dynamic data such as traffic flow and vehicle speed through fixed cameras or geomagnetic sensors and triggers early warnings by combining threshold methods. Although it can achieve short-term risk perception, it ignores the long-term impact of static factors such as street geometric parameters and environmental conditions, resulting in one-sided assessment results.
[0004] In recent years, the widespread adoption of intelligent recognition devices (such as AI cameras and LiDAR) and deep learning technologies has provided new avenues for acquiring fine-grained data on pedestrian / vehicle trajectories and density at low cost. However, the complex coupling relationships among massive amounts of multi-source data (dynamic traffic flow, static street design, environmental variables) are difficult for traditional models (such as logistic regression and shallow neural networks) to effectively mine. Existing research has attempted to use temporal models (such as LSTM) or spatial convolutional networks (CNN) to handle spatiotemporal features, but limitations such as data heterogeneity, lack of interpretability, and regional dependence remain. To address these issues, probabilistic graphical models have been introduced to model the dependencies between multiple factors, such as inferring the causal chain of "sidewalk width - pedestrian wrong-way rate - collision risk" through Bayesian networks. However, traditional probabilistic inference methods (such as Markov chain Monte Carlo) have high computational complexity and are inefficient when dealing with large-scale city-level data, making it difficult to meet real-time assessment needs. Summary of the Invention
[0005] This invention aims to address the problems of low efficiency and poor accuracy in existing urban street space safety prediction methods, and provides an urban street space safety prediction method based on pedestrian-vehicle collision risk assessment.
[0006] The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment described in this invention includes:
[0007] Step 1: Collect pedestrian traffic, vehicle speed, street design parameters and environmental data in the target city in real time through smart cameras, LiDAR and GIS system, and extract standardized dynamic and static safety features of the target city.
[0008] The standardized dynamic and static safety characteristics of the target city include proximity interaction events, sidewalk continuity index, and blind spot coefficient;
[0009] Step 2: Based on the topological structure and standardized dynamic-static safety features of the target city streets, construct an undirected graph model with street intersections as nodes and adjacent road segments as edges;
[0010] Step 3: Based on the dynamic-static security features, use a Gaussian mixture model to fit the distribution of feature data of each node in the undirected graph model, and estimate the mutual information between adjacent nodes in the undirected graph model through Monte Carlo sampling to quantify the association strength between nodes as the weight of the edge; then combine the weight of the edge with the distribution of feature data of each node in the undirected graph model, optimize the potential function parameters of the undirected graph model through maximum likelihood estimation, and obtain the target city street security probability graph model.
[0011] Step 4: Establish a domain adaptive graph neural network. Train the domain adaptive graph neural network using historical traffic data from multiple cities. During the training process, inject local samples from the target city to adjust the graph neural network and obtain a street safety assessment model suitable for the target city.
[0012] Step 5: Input the parameters of the target city street safety probability map model into the street safety assessment model, and output the safety score of the target city street segment to achieve prediction of the spatial safety of the target city street.
[0013] Furthermore, in this invention, step one, the method for extracting standardized dynamic-static security features includes: the extraction process of standardized dynamic security features and the extraction process of standardized static security features;
[0014] The process of extracting standardized dynamic security features includes:
[0015] By deploying smart cameras and lidar at street intersections and main roads, raw data including pedestrian, vehicle and weather parameters are collected in real time.
[0016] A YOLOv8-based target detection model is used to identify pedestrian and vehicle targets in the raw data, and the motion trajectories of the pedestrian and vehicle targets are calculated based on the optical flow algorithm.
[0017] Data from different acquisition devices are time-stamped and processed using a spatial coordinate system. Based on the processed motion trajectories of pedestrian and vehicle targets, the real-time distance and relative speed between the two targets are calculated. Events where the real-time distance is less than a first preset threshold and the relative speed is greater than a second preset threshold are defined as close-range interaction events. The frequency of these close-range interaction events is used as a standardized dynamic security feature.
[0018] The process of extracting standardized static security features includes:
[0019] The basic parameters of the street are extracted from the geographic information system. These basic parameters include at least the lane width, the continuous length and total length of the sidewalk, and obstacle occlusion information.
[0020] Based on the aforementioned basic parameters, a preliminary static safety factor is calculated, which includes at least the pedestrian walkway continuity index and the blind spot coefficient.
[0021] A feature pool containing multiple candidate static safety factors is constructed using the preliminary static safety factors. Based on mutual information calculation, factors with a correlation higher than a preset threshold with the historical accident rate are selected from the feature pool as effective static safety factors.
[0022] Principal component analysis is performed on the effective static security factors to reduce dimensionality, and components with cumulative variance contribution rates exceeding a preset contribution rate threshold are retained to generate a standardized static security feature dataset.
[0023] Furthermore, in this invention, the method for obtaining the target city street safety probability map model in step three is as follows:
[0024] Step 3: 1. Use a Gaussian mixture model to fit the conditional probability distribution of the dynamic security feature data and the static security feature data of each node in the undirected graph model under different preset security states;
[0025] Step 3.2. For adjacent nodes in the undirected graph model, estimate the mutual information between their corresponding feature data distributions based on the Monte Carlo sampling method, and use the normalized mutual information value as the weight of the corresponding edge.
[0026] Step 3: Based on the weights of the edges and the conditional probability distribution of the nodes, optimize the joint potential function parameters of the undirected graph model through maximum likelihood estimation to obtain a parameter-complete target city street safety probability graph model.
[0027] Furthermore, in this invention, in step three-one, the conditional probability distribution of the dynamic security feature data and the static security feature data;
[0028]
[0029] in, This represents the feature data vector of node i. The security state of node i This represents the probability distribution that node i is in a high-risk state. Let K represent the probability distribution of node i being in a low-risk state, and K represent the number of components in the Gaussian mixture model. This represents the mixing weight of the k-th Gaussian component. Let represent the probability density function of the k-th Gaussian distribution. Let represent the mean vector of the k-th Gaussian distribution. Let the covariance matrix of the k-th Gaussian distribution be denoted as . This represents the probability density function of a Gaussian distribution under low-risk conditions. The vector representing the mean of the Gaussian distribution in the low-risk state. This represents the covariance matrix of the Gaussian distribution in the low-risk state.
[0030] Furthermore, in this invention, in step three-two, for adjacent nodes in the undirected graph model, the method for estimating the mutual information between their corresponding feature data distributions based on the Monte Carlo sampling method, and using the normalized mutual information value as the weight of the corresponding edge, is as follows:
[0031] Define the similarity function:
[0032]
[0033] and These represent the feature data vectors of node i and node j (i.e., the standardized dynamic-static security features extracted from nodes i and j). The joint probability density function represents the feature vectors of nodes i and j; Let represent the marginal probability density functions of the feature vectors of nodes i and j, respectively; Represents the k-th sample pair The similarity function;
[0034] Using the aforementioned similarity function, and based on the Monte Carlo sampling method, the mutual information between corresponding feature data distributions is estimated:
[0035]
[0036] The mutual information between the feature vectors of nodes i and j is represented by N, which represents the number of samples sampled in Monte Carlo sampling.
[0037] The edge weights are obtained by normalizing the mutual information:
[0038]
[0039] Make the weight range [0,1], where, This represents the normalized edge weights. The information entropy represents the feature vectors of nodes i and j.
[0040] Furthermore, in this invention, step four, the process of obtaining a street safety assessment model suitable for the target city, is as follows:
[0041] Constructing a graph neural network based on a message passing mechanism;
[0042] The graph neural network is trained using historical data from multiple source cities. The loss function used in the training is the weighted cross-entropy loss function, which assigns different loss weights to regions with different risk levels. Furthermore, domain adversarial training is performed simultaneously during the pre-training process, and the data distribution characteristics between different source cities and between source cities and target cities are aligned through a gradient inversion layer.
[0043] A predetermined proportion of local samples representing a certain percentage of the total data volume of the target city is injected into the training process. Enhanced data consistent with the data distribution of the target city is synthesized through a generative adversarial network to expand the fine-tuning training samples and fine-tune the pre-trained graph neural network. A dynamically adjusted learning rate strategy is adopted to freeze the parameters of some lower-level networks in the graph neural network and optimize the parameters of the top-level classifier. A street safety assessment model suitable for the target city is obtained.
[0044] Furthermore, in this invention, a graph neural network is constructed based on a message passing mechanism:
[0045]
[0046] in, This represents the feature vector of node i at layer t (or time step t). This represents the feature vector of node i after the update at layer t+1. This represents the learnable weight matrix used for transforming the node's own features. This represents the learnable weight matrix used for neighbor feature aggregation. Let b represent the ReLU activation function, and b represent the bias vector. The feature vector of node j at layer t.
[0047] Furthermore, in this invention, in step five, the safety score of the target city street segment is:
[0048]
[0049] in, The dynamic weight of the k-th risk factor is calculated dynamically from the SHAP value attribution. The quantitative value representing the overall safety level of road segment i. This represents the normalized risk value of the k-th risk factor.
[0050] This invention proposes a multimodal fusion approach to conduct comprehensive assessment using dynamic traffic flow data and static street design parameters, overcoming the limitations of traditional methods that rely on a single data source and improving assessment accuracy. A rapid cross-city migration method based on domain adaptive graph neural networks and adversarial training technology allows target cities to fine-tune their models with only 10% local data. By quantifying the contribution of four-dimensional indicators using SHAP values and combining this with gradient activation graphs to pinpoint high-risk causes, interpretability-driven decision-making is achieved, making renovation recommendations more targeted. Furthermore, a collaborative analysis of static and dynamic indicators is proposed to support long-term planning and guide the prioritization of urban road network renovations. Attached Figure Description
[0051] Figure 1 This is a flowchart of the method described in this invention. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0053] Specific implementation method one: Refer to Figure 1 This embodiment specifically describes the urban street space safety prediction method based on pedestrian-vehicle collision risk assessment, which includes:
[0054] Step 1: Collect pedestrian traffic, vehicle speed, street design parameters and environmental data in the target city in real time through smart cameras, LiDAR and GIS system, and extract standardized dynamic and static safety features of the target city.
[0055] The standardized dynamic and static safety characteristics of the target city include close-range interaction events, sidewalk continuity index, and blind spot coefficient;
[0056] Step 2: Based on the topological structure and standardized dynamic-static safety features of the target city streets, construct an undirected graph model with street intersections as nodes and adjacent road segments as edges;
[0057] Step 3: Based on the dynamic-static security features, use a Gaussian mixture model to fit the distribution of feature data of each node in the undirected graph model, and estimate the mutual information between adjacent nodes in the undirected graph model through Monte Carlo sampling to quantify the association strength between nodes as the weight of the edge; then combine the weight of the edge with the distribution of feature data of each node in the undirected graph model, optimize the potential function parameters of the undirected graph model through maximum likelihood estimation, and obtain the target city street security probability graph model.
[0058] Step 4: Establish a domain adaptive graph neural network. Train the domain adaptive graph neural network using historical traffic data from multiple cities. During the training process, inject local samples from the target city to adjust the graph neural network and obtain a street safety assessment model suitable for the target city.
[0059] Step 5: Input the parameters of the target city street safety probability map model into the street safety assessment model, and output the safety score of the target city street segment to achieve prediction of the spatial safety of the target city street.
[0060] Furthermore, in this embodiment, the method for extracting standardized dynamic-static security features in step one includes: the extraction process of standardized dynamic security features and the extraction process of standardized static security features;
[0061] The process of extracting standardized dynamic security features includes:
[0062] By deploying smart cameras and lidar at street intersections and main roads, raw data including pedestrian, vehicle and weather parameters are collected in real time.
[0063] A YOLOv8-based target detection model is used to identify pedestrian and vehicle targets in the raw data, and the motion trajectories of the pedestrian and vehicle targets are calculated based on the optical flow algorithm.
[0064] Data from different acquisition devices are time-stamped and processed using a spatial coordinate system. Based on the movement trajectories of the pedestrian and vehicle targets, the real-time distance and relative speed between the two targets are calculated. Events where the real-time distance is less than a first preset threshold and the relative speed is greater than a second preset threshold are defined as close-range interaction events. The frequency of these close-range interaction events is used as a standardized dynamic security feature.
[0065] The process of extracting standardized static security features includes:
[0066] The basic parameters of the street are extracted from the geographic information system. These basic parameters include at least the lane width, the continuous length and total length of the sidewalk, and obstacle occlusion information.
[0067] Based on the aforementioned basic parameters, a preliminary static safety factor is calculated, which includes at least the pedestrian walkway continuity index and the blind spot coefficient.
[0068] A feature pool containing multiple candidate static safety factors is constructed using the preliminary static safety factors. Based on mutual information calculation, factors with a correlation higher than a preset threshold with the historical accident rate are selected from the feature pool as effective static safety factors.
[0069] Principal component analysis is performed on the effective static security factors to reduce dimensionality, and components with cumulative variance contribution rates exceeding a preset contribution rate threshold are retained to generate a standardized static security feature dataset.
[0070] Furthermore, in this embodiment, the method for obtaining the target city street safety probability map model in step three is as follows:
[0071] Step 3: 1. Use a Gaussian mixture model to fit the conditional probability distribution of the dynamic security feature data and the static security feature data of each node in the undirected graph model under different preset security states;
[0072] Step 3.2. For adjacent nodes in the undirected graph model, estimate the mutual information between their corresponding feature data distributions based on the Monte Carlo sampling method, and use the normalized mutual information value as the weight of the corresponding edge.
[0073] Step 3: Based on the edge weights and the conditional probability distribution of the nodes, optimize the joint potential function parameters of the undirected graph model through maximum likelihood estimation to obtain a parameter-complete target city street safety probability graph model.
[0074] Furthermore, in step three-one of this embodiment, the conditional probability distribution of the dynamic security feature data and the static security feature data;
[0075]
[0076] in, This represents the feature data vector of node i. The security state of node i This represents the probability distribution that node i is in a high-risk state. Let K represent the probability distribution of node i being in a low-risk state, and K represent the number of components in the Gaussian mixture model. This represents the mixing weight of the k-th Gaussian component. Let represent the probability density function of the k-th Gaussian distribution. Let represent the mean vector of the k-th Gaussian distribution. Let the covariance matrix of the k-th Gaussian distribution be denoted as . This represents the probability density function of a Gaussian distribution under low-risk conditions. The vector representing the mean of the Gaussian distribution in the low-risk state. This represents the covariance matrix of the Gaussian distribution in the low-risk state.
[0077] Furthermore, in this embodiment, in step three two, for adjacent nodes in the undirected graph model, the method for estimating the mutual information between their corresponding feature data distributions based on the Monte Carlo sampling method and using the normalized mutual information value as the weight of the corresponding edge is as follows:
[0078] Define the similarity function:
[0079]
[0080] and These represent the feature data vectors of node i and node j (i.e., the standardized dynamic-static security features extracted from nodes i and j). The joint probability density function represents the feature vectors of nodes i and j; Let represent the marginal probability density functions of the feature vectors of nodes i and j, respectively; Represents the k-th sample pair The similarity function;
[0081] Using the aforementioned similarity function, and based on the Monte Carlo sampling method, the mutual information between corresponding feature data distributions is estimated:
[0082]
[0083] The mutual information between the feature vectors of nodes i and j is represented by N, which represents the number of samples sampled in Monte Carlo sampling.
[0084] The edge weights are obtained by normalizing the mutual information:
[0085]
[0086] Make the weight range [0,1], where, This represents the normalized edge weights. The information entropy represents the feature vectors of nodes i and j.
[0087] Furthermore, in this embodiment, step four, the process of obtaining a street safety assessment model applicable to the target city, is as follows:
[0088] Constructing a graph neural network based on a message passing mechanism;
[0089] The graph neural network is trained using historical data from multiple source cities. The loss function used in the training is the weighted cross-entropy loss function, which assigns different loss weights to regions with different risk levels. Furthermore, domain adversarial training is performed simultaneously during the pre-training process, and the data distribution characteristics between different source cities and between source cities and target cities are aligned through a gradient inversion layer.
[0090] A predetermined proportion of local samples representing a certain percentage of the total data volume of the target city is injected into the training process. Enhanced data consistent with the data distribution of the target city is synthesized through a generative adversarial network to expand the fine-tuning training samples and fine-tune the pre-trained graph neural network. A dynamically adjusted learning rate strategy is adopted to freeze the parameters of some lower-level networks in the graph neural network and optimize the parameters of the top-level classifier. A street safety assessment model suitable for the target city is obtained.
[0091] Furthermore, in this embodiment, a graph neural network is constructed based on a message passing mechanism:
[0092]
[0093] in, This represents the feature vector of node i at layer t (or time step t). This represents the feature vector of node i after the update at layer t+1. This represents the learnable weight matrix used for transforming the node's own features. This represents the learnable weight matrix used for neighbor feature aggregation. Let b represent the ReLU activation function, and b represent the bias vector. The feature vector of node j at layer t.
[0094] Furthermore, in this embodiment, in step five, the safety score of the target city street segment is:
[0095]
[0096] in, The dynamic weight of the k-th risk factor is calculated dynamically from the SHAP value attribution. The quantitative value representing the overall safety level of road segment i. This represents the normalized risk value of the k-th risk factor.
[0097] The specific implementation process of the method described in this invention is as follows:
[0098] Step 1: Multi-source data acquisition and feature extraction;
[0099] By using smart cameras, lidar, and GIS systems, pedestrian flow, vehicle speed, street design parameters, and environmental data are collected in real time, and standardized dynamic and static safety features are extracted, including close-range interaction events, sidewalk continuity index, and blind spot coefficient.
[0100] Step 2: Construct a street safety probability graph model;
[0101] An undirected graph model is established with intersections as nodes and adjacent road segments as edges. Based on Gaussian mixture model (GMM) and mutual information quantization of dynamic-static factor coupling weights, a joint energy function is defined to fuse multimodal data.
[0102] Step 3: Train a transferable graph neural network
[0103] The design incorporates a domain-adaptive graph neural network. During the pre-training phase, historical data from multiple cities is used. In the fine-tuning phase, 10% of the samples from the target city are injected. Cross-city generalization is achieved through weighted cross-entropy loss and a gradient inversion layer.
[0104] Step 4: Security scoring and decision generation;
[0105] Input the target city map model parameters into the training network, output the road segment safety score (0-100 points), and generate a list of renovation priorities based on SHAP value attribution, such as "widening the sidewalk" or "optimizing the signal timing", to support precise intervention.
[0106] Furthermore, step one specifically includes:
[0107] Step 1.1: Real-time acquisition of dynamic data and trajectory analysis;
[0108] Data source deployment: Deploy 4K resolution smart cameras (frame rate ≥ 30fps) to cover street intersections and main roads, installed at a height of 6-8 meters and tilted at an angle of 25°-30° to maximize the field of view. LiDAR (scanning frequency 20Hz) assists in target detection at night or in low-light conditions.
[0109] Data capture: Real-time collection of pedestrian flow (people / m²), vehicle speed (km / h), traffic flow density (vehicles / km), and weather parameters (rainfall, light intensity).
[0110] Trajectory extraction and processing: The YOLOv8 model is used to identify pedestrian and vehicle targets with a confidence threshold > 0.8. The target trajectory is calculated based on the Lucas-Kanade algorithm, and close-range interaction events (distance between two targets < 1.5m and relative speed > 5km / h) are defined as collision risk indicators. Data from multiple devices is synchronized with timestamps and unified with spatial coordinates (WGS84 coordinate system) to eliminate discrepancies between devices.
[0111] Step 1.2: Static data integration and security factor screening;
[0112] Lane width (accuracy 0.1m), sidewalk continuity index (continuous length / total length), and blind spot ratio (total obstacle occlusion angle / 180° × number of nodes) were extracted from GIS maps. Blind spot locations were marked by combining historical rainfall data from meteorological stations and street view images. An initial selection pool containing 30+ candidate features was constructed. Factors significantly related to historical accident rates were screened through mutual information calculation. Dimensionality reduction using PCA was used to remove redundant features, retaining principal components with a cumulative variance contribution rate >85%. Finally, a standardized static feature dataset was generated, covering core parameters such as lane width and blind spot coefficient.
[0113] Furthermore, step two specifically involves:
[0114] Step 2.1: Undirected Graph Model Construction and Damage Identification Problem Definition;
[0115] Considering the mutual influence between key street components (such as intersections, sidewalks, and traffic lights), an undirected graph model is used to model the street space, where nodes represent key components and edges represent functional or spatial relationships between components (such as traffic flow interaction and sight distance occlusion).
[0116] Based on Bayes' theorem, the street safety assessment problem is transformed into the task of solving the posterior probability distribution, that is, calculating the probability distribution of the safety status x of each node given observed data Y (such as pedestrian flow, blind spot coefficient):
[0117]
[0118] in This represents the joint potential function of nodes i and j. For observation data In state The conditional probability under the following conditions, Represents all nodes. Given the set of edges in a graph, an energy function is defined to quantify the global consistency of node states:
[0119]
[0120] in Let (i,j) be the potential weight of the edge (i,j) connecting nodes i and j, representing the strength of the dependency between nodes.
[0121] Step 2.2: Determine the structure of the graphical model;
[0122] The undirected graph model structure is determined based on the spatial distribution of the pseudo-sensor network. Each pseudo-sensor corresponds to a graph node, covering high-risk areas such as intersections and pedestrian crossing interruptions. If the areas represented by two nodes have direct traffic flow interaction or line-of-sight association, an edge connection is established, such as adjacent intersections sharing traffic flow. Long-distance association edges are supplemented by the K nearest neighbor algorithm (K=3), such as blind spot occlusion across road segments, to ensure that the model captures global spatial dependencies.
[0123] Step 2.3: Determine the structure of the graphical model;
[0124] Based on the damage-sensitive feature data (such as sidewalk continuity index and blind zone coefficient) extracted in step 1.2, the parameters of the undirected graphical model are learned through the following process:
[0125] Probability density estimation: A Gaussian mixture model (GMM) is used to fit the distribution of feature data for each node. It is assumed that node i is in a safe state. =1 (high risk) and The feature data distributions under the condition of =0 (low risk) are as follows:
[0126]
[0127] Where K is the number of Gaussian components (usually taken as 3). It is a mixed weight.
[0128] Mutual information is used to calculate edge weights: the correlation between adjacent nodes is quantified by the mutual information of their feature data. A similarity function is defined.
[0129]
[0130] Mutual information estimation based on Monte Carlo sampling:
[0131]
[0132] Further normalization yields the edge weights. Ensure that the weight value range is [0,1].
[0133] Potential function parameterization: Parameterizing the conditional probability With edge weight Substituting the posterior probability formula, we optimize using maximum likelihood estimation. Finally, the model parameters are learned.
[0134] Furthermore, step three specifically includes:
[0135] 3.1 Network Architecture Design and Pre-training:
[0136] Based on the message passing mechanism, a GNN is constructed, and the node update formula is:
[0137]
[0138] in , For learnable parameters, The ReLU activation function is used, and data from source cities such as Beijing and Shanghai are used during the pre-training phase, with weighted cross-entropy loss. Optimize the model, where Weights are dynamically allocated according to risk level (e.g., the weight of high-risk areas is increased to 1.5 times), and a domain adversarial training module is introduced to align the data distribution of the source domain and the target domain through a gradient inversion layer.
[0139] 3.2 Fine-tuning and intercity migration;
[0140] For target cities (such as Chengdu where data is scarce), 10% local samples are injected. The cosine annealing algorithm is used to dynamically adjust the learning rate. The initial learning rate is set to 0.001, and it is reduced to 50% of the original value every 10 epochs. During the fine-tuning process, the parameters of the first 3 layers of the pre-trained model are frozen, and only the top-level classifier is optimized. Finally, the prediction error (MAE) of the model in the target city is reduced from the initial 15.6 to 8.3. If the amount of data in the target city is very small (<5%), generative adversarial networks (GANs) are used to synthesize augmented data to ensure the generalization ability of the model.
[0141] Furthermore, step four specifically involves:
[0142] 4.1 Safety score calculation and risk attribution;
[0143] Input the parameters of the target city map model into the trained GNN, and output the road segment safety score:
[0144]
[0145] in Dynamically assigned by SHAP value (e.g., liquidity weight) =0.3), and at the same time, based on the gradient class activation map (Grad-CAM), the causes of high risk are located, such as "the blind spot on the west side of the intersection contributes 68% of the risk", and a visual heat map is automatically generated to mark the distribution of the contribution of each factor.
[0146] 4.2 Priority list for renovation and effect tracking;
[0147] A priority list for renovations is generated based on safety scores from low to high, recommending specific measures such as "widening the sidewalk to 2.5m" or "adding left-turn traffic lights." This list is then pushed to the urban planning platform via API to trigger an early warning mechanism (automatic alarm when the score is <60). A review is conducted every 3 months after the renovations are completed. For example, in a pilot area, after the sidewalk continuity index increased from 0.4 to 0.7, the accident rate decreased by 37%. The model prediction error (MAE=7.2) verified the effectiveness of the intervention, forming a closed-loop management process of "assessment-intervention-verification".
[0148] Taking Yan'an Road in Hangzhou as an example, this paper details the specific implementation process of the present invention in urban street safety assessment:
[0149] Step 1: Multi-source data acquisition and feature extraction;
[0150] Equipment Deployment and Data Acquisition: Eight 4K smart cameras (Hikvision DS-2CD6143, 30fps) are deployed along Yan'an Road and at intersections (such as Yan'an Road-Fengqi Road and Yan'an Road-Qingchun Road), at a height of 7.2 meters, a tilt angle of 28°, and a coverage radius of 80 meters. A 16-line LiDAR (Robotech RS-LiDAR-16, 20Hz scanning frequency) is also deployed to supplement nighttime data. Real-time meteorological data (rainfall, light intensity) and historical accident records (data from the traffic police department for the past 5 years) are accessed through the traffic management platform.
[0151] Trajectory Extraction and Feature Calculation: A YOLOv8 model (pre-trained weights yolov8x.pt, confidence threshold 0.85) was used to detect pedestrian and vehicle targets, and the Lucas-Kanade optical flow algorithm was used to calculate trajectories. Near-field interaction events were defined as situations where the distance between two targets is <1.5m and the relative speed is >5km / h. The average hourly frequency during peak hours (8:00-9:00) was statistically analyzed. Lane width, sidewalk continuity index, and blind spot percentage of Yan'an Road were extracted using a GIS system. PCA was used to reduce the dimensionality of 30 initially selected features, retaining 6 principal components, including dynamic indicators: pedestrian density (people / m²), vehicle emergency braking frequency (times / h); and static indicators: sidewalk continuity, blind spot coefficient, traffic light timing rationality index, and nighttime lighting intensity.
[0152] Step 2: Construct a street safety probability graph model;
[0153] Topology modeling: Yan'an Road is divided into 32 nodes (including 6 intersections and 26 road segment units), and an undirected graph is constructed based on traffic flow correlation. The distance between adjacent nodes is ≤100 meters. Long-range connections are supplemented by K-nearest neighbors (K=3), such as the Yan'an Road-Wulin Square node being connected across road segments due to visual blind spots.
[0154] Parameter calculation: A Gaussian mixture model (GMM, K=3) was used to fit the node feature distribution. Taking the Yan'an Road-Fengqi Road intersection as an example, in a high-risk state ( =1) The pedestrian density follows a mixed distribution: 0.4N(2.1,0.5)+0.3N(3.8,1.2)+0.3N(5.5,0.9); low-risk state ( =0) follows N(1.2,0.3). Mutual information between nodes is calculated through Monte Carlo sampling (N=5000). For example, the normalized mutual information N(yA,yB) between intersection node A and adjacent road segment node B is 0.78, and the corresponding edge weight is 0.69.
[0155] Step 3: Train a transferable graph neural network;
[0156] Pre-training and adversarial training: Historical data from Beijing (Xidan Street, East Third Ring Road, etc.) and Shanghai (Nanjing West Road, Huaihai Middle Road, etc.) were used for pre-training. The GNN architecture consists of 3 layers of graph convolutions, and the domain adversarial module uses a gradient inversion layer (λ=0.3). The initial learning rate is 0.001, and the batch size is 256. After pre-training, the model achieved a MAE of 9.2 on the source city test set.
[0157] Fine-tuning the transfer learning: Local Hangzhou data (320 nodes on Yan'an Road, accounting for 10%) was injected, and cosine annealing was used to adjust the learning rate (per 10 epochs). The parameters of the first three layers were frozen, and only the classifier layer was fine-tuned. After 30 epochs of fine-tuning, the model's MAE on the Hangzhou test set decreased from the initial 15.6 to 8.3. When local data was less than 5%, synthetic data was generated using StyleGAN2-ADA to expand the training set, stabilizing the MAE at 9.1±0.4.
[0158] Step 4: Safety scoring and decision optimization;
[0159] Input the Yan'an Road map model into the trained GNN to generate a safety heatmap. High-risk areas are concentrated at the Yan'an Road-Stadium Road intersection; SHAP attribution indicates this is mainly due to blind spot coefficients and pedestrian wrong-way crossing rates. Grad-CAM highlights the area obstructed by billboards on the west side as a key risk source. A post-implementation review verifies the effectiveness of the intervention measures.
[0160] While the invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.
Claims
1. A method for predicting the spatial safety of urban streets based on pedestrian-vehicle collision risk assessment, characterized in that, include: Step 1: Collect pedestrian traffic, vehicle speed, street design parameters and environmental data in the target city in real time through smart cameras, LiDAR and GIS system, and extract standardized dynamic and static safety features of the target city. The standardized dynamic-static safety characteristics of the target city include proximity interaction events, sidewalk continuity index, and blind spot coefficient; Step 2: Based on the topological structure and standardized dynamic-static safety features of the target city streets, construct an undirected graph model with street intersections as nodes and adjacent road segments as edges; Step 3: Based on the dynamic-static security features, use a Gaussian mixture model to fit the distribution of feature data of each node in the undirected graph model, and estimate the mutual information between adjacent nodes in the undirected graph model through Monte Carlo sampling to quantify the association strength between nodes as the weight of the edge; combine the weight of the edge with the distribution of feature data of each node in the undirected graph model, and optimize the potential function parameters of the undirected graph model through maximum likelihood estimation to obtain the target city street security probability graph model; Step 4: Establish a domain adaptive graph neural network. Train the domain adaptive graph neural network using historical traffic data from multiple cities. During the training process, inject local samples from the target city to adjust the graph neural network and obtain a street safety assessment model suitable for the target city. Step 5: Input the parameters of the target city street safety probability map model into the street safety assessment model, and output the safety score of the target city street segment to achieve prediction of the spatial safety of the target city street.
2. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 1, characterized in that, In step one, the method for extracting standardized dynamic-static security features includes: the extraction process of standardized dynamic security features and the extraction process of standardized static security features.
3. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 2, characterized in that, The process of extracting standardized dynamic security features includes: By deploying smart cameras and lidar at street intersections and main roads, raw data including pedestrian, vehicle and weather parameters are collected in real time. A YOLOv8-based target detection model is used to identify pedestrian and vehicle targets in the raw data, and the motion trajectories of the pedestrian and vehicle targets are calculated based on the optical flow algorithm. Data from different acquisition devices are time-stamped and processed using a spatial coordinate system. Based on the processed motion trajectories of pedestrian and vehicle targets, the real-time distance and relative speed between the two targets are calculated. Events where the real-time distance is less than a first preset threshold and the relative speed is greater than a second preset threshold are defined as near-field interaction events. The frequency of these near-field interaction events is used as a standardized dynamic safety feature.
4. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 2, characterized in that, The process of extracting standardized static security features includes: Basic parameters of the street are extracted from the geographic information system. These basic parameters include at least lane width, continuous length and total length of sidewalk, and obstacle occlusion information. Based on the aforementioned basic parameters, a preliminary static safety factor is calculated, which includes at least the pedestrian walkway continuity index and the blind spot coefficient. A feature pool containing multiple candidate static safety factors is constructed using the preliminary static safety factors. Based on mutual information calculation, factors with a correlation higher than a preset threshold with the historical accident rate are selected from the feature pool as effective static safety factors. Principal component analysis is performed on the effective static security factors to reduce dimensionality, and components with cumulative variance contribution rates exceeding a preset contribution rate threshold are retained to generate a standardized static security feature dataset.
5. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 1, characterized in that, In step three, the method for obtaining the target city street safety probability map model is as follows: Step 3:
1. Use a Gaussian mixture model to fit the conditional probability distribution of the dynamic security feature data and the static security feature data of each node in the undirected graph model under different preset security states; Step 3.
2. For adjacent nodes in the undirected graph model, estimate the mutual information between their corresponding feature data distributions based on the Monte Carlo sampling method, and use the normalized mutual information value as the weight of the corresponding edge. Step 3: Based on the weights of the edges and the conditional probability distribution of the nodes, optimize the joint potential function parameters of the undirected graph model through maximum likelihood estimation to obtain a parameter-complete target city street safety probability graph model.
6. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 1, characterized in that, In step 3, the conditional probability distribution of the dynamic security feature data and the static security feature data; in, This represents the feature data vector of node i. The security state of node i This represents the probability distribution that node i is in a high-risk state. Let K represent the probability distribution of node i being in a low-risk state, and K represent the number of components in the Gaussian mixture model. This represents the mixing weight of the k-th Gaussian component. Let represent the probability density function of the k-th Gaussian distribution. Let represent the mean vector of the k-th Gaussian distribution. Let the covariance matrix of the k-th Gaussian distribution be denoted as . This represents the probability density function of a Gaussian distribution under low-risk conditions. The vector representing the mean of the Gaussian distribution in the low-risk state. This represents the covariance matrix of the Gaussian distribution in the low-risk state.
7. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 1, characterized in that, In step 3.2, for adjacent nodes in the undirected graph model, the mutual information between their corresponding feature data distributions is estimated based on the Monte Carlo sampling method, and the normalized mutual information value is used as the weight of the corresponding edge. The specific method is as follows: Define the similarity function: and These represent the feature data vectors of node i and node j, respectively. The joint probability density function represents the feature vectors of nodes i and j; Let represent the marginal probability density functions of the feature vectors of nodes i and j, respectively; Represents the k-th sample pair The similarity function; Using the aforementioned similarity function, and based on the Monte Carlo sampling method, the mutual information between corresponding feature data distributions is estimated: The mutual information between the feature vectors of nodes i and j is represented by N, which represents the number of samples sampled in Monte Carlo sampling. The edge weights are obtained by normalizing the mutual information: Make the weight range [0,1], where, This represents the normalized edge weights. The information entropy represents the feature vectors of nodes i and j.
8. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 1, characterized in that, Step four involves obtaining a street safety assessment model applicable to the target city as follows: A graph neural network is constructed based on a message passing mechanism; historical data from multiple source cities are used to train the graph neural network, and the loss function used for training is a weighted cross-entropy loss function, assigning different loss weights to areas with different risk levels; furthermore... Domain adversarial training is performed simultaneously during pre-training, and the data distribution characteristics between different source cities and between source cities and target cities are aligned through gradient inversion layers. Local samples, representing a predetermined proportion of the total data volume of the target city, are injected into the training process. Enhanced data consistent with the data distribution of the target city is synthesized through a generative adversarial network. This expands the fine-tuning training samples and fine-tunes the pre-trained graph neural network. By employing a dynamically adjusted learning rate strategy, the parameters of some lower-level networks in the graph neural network are frozen, while the parameters of the top-level classifier are optimized; thus, a street safety assessment model suitable for the target city is obtained.
9. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 5, characterized in that, The graph neural network constructed based on the message passing mechanism is as follows: in, This represents the feature vector of node i at layer t. This represents the feature vector of node i after the update at layer t+1. This represents the learnable weight matrix used for transforming the node's own features. This represents the learnable weight matrix used for neighbor feature aggregation. Let b represent the ReLU activation function, and b represent the bias vector. The feature vector of node j at layer t.
10. The urban street space safety prediction method based on pedestrian-vehicle collision risk assessment according to claim 1, characterized in that, In step five, the safety score for the target city street section is: in, The dynamic weight of the k-th risk factor is calculated dynamically from the SHAP value attribution. The quantitative value representing the overall safety level of road segment i. This represents the normalized risk value of the k-th risk factor.