1 Introduction

The livelihoods of 100 million people depend on coffee (Pendergrast 1999), many of whom are vulnerable to climate change (Baca et al. 2014). In addition to its socio-economic importance, the agronomy of coffee production justifies research on the crop’s adaptation to climate change. The average lifespan of a coffee plantation is about 30 years (Wintgens 2009) but can be more than 50 years. Existing coffee plantations may thus experience the climate change foreseen by global circulation models (GCMs). Commercial varieties in current use have a narrow genetic base (Anthony et al. 2001) and therefore a narrow climatic range (DaMatta 2004). The threat of climate change is further aggravated by the long lead time of adaptation measures such as breeding for stress tolerance, which may take decades (Eskes and Leroy 2008).

Most coffee is produced from two species. Robusta coffee (Coffea canephora var. Robusta) accounts for 30 % of global production (USDA 2012). It is generally more heat tolerant, but is more susceptible to low temperatures than Arabica coffee (Coffea arabica) (Wintgens 2009), which accounts for the remaining 70 % of global production (USDA 2012). Climate change has already been forecast to reduce productivity of Arabica coffee (e.g. Gay Garcia et al. 2006; Zullo et al. 2011; Schroth et al. 2009). Coffee could migrate to higher latitudes (Zullo et al. 2011) or altitudes (Schroth et al. 2009) but this would not benefit current producers (Baca et al. 2014) and the migration could threaten ecosystems (Laderach et al. 2009). Although C. canephora can sustain higher temperatues than the higher quality C. arabica, it is uncertain whether it can replace the latter on commodity markets.

Studies have assessed the impact of climate change on coffee using one of three methods: use of common denominators of climate suitability to map risk areas (Zullo et al. 2011; Simonett 1988); or correlation between temporal (Gay Garcia et al. 2006) or spatial variability of coffee production (Schroth et al. 2009; Davis et al. 2012). Simonett et al. (1988), with Robusta in Uganda, used mean annual temperature to conclude that only high altitudes will remain suitable. Zullo et al. (2011) included water deficit and frost risk in addition to mean annual temperature to project a southward migration of Arabica production in Brazil. Gay Garcia et al. (2006) used the correlation between yield and temperature in Mexico to suggest that economical yields would not be viable by 2020. Schroth et al. (2009) found a similar impact on Mexican coffee with increasing temperatures. Davis et al. (2012) concluded that areas that are climatically suitable for indigenous coffee varieties in East Africa may be substantially reduced in future scenarios.

These previous studies on the impact of climate change on coffee demonstrate latitudinal and altitudinal migration or complete abandonment of coffee. The results, however, are limited to local levels and global trends remain unclear.

Davis et al. (2012) and Schroth et al. (2009) used the MaxEnt species distribution software (Phillips et al. 2006) to investigate the impact of climate impacts on C. arabica. MaxEnt has been criticized as giving biased representation of suitable climates if the parameters are not chosen carefully. There is a vast literature on defining appropriate parameter values for robust models. But in the absence of reliable data to compare inter-temporal climate and species distribution changes, there is no clear guidance for parameter values that allow reliable extrapolation (Elith and Graham 2009). This is despite model uncertainties that are larger than those from stemming from GCMs (Diniz-Filho et al. 2009).

This limitation may be overcome by using outputs from an ensemble of various models, which provide a more robust assessment and allow for explicit uncertainty analysis (Araujo and New 2007; Diniz-Filho et al. 2009). Weigel et al. (2008) demonstrated that outputs from a multi-model ensemble improved prediction skill. Hannah et al. (2013) used ensembles to assess the potential indirect effects of land-use change on ecosystems by the migration of viticulture. Bhatt et al. (2013) used them to generate risk maps of dengue fever.

The objective of this paper is to predict current and future climate suitability for coffee (Arabica and Robusta) production on a global scale. The ensemble approach we chose improves the robustness of the analysis compared with previous studies. We then compared the distribution of suitability under current and future conditions to derive an impact profile of climate change on global coffee production.

