Introduction

In recent years, with the continued advancement of China’s ecological civilization construction, its proposal of “Carbon Neutral and Peak Carbon” goals has indicated a direction for low-carbon transformation across various industries. At the United Nations General Assembly in September 2020, China explicitly proposed the strategic goals of striving to achieve a carbon peak before 2030 and carbon neutrality before 2060. In addition, its implementation of the rural revitalization strategy has provided new opportunities for protecting and developing agricultural heritage sites. As a crucial approach to rural revitalization, integrating agriculture and tourism has become an effective pathway for promoting rural economic transformation, inheriting farming culture, and increasing farmers’ income1. However, carbon emissions from tourism activities, including transportation, accommodation, and catering, have become increasingly prominent. Jones et al. found that tourism carbon emissions account for approximately 8% of global carbon emissions and show a continuing upward trend2. With this percentage is potentially higher at agricultural heritage sites due to their remote locations and increased transportation needs. The dual mandate of these sites - preserving traditional agricultural systems while promoting sustainable tourism - makes understanding and promoting tourists’ carbon reduction behavior particularly crucial. However, current research has not adequately addressed how the distinctive spatial characteristics of agricultural heritage sites might influence visitors’ environmental behaviors.”

Regarding the influence mechanisms of tourists’ carbon reduction behavior, academia has formed two main perspectives. One emphasizes the decisive role of individual factors, considering environmental awareness, values, and knowledge levels as key influences on low-carbon behavior3,4. The other focuses on the role of external contexts, advocating for guiding low-carbon behavior through external interventions such as facility improvements and incentive measures5. However, this “individual-oriented—external incentive” research paradigm may overlook the spatial uniqueness of agricultural heritage sites. As a unique cultural landscape space, agricultural heritage sites not only carry traditional production and living functions but also provide distinctive experiential venues for modern tourism activities6. Research has shown that spatial environments significantly influence tourists’ cognitive evaluation, emotional experience, and behavioral decision-making7. Particularly in agricultural heritage sites, the integrity of traditional agricultural production systems8, the harmony of human-land relationships9, and the diversity of cultural values10 may all profoundly impact tourist behavior.

Spatial research on agricultural heritage sites has evolved from morphological description to functional analysis and then to conservation management. Early studies mainly focused on identifying and classifying spatial morphological characteristics. Zhou et al. constructed an evaluation index system for the spatial characteristics of agricultural heritage sites based on morphological methods, revealing the spatial organization patterns of different heritage site types11. Wang et al. quantitatively analyzed spatial pattern evolution in typical terraced heritage sites using geographic information system technology, discovering that topographical conditions and water availability are key factors influencing spatial layout12.

As research advanced, studies began to focus on the evolution and adaptability of spatial functions. Su et al. found through comparative studies that agricultural heritage sites often maintain their traditional functions while reasonably introducing modern tourism functions13. Zhu et al. highlighted that spatial functional transformation should be premised on protecting traditional agricultural systems while moderately developing tourism functions such as sightseeing and experiential activities14. Regarding conservation management, Shen and Chou proposed a conservation framework based on cultural landscape theory, emphasizing the coordinated development of production, living, and ecological spaces15.

“Previous research on spatial perception’s influence on tourist behavior has evolved through several key stages. Early studies focused on how physical spatial elements affect tourist satisfaction and experience quality, demonstrating that spatial layout and accessibility significantly impact tourists’ behavioral intentions16. Research then expanded to examine the relationship between spatial perception and environmental behavior, revealing that tourists’ perception of natural landscape integrity positively correlates with their environmental awareness and protective behaviors17. Spatial perception influences pro-environmental behavior through multiple pathways: direct cognitive impact, emotional connection, and place attachment18. Recent studies have specifically examined spatial perception’s role in sustainable tourism behaviors, showing that tourists’ understanding of destination spatial characteristics significantly affects their willingness to participate in carbon reduction activities19. However, the specific mechanisms through which spatial perception affects carbon reduction behavior in agricultural heritage sites—unique spaces combining traditional agricultural systems, cultural landscapes, and modern tourism functions—remain understudied.”

Regarding spatial perception research, the focus has expanded from single physical environmental elements to multidimensional comprehensive evaluation. Yang et al. categorized tourism spatial perception into dimensions such as landscape esthetics, spatial scale, and accessibility based on multivariate data analysis20. Zhang et al. further identified core dimensions in agricultural heritage site research, including productive landscape, cultural landscape, and facility perceptions. Studies examining the influencing factors indicate that multiple factors affect tourists’ spatial perception21. Dai and Zheng discovered that individual characteristics (e.g., age and education level), visitation experience, and environmental attitudes significantly influence the intensity of spatial perception22. A longitudinal study by McKercher et al. found that seasonal changes and tourist flow also affect spatial perception outcomes23. Additionally, Weng et al. noted that the quality of interpretation systems and the professionalism of tour guides can significantly enhance visitors’ understanding of heritage sites’ spatial characteristics24. Regarding the mechanism of action, Pai et al. confirmed the positive impact of spatial perception on tourist satisfaction and revisit intention25. Additionally, Albayrak et al. found that positive spatial perception helps extend tourists’ length of stay and increase tourism consumption26. However, research on the relationship between spatial perception and environmental behavior, particularly carbon reduction behavior, remains scarce.

Carbon reduction research in the tourism field also shows a trend shifting from quantitative assessment to behavioral intervention. Regarding carbon footprint accounting, Zha et al. established a carbon emission accounting system for tourism destinations, quantifying the carbon emission contributions of different tourism activities27. Cao et al. systematically evaluated the spatiotemporal characteristics of tourism carbon emissions in Guilin using life cycle assessment methods28. These studies provide a foundation for understanding the composition of tourism carbon emissions. Regarding environmental behavior research, Wang et al. confirmed the influence of environmental attitudes, subjective norms, and perceived behavioral control on low-carbon tourism behavior based on the theory of planned behavior3. Lin et al. found that the dissemination of environmental knowledge and facility convenience are key factors in promoting tourists’ carbon reduction behavior4. Dolnicar et al. further demonstrated that contextual cues and incentive mechanisms can effectively promote environmentally friendly behavior among tourists5. However, existing studies have mainly focused on individual psychological and external intervention factors, with limited consideration of the influence of spatial environmental characteristics.

