Skip to main content

Theory and Modern Applications

Data science basis and influencing factors for the evaluation of environmental safety perception in Macau parishes

Abstract

In the context of rapid urbanization, accurately identifying the visual factors that influence environmental safety perception is crucial for improving urban transportation environments and enhancing pedestrian safety. With the increase in urban population density and traffic flow, optimizing urban environmental design to elevate residents’ sense of safety has become a key issue in urban planning and management. However, the existing studies face numerous challenges in conducting large-scale quantitative analysis of environmental safety perception in complex scenarios, such as difficulties in data acquisition and limitations in analytical methods. This study addresses these challenges by applying image semantic segmentation and object detection techniques to extract key visual elements from street view images, combined with manual scoring and deep learning methods, to construct a road safety perception dataset. Using a LightGBM model and the SHAP interpretation framework, in this study, we identify the critical visual factors influencing environmental safety perception. An empirical study was conducted in Macau, a modern city where Eastern and Western cultures intersect, and tourism thrives. The findings reveal that: The overall environmental safety perception in the eight parishes and surrounding roads of Macau is relatively high, with significant regional differences in safety perception scores around Macau’s parish roads; The proportions of buildings, sidewalks, roads, and trees in images are the four primary factors influencing environmental safety perception; The proportions and quantities of visual elements interact with each other, and their reasonable distribution helps form clear spatial visibility and creates conducive activity spaces, thereby enhancing the perception of environmental safety. Through empirical analysis, this study uncovers the mechanisms by which visual elements in urban street scenes affect environmental safety perception, providing scientific evidence for urban planning and transportation environment improvement. The research holds theoretical significance and offers practical references for urban design and management, demonstrating broad application value.

1 Introduction

Urban roads are not only a critical component of urban space but also serve as key linkages between different functional areas [1]. With the advancement of urbanization, issues such as traffic congestion, declining quality of pedestrian spaces, and conflicts between pedestrians and vehicles have become increasingly severe. The urban environment profoundly impacts residents’ psychological perceptions and behaviors, with environmental factors playing a crucial role in shaping the perception of safety [2]. Enhancing residents’ sense of safety is fundamental to invigorating urban public spaces and improving the effectiveness of social governance. Therefore exploring the mechanisms influencing environmental safety perception from the user’s perspective holds significant academic and practical importance. Human perception refers to individuals’ psychological experiences of specific locations [3], reflecting their sense of belonging and emotional attachment to those places [4]. Previous research in fields such as environmental psychology [5, 6], urban planning [7, 8], social medicine [9], and social sciences [10] has extensively focused on the relationship between human perception and the environment. Safety perception, as a crucial dimension of perception, was first introduced in Freud’s psychoanalytic theory, referring to an individual’s anticipation of potential physical or psychological danger, manifested as a sense of control and certainty [11]. Safety perception differs from actual safety; it is a complex psychological experience [12, 13], influenced not only by the physical environment [14] but also by social and individual characteristics [15, 16]. Based on this, the current study defines environmental safety perception as pedestrians’ anticipation of negative emotions, such as panic and anxiety, potentially triggered by the physical environment in urban road spaces. This safety perception encompasses not only the fear of crime but also the evaluation of the safety of the physical environment and human activities within that scene. Traditional methods for quantifying environmental perception mainly rely on questionnaires or field interviews [1719], but these approaches are time-consuming and labor-intensive, making large-scale data collection challenging. The development of Virtual Reality (VR) technology offers a new pathway for measuring subjective perception information. However, due to limited accessibility to the necessary equipment, this method has yet to see widespread application [20].

In recent years, the widespread application of street view images has provided rich data resources for urban studies [21]. These images, captured from the pedestrian perspective, display both natural and man-made landscapes of city streets, offering a visual representation of the urban road environment [22]. Street view images are characterized by their wide coverage, easy accessibility, and high clarity [23]. Compared to other spatial-temporal data, street view data better align with human visual perception, allowing for a more accurate depiction of the physical environment [24]. Combined with the rapid development of deep learning technologies, street view data have brought new opportunities to quantitative urban research. Scholars have extensively explored areas such as environmental perception, urban change [25], housing price prediction [26], infrastructure identification [27], demographic analysis [28], and building classification [29]. In the realm of environmental perception studies, topics like walkability, road comfort, and urban safety perception are the primary focus [3032]. The MIT Media Lab was the first to propose the use of paired street view images for comparative analysis, collecting participants’ perceptual results to assess the impact of urban environments on social and economic development [33]. Building on this, Zhang et al. [34] employed machine learning models to automate large-scale image scoring, revealing the distribution of environmental perceptions in Beijing and Shanghai. Additionally, spatiotemporal big data collected from social media have also been leveraged to efficiently and extensively extract evaluations of urban space perception [35], providing a valuable supplement to traditional survey methods. However, the application of this emerging data to the quantitative study of safety perception remains underexplored. Although the quantitative analysis of visual impact factors based on street view data has garnered widespread attention, most existing studies rely on single-factor analysis, often neglecting the interaction between factors. Gestalt psychology suggests that human perception is both holistic and local, with overall perception preceding part perception. Therefore analyzing the impact of a single factor can only partially satisfy perceptual needs, and it is necessary to explore the combined effects of multiple factors [36]. Current quantitative methods predominantly use convolutional neural networks (CNNs) for image segmentation and classification [37], but this approach only provides the proportion of each spatial element and does not determine the actual number of elements. For elements with a large proportion in an image, two scenarios are possible: a single element close to the camera; multiple elements farther from the camera. Without considering the impact of the actual number of elements, results might show identical proportions but differing perceptual outcomes. Therefore it is essential to analyze the synergistic effects of both proportion and actual number of elements on perception and to interpret the differences. In terms of research methods for the relationship between visual elements and environmental perception, the existing studies tend to use linear models such as multiple regression and principal component analysis (PCA) [38]. However, these models typically require assumptions about the underlying relationship between independent and dependent variables [39]. If these assumptions are invalid, then the model results may be biased or incorrect, limiting their ability to reflect true relationships. Given the complex relationship between urban road environments and human perception [4042], whether a nonlinear relationship exists between the two remains to be further explored. In contrast, machine learning models offer significant flexibility, typically requiring no assumptions about the distribution of data and capable of handling missing values, noise, and outliers [43]. Thus they are considered more adept at managing nonlinear relationships in data [44].

Although machine learning demonstrates unique advantages in model prediction and data processing, its “black-box” nature—meaning the inability to explain prediction results—reduces its credibility and limits its application scope. In recent years the interpretability of machine learning models has garnered increasing attention from scholars. Lundberg et al. [45] introduced the SHAP method, which effectively unifies global and local interpretability while aligning its explanatory results with human perception. This method has thus found widespread application across various fields. For instance, Liu Zhiqian et al. [21] utilized this approach to study the relationship between urban features and six types of perceptions; Yang et al. [46] explored the correlation between different features and thermal sensation as well as decision paths; and Qi et al. [47] analyzed the impact of factors such as road conditions on traffic order. In the context of rapid urban development, accurately identifying the visual factors that influence environmental safety perception has become a crucial issue for improving urban transportation environments and enhancing pedestrian safety. As urban population density and traffic flow increase, optimizing urban environmental design to elevate residents’ sense of safety has become a central concern in urban planning and management. However, the existing studies face numerous challenges when conducting large-scale quantitative analysis in complex scenarios, such as difficulties in data acquisition and limitations in analytical methods. To address these issues, this study integrates image semantic segmentation and object detection techniques to extract key visual elements from street view images. Combined with manual scoring and deep learning methods, a road safety perception dataset was constructed. By employing the LightGBM model and the SHAP interpretation framework the study identifies the critical visual factors influencing environmental safety perception.

