Next Article in Journal
Agricultural Production Can Be a Carbon Sink: A Case Study of Jinchang City
Previous Article in Journal
Green Power Consumption Digital Identification System Based on Blockchain Technology
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Machine-Learning-Based Spectroscopic Technique for Non-Destructive Estimation of Shelf Life and Quality of Fresh Fruits Packaged under Modified Atmospheres

by
Maged Mohammed
1,2,*,
Ramasamy Srinivasagan
3,
Ali Alzahrani
3 and
Nashi K. Alqahtani
1,4
1
Date Palm Research Center of Excellence, King Faisal University, Al-Ahsa 31982, Saudi Arabia
2
Agricultural and Biosystems Engineering Department, Faculty of Agriculture, Menoufia University, Shebin El Koum 32514, Egypt
3
Computer Engineering Department, College of Computer Sciences & Information Technology, King Faisal University, Al-Ahsa 31982, Saudi Arabia
4
Department of Food and Nutrition Sciences, College of Agricultural and Food Sciences, King Faisal University, Al-Ahsa 31982, Saudi Arabia
*
Author to whom correspondence should be addressed.
Sustainability 2023, 15(17), 12871; https://doi.org/10.3390/su151712871
Submission received: 22 June 2023 / Revised: 10 August 2023 / Accepted: 22 August 2023 / Published: 25 August 2023
(This article belongs to the Section Sustainable Agriculture)

Abstract

:
The safety and quality of fresh fruits deserve the greatest attention, and are a priority for producers and consumers alike. Modern technologies are crucial to accurately estimating and predicting fresh fruits’ quality and shelf life, to optimize supply chain management. Modified atmosphere packaging (MAP) is an essential method that maintains quality parameters and increases the shelf life of fresh fruits by reducing their ripening rates. This study aimed to develop a cost-effective, non-destructive technique using tiny machine learning (TinyML) and a multispectral sensor to predict/estimate the quality parameters and shelf life of packaged fresh dates under the natural atmosphere (Control), vacuum-sealed bags (VSBs), and MAP with different gas combinations: 20% CO2 + N balance (MAP1), and 20% CO2 + 10% O2 + N balance (MAP2). The shelf life and quality parameters of the packaged fresh dates (pH, total soluble solids (TSSs), sugar content (SC), moisture content (MC), and tannin content (TC)) were evaluated under different storage temperatures and times. A multispectral sensor (AS7265x) was utilized to correlate the fruit quality parameters with spectrum analysis under the same storage conditions, to prepare the dataset to train the prediction models. The prediction models were trained in the Edge Impulse Platform, and deployed to an Arduino Nano 33 BLE sense microcontroller unit (MCU) for inference. The findings indicated that the vacuum and MAP1 efficiently increased the shelf life and maintained the quality parameters of the packaged fresh fruit to 43 ± 2.39 and 39 ± 3.34 days, respectively, at 5 °C. The optimal neural network consisted of the input layer with 20 nodes (the packaging type, storage temperature, and 18 channels of the spectral sensor data at 410 to 940 nm wavelengths), two hidden layers with 20 and 12 nodes, and an output layer with one node for the target quality parameter or shelf life. These optimal prediction models efficiently predicted the shelf life with R2 = 0.951, pH with R2 = 0.854, TSSs with R2 = 0.893, SC with R2 = 0.881, MC with R2 = 0.941, and TC with R2 = 0.909. The evaluation of the developed prediction models under each packaging condition indicated that these models serve as powerful tools for accurately predicting fruit quality parameters, and estimating the shelf life of fresh dates.

1. Introduction

The date palm (Phoenix dactylifera L.) is among the ancient fruit-bearing plants flourishing in North Africa and the Middle East. Date palm fruits are a staple food, and a primary source of revenue, for many communities [1]. Approximately 8.46 million tons of date palm fruits are produced yearly worldwide. Saudi Arabia exported 1.54 million tons in 2022 [2]. The pre-maturation, maturation, and ripening stages of date palm fruits are Hababauk, Kamri, Khalal, Rutab, and Tamr. These growth phases lead to various alterations in color, chemical composition, sweetness, and texture, both internally and externally, based on the maturity and ripeness. The Khalal stage is the initial stage of date fruit ripening [3,4]. Date fruits can be marketed at the Khalal, Rutab, and Tamr ripening stages. Dates in the Khalal stage are edible, and ready for marketing as fresh ripe fruit. Khalal date fruits have a solid surface, crisp texture, and red or bright yellow color, based on the date palm tree cultivar. The fruit at the Rutab stage, in terms of appearance, has a partly browned color at its tip, which then extends gradually to the whole fruit. The Rutab fruits are delicate, have a short shelf life, and are highly perishable. Tamr is the final ripening stage of date fruits. The color of the Tamr fruits is usually dark brown, and the fruit texture is pliable or hard, based on the date palm cultivar [5]. Fresh dates are suggested as a wholesome and nourishing snack, which is attributed to their reduced total sugar content compared to ripped date fruits (Tamr). When they are consumed before reaching full maturity, fresh dates can be enjoyed liberally, without raising concerns about the number of daily servings, and their potential impact on glycemic levels (GL) [6,7,8]. However, fresh dates are seasonal, and available only between July and November. Therefore, food security demands the storage of fruits in suitable conditions, to preserve their quality for consumption out of season, to slow down fruit decay, to keep them in good shape, and to ensure an even supply to the market, to allow higher pricing [9,10,11].
Preserving the quality of fresh date palm fruits during the marketing process is a significant technical hurdle, particularly at the Khalal stage of maturity [12]. The factors that affect the optimal packaging of fresh fruits include the respiration rate of the product, the desired gas composition to extend the shelf life, the surrounding temperature and gas composition, the volume, area, and thickness of the packaging material, and the permeability of the film to CO2 and O2 gases [13]. Therefore, modified atmosphere packaging (MAP) is an efficient method that effectively prolongs the shelf life of many fresh products, by modifying the atmosphere surrounding the product inside a package. MAP involves replacing the air-sealed fruit package with modified gases, such as carbon dioxide, nitrogen, argon, and oxygen, which help to preserve the product’s quality and freshness [14,15,16]. In addition, intelligent MAP is a packaging system that can carry out intelligent functions, including detecting, sensing, tracing, recording, applying scientific logic, and communicating, to facilitate decision-making, to improve quality, extend shelf life, enhance safety, warn about potential problems, and provide information [17].
The quality parameters of dates are responsible for maintaining a fruit’s freshness and shelf life. However, the traditional measurement analysis of these properties, and other parameters that can reflect the quality of the fruit, is not only time-consuming and labor-intensive, but also highly destructive to the fruit. Therefore, conducting a fast and non-destructive assessment of fruit quality has become a critical topic [4,18]. The most popular widespread assessment methods in the food industry are indeed NIR spectroscopy (NIRs), image and multi/hyperspectral analysis, and vis/near-infrared (Vis–NIRs) spectroscopy [19]. The techniques of NIRs, Vis–NIRs, and multispectral/hyperspectral analysis are all rooted in the principles of spectroscopy, but differ in terms of the wavelength range, and the interaction of light with matter. NIRs uses the near-infrared electromagnetic spectrum region from 700 to 2500 nanometers. NIRs is utilized to measure the absorption of light by the target materials. NIRs is a non-destructive method that does not destroy the material being evaluated. Therefore, NIRs offers an efficient quality evaluation for agricultural products. Vis–NIRs uses the electromagnetic spectrum’s visible and near-infrared regions from 400 to 2500 nanometers. Vis–NIRs is more versatile than NIRs because it can measure a broader range of chemical compounds. Image and multi/hyperspectral analysis are spectroscopy types that use hyperspectral images to measure light absorption by materials. Hyperspectral images are images that contain information about the spectral reflectance or emission of materials at multiple wavelengths. Each technique offers special advantages and applications, contributing to a wide range of fields, such as agriculture, food safety, and remote sensing [20,21,22]. The hyperspectral imaging method to detect the microbial contamination of date palm fruits, using latent and quadratic discriminant analyses, was investigated in [23]. For example, a previous research identified fungal-infected and healthy date fruits using the different wavelengths of 1120, 1300, 1610, and 1650 nm [23]. In addition, the NIR and visible spectroscopy were used to assess fruit and vegetable quality, and their internal characteristics [24]. Numerous scholars have employed spectral ranges such as visible–short-wave near-infrared (Vis-SWNIR), near-infrared (NIR), and infrared (IR) bands, to analyze reflective characteristics for assessing the quality and shelf life of diverse fruits, including the chardonnay grapes [25], kesar mango [26], muskmelon [27], strawberry [28], persimmon [29], kiwi fruit [30], pineapple [31], date fruit [32], and Royal Gala [33].
The quality and shelf life of the fresh fruits in the supply chain undergo dynamic changes over time, depending on environmental factors. The machine learning (ML) approach can be beneficial in developing models that boast a high accuracy in estimation or prediction under these environmental factors [34]. The prediction and estimation of the shelf life of fresh fruits is critical to scheduling them for consumption at the right time in the supply chain to benefit from their nutritional advantages [18]. ML includes algorithms that derive niche information from data, and use this information in learning, for estimation, prediction, and classification. ML has the potential to enhance food sustainability by enhancing agricultural methods such as precision farming, which aims to minimize resource consumption, while maximizing crop yields. Furthermore, ML can oversee crop development, and provide more precise yield forecasts, aiding farmers in improved planning and waste reduction. Additionally, artificial intelligence (AI) finds utility within the supply chain, enabling food quality monitoring, and curtailing waste, by anticipating customer demand and optimizing logistics, resulting in more efficient deliveries [18,35,36,37].
Internet of things (IoT) and ML applications are used to evaluate the quality of the fruit. In addition, the use of deep learning techniques to grade, classify, and predict the quality parameters of fruits has been proposed by several researchers [5,27,37,38,39,40,41,42,43]. The decision regarding model development and deployment is determined through two methodologies: cloud computing and edge computing. Cloud computing entails providing services via the internet, granting users access to virtual resources such as computing power, software, storage, and services on a need basis, without the management of hardware. On the other hand, edge computing pertains to a novel computing paradigm encompassing a diverse network and array of devices for the user. Edge computing involves processing data closer to the point of origin, facilitating faster and more voluminous data processing. This, in turn, results in immediate action-orientated outcomes in real time. The choice of computing is made according to several favorable parameters, such as the inference time, training time, bandwidth, scalability, latency, reliability, economics, and privacy. Therefore, most agricultural food chain activities benefit Edge AI computing [44]. Edge AI conducts most of its data processing in a localized way, resulting in reduced data transmission over the internet, and a considerable preservation of internet bandwidth. Additionally, edge computing tools are fashioned with an exceptional power efficiency, translating to lower power demands for running AI at the edge than for cloud data centers. Lightweight models can be used to satisfy Edge AI computing requirements. In addition, the new Edge AI computing paradigm is known as tiny machine learning (TinyML), which can be deployed on micro-controllers [45]. TinyML is a field of ML that focuses on the development of machine learning models that can run on small devices. TinyML models are typically much smaller and simpler than traditional machine learning models, making it possible to run them on devices with limited resources. TinyML presents intelligence to low-power and low-memory tiny devices, by allowing ML [46].
To our knowledge, no previous study has been conducted to predict the shelf life combined with quality parameters for fresh date fruits using the multispectral sensor and TinyML regression model. However, using computer vision and other classification models, several related works exist for other fruits, such as the Royal Gala, strawberry, mango, banana, musk melon, and grape. Accordingly, the current study aimed to estimate the shelf life and quality parameters of date fruits under different packaging atmospheres and temperature conditions, by developing a low-cost, non-destructive spectroscopic technique. Our contributions toward fulfilling the aim of the study can be outlined as follows:
  • Investigate the influence of MAP, temperature, and storage days on the shelf life and quality parameters of dates.
  • Evaluate the quality parameters and shelf life of dates during storage under storge conditions.
  • Develop a low-cost and fast inference multispectral sensor-based detector for reflectance spectroscopy data acquisition in dates during storage.
  • Develop predictive models, using Edge Impulse to predict the quality and shelf life of packaged dates, based on reflectance spectroscopy.
  • Validate the performance of the developed TinyML models for predicting packaged fruits’ shelf life and quality under different storage conditions.

