Intelligent prediction method for three-dimensional quality of agricultural products based on multi-source perception and dynamic coupling

CN122948004APending Publication Date: 2026-10-20SHENZHEN ACAD OF METROLOGY & QUALITY INSPECTION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611360526.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-03
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0004]鉴于上述的分析,本发明实施例旨在提供一种基于多源感知与动态耦合的农产品三维品质智能预测方法,用以解决现有技术仅关注单一维度品质指标、难以量化不同维度之间的耦合强度及其时变特性、预测精度及实时性不佳的问题

Benefits of technology

[0015]与现有技术相比,本发明至少可实现如下有益效果之一:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention belongs to the field of smart agriculture and food quality and safety technology, and relates to an intelligent prediction method for the three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling. The method includes: collecting nutritional index data, sensory index data, safety index data, and environmental data to obtain nutritional feature vectors, sensory feature vectors, safety feature vectors, and environmental feature vectors, respectively; calculating the intrinsic change rates of nutritional, sensory, and safety features, and constructing a time-varying coupling coefficient matrix by combining the environmental feature vectors; constructing a system of coupled differential equations and solving for the predicted nutritional state vector, sensory state vector, and safety state vector at future times; and calculating the comprehensive quality score of the agricultural product to output an intelligent prediction report of the three-dimensional quality of the agricultural product. This invention achieves dynamic characterization and accurate prediction of the multi-dimensional quality degradation process of agricultural products in the circulation environment, providing real-time decision-making basis for agricultural product storage logistics and shelf-life management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of smart agriculture and food quality and safety technology, and in particular to a method for intelligent prediction of three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling. Background Technology

[0002] Post-harvest quality degradation of agricultural products is a complex process involving multi-dimensional synergistic deterioration, mainly manifested in the degradation of nutrients, deterioration of sensory attributes, and accumulation of safety risks. Currently, technical solutions for monitoring and predicting the quality of agricultural products mainly include: analyzing changes in nutrient composition through spectral imaging; assessing maturity and freshness by fusing spectral and spatial characteristics; and achieving mold prevention monitoring for specific product categories through multi-source sensing and trend prediction.

[0003] However, existing technologies still have the following shortcomings: First, they only focus on changes in a single dimension of quality indicators and do not fully consider the intrinsic relationships between different dimensions, resulting in a large deviation between the prediction results and the actual situation; Second, they lack the ability to adapt to dynamic changes in environmental factors in the distribution process and are unable to respond in real time to the nonlinear impact of fluctuations in environmental parameters such as temperature and humidity on the rate of quality degradation; Third, it is difficult to quantify the coupling strength and time-varying characteristics between different dimensions, thus making it impossible to accurately predict the remaining shelf life in complex distribution environments and to provide real-time and accurate quality prediction reports for warehousing and transportation decisions. Summary of the Invention

[0004] Based on the above analysis, the embodiments of the present invention aim to provide a three-dimensional quality intelligent prediction method for agricultural products based on multi-source perception and dynamic coupling, in order to solve the problems of existing technologies that only focus on single-dimensional quality indicators, have difficulty in quantifying the coupling strength and time-varying characteristics between different dimensions, and have poor prediction accuracy and real-time performance.

[0005] This invention provides a method for intelligent prediction of three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling, comprising: Nutritional, sensory, safety, and environmental data of agricultural products are collected during the circulation process. After data processing and fusion, nutritional feature vectors, sensory feature vectors, safety feature vectors, and environmental feature vectors are obtained respectively. Based on the nutritional feature vector, sensory feature vector, and safety feature vector, the intrinsic nutrient change rate, intrinsic sensory change rate, and intrinsic safety change rate are obtained respectively, and combined with the environmental feature vector, a time-varying coupling coefficient matrix is ​​constructed. Based on the nutritional feature vector, sensory feature vector, safety feature vector, rate of change of nutritional intrinsic features, rate of change of sensory intrinsic features, rate of change of safety intrinsic features, and time-varying coupling coefficient matrix, a set of coupled differential equations is constructed and the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector for future time moments are solved. Based on the nutritional status prediction vector, sensory status prediction vector, and safety status prediction vector, the comprehensive quality score of agricultural products is calculated to output an intelligent prediction report of the three-dimensional quality of agricultural products.

[0006] Furthermore, the data processing and fusion include: After performing spatiotemporal alignment and normalization preprocessing on the nutritional index data, sensory index data, safety index data, and environmental data, they are input into a preset Transformer multi-head cross-attention network and feature mapping and fusion of each index data are performed through a cross-modal attention mechanism to obtain the nutritional feature vector, sensory feature vector, safety feature vector, and environmental feature vector.

[0007] Furthermore, obtaining the intrinsic nutritional change rate includes: Based on the Arrhenius correction equation, the intrinsic trophic variation rate is calculated according to the trophic eigenvector and the ambient temperature in the environmental data; wherein the Arrhenius correction equation is expressed in the following form: ; in, Indicates the rate of change in intrinsic nutritional characteristics; The value represents the predicted intrinsic nutrient value at time t; A represents the frequency factor; Ea represents the activation energy; R represents the gas constant; T(t) represents the absolute temperature at time t calculated based on the ambient temperature. This represents the temperature correction factor.

[0008] Furthermore, obtaining the sensory intrinsic rate of change includes: Based on a pre-defined dual-layer stacked LSTM network, the intrinsic sensory change rate is obtained according to the sensory feature vector, the ambient temperature and humidity in the environmental data, and the pre-collected sensory historical feature sequence. The first layer of the dual-layer stacked LSTM network is used to arrange the sensory feature vector and the sensory historical feature sequence in chronological order, and concatenate them with the environmental temperature and humidity corresponding to each time point to perform time-by-time temporal coding; the second layer of the dual-layer stacked LSTM network is used to process the temporal features according to the temporal coding results output by the first layer to calculate the hidden state, and obtain the sensory intrinsic change rate by linearly mapping the hidden state.

[0009] Furthermore, obtaining the rate of change of the safe intrinsic characteristics includes: Based on the preset Gompertz model, the maximum specific growth rate and lag period are obtained according to the ambient temperature and humidity in the environmental data. The safety quality status is obtained based on the safety feature vector, and the number of microorganisms is calculated by reverse calculation based on the safety quality status and the preset maximum number of microorganisms. The rate of change of the number of microorganisms is calculated based on the number of microorganisms, the maximum specific growth rate, and the lag period, and the rate of change of the intrinsic safety feature is obtained.

[0010] Furthermore, the rate of change in the number of microorganisms is calculated according to the following formula: ; in, The value represents the rate of change in the number of microorganisms; M(t) represents the number of microorganisms at time t. Indicates the maximum specific growth rate; Indicates the delay period; This represents the maximum number of microorganisms when their growth reaches a stationary phase; e represents the natural constant. The rate of change of the safety intrinsic eigenvalue is calculated according to the following formula: ; in, This represents the rate of change of the intrinsic safety features.

[0011] Furthermore, the construction of the time-varying coupling coefficient matrix includes: Based on the changes in the intrinsic nutritional characteristics, the intrinsic sensory characteristics, and the intrinsic safety characteristics, the nutritional state vector, the sensory state vector, and the safety state vector of the current step are obtained, and the first-order and second-order difference terms corresponding to each current step state vector are constructed respectively. Based on the current step's nutritional state vector, sensory state vector, safety state vector, each of the first and second order difference terms, the hidden state calculated by the double-layer stacked LSTM network, and the environmental feature vector, a one-dimensional feature input vector is obtained by concatenation, and the time-varying coupling coefficient matrix is ​​constructed based on the one-dimensional feature input vector.

[0012] Furthermore, the coupled differential equations are expressed in the following form: ; in, This represents the total rate of change of the comprehensive nutritional state vector, sensory state vector, and safety state vector; , , These represent the rates of change in nutritional intrinsic characteristics, sensory intrinsic characteristics, and safety intrinsic characteristics, respectively. represents a 3×3 time-varying coupling coefficient matrix; N, S, and F represent the nutritional state vector, sensory state vector, and safety state vector, respectively.

[0013] Furthermore, the process of solving for the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector at future time points includes: Using the nutritional feature vector, sensory feature vector, and safety feature vector as the initial state, and substituting the nutritional intrinsic rate of change, sensory intrinsic rate of change, safety intrinsic rate of change, and time-varying coupling coefficient matrix into the coupled differential equation system, the coupled differential equation system is iteratively numerically integrated using the RK4 solver to obtain the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector at future time steps.

