Green-Software-Foundation / hack

Carbon Hack 24 - The annual hackathon from the Green Software Foundation
https://grnsft.org/hack/github
14 stars 1 forks source link

Black is Green #53

Open mads6879 opened 5 months ago

mads6879 commented 5 months ago

Type of project

Building a plug-in for Impact Framework

Overview

Context

It is known for sometime now that darker colours require less energy to illuminate LED/OLED displays, black being the lowest energy colour and white being the most energy intensive colour. Red, green and blue lie in the middle with blue being more energy inefficient than red and green. Having said that, almost all websites load images. It would be fascinating to see how each image contributes towards energy consumption eventually leading to carbon emissions.

Idea/Problem statement

I am thinking of building a pipeline which has following steps 1) Image importer plugin - Pulls an image from AWS s3 bucket 2) Image analyser plugin - Analyses the image to figure out the R, G, B percentages, height and width of the image 3) Image efficiency plugin - Take the values from output of previous plugin along with size of the display area and calculates total power consumption at a standard/typical brightness 4) Brightness adjuster plugin - Takes the total power consumption and adjust it according to given brightness input 5) Finally to calculate SCI, the total power consumption needs to be converted to Carbon and used as input to standard model SCI from IF. Other standard models like SCI-E, SCI-M can be used OR new one might be needed to apply the monitor/display's embodied carbon (not sure at this point).

Scope

For hackathon, it would be limited to 1) LED/OLED displays. (LCD use backlight and work on different technique than LEDs). 2) AWS s3 but later can be extended to other providers. 3) Direct linear correlation between brightness and consumption (As brightness increases, power consumption increases linearly).

Impact

There are hundreds of websites that host stock photos and images for download and use e.g. Shutterstock, Unsplash, Getty images etc. If these images were to display SCI as part of their metadata then the user can become 'Carbon Aware' and will know the impact of including an image in their webpage.

Language

Leaning toward Python but not given up on TypeScript yet.

Questions to be answered

1) Are there plugin already available which do these image/colour manipulations? 2) Is pipeline better OR all steps mentioned above can be part of a single plugin/model? 2) Would passing in total-embodied-emissions in the model config for SCI-M, help me calculate embodied carbon for displays/monitors? 3) I am not sure if I can use the SCI-E and SCI-O directly given that the input is mostly CPU, GPU, memory related. 4) SCI should be ok to use as it takes carbon as input so long as I have carbon as output from my plugins, I can use SCI.

Have you got a project team yet?

I am working on this project alone

Project team

@mads6879

Terms of Participation

jmcook1186 commented 5 months ago

fascinating idea!

Answers to your questions:

jawache commented 5 months ago

Agreed, very interesting, @mads6879; I had never thought to apply Impact Framework this way!

I think 4 sep plugins might be a bit too much as @jmcook1186 suggested, but if you were to break this out into two plugins, that might make the solution have more down stream applications.

A plugin to load an image and capture meta-data like size, colors, kb, etc... Another plugin that takes the metadata and computes the environmental impact like carbon/energy etc.

You could use both plugins together in a pipeline to figure out the emissions of a single image.

But if someone else is, say, using IF to compute information about their website and already has the meta-data, then they could just use the second plugin to compute the impacts.

pipeline:
  - image-meta-data-extractor
  - image-emissions-estimator

Where image-meta-data-extractor perhaps takes as input image-URL and outputs image-size, image-colors, image-data-size, and whatever else metadata might be useful to extract about that image.

And image-emissions-estimator would then take those inputs and estimate the energy based on certain configuration parameters like screen type, and brightness level.

I'm not 100% sure how it might be used, but if there were two plugins here, I could imagine the second being used in other pipelines where people already have metadata about the images (e.g. from another source like a website carbon analyzer, or from a dump from say google lighthouse to enhance those reports with more detailed information about carbon per image.

mads6879 commented 5 months ago

Thanks @jawache and @jmcook1186 for your inputs.

