|
Download README.md from DeeAli/arabic-food-classifier-vit: direct link, hf CLI and curl.
- Browser
- Download file 3.02 kB
-
https://huggingface.co/DeeAli/arabic-food-classifier-vit/resolve/main/README.md
- Command line
-
hf download hf://DeeAli/arabic-food-classifier-vit/README.md
-
curl -L -o README.md https://huggingface.co/DeeAli/arabic-food-classifier-vit/resolve/main/README.md
3.02 kB
| language: en | |
| license: apache-2.0 | |
| tags: | |
| - image-classification | |
| - arabic-food | |
| - food-recognition | |
| - vision | |
| - vit | |
| datasets: | |
| - custom | |
| metrics: | |
| - accuracy | |
| model-index: | |
| - name: Arabic Food Classifier | |
| results: | |
| - task: | |
| type: image-classification | |
| name: Image Classification | |
| metrics: | |
| - type: accuracy | |
| value: 100.0 | |
| name: Test Accuracy | |
| # Arabic Food Classifier π½οΈ | |
| A Vision Transformer (ViT) model fine-tuned to recognize 10 popular Arabic dishes with **100% test accuracy**. | |
| ## Model Description | |
| This model uses Google's ViT-Base architecture, fine-tuned on a custom dataset of Arabic cuisine images. It can accurately identify: | |
| - β Arabic Coffee | |
| - π« Dates | |
| - π§ Falafel | |
| - π₯© Grilled Meat | |
| - π« Hummus | |
| - π Kabsa | |
| - π° Kunafa | |
| - π Mandi | |
| - π₯ Samboosa | |
| - π― Shawarma | |
| ## Performance | |
| **Test Accuracy: 100%** (10/10 correct predictions) | |
| Individual class performance: | |
| - Arabic Coffee: 83.0% confidence | |
| - Dates: 95.7% confidence | |
| - Falafel: 97.4% confidence | |
| - Grilled Meat: 68.7% confidence | |
| - Hummus: 88.5% confidence | |
| - Kabsa: 95.9% confidence | |
| - Kunafa: 98.8% confidence | |
| - Mandi: 53.9% confidence | |
| - Samboosa: 96.5% confidence | |
| - Shawarma: 98.7% confidence | |
| ## Usage | |
| ```python | |
| from transformers import AutoModelForImageClassification, AutoImageProcessor | |
| from PIL import Image | |
| # Load model | |
| model = AutoModelForImageClassification.from_pretrained("AhmedYasir/arabic-food-classifier-vit") | |
| processor = AutoImageProcessor.from_pretrained("AhmedYasir/arabic-food-classifier-vit") | |
| # Load and process image | |
| image = Image.open("food.jpg") | |
| inputs = processor(image, return_tensors="pt") | |
| # Predict | |
| outputs = model(**inputs) | |
| predicted_class = outputs.logits.argmax(-1).item() | |
| classes = ['arabic_coffee', 'dates', 'falafel', 'grilled_meat', 'hummus', | |
| 'kabsa', 'kunafa', 'mandi', 'samboosa', 'shawarma'] | |
| print(f"Predicted: {classes[predicted_class]}") | |
| ``` | |
| ## Training Details | |
| - **Base Model:** google/vit-base-patch16-224 | |
| - **Fine-tuning Method:** Full fine-tuning | |
| - **Dataset:** 992 images (custom Arabic food dataset) | |
| - Train: 692 images | |
| - Validation: 144 images | |
| - Test: 156 images | |
| - **Training:** | |
| - Epochs: 3 | |
| - Batch Size: 16 | |
| - Learning Rate: 5e-5 | |
| - Optimizer: AdamW | |
| - **Hardware:** NVIDIA GPU | |
| ## Limitations | |
| - Trained on specific Arabic dishes; may not generalize to all regional variations | |
| - Best performance on well-lit, clear images | |
| - Limited to 10 dish categories | |
| ## Author | |
| **Ahmed Yasir** | |
| - Building AI/ML systems | |
| - Focus on Arabic language and cultural applications | |
| - [LinkedIn](https://www.linkedin.com/in/ahmed-yasir-907561206/) | [GitHub](https://github.com/ahmedyasir779) | |
| ## Citation | |
| ```bibtex | |
| @misc{arabic-food-classifier-2025, | |
| author = {Ahmed Yasir}, | |
| title = {Arabic Food Classifier: Vision Transformer for Arabic Cuisine Recognition}, | |
| year = {2025}, | |
| publisher = {Hugging Face}, | |
| howpublished = {\url{https://huggingface.co/AhmedYasir/arabic-food-classifier-vit}} | |
| } | |
| ``` | |
| --- | |
| Built with β€οΈ in Saudi Arabia πΈπ¦ |