A postharvest weight loss rate prediction method and prediction system based on sliding window correction

By using a sliding window correction method, an initial model was constructed using a small amount of early storage data. Combined with local fitting and error-driven slope dynamic correction, the problem of predicting the postharvest weight loss rate of fruits and vegetables under multiple treatment groups and data missing scenarios was solved, and long-term high-precision prediction of the weight loss rate of fruits and vegetables was achieved.

CN121479739BActive Publication Date: 2026-03-24ZHEJIANG UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-08
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies lack adaptive prediction strategies for predicting postharvest weight loss rates in fruits and vegetables, which are not suitable for scenarios involving multiple treatment groups, multiple samples, and missing data. They also fail to maintain the stability and robustness of predictions under different varieties and treatment conditions.

Method used

By employing a sliding window-based correction method, an initial linear model is constructed using a small amount of early storage observation data. This model is then combined with a sliding window local fitting and a dynamic slope correction mechanism for prediction errors to achieve long-term, high-precision adaptive prediction of postharvest weight loss rate of fruits and vegetables.

Benefits of technology

Relying only on data from approximately three time points in the early stages of storage, it can provide a long-term trend prediction of weight loss rate throughout the entire storage period. Furthermore, at each subsequent time point, it utilizes local windows to refit the weight loss slope and adaptively adjusts the error correction factor, significantly improving the prediction coefficient of determination and reducing the root mean square error. It is adaptable to multiple treatment groups, multiple replicates, and data missing conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121479739B_ABST
    Figure CN121479739B_ABST
Patent Text Reader

Abstract

The present application relates to the field of postharvest storage quality control of fruits and vegetables, and particularly relates to a fruit and vegetable postharvest weight loss rate prediction method and system based on sliding window correction. The method first uses the weighted average weight loss rate of a small number of time points in the early storage period to establish an initial linear model; then a time sliding window is constructed for local linear fitting when new observations are observed, and a dynamic correction factor is adaptively calculated according to the prediction error to update the weight loss rate slope and intercept in real time, so as to continuously correct the long-term trend. The system includes data acquisition, preprocessing and weighting calculation, initial modeling, sliding window fitting, dynamic correction and prediction output modules. Compared with the fixed parameter model, the present application significantly improves the determination coefficient, reduces the root mean square error and the average absolute error on various fruits and vegetables, and has high precision, strong adaptability and good engineering application prospect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of postharvest storage quality control technology for fruits and vegetables, and in particular to a method and system for predicting postharvest weight loss rate of fruits and vegetables based on sliding window correction. Background Technology

[0002] Fruits and vegetables, as typical fresh and perishable agricultural products, undergo continuous water evaporation and respiration throughout their entire lifecycle, from harvest to storage, transportation, and sale, resulting in a phenomenon known as "postharvest weight loss." This weight loss not only directly reduces the saleable weight but also causes quality deterioration such as skin wrinkling, tissue wilting, and decreased taste, making it a key indicator determining the shelf life and commercial value of fruits and vegetables. Therefore, modeling and predicting the postharvest weight loss process of fruits and vegetables has become an important technological direction in fields such as cold chain logistics, pre-cooling at production sites, and warehousing management.

[0003] In existing technologies, there are two main approaches to predicting the weight loss process of fruits and vegetables: one focuses on using macroscopic factors such as ambient temperature and storage time in combination with mathematical models or intelligent algorithms to predict the weight loss rate; the other focuses more on non-destructive testing signals such as spectra and images to comprehensively evaluate the quality or shelf life of fruits and vegetables, which often includes indirect reflections of quality loss or water loss trends.

[0004] For example, Chinese invention patent CN115184395A, published as "Method, Device, Electronic Equipment and Storage Medium for Predicting Weight Loss Rate of Fruits and Vegetables," proposes a scheme for predicting the weight loss rate of fruits and vegetables based on a neural network model. This patent collects the temperature and storage time of the environment in which the fruits and vegetables are stored, using these as inputs to a pre-trained neural network weight loss rate prediction model to obtain the target weight loss rate prediction information. The neural network model is trained offline based on a large amount of sample data labeled with weight loss rate, and the training samples contain multiple sets of storage temperature and corresponding storage time information. However, from the perspective of the modeling mechanism, this patent belongs to a "fixed parameter" black box model: the neural network structure and weights remain basically unchanged after training and do not adaptively update with the arrival of new observation data during actual storage. Its training relies on a large-scale and relatively complete historical sample; for fruits and vegetables of different varieties, different treatment methods, different years, or different origins, it is often necessary to collect a large number of samples for retraining or fine-tuning. Especially under complex conditions such as multiple treatment groups (e.g., different pretreatment agents, different gas environments), multiple duplicate samples, and data loss due to decay or mechanical damage, which are common in scientific research experiments or production sites, this patent does not provide a unified modeling and prediction strategy for "few data, missing data, and multiple groups", nor does it involve a mechanism for real-time slope correction and error feedback correction of the weight loss rate time series based on a sliding window.

[0005] Chinese invention patent CN112115577A discloses a method and device for dynamic grading of fruit quality throughout the cold chain. This patent focuses on the entire cold chain process, constructing a three-dimensional spatiotemporal distribution model of temperature and humidity in cold chain 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 relationship between fruit and the environment. Combined with initial fruit quality indicators and quality dynamics models under different temperatures and humidity levels, the dynamic changes in fruit quality throughout the cold chain are calculated, and dynamic quality grading is achieved based on this. This patent emphasizes the spatiotemporal evolution and grading assessment of "overall quality level," using a pre-established quality dynamics model that includes the variation patterns of multiple indicators such as hardness and soluble solids. Its modeling focus is on the mapping between the environmental field and quality indicators, rather than building a lightweight, low-sample, adaptive prediction algorithm for a single weight loss rate indicator. Although the patent takes into account the complexity of temperature and humidity changes over time and space, it also uses preset dynamic equations and parameters. It lacks a mechanism for local fitting of sliding windows and dynamic parameter correction based on the latest observation data, and does not provide specific strategies for maintaining prediction stability and robustness under conditions of multiple treatment groups, heterogeneity of multiple samples, and missing data at local time points.

[0006] Furthermore, Chinese invention patent CN110411957A discloses a non-destructive and rapid prediction method and device for fruit shelf life and freshness, proposing a fruit freshness and shelf life prediction scheme based on spectral data from a non-destructive testing perspective. This patent collects spectral data of fruits stored for different times and records corresponding storage time and environmental data, using a regression algorithm to establish a fruit storage time model. Based on the model prediction, a weighted correction prediction value is calculated using the sample size, and a discrimination threshold is set accordingly to determine fruit freshness. It also proposes a method for determining shelf life based on key change period data and develops corresponding analytical instruments. This scheme significantly improves the accuracy of shelf life and freshness prediction, achieving a non-destructive, rapid, and accurate assessment of fruit freshness. This patent focuses on the comprehensive evaluation of "freshness" and "shelf life," with its core data source being spectral signals and the "time model" constructed from them. Weight loss rate is only one of many factors affecting quality, and it does not specifically model the dynamic prediction of post-harvest weight loss rate as a quantitative indicator. The regression model used in this patent belongs to the offline training paradigm. Its adaptability to different varieties and different processing conditions needs to be achieved by remodeling or retraining. It also lacks a unified algorithm framework that uses a small amount of early data, combined with a sliding time window and error feedback to dynamically correct the model slope. Furthermore, it does not have a systematic processing solution for situations such as multiple processing groups, multiple duplicate samples, and missing data. Summary of the Invention