In recent years, studies have attempted to explore the relationship between spatial perception and tourist behavior using various methods. Traditional research mainly employs statistical methods such as structural equation modeling (SEM) and multiple linear regression. Rao et al. used SEM to examine the relationship between scenic area spatial environment and tourist environmental behavior, finding limitations in handling nonlinear interaction effects29. Wang et al. applied SEM to study the influence of tourism spatial perception on tourists’ low-carbon behavior, but their model showed insufficient explanatory power3. Vázquez-Parra et al. noted that SEM has strict requirements for data normality and struggles to handle multicollinearity issues among variables30. Gao et al. used multiple linear regression to establish models of tourists’ viewing willingness for various walking corridors31. Studies by Kline32 and Darlington and Hayes33 indicated that traditional statistical methods often overlook complex interactions among variables, affecting prediction accuracy. With the development of machine learning methods, studies have begun experimenting with methods such as support vector machine (SVM) and random forest (RF) to examine tourist behavior. Yuan et al. used RF algorithms to predict tourist spatial perception, which improved prediction accuracy but struggled to explain feature influence mechanisms34. Yin and Jung used an SVM to examine the impact of scenic area spatial characteristics on tourists’ experience; however, the model’s “black box” nature limited the practical guidance value of their findings35. Rudin et al. further highlighted that traditional machine learning methods still require improvement in stability and interpretability when handling high-dimensional features and nonlinear relationships36. Based on these methodological limitations, our study adopts the eXtreme Gradient Boosting (XGBoost)-SHapley Additive exPlanations (SHAP) framework to analyze the influence of agricultural heritage site spatial perception on tourists’ carbon reduction behavior. This method not only effectively handles nonlinear relationships and feature interactions but also provides a theoretical foundation for explaining model prediction results through SHAP value analysis.

A literature review identified the following limitations in existing research. Firstly, spatial research of agricultural heritage sites has mainly focused on morphological characteristics and functional evolution, with limited systematic research on spatial perception. Secondly, spatial perception studies have mainly focused on traditional tourist behavior, lacking correlation analysis with carbon reduction behavior. Thirdly, carbon reduction behavior research rarely considers the influence of spatial environmental characteristics. Fourthly, existing research methods struggle to effectively capture the complex nonlinear relationships between spatial perception and carbon reduction behavior. Fifthly, existing research has not distinguished between the differential characteristics of immediate and sustained carbon reduction behaviors, overlooking potential differences in influence mechanisms among different types of carbon reduction behaviors. Based on these limitations, our study selects the typical agricultural heritage site in Anji, Zhejiang, as a case study, employing the XGBoost-SHAP model to explore how spatial perception influences tourists’ carbon reduction behavior.

Based on these research gaps, this study adopts an innovative XGBoost-SHAP methodological framework to analyze the complex nonlinear relationships between spatial perception and tourists’ carbon reduction behavior in agricultural heritage sites. Unlike traditional methods that assume linear relationships or struggle with feature interactions, the XGBoost-SHAP framework enables comprehensive analysis of both direct and interaction effects through three key analytical capabilities. First, it provides an exact calculation of individual feature impacts through localized decomposition of model predictions. Second, it enables the detection of complex interaction patterns between spatial elements, quantifying synergistic and antagonistic effects. Third, it offers both global feature importance rankings and local interpretation capability for individual cases, supporting a more nuanced understanding of spatial perception impacts. Through this advanced analytical approach, this study attempts to answer the following questions: (1) How do spatial perception elements in agricultural heritage sites influence tourists’ carbon reduction behavior? (2) Are there differentiated influence mechanisms for different types of carbon reduction behavior? (3) Do interactions exist among spatial perception elements? (4) How do these interactions affect the formation of carbon reduction behavior?

Methods

This study developed a prediction model based on the XGBoost algorithm to explore the intrinsic correlation between tourists’ spatial perception and carbon reduction behavior. In the model construction process, tourists’ spatial perception was used as the predictor variable, which encompasses three dimensions: productive landscape perception, cultural landscape perception, and facility perception. Tourists’ carbon reduction behavior was used as the response variable, which encompasses four dimensions: transportation behavior (TB), consumption behavior (CB), recreational behavior (RB), and environmental protection behavior (EPB). This study’s specific implementation pathway was as follows. Firstly, the three dimensions of tourists’ spatial perception were used as explanatory variables to construct the input layer of the prediction model. Secondly, the XGBoost model was trained on the data to reveal the nonlinear coupling relationship between spatial perception dimensions and carbon reduction behavior. Five-fold cross-validation was adopted to optimize the model hyperparameters, and the model’s predictive performance was quantitatively validated through multidimensional evaluation metrics. Finally, SHAP value analysis and partial dependence plots (PDPs) were used to analyze model interpretability, and optimization strategies for promoting tourists’ low-carbon behavior were proposed based on the model interpretation results. Figure 1 presents the research framework.

Fig. 1
figure 1

Study flowchart.

Study area

This study selected Huangdu Village (119°40′12″–119°41′24″E, 30°28′48″–30°29′36″N) in Anji County, Huzhou City, Zhejiang Province as the research area. Located in the hilly northeastern region of Anji County, Huangdu Village has a subtropical monsoon climate characterized by warm, humid conditions and abundant rainfall. It covers an area of 11.5 square kilometers, including 14,167 mu of mountainous forest land, with 82% forest coverage. The natural conditions are suitable for growing Moso bamboo and white tea, with 90% of households engaged in white tea-related work.

Huangdu Village represents an exemplary case for studying the relationship between spatial perception and carbon reduction behavior for three key reasons. First, the village’s traditional bamboo forest-tea garden composite system epitomizes how agricultural heritage sites inherently embody low-carbon principles through their sustainable land-use practices, making them natural laboratories for studying environmental behavior. The site maintains complete spatial elements of traditional agricultural systems while successfully integrating modern tourism functions, receiving over 305,000 tourists annually. This provides an ideal setting for examining how heritage spatial characteristics influence visitor behavior. Second, as a core component of the “Anji White Tea Traditional Cultivation System” agricultural heritage and the birthplace of the “Two Mountains” theory (which balances ecological preservation with economic development), the village demonstrates exceptional representativeness of agricultural heritage sites that successfully combine traditional wisdom with contemporary sustainable development. Third, the findings from this case study can inform global agricultural heritage conservation practices, particularly in how spatial design and preservation can promote environmentally conscious tourist behavior, thereby contributing to both heritage protection and carbon reduction goals.

The village scale was selected as the research unit for providing clear spatial boundaries and complete system elements, enabling systematic observation of how agricultural heritage spatial characteristics influence tourist behavior. This methodological approach allows findings to be effectively applied to similar heritage sites globally, particularly in developing integrated conservation and sustainable tourism strategies.

Questionnaire design

