Trees on smallholder farms and forest restoration are critical for Rwanda to achieve net zero emissions

Landscape restoration initiatives are mainly focusing on forest regeneration and agroforestry, especially in the Global South. However, due to a lack of monitoring tools, the carbon balance of restoration efforts remains poorly quanti ﬁ ed. Here, we use satellite images from 2008 and 2019 to calculate carbon stocks for individual trees in Rwanda, a country which has been actively engaged in restoration activities over the past decade. We show that smallholder farmers on average planted about 3 trees per farm during 2008 – 2019, contributing about 50.4 million new trees at the national scale. The overall C sink of the new farmland trees was 0.13 Megagrams of Carbon per hectare per year, which is 6 times lower than gains observed from restoration of degraded forests (0.76 Megagrams of Carbon per hectare per year). If national greenhouse gas emissions remain at the level of 2019, agroforestry (~61% of national area coverage) and continued restoration of degraded natural forests (~0.5% of national area coverage) have the potential to offset about 80% of the national emissions before 2050. Our work monitors and quanti ﬁ es progress and impact of landscape restoration projects and outlines a pathway to engage smallholder farmers with a limited number of on-farm trees into the expanding carbon market.


Check for updates
Maurice Mugabowindekwe 1,2 , Martin Brandt 1 , Athanase Mukuralinda 3 , Philippe Ciais 4 , Florian Reiner 1 , Ankit Kariryaa 1,5 , Christian Igel 5 , Jérôme Chave 6 , Ole Mertz 1 , Pierre Hiernaux 7 , Xiaoye Tong 1 , Gaspard Rwanyiziri 2,8 , Dimitri Gominski 1 , Sizhuo Li 1 , Siyu Liu 1 , Ivan Gasangwa 9 , Yves Hategekimana 10 , Alain Ndoli 11 , Jean Nduwamungu 12 , Sassan Saatchi 13 & Rasmus Fensholt 1 Landscape restoration initiatives are mainly focusing on forest regeneration and agroforestry, especially in the Global South.However, due to a lack of monitoring tools, the carbon balance of restoration efforts remains poorly quantified.Here, we use satellite images from 2008 and 2019 to calculate carbon stocks for individual trees in Rwanda, a country which has been actively engaged in restoration activities over the past decade.We show that smallholder farmers on average planted about 3 trees per farm during 2008-2019, contributing about 50.4 million new trees at the national scale.The overall C sink of the new farmland trees was 0.13 Megagrams of Carbon per hectare per year, which is 6 times lower than gains observed from restoration of degraded forests (0.76 Megagrams of Carbon per hectare per year).If national greenhouse gas emissions remain at the level of 2019, agroforestry (~61% of national area coverage) and continued restoration of degraded natural forests (~0.5% of national area coverage) have the potential to offset about 80% of the national emissions before 2050.Our work monitors and quantifies progress and impact of landscape restoration projects and outlines a pathway to engage smallholder farmers with a limited number of onfarm trees into the expanding carbon market.
Tree-dominated ecosystems are crucial for climate change mitigation and adaptation as they support biodiversity, store carbon (C), provide habitats, and offer nutritional and economic benefits 1,2 .Tree density, size, and distribution within an ecosystem are key attributes and central to decisionmaking regarding landscape restoration efforts aiming to increase treebased ecosystem services and promote optimal tree growth [3][4][5] .
Among many existing landscape restoration initiatives, agroforestry, which involves the integration of trees within croplands, is increasingly being adopted in the Global South 6,7 .Agroforestry has the potential for concurrent intensification and diversification of production and enhanced carbon storage 8 .Furthermore, trees within croplands fertilize and stabilize the soil, and provide numerous benefits to farmers including enhanced income as well as improved food and nutrition security [9][10][11][12] .
Contrastingly, natural forests provide different ecosystem services, such as high C stocks, biodiversity, and ecological habitats 1,13 .However, natural forests are threatened by both natural and anthropogenic processes, often leading to deforestation and forest degradation 14,15 .The restoration potential of degraded natural forests (hereafter, degraded forests) is high, and once restored, regrowing forests can store carbon up to 20 times faster as compared to old-growth forests, which is in particular the case in the tropics 1 .Identifying degraded forests within protected areas is however challenging.As a result, many large-scale restoration programs prioritize agricultural land, where tree cover is typically low and presumed to be easier to increase rapidly 16 .
Furthermore, it is challenging to monitor the success of large-scale restoration efforts within degraded forests, as quantifying newly established individual trees is difficult using traditional satellite systems and often requires labor-intensive field inspections that may not be representative for large areas.The same difficulties apply to farmlands, where trees are typically sparsely planted, and single trees are too small to be identified by conventional satellite systems, especially when trees are young.Consequently, studies often rely on proxies to evaluate the success of ecosystem restoration, such as the greenness of an area [17][18][19] .However, greenness is a measure of the presence and abundance of green vegetation, and it is not always related to tree cover.Tree-level traits such as density, crown area, and carbon stock dynamics related with tree plantations and forest regeneration have rarely been reported for large areas over extended time periods.Furthermore, conventional methods for monitoring restoration activities usually focus on larger land units, excluding smallholder farms with less than 10 ha 10,11,20 .Therefore, the contribution of smallholders to landscape restoration goes often unnoticed and remains largely unrecognized.
Here, we conduct a nation-wide wall-to-wall mapping of trees (defined here as woody plants with a crown area larger than 3 m 2 ) in 2008 and 2019 in Rwanda, and study changes in their number, crown area and carbon stock, with a particular focus on newly established trees in farmlands and degraded forests.Rwanda has invested a remarkable effort in restoration [21][22][23][24] , and is thus an interesting case to illustrate potential gains in forest and non-forest biomass from restoration in tropical countries.We demonstrate how our data can be utilized to estimate future potential carbon sinks needed to reach net zero emissions by 2050, and to what extent carbon gains resulting from smallholder farms and forest restoration contribute towards achieving this target.