[0014] Furthermore, the overall quality score of the agricultural product is calculated according to the following formula: ; Where Q(t) represents the comprehensive quality score of agricultural products at time t; N(t), S(t), and F(t) represent the nutritional state vector, sensory state vector, and safety state vector at time t, respectively; and N(0), S(0), and F(0) represent the initial nutritional state reference value, the initial sensory state reference value, and the initial safety state reference value, respectively. , , These represent the weighting coefficients for nutritional status, sensory status, and safety status, respectively. , , These are nonlinear sensitivity indices representing nutritional status, sensory status, and safety status, respectively.

[0015] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects: First, unlike related technologies that only focus on a single-dimensional quality indicator, this invention incorporates three-dimensional indicators of nutrition, sensory characteristics, and safety into a unified prediction framework, which is more in line with actual consumer needs and food safety standards. Simultaneously, by deeply combining the Arrhenius equation, the Gompertz model, and the LSTM long short-term memory network, the intrinsic change rates of nutrition, sensory characteristics, and safety characteristics are obtained respectively. Then, the nutritional feature vector, sensory feature vector, safety feature vector, and environmental feature vector are used as coupling variables for joint solution, taking into account both physical interpretability and the ability to learn complex patterns. This achieves a joint representation of the multi-dimensional quality synergistic deterioration process of agricultural products, overcoming the deficiency that single-dimensional prediction cannot reflect the mutual influence between dimensions.

[0016] Secondly, unlike related technologies which struggle to quantify the coupling strength and time-varying characteristics between different dimensions, this invention dynamically generates a time-varying coupling coefficient matrix through a coupling network within each integration step, based on the first-order difference, second-order difference, intrinsic rate of change of each dimension, implicit state, and environmental data of the current state value. This allows the time-varying coupling matrix to quantify the mutual influence between dimensions in real time, breaking through the limitations of static weighting. It can capture complex synergistic effects such as accelerated microbial proliferation and sensory deterioration. At the same time, the coupling strength is adjusted in real time with changes in the circulation environment and the evolution of quality status, overcoming the shortcomings of static coupling coefficients or fixed weights that cannot adapt to complex circulation environments.

[0017] Third, unlike related technologies which suffer from poor prediction accuracy and real-time performance, this invention uses the RK4 solver to perform iterative numerical integration of the coupled differential equation system. In each integration step, real-time collected environmental data is used to drive each intrinsic evolution submodule. At the same time, the coupling network synchronously completes the dynamic calculation of the coupling coefficient in each integration step, enabling the model to respond in real time to fluctuations in environmental parameters such as temperature and humidity in the circulation process. This ensures prediction accuracy while meeting real-time decision-making requirements, overcoming the shortcomings of insufficient accuracy and lag in response of offline static models or low-order numerical methods.

[0018] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0019] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. Figure 1 This is a flowchart of the intelligent prediction method for three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling, according to an embodiment of the present invention. Figure 2 This is a schematic diagram of the overall architecture of the intelligent prediction method for three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling, according to an embodiment of the present invention. Figure 3 This is a structural diagram of the three-dimensional coupling prediction model according to an embodiment of the present invention. Detailed Implementation

[0020] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0021] The technical concept of this invention lies in collecting data from the circulation process through multi-source sensing methods such as hyperspectral imaging, machine vision, biosensing, and temperature and humidity sensors, and constructing a three-dimensional coupled prediction model composed of three sub-modules: nutrient decay, sensory deterioration, and safety risks. This model employs a hierarchical architecture of feature extraction, cross-modal fusion, and coupled dynamics deduction. The bottom layer processes multi-source heterogeneous data, the middle layer extracts cross-modal correlations through an attention mechanism, the core layer quantifies the dynamic interactions between dimensions using coupled differential equations and state transition matrices, and the output layer generates a comprehensive quality assessment and supports traceability analysis. The hierarchical architecture specifically includes: The bottom layer (feature extraction and alignment layer) uses dedicated sub-neural networks to process heterogeneous data. For example, CNN models process images, 1D-CNN models process spectra, and RNN models process time-series sensor data. Through a cross-modal attention alignment module, timestamps and spatial scales are aligned at the feature level, and a unified and physically meaningful feature vector set Vn (nutrition), Vs (sensory), and Vf (safety) is output.

[0022] The middle layer (dynamic feature interaction layer) introduces a lightweight graph neural network or cross-attention module to learn the short-term correlation strength between Vn, Vs, and Vf online. For example, this layer can learn that "the correlation between the currently detected specific fungal metabolite (safety feature) and the vitamin C degradation rate (nutritional feature) is increasing."

[0023] Core Layer (Coupled Dynamics Prediction Layer): Its input consists of features processed by the interaction layer, containing preliminary relationships between dimensions. The core layer contains three parallel differentiable differential equation solvers, corresponding to the decay processes of N (nutrients), S (sensory), and F (safety), respectively. These equations are interconnected through a learnable coupling coefficient matrix C(t).

[0024] Output layer (comprehensive decision layer): The future trajectory predicted by the core layer is used to generate an intelligent prediction report containing comprehensive quality score, remaining shelf life, and traceability of major risk sources through an interpretable weighted fusion algorithm.

[0025] Thus, by combining data-driven approaches with biochemical mechanism constraints, a digital twin core capable of dynamically evolving with the environment and data has been formed, achieving a leap from static correlation to dynamic coupling, and possessing both accuracy and interpretability.

[0026] A specific embodiment of the present invention discloses a method for intelligent prediction of three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling, such as... Figure 1 and Figure 2 As shown, the steps S1 to S4 are as follows: Step S1: Collect nutritional index data, sensory index data, safety index data, and environmental data of agricultural products in the circulation process. After data processing and fusion, nutritional feature vector, sensory feature vector, safety feature vector, and environmental feature vector are obtained respectively.

[0027] Specifically, the three-dimensional quality of agricultural products described in this invention refers to the prediction and evaluation of the comprehensive quality status of agricultural products during the circulation process from three dimensions: nutritional quality, sensory quality, and safety quality. The circulation process of agricultural products refers to the complete supply chain stages from harvesting, including pre-cooling at the production site, cold chain transportation, warehousing and transshipment, or shelf placement at sales terminals. It should be noted that this invention uses changes in quality across the three dimensions of nutrition, sensory quality, and safety as the prediction target; environmental data is used to assist in the calculation of quality indicators for each dimension, rather than as an independent predictive output.

[0028] During implementation, multi-source data on agricultural products are collected simultaneously throughout the distribution process. This includes: nutritional index data collected via hyperspectral / near-infrared spectroscopy equipment, representing the content and changes of nutrients in agricultural products, such as sugar content, acidity, vitamin C content, and protein content; sensory index data collected via RGB-D imaging equipment / electronic nose / texture analyzer, representing the appearance quality and consumer-perceived attributes of agricultural products, such as color, hardness, odor, and surface integrity; safety index data collected via impedance microbial detection / biosensors, representing the accumulation degree of safety risk factors in agricultural products, such as total microbial colony count and mycotoxin content; and environmental data, such as temperature and humidity, collected via temperature and humidity sensors. After collection, the timing of the collection of different heterogeneous data can be unified to the same time base, specifically through hardware-triggered synchronization signals. When sampling frequencies are inconsistent, interpolation alignment can be used for processing.

[0029] Preferably, the data processing and fusion includes: performing spatiotemporal alignment and normalization preprocessing on the nutritional indicator data, sensory indicator data, safety indicator data, and environmental data, then inputting them into a preset Transformer multi-head cross-attention network and performing feature mapping and fusion on each indicator data through a cross-modal attention mechanism to obtain the nutritional feature vector, sensory feature vector, safety feature vector, and environmental feature vector.

[0030] In some implementations, the collected multi-source data is spatiotemporally aligned and normalized, and a unified multidimensional feature vector set is generated through a cross-modal attention mechanism.

[0031] For example, firstly, timestamp alignment is performed on multi-source heterogeneous data, combining nutritional, sensory, safety, and environmental data collected at the same time into a single time-point sample. For nutritional index data collected by hyperspectral equipment, minimum noise separation transform (MNF) is used to remove noise bands, retaining the top 30 principal components with a signal-to-noise ratio greater than 20dB as spectral features. For sensory index data collected by electronic nose sensors, baseline correction is used to remove drift, and principal component analysis (PCA) is used to reduce the dimensionality to a 10-dimensional feature vector. For sensory data collected by RGB-D image equipment, a pre-trained ResNet18 network is used to extract depth features, and the spatial pyramid pooling result (256 dimensions) of the last convolutional layer output is used. For safety index data collected by rapid microbial detection devices, equivalent circuit model parameters (such as charge transfer resistance and double-layer capacitance) are extracted as features. For temperature and humidity data collected by temperature and humidity sensors, no feature extraction is required; normalization preprocessing is performed directly, and the environmental feature vector is formed after temporal alignment with other dimensional feature vectors.