This study designed a survey questionnaire to examine the influence of spatial perception on tourists’ carbon reduction behavior in agricultural heritage sites, using Huangdu Village as the research subject. The questionnaire collected data anonymously, with respondents informed that data would be used solely for academic research purposes. The questionnaire comprised four main parts. The first part covered basic information, including demographic characteristics such as gender, age, education level, occupation, monthly income, place of origin, and number of visits. The second part evaluated tourists’ spatial perception in Huangdu Village, containing 21 items measured on a five-point Likert scale (1 = very poor/very low, 5 = very good/very high). The items were divided into three dimensions: agricultural heritage characteristics, landscape cultural elements, and tourism infrastructure. The third part focused on measuring tourists’ carbon reduction behavioral intentions, including 12 items also measured on a five-point Likert scale (1 = very low/very few, 5 = very high/many). The items examined aspects of transportation mode choice, accommodation preferences, dining behavior, shopping considerations, activity participation, and resource conservation. The fourth part consisted of open-ended questions soliciting respondents’ suggestions for improving Huangdu Village’s spatial environment and promoting low-carbon tourism development. The questionnaire design and rigorous data collection process supported exploring the relationship between spatial perception and tourists’ carbon reduction behavior in agricultural heritage sites.

The measurement quality of the research instruments was evaluated through comprehensive reliability and validity analyses. The internal consistency assessment yielded a Cronbach’s alpha coefficient of 0.709 for the 21-item spatial perception scale, exceeding the conventional threshold of 0.7. The construct validity examination through Kaiser-Meyer-Olkin test demonstrated a value of 0.56, indicating moderate sampling adequacy, while Bartlett’s test of sphericity yielded significant results (χ² = 14024.675, df = 210, p < 0.001), confirming the correlation matrix’s factorability and the data’s structural validity for subsequent analyses.

The implementation of the XGBoost-SHAP-PDP methodological framework introduces important considerations regarding measurement requirements. Unlike traditional statistical approaches that demand stringent measurement properties, machine learning algorithms exhibit enhanced robustness to moderate reliability and validity coefficients due to several inherent characteristics. First, XGBoost’s tree-based ensemble architecture incorporates both L1 and L2 regularization terms, effectively mitigating the impact of measurement noise and potential multicollinearity issues. Second, the algorithm’s iterative learning process through gradient boosting enables it to capture complex nonlinear patterns while maintaining stability in feature importance estimation, even with moderate measurement precision. Furthermore, the integration of SHAP values and PDP analyses transcends conventional measurement limitations by decomposing model predictions into interpretable feature contributions and interaction effects, thereby providing robust insights into spatial perception-behavior relationships independent of classical measurement theory constraints. This methodological advancement aligns with recent developments in machine learning applications to social science research, where the focus has shifted from strict measurement thresholds to more flexible, yet rigorous, approaches in handling real-world behavioral data37.

Data sources

This study collected data through questionnaire surveys conducted from August to October 2024, employing both online and offline approaches, with questionnaires distributed at major scenic spots, tourist distribution centers, and rest areas in Huangdu Village. In order to ensure a representative sample, the survey combined random sampling with quota sampling, randomly surveying tourists during different periods (weekdays/weekends, morning/afternoon). During the preliminary survey phase, the research team distributed 50 questionnaires at the research site in August 2024 for pre-testing. The questionnaire’s wording and logical sequence were optimized and adjusted based on the pre-test results.

The formal survey distributed 580 questionnaires. After eliminating invalid questionnaires with incomplete responses and obvious pattern answers, 532 valid questionnaires were obtained, yielding an effective response rate of 91.72%. A double-entry and cross-checking method was employed during the data entry phase to ensure accurate data entry. The collected data were descriptively analyzed using SPSS. The XGBoost model was constructed, and SHAP and PDP values were calculated using Python to conduct an in-depth analysis of how spatial perception influences tourists’ carbon reduction behavior at agricultural heritage sites. To ensure the reliability of research results, the research team systematically processed outliers and missing values during the data preprocessing stage. Outliers were identified and processed using the box-plot method. Since the number of missing values was small, methods such as mean and median substitution were applied according to item characteristics to ensure the scientific validity of the constructed model.

This study constructed an explanatory variable framework for spatial perception through systematic literature analysis and theoretical synthesis. The framework operationalizes spatial perception into measurable indicators across three primary dimensions: productive landscape perception, cultural landscape perception, and facility perception, encompassing 21 specific observational indicators (Table 1).

Table 1 Detailed information on factors influencing tourists’ carbon reduction behavior in this study

The productive landscape perception dimension comprises nine indicators based on observable characteristics of agricultural heritage sites. Agricultural production functional integrity (APFI) measurement draws from Wang et al.’s validated framework, which enables tourists to evaluate visible elements of traditional agricultural systems. Yang et al. demonstrate that ecosystem service perception (ECSP) can be effectively measured through tourists’ assessment of observable environmental benefits, while Liu et al. validate the measurability of traditional agricultural characteristics recognition (TACR) through visitor evaluations.

The cultural landscape perception dimension incorporates six indicators that quantify tourists’ direct observations of heritage elements. Following Kim et al.’s empirically validated approach, cultural heritage value recognition (CHVR) measurement focuses on visitors’ perception of observable heritage features. Historical cultural atmosphere perception (HCAP) assessment builds on Halkos et al.’s tested framework, which enables systematic evaluation of experiential elements16. These indicators transform abstract cultural concepts into measurable variables based on tourists’ direct experience at the site.

The facility perception dimension contains six indicators that quantify tourists’ interaction with site infrastructure. Weng et al.’s methodology validates the measurement approach for traffic accessibility (TRAC), while Pai et al.’s framework confirms the measurability of service facility convenience perception (SFCP). Each indicator in this dimension enables systematic evaluation of observable facility characteristics through visitor assessments.

The study employs a systematic framework to measure tourists’ carbon reduction behaviors, categorizing observable actions into four dimensions based on behavioral characteristics. This classification enables comprehensive assessment of both immediate and sustained environmental behaviors in heritage tourism contexts (Table 2).

Table 2 Critical carbon reduction behaviors

TB measurement follows Jones’ validated framework, focusing on observable modal choices in site access and internal movement. Lin et al.’s empirical studies confirm the reliability of this measurement approach in heritage tourism contexts, demonstrating its effectiveness in capturing actual behavioral patterns rather than stated intentions.

CB assessment builds on Dolnicar and Demeter’s measurement framework, enabling systematic evaluation of observable consumption choices. Wang et al.’s validation studies demonstrate the framework’s effectiveness in quantifying sustainable consumption patterns through visitor assessments.

RB measurement incorporates Lee and Lee’s validated approach, focusing on quantifiable activity choices that impact carbon emissions. Gao et al.’s empirical studies confirm the framework’s reliability in measuring actual RBs through systematic assessment.

EPB measurement follows Cao et al.’s framework, enabling evaluation of direct conservation actions. Rao et al.’s validation studies demonstrate the effectiveness of this measurement approach in capturing sustained environmental behaviors through visitor assessments.

XGBoost algorithm

