Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
123 changes: 11 additions & 112 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,6 @@

The exploratory project estimates and measures carbon emissions from various Machine Learning and deep learning datasets to quantify and analyze their impact.

<br/>

- [About](https://github.com/blessinvarkey/EcoCoding#about)
- [Emissions](https://github.com/blessinvarkey/EcoCoding#emissions)
- [Installation](https://github.com/blessinvarkey/Energy-Consumption-In-Machine-Learning/blob/main/README.md#installation)
- [IRIS-Dataset](https://github.com/blessinvarkey/Estimation-of-Energy-Consumption-In-Machine-Learning/blob/main/README.md#1-iris-dataset)
- [ASD-Screening](https://github.com/blessinvarkey/Estimation-of-Energy-Consumption-In-Machine-Learning/blob/main/README.md#2-autism-spectrum-quotient-aq-10--q-chat)
- [Fashion MNIST](https://github.com/blessinvarkey/EcoCoding#3-fashion-mnist)

## Definitions
- 1 Wh is 3600 Joules

## Why do we need Sustainable Software?
- A 200g ebook requires about 15kg of raw materials (e.g. rare earth metal) 300L water, and 170 kg of CO2. Ecologically more beneficial than paperback only if you read between 30-60 books
- Energy consumption of ICT

__Email:__
- 1 MB Email =≈ 20g of CO2
- 20 emails on 365 days = car travelling 1000 km

__Web search:__
- ≈3.5 Wh, ≈ 1g CO2 equivalent
- 2-3 web searches per day =≈ 10 kg of CO2 per year

Per capita consumption: equivalent to ≈ 1,400 km by car

__ICT global demand__
- 1% to 10%
- 2% of global emissions, equal to aviation industry from fuel

__Forecast:__
- Data centres could consume 28% of total energy consumption (est.: 11%, best 4%)
- “In worst-case scenario, ICT electricity usage could contribute upto 23% of the globally released greenhouse gas emissions in 2030”


![](https://theshiftproject.org/wp-content/uploads/2019/07/Graphique_EN_Energy-consumption-of-digital-technologies.png)

Product development/software development teams

__Organizational__: Product development teams and methods
Examples: _Agile Development_, _DevOps_

__Technological__: Technological Advancements
Examples: _cloud infrastructure_, _mobile devices_

__Market__:
Examples: _hyperscale cloud providers_, _consumer demands_

# GREENSOFT Model
- A wholistic reference model for producing and consuming sustainable software
- "Green and Sustainable Software Engineering is the art of defining and developing software products in a way, so that the negative and positive impacts on sustainable development that result from the software product over its whole life cycle are continously assessed, documented, and used for further optimization of the software product."[[3](https://www.semanticscholar.org/paper/The-GREENSOFT-Model%3A-A-reference-model-for-green-Naumann-Hirsch-Dick/d52109cceee36af7731cdcd6a69c1972e0905a4b)]

Lifecycle phases in the "Greensoft- Green and Sustainable Software Model"?
- Development
- Usage
- End of Life


![](https://ars.els-cdn.com/content/image/1-s2.0-S2210537911000473-gr1.jpg)


The following projects in the repo uses code carbon taking into account the computing infrastructure, location, usage and running time.

# Emissions

| Algorithm | Dataset/ Link to code | Instance | Accuracy| Emissions Recorded in Joules* (average) |Emissions Recorded in kg* (average) |
| ------------- |------------- | ------------- | ------------- | ------------- | ------------- |
|Logistic Regression | [IRIS Dataset](https://github.com/blessinvarkey/EcoCoding/blob/main/iris-dataset/train.py)|50 | 95.56%|11322593948.720951 joules|1.2598084791716727e-07 kg |
| Logistic Regression | [ASD Screening](https://github.com/blessinvarkey/EcoCoding/blob/main/asd-dataset/train.py) | 761 | 99.53% | 23098647146.30177 joules | 2.570071104209542e-07 kg |
|Support Vector Machines | [IRIS Dataset](https://github.com/blessinvarkey/EcoCoding/blob/main/iris-dataset/train.py)| 50 | 97.78%|11020140817.496267 joules|1.226156029830599e-07 kg|
|K Nearest Neighbors | [IRIS Dataset](https://github.com/blessinvarkey/EcoCoding/blob/main/iris-dataset/train.py)| 50 | 93.33%|11183853335.19536 joules|1.2443715040300566e-07 kg |
| Adam Optimization | [Fashion MNIST](https://github.com/blessinvarkey/EcoCoding/blob/main/fashion-mnist/train.py) | 70,000 | |52381696453822.83 joules (5 epochs)| |

# Installation

Download the project along with a code editor.
Expand Down Expand Up @@ -119,51 +46,23 @@ python train.py

# About the Dataset

## 1. Iris Dataset
The IRIS data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant. One class is linearly separable from the other 2; the latter are NOT linearly separable from each other.

The details on the dataset can be found [here](https://archive.ics.uci.edu/ml/datasets/iris)


### Data Visualization: Sepal Length vs Width & Petal Length vs Width
|![Screenshot](images/Figure_1.png)|![Screenshot](images/Figure_2.png)|![Screenshot](images/Figure_3.png)|
| ------------- | ------------- |------------- |



## 2. ASD Screening
The Autism-Spectrum Quotient publisehed by Baron-Cohen, Wheelwright, Skinner, Martin, & Clubley was developed to assess how adults with 'normal' intelligence has the traits associated with autism spectrum conditions. Each question allows the subject to indicate "Definitely agree", "Slightly agree", "Slightly disagree" or "Definitely disagree". Approximately half the questions are worded to elicit an "agree" response from normal individuals, and half to elicit a "disagree" response. The subject scores one point for each question which is answered "autistically" either slightly or definitely." The questions cover five different domains associated with the autism spectrum: social skills; communication skills; imagination; attention to detail; and attention switching/tolerance of change.
# Data Visualization

According to the dataset, 'Yes' indicates that the individual is on the Autism Spectum and 'No' is indicated when the final score is less than or equal to 7. You can refer the questions from [here](https://www.nice.org.uk/guidance/cg142/resources/autism-spectrum-quotient-aq10-test-pdf-186582493).

The Dataset can be downloaded from the UCI Repository which is publicly available [here](https://archive.ics.uci.edu/ml/datasets/Autism+Screening+Adult).
# Emissions - Red Wine

### Data Visualization
|![Screenshot](images/asd_dataset/Figure_1.png)|![Screenshot](images/asd_dataset/Figure_2.png)|![Screenshot](images/asd_dataset/Figure_3.png)|![Screenshot](images/asd_dataset/Figure_4.png)|
| ------------- | ------------- |------------- | ------------- |
|![Screenshot](images/asd_dataset/Figure_5.png)|![Screenshot](images/asd_dataset/Figure_6.png)|![Screenshot](images/asd_dataset/Figure_7.png)|![Screenshot](images/asd_dataset/Figure_9.png)|

|![Screenshot](images/asd_dataset/Figure_10.png)|![Screenshot](images/asd_dataset/Figure_11.png)|
| ------------- |------------- |


## 3. Fashion MNIST
Fashion MNIST is a dataset comprised of 60,000 small square 28×28 pixel grayscale images of items of 10 types of clothing, such as shoes, t-shirts, dresses, and more. The mapping of all 0-9 integers to class labels is listed below.

# Emissions

0: T-shirt/top
1: Trouser
2: Pullover
3: Dress
4: Coat
5: Sandal
6: Shirt
7: Sneaker
8: Bag
9: Ankle boot
| Algorithm | Dataset/ Link to code | Instance | Accuracy| Emissions Recorded in Joules* (average) |Emissions Recorded in kg* (average) |
| ------------- |------------- | ------------- | ------------- | ------------- | ------------- |
|Logistic Regression | [IRIS Dataset](https://github.com/blessinvarkey/EcoCoding/blob/main/iris-dataset/train.py)|50 | 95.56%|11322593948.720951 joules|1.2598084791716727e-07 kg |
| Logistic Regression | [ASD Screening](https://github.com/blessinvarkey/EcoCoding/blob/main/asd-dataset/train.py) | 761 | 99.53% | 23098647146.30177 joules | 2.570071104209542e-07 kg |
|Support Vector Machines | [IRIS Dataset](https://github.com/blessinvarkey/EcoCoding/blob/main/iris-dataset/train.py)| 50 | 97.78%|11020140817.496267 joules|1.226156029830599e-07 kg|
|K Nearest Neighbors | [IRIS Dataset](https://github.com/blessinvarkey/EcoCoding/blob/main/iris-dataset/train.py)| 50 | 93.33%|11183853335.19536 joules|1.2443715040300566e-07 kg |
| Adam Optimization | [Fashion MNIST](https://github.com/blessinvarkey/EcoCoding/blob/main/fashion-mnist/train.py) | 70,000 | |52381696453822.83 joules (5 epochs)| |

### Data Visualization
|![Screenshot](images/f1.png)|![Screenshot](images/f2.png)|![Screenshot](images/f3.png)|
|--|--|--|


[↑ Back to top](https://github.com/blessinvarkey/EcoCoding#energy-consumption-in-machine-learning--deep-learning-models)
Binary file removed ResNet50/bay.jpg
Binary file not shown.
12 changes: 0 additions & 12 deletions ResNet50/train.py

This file was deleted.

1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

Binary file removed asd-dataset/.DS_Store
Binary file not shown.
Loading