Studio Zenkai


Bold and Clear, without excess • Kaizen 改善 • With Purpose


Studio Zenkai is dedicated to the craft of programming, hardware hacking, photography, machine learning and how to live sensibly.


48 Hours Climate Change hackathon

I am participating this weekend in the AI Climate Change Hackathon, and I will jot down here my notes and progress. Here is the event pitch:

“Join us along with the other talented and diverse participants, supported by leading mentors in their fields who will come together to collaborate to attempt to address climate change and its impacts on communities and ecosystems. We hope to begin to achieve real positive impact in 48 hours using AI. We are also announcing 4 AI challenges: Plant Village Challenge, Extreme Weather Prediction, Climate-Related Risk Assessment, and Predict the Weather in Montréal.”

This sounds like a recipe to attract ecologists, students, and dreamers alike. It tells very little about technologies, specific goals and metrics, or datasets, which are key in AI.

Neverthless, it should be a good opportunity to implement an idea I had recently.

A while ago, I used the iOS app Gyroscope, which excels in giving a picture of your daily health. The app has good integration with data providers like Garmin or Apple Health. It was also good at recognizing activities such as walking, biking or taking public transit. At the end of the day, an elegant screen shows total energy expenditure, heart rates, sleep patterns and other core metrics.

Health tracking with gyroscope

Fitness apps are good into telling you if your work-out was good, but Gyroscope was great into showing if you were getting healthier, overall.

It’s this ability to track daily actions and giving you a 10,000 feet global view that I want to render, in the case of climate change. Imaging taking an Uber, then getting your Starbucks, having a hamburger at lunch later, then finally biking home. The app will then sum up in a screen what are the positive/negative impact of these actions. You can then share this on social media or just bask in what you’ve done that day :)

One can even imagine, that given enough users and patterns, you could be recommended specific products or actions that improves your “climate change balance”.

Now, if it sounds like I am a green die-hard activist – I am not at all. This is just 48 hours of my time trying to build an app that can give key information to people in their life, so they can decide what’s best for them.

Now, a bit of background:

  • I did outcomereference, which is able to correlate a food to diseases, and vice-versa. This project is still a work in progress, as it needs more precise statistical modeling, a course that was in my bottom priorities in engineering. But above all, it works and you can trust the results in any page.
  • I built a couple of self-driving RC vehicles, based on the donkeycar open source project. So I can do supervised learning, reinforcement learning, computer vision and more.
  • I also did a lot of AI modeling to know that you have to be either lucky or have an army of supervisers to get an accurate AI model. In 98% of cases, reverting to regressions, mathematical modeling, or brute-forcing with a database works better than an “AI model”
  • I did a dozen of web apps, back-end, API or full-stack
  • I can do design and UI but it will generally be poor. I’m a sucker for slick designs so will need help on this

For this project, I foresee a few problems:

  • What are the datasets? and if there aren’t any supplied, where do we get them?
  • Can you actually use an accurate AI model?
  • What are the metrics for positive/negative climate change actions? I can think of CO2, but it can be also CH4, or harmful substances (pesticides) and plastics generated
  • How do you present something that’s simple and elegant for everyone?
  • Is there even time to train a model and get an accurate model?

As you can see, there are data, back-end, design challenges and I hope to write down here the challenges, analysis, the range of solutions and the course taken.

To be continued. If you want to contact, I’m on twitter @heri or heri [at] studiozenkai.com

Friday 13 Sep - 6pm

Yoshua Bengio outlines how A.I. can be used, specifically optimizing operations of heavy industry or governments. I think he refers to work done at Element.AI, a commercial entity which works with big businesses. There is no mention of invididual or consumer applications. He also mentions climate and weather modeling, although I am not sure how this can be done in 48 hours. The other presenter, Sasha Luccioni, discusses the actual climate costs of Machine Learning work, and various applications with G.A.N. (??)

There is also a random guy who talks about hugging trees and children and taking a sabbatical leave :)

It’s also the first time I go to the MILA / Element.AI building and it reminds me of Facebook/Google/Apple campuses. The building has a surprisingly massive footprint.

