Abstract
Tomato ripening is an irreversible, non-linear biological process that is difficult to track. Conventional ripeness classifiers are static and single-observation, failing to capture time-dependent progression and limiting data-driven post-harvest decision-making. This study presents a dual-head physics-inspired neural network (Bi-PINN) built on a ResNet50 backbone that classifies tomatoes into eight ripeness stages and forecasts four temporal horizons (red, peak ripeness, overripe, and senescence), representing the expected, class-conditioned progression interval for each stage. The main novelty of Bi-PINN is the combination, within a single network, of joint stage classification and multi-horizon regression through a shared backbone (multi-task learning), with a monotonicity penalty that keeps the four predicted horizons in biological order. The violations are quantified by a physical violation rate (PVR). Under 5-fold tomato-wise GroupKFold cross-validation, Bi-PINN achieved 71.06 ± 6.29% accuracy, MAE = 0.672 ± 0.197 days, R2 = 0.927 ± 0.038 and PVR = 0.55 ± 0.61%. Its accuracy was statistically indistinguishable from that of the strongest baseline, ResNet18 (71.31 ± 6.67%), and its main advantage was a lower PVR than the baselines (1.76–3.82%). This proof of concept provides the predictive component that a future post-harvest digital twin could build on; broader deployment requires larger, multi-cultivar datasets.