Smartphone clip-on microscopes turn everyday devices into low-cost, portable imaging systems that can even reveal fungal structures at the microscopic level, enabling mold inspection beyond unaided visual checks. In this paper, we introduce MobileMold, an open smartphone-based microscopy dataset for food mold detection and food classification. MobileMold contains 4,941 handheld microscopy images spanning 11 food types, 4 smartphones, 3 microscopes, and diverse real-world conditions. Beyond the dataset release, we establish baselines for (i) mold detection and (ii) food-type classification, including a multi-task setting that predicts both attributes. Across multiple pretrained deep learning architectures and augmentation strategies, we obtain near-ceiling performance (accuracy = 0.9954, F1 = 0.9954, MCC = 0.9907), validating the utility of our dataset for detecting food spoilage. To increase transparency, we complement our evaluation with saliency-based visual explanations highlighting mold regions associated with the model's predictions. MobileMold aims to contribute to research on accessible food-safety sensing, mobile imaging, and exploring the potential of smartphones enhanced with attachments.
Figures & tables
Figure 1. Effective field of view comparison using millimeter paper. Both images are cropped according to the preprocessing pipeline and show an effective FOV of 11mm×11mm .
Figure 2. Typical data acquisition setup mimicking consumer use. A smartphone equipped with the Apexel 100× attachment is held manually over a carrot sample.
Figure 3. MobileMold per-food distribution of mold vs. no mold .
Figure 4. Samples of MobileMold.
Model
ACC
F1
AUC
PR AUC
Kappa
MCC
DenseNet
0.9859
0.9858
0.9995
0.9995
0.9718
0.9720
MobileNet
0.9836
0.9838
0.9992
0.9992
0.9671
0.9674
Resnet
0.9648
0.9650
0.9965
0.9965
0.9296
0.9297
VGG
0.9859
0.9860
0.9993
0.9993
0.9718
0.9719
ShuffleNet
0.9742
0.9740
0.9933
0.9913
0.9484
0.9485
Swin
0.9883
0.9884
0.9989
0.9984
0.9765
0.9768
Table 1. Model comparison on the MobileMold test set.
Model
ACC
F1
AUC
PR AUC
Kappa
MCC
None
0.9883
0.9884
0.9989
0.9984
0.9765
0.9768
Flip + Rotation
0.9953
0.9953
0.9999
0.9999
0.9906
0.9907
TrivialAugment
0.9953
0.9953
0.9996
0.9996
0.9906
0.9906
RandAugment
0.9930
0.9929
0.9998
0.9998
0.9859
0.9859
AutoAugment
0.9906
0.9907
0.9995
0.9995
0.9812
0.9813
AugMix
0.9930
0.9929
0.9998
0.9998
0.9859
0.9859
Table 2. Augmentation comparison on the MobileMold test set for Swin Transformer.
Model
ACC
F1
AUC
PR AUC
Kappa
MCC
None
0.9836
0.9838
0.9993
0.9993
0.9672
0.9675
Flip + Rotation
0.9695
0.9695
0.9978
0.9979
0.9390
0.9390
TrivialAugment
0.9907
0.9907
0.9999
0.9999
0.9813
0.9813
RandAugment
0.9907
0.9907
0.9995
0.9995
0.9813
0.9813
AutoAugment
0.9883
0.9883
0.9996
0.9996
0.9766
0.9766
AugMix
0.9954
0.9954
0.9999
0.9999
0.9907
0.9907
Table 3. Augmentation comparison on the MobileMold test set for MobileNet.
Model
Task
ACC
F1 (macro)
AUC (OvR)
Kappa
MCC
Swin
Mold
0.9883
0.9883
0.9998
0.9765
0.9766
Food
1.0000
1.0000
1.0000
1.0000
1.0000
MobileNet
Mold
0.9906
0.9906
0.9997
0.9812
0.9812
Food
0.9977
0.9964
1.0000
0.9973
0.9973
Table 4. Test performance for multitask learning on mold detection (binary) and food type classification (multiclass). F1 is macro-averaged, multiclass AUC is reported using One-versus-rest.
Figure 5. Saliency maps of MobileNet for 3 random samples of the test set with mold.
Figure 6. Main screen interface (left) and analysis screen showing mold detection results (right) of our app.
Department of Biological and Agricultural Engineering, University of Arkansas, Fayetteville, AR · Department of Food Science, University of Arkansas, Fayetteville, AR