We first assembled a global dataset of known present occurrence locations of both coffee species. Using these data, we trained three popular machine-learning algorithms; Support Vector Machines (Karatzoglou et al. 2006); Random Forest (Breiman 2001); and MaxEnt (Phillips et al. 2006). We used distinct parameter combinations as outlined below, to give a total of 135 models. We evaluated the model performance against the performance of a trivial inverse-distance model. Finally, we extrapolated the models on to interpolated climate data of current and future conditions and derived the mean suitability score for each global pixel cell. We generated the future climate data by downscaling GCM models run for the representative concentration pathways (RCP) 2.6, 6.0 and 8.5 (van Vuuren et al. 2011). We analyzed impacts for latitude, altitude, regions and land-use classes to hypothesize future impact scenarios on global coffee production.

2 Materials and methods

2.1 Climate variables

For the current climate (1950–2000) we used the WorldClim global climate data set on 2.5 arcminute resolution (Hijmans et al. 2005). The dataset provides interpolated climate layers for 19 bioclimatic variables based on historical data. These variables represent patterns found in monthly weather station data, e.g. annual temperature and precipitation extremes, seasonality and means.

We used five GCMs from the IPCC’s 5th assessment report (Stocker et al. 2013) to obtain future climate data (GFDL-ESM2M, HadGEM2-ES, IPSL-CM5A-LR, MIROC-ESM-CHEM, and NorESM1-M). These GCMs are representative of projected changes of global mean temperature and precipitation (Warszawski et al. 2014). We downscaled the outputs of the GCMs using the delta method (Ramirez and Jarvis 2010) and computed the difference between model outputs for current conditions and the mean for the 2040–2069 time-slice. We smoothed the resulting layers to 2.5 arcminute resolution and applied them to the WorldClim layers for current climate. The result was a high-resolution surface corrected for bias for the current climate and the 2050 time-slice for the 19 bioclimatic variables.

2.2 Present occurrence data

Present occurrence location data identify climates currently suitable to produce coffee. We derived the occurrence points from three sources: (i) Geo-referenced coffee farms; (ii) geo-referenced municipalities in Brazil that produce coffee; and (iii) geo-referenced coffee-growing areas identified from Google Earth where data sources (i) or (ii) were not available.

Most occurrence points came from a global database of 62,000 geo-referenced individual farms with predominantly C. arabica and some C. canephora. The International Center for Tropical Agriculture (CIAT) developed the database during several regional projects that were conducted in collaboration with coffee cooperatives and cooperating research organizations.

A comprehensive set of occurrence records in all coffee-producing regions is desirable so that all suitable climates are represented in the database (Elith et al. 2011). We supplemented the geo-referenced data by generating additional occurrence points using publicly-available information about the distribution of coffee production. We used satellite imagery to identify precise locations based on this information.

Unlike the C. canephora data, data of the C. arabica locations were not collected for modeling so that they were highly clustered in the project regions. We stratified the database to avoid bias using a principal-component analysis on the 19 bioclimatic variables to identify typical climates. From each climate cluster we chose a random representative sample. This reduced the original sample to 1772 unique presence locations for C. arabica.

Neither the Arabica nor the Robusta database included all of the dominant growing regions in Brazil, where 36 % of global Arabica coffee is produced (USDA 2012). To ensure sufficient representation of Brazilian sites and climates, we included data provided by IBGE (2012). Using these data, we identified municipalities where 75 % of the coffee is from one or other of the two species. We then geo-referenced these municipalities for the appropriate species.

The combined geo-reference dataset gave 2861 unique pixel cells for C. arabica in 26 countries that together accounted for 92 % of global Arabica output 1998–2002 (USDA 2012). For C. canephora the dataset included 364 unique pixel cells in 11 countries that together account for 92 % of global Robusta output 1998–2002 (USDA 2012) (Supplementary Material Table S1). Figure 1 shows the distribution of present coffee locations and major production regions.

Fig. 1
figure 1

Global coffee location database and major coffee growing regions. Blue points represent C. canephora occurrence locations; orange points locations of C. arabica based production. Grey shading and bold names represent regions of coffee production

2.3 Background sampling

To fit a function that describes suitable climates, the classification algorithms compare the variable patterns found at present occurrence locations with the pattern found in environments that are potentially suitable. To characterize these environments, we took random samples from locations that were not known present locations.