As an optimized version of the gradient-boosting decision tree, the XGBoost algorithm innovates by introducing second-order Taylor expansion and regularization terms in the objective function to enhance model performance38. Through these optimization strategies, XGBoost can not only evaluate the declining trend of the loss function but also effectively control model complexity, avoiding overfitting problems39. A major advantage of this algorithm is its immunity to multicollinearity, allowing the retention of all influential feature variables even when they are strongly correlated40. This study uses this algorithm to analyze the complex nonlinear relationships between spatial perception and tourists’ carbon reduction behavior in agricultural heritage sites. The specific calculation process is as follows:

(1) This study defines the dataset D = {(\({x}_{i}\), \({y}_{i}\)): i = 1, 2…, n, \({x}_{i}\) Rp, \({y}_{i}\) R}, where n represents the sample size, and each sample contains p features. If k (k = 1, 2, …, K) represents the number of regression trees, \({x}_{i}\) and \({y}_{i}\) represent the feature vector of the ith point, \({f}_{k}\) represents the regression tree, and F represents the combination space of regression trees, the model can be expressed as:

$${\hat{y}}_{i}={\mathop{\sum}\limits_{k=1}^{K}}{f}_{k}\left({x}_{i}\right),{f}_{k}\in F$$
(1)

where \({\hat{y}}_{i}\) represents the predicted carbon reduction behavior and\(\,{y}_{i}\) represents the actual observed data.

(2) Construction of the objective function:

$$\begin{array}{c}{L}_{t}={\mathop{\sum }\limits_{i=1}^{n}}l({y}_{i},{\hat{y}}_{i})+{\sum }_{k=1}^{K}\varOmega ({f}_{k})\\ \end{array}$$
(2)
$$\varOmega ({f}_{k})=\gamma T+\frac{1}{2}\lambda \parallel \omega {\parallel }^{2}$$
(3)

where \({\rm{l}}({y}_{i},{\hat{y}}_{i})\) represents the loss term, Ω(fₖ) is the regularization term, T and ω represent the number of leaf nodes and leaf weights, respectively, and γ and λ are the corresponding penalty coefficients.

(3) This study introduces a second-order Taylor expansion to optimize the objective function where \({g}_{i}\) and \({h}_{i}\) represent the first and second-order derivatives calculated for the predicted values \({{\hat{y}}_{i}}^{t-1}\), respectively:

$${L}_{t}=\mathop{\sum }\limits_{i=1}^{n}({g}_{i}{f}_{t}({x}_{i})+\frac{1}{2}{h}_{i}{f}_{t}^{2}({x}_{i}))+\Omega ({f}_{t})$$
(4)

(4) This study sets leaf node scores\(\,{\omega }_{j}\) in the algorithm to characterize predicted values, with \(q\left({x}_{i}\right)\) pointing to specific leaf nodes. This study defines Ij as the sample set of leaf node j, with complexity expressed as:

$$\begin{array}{c}\varOmega ({f}_{t})=\gamma T+\frac{1}{2}\lambda {\mathop{\sum }\limits_{j=1}^{T}}{\omega }_{j}^{2}\\ \end{array}$$
(5)
$${I}_{j}=\{i{\rm{| }}q({x}_{i})=j\}$$
(6)

Mapping the sample set to the set of leaf nodes, setting \({G}_{j}=\sum _{i\in {I}_{j}}\,{g}_{i},{H}_{j}=\sum _{i\in {I}_{j}}\,{h}_{i}\), the optimized objective function is obtained as follows:

$${L}_{t}=\mathop{\sum }\limits_{j=1}^{T}({G}_{j}{\omega }_{j}+\frac{1}{2}({H}_{j}+\lambda ){\omega }_{j}^{2})+\gamma T$$
(7)

The optimal value of leaf node j and the minimum value of the objective function are obtained by solving for the condition where the first-order derivative of the objective function equals zero:

$${L}_{t}=-\frac{1}{2}\mathop{\sum }\limits_{j=1}^{T}\,\frac{{G}_{j}^{2}}{{H}_{j}+\lambda }+\gamma T$$
(8)

The dataset was divided into a training set (425 samples) and a test set (107 samples) at an 8:2 ratio. This study employed a systematic hyperparameter tuning approach to ensure optimal performance of the XGBoost model. Grid search optimization was conducted for seven key hyperparameters, including learning rate, maximum tree depth, minimum child weight, column sampling ratio (colsample_bytree), L1 regularization parameter (alpha), sample sampling ratio (subsample), and L2 regularization parameter (lambda). Detailed search ranges were established for each parameter (Table 3). This study utilized the GridSearchCV method for automated parameter search to effectively identify the optimal combination within the parameter space and used five-fold cross-validation to evaluate model performance. During parameter optimization, the program selected the optimal parameter combination by minimizing the error rate. When the model evaluation scores no longer significantly improved in consecutive iterations, the optimization program automatically terminated the search process and returned the obtained optimal hyperparameter combination. The parameter optimization method used in this study not only ensured the model’s predictive accuracy but also effectively prevented overfitting.

Table 3 Detailed XGBoost hyperparameter ranges

This study comprehensively assessed the predictive performance of the XGBoost model using three complementary evaluation metrics—coefficient of determination (R²), root mean square error (RMSE), and mean absolute percentage error (MAPE)—to quantitatively evaluate the model from different dimensions. The specific meanings and calculation methods of these metrics are as follows:

(1) R² reflects the extent to which the model explains the variability of the dependent variable, with values in [0,1]. The closer to 1, the better the model’s fit. The calculation formula is:

$${R}^{2}=1-\frac{\mathop{\sum }\nolimits_{i=1}^{n}\,{({y}_{i}-{\hat{y}}_{i})}^{2}}{\mathop{\sum }\nolimits_{i=1}^{n}\,{({y}_{i}-\bar{y})}^{2}}$$
(9)

where \({y}_{i}\) is the actual value of the ith sample, \({\hat{y}}_{i}\) is the corresponding predicted value, \(\bar{y}\) is the mean of the actual values, and n is the number of samples.

(2) RMSE measures the average deviation between predicted and actual values, with smaller values indicating greater model prediction accuracy. The calculation formula is:

$${RMSE}=\sqrt{\frac{1}{n}{\sum }_{i=1}^{n}\,{({y}_{i}-{\hat{y}}_{i})}^{2}}$$
(10)

(3) MAPE reflects the relative error between the predicted and actual values, with smaller values indicating greater relative model prediction accuracy. The calculation formula is:

$${MAPE}=\frac{1}{n}{\sum }_{i=1}^{n}|\frac{{y}_{i}-{\hat{y}}_{i}}{{y}_{i}}|\times 100 \% $$
(11)

Algorithm interpretable analysis

