Food Rescue App Presentation

How This Happened

Sometimes I wonder if there is a genetic component involved when choosing ones projects and purpose in life. In my case, I have always hated seeing usable items being tossed away. When I was three or four years old, I saw the bulky trash collection vehicle for the first time, smashing furniture with its hydraulic press. And I remember that I cried. Now, I am writing software against wasting food. It’s the same mindset, no?


Figure 1: Before Food Rescue App existed, I found this jar of honey from 1983 in an abandoned house. And I didn’t know what to do with it.

My experiences with rescuing food started rather randomly, though. In a festival camp near Kassel, I learned to live from dumpster diving for two weeks. And I would harvest wild cherries and plums. And then I ate my way through 40-50 aging jars with red cabbage, and finished them when they reached to 7.5 years after their best-before date. None of them had gone bad, and I’d still eat from aged jars every time (but pass on red cabbage … I had my share). Not all the food rescues went great, though. One thing I learned by doing was to not eat the pickled herring filets when they start to taste like fizzy water. And another thing: eating a larger amount of whole grain spelt crisp bread a year after its best before date may lead to a night of feeling sick (me) or vomiting (a friend). We looked this up online and found people say that even their dog got sick from that stuff.


Figure 2: One of my many dishes with rescued red cabbage.

Maybe it was because of his experience with questionable spelt crisps, or just the wastefulness of our food system in general – one morning this friend of mine woke up with the idea that there should be an app for figuring out if food is still edible, and it should work by pointing the smartphone to the ubiquitous barcodes on food packaging. That is how the idea for Food Rescue App was born, and Prototype Fund helped it to become reality.

With Food Rescue App, we want to provide people with a pocket tool that makes them food waste experts, so that they can quickly and confidently assess if and how to utilize a questionable food item. And we want to contribute with this to a larger culture shift, where citizens start to resist the lure of overconsumption and resource wastage and rather take pride in knowledgeable frugality.

What I did not imagine when starting the work on Food Rescue App is how fuzzy all knowledge about food spoilage is, with lots of differing opinions, both overly cautious and reckless ones. I did my best to bring all that content into an accessible form with understandable explanations and easily checkable sources. You can judge if and how far I succeeded, as the application is now ready to try.

Counting the Benefits

Let’s do a quick calculation of the benefits from avoiding food waste in all its forms. And in 2013, global agriculture produced 9747 kcal per person, out of which 2353 kcal were necessary for human consumption.i This means that (9747 kcal – 2353 kcal) / 9747 kcal = 75.9% of all calories were wasted. Now food production is responsible for 26% of global greenhouse gas emissions according to a study of 2010 data.ii Taken together, food waste is responsible for 26% × 75.9% = 19.7% of global greenhouse gas emissions.

This number does not yet account for GHG emissions from land use changes, because this is difficult to measure (and a source of endless arguments). Land use changes (LUC) means for example the increased net emissions from the landscape when cutting down a forest and converting it to agricultural land. The United Nation organization FAO estimates that “if LUC were taken into account […] the evaluation of the global GHG emissions for food production phase would be at least 25 percent higher […] and potentially 40 percent higher.”iii Assuming a mean of (40% + 25%)/2 = 32.5%, this would increase the contribution of food waste to global emissions to 19.7% + (19.7% × 32.5%) = 26.1%.


Figure 3: Global food energy flow in kcal/person/year. (Source: Berners-Lee et al. 2018, see endnotes)

So in total, a quarter of all GHG emissions can be avoided by just not wasting the food we grow. For comparison, the consumption based greenhouse gas emissions of the People’s Republic of China, the world’s largest emitter, were 17.9%.iv Assigning 26.1% to food waste may sound outrageously high, and indeed we’ll never be able to being this to zero as there will always be some waste in transport and handling, and we’ll always want to eat at least some animal products. Other studies estimate the contribution of food waste to GHG emissions at 6%,v which would be 6% + (6% × 32.5%) = 7.95% with our estimation of land-use changes. The difference is because this lower value only accounts for loss of food meant for human consumption, omitting farm losses, biofuel production, calory losses from feeding livestock and from excess consumption. In any case, food waste avoidance is one of the low hanging fruits of climate protection.