[0007] The technical objective of this invention is to provide a dynamic prediction method and system for weight loss rate in the postharvest storage process of fruits and vegetables, applicable to multiple treatment groups, multiple samples, and scenarios with missing data. By constructing an initial linear model using a small amount of observation data from the early stages of storage, and combining sliding window local fitting and a slope dynamic correction mechanism based on prediction error during subsequent storage, long-term, high-precision, and adaptive prediction of postharvest weight loss rate of fruits and vegetables can be achieved. This provides a reliable quantitative decision-making basis for optimizing fruit and vegetable storage conditions, screening preservation processes, and managing shelf life.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] A method for predicting postharvest weight loss rate of fruits and vegetables based on sliding window correction, the method includes the following steps:

[0010] S1. Collect the weight of fruits and vegetables at each storage time point, calculate the weight loss rate of a single fruit according to the preset weight loss rate formula, and calculate the weighted average weight loss rate at each time point based on the effective samples and their weights.

[0011] S2, select the weighted average weight loss rate of at least three consecutive early time points, and use linear regression to establish an initial weight loss rate model with time as the independent variable, and obtain the initial slope and intercept as the parameters of the current model;

[0012] S3. For subsequent time points, a sliding window containing the most recent w time points is used. When the number of valid time points in the window is not less than 2, local linear fitting is performed to obtain the local predicted value and local slope of that time point.

[0013] S4. At time points where the measured weighted average weight loss rate exists, a dynamic correction factor related to the error magnitude is calculated based on the error between the measured value and the local predicted value. The local slope is corrected and the intercept is updated. The corrected slope and intercept are used as the new current model parameters. When the number of valid time points in the window is less than 2 or there are no measured values, the current model parameters of the previous time point are used for prediction.

[0014] S5. Using the current model parameters, the weight loss rate at each subsequent time point is recursively predicted to obtain the weight loss rate prediction curve for the entire storage period.

[0015] Preferably, in step S1, the weight loss rate of a single fruit is calculated using the following formula:

[0016] ;

[0017] in, For the first The initial weight of each fruit at the start of storage. For the first The fruit in time The weight, For the first The fruit in time The rate of weightlessness;

[0018] The weighted average weightlessness rate at each time point is calculated using the following formula:

[0019] ;

[0020] in, For time The weighted average weight loss rate For time The number of effective fruits, For the first The fruit in time The corresponding weights;

[0021] Preferably, in step S2, the weighted average weight loss rate is selected at least three consecutive time points during the early stage of storage. An initial weight loss rate model was established using univariate linear regression, with time as the independent variable and the weighted average weight loss rate as the dependent variable. The initial slope and initial intercept were obtained, and these initial slope and intercept were set as the current slope and current intercept to provide an initial long-term forecast trend of the weight loss rate throughout the storage period, given only a limited amount of previous data. The initial model is as follows:

[0022] ;

[0023] in, For time The predicted weightlessness rate The initial slope, This is the initial intercept;

[0024] Solve using the least squares method:

[0025] ;

[0026] ;

[0027] Where m is the initial number of training points; : Time average; Mean weight loss rate.

[0028] Preferably, in step S3, for subsequent time points... Based on recent A sliding time window is constructed using a number of valid time points. Greater than or equal to When all corresponding weighted average weight loss rates have measured values, a weighted linear regression is applied to the weighted average weight loss rate within the window to obtain the time points. Local slope and local intercept And calculate the time point. Local predicted values ; Number of valid time points within the window Less than When local fitting is skipped, the current slope is used directly. and current intercept Make predictions.

[0029] Preferably, in step S4, when time point There are measured values ​​of weighted average weight loss rate. Furthermore, when step S3 completes the local fitting, the prediction error is calculated. The system calculates a dynamic correction factor based on the error magnitude, corrects the local slope under defined upper and lower limits of correction intensity, and obtains the corrected slope and intercept. The corrected slope and intercept are then used as the new current slope and intercept. At time point... When there are no measured values ​​or local fitting is not complete, keep the current slope and current intercept unchanged;

[0030] The prediction error is calculated using the following formula:

[0031] ;

[0032] in, For time points The measured weighted average weight loss rate For time points Local predicted values, For time points The prediction error;

[0033] The dynamic correction factor is calculated using the following formula:

[0034] ;

[0035] in, As a dynamic correction factor, Basic correction factor, This represents the absolute value of the prediction error. and These are the lower and upper limits of the correction intensity, respectively;

[0036] The corrected slope is calculated using the following formula:

[0037] ;

[0038] in, For time points Corrected slope The time interval between two adjacent observation points, and satisfying the following conditions: ;

[0039] The corrected intercept is calculated using the following formula:

[0040] ;

[0041] in, For time points Corrected intercept;

[0042] Corrected predictions:

[0043] .

[0044] Preferably, in step S5, , As the new current slope and current intercept Based on the current slope and current intercept, for subsequent time points The weight loss rate is then recursively predicted to obtain a dynamic prediction curve of the weight loss rate throughout the storage period. Steps S3 and S4 are repeated at each time point with measured values, so that the model can adaptively track the dynamic changes of the postharvest weight loss rate of fruits and vegetables under conditions of multiple treatment groups, multiple samples and missing data, and achieve long-term prediction across varieties and treatment conditions.

[0045] Preferably, the method also includes a step of quantitatively evaluating the prediction performance, which includes:

[0046] Calculate the root mean square error between the predicted result obtained based on the sliding window correction method and the actual weighted average weight loss rate. Coefficient of determination and mean absolute error The root mean square error is calculated using the following formula:

[0047] ;

[0048] in, The number of time points involved in the evaluation. For time points The measured weighted average weight loss rate For time points Predicted weightlessness rate;

[0049] The coefficient of determination is calculated using the following formula:

[0050] ;

[0051] in, The mean of the measured weighted average weight loss rate during the evaluation period;

[0052] The root mean square error obtained using a simple linear regression model with fixed parameters and coefficient of determination For comparison, the improvement percentage and the relative increase in the coefficient of determination are calculated, and the improvement percentage is calculated according to the following formula:

[0053] ;

[0054] in, The root mean square error of the sliding window correction method;

[0055] The relative increase in the coefficient of determination is calculated using the following formula:

[0056] ;

[0057] in, The coefficient of determination for the sliding window correction method. The coefficient of determination is the coefficient of determination for a simple linear regression model.

[0058] Furthermore, the present invention also provides a fruit and vegetable postharvest weight loss prediction system based on sliding window correction for performing the method, comprising:

[0059] The data acquisition module is used to collect weight data of multiple samples from each treatment group at various time points during the post-harvest storage of fruits and vegetables, and to record the corresponding treatment conditions and storage environment parameters.

[0060] The preprocessing and weighted calculation module is used to calculate the single fruit weight loss rate based on the weight data. And at each time point, the weighted average weight loss rate is obtained according to the weighting method in step S1. It simultaneously removes outlier samples and marks missing data.

[0061] The initial modeling module is used to select the weighted average weight loss rate at at least three consecutive time points during the early stages of storage. The initial slope is obtained through linear regression. and initial intercept And write it into the model parameter storage unit as the current slope. and current intercept ;