[0032] Furthermore, for moments with missing data, linear interpolation is first used to fill them in, ensuring the continuity of the time series and a fixed input dimension, thus meeting the input requirements of the subsequent LSTM network and the fourth-order Runge-Kutta numerical solver for equally spaced time series. At the same time, a masking mechanism is introduced in the cross-modal attention calculation to force the attention weights at the filling positions to be set to zero, preventing the network from over-relying on the interpolation to generate low-confidence data. Finally, the feature vectors of each dimension are numerically normalized and mapped to the [0,1] interval. This ensures both the feasibility of numerical calculation and the maintenance of model accuracy.

[0033] Furthermore, this embodiment constructs a cross-modal attention mechanism based on a Transformer-based multi-head cross-attention network, which includes three independent input branches capable of processing input features from the nutrition, sensory, and safety dimensions, respectively. Specifically, each branch first maps the features to the same embedding dimension (set as 128 dimensions) through a linear projection layer. Then, a three-way cross-attention calculation is performed, using the nutrition feature as the query, and the sensory and safety feature vectors as the key and value, respectively, to capture the contribution weights of sensory and safety features to the nutrition feature. Similarly, using sensory and safety features as queries, the attention outputs in the other two directions are calculated, which will not be elaborated here.

[0034] Then, the attention outputs from the three directions are concatenated and input into a feedforward neural network (e.g., two fully connected layers, hidden layer dimension 256, activation function GELU), finally generating a unified and mutually enhanced three-dimensional feature vector group: nutrition feature vector Vn, sensory feature vector Vs, and safety feature vector Vf; and each vector has a dimension of 128. The cross-modal attention mechanism uses scaled dot product attention, with the number of heads set to 8 and the dropout rate set to 0.1.

[0035] Furthermore, to address the issue of inconsistent sampling frequencies across different sensors, a temporal coding module can be introduced before attention alignment. By adding sinusoidal position coding to the features, the feature vector at each time point is combined with its corresponding timestamp: V time (t)=V feature V(t) + PE(t), where PE(t) is the sinusoidal positional encoding vector; feature (t) represents the feature vectors of each dimension after cross-modal attention fusion; V time (t) represents the feature vectors of each dimension after fusing time series information.

[0036] It is understandable that the Transformer attention mechanism itself is not aware of temporal sequence. This embodiment differs from the traditional approach of concatenating time as an independent dimension by injecting temporal information through positional encoding, thus avoiding the destruction of the feature space structure. Simultaneously, for missing data moments, linear interpolation is used for padding, and a masking mechanism is introduced into the attention calculation, ensuring that the attention only applies to valid data positions, ignoring the influence of the padding position, thereby avoiding computational bias caused by missing data padding.

[0037] Furthermore, during the training phase, this embodiment can also introduce a contrastive learning loss, which is used to optimize the fused feature representation of the Transformer multi-head cross-attention network. Specifically, fused feature vectors extracted from the same batch of agricultural products at different collection times are used as positive sample pairs, enabling the network to learn a stable representation that remains consistent across the time dimension; fused feature vectors from different batches or different types of agricultural products are used as negative sample pairs, allowing the network to differentiate the feature distances between different samples. Preferably, the contrastive learning loss weight is set to 0.1 and jointly optimized with the main loss function of the downstream quality prediction task. Through the above contrastive learning constraints, the three-dimensional feature vector set output by the Transformer network has stronger discriminativeness and robustness.

[0038] Therefore, this invention incorporates nutritional, sensory, and safety indicators into a unified prediction framework, achieving multi-dimensional coverage of agricultural product quality prediction and better aligning with actual consumer needs and food safety standards. Furthermore, through cross-modal attention alignment networks and adaptive feature fusion, it can adapt to the quality prediction needs of different categories of agricultural products, exhibiting greater universality.

[0039] Step S2: Based on the nutritional feature vector, sensory feature vector, and safety feature vector, obtain the intrinsic nutrient change rate, intrinsic sensory change rate, and intrinsic safety change rate, respectively, and construct a time-varying coupling coefficient matrix by combining the environmental feature vector.

[0040] Specifically, refer to Figure 3 As shown, this embodiment achieves dynamic prediction of the three-dimensional quality of agricultural products in the circulation process through a pre-constructed three-dimensional coupled prediction model. The core layer of the three-dimensional coupled prediction model includes a nutritional intrinsic evolution submodule, a sensory intrinsic evolution submodule, a safety intrinsic evolution submodule, a time-varying coupled matrix generation network, and a coupled differential equation system module. Wherein: (1) The intrinsic nutrient evolution submodule is used for: Based on the Arrhenius modified equation, the intrinsic trophic variation rate is calculated according to the trophic feature vector and the ambient temperature in the environmental data.

[0041] For example, the nutrient feature vector Vn can be used as a reference value for the initial nutrient state. Furthermore, using the trophic state value N(t) at the current integration step in the RK4 (fourth-order Runge-Kutta method) solver and the ambient temperature T(t) as input, the intrinsic trophic rate of change is calculated based on the Arrhenius modified equation. The output is then sent to the coupled differential equations module to be solved as eigenterms of the trophic dimension.

[0042] It is understandable that the Arrhenius equation can describe the effect of temperature on the degradation rate of nutrients. Its frequency factor A and activation energy Ea are learnable parameters, with initial values ​​ranging from 1 × 10⁻⁶. 3 ~1×10 8 The parameters 10~100kJ / mol are optimized along with all other network weights via gradient descent during the end-to-end joint training of the entire 3D coupled prediction model.

[0043] Preferably, a temperature correction coefficient can be introduced to improve the sensitivity of the temperature response. Therefore, the Arrhenius modified equation can be expressed in the following form: ; in, Indicates the rate of change in intrinsic nutritional characteristics; The value represents the predicted intrinsic nutritional value at time t; A represents the frequency factor (also known as the pre-exponential factor), which is a constant related to the collision frequency of reactant molecules; Ea represents the activation energy, the energy barrier that needs to be overcome for the reaction to occur; R represents the gas constant, which is 8.314 J / (mol·K); T(t) represents the absolute temperature at time t (in Kelvin) calculated based on the ambient temperature. This represents the temperature correction factor, which is a learnable parameter; and The initial value is set to 0, and the reasonable range of values ​​is [-3, +3]. Its physical meaning is to compensate for the temperature difference between the sensor installation location and the actual core temperature of the product.

[0044] (2) The sensory intrinsic evolution submodule is used for: Based on a pre-defined dual-layer stacked LSTM network, the intrinsic sensory change rate is obtained according to the sensory feature vector, the ambient temperature and humidity in the environmental data, and the pre-collected sensory historical feature sequence. The first layer of the dual-layer stacked LSTM network is used to arrange the sensory feature vector and the sensory historical feature sequence in chronological order, and concatenate them with the environmental temperature and humidity corresponding to each time point to perform time-by-time temporal coding; the second layer of the dual-layer stacked LSTM network is used to process the temporal features according to the temporal coding results output by the first layer to calculate the hidden state, and obtain the sensory intrinsic change rate by linearly mapping the hidden state.

[0045] It can be understood that the sensory feature vector represents the sensory quality status of agricultural products at the current moment, and the sensory history feature sequence is formed by arranging the sensory history feature vectors of multiple historical moments before the current moment in chronological order. Together, they constitute the temporal input sequence of the double-layer stacked LSTM network.

[0046] For example, the sensory feature vector Vs is used as the initial sensory state reference value S(0), and the current temperature T, humidity H, and the sensory history feature sequence Hs(t) of the previous 24 hours are used as the reference values. t 23 ,s t 22 ,…,s t [ ] is the input, and each st-i in Hs(t) is a 128-dimensional sensory feature vector output at time ti; the sensory intrinsic rate of change d is output through a two-layer stacked LSTM network. / dt and the 64-dimensional hidden state hs(t); where d / dt is transmitted to the coupled differential equation module for solution; hs(t) is transmitted to the time-varying coupled matrix generation network after dimensionality reduction by the linear projection layer (64→16).