In summary, alhough the existing studies on urban perception have primarily focused on macrolevel analysis, recent advancements in the field, particularly in the context of complex scenarios, remain underexplored. Moreover, there is a noticeable gap in the integration of cutting-edge machine learning techniques in these studies, especially when analyzing environmental safety perception. This research addresses these gaps by selecting Macau, a unique urban environment where Eastern and Western cultures blend, as a case study. By applying state-of-the-art models such as DeepLabv3+ and YOLOv3 for extracting visual elements and object quantities from street view images and combining these with safety perception scores, a comprehensive road safety perception dataset is constructed. Furthermore, the LightGBM algorithm, coupled with the SHAP interpretability method, is employed to analyze the mechanisms by which visual factors influence environmental safety perception, providing insights into the key elements, their intensity, and the nature of their impact. This approach bridges the gap in the recent literature by integrating machine learning techniques and offering a more detailed exploration of environmental safety perception in complex urban environments.

2 Research methodology

2.1 Research approach

The main approach of the study is as follows: Select the variables for the environmental safety perception model and construct the analytical model; For the selected experimental area, acquire road network and street view image data, identify visual elements, and conduct a safety perception comparison survey; Apply the SHAP method to interpret the model, identify the key visual elements influencing safety perception, and evaluate environmental safety perception; In the conclusion and discussion section, summarize the research findings and propose planning recommendations. The research workflow is illustrated in Fig. 1.

Figure 1
figure 1

Technical workflow of the study on the impact of visual elements on environmental safety perception

2.2 Selection of variables for the environmental safety perception model

(1) Dependent variable of environmental safety perception

The dependent variable in this study is the environmental safety perception score, which is measured on a large scale through a combination of manual evaluation and machine learning. Each street view image sample is defined by two values, the probability of higher safety perception (P) and the probability of lower safety perception (N):

$$\begin{aligned}& \mathrm{P}_{\mathrm{i}} = \frac{\mathrm{p}_{\mathrm{i}}}{\mathrm{p}_{\mathrm{i}} + \mathrm{e}_{\mathrm{i}} + \mathrm{n}_{\mathrm{i}}}, \end{aligned}$$
(1)
$$\begin{aligned}& \mathrm{N}_{\mathrm{i}} = \frac{\mathrm{n}_{\mathrm{i}}}{\mathrm{p}_{\mathrm{i}} + \mathrm{e}_{\mathrm{i}} + \mathrm{n}_{\mathrm{i}}}. \end{aligned}$$
(2)

In the equations, \(\mathrm{P}_{\mathrm{i}}\) represents the probability that street view image i is selected as having a higher safety perception in pairwise comparisons, \(\mathrm{N}_{\mathrm{i}}\) represents the probability that image i is selected as having a lower safety perception in comparisons, \(\mathrm{p}_{\mathrm{i}}\) denotes the number of times image i was chosen, \(\mathrm{n}_{\mathrm{i}}\) denotes the number of times image i was not chosen, and \(\mathrm{e}_{\mathrm{i}}\) represents the number of times image i was considered equal to the comparison image. Using equations (1) and (2), the safety perception score for street view image i is calculated as follows:

$$ Q_{i} = \frac{10}{3} \left ( P_{i} \right . + \frac{1}{p_{i}} \sum _{k_{i} =1}^{p_{i}} P_{k_{i}} - \frac{1}{n_{i}} \sum _{k_{2} =1}^{n_{k_{2}}} N_{k_{2}} + \left . 1 \right ), $$
(3)

where \(\mathrm{k}_{\mathrm{i}}\) means in the comparison between image i and image i, the former is selected as a higher security perception, whereas the latter is not selected, the number of image i and \(\mathrm{P}_{\mathrm{k}_{\mathrm{i}}}\) represents the sum of all unselected images i; accordingly, \(\mathrm{k}_{2}\) means that in the comparison between image i and image i, the latter is selected as a higher security perception, whereas the former is not selected, the number of image i, \(\mathrm{n}_{\mathrm{k}_{2}}\) is the sum of the Ni value of the selected street view image i. The added constant terms 10/3 and 1 normalize the score Q to between 0 and 10. The Q-score is a statistical method that surveys a group of respondents to determine the awareness or liking of a particular item [48]. In this study the Q value was used to quantify the results of environmental safety perceptions of the respondents. The higher the Q score, the higher the degree of safety perception of the Street View picture, and the lower the vice versa.

Given that the comparison count of streetscape images in this study exceeds 60 million, conducting manual comparisons is not feasible due to the significant time and labor costs involved. Therefore deep learning technology was employed for model training. Initially, a dataset for road safety perception was constructed based on manual evaluation results, consisting of 10,000 image comparison sets, with 8000 sets used for training and 2000 sets for testing. Subsequently, a Transformer-based deep learning model ConvNeXt was trained on the safety perception score training set. The model parameters were set as follows: a learning rate of 0.001, Adam optimizer, batch size of 20, 120 epochs, and CrossEntropyLoss as the activation function. The trained model automatically scored the images in the test set, achieving an accuracy of 89.2%. Finally, this model was used to compare the safety perception across all streetscape images, and the score for each image was calculated according to equation (3) and Fig. 2.

Figure 2
figure 2

Process flow for streetscape image safety perception scoring

(2) Explanatory variables for environmental safety perception

The explanatory variables in this study are visual elements, primarily measured through two methods, image semantic segmentation and object detection (Fig. 3). Image semantic segmentation, a crucial area in computer vision, classifies each pixel in an image. Object detection, on the other hand, identifies objects within an image, predicting their categories and locations. The specific process is as follows: Streetscape images are segmented using the MIT ADE20K network model with ConvNeXt as the backbone. This model is pretrained on the ConvNeXt dataset via Baidu PaddleHub, which includes 25,574 streetscape images—20,000 for the training set and 5574 for the validation set—annotated with 150 pixel-level categories. This study focuses on key elements such as the sky, trees, buildings, vehicles, and roads [49, 50]. For object detection, the YOLOv3 network model, pretrained on the COCO2017 dataset and also based on a ResNet50 backbone, is utilized. YOLOv3 demonstrates excellent performance in both processing time and accuracy and is widely applied in areas like vehicle detection and facial recognition [5153]. The COCO2017 dataset contains 80 object categories, divided into 118,000 training images, 5000 validation images, and 41,000 test images, with an average precision (mAP) of 43.2%. Although the multiobject classification model of YOLOv3 does not achieve exceptionally high average detection accuracy, in this study, the number of vehicles, bicycles, and people are selected as visual element indicators. Additionally, a random sample of 200 streetscape images was used to calculate a miss detection rate of 7.93% and a false detection rate of 6.3%, indicating that the model results for these three indicators are satisfactory for the study requirements.

