Datasets:

Modalities:
Image
Size:
< 1K
Libraries:
Datasets
License:
File size: 8,158 Bytes
981dfae
 
 
 
7d626b6
981dfae
 
84499d4
 
 
 
 
981dfae
dfe4a32
12cc4dd
981dfae
dfe4a32
25f76f6
30963c1
cc51849
 
97d78cd
cc51849
 
25f76f6
30963c1
cc51849
 
 
 
981dfae
dfe4a32
0ab9846
25f76f6
 
0f3aa63
25f76f6
 
0ab9846
2cc3582
 
 
 
 
 
981dfae
30963c1
d2ec753
84499d4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
981dfae
dfe4a32
981dfae
ab6512e
981dfae
 
dfe4a32
981dfae
 
dfe4a32
 
981dfae
 
 
 
 
 
 
3020554
981dfae
 
 
dfe4a32
 
981dfae
1aed636
 
 
 
 
3020554
 
 
 
 
2cc3582
 
981dfae
61eb54b
c2ae87b
2455980
c2ae87b
2455980
c2ae87b
31e1b39
c2ae87b
de6b2cf
61eb54b
ba13e4b
d07b7ad
981dfae
ba13e4b
d07b7ad
dfe4a32
84499d4
 
baed4e8
84499d4
 
ba65226
84499d4
 
 
 
 
 
baed4e8
84499d4
fe4ddf0
dfe4a32
c6ffc1f
fe4ddf0
 
c6ffc1f
2455980
5abbb1b
 
 
7e2d09d
fe4ddf0
76fb94a
 
7e2d09d
fe4ddf0
76fb94a
c6ffc1f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
---
license: mit
---
# Waste Identifer Classifcation Model 
**By Amanda Sim**

# Context 
This classification model aims to identify items and categorize them based on how they should be disposed of. Using YOLOv11, 
this model fine-tunes previously trained datasets from Roboflow to fit new classes: recycle, trash, compost, and specialized disposal. 
This model is intented to be used to help people correctly dispose of their items and can be used for smart bins, which detected the item a 
person is holding and opens to the appropriate bin or for apps where the user can take a photo of the item and identify where it goes and how
to dispose of it. 

---