[0047] Preferably, the sensory intrinsic evolution submodule uses a two-layer stacked LSTM network to model the temporal evolution process of sensory features. The number of hidden units in each layer of the LSTM network is set to 64, and the time step is set to 24, corresponding to a 24-hour sensory history feature sequence.

[0048] The core mechanism of LSTM networks lies in the selective memorization and forgetting of temporal information through a gating structure. The first-layer LSTM network processes the input sequence time-by-time, outputting the hidden state at each time step. This output serves as the input to the second-layer LSTM network at the corresponding time step, allowing the second-layer network to calculate its own hidden state. Specifically, at each time step, each LSTM network updates its state according to the following formula: Input Gate: ; Forgotten Gate: ; Output gate: ; Candidate memory cells: ; Memory cell renewal: ; Implicit state output: ; Where, x t Input for the current moment (e.g., a sensory history sequence of the previous 24 hours); h t Let represent the latent state at the current time step; ⊙ represent the Hadamard product; σ represent the Sigmoid activation function; W and b are trainable weight matrices and bias terms, respectively. Furthermore, to prevent overfitting, a Dropout layer is added between the two LSTM layers. The output of the first layer is fed into the second layer after passing through a Dropout layer with a dropout rate of 0.3, and the parameters of the two layers are not shared.

[0049] Furthermore, during the training phase of the dual-layer stacked LSTM network, a multi-step prediction method is adopted. The sensory history feature sequence Hs(t) of the previous 24 hours is input and processed in 24 steps along the time dimension. The hidden state h of the last step is then taken. 24 Starting from the initial state, continue rolling the prediction for 48 steps to output the complete sensory rating prediction sequence: The derivative of the output sequence with respect to time t is the rate of change of the sensory intrinsic characteristics, d. / dt. Meanwhile, the hidden state hs(t) output by the LSTM network at each time step is not only used to predict the sensory value at the next time step, but also serves as the input feature of the time-varying coupled matrix generation network.

[0050] Furthermore, in the inference phase (RK4 integration loop) of the dual-layer stacked LSTM network, the LSTM network is invoked differently than in the training phase. Since the RK4 integration step size Δt = 0.1 hours, and the time-varying coupling coefficient matrix C(t) needs to be recalculated based on the latest state in each integration step, the dual-layer stacked LSTM network needs to re-execute a complete forward propagation in each integration step to output the sensory intrinsic change rate d required for the current integration step. Instead of generating predictions for all future steps at once, the predictions are generated in the form of / dt.

[0051] For example, within each RK4 integration step t, the sensory history feature sequence hs(t) up to the current time t is read from the cache, input into the double-layer stacked LSTM network and processed in 24 steps along the time dimension, and the hidden state h of the last step is taken. 24 The sensory intrinsic change rate d is mapped to the current integration step through a trainable linear projection layer (64→16). / dt. This value, along with the intrinsic nutrient rate of change and the intrinsic safety rate of change, is then input into the time-varying coupling matrix generation network to calculate the time-varying coupling coefficient matrix C(t) for the current integration step.

[0052] (3) The security intrinsic evolution submodule is used for: Based on the preset Gompertz model, the maximum specific growth rate and lag period are obtained according to the ambient temperature and humidity in the environmental data. The safety quality status is obtained based on the safety feature vector, and the number of microorganisms is calculated by reverse calculation based on the safety quality status and the preset maximum number of microorganisms. The rate of change of the number of microorganisms is calculated based on the number of microorganisms, the maximum specific growth rate, and the lag period, and the rate of change of the intrinsic safety feature is obtained.

[0053] For example, using the safety eigenvector Vf as the initial safety state F(0), and taking the current temperature T, humidity H, and the safety quality state F(t) of the current integration step in the RK4 solver as input, the output safety intrinsic rate of change is calculated. The result is then transmitted to the coupled differential equations module for solving.

[0054] It is understood that this embodiment describes the microbial growth curve based on the Gompertz model. The core parameter of the Gompertz model, namely the maximum specific growth rate... and delay period It is generated by two independent lightweight neural networks, both of which are single-hidden-layer fully connected networks, for example, with 16 hidden layer neurons and the activation function ReLU. The network input features are the normalized values ​​of the current temperature T and humidity H, and the output is mapped to a reasonable range by the Sigmoid function: maximum specific growth rate μmax∈[0.01,0.5], lag period λ∈[0,48] (unit: hours).

[0055] In some implementations, based on the current safety quality status F(t) and the maximum number of microorganisms To infer the current number of microorganisms, the formula includes: ; To convert the microbial change rate into a safety and quality status change rate, the safety and quality status... Defined in the following form: ; Furthermore, the rate of change in microbial population was calculated using the Gompertz model: ; in, The value represents the rate of change in the number of microorganisms; M(t) represents the number of microorganisms at time t. Indicates the maximum specific growth rate; Indicates the delay period; This represents the maximum number of microorganisms when their growth reaches a stationary phase; e represents the natural constant. Furthermore, the rate of change of the safety intrinsic eigenvalue is calculated according to the following formula: ; in, This represents the rate of change of the intrinsic safety features.

[0056] Therefore, the aforementioned intrinsic nutrient change rate, intrinsic sensory change rate, and intrinsic safety change rate are respectively input into the differential equations corresponding to each dimension in the solver of the coupled differential equation system module, as intrinsic terms of their respective dimensions, and then superimposed with the coupling correction term to participate in the iterative solution of the current integration step.

[0057] (4) The time-varying coupled matrix generation network is used for: The coupling coefficients are dynamically calculated based on the current real-time state within each RK4 (fourth-order Runge-Kutta method) integration step, instead of using fixed values ​​or offline calibration.

[0058] Preferably, constructing the time-varying coupling coefficient matrix includes: obtaining the nutrient state vector, sensory state vector, and safety state vector of the current step based on the nutrient intrinsic change rate, sensory intrinsic change rate, and safety intrinsic change rate, and constructing first-order and second-order difference terms corresponding to each current step state vector respectively; concatenating the nutrient state vector, sensory state vector, safety state vector, each of the first-order and second-order difference terms, the hidden states calculated by the double-layer stacked LSTM network, and the environmental feature vector of the current step to obtain a one-dimensional feature input vector, and constructing the time-varying coupling coefficient matrix based on the one-dimensional feature input vector.

[0059] For example, the input to the time-varying coupled matrix generation network includes: the current nutritional state vector N, sensory state vector S, and safety state vector F (from the current step of the RK4 solver); the first-order difference terms dN / dt, dS / dt, dF / dt, and the second-order difference terms d²N / dt², d²S / dt², d²F / dt² corresponding to the current step state vectors of each dimension; the hidden state hs(t); and the environment vector E(t), which defines the environment feature vector at time t as E(t) = [T(t), H(t)], where T(t) is the absolute temperature at time t, and H(t) is the relative humidity at time t. The output of the time-varying coupling matrix generation network includes a 3×3 coupling coefficient matrix C(t), with 0 on the diagonal and 6 values ​​in the [0,1] interval on the off-diagonal. The coupling coefficient matrix C(t) is then output to the RK4 solver of the coupled differential equation module to calculate the coupling correction term for the current integration step. The coupling correction term is added to the eigenrate rates of change of the three dimensions to obtain the complete rate vector of change for each dimension, which is then used by the RK4 solver to advance to the next integration step.

[0060] Preferably, the construction of input features for the time-varying coupled matrix generation network specifically includes: First, at the current integration step t, the state vector and the first-order difference term are calculated numerically; for example, the first-order difference term corresponding to the nutrient state vector at the current step is calculated as follows: ; Where N(t) is the current nutrient state vector obtained from the RK4 solver; N(t-Δt) is the nutrient state vector saved when the coupled network was last called (i.e., the previous RK4 integration step); Δt = 0.1 hours; similarly, dS / dt and dF / dt are calculated, which will not be elaborated here.

[0061] Secondly, the second-order difference term is obtained by further difference of the first-order difference term; for example, the second-order difference term corresponding to the nutrient state vector of the current step is calculated as follows: ; Similarly, the calculations of d²S / dt² and d²F / dt² are not elaborated here; In this embodiment, the second-order difference term is used to capture the acceleration or deceleration trend of the quality decay rate, such as the accelerated decay when microorganisms enter the logarithmic growth phase; thereby enabling the coupled network to adjust the coupling coefficient in advance before the rate of change changes.

