Upload README (1).md
Browse files- README (1).md +138 -0
README (1).md
ADDED
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- image-classification
|
5 |
+
- resnet50
|
6 |
+
datasets:
|
7 |
+
- mostafaabla/garbage-classification
|
8 |
+
license: mit
|
9 |
+
---
|
10 |
+
|
11 |
+
|
12 |
+
# Model Card for Garbage Classification using ResNet50
|
13 |
+
|
14 |
+
## Model Overview
|
15 |
+
This model is a garbage classification system built on the ResNet50 architecture, fine-tuned for classifying household garbage into 12 distinct categories: paper, cardboard, biological, metal, plastic, green-glass, brown-glass, white-glass, clothes, shoes, batteries, and trash. The model was trained on a dataset sourced from the Kaggle Garbage Classification Dataset by Mostafa Abla. The purpose of this model is to assist in sorting household waste for better recycling efficiency.
|
16 |
+
|
17 |
+
## Model Architecture
|
18 |
+
Base Model: ResNet50 (pre-trained on ImageNet).
|
19 |
+
|
20 |
+
Modifications: The final fully connected layer was modified to output 12 classes instead of the default 1000 classes used in ImageNet.
|
21 |
+
|
22 |
+
## Intended Use
|
23 |
+
This model is intended for environmental conservation efforts through waste sorting and recycling. It can be implemented in waste management systems, where a camera captures images of garbage and sorts them into appropriate categories for recycling.
|
24 |
+
|
25 |
+
## Potential Use Cases:
|
26 |
+
|
27 |
+
- Automated waste sorting systems.
|
28 |
+
- Integration in smart recycling bins.
|
29 |
+
- Environmental and educational tools to promote recycling.
|
30 |
+
|
31 |
+
## Limitations and Ethical Considerations
|
32 |
+
While this model can help with waste sorting, there are some important considerations to keep in mind:
|
33 |
+
|
34 |
+
- Bias in Dataset: The dataset was collected through web scraping, and some categories, such as clothes and shoes, may not reflect real-world garbage. This could cause inaccuracies in certain classes.
|
35 |
+
- Ethical Use: The model should not be used in isolation without human oversight, especially in critical recycling operations, as there is potential for error in misclassification that could lead to incorrect waste handling.
|
36 |
+
- Dataset Limitations: The dataset used was created in a controlled environment, not in real-world garbage scenarios. This may limit the generalizability of the model to environments where garbage is not presented in a clean, well-lit setting.
|
37 |
+
|
38 |
+
## Mitchell's Ethical AI Considerations (2018)
|
39 |
+
- Bias: The dataset contains inherent bias, as it was primarily collected through web scraping rather than real-world garbage images. For instance, images of clothes are typically of clean clothes, not actual discarded garments, which can lead to incorrect classification.
|
40 |
+
- Fairness: The model may perform differently depending on the type of garbage presented. Since it was not trained on real-world garbage images, it might favor certain categories.
|
41 |
+
- Transparency: The model was built using a pre-trained ResNet50 with added modifications, and the details of training and performance metrics are shared openly.
|
42 |
+
- Mitigation: Further data collection from real-world garbage environments can improve model accuracy and fairness.
|
43 |
+
|
44 |
+
# Training and Experimental Details
|
45 |
+
## Training Parameters
|
46 |
+
- Optimizer: Adam optimizer with learning rate of 0.001
|
47 |
+
- Loss Function: CrossEntropyLoss
|
48 |
+
- Scheduler: StepLR, decreasing the learning rate every 7 epochs by a factor of 0.1
|
49 |
+
- Batch Size: 32
|
50 |
+
- Number of Epochs: 10
|
51 |
+
- Transformations:
|
52 |
+
- Training: RandomResizedCrop, RandomRotation, HorizontalFlip, ColorJitter, Normalization.
|
53 |
+
- Validation: Resize, CenterCrop, Normalization.
|
54 |
+
|
55 |
+
The training was conducted on a single GPU to speed up computation.
|
56 |
+
|
57 |
+
## Dataset Used
|
58 |
+
The model was trained using the Kaggle Garbage Classification Dataset https://www.kaggle.com/datasets/mostafaabla/garbage-classification/data. The dataset contains 15,150 images of household garbage spread across 12 classes. The images were split into training and validation sets to evaluate the model performance.
|
59 |
+
|
60 |
+
## Model Evaluation Results
|
61 |
+
The model's performance was evaluated on the validation set. Below are the key metrics:
|
62 |
+
|
63 |
+
Epoch 1/10
|
64 |
+
----------
|
65 |
+
train Loss: 1.0083 Acc: 0.6850
|
66 |
+
valid Loss: 0.6304 Acc: 0.7985
|
67 |
+
Epoch 1 completed in 2109.20 seconds.
|
68 |
+
|
69 |
+
Epoch 2/10
|
70 |
+
----------
|
71 |
+
train Loss: 0.7347 Acc: 0.7687
|
72 |
+
valid Loss: 0.8616 Acc: 0.7307
|
73 |
+
Epoch 2 completed in 2183.41 seconds.
|
74 |
+
|
75 |
+
Epoch 3/10
|
76 |
+
----------
|
77 |
+
train Loss: 0.6510 Acc: 0.7913
|
78 |
+
valid Loss: 0.5594 Acc: 0.8260
|
79 |
+
Epoch 3 completed in 2174.55 seconds.
|
80 |
+
|
81 |
+
Epoch 4/10
|
82 |
+
----------
|
83 |
+
train Loss: 0.5762 Acc: 0.8126
|
84 |
+
valid Loss: 0.4006 Acc: 0.8655
|
85 |
+
Epoch 4 completed in 2166.46 seconds.
|
86 |
+
|
87 |
+
Epoch 5/10
|
88 |
+
----------
|
89 |
+
train Loss: 0.5478 Acc: 0.8210
|
90 |
+
valid Loss: 0.3968 Acc: 0.8793
|
91 |
+
Epoch 5 completed in 2189.89 seconds.
|
92 |
+
|
93 |
+
Epoch 6/10
|
94 |
+
----------
|
95 |
+
train Loss: 0.5223 Acc: 0.8272
|
96 |
+
valid Loss: 0.4051 Acc: 0.8729
|
97 |
+
Epoch 6 completed in 2185.71 seconds.
|
98 |
+
|
99 |
+
Epoch 7/10
|
100 |
+
----------
|
101 |
+
train Loss: 0.4974 Acc: 0.8355
|
102 |
+
valid Loss: 0.3223 Acc: 0.9094
|
103 |
+
Epoch 7 completed in 2184.83 seconds.
|
104 |
+
|
105 |
+
Epoch 8/10
|
106 |
+
----------
|
107 |
+
train Loss: 0.3464 Acc: 0.8870
|
108 |
+
valid Loss: 0.2221 Acc: 0.9338
|
109 |
+
Epoch 8 completed in 2184.53 seconds.
|
110 |
+
|
111 |
+
Epoch 9/10
|
112 |
+
----------
|
113 |
+
train Loss: 0.2896 Acc: 0.9049
|
114 |
+
valid Loss: 0.2125 Acc: 0.9338
|
115 |
+
Epoch 9 completed in 2181.82 seconds.
|
116 |
+
|
117 |
+
Epoch 10/10
|
118 |
+
----------
|
119 |
+
train Loss: 0.2604 Acc: 0.9136
|
120 |
+
valid Loss: 0.2076 Acc: 0.9326
|
121 |
+
|
122 |
+
Training complete in 362m 11s
|
123 |
+
|
124 |
+
Best val Acc: 0.9338
|
125 |
+
|
126 |
+
Training Time: Approximately 12 minutes on a single GPU for 10 epochs.
|
127 |
+
|
128 |
+
The model showed high accuracy in predicting common categories such as plastic, paper, and metal, but struggled with classes like shoes and clothes, reflecting the challenges of web-scraped images for such categories.
|
129 |
+
|
130 |
+
## Conclusion
|
131 |
+
This ResNet50-based garbage classification model shows promising performance for sorting household waste into multiple categories. It can be used in waste management systems to automate and optimize the recycling process. Future work includes improving data quality by collecting real-world garbage images, fine-tuning the model, and addressing potential biases.
|
132 |
+
|
133 |
+
Further details and the code for this model can be found in the experiment tracking system.
|
134 |
+
|
135 |
+
## Potential Improvements
|
136 |
+
- Real-world data collection (also preferably from items in poor or trash-like conditions) is necessary to reduce bias, as trash banks and recycling centers encourage people to separate used items into those that are reusable and those that are not suitable for use.
|
137 |
+
- More data augmentation to handle edge cases like occluded or partially damaged garbage items.
|
138 |
+
- Deploying the model in edge devices for real-time classification at waste management facilities.
|