We chose the background samples to avoid both trivial classification and overtraining of the algorithms. In ecology, there is a trade-off between predictive performance and capability to generalize. For example, a model that always correctly separates known occurrence locations from the random background samples may be undesirable. This is because it underestimates the true environmental range in cases where the known occurrence data incompletely represent the true distribution. A more general model, however, that always correctly predicts unknown present locations may overestimate the environmental range.

No optimization framework for the definition of background parameters and modeling approaches exists to date (Elith and Graham 2009). Therefore, rather than using a single sampling strategy we used a model ensemble. We based the ensemble on several background sampling parameters within reasonable ranges for (i) the geographical extent from which the background sample was drawn, and (ii) the number of samples. Furthermore, we accounted for remaining sampling bias in the location database using the biased-background sampling method Dudík et al. (2005)) (Supplementary Material Table S1).

The geographic extent of background samples should reflect prior knowledge of the species distribution and be adequate to the geographical scale of the study (VanDerWal et al. 2009). We employed three different background concepts, political, biophysical, and geographic. We defined the first background as all countries that produce either Robusta or Arabica (USDA 2012; ICO 2013) respectively. We defined the second by limiting the environment to the observed spread of annual mean temperature for each species location sample (C. arabica: 14 °C–26.4 °C; C. canephora 19.2 °C–27.8 °C). We defined the third by using a 4.5° buffer around present locations (about 500 km at the equator).

The literature agrees that the ratio of background samples to occurrence locations should be at least 1:1. Too few background samples do not allow for a clear distinction between occurrence and background, commonly leading to an over-prediction of distribution, while too many background samples result in under-prediction (Barbet-Massin et al. 2012). We used occurrence location to background sample ratios of 1:1, 2:1, 4:1, 6:1, 8:1.

2.4 Model training

For the climate suitability mapping we relied on the classification probabilities provided by three machine-learning algorithms: MaxEnt, Support Vector Machines (SVM) and Random Forest. MaxEnt (Phillips et al. 2006) is widely used to model species distribution in ecology (Merow et al. 2013). SVM is a widely used classification algorithm; we used the implementation in the R package “kernlab” (Karatzoglou et al. 2006). Random Forests (Breiman 2001) is an ensemble learning method for classification of data using multiple decision trees that has been shown to be useful in ecology (Prasad et al. 2006).

Machine learning algorithms include a regularization parameter that allows the user to adjust a trade-off between optimal model fit and generalization. Optimal parameter values are usually dependent on the characteristics of the input data. We therefore initially defined relevant parameter values by conducting a grid search across the relevant parameter ranges. To assess generalization capacity we selected 25 % of our occurrence points that were most distant from other points as a test data set, and trained on the 75 % of present locations that were not as dispersed. We chose three levels of regularization per algorithm that improved model generalization compared to default settings. For the MaxEnt regularization parameter β we choose 0.01, 5 and 20: for SVM’s c-cost parameter 1, 0.5 and 0.05; and for the number of variables picked at nodes by Random Forest 8, 4, and 2. The first value was meant to produce a well-fitted model, while the last value gave a general model.

2.5 Model evaluation

To assess the performance of the individual models we used two measures: the threshold independent area under the receiver characteristic curve (AUC); and a calibrated AUC measure (cAUC). AUCs were calculated using 10-fold subsampling of training and testing data. Each model was thus trained on 90 % of the location database and evaluated on the remaining 10 % in ten replications.

The AUC is the standard method of model evaluation in modeling predictive distributions. It summarizes the ranking of occurrence points versus the ranking of background samples. If all present sites have a higher value than background sites its value is 1, while a value of 0.5 reflects a model that is no better than chance. The use of the AUC statistic has been criticized, however, as being misleading when different background samples are drawn from different background extents: low predictions on geographically distant locations are often trivial and inflate the statistic (Lobo et al. 2008). This is to be expected because climate patterns are usually auto-correlated. We therefore calculated a cAUC as proposed by Hijmans (2012) by calibrating the model AUC using the AUC derived from a trivial null model based on the inverse distance to the training presence.

We estimated variable importance by computing AUC values for each predictor variable individually using the Caret package in R (Kuhn 2008). This method applies cutoffs to the predictor data and then calculates sensitivity and specificity for each cutoff to calculate the AUC. The AUC is then a measure for variable importance.