On my side, I am searching public datasets that could be used, freely or with a license. CoolClimate has a calculator that uses CO2 for climate change costs with categories in travel, home, food and shopping. It would be possible to deduce activity costs with this calculator, and get sparse data that could be used as a foundation for the app. Another calculator has a better design for everyday users, however it would be hard to “reverse engineer” this.

There are also various papers in ecological footprints but with my experience with outcomereference, I know these would take forever to read, assimilate and use.

I am also reading an extensive study modeling GHG production and their statistical framework. I think there are some very good lessons here for consumer/invidual applications.

I also found a few datasets such as OpenAMEE or CO2 Emissions data . The first one by OpenAMEE and various forks is especially interesting. I will have to look into the scientific validation of the dataset tomorrow but it is a good start.

At this point however, it is clear there is no extensive public database of ecological footprint of your daily actions.

The other part of the challenge was finding metrics to qualify daily actions. Interestingly, the CoolClimate calculator seems to correlate all activities with CO2 production. Isn’t using CO2 simplistic? Or is it really a standard? I hope I meet a climate change specialist to confirm or deny this tomorrow. Personally, I see “climate change” as one of the many modern issues that needs to be tackled. I’m not sure that pesticides, radioactivity or microplastics contribute to climate change for instance, but I see them as important plagues that need action. I might go againt the grain, but I would even rather see climate change rather than having our lands filled with microplastics and chemicals everywhere. Or maybe, CO2, CH4, harmful chemicals can be different components and responses, much alike calories, sleep patterns and mindset are presented in different screens in Gyroscope.

On the social side, I’ve received a lot of positive responses from good folks like Nicole Fu, on the other side of the ocean. She’s working on The Crowd app, which compels you to pledge positive climate change. I’ll have to look into this tomorrow am. I’ve got also good support on Twitter and Facebook. This is great and a sign that we are going in a good direction.

It’s 7:30pm however and family duty calls. I’m wrapping this up and will be here tomorrow 9AM sharp

Friday 13 Sep - Late Night Brainstorming

I have given some thoughts on the footprintcalculator.org design, linked above. They do not tell you figures but rather tell you how many Earths would be needed to support your activities. I like this idea, as this is easy to explain to people, even outside climate change communities, and can also be illustrated elegantly.

Drive an SUV, eat red meat daily, spend thousands on plastic stuff you don’t need => 4.5 Earths

Walk/Bike, produce your own veggies, work remotely => 0.3 Earths

The OpenAMEE dataset mentioned earlier is also interesting, as it would be straightforward to map into a hierarchical database, like this:

root activity __ Transport activity 1.2 Earths __ walking 0.02 Earths (or CO2 metric) __ biking 0.25 Earths __ public transport (subway, electric) 0.85 Earths __ public transport (bus, gas) 1.1 Earths __ electric car 1.6 Earths __ ICE car 2.3 Earths __ SUV 3.5 Earths __ flying Boeing Dreamliner 7.5 Earths

You could sort siblings at the same level to get the min and max ecological footprint, the median, and also showcase alternative(s). For example, if you take the subway, the app could tell you that walking would have a lower ecological footprint but it would be definitively better than taking a truck for the same trip.

This doesn’t tell me yet how machine learning could be used. I could use Google’s Open Images V5 to categorize pictures of activities uploaded. Or maybe do some NLP. This is hard right now to answer because datasets and outputs are not clear. It would be good if a machine learning researcher could look into this tomorrow.

Saturday 14 Sep - Design phase

Here is a tentative mockup:

mockup

One could add a picture of their flight. He can add flight duration, and then carbon intensity estimation is shown. This is added as one of his activity. At the end of the day, on the right side, a graph made up of his activities represents his “carbon map”. This is the key take-away from the app - knowing first what are the impact of each of your activities.

If the user does not enter any input, it is assumed his choices is similar to the baseline, i.e. other people in his city for transport, food, shopping and activities (work, entertainment etc.)

Imagine if it could connect to Alexa Smart Home, and deduce your energy consumption, cooking and other activities. Or it could tap into Garmin and many other popular data providers to provide better estimations. Machine Learning could be used further on top to improve carbon footprint estimations.