2. Materials and Methods

2.1. Collection and Preparation of the Samples

The fresh date samples (Khalas cv.) were harvested at the Khalal stage from the experimental orchard (25.268089° N, 49.708498° E) of the Date Palm Research Center of Excellence (DPRC), King Faisal University (KFU), Saudi Arabia. At the Khalal stage, the fruits are yellow, have a high moisture content, and are still hard, which gives them a crunchy texture. After this stage is the Rutab stage, when the yellow color begins to convert to brown, gradually.
The samples were cleaned, washed with potable water, and sorted immediately after harvesting. Approximately 250 g of the fruits were packaged into vacuum-sealed bags, and in modified atmosphere packaging (MAP) trays (35 × 135 × 185 mm) with a single layer. Afterward, half of the date fruits were packaged and stored at 5 °C in a cold storage room, and the other half was left at controlled room temperature (22 °C) for the conduction of the storage treatments. The vacuum sealer model VS6611X, Yumyth Electronic Tech Co., Limited, Guangdong, China, was used to seal the vacuum sealer bags, after they were packaged with precooled samples. The MAP trays were vacuumed, desired with gas mixtures, and sealed using a tray-sealing machine (VC999 TS300, Bernhard Inauen, Herisau, Switzerland).
The MAP experiment consisted of the following four treatments:
  • Unsealed trays in the natural atmosphere (Control).
  • Vacuum-sealed bags (VSBs).
  • Modified atmosphere packing trays with 20% CO2 and N balance (MAP1).
  • Modified atmosphere packing trays with 10% O2, 20% CO2, and N balance (MAP2).
The target-modified atmosphere (20% CO2 + N balance and 10% O2 + 20% CO2 + N balance) was supplied from premixed gas cylinders. The validation of the gas concentration levels in the sealed MAP trays was performed after the completion of tray packaging with the target gas and, during storage time, using a portable gas analyzer (OXYBABY® M+ gas, Gase Technik GmbH & Co KG, Salinger Feld, Witten, Germany).
The treated containers were stored at 5 ± 0.5 °C in the cold storage room, and at 22 ± 1 °C in the room temperature, for shelf life and quality parameter estimation at 0, 10, 20, 30, 40, 50, and 60 days of storage. Three containers from each packaging treatment were randomly selected for the initial quality evaluation, and after each storage time. In addition, the percentage of fresh fruits that turned into dates and Rutab, or spoiled, was calculated during storage days.

2.2. Quality Parameter Measurments

The fruit quality criteria, i.e., the moisture content (MC), total soluble solids (TSSs), total sugar (TS), pH, and tannin content (TC) were assessed within the fruit quality laboratories of the DPRC. The MC of the fruit was determined through the vacuum drying of a 50 g sample at 70 °C, using a vacuum-drying oven model LVO-2041P, Daihan Labtech Co., Ltd., Namyangju-si, Gyeonggi-do, Korea. The weight of the sample was then measured after 48 h, in accordance with the recognized analysis protocols of the Association of Official Analytical Chemists International (AOAC) [47]. The portable aw device model (aqualab, 3Series 3, Decagon Devices, Inc., Pullman, WA, USA) was used to determine the fruit aw, according to the standard analysis methods of the AOAC [47]. The digital laboratory refractometer (model RFM 840, Richmond Scientific Ltd. Unit 9, Lancashire, UK) was used to determine the TSSs of the date fruits. The anthrone–sulfuric acid colorimetry method was used to determine the TS of the date fruits. This method was described in [4,36,48]. The absorbance at 630 nm wavelength was determined using a spectrophotometer (model Genesys 20, Thermo Scientific, Waltham, MA, USA). A portable pH meter (model S400, Mettler-Toledo LLC, Columbus, OH, USA) was used to measure the fruit pH. A spectrophotometer (model Genesys 20, Thermo Scientific, Waltham, MA, USA) was used to measure the TC of the fruits at 750 nm wavelength. The TC was quantified through the employment of a calibration curve derived from the measurement of the absorbance of predetermined concentrations of gallic acid [49].

2.3. Multispectral Sensor Description

A multispectral sensor (AMS -OSRAM AG, Tobelbader Straße, Premstaetten, Austria) was used to measure the spectral reflectance of the tested date fruits. This sensor consists of the AS7265x chipset that incorporates three chips, i.e., AS72651, AS72652, and AS72653, to deliver an 18-channel VIS to the Vis–SWNIR sensing array, covering wavelengths from 410 nm to 940 nm, to detect fresh dates’ physicochemical properties. This chipset is equipped with on-device optical filters, characterized by on-device Gaussian band pass filters that exhibit a 20 nm full width. The chipset incorporates three sensors, each featuring six distinct wavelengths, totaling eighteen wavelengths across the spectrum. The normalized responsivity of the spectrum for the AS7265x triad chipset is depicted in Figure 1, sourced from the manufacturer’s datasheet [50]. Additionally, the sensors are furnished with integrated programmable constant current-led drivers, facilitating light intensity adjustment. The reflections from the target date fruit are applied, to obtain the fruit MC, pH, TSSs, S, and TC. The wavelengths employed in the AS7265x optical sensors align with the specific absorption peaks relevant to the fresh date maturity analysis from the Khalal to the Tamr.

2.4. TinyML Prediction Models