[0062] Finally, the aforementioned nutritional state vector N(t), sensory state vector S(t), safety state vector F(t), the first-order difference terms dN / dt, dS / dt, dF / dt and the second-order difference terms d²N / dt², d²S / dt², d²F / dt², hs(t) corresponding to the current step state vectors of each dimension, and the environmental feature vector E(t) are concatenated into a one-dimensional feature vector and subjected to layer normalization to obtain the one-dimensional feature input vector of the time-varying coupled matrix generation network.

[0063] Preferably, the time-varying coupling matrix generation network adopts a 3-layer fully connected structure, with 128, 64, and 6 neurons in each layer, respectively. The weights are initialized uniformly using Xavier, the bias term is initialized to 0, the activation function of the intermediate layers is LeakyReLU (negative slope 0.01), and the output layer uses the Softplus activation function (expressed as ln(1+e...). x Ensure the coupling coefficients are positive. After output, perform a hard truncation operation: c = min(c, 1). The diagonal elements of the time-varying coupling coefficient matrix C(t) are forcibly set to 0, and the off-diagonal elements are filled with the 6 values ​​output by the network in sequence (corresponding to c). ns c nf c sn c sf c fn c fs The time-varying coupling coefficient matrix is ​​represented in the following form: ; Among them, c ns (t) represents the intensity of the influence of sensory state on nutritional state; c nf (t) represents the intensity of the effect of the safe state on the nutritional state; c sn (t) represents the intensity of the effect of nutritional status on sensory status; c sf (t) represents the intensity of the effect of the safe state on the sensory state; c fn (t) represents the intensity of the influence of nutritional status on safety status; c fs (t) represents the strength of the influence of sensory state on safety state.

[0064] Preferably, the time-varying coupled matrix generation network adopts an end-to-end joint training mechanism. Its training process is not independent but is jointly optimized end-to-end with the entire prediction model. During training, batches (sets of samples processed at one time during training) are constructed according to time windows. Each batch contains multi-source sensory data and corresponding measured quality labels of the same batch of agricultural products within a continuous time window. During forward propagation, the RK4 solver uses the current coupled network output C(t) to integrate from t0 to t0+W, obtaining the predicted trajectory, i.e., the nutritional state vector N(t), sensory state vector S(t), and safety state vector F(t). During backpropagation, the error gradient is backpropagated to each layer of the coupled network weights via the complete computational graph of the RK4 solver. Since each state update step of RK4 involves algebraic operations on the coupled network output C(t), the gradient can be propagated back step-by-step along the integration time chain, thereby achieving end-to-end optimization of the coupled network weights.

[0065] Step S3: Based on the nutritional feature vector, sensory feature vector, safety feature vector, rate of change of nutritional intrinsic features, rate of change of sensory intrinsic features, rate of change of safety intrinsic features, and time-varying coupling coefficient matrix, construct a set of coupled differential equations and solve for the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector at future time moments.

[0066] Specifically, a fourth-order Runge-Kutta method was used for numerical integration with a time step Δt = 0.1 hours. The RK4 solver, coupled with the differential equations module, was used to solve the equations based on the initial nutritional reference values ​​N(0) = Vn, the initial sensory reference values ​​S(0) = Vs, the initial safety reference values ​​F(0) = Vf, and the intrinsic nutritional rate of change. , rate of change of sensory intrinsic characteristics Safety intrinsic change rate By combining the time-varying coupling coefficient matrix C(t), we can obtain the trajectories and the rates of change of each dimension of the nutritional state vector N(t), sensory state vector S(t), and safety state vector F(t) at future time points.

[0067] Therefore, by adding the intrinsic rates of change (evolving independently) of the three dimensions to the coupling correction terms (influenced by each dimension) using a system of coupled differential equations, the final total rate of change is obtained; the system of coupled differential equations is expressed in the following form: ; in, This represents the total rate of change of the comprehensive nutritional state vector, sensory state vector, and safety state vector; , , These represent the rates of change in nutritional intrinsic characteristics, sensory intrinsic characteristics, and safety intrinsic characteristics, respectively. represents a 3×3 time-varying coupling coefficient matrix; N, S, and F represent the nutritional state vector, sensory state vector, and safety state vector, respectively.

[0068] In practice, the specific solution process includes: using the nutritional feature vector, sensory feature vector, and safety feature vector as the initial state, and substituting the nutritional intrinsic rate of change, sensory intrinsic rate of change, safety intrinsic rate of change, and time-varying coupling coefficient matrix into the coupled differential equation system; using the RK4 solver to perform iterative numerical integration on the coupled differential equation system to obtain the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector at future time steps.

[0069] In other words, the iterative numerical integration of the coupled differential equations using the RK4 solver includes: Within each integration step, the RK4 solver obtains an estimate of the overall rate of change for the current integration step based on the state value and environmental data. The state value of the current integration step is then added to the product of the estimated overall rate of change and the integration step size to update the state value for the next integration step. Simultaneously, within each integration step, first-order and second-order differences are calculated based on the state value of the current integration step. These first-order and second-order differences, along with the intrinsic rates of change, latent states, and environmental data for each dimension, are input into the coupling network. The coupling network outputs the time-varying coupling coefficient matrix for the current integration step. The time-varying coupling coefficient matrix is ​​multiplied by the current state vector or intrinsic rate of change vector to obtain a coupling correction term. This coupling correction term is then added to the intrinsic rates of change for each dimension to obtain the complete rates of change for each dimension, which are then used by the RK4 solver to advance the integration for the next time step. This process is repeated iteratively until the integral step reaches a preset future time. The state values ​​of each dimension corresponding to that time are then used as the nutritional state prediction vector, sensory feature prediction vector, and safety feature vector.

[0070] In some implementations, the initial time N(0) = =Vn, but after t>0 The difference between N(t) and N(t) lies in the fact that the former represents the pure eigenvalue without coupling effects, while the latter represents the final value after coupling correction. Within each integration step, the first-order difference terms dN / dt, dS / dt, and dF / dt are used for RK4 integration to update the state values, obtaining the sensory state values ​​for the next time step. ; Similarly, the above formula applies to the calculation of state values ​​for sensory and safety dimensions.

[0071] Furthermore, the second-order difference terms d²N / dt², d²S / dt², and d²F / dt² are used as input features of the coupled network to generate the time-varying coupling coefficient matrix C(t) of the current integration step, in order to calculate the coupling correction term. Together with the first-order difference terms, they form the complete rate of change, which is then used by RK4 integration to update the state value at the next time step.

[0072] For example, within each RK4 integration step, the computation order of each intrinsic evolution submodule and the coupled differential equation system module is as follows: (1) Based on the current temperature T, the intrinsic trophic evolution submodule calculates the rate of change of intrinsic trophic ... ; (2) The two-layer stacked LSTM network calculates the sensory intrinsic change rate based on the current S(t) and the environmental feature vector E(t). At the same time, hs(t) is output; (3) The security intrinsic evolution submodule calculates μ based on the current T and H. max Substituting (T,H) and λ(T,H) into the derivative of the Gompertz model, we can calculate the rate of change of the secure intrinsic eigenvalues. ; (4) Input the intrinsic rates of change of the above three dimensions with the current N, S, F, first-order difference term, second-order difference term, hs(t), and E(t) into the coupling differential equation module to generate C(t); (5) Add each intrinsic rate of change to the coupling term to obtain the complete rate of change vector for use in the next time step calculation of RK4.

[0073] Preferably, the boundary conditions for solving the coupled differential equations can be set as follows: N(t)≥0, S(t)≥0, F(t)∈[0,1]. When the state value of any dimension exceeds the preset boundary during the iteration process, it is forcibly truncated to the corresponding boundary value, and a "model prediction anomaly" prompt message is issued. At the same time, the rate of change data of each dimension is recorded in real time during the solution process for subsequent quality degradation contribution analysis.

[0074] Therefore, by quantifying the mutual influence between dimensions in real time through the time-varying coupling matrix C(t), it is possible to capture complex synergistic effects such as "accelerated sensory deterioration due to microbial proliferation"; the coupled dynamic model based on differential equations deeply integrates mechanistic equations such as the Arrhenius equation and the Gompertz model with the LSTM data-driven network, which has both physical interpretability and complex pattern learning capabilities.

[0075] Step S4: Calculate the comprehensive quality score of agricultural products based on the nutritional status prediction vector, sensory status prediction vector, and safety status prediction vector, and output an intelligent prediction report of the three-dimensional quality of agricultural products.

[0076] Specifically, the comprehensive quality score of the target agricultural product within the predicted future time window can be calculated based on the nutritional status prediction vector, sensory status prediction vector, and safety status prediction vector obtained from the above calculation, so as to output the remaining shelf life and risk level.

[0077] Preferably, the adaptive selection of the prediction time window includes: dynamically setting the prediction time window length W according to the type of agricultural product and the current environmental conditions. For perishable agricultural products (such as strawberries and leafy vegetables), the default window is set to 48 hours; for storable agricultural products (such as apples and potatoes), the default window is set to 168 hours. Simultaneously, when the ambient temperature exceeds a threshold (such as 25℃) or the microbial activity index increases at a rate exceeding 0.1 for three consecutive hours, the window is automatically shortened to 24 hours to improve early warning sensitivity. The window length is used as the upper limit of integration during model solving and is iteratively calculated using the fourth-order Runge-Kutta method.

[0078] Furthermore, the overall quality score Q(t) is defined as a weighted nonlinear combination of the predicted values ​​of the three dimensions: nutrition, sensory appeal, and safety; the overall quality score of the agricultural product is calculated according to the following formula: ; Where Q(t) represents the comprehensive quality score of agricultural products at time t; N(t), S(t), and F(t) represent the nutritional state vector, sensory state vector, and safety state vector at time t, respectively; N(0), S(0), and F(0) represent the initial nutritional state reference value, the initial sensory state reference value, and the initial safety state reference value, respectively. The normalized value is taken from the first measurement at the time of entry into the warehouse of this batch of agricultural products. If the measurement is not taken at the time of entry into the warehouse, the statistical mean of the historical data of the same category is taken. , , These represent the weighting coefficients for nutritional status, sensory status, and safety status, respectively. , , These are nonlinear sensitivity indices representing nutritional status, sensory status, and safety status, respectively.

[0079] Among them, the weighting coefficient , , Based on the pre-defined consumption scenarios for agricultural products, such as higher sensory weighting in fresh food scenarios and higher nutritional weighting in processed raw material scenarios, and satisfying wn+ws+wf=1; index , , The value range of is [0.5, 2], which is used to characterize the nonlinear sensitivity of decay in each dimension and can be learned through historical data; the score range of Q(t) is 0 to 100, and the higher the score, the better the overall quality.

[0080] Preferably, the overall quality score is divided into five risk levels, with thresholds preset based on agricultural product categories and industry standards, and users are allowed to customize these levels. Specifically, this includes: Steady state (Level I): Q(t)≥85, excellent quality, no warning; Fluctuation Warning (Level II): 70≤Q(t)<85, quality begins to fluctuate, it is recommended to strengthen monitoring; Initial risk (Level III): 55≤Q(t)<70, quality deterioration accelerates, it is recommended to prioritize sales or short-chain delivery; Moderate risk (Level IV): 40≤Q(t)<55, quality has declined significantly, triggering a suspension of circulation review; High risk of corrosion (Level V): Q(t) < 40, quality is unacceptable, and must be removed from shelves or destroyed.

[0081] For specific agricultural products (such as ingredients for infant food), the overall threshold level can be increased (for example, the lower limit of the stable state can be adjusted to 90).

[0082] Preferably, the method further includes: determining the remaining shelf life of the agricultural product based on the nutritional status prediction vector, sensory status prediction vector, safety status prediction vector, and overall quality score at future time points. For example, the remaining shelf life R is defined as the period from the current time t0 until the overall quality score first drops to an acceptable threshold Q. acc The time length. Acceptable thresholds are set according to sales channels (e.g., 75 for premium supermarkets, 60 for general retail, and 50 for processed raw materials). The three-dimensional coupled prediction model predicts within the prediction interval [t0, t0...]. +W The search within the RK4 integral results uses the search to find the condition Q(t) ≤ Q. acc If the minimum value t is not reached within the window, the prediction is extended by extrapolation until the threshold is reached. Simultaneously, during the inference phase, all Dropout layers remain active, and random deactivation sampling is performed on the model weights (such as all weight matrices and bias terms of the feature extraction network, cross-modal attention alignment network, double-layer stacked LSTM network, and time-varying coupling matrix generation network). The same input sample is repeatedly predicted 100 times forward, and the 2.5% and 97.5% quantiles are used as the 95% confidence interval. The mean of the remaining shelf life and the 95% confidence interval are calculated to quantify the prediction uncertainty.

[0083] Furthermore, embodiments of the present invention also include an intervention simulation mechanism to support managers in conducting rapid assessments. Specifically, this includes setting up an intervention effect simulator, allowing managers to input hypothetical environmental control measures, including but not limited to cooling to a specified temperature, introducing modified atmosphere gas, and applying antibacterial agents; subsequently, in response to the input control measures, the environmental parameter E(t) can be replaced with the set value after the intervention, and the RK4 integration can be restarted based on the current state value to quickly generate the predicted change in the remaining shelf life after the intervention.

[0084] During the simulation, if the control measures involve temperature changes, then temperature T will alter the temperature term T(t) in the Arrhenius correction equation; if the control measures involve temperature / humidity changes, then T and H will change the input f of the parameter generation network in the Gompertz model. μ (T,H), f λ (T,H), thereby updating the output parameter μ max And λ; at the same time, changes in environmental parameters can also change the input conditions of the time-varying coupling matrix generation network. For example, changes in T or H cause the time-varying coupling coefficient matrix C(t) to be updated synchronously.

[0085] Preferably, the embodiments of the present invention further include a risk contribution analysis mechanism, specifically including: based on the real-time recorded change rates (dN / dt, dS / dt, dF / dt) of each dimension and the coupling coefficients c between each dimension during the RK4 solution process. ab (t) Contribution decomposition is performed to determine the percentage of risk contribution. Specifically, at each time point, the proportion of the rate of change of each dimension itself and the rate of change affected by the coupling of other dimensions to the total rate of change is calculated. Then, the proportion is integrated and averaged over the prediction time window to obtain the percentage of contribution of the three dimensions of nutrition, sensory function, and safety to quality degradation.

[0086] In some preferred embodiments, the intelligent prediction report of the three-dimensional quality of agricultural products is output in JSON format via a RESTful API interface for use by the upper-level management platform. It also supports real-time push via the WebSocket protocol, proactively pushing early warning information to the administrator terminal when the risk level changes or the predicted remaining shelf life falls below a preset threshold. The output data of the intelligent prediction report includes at least the following fields: timestamp, batch ID, prediction sequences for each dimension, comprehensive score sequence, risk level, remaining shelf life and confidence interval, and risk contribution percentage.

[0087] In some preferred embodiments, the method further includes: dynamically optimizing the model parameters of the three-dimensional coupled prediction model through a dual-loop self-correction mechanism.

[0088] For example, continue to refer to Figure 2As shown, the dual-loop self-correction mechanism comprises two levels: an inner loop and an outer loop. The inner loop is an online adaptive loop that uses an unscented Kalman filter algorithm to correct key parameters in the model in real time. The outer loop is an incremental learning loop that uses a physical information neural network to periodically retrain the overall 3D coupled prediction model. Specifically, it includes: First, the inner loop (online adaptive) circuit: Unscented Kalman filtering (UKF) is used instead of extended Kalman filtering to handle highly nonlinear coupled systems. Its state vector (i.e., the parameter vector to be estimated) is represented as follows: x = [PCA1, PCA2, ..., PCA...]. 10 ,A,Ea,μ max ] T The dimension is 13.