[0062] The sliding window fitting module is used to fit the window to a preset size. Extract the most recent The weighted average weightlessness rate at each time point forms a sliding window, and the number of valid time points within the window is determined. and in Perform local linear fitting at that time to obtain , and local predicted values ;exist The time-direction dynamic correction module outputs the current slope. and current intercept ;

[0063] The dynamic correction module is used to obtain the measured weighted average weight loss rate. Calculate prediction error in time Based on the basic correction factor Calculate the dynamic correction factor based on the error magnitude. Under the condition of limiting the upper and lower limits of the correction intensity, the slope and intercept are updated according to step S4. , And write it into the model parameter storage unit as a new , ;

[0064] The prediction output module is used to predict the output based on the current slope. and current intercept Recursively predict subsequent time points and output the weight loss rate prediction curve during storage.

[0065] Furthermore, 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.

[0066] Furthermore, the present invention also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the method.

[0067] This invention employs a collaborative mechanism of "initial modeling with few samples, local fitting via a sliding window, and dynamic correction of the slope driven by error." Technically, it achieves the following: It can predict the long-term trend of weight loss rate throughout the entire storage period using only data from approximately three time points in the initial storage phase. Furthermore, at each subsequent time point with new observation data, it refits the weight loss slope using a local window and adaptively adjusts the correction factor according to the error magnitude. This ensures the smoothness of the prediction curve while rapidly tracking the phased changes in the weight loss rate, significantly improving the coefficient of determination and reducing the root mean square error and mean absolute error. By using time-point weighted averaging and determining the number of valid samples within the window, it achieves robust handling of multiple treatment groups, multiple duplicate samples, and data loss due to decay or weighing anomalies. This allows the model to output continuous and stable prediction results even under complex conditions such as unbalanced sample sizes and incomplete time series. Moreover, the same parameter template can be reused for various fruits and vegetables such as plums, blueberries, citrus, and cherry tomatoes, under different temperatures and pretreatment conditions, demonstrating excellent cross-variety and cross-treatment versatility and engineering application value. Attached Figure Description

[0068] Figure 1 This is a system structure block diagram of the present invention.

[0069] Figure 2 This is a flowchart of the method of the present invention.

[0070] Figure 3 A prediction graph of fruit and vegetable weight loss rate based on sliding window correction for plums.

[0071] Figure 4 A prediction map of fruit and vegetable weight loss rate based on sliding window correction for blueberry Eurica fruit.

[0072] Figure 5 A prediction map of fruit and vegetable weight loss rate based on sliding window correction for blueberry snow-chasing fruit.

[0073] Figure 6 Predicted weight loss rate of fruits and vegetables based on sliding window correction using Eureka for blueberry ozone treatment.

[0074] Figure 7 A prediction chart of fruit and vegetable weight loss rate based on sliding window correction for the Citrus Spring Fragrance variety.

[0075] Figure 8 A prediction map of fruit and vegetable weight loss rate based on sliding window correction for citrus and mandarin oranges.

[0076] Figure 9 A prediction map of fruit and vegetable weight loss rate based on sliding window correction for citrus and mandarin oranges.

[0077] Figure 10 This is a prediction chart of fruit and vegetable weight loss rate based on sliding window correction for the cherry tomato Huangfei variety. Detailed Implementation

[0078] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0079] I. Terminology Explanation

[0080] To facilitate understanding of the method and system of this invention by those skilled in the art, the main terms used in this specification are first defined and explained:

[0081] 1. Postharvest weight loss rate of fruits and vegetables: refers to the percentage of mass loss of fruits and vegetables relative to their initial weight during storage, transportation, or shelf life after harvest. In this invention, the... The fruit in time The weightlessness rate is defined as:

[0082] ;

[0083] in, For the first The initial weight of each fruit. For the fruit in time The weighing value, This represents the rate of weightlessness.

[0084] 2. Weighted average weight loss rate: at the same time point The weighted average of the weight loss rates of multiple fruit samples from a single treatment group or a combination of treatment groups is used to characterize the overall weight loss level at that time point. In this invention, time... Weighted average weight loss rate Defined as:

[0085] ;

[0086] in, For time The number of effective fruits, For the first The fruit in time The weight.

[0087] 3. Sliding window: In a time series, this refers to a local subset of data formed by tracing back several recent time points from the current position. In this invention, the window size is used as the reference point. The number of time points contained in the representation window, such as the number of time points. A window typically contains to Several points in time.

[0088] 4. Number of valid time points This refers to the number of time points within a sliding window where a weighted average weight loss rate observation actually exists and is not identified as missing or outlier. At that time, it was assumed that the window could be used for local linear fitting.

[0089] 5. Current slope With current intercept : This represents the linear model parameters used to predict the weightlessness rate over the entire subsequent time period at a given moment. The corresponding relationship is as follows:

[0090] ;

[0091] in, For time The predicted weightlessness rate.

[0092] 6. Dynamic correction factor The correction coefficient is adaptively adjusted based on the magnitude of the prediction error at the current moment. It is used to control the magnitude of the correction to the local slope, so as to speed up the model adjustment when the error is large and avoid excessive perturbation when the error is small.

[0093] 7. Multiple treatment groups: refers to multiple experimental or application groups formed by different pretreatments (such as different concentrations of ethylene, 1-MCP, ozone, etc.), different storage temperatures, or different packaging methods for the same batch of fruits and vegetables after harvest.

[0094] 8. Missing data: This refers to the inability to obtain a valid weighing value at a certain time point due to reasons such as fruit rot, mechanical damage, weighing failure, or record loss, thus making it impossible to calculate the weight loss rate at that time point. In this invention, such data is marked as missing and excluded in the weighting and fitting process.

[0095] Through the above explanation of terminology, those skilled in the art can clearly understand the meaning of each variable and concept in this invention, laying the foundation for understanding the subsequent technical solutions.

[0096] II. System Overall Structure

[0097] See Figure 1 This invention provides a fruit and vegetable post-harvest weight loss prediction system based on sliding window correction, which can be implemented using a typical architecture of "front-end data acquisition, back-end server, database, and visualization terminal". The system can generally include the following sub-modules:

[0098] 1. Data Acquisition Module 201

[0099] It can be deployed in experimental cold storage, processing plant warehouses, or cold chain transport vehicles.

[0100] It includes an electronic balance, temperature and humidity sensors, and a data acquisition terminal, used to collect weight data, ambient temperature, and relative humidity of multiple fruits from each treatment group at preset time intervals. The data can be uploaded to the server via serial port, local area network, or wireless network.

[0101] 2. Preprocessing and Weighted Calculation Module 202

[0102] Deployed on a backend server or industrial computer. Receives raw weighing and environmental data, performs single-fruit weight loss rate calculation, abnormal sample identification, data missing markers, and weighted average weight loss rate calculation at each time point.

[0103] 3. Initial Modeling Module 203

[0104] To calculate the initial slope, a weighted average weight loss rate is used to select at least three consecutive time points in the early stage of storage, and a univariate linear regression is performed. and initial intercept .Will and Write the current slope and current intercept into the model parameter storage unit.

[0105] 4. Sliding window fitting module 204

[0106] At each new time point, based on the preset window size Automatically construct a sliding window and determine the number of valid time points. .like Perform local linear fitting and output the local slope. Local intercept and local predicted values .

