Machine vision — technofix or smallholder solution for deforestation-free coffee?

Dive into the future of sustainable coffee farming with AI- powered technology for smallholders with Dr. Christian Bunn.

Christian Bunn
People • Nature • Landscapes
9 min readNov 17, 2023

--

Coffee cherry picking in Uganda. Women often do the harvest work (Image: HRNS).

The digital divide is a growing problem for sustainable value chains in agriculture. While coffee houses provide working spaces to digital nomads, many coffee producers continue to live in an offline world.

Sustainable value chain governance in the agri-food sector tries to provide incentives to land users to protect the world’s natural ressources. Monitoring compliance today includes the digital documentation of immaterial properties of the goods (e.g. fair labour, sustainable production practices, etc.). Smallholder farmers account for a large share of the global food system and often cultivate land in proximity to nature.

This is why at the Alliance of Bioversity International and CIAT, we are investigating how modern information devices may provide value to smallholder coffee producers. We believe that machine vision can support the inclusivity of value chains by facilitating access to the digital chain.

“Our Croppie app will simplify deforestation-free compliance for coffee smallholders.“

The groundbreaking EU regulation on deforestation free supply chains (EUDR) stipulates that any product which comes from a plot of land with recent deforestation will be prohibited from entry into the European market. Once the EUDR enters into force, coffee importers must geolocate all production/sourcing areas, and conduct rigorous deforestation analysis.

Coffee landscape in Uganda (left); coffee sorting as a family task in Uganda (right) (Images: HRNS).

The EUDR itself frequently makes reference of remote sensing for deforestation-free verification. However, it is no secret that remote sensing struggles to accurately capture agroforestry, and that this is a problem for climate action (Terasaki Hart et al. 2023). Therefore, the EUDR also stipulates that any scientifically proven method which is remotely verifiable can be used to make deforestation-free claims (European Union 2023). Before we go into machine vision or proximal sensing, as a potential way forward, let us revisit the problem for smallholders.

Deep dive: In this blog post, we explain why satellite monitoring performs especially poor for biodiverse, shade grown coffee.

The EUDR shade coffee conundrum

Critiques of the EUDR expect coffee importers to minimize the risk of having coffee rejected at the port by preferentially sourcing from large producers in regions with sparse remnant forest, or where production is predominantly without shade cover. This way they hope to avoid false positive deforestation alerts, but henceforth such policies may exclude smallholders with biodiverse shade from supply chains.

Coffee producers are concerned about the EUDR and fear being excluded from supply chains. Image: CIAT.

To illustrate the conundrum, consider two coffee production extremes: On the one hand, indigenous producers in the Central American highlands organize informal trade routes to central collection stations because of their remote location. Their coffee grows in biodiverse systems with old native shade trees. Yet, importers will be hard pressed to show where the coffee comes from, and even when coordinates for coffee stands can be provided, satellites might detect forest cover. This coffee faces great risks of being rejected when reaching the EU. Coffee from a Brazilian estate on the other hand — grown under full sun, with much fertilizers, irrigated and mechanically harvested — will easily comply.

This outlook puts the EUDR’s broader intention to foster sustainable production to the test. Of course, excluding communities which produce coffee in a sustainable way in proximity to forests from value chains is bound to have unintended side effects.

“To stop deforestation, reduce emissions, protect biodiversity and improve livelihoods, we need a smallholder inclusive implementation of the EUDR.”

The Croppie project for digital harvest forecasts

The Croppie projet will enable coffee producers to demonstrate their compliance in an easily accessible way, while ensuring that information is remotely verifiable to comply with EUDR rules. We are achieving this by digitally documenting harvest forecasts on-farm, using machine vision.

In smallholder contexts, apps often come in one of two ways — they either deliver top-down information, such as training manuals for sustainable agriculture, or are extractive — when the producer is meant to enter information into traceability tools (Hidalgo et al. 2023). In essence, these apps don’t solve user (coffee producer) needs, but rather the problems of their creators — such as development agencies or coffee buyers.

“Is machine vision the link to enable smallholder inclusion in deforestation free value chains, and add additional services for the producers?”

Machine vision is the ability of Information and Communications Technology (ICT) devices to interpret images similar to human vision. It involves the use of cameras and image processing. In agriculture, machine vision has seen applications such as weed classification, leaf or variety typologies, stress, pest and disease detection, and fruit grading — including the detection of shape, texture and color features.

Most of these applications have been developed to improve the efficiency of large-scale plantations. For example, when drones are used to identify ripe banana or mango and deploy harvest workers accordingly. Smallholders are unlikely to fly drones, own lidar devices or invest in autonomous harvest robots.

AI-generated illustrations of a drone and banana plants. Images: craiyon.com

In the coffee sector, harvest estimates are a standard practice and in high demand by companies and other stakeholders, needing such information to inform their management and financial decisions. Harvest forecasts are immensely influential for the virtual coffee trade, and therefore highly relevant for the physical trade as well. Certified coffee often requires harvest estimates to avoid leakage from uncertified farms. Yet, harvest estimates require local technicians to travel to sample farms, spending the day counting coffee cherries, branches and trees.

Now, the EUDR will make such counts standard practice in high-risk areas. The regulation demands the prevention of elusion of the regulation by mixing with produce of undocumented origin. In essence, this is what e.g. Fairtrade farms already do to estimate certifiable quantities. The process is really quite simple, but has important shortcomings.

“Count cherries on a branch, multiply the counted cherries, branches, and trees with a correction factor for processing, and you will get an estimate of how much dried coffee you can expect from your plot.”