Figure 3
figure 3

Quantification process of visual elements

2.3 Model construction and interpretive analysis

2.3.1 Building the environmental safety perception model using LightGBM

In this study, the LightGBM algorithm is employed to model the relationship between environmental safety perception and visual elements. LightGBM (Light Gradient Boosting Machine) is an enhancement method based on Gradient Boosting Decision Trees (GBDT) [54]. This algorithm introduces Gradient-based One-side Sampling (GOSS), which effectively excludes most small-gradient samples, retaining only large-gradient samples for information gain calculations. This approach reduces the amount of training data while maintaining model accuracy. Additionally, LightGBM utilizes a leafwise growth strategy with depth limitations, meaning that it iteratively selects the leaf node with the highest split gain for splitting. This process is repeated until all splits are completed. The leafwise strategy reduces errors and enhances accuracy compared to traditional levelwise methods under the same number of splits. Limiting the maximum tree depth (Max-depth) further helps prevent overfitting. Compared to Random Forest and XGBoost, LightGBM exhibits distinct advantages in the following aspects: (1) Faster training speed: LightGBM utilizes a histogram-based decision tree algorithm combined with GOSS, which significantly accelerates training speed when processing large-scale datasets, outperforming traditional models like Random Forest and XGBoost. (2) Lower memory consumption: LightGBM effectively reduces memory usage through its histogram algorithm during training, particularly when handling high-dimensional features. This lower memory consumption is especially critical for processing large datasets, making LightGBM more efficient than Random Forest and XGBoost. (3) Ability to handle nonlinear relationships: Unlike traditional linear models, LightGBM introduces a nonlinear splitting strategy, which better captures the complex nonlinear relationships between features and target variables. Compared to the global model approach of Random Forest, LightGBM optimizes each split progressively, enhancing the model’s predictive power. (4) Model interpretability: Although XGBoost may offer high accuracy in certain cases, its outputs are often difficult to interpret. By integrating the SHAP method, LightGBM not only delivers strong predictive accuracy but also provides intuitive explanations for the contribution of each feature through SHAP values. This level of interpretability has significant practical value in policy-making and urban planning.

In summary, compared to traditional algorithms, LightGBM offers faster training speeds, lower memory consumption, and higher accuracy, making it one of the most optimal boosting methods currently available.

2.3.2 Quantifying the impact of visual elements on environmental safety perception using SHAP

SHAP (SHapley Additive exPlanations) is a tool used to interpret model outputs, derived from the Shapley values in cooperative game theory [45]. SHAP can quantify the impact of each factor on the model’s prediction for individual samples, indicating whether the influence is positive or negative. This method provides a unified approach to both global and local explanations of machine learning models [54, 55]. In this study the SHAP method is used to assess the impact of visual elements on environmental safety perception, with each element being assigned a corresponding SHAP value.

$$ \mathrm{g} \left ( \acute{\mathrm{Z}} \right ) = \emptyset _{0} + \sum _{\mathrm{i}=1}^{\mathrm{M}} \emptyset _{\mathrm{i}} \acute{\mathrm{Z}}_{\mathrm{i}}. $$
(4)

In the equation, g(z´) represents the predicted value of environmental safety perception for the visual element z´, Ø0 denotes the average environmental safety perception value, M indicates the number of elements in the perception model, Øi is the SHAP value for the ith visual element, and z´i{0,1} indicates whether the ith visual element is included in the model prediction. The formula for calculating SHAP values is as follows [45]:

$$ \emptyset _{i} = \sum _{\acute{Z} \subseteq f \backslash \left \{ i \right \}} \frac{\left \vert \acute{z} \right \vert ! \left ( M- \left \vert \acute{z} \right \vert -1 \right ) !}{M!} \left [ f_{x} \left ( \acute{z} \right ) - f_{x} \left ( \acute{z} \backslash i \right ) \right ], $$
(5)

In the equation, Øi represents the SHAP value of the ith visual element; \(\left \vert \acute{z} \right \vert \) denotes the set of visual elements involved in the prediction; M represents the entire set of visual elements; and \(\left \vert \acute{z} \right \vert ! \left ( M- \left \vert \acute{z} \right \vert -1 \right ) !\) is the factorial of the number of elements in a set ź multiplied by the factorial of the number of elements in ź excluding element i. This accounts for all possible sequences of elements that include element i. \(f_{x} \left ( \acute{z} \right ) - f_{x} \left ( \acute{z} \backslash i \right )\) represents the change in environmental safety perception value after adding element i. In this study, SHAP values represent the weighted sum of differences in safety perception scores across different scenes, considering various combinations of visual elements.

3 Data sources and processing

3.1 Overview of the study area

Macau, a special administrative region of China, is composed of eight parishes and is located on the western shore of the Pearl River Delta, bordering Zhuhai City. With a rich historical background and diverse culture, Macau has long served as a significant gateway for cultural exchanges between China and the Western world, making it a unique city where Eastern and Western cultures intersect. This cultural backdrop has deeply influenced Macau’s urban landscape, social structure, and the lifestyle of its residents. As a result, Macau is not only a renowned tourist destination but also a vital commercial and economic hub. Despite its small size and limited land resources, Macau has continuously expanded its urban scale and infrastructure through land reclamation and scientific urban planning to meet the growing needs of its residents and tourists. The tourism and gaming industries are the pillars of Macau’s economy, driving local prosperity. However, Macau does not solely rely on these traditional economic sectors but is also actively developing its convention, exhibition, and financial services industries to enhance its competitiveness on the international stage. Macau’s unique historical background is reflected not only in its diversified economy but also in its distinctive urban environment and public security. The Macau government places great emphasis on social order and public safety, ensuring the security of residents and tourists through a comprehensive legal framework, efficient law enforcement mechanisms, and broad community engagement. This historical and cultural context has made environmental safety perception an important consideration in urban planning and management. Historically, Macau has been a city of immigrants, with a multicultural and complex social structure. This background has added challenges to urban management, particularly in maintaining social order and public safety. The government has made ongoing efforts to enhance urban infrastructure and promote community participation, encouraging residents to actively contribute to maintaining a safe and harmonious city. In response to challenges such as high population density and environmental pressures, Macau has worked in various ways to improve the quality of life and sense of security for its residents. While promoting sustainable urban development, Macau has maintained its unique historical and cultural charm, providing both residents and tourists with a vibrant yet safe environment for living and visiting. This multicultural and complex social environment gives Macau’s environmental safety perception its distinctiveness, offering rich context and a unique perspective for this study. (See Fig. 4.)

Figure 4
figure 4

Study area

3.2 Data sources and processing

The data for this study primarily consist of two parts: streetscape image data and environmental safety perception data.

  1. (1)

    Streetscape Image Data: Road data for the study area was extracted from Open Street Map (OSM). After topological checks and geographic alignment, all roads were segmented at intersections. For road segments shorter than 50 meters, a sampling point was selected at the segment center. For segments longer than 50 meters, sampling points were selected at 100-meter intervals. A total of 10,442 sampling points were selected. Using the Google Maps API, streetscape images were obtained for each sampling point from the end of 2022 to the end of 2023. The specific request parameters were set as follows: a pitch angle of 0 degrees, an image size of 1024 pixels by 512 pixels, and each sampling point’s panoramic photo was divided into four images, corresponding to 0°, 90°, 180°, and 270°. Due to the absence of streetscape images at some sampling points, a total of 10,442 streetscape images were ultimately collected.