The prediction models for shelf life and quality parameter estimation were developed using TinyML, supported by the Edge Impulse Cloud MLOPs engine. The developed models were targeted to a microcontroller of Arduino Nano33 BLEsense–Cortex M4 that can run the prediction neural network (NN) models. The Nano33 BLE sense board hosts several sensors that facilitate TinyML wide-range purposes. The workflow of the TinyML model typically consists of five stages, as illustrated in Figure 2 of the flow diagram.
Figure 3 illustrates a schematic representation of the estimation models based on TinyML, devised for the estimation of shelf life and quality parameters in fresh fruits. The 18-channel spectral sensor captures the parameters as reflectance values, which are then transmitted to the Edge Impulse via Arduino CLI, using the acting as the Edge Device. Once trained, Edge Impulse deploys the model back to the Edge device. Consequently, the Nano 33 BLE performs real-time inference to estimate the quality parameters and fruit shelf life.
The values of the reflectance readings obtained from samples using the 18-channel spectral sensor were captured, utilizing a 12.5 mA current source drive, and a receiver gain set at 64x. The 18-channel spectral filters were systematically adjusted in increments of 20 nm, spanning from 410 nm to 940 nm, for each specified configuration of current and gain outlined above. These spectral measurements were carried out on the exact storage days when laboratory analyses were conducted on the identical samples, tracking their progression through the distinct maturity stages from Fresh to Tamr. Furthermore, all samples underwent testing under consistent environmental light conditions (300 Lux), and maintained a uniform distance of 3 cm between the spectral sensor and the sample.
TinyML has experienced remarkable advancements, leading to the emergence of numerous tools for the development and testing of ML algorithms. In this study, artificial N architectures have been employed for the deployment of the TinyML prediction model on the microcontroller, to predict the packaged date fruit’s shelf life and quality parameters. The reflected light corresponding to the major quality parameters of pH, TSSs, SC, MC, TC, and the shelf life of dates as carried as an input variable for the prediction NN-based model.
The input variables were derived from the AS7265x sensor, using the I2C port of the microcontroller (serving as the Edge Device). The sample architecture of the NN model is depicted in Figure 4. The hidden layers are responsible for data processing, while the output layer provides the predicted values for a specific target, either the shelf life or a quality parameter.
The values obtained from the input layer are combined with those of a hidden node, and then multiplied by their designated weights as preset values. As a result, the outcomes of this operation are added up, to fashion a new value. This newly spawned value is steered toward a mathematical function, followed by an activation function, to complete the process (ReLu—rectified linear unit) to predict fresh date fruits’ shelf life and quality parameters, until they reach the date stage. The accumulation of weighted inputs entering a neural network node labeled “j” is combined with the output activation function, which transforms the neuron’s weighted value into its rectified linear unit (ReLU) output activation function, as illustrated in Figure 5.
In this research, the development of TinyML prediction models was accomplished using the Edge Impulse. The training of the multilayer perceptron module NN employed a backpropagation learning algorithm, along with an optimizer (Adam). This optimizer was utilized to adjust the weights in a manner that reduced the error function. Adam optimization is a stochastic gradient descent algorithm that relies on the adaptable estimation of first- and second-order moments. The data were arranged randomly, wherein 80% were allocated for training, and the remaining 20% were used for testing. While the training dataset was utilized for weight determination and model construction, the testing data were leveraged to identify errors and prevent overtraining during the training process.
The parameters of the NN regression model utilized in the implementation of predictions are outlined in Table 1. Given that the model’s objective is to predict continuous values for the quality parameters and shelf life of fruits, regression models were selected. Furthermore, the edge device is constrained by memory limitations, leading to a preference for lightweight regression models in this context. Every 10 days, there was a need to collect samples for laboratory analysis to validate the quality parameters of dates during the storage days. Therefore, 10 fruit samples at 0, 10, 20, 30, 40, 50, and 60 days of storage were taken for each packaging type, under each storage temperature.
Consequently, the total sample number was 70, which was sufficient for training. The total required sample number was 168, sufficient for training to predict the quality parameters of packaged fruits in all packaging types and at all storage temperatures. A batch size of 32 was opted for, to mitigate memory usage during both the training and inference stages. A learning rate of 0.005 was selected, considering the batch size, and aiming for improved merging. The ADAM optimizer was employed, due to its rapid convergence capabilities.
The developed NN prediction models were deployed, to authenticate their accuracy using the external validation dataset. The Edge Impulse cloud platform is purpose-built for the deployment of models on edge devices for real-time applications. Considering the hyperparameters employed for the NN model, to predict the quality parameters of packaged fruit under various atmosphere and temperature conditions, the inference time stands at 1 millisecond, and the RAM usage amounts to 1.8 kilobytes out of the available 256 kilobytes for the storing model parameters. Furthermore, the NN regression model utilizes just 10.9 kilobytes out of the 1 megabyte flash available. These statistics underscore the optimization of this model for real-time inference using the implemented TinyML predictions models.

2.5. Statistical Analysis and TinyMl Models Evaluation

The analysis of variance (ANOVA) at p ˂ 0.05 using IBM SPSS Software version 26 (SPSS Inc., Chicago, IL, USA) was used to perform the statistical analysis. The coefficient of determination (R2), mean absolute error (MAE), and the root-mean-square error (RMSE) were used as statistical measures to evaluate the performance of the developed TinyML prediction models, using the following formulas:
R 2 = 1 O j P j 2 O j 2 ( O j ) 2 n
M A E = 1 n × n 1 n O i P i
R M S E = j n O j P j 2 n
where Oj is the observed value, Pj is the predicted values of the target parameter data j, and n is the number of the measure values.
R2 is an essential statistical measure that determines how well the modeled data fit the observation data, to describe the strength of a linear relationship between the observed and predicted values. The absolute error is the absolute value of the difference between the predicted and the observed values over the test sample, where all individual differences have equal weight. The MAE evaluates the precision of the continuous variables by computing the average magnitude of errors generated by a given set of predictions, without considering their direction. The RMSE measures the error between two datasets, by measuring the difference between the predicted values from the developed model, and the observed values from the modeled measurements. The RMSE aggregates these residuals into a single measure of predictive effectiveness. Therefore, the RMSE was used to compare the predicted and observed values.

3. Results

3.1. Influence of Storage Conditions on Fresh Dates

The influence of modified atmosphere packaging (MAP) on Khalal-stage dates (cv. Khalas) stored for 0, 10, 20, 30, 40, 50, and 60 days, at 5 and 22 °C, showed a statistically significant (p ≤ 0.05) difference (Figure 6A–H). The results of the unsealed control treatment indicated that the fruit percentage of Khalal-stage fruits linearly decreased after 8 days of storage (DOS) when kept at 5 °C (Figure 6A). However, an immediate decline was observed when same-stage fruits were stored at 22 °C (Figure 6B). Similarly, 55% of Khalal fruits were converted to the Rutab stage after 30 DOS at both temperatures; after that, the percentage declined. The fruit was changed to Tamr after 30 DOS at 5 °C, and attained the highest percentage (60%) after 60 DOS. However, fruits stored at 22 °C changed to Tamr after 25 DOS, and 90% Tamr fruits were recorded after 53 DOS. Fruit spoilage was started after 20 DOS at 5 °C, and the maximum percentage of spoiled fruits (40%) was noted after 60 DOS. It increased by 15% from 50 to 60 DOS, when fruit were stored at 22 °C. Figure 6C indicates that 100% of Khalal fruits stored at 5 °C in VSBs remained fresh up to 30 DOS. However, these were counted for 24 days stored at 22 °C (Figure 6D). Similarly, fruits were starting to convert into Rutab after 30 DOS at both temperatures, and gained the highest Rutab fruit percentage after 60 DOS (50%). Fruits stored in VSBs at both temperatures did not convert to the Tamr stage. However, only 5% of fruits were spoiled at 5 °C, and 35% at 22 °C, after 60 DOS. Khalal fruits stored at 5 °C in MAP trays sealed with 20% CO2 and N balance remained fresh up to 28 DOS (Figure 6E), 23 days at 22 °C (Figure 6F), and declined afterward. However, Khalal fruits converted to the Rutab stage after 33 DOS at 5 °C, and 25 DOS at 22 °C, and had the highest percentage (60 and 50%, respectively) after 60 DOS. None of the Tamr fruits were observed in MAP trays sealed with 20% CO2 and N at both temperatures. Only 8% of spoiled fruits were counted at 5 °C, whereas it was 40% at 22 °C after 60 DOS. The data presented in Figure 6G show that the Khalal fruits stored at 5 °C in MAP trays sealed with 10% O2, 20% CO2, and N balance persisted fresh up to 23 DOS, which were counted for 21 days at 22 °C (Figure 6H).
The stored fruits started to convert to the Rutab stage after 27 DOS at 5 °C, and the highest Rutab fruit percentage (72%) was recorded after 60 DOS. On the other hand, the fruits stored at 5 °C converted to Rutab stage after 25 DOS and achieved the highest Rutab fruit percentage (46%) after 60 DOS. Fruits kept at either temperature in MAP trays sealed with 10% O2, 20% CO2, and N balance did not reach the Tamr stage. The percentage of spoiled fruits was lowest (19%) at 5 °C, and highest (59%) at 22 °C after 60 DOS. The fruit spoilage stage started at 24 DOS and 25 DOS, at 5 and 22 °C, respectively.
Figure 7 shows the impact of the various packaging atmosphere conditions on the shelf life of fresh date fruits at 5 °C and 22 °C. At 5 °C, the shelf life of the fresh date fruits packaged in natural air was 15 ±1.05 days. However, the VSBs significantly increased the shelf life of the fruits, to 43 ± 2.39 days. This is due to the vacuum packaging creating a low-oxygen environment that helps to preserve the freshness and extend the shelf life of the fruits. The MAP also positively impacted the shelf life of fresh dates. MAP1, which involved modifying the atmosphere by adjusting the N and CO2 levels, resulted in a shelf life of 39 ± 3.34 days at 5 °C. MAP2, which involved modifying the atmosphere by adjusting the O2, N, and CO2 levels, extended the shelf life to only 29 ± 1.18 days, at the same temperature. At 22 °C, the fresh date fruits’ shelf life in natural air decreased to 11 ± 1.05 days. However, the VSBs proved highly effective, increasing the shelf life to 34 ± 2.21 days. This indicates that VSBs can help to save fresh dates’ quality, and extend their shelf life, even at higher temperatures. Similarly, the MAP options also demonstrated their effectiveness at 22 °C. MAP1 resulted in a shelf life of 31± 2.92 days, while MAP2 extended the shelf life to 25 ± 1.18 days.

3.2. Quality Parameters of Dates

Table 2 provides a detailed overview of the mean values of quality attributes of dates at the different ripening stages, namely Fresh (Khalal), Rutab, and Tamr. This table indicates the highest pH, TSSs, and sugar content, and lowest MC and tannin content in Tamr fruit, followed by Rutab-stage fruits. The fresh fruits at the Khalal stage had the lowest pH, TSSs, and sugar content, and the highest MC and tannin content. Some physicochemical studies on date palm fruit also reported that the MC and tannin content is decreased from the Khalal stage to the Rutab and Tamr stages, whereas the fruit pH, TSSs, and sugar content behaved oppositely, and gradually increased from the Khalal to Rutab, and Tamr stage. Khalal stage dates have higher levels of moisture and tannin than dates at the Rutab and Tamr stages of ripening.

3.3. Spectral Reflectance Data

