Introduction

Vegetation dynamics is the most fundamental element of the terrestrial global ecosystem (Law et al. 2002), which is essential for regulating the energy conversation, carbon and water stability, and environmental conditions at various local to global timescales (Liu and Lei 2015; Huang and Xu 2016; Zhou et al. 2017; Zhang et al. 2020). As a dynamic element of the terrestrial ecosystem, vegetation is generally exploited to assess the significant impact on the water cycle and terrestrial climate conditions on a local, regional, and global scale (Liu and Lei 2015; Xu et al. 2015; Huang et al. 2016; Zhang and Wu 2020). Climate change and anthropogenic activities are two primary forces that play a major part in vegetation dynamics and there has been an intensification focused on identifying their influence on the development of vegetation (Chen et al. 2015; Jiapaer et al. 2015; Kong et al. 2020). Generally, remote sensing data e.g., normalized differential vegetation index (NDVI) with the appropriate spatial and temporal resolution is used as a powerful proxy for monitoring vegetation dynamics (Fathi-Taperasht et al. 2023), in response to environmental factors like climate change and human activities.

Climate change, specifically precipitation (P), is a crucial element in regulating vegetation growth (Guo et al. 2021), as p has shown a strong correlation with NDVI (Fathi-Taperasht et al. 2022) and its impact on growth varies depending on the temporal and geographical context. Precipitation has a positive impact on vegetation development when there is a lack of water, which is most prevalent in arid locations (Zhou et al. 2017; Nemani et al. 2003), and its variations on an annual and seasonal scale can alternate the phenology of vegetation (Snyder and Tartowski 2006). Temperature (T) is another significant climatic component that impacts NDVI variation and is directly interrelated to the beginning, completion, and effectiveness of the photosynthesis process in plants (Braswell et al. 1997; Wang et al. 2011). This is primarily due to climate change-induced temperature rise, which diminishes surface water availability, leading to desiccation of vegetation and soils. Hence, for a better understanding of vegetation dynamics, it is important to understand the NDVI variations and their relationships with climatic factors (commonly P and T) at different spatial–temporal scales as well as to predict future vegetation development trends and their response to climate change (Gang et al. 2017).

Conversely, anthropogenic activities have also been found to exert a notable impact on NDVI dynamics. Studies have revealed that two human-induced factors—rapid population growth and the swift expansion of global economies—significantly influence vegetation cover and have the potential to alter its trends at a regional scale (Zhang and Wu 2020; Shi et al. 2021). In general, anthropogenic activities such as unsustainable farming practices, extensive land development, overgrazing, and urban expansion contribute to a notable reduction in vegetative cover (Liu et al. 2015; Feng et al. 2021). However, they can also enhance vegetation abundance through improved agricultural practices, afforestation efforts, and land conservation measures (Liu et al. 2020; Sun et al. 2015). Vegetation and phenology characteristics can be varied significantly depending on the kind of land cover that was affected. The average amount of land cover that has been impacted by anthropogenic activity ranges between 30 and 50% (Foley 2005).

More specifically, as the world's climate continues to warm, and increasing inappropriate use of land resources continues, the vegetation undergoes significant variations (Sun et al. 2015; Huang et al. 2016; Zhang et al. 2016; Jiang et al. 2017; Zheng et al. 2019) that might cause massive ecological damage and economic loss (Wang et al. 2015; Chen et al. 2020). For Example, Sindh, Pakistan's arid region has an overall higher tendency for the NDVI (an annual 86.71% and a growing season trend of 82.7%) as well as a partial declining trend (an annually 13.3% and in the growing season 17.3%) (Bashir et al. 2020). Precipitation was the most significant factor which mainly composed 56.66% of the total climatic factors that impacted NDVI, and temperature had an 8.92% influence. The percentages of the increase in net primary production (NPP) that were attributed to anthropogenic and climate change were 39.70% and 60.30% respectively (Peng et al. 2021). In addition to significant global climate variability, the increasing human activities also intensify the effect on the dynamics of the vegetation and this issue has become a crucial issue in today's world (Liu et al. 2015; Du et al. 2019).