Although the SHAP method was used to interpret the model output, further in-depth analysis is recommended to explore how these interpretations can be applied in practical urban planning and design, thereby enhancing the practical value of research. After data acquisition, a multistep cleaning and preprocessing process was carried out to ensure the quality and representativeness of the imagery data. First, for sampling points with missing street view images, images from adjacent road segments were supplemented to maintain data continuity and completeness. Second, duplicate images were removed to avoid data redundancy that could affect the analysis results. For images with poor quality or significant obstructions (e.g., buildings, vehicles blocking key visual elements), an image quality detection algorithm was used to filter them, and in necessary cases, new images were obtained, or substitute images were used. During image preprocessing, enhancement techniques such as contrast adjustment and noise reduction were applied to improve the clarity and usability of the images. To address differences in color and brightness across images, standardization was performed to ensure that all images were analyzed under consistent visual conditions. Additionally, to eliminate potential viewpoint bias between different sampling points, the shooting angles of the images were uniformly corrected.

  1. (1)

    Safety Perception Scoring Data: From May to June 2024, a safety perception survey was conducted using the streetscape images. A random selection of 2000 images was made from the previously acquired dataset, and the safety perception (SP) method was employed to assess the images. 88 volunteers participated in the survey, evenly split between 44 males and 44 females, each constituting 50% of the sample. The participants were also divided equally by age groups, with 44 individuals aged 18–30 and 44 aged 31–64, each representing 50% of the sample. Among the volunteers, 50 had backgrounds in architecture, urban planning, or art design, whereas 38 had nonprofessional backgrounds, resulting in a ratio of 1.3:1. This diversity in background ensured a broad perspective among the evaluators. Each volunteer rated the sample images on a scale of 1 to 10, culminating in the safety perception scores for the images.

To avoid sample selection bias, 2000 street view images were randomly selected from different neighborhoods for analysis. These images cover all parishes of Macau, ensuring the broadness and representativeness of the data sample. However, despite the randomness and diversity in sample selection, the environmental characteristics of different neighborhoods may still affect the generalizability of the study results. For example, certain neighborhoods may have higher greenery coverage or more modern facilities, which could result in higher safety perception scores, while other neighborhoods may score lower due to poor infrastructure or high pedestrian density.

4 Results and analysis

4.1 Spatial distribution and evaluation of safety perception

The safety perception scores of the 10,442 images were color-coded in descending order, revealing the spatial distribution of environmental safety perception across Macau (Fig. 5). The overall safety perception in the eight parishes and surrounding roads of Macau is relatively high. However, there are noticeable regional differences in safety perception scores around the Macau parish. High-safety perception areas are primarily concentrated in the city center and commercial districts, characterized by a high degree of modernization and well-developed infrastructure. These areas are clean, well maintained, and equipped with comprehensive facilities, resulting in higher safety perception scores. Medium-safety perception areas are more scattered, mostly found in residential areas and public service locations where the environment is decent but requires further improvement. Low-safety perception areas are concentrated in older districts and city outskirts with poor infrastructure and cluttered environments, which need significant enhancement and improvement. The safety perception scores for the eight parishes and surrounding roads were extracted and displayed in a box plot (Fig. 6). Among them, the Nossa Senhora de Fátima Parish has the highest average safety perception score (M=5.8, SD=0.84), followed by the Cotai and Sé Parishes (both M=4.80, SD=0.84). The Santo António Parish shows the greatest variability in safety perception scores (M=3.40, SD=1.14), whereas the Nossa Senhora do Carmo and São Lázaro Parishes have moderate variability (M=3.80, SD=0.84). The São Francisco Xavier Parish has the least variability (M=5, SD=0.71), and the São Lourenço Parish has the lowest average safety perception score (M=2.80, SD=0.84). These findings reveal significant spatial differences in safety perception scores across Macau’s eight parishes. The Nossa Senhora de Fátima and São Francisco Xavier Parishes exhibit higher and more stable safety perception scores, indicating that these areas are characterized by beautiful environments, well-developed infrastructure, including good road conditions, abundant greenery, modern public facilities, and efficient community services. These favorable conditions collectively enhance the safety perception of residents and visitors. In contrast, the São Lourenço Parish has the lowest safety perception score, reflecting significant environmental and infrastructure issues, such as severe road damage, chaotic traffic management, low green coverage, and inadequate and poorly maintained public facilities. These problems severely impact the safety perception of residents and visitors, necessitating targeted improvements. Additionally, the Santo António Parish displays the most significant fluctuation in safety perception scores, indicating substantial variability in environmental and infrastructure quality within the parish. Some areas may have favorable conditions, whereas others may exhibit notable deficiencies. This imbalance leads to large fluctuations in scores, highlighting areas that require focused attention and improvement.

Figure 5
figure 5

Distribution of safety perception scores for roads surrounding Macau’s parishes

Figure 6
figure 6

Box plot of safety perception scores for Macau’s parishes and surrounding roads

4.2 Analysis of factors influencing environmental safety perception

(1) Analysis of the impact of visual elements on environmental safety perception

Figure 7 illustrates the overall impact of visual elements on environmental safety perception. The labels on the left side are ranked by the importance of each element, whereas the horizontal axis represents the SHAP values, indicating the weight of each element’s influence. The wider the distribution of the SHAP values, the greater the influence of that element. Each point on the chart represents a sample, with color indicating the value of each element—redder colors represent higher values, whereas bluer colors indicate lower values. By analyzing the SHAP chart it is evident that roads are the most significant factor influencing safety perception. High feature values of roads have a notable positive impact on the model output, suggesting that good road conditions significantly enhance the safety perception of residents and visitors. Trees and sidewalks also positively contribute to safety perception, with higher feature values leading to an increase in perceived safety. This indicates that sufficient greenery and well-maintained sidewalks can significantly improve safety perception. Conversely, the sky is the least influential element, with relatively concentrated and lower SHAP values. An excess of vehicles, fences, walls, and high pedestrian density negatively impacts safety perception, indicating that crowded environments and poor infrastructure lead to decreased safety perception. Therefore optimizing road conditions, increasing greenery, improving sidewalk facilities, and managing vehicle and pedestrian flow can effectively enhance environmental safety perception. Since the proportions of sidewalks, trees, roads, and buildings in images have the most significant impact on environmental safety perception, this study further analyzes these four key elements. Figures 8(a–d) describe the relationship between the SHAP values and the image proportion of these visual elements. In Figs. 8(a, b, c), as the image proportions of buildings, roads, and sidewalks increase, SHAP values generally show a downward trend. Higher proportions of these elements in images negatively impact environmental safety perception, leading to a decrease in perceived safety. High-density buildings typically imply more high-rise structures and less open space, which can create a sense of oppression and overcrowding, reducing visual comfort and thus lowering safety perception. A higher proportion of road images usually indicates more roads, vehicles, and traffic signs, increasing visual complexity and distraction. Such a complex road environment can induce tension and unease, thereby lowering safety perception. In areas with high sidewalk density, poorly maintained sidewalks with issues like cracks and uneven surfaces can increase the risk of walking, thereby decreasing the perceived safety of the environment. Figure 8(d) illustrates the relationship between the proportion of tree images and environmental safety perception. As the proportion of tree images increases, SHAP values generally trend upward. A higher proportion of tree images positively contributes to environmental safety perception. When the tree image proportion exceeds 0.15, its positive impact on safety perception is most significant. Although an increase in trees improves safety perception even below the 0.15 threshold, the effect is not as pronounced as in higher proportions. Trees and greenery enhance visual comfort and pleasure. A well-greened environment typically makes people feel relaxed and secure, thereby boosting safety perception. Research has shown that exposure to natural environments and green spaces positively impacts mental health, reducing stress and anxiety, and enhancing feelings of well-being and safety.