[0089] Among them, PCA1 to PCA 10 The first 10 principal components of the network weights are generated by the time-varying coupling matrix. The mechanistic model parameters A and Ea are the parameters of the Arrhenius correction equation, μ... max This is the current estimate of the maximum specific growth rate of the Gompertz model. Furthermore, the unscented Kalman filter calculates the Kalman gain using the residuals between the observed vector (measured data) and the model's predicted output, thereby correcting prediction bias and optimizing the estimates of these parameters at the current time step, rather than directly modifying the N / S / F state variables themselves.

[0090] For example, the filter is updated every 3 hours. The specific execution steps include: (1) Generate 2n+1=27 Sigma points (n=13), distributed around the current state estimate, with each Sigma point carrying a set of parameter assumptions; (2) Substitute the parameters corresponding to each Sigma point into the three-dimensional coupled prediction model for forward calculation (including RK4 integration) to obtain 27 predicted observations; (3) Calculate the mean and covariance of the predicted observations; (4) Calculate the Kalman gain, update the state estimate with the latest measured value, and obtain the corrected parameter values.

[0091] Preferably, the observation vector includes the latest batch (e.g., 6 consecutive hours) of nutrient spectral data, microbial detection data, and measured sensory scores. The parameters (A, Ea, μ) are corrected by UKF. max The top 10 principal components of the weights of the time-varying coupling matrix generation network are fed back to the nutrition intrinsic evolution submodule, the sensory intrinsic evolution submodule, the safety intrinsic evolution submodule, and the time-varying coupling matrix generation network to update the model parameters of each module at the current time.

