Next Article in Journal
Rolling Bearing Fault Diagnosis Model Based on Multi-Scale Depthwise Separable Convolutional Neural Network Integrated with Spatial Attention Mechanism
Previous Article in Journal
Attention-Enhanced CNN-LSTM Model for Exercise Oxygen Consumption Prediction with Multi-Source Temporal Features
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Machine Learning-Based Shelf Life Estimator for Dates Using a Multichannel Gas Sensor: Enhancing Food Security

by
Asrar U. Haque
1,*,
Mohammad Akeef Al Haque
2,
Abdulrahman Alabduladheem
3,
Abubakr Al Mulla
3,
Nasser Almulhim
3 and
Ramasamy Srinivasagan
3
1
Department of Computer Science, College of Computer Science and Information Technology CCSIT, King Faisal University, Al AHSA 31982, Saudi Arabia
2
Department of Networks and Operating Systems, Deanship of E-Learning and Information Technology DEIT, King Faisal University, Al AHSA 31982, Saudi Arabia
3
Department of Computer Engineering, CCSIT, King Faisal University, Al AHSA 31982, Saudi Arabia
*
Author to whom correspondence should be addressed.
Sensors 2025, 25(13), 4063; https://doi.org/10.3390/s25134063
Submission received: 3 May 2025 / Revised: 19 June 2025 / Accepted: 25 June 2025 / Published: 29 June 2025
(This article belongs to the Section Intelligent Sensors)

Abstract

Highlights

What are the main findings?
  • 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.
What are the implications of the main findings?
  • 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

It is a well-known fact that proper nutrition is essential for human beings to live healthy lives. For thousands of years, it has been considered that dates are one of the best nutrient providers. To have better-quality dates and to enhance the shelf life of dates, it is vital to preserve dates in optimal conditions that contribute to food security. Hence, it is crucial to know the shelf life of different types of dates. In current practice, shelf life assessment is typically based on manual visual inspection, which is subjective, error-prone, and requires considerable expertise, making it difficult to scale across large storage facilities. Traditional cold storage systems, whilst being capable of monitoring temperature and humidity, lack the intelligence to detect spoilage or predict shelf life in real-time. In this study, we present a novel IoT-based shelf life estimation system that integrates multichannel gas sensors and a lightweight machine learning model deployed on an edge device. Unlike prior approaches, our system captures the real-time emissions of spoilage-related gases (methane, nitrogen dioxide, and carbon monoxide) along with environmental data to classify the freshness of date fruits. The model achieved a classification accuracy of 91.9% and an AUC of 0.98 and was successfully deployed on an Arduino Nano 33 BLE Sense board. This solution offers a low-cost, scalable, and objective method for real-time shelf life prediction. This significantly improves reliability and reduces postharvest losses in the date supply chain.

1. Introduction