[0107] 5. Dynamic Correction Module 205

[0108] Reception time point Measured weighted average weight loss rate Compared with local predicted values Calculate the prediction error and dynamic correction factor The slope and intercept are updated according to the corrected formula. , And write it back to the model parameter storage unit.

[0109] 6. Predictive Output and Evaluation Module 206

[0110] Based on the current slope and intercept, recursive predictions are made for subsequent time points to obtain the weight loss rate prediction curve for the entire storage period. Calculation , , Performance metrics were analyzed and compared with the results of simple linear regression.

[0111] 7. Database Module 207

[0112] It is used to store raw experimental data, preprocessing results, historical model parameter records, prediction results, and performance evaluation metrics.

[0113] 8. User Interface and Visualization Module 208

[0114] It can be deployed on PCs, tablets, or mobile devices, providing parameter configuration interfaces, graph and report display interfaces, making it convenient for researchers or production managers to view weight loss rate prediction results and model performance.

[0115] The system structure of this invention adopts a modular design, and those skilled in the art can choose to deploy the above modules on a standalone machine, a local area network, or a cloud platform according to actual project needs and existing hardware conditions.

[0116] III. Method Implementation Examples – Prediction Techniques Based on Sliding Window Correction

[0117] See Figure 2 The overall process of the method of this invention can be summarized as follows: data acquisition and preprocessing → initial modeling with few samples → local fitting with sliding window → dynamic correction of slope driven by error → long-term prediction and result output. The specific implementation methods of each step are described in detail below.

[0118] 3.1 Step S1: Data Acquisition and Weighted Weight Loss Rate Calculation (Medium Contribution)

[0119] 1) Data Acquisition Scheme

[0120] In a typical embodiment, a specific fruit or vegetable variety (such as plum) is selected, and multiple treatment groups are chosen, such as: ethylene treatment groups with different concentrations, 1-MCP treatment groups, and a control group. Each treatment group has several replicates (e.g., 3 boxes per group, 40 fruits per box). The fruits from each group are placed in a temperature-controlled cold storage. , , Store at the same temperature.

[0121] Set the time sampling point, such as Every day. At each time point, a certain number of fruits (e.g., 6 fruits per box) are randomly selected from the replicate samples for each treatment group, weighed, and the initial weight is recorded. and current weight .

[0122] 2) Calculation of single fruit weight loss rate

[0123] The system calls the preprocessing and weighted calculation module 202 to perform the calculation on the first... The fruit in time The weightlessness rate is calculated as follows:

[0124] ;

[0125] in, For the first The initial weight of each fruit. For time The weighing value, The weightlessness rate is expressed as a percentage.

[0126] 3) Abnormal sample identification and removal

[0127] To avoid interference from rot, mechanical damage, or weighing errors in the modeling, this embodiment can set one or a combination of the following anomaly judgment rules: if the single fruit weight loss rate at a certain time point... Exceeding the preset reasonable range (e.g., less than) or greater than If the weight loss rate increment is abnormally large between two adjacent time points (e.g., a single increment exceeds several times the standard deviation of the normal sample mean), it is also considered abnormal. Samples marked as abnormal will not be included in the subsequent weighted average weight loss rate calculation and are considered invalid data.

[0128] 4) Calculation of weighted average weight loss rate

[0129] After anomaly removal is completed, time... Weight loss rate of all valid samples By weight Perform a weighted summation:

[0130] ;

[0131] in, For time The weighted average weight loss rate For time Valid sample size For the first Each sample in time The weights. In a simpler embodiment, valid samples within the same treatment group can be assigned the same weight; when modeling multiple treatment groups jointly, each treatment group can be assigned a weight based on time. The effective sample size is used as the weight of the group to reflect the impact of different group sample sizes on the overall weight loss level.

[0132] Through the above steps, we obtain the result by time. Sorted weighted average weight loss sequence This provides basic data for subsequent modeling.

[0133] 3.2 Step S2: Initial Linear Modeling with Few Samples

[0134] A key innovation of this invention is that, in the early stages of storage, an initial linear model is constructed based on only a few (usually three) time points to approximately describe the long-term trend of weight loss rate throughout the entire storage period, and then continuously corrected through sliding windows and dynamic adjustments.

[0135] 1) Selection of initial training data

[0136] Preprocessing and weighted calculation module 202 will... Data at each time point Send to the initial modeling module 203, where The corresponding storage Heaven, the First Tianhe Di sky.

[0137] Those skilled in the art can adjust the initial number of training points according to actual needs. Set as or This enables rapid modeling under conditions of limited data.

[0138] 2) Construction of linear regression model

[0139] Initial modeling module 203 uses the least squares method to solve the univariate linear regression model:

[0140] ;

[0141] in, For time The predicted weightlessness rate The initial slope, This is the initial intercept.

[0142] In the specific solution, you can first calculate the time average and the average weightlessness rate:

[0143] ;

[0144] in, This represents the initial number of training time points. The average over time. This represents the average weight loss rate.

[0145] initial slope It can be calculated using the following formula:

[0146] ;

[0147] Initial intercept Then it is:

[0148] .

[0149] 3) Parameter initialization and storage

[0150] The initial modeling module 203 will obtain and Write the parameters to the model parameter storage unit, and simultaneously set it as the current slope in the system. and current intercept At this point, even without the subsequent introduction of a sliding window and dynamic correction, this invention can still use the initial linear model to make a basic prediction of the weight loss rate throughout the storage period.

[0151] The key contribution of this step is that by making reasonable use of data from a small number of early time points, an initial long-term trend is established, providing a baseline model for subsequent adaptive corrections; and in scenarios with multiple fruit and vegetable varieties and multiple treatment groups, the amount of preliminary data required for modeling is greatly reduced.

[0152] 3.3 Step S3: Local Fitting with Sliding Window

[0153] As storage time progresses, in order to dynamically reflect the change in the rate of weight loss over time, this invention introduces a sliding window local fitting method to linearly model short-term data near the current time point.

[0154] 1) Generating sliding windows

[0155] When the time series progresses to the [number]th Time points and At that time, the sliding window fitting module 204 fits the window according to the preset window size. from Select the nearest one A set of windows is formed at each time point. .like In this case, a "variable window" approach can be used, that is, only using... to The point in time.

[0156] 2) Determination of the number of valid time points

[0157] For each time point within the window, check whether there is a valid weighted average weightlessness rate observation. And it was not marked as missing or abnormal. Count the number of time points that meet the conditions. .

[0158] when At that time, it is considered that the data within the window is sufficient for local linear fitting;

[0159] when When skipping local fitting, this invention adopts... , Make predictions.

[0160] 3) Local linear fitting process

[0161] exist In this case, the sliding window fitting module 204 extracts all valid time points within the window. and the corresponding weighted average weight loss rate A local linear model is constructed using the least squares or weighted least squares method:

[0162] ;

[0163] in, For a local prediction model built on window data, For time points The local slope, This is the corresponding intercept.

[0164] If we consider the weight of time points within the window Alternatively, a weighted slope calculation formula can be used, which can be set by those skilled in the art according to the engineering needs.

[0165] 4) Calculation of local predicted value at the current point

[0166] After obtaining the local model, calculate the time points. Local predicted weightlessness rate:

[0167] ;

[0168] This local forecast is based only on recent window data and has a good ability to reflect short-term trends.

