A Multispectral Framework for the Detection of Calcium Carbide-Induced Ripening and Shelf-Life Estimation in Climacteric Fruits

arXiv:2608.13073 · cs.LG · Submitted 2026-08-13 · Read on arXiv

Gurbhit Chaurakoti, Harshit Kumar, Hani Kumar, Anurag Singh, Ram Asrey

National Institute of Technology Delhi · ICAR-Indian Agricultural Research Institute

cs.LG

Submitted: 2026-08-13

Updated: 2026-08-14

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

Importance score: 75/100

The gist: The proposed study explores a novel, non-invasive multispectral framework for distinguishing safely ripened fruits (naturally ripened and ethephon-induced) from calcium carbide-ripened samples, while

Terminology

Summary

The proposed study explores a novel, non-invasive multispectral framework for distinguishing safely ripened fruits (naturally ripened and ethephon-induced) from calcium carbide-ripened samples, while also estimating their ripening progression (in percentage) and remaining shelf life (in days). The spectral profiles of Mango (Mangifera indica) and Banana (Musa acuminata) at 18 discrete wavelengths in the visible-near infrared (NIR) range (410 nm – 940 nm) are studied using the AS7265x spectral triad sensor. CaC2 treated samples exhibit sharper spectral intensity drops in the visible region wavelengths, consistent with accelerated chlorophyll degradation and carotenoid development. To characterize these physiological changes, the feature engineering strategy integrates inter-method spectral variance, intensity ratios at distinct wavelengths, and environmental parameters including temperature and humidity. Dimensionality reduction using Principal Component Analysis (PCA) retains >90% of spectral variance within the first 5–7 components. The resulting feature set is used to train three independent eXtreme Gradient Boosting (XGBoost) based learning algorithms for ripening method classification along with quantitative estimation of remaining shelf life and ripening progression. A classification accuracy of 95% along with carbide class recall of 0.67 is observed for mango samples, while the model achieves an accuracy of 81% and carbide class recall of 0.74 for banana. This instrumentation and data-driven approach demonstrates the effectiveness of the proposed non-invasive framework.

A total of 100 raw fruit samples, comprising 60 bananas and 40 mangoes, are sourced from Azadpur Mandi in Delhi through a vendor on the campus of the National Institute of Technology, Delhi. These fruits are divided into three batches to be ripened under different conditions. The first batch consists of acetylene-ripened fruits, where 5 g of CaC2 powder, wrapped in tissue paper, is placed with each kilogram of fruit samples, maintaining the concentration of CaC2 at 5g/kg for both banana and mango samples. The second batch is ripened using FSSAI-approved ethephon sachets. One sachet is used per 5 kg of fruits in accordance with the specification on product packaging. The third batch is naturally ripened using dry straw grass. Each batch is further divided into two groups based on storage conditions. One group is kept in an air-conditioned room at a temperature ranging from 20°C to 27°C and another group is stored outdoors at a temperature between 30°C and 33 °C. Observation concluded upon the spoilage of all fruit samples within an 11-day period, yielding a dataset of 1,172 unique temporal data points for subsequent analysis. These are longitudinal measurements collected from the same 100 individual fruits over a period of 11 days.

The color and firmness of the fruit are used to determine the ripeness percentage. The change in peel color is recorded on a scale from 0 to 7, and firmness is rated on a scale from 0 to 4, depending on the fruit’s softness. Analogous to the Von Loesecke ripening scale, the color scale is defined as follows: S0 - Green, S1 - Yellow color break, S2 - Mostly green with yellow texture, S3 - Mixed yellow and green, S4 - Yellow dominant, S5 - Almost full yellow, S6 - Bright yellow, and S7 - Blackish color. The firmness scale is defined as: S0 - Fully Firm, S1 - Soft patches in some area, S2 - Mixed firmness, S3 - Almost the entire body is soft, S4 - Fully Soft. Ripeness percentage is used in this study as a heuristic index designed to provide a numerical description of ripening progression, rather than a direct biochemical quantification. For mangoes, the ripeness percentage is based on the fact that the studied cultivar stays predominantly green throughout the ripening process, while its firmness changes. A higher weight is assigned to firmness as compared to color to take into account this physiological behavior. Firmness and color are combined using empirically selected weightings (80% to firmness and 20% to color). In contrast, bananas exhibit a noticeable color transition during the entire course of ripening, making surface color a reliable indicator of maturity. Therefore, a higher weight is assigned to color as compared to firmness (60% to color and 40% to firmness). A 5% baseline offset is included to set a realistic starting point, considering pre-harvest physiological maturity. To determine shelf life, every fruit gets a unique serial number, which is tracked throughout the study. The last recorded day that a fruit’s serial number appears in the dataset is considered its true observed lifespan. If D represents the last observed day and d is the current day, then the remaining shelf life of the fruit on any day is calculated as (D − d) days.

