Instructions to use 240519P/snapchef-edibility-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use 240519P/snapchef-edibility-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://240519P/snapchef-edibility-classifier") - Notebooks
- Google Colab
- Kaggle
| library_name: keras | |
| pipeline_tag: image-classification | |
| tags: | |
| - tensorflow | |
| - keras | |
| - efficientnet | |
| - food-waste | |
| - image-classification | |
| # SnapChef Edibility Classifier | |
| This model classifies loose food images into two categories: | |
| - Edible | |
| - Inedible | |
| ## Model Architecture | |
| The model uses EfficientNet-B0 with transfer learning | |
| The original pretrained layers were frozen during the first training stage | |
| The final 20 EfficientNet-B0 layers were later fine tuned using a lower learning rate | |
| ## Optimisation | |
| The model was improved using: | |
| - Data augmentation | |
| - Dropout | |
| - Early stopping | |
| - Learning rate reduction | |
| - Fine tuning | |
| - Hard example retraining | |
| Hard example retraining was used after a fresh red apple was incorrectly classified as inedible during real world testing | |
| ## Performance | |
| - Final validation accuracy: 96 percent | |
| - Final validation loss: 0.1364 | |
| - Test accuracy before hard example retraining: 93.33 percent | |
| ## Labels | |
| - 0 = Edible | |
| - 1 = Inedible | |
| ## Input | |
| The model accepts RGB food images resized to 224 by 224 pixels | |
| ## Intended Use | |
| This model is designed for the SnapChef food waste reduction application | |
| It helps users estimate whether loose food appears edible or inedible based on an uploaded image | |
| ## Limitations | |
| The model may make incorrect predictions for food types or visual conditions that were not sufficiently represented in the training dataset | |
| Predictions should not replace proper food safety inspection or professional advice |