[0169] By using a sliding window for local fitting, this invention can reflect the phased changes in the rate of weightlessness using the most recent observation data, providing a basis for subsequent error-driven slope correction.

[0170] 3.4 Step S4: Dynamic slope correction based on error magnitude constraints

[0171] This step is one of the core innovations of this invention. By comparing the local prediction results with the measured data, the slope is corrected using the magnitude of the error, and upper and lower limit constraints are used to prevent overcorrection.

[0172] 1) Calculation of prediction error

[0173] When the time point There is a measured weighted average weight loss rate And once the local fitting in step S3 has been completed, the dynamic correction module 205 calculates the prediction error:

[0174] ;

[0175] in, For time points The measured weighted average weight loss rate For time points Local predicted weightlessness rate The prediction error can be positive or negative.

[0176] 2) Calculation of dynamic correction factor

[0177] To avoid excessively large or small slope changes due to a single error, this invention introduces a dynamic correction factor based on the error amplitude. The calculation formula is:

[0178] ;

[0179] in, The basic correction factor can take values ​​ranging from 1 to 10. ~ Preferred ~ ; This represents the absolute value of the prediction error. and These represent the lower and upper limits of the correction intensity factor, ensuring that the correction factor is within a certain range. and The changes between them.

[0180] When the error is small and At that time, through The correction factor should be no less than To avoid overly weak correction; when the error is too large and At that time, through Limit the correction factor to no more than This is to avoid sudden and large changes in the slope that could cause violent oscillations in the prediction curve.

[0181] 3) Slope Correction Formula

[0182] In calculation Then, the local slope is corrected:

[0183] ;

[0184] in, For time points Corrected slope The time interval between two adjacent observation points must satisfy the following conditions: This formula embodies the following idea:

[0185] when When the value is positive and the absolute value is large, it indicates that the local predicted value is too low, and the slope should be increased appropriately.

[0186] when When the value is negative and the absolute value is large, it indicates that the local predicted value is too high, and the slope should be appropriately reduced.

[0187] The correction magnitude is positively correlated with the error magnitude and inversely proportional to the time interval. The longer the time interval, the gentler the slope adjustment caused by the same error.

[0188] 4) Intercept update formula

[0189] To keep at the point in time The predicted value at a given location has reasonable consistency with the local predicted value. Therefore, this invention updates the intercept in the following manner:

[0190] ;

[0191] in, For time points The corrected intercept. This method ensures that... Nearby, the corrected model shows good alignment with the local fitting results, avoiding obvious prediction inflection points.

[0192] 5) Current model parameter updates and handling of missing parameters

[0193] Dynamic correction module 205 will and Write the model parameter storage unit and set it as the new current slope. and current intercept .

[0194] If time point No measured value , or due to If local fitting is not performed, the present invention does not perform slope correction and intercept update at this time point, but only uses the previous time point. and .

[0195] When data is continuously missing, the model maintains the parameters from the previous time step, thus ensuring the continuity and stability of the prediction curve.

[0196] Through the aforementioned dynamic correction mechanism, this invention can continuously calibrate the long-term prediction model using new observation data throughout the entire storage process, overcoming the mismatch problem of fixed parameter models at different stages and in different batches of fruits and vegetables. This is an important technical link in achieving high-precision and highly adaptive prediction.

[0197] 3.5 Step S5: Long-term forecasting and sequence update

[0198] After completing the slope and intercept update, the prediction output and evaluation module 206 uses the current model parameters to recursively predict subsequent time points.

[0199] 1) Recursive prediction formula

[0200] For any point in time Use the current slope and current intercept Calculate the predicted weightlessness rate:

[0201] ;

[0202] in, For time points The predicted weighted average weight loss rate.

[0203] 2) Predicted sequence update and storage

[0204] As time progresses, whenever new measured data emerges, this invention repeats steps S3 and S4 to correct the slope and intercept; simultaneously, it records each prediction result. Compared with measured values It is also stored in database module 207 to support subsequent performance evaluation and model optimization.

[0205] 4) Performance evaluation (optional step)

[0206] In one embodiment, it is possible to [do something] from the [first] [year]. The root mean square error of the prediction results from each time point is calculated. :

[0207] ;

[0208] and the coefficient of determination :

[0209] ;

[0210] in, The number of time points involved in the evaluation. The actual weighted average weight loss rate. For predicted values, To evaluate the mean of the measured weight loss rate within the interval.

[0211] It can also be compared with the root mean square error of a simple linear regression model. Compare and calculate the improvement:

[0212] ;

[0213] in, This refers to the root mean square error of the sliding window correction method of the present invention.

[0214] The relative increase in the coefficient of determination is calculated using the following formula:

[0215] ;

[0216] in, The coefficient of determination for the sliding window correction method. The coefficient of determination is the coefficient of determination for a simple linear regression model.

[0217] This step is mainly used to verify the prediction performance and engineering application effect of the method of the present invention on real datasets. It has a relatively low contribution to the inventive step, but it helps those skilled in the art to understand and implement the present invention.

[0218] IV. System Implementation and Operation Process

[0219] In a specific system embodiment, the following hardware and software combination may be used:

[0220] 1. Hardware components

[0221] One or more cold storage / test chambers with automatic temperature and humidity control functions;

[0222] Multiple high-precision electronic balances (accuracy 0.01g or higher);

[0223] Several temperature and humidity sensors are used to monitor the environmental conditions inside the warehouse;

[0224] Industrial computers or servers are used to run preprocessing and modeling algorithms;

[0225] Local or cloud-based database servers are used to store data;

[0226] Several terminal devices (PCs or mobile terminals) are used for monitoring and visualization.

[0227] 2. Software Components

[0228] Data acquisition program: periodically reads data from the balance and sensors, and uploads it to the server via the network;

[0229] Preprocessing and modeling program: Implements all algorithmic logic from S1 to S5 above;

[0230] Database management program: responsible for data writing, indexing, and backup;

[0231] Front-end visualization program: provides graphs, reports, and parameter configuration interfaces.

[0232] During runtime, the system follows Figure 1 The process shown will be executed automatically:

[0233] Once storage begins, data will be automatically collected according to the schedule.

[0234] The system periodically performs preprocessing and weighted calculations, and updates the weighted average weight loss rate sequence in real time.

[0235] Initial linear modeling is automatically performed after obtaining data from the first three time points;

[0236] Subsequently, whenever new data arrives at a new time point, the system automatically constructs a sliding window, performs local fitting, and dynamically corrects the data.

[0237] Users can view the predicted curves and measured points, model parameter change curves, and performance indicators in real time on the interface.

[0238] This specific embodiment provides a typical path for implementing the technical solution of the present invention. Those skilled in the art can make various equivalent substitutions and extensions to the hardware configuration, software architecture and parameter settings without departing from the core idea of ​​the present invention, and these all fall within the protection scope of the present invention.

[0239] Example 1: Prediction of postharvest weight loss rate of plum fruit (e.g., Figure 3 (As shown)

[0240] 1. Experimental materials and treatment conditions

[0241] Prunes of similar maturity and without mechanical damage were selected and, after initial inspection at the production site, randomly divided into multiple treatment groups:

[0242] ETH processing group: using different concentrations of ethylene slow-release agents (e.g.) , ), and fumigate in a sealed packaging environment for a certain period of time;