This study adopts the complementary analytical methods of SHAP and PDP to reveal how tourists’ spatial perception of the agricultural heritage site influences their carbon reduction behavior. SHAP value analysis is used to quantitatively evaluate the contribution of various spatial perception elements to tourists’ carbon reduction behavior. PDPs are used to visualize the nonlinear relationship patterns between spatial perception elements and carbon reduction behavior.

Given the potentially complex nonlinear relationships between tourists’ spatial perceptions of the agricultural heritage site and their carbon reduction behavior, this study used SHAP value analysis to interpret the predictions of the XGBoost model37,41,42. Based on cooperative game theory, SHAP values can quantitatively evaluate the contribution of each spatial perception feature to the predicted carbon reduction behavior and are calculated using the following formula:

$${\phi }_{i}=\sum _{S\subseteq F\setminus \{i\}}\,\frac{{|S|}!({|F|}-{|S|}-1)!}{{|F|}!}[{f}_{S}\cup \{i\}({x}_{S\cup \{i\}})-{f}_{S}({x}_{S})]$$
(12)

where F represents the set of all spatial perception features, S is the subset that does not contain feature i, and \({f}_{S}({x}_{S})\) denotes the predicted value using only the subset of features S. This study mainly uses SHAP value analysis to assess the overall importance of each dimension of spatial perception on tourists’ carbon emission reduction behaviors; to explain the specific contribution value of each spatial perception element in a single sample, revealing its facilitating or inhibiting effect on carbon emission reduction behaviors; and to analyze the interaction effect between spatial perception elements and identify the key element combinations.

This study constructed a PDP to further reveal the marginal effect of spatial perception elements on tourists’ carbon emission reduction behavior in agricultural heritage sites43,44,45,46. The formula is as follows:

$${f}_{{xs}}({x}_{s})={E}_{{x}_{c}}[f({x}_{s},{x}_{c})]=\int f({x}_{s},{x}_{c})p({x}_{c})d{x}_{c}$$
(13)

where \({x}_{s}\) is the spatial perception feature to be analyzed, \({x}_{c}\) represents the other features, and \(f({x}_{s},{x}_{c})\) is the prediction function of the XGBoost model. The PDP analysis focuses on whether there is an evident threshold effect between spatial perception elements and carbon emission reduction behaviors, whether there is a difference in the pattern of influence of different spatial perception dimensions on carbon emission reduction behaviors, and how the changes in the spatial perception scores affect tourists’ carbon emission reduction behavior tendency.

Result

Evaluation of XGBoost model performance

The hyperparameter adjustment results of this study’s model are shown in Table 4, with the four sub-models exhibiting significant consistencies in hyperparameter configuration. Firstly, regarding tree complexity control, all models adopt relatively small decision tree depths (max_depth = 3) and low learning rates (learning_rate = 0.01–0.02), effectively reducing the risk of model overfitting. Secondly, regarding sample weight control, min_child_weight maintains a moderate range of 1–4, ensuring model robustness for small samples. Thirdly, regarding feature sampling, both colsample_bytree and subsample parameters fluctuate between 0.7 and 0.8, with this moderate random sampling strategy ensuring model diversity while avoiding excessive information loss. Finally, regarding regularization control, the alpha and lambda parameters remain relatively small, indicating good model generalization capability. The optimized parameter combinations in this study fully demonstrate the superiority of the XGBoost algorithm in parameter tuning and provide important guarantees for model stability.

Table 4 The hyperparameters of each model and a comparison of the evaluation metrics

Regarding model evaluation metrics, the XGBoost prediction model constructed in this study demonstrates excellent performance across all dimensions. Regarding R², all four sub-models exceed the excellent threshold of 0.9, with the RB model performing best (R² = 0.941), indicating that it explains 94.1% of the variance in the dependent variable. The EPB and CB models show comparable predictive performance (R² = 0.913 and 0.914, respectively), also demonstrating strong explanatory power. While the TB model performed relatively worse, its R² still reached a reliable level of 0.901. Regarding error assessment, the RMSE of all models is controlled within a low range of 0.12–0.145, indicating small deviations between predicted and actual values. The MAPE maintains an excellent level of 1.7–3.2%, further confirming the model’s accuracy. The evaluation indicator results demonstrate that the constructed XGBoost model not only has strong predictive capability but also exhibits good stability and reliability when analyzing the complex nonlinear relationship between tourists’ spatial perception of the agricultural heritage site and their carbon reduction behavior.

Interpretable analysis results

This study uses SHAP value analysis to conduct an in-depth exploration of how tourists’ spatial perception of the agricultural heritage site influences their carbon reduction behavior. The SHAP analysis not only provides overall importance rankings of influencing factors but also reveals the local feature value distribution of each sample (Figs. 25). From the analyses of the four models, key features show some consistency across models, but their importance and influence mechanisms exhibit significant differences. Spatial perception features demonstrate unique distribution patterns, particularly when discussing different types of carbon reduction behaviors.

Fig. 2
figure 2

TB values and contributions.

Fig. 3
figure 3

CB values and contributions.

Fig. 4
figure 4

RB values and contributions.

Fig. 5
figure 5

EPB values and contributions.

In the TB model (Fig. 2), LUCP shows the greatest influence, with its SHAP value contribution reaching 58.267%, far exceeding the other factors. This result is consistent with existing research showing the significant impact of spatial patterns at agricultural heritage sites on tourists’ behavior choices. CHVR and TACR rank second and third, with contributions of 10.378% and 7.620%, respectively, forming a significant secondary influence group. While showing relatively lower contributions of 6.379% and 4.098%, TCID and ACLA still demonstrate statistical significance, indicating that tourists’ low-carbon transportation choices are influenced by multidimensional spatial perception features.

In the CB model (Fig. 3), APFI shows significantly greater importance, with a contribution of 42.038%, approximately 25 percentage points higher than in the other models. This finding stems from tourists’ greater emphasis on perceptions of traditional agricultural system integrity in consumption decisions. TACR and RLCP contribute 16.830% and 15.940% explanatory power, respectively, forming a significant secondary influence group. Interestingly, HCAP and CHVR achieve contributions of 5.554% and 4.760%, respectively, forming a stable tertiary influence group. This hierarchical distribution indicates that tourists’ sustainable CB is strongly influenced by perceiving agricultural production system integrity while also being significantly constrained by the ability to identify traditional features and cultural cognition.

The RB model shows similar influence mechanisms to the TB model (Fig. 4), with LUCP similarly demonstrating overwhelming dominance with a contribution of 57.810%. This finding is consistent with Yang et al.’s conclusions regarding spatial perception’s impact on tourist behavior. Interestingly, CHVR’s contribution reaches 10.936%, significantly greater than in the other models. More intriguingly, TCID, TACR, and ACLA show relatively similar contributions (7.507%, 6.984%, and 6.709%, respectively). This balanced distribution contrasts sharply with the other models, indicating that RB is evenly influenced by multidimensional cultural perception factors.