There is no doubt that adequate nutrition is essential for human beings to live a healthy life. It is considered that dates are one of the best nutrients for survival. Dates are the main food supplements consumed day-to-day amongst a large population across the globe. The date fruit is cultivated on 1.25 million hectares globally, yielding an annual production of 9.61 metric tons (MT). Saudi Arabia is considered to be one of the highest producers and exporters of dates. Saudi Arabia cultivates in an area equal to 0.15 million hectares, producing 1.54 MT [1]. Date palms are seasonal trees, and, hence, preserving the harvested product is much needed to maintain supply throughout the year, enhancing food security. Most of the date fruits’ palm cultivars are consumed at the fully ripened stage, known as the Tamr stage. Dates are subjected to post-harvest losses due to factors which include the following: erratic environmental conditions, insect infestation, and microbial activity.
Dates, like other stored fruit products, are usually accompanied by respiration, evaporation, and physiological changes due to moisture losses, which could induce heavy losses reaching up to 40%. Therefore, suitable storage facilities are essential for extending the shelf life of date fruits [2]. In order to make customers satisfied with the product, it is absolutely crucial to maintain freshness throughout the supply chain. Usually, cold storage provides the ambient conditions necessary to preserve the harvested dates. Relative humidity (RH), and temperature are the core parameters for sustaining the nutrient contents. Modern cold storage is used in date fruit storage, and precise control of the RH is empirically used at a small scale or at laboratory level.
Several studies have explored the impact of environmental control in cold storage on the shelf life of dates and other perishable products. These efforts primarily focus on regulating temperature and humidity to slow physiological degradation, but they often do not adapt dynamically to the actual conditions or remaining shelf life of the stored dates. Fruits are typically stored at non-freezing temperatures to preserve tissue integrity and prevent cell structure disintegration and postharvest damage [3]. Date palm fruits harvested at the Tamer stage are generally kept in storage conditions that are necessary to prolong their shelf life [4]. Key challenges during storage include fruit weight loss and microbial degradation, such as bacterial fermentation and postharvest fungal infections [5]. Low-temperature storage also helps preserve the non-esthetic quality traits of fruits, including texture, nutritional value, aroma, and flavor [6].
In the storage of fresh fruits, temperature is closely correlated with respiration rates. These rates can be reduced by lowering the temperature to an optimal threshold, depending on the specific produce. Lower respiration rates slow the kinetics of biochemical reactions, including those affecting product quality [7]. Temperature thus plays a critical role in determining the shelf life of food products by directly influencing these biochemical activities [8]. Through respiration and microbial degradation, nutrients are broken down into simpler compounds, often leading to reductions in both the quantity and quality of the stored food [9]. In the case of date fruits, weight loss and microbial spoilage—such as yeast and bacterial fermentation, as well as postharvest fungal infections—are major limiting factors for prolonged storage [5,10]. Low-temperature environments also help preserve non-esthetic quality attributes, such as texture, nutritional value, aroma, and flavor [6,11]. Therefore, dates must be kept at low temperatures immediately after harvesting to inhibit microbial growth and insect activity. Additionally, cold storage reduces the vapor pressure differential between the atmosphere and the fruit surface, effectively minimizing moisture loss [12].
Real-time environmental monitoring within cold storage facilities has become feasible through the Internet of Things (IoT) [13,14,15,16,17,18]. However, most existing IoT-based systems focus solely on environmental data collection and do not provide direct shelf life estimation. For example, the IoT-based monitoring framework proposed in [19] uses low-cost gas sensors for food quality evaluation, yet it cannot simultaneously detect multiple volatile gases released during spoilage. This limitation reduces its applicability in complex environments where multiple gas interactions are indicative of food quality deterioration.
When food is stored at refrigerator temperatures of 5 °C for a year, it is less likely to become spoiled, and the aerobic bacteria, yeast, and fungi are less active [20]. In contrast, low-temperature storage necessitates high humidity in order to prevent water loss and preserve the fruit’s characteristics. An RH of 90% is typically the most suitable for fruit storage because the majority of fungi stop growing under conditions of less than about 90% RH, and some fungi can grow at 85% RH [6,21]. Product quality suffers because of storage-specific variations in humidity and temperature in the CSR [19,22]. Unwrapped agricultural products like fruits, vegetables, and other foods are prone to lose moisture, which also reduces the product’s shelf life through dehydration and deterioration. As a result, humidification systems might be able to help cut down on these losses and reduce bacterial growth [14,23]. Controlling a high RH, ideally between 90% and 95%, could prevent water loss during the postharvest cold storage of fruits [5]. The microbial quality of agricultural products like fruits and vegetables did not change when they were humidified; this might be because drinking water contains ozone [24,25,26,27]. In most cases, food humidification systems in CSRs increase the amount of water in the air to reduce the difference between the air and the food surface’s water vapor pressures, helping to retain quality [28,29,30].
From the above discussion, it is evident that maintaining optimal temperature and RH is vital for preserving date palm fruit quality and extending its postharvest shelf life [31,32]. Accurate shelf life estimation is crucial, as it can guide the regulation of temperature and humidity within CSRs to align with the actual condition of stored dates. However, existing methods for shelf life assessment in cold storage environments are either destructive, expensive, or require invasive interventions that disrupt CSR operations. Therefore, any scalable shelf life estimation technique should be non-invasive, cost-effective, and compatible with existing storage infrastructure.
Two notable approaches exemplify the current technological direction. Mohammed et al. [33] used artificial neural networks to predict date quality based on electrical properties, achieving high accuracy but relying on frequent, contact-based LCR measurements that are unsuitable for real-time use. In another approach, Mohammed et al. [34] utilized multispectral sensors with TinyML to estimate shelf life under modified atmosphere packaging. While it is compact and non-destructive, this method depends on custom packaging and specialized hardware, limiting its deployment in standard CSRs.
To overcome these limitations, our work proposes a machine learning-based IoT architecture employing low-cost multichannel gas sensors and measuring spoilage-indicating gases such as CH4, NO2, and CO, along with temperature and RH. The system enables real-time, non-invasive shelf life estimation using edge-deployable ML models without altering the CSR environment or packaging.
We hypothesize that this combination of low-cost gas sensors and lightweight ML models can accurately classify the shelf life stage of stored dates, making it suitable for real-world deployment in cold storage facilities as well as in ambient conditions. The proposed solution offers a scalable, smart, and automated method to support supply chain efficiency and reduce postharvest food loss contributing to improved food security.
The rest of the paper is organized as follows: Section 2 outlines the materials used and methods adopted in this research. Section 3 discusses results and its significance. Section 4 presents the conclusion and suggests future research directions

