Method and system for constructing digital twin model of fruits and vegetables after harvest based on quality index kinetic typing
Patent Information
- Application Number
- CN202611498602.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0008]本发明旨在提供一种基于品质指标动力学分型的果蔬采后数字孪生模型自适应构建方法,通过采集果蔬采后环境、处理及品质时序数据,识别不同品质指标的时间演化类型和驱动响应类型,建立与动力学类型对应的分型约束、贮藏演化模型及货架状态转移模型,并依据新增监测数据更新数字孪生状态和切换预测模型,以解决现有技术中不同品质指标采用统一模型、跨贮藏条件泛化能力不足、预测结果可能不符合生理规律以及模型难以持续适应品质变化的问题
[0044]本发明依据失重率、硬度、腐烂率、色素含量、呼吸速率等品质指标各自的时间响应特征和环境响应特征进行分型,使不同品质指标分别匹配与其变化规律相适应的预测模型,避免统一模型难以表达累积增长、平台衰减、峰值变化及稳定维持等异质动力学过程;通过将变化方向、取值边界、峰值数量和平台特征作为候选模型筛选及预测结果校验条件,减少负值、超过生理上限及变化形态异常等不合理预测;通过留一贮藏温度、留一采后处理或留一贮藏时间点的验证方式,提高模型对未知环境条件和处理条件的泛化能力;通过同时建立贮藏演化模型和货架状态转移模型,实现果蔬当前品质状态、未来贮藏品质状态及转入货架环境后品质状态的连续预测;并通过新增数据驱动的模型评价和切换机制,使数字孪生模型能够随果蔬品质变化规律持续更新,从而提高果蔬采后品质预测的准确性、可靠性和长期运行稳定性,为剩余货架期预测、腐烂风险预警、库存周转和销售窗口确定提供数据支持。
Smart Images