Spectral intensity data of the fruit samples is acquired using a custom-built hardware setup that integrates an AS7265x multispectral sensor, an SHT40 temperature and humidity sensor, and an ESP32 microcontroller. The setup is housed in a 10 cm × 10 cm × 6 cm cuboidal casing. The AS7265x spectral sensor is mounted on the bottom face of the casing, while the opposite top face features an aperture sized to accommodate a portion of the fruit’s surface. This setup uses the inbuilt LEDs present in spectral sensor for illumination and it is ensured that there is a distance of 5 cm between sensor and fruit surface. The inner surface of box is coated with black felt sheet to suppress secondary internal reflections and stray light. The ESP32 microcontroller is integrated with Google Sheets using Google Apps Script to automatically log the spectral data being collected through the microcontroller into the spreadsheet. Spectral data for each day is stored in a separate spreadsheet and each sheet includes serial number, fruit type, fruit’s unique sample ID, ripening method, day since observation started, raw spectral readings from all eighteen channels, temperature and humidity readings from the SHT40 sensor, color stage, firmness stage, calculated ripening percentage, and comments on the condition of each fruit sample, as the columns.

In the proposed study, noise with a mean (µ) of 1.0 and a standard deviation (σ) of 0.02 is injected to introduce small variations in the training set. Sampling from the distribution N(1, 0.022) ensures that overall scale of the data does not change. Furthermore, the multiplicative noise scales with the magnitude of the data, such that value changes less if original value is smaller and large original values experience greater absolute change. Further, PCA is employed for reducing the dimensionality of the 18 wavelength spectral data into principal components that capture the maximum variance. One-Way Analysis of Variance (ANOVA) is performed independently for each ripening method to evaluate the impact of environmental conditions like temperature and relative humidity on spectral readings. In order to establish a robust set of input features, all possible ratios of raw spectral intensity values at the 18 wavelengths are taken into consideration, and their progression over time is analyzed. The raw spectral intensity values are standardized using their respective z-scores. The potential of each feature as a discriminator between ripening methods or indicator of ripening progression is evaluated using two primary metrics. The IoU of IQRs is used to quantify overlap across ripening methods, and the Spearman’s rank correlation coefficient is used to assess the monotonic progression of the features across the three ripening methods. SHAP is applied to select the most relevant subset of input features out of all the possible features explored.

An XGBoost based machine learning framework is developed for classification of ripening method used while simultaneously estimating the shelf life and ripeness percentage. A dedicated set of three models comprising of one classifier and two regressors is constructed independently for both banana and mango samples. All models are trained using the data acquired from the aforementioned hardware setup and have their own set of optimized input features, validated using SHAP analysis. To prevent data leakage caused by the temporal nature of the dataset, data is split into 80% training and 20% hold-out test sets using a Group Shuffle Split based on the fruit’s unique serial numbers. This ensures that all temporal observations of a specific fruit remain strictly within either the training or the test set. Furthermore, augmentation (noise injection), SMOTE, and all data-dependent preprocessing and feature-selection operations are performed exclusively within the training partition. Model stability is rigorously evaluated using a 5-fold Group K-Fold cross-validation strategy on the training partition. The final reported performance metrics are computed exclusively on the unaugmented hold-out test set. For classification, the positive class is calcium carbide-ripened fruits and the negative class is safely ripened fruit. The final XGBoost hyperparameters selected by GridSearchCV are task and fruit-specific, including max depth, learning rate, n estimators, subsample, colsample bytree, and gamma. For the ripening method classification task, SMOTE is applied only to the training set within the pipeline.

The median spectral intensity profiles of mango and banana across 18 wavelengths, ranging from 410 nm to 940 nm are analyzed to study ripening progression under distinct ripening methods and environmental conditions. A consistent trend is obtained where the green-yellow range of visible region (535 nm–585 nm) and the “red edge” or early NIR region (610 nm–705 nm) exhibit pronounced changes during ripening, while spectral intensity at other wavelengths remains comparatively stable. Calcium carbide-ripened bananas exhibit sharper intensity drops in the visible region after mid ripening stages (day 4) as compared to naturally ripened samples, indicating accelerated color transformation, which is not accompanied by a proportionate change in longer wavelengths, within the NIR region (705 nm–900 nm). Across different ripening methods, near-infrared bands (760 nm–900 nm) show sensitivity to internal biochemical changes of the fruit rather than just its surface color. Variations in these bands indicate moisture loss, starch to sugar conversion, and loss of firmness. This behaviour is consistent with the characterization of calcium carbide-induced ripening as predominantly “cosmetic”, where the external appearance of fruit advances faster than internal growth.

