File size: 2,807 Bytes
9729764
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
datasets:
- garythung/trashnet
metrics:
- accuracy
- precision
- recall
pipeline_tag: image-classification
---
### **Model Card: Trash Classification Using MobileNetV2**  

---

## **Model Details**  

- **Model Name**: Trash Classification CNN with MobileNetV2  
- **Model Type**: Convolutional Neural Network (CNN)  
- **Architecture**: MobileNetV2  
- **Dataset**: [TrashNet Dataset](https://huggingface.co/datasets/garythung/trashnet)  
- **Languages**: None (Image-based model)  
- **License**: MIT  

---

## **Model Description**  

This model classifies images of trash into six categories:  
- **trash**  
- **plastic**  
- **cardboard**  
- **metal**  
- **paper**  
- **glass**  

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.  

---

## **Intended Use**  

### **Primary Use Cases**  
- Waste management systems to automate sorting.  
- Educational tools for teaching about recycling and waste segregation.  
- Integration into mobile or web applications for real-time waste classification.  

### **Limitations**  
- Model performance may degrade with images of poor quality or those significantly different from the training dataset.  
- Currently supports only six predefined trash categories.  

---

## **Performance Metrics**  

- **Training Accuracy**: 95%  
- **Testing Accuracy**: 90%  
- **Metrics Evaluated**: Accuracy, Precision, Recall, F1-score  
- **Confusion Matrix**: [Available in evaluation results]  

---

## **How to Use the Model**  

### **Input Format**  
- Images resized to 224x224 pixels and normalized to a range of 0-1.  

### **Output**  
- A probability distribution over six classes with the predicted label.  

### **Code Example**  

```python
from transformers import pipeline
from PIL import Image

# Load pre-trained model
classifier = pipeline("image-classification", model="your-model-id")

# Load an image
image = Image.open("sample_image.jpg")

# Perform classification
results = classifier(image)
print(results)
```

---

## **Training Details**  

- **Framework**: TensorFlow/Keras  
- **Optimizer**: Adam  
- **Learning Rate**: 0.001  
- **Loss Function**: Categorical Crossentropy  
- **Batch Size**: 32  
- **Epochs**: 20  

### **Data Preprocessing**  
- Images were resized to 224x224 pixels and normalized.  
- Oversampling and data augmentation techniques (rotation, zoom, and rescaling) were applied to handle class imbalance and enhance generalization.  

---

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!