Results
Mapping individual tree gains and losses in agroforestry landscapes and degraded forests Aerial images with a spatial resolution of 0.25 × 0.25 m 2 were acquired for 2008 25 , and satellite images with a spatial resolution of 0.5 × 0.5 m 2 for 2019.We manually delineated 325,540 tree crowns with a minimum crown size of 3 m 2 , and then trained a deep learning model to segment the tree crowns.The minimum crown size threshold was based on visual inspection (Fig. 1, see Methods).We mapped individual trees and tracked the crown centers between 2008 and 2019 to separate new trees only found in 2019 from the existing ones in 2008.Trees only found in 2008 but not in 2019 were mapped as losses.Change estimates were validated with tree measurements from 296 permanent field plots (see Methods).We adjusted the images from 2008 and 2019 to each other on a common resolution of 50 cm, and only retained common spectral bands for both images (Red, Green, Blue) on the same radiometric resolution.We further trained a separate deep learning model to remove pixels with clouds and shadows (Supplementary Fig. 3); clumped trees were separated in a post-processing step (see Methods).
We used manually delineated maps of degraded forests 26 and farmlands 27 showing that degraded forests cover about 10,932 ha (about ).Note that the net losses in the eastern part of the country were mainly driven by agricultural expansion in the past decade.For instance, the cultivated area increased by 16.8% between 2017 and 2019 at national scale, with most of the increase observed in the eastern part 37 .0.5% of the country area), while agroforestry landscapes cover about 1,316,389 ha (about 61% of the country).Agroforestry landscapes are here considered as non-wetland areas under active agriculture as well as regularly harvested tree plantations (see Methods).The number of trees in degraded forests increased from 1.5 million in 2008 to about 2.1 million trees in 2019 (Fig. 2), which is a net gain of about 0.6 million trees or +4.6 trees ha −1 yr −1 .We observed about 0.76 million newly established trees or +6.3 trees ha −1 yr −1 (gross gain) in 2019 in degraded forests, and a gross loss of about 0.2 ).h Same as g but for degraded forests (8.39 Mg C ha −1 ).i Boxplots showing variations in density of new trees in degraded forests (n = 759,110) and agroforestry (n = 50,386,436).j Same as i but for carbon stock density per area.k Same as i but for carbon stock density per tree.In boxplots in i-k, the lines from top to bottom represent maximum, third quartile, median, first quartile, and minimum values, respectively.*We present potential gains if smallholder farmers attain a recommended density of 300 trees ha −1 , and degraded forests attain the a density of 700 trees ha −1 (see section "Future restoration potential."and Fig. 4).The ultra fine dotted lines in i and j indicate the required addition to attain the recommendations.million trees or −1.7 trees ha −1 yr −1 .Trees in agroforestry landscapes increased from 77.7 million in 2008 to 105 million in 2019; a net gain of about 28 million trees or +1.9 trees ha −1 yr −1 .We observed about 50.4 million newly established trees or +3.5 trees ha −1 yr −1 (gross gain) in 2019, and a gross loss of about 22.3 million trees or −1.5 trees ha −1 yr −1 in farmlands.The tree density in degraded forests had a net increase from 138 trees ha −1 (standard deviation -SD 90) in 2008 to 188 trees ha −1 (SD 93) in 2019, while agroforestry areas had a net increase from 59 trees ha −1 (SD 62) in 2008 to 80 trees ha −1 (SD 83) in 2019.The new trees are a result of both natural and assisted regeneration in degraded forests 28 , and active tree planting in agroforestry areas 29 .
We further used 942,081 accurate farm plot delineations of 2019 from the National Land Authority of Rwanda, of which 99.6% are smallholder farm plots with a maximum area size of 5 ha and an average of about 0.18 ha.There is at least one tree in each sample plot, and the plots were selected from over 2.4 million land plots covering all land cover types within four sample districts: Rubavu in Western province, Musanze in Northern province, Muhanga in Southern province, and Kirehe in Eastern province.The districts represent the three major landscapes of the country (Supplementary Fig. 4).We show that the average number of trees in these sample plots increased from about 10.9 (SD 28.8) in 2008 to about 14.1 (SD 37.3) in 2019.This implies that each smallholder farmer has planted, on average, about 3.2 trees per plot (about 18 trees ha −1 ) between 2008 and 2019.At national scale, farmlands on average gained 21 trees ha −1 (SD 21.3).