2.6 Impacts

We trained the three algorithms using the parameter spaces described above, five different ratios of background to presence samples, three regularization choices, and the three sampling extents. We therefore trained 3*5*3*3 = 135 distinct models per species. We extrapolated the trained and tested models on raster data for the 19 bioclimatic variables from WorldClim and for the 2050 time-slice. This yielded maps of continuous scores whether a pixel cell belonged to the absence or presence class. This is equivalent to rating each global pixel cell’s climate as suitable or unsuitable for coffee production. We normalized individual model outputs to scores from 0 to 1 and averaged them for each baseline and emission scenario. To define a threshold between probabilities that represent marginal suitability and relevant suitability values we chose the lowest value at a present location. We only included in the analysis pixel cells that had suitability values above this threshold.

We compared impacts across latitude and altitude classes by comparing the sums of suitability scores across 1° latitude classes and 100 m altitude classes. We analyzed regional impacts for 12 regions of coffee production (Fig. 1).

We used the GLC2000 global land cover database (European Commission 2003) to partition suitability changes to land with forest cover (GLC2000 global categories 1–9), land without forest cover, and agricultural land (GLC200 global categories 10–18). Tropical forests provide diverse ecosystem services, are more species rich and hold higher carbon stocks than coffee plantations (De Beenhouver et al. 2013). Coffee plantations, however, often have more biological diversity than other agricultural land (Moguel and Toledo 1999) and hold more carbon stocks (van Rikxoort et al. 2014). Therefore, conversion from natural forest to coffee would have a negative environmental impact, but conversion from open land to coffee plantations could have a positive effect.

3 Results

3.1 Current coffee suitability

The trained and tested models extrapolated on to raster data for WorldClim’s 19 bioclimatic variables gave a global map of current suitability for coffee production (Fig. 2). The largest areas suitable for C. arabica are in the Brazilian state of Minas Gerais. Other highly suitable areas are in Central America and the Ethiopian highlands. Madagascar is also highly suitable despite not being a major producer today. Other African and Asian sites are rated as intermediate climatic suitability for production of Arabica.

Fig. 2
figure 2

Current suitability distribution for coffee. Dark grey indicates high suitability, light grey intermediate suitability. Hatching indicates the species

Larger areas highly suitable for C. canephora are in the Brazilian Espirito Santo region, West Africa, the lower regions of Central America and in mountainous locations in Asia, especially the Philippines, Indonesia and Vietnam.

3.2 Future coffee suitability

We calculated the difference between current and future (2050) mean suitability scores. For the RCP 6.0 scenario, Fig. 3 (A-D) shows the changes in suitability for the current dominant production regions of C. arabica in Latin America, Brazil, Asia and the center of origin of the species in East Africa. The Brazilian production regions lose suitability with possible positive changes at its southern margin. In the rest of Latin America, higher altitudes become more suitable than at present. In East Africa there are positive changes in suitability in the Ethiopian, Ugandan and Kenyan highlands. In Indonesia and the Philippines there are patterns of altitudinal migration similar to South America.

Fig. 3
figure 3

Suitability changes by the 2050s in the RCP 6.0 scenario; A-D: Arabica, E-G: Robusta. Hatching indicates the current suitability distribution; Warm colors represent areas with negative climate change impacts and cold colors positive changes

Figure 3 (E-G) shows the changes in suitability for C. canephora by 2050 in the RCP 6.0 scenario in Brazil, its center of origin in West Africa, and the most important region of Robusta production in South East Asia and the Asian island states. The Brazilian states of Rondonia and Espirito Santo may see severe losses of suitability. The Congo basin and coastal regions of West Africa have decreased suitability. In contrast, suitability is likely to increase at higher altitudes along the equator. In South East Asia the dominant Vietnamese production regions lose suitability.

Maps for the RCP 2.6 and RCP 8.5 emission scenarios are in the Supplementary Material (Fig. S1-2). The coefficient of variation across the 5 GCMs is in Supplementary Material Fig. S3. The CV is generally low, with the exception of the region around Brasilia in Brazil where it is up to 100 % for C. arabica.

3.3 Distribution of climate change impacts

