Machine Learning-Based Shelf Life Estimator for Dates Using a Multichannel Gas Sensor: Enhancing Food Security
Abstract
Highlights
- A low-cost IoT system combining multichannel gas sensors and a TinyML model was developed for the real-time shelf life prediction of dates.
- The deployed model achieved 91.9% classification accuracy and an AUC of 0.98 using data collected under cold storage and ambient conditions.
- Unlike traditional visual inspection methods, this system offers a scalable and objective solution for early spoilage detection.
- This system contributes to improved cold storage decision-making, reducing postharvest losses and enhancing food supply chain resilience.
Abstract
1. Introduction
2. Materials and Methods
- (i)
- The Multichannel Gas Sensor V2: This sensor incorporates four elements, namely GM102, GM302, GM502, and GM702. This low-cost sensor was used in the experiment because each element is specifically designed to detect a particular gas or group of gases. For instance, GM102 is designed to detect hydrogen (H2), GM302 can detect carbon monoxide (CO) and nitrogen dioxide (NO2) gases, GM502 can sense ammonia (NH3) and hydrogen sulfide (H2S), while GM702 is sensitive to methane (CH4) gas.
- (ii)
- The DHT11 sensor: This was used to measure temperature and humidity. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and emits a digital signal on the data pin (no analog input pins needed).
- (iii)
- Arduino boards: This was used to design the IoT-based estimator of a variety of controllers and microprocessors. Sets of digital and analog input/output (I/O) pins can be used to connect the boards to various expansion boards and other circuits. The boards have serial communications interfaces, some of which are USB (Universal Serial Bus), and they can also be used to load programs.
- (iv)
- Standard API: Using a standard API that is also referred to as the Arduino language and is based on the processing language and utilized with a modified version of the Processing IDE, the microcontrollers can be programmed using the C and C++ programming languages.
- (v)
- TinyML kit: This contains Arduino Nano 33 BLE Sense, which integrates a combination of six or seven sensors in one shield. The Arduino Nano 33 BLE Sense combines a small form factor, a wide range of environmental sensors, and the ability to run AI with TinyML and TensorFlow Lite.
3. Results and Discussion
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Chao, 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]
- Mohammed, M.; Riad, K.; Alqahtani, N. Design of a Smart IoT-Based Control System for Remotely Managing Cold Storage Facilities. Sensors 2022, 22, 4680. [Google Scholar] [CrossRef] [PubMed] [PubMed Central]
- Liu, D.-K.; Xu, C.-C.; Guo, C.-X.; Zhang, X.-X. Sub-zero temperature preservation of fruits and vegetables: A review. J. Food Eng. 2020, 275, 109881. [Google Scholar] [CrossRef]
- Al-Yahyai, R.; Al-Kharusi, L. Physical and chemical quality attributes of freeze-stored dates. Int. J. Agric. Biol. 2012, 14, 97–100. [Google Scholar]
- Palou, L.; del Río, M.A.; Guardado, A.; Vilella-Esplá, J. Influence of induced ripening and cold storage protocols on the incidence of postharvest diseases of the date palm fruit. Acta Hortic. 2011, 894, 235–241. [Google Scholar] [CrossRef]
- Paull, R.E. Effect of temperature and relative humidity on fresh commodity quality. Postharvest Biol. Technol. 1999, 15, 263–277. [Google Scholar] [CrossRef]
- Yahia, E.M. Postharvest Technology of Perishable Horticultural Commodities; Elsevier Science: New Delhi, India, 2019; ISBN 9780128132760. [Google Scholar]
- Xue, M.; Zhang, J.; Tang, W. Optimal temperature control for quality of perishable foods. ISA Trans. 2014, 53, 542–546. [Google Scholar] [CrossRef]
- Ahmad, S.A.H.; Ab Rahman, M.N.; Muhamed, A.A. Optimal temperature in cold storage for perishable foods. In Proceedings of the 5th NA International Conference on Industrial Engineering and Operations Management, Detroit, MI, USA, 10–14 August 2020. [Google Scholar]
- Kandasamy, A.; Chinnasamy, K.; Paramasivam, S.K.; Iruthayasamy, J. Melatonin as a Ripening Inhibitor: Enhancing Shelf Life and Quality in Red Banana. J. Pineal Res. 2025, 77, e70060. [Google Scholar] [CrossRef] [PubMed]
- Zuo, X.; Wang, J.; Li, Y.; Zhang, J.; Wu, Z.; Jin, P.; Cao, S.; Zheng, Y. Recent advances in high relative humidity strategy for preservation of postharvest fruits and vegetables: A comprehensive review. Food Chem. 2025, 481, 144130. [Google Scholar] [CrossRef]
- Palipane, K.B. Good Practice for Assuring the Post-Harvest Quality of Exotic Tree Fruit Crops Produced in Jamaica—A Technical Guide; Food and Agriculture Organization of the United Nations: Rome, Italy, 2008. [Google Scholar]
- Stevanoska, S.; Davcev, D.; Jovanovska, E.M.; Mitreski, K. IoT-based system for real-time monitoring and insect detection in vineyards. In Proceedings of the MobiWac 2020—18th ACM Symposium on Mobility Management and Wireless Access, Alicante, Spain, 16–20 November 2020; pp. 133–136. [Google Scholar]
- Swaroop, P.; Reddy, Y.S.; Saif, E.S.; Joseph, M.C. The Real Time Temperature Sensing using Raspberry PI. Int. J. Innov. Res. Sci. Technol. 2015, 1, 232–237. [Google Scholar]
- Yadav, R.K. Remote Monitoring System for Cold Storage Warehouse using IOT. Int. J. Res. Appl. Sci. Eng. Technol. 2020, 8, 2810–2814. [Google Scholar] [CrossRef]
- Appasani, B.; Jha, A.V.; Ghazali, A.N.; Gupta, D.K. Analytical Modeling and Optimal Control of Cold Storage System with Large-Scale Implementation Using IoT. In Advances in Smart Grid Automation and Industry 4.0; Lecture Notes in Electrical Engineering; Springer: Singapore, 2021; Volume 693, pp. 51–59. [Google Scholar]
- Feng, H.; Zhang, M.; Liu, P.; Liu, Y.; Zhang, X. Evaluation of IoT-Enabled Monitoring and Electronic Nose Spoilage Detection for Salmon Freshness During Cold Storage. Foods 2020, 9, 1579. [Google Scholar] [CrossRef]
- Sarkar, S.; Akshatha, K.S.; Saurabh, A.; Samanvitha, B.; Sarwar, M.F. IoT Enabled Cold Supply Chain Monitoring System. In Proceedings of the 2022 IEEE 3rd Global Conference for Advancement in Technology (GCAT), Bangalore, India, 7–9 October 2022; pp. 1–6. [Google Scholar] [CrossRef]
- Popa, A.; Hnatiuc, M.; Paun, M.; Geman, O.; Hemanth, D.J.; Dorcea, D.; Son, L.H.; Ghita, S. An intelligent IoT-based food quality monitoring approach using low-cost sensors. Symmetry 2019, 11, 374. [Google Scholar] [CrossRef]
- Food Safety and Inspection Service. Available online: https://www.fsis.usda.gov/food-safety/safe-food-handling-and-preparation/food-safety-basics/how-temperatures-affect-food (accessed on 10 February 2025).
- Van Den Berg, L.; Lentz, C.P. High humidity storage of vegetables and fruits1. HortScience 1978, 13, 565–569. [Google Scholar] [CrossRef]
- Damdam, A.N.; Ozay, L.O.; Ozcan, C.K.; Alzahrani, A.; Helabi, R.; Salama, K.N. IoT-Enabled Electronic Nose System for Beef Quality Monitoring and Spoilage Detection. Foods 2023, 12, 2227. [Google Scholar] [CrossRef]
- Reni, A. Automatic Data Acquisition and Monitoring Device to Indicate the Freshness of Milk during Transportation. Int. J. Res. Appl. Sci. Eng. Technol. 2021, 9, 2641–2647. [Google Scholar] [CrossRef]
- Bermudez-Aguirre, D. Ultrasound: Advances in Food Processing and Preservation; Academic Press: Cambridge, MA, USA; Elsevier: San Diego, CA, USA, 2017. [Google Scholar]
- Al-Dosary, N.H. Role of the Saw-toothed grain beetle (Oryzaephilus surinamensis L.) (Coleoptera: Silvanidae) in date palm fruit decay at different temperatures. Basrah J. Date Palm Res. 2009, 8, 1–14. [Google Scholar]
- Chemat, F.; Khan, M.K. Applications of ultrasound in food technology: Processing, preservation and extraction. Ultrason. Sonochem. 2011, 18, 813–835. [Google Scholar] [CrossRef]
- Rajan, R.; Pandit, A. Correlations to predict droplet size in ultrasonic atomisation. Ultrasonics 2001, 39, 235–255. [Google Scholar] [CrossRef]
- Suzannah, S.; Hii, C.L.; Maznah, I. Processing and Drying of Foods, Vegetables and Fruits. In Proceedings of the International Symposia on Processing and Drying of Foods, Vegetables and Fruits (ISPDFVF), Kuala Lumpur, Malaysia, 18–19 June 2012. [Google Scholar]
- Gamea, G.R.; Aboamera, M.A.; Mohmed, M.E.; Mohammed, M. Design and Manufacturing of Prototype for Orange Grading Using Phototransistor. Misr J. Agric. Eng. 2011, 28, 505–523. [Google Scholar] [CrossRef]
- Rahman, M.S. Data and Models of Density, Shrinkage, and Porosity. In Food Properties Handbook; CRC Press: Boca Raton, FL, USA, 2009; pp. 433–516. [Google Scholar]
- Benkeblia, N. Storage technologies for date palm fruits (Phoenix dactylifera L.): Current and potential techniques. Acta Hortic. 2013, 994, 151–154. [Google Scholar] [CrossRef]
- Mohammed, M.; Alqahtani, N.; El-Shafie, H. Development and Evaluation of an Ultrasonic Humidifier to Control Humidity in a Cold Storage Room for Postharvest Quality Management of Dates. Foods 2021, 10, 949. [Google Scholar] [CrossRef] [PubMed]
- Mohammed, M.; Munir, M.; Aljabr, A. Prediction of Date Fruit Quality Attributes during Cold Storage Based on Their Electrical Properties Using Artificial Neural Networks Models. Foods 2022, 11, 1666. [Google Scholar] [CrossRef] [PubMed]
- Mohammed, M.; Srinivasagan, R.; Alzahrani, A.; Alqahtani, N.K. Machine-Learning-Based Spectroscopic Technique for Non-Destructive Estimation of Shelf Life and Quality of Fresh Fruits Packaged under Modified Atmospheres. Sustainability 2023, 15, 12871. [Google Scholar] [CrossRef]
- Arm Limited. Edge Impulse. Available online: https://www.arm.com/partners/ai-ecosystem-catalog/edge-impulse (accessed on 5 March 2025).
Module | Model | Manufacturer | Function | Key Specs/Notes |
---|---|---|---|---|
Microcontroller | Arduino Nano 33 BLE Sense | Arduino | Central control, data processing | BLE, multiple onboard sensors, TinyML-ready |
Gas Sensor | Multichannel Gas Sensor V2 | Seeed Studio | Detects CH4, NO2, CO, NH3, H2, H2S | GM102, GM302, GM502, GM702 elements |
Humidity and Temp Sensor | DHT11 | Aosong Electronics | Measures temperature and relative humidity | Digital output, low cost |
Real-Time Clock Module | DS3231 | Adafruit | Timestamps data logs | I2C, battery-backed |
SD Card Module | MicroSD Card Adapter | Generic | Local data storage | SPI Interface |
OLED Display | SSD1306 0.96″ | Adafruit/Generic | Displays real-time shelf life estimates | I2C, 128 × 64 pixels |
Cloud Platform | Edge Impulse | Edge Impulse Inc. | ML model training and deployment | Edge ML support |
Samples | GM102 | GM302 | GM502 | GM702 | Temperature | Humidity |
---|---|---|---|---|---|---|
1 | 429 | 198 | 153 | 228 | 22.6 | 33 |
2 | 424 | 194 | 150 | 227 | 22.6 | 33 |
3 | 421 | 191 | 147 | 227 | 22.2 | 33 |
4 | 418 | 188 | 145 | 226 | 22.2 | 33 |
5 | 420 | 188 | 145 | 227 | 22.2 | 33 |
6 | 422 | 189 | 147 | 228 | 23 | 33 |
7 | 424 | 192 | 149 | 230 | 23.4 | 33 |
8 | 426 | 193 | 151 | 230 | 23.8 | 33 |
9 | 428 | 194 | 152 | 229 | 24.1 | 33 |
10 | 428 | 196 | 154 | 230 | 24.5 | 33 |
11 | 423 | 194 | 152 | 227 | 23.8 | 33 |
12 | 419 | 191 | 148 | 225 | 23 | 33 |
13 | 417 | 188 | 146 | 225 | 22.2 | 33 |
14 | 413 | 186 | 143 | 223 | 22.2 | 33 |
15 | 413 | 184 | 142 | 223 | 21.8 | 33 |
16 | 416 | 184 | 143 | 224 | 22.6 | 33 |
17 | 417 | 186 | 144 | 226 | 23 | 33 |
18 | 419 | 188 | 147 | 227 | 23.4 | 33 |
19 | 420 | 189 | 148 | 227 | 23.8 | 33 |
20 | 421 | 190 | 150 | 227 | 24.1 | 33 |
21 | 421 | 190 | 150 | 226 | 24.1 | 33 |
22 | 415 | 187 | 147 | 222 | 23 | 33 |
23 | 413 | 185 | 145 | 222 | 22.6 | 33 |
24 | 410 | 183 | 141 | 221 | 22.2 | 33 |
25 | 408 | 181 | 139 | 219 | 21.8 | 33 |
26 | 409 | 180 | 139 | 220 | 21.8 | 34 |
27 | 411 | 181 | 140 | 222 | 22.6 | 33 |
28 | 413 | 183 | 142 | 223 | 23 | 33 |
29 | 414 | 184 | 143 | 222 | 23.4 | 33 |
30 | 416 | 186 | 145 | 224 | 23.8 | 33 |
31 | 417 | 187 | 146 | 225 | 24.1 | 33 |
32 | 415 | 187 | 147 | 222 | 23.8 | 33 |
33 | 411 | 184 | 144 | 220 | 23 | 33 |
34 | 407 | 182 | 141 | 219 | 22.6 | 33 |
35 | 405 | 180 | 138 | 219 | 22.2 | 33 |
36 | 402 | 177 | 137 | 219 | 21.8 | 34 |
37 | 405 | 178 | 136 | 219 | 22.2 | 34 |
38 | 408 | 179 | 138 | 220 | 22.6 | 33 |
39 | 410 | 181 | 140 | 221 | 23 | 33 |
40 | 411 | 182 | 141 | 221 | 23.4 | 33 |
41 | 412 | 183 | 143 | 222 | 23.8 | 33 |
42 | 414 | 184 | 144 | 223 | 23.8 | 33 |
43 | 411 | 184 | 144 | 221 | 23.8 | 33 |
44 | 407 | 181 | 142 | 218 | 23 | 33 |
45 | 404 | 179 | 139 | 217 | 22.2 | 33 |
Actual vs. Predicted | Shelf Life High Type A | Shelf Life High Type B | Shelf Life Low |
---|---|---|---|
Shelf Life High Type A | 89.5% (correct) | 5.3% (misclassified) | 5.3% (misclassified) |
Shelf Life High Type B | 0% (misclassified) | 93.9% (correct) | 6.1% (misclassified) |
Shelf Life Low | 0% (misclassified) | 12.3% (misclassified) | 87.7% (correct) |
Metric | Value |
---|---|
Area Under ROC Curve (AUC) | 0.98 |
Weighted Average Precision | 0.92 |
Weighted Average Recall | 0.92 |
Weighted Average F1 Score | 0.92 |
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. |
© 2025 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
Haque, A.U.; Al Haque, M.A.; Alabduladheem, A.; Al Mulla, A.; Almulhim, N.; Srinivasagan, R. Machine Learning-Based Shelf Life Estimator for Dates Using a Multichannel Gas Sensor: Enhancing Food Security. Sensors 2025, 25, 4063. https://doi.org/10.3390/s25134063
Haque AU, Al Haque MA, Alabduladheem A, Al Mulla A, Almulhim N, Srinivasagan R. Machine Learning-Based Shelf Life Estimator for Dates Using a Multichannel Gas Sensor: Enhancing Food Security. Sensors. 2025; 25(13):4063. https://doi.org/10.3390/s25134063
Chicago/Turabian StyleHaque, Asrar U., Mohammad Akeef Al Haque, Abdulrahman Alabduladheem, Abubakr Al Mulla, Nasser Almulhim, and Ramasamy Srinivasagan. 2025. "Machine Learning-Based Shelf Life Estimator for Dates Using a Multichannel Gas Sensor: Enhancing Food Security" Sensors 25, no. 13: 4063. https://doi.org/10.3390/s25134063
APA StyleHaque, A. U., Al Haque, M. A., Alabduladheem, A., Al Mulla, A., Almulhim, N., & Srinivasagan, R. (2025). Machine Learning-Based Shelf Life Estimator for Dates Using a Multichannel Gas Sensor: Enhancing Food Security. Sensors, 25(13), 4063. https://doi.org/10.3390/s25134063