Table 3 shows the spectral reflectance data for eighteen different bands at various frequencies of light, ranging from 410 nm to 940 nm, for the three ripening stages of date fruits: Fresh, Rutab, and Tamr. The reflectance is significantly (p ≤ 0.05) decreased with the change in fruit ripening stage from Khalal to Rutab and Tamr. The data show that the reflectance values vary across different wavelengths and ripening stages. There are significant differences in reflectance values between the ripening stages for some wavelengths, while the differences are not substantial for others. The reflectance was higher when the AS72653 sensor was used at a 535 nm wavelength, whereas it was lower at 485 nm at all three fruit development stages.
Similarly, it was at its maximum at 585 nm, and its minimum at 940 nm, when the sensor AS72652 was used. Using the sensor AS72652, the highest reflectance values were recorded at a 610 nm wavelength, whereas they were lowest at 760 nm. Therefore, the reflectance data of the date fruits at different ripening stages and wavelengths allow for a comprehensive analysis of the spectral characteristics of the fruits during their storage.
Figure 8 displays the mean reflectance values for packaged date fruit samples under modified atmospheres, using the three spectral sensors (As72651, As72652, and AS72653), per storage day point. The mean reflected intensity is reported on the y-axis as an arbitrary unit against the different wavelength settings of the sensor. The data in this curve were obtained via the calculation of the spectral sensor’s mean reflectance value at each wavelength. Each curve in this Figure represents the mean reflectance values of the fruits at different storage conditions for each storage day. In measurements wherein the absolute values cannot be obtained, arbitrary units (au) can be frequently used [51].

3.4. Correlation between Quality and Spectroscopy Data

Table 4 shows the coefficients of correlation between the spectroscopy reflectance data of the As72651, As72652, and AS72653 sensors at different frequencies of light, ranging from 410 nm to 940 nm, and the shelf life parameters of date fruits. This table shows significant correlations (p ≤ 0.01) between the reflectance data and the shelf life parameters of the stored dates. The reflectance data at various wavelengths show moderate to strong positive correlations with the shelf life duration (SLD), MC, and TC of the date fruits. On the contrary, the reflectance data at various wavelengths show moderate to strong negative correlations with the pH, TSSs, and SC of the date fruits. These correlations indicate that the reflectance data can be used as indicators of the quality attributes of date fruits.
Furthermore, Table 4 also indicates strong positive correlations among the shelf life parameters. For example, a strong positive correlation between TSSs and SC indicates that the total soluble solids also increase as the sugar content increases. Similarly, a strong positive correlation between MC and TC suggests that the total carbohydrates also increase as the moisture content increases.
The Edge Impulse platform’s feature explorer option, with color codes for the data according to the label, was used to validate whether the acquired data separated well. For example, the reflectance value concerning the spectral sensor AS7261’s output at W: 860 nm, and its AS7262 output at H: 585 nm, and shelf life is plotted for optimum data visualization for packaged samples in VSBs (Figure 9A) and MAB2 at a 5 °C storage temperature (Figure 9B).
Through examining the various graphs, it becomes evident that there are linear correlations between the reflectance values captured by the spectral sensor, and the shelf life duration. This observation validates the dataset’s strength in being suitable for training the model. Across all subsequent graphs, the x-axis consistently represents the shelf life values. A zero shelf-life value means that the fresh (Khalal) fruits have started turning to Rutab, or spoiled. The fruit becomes half-ripe, softens in texture, and turns light brown. The colors given for the tested samples in Figure 9 were arbitrary, and informed by the Edge Impulse studio application for appropriate visualization. The value of reflectance (au) AS7262 at H: 585 nm is marked as “Re H”; the value of reflectance (au) AS7261 at W: 650 nm is marked as “Ref W”.

3.5. TinyML Prediction Model Evaluation

Table 5 provides the evaluation metric values for validating the TinyML models based on the testing dataset, to predict the date fruits’ shelf life and quality parameters. The TinyML models were evaluated under different packaging types and storage temperatures. The R2, MAE, and RMSE metrics used provide insights into the accuracy and performance of the models in predicting the target parameters. For predicting the shelf life parameters of the stored fruits in unsealed trays (Control) at 5 °C, the models achieved high R2 values, ranging from 0.886 to 0.964, indicating a strong correlation between the predicted and observed values. The MAE values ranged from 0.151 to 2.733, indicating low prediction errors. The RMSE values ranged from 0.166 to 4.121, indicating the general accuracy of the models. Likewise, for the stored fruit at 23 °C, the models achieved high R2 values, ranging from 0.741 to 0.973. The MAE values ranged from 0.171 to 3.142, and the RMSE values ranged from 0.232 to 4.121.
Regarding the stored fruits in the vacuum-sealed bags (VSBs) at 5 °C, the models achieved lower R2 values, ranging from 0.705 to 0.975, compared to the control. The MAE values ranged from 0.172 to 3.418, and the RMSE values ranged from 0.208 to 4.575. In addition, for the VSB condition at 23 °C, the model achieved R2 values ranging from 0.754 to 0.978. The MAE values ranged from 0.125 to 3.146, and the RMSE values ranged from 0.155 to 4.026.
For the modified atmosphere packaging (MAP1) trays sealed with 20% CO2 and N balance at 5 °C, the prediction models achieved R2 values ranging from 0.719 to 0.976. The MAE values ranged from 0.135 to 3.476, and the RMSE values ranged from 0.182 to 4.044. Moreover, for the MAP1 group at 23 °C, the models achieved R2 values ranging from 0.685 to 0.972. The MAE values ranged from 0.235 to 3.573, and the RMSE values ranged from 0.275 to 4.979.
For the modified atmosphere packaging (MAP2) trays sealed with 10% O2, 20% CO2, and N balance at 5 °C, the models achieved high R2 values, ranging from 0.903 to 0.979. The MAE values ranged from 0.088 to 1.863, and the RMSE values ranged from 0.115 to 2.092. Furthermore, for the MAP2 conditions at 23 °C, the models achieved R2 values ranging from 0.751 to 0.966. The MAE values ranged from 0.168 to 2.726, and the RMSE values ranged from 0.192 to 3.403.
The results indicated that the TinyML models showed a promising performance in predicting the fresh fruit shelf life parameters under different packaging types and storage temperatures. The high R2 values and low MAE and RMSE values indicate the accuracy and reliability of the models in predicting the target parameters.
The validation of the developed TinyML models indicated that the obtained results showed promise in predicting the fresh fruit shelf life and quality during the ripening process, as they are experimentally verified for their robustness through validation against the lab results. Figure 10 displays the scatter plots for the predicted values of the shelf life period (Figure 10A), pH (Figure 10B), TSSs (Figure 10C), SC (Figure 10D), MC (Figure 10E), and TC (Figure 10F) of the packaged date fruits under the modified atmosphere and storage temperature conditions versus the values observed by the TinyML models in the evaluation phase, based on the measured reflectance spectroscopy for 18 channels of the spectral sensor. The network structure of the model was two hidden layers with 20 and 12 neurons, respectively, which presented the highest level of accuracy. The results indicated the effectiveness of TinyML models in predicting the quality parameters, and estimating the shelf life of fresh dates packaged under different modified atmospheres. Therefore, a low-cost handheld spectral sensor integrated with a used microcontroller can efficiently predict the quality and shelf life of fresh dates under different packaging conditions.
The regression between the observed and predicted values for the target parameters (i.e., shelf life was y = 0.55 + 0.96 x, pH was y = 0.96 + 0.84 x, TSSs were y = 5.18 + 0.88 x, TS was y = 55.06 + 0.87 x, MC was y = 2.19 + 0.96 x, and y = 0.09 + 0.9 x) nearly overlapped the 1:1 line (y = x + 0). These TinyML models for the shelf life, pH, TSSs, TS, MC, and TC had values of R2 of 0.95, 0.854, 0.893, 0.881, 0.941, and 0.909, respectively.

4. Discussion

4.1. Influence of Storage Conditions on Fresh Dates

Fresh dates are perishable products that can quickly deteriorate if not stored properly. This can lead to waste and financial losses for producers, and pose a health risk to consumers. Large losses are incurred between the cultivator and the consumer in the food product supply chain, predominantly in fruit. Substantial amounts of fruit are produced but not eaten by humans, due to supply chain losses, a component of postharvest losses [52]. Therefore, a suitable preservation method is required during storage, handling, and transport throughout the supply chain, to ensure fruits’ safety and quality [53,54]. Accordingly, this study investigated the influence of different storage conditions on the quality parameters and the shelf life of fresh dates.
The findings of the current study indicated that, although packaging treatments showed a significant positive impact on the fresh fruit percentage at both the temperatures of 5 and 23 °C, compared to the unsealed control treatment, Khalal fruit stored at 5 °C in NAP1 and VSBs remained fresh for up to 30 DOS, compared to other packaging treatments. This treatment had a minimum percentage of Rutab and Tamr fruits after 60 DOS. Khalal fruits stored at both temperatures in VSBs and MAP showed no signs of fruit spoilage. On the other hand, fruits stored at 5 °C in unsealed control bags retained their freshness up to 8 DOS, when it immediately declined to 22 °C. In the unsealed control fruits, the water loss was high, due to which the time taken to reach the fruit development phases (Rutab and Tamr) was reduced, and the fruit spoilage percentage was increased at both temperatures. It might be because the vacuum-sealed and MAP-treated dates were packaged in closed containers to prevent water loss, limiting fruit enzymatic processes and microbial activities [15,55,56,57,58].
Fruits have a high water content, and are metabolically active at the Khalal stage. This makes them more susceptible to unfavorable conditions, causing evaporation from fruits that increases weight loss if they are not properly stored in sealed bags [59,60]. A shift in the fruit’s developmental stage responds to the rise in temperature, as this triggers many of the fruit’s metabolic processes [61]. According to Mortazavi et al. [62], fruits in MAP and vacuum-sealed containers showed the least weight loss and lowest percentage of Rutab and spoilage fruits, whereas, in contrast, these attributes were highest in the unsealed control fruits. Similarly, Khalal fruits of cv. Khalas retained moisture content in a sealed MAP at 0 °C, and showed a negligible weight loss (<1%), compared to the control treatment (14%) after 27 DOS [14]. According to Pesis et al. [63], the oxygen level that remained in the bag after the vacuum packaging of bananas depended on the permeability of the plastic film. In another study, a low amount of O2 and CO2 was estimated in vacuum-sealed banana containers, whereas MAP caused a decrease in O2 and an increase in CO2 concentrations; however, the ethylene did not gather to levels that would induce ripening [64]. The findings of the current study are in line with these investigations. The increase in the shelf life of fresh Khalal fruits stored in vacuum-sealed or MAP bags might be due to the dramatic retardation of the respiration rate because of low oxygen brought about through the modification of the atmosphere. Hence, CO2, a product of respiration, did not accumulate in the VSBs or MAP bags, enhancing the fruit shelf life, and delaying the fruit development phases to Rutab and Tamr [63,64,65]. Generally, fruit characteristics decline as the dates mature. This occurs because the date palm fruit’s cells are disintegrating, and the sugars and TSSs are becoming more concentrated [62,66]. In addition, biochemical changes, enzyme activities, and changes in the membrane permeability can also contribute to the increased TSS levels during fruit ripening. Enzymes lead to the release of glucose and fructose during fruit ripening, and are associated with increased cell wall hydrolyzing enzymes during ripening [67].