The suitability scores indicate how likely it is that a location is climatically suitable for coffee production and a higher sum of scores means the suitable area is larger. The sum of suitability scores across latitudinal meridians for current climate conditions and GCM outputs for scenario RCP 2.6, RCP 6.0 and RCP 8.5 are shown in Fig. 4a. C. arabica loses suitability across all latitudes, although at high latitudes the losses are not as pronounced. The only positive change can be observed at around 27°S. Losses of suitability for C. canephora will mostly occur at low latitudes.

Fig. 4
figure 4

Distribution of suitability changes by a latitude, b altitude, c coffee regions; Continuous lines represent C. arabica, dashed lines C. canephora, black lines the current distribution, colored lines future distribution; the error bars indicate the minimum and maximum across RCP 6.0 model means

The sum of suitability scores in discrete altitude classes for both C. arabica and C. canephora by 2050 (meaned for each RCP scenario) compared with current conditions is shown in Fig. 4b. Both species lose large shares of total suitability mostly in low altitudes below 1000 masl while there will be less relative losses at higher altitudes.

The sum of suitability scores for major coffee regions for current conditions and means for RCP scenarios by 2050 is shown in Fig. 4c. The largest loss of suitability is in Brazil and South East Asia for Arabica coffee, where accumulated suitability scores decrease by 85 % in RCP 8.5 and 30 % in RCP 2.6. The least impact on Arabica is projected for East Africa and the Pacific Island region with 10 % of suitability lost in the RCP 2.6 scenario and up to 30 % in the RCP 8.5 scenario. Globally, losses are projected to be 49 % of overall suitability score lost in the RCP 6.0 scenario (Supplementary material – Table S.3).

C. canephora suitability will be lost in the Congo basin with 60 % (RCP 2.6) to 95 % (RCP 8.5) of total suitability lost in the center of origin of the species. Again, East Africa is projected to face the least impact. In the RCP 2.6 scenario the loss of suitability will be between 16 % and up to 30 % in the RCP 8.5 scenario. Three of the important Robusta production regions, Brazil, South-East Asia and West Africa, are projected to experience losses of about 60 % of suitability score. The global losses are higher for Robusta (54 %) than for Arabica. Even in the low impact scenario RCP 2.6 losses could be 51 % for Robusta (Supplementary Material – Table S.3).

In Fig. 5 the changes in suitability are distributed according to land-use classes in the coffee-producing regions by 2050 in the RCP 6.0 scenario. Globally, losses and gains in suitability are nearly equally distributed across the area with forest cover and without forest cover. Novel areas make up only about 10 % of lost suitability for both species, however. The exceptions for C. arabica are in Brazil, East Africa and the Asian islands. In Brazil 90 % of suitability losses are for areas without forest cover. In East Africa all the suitable area lost that is not currently forested may be replaced with novel area that is also not currently forested. In Asia, however, nearly all suitability gains are in areas that are currently forested.

Fig. 5
figure 5

Distribution of suitability changes by region and the land use classes with forest cover and without forest cover by 2050 under RCP 6.0; a C. arabica b C. canephora

C. canephora shows a similar pattern. In West Africa 90 % of suitability losses occur on land without forest cover, while in the Asian islands, Philippines and Indonesia, gains will be on land with forest cover. For Robusta most of the suitability losses in East Africa also may be replaced by gains on open land. In the Congo basin large losses of suitability for both species will be on forested land.

3.4 Model validation

AUC values were consistently high across all model set ups. The lowest AUC value for Arabica coffee was 0.92 and 0.73 for Robusta, indicating that the models perform much better than chance at discerning presence from background locations. Considering the values that we compared to the performance of a simple null model, cAUC, most of the models performed better than the distance-based model. All models for Arabica coffee were better than the null model according to cAUC. The Robusta models performed better than the null model in 74 % of the cases according to cAUC.

3.5 Variable contribution

The most important variable for Arabica was the mean temperature of the warmest quarter. This was followed by maximum temperature of the warmest month and mean temperature of the wettest quarter. Precipitation variables ranked as least important, especially precipitation of the driest quarter and month (Bio 14 and 16). Among the temperature variables, temperature variability (Bio 2 and Bio 7) was least important.