For detecting changes in NDVI time series, several approaches were used for detecting monotonic change and trends, such as TIMESAT (Jönsson and Eklundh 2002), Fourier spectral (Lhermitte et al., 2008), regression analysis, and wavelet analysis (Torrence and Compo 1998). However, numerous change detection algorithms are still in the proof-of-concept stage or criticized by various researchers. These algorithms are frequently inaccessible due to a lack of publicly available, efficient, and user-friendly implementations, or they have yet to be demonstrated on a large scale using real remote sensing data. The Breaks for Additive Season and Trend (BFAST) algorithm family can also be used as an alternative that identifies multiple breaks (de Jong et al. 2011; Fang et al. 2018). For example, BFASTMonitor, which is designed for real-time change monitoring with a focus on breaks at the series end; and BFAST01, which characterizes the trajectory around the largest break, are all members of the family. These algorithms have been successfully applied for different time series all over the world, from semi-arid regions in Australia to various Canadian ecozones, forest disturbances in the Colombian Andes, and sub-Saharan dryland turning points. The BFAST package is the basis for new change detection frameworks such as TSS.RESTREND and STEF (Fang et al. 2018). Moreover, for the analysis of intricate time-series data, the Ensemble Empirical Mode Decomposition (EEMD) method is an effective signal-processing technique (Wu and Huang 2011). Its unique ability to decompose data into intrinsic mode functions (IMFs) that capture discrete frequency components allows it to be applied to a variety of non-stationary and non-linear signals. Known for its resilience, EEMD reduces mode mixing problems that conventional Empirical Mode Decomposition (EMD) causes (Hawinkel et al. 2015). EEMD is widely used in domains like geophysics, finance, and biomedical signal processing. It is particularly useful in obtaining relevant data from complex time-series datasets that contain inherent uncertainties and irregularities (Hawinkel et al. 2015). In addition to that, there isn't much research on these advanced machine learning models such as BFAST and EEMD algorithms to detect numerous abrupt and gradual changes as well as analyze the non-stationary and nonlinear interannual variability in NDVI time series respectively (Accarino et al. 2021; Ishida et al. 2020; Verbesselt et al. 2010).

Keeping in view, the main objectives are to detect vegetation dynamics of fragile ecosystem and quantify the impact of anthropogenic activities and climate change using BFAST and EEMD algorithm family. The primary goals of this research study include: (1) utilizing advanced algorithms to decompose NDVI for evaluating the temporal pattern of vegetation dynamics and its correlation with climatic factors and (2) quantifying the relative contribution of climate change and anthropogenic activities to vegetation dynamics. The research findings enhance our understanding of how vegetation responds to climate change and human influence, providing a technical foundation for future ecological restoration efforts in similar locations.

Materials and methods

The current study for attribution of vegetation dynamics and temporal response patterns used a holistic approach, which includes a novel combination of some advanced analytical tools by following sequential steps as depicted in Fig. 1, and the details are provided in the subsequent section.

Fig. 1
figure 1

Schematic diagram of the methodology adopted in this study explanation

Study area

The Haro River Basin (HRB) is situated geographically between 33.99° N to 72.20° E and 34.06° N to 73.43° E. Originating from the mountainous regions of Ayubia, Murree, and Margallah Hills, as depicted in Fig. 2, the river spans a length of approximately 43.65 km and traverses through Khyber Pakhtunkhwa (KPK) and Islamabad, extending into Punjab. The primary sources of the river's inflow are derived from snow and rainfall in the upstream areas, with the upper catchment experiencing winter snowfall, leading to seasonal variations in inflows. Climate change significantly impacts peak discharge and inflows in this region. Four significant tributaries including (Lora Haro, Neelan, Stora Haro, and Kunhad) are fed by the Haro River. Notably, the Khanpur Dam, located 40 km northwest of Islamabad at coordinates 33.80° N and 72.93° E, intercepts the Haro River, having a catchment area of approximately 800 km2. The HRB experiences diverse rainfall patterns, with an average annual rainfall of 607 mm in lowland regions and 2400 mm in high-altitude areas. The temperature in the HRB ranges from 4 to 47 °C (Hagras and Habib 2017; Nauman et al. 2019).

Fig. 2
figure 2

Location of Haro River Basin with digital elevation model (DEM) and meteorological stations

