Update README.md
Browse files
README.md
CHANGED
@@ -1,68 +1,103 @@
|
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- garythung/trashnet
|
4 |
+
metrics:
|
5 |
+
- accuracy
|
6 |
+
- precision
|
7 |
+
- recall
|
8 |
+
pipeline_tag: image-classification
|
9 |
+
---
|
10 |
+
### **Model Card: Trash Classification Using MobileNetV2**
|
11 |
+
|
12 |
+
---
|
13 |
+
|
14 |
+
## **Model Details**
|
15 |
+
|
16 |
+
- **Model Name**: Trash Classification CNN with MobileNetV2
|
17 |
+
- **Model Type**: Convolutional Neural Network (CNN)
|
18 |
+
- **Architecture**: MobileNetV2
|
19 |
+
- **Dataset**: [TrashNet Dataset](https://huggingface.co/datasets/garythung/trashnet)
|
20 |
+
- **Languages**: None (Image-based model)
|
21 |
+
- **License**: MIT
|
22 |
+
|
23 |
+
---
|
24 |
+
|
25 |
+
## **Model Description**
|
26 |
+
|
27 |
+
This model classifies images of trash into six categories:
|
28 |
+
- **trash**
|
29 |
+
- **plastic**
|
30 |
+
- **cardboard**
|
31 |
+
- **metal**
|
32 |
+
- **paper**
|
33 |
+
- **glass**
|
34 |
+
|
35 |
+
The model is designed to assist in waste segregation and recycling initiatives by automating the identification of waste types. It uses MobileNetV2, a lightweight CNN architecture pre-trained on ImageNet, fine-tuned on the TrashNet dataset for this specific task.
|
36 |
+
|
37 |
+
---
|
38 |
+
|
39 |
+
## **Intended Use**
|
40 |
+
|
41 |
+
### **Primary Use Cases**
|
42 |
+
- Waste management systems to automate sorting.
|
43 |
+
- Educational tools for teaching about recycling and waste segregation.
|
44 |
+
- Integration into mobile or web applications for real-time waste classification.
|
45 |
+
|
46 |
+
### **Limitations**
|
47 |
+
- Model performance may degrade with images of poor quality or those significantly different from the training dataset.
|
48 |
+
- Currently supports only six predefined trash categories.
|
49 |
+
|
50 |
+
---
|
51 |
+
|
52 |
+
## **Performance Metrics**
|
53 |
+
|
54 |
+
- **Training Accuracy**: 95%
|
55 |
+
- **Testing Accuracy**: 90%
|
56 |
+
- **Metrics Evaluated**: Accuracy, Precision, Recall, F1-score
|
57 |
+
- **Confusion Matrix**: [Available in evaluation results]
|
58 |
+
|
59 |
+
---
|
60 |
+
|
61 |
+
## **How to Use the Model**
|
62 |
+
|
63 |
+
### **Input Format**
|
64 |
+
- Images resized to 224x224 pixels and normalized to a range of 0-1.
|
65 |
+
|
66 |
+
### **Output**
|
67 |
+
- A probability distribution over six classes with the predicted label.
|
68 |
+
|
69 |
+
### **Code Example**
|
70 |
+
|
71 |
+
```python
|
72 |
+
from transformers import pipeline
|
73 |
+
from PIL import Image
|
74 |
+
|
75 |
+
# Load pre-trained model
|
76 |
+
classifier = pipeline("image-classification", model="your-model-id")
|
77 |
+
|
78 |
+
# Load an image
|
79 |
+
image = Image.open("sample_image.jpg")
|
80 |
+
|
81 |
+
# Perform classification
|
82 |
+
results = classifier(image)
|
83 |
+
print(results)
|
84 |
+
```
|
85 |
+
|
86 |
+
---
|
87 |
+
|
88 |
+
## **Training Details**
|
89 |
+
|
90 |
+
- **Framework**: TensorFlow/Keras
|
91 |
+
- **Optimizer**: Adam
|
92 |
+
- **Learning Rate**: 0.001
|
93 |
+
- **Loss Function**: Categorical Crossentropy
|
94 |
+
- **Batch Size**: 32
|
95 |
+
- **Epochs**: 20
|
96 |
+
|
97 |
+
### **Data Preprocessing**
|
98 |
+
- Images were resized to 224x224 pixels and normalized.
|
99 |
+
- Oversampling and data augmentation techniques (rotation, zoom, and rescaling) were applied to handle class imbalance and enhance generalization.
|
100 |
+
|
101 |
+
---
|
102 |
+
|
103 |
+
This model card is designed to comply with Hugging Face standards and can be adapted further as needed. Let me know if you need any specific sections expanded!
|