The EPB model exhibits unique influence characteristics (Fig. 5), with TRAC ranking first with a contribution of 42.842%, consistent with Weng et al.’s findings on the impact of facility accessibility on tourists’ environmental behavior. Interestingly, ISYP and WSYC contribute 16.964% and 8.969% explanatory power, respectively, reflecting the important influence of facility perception dimensions on EPB. The importance of some factors increases as the depth of tourists’ experience increases. For example, TCID and ACLA influence EPB more strongly (8.658% and 7.645%, respectively), indicating that the cultural landscape dimension has a special promotional effect on EPB.

Comparing the SHAP value analyses of four types of carbon reduction behavior models, this study identifies five key features with universal influence. Firstly, LUCP’s contribution exceeds 57% in both the TB and RB models, showing the strongest influence. Secondly, the influence of TACR remains stable across all models, reaching a contribution of 16.830% in the CB model. Thirdly, the influence of CHVR fluctuates across models but remains significant. Fourthly, the influence of TCID gradually increases, rising from 6.379% in the TB model to 8.658% in the EPB model. Fifthly, while ACLA shows relatively lower contributions, it demonstrates a stable influence across all models.

Figure 6 illustrates the influence levels of five spatial perception elements on tourists’ TB. CHVR demonstrates the most significant impact trend, showing a gentle influence in the 1–2 score range, followed by a notable upward trend in the 2–4 range, and stabilizing above 4 points. The influence curve for LUCP remains generally stable, with minimal fluctuations across the 1–5 score range. TACR and TCID exhibit similar impact patterns, showing slight increases in the 3–4 score range. The influence of ACLA is relatively weak, displaying only minor positive effects in the high score range. These findings indicate that enhancing tourists’ recognition of cultural heritage value is the most effective approach to promoting low-carbon transportation choices, particularly crucial during the transition from low to moderate recognition levels.

Fig. 6
figure 6

PDP of TB.

Among the factors influencing CB (Fig. 7), LUCP demonstrates the greatest impact, especially after forming a distinct turning point at a score of 3, where its influence increases significantly. CHVR shows a steady upward trend. TACR exhibits notable influence in the 2–4 score range. The impacts of TCID and ACLA are relatively weak. These findings suggest that tourists’ understanding and acceptance of land use patterns are crucial factors affecting their sustainable CB. When tourists better recognize the harmony of the landscape spatial layout, they are more likely to make environmentally friendly consumption choices.

Fig. 7
figure 7

PDP of CB.

Regarding factors influencing RB (Fig. 8), TACR shows the greatest impact, with its curve showing a sharp upward trend in the 2–4 score range. CHVR and TCID demonstrate secondary but stable influential effects. The impacts of LUCP and ACLA are relatively weak. These findings indicate that tourists’ recognition and understanding of traditional agricultural characteristics directly influence their willingness to participate in low-carbon recreational activities. Enhancing tourists’ perception of traditional agricultural features is an important means of promoting sustainable RB.

Fig. 8
figure 8

PDP of RB.

Concerning factors influencing EPB (Fig. 9), ACLA demonstrates the greatest influence, showing a particularly steep upward trend in the 3–4 score range. CHVR and LUCP exhibit stable positive influences. The impacts of TACR and TCID are relatively weak. These findings suggest that tourists’ recognition of the esthetic value of the agricultural landscape is closely associated with their EPB. Therefore, enhancing landscape esthetics can effectively promote tourists’ environmental awareness and behavior.

Fig. 9
figure 9

PDP of EPB.

Regarding TB (Fig. 10), the LUCP × CHVR interaction plot shows significant gradient features from the lower left to upper right, with the diagonal distribution of color depth indicating an apparent synergistic effect between the perception of land use coordination and recognition of cultural heritage value. Their joint enhancement most effectively promotes tourists’ low-carbon transportation choices. The TACR × APFI interaction plot shows a uniform gradient trend, with regularly inclined contour lines reflecting stable interaction between the recognition of traditional agricultural characteristics and APFI. The CHVR × HCAP interaction plot shows the deepest color in the upper right, revealing that the combination of high recognition of cultural heritage value and perception of the historical cultural atmosphere has the strongest promoting effect on eco-friendly TB. Overall, Fig. 10 indicates that the synergy between cultural cognition and spatial perception plays a crucial role in promoting low-carbon TB.

Fig. 10
figure 10

Three indicator interaction plots for TB.

Regarding CB (Fig. 11), the results present more complex interaction patterns. The LUCP × CHVR interaction plot shows nonlinear color change characteristics, forming significant dark clusters in the medium-high value region, indicating that both factors must reach specific thresholds to significantly impact sustainable CB. The TACR × APFI interaction effects are most evident in the medium-level region, with dense contour lines revealing that moderate combinations promote sustainable CB most effectively. The CHVR × HCAP interaction plot demonstrates the strongest positive effect in the high-value region, indicating that deep cultural cognition and strong historical atmosphere perception maximally stimulate tourists’ sustainable consumption willingness. Overall, Fig. 11 shows that CB is influenced by complex interactions between cultural cognition and spatial perception, requiring multiple factors to reach optimal levels for ideal effects.

Fig. 11
figure 11

Three indicator interaction plots for CB.

Concerning RB (Fig. 12), the LUCP × CHVR interaction exhibits gentle gradient characteristics, with a uniform contour distribution revealing stable influence mechanisms on RB. The TACR × APFI interaction plot shows distinct regional characteristics, forming dark clusters in the medium-high value region, indicating that both factors must reach certain levels to promote low-carbon RB effectively. The CHVR × HCAP interaction effects are most significant in the upper right region, suggesting that high-level combinations maximally promote sustainable recreational activity participation. Overall, Fig. 12 reflects the dominant role of cultural cognitive elements in promoting low-carbon RB.

Fig. 12
figure 12

Three indicator interaction plots for RB.

For EPB (Fig. 13), all three interactions show strong positive effect characteristics. The LUCP × CHVR interaction plot shows the most significant diagonal dark distribution, revealing the most direct and strong influence on EPB. The TACR × APFI interaction also shows clear positive trends, with a regular contour distribution, indicating that their combination continuously strengthens tourists’ environmental awareness. The CHVR × HCAP interaction forms significant dark areas in the high-value region, reflecting that deep cultural cognition and strong historical atmosphere perception significantly promote tourists’ environmental protection behavior. Overall, Fig. 13 shows that EPB is most significantly influenced by the positive effects of spatial perception elements.

Fig. 13
figure 13

Three indicator interaction plots for EPB.