[0092] Second, the outer loop (incremental learning) circuit: The outer ring adopts the Physical Information Neural Network (PINN) paradigm to achieve incremental learning. The Physical Information Neural Network is not an independent network module, but a training paradigm that uses prior physical laws such as the Arrhenius modified equation and the Gompertz model as soft constraints to embed into the model training process. It acts on the entire three-dimensional coupled prediction model (including feature fusion network, each intrinsic evolution sub-module and time-varying coupling matrix generation network, etc.).

[0093] Preferably, the total loss function of the physical information neural network includes: ; Among them, L total L is the total loss function; data For data loss; λ is the dynamic balance coefficient; L physics This represents the loss due to physical constraints.

[0094] Furthermore, data loss L data Calculate using the following formula: ; Where N is the total number of samples in the batch; N represents the nutritional quality status value predicted by the model for the i-th sample; i The measured value of the nutritional quality status of the i-th sample is given; the calculation of data loss for the sensory and safety dimensions is similar and will not be elaborated here.

[0095] Furthermore, the physical constraint loss L physics Calculate using the following formula: ; Among them, L physics Loss due to physical constraints; This represents the total rate of change of the nutrient dimension in the coupled differential equation system; The rate of change of intrinsic nutritional characteristics; This represents the total rate of change of the safety dimension in the coupled system of differential equations; For safety, intrinsic rate of change.

[0096] The derivative of the first term constraining the nutrient intrinsic evolution submodule is consistent with the Arrhenius modified equation, while the derivative of the second term constraining the safety intrinsic evolution submodule is consistent with the derivative of the Gompertz model. The two-layer stacked LSTM network of the sensory intrinsic evolution submodule is purely data-driven and does not impose physical constraints.

[0097] Preferably, the balance coefficient λ of the total loss function of the physical information neural network is initially set to 0.1, and dynamically adjusted according to the performance on the validation set. physicsIf the proportion of loss exceeds 30% of the total loss, λ increases by 0.05; if it is less than 5%, λ decreases by 0.02. The search for the differentiable equation structure employs the DARTS soft maximum weighting strategy, with candidate operations including additive coupling, multiplicative coupling, and saturation coupling, performed once every 10 batches. Thus, through this dual-loop self-correction mechanism, the three-dimensional coupled prediction model can continuously evolve with the environment and data.

[0098] In some preferred embodiments, refer to Figure 2 As shown, the method further includes: uploading the prediction results of the three-dimensional quality of agricultural products and traceability data to a centralized management platform, and generating a three-dimensional quality digital passport by combining blockchain technology.

[0099] For example, an intelligent prediction report containing the percentage of risk contribution, prediction sequences for each dimension, remaining shelf life, and a 95% confidence interval, along with the aforementioned intervention simulation data and actual feedback, is uploaded to a centralized management platform. This management platform generates a three-dimensional quality digital passport, recording the nutrient retention rate curve, sensory evaluation trajectory, safety testing reports, environmental history, and predicted remaining shelf life, which is then uploaded to the blockchain for consumers to verify via QR code.

[0100] Preferably, the passport data is stored in JSON-LD format and includes the following fields: agricultural product ID, variety, origin, harvest time, quality prediction curves for each dimension (time series array), key warning times and reasons, risk contribution percentage, list of intervention suggestions, and blockchain transaction hash value. Simultaneously, it supports dynamic rendering of quality change trend charts on the front end after consumers scan the QR code, and allows clicking on any time point to view detailed indicators.

[0101] To facilitate understanding of the intelligent prediction method for three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling of the present invention, a specific embodiment is provided below; the main implementation steps are as follows: (1) Multi-source data acquisition: When strawberries are put into storage, a multi-source sensing and data acquisition terminal is configured to synchronously acquire the following data: Nutritional data: Strawberries were scanned using a hyperspectral imaging system (400-1000nm), and the vitamin C content was determined by inverting the reflectance.

[0102] Sensory data: The color and surface defect area of ​​strawberries were collected using an RGB-D camera; the response intensity of ethyl acetate (aroma) and hexanal (rotten odor) was detected using an electronic nose; and the firmness of strawberries was measured using a microtexture analyzer.

[0103] Safety indicator data: Mold activity is monitored using a rapid microbial detection device based on impedance method.

[0104] Environmental data: Temperature (12±2℃) and humidity (85±5%RH) of the storage environment are recorded in real time using temperature and humidity sensors.

[0105] (2) Data processing and feature fusion: The collected multi-source data is preprocessed, including using minimum noise separation transform to remove noise from hyperspectral images and using minimum-maximum normalization to normalize the data of each channel. The preprocessed data is then input into a cross-modal attention alignment network to generate a unified three-dimensional feature vector set Vn, Vs, and Vf, corresponding to the feature representations of nutrition, sensory, and safety dimensions, respectively.

[0106] (3) Three-dimensional coupled prediction model prediction: The processing operations of the three-dimensional coupled prediction model in this embodiment include at least the following: Nutritional intrinsic evolution submodule: Degradation kinetics of vitamin C are described based on the Arrhenius equation; end-to-end joint training yields A = 2.3 × 10⁻⁶. 6 Ea = 45 kJ / mol.

[0107] Sensory intrinsic evolution submodule: Based on a two-layer stacked LSTM network, this module predicts the temporal changes in color, odor, and hardness. The network input is the sensory feature sequence Hs(t) of the previous 24 hours, and the output is the predicted sensory rating for the next 48 hours. And its implicit state hs(t). Wherein, the rate of change of sensory intrinsic characteristics d / dt by The derivative with respect to time t yields the result.

[0108] The intrinsic safety evolution submodule describes mold growth curves based on the Gompertz model. max And λ are generated by a small neural network f μ (T,H), f λ (T,H) are dynamically generated based on real-time temperature and humidity. Actual safety index data are obtained using F(t)=1-M(t) / M max This is mapped to a safety and quality status.

[0109] Time-varying coupling matrix generation network: In each RK4 integration step, it receives N(t), S(t), F(t), dN / dt, dS / dt, dF / dt, hs(t), and the environment vector E(t). After layer normalization, it is input into a 3-layer fully connected network (128→64→6). The non-negative coupling coefficients c are output through the Softplus activation function. ns (t), c nf (t), c sn (t), c sf (t), c fn (t), c fs(t), which constitute the time-varying coupling coefficient matrix C(t).

[0110] Coupled differential equation solver: The fourth-order Runge-Kutta method is used for solving the system, with a time step Δt = 0.1 hours; the coupling coefficient is relatively small in the initial stage (c...). sf =0.1, c nf =0.05). When the ambient temperature rises to 15℃, the coupled network automatically changes c. sf Adjust to 0.6, c nf Adjusting the value to 0.3 accelerates the prediction of sensory deterioration and nutrient loss.

[0111] (4) Quality forecasting and risk output: The overall quality score change over the next 48 hours is predicted based on a three-dimensional coupled prediction model. Monte Carlo Dropout (100 samples) provides a 95% confidence interval for the remaining shelf life. For example, this embodiment predicts that strawberries will enter the initial risk stage after 24 hours, reach the moderate risk stage after 48 hours, and have a remaining shelf life of approximately 36 hours (95% CI: 32-40 hours); contribution analysis shows that the main source of risk is "microbial proliferation" (contribution 65%).

[0112] (5) Dual-loop self-correction mechanism: Inner loop (online adaptive): Receives nutritional index data, microbial test data, and sensory score measurements every 6 hours. Fine-tunes the weights of the coupled network using unscented Kalman filtering, focusing on the top 10 principal components and A, Ea, and μ. max The parameters are adjusted to make the predicted curve closely approximate the measured value.

[0113] Outer loop (incremental learning): After the batch is completed, the physical information neural network loss function L=L is calculated using the complete lifecycle data. data +λL physics The weights of the entire network are updated through backpropagation. Where L... physics The derivatives of the constrained intrinsic evolution submodule and the safety intrinsic evolution submodule are consistent with the mechanistic equations; λ is dynamically adjusted according to the validation set.

