| --- |
| tags: |
| - clip |
| - waste-classification |
| - image-classification |
| - pytorch |
| - finetuned |
| license: mit |
| language: |
| - en |
| base_model: openai/clip-vit-base-patch16 |
| datasets: |
| - recyclable-and-household-waste-classification |
| metrics: |
| - accuracy |
| model-index: |
| - name: openclip-finetune-waste |
| results: |
| - task: |
| type: image-classification |
| name: Waste Classification |
| dataset: |
| type: recyclable-and-household-waste-classification |
| name: Recyclable and Household Waste Classification |
| metrics: |
| - type: accuracy |
| value: 0.9133 |
| name: Validation Accuracy |
| --- |
| |
| # Finetuned CLIP for Waste Classification |
|
|
| This model is a finetuned version of OpenAI's CLIP ViT-B/16 for waste classification. |
|
|
| ## Model Details |
|
|
| - **Model Name**: ViT-B-16 |
| - **Pretrained**: laion2b_s34b_b88k |
| - **Classes**: 30 waste categories |
| - **Validation Accuracy**: 0.9133 |
|
|
| ## Classes |
|
|
| The model can classify the following waste items: |
| aerosol_cans, aluminum_food_cans, aluminum_soda_cans, cardboard_boxes, cardboard_packaging, clothing, coffee_grounds, disposable_plastic_cutlery, eggshells, food_waste, glass_beverage_bottles, glass_cosmetic_containers, glass_food_jars, magazines, newspaper, office_paper, paper_cups, plastic_cup_lids, plastic_detergent_bottles, plastic_food_containers, plastic_shopping_bags, plastic_soda_bottles, plastic_straws, plastic_trash_bags, plastic_water_bottles, shoes, steel_food_cans, styrofoam_cups, styrofoam_food_containers, tea_bags |
|
|
| ## Usage |
|
|
| ```python |
| from clip_waste_classifier.finetuned_classifier import FinetunedCLIPWasteClassifier |
| |
| # Load model from Hugging Face Hub |
| classifier = FinetunedCLIPWasteClassifier(hf_model_id="ysfad/openclip-finetune-waste") |
| |
| # Classify image |
| result = classifier.classify_image("path/to/image.jpg") |
| print(f"Predicted: {result['predicted_item']} ({result['best_confidence']:.3f})") |
| ``` |
|
|
| ## Training |
|
|
| This model was finetuned on the [Recyclable and Household Waste Classification](https://www.kaggle.com/datasets/alistairking/recyclable-and-household-waste-classification) dataset with: |
|
|
| - 15,000 images across 30 waste categories |
| - 15 epochs of training |
| - Batch size: 16 |
| - Learning rate: 5e-6 |
| - Train/Val/Test split: 70%/10%/20% |
|
|
| ## License |
|
|
| This model is released under the MIT License. |
|
|