Instructions to use Stefaron/trash-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use Stefaron/trash-classifier with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://Stefaron/trash-classifier") - Notebooks
- Google Colab
- Kaggle
| license: mit | |
| datasets: | |
| - garythung/trashnet | |
| language: | |
| - en | |
| metrics: | |
| - accuracy | |
| - confusion_matrix | |
| - f1 | |
| # Trash Classifier Model | |
| This model is a fine-tuned ResNet50 for classifying trash images into categories such as plastic, paper, glass, metal, and others. | |
| ## Dataset | |
| - Dataset: [TrashNet](https://huggingface.co/datasets/garythung/trashnet) | |
| - Number of Classes: 6 (Plastic, Metal, Paper, Glass, Cardboard, Trash) | |
| ## Model Details | |
| - **Base Model**: ResNet50 (pretrained on ImageNet) | |
| - **Fine-tuning**: Input layer adjusted for 6 classes. | |
| - **Input Shape**: (384, 384, 3) | |
| - **Learning Rate**: 0.0001 | |
| - **Optimizer**: Adam | |
| ## Performance | |
| - **Accuracy F1-Scores**: 92% | |
| ## How to Use | |
| Load the model and use it for inference: | |
| ```python | |
| import tensorflow as tf | |
| model = tf.keras.models.load_model("Stefaron/trash-classifier/best_model.keras") | |