|
|
--- |
|
|
language: en |
|
|
license: mit |
|
|
tags: |
|
|
- image-classification |
|
|
- waste-detection |
|
|
- computer-vision |
|
|
- keras |
|
|
- tensorflow |
|
|
--- |
|
|
|
|
|
# TRASHPRED: Waste Classification Model |
|
|
|
|
|
## Model Overview |
|
|
|
|
|
TRASHPRED is a convolutional neural network (CNN) model designed to classify images of waste into categories such as plastic, metal, paper, glass, and organic materials. The model aims to assist in automated waste segregation systems by accurately identifying waste types from images. |
|
|
|
|
|
## Training Details |
|
|
|
|
|
- **Framework**: TensorFlow with Keras API |
|
|
- **Architecture**: Custom CNN with multiple convolutional and pooling layers |
|
|
- **Dataset**: Trained on a curated dataset of labeled waste images |
|
|
- **Input Size**: 224x224 RGB images |
|
|
- **Optimization**: Adam optimizer with categorical cross-entropy loss |
|
|
- **Epochs**: 25 |
|
|
- **Batch Size**: 32 |
|
|
|
|
|
## Performance Metrics |
|
|
|
|
|
- **Training Accuracy**: 95% |
|
|
- **Validation Accuracy**: 92% |
|
|
- **Loss**: Monitored using validation loss to prevent overfitting |
|
|
|
|
|
## Usage |
|
|
|
|
|
To use the TRASHPRED model for inference: |
|
|
|
|
|
```python |
|
|
import tensorflow as tf |
|
|
from tensorflow.keras.preprocessing import image |
|
|
import numpy as np |
|
|
|
|
|
# Load the model |
|
|
model = tf.keras.models.load_model('path_to_trashpred_model.h5') |
|
|
|
|
|
# Load and preprocess the image |
|
|
img = image.load_img('path_to_image.jpg', target_size=(224, 224)) |
|
|
img_array = image.img_to_array(img) |
|
|
img_array = np.expand_dims(img_array, axis=0) / 255.0 |
|
|
|
|
|
# Predict |
|
|
predictions = model.predict(img_array) |
|
|
predicted_class = np.argmax(predictions, axis=1) |
|
|
|
|
|
print(f"Predicted class: {predicted_class}") |
|
|
Repository Structure |
|
|
|
|
|
TRASHPRED/ |
|
|
βββ model/ |
|
|
β βββ trashpred_model.h5 |
|
|
βββ datasets/ |
|
|
β βββ train/ |
|
|
β βββ validation/ |
|
|
βββ scripts/ |
|
|
β βββ train.py |
|
|
β βββ evaluate.py |
|
|
βββ README.md |
|
|
π License |
|
|
This project is licensed under the MIT License. |
|
|
|
|
|
Author |
|
|
Name: Sriram Rampelli |
|
|
|
|
|
For more projects and information, visit Sriram Rampelli's GitHub Profile. |