Figure 7
figure 7

Overall impact of visual elements on environmental safety perception

Figure 8
figure 8

SHAP feature dependence plots

  1. (1)

    Interaction effects of two factors on environmental safety perception

Figure 8(a) shows the interaction analysis of the four key visual perception factors. Aside from the diagonal self-correlations, the interactions between buildings and trees, sidewalks and trees, and roads and trees are particularly notable. Therefore the following discussion will focus on these three interactions. Figures 9(b–d) depict the interaction effects between two visual elements on SHAP values. The x-axis represents one factor, and the y-axis represents the SHAP value; the color of the scatter points represents the other factor, with blue indicating lower values and red indicating higher values. In Fig. 9(b), when the proportion of building images is below 0.1, the impact on environmental safety perception is uncertain, with SHAP values widely distributed. As the proportion of building images increases from 0.1 to 0.3, SHAP values gradually turn negative, indicating the emerging negative impact of building density on safety perception. When the proportion exceeds 0.3, the negative impact becomes significant, with most SHAP values concentrated between -0.5 and -1.5. On the other hand, a higher proportion of tree images can mitigate the negative effects of building density to some extent, particularly when the building image proportion is between 0.1 and 0.3. Although in high-density building areas (building image proportion > 0.3), the positive impact of tree images is limited, it still slightly reduces the negative effect. To enhance the safety perception of urban environments, urban planning should focus on increasing green coverage, especially in high-density building areas, by strategically incorporating green spaces to improve overall environmental quality and residents’ living experiences. In Fig. 9(c), when the proportion of road images is below 0.1, the impact on environmental safety perception is uncertain, with SHAP values widely distributed. As the proportion of road images increases from 0.1 to 0.3, SHAP values gradually turn negative, indicating the negative impact of road density on safety perception. When the proportion exceeds 0.3, the negative impact becomes significant, with most SHAP values concentrated between -0.5 and -2.0. Similarly to buildings, a higher proportion of tree images can alleviate the negative effects of road density, especially when the road image proportion is between 0.1 and 0.3. Although in high-density road areas (road image proportion > 0.3), the positive impact of tree images is limited, it still slightly reduces the negative effect. To improve the safety perception of urban environments, urban planning should focus on increasing green coverage, especially in high-density road areas, by strategically incorporating green spaces to enhance overall environmental quality and residents’ living experiences. In Fig. 9(d), when the proportion of sidewalk images is below 0.05, the impact on environmental safety perception is uncertain, with SHAP values widely distributed. As the proportion of sidewalk images increases from 0.05 to 0.15, SHAP values gradually turn negative, indicating the negative impact of sidewalk density on safety perception. When the proportion exceeds 0.15, the negative impact becomes significant, with most SHAP values concentrated between -0.5 and -2.0. Again, a higher proportion of tree images can mitigate the negative effects of sidewalk density to some extent, particularly when the sidewalk image proportion is between 0.05 and 0.15. Although in high-density sidewalk areas (sidewalk image proportion > 0.15), the positive impact of tree images is limited, it still slightly reduces the negative effect. To enhance the safety perception of urban environments, urban planning should focus on increasing green coverage, especially in high-density sidewalk areas, by strategically incorporating green spaces to improve overall environmental quality and residents’ living experiences.

Figure 9
figure 9

Interaction effects of two factors on SHAP value

Figure 10 analyzes the interaction between the proportion of visual elements and the number of visual elements. In Fig. 10(a), focusing on the image proportion of people and the number of people, the negative impact begins to manifest when the number of people increases to between 1 and 3, with SHAP values gradually turning negative. When the number of people exceeds 3, the negative impact becomes significant, with most SHAP values concentrated below -0.5. This result aligns with previous studies. American anthropologist Edward T. Hall proposed four types of spatial distances: intimate distance, personal distance, social distance, and public distance. The “social distance,” generally ranging from 1.2 to 3.6 meters, refers to the communication distance between strangers, such as the distance between someone asking for directions and the person giving directions in an urban road setting. If this distance falls below the typical range, then people tend to feel uncomfortable. The personal space is a manifestation of a sense of security, and the pursuit of security is an instinctual human behavior. When this psychological space is infringed upon, it can trigger feelings of discomfort and anxiety [56]. Figure 10(b) shows the interaction between the number of vehicles and the vehicle image proportion. When the number of vehicles is less than 5, the impact on environmental safety perception is uncertain and relatively unstable. The negative impact begins to appear when the number of vehicles ranges from 5 to 10, and it becomes significant when the number exceeds 10. Therefore, to enhance the perception of environmental safety, it is advisable to control the number of vehicles to fewer than 5, avoiding the significant negative impact associated with high vehicle density. Given that people play a fundamental role in urban scenarios [57, 58], it is necessary to further explore the impact of human activity in road spaces on urban perception in future research.

Figure 10
figure 10

Interaction effects of visual element proportion and number on SHAP value

There is a complex interaction between visual elements, and this interaction forms the basis of the nonlinear relationship. The impact on safety perception significantly intensifies, such as when vehicle density exceeds a certain threshold, leading to a noticeable decrease in perceived safety. Additionally, human psychological responses exhibit nonlinear characteristics—when faced with a complex visual environment, an individual’s safety perception is modulated by multiple psychological factors, which may amplify or diminish the influence of certain visual elements. Through the SHAP method, the specific impact of each visual element on environmental safety perception has been quantified, confirming the existence of these nonlinear relationships. This in-depth exploration not only enriches the theoretical foundation in the field of urban environmental perception but also provides valuable practical references for urban planning and design.

5 Discussion

Based on the research conclusions, the following planning recommendations are proposed to improve safety perception across the eight parishes of Macau:

(1)Rational Planning of Building Mass and Streetfront Heights: During the development of the Taipa New District and the renovation of the old city on the peninsula, building mass and streetfront heights should be carefully planned to avoid excessive sky gaps or dense high-rise buildings obstructing the view. This will help enhance the visual permeability of the neighborhoods and improve the spatial sense of safety.

(2)Tree Species Selection and Canopy Coordination: Tree species should be selected based on regional characteristics and canopy size coordination. For example, small-canopy shrubs should be chosen for wide commercial pedestrian streets to reduce obstruction of buildings. On the sides of urban roads, larger-canopy trees can be used to emphasize the apex positions and reinforce the directionality of the roads, making people feel safer in an orderly spatial sequence.