4.2. Non-Destructive Estimation of Shelf Life and Quality of Dates

Accurately estimating and predicting fruit quality and shelf life have become pivotal in reducing waste and optimizing supply chain management. Non-destructive evaluation methods, such as imaging and spectroscopic techniques, are used effectively to respond to food quality control challenges, as these analytical methods offer several advantages, such as the rapidity of obtaining results, non-destruction of samples, and the possibility of evaluating the products during the production process [68]. In the current study, a low-cost and fast-inference multispectral sensor-based detector for the reflectance spectroscopy data acquisition of dates during storage was developed. In addition, Edge Impulse was used to develop regression models to estimate the quality and shelf life of packaged dates based on reflectance spectroscopy. The reflectance values indicated the amount of light reflected by the date fruit samples at each wavelength. Higher reflectance values suggest a higher amount of light being reflected, while lower reflectance values indicate a lower amount of light being reflected. As the storage days progressed, the reflectance values at different wavelengths changed, showing the changes in the quality parameters of the date fruit samples. As fruits ripen, their physical and chemical properties change, which affects their reflectance spectra, which can be determined using non-destructive measurement techniques, using sensors [69]. The spectral reflectance results correlated with the quality parameters data, were very realistic, and proved the robustness of the triad spectroscopy sensor used in the testing. Having verified the matching/correctness of the spectral data with the measurement results for all the major quality parameters during the days of storage that affect fruit maturity, the dataset was appropriate for labeling, to train the NN models.
The Edge Impulse platform provided a good structure to build a model. It allowed us to upload the preprocessed data. Therefore, in this experiment, the acquired data were uploaded and indicated as time series data, using the Edge Impulse platform. The dataset assembly comprised separate files (csv) for all data of reflectance value from the three spectral sensors (As72651, As72652, and AS72653) and the quality parameters and shelf life of packaged samples under natural air, VSBs, MAP1, and MAP2 as a numeric value. Then, the dataset was uploaded to the Edge Impulse cloud training platform, to train the regression model. The data were treated as time series data, because it is important to consider the temporal relationships between the data points [35]. The shelf life of a date fruit is not just determined by its moisture content, sugar level, and pH at a single point in time. It is also determined by how these values change over time. For example, a date fruit with a high moisture content and a low sugar level may have a shorter shelf life than a date fruit with a lower moisture content and a higher sugar level. This is because the date fruit with a higher moisture content will lose water more quickly, reducing its sugar level. By treating the data as time series data, we can consider these temporal relationships, and build a more accurate model for predicting the shelf life of date fruits. The Edge Impulse platform allows users to upload diverse types of preprocessed data, including time series data. This makes it easy to use the platform to build models for time series data, such as the model built in this experiment.
The features of TinyML allowed us to deploy the prediction on the microcontroller of Arduino Nano 33 BLE Sense for the non-destructive and real-time prediction of date fruit quality and shelf life, using a spectral sensor and the Edge Impulse platform. With its low power consumption, TinyML supported the applications for battery-powered devices, making it a fitting solution for achieving the objectives of the current study. Furthermore, the identical cost and efficiency advantages create an opportunity to deploy collaborative TinyML systems at the periphery of the cloud-computing network, making it a suitable choice for our proposed research [45,46]. Several ML frameworks support TinyML applications, i.e., TensorFlow Lite for the mobile-based application PyTorch Mobile. and Tensor Flow Lite for Microcontrollers (TFLM). Although it is feasible to construct ML models for mobile devices (by employing TensorFlow Lite) or the web (using TensorFlow.js) using high-level programming languages such as Python or JavaScript, respectively, these languages happen to be more accessible and simpler than C/C++, which is microcontroller friendly and, hence, can be more challenging to learn for users. However, although frameworks such as TensorFlow Lite for Microcontrollers (TFLM) [46] are commonly used for optimizing and compressing neural networks for embedded devices, the adoption rate tends to be slow, due to a set of inimitable challenges unique to embedded ML ecosystem, including data collection, data processing, development, deployment, and monitoring. In response to these challenges, Edge Impulse, an internet-based platform, has been developed, with the aim of streamlining the processes of data collection and deep learning model training, and their subsequent deployment onto embedded and edge computing devices.
A fruit’s spectral signature measurement enables a more precise pigmentation analysis, and is more promising for non-destructive fruit maturity stage evaluation [70]. The diffuse light reflectance of apple fruit in the 400–800 nm wavelength range was examined by Merzlyak et al. [71]. During the storage period, Merzlyak et al. [71] used five apple cultivars, all harvested when fully ripe. They found a significant correlation between various reflectance indices and the chlorophyll content of fruit. However, Zude-Sasse et al. [72] and Zude [73] noted that the correlation between partial transmittance measurements and the maturity stages of apples was stronger, compared to the correlation observed with reflectance measurements in the spectral range spanning 600 to 750 nm. The internal and external quality of citrus fruit can be measured using different wavelength band selections [22]. For tomatoes, an LED-based sensor with a 400–758 nm reflectance spectrum is utilized, to estimate the amount of lycopene [74,75].

5. Conclusions

The current study developed a fast and cost-effective non-destructive technique using TinyML and multispectral sensors to predict/estimate packaged fresh dates’ quality parameters and shelf life under modified atmospheres. The results showed that vacuum and MAP packaging methods could extend the shelf life of fresh dates. The multispectral sensor accurately measured the reflectance spectrum of fresh dates. The TinyML prediction models were trained, using the Edge Impulse platform, to predict the essential quality parameters of the date fruit, including the pH, total soluble solids, sugar content, moisture content, tannin content, and shelf life. The TinyML prediction models accurately predicted fresh dates’ quality and shelf life. The optimal neural network regression model consisted of the input layer with 20 nodes, two hidden layers with 20 and 12 nodes, and an output layer with one neuron for the target quality parameter or shelf life. The models are deployed on microcontrollers, leveraging edge computing to enable real-time inference and decision-making at the data collection point. The models were validated against the observed laboratory results; the findings indicated a strong correlation and a high accuracy. Adopting TinyML technology in the food supply chain offers numerous benefits, including a reduced inference time, and reduced food waste. TinyML technology is considered a cost-effective and efficient solution for estimating the shelf life of fresh dates. The current study’s findings can contribute to advancing sustainable practices in the food and agriculture industry, and reducing food waste. However, it is essential to note that the study’s limitation stems from its focus on a specific cultivar of dates (cv. Khalas) as a case study. The generalizability of these findings to other date cultivars may be limited. Therefore, further study is needed to address this limitation and expand knowledge in the field. In addition, integrating TinyML technology with IoT devices and cloud platforms can enhance data collection, analysis, decision-making capabilities, and the remote monitoring of multiple storage facilities or supply chains.

Author Contributions

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

Funding

This work was funded by the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia (Grant No. GRANT3909).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data are available upon request from the corresponding author.

Acknowledgments

