File size: 2,414 Bytes
a02e064
 
 
 
 
 
 
 
 
 
ad7c45c
 
 
 
 
 
 
 
a02e064
ad7c45c
 
a02e064
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ad7c45c
a02e064
 
 
 
 
ad7c45c
 
 
a02e064
 
 
 
 
 
 
 
 
 
 
 
 
 
ad7c45c
a02e064
 
 
ad7c45c
 
a02e064
 
 
 
 
558f729
a02e064
 
 
ad7c45c
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Garbage Classification Model β€” CS549</title>
  <style>
    body { font-family: Arial, sans-serif; margin: 40px; line-height: 1.6; color: #333; }
    h1 { color: #2c3e50; }
    h2 { color: #34495e; }
    code { font-family: Consolas, monospace; }
    pre {
      background: #1e1e1e;
      color: #f8f8f2;
      padding: 16px;
      border-radius: 8px;
      overflow-x: auto;
    }
    ul { margin: 0; padding-left: 20px; }
    a { color: #2980b9; text-decoration: none; }
    a:hover { text-decoration: underline; }
  </style>
</head>
<body>

  <h1>πŸ—‘οΈ Garbage Classification Model β€” CS549</h1>

  <p>A Convolutional Neural Network trained to classify garbage images into 7 categories:</p>
  <ul>
    <li>Cardboard</li>
    <li>Glass</li>
    <li>Metal</li>
    <li>Paper</li>
    <li>Plastic</li>
    <li>Trash</li>
    <li>Biodegradable</li>
  </ul>

  <h2>πŸ” Use Case</h2>
  <p>Helps automate waste sorting for better recycling. Great for demos, PoC apps, or smart bin integration.</p>

  <h2>🧠 Model Overview</h2>
  <ul>
    <li><strong>Architecture:</strong> CNN (Conv2D, MaxPooling, Dense)</li>
    <li><strong>Input:</strong> 224x224 RGB</li>
    <li><strong>Output:</strong> 7-class probability vector</li>
    <li><strong>Accuracy:</strong> ~92% (validation)</li>
    <li><strong>Explainability:</strong> Supports Grad-CAM</li>
  </ul>

  <h2>πŸ“¦ How to Use</h2>
  <pre><code>from tensorflow.keras.models import load_model
from PIL import Image
import numpy as np

model = load_model("GarbageMLModel_CS549.h5")

img = Image.open("example.jpg").resize((224, 224))
img_array = np.expand_dims(np.array(img) / 255.0, axis=0)

pred = model.predict(img_array)
classes = ['cardboard', 'glass', 'metal', 'paper', 'plastic', 'trash', 'biodegradable']
print("Prediction:", classes[np.argmax(pred)])</code></pre>

  <h2>πŸ“ Files</h2>
  <ul>
    <li><code>GarbageMLModel_CS549.h5</code> – Trained model</li>
    <li><code>label_map.json</code> – Label mapping</li>
  </ul>

  <h2>πŸ‘€ Author</h2>
  <p>Vincent Huynh<br>
  πŸ“§ <a href="mailto:vintendohuynh@gmail.com">vintendohuynh@gmail.com</a><br>
  πŸ”— <a href="https://www.linkedin.com/in/vhuynh19/">LinkedIn</a> | πŸ”— <a href="https://github.com/vintendohuynh">GitHub</a></p>

</body>
</html>