Among the 18 distinct wavelengths studied, certain wavelengths discriminate well between ripening methods, while some act as indicators of temporal ripening progression. A wavelength is identified as an indicator of temporal progression if it demonstrates a strong monotonic correlation across natural, ethylene, and carbide ripening methods, along with a high degree of IQR overlap. Conversely, a wavelength is identified as a discriminator of ripening methods if it exhibits low IQR overlap and diverging correlation behavior between the three ripening methods. For mango samples, 410 nm shows good class separability (IoU 0.476), 460 nm shows moderate class separability (IoU 0.663), while 610 nm (IoU 0.815) and 680 nm (IoU 0.917) are strong indicators of temporal progression. For banana samples, 460 nm (IoU 0.800) and 730 nm (IoU 0.989) are strong indicators of temporal progression, 510 nm (IoU 0.569) is a moderate temporal progression indicator, and 645 nm (IoU 0.821) shows limited class separability. Wavelengths in visible region; specifically 535nm-610nm (green to orange/red) exhibit higher sensitivity to ripening progression of fruit. The wavelengths exhibiting higher inter-method variance (560 nm for mango, and 610 nm for banana) differ the most in intensity values across the three methods.

In order to amplify relative changes and minimize variations caused by sensor drift or illumination differences, spectral ratios are explored by evaluating all pairwise wavelength ratios. A total of 306 such ratios are explored and their relevance checked based on spearman’s rank correlation coefficient values and IQR ranges. For mango samples, the ratio 410 nm / 940 nm shows good class separability (IoU 0.373), 730 nm / 610 nm is a strong indicator of temporal progression (IoU 0.932), and 610 nm / 705 nm is a moderate temporal progression indicator (IoU 0.682). For banana samples, 585 nm / 645 nm (IoU 0.923) and 560 nm / 645 nm (IoU 0.912) are strong indicators of temporal progression, and 535 nm / 705 nm (IoU 0.744) shows moderate class separability.

The covariance matrices show extensive positive correlation among adjacent wavelengths, particularly within the visible and near-infrared regions. This confirms redundancy in the spectral data and hence the need of dimensionality reduction, for which PCA is employed. Eigenvalue decomposition of the covariance matrices shows a steep decay, with the first few principal components capturing the majority of spectral variance. Explained variance ratio and cumulative variance plots consistently indicate that the first 5-7 principal components account for more than 90% of the total spectral variance. Analysis of the Loading values reveals that the first two principal components are dominated by contributions from visible and NIR wavelengths, aligning with chlorophyll breakdown and carotenoid formation in the visible region and changes in spectral intensity patterns in the NIR band, which is associated with softening of the cell walls and moisture loss.

To take the impact of environmental conditions into account, one-way ANOVA is performed for each wavelength by comparing the spectral intensity values in indoor and outdoor conditions, within the same fruit and ripening method combinations. Wavelengths with a p-value below 0.05 are considered to exhibit significant differences in spectral intensity between the indoor and outdoor conditions. The majority of the wavelengths for CaC2-ripened bananas exhibit significant sensitivity to environmental conditions. Conversely, the 535 nm to 940 nm range for CaC2-ripened mangoes remains largely robust against these variations. This suggests that the spectral profiles of chemically ripened bananas are inherently more susceptible to temperature and humidity fluctuations than those of mangoes.

Three independent models are trained, each for a specific predictive task. For the primary goal of identifying the ripening method, an XGBoost classifier is used, which classifies the fruit sample as either ‘Safely’ Ripened (consists of both natural and ethylene ripened classes) and ‘Carbide’ Ripened. The classifier pipeline includes a Synthetic Minority Over-sampling Technique (SMOTE) layer, for ensuring balance in support of both classes. In addition to the classification model, two XGBoost regression models are trained to predict the remaining shelf life (in days) and the ripening progression (in percentage). The hyperparameters for each model are optimized independently using a comprehensive GridSearchCV strategy to ensure optimal predictive performance. Furthermore, the modeling pipelines are fruit-specific, meaning separate architectures are trained for mango and banana samples. Based on eigenvalue analysis and the obtained loading plots, the first five to seven principal components are used as input features; for both classification and regression tasks. These PCs combined with relevant wavelength ratios, temperature, humidity, and z-score of spectral intensity at 410 nm (for mango classifier only), are used to train the learning algorithms.