The authors gratefully acknowledge the Date Palm Research Center of Excellence projects DPRC-2020, King Faisal University, Saudi Arabia, for the logistic support and equipment availability in the engineering laboratories of the precision engineering technologies program, through the support of DPRC-2-2020, which aims to sort and grade dates using advanced technologies.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. 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]
  2. Faostat-FAO Food and Agriculture Organization of the United Nations. Available online: https://www.fao.org/faostat/en/#data. (accessed on 20 April 2023).
  3. Ali-Dinar, H.; Mohammed, M.; Munir, M. Effects of Pollination Interventions, Plant Age and Source on Hormonal Patterns and Fruit Set of Date Palm (Phoenix dactylifera L.). Horticulturae 2021, 7, 427. [Google Scholar] [CrossRef]
  4. Mohammed, M.; Sallam, A.; Alqahtani, N.; Munir, M. The Combined Effects of Precision-Controlled Temperature and Relative Humidity on Artificial Ripening and Quality of Date Fruit. Foods 2021, 10, 2636. [Google Scholar] [CrossRef] [PubMed]
  5. Altaheri, H.; Alsulaiman, M.; Muhammad, G.; Amin, S.U.; Bencherif, M.; Mekhtiche, M. Date Fruit Dataset for Intelligent Harvesting. Data Brief 2019, 26, 104514. [Google Scholar] [CrossRef] [PubMed]
  6. 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] [PubMed]
  7. 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]
  8. 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]
  9. 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]
  10. 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]
  11. 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]
  12. Al-Kaabi, H.J. Effect of Modified Atmosphere Packaging on Quality of Barhi Dates at Khalal Stage. Int. J. Food Stud. 2020, 9, SI125–SI134. [Google Scholar] [CrossRef]
  13. Mahajan, P.V.; Oliveira, F.A.R.; Montanez, J.C.; Frias, J. Development of User-Friendly Software for Design of Modified Atmosphere Packaging for Fresh and Fresh-Cut Produce. Innov. Food Sci. Emerg. Technol. 2007, 8, 84–92. [Google Scholar] [CrossRef]
  14. Al-Eid, S.M.; Barber, A.R.; Rettke, M.; Leo, A.; Alsenaien, W.A.; Sallam, A.A.; Aleid, S.M.; Barber, A.R.; Rettke, M.; Leo, A.; et al. Utilisation of Modified Atmosphere Packaging to Extend the Shelf Life of Khalas Fresh Dates. Int. J. Food Sci. Technol. 2012, 47, 1518–1525. [Google Scholar] [CrossRef]
  15. Moradinezhad, F.; Dorostkar, M. Effect of Vacuum and Modified Atmosphere Packaging on the Quality Attributes and Sensory Evaluation of Fresh Jujube Fruit. Int. J. Fruit Sci. 2021, 21, 82–94. [Google Scholar] [CrossRef]
  16. Jemni, M.; Chniti, S.; Ferchichi, A.; Artés, F.; Jemni, M.; Chniti, S.; Harbaoui, K.; Ferchichi, A.; Artés, F. Partial Vacuum and Active Modified Atmosphere Packaging for Keeping Overall Quality of Dates. J. New Sci. Agric. Biotechnol. 2016, 29, 1656–1665. [Google Scholar]
  17. Yam, K.L.; Takhistov, P.T.; Miltz, J. Intelligent Packaging: Concepts and Applications. J. Food Sci. 2005, 70, R1–R10. [Google Scholar] [CrossRef]
  18. 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]
  19. 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]
  20. del Río Celestino, M.; Font, R. Using Vis-NIR Spectroscopy for Predicting Quality Compounds in Foods. Sensors 2022, 22, 4845. [Google Scholar] [CrossRef]
  21. Chen, A.; Orlov-Levin, V.; Meron, M. Applying High-Resolution Visible-Channel Aerial Imaging of Crop Canopy to Precision Irrigation Management. Agric. Water Manag. 2019, 216, 196–205. [Google Scholar] [CrossRef]
  22. Magwaza, L.S.; Opara, U.L.; Nieuwoudt, H.; Cronje, P.J.R.; Saeys, W.; Nicolaï, B. NIR Spectroscopy Applications for Internal and External Quality Analysis of Citrus Fruit-A Review. Food Bioprocess Technol. 2012, 5, 425–444. [Google Scholar] [CrossRef]
  23. 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]
  24. 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]
  25. 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]
  26. 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]
  27. 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]
  28. Basak, J.K.; Madhavi, B.G.K.; Paudel, B.; Kim, N.E.; Kim, H.T. Prediction of Total Soluble Solids and PH of Strawberry Fruits Using RGB, HSV and HSL Colour Spaces and Machine Learning Models. Foods 2022, 11, 2086. [Google Scholar] [CrossRef]
  29. 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]
  30. 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 Xi/Spectrosc. Spectr. Anal. 2020, 40, 1940–1946. [Google Scholar]
  31. Mohd Ali, M.; Hashim, N.; Abd Aziz, S.; Lasekan, O. Shelf Life Prediction and Kinetics of Quality Changes in Pineapple (Ananas comosus) Varieties at Different Storage Temperatures. Horticulturae 2022, 8, 992. [Google Scholar] [CrossRef]
  32. Srinivasagan, R.; Mohammed, M.; Alzahrani, A. TinyML-Sensor for Shelf Life Estimation of Fresh Date Fruits. Sensors 2023, 23, 7081. [Google Scholar] [CrossRef]
  33. Cao, M.; Wang, D.; Qiu, L.; Ren, X.; Ma, H. Shelf Life Prediction of ‘Royal Gala’ Apples Based on Quality Attributes and Storage Temperature. Hortic. Sci. Technol. 2021, 39, 343–355. [Google Scholar] [CrossRef]
  34. 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]
  35. Mohammed, M.; Hamdoun, H.; Sagheer, A. Toward Sustainable Farming: Implementing Artificial Intelligence to Predict Optimum Water and Energy Requirements for Sensor-Based Micro Irrigation Systems Powered by Solar PV. Agronomy 2023, 13, 1081. [Google Scholar] [CrossRef]
  36. Mohammed, M.; El-Shafie, H.; Munir, M. Development and Validation of Innovative Machine Learning Models for Predicting Date Palm Mite Infestation on Fruits. Agronomy 2023, 13, 494. [Google Scholar] [CrossRef]
  37. Faisal, M.; Albogamy, F.; Elgibreen, H.; Algabri, M.; Alqershi, F.A. Deep Learning and Computer Vision for Estimating Date Fruits Type, Maturity Level, and Weight. IEEE Access 2020, 8, 206770–206782. [Google Scholar] [CrossRef]
  38. Albarrak, K.; Gulzar, Y.; Hamid, Y.; Mehmood, A.; Soomro, A.B. A Deep Learning-Based Model for Date Fruit Classification. Sustainability 2022, 14, 6339. [Google Scholar] [CrossRef]
  39. Aiadi, O.; Kherfi, M.L. A New Method for Automatic Date Fruit Classification. Int. J. Comput. Vis. Robot. 2017, 7, 692. [Google Scholar] [CrossRef]
  40. Bhole, V.; Kumar, A. A Transfer Learning-Based Approach to Predict the Shelf Life of Fruit. Intel. Artif. 2021, 24, 102–120. [Google Scholar] [CrossRef]
  41. Faisal, M.; Alsulaiman, M.; Arafah, M.; Mekhtiche, M.A. IHDS: Intelligent Harvesting Decision System for Date Fruit Based on Maturity Stage Using Deep Learning and Computer Vision. IEEE Access 2020, 8, 167985–167997. [Google Scholar] [CrossRef]
  42. Nasiri, A.; Taheri-Garavand, A.; Zhang, Y.-D. Image-Based Deep Learning Automated Sorting of Date Fruit. Postharvest Biol. Technol. 2019, 153, 133–141. [Google Scholar] [CrossRef]
  43. Iorliam, I.B.; Ikyo, B.A.; Iorliam, A.; Okube, E.O.; Kwaghtyo, K.D.; Shehu, Y.I. Application of Machine Learning Techniques for Okra Shelf Life Prediction. J. Data Anal. Inf. Process. 2021, 9, 136–150. [Google Scholar] [CrossRef]
  44. Cao, K.; Liu, Y.; Meng, G.; Sun, Q. An Overview on Edge Computing Research. IEEE Access 2020, 8, 85714–85728. [Google Scholar] [CrossRef]
  45. Janapa Reddi, V.; Plancher, B.; Kennedy, S.; Moroney, L.; Warden, P.; Suzuki, L.; Agarwal, A.; Banbury, C.; Banzi, M.; Bennett, M.; et al. Widening Access to Applied Machine Learning with TinyML. Harvard Data Sci. Rev. 2022, 4, 1–38. [Google Scholar] [CrossRef]
  46. Hymel, S.; Banbury, C.; Situnayake, D.; Elium, A.; Ward, C.; Kelcey, M.; Baaijens, M.; Majchrzycki, M.; Plunkett, J.; Tischler, D.; et al. Edge Impulse: An MLOps Platform for Tiny Machine Learning. arXiv 2022, arXiv:2212.03332. [Google Scholar] [CrossRef]
  47. AOAC (Association of Official Analytical Chemists). Official Methods of Analysis of AOAC International, 19th ed.; Publisher Gaithersburg, AOAC International: Washington, DC, USA, 2012. [Google Scholar]
  48. Zhang, C.-R.; Aldosari, S.A.; Vidyasagar, P.S.P.V.; Shukla, P.; Nair, M.G. Determination of the Variability of Sugars in Date Fruit Varieties. J. Plant. Crop. 2015, 43, 53–61. [Google Scholar]
  49. Taira, S. Astringency in Persimmon. In Modern Methods of Plant Analysis; Linskens, H.F., Paech, K., Sanwal, B.D., Tracey, M.V., Eds.; Springer: Berlin/Heidelberg, Germany, 1996; pp. 97–110. [Google Scholar]
  50. AMS-OSRAM Datasheet. Available online: https://ams-osram.com/support/technical-support-form (accessed on 18 June 2023).
  51. Heydarov, S.; Aydin, M.; Faydaci, C.; Tuna, S.; Ozturk, S. Low-Cost VIS/NIR Range Hand-Held and Portable Photospectrometer and Evaluation of Machine Learning Algorithms for Classification Performance. Eng. Sci. Technol. an Int. J. 2023, 37, 101302. [Google Scholar] [CrossRef]
  52. 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).
  53. 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]
  54. 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]
  55. Saltveit, M.E. Biological Basis for CA and MA. In Controlled and Modified Atmospheres for Fresh and Fresh-Cut Produce; Gil, M.I., Beaudry, R., Eds.; Academic Press: London, UK, 2020; pp. 3–22. ISBN 9780128045992. [Google Scholar]
  56. Alegbeleye, O.; Odeyemi, O.A.; Strateva, M.; Stratev, D. Microbial Spoilage of Vegetables, Fruits and Cereals. Appl. Food Res. 2022, 2, 100122. [Google Scholar] [CrossRef]
  57. Chen, J.; Xu, Y.; Yi, Y.; Hou, W.; Wang, L.; Ai, Y.; Wang, H.; Min, T. Regulations and Mechanisms of 1-Methylcyclopropene Treatment on Browning and Quality of Fresh-Cut Lotus (Nelumbo nucifera Gaertn.) Root Slices. Postharvest Biol. Technol. 2022, 185, 111782. [Google Scholar] [CrossRef]
  58. Wanakamol, W.; Kongwong, P.; Chuamuangphan, C.; Bundhurat, D.; Boonyakiat, D.; Poonlarp, P. Hurdle Approach for Control of Enzymatic Browning and Extension of Shelf Life of Fresh-Cut Leafy Vegetables Using Vacuum Precooling and Modified Atmosphere Packaging: Commercial Application. Horticulturae 2022, 8, 745. [Google Scholar] [CrossRef]
  59. Ashraf, Z.; Hamidi-Esfahani, Z. Date and Date Processing: A Review. Food Rev. Int. 2011, 27, 101–133. [Google Scholar] [CrossRef]
  60. Sarraf, M.; Jemni, M.; Kahramanoğlu, I.; Artés, F.; Shahkoomahally, S.; Namsi, A.; Ihtisham, M.; Brestic, M.; Mohammadi, M.; Rastogi, A. Commercial Techniques for Preserving Date Palm (Phoenix dactylifera) Fruit Quality and Safety: A Review. Saudi J. Biol. Sci. 2021, 28, 4408–4420. [Google Scholar] [CrossRef] [PubMed]
  61. Alikhani-Koupaei, M.; Fatahi, R.; Zamani, Z.; Salimi, S. Effects of Deficit Irrigation on Some Physiological Traits, Production and Fruit Quality of ‘Mazafati’ Date Palm and the Fruit Wilting and Dropping Disorder. Agric. Water Manag. 2018, 209, 219–227. [Google Scholar] [CrossRef]
  62. Mortazavi, S.M.H.; Arzani, K.; Barzegar, M. Effect of Vacuum and Modified Atmosphere Packaging on the Postharvest Quality and Shelf Life of Date Fruits in Khalal Stage. Acta Hortic. 2007, 736, 471–477. [Google Scholar] [CrossRef]
  63. Pesis, E.; Ben Arie, R.; Feygenberg, O.; Villamizar, F. Ripening of Ethylene-Pretreated Bananas Is Retarded Using Modified Atmosphere and Vacuum Packaging. HortScience 2005, 40, 726–731. [Google Scholar] [CrossRef]
  64. Esguerra, E.; Del Carmen, D.; Reyes, R.; Lualhati, R. Vacuum Packaging Controlled Crown Rot of Organically-Grown Balangon (Musa Acuminata AAA Group) Banana. Horticulturae 2016, 3, 14. [Google Scholar] [CrossRef]
  65. Kader, A.A. Regulation of Fruit Physiology by Controlled/Modified Atmospheres. Acta Hortic. 1995, 398, 59–70. [Google Scholar] [CrossRef]
  66. Khodabakhshian, R.; Khojastehpour, M. Characteristics Changes of Date Fruits during Ripening Period on-Palm. Agric. Eng. Int. CIGR J. 2021, 23, 243–255. [Google Scholar]
  67. Rastegar, S.; Rahemi, M.; Baghizadeh, A.; Gholami, M. Enzyme Activity and Biochemical Changes of Three Date Palm Cultivars with Different Softening Pattern during Ripening. Food Chem. 2012, 134, 1279–1286. [Google Scholar] [CrossRef]
  68. 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]
  69. Kumar, R.; Paul, V.; Pandey, R.; Sahoo, R.N.; Gupta, V.K. Reflectance Based Non-Destructive Determination of Colour and Ripeness of Tomato Fruits. Physiol. Mol. Biol. Plants 2022, 28, 275–288. [Google Scholar] [CrossRef] [PubMed]
  70. Merzlyak, M.N.; Solovchenko, A.E. Photostability of Pigments in Ripening Apple Fruit: A Possible Photoprotective Role of Carotenoids during Plant Senescence. Plant Sci. 2002, 163, 881–888. [Google Scholar] [CrossRef]
  71. Merzlyak, M.N.; Solovchenko, A.E.; Gitelson, A.A. Reflectance Spectral Features and Non-Destructive Estimation of Chlorophyll, Carotenoid and Anthocyanin Content in Apple Fruit. Postharvest Biol. Technol. 2003, 27, 197–211. [Google Scholar] [CrossRef]
  72. Zude-Sasse, M.; Truppel, I.; Herold, B. An Approach to Non-Destructive Apple Fruit Chlorophyll Determination. Postharvest Biol. Technol. 2002, 25, 123–133. [Google Scholar] [CrossRef]
  73. Zude, M. Comparison of Indices and Multivariate Models to Non-Destructively Predict the Fruit Chlorophyll by Means of Visible Spectrometry in Apple Fruit. Anal. Chim. Acta 2003, 481, 119–126. [Google Scholar] [CrossRef]
  74. Mignani, A.G.; Ciaccheri, L.; Mencaglia, A.A.; Tuccio, L.; Agati, G. Application of a LED-Based Reflectance Sensor for the Assessing in Situ the Lycopene Content of Tomatoes (Lycopersicon esculentum Mill.). In Proceedings of the Sensing for Agriculture and Food Quality and Safety VII, Baltimore, MD, USA, 13 May 2015; Kim, M.S., Chao, K., Chin, B.A., Eds.; SPIE: Bellingham, WA, USA, 2015; Volume 9488, pp. 18–23. [Google Scholar]
  75. Liu, C.; Liu, W.; Chen, W.; Yang, J.; Zheng, L. Feasibility in Multispectral Imaging for Predicting the Content of Bioactive Compounds in Intact Tomato Fruit. Food Chem. 2015, 173, 482–488. [Google Scholar] [CrossRef] [PubMed]
