A recent study published in the journal Sensors introduces an innovative approach using TinyML (tiny machine learning) sensors and models to estimate the shelf life of fresh dates in a non-destructive manner.
Maintaining the quality and freshness of dates is critical to reduce food losses, ensure a steady supply chain, and provide maximum nutrition to consumers. Therefore, accurate and rapid date shelf-life prediction is an important need. Conventional laboratory testing of quality parameters like moisture content requires destructive sampling and is time-consuming and expensive. The present study aimed to develop a non-destructive approach using emerging technologies for real-time, on-site estimation of date shelf life.
Lightweight TinyML System for On-Device Inference
A major contribution of this study was the development of a low-cost, compact machine learning system to enable non-invasive evaluation and prediction of date shelf life in real-time at the point of use. The researchers designed a novel TinyML architecture integrating a small near-infrared (NIR) spectral sensor with an Arduino Nano 33 BLE Sense microcontroller.
The NIR sensor non-destructively acquires spectral data strongly correlated to internal quality parameters of date fruits like moisture content and sugar levels. The Arduino microcontroller transmits this spectral data wirelessly to the Edge Impulse platform. Within Edge Impulse, optimized machine-learning regression models are trained on the sensor inputs to predict the remaining shelf life of the sampled dates. The final regression model is then deployed back onto the Arduino for efficient low-power inferencing of shelf life on the resource-constrained device.
This edge computing approach eliminates the need for continuous cloud connectivity during runtime. The portability of the TinyML system further enables convenient monitoring of date batches at various points across supply chain logistics to estimate real-time shelf life. For example, it can be used to rapidly check shelf life at packing facilities, warehouses, transport vehicles, and retail outlets.
Strategic Design of Miniaturized NIR Sensor
A key breakthrough in this research was the strategic development of a miniaturized NIR spectrometer tailored for non-destructive assessment of agricultural produce quality. Conventional laboratory-scale NIR devices are bulky, expensive, and non-portable.
The study designed an ultra-compact 18-channel visible-shortwave NIR spectral sensor optimized for date fruit monitoring. It incorporates three integrated optical sensors with six wavelengths each, totaling 18 narrow 20nm bandwidth channels spanning 410nm to 940nm. The sensor is specially configured to capture NIR absorption peaks specific to key date fruit quality metabolites like sugars and moisture content.
The credit-card-sized sensor integrates emitter LEDs, optical filters, and detectors, eliminating the need for external light sources or dispersive elements. The spectral measurements are processed by the integrated microcontroller to produce sensor outputs strongly correlated to internal fruit quality. This enables the acquisition of spectra linked to date shelf life non-destructively for machine learning integration.
Machine Learning Models for Predicting Shelf Life
The spectral data obtained non-invasively from the miniature NIR sensor are provided as inputs to regression models implemented within the Edge Impulse platform. This facilitated the development and optimization of neural network models tailored specifically for predicting date shelf life based on the input sensor spectra.
The sensor outputs are transmitted over Bluetooth to the Edge Impulse cloud, where the models are trained and validated on the spectral data before deploying the final regression model back onto the low-power Arduino device. This allows the model to perform shelf-life predictions on the microcontroller based solely on the sensor spectra acquired in real time. The optimized models achieved over 93% prediction accuracy across diverse experimental storage conditions.
Experimental Validation Using Different Packaging Methods
To validate the effectiveness of the proposed approach, fresh Khalal stage dates were stored under different conditions, including vacuum packaging and modified atmosphere packaging at refrigeration and ambient temperatures. Standard laboratory analysis was conducted weekly during storage to determine the evolution of quality parameters and actual shelf life over time.
The TinyML system was utilized to non-destructively predict the shelf life of dates across the investigated packaging methods and temperatures. Results demonstrated that vacuum packaging extended shelf life to 53 days at 5°C compared to just 10 days for unpackaged dates kept at 24°C ambient conditions. Across all conditions, the system achieved over 93% accuracy in predicting date shelf life relative to the true shelf life, highlighting its robustness.
Broader Applications for Agriculture and Food Sectors
The research emphasizes the significant potential of leveraging emerging technologies like machine learning algorithms and miniature spectrometers for non-destructive evaluation of food quality and safety. The portable, inexpensive system can rapidly estimate the remaining shelf life of perishable fruits, like dates without requiring lengthy lab testing procedures.
More accurate predictions of remaining shelf life can assist in optimizing date inventory management, storage protocols and transport conditions to minimize losses. It also ensures dates are consumed closer to peak freshness and nutritional value. The successful application to dates can pave the way for expanding such sensor-based machine learning techniques across diverse agriculture and food sectors to improve productivity and sustainability.
Overall, this pioneering research puts forth an innovative non-destructive solution for assessing produce quality and predicting shelf life using compact NIR spectroscopy and edge intelligence. The findings provide valuable insights into leveraging AI-enabled TinyML sensors to enhance monitoring practices and reduce waste for fresh fruits and other perishable commodities.