But even the “extreme” estimation of 26% of emissions is not the whole story. In the scenario above, avoiding food waste does not require new behaviour, and no major behaviour change beyond stopping to farm for livestock and biofuels. But when we’d allow for more behaviour change, we can use the opportunities that open up from the avoided food waste, and the impact on GHG emissions would be even higher. For example, new forests can be grown on land that is no longer required for food production; these new forests can be used for deadwood burial to enhance carbon sequestration;vi also consumers could switch to less GHG intensive crops such as beans instead of rice; and we could replace city trees with fruit trees, and front lawns with home gardens.

And the impact on greenhouse gas emissions is not the only benefit of avoiding food waste. With less food wasted, it would be easier to prevent hunger and malnutrition. And if we would return the area back to nature that is now occupied to produce wasted food, it is easy to imagine that this would resolve the biodiversity crisis and water scarcity of many areas.

Finally, like all waste avoidance, food waste avoidance is a very affordable intervention: it does not require any new technology or infrastructure but “only” knowledge. This makes it an attractive target for a grassroots initiative like Food Rescue App. Now let’s see the results!

Food Rescue App right now

The current, initial version of Food Rescue App contains open source food rescue content in a database, assigned to food products via food categories. When you scan a food product’s barcode or search for a food category, the application will collect and show whatever it knows about rescuing this food item. The main innovation is to combine a barcode scanner with food rescue information, making it more accessible than through any existing solution.

Beyond the current functionality, I have taken special care to choose an architecture suitable for global usage of this application. This made development slower compared to using a less suitable base technology, but should pay off over the longer term. In particular, the choice of architecture allows the following features and use cases:

  • Offline use. The application obtains all its data from an on-device SQLite3 database, so you can use it without the Internet, whether that means in a supermarket in the basement, on a sailing trip where you caught too much fish, or if you happen to live in a sparsely populated area where Internet access is expensive or unreliable. It makes no difference. The database is relatively compact, so that it is not (yet) necessary to split it by world region. Right now, 27 MiB of database contains 448,224 food products, 9818 food categories and 674,021 assignments of categories to products. This is everything relevant that the open source dataset Open Food Facts has about this. The download size of this database is 10.6 MiB, or about 3-4 photos taken with a smartphone camera.
  • Multi-lingual use. The application’s user interface and content are available in German and English already, and more languages can be added in the same way. With at least 1000 entries each, the food category names are complete enough for real-world usage in seven languages (German, English, French, Dutch, Spanish, Italian, Finnish).
  • Mobile and desktop use. With the same source code, the application is both a native desktop application and a native mobile app. This is made possible by the open source user interface framework KDE Kirigami, itself built with the cross-platform framework Qt. Kirigami is a niche technology right now and not advertised much, but it totally works and allows an efficient “write once, run everywhere” development mode. If you want to try it, you may find it useful that I wrote a complete development guide for it.
  • Cross-platform use. Currently, Food Rescue App has been tested under both Android and Linux. But it supports also all other platforms where Qt is available. That includes the officially supported platforms Linux, macOS, Windows, Android, iOS and UWP (“Windows Mobile”). In addition, it is possible to use the application on minor mobile platforms such as Ubuntu Touch, Sailfish OS and LineageOS. Supporting these is good to challenge the hegemony of the two major mobile platforms.
  • Use on old or slow hardware. The application is designed to be usable on low-resourced hardware, whether that means entry-level or old mobile devices. This is made possible by compiled C++ code, resulting in native applications on all platforms. The native performance is esp. relevant for the barcode scanner feature. It exceeds that of any barcode scanner in JavaScript, and also that of any barcode scanner in Java, which is otherwise the default choice in an Android application.