In contrast, the variables that ranked consistently high for Robusta were the mean diurnal range of temperature (Bio 2) and the annual temperature range (Bio 7). This was followed by maximum temperature of the warmest month. Precipitation variables were more important for Robusta than for Arabica, with intra-annual variation of precipitation (Bio 15) ranked the highest. Least important were temperature in the coldest quarter (Bio 11) and precipitation during the coldest quarter (Bio 19) (Supplementary Material Table S.2).

4 Discussion

The goal of this study was to examine the implications of climate change for global coffee production. Analysis of changes in suitability under the RCP 6.0 scenario shows that climate change may reduce production of Arabica coffee in many areas, especially in Brazil. Robusta may also be less suitable in important regions in Brazil and Vietnam. Gains elsewhere will do little to offset these losses, giving global losses in suitability for both species of about 50 %. Only East Africa and the Asian island states show substantial gains in suitability for both species.

We developed a methodology that is based on the notion that an ensemble of models captures more relevant information than a single model can. By using a mean of models based on several feasible parameter combinations rather than a single model our analysis is more robust than previous regional studies. The extrapolation of the models with spatially-explicit climate information gave global maps of both C. arabica and C. canephora that indicate suitability scores in regions of major production. We applied the underlying models to the outputs of five global climate models for the RCP 2.6, RCP 6.0 and RCP 8.5 emission scenarios. We averaged across emissions scenarios to produce maps and analyzed the change in suitability scores.

Both species show important changes in accumulated suitability scores at lower latitudes, which become less negative, albeit not positive, at higher latitudes. A southward latitudinal migration was also proposed by Zullo et al. (2011) in a regional study in Brazil. However, we did not find such impacts of climate change in other regions. Moreover, the gains in suitability in southern Brazil may not be enough to compensate for losses in suitability over large areas elsewhere. Similarly, losses in suitability are mostly at low altitudes while higher altitudes gain in suitability. Schroth et al. (2009) and Simonett (1988) identified similar altitudinal migration for Arabica in Central America and for Robusta in Uganda, respectively. These local studies confirm our analysis, which shows that altitudinal migration of coffee production will likely be a global trend. The magnitude of this effect, however, depends on how climate change will impact local conditions.

It has previously been hypothesized that Robusta production may be able to replace in part the losses in Arabica production due to climate change. The hypothesis rests on the notion that C. arabica is heat sensitive and would thus suffer in a hotter world. In contrast, C. canephora can tolerate higher temperatures and could thus replace heat-stressed Arabica coffee. This scenario may be viable in some regions, but our analysis emphasizes that C. canephora needs climates with little intra-seasonal variability. This limits the Robusta crop to low latitudes. Also, as climate may not only become hotter, but also more variable, this may aggravate negative effects on Robusta coffee production. Thus, globally both species appear to be equally affected by climate change. It is noteworthy that the Congo basin, the center of origin of C. canephora, may become unsuitable for the species by 2050 in the high emissions scenario. This warrants further investigation as many see indigenous varieties as the key to adapt coffee to climate change.

We found that Arabica production in Eastern Africa is less impacted than in other regions. In contrast, Davis et al. (2012) proposed substantial reduction in the area suitable for indigenous Arabica varieties in Eastern Africa. Our data are based on the distribution of commercial plantations, which have adapted to a broader range of climates than those of Arabica’s native range. This difference suggests that in areas where coffee production remains feasible production systems will have to be adapted. The necessary fundamental changes in local production systems would pose substantial challenges to smallholder farmers.

Moreover, given the long lifespan of coffee plantations the feasibility of migrating coffee to land that will be more suitable under climate change needs further study. The areas of East Africa that will become more suitable for coffee are currently not forested, in contrast to the Asian areas that will gain suitability, which currently are under forest. Climate-induced migration may thus result in further emissions from land-use change. Whether or not newly-suitable areas will be threatened by conversion to agriculture depends on economic incentives. Our analysis shows that highly productive areas of coffee in Brazil and Vietnam may become unsuitable for coffee in the future. World markets may thus create economic opportunities in East Africa, but may induce additional deforestation in Asia, where coffee is already a frontier crop. Policy-makers need to be aware that these are challenges that they will need to confront.