(3)Optimization of Sidewalk Layout: Sidewalks should be designed follwing road design standards while also considering regional pedestrian traffic forecasts to meet actual needs and avoid discomfort caused by overcrowding. Proper sidewalk width and layout can effectively enhance pedestrian safety perception.

(4)Enhanced Traffic Regulation: Traffic regulation should be strengthened, with strict penalties for illegal parking on the roadside and encroachment on sidewalks. Reducing the negative impact of vehicular traffic on pedestrian spaces and ensuring the cleanliness and smoothness of pedestrian areas can significantly improve overall safety perception.

(5)Enhancing the Safety and Convenience of Public Transportation: The perception of safety in public transportation is directly linked to residents’ daily travel experiences. It is recommended to strengthen security measures at major bus and metro stations, such as increasing the presence of security personnel, installing more cameras, and providing emergency call equipment. Additionally, improving the convenience of public transportation, such as expanding night bus routes and reducing wait times, can effectively shorten waiting periods during nighttime or in remote locations, thereby reducing feelings of insecurity.

As a region where Eastern and Western cultures intersect, Macau’s unique historical background and cultural diversity may significantly influence residents’ perception of environmental safety. In this study, we primarily focused on the impact of visual elements and urban planning on environmental safety perception. However, cross-cultural factors, such as habits in using public spaces, differing definitions and expectations of safety, and behavior norms in public settings under different cultural backgrounds, may also significantly affect how safety is perceived. In Macau, residents and visitors from diverse cultural backgrounds may have varying perceptions of environmental safety. For instance, people from Western cultural backgrounds might place more emphasis on nighttime lighting and neighborhood security measures, whereas those from Eastern cultural backgrounds may value the social atmosphere of the community and neighborly relationships. These cultural differences could lead to significant variations in safety perception and evaluation in the same environment. Therefore we recommend the future research to consider cross-cultural factors and conduct both quantitative and qualitative surveys among groups with different cultural backgrounds to analyze whether these factors significantly influence the study’s findings on environmental safety perception. Specifically, comparing safety perception scores of respondents from different cultural backgrounds in the same environment could help determine whether cultural background is a key factor influencing safety perception. If future research reveals that cultural background has a significant impact, then urban planning and safety strategies should account for these cultural differences to ensure that proposed measures can meet the needs of different groups.

5.1 Research limitations

This research used the LightGBM model and SHAP method to analyze the perception of environmental safety in eight districts of Macau. Although meaningful results were obtained, several limitations remain. First, although the LightGBM model performs well in handling nonlinear relationships and high-dimensional data, its performance may be affected by the regional characteristics of the data and specific environmental factors. Second, the potential biases from data sample selection should be carefully considered. The data samples in this study were primarily derived from street view images of specific neighborhoods in Macau. Although these data reflect certain regional characteristics, the limited sampling scope may not fully represent the perception of environmental safety across the entire city or in different areas. Moreover, potential errors in data collection, such as variations in image quality and differences in collection time, could also impact the accuracy of model training and prediction. These biases may, to some extent, limit the generalizability of the results. In addition, errors in the data processing phase could affect the accuracy of quantifying indicators. Given the complexity of street view image processing, errors may be introduced during image segmentation, feature extraction, and other stages, which would directly influence the final output of the model. Lastly, due to time and resource constraints, the scope of this study was relatively small, focusing mainly on the eight districts of Macau. If a broader range of street view data could be collected and combined with other types of data (such as socioeconomic data and resident surveys), it would help improve the predictive accuracy and scientific robustness of the model, leading to a more comprehensive understanding of the factors influencing environmental safety perception.

5.2 Research prospect

As a region where Eastern and Western cultures intersect, Macau’s unique historical background and cultural diversity may significantly influence residents’ perception of environmental safety. In this study, we mainly focused on the impact of visual elements and urban planning on environmental safety perception. However, cross-cultural factors, such as habits in using public spaces, definitions and expectations of safety, and behavioral norms in public settings under different cultural backgrounds, may also significantly affect residents’ sense of safety. In Macau, residents and visitors from different cultural backgrounds may perceive environmental safety differently. For example, individuals from Western cultures may pay more attention to nighttime lighting and neighborhood security measures, whereas those from Eastern cultures might place greater emphasis on the social atmosphere and neighborly relations within the community. These cultural differences could result in significant variations in how different groups perceive and evaluate safety in the same environment. Therefore we recommend that future studies incorporate cross-cultural factors and analyze whether these factors significantly affect the research outcomes on environmental safety perception through both quantitative and qualitative surveys of groups from diverse cultural backgrounds. Specifically, by comparing safety perception scores from respondents of different cultural backgrounds within the same environment, it can be explored whether cultural background is an important factor influencing safety perception. If future research reveals that cultural background significantly impacts safety perception, then urban planning and safety strategies should take these cultural differences into account to ensure that the proposed measures are adaptable to and meet the needs of different groups.

6 Conclusions

This study, based on the LightGBM and SHAP interpretative framework, evaluated environmental safety perception and its influencing factors, with an empirical analysis conducted on the eight parishes of the Macau Special Administrative Region. By integrating streetscape image data with machine learning techniques a road safety perception dataset was constructed as the dependent variable for the model, whereas the streetscape images were processed to obtain the independent variables. The LightGBM algorithm was used to build the environmental safety perception model, and SHAP was employed to conduct an interpretative analysis of the machine learning model, identifying key visual elements influencing safety perception and analyzing their impact mechanisms. The main conclusions are as follows:

(1)The overall environmental safety perception across the eight parishes of Macau is relatively high. High-safety perception areas are primarily concentrated in the city center and commercial districts, characterized by a high level of modernization and well-developed infrastructure. Low-safety perception areas are concentrated in older districts and city outskirts with poor infrastructure and cluttered environments. Among the parishes, Nossa Senhora de Fátima has the highest average score, Santo António shows the greatest variability in ratings, São Francisco Xavier has the least variability, and São Lourenço has the lowest score.

(2)Buildings, sidewalks, roads, and trees are the four most significant factors influencing environmental safety perception. Among them, trees have a positive impact on safety perception, whereas buildings, sidewalks, roads, people, and vehicles have a suppressive effect. The mapping relationships between various visual elements and SHAP values differ, with trees exhibiting a relatively clear linear relationship. As the density of buildings, roads, sidewalks, and the number of vehicles increase, the SHAP value for safety perception becomes increasingly negative, indicating a negative impact on safety perception. Conversely, as the proportion of tree images increases, the SHAP value becomes more positive, indicating that trees positively influence environmental safety perception. This finding confirms the existence of a nonlinear relationship between the urban road environment and human perception, contributing to the theoretical understanding of the relationship between urban environments and human emotions.

(3)There is an interaction between the proportion and number of visual elements, suggesting that a reasonable arrangement of elements can optimize spatial visibility and thus enhance environmental safety perception. For example, when the proportion of tree images is high, small-scale buildings make people feel safer. There is also a synergistic effect between the number and proportion of visual elements; when the number of people and vehicles is low, lower proportions of people and vehicle images enhance safety perception. This finding aligns with psychological research and also indicates that human activities influence environmental safety perception.

