A multi-scale traffic accident-prone section cause analysis method
Patent Information
- Application Number
- CN202411706213.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2044-11-26
AI Technical Summary
[0006]本发明提出一种多尺度的交通事故多发路段成因分析方法,能解决现有的道路安全分析技术的全面性、颗粒度存在不足,不能满足现阶段城市更新背景下交通安全治理需求的问题
[0036]The beneficial effects of this invention are as follows: it comprehensively considers the influencing factors of traffic accidents at different scales, including macro, meso, and micro, and explains their degree of influence on traffic accidents, providing a basis for systematically solving traffic safety problems using urban planning, design, and operation management methods; it defines the basic unit of traffic safety analysis as the road segment, and specifically calculates the main influencing factors of each accident-prone road segment, which can adapt to the needs of refined urban governance and support urban renewal initiatives.
Smart Images

Figure CN119580488B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of urban planning, design and operation management, and in particular to a multi-scale method for analyzing the causes of traffic accident-prone road sections. Background Technology
[0002] Road traffic safety is closely related to residents' production and daily life and is an important part of urban governance.
[0003] Mainstream road traffic safety analysis techniques primarily focus on micro-level traffic influencing factors, starting from traffic accident data and using the behavior of traffic participants (such as traffic flow conflicts, driving habits, and compliance with traffic regulations) to explain the occurrence of traffic accidents. However, many factors beyond traffic participants also have a significant impact on traffic safety. For example, socioeconomic level and population composition play a decisive role in urban motorization levels, travel volume, and travel ratios, thus affecting traffic safety; land use characteristics are also directly related to traffic accident risk, for example, commercial areas have more motor vehicle traffic and more severe congestion, leading to a higher accident risk. Therefore, road traffic safety analysis techniques focusing on the micro-level lack comprehensiveness and cannot integrate traffic safety management into the systematic decision-making process of urban planning, design, and management.
[0004] Therefore, some studies have begun to attempt to quantitatively study the relationship between regional population and economy, land use, traffic operation, road attributes, and traffic safety from a macro perspective. This approach makes it possible to understand traffic safety within the context of urban planning, construction, operation, and management. However, the analytical level of these studies mainly focuses on Traffic Analysis Zones (TAZs), which is relatively singular in dimension and does not fully match the needs of refined governance in the context of current urban renewal.
[0005] Therefore, it is necessary to analyze the impact of non-traffic participant factors such as population distribution, land use type, public buildings, and road infrastructure on the level of urban road traffic safety from the perspective of urban planning, design, operation and management, and to identify key influencing factors. This will not only help improve the level of traffic safety governance, but also provide a scientific basis for urban renewal and urban operation management. Summary of the Invention
[0006] This invention proposes a multi-scale method for analyzing the causes of traffic accidents on road sections with high incidence rates. This method addresses the shortcomings of existing road safety analysis techniques in terms of comprehensiveness and granularity, which fail to meet the needs of traffic safety governance in the context of current urban renewal.
[0007] The present invention adopts the following technical solution.
[0008] A multi-scale method for analyzing the causes of traffic accident-prone road sections, the method comprising the following steps;
[0009] Step S1: Divide the urban roads within the analysis scope into road segments as analysis units to identify road segments with frequent traffic accidents;
[0010] Step S2: From the perspective of urban planning, design and operation management, construct and calculate a multi-scale traffic accident influencing factor index system that meets the requirements at the macro, meso and micro levels.
[0011] Step S3: Train the kernel density analysis model for traffic accidents on the road segment and use the SHAP method to calculate the SHAP value of each influencing factor;
[0012] Step S4: On each accident-prone road segment, compare the degree of influence of each influencing factor on the traffic accidents of the segment by normalizing the SHAP absolute value, and identify the main influencing factors.
[0013] Step S1 specifically includes the following steps:
[0014] Step S101: Within the study area, obtain the road network GIS data within the study area, and divide the road network into road segments using intersections as dividing points;
[0015] Step S102: Calculate the planar distribution of traffic accident kernel density for road segments using historical traffic accident records. Specifically, use geocoding tools provided by internet map service providers to convert the location descriptions in historical traffic accident records into latitude and longitude coordinates, and then represent each accident record as a point on the map. Perform kernel density analysis on all accident points to obtain the traffic accident kernel density distribution of the study area; the geocoding tools include Gaode Map API and Baidu Map API.
[0016] Step S103: Calculate the traffic accident kernel density of the road segment based on the traffic accident kernel density value at the location of the road segment; specifically: divide each road segment into equal parts at a preset interval, and take the average value of the kernel density values at all the division points as the traffic accident kernel density of the road segment.
[0017] Step S104: Use the box plot method to count the traffic accident kernel density of all road segments, and use the upper quartile and interquartile range indicators to calculate the upper limit value index; identify road segments with traffic accident kernel density values exceeding the upper limit value as traffic accident-prone road segments.
[0018] The preset spacing in step S103 is 1 meter.
[0019] Step S2 specifically includes the following steps:
[0020] Step S201: Determine the influencing factors and their indicators at three scales: macro, meso, and micro.
[0021] The macro level refers to the urban area. Macro-level scale influencing factors reflect the impact of the urban area where the road segment is located on the traffic accidents of that road segment. Specific influencing factors include centrality and importance. The centrality-related indicator is the ring level, which is constructed based on the principle of reflecting the distance between the road segment and the city center. The importance-related indicator is the medium centrality, which is constructed based on the principle of reflecting the importance of the road segment in the entire road network.
[0022] The meso-level refers to the street block. Meso-level scale influencing factors reflect the impact of surrounding streets on traffic accidents on the road segment. Influencing factors include population and land use. Population-related indicators include population density, which is constructed to reflect the population size or density of the surrounding streets. Land-related indicators include the proportion of various land use areas, which is constructed to reflect the proportion of various major land uses in the surrounding streets. The various major land uses include commercial and service land, public management land, residential land, and industrial and mining land.
[0023] The micro-level refers to roads, and the influencing factors at the micro-level scale reflect the impact of the attributes of each road segment on traffic accidents. These influencing factors include traffic operation and road safety facilities. The traffic operation-related indicator is traffic saturation, and its construction principle is to reflect the traffic flow characteristics of the road segment, including flow rate, velocity, and density. The road safety facility-related indicators are whether motorized and non-motorized vehicle separation and whether a central divider is installed, and their construction principle is to reflect the construction status of road safety facilities on the road segment.
[0024] Step S202: Calculate the above indicators for each road segment using multi-source urban geographic information data.
[0025] Step S3 specifically includes the following steps:
[0026] Step S301: Construct the dataset: Let the independent variables be indicators of traffic accident influencing factors, including: macro-scale indicators; meso-scale indicators; micro-scale indicators; and the dependent variable be the traffic accident kernel density of road segments.
[0027] Macro-scale indicators include the location of the area and centrality; meso-scale indicators include population density and the proportion of land area of various types; micro-scale indicators include traffic saturation, traffic flow, whether there is separation of motorized and non-motorized traffic, and whether there is a central divider.
[0028] Step S302: Model Training; On the dataset, a multi-scale road segment traffic accident analysis model is trained using the XGBOOST algorithm; Specifically, all variables in the dataset are standardized, and the training set and validation set are divided in a 5:1 ratio; Using Python, the model training function in the XGBOOST package is called, the dependent and independent variables in the training and validation sets are input, and the hyperparameters are optimized using the GridSearchCV package. The result is the road segment traffic accident kernel density analysis model, which reflects the quantitative relationship between the kernel density of traffic accidents in each road segment and the indicators of traffic accident influencing factors.
[0029] Step S303: Model Interpretation; Apply the SHAP method to interpret the model trained by the XGBOOST algorithm, obtaining the SHAP value of each influencing factor index on each accident-prone road segment; specifically: using the road segment traffic accident kernel density analysis model, input the traffic accident influencing factor indexes for each road segment to obtain the model prediction value of the traffic accident kernel density for each road segment; using Python, call the SHAP package, use its model interpretation function, input the model prediction value of the traffic accident kernel density for each road segment and the traffic accident influencing factor indexes to obtain the SHAP value of each traffic accident influencing factor index on each road segment, which reflects the degree of influence of each influencing factor on the traffic accidents of that road segment. The larger the absolute value of SHAP, the greater the degree of influence.
[0030] Step S4 specifically includes the following steps;
[0031] Step S401: On each accident-prone road section, calculate the absolute value of all influencing factor indicators SHAP and divide it by the maximum value to obtain the normalized SHAP absolute value of each indicator.
[0032] Step S402: Among all the indicators corresponding to each influencing factor, take the largest normalized SHAP absolute value as the degree of influence of the influencing factor on the traffic accident of the road section;
[0033] Step S403: On each road segment, all traffic accident influencing factors are divided into three groups according to their degree of influence, from largest to smallest: major influencing factors, minor influencing factors, and other influencing factors.
[0034] Step S403 specifically involves: iterating through all the influence degree characteristic values of all influencing factors, taking the largest influence degree characteristic value as the benchmark value; and dividing all influence degree characteristic values by the benchmark value to obtain the ratio.
[0035] Factors with a ratio greater than or equal to 0.67 are identified as major influencing factors; factors with a ratio greater than or equal to 0.33 and less than 0.67 are identified as minor influencing factors; and factors with a ratio less than 0.33 are defined as other influencing factors.
[0036] The beneficial effects of this invention are as follows: it comprehensively considers the influencing factors of traffic accidents at different scales, including macro, meso, and micro, and explains their degree of influence on traffic accidents, providing a basis for systematically solving traffic safety problems using urban planning, design, and operation management methods; it defines the basic unit of traffic safety analysis as the road segment, and specifically calculates the main influencing factors of each accident-prone road segment, which can adapt to the needs of refined urban governance and support urban renewal initiatives. Attached Figure Description
[0037] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0038] Appendix Figure 1 This is a schematic diagram of the framework of the multi-scale urban road traffic accident frequent incident analysis method of the present invention.
[0039] Appendix Figure 2 This is a schematic diagram of the road segment division and accident-prone road segment identification process of the present invention;
[0040] Appendix Figure 3 This is a schematic diagram illustrating the construction and calculation process of the multi-scale traffic accident influencing factor index system of the present invention;
[0041] Appendix Figure 4 This is a schematic diagram of the training process for the road segment traffic accident kernel density analysis model and the calculation process for the SHAP value of influencing factors in this invention;
[0042] Appendix Figure 5 This is a schematic diagram of the process for identifying factors affecting accident-prone road sections according to the present invention. Detailed Implementation
[0043] 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 invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0044] As shown in the figure, a multi-scale method for analyzing the causes of traffic accident-prone road sections includes the following steps;
[0045] Step S1: Divide the urban roads within the analysis scope into road segments as analysis units to identify road segments with frequent traffic accidents;
[0046] Step S2: From the perspective of urban planning, design and operation management, construct and calculate a multi-scale traffic accident influencing factor index system that meets the requirements at the macro, meso and micro levels.
[0047] Step S3: Train the kernel density analysis model for traffic accidents on the road segment and use the SHAP method to calculate the SHAP value of each influencing factor;
[0048] Step S4: On each accident-prone road segment, compare the degree of influence of each influencing factor on the traffic accidents of the segment by normalizing the SHAP absolute value, and identify the main influencing factors.
[0049] Step S1 specifically includes the following steps:
[0050] Step S101: Within the study area, obtain the road network GIS data within the study area, and divide the road network into road segments using intersections as dividing points;
[0051] Step S102: Calculate the planar distribution of traffic accident kernel density for road segments using historical traffic accident records. Specifically, use geocoding tools provided by internet map service providers to convert the location descriptions in historical traffic accident records into latitude and longitude coordinates, and then represent each accident record as a point on the map. Perform kernel density analysis on all accident points to obtain the traffic accident kernel density distribution of the study area; the geocoding tools include Gaode Map API and Baidu Map API.
[0052] Step S103: Calculate the traffic accident kernel density of the road segment based on the traffic accident kernel density value at the location of the road segment; specifically: divide each road segment into equal parts at a preset interval, and take the average value of the kernel density values at all the division points as the traffic accident kernel density of the road segment.
[0053] Step S104: Use the box plot method to count the traffic accident kernel density of all road segments, and use the upper quartile and interquartile range indicators to calculate the upper limit value index; identify road segments with traffic accident kernel density values exceeding the upper limit value as traffic accident-prone road segments.
[0054] The preset spacing in step S103 is 1 meter.
[0055] Step S2 specifically includes the following steps:
[0056] Step S201: Determine the influencing factors and their indicators at three scales: macro, meso, and micro.
[0057] The macro level refers to the urban area. Macro-level scale influencing factors reflect the impact of the urban area where the road segment is located on the traffic accidents of that road segment. Specific influencing factors include centrality and importance. The centrality-related indicator is the ring level, which is constructed based on the principle of reflecting the distance between the road segment and the city center. The importance-related indicator is the medium centrality, which is constructed based on the principle of reflecting the importance of the road segment in the entire road network.
[0058] The meso-level refers to the street block. Meso-level scale influencing factors reflect the impact of surrounding streets on traffic accidents on the road segment. Influencing factors include population and land use. Population-related indicators include population density, which is constructed to reflect the population size or density of the surrounding streets. Land-related indicators include the proportion of various land use areas, which is constructed to reflect the proportion of various major land uses in the surrounding streets. The various major land uses include commercial and service land, public management land, residential land, and industrial and mining land.
[0059] The micro-level refers to roads, and the influencing factors at the micro-level scale reflect the impact of the attributes of each road segment on traffic accidents. These influencing factors include traffic operation and road safety facilities. The traffic operation-related indicator is traffic saturation, and its construction principle is to reflect the traffic flow characteristics of the road segment, including flow rate, velocity, and density. The road safety facility-related indicators are whether motorized and non-motorized vehicle separation and whether a central divider is installed, and their construction principle is to reflect the construction status of road safety facilities on the road segment.
[0060] Step S202: Calculate the above indicators for each road segment using multi-source urban geographic information data.
[0061] Step S3 specifically includes the following steps:
[0062] Step S301: Construct the dataset: Let the independent variables be indicators of traffic accident influencing factors, including: macro-scale indicators; meso-scale indicators; micro-scale indicators; and the dependent variable be the traffic accident kernel density of road segments.
[0063] Macro-scale indicators include the location of the area and centrality; meso-scale indicators include population density and the proportion of land area of various types; micro-scale indicators include traffic saturation, traffic flow, whether there is separation of motorized and non-motorized traffic, and whether there is a central divider.
[0064] Step S302: Model Training; On the dataset, a multi-scale road segment traffic accident analysis model is trained using the XGBOOST algorithm; Specifically, all variables in the dataset are standardized, and the training set and validation set are divided in a 5:1 ratio; Using Python, the model training function in the XGBOOST package is called, the dependent and independent variables in the training and validation sets are input, and the hyperparameters are optimized using the GridSearchCV package. The result is the road segment traffic accident kernel density analysis model, which reflects the quantitative relationship between the kernel density of traffic accidents in each road segment and the indicators of traffic accident influencing factors.
[0065] Step S303: Model Interpretation; Apply the SHAP method to interpret the model trained by the XGBOOST algorithm, obtaining the SHAP value of each influencing factor index on each accident-prone road segment; specifically: using the road segment traffic accident kernel density analysis model, input the traffic accident influencing factor indexes for each road segment to obtain the model prediction value of the traffic accident kernel density for each road segment; using Python, call the SHAP package, use its model interpretation function, input the model prediction value of the traffic accident kernel density for each road segment and the traffic accident influencing factor indexes to obtain the SHAP value of each traffic accident influencing factor index on each road segment, which reflects the degree of influence of each influencing factor on the traffic accidents of that road segment. The larger the absolute value of SHAP, the greater the degree of influence.
[0066] Step S4 specifically includes the following steps;
[0067] Step S401: On each accident-prone road section, calculate the absolute value of all influencing factor indicators SHAP and divide it by the maximum value to obtain the normalized SHAP absolute value of each indicator.
[0068] Step S402: Among all the indicators corresponding to each influencing factor, take the largest normalized SHAP absolute value as the degree of influence of the influencing factor on the traffic accident of the road section;
[0069] Step S403: On each road segment, all traffic accident influencing factors are divided into three groups according to their degree of influence, from largest to smallest: major influencing factors, minor influencing factors, and other influencing factors.
[0070] Step S403 specifically involves: iterating through all the influence degree characteristic values of all influencing factors, taking the largest influence degree characteristic value as the benchmark value; and dividing all influence degree characteristic values by the benchmark value to obtain the ratio.
[0071] Factors with a ratio greater than or equal to 0.67 are identified as major influencing factors; factors with a ratio greater than or equal to 0.33 and less than 0.67 are identified as minor influencing factors; and factors with a ratio less than 0.33 are defined as other influencing factors.
[0072] Example:
[0073] Please see Figure 1 This embodiment provides a method for analyzing the main influencing factors of urban road traffic accident-prone sections at multiple scales, specifically including the following steps:
[0074] S1: Divide the urban roads within the study area into road segments and identify road segments with frequent traffic accidents.
[0075] S2: From the perspective of urban planning, design and operation management, construct and calculate a traffic accident influencing factor index system that meets the requirements at three different scales: macro, meso and micro.
[0076] S3: Training road segment traffic accident kernel density analysis model, and using the SHAP method to calculate the SHAP value of each influencing factor.
[0077] S4: Further analyze the SHAP value on accident-prone road sections to identify the main influencing factors.
[0078] Figure 2 This is a flowchart for road segmentation and accident-prone road segment identification, which includes the following steps:
[0079] S101: Obtain GIS data of the road network within the study area. Use intersections as dividing points to divide the road network into road segments.
[0080] S102: Using geocoding tools provided by internet map service providers (e.g., Gaode Map API, Baidu Map API), the location descriptions in traffic accident history records are converted into latitude and longitude, and each accident record is then represented as a point on the map. Kernel density analysis is performed on all accident points to obtain the traffic accident kernel density distribution of the study area.
[0081] S103: Divide each road segment into equal parts at 1m intervals, and take the average value of the kernel density values at all division points as the traffic accident kernel density of that road segment.
[0082] S104: Use box plots to calculate the kernel density of traffic accidents across all road segments, and use the upper quartile and interquartile range indicators to calculate the upper limit value. Road segments with kernel density values exceeding the upper limit value are identified as accident-prone road segments.
[0083] Figure 3 This is a flowchart for constructing and calculating a multi-scale index system of influencing factors of traffic accidents, which specifically includes the following steps:
[0084] S201: Determine the influencing factors and their indicators at the macro, meso, and micro levels. See Table 1 for details.
[0085] Table 1 Standard Construction Original
[0086]
[0087] Macro-scale influencing factors reflect the impact of the urban area where the road segment is located on traffic accidents on that road segment. These include two indicators: the area within the urban circle and the degree of centrality.
[0088] Mesoscale factors influencing traffic accidents reflect the impact of surrounding neighborhoods on traffic accidents along a road segment. These factors include five indicators: population density within the grid area, and the proportion of various land uses (commercial / service land, public administration land, residential land, and industrial / mining land).
[0089] Micro-scale factors influencing traffic accidents reflect the impact of the inherent characteristics of each road segment on traffic accidents. These include four indicators: traffic saturation, traffic flow, whether there is separation between motorized and non-motorized traffic, and whether there is a central median.
[0090] S202: The above indicators are calculated for each road segment using multi-source urban geographic information data. The calculation method for each indicator is shown in Table 2.
[0091] Table 2 Calculation Method of Traffic Accident Influencing Factors Indicators
[0092]
[0093] Figure 4 This is a flowchart of the training of the kernel density analysis model for road traffic accidents and the calculation of SHAP values of influencing factors, which specifically includes the following steps:
[0094] S301: Construct the dataset. The independent variables are indicators of traffic accident influencing factors, including: macro-scale indicators (location, centrality); meso-scale indicators (population density, proportion of various land uses); and micro-scale indicators (traffic saturation, traffic flow, whether there is separation between motorized and non-motorized traffic, whether there is a central median). The dependent variable is the traffic accident kernel density of road segments.
[0095] S302: Model Training. Standardize all variables in the dataset and divide the training and validation sets in a 5:1 ratio. Using Python, call the model training function in the XGBOOST package, input the dependent and independent variables from the training and validation sets, and use the GridSearchCV package for hyperparameter optimization. The result is the road segment traffic accident kernel density analysis model. It reflects the quantitative relationship between the traffic accident kernel density and traffic accident influencing factor indicators for each road segment. S303: Model Interpretation. Using the road segment traffic accident kernel density analysis model, input the traffic accident influencing factor indicators for each road segment to obtain the model prediction value of the traffic accident kernel density for each road segment. Using Python, call the SHAP package, use its model interpretation function, input the model prediction value of the traffic accident kernel density for each road segment and the traffic accident influencing factor indicators to obtain the SHAP value of each traffic accident influencing factor indicator for each road segment. It reflects the degree of influence of each influencing factor on the traffic accidents of that road segment. The larger the absolute value of SHAP, the greater the degree of influence. [Explanation of "Using the SHAP method to interpret the model"]
[0096] Figure 5This is a flowchart for identifying the influencing factors of accident-prone road sections, which specifically includes the following steps:
[0097] S401: For each accident-prone road section, calculate the absolute value of the SHAP values of all influencing factor indicators and divide it by the maximum value to obtain the normalized SHAP absolute value of each indicator.
[0098] S402: Among all the indicators corresponding to each influencing factor, take the largest normalized SHAP absolute value as the characteristic value of the influence degree of that influencing factor.
[0099] S403: Iterate through all the influence degree characteristic values of all influencing factors and take the largest influence degree characteristic value as the benchmark value. Divide all influence degree characteristic values by the benchmark value to obtain the ratio. Influencing factors with a ratio greater than or equal to 0.67 are identified as major influencing factors; influencing factors with a ratio greater than or equal to 0.33 and less than 0.67 are identified as minor influencing factors; and those with a ratio less than 0.33 are defined as other influencing factors.
Claims
1. A multi-scale traffic accident-prone section cause analysis method, characterized in that: The analytical method Includes the following steps; Step S1: Divide the urban roads within the analysis scope into road segments as analysis units to identify road segments with frequent traffic accidents; Step S2: From the perspective of urban planning, design and operation management, construct and calculate a multi-scale traffic accident influencing factor index system that meets the requirements at the macro, meso and micro levels. Step S3: Train the kernel density analysis model for traffic accidents on the road segment and use the SHAP method to calculate the SHAP value of each influencing factor; Step S4: On each accident-prone road segment, compare the degree of influence of each influencing factor on the traffic accidents of the road segment by normalizing the SHAP absolute value, and identify the main influencing factors. Step S2 specifically includes the following steps: Step S201: Determine the influencing factors and their indicators for traffic accidents at three scales: macro, meso, and micro. The macro level refers to the urban area. Macro-level scale influencing factors reflect the impact of the urban area where the road segment is located on the traffic accidents of that road segment. Specific influencing factors include centrality and importance. The centrality-related indicator is the ring level, which is constructed based on the principle of reflecting the distance between the road segment and the city center. The importance-related indicator is the medium centrality, which is constructed based on the principle of reflecting the importance of the road segment in the entire road network. The meso-level refers to the street block. Meso-level scale influencing factors reflect the impact of surrounding streets on traffic accidents on the road segment. Influencing factors include population and land use. Population-related indicators include population density, which is constructed to reflect the population size or density of the surrounding streets. Land-related indicators include the proportion of various land use areas, which is constructed to reflect the proportion of various major land uses in the surrounding streets. The various major land uses include commercial and service land, public management land, residential land, and industrial and mining land. The micro-level refers to roads, and the influencing factors at the micro-level scale reflect the impact of the attributes of each road segment on traffic accidents. These influencing factors include traffic operation and road safety facilities. The traffic operation-related indicator is traffic saturation, and its construction principle is to reflect the traffic flow characteristics of the road segment, including flow rate, velocity, and density. The road safety facility-related indicators are whether motorized and non-motorized vehicle separation and whether a central divider is installed, and their construction principle is to reflect the construction status of road safety facilities on the road segment. Step S202: Calculate the above indicators for each road segment using multi-source urban geographic information data; The macro-level layer is calculated based on the city's ring road GIS data. The data source for calculating the median centrality at the macro level is urban road network data. The calculation is performed by defining a road segment network. Specifically, road segments are defined as points, intersections are defined as edges, circles with a preset radius are drawn with each road segment as the center, and road segments outside the circle are removed to construct a road segment subnet. The median centrality of each road segment at the center of its road segment subnet is then calculated.
2. The method for analyzing the causes of traffic accident-prone road sections at multiple scales according to claim 1, characterized in that: Step S1 specifically includes the following steps: Step S101: Within the study area, obtain the road network GIS data within the study area, and divide the road network into road segments using intersections as dividing points; Step S102: Calculate the planar distribution of traffic accident kernel density for road segments using historical traffic accident records. Specifically, this involves using geocoding tools provided by internet map service providers to convert the location descriptions in historical traffic accident records into latitude and longitude, and then representing each accident record as a point on the map; performing kernel density analysis on all accident points to obtain the traffic accident kernel density distribution of the study area; the geocoding tools include Gaode Map API and Baidu Map API. Step S103: Calculate the traffic accident kernel density of the road segment based on the traffic accident kernel density value at the location of the road segment; specifically: divide each road segment into equal parts at a preset interval, and take the average value of the kernel density values at all the division points as the traffic accident kernel density of the road segment. Step S104: Use the box plot method to count the traffic accident kernel density of all road segments, and use the upper quartile and interquartile range indicators to calculate the upper limit value index; identify road segments with traffic accident kernel density values exceeding the upper limit value as traffic accident-prone road segments.
3. The method for analyzing the causes of traffic accident-prone road sections at multiple scales according to claim 2, characterized in that: The preset spacing in step S103 is 1 meter.
4. The method for analyzing the causes of traffic accident-prone road sections at multiple scales according to claim 1, characterized in that: Step S3 specifically includes the following steps: Step S301: Construct the dataset: Let the independent variables be indicators of traffic accident influencing factors, including: macro-scale indicators; meso-scale indicators; micro-scale indicators; and the dependent variable be the traffic accident kernel density of road segments. Macro-scale indicators include the location of the area and centrality; meso-scale indicators include population density and the proportion of land area of various types; micro-scale indicators include traffic saturation, traffic flow, whether there is separation of motorized and non-motorized traffic, and whether there is a central divider. Step S302: Model Training; On the dataset, a multi-scale road segment traffic accident analysis model is trained using the XGBOOST algorithm; Specifically, all variables in the dataset are standardized, and the training set and validation set are divided in a 5:1 ratio; Using Python, the model training function in the XGBOOST package is called, the dependent and independent variables in the training and validation sets are input, and the hyperparameters are optimized using the GridSearchCV package. The result is the road segment traffic accident kernel density analysis model, which reflects the quantitative relationship between the kernel density of traffic accidents in each road segment and the indicators of traffic accident influencing factors. Step S303: Model Interpretation; Apply the SHAP method to interpret the model trained by XGBOOST, and obtain the SHAP value of each influencing factor index on each accident-prone road segment; Specifically: Use the road segment traffic accident kernel density analysis model, input the traffic accident influencing factor index of each road segment, and obtain the model prediction value of the traffic accident kernel density of each road segment; Use Python, call the SHAP package, use the model interpretation function in it, input the model prediction value of the traffic accident kernel density of each road segment and the traffic accident influencing factor index, and obtain the SHAP value of each traffic accident influencing factor index on each road segment, which is used to reflect the degree of influence of each influencing factor on the traffic accident of the road segment. The larger the absolute value of SHAP, the greater the degree of influence.
5. The method for analyzing the causes of traffic accident-prone road sections at multiple scales according to claim 1, characterized in that: Step S4 specifically includes the following steps; Step S401: On each accident-prone road section, calculate the absolute value of all influencing factor indicators SHAP and divide it by the maximum value to obtain the normalized SHAP absolute value of each indicator. Step S402: Among all the indicators corresponding to each influencing factor, take the largest normalized SHAP absolute value as the degree of influence of the influencing factor on the traffic accident of the road section; Step S403: On each road segment, all traffic accident influencing factors are divided into three groups according to their degree of influence, from largest to smallest: major influencing factors, minor influencing factors, and other influencing factors.
6. The method for analyzing the causes of traffic accident-prone road sections at multiple scales according to claim 5, characterized in that: Step S403 specifically involves: iterating through all the influence degree characteristic values of all influencing factors, taking the largest influence degree characteristic value as the benchmark value; and dividing all influence degree characteristic values by the benchmark value to obtain the ratio. Factors with a ratio greater than or equal to 0.67 are identified as major influencing factors; factors with a ratio greater than or equal to 0.33 and less than 0.67 are identified as minor influencing factors; and factors with a ratio less than 0.33 are defined as other influencing factors.