To validate the efficacy of the proposed XGBoost architecture, a comparative analysis is performed against three standard machine learning baselines, consisting of support vector machines (SVM), Decision Tree, and multi-layer perceptron (MLP) neural networks. All these models are trained on the same spectral features. During 5-fold group cross-validation, the XGBoost classification model demonstrated strong stability across both fruit subsets, yielding a mean accuracy of 83.6% ± 4.0% for mango and 77.5% ± 2.9% for banana. When evaluated on the unaugmented hold-out test set, the XGBoost model achieved a classification accuracy of 95% for mango samples and 81% for banana samples, representing the highest overall accuracy among the evaluated classifiers. The ‘Recall’ of carbide class is a crucial metric, as it is a measure of the model’s ability to detect calcium carbide-ripened samples correctly. SVM and Neural Network obtain a recall of 0.70 for mango, slightly better than the proposed XGBoost (0.67) and Decision Tree (0.60). SVM has a higher carbide recall of 0.80 for banana samples, while XGBoost gets 0.74, which is better than the decision tree (0.60) and neural network (0.55). While SVM has a slight advantage in recall, the proposed XGBoost architecture is preferred for classification as it shows significantly higher overall accuracy (95% for mango and 81% for banana), balancing the detection of safely and carbide ripened samples while minimizing the total number of misclassifications.

For regression models predicting ripeness percentage and remaining shelf-life, a nuanced performance divergence is observed between the fruits. In the case of mango samples, SVM actually outperforms the proposed XGBoost architecture, achieving a higher R2 (0.810 vs. 0.750) and a lower shelf-life RMSE (1.80 vs. 1.86 days). Conversely, for banana samples, XGBoost reclaims its position as the most robust model, yielding an R2 of 0.871 and an RMSE of 1.30 days, outperforming SVM (0.850 and 1.36 days, respectively). XGBoost achieved the highest overall classification accuracy among the evaluated classifiers, although SVM provided higher recall for the calcium carbide class. Despite SVM’s highly competitive performance, particularly in mango regression, XGBoost is selected as the primary architecture for this study. Unlike SVMs and Neural Networks, which act as black-box models, the gradient boosting framework allows for explicit SHAP-based feature interpretability. This transparency is crucial for tracing non-linear spectral shifts back to specific physiological changes.

The proposed study presents a comprehensive multispectral framework for non-invasive assessment of fruit ripening, with particular focus on distinguishing between safely ripened (including natural and ethylene ripened) and calcium carbide-ripened samples in mango and banana. By analyzing spectral intensity data across 18 wavelengths (410–940 nm), this study demonstrates that distinct, method-specific spectral signatures emerge at various maturation stages. Temporal progression of intensity values reveals clear differences between naturally ripened and calcium carbide-ripened samples, where calcium carbide-treated samples exhibit stronger spectral changes in the visible region, which are consistent with faster chlorophyll breakdown and carotenoid development. However, this is not accompanied by a proportionate change in the measured NIR region response, suggesting that the internal maturation of the fruit does not align with the rapid surface color transformation. Dimensionality reduction of the spectral intensity values at all 18 wavelengths using PCA reveals a low dimensional feature space where first 5-7 principal components capture >90% of the spectral variance. These principal components, combined with targeted spectral intensity ratios and environmental parameters (temperature and relative humidity), form a robust feature set. This set is subsequently utilized to train XGBoost-based learning algorithms for classification of ripening method, predicting the remaining shelf-life in days and estimating the ripening progression. The proposed study achieves a classification accuracy of 95% for mango samples with a recall of 0.67 for calcium carbide-ripened samples. Similarly, banana samples are classified with an accuracy of 81% and calcium carbide class recall of 0.74. This study provides a strong initial validation of the proposed multispectral framework for non-invasive assessment of fruit ripening under controlled experimental conditions. While the results obtained are promising, broader validation on additional cultivars, independent fruit batches, and varied environmental conditions would strengthen the generalizability of the approach. Future work may focus on extending the framework to other climacteric fruits, integrating larger multi-season datasets, and validating the findings with biochemical and physiological ground-truth measurements.

Improvements for AI systems

