Update README.md
Browse files
README.md
CHANGED
|
@@ -9,11 +9,13 @@ base_model:
|
|
| 9 |
pipeline_tag: image-classification
|
| 10 |
---
|
| 11 |
|
|
|
|
| 12 |
# Model Card for Food Vision Model
|
| 13 |
|
| 14 |
This model is an image classification model trained to identify different types of food from images. It was developed as part of a Food Vision project, likely utilizing transfer learning on a pre-trained convolutional neural network.
|
| 15 |
|
| 16 |
---
|
|
|
|
| 17 |
## Model Details
|
| 18 |
|
| 19 |
### Model Description
|
|
@@ -21,35 +23,37 @@ This model is an image classification model trained to identify different types
|
|
| 21 |
This model is a deep learning model for classifying food images into one of 101 categories from the Food101 dataset. It was trained using TensorFlow and likely employs a transfer learning approach, leveraging the features learned by a model pre-trained on a large dataset like ImageNet. The training process included the use of mixed precision for potentially faster training and reduced memory usage.
|
| 22 |
|
| 23 |
* **Developed by:** Based on the notebook, this seems to be a personal project or tutorial. You should replace this with the actual developer's name or organization.
|
| 24 |
-
|
| 25 |
* **Model type:** Image Classification (likely Transfer Learning with a CNN backbone)
|
| 26 |
-
|
| 27 |
* **Language(s) (NLP):** N/A (Image Classification)
|
| 28 |
-
|
| 29 |
* **License:** MIT
|
| 30 |
-
|
| 31 |
* **Finetuned from model:** EfficienntNetB0
|
| 32 |
|
| 33 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
This model is intended for classifying images of food into 101 distinct categories. Potential use cases include:
|
| 36 |
|
| 37 |
* Food recognition in mobile applications.
|
| 38 |
-
|
| 39 |
* Organizing food images in databases.
|
| 40 |
-
|
| 41 |
* Assisting in dietary tracking or recipe suggestions based on images.
|
| 42 |
|
| 43 |
-
|
| 44 |
---
|
|
|
|
| 45 |
## Limitations
|
| 46 |
|
| 47 |
* **Dataset Bias:** The model is trained on the Food101 dataset. Its performance may degrade on food images that are significantly different in style, presentation, or origin from those in the training data.
|
| 48 |
-
|
| 49 |
* **Image Quality:** Performance can be affected by image quality, lighting conditions, occlusions, and variations in food presentation.
|
| 50 |
-
|
| 51 |
* **Specificity:** While it classifies into 101 categories, it may not distinguish between very similar dishes or variations within a category.
|
| 52 |
|
|
|
|
|
|
|
| 53 |
## Evaluation
|
| 54 |
|
| 55 |
The model's performance was evaluated using standard classification metrics on a validation set from the Food101 dataset.
|
|
@@ -59,7 +63,6 @@ The model's performance was evaluated using standard classification metrics on a
|
|
| 59 |
The model was evaluated on the validation split of the Food101 dataset.
|
| 60 |
|
| 61 |
* **Food101 Dataset:** A dataset of 101 food categories, with 101,000 images. 750 training images and 250 testing images per class.
|
| 62 |
-
|
| 63 |
* **Source:** [TensorFlow Datasets](https://www.tensorflow.org/datasets/catalog/food101)
|
| 64 |
|
| 65 |
#### Factors
|
|
@@ -72,36 +75,34 @@ The primary evaluation metric used is Accuracy. A confusion matrix was also gene
|
|
| 72 |
|
| 73 |
* **Accuracy:** The proportion of correctly classified images out of the total number of images evaluated.
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
|
| 79 |
* **Confusion Matrix:** A table that visualizes the performance of a classification model. Each row represents the instances in an actual class, while each column represents the instances in a predicted class.
|
| 80 |
|
| 81 |
### Results
|
| 82 |
|
| 83 |
-
70-80%
|
| 84 |
|
| 85 |
#### Summary
|
| 86 |
|
| 87 |
-
Transfer learning helped the model achieve greater accuracy, though the model struggled with food closely related to each other indicating more data was needed. The Dataset used
|
| 88 |
|
| 89 |
---
|
|
|
|
| 90 |
## Environmental Impact
|
| 91 |
|
| 92 |
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 93 |
|
| 94 |
* **Hardware Type:** Tesla T4
|
| 95 |
-
|
| 96 |
* **Hours used:** 1 hour estimate(max)
|
| 97 |
-
|
| 98 |
* **Cloud Provider:** Google Cloud
|
| 99 |
-
|
| 100 |
* **Compute Region:** us-central
|
| 101 |
-
|
| 102 |
* **Carbon Emitted:** 80 grams of CO2eq (estimated)
|
| 103 |
|
| 104 |
---
|
|
|
|
| 105 |
## Technical Specifications
|
| 106 |
|
| 107 |
### Model Architecture and Objective
|
|
@@ -115,18 +116,14 @@ The model was trained using a Tesla T4 GPU on Google Cloud in the us-central reg
|
|
| 115 |
### Software
|
| 116 |
|
| 117 |
* TensorFlow
|
| 118 |
-
|
| 119 |
* TensorFlow Datasets
|
| 120 |
-
|
| 121 |
* NumPy
|
| 122 |
-
|
| 123 |
* Matplotlib
|
| 124 |
-
|
| 125 |
* Scikit-learn
|
| 126 |
-
|
| 127 |
* Helper functions from `helper_functions.py` (likely for plotting, data handling)
|
| 128 |
|
| 129 |
-
|
|
|
|
| 130 |
## Usage
|
| 131 |
|
| 132 |
Here's an example of how to use the model for inference on a new image. This assumes the model has been saved in a TensorFlow SavedModel format.
|
|
@@ -138,6 +135,7 @@ pip install tensorflow
|
|
| 138 |
```
|
| 139 |
|
| 140 |
Then, you can load the model and make a prediction:
|
|
|
|
| 141 |
```python
|
| 142 |
import tensorflow as tf
|
| 143 |
import matplotlib.pyplot as plt
|
|
|
|
| 9 |
pipeline_tag: image-classification
|
| 10 |
---
|
| 11 |
|
| 12 |
+
|
| 13 |
# Model Card for Food Vision Model
|
| 14 |
|
| 15 |
This model is an image classification model trained to identify different types of food from images. It was developed as part of a Food Vision project, likely utilizing transfer learning on a pre-trained convolutional neural network.
|
| 16 |
|
| 17 |
---
|
| 18 |
+
|
| 19 |
## Model Details
|
| 20 |
|
| 21 |
### Model Description
|
|
|
|
| 23 |
This model is a deep learning model for classifying food images into one of 101 categories from the Food101 dataset. It was trained using TensorFlow and likely employs a transfer learning approach, leveraging the features learned by a model pre-trained on a large dataset like ImageNet. The training process included the use of mixed precision for potentially faster training and reduced memory usage.
|
| 24 |
|
| 25 |
* **Developed by:** Based on the notebook, this seems to be a personal project or tutorial. You should replace this with the actual developer's name or organization.
|
|
|
|
| 26 |
* **Model type:** Image Classification (likely Transfer Learning with a CNN backbone)
|
|
|
|
| 27 |
* **Language(s) (NLP):** N/A (Image Classification)
|
|
|
|
| 28 |
* **License:** MIT
|
|
|
|
| 29 |
* **Finetuned from model:** EfficienntNetB0
|
| 30 |
|
| 31 |
+
### Model Sources [optional]
|
| 32 |
+
|
| 33 |
+
* **Repository:** \[More Information Needed - Link to the GitHub repository or other source code location]
|
| 34 |
+
* **Paper [optional]:** \[More Information Needed - Link to any relevant paper if applicable]
|
| 35 |
+
* **Demo [optional]:** \[More Information Needed - Link to a demo if available]
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## Uses
|
| 40 |
|
| 41 |
This model is intended for classifying images of food into 101 distinct categories. Potential use cases include:
|
| 42 |
|
| 43 |
* Food recognition in mobile applications.
|
|
|
|
| 44 |
* Organizing food images in databases.
|
|
|
|
| 45 |
* Assisting in dietary tracking or recipe suggestions based on images.
|
| 46 |
|
|
|
|
| 47 |
---
|
| 48 |
+
|
| 49 |
## Limitations
|
| 50 |
|
| 51 |
* **Dataset Bias:** The model is trained on the Food101 dataset. Its performance may degrade on food images that are significantly different in style, presentation, or origin from those in the training data.
|
|
|
|
| 52 |
* **Image Quality:** Performance can be affected by image quality, lighting conditions, occlusions, and variations in food presentation.
|
|
|
|
| 53 |
* **Specificity:** While it classifies into 101 categories, it may not distinguish between very similar dishes or variations within a category.
|
| 54 |
|
| 55 |
+
---
|
| 56 |
+
|
| 57 |
## Evaluation
|
| 58 |
|
| 59 |
The model's performance was evaluated using standard classification metrics on a validation set from the Food101 dataset.
|
|
|
|
| 63 |
The model was evaluated on the validation split of the Food101 dataset.
|
| 64 |
|
| 65 |
* **Food101 Dataset:** A dataset of 101 food categories, with 101,000 images. 750 training images and 250 testing images per class.
|
|
|
|
| 66 |
* **Source:** [TensorFlow Datasets](https://www.tensorflow.org/datasets/catalog/food101)
|
| 67 |
|
| 68 |
#### Factors
|
|
|
|
| 75 |
|
| 76 |
* **Accuracy:** The proportion of correctly classified images out of the total number of images evaluated.
|
| 77 |
|
| 78 |
+
$$
|
| 79 |
+
\text{Accuracy} = \frac{\text{Number of correct predictions}}{\text{Total number of predictions}}
|
| 80 |
+
$$
|
| 81 |
|
| 82 |
* **Confusion Matrix:** A table that visualizes the performance of a classification model. Each row represents the instances in an actual class, while each column represents the instances in a predicted class.
|
| 83 |
|
| 84 |
### Results
|
| 85 |
|
| 86 |
+
70-80% Fluctuating accuracy on validation data
|
| 87 |
|
| 88 |
#### Summary
|
| 89 |
|
| 90 |
+
Transfer learning helped the model achieve greater accuracy, though the model struggled with food closely related to each other indicating more data was needed. The Dataset used a lot but more data is still needed to differentiate between closely looking food.
|
| 91 |
|
| 92 |
---
|
| 93 |
+
|
| 94 |
## Environmental Impact
|
| 95 |
|
| 96 |
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 97 |
|
| 98 |
* **Hardware Type:** Tesla T4
|
|
|
|
| 99 |
* **Hours used:** 1 hour estimate(max)
|
|
|
|
| 100 |
* **Cloud Provider:** Google Cloud
|
|
|
|
| 101 |
* **Compute Region:** us-central
|
|
|
|
| 102 |
* **Carbon Emitted:** 80 grams of CO2eq (estimated)
|
| 103 |
|
| 104 |
---
|
| 105 |
+
|
| 106 |
## Technical Specifications
|
| 107 |
|
| 108 |
### Model Architecture and Objective
|
|
|
|
| 116 |
### Software
|
| 117 |
|
| 118 |
* TensorFlow
|
|
|
|
| 119 |
* TensorFlow Datasets
|
|
|
|
| 120 |
* NumPy
|
|
|
|
| 121 |
* Matplotlib
|
|
|
|
| 122 |
* Scikit-learn
|
|
|
|
| 123 |
* Helper functions from `helper_functions.py` (likely for plotting, data handling)
|
| 124 |
|
| 125 |
+
---
|
| 126 |
+
|
| 127 |
## Usage
|
| 128 |
|
| 129 |
Here's an example of how to use the model for inference on a new image. This assumes the model has been saved in a TensorFlow SavedModel format.
|
|
|
|
| 135 |
```
|
| 136 |
|
| 137 |
Then, you can load the model and make a prediction:
|
| 138 |
+
|
| 139 |
```python
|
| 140 |
import tensorflow as tf
|
| 141 |
import matplotlib.pyplot as plt
|