2. Materials and Methods

Figure 1 shows the architecture of the overall system setup in the CSR of the Date Research Center of King Faisal University. The system contains a multichannel gas sensor to detect gas emissions. There is a humidity sensor to measure moisture levels along with a temperature sensor to track the temperature variations. These sensors collect real-time data from the CSR, where products are stored, and send it to a master microcontroller via Bluetooth Low Energy (BLE). The dates used in this experiment were harvested at the fully ripened Tamr stage and placed into CSRs. Data collection began shortly after, following setup and sample arrangement. The machine learning model was applied from the start of sensor data acquisition and remained active throughout the postharvest monitoring period, which extended over several months.
The following hardware and software components have been used:
(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.
The circuit diagram in Figure 2 illustrates a sensor-based setup built around the Arduino Nano 33 BLE microcontroller. Multiple sensors and peripherals are integrated into the system to gather and show environmental data. A multichannel gas sensor is linked to the microcontroller to detect various gases, with power supplied at 5 V and data communicated via SPI. A DHT11 sensor is wired to provide real-time humidity readings, using a DATA pin along with VCC and GND connections, as shown in Figure 2. Along with that, the circuit becomes attached to a Real-Time Clock (RTC) module for accurate timestamping of the collected data, communicating over the I2C protocol via SCL and SDA lines. Moreover, an OLED display is connected through the I2C (SCL and SDA) protocol to display the estimated shelf life of the harvested items. Last but not least, an SD card was wired through the SPI interface to store the collected data for analysis. This setup allows for the real-time monitoring of environmental conditions, with data logging capabilities and a visual display for immediate feedback, making it ideal for applications in climate control, air quality monitoring, and smart storage systems. Table 1 shows various modules and related information.
The IoT-based system was set up at the Date Palm Research Center (DPRC) at King Faisal University, Al Ahsa, Saudi Arabia, to collect valuable research data. The DPRC houses the CSR in the research laboratory, which contained racks filled with boxes of dates.
Figure 3 illustrates the experimental setup used for data collection under CSR and ambient conditions. Data were collected from the CSR, as shown in Figure 3a. Data were also collected in an ambient room temperature environment, as shown in Figure 3b, allowing us to conduct a comparative analysis. All these data were stored in SD card memory. The results of the analysis are compared with the actual data that are theoretically known or experimentally approved in agricultural research centers.
In order to maintain signal stability and data consistency, the sensor system was configured to record readings at regular intervals of every 3 min. Data collection was conducted over an extended period in multiple phases, including initial testing followed by long-term monitoring. Prior to each reading, the system was allowed to stabilize within the storage environment to ensure that gas concentrations around the sensors had equilibrated. This procedure helped minimize transient fluctuations and ensured the acquisition of reliable and consistent data for model training and evaluation. The sensor system continuously collects environmental data from the CSR where date fruits are stored. This includes multichannel gas sensor readings for gases such as methane (CH4), carbon monoxide (CO), and nitrogen dioxide (NO2), along with temperature and relative humidity measured via dedicated temperature and humidity sensors. These readings are transmitted to a microcontroller (Arduino Nano 33 BLE Sense), which processes the incoming signals and prepares the data for local display, storage, or inference. The dataflow architecture is shown in Figure 4. During the offline training phase, raw sensor data is uploaded from the microcontroller to a cloud-based platform (Edge Impulse) [35], where a machine learning model is trained. Once trained, the optimized model is deployed back onto the microcontroller. In the online phase, the microcontroller performs real-time inference using the embedded model to predict the shelf life of stored dates based on current sensor input.
To enable shelf life prediction from gas sensor and environmental data, we employed Edge Impulse as the primary platform for data preprocessing, feature extraction, model training, and deployment. A sample of the collected gas concentration, temperature, and humidity readings is presented in Table 2. Although Table 2 presents 45 representative samples, the full dataset used for model training and evaluation was collected over several months. Sensor readings were taken every 3 min under both CSR and ambient room conditions, and features were extracted from aggregated time windows. The dataset was first uploaded to the Edge Impulse Studio, where data augmentation and filtering were applied to ensure consistency. Features were extracted using statistical methods, including mean, variance, and peak-to-peak values over sliding windows of sensor readings. These features were used to train a classification model using a fully connected neural network (FCNN) with ReLU activation functions. The model architecture consisted of an input layer matching the feature vector size, followed by two hidden layers (20 and 10 neurons, respectively), and a SoftMax output layer for three-class classification (Shelf Life High Type A, High Type B, and Low). The dataset was split into training (80%) and testing (20%) sets. Hyperparameter tuning was performed using validation accuracy and loss as optimization targets, and early stopping was used to avoid overfitting. The final model was validated using cross-validation and performance metrics such as precision, recall, F1-score, and AUC. For edge deployment, the trained model was quantized to 8-bit integer (int8) format using TensorFlow Lite, ensuring the real-time inference capabilities of the Arduino Nano 33 BLE Sense board.
The classification of shelf life categories, namely Shelf Life High Type A, High Type B, and Low, was based on a combination of the prior literature and expert input. Guidance was provided by experienced personnel at the Date Palm Research Center, who categorized the samples using their professional knowledge of postharvest quality traits, such as texture, odor, and appearance. This domain expertise helped to validate the labeling process used for training the machine learning model.

3. Results and Discussion

The dataset consists of gas sensor readings (GM102, GM302, GM502, GM702) and temperature and humidity values collected from stored date samples, providing critical insights into the fruit’s shelf life. The GM102 sensor values range from 404 to 429, potentially indicating variations in hydrogen (H2) emissions, which are closely linked to ripening and spoilage. GM302 readings, fluctuating between 176 and 198, likely reflect CO and NO2 concentrations, another key marker of fruit respiration and deterioration. Similarly, GM502 and GM702 values show fluctuations, capturing a broader spectrum of gas emissions that influence shelf life prediction. The temperature values range from 21.8 °C to 24.8 °C, reflecting natural ambient room temperature variations, while humidity remains stable at 33–34%, ensuring consistent monitoring conditions. The interplay between gas emissions, temperature, and humidity provides crucial data for training machine learning models aimed at predicting date shelf life with high accuracy, allowing for optimized storage conditions and reduced postharvest losses.
Figure 5 provide an analysis of gas concentration stability under two distinct storage conditions, monitored using a multichannel gas sensor over 30 samples. Figure 5a illustrates the gas concentration levels for gases GM102B, GM302B, GM502B, and GM702B when stored within a CSR. The graph shows remarkably consistent gas concentrations with minimal variability, suggesting that the cold storage condition effectively stabilizes the gases, thereby mitigating any potential chemical degradation or interaction that could alter their concentrations. This stability is crucial for applications that require precise and reliable gas measurements, such as in determining the shelf life of dates.
In contrast, Figure 5b presents the same set of gases stored at room temperature. Here, the concentration levels exhibit more pronounced fluctuations, particularly for gases GM302B and GM502B. These variations could be attributed to environmental factors such as temperature changes, humidity, and exposure to ambient air, which can induce physical or chemical transformations in the gases. The graph indicates that, while GM102B and GM702B maintain relatively stable concentrations, GM302B and GM502B are more susceptible to changes, highlighting the need for the careful consideration of gas-specific storage requirements. These observations emphasize the critical role of storage conditions in maintaining gas quality and the functionality of gas sensors. By demonstrating the comparative stability of gases stored in CSR versus room temperature, the data advocates for tailored storage solutions based on the specific sensitivity and composition of each gas, ensuring accuracy and consistency in their use across various industrial and research settings.
Classification performance is shown in Table 3, where the model correctly classified 89.5% of Shelf Life High Type A samples. A visual summary of model prediction accuracy is presented in Figure 6 using a data explorer scatter plot. The trained machine learning model for the shelf life estimation of dates using a multichannel gas sensor demonstrated high classification performance, achieving a validation accuracy of 91.9% with a loss of 0.26, indicating a well-optimized model with minimal overfitting. The confusion matrix provides detailed insights into the model’s classification ability across three categories: Shelf Life High Type A, Shelf Life High Type B, and Shelf Life Low. The model correctly classified 89.5% of Shelf Life High Type A samples, with 5.3% misclassified as Type B and another 5.3% misclassified as Shelf Life Low. Similarly, Shelf Life High Type B exhibited the highest classification accuracy at 93.9%, with only 6.1% misclassified as Shelf Life Low. The Shelf Life Low category was accurately predicted in 87.7% of cases, but 12.3% of samples were incorrectly labeled as Shelf Life High Type B, suggesting minor overlaps in gas sensor readings between these classes. The weighted average precision, recall, and F1-score all stand at 0.92, highlighting the model’s ability to make reliable predictions while maintaining a strong balance between precision (minimizing false positives) and recall (minimizing false negatives).
The Receiver Operating Characteristic (ROC) curve yielded an AUC score of 0.98, confirming excellent model discrimination between shelf life categories, as per Table 4. This high AUC indicates that the model is highly effective in differentiating between fresh and deteriorating dates based on the multichannel gas sensor data. The data explorer visualization further validates the classification performance, where green points signify correctly classified samples, while red and yellow points represent misclassifications. A closer examination of the scatter plot reveals clusters of misclassified samples, particularly in transitional stages where the sensor readings of Shelf Life High Type B and Shelf Life Low overlap. This suggests that certain biochemical changes in dates, such as ethylene and CO2 emissions, may exhibit similar patterns between early and late spoilage stages, leading to minor misclassification errors.
From a deployment perspective, the model has been quantized to 8-bit integer format (int8) using TensorFlow Lite, significantly reducing its computational load while maintaining high accuracy. This optimization ensures efficient real-time performance on edge devices, making the model highly suitable for IoT-based cold storage monitoring systems. By integrating this machine learning model into automated food preservation workflows, it enables real-time decision-making to adjust storage conditions, reduce postharvest losses, and improve supply chain efficiency. Despite its high performance, further refinements—such as feature engineering, sensor recalibration, or ensemble modeling—could further reduce classification errors in edge cases where gas emission variations between shelf life stages are minimal. Nevertheless, with its high precision, recall, and real-time inference capabilities, this model provides a robust and scalable solution for intelligent date preservation and shelf life prediction.

4. Conclusions

This research presents a practical and cost-effective IoT-based framework that integrates multichannel gas sensing with TinyML for the real-time shelf life estimation of date fruits. By leveraging lightweight machine learning models deployed on edge devices, the system enables the accurate classification of date freshness based on spoilage-indicating gases and environmental parameters. An important contribution of this work is its non-invasive and scalable approach to freshness detection, eliminating the need for destructive testing or specialized packaging. The trained model achieved a classification accuracy of 91.9% and an AUC of 0.98, demonstrating strong predictive performance under both cold storage and ambient conditions. Designed with affordability and accessibility in mind, the architecture supports deployment on compact hardware such as the Arduino Nano 33 BLE Sense, making it highly applicable within real-world supply chains. Moreover, the system’s real-time monitoring and control capabilities facilitate their integration into both storage and transportation contexts, where early spoilage detection is critical to minimizing postharvest losses and enhancing food security. Future enhancements may include scaling the dataset, evaluating alternative machine learning models, and extending the methodology to other perishable commodities with minimal adaptation.

Author Contributions

Conceptualization, M.A.A.H., A.A., A.A.M., N.A., A.U.H. and R.S.; methodology, A.A., N.A. and M.A.A.H.; software, A.A., A.A.M. and N.A.; validation, R.S., A.A. and M.A.A.H.; formal analysis, A.U.H. and M.A.A.H.; investigation, M.A.A.H.; resources, M.A.A.H. and A.U.H.; data curation, N.A., M.A.A.H. and A.U.H.; writing—original draft preparation, M.A.A.H., A.A., A.A.M. and N.A.; writing—review and editing, M.A.A.H. and A.U.H.; visualization, N.A.; supervision, M.A.A.H. and A.A.; project administration, M.A.A.H.; funding acquisition, A.U.H. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Al Ahsa, Saudi Arabia [Grant number KFU251181].

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The dataset is available upon request from the corresponding author.

Acknowledgments

The authors sincerely express their gratitude to Ali Alzahrani, Dean of the Deanship of E-Learning & IT, for his invaluable support. They also extend their appreciation to Maged Mohammed and the dedicated technicians at the Date Palm Research Center of Excellence at King Faisal University, Saudi Arabia, for providing access to and facilitating the use of the cold storage room, facilities, and engineering workshops that were instrumental to this research. Finally, special thanks go to Tassadaq Nawaz Khan and Naveed Rasool for their valuable feedback.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. 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]
  2. 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]
  3. 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]
  4. 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]
  5. 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]
  6. Paull, R.E. Effect of temperature and relative humidity on fresh commodity quality. Postharvest Biol. Technol. 1999, 15, 263–277. [Google Scholar] [CrossRef]
  7. Yahia, E.M. Postharvest Technology of Perishable Horticultural Commodities; Elsevier Science: New Delhi, India, 2019; ISBN 9780128132760. [Google Scholar]
  8. Xue, M.; Zhang, J.; Tang, W. Optimal temperature control for quality of perishable foods. ISA Trans. 2014, 53, 542–546. [Google Scholar] [CrossRef]
  9. 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]
  10. 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]
  11. 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]
  12. 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]
  13. 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]
  14. 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]
  15. 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]
  16. 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]
  17. 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]
  18. 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]
  19. 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]
  20. 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).
  21. Van Den Berg, L.; Lentz, C.P. High humidity storage of vegetables and fruits1. HortScience 1978, 13, 565–569. [Google Scholar] [CrossRef]
  22. 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]
  23. 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]
  24. Bermudez-Aguirre, D. Ultrasound: Advances in Food Processing and Preservation; Academic Press: Cambridge, MA, USA; Elsevier: San Diego, CA, USA, 2017. [Google Scholar]
  25. 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]
  26. Chemat, F.; Khan, M.K. Applications of ultrasound in food technology: Processing, preservation and extraction. Ultrason. Sonochem. 2011, 18, 813–835. [Google Scholar] [CrossRef]
  27. Rajan, R.; Pandit, A. Correlations to predict droplet size in ultrasonic atomisation. Ultrasonics 2001, 39, 235–255. [Google Scholar] [CrossRef]
  28. 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]
  29. 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]
  30. 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]
  31. Benkeblia, N. Storage technologies for date palm fruits (Phoenix dactylifera L.): Current and potential techniques. Acta Hortic. 2013, 994, 151–154. [Google Scholar] [CrossRef]
  32. 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]
  33. 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]
  34. 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]
  35. Arm Limited. Edge Impulse. Available online: https://www.arm.com/partners/ai-ecosystem-catalog/edge-impulse (accessed on 5 March 2025).
