Study area

The Yangmingshan National Park is located in the center of Taipei–Keelung metropolitan area of northern Taiwan (Fig. 1). The park was established in 1985, encompassing an area of 113 km2 with an elevation range of 56–1,120 m. We classified a year into three seasons: December–March (a colder season with a mean temperature of 13.2 °C, and mean monthly precipitation of 224 mm), April–July (a hotter and dryer season with a mean temperature of 22.4 °C, and a mean monthly precipitation of 274 mm), and August–November (a hotter and wetter season with a mean temperature of 21.3 °C, and a mean monthly precipitation of 406 mm) according to the meteorological data at Anbu weather station (2012–2016). Lowland evergreen broad-leaved forests characterized with Machilus sp. and Acacia sp. account for 76% of the park’s vegetation cover, followed by agriculture cover (7%), herbaceous cover (6%), broad-leaved thickets (4%), plantation forests (4%), and others (3%; Hsu et al. 2008). At least 26 species of mammals occur in the park46, including seven endemic species to Taiwan (27% endemism). This study included nine native species with larger size (>1 kg). Among them, three are currently protected under Wildlife Conservation Act of Taiwan (http://conservation.forest.gov.tw), including Formosan pangolin (M. pentadactyla pentadactyla), a subspecies of the Critically Endangered Chinese pangolins on the IUCN Red List47, as well as small Indian civets, and sambar. The other six species are Formosan macaques, Reeves’s muntjac, wild boar, masked palm civets, Chinese hares and Chinese ferret badgers. Native apex predators, such as leopard cats (Prionailurus bengalensis) and black bears (Ursus thibetanus) do not occur in this area46.

Camera trapping

Remote cameras are ideal tools for tracking medium- to large-sized mammals and assessing anthropogenic impacts48. We deployed cameras (Cuddeback Capture, Cuddeback Digital, Wisconsin, USA; HC500 and PC800, Reconyx Inc. Wisconsin, USA; KeepGuard KG780NV, Keeptime Inc., Shenzhen, China) at 121 sites throughout the study area from March 2012 to July 2017 (Fig. 1). We overlaid the study area with a 1 × 1 km grid system and placed cameras in every other grid. The three brands of cameras were randomly distributed. A total of 61 grids (41% of all grids) were sampled. More than one camera sites were sampled at 33 grids, but the cameras were not deployed simultaneously. At each camera site, cameras were active for 143 days (SE = 11) on average. We installed cameras near existing animal trails to maximize detection probability. Thus, our protocol represents a balance between systematic sampling and intentional selection of animals49. Cameras were set 30–80 cm from the ground with an angle slightly downward, which was expected to work well for medium- to large-sized mammals. We checked each station every month to change memory cards and batteries. Camera trap data between 2012 and 2014 were used for a previous study32, which focused on the population status of small Indian civets and described their potential threat from dogs.

Many environmental conditions could influence species richness and occurrence of mammals. For each camera station, we recorded vegetation cover and classified it into three types: herbaceous vegetation and fargesias thickets, broad-leaved forests, and broadleaf-conifer mixed forests. We used ArcMap 10.1 (ESRI Redlands, CA, USA) to calculate distances to the nearest human settlement and water body. The layer of human settlements, including buildings, farms and recreation areas, was extracted from a land-cover layer provided by YMSNP. The water layer was provided by the Water Resources Agency in Taiwan (https://data.gov.tw, accessed 1 Feb 2018). Elevation, slope, and solar radiation were derived from a 20-m resolution Digital Elevation Model provided by the Ministry of the Interior, Taiwan (https://data.gov.tw, accessed 1 Feb 2018).

We summarized trap-nights of effort for every camera after subtracting days where cameras malfunctioned or ran out of batteries. We used a RAI to quantify activity level of the invasive carnivores50. Consecutive camera detections of the same species at the same site were deemed independent when there was at least a 0.5-h interval between them or when animals could be individually distinguished51.

Multi-species hierarchical occupancy modeling

We used multi-species hierarchical occupancy modeling29,30,52 with a Bayesian approach25 (Supplementary Information 6) to estimate species richness as a function of model-based estimators of species-specific occurrence at each camera site. Multi-species hierarchical occupancy model combines information across species and reduces the number of parameter estimates, while allowing for species-specific responses to covariates53,54. Several species in the study areas can have home ranges covering several camera sites, and likely violated the assumption of population closure. Thus, we estimated occurrence of a species at a camera site instead of occupancy, as the probability of the species using the site during the sampling period55.

We hypothesized the occurrences of native mammals are influenced by distance to human settlements and activity levels of dogs and cats. However, because dogs and cats are mobile, their presence could also influence detection probability (frequency of uses by the animal at a given site56,57,58, a metric of intensity of site use) of native mammals in trail camera survey. Therefore, we assumed that detection probability is affected by activity levels of dogs and cats, as well as camera brands and season. We performed preliminary LOESS regressions to explore the most likely forms of relationships between species richness of the native mammals and distance to human settlements, dog RAI or cat RAI. The patterns suggest that species richness of native mammals might have a peak around 0–0.5 RAIs of dogs and cats, which persisted even after the data points with zero RAIs were removed (Supplementary Information 7). On the other hand, species richness of native mammals appeared to have a linear relationship with distance to human settlements (Supplementary Information 7). We thus chose to apply quadratic relationships between RAI of the invasive carnivores and occurrences of native mammals.

For other covariates that may influence wildlife occupancy and detection but are not of our interests, we used a stepwise selection strategy to decide whether to retain it59. Specifically, a covariate was retained if its 95% CI did not include zero. For model of detection probability, we first included both effects of season and camera brands (Keep Guard [reference level], Cuddeback, Reconyx) in the model. We then removed variables that do not have significant effects. Our final base model of detection probability only included effects of camera brands to account for differences in sensitivity and trigger speed. For environmental variables that may influence occurrences, such as vegetation type, elevation, slope, solar radiation and distance to water, we included these variables sequentially to the base occupancy model that only include variables for detection probability. After the selection of the environmental covariates, which resulted in no environmental covariate being selected, we added the three variables of anthropogenic disturbances (i.e. distance to the nearest human settlement, RAI of dogs, RAI of cats) to form the final models:

$$\begin{array}{rcl}{\rm{logit}}({\rm{probability}}\,{\rm{of}}\,{\rm{occurrence}}) & = & {\rm{\alpha }}0+{\rm{\alpha }}1({\rm{distance}}\,{\rm{to}}\,{\rm{human}}\,{\rm{settlement}})\\ & & +\,{\rm{\alpha }}2({\rm{RAI}}\,{\rm{of}}\,{\rm{dogs}})+{\rm{\alpha }}3({\rm{RAI}}\,{\rm{of}}\,{{\rm{dogs}}}^{{\rm{2}}})\\ & & +\,{\rm{\alpha }}4({\rm{RAI}}\,{\rm{of}}\,{\rm{cats}})+{\rm{\alpha }}5({\rm{RAI}}\,{\rm{of}}\,{{\rm{cats}}}^{{\rm{2}}})\end{array}$$

$$\begin{array}{rcl}{\rm{logit}}\,({\rm{detection}}\,{\rm{probability}}) & = & {\rm{\beta }}0+{\rm{\beta }}1({\rm{Cuddeback}})\\ & & +\,{\rm{\beta }}2({\rm{Reconyx}})+{\rm{\beta }}3\,({\rm{RAI}}\,{\rm{of}}\,{\rm{dogs}})+{\rm{\beta }}4({\rm{RAI}}\,{\rm{of}}\,{\rm{cats}})\end{array}$$

The distance to human settlement, dog RAI, and cat RAI are not correlated (Pearson’s correlation, p > 0.05, r < |0.3|). The RAI of dogs and cats were log-transformed. We standardized all continuous covariates to have a mean of zero and standard deviation of one before running the occupancy model.

We estimated posterior distributions of parameters using Markov chain Monte Carlo (MCMC) implemented in JAGS (version 3.4.0) through R2Jags60 in program R (version 3.4.2, R Foundation for Statistical Computing, Vienna, Austria). For each model, we generated three chains of 50,000 iterations after a burn-in of 10,000 and thinned by 50. We assessed convergence using the Gelman–Rubin statistic where values < 1.1 indicate convergence61. We used probability of occurrence matrices generated by MCMC iterations to estimate overall species richness and richness at each camera station (Supplementary Information 8)25,30.

Diel activity overlap

To study the temporal relationships between native mammals and invasive carnivores, we inspected how the levels of diel activity overlap changed in response to seasonal activity levels of dogs and cats. We first calculated RAI of dogs and cats for each season to examine the variation of their seasonal activity levels. We then estimated the overlap in diel activity between native mammals and invasive carnivores in each season (except for Chinese pangolins due to its small sample size with only nine detections; Supplementary Information 1).

Seasonal RAI was calculated as the average monthly RAI of the season. We used the data from only 31 out of the 121 cameras, which were active for at least two seasons and at least 60 days per season. This helps reduce the confounding effects from spatial heterogeneity when comparing seasonal patterns based on the data taken at different locations.