I agree 4 separate ones would be an overkill especially since each one would be doing bare minimum. 2 plugins (extractor and estimator) seems like a good approach.

Taking into account your feedback, I will give this some more thought over the weekend and see how it can be taken forward. I will also do some research on how we can get embodied emissions for screens/displays.

mads6879 commented 5 months ago

I have done some research on the embodied carbon for monitors/displays so that total-embodied-emissions can be provided to the SCI-M model.

There was a study conducted : Assessing embodied carbon emissions of communication user devices by combining approaches https://www.sciencedirect.com/science/article/pii/S1364032123002794

Result from the study for displays is shown in table below Approach For 6 kg, 25in display (only supply chain, excludes usage and end-of-life stages)
LCA/PCF 360 kgCO2e/device
Supply chain 100 kgCO2e/device
Vendor reported 100 kgCO2e/device

Visiting the vendor websites, I found the product carbon footprint (PCF) as shown below

Monitor Dell E2422HS Dell S2421HN Asus BE279
Report date Aug 2021 Aug 2021 Mar 2022
PCF 494 kgCO2e +/- 95 kgCO2e 475 kgCO2e +/- 99 kgCO2e 757 kgCO2e
weight 4.3kg 3.8kg 9.01kg
product lifetime 6years 6years 4years
screen size 23.8” 23.8” 27”
Use location EU EU Worldwide
Assembly location China China China

Even though my research is fairly limited, it seems possible to get the total embodied carbon for the displays. The image-emissions-estimator can output the SCI for a default display type (e.g. 6 kg, 25in display). For vendor specific SCI value, vendor specific config would have to be provided (e.g. for Dell monitor, one would provide PCF for Dell) .

However what I am a little unsure at this point is - The IF is supposed to be used to calculate the SCI for an application (mostly running in the cloud). If I were to calculate the overall impact of fetching the image from cloud and displaying it in an application/website on a display, is it the right use of the IF? Looking forward for some feedback. Thanks.

Bibliography Dell PCF : https://www.dell.com/en-us/dt/corporate/social-impact/advancing-sustainability/climate-action/product-carbon-footprints.htm#tab0=2&pdf-overlay=//www.delltechnologies.com/asset/en-us/products/electronics-and-accessories/technical-support/dell-e2422hs-monitor-pcf-datasheet.pdf Asus PCF: https://esg.asus.com/english/file/PEP_Monitor_BE279.pdf ScienceDirect : https://www.sciencedirect.com/science/article/pii/S1364032123002794

jmcook1186 commented 5 months ago

oh, nice find.

The challenge now you have the total-embodied-emissions would be to determine how much time to allocate to your application - if your monitor exists solely for the purpose of displaying images from your application, meaning across the whole lifespan of the monitor, it is only used for this purpose, then your calculation includes the entire total-embodied-emissions of the monitor. However, most likely it's used for other purposes too, so you'd have to determine what proportion of the monitor lifespan to assign to your specific application. Presumably if you are aiming to provide a value per image. the resulting embodied-carbon value will be small in comparison to the total-embodied-emissions.

Yes, you can use IF to do the calculation - it's primarily been designed with cloud computing in mind so far but we are very keen to be a generalized platform for a wide range of domains.

mads6879 commented 5 months ago

Thanks @jmcook1186 for your inputs. You have raised some interesting questions. Time for some more thinking and research!

mads6879 commented 3 months ago

@jawache @jmcook1186 - Sorry I haven't had a chance to register my project for the hackathon yet. I am currently tied up with launching the Mentorship Programme 2024 for Women Who Code London. The kick-off is on 11/04. Unfortunately both the events have coincided. All the best for hackathon!

jmcook1186 commented 3 months ago

Hi - no worries - don't forget you can register any time right up to the submission day so if you find you have time feel free to join in later! Hope your programme launch goes well!

mads6879 commented 3 months ago

Thanks @jmcook1186