Figure CN123014815A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of postharvest preservation and intelligent cold chain technology of fruits and vegetables, and particularly relates to a method and system for constructing a postharvest digital twin model of fruits and vegetables based on the dynamic classification of quality indicators. Background Technology
[0002] Fruits and vegetables continue to undergo physiological activities such as respiration, transpiration, ripening, and senescence after harvest. Their quality indicators, including weight loss, firmness, decay rate, soluble solids, color, respiration rate, and ethylene release rate, change over storage time. These changes are influenced not only by temperature and relative humidity but also by factors such as oxygen concentration, carbon dioxide concentration, ethylene concentration, packaging method, pre-cooling treatment, controlled atmosphere treatment, 1-methylcyclopropene treatment, and the initial maturity of the fruits and vegetables. Because the quality evolution patterns of different fruit and vegetable types, varieties, and post-harvest treatment conditions vary, accurately predicting the future quality status and remaining shelf life of fruits and vegetables is a crucial foundation for cold storage management, cold chain transportation, inventory turnover, and sales planning.
[0003] Currently, postharvest quality prediction of fruits and vegetables typically employs kinetic models, statistical models, or machine learning models. Kinetic models can characterize the changes in quality indicators over time, but generally require pre-determining the model form and parameters. Machine learning models can handle nonlinear relationships between multiple factors, but their predictive effectiveness depends on the quantity and distribution of training data and the model selection method. Different quality indicators exhibit significantly different patterns of change. For example, weight loss typically shows a cumulative upward trend, firmness typically decreases and then plateaus, decay rate typically shows a bounded upward trend, respiration rate and ethylene release rate may exhibit peak or bimodal changes, while soluble solids may show slight fluctuations or relative stability. Therefore, using the same predictive model to handle different quality indicators can easily lead to a mismatch between the model and the patterns of quality change, potentially producing prediction results that do not conform to the postharvest physiological laws of fruits and vegetables, such as negative values, exceeding physiological limits, abnormal number of peaks, or missing plateau characteristics.
[0004] Existing technologies have begun to apply quality dynamics models and digital twin technology to fruit cold chain management. For example, Chinese invention patent application CN112115577A discloses a method and device for dynamic grading of fruit quality throughout the cold chain. This method obtains the three-dimensional spatiotemporal distribution information of temperature and humidity of the fruit based on the three-dimensional spatiotemporal distribution information of temperature and humidity in the storage and transportation environment and the temperature and humidity conversion information between the fruit and the storage and transportation environment. Then, it combines the initial quality indicators of the fruit with the quality dynamics model of the fruit under different temperature and humidity conditions to calculate the dynamic changes in fruit quality throughout the cold chain and perform quality grading. This technology can combine the cold chain environment with changes in fruit quality, but it mainly uses a pre-established quality dynamics model and has not yet classified the temporal evolution patterns and environmental response modes of different quality indicators, nor has it provided a specific mechanism for automatically selecting different candidate models based on the classification results and switching models as new monitoring data is added.
[0005] For example, Chinese invention patent application CN115184395A discloses a method, device, electronic equipment, and storage medium for predicting the weight loss rate of fruits and vegetables. This method inputs the temperature and storage time of the fruit and vegetable's environment into a trained neural network weight loss rate prediction model to obtain the target weight loss rate prediction information. While this technology can use neural networks to predict the weight loss rate of fruits and vegetables, its prediction object is mainly a single weight loss rate indicator, and the model structure and parameters are relatively fixed after training. When the fruit and vegetable variety, post-harvest processing method, storage stage, or environmental response changes, it is usually necessary to retrain or manually select the model, making it difficult to simultaneously consider quality indicators with different kinetic characteristics such as weight loss rate, firmness, decay rate, pigment content, and respiration rate.
[0006] Furthermore, existing models typically evaluate predictive performance by randomly partitioning training and validation sets. When data from the same storage temperature, treatment group, or adjacent time points appear simultaneously in both the training and validation sets, the evaluation results may be higher than the model's actual predictive ability under unknown temperatures, treatment conditions, or storage stages. Existing technologies also rarely consider the direction of change, value boundaries, number of peaks, and plateau characteristics of quality indicators as criteria for model selection and prediction result verification, thus making it difficult to avoid the model producing results that are not physiologically meaningful during extrapolation.
[0007] On the other hand, after fruits and vegetables are transferred from low-temperature storage environments to retail shelf environments, the temperature and relative humidity change significantly, and the rate of quality deterioration also changes accordingly. Predicting the quality during storage based solely on storage time and environmental parameters is insufficient to directly reflect the impact of the current quality status at the time of transfer on subsequent shelf quality. Existing digital twin systems typically focus on environmental condition monitoring, storage period quality estimation, or quality grade display, but they are still unable to simultaneously establish a quality evolution model during storage and a state transition model from the current storage quality state to the shelf quality state. Summary of the Invention
[0008] This invention aims to provide an adaptive construction method for postharvest digital twin models of fruits and vegetables based on the dynamic classification of quality indicators. By collecting time-series data on the postharvest environment, treatment, and quality of fruits and vegetables, the method identifies the time evolution types and driving response types of different quality indicators, establishes classification constraints, storage evolution models, and shelf state transition models corresponding to the dynamic types, and updates the digital twin state and switching prediction models based on newly added monitoring data. This addresses the problems in existing technologies, such as using a unified model for different quality indicators, insufficient generalization ability across storage conditions, prediction results that may not conform to physiological laws, and the difficulty of the model continuously adapting to quality changes.
[0009] Firstly, in order to achieve the above-mentioned objectives, the present invention adopts the following technical solution:
[0010] An adaptive construction method for postharvest digital twin models of fruits and vegetables based on quality index dynamics classification includes the following steps:
[0011] S1. Collect time-series data of environmental factors, post-harvest treatment, initial quality and quality indicators according to fruit and vegetable batches, establish a set of core driving factors corresponding to fruit and vegetable types, quality indicators and prediction targets and check the completeness.
[0012] S2, extract the time response characteristics and environmental response characteristics of each quality indicator, determine the main type of time evolution and the auxiliary type of driving response, and establish a classification constraint that includes the direction of change, value boundary and peak or plateau characteristics;
[0013] S3. Candidate models are obtained from the model library based on two types. A validation set is constructed by leaving one storage temperature, one post-harvest treatment, or one storage time point. Candidate models whose prediction results do not meet the classification constraints are eliminated. The storage evolution model of each quality index is determined based on the validation error. The current quality state under the same temperature, treatment, and time and the quality state after transitioning to the preset shelf conditions are used to form paired samples to train the shelf state transition model.
[0014] S4. Establish a digital twin state space that uniquely corresponds to each batch of fruits and vegetables, and write the driving factors, current quality status, two types of models, classification constraints and prediction results into the digital twin state space.
[0015] S5, receive new monitoring data and update the kinetic type, digital twin status and model performance; when the kinetic type changes, the prediction error exceeds the limit or the candidate model verification error is lower, switch the corresponding model according to step S3, and output the future storage quality status and the quality status after entering the preset shelf conditions.
[0016] As a further improvement, the environmental factors in step S1 include temperature, relative humidity, oxygen concentration, carbon dioxide concentration, and ethylene concentration; the post-harvest treatment includes packaging treatment, pre-cooling treatment, modified atmosphere treatment, and 1-methylcyclopropene treatment; the initial quality includes maturity, initial hardness, soluble solids, acidity, color, respiration rate, and ethylene release rate; the time-series data of the quality indicators include at least two of the following: weight loss rate, decay rate, hardness, soluble solids, pigment content, respiration rate, ethylene release rate, and color index.
[0017] As a further improvement, in step S1, the set of core driving factors established for climacteric fruits includes at least temperature, oxygen concentration, carbon dioxide concentration, ethylene concentration, and 1-methylcyclopropene treatment information; the set of core driving factors established for non-climacteric fruits includes at least temperature, relative humidity, storage time, and initial quality status.
[0018] As a further improvement, the integrity check in step S1 includes checking whether the core driving factors are missing, whether the data format is consistent, whether the collection time is corresponding, and whether the number of effective samples meets the modeling requirements; when the core driving factors are missing, a missing label is set for the corresponding data, and historical data of the same variety and the same processing are used to estimate or reduce the confidence level of the corresponding prediction results.
[0019] As a further improvement, in step S2, the time response characteristics include first-order change trend, second-order change trend, change rate, change amplitude, number of peaks, peak position and platform length; the environmental response characteristics include temperature effect, humidity effect, gas effect, post-harvest treatment effect and the interaction effect of storage time and environmental factors.
[0020] As a further improvement, in step S2, the main type of time evolution includes constant rate rising type, constant rate falling type, bounded falling type, asymptotic growth type, peak type, bimodal type, fluctuating type and stable maintenance type; the auxiliary type of driving response includes temperature-dominated type, humidity-dominated type, gas-dominated type and multi-factor coupled type; the auxiliary type of driving response is recorded in combination with the main type of time evolution.
[0021] As a further improvement, in step S2, for quality indicators with known post-harvest change patterns, the kinetic type is determined according to preset judgment rules; for unknown quality indicators or quality indicators whose types cannot be determined by preset judgment rules, clustering algorithms or classification models are used to determine the kinetic type, and the quality indicator name, kinetic type, determination method, applicable fruits and vegetables, applicable environmental range, and version information are associated and stored.
[0022] As a further improvement, in step S3, the model library includes at least three of the following: zero-order dynamics model, first-order dynamics model, Logi-step Stic model, Gompertz model, linear regression model, ridge regression model, generalized additive model, random forest model, support vector machine model, gradient boosting tree model, neural network model, long short-term memory network model, Tran-step Sformer model, dynamics-neural network hybrid model, and physical information neural network model.
[0023] As a further improvement, in step S3:
[0024] For quality indicators with a constant rate of increase, the classification constraints include at least the requirement that the predicted value is non-negative and that the predicted value at adjacent prediction points does not decrease.
[0025] For bounded declining quality indicators, the classification constraints include at least the following: the predicted value is non-negative, the predicted value does not exceed the upper limit of data support, and the value enters the plateau range after declining.
[0026] For asymptotically growing quality indicators, the classification constraints include at least the fact that the predicted value is non-negative and the predicted value does not exceed a preset cumulative upper limit.
[0027] For peak-type or bimodal quality indicators, the classification constraint includes at least the number of peaks and the range of peak positions;
[0028] For stable maintenance-type quality indicators, a relative change model anchored to the initial quality value or an environmental response model corresponding to its auxiliary dynamic type is adopted.
[0029] As a further improvement, the value boundary is determined jointly based on the physiologically permissible range of the corresponding quality index and the observation range of the training data; the lower bound of the prediction of the quality index is zero or the lower limit of the physiologically permissible range, and the upper bound of the prediction is no greater than 1.10 times the observed maximum value, wherein the upper bound of the prediction of weight loss rate and decay rate does not exceed 100%.
[0030] As a further improvement, in step S3, each candidate model is trained and evaluated using the same training set and validation set; the validation set is formed by sequentially reserving a storage temperature, a post-harvest processing group, or a time point for transferring to the shelf, in order to evaluate the generalization ability of the candidate model to storage conditions or processing conditions that were not included in the training.
[0031] As a further improvement, the storage evolution model takes storage temperature, post-harvest treatment, current storage time, prediction time span, and current quality state vector as inputs, and the storage quality state at the prediction time point as output; different quality indicators correspond to their respective storage evolution models.
[0032] As a further improvement, the shelf state transition model takes storage temperature, post-harvest treatment, current storage time and current quality state vector as input, and the quality state after transitioning to a preset shelf temperature and relative humidity and passing through a preset shelf time as output; the current quality state vector is represented by the original quality index, state variables obtained by principal component analysis or state variables obtained by partial least squares regression.
[0033] As a further improvement, in step S5, the model performance is determined based on at least three of the following: root mean square error, mean absolute error, goodness of fit, cross-validation error, and computation time; the candidate model replaces the current model only when it meets the corresponding fractal constraints and the validation error is lower than that of the current model, and the model version, model parameters, applicable scope, and update time are updated synchronously.
[0034] As a further improvement, the digital twin state space includes environmental state, quality state, driving factor state, model state, risk state, and prediction state; the risk state includes spoilage risk, quality deterioration risk, and remaining shelf life risk; and the prediction state includes prediction value, prediction interval, prediction time, prediction confidence, and prediction update time.
[0035] Secondly, the present invention also provides an adaptive construction system for a post-harvest digital twin model of fruits and vegetables based on the dynamic classification of quality indicators. This system is used to implement the method, including:
[0036] The driver factor management module is used to collect time-series data on environmental factors, post-harvest treatment, initial quality, and quality indicators by batch of fruits and vegetables, establish a core driver factor set, and check its integrity.
[0037] The dynamics classification and constraint module is used to extract the time response characteristics and environmental response characteristics of each quality index, determine the main type of time evolution and the auxiliary type of driving response, and generate classification constraints.
[0038] The model building module is used to obtain candidate models based on two types of dynamics, determine the storage evolution model of each quality index through leave-one-out condition verification and fractal constraint screening, and establish a shelf state transition model based on paired samples of the current quality state and the quality state after transitioning to the preset shelf conditions.
[0039] The digital twin status management module is used to establish a digital twin status space that uniquely corresponds to each batch of fruits and vegetables.
[0040] The online update module is used to update the dynamics type, digital twin status and model performance based on newly added monitoring data, and switch the corresponding model when the switching conditions are met.
[0041] The prediction output module is used to output the future storage quality status and the quality status after being transferred to preset shelf conditions.
[0042] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the method described above.
[0043] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described thereon.
[0044] This invention classifies quality indicators such as weight loss rate, hardness, decay rate, pigment content, and respiration rate according to their respective time and environmental response characteristics. This allows different quality indicators to be matched with prediction models adapted to their respective variation patterns, avoiding the difficulty of a unified model in expressing heterogeneous dynamic processes such as cumulative growth, plateau decay, peak changes, and stable maintenance. By using the direction of change, value boundaries, number of peaks, and plateau characteristics as candidate model selection and prediction result verification conditions, unreasonable predictions such as negative values, exceeding physiological upper limits, and abnormal change patterns are reduced. Furthermore, by retaining a storage temperature, a post-harvest treatment, or a certain amount of storage time... The verification method at storage time points improves the model's generalization ability to unknown environmental and treatment conditions. By simultaneously establishing storage evolution models and shelf state transition models, continuous prediction of the current quality status, future storage quality status, and quality status after being transferred to the shelf environment of fruits and vegetables can be achieved. Furthermore, by adding a data-driven model evaluation and switching mechanism, the digital twin model can be continuously updated according to the changing patterns of fruit and vegetable quality, thereby improving the accuracy, reliability, and long-term operational stability of post-harvest quality prediction of fruits and vegetables, and providing data support for remaining shelf life prediction, spoilage risk warning, inventory turnover, and sales window determination. Attached Figure Description
[0045] Figure 1 : Overall technical architecture diagram of the present invention.
[0046] Figure 2 Postharvest driving factor space construction diagram.
[0047] Figure 3 : Driver Factor Integrity Check and Importance Analysis Chart.
[0048] Figure 4 : Construction of dynamic feature space and fractal diagram.
[0049] Figure 5 Model library, model competition and dynamic switching diagram.
[0050] Figure 6 Digital twin state space construction diagram.
[0051] Figure 7Online updates and intelligent prediction closed-loop diagram.
[0052] Figure 8 Software system architecture diagram.
[0053] Figure 9 Prune storage - shelf test design diagram.
[0054] Figure 10 Prune quality index typing-physiological constraint mapping diagram.
[0055] Figure 11 Blueberry experiment and genotyping model configuration diagram.
[0056] Figure 12 This invention relates to the unified Neural ODE model R. 2 Comparison chart.
[0057] Figure 13 : Rendering of the model's dynamic switching effect. Detailed Implementation
[0058] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. It should be noted that the following embodiments are used to illustrate the technical solution of the present invention, and not to limit the scope of protection of the present invention. Equivalent substitutions made by those skilled in the art regarding data acquisition frequency, model type, parameter range, and deployment form without departing from the technical concept defined in the claims are all within the scope of the technical concept of the present invention.
[0059] I. Terminology Explanation
[0060] 1. Postharvest driving factors refer to variables that can cause or characterize changes in the postharvest quality status of fruits and vegetables, including environmental driving factors, treatment driving factors, quality driving factors, and management information. Environmental driving factors include at least temperature, relative humidity, oxygen concentration, carbon dioxide concentration, and ethylene concentration; treatment driving factors include packaging method, 1-methylcyclopropene treatment, modified atmosphere treatment, precooling treatment, ripening treatment, and sterilization treatment; quality driving factors include maturity, initial firmness, initial soluble solids content, initial acidity, initial color, respiration rate, and ethylene release rate; management information includes fruit and vegetable type, variety, batch, harvest time, storage time, storage period, and cold storage number.
[0061] 2. The core driver set refers to the set of driver factors identified from postharvest driver factors for a specific fruit and vegetable variety, specific quality index, and specific prediction target, whose absence would significantly reduce the reliability of the prediction. For example, the prediction of ripening and softening of climacteric fruits should at least include temperature, ethylene concentration, oxygen concentration, carbon dioxide concentration, and 1-methylcyclopropene treatment status as core driver factors; the prediction of weight loss and decay rate of non-climacteric berries should at least include temperature, relative humidity, storage time, and initial quality status as core driver factors.
[0062] 3. Quality dynamics characteristics refer to the features that can characterize the evolution of quality indicators with storage time and environmental changes, including the overall direction of change, rate of change, first derivative, second derivative, number of peaks, peak position, plateau interval, change amplitude, time response intensity and environmental response intensity.
[0063] 4. The principal classification of dynamics refers to the category determined by the shape of the quality index changing over time, including constant rate increase type, constant rate decrease type, rate-dependent decrease type, bounded decrease type, asymptotic growth type, unimodal type, bimodal type, fluctuating type, stable maintenance type, and composite change type.
[0064] 5. Kinetic-assisted classification refers to the category determined based on the way environmental driving factors affect changes in quality indicators, including temperature-dominant, humidity-dominant, gas-dominant, and multi-factor coupled types. Auxiliary classification is used in conjunction with primary classification, but it does not replace primary classification.
[0065] 6. Physiological constraints refer to the constraints on prediction results set according to the postharvest physiological laws of fruits and vegetables and the physical meaning of indicators. These include non-negativity constraints, upper bound constraints, direction of change constraints, peak quantity constraints, and plateau interval constraints. For example, the weight loss rate must not be negative and should not decrease under continuous storage conditions in principle; the decay rate must not be negative or exceed 100%; and the hardness softening model must not continuously and abnormally increase without external treatment changes.
[0066] 7. A candidate model refers to one or more models selected from a quality index model library based on the results of dynamic classification, which are then used for training and evaluation. Candidate models may include dynamic models, statistical models, machine learning models, deep learning models, and hybrid models.
[0067] 8. A digital twin object is a digitized object corresponding to a batch of fruits and vegetables or a management unit. Each digital twin object is assigned a unique batch identifier and stores information on environmental status, quality status, driving factor status, model status, risk status, and prediction status.
[0068] 9. A state transition model is a model that takes the current storage state, environmental conditions, and predicted time span as inputs and outputs the future storage quality state or the quality state after transitioning to shelf conditions.
[0069] 10. Leave-one-out validation refers to using all samples under a certain temperature, treatment method, fruit and vegetable variety, or storage stage as the validation set, and samples under other conditions as the training set, in order to evaluate the model's ability to generalize to conditions not included in the training.
[0070] II. System Structure
[0071] like Figure 8 As shown, the adaptive construction system for post-harvest digital twin models of fruits and vegetables includes a driving factor management module, a dynamic classification module, a model library management module, a model competition and switching module, a digital twin state management module, an online update and prediction output module, and a data storage and interface layer.
[0072] The driver factor management module is used to receive data from sensors, laboratory testing equipment, warehouse management systems and manual data entry terminals, and to perform field mapping, unit unification, time alignment, outlier identification, missing value marking, core driver factor invocation and integrity checks.
[0073] The kinetic classification module is used to smooth the time series of quality indicators and estimate their derivatives, extract trends, peaks, plateaus, magnitudes of change and environmental response characteristics, and output the main kinetic classification, the auxiliary kinetic classification and the physiological constraints corresponding to the classification.
[0074] The model library management module is used to store model programs, applicable dynamic categories of the model, input field requirements, training parameter ranges, model versions, model creation time, and applicable scope of the model.
[0075] The model competition and switching module is used to screen candidate models, divide the training set and validation set, complete model training, calculate evaluation metrics, check whether the prediction results meet physiological constraints, determine the deployment model, and complete model update and version switching when the switching conditions are met.
[0076] The digital twin state management module is used to create digital twin objects, save each sub-state and state update time, and maintain the correspondence between physical fruit and vegetable batches and digital twin objects.
[0077] The online update and forecast output module is used to receive new monitoring data, correct the digital twin status, call the currently deployed model, and output future quality indicators, forecast range, remaining shelf life, quality deterioration risk, and sales window.
[0078] The data storage and interface layer includes a time-series database, a relational database, a model file storage area, and a data interface. The time-series database stores continuous monitoring data such as temperature, humidity, and gas concentration; the relational database stores fruit and vegetable varieties, batches, processing methods, and quality testing results; the model file storage area stores model parameters, training data versions, and evaluation results; and the data interface uses at least one of the following: a message queue interface, a REST interface, or a database interface.
[0079] The system can be deployed on a cold storage server, a cloud server, or an edge computing device. The server includes at least a processor, a memory, a communication interface, and a computer program stored in the memory. When the computer program is executed by the processor, it implements the following steps S1 to S5.
[0080] III. Overall Technical Route
[0081] like Figure 1 As shown, this invention starts with multi-source monitoring data, sequentially establishes a post-harvest driving factor space and a quality dynamic characteristic space, completes the dynamic classification of quality indicators, selects and competes to determine the deployment model from the quality indicator model library based on the dynamic classification results, establishes a digital twin state space, and continuously receives new data during operation to realize state updates, model evaluation, dynamic model switching and quality prediction.
[0082] This embodiment divides the method into S1 to S5. S1 mainly addresses the problems of missing input variables, inconsistent data sources, and inconsistent time scales; S2 mainly addresses the problems of heterogeneous dynamic laws of different quality indicators and the inability of unified modeling to express physiological evolution laws; S3 mainly addresses the problems of candidate model selection, cross-condition generalization, physiological constraints, and the transition from storage to shelf status; S4 completes the establishment of batch-level digital twin objects; S5 completes the continuous updating and dynamic switching of the digital twin model. Among them, S2 and S3 constitute the main technical links that distinguish this invention from conventional quality prediction methods.
[0083] (I) S1: Establishing the postharvest driving factor space
[0084] 1. Data Collection
[0085] like Figure 2 As shown, the system collects environmental driving factors, processing driving factors, quality driving factors, and management information respectively.
[0086] Environmental driving factors are collected by sensors within the cold storage or transport vehicle. In one specific embodiment, the sampling interval for temperature and relative humidity is 10 minutes, and the sampling interval for oxygen concentration, carbon dioxide concentration, and ethylene concentration is 30 minutes. Temperature is recorded in °C, relative humidity in %, oxygen and carbon dioxide concentrations in volume fractions, and ethylene concentration in μL / L.
[0087] Treatment driving factors are represented using a combination of discrete codes and continuous parameters. For example, when 1-methylcyclopropene treatment is not performed, the treatment state is recorded as 0; when 1-methylcyclopropene treatment is performed, the treatment state is recorded as 1, and the treatment concentration, treatment temperature, and treatment time are recorded simultaneously. Packaging method, modified atmosphere treatment, and precooling method are represented using category codes.
[0088] Quality drivers are obtained through laboratory testing equipment, online non-destructive testing equipment, or manual testing. For destructive testing indicators, the conditional mean is calculated from the test results of repeated samples under the same temperature, processing method, and storage time conditions, and the standard deviation and number of replicates are stored together. For online non-destructive testing indicators, each measurement value and measurement time are retained.
[0089] Management information is used to determine the attribution of data. Each data entry must be associated with at least the type of fruit or vegetable, variety, batch identifier, harvest time, storage time, testing time, and data source.
[0090] 2. Field standardization and time alignment
[0091] Field standardization includes mapping field names, unifying units of measurement, and encoding categorical variables. For example, "Temp", "Temperature", and "Storage Temperature" are uniformly mapped to temperature; "Storage_day" and "Day" are uniformly mapped to storage_day; and "Weight LossRate" and "Weightloss" are uniformly mapped to weight_loss.
[0092] For data with different sampling frequencies, the quality inspection time is used as the quality status anchor point. Within a preset environmental statistics window before the quality inspection time, the mean, maximum, minimum, standard deviation, and cumulative exposure of environmental driving factors are calculated. In this embodiment, the environmental statistics window takes the time interval between two adjacent quality inspections; when there is no previous inspection time for the first quality inspection, the statistics window takes the time from the entry time to the first inspection time.
[0093] The cumulative temperature exposure is determined using the following formula:
[0094] ;
[0095] In the formula, Cumulative temperature exposure; and These represent the temperatures at two adjacent sampling times; and These are the corresponding sampling times; To count the number of temperature sampling points within the window.
[0096] For short-term missing data with adjacent sampling intervals no greater than twice the normal sampling interval, linear interpolation is used. For missing intervals exceeding twice the normal sampling interval, no interpolation is performed across intervals; instead, the missing data marker is retained. Outliers are identified using the interquartile range rule: when a data point is less than the first quartile minus 1.5 times the interquartile range, or greater than the third quartile plus 1.5 times the interquartile range, it is marked as a value to be checked. For variables with clear physical boundaries, physical boundary checks are also performed simultaneously.
[0097] 3. Core driving factor set and completeness check
[0098] like Figure 3 As shown, the system queries the core driving factor configuration table based on the type of fruit and vegetables, quality indicators, and prediction targets. The core driving factor configuration table includes at least the type of fruit and vegetables, quality indicators, prediction task, required input fields, and recommended input fields.
[0099] The system calculates the normalized importance of each driving factor. Specifically, it can use permutation importance from the training set, randomly permuting the value of a driving factor, calculating the increase in validation error before and after the permutation, and then normalizing the increase in error for each driving factor. Driving factors with a normalized importance of not less than 0.05 are retained; at the same time, they are sorted by importance from largest to smallest, retaining all driving factors whose cumulative importance does not reach 0.90. Factors that meet any of the above conditions are included in the core driving factor set.
[0100] The integrity factor is calculated using the following formula:
[0101] ;
[0102] In the formula, The integrity coefficient of the driving factor; The number of core driving factors; For the first The normalized importance of the first core driving factor; when the first When core driving factors are available Take 1, when it is missing. Take 0.
[0103] This implementation divides the integrity status into three levels: when all core driving factors are available, the integrity coefficient correction value is 1.00; when recommended driving factors are missing but necessary driving factors are complete, the integrity coefficient correction value is 0.85; when at least one necessary driving factor is missing, the integrity coefficient correction value is 0.60.
[0104] When a necessary driving factor is missing, the system sequentially performs the following steps: querying data from the same batch at nearby times, querying historical data from the same variety under the same treatment conditions, generating a missing status marker, expanding the prediction interval, and reducing the prediction confidence. The system must not mark the estimated value as the measured value.
[0105] (ii) S2: Extract quality kinetic characteristics and complete kinetic classification.
[0106] The purpose of S2 is not merely to pre-define the model based on the name of the quality indicator, but to determine the kinetic category based on the actual evolutionary characteristics of the quality indicator under the current fruit and vegetable varieties, treatment methods and environmental conditions, and to further convert the kinetic category into the candidate model range and physiological constraints.
[0107] 1. Time series preprocessing
[0108] like Figure 4 As shown, the system reads time series data for the same type, variety, treatment method, and quality indicators of fruits and vegetables, and arranges them in ascending order of storage time. The time series must contain at least 5 valid detection time points; if there are fewer than 5 time points, data-driven typing is not performed, but rule-based typing of similar fruits and vegetables is used, and the typing confidence level is marked as low.
[0109] For sequences with inconsistent detection time intervals, the actual time intervals are retained, and they are not forcibly converted into equally spaced sequences. To reduce the impact of detection noise on derivative and peak identification, this implementation uses the Savitzky-Golay local polynomial smoothing method, with a smoothing window of 5 time points and a polynomial order of 2. When the number of valid time points is 5 or 6, the window size is 5; when the number of valid time points is not less than 7, the window size can be 5 or 7, with priority given to windows with smaller cross-validation errors.
[0110] For the The first-order rate of change of each quality indicator at adjacent time points is calculated using the following formula:
[0111] ;
[0112] In the formula, For the first The quality indicator in the first First-order rate of change within a time interval; and These are the smoothing quality values at two adjacent time points; and The adjacent detection time.
[0113] The second-order change characteristics are calculated using the following formula:
[0114] ;
[0115] In the formula, For the first The quality indicator in the first Second-order variation characteristics at each position; and The first-order rate of change between two adjacent intervals; and This refers to the start and end times of the corresponding time range.
[0116] To ensure that quality indicators with different dimensions can use a unified classification threshold, the quality value and storage time are normalized from 0 to 1. Normalization is only used for feature extraction and classification and does not replace the actual unit of measurement in the model output.
[0117] 2. Dynamic eigenvectors
[0118] For each quality indicator, the following features are extracted:
[0119] First, the overall trend slope, that is, the linear regression slope of the normalized quality value relative to the normalized storage time.
[0120] Second, the monotonic consistency rate, which is the proportion of the number of intervals whose adjacent change direction is consistent with the overall change direction to the total number of valid intervals.
[0121] Third, the normalized range of change, which is the difference between the maximum and minimum values of the quality index divided by the observation range of the index;
[0122] Fourth, the maximum, minimum, mean, and standard deviation of the first-order rate of change;
[0123] Fifth, the maximum absolute value and the number of sign changes of the second-order change characteristics;
[0124] Sixth, the number of peaks, the location of peaks, and the prominence of peaks;
[0125] Seventh, the length of the plateau interval and the average slope of the plateau interval;
[0126] Eighth, the standardized response strength of temperature, relative humidity, and gas concentration;
[0127] Ninth, the main effect of time, the main effect of environment, and the interaction effect between time and environment;
[0128] Tenth, the goodness of fit of zero-order dynamics, first-order dynamics, Logistic model and Gompertz model.
[0129] When identifying peaks, the peak prominence threshold is set to 0.05 of the normalized quality variation range, and the minimum distance between two adjacent peaks is set to 0.10 of the effective sequence length. When determining plateau intervals, the absolute value of the normalized slope of the continuous interval is not greater than 0.03, and the length of the interval is not less than 0.20 of the complete storage period.
[0130] The above characteristics form the quality dynamics eigenvector:
[0131] ;
[0132] In the formula, For the first The dynamic eigenvectors of each quality indicator. The overall trend slope; The monotonic consistency rate; This represents the normalized range of change. The average rate of change; The standard deviation of the rate of change; Peak characteristics; Platform features; , and These are temperature, humidity, and gas response intensity, respectively.
[0133] 3. Principal Fractal Determination Rules
[0134] When the overall trend slope is greater than 0.05, the monotonic consistency rate is not less than 0.80, and there is no significant upper limit plateau, it is judged as a constant rate of increase; when a tail plateau is detected at the same time, it is judged as an asymptotic growth type.
[0135] When the overall trend slope is less than -0.05, the monotonic consistency rate is not less than 0.80, and there is no significant lower limit plateau, it is judged as a constant rate decline type or a rate-dependent decline type; when the length of the continuous interval of the tail segment is not less than 0.20 of the complete storage period, and the absolute value of the normalized slope of the tail segment is not greater than 0.03, it is judged as a bounded decline type.
[0136] When an internal peak with a prominence of not less than 0.05 is identified, it is determined to be a single-peak type; when two internal peaks that meet the minimum interval requirement are identified, it is determined to be a double-peak type.
[0137] When the absolute value of the overall trend slope is no greater than 0.05 and the normalized change is no greater than 0.10, it is judged as a stable and maintained type; when the overall trend is not significant but the change is greater than 0.10 and the derivative sign changes multiple times, it is judged as a fluctuating type.
[0138] When the same sequence simultaneously exhibits at least three evolutionary segments—rising, falling, peak, and plateau—and the goodness of fit of any single variant is less than 0.70, it is determined to be a composite variant.
[0139] 4. Auxiliary classification rules
[0140] The standardized response strengths of temperature, relative humidity, oxygen concentration, carbon dioxide concentration and ethylene concentration to the quality indicators were calculated separately, and the response strengths were normalized.
[0141] When the maximum response intensity accounts for at least 0.50% of the sum of all environmental response intensities, the corresponding driving factor is determined as the dominant factor. For example, when the temperature response accounts for at least 0.50%, the auxiliary classification is temperature-dominant.
[0142] When the sum of the responses of the top two factors is not less than 0.70, and the response proportion of each single factor is less than 0.50, the auxiliary classification is a two-factor coupled type; when there is no single or two-factor combination that meets the above conditions, the auxiliary classification is a multi-factor coupled type.
[0143] For quality indicators where the main effect of time is not significant but the main effect of temperature is significant, the primary genotype can be classified as stable maintenance type, and the secondary genotype as temperature-dominant type. This avoids incorrectly classifying respiratory rate, which shows "no significant monotonic change over time but significant differences in levels at different temperatures," as a degenerative indicator.
[0144] 5. Integration of rule-based fractal and data-driven fractal
[0145] For quality indicators with existing rules, rule-based classification is performed first. Simultaneously, the quality dynamics feature vector is standardized, and K-means clustering is used to identify the data structure. The number of clusters is searched between 2 and 10, with a random seed of 2026. Each cluster size is initialized 20 times, and the cluster with the largest silhouette coefficient is selected.
[0146] When the maximum silhouette coefficient is less than 0.50, no new category is established based on the clustering results; when the maximum silhouette coefficient is not less than 0.50, and the leave-one-out validation error of the data-driven classification model is reduced by at least 5% compared with the regular classification model, data-driven classification is adopted.
[0147] To prevent frequent reclassification due to a small amount of newly added data, the system performs 500 self-sampling tests on the data-driven classification. When the proportion of the same category appearing in the 500 classifications is not less than 0.80, a new dynamic category is confirmed. Otherwise, the original dynamic category is retained and marked as pending review.
[0148] 6. Physiological constraints corresponding to subtyping
[0149] After classification is completed, the system synchronously establishes prediction constraints, rather than simply saving the category names.
[0150] For weight loss rate and decay rate, non-negative constraints are set; the upper bound of decay rate is 100%. Under continuous storage conditions, adjacent predicted values of weight loss rate and cumulative decay rate satisfy non-decreasing constraints.
[0151] For hardness, non-negativity constraints and bounded descent constraints are set. The upper bound of the prediction is 1.10 times the maximum value observed in the training data; when the fractal is bounded descent, the plateau length of the tail segment of the prediction sequence is required to be no less than 0.20 of the prediction period.
[0152] For pigments, soluble solids, and color indices, a non-negative lower bound is set, and the upper bound of data support is 1.10 times the maximum observed value in the training data. When the predicted value exceeds the upper bound of data support, it is not directly used as a valid prediction output, but is marked as an extrapolation result.
[0153] For peak-type metrics, the number of peaks allowed will be set to the number of peaks identified by the dynamic fractal, and the peak position will be allowed to shift by 0.10 of the full prediction period before or after the average peak position of the training data.
[0154] (III) S3: Candidate model training, cross-condition validation and model determination
[0155] The key features of S3 technology are: narrowing down the range of candidate models based on kinetic classification; using leave-one-out conditions to verify and evaluate the generalization ability across temperature or treatment conditions; using physiological constraints to eliminate models that have low fitting errors but produce unreasonable predictions; and constructing storage evolution models and storage-to-shelf state transition models, respectively.
[0156] 1. Model Library Structure
[0157] Each model entry in the model library must include at least: model identifier, model category, applicable primary fractal, applicable secondary fractal, required input variables, optional input variables, output quality index, training parameters, constraint type, model version, and training data version.
[0158] For constant rate ascending and constant rate descending types, candidate models include zero-order dynamics, linear regression, ridge regression, and gradient boosting tree models.
[0159] For rate-dependent descent models, candidate models include first-order dynamics models, generalized additive models, gradient boosting tree models, and physical information neural network models.
[0160] For bounded descent and asymptotically growing models, candidate models include the Logistic model, the Gompertz model, the multinomial ridge regression model with plateau constraints, the random forest model, and the gradient boosting tree model.
[0161] For unimodal and bimodal models, candidate models include piecewise dynamics models, generalized additive models, long short-term memory network models, and Transformer models.
[0162] For stable indicators with significant temperature response, candidate models include second-order polynomial temperature response models, ridge regression models, and Gaussian process regression models.
[0163] For composite variation types, candidate models include random forest models, gradient boosting tree models, long short-term memory network models, Transformer models, and dynamics-neural network hybrid models.
[0164] 2. Training Data Construction
[0165] For the same fruit and vegetable variety and the same quality index, condition combinations are formed according to temperature, treatment method, and testing time. When there are multiple repeated measurements under the same condition combination, the condition mean is used as the model training target, the standard deviation is used as the observation uncertainty, and the number of repeated measurements is retained.
[0166] Training data must not share the same combination of conditions across the training and validation sets. For example, in leave-one-out temperature cross-validation, when all time points and treatments under 10°C conditions are used as the validation set, any duplicate samples under 10°C conditions must not be included in the training set.
[0167] The standardized parameters of continuous variables are calculated only on the training set and then applied to the validation set to prevent leakage of validation information. Categorical variables are encoded using one-hot encoding; categories not appearing in the training set are encoded as unknown categories.
[0168] 3. Candidate model parameters
[0169] This implementation uses the following executable parameters for the candidate model.
[0170] In the multinomial ridge regression model, the second-order model is used for stable and temperature-responsive indicators, while the third-order model is used for cumulative and bounded-decreasing indicators. Regularization coefficients of 0.01, 0.1, 1, 10, and 100 are determined through 5-fold cross-validation within the training set.
[0171] The random forest model uses 300 trees, 2 samples for the minimum leaf node, and the maximum number of features is the square root of the number of input features. The random seed is 2026. The maximum tree depth is selected from 6, 10, 15, and unlimited depth.
[0172] The gradient boosting tree model uses 300 base learners, with learning rates selected between 0.03, 0.05, and 0.10, maximum tree depth selected between 3 and 6, sample sampling ratio of 0.80, feature sampling ratio of 0.80, L2 regularization coefficient of 1, and random seed of 2026.
[0173] The support vector regression model uses a radial basis function kernel, with the penalty coefficient chosen between 1, 10, and 100. The kernel coefficients are the reciprocals of the variance of the training set features.
[0174] The Gaussian process regression model uses the product of a constant kernel function and a radial basis function kernel function, superimposed with a white noise kernel function. The initial value of the radial basis function length scale is set to 1.0, with an allowable optimization range of 0.01 to 100; the initial variance of the white noise is set to 0.01.
[0175] The Long Short-Term Memory (LSTM) network model uses one or two recurrent layers, with 32 or 64 hidden units per layer. The input time window consists of 4 to 8 detection time points, and the dropout rate is 0.10 or 0.20. The optimizer is Adam, with an initial learning rate of 0.001, a batch size of 16, and a maximum training epoch of 200. Training is stopped early if the validation error does not decrease for 20 consecutive epochs.
[0176] The Transformer model uses two encoder layers and four attention heads, with a feature dimension of 64, a feedforward network dimension of 128, a dropout rate of 0.10, and an input time window of 8 to 16 time points. The optimizer uses Adam, with an initial learning rate of 0.001, a maximum number of training epochs of 200, and an early stopping epoch of 20.
[0177] 4. Leave one condition for verification
[0178] Randomized partitioning validation allows different time points under the same temperature conditions to simultaneously enter the training and test sets, primarily reflecting the model's ability to fit known conditions. This invention prioritizes leave-one-out validation, using a complete temperature or treatment condition as the validation set to evaluate the model's generalization ability to unseen conditions.
[0179] The plum model employs leave-one-out temperature cross-validation, where all samples at 0℃, 5℃, and 10℃ are used as the validation set, and the remaining temperatures are used as the training set, with the validation being repeated three times. If used to evaluate the differences in 1-methylcyclopropene treatment, leave-one-out treatment validation is performed separately, and the results of the two validation methods should not be mixed.
[0180] Model evaluation metrics include root mean square error, mean absolute error, coefficient of determination, computation time, and physiological constraint pass rate. The comprehensive evaluation value is calculated using the following formula:
[0181] ;
[0182] In the formula, This is the comprehensive evaluation value of the candidate model; the smaller the value, the better the overall performance. This is the normalized root mean square error; This is the normalized mean absolute error; The normalized coefficient of determination is 1 minus the coefficient of determination; The normalized calculation time is represented by 0.40, 0.25, 0.25, and 0.10, which are the weights of the corresponding evaluation items.
[0183] Models must first meet constraint checks before participating in the comprehensive evaluation. Boundary constraint pass rate must be 100%, and directional constraint pass rate must be no less than 90%. Models that do not meet boundary constraints are directly eliminated; models with a directional constraint pass rate below 90% must not be deployed.
[0184] 5. Storage evolution model
[0185] The inputs to the storage evolution model should include at least the current temperature, treatment method, current storage time, prediction time span, and current quality status. The output is the future storage quality status. For initial predictions lacking the current quality status, the average initial conditions under the same variety, treatment method, and temperature can be used for initialization, but this reduces the prediction reliability.
[0186] For indicators such as TSS (Total Sediment Saturation Level) where initial values differ significantly across batches but relatively change little over storage, a relative change rate model anchored to the initial value is used. The relative change rate is determined by the following formula:
[0187] ;
[0188] In the formula, For quality indicators in time The relative rate of change; For time The quality value; This is the initial quality value for this batch.
[0189] The absolute quality value is recovered by the following formula during prediction:
[0190] ;
[0191] In the formula, To predict absolute quality values; This is the initial quality value for the batch. This is the output value for the relative rate of change model.
[0192] 6. Storage to Shelf State Transition Model
[0193] The storage-to-shelf state transition model is used to predict the quality status of fruits and vegetables after they are transferred from their current storage conditions to preset shelf conditions and maintained for a preset time. The model's input and output relationships are as follows:
[0194] ;
[0195] In the formula, To predict quality status at the end of the shelf life; Storage environment conditions; To handle driving factors; This is the current storage time; This refers to the current quality status upon transfer to the shelf. The condition of the shelving environment; For shelf life; This is the state transition model after training.
[0196] like Figure 11 As shown, four input schemes were constructed. Scheme A uses temperature, treatment method, and storage days; Scheme B adds the original storage quality indicators to Scheme A; Scheme C adds storage state variables obtained from principal component analysis to Scheme A; and Scheme D adds storage state variables obtained from partial least squares regression to Scheme A.
[0197] 7. Forecast Interval
[0198] This implementation method uses 500 bootstrapping samplings to determine the prediction interval. Each time, the same number of samples as the original training set are drawn with replacement from the training samples, the model is retrained, and predictions are performed. The 2.5th percentile and 97.5th percentile of the 500 prediction results are used as the 95% prediction interval. This interval should be described as a prediction interval, not a parameter confidence interval.
[0199] 8. Deployment Model Determination
[0200] After the candidate models pass the constraint check, the model with the smallest comprehensive evaluation value is selected as the current deployment model. If the difference in comprehensive evaluation values between two candidate models is less than 2%, the model with fewer input fields, lower computational cost, and stronger physiological interpretability is given priority.
[0201] The model deployment file should at least save the following: quality indicator name, primary dynamics subtype, secondary dynamics subtype, input variable order, missing value handling rules, standardized parameters, model parameters, physiological constraints, training data version, validation results, setup time, and model version number.
[0202] (iv) S4: Establishing the digital twin state space
[0203] like Figure 6As shown, a digital twin object is created for each batch of fruits and vegetables and assigned a unique batch identifier. The digital twin state can be represented as follows:
[0204] ;
[0205] In the formula, For batch In time The digital twin state; Environmental state; Quality status; For driving factor states; For model state; The situation is at risk. This is for predicting the state.
[0206] The environmental status records include the current temperature, relative humidity, oxygen concentration, carbon dioxide concentration, and ethylene concentration, as well as the mean, maximum, minimum, and cumulative exposure of each environmental variable in the previous quality monitoring cycle.
[0207] The quality status records the current weight loss rate, decay rate, hardness, soluble solids, respiration rate, ethylene release rate, and color indicators. Each value in the quality status is also associated with the data source, testing time, testing method, and actual or estimated label.
[0208] The driving factor status stores the current values and integrity coefficients of environmental driving factors, processing driving factors, quality driving factors, and management information.
[0209] The model state saves the currently deployed model identifier, model version, dynamics category, list of input variables, applicable temperature range, applicable processing method, training data version, update time, and benchmark verification error.
[0210] The risk status includes the risk of spoilage, the risk of quality deterioration, the risk of insufficient remaining shelf life, and the risk update time. The forecast status includes the future quality forecast value, the 95% forecast range, the forecast target time, the remaining shelf life, the optimal sales window, and the forecast reliability.
[0211] During the initialization of the digital twin object, the batch information, post-harvest processing information, initial quality status, and current environmental status are read. If the initial quality status is incomplete, the historical initial status of the same variety and processing method is retrieved for estimation, and the estimation identifier is recorded.
[0212] A two-way mapping is established between the physical condition of fruits and vegetables and their digital twin objects. Monitoring data generated on the physical side is used to update the digital twin objects; the prediction results and risk status generated by the digital twin objects are used to generate suggestions for sampling, sales, transfer, or environmental adjustment. This two-way mapping does not mean that the prediction results can replace the measured data.
[0213] (v) S5: Online updates, model evaluation and dynamic switching
[0214] like Figure 7 As shown, the system continuously receives new monitoring data and sequentially completes the updating of driving factor status, correction of environmental and quality status, invocation of the currently deployed model, prediction of future quality, and evaluation of prediction error and dynamic category.
[0215] 1. Status Correction
[0216] When the new data is a quality value directly tested in the laboratory, the quality status correction factor is 0.80; when the new data is an online non-destructive testing value, the correction factor is 0.60; when the new data is calibrated environmental sensor data, the environmental status correction factor is 1.00.
[0217] The corrected state is determined by the following formula:
[0218] ;
[0219] In the formula, The corrected state value; These are newly added monitoring values; This represents the model's predicted state before the arrival of new monitored values. As correction factors, 0.80 is used for laboratory quality testing, 0.60 for online non-destructive testing, and 1.00 for environmental sensor data.
[0220] 2. Triggering conditions for model re-evaluation
[0221] The system triggers a model re-evaluation when any of the following conditions are met:
[0222] (1) No fewer than 5 new valid quality inspection time points shall be added;
[0223] (2) The number of new samples reaches 20% of the original training sample number;
[0224] (3) The prediction error at two consecutive quality inspection time points both exceed twice the root mean square error of the current model benchmark;
[0225] (4) The re-extracted dynamic features lead to changes in the main or auxiliary dynamic fractal;
[0226] (5) Add new models that match the current dynamics category to the model library;
[0227] (6) The user changes the forecast target, forecast time span, or shelf environment conditions.
[0228] 3. Shadow Model and Dynamic Switching
[0229] During re-evaluation, the currently deployed model continues to provide prediction services, while the candidate model is trained and validated in the background as a shadow model. The candidate model must be compared using the same validation data and physiological constraints as the currently deployed model.
[0230] When the overall evaluation value of the candidate model is reduced by at least 2% compared to the currently deployed model, the boundary constraint pass rate reaches 100%, the directional constraint pass rate is not less than 90%, and the above advantages remain valid for two consecutive evaluation cycles, the model switch is executed.
[0231] Before switching models, save the original model version, reason for switching, switching time, and evaluation results of the old and new models. For the first two prediction cycles after the switch, retain the original model's parallel output for rollback in case of anomalies. If the error of the new model exceeds that of the original model for two consecutive cycles, revert to the original model and record the rollback event.
[0232] After day 45, data distribution drift was artificially set, and the prediction error of the fixed model continued to increase, while the growth rate of the prediction error of the periodically retrained model decreased. After continuously confirming that the candidate model is better than the current model, the present invention performs dynamic switching on day 52, and the prediction error after switching is reduced and remains stable.
[0233] 4. Quality forecasting and remaining shelf life determination
[0234] After completing state correction and model evaluation, the system generates a sequence of future quality states starting from the current moment, following a preset prediction step size. The remaining shelf life is determined based on the time when one or more quality thresholds are first exceeded. These quality thresholds are determined by national standards, industry standards, enterprise acceptance standards, or user-defined values, and are stored along with the standard sources.
[0235] When multiple quality indicators have thresholds set, the earliest time that the non-conforming threshold is reached is taken as the end of the remaining shelf life. The optimal sales window is set before the expected decline in quality grade, and the specific lead time can be set to 1 to 3 days; this implementation uses 2 days.
[0236] IV. Examples and Comparative Examples
[0237] Example 1: Construction of a digital twin model based on plum storage-shelf test data
[0238] This embodiment uses the climacteric fruit "France" plum as the subject, and employs the method of this invention to establish a storage quality prediction model driven by temperature and 1-methylcyclopropene treatment, as well as a state transition model from the storage state to the quality state after 3 days on the shelf. The experimental procedure is as follows: Figure 9 As shown.
[0239] 1. Experimental Design and Data Processing
[0240] Prunes of similar maturity, size, and appearance without mechanical damage were selected and stored at 0℃, 5℃, and 10℃, respectively. Control groups and 1-methylcyclopropene treatment groups were set up for each temperature condition. The 1-methylcyclopropene treatment concentration was 1.0 μL / L, the treatment temperature was 20℃, and the treatment time was 12 hours.
[0241] The storage period is 120 days, and the quality indicators are tested every 7 days during the storage period. Samples are taken on the 15th, 30th, 45th, 60th, 75th, 90th, 105th and 120th days of storage. The samples are then placed in a shelf environment of 20°C and 65% relative humidity for 3 days, and the quality status after 3 days on the shelf is tested.
[0242] The test indicators include weight loss rate, hardness, soluble solids, chlorophyll a, chlorophyll b, total chlorophyll, carotenoids, chlorophyll / carotenoid ratio, anthocyanins, and CIRG.
[0243] Table 1. Prune Storage-Shelf Experiment Design and Data Structure
[0244]
[0245] Since the detection targets and number of replicates for hardness, sugar and acid composition and pigment index are not completely consistent, this embodiment constructs a model sample with the mean values under the same temperature, the same treatment method and the same storage time, and retains the replicated values for calculating the standard deviation and predicting uncertainty.
[0246] 2. Dynamic Feature Extraction and Classification
[0247] The system establishes a quality dynamics feature space based on the direction, rate of change, first derivative, second derivative, number of peaks, plateau length, and environmental response characteristics of quality indicators with storage time, and performs principal and auxiliary classifications.
[0248] The kinetic classification and candidate model configuration of plum quality indicators are shown in Table 2.
[0249] Table 2 - Kinetic Classification and Candidate Model Configuration of Plum Quality Indicators
[0250]
[0251] 3. Setting Prediction Boundaries
[0252] To avoid abnormal results such as negative weight loss rate, negative stiffness, or exceeding the range supported by the data from model extrapolation, the lower bound of the prediction for the corresponding index is set to 0, and the upper bound of the prediction is set to 1.10 times the maximum value observed in the experiment; the upper bound of the prediction for weight loss rate shall not exceed 100%.
[0253] Table 3 - Experimental observation range and model prediction boundary for plum quality indicators
[0254]
[0255] 4. Model Training and Evaluation
[0256] Temperature, processing method, and storage days were used as basic input variables. For the XGBoost model, in one implementation, the number of decision trees was set to 300, the maximum tree depth was set to 4, the learning rate was set to 0.05, the subsample ratio was set to 0.80, the feature sampling ratio was set to 0.80, the L2 regularization coefficient was set to 1, the loss function was the squared error, and the random seed was set to 2026.
[0257] The training and validation sets were divided according to temperature conditions. One temperature condition was retained as the validation set at each step, and the remaining temperature conditions were used as the training set. This process of leave-one-out-of-temperature cross-validation was performed sequentially. The results are shown in Table 4.
[0258] Table 4 - Predictive Performance Evaluation Results of Prune Storage Quality Indicators
[0259]
[0260] The results showed that the R² values of trend-type quality indicators such as weight loss rate, hardness, anthocyanins, and CIRG were all no less than 0.839, while the predictive ability of fluctuation-type indicators was relatively low. This indicates that kinetic modeling can identify quality indicators suitable for long-term prediction and adopt different modeling strategies for low-trend indicators.
[0261] 5. Storage quality scenario prediction
[0262] Using 0℃, control treatment, and initial storage conditions as inputs, Table 5 was obtained. Figure 10 The model prediction results are shown.
[0263] Table 5. Prediction results of representative scenarios for plums in the 0℃ control group.
[0264]
[0265] The weight loss rate showed a continuous increasing trend, the hardness gradually entered a plateau range after 45 to 60 days, the anthocyanins continued to increase, and the CIRG maintained bounded changes, which respectively conformed to the corresponding kinetic classifications.
[0266] 6. Shelf3 State Transition Model
[0267] The current quality status under the same temperature, processing method, and storage time is paired with the quality status after 3 days on the shelf to form a status transition sample. The following input schemes are set respectively:
[0268] Option A only requires inputting temperature, treatment method, and storage days; Option B adds the original storage quality status to Option A; Option C adds the storage status extracted by principal component analysis to Option A; Option D adds the storage status extracted by partial least squares regression to Option A.
[0269] Table 6 - Evaluation results of different state input schemes for the Shelf3 state transition model
[0270]
[0271] Among schemes B through D with clear evaluation values, scheme B, which directly incorporates the original storage quality status, achieves a higher average R², indicating that the actual quality status on the day of transfer to the shelf can provide effective information for shelf quality prediction.
[0272] Example 2: Indicator-Specific Digital Twin Model Based on Real Blueberry Experimental Data
[0273] This embodiment uses the non-breathing climacteric "Eureka" blueberry as an example to establish a multi-index quality digital twin model driven by temperature and storage time.
[0274] 1. Experimental Design
[0275] Four storage temperatures were set: 0℃, 5℃, 10℃, and 20℃. The storage period was 0 to 33 days, and the detection time points were days 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, and 33. A total of 360 raw data entries were collected.
[0276] Table 7 - Experimental Design and Data Structure for Blueberry Postharvest Storage
[0277]
[0278] 2. Dynamic identification and classification
[0279] The system identifies the dynamic type of quality indicators through time effects, temperature effects, time-temperature interaction effects, and time quadratic terms.
[0280] Table 8 - Statistical Test Results and Kinetic Classification Results of Blueberry Quality Indicators
[0281]
[0282] 3. Model Building
[0283] Table 9 - Blueberry Quality Indicator Model Construction Strategies and Deployment Models
[0284]
[0285] The ridge regression regularization coefficients were selected from 0.01, 0.1, 1, 10, and 100 through cross-validation on the training set, with a random seed of 2026.
[0286] The relative rate of change of TSS is calculated according to the following formula:
[0287] ;
[0288] In the formula, The relative rate of change of TSS; Storage time is TSS at that time; This is the initial TSS.
[0289] After the model outputs the relative rate of change, the absolute predicted value is restored according to the following formula:
[0290] ;
[0291] In the formula, This is the predicted value for TSS; The initial TSS for input; This represents the relative rate of change of TSS predicted by the model.
[0292] 4. Model Evaluation
[0293] Table 10 - Evaluation results of the predictive performance of blueberry multi-model digital twin
[0294]
[0295] For hardness, we further compared the absolute value degradation model and the relative rate of change model.
[0296] Table 11 - Evaluation results of different modeling strategies for blueberry firmness
[0297]
[0298] Under leave-one-temperature validation conditions, the relative rate of change model reduced the hardness RMSE by 46.2% and the MAE by 36.1%. The system can use the relative rate of change model as an alternative deployment model when the initial hardness of a new batch deviates from the training data distribution.
[0299] 5. Intermediate Temperature Scenario Prediction
[0300] The storage temperature was set to 8℃, the storage time to 30 days, and the initial TSS to 12.0. The results are shown in Table 12.
[0301] Table 1. Scenario prediction results of blueberry quality under 12-8℃ and 30-day storage conditions.
[0302]
[0303] The 8℃ temperature falls between the experimental conditions of 5℃ and 10℃. The above results are interpolation predictions within the range supported by the experimental data, rather than direct measured data under the 8℃ condition.
[0304] Example 3: Repetitive Data Validation Based on Plum Experimental Boundaries
[0305] This embodiment is used to verify the stability of the dynamic classification when detection errors exist. Using the predicted trajectory of the 0℃ control group in Example 1 as the center value, zero-mean random perturbation is added to each center value to generate 5 replicates.
[0306] ;
[0307] In the formula, For the first A repetition in time The value; These are the model predictions for the corresponding time periods; The random disturbance is a zero-mean normal distribution. and These are the lower bound and the upper bound of the prediction, respectively. This indicates a boundary interception operation.
[0308] The random seed was set to 2026, and the coefficients of variation for weight loss, hardness, anthocyanins, and CIRG were set to 3%, 4%, 5%, and 3%, respectively.
[0309] Table 13 - Repeated Data Generated Based on Plum's True Predicted Trajectory
[0310]
[0311] After re-extracting the kinetic characteristics of the data, the weight loss rate was still identified as monotonically cumulative, the hardness was still identified as a bounded plateau decay type, the anthocyanins were still identified as monotonically pigment-accumulating type, and the CIRG was still identified as a bounded color index type, indicating that the kinetic classification results remained stable within the above detection error range.
[0312] Example 4: Indicator-Specific Digital Twin Model Based on Real Experimental Data of 'Huangfei' Tomato This embodiment uses the respiratory climacteric 'Huangfei' tomato as an example to establish a multi-index quality digital twin model driven by temperature and storage time.
[0313] 1. Experimental Design
[0314] Six storage temperatures were set: 0℃, 5℃, 8℃, 10℃, 16℃, and 20℃. The longest storage period was 0–20 days. The experiment was repeated three times, and a total of 297 raw data points were obtained.
[0315] Different quality indicators were tested using different timeframes. Specifically, respiration rate was tested on days 0, 0.125, 0.25, 0.375, 0.625, 0.875, 2, 3, 4, 5, 6, 7, 10, 15, and 20; ethylene release rate was tested on days 0, 0.125, 0.25, 0.375, 0.625, 0.875, 2, 3, 4, 5, and 6; and weight loss, titratable acid content, and TSS were tested on days 0, 1, 3, 6, 9, 12, and 15.
[0316] Respiration rate and ethylene release rate were determined at all six temperature conditions; weight loss, titratable acid content, and TSS were determined only at 5°C and 20°C. All data pertain to the storage period.
[0317] Table 14 - Experimental Design and Data Structure for Postharvest Storage of Huangfei Tomato
[0318] There were 270 valid observations of respiration rate, which were compiled into 90 temperature-time conditional averages; there were 194 valid observations of ethylene release rate, which were compiled into 66 conditional averages; there were 42 valid observations of weight loss rate and titratable acid content, which were compiled into 14 conditional averages each; and there were 39 valid observations of TSS, which were compiled into 13 conditional averages.
[0319] 2. Dynamic identification and classification
[0320] The system identifies the dynamic type of quality indicators through time effects, temperature effects, time-temperature interaction effects, and time quadratic terms.
[0321] Table 15 - Statistical Test Results and Kinetic Classification of Quality Indicators of 'Huangfei' Tomato
[0322] The weight loss rate exhibits significant time effects and time-temperature interaction effects, while the quadratic term of time is not significant, indicating that it generally exhibits an approximately linear cumulative effect at various temperatures, but the weight loss rate varies at different temperatures.
[0323] The time effect, temperature effect, time-temperature interaction effect, and time quadratic term of respiration rate were all significant, indicating that the postharvest respiration state of Huangfei tomatoes has obvious rapid adjustment, nonlinear change, and temperature dependence characteristics.
[0324] The ethylene release rate is also significantly affected by time and temperature, exhibiting a significant time-secondary effect. Its variation cannot be described by a simple linear equation and is best suited to a nonlinear data-driven model.
[0325] The main effects of time and temperature on titratable acid content were not significant, but the time-temperature interaction effect was significant, indicating that the direction or rate of change of TA differs at different temperatures.
[0326] TSS exhibits significant temperature and time quadratic effects, with relatively small overall variation, but may show different curve shapes at different temperatures.
[0327] 3. Model Building
[0328] Table 16 - Model Construction Strategy and Deployment for Huangfei Tomatoes' Quality Indicators
[0329] The system compares the second-order polynomial ridge regression model and the random forest regression model. The regularization coefficient of the ridge regression is set to 1.0; the random forest consists of 200 decision trees with a random seed of 42.
[0330] The model selection employs both of the following types of validation: Leave one time point for validation: Each time, a complete stored time point is used as the validation set to evaluate the model's ability to predict unseen time points; Leave-one-out temperature validation: Each time, a complete set of temperatures is used as the validation set to evaluate the model's ability to predict unseen temperatures.
[0331] The system calculates the average RMSE of the two types of validations and selects the candidate model with the smaller overall error accordingly. When the R² of the leave-one-time-point validation or leave-one-temperature validation is not greater than 0, the model is only registered as an experimental model and is not included in the prediction channel for ordinary users.
[0332] The weight loss rate model is supplemented with the following physical constraints: WL(T,0)=0; WL(T,t)≥0; where (WL(T,t)) is the predicted weight loss rate under temperature (T) and storage time (t) conditions.
[0333] Respiration rate, ethylene release rate, TA and TSS all increase non-negative constraints: Q(T,t)≥0; where (Q(T,t)) is the predicted value of the corresponding quality or physiological indicator.
[0334] Huangfei tomatoes are cold-sensitive fruits, and the platform sets the lower temperature limit to 0℃. When the input temperature is below 0℃, the system issues an invalid input warning and does not perform quality trend prediction.
[0335] 4. Model Evaluation
[0336] This embodiment uses leave-one-time-point verification as an evaluation of time prediction performance, and also reports the leave-one-temperature verification results. The number of valid samples in the table is the number of conditional means obtained by averaging under the same temperature and storage time.
[0337] Table 17 - Evaluation Results of Leave-at-One-Time Prediction Performance of Huangfei Tomato Multi-Model Digital Twin
[0338] The one-stay-one-time validation R² for the weight loss rate model was 0.965, indicating that the model can effectively describe the cumulative change of weight loss rate over time at 5℃ and 20℃. The one-stay-one-time validation R²s for respiration rate and ethylene release rate were relatively low, mainly due to the dense early detection periods and the rapid changes and local fluctuations in both indicators during the early stages of storage. Nevertheless, both models performed well in cross-temperature validation.
[0339] Table 18 - Evaluation Results of Different Verification Methods for Quality Indicators of Huangfei Tomato
[0340] TA and TSS were measured only at 5℃ and 20℃. In the leave-one-temperature validation, data from only one temperature could be used to predict the other at a time, making the validation conditions very stringent and also revealing the problem of insufficient temperature information. Therefore, the TA and TSS models are retained only as experimental models.
[0341] 5. Intermediate Temperature Scenario Prediction
[0342] Inputting a storage temperature of 12℃ and a storage time of 5 days yielded the prediction results shown in Table 19. 12℃ falls between 10℃ and 16℃, and also between 5℃ and 20℃ for weight loss, total ta (TA), and total sweet spot (TSS). Therefore, this scenario represents an interpolated prediction within the experimental temperature range, rather than direct measured data under 12℃ conditions.
[0343] Table 1. Prediction results of Huangfei tomato quality under 19-12℃ and 5-day storage conditions.
[0344] The intervals in the table are approximated for RMSE based on leave-one time point verification using the following formula: PI 95% = y^ ± 1.96 × RMSE; where PI 95% y^ represents the approximate 95% error reference interval; y^ represents the model prediction value; RMSE represents the root mean square error of validation with one time point left.
[0345] For indicators with non-negativity constraints, the lower limit of the interval is no less than 0. Since the current model has not yet established a prediction interval that has been independently probabilistically calibrated, the above interval is a model error reference interval and is not equivalent to the 95% prediction interval in a strictly statistical sense.
[0346] Weight loss rate, respiration rate, and ethylene release rate have been validated by time and temperature and can be used as official predictive indicators for the platform. TA and TSS have not yet been fully validated, and their predictive results can only be used as research references and should not be directly used as the basis for judging product quality or determining storage endpoints.
[0347] Example 5: Indicator-Specific Digital Twin Model Based on Real Experimental Data of Green Beans This embodiment takes green beans, a non-climacteric vegetable, as the subject and establishes a multi-index quality digital twin model driven by temperature and storage time.
[0348] 1. Experimental Design The original experiment set five storage temperatures: 0℃, 5℃, 10℃, 12℃, and 20℃. The storage period was 0–21 days, and the detection time points were days 0, 7, 14, and 21. Each treatment was replicated four times. The original data file contained a total of 124 records, including 72 records for the storage stage and 52 records for the shelf stage.
[0349] This embodiment only constructs a quality prediction model for the storage period and does not predict shelf life. Therefore, all shelf-life stage records are excluded before model training. Simultaneously, to study the quality kinetics under 5℃, 12℃, and 20℃ conditions, the 0℃ and 10℃ groups are further excluded, but data from day 0 are retained. After completing the stage and temperature screening, a total of 40 original storage period records are included in the data processing. The conditional mean of four repeated measurements at the same temperature and storage time is taken, ultimately forming 10 temperature-time conditional means. The 5℃ and 12℃ groups include data from days 0, 7, 14, and 21, while the 20℃ group only includes data from days 0 and 7.
[0350] Table 20 - Experimental Design and Data Structure for Postharvest Storage of Green Beans
[0351] 2. Dynamic identification and classification The system identifies the dynamic types of each quality index through time effect, temperature effect, time-temperature interaction effect, and time quadratic term.
[0352] Table 21 - Statistical Test Results and Kinetic Classification Results of Quality Indicators of Green Beans During Storage Period
[0353] The time-temperature interaction effect of weight loss rate was extremely significant, indicating a marked difference in the rate of weight loss at different temperatures. The overall weight loss rate within each temperature group accumulated over time, thus classifying them into a constant-rate increasing type and a time-temperature strongly coupled type. The disease index exhibited significant time effects, interaction effects, and time-secondary effects, indicating that disease development accelerates with storage time and is temperature-regulated. Hardness showed significant time effects, interaction effects, and time-secondary effects, indicating that hardness changes are not a simple linear decrease. The main time and temperature effects of CCI were not significant, but the interaction effect was significant, indicating that the direction or rate of change of CCI differed at different temperatures.
[0354] 3. Model Building Table 22 - Model Construction Strategies and Model Deployment for Various Quality Indicators of Green Beans During Storage Period
[0355] The system compares a second-order polynomial ridge regression model and a random forest regression model. The ridge regression regularization coefficient is set to 1.0; the random forest contains 200 decision trees with a random seed of 42. Model selection employs both leave-one-out-of-time and leave-one-out-of-temperature validation. The system calculates the average RMSE of the two validation classes and selects the model with the smaller overall error. When the R² of any key validation is not greater than 0, the model is registered only as an experimental model and not included in the ordinary prediction channel.
[0356] The weight loss rate is reset to zero on day 0, and non-negativity is constrained as follows: WL(T,0)=0; WL(T,t)≥0. The disease index is limited to: 0≤DI(T,t)≤100. The predicted hardness value is limited to non-negativity. This embodiment does not establish a storage-shelf state transition model, nor does it output the 3-day shelf quality, shelf life, or remaining shelf life.
[0357] 4. Model Evaluation Table 23 - Evaluation Results of Multi-Model Digital Twin Prediction Performance for Green Bean Storage Period
[0358] The R², RMSE, and MAE in the table represent the validation results at the leave-one time point. Further validation at the leave-one temperature point yielded the following results.
[0359] Table 24 - Evaluation Results of Different Verification Methods for Quality Indicators of Green Beans During Storage
[0360] Weight loss rate was the best-performing indicator in this modeling study. Its leave-one-time validation R² was 0.881, and its leave-one-temperature validation R² was 0.843, indicating that the model can effectively describe the changes in weight loss rate over time and temperature. The disease index and CCI both passed the minimum deployment threshold and can be used as indicators for predicting the formal storage period. The leave-one-time validation R² for hardness was negative, indicating that the model cannot stably predict completely unseen time points; therefore, it is only retained as an experimental model.
[0361] 5. Intermediate Temperature Scenario Prediction Inputting a storage temperature of 8℃ and a storage time of 14 days yielded the prediction results shown in Table 25. 8℃ falls between the experimental temperatures of 5℃ and 12℃, and 14 days represents the actual detection time for the 5℃ and 12℃ groups. Therefore, this scenario falls within the range of storage period temperature interpolation prediction supported by the experimental data.
[0362] Table 2. Prediction results of green bean quality during storage at 25-8℃ and 14 days.
[0363] The approximate 95% error reference interval is calculated using the following formula: PI95% = y^ ± 1.96 × RMSE. This interval is based on the RMSE validated at one-time point and belongs to the model error reference interval, not the strictly 95% prediction interval after independent probability calibration. This model is only applicable to predicting quality changes during storage. Weight loss rate, disease index, and CCI can be used as official outputs of the platform; hardness prediction is only for research reference.
[0364] Comparative Example 1: A unified Neural ODE model without dynamic classification of quality indicators
[0365] Comparative Example 1 used the same blueberry data as Example 2, and composed a unified state vector of weight loss rate, respiration rate, decay rate, TSS, and firmness. A Neural ODE model was used to learn the changes of all quality indicators over time. All input variables and quality indicators were standardized, and observation range constraints were set during the numerical integration process.
[0366] Table 26 - Predictive performance evaluation results of the unified Neural ODE comparative model
[0367]
[0368] As shown in Tables 10 and 26, the average R² of the method of the present invention across the five indicators is 0.8176, while that of Comparative Example 1 is 0.7654. The present invention reduces the RMSE of weight loss rate, respiration rate, decay rate, TSS, and hardness by 28.0%, 14.9%, 18.8%, 8.3%, and 3.9%, respectively. The comparison results are as follows: Figure 12 As shown.
[0369] Although the MAE of the hardness model in Comparative Example 1 is slightly lower, the R² of the hardness model of this invention is higher and the RMSE is lower, indicating that the model selection should comprehensively consider multiple evaluation indicators and dynamic consistency, rather than relying solely on a single error indicator.
[0370] Comparative Example 2: No dynamic and physiological boundary constraints are set.
[0371] Comparative Example 2 uses the same training data and candidate model as Example 1, but determines the model only based on the validation error, without implementing non-negativity constraints, upper bound constraints, change direction constraints, peak number constraints, and plateau constraints.
[0372] Based on the observation range of Example 1, 180 prediction points were generated, and abnormal prediction events were statistically analyzed.
[0373] Table 27 - Comparison of anomaly prediction results with and without kinetic-physiological constraints
[0374]
[0375] The results show that relying solely on prediction errors for model selection may lead to negative weight loss rates, abnormal increases in hardness, and results exceeding the experimental support range. This invention, by linking kinetic classification results with model constraints, can reduce predictions that do not conform to the postharvest physiological patterns of fruits and vegetables.
[0376] Comparison Example 3: Fixed Model and Model Only Retrained
[0377] Test data for 90 consecutive monitoring periods were constructed using the blueberry model residual distribution of Example 2. Starting from the 46th monitoring period, the environmental response relationship was changed to simulate data drift caused by seasonal changes, batch changes, or changes in the status of cold chain equipment.
[0378] Comparative Example 3-1 always uses the initial model; Comparative Example 3-2 retrains the original model structure using only new data after detecting a performance degradation; the present invention, however, re-extracts dynamic features, reconfirms dynamic classifications, and allows candidate models to compete again and switch dynamically.
[0379] When the prediction error exceeds twice the baseline RMSE for two consecutive cycles, the candidate model is re-evaluated; when the new model's overall evaluation result improves by no less than 2%, meets all physiological constraints, and maintains its advantage for two consecutive evaluation cycles, the model is switched.
[0380] Table 28 - Comparison of prediction performance between fixed model, model that only retrains, and dynamically switching model
[0381]
[0382] Table 28 shows the corresponding relationships. Figure 13 As shown, compared to a fixed model, this invention reduces the standardized RMSE after data drift by 69.8%; compared to simply retraining the original model, this invention reduces the standardized RMSE by 50.2%, indicating that reclassification and model type switching can improve the long-term adaptability of digital twin models when the pattern of quality change changes.
[0383] Comparative Example 4: Incomplete core driving factors
[0384] Taking blueberry TSS prediction as an example, the complete input includes temperature, storage time, and initial TSS. In the first missing state, the initial TSS is not input, and the historical average under the corresponding temperature conditions is used instead; in the second missing state, both the initial TSS and temperature monitoring are missing, and the temperature data is interpolated to complete the data.
[0385] The residual distribution of Example 2 was used for 500 resampling operations, and the results are shown in Table 29.
[0386] Table 29 - Comparison of prediction results under different core driving factor integrity conditions
[0387]
[0388] The results show that when the integrity of the core driving factors decreases, both the prediction error and the prediction interval width increase. This invention enables the digital twin system to reflect the uncertainty caused by incomplete input data through driving factor integrity checks, missing state marking, and prediction confidence adjustment.
[0389] V. Overall Implementation Results
[0390] Examples 1-5 and Comparative Examples 1-4 demonstrate that this invention establishes a quality dynamics feature space, performs dynamic classification on quality indicators with different evolutionary patterns, and uses the classification results for candidate model screening, physiological constraint configuration, digital twin state construction, and dynamic model switching. Compared with unified models, unconstrained models, fixed models, and incomplete driving factor conditions, this invention can improve the prediction accuracy of trend indicators, reduce prediction results that do not conform to physiological patterns, and maintain good online prediction capabilities when quality evolution patterns change.
[0391] The foregoing description of embodiments of the present invention, through which those skilled in the art are able to implement or use the present invention, will be readily apparent to those skilled in the art. Various modifications to these embodiments will be readily apparent to those skilled in the art. The general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novelty disclosed herein.
Claims
1. An adaptive construction method for postharvest digital twin models of fruits and vegetables based on quality index dynamic classification, characterized in that, Includes the following steps: S1. Collect time-series data of environmental factors, post-harvest treatment, initial quality and quality indicators according to fruit and vegetable batches, establish a set of core driving factors corresponding to fruit and vegetable types, quality indicators and prediction targets and check the completeness. S2, extract the time response characteristics and environmental response characteristics of each quality indicator, determine the main type of time evolution and the auxiliary type of driving response, and establish a classification constraint that includes the direction of change, value boundary and peak or plateau characteristics; S3. Candidate models are obtained from the model library based on two types. A validation set is constructed by leaving one storage temperature, one post-harvest treatment, or one storage time point. Candidate models whose prediction results do not meet the classification constraints are eliminated. The storage evolution model of each quality index is determined based on the validation error. The current quality state under the same temperature, treatment, and time and the quality state after transitioning to the preset shelf conditions are used to form paired samples to train the shelf state transition model. S4. Establish a digital twin state space that uniquely corresponds to each batch of fruits and vegetables, and write the driving factors, current quality status, two types of models, classification constraints and prediction results into the digital twin state space. S5, receive new monitoring data and update the kinetic type, digital twin status and model performance; when the kinetic type changes, the prediction error exceeds the limit or the candidate model verification error is lower, switch the corresponding model according to step S3, and output the future storage quality status and the quality status after entering the preset shelf conditions.
2. The method according to claim 1, characterized in that, The environmental factors in step S1 include temperature, relative humidity, oxygen concentration, carbon dioxide concentration, and ethylene concentration; the post-harvest treatment includes packaging treatment, pre-cooling treatment, modified atmosphere treatment, and 1-methylcyclopropene treatment; the initial quality includes maturity, initial hardness, soluble solids, acidity, color, respiration rate, and ethylene release rate; the time-series data of the quality indicators include at least two of the following: weight loss rate, decay rate, hardness, soluble solids, pigment content, respiration rate, ethylene release rate, and color index.
3. The method according to claim 1 or 2, characterized in that, In step S1, the set of core driving factors established for climacteric fruits includes at least temperature, oxygen concentration, carbon dioxide concentration, ethylene concentration, and 1-methylcyclopropene treatment information; the set of core driving factors established for non-climacteric fruits includes at least temperature, relative humidity, storage time, and initial quality status. And / or, in step S1, the integrity check includes checking whether the core driving factors are missing, whether the data format is consistent, whether the collection time is corresponding, and whether the number of effective samples meets the modeling requirements; when the core driving factors are missing, a missing label is set for the corresponding data, and historical data of the same variety and the same processing are used to estimate or reduce the confidence level of the corresponding prediction results.
4. The method according to claim 1, characterized in that, In step S2, the time response characteristics include first-order change trend, second-order change trend, change rate, change amplitude, number of peaks, peak position, and platform length; the environmental response characteristics include temperature effect, humidity effect, gas effect, post-harvest processing effect, and the interaction effect between storage time and environmental factors. And / or, in step S2, the main type of time evolution includes constant rate increase type, constant rate decrease type, bounded decrease type, asymptotic growth type, peak type, bimodal type, fluctuating type, and stable maintenance type; the auxiliary type of driving response includes temperature-dominated type, humidity-dominated type, gas-dominated type, and multi-factor coupled type; the auxiliary type of driving response is recorded in combination with the main type of time evolution. And / or, in step S2, for quality indicators with known post-harvest change patterns, the kinetic type is determined according to preset judgment rules; for unknown quality indicators or quality indicators whose types cannot be determined by preset judgment rules, the kinetic type is determined by clustering algorithm or classification model, and the quality indicator name, kinetic type, determination method, applicable fruits and vegetables, applicable environmental range and version information are associated and stored.
5. The method according to claim 1, characterized in that, In step S3, the model library includes at least three of the following: zero-order dynamics model, first-order dynamics model, Logi-step Stic model, Gompertz model, linear regression model, ridge regression model, generalized additive model, random forest model, support vector machine model, gradient boosting tree model, neural network model, long short-term memory network model, Tran-step Sformer model, dynamics-neural network hybrid model, and physical information neural network model. And / or, in step S3: For quality indicators with a constant rate of increase, the classification constraints include at least the requirement that the predicted value is non-negative and that the predicted value at adjacent prediction points does not decrease. For bounded declining quality indicators, the classification constraints include at least the following: the predicted value is non-negative, the predicted value does not exceed the upper limit of data support, and the value enters the plateau range after declining. For asymptotically growing quality indicators, the classification constraints include at least the fact that the predicted value is non-negative and the predicted value does not exceed a preset cumulative upper limit. For peak-type or bimodal quality indicators, the classification constraint includes at least the number of peaks and the range of peak positions; For stable maintenance-type quality indicators, a relative change model anchored to the initial quality value or an environmental response model corresponding to its auxiliary dynamic type is adopted. And / or, the value boundaries are determined jointly based on the physiologically permissible range of the corresponding quality index and the observation range of the training data; the lower bound of the prediction of the quality index is zero or the lower limit of the physiologically permissible range, and the upper bound of the prediction is no greater than 1.10 times the observed maximum value, wherein the upper bound of the prediction of weight loss rate and decay rate does not exceed 100%.
6. The method according to claim 1, characterized in that, In step S3, each candidate model is trained and evaluated using the same training set and validation set. The validation set is formed by sequentially reserving a storage temperature, a post-harvest processing group, or a time point for transferring to the shelf, in order to evaluate the generalization ability of the candidate model to storage conditions or processing conditions that were not included in the training. And / or, the storage evolution model takes storage temperature, post-harvest treatment, current storage time, prediction time span, and current quality state vector as input, and the storage quality state at the prediction time point as output; different quality indicators correspond to their respective storage evolution models; And / or, the shelf state transition model takes storage temperature, post-harvest treatment, current storage time and current quality state vector as input, and the quality state after transitioning to a preset shelf temperature and relative humidity and passing through a preset shelf time as output; the current quality state vector is represented by the original quality index, state variables obtained by principal component analysis or state variables obtained by partial least squares regression.
7. The method according to claim 1, characterized in that, In step S5, the model performance is determined based on at least three of the following: root mean square error, mean absolute error, goodness of fit, cross-validation error, and computation time. A candidate model replaces the current model only if it meets the corresponding fractal constraints and the validation error is lower than that of the current model. The model version, model parameters, applicable scope, and update time are updated synchronously. And / or, the digital twin state space includes environmental state, quality state, driving factor state, model state, risk state, and prediction state; the risk state includes spoilage risk, quality deterioration risk, and remaining shelf life risk; and the prediction state includes prediction value, prediction interval, prediction time, prediction confidence, and prediction update time.
8. An adaptive construction system for postharvest digital twin models of fruits and vegetables based on quality index dynamics classification, characterized in that, The system is used to implement the method according to any one of claims 1-7, comprising: The driver factor management module is used to collect time-series data on environmental factors, post-harvest treatment, initial quality, and quality indicators by batch of fruits and vegetables, establish a core driver factor set, and check its integrity. The dynamics classification and constraint module is used to extract the time response characteristics and environmental response characteristics of each quality index, determine the main type of time evolution and the auxiliary type of driving response, and generate classification constraints. The model building module is used to obtain candidate models based on two types of dynamics, determine the storage evolution model of each quality index through leave-one-out condition verification and fractal constraint screening, and establish a shelf state transition model based on paired samples of the current quality state and the quality state after transitioning to the preset shelf conditions. The digital twin status management module is used to establish a digital twin status space that uniquely corresponds to each batch of fruits and vegetables. The online update module is used to update the dynamics type, digital twin state, and model performance based on newly added monitoring data, and to switch the corresponding model when the switching conditions are met; and The prediction output module is used to output the future storage quality status and the quality status after being transferred to preset shelf conditions.
9. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Cold-chain whole-course fruit quality dynamic grading method and device
CN112115577A
Fruit and vegetable weight loss rate prediction method and device, electronic equipment and storage medium
CN115184395A
