| <!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> |
|
|
|
|