Update README.md
Browse files
README.md
CHANGED
@@ -32,7 +32,7 @@ The aim is to build a model for waste classification that identifies among the d
|
|
32 |
This machine learning model will help people to improve their decision when classifying trash
|
33 |
|
34 |
|
35 |
-
**Fastai** is a deep learning library which provides high-level components that can quickly and easily provide state-of-the-art results in standard deep learning domains.
|
36 |
|
37 |
It has two main design goals:
|
38 |
|
@@ -42,7 +42,6 @@ To be also configurable.
|
|
42 |
### Model Sources
|
43 |
|
44 |
- **Repository:** [https://github.com/rootstrap/fastai-waste-classifier](https://github.com/rootstrap/fastai-waste-classifier)
|
45 |
-
- **Demo (with detector):** [https://huggingface.co/spaces/rootstrap-org/waste-classifier](https://huggingface.co/spaces/rootstrap-org/waste-classifier)
|
46 |
|
47 |
## Uses
|
48 |
|
@@ -60,14 +59,10 @@ model.predict()
|
|
60 |
|
61 |
## Bias, Risks, and Limitations
|
62 |
|
63 |
-
Take into account that the model has been trained
|
64 |
you won't be able to classify several objects at the same time, or pictures that have one object above another.
|
65 |
This does not aim to replace humans to classify trash, at least for now, instead it is a tool to help them to better classify.
|
66 |
|
67 |
-
## How to Get Started with the Model
|
68 |
-
|
69 |
-
You can use the following Google
|
70 |
-
|
71 |
## Training Details
|
72 |
|
73 |
### Training Data
|
@@ -81,7 +76,7 @@ To load the model in the file [result-resnet50.pkl](result-resnet50.pkl)
|
|
81 |
|
82 |
The model has been trained to classify waste into 6 classes.
|
83 |
This repository contains the dataset that we collected.
|
84 |
-
|
85 |
- 501 glass
|
86 |
- 594 paper
|
87 |
- 403 cardboard
|
@@ -92,83 +87,17 @@ Currently, the dataset consists of 2527 images:
|
|
92 |
The dataset was built joining images search on the internet using Bing plus some images taken manually, in addition to images from [Trashnet dataset](https://github.com/garythung/trashnet)
|
93 |
If you are using the dataset, please give a citation of this repository. The dataset can be downloaded at [rootstrap-org/waste-classifier](rootstrap-org/waste-classifier).
|
94 |
|
|
|
|
|
95 |
### Training Procedure
|
96 |
You can find the code for training at [resnet-model.ipynb](https://github.com/rootstrap/fastai-waste-classifier/blob/main/resnet-model.ipynb)
|
97 |
Training the model using resnet50: ResNet34 is a convolutional neural network(CNN) that has 34 layers. It has been already trained with images from the ImageNet database. It classifies 1000 object from very broad categories, such as pencil or animals. The input size of the network is 224x224.
|
98 |
|
99 |
## Evaluation and Results
|
100 |
-
|
101 |
![confusion_matrix](https://github.com/rootstrap/fastai-waste-classifier/blob/main/classification_matrix_resnet34.png)
|
|
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
{{ results_summary | default("", true) }}
|
107 |
-
|
108 |
-
## Model Examination [optional]
|
109 |
-
|
110 |
-
<!-- Relevant interpretability work for the model goes here -->
|
111 |
-
|
112 |
-
{{ model_examination | default("[More Information Needed]", true)}}
|
113 |
-
|
114 |
-
## Environmental Impact
|
115 |
-
|
116 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
117 |
-
|
118 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
119 |
-
|
120 |
-
- **Hardware Type:** {{ hardware | default("[More Information Needed]", true)}}
|
121 |
-
- **Hours used:** {{ hours_used | default("[More Information Needed]", true)}}
|
122 |
-
- **Cloud Provider:** {{ cloud_provider | default("[More Information Needed]", true)}}
|
123 |
-
- **Compute Region:** {{ cloud_region | default("[More Information Needed]", true)}}
|
124 |
-
- **Carbon Emitted:** {{ co2_emitted | default("[More Information Needed]", true)}}
|
125 |
-
|
126 |
-
## Technical Specifications [optional]
|
127 |
-
|
128 |
-
### Model Architecture and Objective
|
129 |
-
|
130 |
-
{{ model_specs | default("[More Information Needed]", true)}}
|
131 |
-
|
132 |
-
### Compute Infrastructure
|
133 |
-
|
134 |
-
{{ compute_infrastructure | default("[More Information Needed]", true)}}
|
135 |
-
|
136 |
-
#### Hardware
|
137 |
-
|
138 |
-
{{ hardware | default("[More Information Needed]", true)}}
|
139 |
-
|
140 |
-
#### Software
|
141 |
-
|
142 |
-
{{ software | default("[More Information Needed]", true)}}
|
143 |
-
|
144 |
-
## Citation [optional]
|
145 |
-
|
146 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
147 |
-
|
148 |
-
**BibTeX:**
|
149 |
-
|
150 |
-
{{ citation_bibtex | default("[More Information Needed]", true)}}
|
151 |
-
|
152 |
-
**APA:**
|
153 |
-
|
154 |
-
{{ citation_apa | default("[More Information Needed]", true)}}
|
155 |
-
|
156 |
-
## Glossary [optional]
|
157 |
-
|
158 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
159 |
-
|
160 |
-
{{ glossary | default("[More Information Needed]", true)}}
|
161 |
-
|
162 |
-
## More Information [optional]
|
163 |
-
|
164 |
-
{{ more_information | default("[More Information Needed]", true)}}
|
165 |
-
|
166 |
-
## Model Card Authors [optional]
|
167 |
-
|
168 |
-
{{ model_card_authors | default("[More Information Needed]", true)}}
|
169 |
-
|
170 |
-
## Model Card Contact
|
171 |
-
|
172 |
-
{{ model_card_contact | default("[More Information Needed]", true)}}
|
173 |
-
|
174 |
|
|
|
32 |
This machine learning model will help people to improve their decision when classifying trash
|
33 |
|
34 |
|
35 |
+
The model was built using **Fastai** is a deep learning library which provides high-level components that can quickly and easily provide state-of-the-art results in standard deep learning domains.
|
36 |
|
37 |
It has two main design goals:
|
38 |
|
|
|
42 |
### Model Sources
|
43 |
|
44 |
- **Repository:** [https://github.com/rootstrap/fastai-waste-classifier](https://github.com/rootstrap/fastai-waste-classifier)
|
|
|
45 |
|
46 |
## Uses
|
47 |
|
|
|
59 |
|
60 |
## Bias, Risks, and Limitations
|
61 |
|
62 |
+
Take into account that the model has been trained firstly trained with images that mostly have white background that contains only one object. In a further training the model was trained with a more varied range of images, which improved the bias a little bit. But the model still is incapable of detecting more than one object per image. So,
|
63 |
you won't be able to classify several objects at the same time, or pictures that have one object above another.
|
64 |
This does not aim to replace humans to classify trash, at least for now, instead it is a tool to help them to better classify.
|
65 |
|
|
|
|
|
|
|
|
|
66 |
## Training Details
|
67 |
|
68 |
### Training Data
|
|
|
76 |
|
77 |
The model has been trained to classify waste into 6 classes.
|
78 |
This repository contains the dataset that we collected.
|
79 |
+
The dataset used for the first training consisted of 2527 images:
|
80 |
- 501 glass
|
81 |
- 594 paper
|
82 |
- 403 cardboard
|
|
|
87 |
The dataset was built joining images search on the internet using Bing plus some images taken manually, in addition to images from [Trashnet dataset](https://github.com/garythung/trashnet)
|
88 |
If you are using the dataset, please give a citation of this repository. The dataset can be downloaded at [rootstrap-org/waste-classifier](rootstrap-org/waste-classifier).
|
89 |
|
90 |
+
In the second training, another set of images was collected using the [TACO dataset](http://tacodataset.org/) as a starting point, along with other datasets in the web. A selection of proper training images was made from those datasets to build the training dataset.
|
91 |
+
|
92 |
### Training Procedure
|
93 |
You can find the code for training at [resnet-model.ipynb](https://github.com/rootstrap/fastai-waste-classifier/blob/main/resnet-model.ipynb)
|
94 |
Training the model using resnet50: ResNet34 is a convolutional neural network(CNN) that has 34 layers. It has been already trained with images from the ImageNet database. It classifies 1000 object from very broad categories, such as pencil or animals. The input size of the network is 224x224.
|
95 |
|
96 |
## Evaluation and Results
|
97 |
+
After the first training, the model reached an accuracy of 0.98, here we can see the confusion matrix:
|
98 |
![confusion_matrix](https://github.com/rootstrap/fastai-waste-classifier/blob/main/classification_matrix_resnet34.png)
|
99 |
+
However, that first model had a lot of bias and limitations.
|
100 |
|
101 |
+
The final model trained with more images, many of them from the TACO dataset, reached an accuracy of 89%.
|
102 |
+
That model still has some limitation, but it's a lot more flexible than the first one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|