Carbon stock changes
We adopted the approach from ref. 30 to estimate diameter at breast height (DBH) from the tree crown diameter, which was further used to estimate above-ground biomass, finally converted to above-ground carbon stocks using the biomass-to-carbon conversion factor of 0.47 31,32 (see Methods).For farmlands, ref. 30 estimated an uncertainty of 5.7% and 33.4% for degraded forests.
For degraded forests, we estimated a carbon stock of 0.38 ± 0.12 Tg C (± is the uncertainty derived from NFI data, see Supplementary Table 1; ref. 30 ) in 2008, and 0.79 ± 0.26 Tg C in 2019, of which about 23.7% was from newly established trees (Fig. 2).We found our estimates to be in the same range as existing global estimates (Supplementary Fig. 2a).The carbon density of newly established trees was estimated to be about 8.4 (SD 8.4) Mg C ha −1 , with an annual increment of about 0.76 Mg C ha −1 yr −1 .In agroforestry fields, we estimated about 5.2 ± 0.3 Tg C of tree carbon stock in 2008, and 6.3 ± 0.36 Tg C in 2019, of which 29.7% was from newly established trees (Fig. 2).The carbon stock density of new trees within agroforestry fields was estimated to about 1.4 (SD 1.3) Mg C ha −1 or +0.12 Mg ha −1 yr −1 .These numbers imply that the annual increment was almost six times faster in degraded forests as compared to agroforestry fields within the same period (Fig. 2).The lower carbon stock and tree density in agroforestry fields can be partially explained by sparse tree planting and regular harvesting of the trees for socio-economic purposes 33,34 (see Discussion).Geographically, the highest carbon gains from new trees in farmlands (46%) were observed in the central plateau area of Rwanda, and 29% in humid highlands in the western part of the country.A total of 25% was found in drylands in the eastern part, which also experienced the highest losses (Fig. 1).

