TinyML-Sensor for Shelf Life Estimation of Fresh Date Fruits
Abstract
:1. Introduction
- Assess the physicochemical attributes of date fruits throughout their storage period in various modified atmospheres and determine the shelf life for each storage condition.
- Develop a low-cost, fast inference, and portable shelf life estimator using a TinyML-assisted 18-channel spectrometer.
- Develop real-time predictive regression models trained from Edge Impulse utilizing the reflectance property to predict the shelf life of fresh dates.
- Validate the results obtained using the developed predictive models against the observed laboratory results.
2. Materials and Methods
2.1. Sample Collection and Preparation
2.2. Physicochemical Attributes Measurements
2.3. Characteristics of Low-Cost Multiband Sensor
2.4. Need for ML Models in Enhancing Food Sustainability
2.5. Computing Choices for ML Model
2.6. Need for Tiny Machine Learning
2.7. How to Implement TinyML?
- TensorFlow Lite for mobile-based applications
- PyTorch Mobile
- Tensor Flow Lite for Microcontrollers (TFLM)
2.8. TinyML Development Using Spectral Sensor and Edge Impulse Platform
2.9. Architecture of SSLED
2.10. Structure of Neural Network Used for Spectral Shelf Life Estimator for Dates (SSLED)
2.11. Model Evaluation
3. Results and Discussion
3.1. Major Attributes for Shelf Life
3.2. Major Attributes
3.3. Datasets for TinyML Model Development
3.4. TinyML Model Development
4. Conclusions
5. Future Works
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Nomenclature
A. U. | Arbitrary Unit |
AI | Artificial Intelligence |
ANN | Artificial Neural Network |
CNN | Convolutional Neural Network |
DT | Decision Trees |
ET | Ensemble Technique |
GI | Glycemic Index |
IoT | Internet of Things |
IR | Infrared Red |
ITSBLERP | Inference, Training, Scalability, Bandwidth, Latency, Economics, Reliability, and Privacy Characteristics |
K-MC | K-Means Clustering |
K-NN | K-Nearest Neighbor |
LDA | Linear Discriminant Analysis |
LI | Lifelong Learning (Ll) |
LR | Linear Regression |
LSTM | Long Short-Term Memory |
MAE | Mean Absolute Error |
MAP | Modified Atmosphere Packaging |
MC | Moisture Content |
ML | Machine Learning |
NB | Naïve Bayes |
NIR | Near-Infrared Red |
PCA | Principal Component Analysis |
MAPE | Mean absolute percentage error |
RF | Random Forest |
RLM | Reinforcement Learning Models |
RMSE | Root Mean Square Error |
RNN | Recurrent Neural Network |
SC | Sugar Content |
SSLED | Spectral Shelf Life Estimator For Dates |
SVM | Support Vector Machines |
SWNIR | Short-Wave Near-Infrared |
TC | Tannin Content |
TFLM | Tensor Flow Lite for Microcontrollers |
TinyML | Tiny Machin Learning |
TSS | Total Soluble Solids |
wa | Water Activity |
Xgboost | Extreme Gradient Boosting |
References
- United Nation Environment Programme Food Waste Index Report 2021. Available online: https://wedocs.unep.org/bitstream/handle/20.500.11822/35280/FoodWaste.pdf (accessed on 1 April 2023).
- Chao, C.C.T.; Krueger, R.R. The Date Palm (Phoenix dactylifera L.): Overview of Biology, Uses, and Cultivation. HortScience 2007, 42, 1077–1082. [Google Scholar] [CrossRef] [Green Version]
- Dhehibi, B.; Ben Salah, M.; Frija, A. Date Palm Value Chain Analysis and Marketing Opportunities for the Gulf Cooperation Council (GCC) Countries. In Agricultural Economics—Current Issues; Kulshreshtha, S., Ed.; IntechOpen: Rijeka, Croatia, 2019; pp. 11–17. [Google Scholar]
- Mirghani, H.O. Dates Fruits Effects on Blood Glucose among Patients with Diabetes Mellitus: A Review and Meta-Analysis. Pak. J. Med. Sci. 2021, 37, 1230–1236. [Google Scholar] [CrossRef] [PubMed]
- Alkaabi, J.M.; Al-Dabbagh, B.; Ahmad, S.; Saadi, H.F.; Gariballa, S.; Ghazali, M. Al Glycemic Indices of Five Varieties of Dates in Healthy and Diabetic Subjects. Nutr. J. 2011, 10, 59. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- AlGeffari, M.A.; Almogbel, E.S.; Alhomaidan, H.T.; ElMergawi, R.; Barrimah, I.A. Glycemic Indices, Glycemic Load and Glycemic Response for Seventeen Varieties of Dates Grown in Saudi Arabia. Ann. Saudi Med. 2016, 36, 397–403. [Google Scholar] [CrossRef] [Green Version]
- Gallagher, M.J.S.J.S.; Mahajan, P.V.V. The Stability and Shelf Life of Fruit and Vegetables. In Food and Beverage Stability and Shelf Life; Kilcast, D., Subramaniam, P., Eds.; Woodhead Publishing: Cambridge, UK, 2011; pp. 641–656. ISBN 9781845697013. [Google Scholar]
- Thompson, A.K.A.K. Fruit and Vegetable Storage. In Food, Health and Nutrition; SpringerBriefs in Food, Health, and Nutrition; Springer International Publishing: Cham, Switzerland, 2016; pp. 1–126. ISBN 978-3-319-23590-5. [Google Scholar]
- Suriati, L.; Utama, I.M.S.; Harjosuwono, B.A.; Wayan Gunam, I.B. Physicochemical Characteristics of Fresh-Cut Tropical Fruit during Storage. Int. J. Adv. Sci. Eng. Inf. Technol. 2020, 10, 1731–1736. [Google Scholar] [CrossRef]
- Giovenzana, V.; Tugnolo, A.; Casson, A.; Guidetti, R.; Beghi, R. Application of Visible-near Infrared Spectroscopy to Evaluate the Quality of Button Mushrooms. J. Near Infrared Spectrosc. 2019, 27, 38–45. [Google Scholar] [CrossRef]
- Beghi, R.; Giovenzana, V.; Brancadoro, L.; Guidetti, R. Rapid Evaluation of Grape Phytosanitary Status Directly at the Check Point Station Entering the Winery by Using Visible/near Infrared Spectroscopy. J. Food Eng. 2017, 204, 46–54. [Google Scholar] [CrossRef]
- Teena, M.A.; Manickavasagan, A.; Ravikanth, L.; Jayas, D.S. Near Infrared (NIR) Hyperspectral Imaging to Classify Fungal Infected Date Fruits. J. Stored Prod. Res. 2014, 59, 306–313. [Google Scholar] [CrossRef]
- Walsh, K.B.; Blasco, J.; Zude-Sasse, M.; Sun, X. Visible-NIR ‘Point’ Spectroscopy in Postharvest Fruit and Vegetable Assessment: The Science behind Three Decades of Commercial Use. Postharvest Biol. Technol. 2020, 168, 111246. [Google Scholar] [CrossRef]
- Dutta, J.; Deshpande, P.; Rai, B. AI-Based Soft-Sensor for Shelf Life Prediction of ‘Kesar’ Mango. SN Appl. Sci. 2021, 3, 657. [Google Scholar] [CrossRef]
- Pampuri, A.; Tugnolo, A.; Giovenzana, V.; Casson, A.; Pozzoli, C.; Brancadoro, L.; Guidetti, R.; Beghi, R. Application of a Cost-Effective Visible/Near Infrared Optical Prototype for the Measurement of Qualitative Parameters of Chardonnay Grapes. Appl. Sci. 2022, 12, 4853. [Google Scholar] [CrossRef]
- Suzuki, M.; Masuda, K.; Asakuma, H.; Takeshita, K.; Baba, K.; Kubo, Y.; Ushijima, K.; Uchida, S.; Akagi, T. Deep Learning Predicts Rapid Over-Softening and Shelf Life in Persimmon Fruits. Hortic. J. 2022, 91, 408–415. [Google Scholar] [CrossRef]
- Albert-Weiss, D.; Osman, A. Interactive Deep Learning for Shelf Life Prediction of Muskmelons Based on an Active Learning Approach. Sensors 2022, 22, 414. [Google Scholar] [CrossRef] [PubMed]
- Shao, Y.Y.; Wang, Y.X.; Xuan, G.T.; Gao, Z.M.; Liu, Y.; Han, X.; Hu, Z.C. Hyperspectral Imaging Technique for Estimating the Shelf-Life of Kiwifruits. Guang Pu Xue Yu Guang Pu Fen ** Machine Learning-Based Intelligent Control System for Performance Optimization of Solar PV-Powered Refrigerators. Sustainability 2023, 15, 6911. [Google Scholar] [CrossRef]
- Kapoor, A. Hands-On Artificial Intelligence for IoT: Expert Machine Learning and Deep Learning Techniques for Develo** Smarter IoT Systems; Packt Publishing Ltd.: Birmingham, UK, 2019. [Google Scholar]
- Saha, D.; Manickavasagan, A. Machine Learning Techniques for Analysis of Hyperspectral Images to Determine Quality of Food Products: A Review. Curr. Res. Food Sci. 2021, 4, 28–44. [Google Scholar] [CrossRef] [PubMed]
- Wang, M.; Xu, Y.; Yang, Y.; Mu, B.; Nikitina, M.A.; **ao, X. Vis/NIR Optical Biosensors Applications for Fruit Monitoring. Biosens. Bioelectron. X 2022, 11, 100197. [Google Scholar] [CrossRef]
- Jagtap, A.D.; Kawaguchi, K.; Karniadakis, G.E. Adaptive Activation Functions Accelerate Convergence in Deep and Physics-Informed Neural Networks. J. Comput. Phys. 2020, 404, 109136. [Google Scholar] [CrossRef] [Green Version]
Sensors | Wavelengths |
---|---|
AS72653 | 410 435 460 485 510 535 |
AS72652 | 560 585 645 705 900 940 |
AS72651 | 610 680 730 760 810 860 |
Task | Activities | Models |
---|---|---|
Preharvest (Health of Crop) | Soil, seed quality, fertilizer/pesticide application, pruning, cultivar selection, genetic and environmental conditions, irrigation, crop load, weed detection, and disease detection. | Artificial Neural Network (ANN), Fuzzy logic, decision trees, Naïve Bayes, k-means clustering, support vector machines (SVM), random forest (RF), k-Nearest Neighbor (k-NN), and XGBoost, Ensemble technique [35,39,40,41,42,43,44,45,46]. |
Harvesting | Fruit/crop size, skin color, firmness, taste, quality, maturity stage, market window, fruit detection, and classification. | Convolutional neural network (CNN), Resnet, Mobilenet, Densenet, long-short-term memory (LSTM), Recurrent Neural Network (RNN), Alexnet, LeNet, Linear Discriminant Analysis (LDA), and Principal Component Analysis (PCA) [12,16,22,23,25,27,36,39,47,48,49] |
Post Harvesting | Factors affecting the fruit shelf-life include temperature, humidity, moisture conditions, gasses used in fruit containers, usage of chemicals in postharvest and fruit handling processes to retain quality, and fruit grading as per quality. | Linear Regression (LR), RNN, LSTM. Reinforcement Learning Models [47,50,51,52,53,54,55]. |
Parameters | Cloud AI Computing | Edge AI Computing |
---|---|---|
Inference time | -- | ++ |
Training time | ++ | -- |
Scalability | ++ | + |
Bandwidth | -- | ++ |
Latency | -- | +++ |
Economics | - | ++ |
Reliability | - | ++ |
Privacy | --- | +++ |
Maturity Stage of Date Fruit | The Mean Value of Major Attributes of Dates | ||||
---|---|---|---|---|---|
pH | TSS (Brix) | Sugar (%) | MC (%) | Tannin (%) | |
Khalal | 5.30 | 24.86 | 24.96 | 71.47 | 6.19 |
Rutab | 6.15 | 51.29 | 52.02 | 46.54 | 1.05 |
Tamr | 6.64 | 60.58 | 63.35 | 16.94 | 0.3 |
Major Attribute | Wavelength in nm | |
---|---|---|
Number | Terminology/Name | |
1 | MC-SWNIR | 535, 705, 940 |
2 | pH-SWNIR | 510, 680, 900 |
3 | Sugar-SWNIR | 460, 645, 810 |
4 | Tan-SWNIR | 560, 585, 610 |
5 | TSS-SWNIR | 410, 560, 730 |
MC-SWNIR | pH-SWNIR | TSS-SWNIR | Sugar-SWNIR | Tan-SWNIR | Shelflife |
---|---|---|---|---|---|
1087 | 280 | 787 | 797 | 430 | 0 |
1065 | 282 | 797 | 807 | 417 | 1 |
1043 | 285 | 808 | 817 | 403 | 2 |
1021 | 287 | 819 | 827 | 388 | 3 |
999 | 289 | 829 | 837 | 376 | 4 |
977 | 292 | 840 | 847 | 360 | 5 |
955 | 294 | 850 | 857 | 349 | 6 |
933 | 297 | 861 | 867 | 333 | 7 |
911 | 299 | 872 | 877 | 322 | 8 |
889 | 302 | 882 | 887 | 305 | 9 |
867 | 304 | 893 | 897 | 293 | 10 |
845 | 307 | 903 | 907 | 277 | 11 |
823 | 309 | 914 | 917 | 259 | 12 |
801 | 312 | 924 | 927 | 243 | 13 |
779 | 314 | 935 | 937 | 231 | 14 |
Parameters | Specifications | |||||||
---|---|---|---|---|---|---|---|---|
Model Type | Sequential | |||||||
Input layer | 15 major features + 3 (Vacuum, MAP2, MAP1) | |||||||
First level Hidden Dense layer | 20 neurons | |||||||
Second level Hidden Dense Layer | 10 neurons | |||||||
Dropout rate | 0.2 | |||||||
Output Layer | 1 neuron (Y-Predicted, no activation function) | |||||||
Learning Rate | 0.005 | |||||||
Activation function for all layers | ReLu | |||||||
Batch Size | 32 | |||||||
Epochs | 100 | |||||||
Optimizer | Adam | |||||||
Loss function | MSE (Mean Squared Error) | |||||||
Number of Training Cycles | 100 | |||||||
Treatments | VSB (5) | VSB (24) | MAP2(5) | MAP2(24) | MAP1(5) | MAP1(2) | Unsealed (5) | Unsealed (24) |
Training Dataset (80%) | 960 | 706 | 706 | 448 | 416 | 272 | 240 | 120 |
Testing and Validation Dataset (20%) | 240 | 178 | 178 | 112 | 104 | 68 | 60 | 30 |
Packing Type | Temperature | Threshold | |||||
---|---|---|---|---|---|---|---|
Metrics | 1 | 1.25 | 1.5 | 1.75 | 2 | ||
VSB | 5 | MAPE | 89.39 | 96.6 | 97.87 | 98.3 | 98.3 |
RMSE | 0.39 | 0.39 | 0.39 | 0.39 | 0.39 | ||
24 | MAPE | 96.65 | 96.65 | 99.44 | 100 | 100 | |
RMSE | 0.23 | 0.23 | 0.23 | 0.23 | 0.23 | ||
MAP2 | 5 | MAPE | 85.8 | 97.73 | 100 | 100 | 100 |
RMSE | 0.39 | 0.39 | 0.39 | 0.39 | 0.39 | ||
24 | MAPE | 97.13 | 100 | 100 | 100 | 100 | |
RMSE | 0.15 | 0.15 | 0.15 | 0.15 | 0.15 | ||
MAP1 | 5 | MAPE | 83.65 | 90.38 | 96.15 | 96.15 | 96.15 |
RMSE | 0.61 | 0.61 | 0.61 | 0.61 | 0.61 | ||
24 | MAPE | 76.4 | 88.2 | 92.18 | 94.16 | 96.12 | |
RMSE | 0.68 | 0.68 | 0.68 | 0.68 | 0.68 | ||
Unsealed | 5 | MAPE | 75.2 | 84.67 | 92.76 | 94.1 | 95.2 |
RMSE | 0.69 | 0.69 | 0.69 | 0.69 | 0.69 | ||
24 | MAPE | 86.36 | 93.18 | 93.18 | 95.45 | 100 | |
RMSE | 0.65 | 0.65 | 0.65 | 0.65 | 0.65 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Srinivasagan, R.; Mohammed, M.; Alzahrani, A. TinyML-Sensor for Shelf Life Estimation of Fresh Date Fruits. Sensors 2023, 23, 7081. https://doi.org/10.3390/s23167081
Srinivasagan R, Mohammed M, Alzahrani A. TinyML-Sensor for Shelf Life Estimation of Fresh Date Fruits. Sensors. 2023; 23(16):7081. https://doi.org/10.3390/s23167081
Chicago/Turabian StyleSrinivasagan, Ramasamy, Maged Mohammed, and Ali Alzahrani. 2023. "TinyML-Sensor for Shelf Life Estimation of Fresh Date Fruits" Sensors 23, no. 16: 7081. https://doi.org/10.3390/s23167081