The way vegetation responds to climate change has received a lot of attention and in the field of climate change research, it is now a particularly hard topic (Bao et al., 2014). Among other satellite-based indicators, the Normalized Difference Vegetation Index (NDVI) has demonstrated its effectiveness as a vegetation activity indicator during the past few decades (Groten, 1993; Neigh et al., 2008; Piao et al., 2014). Hence, the methodology of this study involved utilizing data from NASA's Moderate Resolution Imaging Spectroradiometer (MODIS) Terra for the years 2002 to 2021. Specifically, the MODIS product (MOD13Q1.061) was employed to acquire Normalized Difference Vegetation Index (NDVI) values, offering a spatial resolution of 250 m and a temporal resolution of 16 days (Shi et al., 2021). On the other hand, climatic data, encompassing monthly precipitation, humidity, and maximum and minimum temperatures spanning the same period, were sourced from the Pakistan Meteorological Department (PMD). The Digital Elevation Model (DEM) used in the study had a spatial resolution of 30 m and was obtained from NASA's Shuttle Radar Topography Mission (SRTM) dataset (http://srtm.csi.cgiar.org/). To assess changes in Land Use and Land Cover (LULC) over the study period (2002–2021), land use images were collected from Earth Explorer USGS (https://earthexplorer.usgs.gov/) (refer to Table 1 for details). This comprehensive approach integrates remote sensing, climatic, and topographic data, providing a robust foundation for analyzing vegetation dynamics and understanding the influences of climate and land use changes in the Haro River Basin. Furthermore, an investigation of LULC changes was also carried out to understand the developing dynamics of human and natural activities, which necessitates a thorough understanding of temporal variations in relevant aspects. In the current study, LULC mapping was carried out using Landsat 7 satellite data that was thoroughly filtered to reduce cloud cover influence and enhance temporal relevance through date range selection. Following that, image classification was carried out using the NDVI classification criteria outlined in Table 2, as specified by Akbar et al. (2019).

Table 1 Detailed information about the data sets utilized in this research study
Table 2 Classification criteria range based on NDVI

Trend analysis by using ordinary least squares (OLS) method

A statistical technique Ordinary Least Squares (OLS) was initially utilized to identify trends in NDVI and climatic factors including precipitation, temperature, and humidity at the regional scale (Hou et al. 2015). The relationship between one or more independent variables and a dependent variable can be calculated by minimizing the sum of squares in the difference between the observed values and predicted values of the dependent variable which is represented by a straight line. This process is described below:

$$NDVI_{i} = a + slope \times i + \hat{I}_{i}$$
(1)
$$slope = \frac{{n \times \sum\nolimits_{i = 1}^{n} {(i \times } NDVI_{i} ) - \sum\nolimits_{i = 1}^{n} {i \times \sum\nolimits_{i = 1}^{n} {NDVI_{i} } } }}{{ \, n \times \sum\nolimits_{i = 1}^{n} {i^{2} } - (\sum\nolimits_{i = 1}^{n} {i)^{2} } }}$$
(2)

where NDVIi is the average NDVI time series data for the ith growth season; a and slope indicates the linear regression equation's intercept and slope; i represents time series data of ith year; n is the length of the time series data for the NDVI; ε denote error term. Using a Mann–Kendall test, the statistical significance of the NDVI variation trend was assessed and a trend was considered statistically significant when p < 0.05.

NDVI time series decomposition using breaks for additive season and trend (BFAST)

Breaks for Additive Season and Trend (BFAST) is a powerful time series analysis technique used to detect abrupt changes or “breaks” in data trends and is employed in various fields such as remote sensing, ecology, and climate science. BFAST algorithm can decompose the original time series data of NDVI into three basic components which include seasonal components, trend components, and residual components (de Jong et al. 2011; Fang et al. 2018) and it can also recognize and classify sudden changes or “breaks,” in the seasonal and trend components in a time series of remotely sensed imageries. By fitting piecewise linear models to the data, BFAST identifies points where the observed values deviate significantly from the expected trend and seasonality. These deviations signal potential disturbances or shifts in the underlying processes being monitored. BFAST's ability to effectively capture abrupt changes makes it a valuable tool for analyzing environmental data, including remote sensing imagery, climate datasets, and ecological monitoring records. Its robustness and versatility have led to its widespread adoption in various scientific fields for understanding temporal dynamics and detecting critical transitions in time series data. The basic formula of this method is shown below:

$$Y_{t} = T_{t} + S_{t} + e_{t} (t = 1 \, ,2 \, ,3,.........,n)$$
(3)

where Yt identified the original time series at a time “t”; Tt (\(T_{t} = \alpha_{i} + \beta_{i} t \,\)) represents the trend component of the time series with i = 1,2, …, m; and τ0 = 0 and τm+1 = n, αi and βi as intercept and slope respectively; St (\(S_{t} = \sum\limits_{k = 1}^{{^{j} }} {\alpha_{j,k} } \sin \left( {\frac{2\pi kt}{f} + \delta_{j,k} } \right) \,\)) denotes the seasonal component of the time series where j term indicates the location of break sections, j = 1…, m; k represents the number of harmonic elements; section-specific amplitude and phase are expressed by αj, k and δj,k respectively; f represents the frequency term; et indicates the residual component; t is the observation period.

The BFAST computation processes include Initial data preparation to ensure the time series is properly structured and clear of gaps. The time series is then divided into seasonal, trend, and residual components using an appropriate decomposition algorithm. Piecewise linear models are then applied to the trend component, dividing it into intervals and estimating linear trends within each. Following that, significant breakpoints or changes in the trend component are identified using statistical or change-point detection techniques. The observed breakpoints are assessed for importance and reliability, and their interpretation is contextualized within the underlying processes under observation. Finally, the BFAST analysis findings, comprising the original time series data, deconstructed components, and identified breakpoints, are shown to aid comprehension of temporal dynamics.

Ensemble empirical mode decomposition (EEMD) method for NDVI trend decomposition

In the next step, a time-series breakdown method Ensemble Empirical Mode Decomposition (EEMD) was used to separate nonlinear and nonstationary data from NDVI original data series at various timescales (Wu and Huang 2011). EEMD is simpler to apply and less likely to cause overfitting or bias in the analysis because it does not need the definition of any tuning parameters. In EEMD, which enhanced version of Empirical Mode Decomposition (EMD), the sequencing of the initial data, x(t), is broken down into n elements known as intrinsic mode function IMFs and a residual term. This decomposition process involves iteratively extracting IMFs from the original time series using EMD with ensemble data generated by adding white noise and oscillation at a specific timescale period is represented by individual IMF components whereas the original sequence's long-term trend is represented by the residual term. The formula for EEMD involves iteratively decomposing the original time series x(t) into a finite number of intrinsic mode functions (IMFs) C(t) and a residual component r(t). Mathematically, the EEMD algorithm can be represented as follows:

$$X(t) = \sum\limits_{i = 1}^{n} {c_{i} (t)} {\text{ + r(t) }}$$
(4)

where ci​(t) and r(t) denote the ith IMF and residue term.

The step-by-step calculation equations for Ensemble Empirical Mode Decomposition (EEMD) involves.

(1)- Generate ensemble data: xk(t) = x(t) + nk(t) where xk(t) is the k-th ensemble data set, x(t) is the original time series, and nk(t)is white noise, (2)- Decompose ensemble data into IMFs, using Empirical Mode Decomposition (EMD): Let cik​(t) represent the i-th IMF obtained from the k-th ensemble data set, (3)- Repeat decomposition for multiple ensembles, (4)- Compute ensemble mean of IMFs cˉi​(t) and (5)- Obtain final decomposition by subtracting the ensemble mean of IMFs from the original time series to obtain the final decomposition.

Partial correlation analysis

Partial correlation analysis, which accounts for the effect of other factors, enables researchers to extract and quantify direct relationships between variables of interest (Abbas et al. 2021, 2022). Hence, partial correlation analysis was used in this study to determine the correlations between climatic variables, land use/land cover (LULC) dynamics, and NDVI while accounting for any confounding factors. In addition to that partial correlation analysis could aid in determining the extent to which climatic variables (such as temperature, precipitation, and humidity) have a direct influence on NDVI trends, regardless of land use changes or other external influences, therefore, partial correlation analysis was used to examine the relationship and how climatic factors and LULC impact vegetation dynamics.

$$r_{xy,z} = \frac{{r_{xy} - r_{xz} \times r_{yz} }}{{\sqrt {(1 - r_{xz}^{2} ) \times (1 - r_{yz}^{2} )} }}$$
(5)

where rxy represents the correlation between variable x and y; rxz represents the correlation of the third variable z with the variable x; ryz represents the correlation of the third variable z with the variable y.

To assess the lag time response of climate parameters to vegetation growth, the relationship between NDVI and climatic factors was calculated which frequently happens from one month to several months (Chen et al. 2014; Bhuyan et al. 2017; Wen et al. 2017). This research has taken a 0 to 2-month time lag between climatic variables and NDVI.

Estimation of relative contribution of climate change and anthropogenic activities

Finally, the residual trend analysis method was used to distinguish between human-induced vegetation dynamics and effects caused by climate change (Waseem et al. 2022, Evans and Geerken, 2004; Wessels et al., 2012). The predicted NDVI (NDVIpre) value was estimated using regression analysis between NDVI and climatic parameters; these values demonstrated the impact of climatic driving elements on NDVI. Finally, the residual (NDVIres) value is calculated by subtracting the NDVIpre value from the NDVIobs value, which illustrates the vegetation's response to human activity. When the changing trend of the NDVI residual with time was insignificant, the change of the NDVI was explained by climatic factors. As opposed to the above, the change in the NDVI was explained by anthropogenic activities (Jiang et al. 2017; Liu et al., 2017). The following equations are used to calculate the proportions of anthropogenic activity and climate change to changes in vegetation cover:

$$r_{1} = \frac{{slope(NDVI_{pre} )}}{{{\text{slope(NDVI}}_{obs)} }} \times 100\%$$
(6)
$$r_{2} = \frac{{slope(NDVI_{res} )}}{{{\text{slope(NDVI}}_{obs} )}} \times 100\% \,$$
(7)

where r1 represents variations in vegetation cover due to relative rates of contribution of climatic change; r2 represents variations in vegetation cover due to relative rates of contribution of anthropogenic activities. Since no additional variables were considered in this investigation expect r2 = 1- r1 could be assumed.

Results

Land use and land cover change analysis

The unsupervised classification of land use and land cover types in the Haro River Basin for the years 2002, 2013, and 2021, shown in Fig. 3, resulted in significant land use transformations. For the current study, the land use was categorized into six distinct categories, including water (W), built-up areas (BU), barren land (BL), shrub and grass (SG), sparse vegetation (SV), and dense vegetation (DV). In 2002, the landscape composition was 0.2% water, 64.12% built-up areas, 13.93% barren land, 18.39% shrub and grass, 3.32% sparse vegetation, and 0.05% dense vegetation. By 2013, there was a noticeable shift, with increases in water, barren land, shrub and grass, sparse vegetation, and dense vegetation by 0.5%, 18.95%, 30.68%, 3.84%, and 0.15%, respectively. However, built-up areas experienced a substantial decrease of 45.80%. In 2021, the landscape continued to evolve, witnessing a surge in built-up areas to 61.35%, while water, barren land, shrub & grass, sparse vegetation, and dense vegetation experienced reductions by 0.24%, 15.44%, 21.48%, 1.45%, and 0.01%, respectively, as outlined in Fig. 4. The categories of shrub & grass, sparse vegetation, and dense vegetation were amalgamated into a single vegetation class for clarity. It was noted that the region experienced a large increase in anthropogenic activity, driven by infrastructural expansion and intensive farming techniques, hence, resulting in a notable loss of natural vegetation cover. From 2002 to 2021, dominating land cover classes were converted to built-up areas, with southern and western regions experiencing the most growth. Barren land was also turned into space for infrastructure development, including roadways, residential, and industrial zones, so fostering urban expansion. On the other hand, agricultural expansion, aided by machinery-intensive methods, met food demand and supplied livelihoods despite rapid population rise. Additionally, rural-to-urban migration headed the growth of urbanized regions. Conclusively, these findings offer a nuanced understanding of the dynamic land use and cover patterns throughout the studied period, highlighting the complex interplay of natural and anthropogenic influences.

Fig. 3
figure 3

Land use and land cover classification map in a 2002, b 2013 and c 2021 respectively

Fig. 4
figure 4

Percentage area of the land use and land cover types

Temporal trend analysis of climatic factors and NDVI

Figure 5 indicates the average annual temporal variation in slope and trend of different climatic factors and NDVI for the study period of 2002–2021 in the HRB. In terms of climatic factors rainfall, humidity, and minimum temperature exhibited a statistically significant upward trend (0.4044 mm/year; 0.4497%/year; 0.0282 °C/year respectively). Conversely, maximum temperature demonstrated a negative trend of − 0.025 °C/year. The analysis also revealed that annual precipitation in the Haro River Basin varied in the range of 607 mm/year to 2400 mm/year and maximum temperature showed a significant increasing trend in spring and autumn (with rates of 0.006 °C/year, and 0.026 °C/year respectively, and had a slight decreasing trend (at a rate of − 0.08 °C/year and − 0.077 °C/year) in winter and summer season. However, minimum temperature showed a positive trend in winter, spring, and autumn with rates of 0.045 °C/year, 0.097 °C/year, and 0.057 °C/year respectively, and had a negative trend at a rate of − 0.027 °C/year in the summer season. Moreover, NDVI data indicates that HRB experienced a positive trend over time with overall rates of 0.0029/year in the HRB. These findings suggest a complex interplay between climatic factors and vegetation dynamics in the HRB, highlighting the importance of considering multiple variables in understanding the ecological changes over the study period.

Fig. 5
figure 5

Temporal trend analysis: a NDVI, b rainfall, c humidity and d maximum and minimum temperature from 2002 to 2021

NDVI time series decomposition

This study focused on identifying and characterizing variations in the trend component of the NDVI time series at the monthly scale in the HRB by using the BFAST approach. Furthermore, employing the BFAST technique a breakpoint in the NDVI was identified in 2013. The increase in greening exhibited a gradual rise trend of 0.0001/year from 2002 to 2013. Subsequently, it experienced a sudden rising trend after 2013 up to 0.0002/year. Concluded that Abbottabad, Islamabad, Murree, and Rawalpindi indicated a considerable increasing greening trend from 2002 to 2021 as presented in Fig. 6. These results highlight the gradual changes in vegetation patterns, showcasing how the BFAST approach effectively captures and describes these trends in the Haro River Basin landscape throughout the study period (Fig. 6).

Fig. 6
figure 6

BFAST algorithm for monthly NDVI time series decomposition from 2002 to 2021 at the regional scale

The decomposition of NDVI time series data from the period of 2002–2021 into non-stationary and non-linear components in Abbottabad, Islamabad, Murree, and Rawalpindi is shown in Fig. 7. The original NDVI data series range is represented by the D (t) term. IMFs represented the non-stationary and non-linear NDVI time series data at multiple time scales. Whereas the residual term indicated that overall NDVI showed an increasing trend in all respective stations. Specifically, Abbottabad experienced an increase from 0.51 to 0.54 and Murree observed an increase from 0.53 to 0.55 over the span of 20 years. This decomposition provides a clear understanding of the temporal dynamics in vegetation, emphasizing a general positive trend in NDVI across the studied regions, and contributing valuable insights for ecosystem monitoring and management in these areas.

Fig. 7
figure 7

Trend decomposition of monthly NDVI time series for the period of 2002 to 2021 based on EEMD: a Abbottabad, b Islamabad, c Murree and d Rawalpindi

Relationship between climatic factors and NDVI

Partial correlation between NDVI and climatic factors

The effect of precipitation, humidity, maximum and minimum temperature on vegetation dynamics was assessed by estimating the coefficients of partial correlation. These coefficients were then used to map the relationship between monthly average precipitation, humidity, temperature, and NDVI from 2002 to 2021. In Abbottabad, Islamabad, Murree, and Rawalpindi the partial correlation between rainfall and NDVI is observed as − 0.058, 0.117, − 0.149, and 0.094, respectively. Similarly, the coefficient of partial correlation between humidity and NDVI is 0.513, 0.516, 0.366, and 0.626 for Abbottabad, Islamabad, Murree, and Rawalpindi respectively. Similarly, the partial correlation coefficients between minimum temperature and NDVI are 0.063, 0.055, 0.08, and 0.108 for Abbottabad, Islamabad, Murree, and Rawalpindi respectively. On the other hand, the partial correlation coefficients between maximum temperature and NDVI are 0.157, 0.001, 0.23, and -0.048 for Abbottabad, Islamabad, Murree, and Rawalpindi respectively.

A positive coefficient of partial correlation between the rainfall and NDVI occupied 81.06% and a negative partial correlation coefficient was identified at 18.93% in the entire area. The significant positive relationship accounted for 0.51% and the insignificant positive relationship accounted for 99.48% area. A positive coefficient of partial correlation was found between the humidity and NDVI accounting for 100% and a significant positive correlation is identified in the 100% area. Within the area, a positive coefficient of partial correlation between maximum temperature and NDVI was present in 38.56% region while a negative coefficient was observed in 61.44%. Among these correlations, a significant positive relationship was found in the 10.13% area while an insignificant positive correlation accounted for 89.86%. A positive coefficient of partial correlation was found between the minimum temperature and NDVI accounted for 100% and an insignificant positive correlation was identified in 100% of the study area. Significant results for the partial correlation of all climatic factors and NDVI.

Partial correlation between land use classes and climatic factors

Figure 8 indicates annual timescale analysis for significant positive and negative partial correlations between NDVI-based land use classes and precipitation, humidity, minimum temperature, and maximum temperature in the Haro River Basin. Rainfall exhibits a positive partial correlation with water, barren land, and sparse vegetation while it has a negative partial correlation with other classes. Humidity only exhibits negative partial correlations with barren land and shrubs & grass but it exhibits negative partial correlations with barren land and shrubs & grass. Maximum Temperature shows negative partial correlations with all land cover classifications except sparse vegetation. Minimum Temperature displays a strong positive partial correlation with water, barren land, and dense vegetation but it exhibits a strong negative partial correlation with other classes.

Fig. 8
figure 8

Partial correlation between different LULC classes and climatic factors in HRB

Lag time analysis between climatic factors to NDVI

Time lag response between climatic parameters (P, H, Tmax, and Tmin) and NDVI showed distinct variations at spatial scale analysis. When considering the monthly scale approximately 36.38% of the area exhibited a statistically significant lag time effect of 0-months in Rawalpindi and Islamabad while 63.62% area displayed a statistically insignificant lag time effect. For a lag time of 1-month 11.38% area showed the most favorable lag time response for Precipitation (P) to NDVI in Abbottabad while 88.62% of the area exhibited a statistically insignificant lag time effect. However, in the case of a 2-month lag time 100% area revealed an insignificant lag time response for Precipitation (P) to NDVI. On the other hand, when examining the lag time response of humidity to NDVI it was observed that 100% area displayed a statistically significant lag time effect for both 0 and 1-month lag. However, for a lag time of 2-months, 28.03% of the area in Rawalpindi exhibited a statistically significant lag time response of humidity (H) to NDVI while 71.97% area showed a statistically insignificant lag time response. Regarding the lag time response of maximum temperature to NDVI it was found that 100% area showed a statistically insignificant lag time effect for a 0-month lag. For a 1-month lag time, a combined 30.99% area exhibited a significant lag time response of maximum temperature (Tmax) to NDVI in Murree and Rawalpindi while 69.01% of the area displayed a statistically insignificant lag time effect. Additionally, in Rawalpindi, 28.03% area demonstrated a statistically significant lag time response of Tmax to NDVI for a 2-month lag whereas 71.97% of the area revealed a statistically insignificant lag time effect. Regarding the lag time response of minimum temperature to NDVI it was found that 100% area showed a statistically insignificant lag time effect for both a 0-month and 2-month lag. However, for a 1-month lag time, a combined 36.38% of the area exhibited a significant lag time response of minimum temperature (Tmin) to NDVI in Islamabad and Rawalpindi while 63.62% of the study area displayed a statistically insignificant lag time effect.

Contribution of climate change and anthropogenic activities to NDVI

The impact of anthropogenic activity on vegetation variations cannot be disregarded because they have a major effect on the ecosystem of the HRB. In the interest of differentiated relative rates of the contribution of anthropogenic activity and climate change to vegetation dynamics, the residual NDVI trend from 2002 to 2021 was determined by developing the multiple linear regression model between the rainfall, humidity, maximum temperature, minimum temperature, and NDVI. The results illustrate the proportional contributions of anthropogenic activity and climate change in the Haro River Basin. In Abbottabad climate change and anthropogenic activities accounted for 71.88% and 31.25% respectively. Similarly, in Islamabad, the contributions were 75% for climate change and 25% for anthropogenic activities. In Murree, the respective proportions were 78.26% for climate change and 21.74% for anthropogenic activities. Lastly, in Rawalpindi, the contributions were 75% for climate change and 25% for anthropogenic activities in relation to overall dynamics observed in vegetation.

Contribution of climate change and anthropogenic activities to different land use classes

Comparative rates of the contribution of anthropogenic activities and climate change were estimated for corresponding land use classes to compare the potential influence on NDVI results shown in Fig. 9. Among different land use classes, the rates of the contribution of climate change and anthropogenic activities to NDVI’s variation are different. In Abbottabad, the major relative rates of the contribution of climate change are found for built-up, barren land, sparse vegetation, and dense vegetation at 84.46%, 82.98%, 71.43%, and 69.56% respectively. Meanwhile, the major relative contribution rate of anthropogenic activities found for water is 70.58%. In Islamabad, significant contributions from climate change were observed in shrub & grass, sparse vegetation, and barren land accounting for 93.33%, 82.98%, 87.71%, and 75.84% respectively. Meanwhile, anthropogenic activities were found to have a major relative contribution rate of 82.57% in dense vegetation and 66.66% in water areas. In Murree, the major relative contribution rate of climate change is found for built-up, water, dense vegetation, and shrub and grass 93.33%, 88.46%, 85.82%, and 82.24% respectively. Similarly, the major relative contribution rate of anthropogenic activities found for sparse vegetation is 58.88%. In Rawalpindi the analysis revealed that climate change had a major relative contribution rate in water bodies, sparse vegetation, dense vegetation, and barren land, accounting for 93.87%, 85.44%, 75%, and 73.97% respectively. Additionally, anthropogenic activities specifically in built-up areas exhibited a high relative contribution rate of 72.48%.

Fig. 9
figure 9

Rates of the relative contribution of climate change and anthropogenic activities to each LULC class: a Abbottabad, b Islamabad, c Murree and d Rawalpindi

Discussion

The intricate relationship between land surface dynamics and the atmospheric system gets more complex as anthropogenic regulations and natural processes interact more. Not only is the climate affected by natural forces, but anthropoid activity can also change it, adding layers of complexity to its evolution. Vegetation specifically can only grow in the optimum climatic conditions (for example, the optimal T and P) and proper nutritious situations. On the other hand, Anthropogenic activities such as biodiversity programs, human productivity, and way of life have also an impact on the dynamic of vegetation (Zhang and Wu 2020). Several studies have found that vegetation dynamics respond on a local scale which is mostly affected by local climate as well as the quick expansion of the world economy and the explosive development in population as a result of anthropogenic activities (Zhang and Wu 2020; Shi et al. 2021). For example, the study area (i.e., Haro River Basin (HRB)) has shown a significant trend towards wetness and warmness that was likely caused by the effects of global warming as well as anthropogenic activities over the last 20 years (Nauman et al. 2019). In this study i.e., Nauman et al., (2019) assessed the potential impacts of climate change on streamflow in the Haro River watershed, Pakistan, using the Soil and Water Assessment Tool (SWAT) and showed that streamflow in the Haro River watershed is highly vulnerable to climatic variations and could impact the discharge at Khanpur Dam, which is a crucial source for meeting the domestic water supply needs of a large population. Hence, the current study designed a holistic approach to investigate the vegetation dynamics in HRB and found that Climate change relative contribution rates on NDVI are mainly found in the range of 72–78%. Our results correlate with a previous study which indicates that climate change contributes 59.68% to NDVI and is the main driving factor influencing vegetation activities (Zhu et al. 2023). It was expected that the basin's topography would comprise a mix of plains, foothills, and potentially some mountainous areas, with diverse land use patterns, including agricultural areas, urban developments, and potentially some natural or protected areas and anthropogenic activities such as agriculture, industrial activities, and urbanization are limited. Moreover, anthropogenic activities can also increase the amount of vegetation in the region by improving agricultural technology, amount of plants, and closed hills for afforestation (Liu et al. 2020; Sun et al. 2021). National and local administrations have accomplished several ecological programs over the past 20 years including the Ecological Shelter Project, Green Plant Project, Soil and Water Management Project, and Natural Forest Preservation Project. This study also depicted that from 2002 to 2021 built-up and vegetation increased to 61.35% and 23%, whereas water and barren land decreased by a magnitude of 0.24%, and 15.44% respectively. The results of a previous study in the Simly watershed on the Pothwar Plateau also showed that the areas covered by settlements, bare soil, and agriculture classes were improved while the areas covered by vegetation and water classes significantly declined (Butt et al. 2015). Moreover, a relative contribution rate of anthropogenic activities was found in this area that ranged from 22 to 31% to NDVI. Zhu et al. 2023) also found in research that anthropogenic activities could contribute up to 42.35% to an increase in NDVI. In addition to attribution, an understanding of temporal response patterns is necessary to predict the dynamics of the vegetation and as the timespan elongated the importance of interaction between vegetation and climate change increased (Qi et al. 2019). The study reveals that a substantial portion of the area (36.38%) exhibits a statistically significant instantaneous response of NDVI to precipitation (P), emphasizing the immediate impact of rainfall on vegetation. Additionally, a notable percentage (30.99%) displays a significant lag time effect of maximum temperature (Tmax) on NDVI, suggesting a delayed but discernible influence of temperature on vegetation. These findings underscore the complex and multifaceted relationships between climate variables and vegetation dynamics in the studied area.

Conclusions

This study employed MODIS NDVI and climatic factors (P, H, Tmax, and Tmin) to comprehensively analyze the spatiotemporal patterns and relationships from 2002 to 2021 in the Haro River Basin. Utilizing novel integrated methodology, including ordinary least squares linear regression, BFAST, EEMD, and partial correlation analysis, along with residual trend analysis, the research yielded significant insights:

  1. 1.

    The comprehensive analysis of land use, climatic factors, and vegetation dynamics in the Haro River Basin from 2002 to 2021 reveals interconnected trends and drivers shaping the vegetation dynamics.

  2. 2.

    The observed trends in annual average NDVI across all monitoring stations signify an overall enhancement in vegetation health, coinciding with increasing rainfall and humidity and the decreasing trend in maximum temperatures, alongside fluctuations in minimum temperatures.

  3. 3.

    Analyses employing BFAST and EEMD techniques further elucidate the significant role of climatic factors in driving NDVI variations, showing spatial and class-specific heterogeneity.

  4. 4.

    Notably, while anthropogenic activities exert some influence on vegetation variation, climate change emerges as the predominant driver, contributing over 55% to changes in various vegetation classes

  5. 5.

    These findings underscore the urgency of addressing climate change impacts on ecosystem resilience and underscore the critical need for sustainable land management practices to mitigate adverse effects and ensure long-term ecological sustainability in the Haro River Basin.

In conclusion, this research underscores the complex interplay of climatic factors and anthropogenic activities on vegetation dynamics, highlighting the dominant role of climate change. However, causality-based identification of specific primary drivers of vegetation change can further enhance the scope of this study for better sustainable development in the Haro River Basin. The future scope of the research may also include conceptual guidance for ecological management, specific actions for vegetation ecological protection and restoration, and sustainable development in the Haro River Basin.