This architecture is still not perfect, though. Due to Qt QML, the technology used for the Kirigami based user interface, the application contains some JavaScript code and a JavaScript virtual machine. This does not provide native performance, but is not used for performance-critical code either. The situation will be resolved in the future with Qt 6, which will support compiling QML to native C++ code.vii Another challenge is that on systems without a proper package manager, the full Qt libraries have to be included when distributing the application. This increases the installation size from 400 kiB (on Linux) to 37 MiB (on Android). But even when distributing the Qt libraries, they do not have to be that large. It’s just that nobody really cared about the Qt installation size under Android and iOS. But I already discovered techniques that should reduce that size by at least 75% in a future release (details).

Vision

The above is what Food Rescue App is right now – it’s a start. Now let’s explore its full potential: what else can a small piece of software like this contribute to the grand goals of protecting the climate, ending hunger and protecting biodiversity?

As outlined in the exploratory study “1.5 Degree Lifestyles”viii and also illustrated by the lifestyle adaptations to the COVID-19 pandemic, the potential impact of lifestyle changes is huge, and these changes can be realized immediately. Two scenarios are realistic for bringing lifestyle change into practice: either political change that prioritizes climate protection with much more radical interventions, including national calorie rationing; or a giant culture shift towards frugality and living within our ecological limits.

Whatever the cause, once somebody actively tries to avoid food waste in their sphere of influence, the possible impact of an application like Food Rescue App is astonishingly large. I discovered during the development phase that avoiding food waste is about much more than “Can I still eat this?” or “How to store this type of food better next time?” So here are my scenarios for all the ways how Food Rescue App could help to avoid food waste in a future version:

  • Avoiding food with heavy ecological impacts. Food differs wildly in its ecological impact, based on type and production method. As we have seen above, animal feed and biofuels are the major sources of food losses, and the application would recommend against products that rely on them. There are labels that certify individual aspects of this, such as “bird friendly coffee”, so far there is no attempt whatsoever to calculate the whole ecological impact of food production. With enough data, such a combined label could be calculated independent of the manufacturer, and presented by the advisory app. The impacts to take into account would include the protection of rainforests, insects, bees, groundwater and also employment and trade ethics, animal welfare, greenhouse gas emission intensity, energy use during transportation and so on.
  • Storage instructions. This belongs to the basics and is mostly covered in Food Rescue App already: how to store food in the pantry, refrigerator, freezer and commercially, in order to prevent it from spoilage. There is a lot to say about this, esp. when it should also be applicable under difficult conditions such as a family in the tropics who cannot afford a freezer.
  • Preservation instructions. A lot of food preservation options are available in the home, and this helps especially when the standard storage choices (fridge and freezer) are not applicable or available. In Western societies, much of that knowledge got lost, but it can be revived.
  • Cleaning out. Residual waste in food packaging and in pots and pans is another food waste issue, and the advisory app would collect and present the many tips for cleaning these out.
  • Food ageing and spoilage symptoms. Eating questionable food is a matter of trust, and some people want to understand the details before they trust a source. Explaining processes and symptoms of ageing and spoiling food in detail is essential for this. For example: the white protein crystallization on capers and the white fatty bloom on aged chocolate are completely harmless changes.
  • Rescuing spoiled food. Not all food that started to spoil is immediately inedible. There are ways to prepare sprouted potatoes, to utilize some types of soured milk, to use overripe fruit for alcoholic beverages, and even to safely eat some few types of food that started to become mouldy.
  • Harvesting wild food, and gleaning. Some projects like Mundraub publish the locations of wild-growing edibles and of unharvested food that the owner made “public domain”. Other projects like Gleaning Network promote the collection of un-harvested farm produce. Showing the closest locations and events at harvest time in Food Rescue App can help bring in the necessary labour to prevent these food losses.
  • Donating surplus food. Sometimes, after rescuing food it is just too much to eat or process before it spoils. Quick information about how and where it can be donated locally will help to put all food to good use.
  • Edible parts. A lot more is edible than we traditionally eat, at least in Western cuisine. For example, the stalks of broccoli, the seeds of jackfruits and the seeds of mangoes can all be prepared and eaten. Similarly, about half of the “discards” after eating a fish’s fillets are edible.ix
  • Avoiding packaging waste. Beyond the food items themselves, packaging them is a major source of resource waste. Not all packaging is created equal though, and recommending consumers alternative products from the same shop that are less wastefully packaged could gradually push producers to more sustainable packaging.
  • Reuse and recycling. Even when food was spoiled, throwing it away is not necessarily the only option. The same applies to inedible parts of food items. Any additional use before ultimately throwing away something is waste avoidance and resource protection. For example, spent coffee grounds are a nitrogen-rich fertilizer; spent lemon-halves can be used instead of detergent when doing the dishes; and especially rural households can profit from replacing LPG cooking gas with self-produced biogas from kitchen scraps.
  • Encouraging home composting and gardening. The ultimate in waste avoidance is if you can recycle the waste that still occurs, such as kitchen scraps and all inedible parts. Home composting and gardening are ways to do that, and with the right technique this is possible even on the balcony of a city flat. Home gardening has ecological advantages that are worthy to explore in any society, including the provision of fresh herbs, fruits and vegetables; the elimination of storage issues by simply delaying the harvest for a bit; and the fact that backyard and balcony gardening does not consume any ecologically valuable space. In Food Rescue App, home gardening tips could be interspersed with other content. For example when a user investigates the storage life of dried basil, the program would also tell: Did you know you can grow fresh basil on your window still, and that it tastes much better?