[0114] (6) Decision support and tracing: The centralized management platform indicated that the main risk source for this batch of strawberries was "microbial proliferation" (contributing 65%), and recommended prioritizing sales until they could reach stores within 24 hours. Platform simulations showed that "immediately cooling to 8°C" could extend shelf life by 30%. Simultaneously, a three-dimensional digital quality passport was generated, recording nutrient retention curves, sensory evaluation data, safety testing reports, environmental records, and predicted remaining shelf life, which was uploaded to the blockchain for consumers to verify via QR code.

[0115] (7) Experimental comparison results: The three-dimensional coupled prediction model using the method described in this embodiment of the invention is compared with a single-sensory prediction model based solely on an LSTM network. On the same dataset, the method improves the overall quality prediction accuracy by 22% after 24 hours and issues a moderate risk warning 6 hours in advance, verifying that the prediction accuracy of this embodiment of the invention is higher and has superior performance.

[0116] It is understood that the above embodiments are only for ease of understanding and simplification of description, and should not be construed as limiting the present invention. The present invention does not specifically limit the types of multi-source sensing data, the construction method of the three-dimensional coupled prediction model, the calculation method, etc.

[0117] Therefore, it can be seen that the embodiments of the present invention can achieve at least one of the following beneficial effects: (1) Full-dimensional coverage: For the first time, the three-dimensional indicators of nutrition, sensory experience and safety are incorporated into a unified prediction framework, which is more in line with actual consumer needs and food safety standards.

[0118] (2) Dynamic coupling for accurate prediction: By using a time-varying coupling matrix to quantify the mutual influence between dimensions in real time, it breaks through the limitations of static weighting and can capture complex synergistic effects such as accelerated microbial proliferation and sensory deterioration, thereby improving prediction accuracy.

[0119] (3) Mechanism and data fusion: The Arrhenius equation, Gompertz model and LSTM network are deeply combined to balance physical interpretability and complex pattern learning ability.

[0120] (4) Adaptive self-correction: The dual-loop mechanism enables the model to continuously evolve with the environment and data, ensuring the robustness of long-term deployment.

[0121] (5) Explainable decision traceability: Provides risk contribution analysis, intervention simulation and tamper-proof digital quality passport to provide a scientific basis for agricultural product supply chain management.

[0122] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0123] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for intelligent prediction of three-dimensional quality of agricultural products based on multi-source sensing and dynamic coupling, characterized in that, include: Nutritional, sensory, safety, and environmental data of agricultural products are collected during the circulation process. After data processing and fusion, nutritional feature vectors, sensory feature vectors, safety feature vectors, and environmental feature vectors are obtained respectively. Based on the nutritional feature vector, sensory feature vector, and safety feature vector, the intrinsic nutrient change rate, intrinsic sensory change rate, and intrinsic safety change rate are obtained respectively, and combined with the environmental feature vector, a time-varying coupling coefficient matrix is ​​constructed. Based on the nutritional feature vector, sensory feature vector, safety feature vector, rate of change of nutritional intrinsic features, rate of change of sensory intrinsic features, rate of change of safety intrinsic features, and time-varying coupling coefficient matrix, a set of coupled differential equations is constructed and the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector for future time moments are solved. Based on the nutritional status prediction vector, sensory status prediction vector, and safety status prediction vector, the comprehensive quality score of agricultural products is calculated to output an intelligent prediction report of the three-dimensional quality of agricultural products.

2. The method according to claim 1, characterized in that, The data processing and fusion include: After performing spatiotemporal alignment and normalization preprocessing on the nutritional index data, sensory index data, safety index data, and environmental data, they are input into a preset Transformer multi-head cross-attention network and feature mapping and fusion of each index data are performed through a cross-modal attention mechanism to obtain the nutritional feature vector, sensory feature vector, safety feature vector, and environmental feature vector.

3. The method according to claim 2, characterized in that, The obtained rate of change in intrinsic nutritional characteristics includes: Based on the Arrhenius correction equation, the intrinsic trophic variation rate is calculated according to the trophic eigenvector and the ambient temperature in the environmental data; wherein the Arrhenius correction equation is expressed in the following form: ; in, Indicates the rate of change in intrinsic nutritional characteristics; The value represents the predicted intrinsic nutrient value at time t; A represents the frequency factor; Ea represents the activation energy; R represents the gas constant; T(t) represents the absolute temperature at time t calculated based on the ambient temperature. This represents the temperature correction factor.

4. The method according to claim 3, characterized in that, The obtained sensory intrinsic change rate includes: Based on a pre-defined dual-layer stacked LSTM network, the intrinsic sensory change rate is obtained according to the sensory feature vector, the ambient temperature and humidity in the environmental data, and the pre-collected sensory historical feature sequence. The first layer of the dual-layer stacked LSTM network is used to arrange the sensory feature vector and the sensory historical feature sequence in chronological order, and concatenate them with the environmental temperature and humidity corresponding to each time point to perform time-by-time temporal coding; the second layer of the dual-layer stacked LSTM network is used to process the temporal features according to the temporal coding results output by the first layer to calculate the hidden state, and obtain the sensory intrinsic change rate by linearly mapping the hidden state.

5. The method according to claim 4, characterized in that, The obtained safe intrinsic rate of change includes: Based on the preset Gompertz model, the maximum specific growth rate and lag period are obtained according to the ambient temperature and humidity in the environmental data. The safety quality status is obtained based on the safety feature vector, and the number of microorganisms is calculated by reverse calculation based on the safety quality status and the preset maximum number of microorganisms. The rate of change of the number of microorganisms is calculated based on the number of microorganisms, the maximum specific growth rate, and the lag period, and the rate of change of the intrinsic safety feature is obtained.

6. The method according to claim 5, characterized in that, The rate of change in the number of microorganisms is calculated according to the following formula: ; in, The value represents the rate of change in the number of microorganisms; M(t) represents the number of microorganisms at time t. Indicates the maximum specific growth rate; Indicates the delay period; This represents the maximum number of microorganisms when their growth reaches a stationary phase; e represents the natural constant. The rate of change of the safety intrinsic eigenvalue is calculated according to the following formula: ; in, This represents the rate of change of the intrinsic safety features.

7. The method according to claim 6, characterized in that, The construction of the time-varying coupling coefficient matrix includes: Based on the changes in the intrinsic nutritional characteristics, the intrinsic sensory characteristics, and the intrinsic safety characteristics, the nutritional state vector, the sensory state vector, and the safety state vector of the current step are obtained, and the first-order and second-order difference terms corresponding to each current step state vector are constructed respectively. Based on the current step's nutritional state vector, sensory state vector, safety state vector, each of the first and second order difference terms, the hidden state calculated by the double-layer stacked LSTM network, and the environmental feature vector, a one-dimensional feature input vector is obtained by concatenation, and the time-varying coupling coefficient matrix is ​​constructed based on the one-dimensional feature input vector.

8. The method according to claim 7, characterized in that, The coupled differential equations are expressed in the following form: ; in, This represents the total rate of change of the comprehensive nutritional state vector, sensory state vector, and safety state vector; , , These represent the rates of change in nutritional intrinsic characteristics, sensory intrinsic characteristics, and safety intrinsic characteristics, respectively. represents a 3×3 time-varying coupling coefficient matrix; N, S, and F represent the nutritional state vector, sensory state vector, and safety state vector, respectively.

9. The method according to claim 8, characterized in that, The process of solving for the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector at future time points includes: Using the nutritional feature vector, sensory feature vector, and safety feature vector as the initial state, and substituting the nutritional intrinsic rate of change, sensory intrinsic rate of change, safety intrinsic rate of change, and time-varying coupling coefficient matrix into the coupled differential equation system, the coupled differential equation system is iteratively numerically integrated using the RK4 solver to obtain the nutritional state prediction vector, sensory state prediction vector, and safety state prediction vector at future time steps.

10. The method according to any one of claims 1 to 9, characterized in that, The overall quality score of the agricultural products is calculated according to the following formula: ; Where Q(t) represents the comprehensive quality score of agricultural products at time t; N(t), S(t), and F(t) represent the nutritional state vector, sensory state vector, and safety state vector at time t, respectively; and N(0), S(0), and F(0) represent the initial nutritional state reference value, the initial sensory state reference value, and the initial safety state reference value, respectively. , , These represent the weighting coefficients for nutritional status, sensory status, and safety status, respectively. , , These are nonlinear sensitivity indices representing nutritional status, sensory status, and safety status, respectively.