The process is time-consuming and relies on the technicians’ incentives to report correctly, deal with fatigue and the intensive travel involved. Imagine spending your day in the humid tropics exposed to heat, rain and bugs, and counting cherries all day only to put a results into an excel table on a tablet.

It is these kinds of challenges, where machines should help humans. Machine vision can go beyond the capabilities of human vision because images can be augmented with auxiliary data, stored over time and transferred between supply chain participants. In the Croppie project, we created AI machine vision coffee estimates which require less travel, less time spent on farms, reduce fatigue, improve reproducibility, and enable remotely verifiable traceability.

We have trained a deep learning-AI algorithm to identify and count all coffee cherries on images of coffee branches. Together with an estimate of the tree number, the results are stunning. The agreement between measured yield (kg/ha) and the AI-predicted yield is very high (R2 = .93 — unpublished). This performance is equal to the traditional manual count methods. For both methods, some error is to be expected due to loss at harvest and varying bean sizes. But, the AI provides reproducible results faster and easier than the manual yield estimates, and comes with digital evidence that can be passed downstream.

Now, in the case of the EUDR, time- and geo-tagged images could be used as evidence to show that the coffee was produced on a certain plot of land.

Sample image of a coffee branch with AI detected coffee cherries. Red boxes showing cherry detections for counting. Can you see the omissions? Image: Croppie project.

Towards a digital revolution for sustainable agriculture

Our research has turned into a fascinating multidisciplinary endeavour. We not only integrate machine vision engineering but also need a comprehensive understanding of smallholder decision-making, value chain incentives, the physiology of coffee plants, the diversity of production systems, and the functioning of financial instruments in smallholder contexts.

Our objective has moved from estimating yield to providing value to producers. Therefore, our partner ProducersDirect is working with farmers to create an easily accessible app. Eventually, the app will provide not only yield estimates, but also provide personalized services. The Croppie app first asks its users a few basic questions about their farm status. It then validates the farms’ geo-location, before visually guiding its users through an image taking protocol. For each coffee plot, users need to povide images of three branches of nine trees.

Current research tries to understand how coffee producers evaluate this interaction, how to make it easier, while still delivering agronomic information with the required precision. We are working to understand how different use cases justify costs (labor), provide benefit to the producers, and have different requirements for data analysis.

Illustration of the coffee value chain in Uganda. Compliance with EUDR rules will be a challenge for millions of smallholders (Source: Christian Bunn, CIAT).

Closing the cycle to EU countries’ ambitions for net-zero coffee and the smallholder EUDR conundrum, in the next phase of the project, we will work with traceability solution providers to link our ‘coffee-cherry-counting’ app to their systems. Their current solutions often rely on self-reported data and checks by intermediaries that smallholder coffee producers can neither access nor pay for. With the Croppie app, we can now provide them with a robust quantitative estimate of the product, underpinned with unique images. This will facilitate the inclusion of smallholders in coffee supply chains — especially in high-deforestation risk regions such as Western Honduras, where leakage has to be audited.

Great potential also lies in the provision of insurance. Existing examples of insurance for coffee producers have been framed as maladaptation to climate change. Without the possibility of remotely monitoring the yield of farmers, weather index insurances provide payouts in the event of hazardous weather conditions. With climate change, every year is an unusual year and regular payouts prevent adaptation of production.

Croppie could provide incentives to adapt, while also providing the financial security that smallholders need to plan ahead.

In urban societies, every aspect of life has been digitized. This digital transformation has yet to fully reach smallholder farmers in the global south. Understanding their livelihoods, values, priorities and not least the agricultural system in which they strive will be key to make a digital revolution happen for smallholders. Digital tools can close knowledge gaps, reduce power disparities and may improve the efficency of the food system, so that globally less ressources are wasted and food security is increased.

Further reading

Blog post: Biodiverse coffee at risk from zero-deforestation regulation

Blog post: Climate smart coffee in Uganda

Project website (under construction): https://croppie.org/

Bunn C, Lundy M, Läderach P, Fernández P, Castro-Llanos F. 2019. Climate-smart Coffee in Uganda. International Center for Tropical Agriculture (CIAT), Cali, Colombia. https://hdl.handle.net/10568/101331

European Union (2023). Regulation (EU) 2023/1115 of the European Parliament and of the Council of 31 May 2023 on the Making Available on the Union Market and the Export from the Union of Certain Commodities and Products Associated with Deforestation and Forest Degradation and Repealing Regulation (EU) No 995/2010. https://eur-lex.europa.eu/legal-content/EN/ALL/?uri=CELEX:32023R1115.

Hidalgo, Francisco, Xiomara F. Quiñones-Ruiz, Athena Birkenberg, Thomas Daum, Christine Bosch, Patrick Hirsch, and Regina Birner (2023). “Digitalization, Sustainability, and Coffee. Opportunities and Challenges for Agricultural Development.” Agricultural Systems 208 (May): 103660. https://doi.org/10.1016/j.agsy.2023.103660.

Terasaki Hart, Drew E., Samantha Yeo, Maya Almaraz, Damien Beillouin, Rémi Cardinael, Edenise Garcia, Sonja Kay, et al. (2023). “Priority Science Can Accelerate Agroforestry as a Natural Climate Solution.” Nature Climate Change, September. https://doi.org/10.1038/s41558-023-01810-5.

--

--

Christian Bunn
People • Nature • Landscapes

Postdoctoral fellow at the International Center for Tropical Agriculture trying to help coffee and cocoa sectors to proactively adapt to climate change