Improvements to AI Systems:

  1. Enhanced Ripening-Method Classification with Interpretability
  • Integrate SHAP-based feature attribution into the classifier to explain why a fruit is classified as carbide-ripened (e.g., specific wavelength ratios like 410nm/940nm or 535nm/705nm). This allows AI systems to provide actionable feedback to inspectors, highlighting which spectral bands indicate unsafe ripening.

  • Improve carbide-class recall (currently 0.67–0.74) by using cost-sensitive learning or ensemble methods that prioritize false-negative reduction, since missing a carbide sample is more harmful than a false positive.

  1. Multi-Task Learning for Ripening Progression and Shelf-Life Prediction
  • Replace separate XGBoost regressors with a shared multi-task neural network or gradient-boosting model that jointly predicts ripeness percentage and remaining shelf life. This leverages correlated physiological signals (e.g., NIR moisture loss correlates with firmness) to improve accuracy, especially for mango where SVM outperformed XGBoost.

  • Add uncertainty quantification (e.g., quantile regression or Monte Carlo dropout) to output confidence intervals for shelf-life predictions, enabling risk-aware decisions in supply chains (e.g., flagging high-uncertainty batches for manual inspection).

  1. Domain-Adaptive Spectral Normalization
  • Train a domain-adversarial or self-supervised encoder on spectral data to learn invariant features across environmental conditions (temperature/humidity). This reduces the observed sensitivity of carbide-ripened bananas to environmental fluctuations, making the system robust across storage settings without retraining.

  • Use the ANOVA-identified sensitive wavelengths (e.g., 535–940nm for carbide bananas) as auxiliary inputs to a calibration module that adjusts predictions based on ambient conditions.

  1. Temporal Sequence Modeling for Early Detection
  • Replace single-day spectral snapshots with a recurrent or transformer-based model (e.g., LSTM, Temporal Convolutional Network) that processes longitudinal spectral intensity trends (e.g., day-over-day changes in 610nm/705nm ratios). This captures accelerated chlorophyll degradation patterns in carbide-ripened fruits earlier than static classifiers, enabling detection before visual symptoms appear.

  • Implement an early-warning system that triggers alerts when the rate of spectral change deviates from natural ripening baselines, using anomaly detection on the temporal trajectory.

  1. Fruit-Agnostic Feature Transfer
  • Pre-train a foundation model on multispectral data from multiple fruit types (mango, banana, and future climacteric fruits) using contrastive learning. Fine-tune it for new fruits with minimal labeled data, leveraging shared physiological markers (e.g., chlorophyll breakdown in visible bands, moisture loss in NIR). This reduces the need for fruit-specific architectures and accelerates deployment.
  1. Active Learning for Scarce Carbide Samples
  • Implement an active learning loop where the AI system queries the most informative unlabeled samples (e.g., those with high spectral variance or low model confidence) for human labeling. This is critical given the low carbide-class recall and limited carbide sample availability, improving recall without requiring large annotated datasets.
  1. Real-Time Edge Deployment with Sensor Fusion
  • Compress the XGBoost models (e.g., via quantization or knowledge distillation into a lightweight neural network) for deployment on the ESP32 microcontroller used in the hardware setup. This enables on-device classification and shelf-life estimation in real-time, eliminating cloud dependency and enabling field use in markets or warehouses.
  1. Explainable Ripeness Index Calibration
  • Use the model’s feature importance to refine the heuristic ripeness percentage formula (currently 80/20 firmness/color for mango, 60/40 color/firmness for banana). The AI can learn optimal weights per fruit cultivar from spectral data, replacing manual heuristics with data-driven ripeness indices that correlate better with biochemical ground truth.

What the Improved AI System Can Do:

  • Detect unsafe carbide-ripened fruits with higher recall and explainable evidence (e.g., High 410nm/940nm ratio suggests accelerated chlorophyll degradation).

  • Predict shelf life and ripeness percentage with confidence intervals, enabling dynamic pricing, inventory rotation, and waste reduction.

  • Operate across diverse environmental conditions without performance drops, using domain-adaptive normalization.

  • Flag early-stage carbide ripening days before visual symptoms, allowing pre-emptive removal from supply chains.

  • Transfer to new fruit types with minimal retraining, using pre-trained spectral representations.

  • Run on low-cost edge hardware for real-time, on-site screening in markets and farms.

  • Provide actionable insights to regulators by linking spectral signatures to specific physiological changes (e.g., chlorophyll vs. carotenoid ratios), supporting policy enforcement.

Related papers