# Training Data 
#### Datasets
1. [Classifcation waste Computer Vision Model](https://universe.roboflow.com/gkhang/classification-waste) by GKHANG

     **Classes**: 10

     **Images**: 10,289


2. [Trash Computer Vision Dataset](https://universe.roboflow.com/baile/trash-izcuy) by BAILE

   **Classes**: 48

   **Images**: 101


#### Class Distribution
After merging the two datasets, I reorganized the classes into their new perspective classes seen in the table below.
| Recycle - 6,640 - 5,033 = 1,607 | Trash - 1,023 | Compost - 1,814 | Specialized Disposal - 1,026 | Deleted - 27 |
|---|---|---|---|---|
| Glass <br> Paper <br> Cardboard <br> Metal <br> Plastic <br> Glass <br> Drink can <br> Pop tab <br> Clear plastic bottle<br> Food can <br> Glass bottle <br> Glass jar <br> Other plastic bottle <br> Normal paper <br> Other carton <br> Other plastic wrapper <br> Aerosol <br> Aluminium foil <br> Drink carton <br> Paper bag <br> Toilet tube <br> Corrugated carton <br> Metal lid <br> Spread tub <br> Meal carton | Broken glass <br> Gloves <br> Masks <br> Cigarette <br> Plastic film <br> Foam cup <br> Disposable food container <br> Crisp packet <br> Metal bottle cap <br> Plastic lid <br> Plastic straws <br> Plastic utensils <br> Paper cup <br> Aluminium blister pack <br> Garbage bag <br> Tissues <br> Styrofoam piece <br> Paper straw <br> Single use carrier bag <br> Squeezable tube <br> Rope & string <br> Shoe <br> 6 pack rings <br> Disposable plastic cup | Biodegradable <br> Food waste <br> Egg carton | Syringe <br> Medicines <br> Metal bottle cap <br> Battery | Plastic bottle caps <br> Glass cup <br> Unlabeled litter <br> Other plastic |


This is the final class distributions
|Class                  | Train | Valid |  Test | Total |
|-----------------------|------:|------:|------:|------:|
|Recycle                |  992  |  324  |  234  | 1,607 |
|Trash                  |  626  |  223  |  151  | 1,023 |
|Compost                | 1,151 |  389  |  269  | 1,814 |
|Specialized Disposal   |  667  |  219  |  140  | 1,026 |


#### Annotation Process
For the compost class, some images included items that could not be composted (ex, red meat). I reviewed all the images and 
moved non-compostable food waste to the trash category. <br>

For the classes I chose to delete, the first one being plastic bottle caps, from Google searches, it is generally 
recommended to keep your bottle caps on your bottles when recycling, but for recycling plastic bottle caps, there were
specific requirements on what size can and cannot be recycled. For example, according to the Seattle Public Utilities, 
loose bottle caps less than 3 inches in diameter go into the trash 
([Seattle Public Utilities](https://www.seattle.gov/utilities/your-services/collection-and-disposal/where-does-it-go#/a-z )). 
However, from the images alone, it’s difficult to interpret the size of the caps, so for less confusion in training, 
I choose to opt out of including them. For glass cups, they cannot be recycled and generally recommended to donate them; 
however, since there are only 3 images in this class, rather than adding a new “donate” class and risk significant class imbalance,
I choose to delete them. Lastly, for both unlabelled litter and other plastic, it was difficult to identify these items, so I chose
to delete them to minimize confusion. <br>

For the recycle class, it came up to a total of 6,640 images, but because the rest of the classes were within the 1,000 range, 
and I wanted to try to prevent any false negatives and accuracy issues from imbalanced classes, I chose to delete 5,033 images
from the class and ended up with 1,607. <br>

#### Train/Valid/Test Split 
- **Train**: 3,421 images (64%)
- **Valid**: 1,145 images (21%)
- **Test**: 791 images (15%)

#### Augmentations 
- None

---

# Training Procedure 
- **Framework**: Ultralytics
- **Hardware**: NVIDIA A100-SXM4-80GB
- **Batch Size**: 64
- **Epochs**: 50
- **Image Size**: 640
- **Patience**: 10
- **Preprocessing**: None 

- _Early Stopping_: 38 epochs

---

# Evaluation Results 
**Overall Breakdown**
| Top 1 Accuracy        | F1-Score | Precision | Recall |
|-----------------------|---------:|----------:|-------:|
|       0.962           |    0.96  |    0.96   |  0.96  |

**Per-Class Breakdown**
| Class                 | Precision | Recall | F1-Score |
|-----------------------|----------:|-------:|---------:|
| Recycle               |   0.98    |  0.96  |   0.97   |
| Trash                 |   0.95    |  0.91  |   0.93   |
| Compost               |   0.98    |  0.99  |   0.98   |
| Specialized Disposal  |   0.98    |  0.99  |   0.98   |

**Class Examples**
- Recycle
<img src='Recycle Class.png' alt="recycle class images" width="200" height="200">
- Trash
<img src='Trash Class.png' alt="trash class images" width="200" height="200">
- Compost
<img src='Compost Class.png' alt="compost class images" width="200" height="200">
- Specialized Disposal
<img src='Specialized Disposal Class.png' alt="specialized disposal class images" width="200" height="200">

**Confusion Matrix**
<img src='confusion_matrix_normalized.png' alt="Normalized Comfusion Matrix" width="500">

**Train/Loss and Val/Loss Curves**
<img src='results.png' alt="Train/Loss and Val/Loss Curves" width="500">


**Peformance Analysis**

From this model, the overall performance indicate high accuracy, with the top 1 accuracy being 0.962 and each class having a F1-score
in the 0.9 range. From the confusion matrix, we can see a perfect diagonal, which indicates the model was able to accurately predict
the items correctly. However we do see a few false negatives and positives, specifically where the model mixed up trash and specalized disposal is the highest, but this is very minor.
Looking at the train/loss curve shows that the model is learning effectively, with the downward shape curve and decreasing spikes as the 
longer the model trains. From the metrics/accuracy_top1 curve we see large spikes towards the beginning of the training process but the 
spikes slowly decreases as it trains longer, which indicates the model is improving it’s accuracy and showing stable performance. 
For the validation loss curve, we see extremely high spikes towards the beginning, but the spikes slowly decreases as more training time
is applied. Lastly, for the metrics/accuracy_top5, this shows up as a horizontal line at 1 due to the fact that I only have 4 classes. 
Overall, my model indicates high accuracy and no cases of overfitting, however, the model could benefit from longer training time to
allow the curves to smoothen out further and reach an eventual straight horizontal line. 

--- 

# Limitations and Biases

**Failure Cases**
- Struggled at identifying compost majority of the time
  - ex: misidentifed bananas as recycle 
- Confused specialized disposal for trash
  - ex: items belonging in the trash class featured in images identified as specialized disposal
    - someone wearing gloves while holding a syringe 

**Limitation**
- Decisions on which classes belong in which were made based on Seattle's disposal guidelines, which can’t be used worldwide or statewide due to different disposal requirements and regulations.
- Model lacks representation and diversity in types of items in each class

**Poor Performing Class: Compost**
- Majority of images in the compost class feature pixelated or low-quality images, making it difficult for the model to identify items in this class correctly.