Towards net zero emissions via agroforestry and forest restoration
Our results indicate an overall net C stock gains in agroforestry fields were 1.1 Tg C or 0.09 Tg C yr −1 between 2008 and 2019, and 0.42 Tg C or 0.038 Tg C yr −1 in degraded forests (Fig. 2).This suggests an annual net C sink of 0.13 Tg C yr −1 from trees within the two land cover types.Data from ref. 35 show that the annual GHG emissions of Rwanda were 1.4 Tg C (combined emissions from CO 2 , methane CH 4 , and Nitrous Oxide N 2 O; Supplementary Fig. 5) in 2019.That implies that agroforestry and forest restoration have offset about 10% of the national annual greenhouse gas (GHG) emissions.
When translated into the social cost of carbon dioxide (SC-CO 2 ), a measure of the monetized value of damages associated with emissions to society 36 , the emissions from 2019 correspond to an average of about 943.5 million USD in equivalent social damages.The emissions offset by agroforestry and forest restoration correspond to about 88.2 million USD in avoided social damages.However, our recommended combined scenario for reaching the optimal tree restoration potential indicates that over a 20year period, agroforestry and degraded forests alone could achieve an annual C gain of about 1.1 Tg C yr −1 (i.e.0.15 Tg C yr −1 from restoring degraded forests in scenario 2, and 0.96 Tg C yr −1 from agroforestry in scenario 3 (See Fig. 4; Supplementary Table 2; Supplementary Table 3).This is about 80% of the total national GHG emissions in Rwanda in 2019.The remaining 20% could be covered by preserving natural forests, which cover 5% of the country but hosts over 50% of the national C stocks 30 .The country's target to reduce emissions by 38% in 2030, to which LULUCF (Land use, Land-Use Change, and Forestry) is planned to play a notable role 24 , would also contribute to an earlier achievement of the net zero goal.
About 99.6% of Rwandan farms are operated by smallholder farmers with land areas less than 5 ha, and the national average agricultural land ownership is below 0.5 ha 37 , yet, their contribution to the CO 2 emission offsets goes largely unrecognized.Being able to accurately assess CO 2 emission offsets at the level of trees and smallholder farms (Fig. 3), our mapping approach opens a technological opportunity of engaging smallholder farmers in the growing global carbon market.The carbon credits market value of the tree-level CO 2 offsets within farmlands in Rwanda can be estimated in the range of 3.7-36.7 million USD per year (a range of 10-100 USD per tonne of CO 2 according to ref. 38 , the ref. 39, and ref. 40 .The high cost range is due to the high volatility and speculations in the carbon market 39 .

Future restoration potential
In this section, we exemplify how our data can be utilized to estimate potential costs and benefits of tree restoration at national scale.We assess the maximum potential contributions of degraded forest restoration and agroforestry, as well as associated costs for the country to achieve its net zero by 2050 target 41 .We study this under three scenarios (Fig. 4; Supplementary Table 2; Supplementary Table 3).First, we apply a business as usual scenario and assess potential outcomes in regards to restoration benefits (i.e.increased tree density, carbon stock, annual carbon sink increments, and economic revenues), if the annual tree density increase would remain at the same level as observed in this study.Second, we assess potential outcomes if all smallholder farmers in the country attain the maximum tree density for their farmlands 42,43 , and degraded forests were restored to attain 70% of the recommended tree density 44 .Third, we study potential outcomes if all smallholders attain the recommended maximum on-farm tree density by the Ministry of Environment of Rwanda 45 , and degraded forests attain 70% of the field-measured maximum density in natural forests of the country 45 (see Methods; Supplementary Table 2; Supplementary Table 3).The estimations of restoration benefits is based on the assumption that the GHG emissions would be kept at the 2019 level.
We recommend scenario 3 for optimal agroforestry restoration with a density of 300 trees ha −1 , and scenario 2 for restoring degraded forests with a density of 700 trees ha −1 (Fig. 4).This combined scenario suggests a tree density that would leave sufficient space for crops, allowing a harvest of 50% of on-farm trees, at an expense of about 1,200 USD ha −1 including direct and indirect financial costs (see ref. 45 ).This would also yield a return on investment (i.e.net profit relative to the investment cost) ranging between 12% to 38% without potential carbon credits revenues.9][40] .For degraded forests, an investment cost of 375 USD ha −1 would be required with a carbon credit-based return on investment almost equal to the investment cost.
Using our tree-level data, we present a simplified estimation that disregards social and landscape variations.Here, about 294.6 million new trees could be established in a 20-year period (assuming 70% survival rate, see Methods), resulting in a new nationwide C stock of about 23.5 Tg C in farmlands, and 3.0 Tg C in degraded forests, which is in a similar range as the existing global estimates 42 (Supplementary Fig. 2).To put this into perspective, the scenario suggests that both farmlands and degraded natural forests have reached about 27% of their potential optimal tree density.The financial cost of this scenario is estimated to be around 1.163 billion USD for a 20-year period, with an estimated return on investment of 140-442 million USD from increased crop and timber yields, prevented erosion, and additional revenue ranging between 33 and 330 million USD from potential carbon credits (Supplementary Table 2; Supplementary Table 3).This cost estimate is 2.2 times higher than the total amount already invested in landscape restoration projects nation-wide between 2010 and 2018 in Rwanda 22 .Figure 4, Supplementary Table 2, and Supplementary Table 3 provide more details on multiple possible pathways with scenarios assuming different tree densities.All scenarios are however based on a simplified perspective, and we therefore recommend conducting a more comprehensive econometric forecast when considering the implementation of such projects.

Discussion
Various national, continental and global restoration initiatives pledge to plant a certain number of trees in a given time.Examples of such initiatives include the pledge to plant 43 million trees in 2019 in Rwanda 46 , 20 billion trees in Ethiopia 47 , 10 billion trees in Pakistan 48 , "The 3 billion tree planting pledge for 2030" in Europe 49 , "trillion trees" initiatives (https://www.1t.org/; https://trilliontrees.org/),among others.Monitoring and quantifying benefits, progress and impact of these landscape restoration initiatives is challenging due to unreliable monitoring systems.Previous attempts reported the impact of landscape restoration from proxies based on medium or coarse resolution satellite data reflecting the greenness of an area [17][18][19] .While these proxies can help to identify overall changes in vegetation productivity, they are less suitable to identify changes in tree cover and carbon stocks, particularly in heterogeneous and fragmented systems such as small-scale farms dominating most African countries 50,51 (Fig. 3).Since forest expansion often conflicts with agriculture, the majority of new trees are planted under agroforestry schemes 6,52 .However, on-farm trees are too sparse to be monitored by such proxy-based approaches.Therefore, tools and approaches to identify and quantify gains at tree-level are highly needed to monitor the progress and impact of landscape restoration projects, and enable quantification of the associated ecosystem services.
Our tree-level analysis shows that over a period of 11 years, both agroforestry areas and degraded forests had a considerable gain in the number of trees, with over 50 million newly established trees, and the C stock density increased six times faster in degraded forests as compared to farmlands.This difference can be partially associated with sparse tree planting and regular tree harvesting in agroforestry systems in Rwanda 33,34 .The new trees in degraded forests are a result of both natural and assisted regeneration 28 .The high and fast C gains in degraded forests underscore the effectiveness of conservation, protection, and regeneration of natural forests for climate change mitigation and biodiversity goals.This becomes important as many ongoing restoration projects focus on plantations with monocultures that are typically not benefiting biodiversity and, depending on species and the land use they replace, may even have limited benefits for climate change mitigation 2,53 , although they provide some socio-economic benefits (Fig. 4; Supplementary Table 2; Supplementary Table 3).Although the optimal spacing of trees in agroforestry systems can boost agricultural productivity, too high tree densities could decrease crop yields, and some exotic tree species can lower soil fertility 54 .
While on-farm tree density, gain and carbon sequestration are much lower than an equivalent area of natural forest in Rwanda, there is a far larger area covered by farmland as compared to forests and degraded forests.For example, our study shows that smallholder farms experienced an increase of 3.2 trees per plot on average, contributing to an increase of about 50.4 million new trees between 2008 and 2019.This led to a net gain of over 22 million trees nation-wide, storing about 1.1 Tg C equivalent to 4.034 Tg CO 2 (Fig. 2).Briefly, both agroforestry and forest regeneration contributed considerably to the national carbon sink and collectively represent a notable pathway towards net zero emissions by 2050 target (Fig. 4; Supplementary Tables 2 and 3).
The technological advances presented by our dataset, combined with other technological solutions to create "smart contracts" 55 for direct transactions between carbon credit buyers and owners, would make it technically feasible to engage smallholders in carbon markets to a much larger degree than at present.Data such as these presented here be used for traceability and monitoring, reporting, and verification (MRV) for woody carbon stock changes and associated credits.However, we acknowledge that quality of the data is dependent on image quality.Therefore, including high resolution images and more information on tree traits, such as height from LiDAR where available, will provide results with a higher level of details and improved accuracy.Moreover, to increase the availability of such detailed datasets with higher temporal coverage, future research should assess the transferability of our approach to other areas using freely available or low cost multi-temporal satellite images.Finally, we acknowledge that the inclusion of smallholders in carbon markets also has political, economic and regulatory implications.This will most likely require policies to ensure that transactions are in accordance with national legislation and are fair and just for both smallholders and buyers.These elements have been beyond the scope of the present paper to address.

Methods
This study employs aerial images from 2008 and satellite images from 2019, which are harmonized to match the spatial and spectral characteristics of each other.We developed a deep learning model trained by 325,540 manual tree crown labels from both datasets, and segmented tree crowns for both 2008 and 2019.We used permanent field plots that cover the study period to evaluate the mapped changes.Tree crowns were converted to biomass following ref. 30.Finally, we tracked each tree between 2008 and 2019, and marked trees that were only found in 2008 as loss, and trees that were only found in 2019 as gain.

Aerial and satellite images
We used two types of publicly available images: aerial images at 0.25 × 0.25 m 2 resolution captured in June -August of 2008 and 2009 using a Vexcel UltraCam-X aerial digital photography camera 25 , and WorldView satellite images at 0.5 × 0.5 m 2 resolution for 2019 provided by Rwanda Space Agency (RSA).Both of the images were stored in an 8-bit unsigned Fig. 4 | Different scenarios for optimal contribution of agroforestry and degraded forests to Rwanda's net zero emissions target.We study three pathways to reach new tree densities for optimal restoration of both agroforestry areas and degraded forests, with an assumption that GHG emissions will remain at the 2019 level.We propose three scenarios and present their corresponding environmental and economic benefits (see Supplementary Table 2; Supplementary Table 3) with reference to previous studies about the optimal number on-farm tree densities in Rwanda (refs. 42,43,45for Scenario 2 and Scenario 3), the recommended tree density for optimal forest restoration in the tropics (ref. 44for Scenario 2), as well as the observed tree density in non-degraded forests of Rwanda (ref. 67for Scenario 3).The green arrow presents potential results of our recommended combined scenario (scenario 2 and 3), by which only the aboveground woody biomass in agroforestry and degraded forests would capture 80% of the total country's national GHG emissions (presented by orange arrow) before 2050.Note that icons for the figure were accessed from https://www.canva.com/.
integer format, and only common spectral bands for both of the images (i.e.Red, Green, Blue) were retained for consistency.

Pre-processing of the images
The images from 2008 are from an aerial campaign with 0.25 m resolution, while those from 2019 are from the WorldView satellites, pansharpened and resampled to 0.5 m resolution.We first resampled the images to each other on a common of 0.5 m.Next, we trained a deep learning model to detect and segment cloud and shadow pixels (Supplementary Fig. 3), which were then masked out and excluded from further analysis along with wetland areas.We performed a spatial overlay of the images, and eliminated the spatially corresponding pixels for clouds and shadows by setting their values to no-data in both images (Supplementary Fig. 3).This has excluded about 1.4% of of the farmland's total area, and about 3.3% of degraded forests' total area.Note that these masked-out areas are not included in the analysis.We have chosen to not extrapolate our results to areas with missing data as this would add some level of uncertainty.Finally, a histogram matching was performed to ensure that the cumulative distribution function of pixel values is calibrated, achieving a consistent and uniform distribution of pixel intensities for both aerial images in 2008 and their corresponding satellite images in 2019 (Supplementary Fig. 7).Note that these images adjustments make the results from this study incomparable to ref. 30 .

Environmental data
We use the national forest cover map and agricultural spatial extent map 27 to classify farmlands and natural degraded forests.The map was created using on-screen digitization over the same aerial images of 2008 as used in this study 21,26 .A forest was defined as "a group of trees higher than seven meters and a tree cover of more than 10%, or trees able to reach these thresholds in situ on a land of about 0.25 ha or more".A shrub was defined as "a group of perennial trees smaller than seven meters at maturity, and a canopy cover of more than 10% on a land of about 0.25 ha or more".The forest cover map has five major classes: natural forest, forest plantations, bamboo stands, shrubs, and wooded savanna, with natural forest class subdivided into "closed natural forest" and "degraded natural forest".We hereby refer to degraded natural forest as degraded forests.The spatial overlay of forest cover and agricultural extent allowed the spatial delineation of the two land cover classes of focus: degraded forests and farmlands.Farmlands are considered as areas under agriculture, and Eucalyptus and non-Eucalyptus plantations, excluding plantations in urban areas and wetlands.The agriculture and plantation areas were combined due to a prevalence of encroachment among these land cover types 33,42,56 .

Nation-wide mapping of trees using deep learning
We adopt the tree segmentation approach developed in ref. 57 to automatically detect and map trees at a national scale.The training dataset was composed of 131,269 manually delineated tree crowns spread over 4039 patches with a size of 256 × 256 pixels for 2008 (covering about 1,698.8ha), and 194,271 manually delineated tree crowns spread over 7390 patches with a size of 256 × 256 for 2019 (covering about 3133.9 ha).The training samples are spread across the country representing the full range of biogeographical conditions across Rwanda (Supplementary Fig. 8.).We applied random stratified sampling to ensure representative samples per elevation gradient (from highlands in the West to lowlands in East), as well as per the 6 broad land cover classes: natural forests, savannahs and shrubland, Eucalyptus plantation, non-Eucalyptus plantations, Farmland, and Urban/Builtup 27,30 .The final results were restricted to 2 land cover classes of the study's scope: degraded forests and farmlands.We trained a UNet architecture 58,59 network using both the 2008 and 2019 images as inputs, putting a higher weight for boundary areas between tree crowns in closed canopies to decrease clumps in predictions especially in dense canopy areas, as proposed in ref. 58 and implemented in ref. 57 .We selected the best model as the model with the lowest loss value on a separate validation set (20% of the training data).We set aside 52 randomly selected labeled patches containing 17,306 manual labels of individual trees (i.e. over 5% of the total manual labels) as an independent test set.The 52 patches overlaid with both 2008 and 2019 images and contained 6639 manually labeled tree crowns in 2008 and 10,667 in 2019.The number of single trees mapped within a hectare is referred to as "tree density", while the percentage of a hectare covered by tree crowns is referred to as "canopy cover".

Separating clumped trees in dense canopy areas
Accurate mapping of trees individually without multiple trees being connected is important, especially for accurate biomass and C stock estimations.However, in dense canopy areas, some trees were predicted as clumps by our tree detection approach.In this case, we adopted a post-processing method to separate clumped tree crowns and fill any gap inside a single crown 30 .Briefly, with an assumption of a round tree crown shape, the post-processing method determines the crown centers in the crown predictions, and then relabels them based on weighted distances to the identified crown centers.The process is described in more detail in ref. 30 .

Cloud detection and masking
The 2019 satellite images were partly cloudy especially in the highlands region of Rwanda, where most of natural forests in protected areas are located.We trained a separate UNet-based model to detect and segment cloud and shadow pixels in the images.We trained a network with 870 manually delineated clouds across 1877 areas covering 5219 ha.The trained model was deployed over the 2019 images and detected clouds and shadows (Supplementary Fig. 3), and the results were manually checked to ensure accuracy and consistency.The manual check is supported by the fact that the cloud detection with machine learning is one of the renowned tasks yielding very high accuracy in remote sensing studies [60][61][62] , and there was no overfitting during the training session (Supplementary Fig. 6).The detected pixels with clouds and shadows were then masked out in 2019 images, as well as the corresponding pixels in the 2008 images for consistency and comparability.The masking process was done via a spatial overlay analysis, where pixels with clouds or shadows were set as no-data in both images.

Tree-level allometry for biomass and carbon stock estimation
With the general principle of allometric equations to statistically relate structural properties of a tree and its biomass 63,64 , we adopt an existing treelevel allometry approach, which assumes a relationship between the crown area and AGB with a variation between biomes 65 .The approach uses five allometric equations to establish a relationship between crown area-derived crown diameter (CD = 2*√(Crown area /π)), diameter at breast height (DBH), and Above-Ground Biomass (AGB) of trees in savannas and shrublands (Eqs.( 1) and ( 2)); plantations, farmlands, and urban and builtup areas (Eqs.( 1) and ( 3)); and natural forests (Eqs.( 4) and ( 5)).The performance evaluation and errors for the equations are reported in ref. 30 .
AGB predicted in kg ¼ exp½1:803 À 0:976E þ 0:976 lnðρÞ þ 2:673 lnðDBHÞ Here CD is the crown diameter, DBH predicted is the estimated DBH, AGB predicted is the estimated AGB, E (in Eq. ( 5)) is a measure of the environmental stress 66 (a gridded layer is available at https://chave.ups-tlse. fr/pantropical_allometry.htm), and ρ is the wood density (fixed at 0.54: a weighted average of 6161 tree records from ref. 67 ).Tree-level AGB estimation via allometry entails different sources of uncertainties, which increase especially in the absence of field measured height or DBH 65,66 .In this study, the uncertainties start from the DBH estimation based on CD, propagate through the AGB estimation from DBH, and further by using a biomass-to-carbon conversion factor to estimate AGC from AGB 31,32 .Wood density also induces further uncertainty during the AGB estimation, given the intra-and inter-species variability in the trees and a transition from early to late successional stages especially in natural forests 67,68 .A thorough evaluation of the allometric approach using NFI field measurements can be found in ref. 30 , and a summary is shown in Supplementary Table 1.

Evaluation and uncertainties of the tree crown segmentation
We set aside 52 labeled patches containing 17,306 individual trees (over 5% of the total training labels) as an independent test set to evaluate the model performance.The 52 patches overlaid with both 2008 and 2019 images and contained 6639 manually labeled tree crowns in 2008 and 10,667 in 2019.This dataset was neither used during training nor validation.The plot-wise comparison indicates an overall underestimation with r 2 of 0.84 for tree count, 0.89 for canopy area coverage, and 0.78 for mean crown cover in 2008 (Supplementary Fig. 1).The evaluation for 2019 revealed r 2 of 0.71 for tree count, 0.78 for the canopy area, and 0.72 for the mean crown area.A confusion matrix indicated a true positive rate of 74%, a false negative rate of 26%, and an overall accuracy of 95% for 2008 (Supplementary Table 4a); and a true positive rate of 77%, a false negative rate of 23%, and an overall accuracy of 93% for 2019 (Supplementary Table 1b).

Evaluation of the change 2008-2019
To evaluate the accuracy of our final results and quantify the overall error of the reported changes between 2008 and 2019, we used field measurements in 296 permanent field plots that are regularly visited in Rwanda (Supplementary Fig. 9).In total, 4217 trees were measured in these plots, and the planting year of each tree was recorded (Supplementary notes; Supplementary Fig. 9).In 79 of the plots, most trees were planted before 2006, and here we expected the measured numbers to match our results from both 2008 and 2019.From the plots, 1057 and 1078 trees were measured in 2008 and 2019 respectively, which is an increase of about 1.9%.We map 970 trees for 2008 (8.2% underestimation), and 1001 trees for 2019 (7.1% underestimation) within the same plots, indicating a change of about 3.2% in our results.For other 217 plots, most of trees were planted between 2006-2016, so the measured numbers are also expected to match our predictions of 2019.In these plots, field measurements indicate a count of 3514 trees and we map 3186 trees in 2019, which is an underestimation of about 9.3%.All comparisons show a consistent bias of 7-9% for both 2008 and 2019.

Cost-benefit analysis of tree restoration potential
We refer to the methodology applied by the Ministry of Environment of Rwanda in 2014 45 to estimate cost for the tree restoration potential in farmlands and degraded forests.The study indicates an optimal restoration of agricultural fields by planting 300 trees ha −1 .This would require financial investment of about RWf 843,600 ha −1 (about 1200 USD according to the 2014 exchange rate in Rwanda 69 ) to transition from pure agriculture to agroforestry over a 20-year period.This transition would also generate an income (i.e return on investment) ranging between 12% and 38% of the initial investment cost, and would leave enough space for crops to grow without competing with on-farm trees.Our tree restoration potential scenario in farmlands consider adding about 220 trees ha −1 to the currently mapped average tree density (about 80 trees ha −1 ) to reach 300 trees ha −1 .The tree restoration potential in degraded forests refers to ref. 44 who indicated that optimal forest restoration in the tropics requires planting about 1000 trees ha −1 , and depending on the planted tree species and the location, the survival rate ranges between 50% and 90%.We first estimate planting about 700 trees ha −1 (1000 trees ha −1 with an average 70% survival rate).Then, we consider adding about 570 trees ha −1 to the currently mapped average tree density in the degraded forests (130 trees ha −1 ) to reach the 700 trees ha −1 target.This number aligns well with previous findings in Rwanda, where a number of trees with a DBH larger than 10 cm was found to range between 200 and 958 trees ha −1 , while the number of trees with DBH < 5 cm ranged between 350 and 1844 within a tropical montane rainforest 67 .Also, our estimates agree with the existing study on "the global potential for increased storage of carbon on land" 42 (Supplementary Fig. 2b).The cost of restoration was obtained by referring back to ref. 45 , where a required investment cost was estimated at about 376 USD per ha via assisted natural regeneration over a 20-year period.The revenue from potential carbon credits was predicted to be almost the same as the investment cost, making the return on investment to be about zero.

Fig. 1 |
Fig. 1 | Mapping tree-level changes in agroforestry fields and degraded forests in Rwanda in 2008 and 2019.a Location of Rwanda in Central East Africa.Data from ref. 70 .b The mapped changes in tree density between 2008 and 2019 in agroforestry fields and degraded forests.c An example of individual trees mapped in an agroforestry landscape in 2008 (c (i) ), and in 2019 (c (ii) ), and their estimated tree-level aboveground C stock density in 2008 (c (iii) ) and 2019 (c (iv) ).d An example of individual trees mapped in degraded forests in 2008 (d (i) ) and in 2019 (d (ii) ), and their estimated tree-level aboveground C stock density in 2008 (d (iii) ) and 2019 (d (iv)).Note that the net losses in the eastern part of the country were mainly driven by agricultural expansion in the past decade.For instance, the cultivated area increased by 16.8% between 2017 and 2019 at national scale, with most of the increase observed in the eastern part37 .

Fig. 2 |
Fig. 2 | Carbon stock in agroforestry fields and degraded forests in 2008 and associated gains in 2019.a Illustration of area extent covered by agroforestry areas in Rwanda in 2008 and 2019 (1,316,389 ha).Note that we assume no change in the spatial extent of both landscapes between 2008 and 2019 (see Methods).b Same as a but for degraded forests (10,932 ha).c Tree count in agroforestry areas in 2008 (n = 77,717,415) and 2019 (n = 105,781,561).Note: The red outline indicates gains in 2019.d Same as c but in degraded forests (n = 1,506,129 in 2008; n = 2,057,853 in 2019).e Total estimates of tree-level aboveground carbon stock in agroforestry areas in 2008 (5.2 Tg C) and 2019 (6.3 Tg C). f Same as e but for degraded forests (0.38 Tg C in 2008 and 0.79 Tg C in 2019).g Average C density in new trees in 2019 (1.43 Mg C ha −1).h Same as g but for degraded forests (8.39 Mg C ha −1 ).i Boxplots showing variations in density of new trees in degraded forests (n = 759,110) and agroforestry (n = 50,386,436).j Same as i but for carbon stock density per area.k Same as i but for carbon stock density per tree.In boxplots in i-k, the lines from top to bottom represent maximum, third quartile, median, first quartile, and minimum values, respectively.*We present potential gains if smallholder farmers attain a recommended density of 300 trees ha −1 , and degraded forests attain the a density of 700 trees ha −1 (see section "Future restoration potential."and Fig.4).The ultra fine dotted lines in i and j indicate the required addition to attain the recommendations.

Fig. 3 |
Fig. 3 | Plot-level aboveground carbon stock in sample smallholder farms in Rwanda.a Visualization of estimated aboveground carbon stocks (AGC in Mg per farm plot) in sample smallholder farms in Rwanda (n = 942,081; Supplementary Fig. 4).Plots boundaries data is from the National Land Authority of Rwanda (https://www.lands.rw/home),received via Rwanda Forestry Authority (https:// www.rfa.rw/).b (i) Example of smallholder farms overlaid on aerial images.b (ii) Example of smallholder farms and their estimated C stocks.c Boxplots showing variation in tree density within sample farm plots (n = 942,081).d Same as c but for C stock per plot.e Same as c but for C stock per tree.In boxplots in c-e, the lines from top to bottom represent maximum, third quartile, median, first quartile, and minimum values respectively.