Prewarning method for cold-chain logistics quality of fresh fruits and vegetables
By building a fresh fruit and vegetable quality warning indicator system and the SG-NRBO-CNN-LSTM-Attention model, the problem of quality and safety assurance in the cold chain logistics of fresh fruits and vegetables was solved, early warning and accurate assessment were achieved, and the quality control capabilities of fruits and vegetables were improved.
Patent Information
- Application Number
- CN202510986534.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-09-23
AI Technical Summary
It is difficult to effectively ensure the quality and safety of fresh fruits and vegetables during the cold chain logistics process, especially due to the complexity of multi-dimensional environmental indicators and the large amount of data, which makes it difficult to detect food problems and trace responsibility in a timely manner, posing a potential health threat.
A quality early warning index system for fresh fruits and vegetables was constructed. The entropy weight TOPSIS method was used to determine the indicator weights. The SG-NRBO-CNN-LSTM-Attention model was combined for data processing and early warning model optimization. The dimensional effect was eliminated through standardization, and deep learning technology was used for early warning.
It achieves early warning of the cold chain logistics process of fresh fruits and vegetables, improves the accuracy of quality assessment and the performance of the early warning model, and can identify potential quality problems in a timely manner to ensure the safety of fruits and vegetables.
Smart Images

Figure CN120688960A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of early warning of the quality of cold chain logistics of fresh fruits and vegetables, and particularly relates to an early warning method for the quality of cold chain logistics of fresh fruits and vegetables. Background Art
[0002] As people's pursuit of quality of life continues to rise, food safety has become a core concern for all sectors. Domestically, demand for cold chain logistics for fresh fruits and vegetables is experiencing rapid growth. Despite the continuous optimization and upgrading of my country's cold chain logistics infrastructure in recent years, with significant progress in cold storage construction and refrigerated transportation equipment, safety issues with fresh fruits and vegetables continue to arise frequently. Deterioration of fresh fruits and vegetables is particularly serious, making it difficult to effectively guarantee the quality and safety of fresh fruits and vegetables during circulation. Specifically, the circulation of fresh fruits and vegetables involves multi-dimensional environmental indicators such as temperature, humidity, and gas composition, as well as multiple links such as production, warehousing, transportation, and sales. The resulting data volume is vast and complex, making it difficult to promptly identify and trace responsibility for food problems, which can ultimately pose a potential threat to consumer health. Therefore, it is imperative to use currently advanced deep learning technologies to study the quality issues of cold chain logistics for fresh fruits and vegetables. Summary of the Invention
[0003] In order to overcome the above problems in the prior art, the purpose of the present invention is to provide a method for early warning of the quality of cold chain logistics of fresh fruits and vegetables, which can grasp the information of various indicators of fresh fruits and vegetables in the cold chain logistics process of fresh fruits and vegetables and provide early warning.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is: A method for early warning of the quality of cold chain logistics of fresh fruits and vegetables, comprising the following steps: 1) Establish a quality early warning indicator system for fresh fruits and vegetables; 2) Analyze the entire cold chain logistics process and determine key indicators for production, storage, transportation, and sales; Raw data was collected and solved using the entropy weight TOPSIS method to obtain the weights of key indicators in the fresh fruit and vegetable cold chain logistics quality and safety early warning index system. Based on the comprehensive scores of each indicator of the TOPSIS method, the quality assessment value of the fresh fruit and vegetable cold chain was calculated, and the dimensional effect was eliminated through standardization. 3) Build a fresh fruit and vegetable quality indicator early warning model, specifically by constructing an SG-NRBO-CNN-LSTM-Attention model, optimizing its parameters, and training the mathematical model; 4) Use step 3) to build an optimized SG-NRBO-CNN-LSTM-Attention model, input the data processed in step 2) into the model, and output the quality alert level of each link of the fresh fruit and vegetable cold chain logistics and the overall quality alert level.
[0005] The early warning indicator system in step 1) includes: First-level indicators: Production link, storage link, transportation link, sales link; Secondary indicators: Production process: quality indicators; Storage link: storage condition indicators; Transportation link: transportation efficiency index, transportation loss index, transportation condition index; Sales: sales efficiency indicators, customer indicators; Level 3 indicators: Quality indicators: freshness, size, and appearance integrity; Storage condition indicators: storage temperature, storage humidity, oxygen content, carbon dioxide content; Transportation efficiency indicators: transportation cost, transportation time; Transportation loss indicators: loss rate, packaging quality; Transportation condition indicators: transportation temperature, transportation humidity; Sales efficiency indicators: sales cycle, sales channel efficiency; Customer indicator: customer satisfaction.
[0006] The specific method of data standardization in step 2) is as follows: Positive indicator standardization formula: Negative indicator normalization formula: The formula for near interval processing: Square sum normalization formula: ——The original value of the jth indicator of the i-th sample; ——standardized indicator value; ——The maximum value of the jth indicator in all samples; ——The minimum value of the jth indicator among all samples; p——the upper limit p value of the interval; q——the lower limit q value of the interval.
[0007] The SG-NRBO-CNN-LSTM-Attention model construction in step 3) includes: Data preprocessing layer: Use Savitzky-Golay filter to smooth and reduce noise of input data; The core architecture includes: input layer, convolution layer, ReLU activation layer, average pooling layer, LSTM layer, attention layer, and fully connected layer.
[0008] The parameter optimization of step 3) adopts the Newton-Raphson optimization strategy (NRBO), and the specific method is: (a) Population initialization: Generate Np populations, each of which consists of fuzzy decision variables or vectors. The position x of each individual in each population is j Calculated by the following formula: x j ——decision vector; dim - Problem dimensions; lb — lower limit; ub — upper limit; ——No. n th The overall j th The position of the dimension; rand ——A random number between 0 and 1; The population matrix of all dimensional populations is as follows: (b) Newton-Raphson search rule NRSR update: By performing Taylor series expansion on the objective function, the update formula is as follows: Based on the search requirements of the population, random parameters are introduced randn — the worst position in the population; ——The best position in the population.
[0009] Introducing adaptive coefficient δ The exploration and development capabilities of the algorithm are dynamically adjusted during the iteration process to better balance the relationship between the two. The adaptive coefficient δ is specifically defined as follows: IT ——Current iteration number; Max_IT ——maximum number of iterations; The parameter ρ is introduced to enhance the development capability of the algorithm, a∈(0,1), b∈(0,1) r i — a distinct integer randomly selected from the population; (c) Trap Avoidance Operator (TAO) Modification: Avoid falling into the local optimum trap by combining the best positions and the current vector position , generate a new solution based on certain conditions , θ1——uniform random number between (-1,1); θ2——uniform random number between (-0.5, 0.5); μ i ——Random numbers generated according to specific conditions; (d) Iteration convergence: First, according to NRSR and parameter ρ, the new position is obtained , as shown below: By placing the best position x b Substituting into the above formula, we get the new position : Finally, the new position vector for the next iteration is calculated according to : r 2 ——A random number between (0,1).
[0010] After optimization, the SG-NRBO-CNN-LSTM-Attention model in step 3) meets the requirements of a learning rate parameter of 0.0023777, a number of hidden layer nodes of 30, and an L2 regularization coefficient of 0.00010001.
[0011] The performance of the SG-NRBO-CNN-LSTM-Attention model in step 3) is evaluated using the following metrics: Mean Absolute Error (MAE): Mean Squared Error (MSE): Root mean square error RMSE: Mean Average Precision: Where: y i —True value; —predicted value; —mean of the true values; n—number of samples.
[0012] The alarm level classification in step 4) includes: No alarm: [0.5, 1.0]; Micro alert: (0.4, 0.5]; Light police: (0.3, 0.4]; China police: (0.2, 0.3]; Heavy warning: [0, 0.2].
[0013] Beneficial effects of the present invention: This invention addresses the optimization of a fresh fruit and vegetable quality indicator system. Taking into account the various principles of a fresh fruit and vegetable quality indicator system, based on field research and data analysis, key logistics nodes within the overall fresh fruit and vegetable cold chain logistics process where serious quality issues exist are identified. Important indicators affecting fresh fruit and vegetable quality at these key nodes are summarized. Using the entropy-weighted TOPSIS method, weighted evaluation results for each important indicator are obtained, and the weights of each key indicator are determined, ultimately establishing a valuable early warning indicator system for fresh fruit and vegetable quality and safety.
[0014] This study investigates the optimization of early warning methods for fresh fruit and vegetable quality. Data on various important fresh fruit and vegetable quality indicators are preprocessed using positive and negative indicators and approximation. This data preprocessing converts the raw data into dimensionless data, facilitating subsequent early warning model analysis. Experiments are conducted to compare and analyze the LSTM model, CNN-LSTM model, NRBO-CNN-LSTM-Attention model, and SG-NRBO-CNN-LSTM-Attention early warning model. Parameter optimization is performed using the control variable method. The SG-NRBO-CNN-LSTM-Attention early warning model demonstrates higher accuracy than the LSTM, CNN-LSTM, and NRBO-CNN-LSTM-Attention models, with predicted values closest to the true values. This demonstrates its excellent performance in early warning and is more conducive to early warning of fresh fruit and vegetable quality and safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1Predict results for the LSTM model.
[0016] Figure 2 Prediction results for the CNN-LSTM-Attention model.
[0017] Figure 3 Prediction results for the NRBO-CNN-LSTM-Attention model.
[0018] Figure 4 This is the iterative convergence diagram of the NRBO algorithm after adding the SG filter.
[0019] Figure 5 Prediction results for the SG-NRBO-CNN-LSTM-Attention model.
[0020] Figure 6 This is a comparison chart of the prediction effects of four early warning models.
[0021] Figure 7 It is a quality and safety early warning indicator system for cold chain logistics of fresh fruits and vegetables. DETAILED DESCRIPTION
[0022] The present invention will be described in further detail below with reference to the accompanying drawings.
[0023] A method for early warning of the quality of cold chain logistics of fresh fruits and vegetables, comprising the following steps: Establish a comprehensive early warning indicator system for the quality of fresh fruits and vegetables; Based on the theoretical research related to the early warning of fresh fruit and vegetable quality safety, after field investigation and literature search, when studying the early warning of fresh fruit and vegetable quality, the representative cherry was selected as the research object; Analyze the entire cold chain logistics process of fresh fruits and vegetables, identify key factors affecting quality and safety, and establish a representative early warning indicator system for fresh fruits and vegetables; The entropy weight TOPSIS method was used to solve the data and obtain the indicator weights of the fresh fruit and vegetable cold chain logistics quality and safety early warning index system. Based on the comprehensive scores of various indicators of the TOPSIS method, the quality assessment value of the fresh fruit and vegetable cold chain was calculated.
[0024] Remove the dimensional restrictions between indicators, standardize the data, and eliminate the impact of dimensional differences on data analysis results.
[0025] 3) Construct a fresh fruit and vegetable quality indicator early warning model and propose the SG-NRBO-CNN-LSTM-Attention model. Compare and analyze it with the LSTM model, CNN-LSTM model, and NRBO-CNN-LSTM-Attention model. Optimize the early warning model parameters and train the mathematical model. 4) Following step 3), the processed data was input into the SG-NRBO-CNN-LSTM-Attention model proposed above, along with the LSTM model, the CNN-LSTM model, and the NRBO-CNN-LSTM-Attention model. This model then performed warning predictions for the overall quality cold chain logistics of fresh fruits and vegetables and for each link in the cold chain logistics. The SG-NRBO-CNN-LSTM-Attention model achieved higher accuracy, with its predicted values closest to the true values, demonstrating its excellent performance in early warning and facilitating early warnings for fresh fruit and vegetable quality and safety.
[0026] The step 1) the fresh fruit and vegetable early warning indicator system includes four links, namely production, storage, transportation and sales, which constitute the first-level indicators; The secondary indicators of the production process include quality indicators; The secondary indicators of the storage link include storage condition indicators; The secondary indicators of the transportation link include transportation efficiency index, transportation loss index and transportation condition index; The secondary indicators of the sales link include sales efficiency indicators and customer indicators.
[0027] The three-level indicators of the quality index include freshness, size and appearance integrity; The three-level indicators of the storage condition index include storage temperature, storage humidity, oxygen content and carbon dioxide content; The three-level indicators of the transportation efficiency index include transportation cost and transportation time; The three-level indicators of the transportation loss index include loss rate and packaging quality; The three-level indicators of the transportation condition indicators include transportation temperature and transportation humidity; The three-level indicators of the sales efficiency indicator include sales cycle and sales channel efficiency; The third level of customer indicators includes customer satisfaction.
[0028] In step 2), the (1-1) For the positive indicator processing of data, use (1-2) To process the negative indicators of the data, use (1-3) For the near interval processing of data, use (1-4) The data are squared and normalized.
[0029] In step 3), the proposed SG-NRBO-CNN-LSTM-Attention model is an improved model built on the NRBO-CNN-LSTM-Attention model architecture by introducing a Savitzky-Golay filter to preprocess the input data. The Newton-Raphson (NRBO) optimization algorithm is used to optimize the warning model parameters. The model parameter configuration is shown in Table 1 below. The NRBO-CNN-LSTM-Attention model improves the performance of the CNN-LSTM-Attention model by incorporating an optimization framework based on the Newton-Raphson optimization strategy (NRBO). The process of the SG-NRBO-CNN-LSTM-Attention model is as follows: (1) Preprocessing of cold chain quality data of fresh fruits and vegetables. SG filter is applied to smooth and reduce noise on the data to improve data quality. The data processed by SG filter is flattened and formatted to meet the requirements of model input, preparing for subsequent model training.
[0030] (2) NRBO optimization model parameters. The NRBO model is introduced into the CNN-LSTM-Attention model for parameter optimization. The three parameters of the model, namely the learning rate, the number of hidden layer nodes, and the L2 regularization coefficient, are optimized to obtain a more accurate warning value.
[0031] (3) Model construction process. Construct a CNN-LSTM-Attention hybrid model. This model can effectively extract, process and predict data features. (4) Model prediction results and analysis. The data is divided into a training set and a test set. The training set is used for model learning and training, and the test set is used to evaluate the trained model. The prediction accuracy of the model is quantified by calculating multiple evaluation indicators. At the same time, the model performance is more intuitively demonstrated by plotting the model prediction results and prediction error graphs.
[0032] The architecture of the CNN-LSTM-Attention model consists of the following parts: (1) Input layer. The input layer parameter is set to 16, which means that the input layer defines the format and size of the external input data received by the model and is used to receive input sequence data.
[0033] (2) Convolutional layer. The first convolution kernel size is [3, 1], and the number of convolution kernels is 32. The convolution layer extracts features from the input data through the convolution kernel. Each convolution kernel slides over the input data to obtain the feature map of the corresponding channel. The convolution kernel size of [3, 1] here means that the convolution operation is performed pixel by pixel, which mainly plays the role of linear transformation of the input data and extraction of local features. The feature map of 32 channels is output to enrich the feature representation. The second convolution kernel size is also [3, 1], and the number of convolution kernels is 64. This layer further extracts and transforms the feature map after the previous convolution layer, increasing the feature dimension from 32 channels to 64 channels, and can learn more complex and abstract feature information.
[0034] (4) Activation layer. The model has four activation layers. The first activation layer, Relu1, follows the first convolutional layer and is used to add nonlinear factors to the linear output after the convolution operation. The Relu function sets the negative input value to 0 and outputs the positive value as is, which can accelerate the convergence of the model and help alleviate the gradient vanishing problem, allowing the model to learn and fit more complex functional relationships. The second activation layer, Relu2, is located after the second convolutional layer and plays a similar role in adding nonlinearity to the convolution output, enhancing the model's ability to fit complex data patterns. The third activation layer, Relu3, is used to introduce nonlinear transformations in subsequent structures involving fully connected layers, helping the network to better learn the nonlinear mapping relationship between input and output.
[0035] (5) Pooling layer. The average pooling layer is used. This layer performs an average pooling operation on the input feature map in the spatial dimension, compressing the feature map of each channel into a single value, which plays a role in dimensionality reduction and feature integration, reducing the number of parameters in the subsequent fully connected layer. At the same time, it can also retain important global feature information to a certain extent and prevent overfitting.
[0036] (6) LSTM layer. Each LSTM unit contains three gating mechanisms: input gate, forget gate, and output gate, as well as a unit state, which is used to handle long-term dependency issues. This LSTM layer contains 6 units. When processing sequence data, the model can simultaneously focus on information at 6 different time scales. The output mode uses the hidden state of the last time step, that is, the final result after the entire sequence is processed, rather than outputting at each time step. It is suitable for many sequence-to-single-output prediction task scenarios. Here, it can further learn and integrate the time series information of the sequence-related features after the previous multi-layer processing, and mine the long-term dependency relationships in the data.
[0037] (7) Attention layer. This paper adopts SE attention layer and dot product attention layer. By modeling the feature channel, attention weights are generated, and then the attention weights are dot-multiplied with the features to achieve adaptive weighting of features.
[0038] (8) Fully connected layer. The first fully connected layer has an output dimension of 16. It will perform a linear transformation on the processed feature vector and map it to a 16-dimensional space to achieve further integration and nonlinear mapping of features. The second fully connected layer has an output dimension of 64. It will continue to perform a linear transformation on the features, mapping them from the 16-dimensional space to the 64-dimensional space, further enriching and adjusting the feature representation. It plays a role in connecting the upper and lower layers of the entire network structure, integrating features at different levels and moving closer to the final output. The last fully connected layer has an output dimension of 1. It will finally map the features learned by the previous layer to a single numerical output, which is used to predict the target value output in the regression task, such as predicting the value of a continuous indicator.
[0039] (9) Output layer: Outputs the final prediction results.
[0040] Program code was written in MATLAB, using 16 early warning indicator values as the model input and fresh fruit and vegetable quality assessment values as the model output. The Adam gradient descent algorithm was used for model training, with the number of training cycles set to 100. The learning rate, a key parameter controlling the step size of each model weight update, was initially set to 0.01. During training, the learning rate was adjusted using a segmented strategy, with a descent factor set to 0.1. This means that after each specific training phase, the learning rate will decay to 0.1 times the current value. Specifically, after every 100 training cycles, the learning rate is adjusted accordingly based on the descent factor to optimize the model's training process and performance.
[0041] Table 1 SG-NRBO-CNN-LSTM-Attention model parameters The SG-NRBO-CNN-LSTM-Attention model was trained based on the model parameters defined in Table 1. After the SG filter was introduced into the model, the NRBO algorithm adjusted the parameter optimization results based on the model data. The optimized model parameters are shown in Table 2.
[0042] Table 2 Model parameter optimization results of NRBO algorithm after adding SG filter The SG-NRBO-CNN-LSTM-Attention model also has an input data index size of 16, an output data index of 1, a data sample size of 1000, and a training set and validation set size ratio of 8:2. The filter window size is iterated by the code to find the optimal value. The fitness change line of the model training is as follows: Figure 4 shown.
[0043] Newton-Raphson Optimization (NRBO) algorithm: In the initialization phase, based on the fact that there are Np populations, and each population consists of fuzzy decision variables or vectors, a random population is generated using formula (1-5), as shown below: (1-5) x j ——decision vector; dim - Problem dimensions; lb — lower limit; ub — upper limit; ——No. n th The overall j th The position of the dimension; rand ——A random number between 0 and 1.
[0044] Formula (1-6) gives the population matrix that can describe all dimensional populations. The formula is as follows: (1-6) The Newton-Raphson search rule (NRSR) is one of the core elements of the Newton-Raphson optimization algorithm. It is based on the Newton-Raphson method and uses Taylor series expansion of the objective function to obtain the update formula (1-7) as shown below: (1-7) In order to better adapt to the needs of population-based search, the formula was adjusted and a random parameter was introduced randn , as shown in formula (1-8): (1-8) — the worst position in the population; ——The best position in the population.
[0045] In addition, to further improve the performance of the algorithm, an adaptive coefficient δ is introduced. By introducing δ, the algorithm's exploration and development capabilities can be dynamically adjusted during the iteration process to better balance the relationship between the two. The formula is shown in (1-9): (1-9) IT ——Current iteration number; Max_IT ——The maximum number of iterations.
[0046] At the same time, in order to enhance the development capability of the algorithm, parameters ρ, a∈(0,1), b∈(0,1) are introduced.
[0047] (1-10) r i —distinct integers randomly selected from the population.
[0048] Trap Avoidance Operator (TAO) is another important component of the Newton-Raphson optimization algorithm. Its main function is to help the algorithm avoid falling into the local optimal trap. TAO combines the best position and the current vector position , generate a new solution based on certain conditions , the specific formula is shown in (1-11): (1-11) θ1——uniform random number between (-1,1); θ2——uniform random number between (-0.5, 0.5); μ i ——A random number generated based on specific conditions.
[0049] In the iterative process of the algorithm, the optimal solution is gradually approached by continuously updating the position of each individual in the population. Specifically, the new position is obtained based on the NRSR and the updated position ρ. , as shown in the following formula: (1-12) By placing the best position x b Substituting into the above formula, we get the new position : (1-13) Finally, the new position vector for the next iteration is calculated according to : (1-14) (1-15) r 2 ——A random number between (0,1).
[0050] During the parameter optimization process of the aforementioned SG-NRBO-CNN-LSTM-Attention model, the population initialization and iteration mechanism of the Newton-Raphson optimization strategy (NRBO) are deeply integrated with the cold chain data of fresh fruits and vegetables: The data nature of the population: The “population individuals” in the NRBO algorithm directly correspond to the standardized indicator data set collected in the cold chain link. The position vector x of each individual j Represents a set of potential model parameter combinations (including learning rate, number of hidden layer nodes, and L2 regularization coefficient).
[0051] Optimization goal: By minimizing the model prediction error, NRBO performs a search in the data feature space: utilizing the distribution characteristics of the indicator data to dynamically adjust the parameter direction; preventing the parameter optimization from falling into the local optimum, ensuring adaptation to the complex time series fluctuations of the cold chain data.
[0052] Parameter output and model training closed loop: The final output new position vector is the optimized hyperparameter combination, which is injected into the CNN-LSTM-Attention architecture to complete the construction of the SG-NRBO-CNN-LSTM-Attention model.
[0053] The model evaluation index can be expressed by the following formula: (1-16) (1-17) (1-18) (1-19) y i ——True value; ——predicted value; ——the average of the true values; n——sample size.
[0054] When evaluating model performance, smaller values of the four evaluation indicators, namely mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE), and mean absolute percentage error (MPAE), are generally preferred. This is because smaller values of these indicators mean smaller prediction errors and better model fitting effects. These indicators each have their own emphasis and together provide a comprehensive perspective for evaluating the model.
[0055] The warning indicator data has been standardized and weighted previously. The evaluation value of the fresh fruit and vegetable cold chain is calculated using the following formula as the output value of the warning model. The mathematical formula for calculating the evaluation value of the fresh fruit and vegetable cold chain is expressed as: (1-20) w i ——normalized value of indicator i; x j ——The weight of indicator i. Example
[0056] Representative cherries were selected as the research object, and the entire cold chain logistics process of fresh fruits and vegetables was analyzed. That is, the risk factors that may affect the quality and safety of cherries in the production, storage, transportation, sales and other links were classified and screened. Combined with big data mining and analysis, the key factors affecting quality and safety were determined, and a representative fresh fruit and vegetable early warning indicator system was established.
[0057] For the quality cold chain logistics of fresh fruits and vegetables, a hierarchical structure model consisting of 4 categories of first-level indicators, 7 second-level indicators, and 16 third-level indicators was finally selected, such as Figure 6 shown.
[0058] The first-level indicators are set up corresponding to the indicators of the four links: production, storage, transportation and sales.
[0059] Secondary indicators include quality, storage conditions, transportation efficiency, loss, transportation conditions, sales efficiency and customer indicators.
[0060] The third-level indicators include freshness, size and specifications, appearance integrity, storage temperature, storage humidity, oxygen content, carbon dioxide content, transportation cost, transportation time, loss rate, packaging quality, transportation temperature, transportation humidity, sales cycle, sales channel efficiency, and customer satisfaction.
[0061] The present invention establishes the weights of fresh fruit and vegetable indicators using the entropy weight TOPSIS method based on data collected on the spot and references.
[0062] First, collect the original data of the third-level indicators of each link (taking the third-level indicators of the cherry production link as an example, see Table 3). Table 3 Original data of the three-level indicators in the cherry production process The standards for setting cherry interval values are as follows: storage temperature interval value is 0-1 degrees Celsius, storage relative humidity interval value is 85%-90%, storage oxygen content interval value is 3%-5%, storage carbon dioxide content interval value is 10%-15%, transportation temperature interval value is 0-2 degrees Celsius, and transportation relative humidity interval value is 90%-95%. Cherry indicator data is processed for positive and negative indicators and close interval processing (see Table 4 for the processed data). Specific indicator processing examples are as follows: Freshness No. 1: Positive indicator processing yields: Transport time sequence number 1: negative indicator processing results: Transport temperature sequence number 9: after localization, the result is: Table 4 Data table of the three-level indicators in the cherry production process after processing The original data differ in both dimensions and dimensionality. It is necessary to convert them into dimensionless pure data to eliminate the impact of these dimensional differences on the data analysis results. Formulas 1-4 are used to normalize the original data to their sum-of-squares values. Table 5 shows the results of this normalization.
[0063] For example: Freshness number 1: Perform square sum normalization to get: Table 5 Normalized values of the sum of squares of various indicators in the production process The entropy method's weight calculation principle requires that the data cannot be less than or equal to 0. Because the above sample contains values of 0, a non-negative shift of 0.001 is applied to the entire sample. For example, freshness index 4 is positively shifted by 0.001 to obtain 0.001. (See Table 6 for the overall processed data.)
[0064] Table 6 Non-negative shift values of the three-level indicators in the cherry production process after processing The entropy value, information utility value and weight coefficient value of the weight are calculated using the entropy method. The total weight system of fresh fruit and vegetable early warning indicators is shown in Table 7 below.
[0065] Table 7 Early warning index values obtained by entropy method The above total weight system table can clearly show the importance level of each indicator, providing a complete quarantine standard for reference for fresh fruit and vegetable quality quarantine departments.
[0066] The TOPSIS method is used to calculate the Euclidean distance between the evaluation object and the positive and negative ideal solutions to obtain the evaluation results. , negative ideal solution distance and relative proximity The formula is as follows: (1-21) n——evaluation object; Z+——positive ideal solution.
[0067] ——Negative ideal solution.
[0068] Furthermore, the comprehensive scores of various indicators of cherry cold chain transportation are calculated, as shown in Table 8 below.
[0069] Table 8 Early warning index values obtained by entropy method Based on the weights of each link in the cherry cold chain transportation process and the TOPSIS evaluation results, groups with higher relative proximity have better overall cold chain transportation performance. To effectively evaluate model performance, the predicted values are divided into different alert levels based on different intervals. The accuracy of the model's predictions is determined by comparing the alert levels of the actual and predicted values. Different alert levels were designed based on the target output values, and the results are shown in the alert level table in Table 9 below.
[0070] Table 9 Police Situation Grading Table Forecast range [0,0.2] (0.2,0.3] (0.3,0.4] (0.4,0.5] (0.5,1] Police Information Heavy Police Central Police Light Police Wechat alert No police Based on the severity of the alert, the specific values predicted by the LSTM, CNN-LSTM, NRBO-CNN-LSTM-Attention, and SG-NRBO-CNN-LSTM-Attention algorithms were used to determine the alert, and their warning effectiveness was compared. Due to the large amount of data, 10 consecutive data points were selected for the alert comparison. The specific results are shown in Table 10.
[0071] Table 10 Prediction results of fresh fruit and vegetable cold chain quality warnings using four models The data results in Table 10 show that among the 10 samples, there is a significant difference between the predicted alarm values of the LSTM model and the actual alarm values. There are three cases where the alarm prediction is incorrect. The CNN-LSTM model and the NRBO-CNN-LSTM-Attention model both have one alarm prediction deviation. However, the SG-NRBO-CNN-LSTM-Attention model proposed in this paper has no alarm prediction deviation, and its predicted alarm values are completely consistent with the actual alarm values.
[0072] Further observation of the differences between the predicted and true values of different models revealed that when the true value falls within the pre-set warning boundary, insufficient model prediction accuracy can easily lead to deviations between the predicted and true values, causing the predicted value to deviate from the original warning interval, leading to misjudgment of warnings. Taking sample 2 as an example, its value is 0.5035, and the warning value is close to the left boundary of the non-warning interval. Based on the warning results, the LSTM, CNN-LSTM, and NRBO-CNN-LSTM-Attention models all exhibited warning prediction errors, while the predicted values of the SG-NRBO-CNN-LSTM-Attention model were more consistent with the true value, and the warning judgment was completely consistent with the actual situation. Therefore, this model can timely predict warnings in fresh fruit and vegetable safety warnings, helping fresh fruit and vegetable cold chain transportation managers make early decisions and eliminate risks that affect fresh fruit and vegetable quality as soon as possible, which is of great significance to fresh fruit and vegetable quality control. The present invention belongs to the field of fresh fruit and vegetable cold chain logistics quality warning technology, and specifically relates to a fresh fruit and vegetable cold chain logistics quality warning method.
Claims
1. A method for early warning of the quality of cold chain logistics of fresh fruits and vegetables, comprising the following steps: 1) Establish a quality early warning indicator system for fresh fruits and vegetables; 2) Analyze the entire cold chain logistics process and determine key indicators for production, storage, transportation, and sales; The original data were collected and solved using the entropy weight TOPSIS method to obtain the weights of the key indicators of the fresh fruit and vegetable cold chain logistics quality and safety early warning index system; Based on the comprehensive scores of various indicators of the TOPSIS method, the quality assessment value of the fresh fruit and vegetable cold chain is calculated, and the dimension effect is eliminated through standardization; 3) Build a fresh fruit and vegetable quality indicator early warning model, specifically by constructing an SG-NRBO-CNN-LSTM-Attention model, optimizing its parameters, and training the mathematical model; 4) Use step 3) to build an optimized SG-NRBO-CNN-LSTM-Attention model, input the data processed in step 2) into the model, and output the quality alert level of each link of the fresh fruit and vegetable cold chain logistics and the overall quality alert level.
2. A method for early warning of cold chain logistics quality of fresh fruits and vegetables according to claim 1, characterized in that: The early warning indicator system in step 1) includes: First-level indicators: Production link, storage link, transportation link, sales link; Secondary indicators: Production process: quality indicators; Storage link: storage condition indicators; Transportation link: transportation efficiency index, transportation loss index, transportation condition index; Sales: sales efficiency indicators, customer indicators; Level 3 indicators: Quality indicators: freshness, size, and appearance integrity; Storage condition indicators: storage temperature, storage humidity, oxygen content, carbon dioxide content; Transportation efficiency indicators: transportation cost, transportation time; Transportation loss indicators: loss rate, packaging quality; Transportation condition indicators: transportation temperature, transportation humidity; Sales efficiency indicators: sales cycle, sales channel efficiency; Customer indicator: customer satisfaction.
3. A method for early warning of cold chain logistics quality of fresh fruits and vegetables according to claim 1, characterized in that: The specific method of data standardization in step 2) is as follows: Positive indicator standardization formula: Negative indicator normalization formula: The formula for near interval processing: Square sum normalization formula: ——The original value of the jth indicator of the i-th sample; ——standardized indicator value; ——The maximum value of the jth indicator in all samples; ——The minimum value of the jth indicator among all samples; p——the upper limit p value of the interval; q——the lower limit q value of the interval.
4. A method for early warning of cold chain logistics quality of fresh fruits and vegetables according to claim 1, characterized in that: The SG-NRBO-CNN-LSTM-Attention model construction in step 3) includes: Data preprocessing layer: Use Savitzky-Golay filter to smooth and reduce noise of input data; The core architecture includes: input layer, convolution layer, ReLU activation layer, average pooling layer, LSTM layer, attention layer, and fully connected layer.
5. A method for early warning of cold chain logistics quality of fresh fruits and vegetables according to claim 1, characterized in that: The parameter optimization of step (3) adopts the Newton-Raphson optimization strategy (NRBO), and the specific method is: (a) Population initialization: Generate Np populations, each of which consists of fuzzy decision variables or vectors. The position x of each individual in each population is j Calculated by the following formula: x j ——decision vector; dim - Problem dimensions; lb — lower limit; ub — upper limit; ——No. n th The overall j th The position of the dimension; rand ——A random number between 0 and 1; The population matrix of all dimensional populations is as follows: (b) Newton-Raphson search rule NRSR update: By performing Taylor series expansion on the objective function, the update formula is as follows: Based on the search requirements of the population, random parameters are introduced randn — the worst position in the population; — the best position in the population; Introducing adaptive coefficient δ The exploration and development capabilities of the algorithm are dynamically adjusted during the iteration process to better balance the relationship between the two. The adaptive coefficient δ is specifically defined as follows: IT ——Current iteration number; Max_IT ——maximum number of iterations; The parameter ρ is introduced to enhance the development capability of the algorithm, a∈(0,1), b∈(0,1) r i — a distinct integer randomly selected from the population; (c) Trap Avoidance Operator (TAO) Modification: Avoid falling into the local optimum trap by combining the best positions and the current vector position , generate a new solution based on certain conditions , θ1——uniform random number between (-1,1); θ2——uniform random number between (-0.5, 0.5); μ i ——Random numbers generated according to specific conditions; (d) Iteration convergence: First, according to NRSR and parameter ρ, the new position is obtained , as shown below: By placing the best position x b Substituting into the above formula, we get the new position : Finally, the new position vector for the next iteration is calculated according to : r 2 ——A random number between (0,1).
6. A method for early warning of cold chain logistics quality of fresh fruits and vegetables according to claim 1, characterized in that: After optimization, the SG-NRBO-CNN-LSTM-Attention model in step 3) meets the requirements of a learning rate parameter of 0.0023777, a number of hidden layer nodes of 30, and an L2 regularization coefficient of 0.00010001.
7. A method for early warning of cold chain logistics quality of fresh fruits and vegetables according to claim 1, characterized in that: The performance of the SG-NRBO-CNN-LSTM-Attention model in step 3) is evaluated using the following metrics: Mean Absolute Error (MAE): Mean Squared Error (MSE): Root mean square error RMSE: Mean Average Precision: Where: y i —True value; —predicted value; —mean of the true values; n—number of samples.
8. A method for early warning of cold chain logistics quality of fresh fruits and vegetables according to claim 1, characterized in that: The classification of alarm levels in step (4) includes: No alarm: [0.5, 1.0]; Micro alert: (0.4, 0.5]; Light police: (0.3, 0.4]; China police: (0.2, 0.3]; Heavy warning: [0, 0.2].