Beyond food waste avoidance, the same advisory application could be extended to help living efficiently with respect to other resources: saving electricity, freshwater and heating fuel, avoiding solid waste and avoiding automotive travel. From my own experience of living in an oldtimer truck for several years, cutting down the average central European resource consumption in all these areas by more than 80% is easily doable. I hope we don’t have to adopt that level of frugality collectively to rescue our civilization from climate catastrophe and ecological collapse. But if so, I want us to know how to do this right. Look up “Resource Rescue App” when that time comes – I hope I’ll have it ready then.

iBerners-Lee, M., Kennelly, C., Watson, R. and Hewitt, C.N., 2018. Current global food production is sufficient to meet human nutritional needs in 2050 provided there is radical societal adaptation. Elem Sci Anth, 6(1), p.52. Excerpts used under a Creative Commons Attribution 4.0 License.

iiPoore, J., Nemecek, T., 2018. Reducing food’s environmental impacts through producers and consumers. Science, 360(6392), p. 987-992.

iiiFAO: Food wastage footprint: Impacts on natural resources. p. 16

ivThe data in the study we use about food system losses (see Poore and Nemecek, 2018) is from 2010. For comparability, we use 2010 emission numbers for China. As per the World Resource Institute’s CAIT Climate Data Explorer, China emitted 9.8 GtCO2eq in 2010, or 21% of global emissions. Their trade-adjusted resp. consumption based emissions were 14.59% lower in 2010 as per “Our World in Data: CO2 and Greenhouse Gas Emissions: Consumption-based (trade-adjusted) CO2 emissions”. This results in 9.8 GtCO2eq × (1 – 0.1459) = 8.37 GtCO2eq emissions, or 21% × (1 – 0.1459) = 17.94% of global emissions after adjusting for exported emissions via global trade.

vOur World in Data: Food waste is responsible for 6% of global greenhouse gas emissions.

viZeng, N.. 2008. Carbon sequestration via wood burial. In: Carbon Balance and Management, Volume 3 (2008). DOI: 10.1186/1750-0680-3-1

viiFor details, see my answer on Stack Overflow to the question “Is QML translated into native code at the compilation time or is it interpreted at runtime the way JavaScript is ran in web browsers?”.

viiiAalto University Department of Design: 1.5 Degree Lifestyles.

ixFor a pretty drastic experiment illustrating these numbers, there is this video of YouTube sailing channel “Sailing into Freedom”.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.