The PDP interaction analysis shows that the spatial perception elements’ influence mechanisms on tourists’ carbon reduction behavior differ significantly in characteristics. TB is mainly affected by the synergy between cultural cognition and spatial layout coordination, CB shows complex nonlinear interaction characteristics, RB prominently reflects the dominant role of cultural cognitive elements, and EPB presents the most significant positive interaction effects. These findings reveal that CHVR plays a core role in all behavior types, with its interactions with other elements generally strong, highlighting the key position of cultural cognition in promoting carbon reduction behavior formation. In addition, spatial perception elements’ interaction effects generally show distinct threshold characteristics, indicating that multiple elements must reach specific levels to produce significant behavioral guidance effects.

Based on these interaction patterns and their spatial manifestations, the XGBoost-SHAP model analysis revealed three key findings regarding spatial perception’s influence on tourists’ carbon reduction behavior. First, the model demonstrated robust predictive capability across all behavioral dimensions, with R² values consistently exceeding 0.9 (ranging from 0.901 to 0.941) and MAPE maintained at an excellent level between 1.7 and 3.2%, indicating high reliability in capturing the nonlinear relationships between spatial perception and carbon reduction behaviors. Second, SHAP analysis identified two dominant spatial perception elements: land use coordination perception (LUCP) showed the strongest influence on transportation and RBs (with contributions of 58.267% and 57.810%, respectively), while CHVR maintained significant cross-dimensional influence across all behavioral models (contributions ranging from 4.760 to 10.936%). Third, PDP analysis revealed differentiated influence patterns among different types of carbon reduction behaviors, where immediate behaviors (transportation, consumption, and recreational) showed stronger responses to spatial layout coordination, while sustained behaviors (environmental protection) demonstrated more reliance on the combined effects of cultural cognition elements. Furthermore, interaction analysis identified significant synergistic effects among spatial perception elements, particularly between LUCP and CHVR, where their combination at high levels generated amplified effects on carbon reduction behaviors, exceeding the sum of their individual influences.

Discussion

The XGBoost-SHAP model analysis identified five key spatial perception characteristics that significantly influence tourists’ carbon reduction behavior. LUCP demonstrates the greatest influence on transportation and RBs, with SHAP value contributions reaching 58.267% and 57.810%, respectively. This finding extends Lee et al.’s conclusions about spatial layout rationality, while also aligning with Zhang et al.’s findings on how spatial organization patterns affect tourist behavior choices. The strong influence of LUCP particularly resonates with Shen and Chou’s cultural landscape theory emphasizing the coordinated development of production, living, and ecological spaces in heritage sites.

As a cross-dimensional core influencing factor, CHVR maintains significant contributions across all behavioral models (4.760–10.936%). This universal influence not only validates Yang et al.’s findings regarding cultural cognition in behavioral guidance but also supports Kim et al.’s emphasis on cultural heritage recognition in sustainable tourism development. Moreover, this aligns with Hou et al.’s research on the role of intangible cultural heritage in shaping visitor behavior.

TACR notably influences the CB model (16.830%), reflecting Su et al.’s findings on how traditional agricultural system recognition affects tourist consumption decisions. This result also extends Wang et al.’s research on landscape pattern optimization in agricultural heritage sites, demonstrating how spatial perception influences behavioral choices. The significant impact of TACR also aligns with Zhou et al.’s findings on the importance of traditional agricultural characteristics in shaping visitor experience and behavior.

The gradually increasing influence of TCID (from 6.379 to 8.658%) builds on McKercher et al.’s temporal analysis of tourist behavior, while adding new insights into how local characteristic identification develops over time. This progressive influence pattern supports Dai and Zheng’s research on how spatial experience accumulates to affect behavioral intentions. ACLA’s stable influence across models (4–7%) supports Pai et al.’s findings on multi-sensory spatial experience, while also complementing Albayrak et al.’s research on how environmental perception affects tourist behavior duration.

These findings significantly extend previous research by Zhou et al. and Wang et al. on spatial characteristics of agricultural heritage sites, revealing not just the importance of individual elements but their complex interactions in influencing carbon reduction behavior. The results also add a new dimension to Zhu et al.’s sustainability framework by quantifying how spatial perception elements contribute to environmental behavior formation. The importance ranking of the five key characteristics (LUCP, CHVR, TACR, TCID, and ACLA) provides a more nuanced understanding than previous studies, which often treated spatial perception as a unified construct.

The XGBoost-SHAP model analysis reveals that immediate carbon reduction behaviors (including transportation, consumption, and RBs) demonstrate differentiated spatial perception influence mechanisms. The differentiated influence mechanisms identified both support and extend previous findings. While the results align with Lee et al.’s conclusions about spatial environment’s influence, they further reveal how specific spatial elements interact with cultural factors - a dimension not fully explored in previous studies.

LUCP and CHVR play dominant roles in TB, consistent with Lee et al.’s findings on the influence of the spatial environment on tourists’ behavior. This extends Zhang et al.’s research by demonstrating how spatial organization specifically affects transportation choices. LUCP guides eco-friendly transportation choices by influencing tourists’ understanding of the spatial layout, while CHVR enhances environmental responsibility through improved recognition of cultural value, supporting Su et al.’s findings on the role of heritage awareness in behavioral decisions.

TACR had the greatest influence on CB, supporting Su et al.’s discussion of the impact of recognizing the traditional agricultural system on tourists’ consumption decisions. While they focused on general heritage value perception, the current results specify how different spatial elements contribute to distinct behavioral outcomes. Enhanced recognition of traditional agricultural system characteristics directly promotes the selection tendency toward local agricultural products and eco-friendly accommodation facilities, while ACLA strengthens identification with local products through enhanced esthetic experience. This finding advances Wang et al.’s framework by revealing specific pathways through which spatial perception influences consumption patterns.

CHVR and TCID have complementary influences on RB, validating Yang et al.’s findings on cultural cognition’s fundamental role in guiding behavior. This relationship was further elaborated by the PDP analysis, which showed that characteristic interactions in immediate carbon reduction behaviors mainly manifest in LUCP × CHVR and TACR × TCID combinations. These synergistic effects exceed the sum of individual characteristic influences when multiple characteristics reach higher levels, a phenomenon not previously identified in spatial perception research.

Sustained carbon reduction behavior (EPB) shows unique spatial perception influence mechanisms. The PDP analysis indicates that ACLA forms a steep upward curve in the 3–4 score range, echoing Weng et al.’s results on spatial experience’s influence on environmental behavior. This finding adds precision to previous research by identifying specific threshold points where spatial perception begins to significantly impact behavior. TCID’s influence manifests as a cumulative effect, with sustained improvements in identification ability gradually enhancing environmental behavior tendency, supplementing Dolnicar et al.’s research framework on factors influencing environmental behavior.