Data availability

The datasets used and/or analyzed during the current study are available from the corresponding author upon reasonable request.

References

  1. Shihai, K., Yao, Y., Hong, Z., et al.: Evaluation of urban traffic layout in Chinese cities based on road network data and complex graph theory. J. Geo-Inform. Sci. 23(5), 812–824 (2021)

    Google Scholar 

  2. Gehl, J.: Cities for People. Island Press, Washington (2010)

    Google Scholar 

  3. Ordonez, V., Berg, T.L.: Learning high-level judgments of urban perception. In: Computer Vision – ECCV 2014, pp. 494–510. Springer, Cham (2014)

    Chapter  Google Scholar 

  4. Tuan, Y.F.: Space and Place: The Perspective of Experience. University of Minnesota Press, Minneapolis (1977)

    Google Scholar 

  5. Kaplan, R., Kaplan, S.: The Experience of Nature: A Psychological Perspective. Cambridge University Press, Cambridge (1989)

    Google Scholar 

  6. Ulrich, R.S., Simons, R.F., Losito, B.D., et al.: Stress recovery during exposure to natural and urban environments. J. Environ. Psychol. 11(3), 201–230 (1991)

    Article  Google Scholar 

  7. Lynch, K.: The Image of the City. MIT Press, Cambridge (1964)

    Google Scholar 

  8. Ma, X., Chau, C.K., Lai, J.H.K.: Critical factors influencing the comfort evaluation for recreational walking in urban street environments. Cities 116, 103286 (2021)

    Article  Google Scholar 

  9. Duncan, M.J., Mummery, W.K., Steele, R.M., et al.: Geographic location, physical activity and perceptions of the environment in Queensland adults. Health Place 15(1), 204–209 (2009)

    Article  Google Scholar 

  10. Weimann, H., Rylander, L., van den Bosch, M.A., et al.: Perception of safety is a prerequisite for the association between neighbourhood green qualities and physical activity: results from a cross- sectional study in Sweden. Health Place 45, 124–130 (2017)

    Article  Google Scholar 

  11. Lijuan, A., Zhong, C.: A review of research on safety perception. Chin. J. Behav. Med. Sci. 12(6), 698–699 (2003)

    Google Scholar 

  12. Márquez, L.: Safety perception in transportation choices: progress and research lines. Ingen. Compet. 18(2), 11–24 (2016)

    Google Scholar 

  13. Li, X.J., Zhang, C.R., Li, W.D.: Does the visibility of greenery increase perceived safety in urban areas? Evidencefrom the place pulse 1.0 dataset. ISPRS Int.l J. Geo-Inf. 4(3), 1166–1183 (2015)

    Article  Google Scholar 

  14. Yao, Y., Liang, Z.T., Yuan, Z.H., et al.: A human-machine adversarial scoring framework for urban perception assessment using street-view images. Int. J. Geogr. Inf. Sci. 33(12), 2363–2384 (2019)

    Article  Google Scholar 

  15. Van der Wurff, A., Van Staalduinen, L., Stringer, P.: Fear of crime in residential environments: testing a social psychological model. J. Soc. Psychol. 129(2), 141–160 (1989)

    Article  Google Scholar 

  16. Farrall, S., Bannister, J., Ditton, J., et al.: Social psychology and the fear of crime. Br. J. Criminol. 40(3), 399–413 (2000)

    Article  Google Scholar 

  17. Grahn, P., Stigsdotter, U.K.: The relation between perceived sensory dimensions of urban green space and stress restoration. Landsc. Urban Plan. 94(3/4), 264–275 (2010)

    Article  Google Scholar 

  18. Kabisch, N., Qureshi, S., Haase, D.: Human-environment interactions in urban green spaces: a systematic review of contemporary issues and prospects for future research. Environ. Impact Assess. Rev. 50, 25–34 (2015)

    Article  Google Scholar 

  19. Dadvand, P., Bartoll, X., Basagaña, X., et al.: Green spaces and general health: roles of mental health status, social support, and physical activity. Environ. Int. 91, 161–167 (2016)

    Article  Google Scholar 

  20. Baran, P.K., Tabrizian, P., Zhai, Y., et al.: An exploratory study of perceived safety in a neighborhood park using immersive virtual environments. Urban For. Urban Greening 35, 72–81 (2018)

    Article  Google Scholar 

  21. Zhiqian, L., Jianjun, L., Yao, Y., et al.: Research method of explainable urban perception models based on streetscape images. J. Geo-Inform. Sci. 24(10), 2045–2057 (2022)

    Google Scholar 

  22. Liying, Z., Tao, P., Yijin, C., et al.: A review of urban environment evaluation based on streetscape images. J. Geo-Inf. Sci. 21(1), 46–58 (2019)

    Google Scholar 

  23. Biljecki, F., Ito, K.: Street view imagery in urban analytics and GIS: a review. Landsc. Urban Plan. 215, 104217 (2021)

    Article  Google Scholar 

  24. Helbich, M., Yao, Y., Liu, Y., et al.: Using deep learning to examine street view green and blue spaces and their associations with geriatric depression in Beijing, China. Environ. Int. 126, 107–117 (2019)

    Article  Google Scholar 

  25. Naik, N., Kominers, S.D., Raskar, R., et al.: Do people shape cities, or do cities shape people? The Co-evolution of physical, social, and economic change in five major U.S. cities. SSRN Electron. J. (2015)

  26. Glaeser, E.L., Kominers, S.D., Luca, M., et al.: Big data and big cities: the promises and limitations of improved measures of urban life. Econ. Inq. 56(1), 114–137 (2018)

    Article  Google Scholar 

  27. Zhang, W.X., Witharana, C., Li, W.D., et al.: Using deep learning to identify utility poles with crossarms and estimate their locations from Google Street View images. Sensors 18(8), Article ID 2484 (2018)

    Article  Google Scholar 

  28. Gebru, T., Krause, J., Wang, Y.L., et al.: Using deep learning and Google Street View to estimate the demographic makeup of neighborhoods across the United States. Proc. Natl. Acad. Sci. USA 114(50), 13108–13113 (2017)

    Article  Google Scholar 

  29. Kang, J., Körner, M., Wang, Y., et al.: Building instance classification using street view images. ISPRS J. Photogramm. Remote Sens. 145, 44–59 (2018)

    Article  Google Scholar 

  30. Yin, L., Wang, Z.: Measuring visual enclosure for street walkability: using machine learning algorithms and Google Street View imagery. Appl. Geogr. 76, 147–153 (2016)

    Article  Google Scholar 

  31. Cancan, Y., Fangnian, X., Ling, J., et al.: Study on urban road space comfort based on streetscape images. J. Geo-Inf. Sci. 23(5), 785–801 (2021)

    Google Scholar 

  32. Ramírez, T., Hurtubia, R., Lobel, H., et al.: Measuring heterogeneous perception of urban space with massive data and machine learning: an application to safety. Landsc. Urban Plan. 208, 104002 (2021)

    Article  Google Scholar 

  33. Salesses, P., Schechtner, K., Hidalgo, C.A.: The collaborative image of the city: mapping the inequality of urban perception. PLoS ONE 8(7), Article ID e68400 (2013)

    Article  Google Scholar 

  34. Zhang, F., Zhou, B., Liu, L., et al.: Measuring human perceptions of a large-scale urban region using machine learning. Landsc. Urban Plan. 180, 148–160 (2018)

    Article  Google Scholar 

  35. Zhang, F., Zu, J., Hu, M., et al.: Uncovering inconspicuous places using social media check-ins and street view images. Comput. Environ. Urban Syst. 81, 101478 (2020)

    Article  Google Scholar 

  36. Yulian, L., Zhengfan, H.: Environmental Psychology. China Architecture & Building Press, Beijing (2000)

    Google Scholar 

  37. Wang, R., Liu, Y., Lu, Y., et al.: Perceptions of built environment and health outcomes for older Chinese in Beijing: a big data approach with street view images and deep learning technique. Comput. Environ. Urban Syst. 78, 101386 (2019)

    Article  Google Scholar 

  38. Zhou, H., Tao, G., Nie, Y., et al.: Outdoor thermal environment on road and its influencing factors in hot, humid weather: a case study in Xuzhou City China. Build. Environ. 207, 108460 (2022)

    Article  Google Scholar 

  39. Wen, X., Xie, Y., Jiang, L., et al.: Applications of machine learning methods in traffic crash severity modelling: current status and future directions. Transp. Rev. 41(6), 855–879 (2021)

    Article  Google Scholar 

  40. Evans, G.W.: The built environment and mental health. J. Urban Health 80(4), 536–555 (2003)

    Article  Google Scholar 

  41. Lee, A.C.K., Maheswaran, R.: The health benefits of urban green spaces: a review of the evidence. J. Public Health 33(2), 212–222 (2011)

    Article  Google Scholar 

  42. Li, X., Hijazi, I., Koenig, R., et al.: Assessing essential qualities of urban space with emotional and visual data based on GIS technique. ISPRS Int. J. GeoInf. 5(11), 218 (2016)

    Article  Google Scholar 

  43. Tang, J., Liang, J., Han, C., et al.: Crash injury severity analysis using a two-layer stacking framework. Accid. Anal. Prev. 122, 226–238 (2019)

    Article  Google Scholar 

  44. Li, X., Yeh, A.G.O.: Neural-network-based cellular automata for simulating multiple land use changes using GIS. Int. J. Geogr. Inf. Sci. 16(4), 323–343 (2002)

    Article  Google Scholar 

  45. Lundberg, S.M., Lee, S.I.: A unified approach to interpreting model predictions. In: Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 4768–4777. ACM, New York (2017)

    Google Scholar 

  46. Yang, Y.R., Yuan, Y., Han, Z., et al.: Interpretability analysis for thermal sensation machine learning models: an exploration based on the SHAP approach. Indoor Air 32(2), Article ID e12984 (2022)

    Article  Google Scholar 

  47. Qi, H., Yao, Y., Zhao, X., et al.: Applying an interpretable machine learning framework to the traffic safety order analysis of expressway exits based on aggregate driving behavior data. Phys. A, Stat. Mech. Appl. 597, 127277 (2022)

    Article  Google Scholar 

  48. De Silva, C.S., Warusavitharana, E.J., Ratnayake, R.: An examination of the temporal effects of environmental cues on pedestrians’ feelings of safety. Comput. Environ. Urban Syst. 64, 266–274 (2017)

    Article  Google Scholar 

  49. He, K.M., Zhang, X.Y., Ren, S.Q., et al.: Deep residual learning for image recognition. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778. IEEE Press, New York (2016)

    Chapter  Google Scholar 

  50. Chen, L.C., Papandreou, G., Kokkinos, I., et al.: DeepLab: semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected CRFs. IEEE Trans. Pattern Anal. Mach. Intell. 40(4), 834–848 (2018)

    Article  Google Scholar 

  51. Redmon, J., Farhadi, A.: YOLOv3: An incremental improvement (2018). ArXiv preprint arXiv:1804.02767

  52. Benjdira, B., Khursheed, T., Koubaa, A., et al.: Car detection using unmanned aerial vehicles: comparison between faster R-CNN and YOLOv3. In: 2019 1st International Conference on Unmanned Vehicle Systems-Oman (UVS), pp. 1–6. IEEE Press, New York (2019)

    Google Scholar 

  53. Li, C., Wang, R., Li, J.Z., et al.: Face detection based on YOLOv3. In: Recent Trends in Intelligent Computing, Communication and Devices, pp. 277–284. Springer Singapore, Singapore (2019)

    Google Scholar 

  54. Ke, G.L., Meng, Q., Finley, T., et al.: LightGBM: a highly efficient gradient boosting decision tree. In: Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 3149–3157. ACM, New York (2017)

    Google Scholar 

  55. Lundberg, S.M., Erion, G., Chen, H., et al.: From local explanations to global understanding with explainable AI for trees. Nat. Mach. Intell. 2(1), 56–67 (2020)

    Article  Google Scholar 

  56. Stephan, E., Liberman, N., Trope, Y.: Politeness and psychological distance: a construal level perspective. J. Pers. Soc. Psychol. 98(2), 268–280 (2010)

    Article  Google Scholar 

  57. Nasar, J.L.: Perception, cognition, and evaluation of urban places. In: Public Places and Spaces, pp. 31–56. Springer US, Boston (1989)

    Chapter  Google Scholar 

  58. Bonnes, M., Mannetti, L., Secchiaroli, G., et al.: The city as a multi-place system: an analysis of people: urban environment transactions. J. Environ. Psychol. 10(1), 37–65 (1990)

    Article  Google Scholar 