What do you think so far? Head over to Twitter or email me. I’d love to discuss

Saturday 14 Sep - Discussions and first code lines

I’ve talked to many people both online and offline, and the general consensus is that this project needs design, from how to ask for user inputs, to how to show information that does not demotivcate users. For example, somebody who is trying to make change in their life might feel discouraged by seeing the amounts of CO2 he generated recently.

tmrow has been working on this issue for the past 3 years with a solid danish/french team. They have a mobile app and a community base. You can contribute calculations and data to the repository linked earlier. The application is not publicly available so it does limit the usefulness of the app.

Harry from the Crowd Charity responded a lot of questions regarding datasets and also climate change practices. I feel privileged getting this information and hope to bring back with good work to the community in exchange.

It’s now less than 24 hours from Demo time in Montreal. Due to this time constraint, I have decided to build an API-based service where third-parties like The Crowd or other can query the carbon cost of various activities. So far, transport category is covered, with data coming from OpenAMEE and calculations methods based on OpenAMEE sources. If there is no data for a category, the algorithm will look into children categories and get the median cost. All that’s left for the user is inputting the number of km for the transport.

transport

I do not foresee having a front-end tomorrow as I will have to work on the other categories such as food, personal, home and business.

Sun 15 Sep - Final and Wrap-up

Like in most hackathons, there was a severe lack of time towards the end.

I coded mechanically and did some major copy/pasting for data, as well as bulk csv import 🧟

The application allows you to add your activity, one after the other. It will take the CO2 produced and apply a multiplier. It also gets CH4 production and other greenhouse gas, plus also required energy. There are “stochiometry ratios” to get the equivalent CO2 for any CH4 produced, as well as public data on CO2 produced per kwH depending on your current location.

final

In this case, the app sets the location to Canada. Here is a breakdown for these few examples:

  • cycling does not produce greenhouse gases. This is good
  • the mini-bus activity was for 3 hours at 80kmh. The app calculates the distance and then divide by the number of participants to get 3.617 kg CO2. This is not bad as most people will produce more by driving their car in Canada for 3 hours.
  • there are various activities like washing machine and watching TV. We convert the energy required to CO2
  • the biggest culprit here is Dairy Cattle. Effectively, raising dairy cattle completely annihilates any climate change efforts. Dairy cattle produce a huge amount of CH4 and CH4 has a high CO2 ratio

Engineering-wise, I did not do unfortunately any unit or functional testing. I hate myself but it was about having something up in 30mn vs having something well-engineered. Fortunately, all the calculations and mathematical modeling made sense. I cross-referenced with a few other public calculators.

Many other teams presented a working mobile app. I found it amazing that they would be able to work and get an accurate model, as well as build an Android or an iOS app. I didn’t even have time to do some css. I remember a few years ago teams would struggle even to get a single web app working. What’s up with that!

If you are interested (holla or tweet at @heri), I can put this online as a service.

Monday 16 Sep - Future

What’s next? To make this usable, the service needs to be tied to various data providers:

  • MyFitnessPal logs your food. If I can connect to their API, I can associate each ingredient to their carbon footprint
  • I would need to find a trusted service that logs your car trips and your flights, plus the type of car driven. This needs research
  • There are popular fitness trackers such as Fitbit, Garmin or Google Fit that logs your bike and walking trips. This can be integrated and show your carbon intensity (or lack thereof)
  • It looks like due to privacy reasons, there is no public API for Smart Homes. I could be wrong, but there is no way for example to list what are your smart appliances and when they run with Alexa Home, or the Google/Apple equivalent

Using these data providers would be a much more seamless experience for potential users, since they get immediate results, and potentially immediate recommendations.

I would love also to sit down with a climate change scientist to validate calculations. Plus good design people and marketing. Damn, that sounds like a team … I’ll share this on social networks and see where it goes.

Thanks to the team at MTLNewTech and AI Launch Lab who have organized the hackathon. I know from first hand how much dedication it takes to create such an event spanning several days. The food was delicious, coffee was plenty and there was a good diversity of attendees. A special holla to Ilias Benjeloun who gave his 120% and came the whole 3 days, even though he got a cold towards the end.