Figure 1. AS7265x 18-channel spectral responsivity [50].
Figure 1. AS7265x 18-channel spectral responsivity [50].
Sustainability 15 12871 g001aSustainability 15 12871 g001b
Figure 2. TinyML prediction model workflow.
Figure 2. TinyML prediction model workflow.
Sustainability 15 12871 g002
Figure 3. The TinyML-based prediction models’ block diagram uses the spectral sensor to estimate date fruit shelf life and quality parameters.
Figure 3. The TinyML-based prediction models’ block diagram uses the spectral sensor to estimate date fruit shelf life and quality parameters.
Sustainability 15 12871 g003
Figure 4. A sample diagram for the applied neural network architecture.
Figure 4. A sample diagram for the applied neural network architecture.
Sustainability 15 12871 g004
Figure 5. The active unit of artificial neural networks.
Figure 5. The active unit of artificial neural networks.
Sustainability 15 12871 g005
Figure 6. Impact of the packaging type on the stored fresh date fruits. (A,B) Unsealed trays (Control) at 5 and 22 °C, (C,D) VSBs at 5 and 22 °C, (E,F) modified atmosphere packaging (MAP) trays sealed with 20% CO2 and N balance, at 5 and 22 °C. (G,H) MAP trays sealed with 10% O2, 20% CO2, and N balance, at 5 and 22 °C.
Figure 6. Impact of the packaging type on the stored fresh date fruits. (A,B) Unsealed trays (Control) at 5 and 22 °C, (C,D) VSBs at 5 and 22 °C, (E,F) modified atmosphere packaging (MAP) trays sealed with 20% CO2 and N balance, at 5 and 22 °C. (G,H) MAP trays sealed with 10% O2, 20% CO2, and N balance, at 5 and 22 °C.
Sustainability 15 12871 g006
Figure 7. Impact of the various packaging atmosphere conditions on the shelf life of fresh date fruits at different storage temperatures.
Figure 7. Impact of the various packaging atmosphere conditions on the shelf life of fresh date fruits at different storage temperatures.
Sustainability 15 12871 g007
Figure 8. The mean reflectance values at 18 wavelengths for the packaged date fruit samples under modified atmospheres, using the three spectral sensors (As72651, As72652, and AS72653), per storage interval.
Figure 8. The mean reflectance values at 18 wavelengths for the packaged date fruit samples under modified atmospheres, using the three spectral sensors (As72651, As72652, and AS72653), per storage interval.
Sustainability 15 12871 g008
Figure 9. Data visualization plots for two packaged samples in VSBs at 5 °C (A), and at 22 °C (B). Ref H refers to the reflectance value (au) of AS7262 at H: 585 nm, and Ref W refers to the reflectance value (au) of AS7261 at W: 650 nm.
Figure 9. Data visualization plots for two packaged samples in VSBs at 5 °C (A), and at 22 °C (B). Ref H refers to the reflectance value (au) of AS7262 at H: 585 nm, and Ref W refers to the reflectance value (au) of AS7261 at W: 650 nm.
Sustainability 15 12871 g009
Figure 10. The plot of the predicted versus observed values of the shelf life (A), pH (B), total soluble solids (C), sugar content (D), moisture content (E), and tannin content (F) of date palm fruits based on data from samples collected during packaging under different modified atmosphere and temperature conditions, showing data points (circles) and the y = x line (solid line).
Figure 10. The plot of the predicted versus observed values of the shelf life (A), pH (B), total soluble solids (C), sugar content (D), moisture content (E), and tannin content (F) of date palm fruits based on data from samples collected during packaging under different modified atmosphere and temperature conditions, showing data points (circles) and the y = x line (solid line).
Sustainability 15 12871 g010
Table 1. Network information for the NN Block to predict the quality parameters and shelf life of packaged date fruits under each packaging type and storage temperature condition, and to predict the quality parameters of packaged fruits at all packaging types and storage temperatures.
Table 1. Network information for the NN Block to predict the quality parameters and shelf life of packaged date fruits under each packaging type and storage temperature condition, and to predict the quality parameters of packaged fruits at all packaging types and storage temperatures.
ParametersSpecifications
Prediction of the Parameters under Each Packaging and Temperature ConditionPrediction of the Quality Parameters of the Packaged Fruits
Model type Sequential
Input layer 18 inputs: As72651, As72652, and AS72653 sensors data (A, B, C, D, E, F, G, H, I, J, K, L, R, S, T, U, V, and W)20 inputs: As72651, As72652, and AS72653 sensors data (18) + Packaging types (1) + Storage temperatures (1)
Hidden layer 1 18 nodes20 nodes
Hidden layer 210 nodes12 nodes
Dropout rate0.2
Output layer 1 node (Y-Predicted shelf life or one target
quality parameter under each treatment)
1 node (Y-Predicted one target quality
parameter or overall shelf life)
Activation function ReLu
Size of the Batch 32
Epochs numbers10
OptimizationAdam
Loss functionMSE
Cycles of training 2000
Learning rate0.005
Valid Dataset70168
Dataset—Training (80%)56135
Dataset—Testing (20%)1433
Validation dataset168168
Table 2. Mean values of quality attributes of the dates during the ripening stages.
Table 2. Mean values of quality attributes of the dates during the ripening stages.
Ripening Stage Quality Attributes
pHTSSs (Brix)Sugar (%)MC (%)Tannin (%)
Fresh (Khalal)5.46 ± 0.43 C36.45 ± 5.23 C34.95 ± 5.56 C59.23 ± 6.42 A1.88 ± 0.83 A
Rutab6.15 ± 0.35 B48.06 ± 5.81 B46.83 ± 5.74 B42.3 ± 8.26 B0.41 ± 0.51 B
Tamr6.59 ± 0.21 A62.27 ± 6.42 A61.28 ± 4.58 A22.48 ± 3.61 C0.08 ± 0.11 C
Total5.87 ± 0.5443.93 ± 9.7442.6 ± 9.8248.39 ± 13.511.06 ± 1.13
The mean (n = 56 and n total = 168) ± standard deviation is presented. The means with the same letters within each column are not significantly different at p ≤ 0.05.
Table 3. The sensors’ reflectance data of the eighteen bands at different frequencies of light ranging from 410 nm to 940 nm at the different date fruit ripening stages.
Table 3. The sensors’ reflectance data of the eighteen bands at different frequencies of light ranging from 410 nm to 940 nm at the different date fruit ripening stages.
SensorsWavelength (λ)Ripening Stage
FreshRutabTamr
AS72653A: 410 nm1158.5 ± 99.5 a981.6 ± 80.8 b810 ± 40.1 c
B: 435 nm595.2 ± 76.1 a 435.9 ± 77.5 b308.8 ± 15.2 c
C: 460 nm1354.3 ± 205 a981.6 ± 208.5 b715.2 ± 60.5 c
D: 485 nm584.7 ± 95.6 a392.9 ± 88.5 b263.4 ± 91.8 bc
E: 510 nm1474.3 ± 280.2 a883.9 ± 339.2 b370.6 ± 18.5 c
F: 535 nm3348.5 ± 555.9 a1956 ± 833.6 b563.6 ± 49.6 c
AS72652G: 560 nm2162.4 ± 326.9 a1419.8 ± 463.6 b683.8 ± 136.4 c
H: 585 nm2644.1 ± 354.3 a1715.1 ± 561.2 b684.7 ± 65.5 c
I: 645 nm1944.1 ± 215.1 a1282.6 ± 396.6 b479.6 ± 41.4 c
J: 705 nm731.6 ± 60.2 a516.5 ± 155.9 b197.2 ± 20.8 c
K: 900 nm1139.3 ± 122.5 a779.4 ± 219.6 b347.8 ± 42.1 c
L: 940 nm1089.8 ± 86.1 a758.1 ± 143.3 b379.4 ± 47.1 c
AS72651R: 610 nm4407.7 ± 799.6 a2937.6 ± 131.1 b1012.4 ± 170.7 c
S: 680 nm1115.5 ± 119.3 a865.3 ± 193.5 b473.4 ± 55.6 c
T: 730 nm528.3 ± 55.5 a388.4 ± 111.1 b170.3 ± 107.3 bc
U: 760 nm308.7 ± 63.5 a239.2 ± 61.9 a124.2 ± 22.33 c
V: 810 nm862.7 ± 93.5 a678.5 ± 187.7 b345.2 ± 56.56 c
W: 860 nm1167.7 ± 114.4 a1003.1 ± 199.1 b650.2 ± 87.5 c
The values are the mean (n = 20) ± standard deviation. The means with the same letters within each row are not significantly different at p ≤ 0.05.
Table 4. The correlation among the three sensors’ reflectance data of the eighteen bands at different frequencies of light, ranging from 410 nm to 940 nm, and the date fruits’ shelf life and their quality attributes.
Table 4. The correlation among the three sensors’ reflectance data of the eighteen bands at different frequencies of light, ranging from 410 nm to 940 nm, and the date fruits’ shelf life and their quality attributes.
Wavelength (λ) SLpHTSSsSCMCTC
SL1−0.517 **−0.680 **−0.704 **0.710 **0.857 **
pH−0.517 **10.820 **0.819 **−0.400 **−0.527 **
TSSs−0.680 **0.820 **10.995 **−0.764 **−0.767 **
SC−0.704 **0.819 **0.995 **1−0.783 **−0.784 **
MC0.710 **−0.400 **−0.764 **−0.783 **10.826 **
TC0.857 **−0.527 **−0.767 **−0.784 **0.826 **1
A: 410 nm0.718 **−0.166 *−0.553 **−0.578 **0.891 **0.773 **
B: 435 nm0.743 **−0.361 **−0.682 **−0.701 **0.904 **0.802 **
C: 460 nm0.747 **−0.359 **−0.653 **−0.671 **0.865 **0.791 **
D: 485 nm0.799 **−0.409 **−0.704 **−0.728 **0.895 **0.832 **
E: 510 nm0.740 **−0.454 **−0.723 **−0.746 **0.885 **0.789 **
F: 535 nm0.663 **−0.453 **−0.728 **−0.748 **0.875 **0.741 **
G: 560 nm0.672 **−0.397 **−0.680 **−0.699 **0.872 **0.733 **
H: 585 nm0.680 **−0.410 **−0.707 **−0.727 **0.899 **0.747 **
I: 645 nm0.678 **−0.408 **−0.721 **−0.742 **0.916 **0.751 **
J: 705 nm0.583 **−0.357 **−0.668 **−0.689 **0.883 **0.671 **
K: 900 nm0.681 **−0.391 **−0.703 **−0.725 **0.911 **0.744 **
L: 940 nm0.707 **−0.377 **−0.698 **−0.721 **0.921 **0.767 **
R: 610 nm0.630 **−0.390 **−0.686 **−0.711 **0.862 **0.717 **
S: 680 nm0.575 **−0.296 **−0.626 **−0.650 **0.844 **0.675 **
T: 730 nm0.597 **−0.344 **−0.662 **−0.684 **0.874 **0.685 **
U: 760 nm0.576 **−0.301 **−0.622 **−0.645 **0.849 **0.662 **
V: 810 nm0.542 **−0.276 **−0.588 **−0.614 **0.818 **0.620 **
W: 860 nm0.487 **−0.158 *−0.478 **−0.508 **0.742 **0.546 **
** Correlation is significant at the level of 0.01 and * correlation is significant at the level of 0.05.
Table 5. Evaluation metrics for the TinyML model predicting the date fruit shelf life and quality parameters under different packaging types and storage temperatures.
Table 5. Evaluation metrics for the TinyML model predicting the date fruit shelf life and quality parameters under different packaging types and storage temperatures.
Packaging TypeTemperatureEvaluation
Metrics
Parameters
Shelf Life PeriodpHTSSSugarMoisture Tannin
Control5 °CR20.9640.8860.9090.9330.9330.952
MAE0.9110.1513.2912.5432.7330.255
RMSE1.3360.1663.9253.3814.1210.349
22 °CR20.9250.7410.9140.9120.9730.922
MAE1.0760.1712.9623.1421.8420.219
RMSE1.4870.2323.8033.8412.1570.305
VSBs5 °CR20.9750.7820.7980.7050.8840.956
MAE2.0540.1722.7713.4182.0480.209
RMSE2.5870.2083.7184.5753.2670.252
22 °CR20.9780.9080.9220.7540.9390.925
MAE1.6220.1252.1723.1462.1270.259
RMSE1.9420.1552.6914.0262.7070.334
MAP15 °CR20.9760.8510.7190.7230.9340.869
MAE1.2590.1352.8633.4761.9020.285
RMSE1.5710.1824.0443.9972.8420.383
22 °CR20.9720.6850.8830.8480.8690.929
MAE1.5120.2352.3832.5113.5730.251
RMSE2.1870.2752.9443.3494.9790.323
MAP25 °CR20.9790.9650.9750.9570.9730.903
MAE1.3480.0881.2811.8631.3510.257
RMSE1.5550.1151.6212.0921.7730.323
22 °CR20.9660.7510.9090.9460.9610.937
MAE1.3710.1682.7261.9442.1240.221
RMSE1.7850.1923.4032.7982.8790.286
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

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. https://doi.org/10.3390/su151712871

AMA Style

Mohammed M, Srinivasagan R, Alzahrani A, Alqahtani NK. Machine-Learning-Based Spectroscopic Technique for Non-Destructive Estimation of Shelf Life and Quality of Fresh Fruits Packaged under Modified Atmospheres. Sustainability. 2023; 15(17):12871. https://doi.org/10.3390/su151712871

Chicago/Turabian Style

Mohammed, Maged, Ramasamy Srinivasagan, Ali Alzahrani, and Nashi K. Alqahtani. 2023. "Machine-Learning-Based Spectroscopic Technique for Non-Destructive Estimation of Shelf Life and Quality of Fresh Fruits Packaged under Modified Atmospheres" Sustainability 15, no. 17: 12871. https://doi.org/10.3390/su151712871

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