[0243] 1-MCP processing group: using 1-MCP sustained-release agent was used for fumigation treatment;

[0244] Combined treatment groups: such as combinations of "1-MCP + low-concentration ethylene";

[0245] Control group: No gas pretreatment was performed; only conventional packaging was used.

[0246] After processing, each group of fruits was placed in a single layer in a perforated plastic basket, covered with a porous PE film, and then placed separately. , , Cold storage, temperature fluctuations controlled within The relative humidity was 90%. Weighing was performed on days 0, 3, 7, 14, 21, 28, 35, 42, 49, 60, 70, 80, 90, 100, 110, and 120. The high-temperature group experienced accelerated decay, and some treatment groups ended the experiment prematurely after 60 days, resulting in a typical data gap scenario.

[0247] For each treatment group, a random sample of fruit (e.g., 30-40 fruits per group) was taken for each weighing, and the initial weight was recorded. and weight at each time point .

[0248] 2. Parameter settings for the method of this invention

[0249] Number of initial modeling time points That is, using the storage method of the first , No. , No. Establish an initial linear model at three time points;

[0250] Slide window size That is, at each new point in time Build a window using the three most recent valid time points;

[0251] Basic correction factor Dynamic correction factor Calculate according to the aforementioned formula;

[0252] The anomaly detection threshold is set as: single fruit weight loss rate. or This is considered abnormal; the increase in weightlessness rate at adjacent time points exceeds the overall average. Samples that are more than one standard deviation away from the standard deviation are considered outliers.

[0253] The specific implementation is as follows:

[0254] 1) According to step S1 of the present invention, the weight loss rate of multiple samples at each time point and in each treatment group is calculated, and after removing abnormal samples, the weighted average weight loss rate at each time point is obtained by using the number of valid samples at each time point as the weight. ;

[0255] 2) In step S2, the data from days 0, 3, and 7 are used. Establish an initial linear model and obtain and and set it as and ;

[0256] 3) Starting from day 14, for each new time point In step S3, a sliding window is constructed based on the three most recent time points. If the number of valid time points within the window... Calculate the local slope and local predicted values ;like (For example, if the high-temperature group ends prematurely, resulting in consecutive missing values), then the existing methods will be directly used. and .

[0257] 4) With actual measured weighted average weight loss rate At the specified time point, the prediction error is calculated according to step S4 of this invention.

[0258] ;

[0259] And further calculate the dynamic correction factor

[0260] ;

[0261] Then update the slope.

[0262] ;

[0263] and intercept

[0264] ;

[0265] and put and Write back as and .

[0266] 5) Follow step S5 and utilize the updated... and Recursively predict subsequent time points.

[0267] 3. Comparative Example 1: Simple Linear Regression with Fixed Parameters

[0268] To verify the advantages of the method of this invention, a simple linear regression model with fixed parameters was used as a comparison method on the same dataset: the weighted average weight loss rate at all valid time points throughout the storage process was used. In time Establish a linear regression model with as the independent variable. No sliding window fitting, error feedback correction, or special handling of missing windows are performed.

[0269] 4. Results and Technical Effects

[0270] Based on multi-treatment and multi-temperature storage data of plums, the prediction results of the method of this invention and the simple linear regression model were statistically compared. When using the method of this invention, the overall evaluation index of the plum dataset is:

[0271] Number of prediction points: 13;

[0272] Root mean square error ;

[0273] Coefficient of determination ;

[0274] Mean Absolute Error ;

[0275] Maximum absolute error ;

[0276] The average relative error is approximately .

[0277] In the simple linear regression model of Comparative Example 1, the evaluation index (denoted as ) obtained based on the same dataset is used. , This invention is significantly inferior to the present invention, for example, it may yield:

[0278] ;

[0279] .

[0280] The improvement in RMSE of the method of this invention is as follows:

[0281] ;

[0282] in, This represents the root mean square error of the method of this invention. This demonstrates that the present invention maintains high prediction accuracy and good robustness even in complex scenarios involving long storage periods, multiple treatment combinations, and data loss due to premature spoilage at high temperatures.

[0283] Example 2: Prediction of postharvest weight loss rate of blueberry "Eureka" (e.g.) Figure 4 (As shown)

[0284] 1. Experimental Design

[0285] The blueberry variety "Eureka" was selected. After harvesting mature fruit, mechanically damaged and diseased fruit were removed, and the fruit was grouped according to whether or not it underwent 1-MCP pretreatment:

[0286] Group T: Different temperatures ( , , , Direct storage control group;

[0287] Group M: First in Fumigate under 1-MCP conditions for 24 hours in a sealed environment, then store separately. , , , .

[0288] During storage, weigh the contents periodically on days 3, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, and 33; due to The high-temperature group decomposed rapidly, and the experiment ended prematurely on the 17th day. Some groups formed incomplete time series under high temperature conditions.

[0289] 2. Application of the method of the present invention

[0290] In this embodiment, the parameter settings are the same as in Embodiment 1: pre_points=3, w=3, α=0.15.

[0291] Step S1: Calculate the weight loss rate and the weighted average weight loss rate for multiple sample data under each temperature and treatment combination. The weight is the number of valid samples in each group.

[0292] Step S2: Construct an initial linear model using the weighted average weight loss rate at three time points in the early stage of storage;

[0293] Step S3: Build a window of the three most recent time points at each new time point. If local fitting is performed, then the parameters from the previous time step are used; otherwise, the parameters from the previous time step are used.

[0294] Step S4: Adaptively adjust the slope and intercept based on the prediction error;

[0295] Step S5: Perform recursive predictions for each time point within 20 days.

[0296] 3. Comparative Example 2: Simple Linear Regression

[0297] Similarly, on the entire dataset of blueberry "Eureka", a simple linear regression model was used for modeling without sliding window and dynamic correction, resulting in a set of fixed slopes and intercepts for prediction throughout the storage period.

[0298] 4. Results and Analysis

[0299] When using the method of this invention, the statistical indicators of the blueberry "Eureka" dataset are as follows:

[0300] Number of prediction points: 12;

[0301] ;

[0302] ;

[0303] ;

[0304] Maximum absolute error ;

[0305] The average relative error is approximately .

[0306] The simple linear regression model in Comparative Example 2 performs as follows on the same dataset (for example):

[0307] ;

[0308] .

[0309] Considering that blueberries are more sensitive to environmental fluctuations and that the weight loss curves of different temperature zones vary greatly, the method of this invention can still achieve a comprehensive error level that is significantly better than simple linear regression in scenarios with multiple temperature zones and multiple pretreatment groups, verifying the applicability of the sliding window + error correction mechanism to multiple varieties of small berries.

[0310] Example 3: Prediction of postharvest weight loss rate in blueberry "snow chasing" (e.g.) Figure 5 (As shown)

[0311] This embodiment is similar to Embodiment 2, except that the fruit and vegetable variety is changed to blueberry "Zhuixue". The experimental design, storage temperature, 1-MCP treatment method and parameter settings are largely the same as described above.

[0312] The statistical indicators for using the method of this invention are:

[0313] Number of prediction points: 8;

[0314] ;

[0315] ;

[0316] ;

[0317] Maximum absolute error ;

[0318] The average relative error is approximately .

[0319] In the comparative example, the simple linear regression model on this dataset yields:

[0320] ;

[0321] .

[0322] Compared to "Eureka", "Snow Chaser" has a shorter storage time and fewer available prediction points. The method of this invention still shows a significant advantage under the condition of only limited data points (8 prediction points), indicating that the prediction ability of this invention for long-term trends is better than simple linear fitting in the case of limited data.

[0323] Example 4: Prediction of postharvest weight loss rate of blueberry "Eureka" after ozone treatment (e.g.) Figure 6 (As shown)

[0324] 1. Test conditions

[0325] Based on Example 2, ozone treatment was introduced: For the blueberry "Eureka" variety, a no-treatment group (T group) and various combinations of ozone concentrations and treatment intervals were set up (e.g., 100, 300, 500 ppm, aeration once every 12 / 24 / 48 hours, for a total of 3 times). After treatment, all were uniformly... Store in the lower part of the container.

[0326] Weighing time points were set at 0, 5, 10, 15, 20, 25, 30, 40, and 50 days; some high-concentration, long-interval treatment groups experienced increased decay in the later stages, resulting in a small number of missing time point data.

[0327] 2. Methods and Results

[0328] Still using , , .

[0329] The statistical results under the method of this invention are as follows:

[0330] Number of prediction points: 6;

[0331] ;

[0332] ;

[0333] ;

[0334] Maximum absolute error ;

[0335] The average relative error is approximately .

[0336] In the comparison of simple linear regression:

[0337] ;

[0338] .

[0339] Since ozone treatment has a significant impact on the fruit skin structure and water loss channels, the weight loss curves vary greatly under different ozone concentrations and ventilation intervals. This invention captures the linear trend at different stages locally through a sliding window and uses error-driven slope correction, effectively preventing the problem of large deviation accumulation in the later stages of a simple linear model.

[0340] Example 5: Prediction of postharvest weight loss rate of citrus varieties "Chunxiang", "Ponkan", and "Satsuma mandarin" (e.g., Figures 7-9 (As shown)

[0341] 1. Test conditions

[0342] Selected citrus varieties "Chunxiang", "Ponkan", and "Satsuma mandarin" and respectively in , , , , Low-temperature storage is carried out under specific temperature conditions.

[0343] "Chunxiang" and "Ponkan": The weighing time points are relatively close, with a total of 21 prediction points from 0 days to 78 days;

[0344] "Satsuma mandarin oranges": Due to rapid moisture loss and changes in marketability, the experimental time was short, and a total of 7 prediction points were set.

[0345] For each variety and temperature group, a fixed number of fruits were weighed and extracted each time (e.g., 6 fruits per group), and the weight at each time point was recorded and the weight loss rate was calculated.

[0346] 2. Application and Results of the Method of the Invention

[0347] Unified adoption , , .

[0348] (1) "Chunxiang" citrus

[0349] Number of prediction points: 21;

[0350] ;

[0351] ;

[0352] ;

[0353] Maximum absolute error ;

[0354] The average relative error is approximately .

[0355] Comparison with simple linear regression model:

[0356] ;

[0357] .

[0358] This demonstrates that under long-term storage and multiple temperature conditions, the present invention not only has a lower overall error, but also provides more accurate fitting of curve details.

[0359] (2) "Ponkan"

[0360] Number of prediction points: 21;

[0361] ;

[0362] ;

[0363] ;

[0364] Maximum absolute error ;

[0365] The average relative error is approximately .

[0366] Under simple linear regression:

[0367] ;

[0368] .

[0369] This further demonstrates that the present invention still has a significant improvement in citrus fruits with obvious linear weight loss characteristics.

[0370] (3) "Sugar Orange"

[0371] Number of prediction points: 7;

[0372] ;

[0373] ;

[0374] ;

[0375] Maximum absolute error ;

[0376] The average relative error is approximately .

[0377] For comparison: Simple linear regression

[0378] ;

[0379] .

[0380] This demonstrates that even in scenarios with short storage days and limited time points, the present invention can effectively improve prediction accuracy under conditions of few samples.

[0381] In summary, the results of the three citrus varieties demonstrate that the method of this invention can maintain high levels of [unspecified nutrients] during both long-term storage (21 prediction points) and short-term storage (7 prediction points). (basically greater than) It has low RMSE and the same parameter template still has good applicability under multiple varieties and multiple temperature conditions.

[0382] Example 6: Prediction of postharvest weight loss rate of cherry tomato 'Huangfei' (e.g., Figure 10 (As shown)

[0383] 1. Test conditions

[0384] Select the cherry tomato variety "Huangfei" and implement various treatments (such as different packaging methods and different preservatives), and then... and Store under the specified conditions.

[0385] Weighing was conducted at 0, 1, 3, 6, 9, 12, and 15 days, with 9 fruits weighed and the weight loss rate calculated each time. Due to some treatment groups... Rapid water loss and decay occur, and the highest temperature group has relatively few effective prediction points, forming a typical scenario with multiple treatment groups, multiple temperature zones, and missing time points.

[0386] 2. Application and Comparison of the Method of the Invention

[0387] In this embodiment, the following method is still used. , , The parameters are configured, and multiple processing combinations are modeled in a unified manner.

[0388] When using the method of this invention, the statistical indicators of the "Huang Fei" dataset are:

[0389] Number of prediction points: 4;

[0390] ;

[0391] ;

[0392] ;

[0393] Maximum absolute error ;

[0394] The average relative error is approximately .

[0395] In the simple linear regression comparison:

[0396] ;

[0397] .

[0398] Considering the short storage period of cherry tomatoes, the limited number of data points, and the significant impact of temperature differences on the rate of weight loss, this invention can still achieve good fitting results under the condition of joint modeling of multiple treatment groups through sliding window local fitting and dynamic slope correction mechanism. This proves that this invention is not only applicable to traditional fruits (such as citrus, blueberries, and plums), but also to small fruit and vegetable products.

[0399] As can be seen from the above embodiments:

[0400] 1. The method of this invention has achieved high yields on various fruits and vegetables, including plums, blueberries (“Eureka”, “Zhuixue”), citrus fruits (“Chunxiang”, “Ponkan”, “Satsuma”), and cherry tomatoes (“Huangfei”). (generally greater than) Most varieties exceed ) and lower (usually smaller) Citrus fruits are mostly in The following verifies the versatility and robustness of the invention under different types of fruits and vegetables and under multiple temperature and pretreatment conditions;

[0401] 2. Compared with the simple linear regression comparison, the method of this invention significantly reduces the RMSE on all datasets, indicating that the combination of "small sample initial modeling + sliding window local fitting + error-driven slope dynamic correction" does indeed bring about a comprehensive technical effect that exceeds that of the fixed parameter model.

[0402] 3. In several embodiments, there are scenarios where the high-temperature group ends prematurely, or where weighing fails or malfunctions at certain time points, resulting in missing data. This invention addresses these issues by... The rules for determining missing windows and using the parameters from the previous time step ensure the continuity and stability of the prediction curve, while simple linear models often show a significant amplification of deviations in the later stages under these circumstances.

[0403] 4. All embodiments use parameter settings within a uniform range (e.g., , , This method eliminates the need for remodeling or significantly adjusting parameters for different varieties and processing conditions, demonstrating its advantage in easy deployment and migration in engineering applications.

[0404] Therefore, the above fully demonstrates that the present invention can achieve high-precision and highly adaptable dynamic prediction of weight loss rate in post-harvest storage scenarios of fruits and vegetables with multiple treatment groups, multiple samples and missing data, and has significant technical effects and application value.

Claims

1. A method for predicting postharvest weight loss rate of fruits and vegetables based on sliding window correction, characterized in that, The method includes the following steps: S1. Collect the weight of fruits and vegetables at each storage time point, calculate the weight loss rate of a single fruit according to the preset weight loss rate formula, and calculate the weighted average weight loss rate at each time point based on the effective samples and their weights. The weight loss rate of a single fruit is calculated using the following formula: ; in, For the first The initial weight of each fruit at the start of storage. For the first The fruit in time The weight, For the first The fruit in time The rate of weightlessness; The weighted average weightlessness rate at each time point is calculated using the following formula: ; in, For time The weighted average weight loss rate For time The number of effective fruits, For the first The fruit in time The corresponding weights; S2, select the weighted average weight loss rate at at least three consecutive early time points, and use linear regression to establish an initial weight loss rate model with time as the independent variable, obtaining the initial slope and intercept as the parameters of the current model; the specific process is as follows: Weighted average weight loss rate at at least three consecutive time points during the early stage of storage. An initial weight loss rate model was established using univariate linear regression, with time as the independent variable and the weighted average weight loss rate as the dependent variable. This model yielded the initial slope and initial intercept, which were then set as the current slope and current intercept to provide an initial long-term forecast trend for the weight loss rate throughout the storage period, given only limited prior data. The initial model is as follows: ; in, For time The predicted weightlessness rate The initial slope, This is the initial intercept; Solve using the least squares method: ; ; Where m is the initial number of training points; : Time average; Mean weight loss rate; S3. For subsequent time points, a sliding window containing the most recent w time points is used. When the number of valid time points in the window is not less than 2, local linear fitting is performed to obtain the local predicted value and local slope of that time point. S4. At time points where the measured weighted average weight loss rate exists, a dynamic correction factor related to the error magnitude is calculated based on the error between the measured value and the local predicted value. The local slope is corrected and the intercept is updated. The corrected slope and intercept are used as the new current model parameters. When the number of valid time points in the window is less than 2 or there are no measured values, the current model parameters of the previous time point are used for prediction. S5. Using the current model parameters, the weight loss rate at each subsequent time point is recursively predicted to obtain the weight loss rate prediction curve for the entire storage period.

2. The method according to claim 1, characterized in that, In step S3, for subsequent time points Based on recent A sliding time window is constructed using a number of valid time points. Greater than or equal to When all corresponding weighted average weight loss rates have measured values, a weighted linear regression is applied to the weighted average weight loss rate within the window to obtain the time points. Local slope and local intercept And calculate the time point. Local predicted values ; Valid time points within the window Less than When local fitting is skipped, the current slope is used directly. and current intercept Make predictions.

3. The method according to claim 2, characterized in that, In step S4, when time point There are measured values ​​of weighted average weight loss rate. Furthermore, when step S3 completes the local fitting, the prediction error is calculated. The system calculates a dynamic correction factor based on the error magnitude, corrects the local slope under defined upper and lower limits of correction intensity, and obtains the corrected slope and intercept. The corrected slope and intercept are then used as the new current slope and intercept. At time point... When there are no measured values ​​or local fitting is not complete, keep the current slope and current intercept unchanged; The prediction error is calculated using the following formula: ; in, For time points The measured weighted average weight loss rate For time points Local predicted values, For time points The prediction error; The dynamic correction factor is calculated using the following formula: ; in, As a dynamic correction factor, Basic correction factor, This represents the absolute value of the prediction error. and These are the lower and upper limits of the correction intensity, respectively; The corrected slope is calculated using the following formula: ; in, For time points Corrected slope The time interval between two adjacent observation points, and satisfying the following conditions: ; The corrected intercept is calculated using the following formula: ; in, For time points Corrected intercept; Corrected predictions: 。 4. The method according to claim 3, characterized in that, In step S5, , As the new current slope and current intercept Based on the current slope and current intercept, for subsequent time points The weight loss rate is then recursively predicted to obtain a dynamic prediction curve of the weight loss rate throughout the storage period. Steps S3 and S4 are repeated at each time point with measured values, so that the model can adaptively track the dynamic changes of the postharvest weight loss rate of fruits and vegetables under conditions of multiple treatment groups, multiple samples and missing data, and achieve long-term prediction across varieties and treatment conditions.

5. The method according to claim 1, characterized in that, It also includes a step of quantitatively evaluating the predictive performance, the predictive performance evaluation including: Calculate the root mean square error between the predicted result obtained based on the sliding window correction method and the actual weighted average weight loss rate. Coefficient of determination and mean absolute error The root mean square error is calculated using the following formula: ; in, The number of time points involved in the evaluation. For time points The measured weighted average weight loss rate For time points Predicted weightlessness rate; The coefficient of determination is calculated using the following formula: ; in, The mean of the measured weighted average weight loss rate during the evaluation period; The root mean square error obtained using a simple linear regression model with fixed parameters and coefficient of determination For comparison, the improvement percentage and the relative increase in the coefficient of determination are calculated, and the improvement percentage is calculated according to the following formula: ; in, The root mean square error of the sliding window correction method; The relative increase in the coefficient of determination is calculated using the following formula: ; in, The coefficient of determination for the sliding window correction method. The coefficient of determination is the coefficient of determination for a simple linear regression model.

6. A fruit and vegetable postharvest weight loss prediction system based on sliding window correction, characterized in that, For performing the method as described in any one of claims 1 to 5, comprising: The data acquisition module is used to collect weight data of multiple samples from each treatment group at various time points during the post-harvest storage of fruits and vegetables, and to record the corresponding treatment conditions and storage environment parameters. The preprocessing and weighted calculation module is used to calculate the single fruit weight loss rate based on the weight data. And at each time point, the weighted average weight loss rate is obtained according to the weighting method in step S1. It simultaneously removes outlier samples and marks missing data. The initial modeling module is used to select the weighted average weight loss rate at at least three consecutive time points during the early stages of storage. The initial slope is obtained through linear regression. and initial intercept And write it into the model parameter storage unit as the current slope. and current intercept ; The sliding window fitting module is used to fit the window to a preset size. Extract the most recent The weighted average weightlessness rate at each time point forms a sliding window, and the number of valid time points within the window is determined. and in Perform local linear fitting at that time to obtain , and local predicted values ;exist The time-direction dynamic correction module outputs the current slope. and current intercept ; The dynamic correction module is used to obtain the measured weighted average weight loss rate. Calculate prediction error in time Based on the basic correction factor Calculate the dynamic correction factor based on the error magnitude. Under the condition of limiting the upper and lower limits of the correction intensity, the slope and intercept are updated according to step S4 of claim 1. , And write it into the model parameter storage unit as a new , ; The prediction output module is used to predict the output based on the current slope. and current intercept Recursively predict subsequent time points and output the weight loss rate prediction curve during storage.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the method of any one of claims 1–5.

8. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the method of any one of claims 1–5.

Citation Information

Patent Citations

  • Method and device for nondestructive and rapid prediction of shelf life and freshness of fruits

    CN110411957A

  • 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

  • Fruit and vegetable mature period prediction method based on deep learning

    CN121094203A

  • Improving Deep Neural Networks Using Prototype Factoring

    DE102021212086A1