Binary image classifier: food_or_drink vs not_food_or_drink.
Part of the Nutrify pipeline. Role: Highest accuracy.
v2 Improvement
v2 adds 560,836 human-labeled FoodVision images to the 2,952,644 DataComp
training set. FoodVision samples use hard cross-entropy loss; DataComp samples use
KL distillation from SigLIP2-so400m soft labels.
Version
FoodVision Acc
FoodVision F1
Training Data
v2
98.21%
0.9883
DataComp 2,952,644 + FoodVision 560,836
v1
0.00%
0.0000
DataComp only
Δ
+98.21%
+0.9883
Cross-Model Comparison (v2, FoodVision Test — 153K images)
Training data: DataComp 2,952,644 (soft KL labels) + FoodVision 560,836 (hard CE labels)
Epochs: 5 (best blended at epoch 3)
Peak inference throughput: 2096.3 img/s
Optimizer: AdamW (head LR=1e-4, backbone LR=1e-5 after 0.5 epoch warmup)
Loss: DataComp: 0.7×KL(T=3) + 0.3×CE | FoodVision: CE
Weight Variants
Three weight files are included, each optimized for a different metric:
File
Selects by
FV Acc
DC Acc
Blended
Epoch
Use case
model.safetensors (default)
Best blended (50/50)
98.21%
92.42%
95.31%
3
Balanced — good at everything
model_best_fv.safetensors
Best FoodVision test
98.34%
92.28%
95.31%
5
On-device Nutrify deployment
model_best_dc.safetensors
Best DataComp val
98.21%
92.42%
95.31%
3
Scale-up filtering (menus, panels, recipes)
To load a specific variant:
python
1# Default (blended)2weights_path = hf_hub_download("mrdbourke/food-not-food-classifier-siglip2-v2","model.safetensors")34# Best for Nutrify on-device5weights_path = hf_hub_download("mrdbourke/food-not-food-classifier-siglip2-v2","model_best_fv.safetensors")67# Best for scale-up filtering8weights_path = hf_hub_download("mrdbourke/food-not-food-classifier-siglip2-v2","model_best_dc.safetensors")