Download references

Acknowledgements

Not applicable.

Funding

This research was funded by: 1) Guangdong Philosophy and Social Science Planning Project (GD24XYS018). 2) Guangdong Philosophy and Social Science Planning Project (GD24XSH06). 3) 2023 Maoming Philosophy and Social Science Planning Project (2023YB18). 4) Projects of Talents Recruitment of GDUPT (2023rcyj2015). 5) Projects of PhDs’ Start-up Research of GDUPT (2023bsqd1008, 2022bsqd2004). 6) Science and Technology Programme of Maoming of Guangdong Province of China (2023398, 2023411, 2024055, 2024061).

Author information

Authors and Affiliations

Authors

Contributions

CP, Conceptualization; Supervision; Validation; Writing – original draft; Writing – review and editing. HL, Writing – original draft; Data curation; Resources; Validation. LW, Writing – original draft; Formal analysis; Supervision; Visualization. JW, Writing – original draft; Investigation; Software. JG, Writing – original draft; Validation; Investigation. NQ, Writing – review and editing; Visualization. XL, Writing – review and editing; Software. All authors read and approved the final manuscript.

Corresponding authors

Correspondence to Haibo Li or Lu Wang.

Ethics declarations

Competing interests

The author(s) declared no potential conflicts of interest concerning the research, authorship, and/or publication of this paper.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Pan, C., Li, H., Wang, L. et al. Data science basis and influencing factors for the evaluation of environmental safety perception in Macau parishes. Adv Cont Discr Mod 2024, 44 (2024). https://doi.org/10.1186/s13662-024-03846-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1186/s13662-024-03846-z

Keywords