Abstract:Against the dual backdrop of rural revitalization and the post-pandemic era, the issue of safety perception in rural greenways— vital infrastructure connecting urban and rural areas and promoting healthy recreation—has become increasingly prominent. Unlike urban settings, rural greenways are embedded within unique natural and social contexts, which limits the explanatory power of urban-centric safety perception theories such as Crime Prevention Through Environmental Design (CPTED). Therefore, this study uses Nanjing City as a case study, aiming to develop a localized analytical framework for safety perception in rural greenways and to explore its formation mechanisms and infl uencing factors. The research integrates PSPNet-based deep-learning semantic segmentation technology with questionnaire surveys. Two greenway sections—Shecun Line in Jiangning District and Duqiao Line in Jiangbei New Area—were selected as samples. Multidimensional features such as green view index, spatial openness, and environmental diversity were extracted via semantic segmentation and systematically analyzed alongside public perception evaluation data. The fi ndings reveal that: (1) Public safety perception varies signifi cantly across diff erent scenarios, with openness, orderliness, and comfort having signifi cant positive eff ects, while complexity and perceived high naturalness exert negative impacts. (2) Unlike conclusions from most urban street studies, green view index shows no direct signifi cant eff ect on safety perception. (3) Landscape features indirectly infl uence safety perception through perceptual dimensions such as orderliness and comfort, with Bayesian model optimization further unveiling the complex mediating paths involved. This study not only provides an empirical basis for landscape optimization and safety design of rural greenways but also, by revealing diff erences in safety perception mechanisms between urban and rural contexts, off ers new rural perspectives for revising and expanding environmental safety perception theory.