The interaction analysis between ACLA and other characteristics revealed the synergistic promotion effect of landscape esthetic experience and cultural cognition, with the ACLA × CHVR combination particularly showing significant positive effects in high-score regions. This extends beyond McKercher et al.’s findings on seasonal effects by demonstrating how spatial perceptions interact over time to influence behavior. The observed interaction characteristics support Cao et al.’s findings on environmental behavior formation mechanisms, indicating that high landscape esthetic perception and cultural cognition constitute key conditions for tourists’ sustained environmental behavior, thereby promoting long-term EPB practice.

Our study makes three major theoretical contributions to agricultural heritage sites and low-carbon tourism research. Firstly, overcoming the limitations of existing studies that focused excessively on individual environmental awareness and external incentive measures, it systematically revealed the complex influence mechanisms of traditional agricultural system integrity, human-land relationship harmony, and cultural value diversity on tourists’ low-carbon behavior in agricultural heritage sites as unique cultural landscape spaces for the first time. This finding enriches the sustainable development theory of agricultural heritage sites and provides new perspectives on how spatial characteristics influence tourists’ environmental behavior.

Secondly, addressing the challenge that traditional research methods struggle to effectively capture complex nonlinear relationships between spatial perception and carbon reduction behavior, it innovatively introduces the XGBoost-SHAP model framework. It not only quantitatively evaluates the influence weights of spatial perception elements but also reveals element interactions for the first time, particularly finding that the combination of land use coordination perception and CHVR can produce effects exceeding the sum of individual elements’ influences, providing a new research paradigm for agricultural heritage sites’ spatial optimization.

Thirdly, it first distinguished between immediate and sustained carbon reduction behaviors, discovering significant differences in how spatial perception elements influence these two types of behaviors: immediate behaviors are mainly influenced by the perception of land use coordination and the recognition of cultural heritage value, while sustained behavior relies more on the cumulative effects of agricultural cultural landscape esthetics and the identification of traditional characteristics. This finding enriches tourist behavior theory in agricultural heritage sites and provides a theoretical basis for differentiated low-carbon tourism management strategies.

Our study proposes the following implementation suggestions based on the differing characteristics of immediate and sustained carbon reduction behaviors. Firstly, heritage site management departments should focus on optimizing the following aspects to promote immediate carbon reduction behaviors. Spatial planning system construction should strengthen land use coordination; scientifically divide functional zones for production, living, and ecological spaces; and construct multi-level slow travel systems. In addition, improvements in cultural displays must systematically present agricultural heritage values through multimedia displays and scene restoration, innovate interpretation system design, and enhance tourists’ cultural cognition. Moreover, the shaping of local characteristics should systematically organize and refine characteristic elements, strengthening regional features in plant configuration and material selection.

Secondly, management measures should focus on optimizing the following aspects to promote sustained carbon reduction behavior. The landscape esthetic system should be optimized to strengthen agricultural cultural landscape esthetic value, enhancing tourists’ esthetic experience through refined design. In addition, the environmental protection facility configuration must optimize spatial layout, improve classified waste collection systems, and reasonably establish facilities prompting energy-saving and EPBs. Moreover, management mechanisms should be created to establish multi-stakeholder participation systems, form regular monitoring and evaluation mechanisms, conduct environmental protection-themed interactive experience activities, and cultivate tourists’ environmental protection awareness.

These implementation suggestions should be integrated with existing heritage site management systems through comprehensive policy coordination, stakeholder engagement, and strategic resource allocation. Management departments should align these measures with national heritage protection guidelines while considering local development plans and regional tourism strategies. Furthermore, the successful implementation of these suggestions requires active participation from local communities, tourism operators, research institutions, and conservation experts. Resource allocation should prioritize critical infrastructure development while maintaining a balance between cultural preservation and environmental protection measures.

Our study had several significant limitations that warrant careful consideration. The research was confined to a single case site (Huangdu Village), which potentially limits the generalizability of findings across different types of agricultural heritage sites with varied geographical, cultural, and socioeconomic contexts. Data collection was restricted to August-October 2024, failing to capture potential seasonal variations in spatial perception and carbon reduction behaviors, which could particularly affect our understanding of how landscape changes influence tourist behavior patterns throughout the year. Moreover, our research perspective predominantly focused on tourists’ viewpoints, overlooking the potential influence of other stakeholders’ perceptions and actions, including local residents, site managers, and tourism operators. The XGBoost-SHAP model, while demonstrating strong predictive performance, still faces limitations in explaining complex feature interaction effects, particularly in cases where multiple spatial perception elements show nonlinear relationships, which could affect our ability to fully understand the mechanisms through which spatial perception influences sustained environmental behaviors.

Based on these limitations, we propose several directions for future research that would enhance both theoretical understanding and practical applications. Multi-case comparative studies should be conducted across different types of agricultural heritage sites to identify both universal patterns and context-specific characteristics in spatial perception-behavior relationships, thereby providing more nuanced guidance for site-specific management strategies. Longitudinal studies spanning multiple seasons should be implemented to systematically track changes in spatial perception and carbon reduction behaviors across different temporal dimensions, enabling more effective long-term planning for low-carbon tourism development. Future research should also adopt a multi-stakeholder collaborative governance perspective to investigate spatial cognition differences among various stakeholders and their impact on carbon reduction outcomes, with particular attention to the role of local communities in shaping sustainable spatial characteristics. Additionally, methodological advances should be pursued to enhance the interpretability of complex spatial perception-behavior relationships, potentially through hybrid modeling approaches that combine machine learning with traditional qualitative methods and advanced visualization techniques for better communicating complex interaction effects to stakeholders and decision-makers.

Through the innovative application of the XGBoost-SHAP framework, this study systematically reveals the complex mechanisms through which spatial perception influences tourists’ carbon reduction behavior in agricultural heritage sites. The findings demonstrate that land use coordination perception and CHVR serve as dominant factors in shaping environmental behaviors, with their synergistic effects exceeding simple additive impacts. This phenomenon can be attributed to the unique spatial-cultural characteristics of agricultural heritage sites, where traditional agricultural systems, cultural landscapes, and modern tourism functions converge to create distinctive experiential environments. Moreover, the differentiated influence patterns between immediate and sustained carbon reduction behaviors—with the former primarily driven by spatial layout coordination and the latter by cultural cognition elements—reflect the evolutionary nature of environmental behavior formation in heritage tourism contexts. These insights suggest that future agricultural heritage site development should adopt an integrated approach that emphasizes both spatial optimization and cultural value enhancement, potentially leading to more effective carbon reduction outcomes through the cultivation of tourists’ comprehensive spatial-cultural awareness. Such an understanding provides crucial theoretical guidance for developing targeted management strategies that can simultaneously preserve heritage values and promote sustainable tourism practices.