Figure 1. Architecture of the proposed shelf life estimation system, illustrating the major hardware components and their interactions.
Figure 1. Architecture of the proposed shelf life estimation system, illustrating the major hardware components and their interactions.
Sensors 25 04063 g001
Figure 2. Circuit connections between Arduino and sensors.
Figure 2. Circuit connections between Arduino and sensors.
Sensors 25 04063 g002
Figure 3. Measurement of gas concentration. (a) Room temperature collection. (b) Overall CSR data collection.
Figure 3. Measurement of gas concentration. (a) Room temperature collection. (b) Overall CSR data collection.
Sensors 25 04063 g003
Figure 4. Dataflow architecture of the IoT-based shelf life estimation system.
Figure 4. Dataflow architecture of the IoT-based shelf life estimation system.
Sensors 25 04063 g004
Figure 5. Gas concentration for 30 samples. (a) Measured in CSR environment. (b) Measured at room temperature.
Figure 5. Gas concentration for 30 samples. (a) Measured in CSR environment. (b) Measured at room temperature.
Sensors 25 04063 g005
Figure 6. Data explorer visualization of the trained model’s classification results for shelf life estimation of dates.
Figure 6. Data explorer visualization of the trained model’s classification results for shelf life estimation of dates.
Sensors 25 04063 g006
Table 1. Modules and their functionalities.
Table 1. Modules and their functionalities.
ModuleModelManufacturerFunctionKey Specs/Notes
MicrocontrollerArduino Nano 33 BLE SenseArduinoCentral control, data processingBLE, multiple onboard sensors, TinyML-ready
Gas SensorMultichannel Gas Sensor V2Seeed StudioDetects CH4, NO2, CO, NH3, H2, H2SGM102, GM302, GM502, GM702 elements
Humidity and Temp SensorDHT11Aosong ElectronicsMeasures temperature and relative humidityDigital output, low cost
Real-Time Clock ModuleDS3231AdafruitTimestamps data logsI2C, battery-backed
SD Card ModuleMicroSD Card AdapterGenericLocal data storageSPI Interface
OLED DisplaySSD1306 0.96″Adafruit/GenericDisplays real-time shelf life estimatesI2C, 128 × 64 pixels
Cloud PlatformEdge ImpulseEdge Impulse Inc.ML model training and deploymentEdge ML support
Table 2. Sample dataset of gas sensor readings, temperature, and humidity.
Table 2. Sample dataset of gas sensor readings, temperature, and humidity.
SamplesGM102GM302GM502GM702TemperatureHumidity
142919815322822.633
242419415022722.633
342119114722722.233
441818814522622.233
542018814522722.233
64221891472282333
742419214923023.433
842619315123023.833
942819415222924.133
1042819615423024.533
1142319415222723.833
124191911482252333
1341718814622522.233
1441318614322322.233
1541318414222321.833
1641618414322422.633
174171861442262333
1841918814722723.433
1942018914822723.833
2042119015022724.133
2142119015022624.133
224151871472222333
2341318514522222.633
2441018314122122.233
2540818113921921.833
2640918013922021.834
2741118114022222.633
284131831422232333
2941418414322223.433
3041618614522423.833
3141718714622524.133
3241518714722223.833
334111841442202333
3440718214121922.633
3540518013821922.233
3640217713721921.834
3740517813621922.234
3840817913822022.633
394101811402212333
4041118214122123.433
4141218314322223.833
4241418414422323.833
4341118414422123.833
444071811422182333
4540417913921722.233
Table 3. Confusion matrix analysis of the trained machine learning model.
Table 3. Confusion matrix analysis of the trained machine learning model.
Actual vs. PredictedShelf Life High Type AShelf Life High Type BShelf Life Low
Shelf Life High Type A89.5% (correct)5.3% (misclassified)5.3% (misclassified)
Shelf Life High Type B0% (misclassified)93.9% (correct)6.1% (misclassified)
Shelf Life Low0% (misclassified)12.3% (misclassified)87.7% (correct)
Table 4. Metrics (validation set) for the trained machine learning model used in shelf life estimation.
Table 4. Metrics (validation set) for the trained machine learning model used in shelf life estimation.
MetricValue
Area Under ROC Curve (AUC)0.98
Weighted Average Precision0.92
Weighted Average Recall0.92
Weighted Average F1 Score0.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.

Share and Cite

MDPI and ACS Style

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

AMA Style

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 Style

Haque, 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 Style

Haque, 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

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop