Method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning
Patent Information
- Application Number
- CN202611105843.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-10-27
AI Technical Summary
[0002]做好油菜籽仓储品质管控,对保障其加工价值、种用性能及后续产品质量十分重要,在存放的阶段当中,油菜籽面临多种影响关键品质指标方面的风险:湿度太高会造成水分含量超标,加速发生霉变;温度与氧气条件不合适会抑制种子活力,造成发芽率明显下降;湿热积累以及微生物的活动能促进脂肪水解,造成游离脂肪酸含量攀升,从而加速油脂酸败发生,要是这些问题没有被有效管制,将对种植户的收益以及食用油产业原料稳定性带来较大影响
[0013](1)本发明打破了传统“先检测后判断”的被动模式,通过将数阶指数及动态模糊指数相结合,依据样本数据自主构建聚类中心矩阵作为等级基准,并输出劣变阶段隶属度作为物理先验。该方法能够基于历史演变规律预先判定未来品质等级的变化趋势,在劣变实际发生前启动干预,实现了从事后处理到事前主动预防的模式升级。
Smart Images

Figure CN122986571A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of agriculture and deep learning, specifically involving a method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning. Background Technology
[0002] Effective quality control during rapeseed storage is crucial for ensuring its processing value, seed performance, and the quality of subsequent products. During storage, rapeseed faces several risks affecting key quality indicators: excessive humidity can lead to excessive moisture content and accelerate mold growth; unsuitable temperature and oxygen conditions can inhibit seed vigor, resulting in a significant decrease in germination rate; and the accumulation of heat and moisture, along with microbial activity, can promote fat hydrolysis, causing a rise in free fatty acid content and accelerating rancidity. If these problems are not effectively controlled, they will have a significant impact on farmers' income and the stability of raw materials for the edible oil industry.
[0003] Currently, rapeseed storage quality control still faces prominent problems in practical applications. Traditional quality management mainly relies on manual sampling and experience-based judgment, which has drawbacks such as untimely sampling, long testing times, and significant subjective influence. It is difficult to promptly grasp the dynamic changes of key indicators, resulting in quality deterioration not being detected and intervened in the early stages. While sensors for temperature, humidity, oxygen, and carbon dioxide can be deployed in the storage environment, these devices mostly operate independently, resulting in a lack of ability to model correlations with quality indicators. Fusing and analyzing multi-source data is difficult, hindering in-depth analysis of quality evolution trends. Managers face massive amounts of heterogeneous testing data, making it difficult to quickly and accurately determine the quality grades of different batches and regions, and preventing targeted tiered control measures.
[0004] To improve the effectiveness and accuracy of rapeseed storage quality early warning, researchers have begun to introduce various intelligent technologies, including rule engines based on sensor data, machine learning, and deep learning. However, current prediction models and methods still face the following technical challenges when applied to rapeseed storage quality early warning: Model training heavily relies on idealized sample data collected in laboratory environments. In actual storage environments, the distribution of parameters such as temperature, humidity, and gas concentration is unpredictable, and noise interference is significant, resulting in poor generalization ability and a substantial decrease in prediction accuracy. Many models employ static learning structures, failing to update and adaptively adjust based on newly added online detection data during the storage process. Their ability to respond well to sudden deterioration events is also inadequate. Existing methods do not fully utilize multi-source heterogeneous sensor data fusion, lack feasible data cleaning and feature extraction methods, and struggle to uncover deep connections between different data sources. Most models only identify the state at a single point in time, lacking the ability to conduct long-term dynamic modeling of quality evolution trends, making it difficult to meet the practical requirements of tiered early warning and closed-loop control.
[0005] Intelligent early warning and response to rapeseed storage quality risk events is a unique and complex system problem. Current models and methods are still insufficient to effectively and accurately predict the storage quality status. There is a great need to develop more intelligent methods to improve the scientific nature and timeliness of rapeseed storage quality management, and drive the transformation from passive response to proactive early warning, and from experience-based prediction to data-driven regulation. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention employs a collaborative prediction and risk assessment method for rapeseed storage quality indicators based on deep learning.
[0007] In a first aspect, this invention proposes a collaborative prediction and risk assessment method for rapeseed storage quality indicators based on deep learning, the method comprising:
[0008] A standardized feature vector based on rapeseed storage quality indicators is constructed; the quality indicators include rapeseed moisture content, germination rate, and free fatty acid content; each quality indicator corresponds to multiple samples.
[0009] Multiple initial cluster centers are selected based on the K-means++ rule for initializing standardized feature vectors; fractional exponents of different quality indices are calculated; the ratio of the local variance of multiple samples to the variance of cluster centers is calculated, and the ratio is mapped to generate a dynamic fuzzy index using the Sigmoid function; the membership degree of the standardized feature vector to each cluster center is calculated using the fractional exponent and the dynamic fuzzy index; the cluster centers are iteratively optimized based on the membership degree using a momentum update formula containing an explicit damping term; the iteration continues until the objective function converges, and the cluster centers after the objective function converges are mapped to quality levels according to the order of quality, and the cluster center matrix carrying the quality level and the membership degree of the deterioration stage are output;
[0010] A time series prediction model is constructed. The membership degree of the deterioration stage and the standardized feature vector are concatenated and input into the time series prediction model. Finally, the final prediction sequence is output after time delay cross-correlation correction.
[0011] A dual-mode mixed distance metric function is constructed based on the cluster center matrix and the membership degree of the deterioration stage. Using the dual-mode mixed distance metric function, dynamic mixed weight coefficients are calculated based on the final predicted sequence. The mixed weighted distance from the final predicted sequence to each cluster center is calculated using the weight coefficients. The quality level of the cluster center corresponding to the minimum value of the mixed weighted distance is taken as the final quality level. When the final quality level reaches the preset risk level threshold, an early warning is triggered.
[0012] The beneficial effects of this invention are as follows:
[0013] (1) This invention breaks away from the traditional passive mode of "detecting first and then judging". By combining numerical index and dynamic fuzzy index, it autonomously constructs a cluster center matrix as a grade benchmark based on sample data and outputs the membership degree of the deterioration stage as a physical prior. This method can predict the future trend of quality grade changes based on historical evolution patterns and initiate intervention before the actual deterioration occurs, realizing a model upgrade from post-processing to pre-event proactive prevention.
[0014] (2) Addressing the challenges of noise interference in the warehousing environment and differences in the dynamic characteristics of indicators, this invention assigns independent fractional-order indices to each quality indicator during the clustering stage, constructs a time-series prediction model during the prediction stage, and introduces an adaptive hysteresis dead zone and a first-order inertial damping mechanism. These features enable the time-series prediction model to maintain the stability of membership during the deterioration stage when facing instantaneous fluctuations or local outliers, thereby reducing the false alarm and false negative rates at the source.
[0015] (3) This invention injects the membership degree of the deterioration stage obtained from clustering into the dual-mode hybrid distance metric function, and adaptively adjusts the ratio of Manhattan distance and Euclidean distance using dynamic hybrid weight coefficients. Simultaneously, by adaptively segmenting and focusing on segments with equal amplitude changes, dynamic modulation and amplitude enhancement of frequency position are achieved using learnable discrete cosine transform of amplitude and frequency, and the leading-lagging relationship between indicators is obtained based on time-delay cross-correlation channel correction. This three-domain collaborative mechanism enables the system to accurately determine the future quality level based on the hybrid weighted distance, achieving an improvement from single-indicator numerical prediction to multi-indicator graded early warning, significantly reducing the risk of storage quality loss. Attached Figure Description
[0016] Figure 1 This is a flowchart of a method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning, according to the present invention. Detailed Implementation
[0017] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0018] In some embodiments, such as Figure 1 This invention proposes a collaborative prediction and risk assessment method for rapeseed storage quality indicators based on deep learning. The method includes:
[0019] A standardized feature vector based on rapeseed storage quality indicators is constructed; the quality indicators include rapeseed moisture content, germination rate, and free fatty acid content; each quality indicator corresponds to multiple samples.
[0020] For example, time-series data of rapeseed quality indicators under different temperature and humidity conditions were collected during 112 days of storage. Environmental disturbances such as diurnal fluctuations in storage temperature and humidity, and instrument noise causing single-value jumps due to fluctuations in instrument sensitivity, led to short-term, irregular abrupt changes in rapeseed quality indicators. HP filtering was performed on the time-series data, decomposing it into a smooth sequence reflecting long-term deterioration trends and noise components representing short-term random fluctuations. This eliminated minor fluctuations caused by measurement errors and environmental disturbances, while retaining the overall upward or downward trend characteristics. Subsequently, the filtered sequence was length-normalized, and a uniform reference length was set. Sequences shorter than this length were padded with end values or linear interpolation to eliminate matching difficulties caused by inconsistent sequence lengths. Finally, a standardized feature vector with a fixed dimension was obtained, and Z-score standardization was performed to obtain the standardized feature vector.
[0021] Multiple initial cluster centers are selected based on the K-means++ rule for the initialization of standardized feature vectors; fractional exponents of different quality indices are calculated; the ratio of the local variance of multiple samples to the variance of cluster centers is calculated, and the ratio is mapped to generate a dynamic fuzzy index using the Sigmoid function; the membership degree of the standardized feature vector to each cluster center is calculated using the fractional exponent and the dynamic fuzzy index; the cluster centers are iteratively optimized based on the membership degree using a momentum update formula containing an explicit damping term; the iteration continues until the objective function converges, and the converged cluster centers are mapped to quality levels in order of quality superiority or inferiority, outputting a cluster center matrix carrying the quality level and the membership degree of the deterioration stage;
[0022] For example, initializing multiple initial cluster centers based on the K-means++ rule for standardized feature vectors includes: randomly selecting the standardized feature vector of a sample with equal probability from the standardized feature vectors as the first initial cluster center; calculating the distance between each sample that has not yet been selected as an initial cluster center and all currently selected initial cluster centers, taking the closest distance of each sample and constructing a probability distribution to filter the next initial cluster center; repeating the above steps to add initial cluster centers one by one until K initial cluster centers are selected.
[0023] For example, under different temperature and humidity storage conditions, the germination rate and free fatty acids of rapeseed exhibit a unidirectional convex degradation curve with cumulative variance increase, while the moisture content shows a mean-regression concave fluctuation sequence. Traditional distance metric formulas with a uniform order are prone to causing dynamic coupling distortion of quality indicators. Calculating fractional-order indices for different quality indicators involves: configuring learnable fractional-order indices for each quality indicator; based on the dynamic characteristics of each indicator's degradation, autonomously selecting a convex or concave function as the metric rule during model updates; if the standard deviation of the qual-th indicator shows a cumulative increasing or decreasing trend over time, the fractional-order index is initialized to less than 1; if the indicator exhibits mean-regression fluctuation characteristics, the fractional-order index is initialized to 1 to 2. The index is dynamically adjusted according to the data characteristics of different indicators, achieving a "one indicator, one strategy" nonlinear distance metric, eliminating coupling distortion and feature submersion problems generated during the clustering of multi-source heterogeneous indicators.
[0024] For example, during the stable storage period, the moisture content, germination rate, and free fatty acid content of rapeseed show relatively gradual changes, with a large number of transitional intermediate samples, making soft partitioning suitable for cluster analysis. During the rapid deterioration period, the moisture content, germination rate, and free fatty acid content change drastically, exhibiting a binary differentiation between safe and deteriorated conditions, making hard partitioning suitable for cluster analysis to ensure clear and reliable risk warnings. The calculation of the dynamic fuzzy index involves: eliminating the traditional fixed hyperparameter setting of 2, introducing the ratio of sample local variance to cluster center variance, and dynamically generating the dynamic fuzzy index through a Sigmoid mapping. When a sample is in the rapid deterioration stage, the dynamic fuzzy index approaches 1, and the membership degree automatically tends towards hard clustering to ensure the decisiveness of warning decisions. When a sample is in the stable storage period, the dynamic fuzzy index approaches 2, and the membership degree maintains soft clustering to preserve the natural uncertainty of grade transitions.
[0025] Understandably, the membership degree is jointly constrained by the ratio of time-domain variance and the fractional exponent of the index. The two work together to optimize during backpropagation and jointly drive the iterative evolution of cluster centers. This design enables the quality grade classification to not only reflect the current numerical distribution of multiple indicators, but also implicitly encode the differences in the rate of change of each indicator and the non-stationary fluctuation characteristics of the storage stage, providing fuzzy label support with physical interpretability and statistical robustness for time series prediction and dynamic early warning.
[0026] A time series prediction model is constructed. The membership degree of the deterioration stage and the standardized feature vector are concatenated and input into the time series prediction model. Finally, the final prediction sequence is output after time delay cross-correlation correction.
[0027] A dual-mode mixed distance metric function is constructed based on the cluster center matrix and the membership degree of the deterioration stage. Using the dual-mode mixed distance metric function, dynamic mixed weight coefficients are calculated based on the final predicted sequence. The mixed weighted distance from the final predicted sequence to each cluster center is calculated using the weight coefficients. The quality level of the cluster center corresponding to the minimum value of the mixed weighted distance is taken as the final quality level. When the final quality level reaches the preset risk level threshold, an early warning is triggered.
[0028] The risk level threshold refers to the degradation category threshold defined by clustering grading. Using a clustering algorithm, samples are clustered based on three quality indicators: rapeseed moisture, germination rate, and free fatty acids. The samples are then sorted according to the severity of rancidity and mold, from excellent and safe to severely degraded, generating an ordered clustered degradation category sequence. Combining the critical values for safe rapeseed storage in the grain and oil storage industry standards, the mean value of the corresponding indicator for each clustered sample is matched to clarify the actual degree of degradation for each category. The value corresponding to the degradation category that just exceeds the grain and oil safety indicators and begins to show signs of rancidity and mold is set as the degradation category threshold.
[0029] During the iterative optimization process, an inter-cluster exclusion regularization term is added to the objective function to forcibly increase the distance between the cluster centers. The objective function is composed of the intra-cluster weighted compactness term minus the inter-cluster exclusion regularization term.
[0030] The objective function is:
[0031] ;
[0032] Where J is the overall clustering optimization objective value, and the iterative optimization aims to minimize the objective value; n refers to the total number of samples, i is the sample index; k is the total number of clusters, and j is the cluster center index. It is a temporary index for each cluster during the denominator normalization process. For clusters different from j, used to calculate inter-cluster penalties, and >j; As a weighting factor; The power of the exponent. It is the fractional distance between sample i and cluster center j, with a value ranging from (0,1]. It is the coefficient that balances the inter-cluster repulsion regularization term; the j-th and the j-th The cluster center vectors are respectively and , This explains the relationship between the j-th and the j-th Euclidean distance between cluster centers It is used to measure the j-th and the first. The parameter indicating the distance between cluster centers in the index space; A small constant that serves to prevent division by zero; For sample i in the th The values on each indicator Let be the value of the j-th cluster center on the qual index. For the first The standard deviation of each indicator in the entire sample Let be the fractional index of the qual-th indicator, and D be the number of indicators.
[0033] It is understandable that the inter-cluster exclusion regularization term would be included. An objective function is introduced, using the reciprocal of the square of the Euclidean distance between any two cluster centers as a metric. When two centers approach each other, the penalty intensity increases, driving mutual exclusion and separation; when two centers move away, the penalty approaches zero. A division-to-zero constant is introduced in the denominator to ensure numerical stability and avoid division-to-zero anomalies caused by center overlap. A learnable balance coefficient dynamically adjusts the priority between intra-cluster compactness and inter-cluster separation. When samples approach the deterioration boundary, the coefficient is automatically increased to forcibly widen the distance between rank centers, reducing the risk of false alarms; when samples are naturally dispersed, a smaller coefficient is maintained to respect the inherent structure of the data. This design simultaneously satisfies the criteria of high clustering density of similar samples and high separation density of dissimilar centers, providing a high-confidence, high-discrimination cluster center benchmark for rank determination based on mixed weighted distance, and solving the problem of false alarms and missed alarms caused by ambiguous rank boundaries.
[0034] In some embodiments, the method for calculating the membership degree of the standardized feature vector to each cluster center includes:
[0035] ;
[0036] ;
[0037] Where i is the sample index and j is the cluster center index. It is a temporary index for each cluster during the denominator normalization process, k is the total number of clusters, qual is the quality index, and D represents the total number of indicators. Let be the actual measured value of the i-th sample on the qual indicator. and They are respectively the j-th and the j-th The value that each cluster center takes on the qual index. Let be the fractional exponent of the qual index. γ is the standard deviation of the indicator across all samples; where γ is a learnable sensitivity coefficient used to control the variance-to-response rate, initially set to 1, and updated using gradient descent during training. and These are the local temporal variance of the sample and the discrete variance of the cluster centers on each quality index, respectively. The ratio of the two is mapped by a Sigmoid type to adaptively control the degree of softness or hardness of the membership degree. It is the natural exponential function. It is the fuzzy membership degree of the i-th sample belonging to the j-th quality level cluster, where j ranges from 1 to k. The sum equals 1. Let be the i-th standardized feature vector.
[0038] In some embodiments, the iterative optimization of cluster centers based on the membership degree using a momentum update formula that includes an explicit damping term includes:
[0039]
[0040] Where m is the iteration round index. Let be the displacement vector of the center at the end of the m-th iteration. Let be the displacement vector of the actual movement of the center at the end of the (m-1)th iteration. The momentum decay rate is dynamically adjusted based on the degree of oscillation in the gradient direction, and its value range is [0,1). It is used to control the proportion of historical gradients retained. The learning rate is initialized to 0.01 and is adaptively adjusted based on the distance between the level centers, with a value range of (0, 0.1); n is the total number of samples, and i is the sample index. Let represent the fuzzy membership degree of sample i to the cluster corresponding to cluster center j. The weighting factor is used to emphasize the dominant role of high membership samples in center updates; Fractional distance of the kernel kernel for indicator perception cluster center vector The gradient; The fractional power of the absolute deviation. To prevent the division by zero, the small constant is set to 10. -8 , Let m+1 be the cluster center vector. is the original cluster center in the m-th round.
[0041] It is understandable that the aforementioned method of iteratively optimizing cluster centers based on the membership degree using a momentum update formula containing an explicit damping term can also be described as a fractional-order stable damped momentum update method addressing the gradient explosion and numerical oscillation problems that exist when the fractional-order distance of the index-aware exponential kernel approaches the cluster center. This method's innovation lies in two aspects: the fractional-order exponents assigned to rapeseed in the low-temperature stable stage and the mildly deteriorated stage, based on their changing characteristics, are less than 1, resulting in a very small difference between their index values and the cluster center, making them prone to gradient explosion. An explicit fractional-order damping term is introduced into the denominator of the update formula. The damping term dynamically adjusts the gradient magnitude based on the distance between the sample and the cluster center. When the fractional exponent is less than 1 and the distance approaches zero, the damping term automatically increases to suppress gradient explosion; when the distance is large, the damping term weakens to ensure convergence speed and numerical stability under a non-convex heterogeneous objective function. The free fatty acid content and germination rate show large differences in the later stages, belonging to convex distances; the moisture content values exhibit oscillating characteristics with small fluctuations, belonging to concave distances. To address the problem of a single indicator dominating cluster center updates due to inconsistent numerical scales caused by the heterogeneous distances of the three indicators, it is necessary to introduce the inertia of historical update directions. The historical momentum term is introduced into the update formula. By leveraging the inertia of historical update directions to suppress update path oscillations, and overcoming the convergence difficulties caused by excessive differences in fractional exponents across various indicator dimensions, this approach provides a stable and efficient optimization solution for indicator-aware clustering frameworks, ensuring that cluster centers converge to the global optimum and providing a highly reliable central benchmark for quality level classification.
[0042] In some embodiments, outputting the cluster center matrix and the membership degree of the deterioration stage includes: real-time monitoring of the change in the overall clustering optimization target value during two consecutive iterations, terminating the iteration when the change is less than a preset convergence threshold; constructing the cluster center matrix based on the final cluster centers after the iteration termination; extracting the maximum membership degree value based on the membership degree calculation results after the iteration termination, and mapping the maximum membership degree value to the membership degree of the deterioration stage that characterizes the physical state of the sample.
[0043] In some embodiments, the physical time-frequency co-series prediction model is composed of an adaptive block layer, an amplitude-frequency learnable discrete cosine transform layer, an inertial damping cross-attention fusion layer, and a wave-sensing exponential attention encoder cascaded together.
[0044] The membership degree of the deterioration stage is concatenated with the standardized feature vector along the feature dimension to obtain a concatenated sequence. The concatenated sequence is then input into the adaptive segmentation layer, and the concatenated sequence is adaptively segmented based on the rate of change to output a segmented sequence with equal amplitude changes.
[0045] For example, the adaptive segmentation layer is specifically used for: Rapeseed free fatty acids and germination rate vary greatly under high temperature and high humidity storage conditions, but vary little under low temperature and low humidity stable conditions. Traditional fixed-length temporal segmentation leads to semantic inconsistencies within segments of smooth and deteriorating conditions, and dilutes key mold characteristics in rapidly deteriorating segments. By setting a threshold for relative change, the length of the spliced sequence can adaptively change with the rate of local data change, thus making the cumulative change amplitude within each spliced sequence more similar. This solves the semantic inconsistency problem of fixed-length segments when the change rate is different, while allowing the model to focus its efforts on "significant change segments" with equal amplitude changes. Starting from the initial point g = 1 of the spliced sequence, the cumulative relative change is calculated one by one, and the minimum len that first reaches the threshold is defined as the length K1 of the first segment. Then the starting point is updated, i equals i + K1, and the above process is repeated until the remaining length is insufficient, ultimately obtaining a batch of segmented sequences with varying lengths. The specific method is as follows:
[0046] ;
[0047] Where s is the number of splices. Let be the length of the s-th concatenated sequence, and len be the length of the candidate concatenated sequences starting from 1. It is the value at the starting point of the current splicing sequence. It is the value of the len-th data point from the starting point. This is a preset relative change threshold. The symbol |.| represents the absolute value, and min means taking the smallest integer value of len that satisfies the condition. The meaning of this formula is: starting from the starting point i, try len=1,2,3,… to calculate the absolute value of relative change. When this value first reaches or exceeds the threshold... When the current len is used as the length of the concatenated sequence, , The threshold is the relative change threshold.
[0048] The block sequence is then input into the amplitude-frequency learnable discrete cosine transform layer, and the frequency position and amplitude of the block sequence are dynamically modulated using environmental parameters to output time-frequency fusion features containing physical constraints.
[0049] For example, the energy of rapeseed free fatty acid content and germination rate under low temperature and low humidity conditions is mostly concentrated in the ultra-low frequency, while under high temperature and high humidity conditions, the energy is concentrated in the medium and low frequency. The moisture content data contains a lot of high frequency disturbances, which need to be suppressed to avoid submerging the characteristics of various quality indicators of rapeseed. Therefore, it is necessary to introduce amplitude modulation of temperature, humidity and storage days, and at the same time, it is necessary to introduce frequency offset to ensure that the basis is shifted to the ultra-low frequency under low temperature and low humidity conditions and to the medium and low frequency under high temperature and high humidity conditions. The amplitude-frequency learnable discrete cosine transform layer provides a data-driven, two-dimensional dynamic enhancement to the traditional discrete cosine transform. In the frequency dimension, it abandons fixed frequency positions, performing global average pooling on the input time-domain sequence Y, and then generating a frequency bias term through multilayer perceptron regression, allowing the basis function frequency to adaptively shift with the overall distribution characteristics of the input waveform. In the amplitude dimension, the original frequency domain coefficients, along with the ambient temperature Te, humidity He, and storage days De corresponding to the current block sequence, are input into a lightweight multilayer perceptron network. After Sigmoid activation, the degradation sensitivity score of that frequency component is output. The original learnable amplitude is modulated by a multiplicative factor to obtain the physically enhanced final amplitude. The dynamically modulated frequency position and amplitude are substituted into the discrete cosine transform basis matrix, achieving dual physical constraints: the frequency position is within a physically reasonable range, important frequency components are amplified, and noise is suppressed. This maintains data-driven flexibility while ensuring the frequency domain representation aligns with the physical principles of rapeseed degradation. Specifically, this includes:
[0050]
[0051] ;
[0052] ;
[0053]
[0054] in, This represents the basis coefficient of the e-th frequency component at the c-th time-domain position. Ks refers to the length of the current spliced sequence. e serves as the frequency index, with e equal to 0 corresponding to the DC component. c serves as the index of the discrete time-domain position. As a reference for the amplitude modulation coefficient of the e-th frequency component It is the position of the dynamic frequency of the e-th frequency component. Let ξ be the learnable base amplitude at the e-th frequency, initially set to 1; ξ can be called the modulation intensity coefficient, initially set to 0. It is the Sigmoid activation function. MLP represents the transpose of the linear transformation weight matrix, where MLP stands for Multilayer Perceptron. It is the initial conversion coefficient for the e-th frequency. These are the ambient temperature, ambient humidity, and storage days associated with the current subsequence. As the coefficients of the basis matrix generated using an initial fixed frequency. It is the value at the c-th position of the input time-domain sequence. Dynamically formed at a reference frequency Content-adaptive offset In the form of addition, After performing global average pooling on the input sequence Y, the frequency shift values obtained from MLP regression are finally used to define a split point C. The frequency domain is divided into high-frequency and low-frequency vectors, and each is input into the feature fusion module. is the global average pooling function, and F is the total number of frequency components.
[0055] The time-frequency fusion features are input into the inertial damping cross-attention fusion layer. The membership degree of the deterioration stage is used to construct a routing gate to determine the time-frequency fusion weight. The time-frequency fusion features are then combined with first-order inertial damping and adaptive hysteresis dead zone to perform stable fusion and output the fusion features after inertial correction.
[0056] The inertial-corrected fusion features are input into the fluctuation-aware exponential attention encoder. The distribution of attention weights is adjusted based on the local fluctuation intensity and the membership degree of the deterioration stage to perform fluctuation-aware attention decay and output the initial prediction sequence.
[0057] The initial prediction sequence is corrected across indicators by utilizing the time-delay cross-correlation relationship between different quality indicators, and the final prediction sequence is output.
[0058] In some embodiments, the process of outputting the fused features after inertial correction includes:
[0059] Because the free fatty acid content and germination rate change little during the stable storage stage, with only minor fluctuations in moisture content, it is necessary to capture low-frequency, long-term decay signals of quality indicators. During the accelerated deterioration stage, the free fatty acid content increases rapidly, and the germination rate decreases rapidly, requiring high-frequency components to pinpoint short-term inflection points and accurately capture risk signals of oil rancidity. The standardized feature vector is a time-domain feature vector; the standardized feature vector includes high-frequency and low-frequency feature vectors; the gating value of the original route is constructed based on the variance ratio of the high-frequency feature vector to the time-domain feature vector and the membership degree of the deterioration stage.
[0060] ;
[0061] in, This belongs to the original routing gate value. It is the Sigmoid activation function. As the first balancing coefficient that can be learned. As a second balance coefficient that can be learned. It is the variance of the high-frequency eigenvectors. It is the variance of the time-domain eigenvectors. For the deterioration stage, the membership degree is... As a bias term, it is initially set to 0;
[0062] Due to fluctuations and noise interference in moisture content data, an inertial damping coefficient was designed to inherit the historical gating from the previous moment while absorbing a small amount of instantaneous fluctuation interference. The original routing gating value was then subjected to first-order inertial smoothing using the inertial damping coefficient. A weighted combination of the previous gating value and the original routing gating value was then performed to obtain an intermediate smoothed gating value.
[0063] ;
[0064] in, This is the intermediate gate value. It is the inertial damping coefficient. It is the gate value from the previous moment;
[0065] Due to fluctuations and noise in moisture content data, and the need for accurate prediction of deterioration stages, a dynamic hysteresis dead zone is used to filter out minor fluctuations. The dead zone threshold is automatically reduced over storage time to improve the sensitivity of later risk warnings. An adaptive hysteresis dead zone filter is applied to the intermediate smoothing gate value, and a dynamic threshold that adaptively decays with the number of storage days is set. The final gate value is output based on this dynamic threshold.
[0066]
[0067] in, Represents the final gating value. This is the initial dead zone threshold, and dea represents the dead zone decay rate. t is the total number of steps over all time periods; t is the time step.
[0068] The time-domain feature vector, high-frequency feature vector, and low-frequency feature vector are weighted and fused using the final gate value. After normalization, the fused feature after inertial correction is obtained.
[0069] ;
[0070] in, After inertial correction, For layer normalization operation, This is a function for calculating cross-attention in physical perception. For time-domain feature vectors, For low-frequency feature vectors, These are high-frequency feature vectors.
[0071] In some embodiments, the process of outputting the final predicted sequence based on the fused features after inertial correction includes:
[0072] Due to the differences in quality index data between free fatty acid content and germination rate and moisture content, and the fluctuating nature of moisture content data, a three-layer dynamic control of attenuation rate is introduced, utilizing the frequency domain, degradation stage, and local fluctuations of the amplitude-frequency learnable discrete cosine transform. This ensures that free fatty acids and germination rate retain long-term slow attenuation at low frequencies, while moisture content retains high-frequency fast attenuation to filter out oscillations. Furthermore, clustering output membership degree modulation of the attention peak is introduced, causing weights to shift towards the inflection point, preserving key information at the inflection point and amplifying the risk stage. Simultaneously, the attenuation coefficient is corrected in real time using local fluctuation intensity. During periods of severe moisture fluctuation, forgotten noise is accelerated, while free fatty acid content and germination rate remain unaffected. The ratio of the local fluctuation intensity to the reference variance of the inertial-corrected fusion feature is calculated. This ratio, after normalization using a hyperbolic tangent activation function, is combined with the attenuation basis of the attention head and the cosine modulation term of the dynamic frequency position to generate the dynamic attenuation rate, specifically:
[0073] ;
[0074] in, It is the dynamic decay rate corresponding to position u at the h-th head. It is the hyperbolic tangent activation function. It is the local variance of the feature sequence at position u before time step u. That is, the reference variance. It is the only decaying base case for the h-th attention head. These are modulation intensity coefficients related to the frequency domain response. It is the dynamic frequency position of the e-th frequency component.
[0075] Based on the dynamic decay rate and the membership degree of the deterioration stage, an attention weight is constructed that includes a spatial distance decay term and a historical inflection point offset term. The attention weight is normalized by Softmax and then encoded to encode the fused features, resulting in an initial prediction sequence.
[0076] The attention weights, which include a spatial distance decay term and a historical inflection point offset term, are constructed as follows:
[0077] ;
[0078] in, This represents the attention weight of position v relative to position u in the h-th attention head, where u refers to the index of the current query position, v is the index of the position related to the historical key position, and Softmax is the standard normalized exponential function. It is the representation of the query vector at position u of the h-th head. The transpose of the key vector at position v of the h-th head, where d is the dimension of the query vector. It is the dynamic decay rate corresponding to position u of the h-th head. This indicates the absolute distance between the two time steps u and v, while b is a coefficient representing the modulation intensity during the deterioration phase. This corresponds to the inflection point of historical deterioration. As an indicator function related to causal masking; Let u be the membership degree of the vector at position u during the deterioration stage;
[0079] The deterioration of the three major indicators exhibits a natural time-series lead-lag relationship. High moisture content induces an increase in free fatty acid content and a decrease in germination rate. Increased free fatty acid content accelerates seed inactivation, and this effect has a time lag. To capture the mutual influence between indicators at different times, time lags and cross-correlation coefficients are introduced. Based on the initial prediction sequence, cross-correlation coefficients between different quality indicators are calculated. All possible time lags are iterated, and the time lag that maximizes the absolute value of the cross-correlation coefficient is selected as the optimal time lag. The corresponding correlation coefficient is then determined, specifically as follows:
[0080] ;
[0081] in, This indicates the time lag between indicators p and q. Cross-correlation coefficients at different times; This is the predicted value of indicator p at time t. For the indicator q in time The predicted value; It is the arithmetic mean of the predicted sequence of index p. It is the arithmetic mean of the predicted sequence of index q; The standard deviation of the predicted sequence for the p-index is... q represents the standard deviation of the predicted sequence; T represents the total length of the predicted sequence. The time lag is used; p and q are different quality indexes.
[0082] Based on the optimal time delay, the correlation coefficient, and the correction strength coefficient, the final predicted sequence is obtained, specifically as follows:
[0083] ;
[0084] in, This represents the final predicted sequence of index q after channel correction at time t; To correct the strength coefficient; For symbolic functions, It is the cross-correlation coefficient between indicators p and q under the optimal time lag; The optimal lead time lag from indicator p to indicator q; It is the indicator p in time The predicted value, for The value of the previous time step.
[0085] In some embodiments, since the free fatty acid content and germination rate change only slightly during stable storage but fluctuate dramatically during deterioration, Euclidean distance, which is insensitive to small deviations, is suitable for calculating the distance to the cluster center. Moisture content, however, is easily affected by storage conditions and fluctuates slightly; Manhattan distance, which is highly sensitive to index shifts, is suitable for calculating the distance. When rapeseed is in a stable storage period, Euclidean distance should be the primary method to reduce the risk of false alarms caused by moisture content fluctuations. When rapeseed is in an accelerated deterioration period, Manhattan distance should be the primary method to amplify the accuracy of early warnings regarding changes in free fatty acid content and germination rate. Based on the membership degree of the deterioration stage and the dispersion of the final predicted sequence, the dynamic mixing weight coefficient is calculated as follows:
[0086] ;
[0087] in, (.) is the Sigmoid activation function; The weighting coefficients for membership in the deterioration stage. Let be the membership degree of the i-th sample in the deterioration stage. The weighting coefficients for the relative dispersion of the final predicted sequence are initialized to 2 and take values in the range (1, 3). For the final predicted sequence Variance across various quality indicators The overall variance of all level centers across all indicators. This is a bias term.
[0088] In some embodiments, the weighted distance from the final predicted sequence to each cluster center is calculated using the weighting coefficients, and the level corresponding to the minimum distance is taken as the future quality level determination result. An early warning is triggered when the determined level exceeds a preset threshold. The process of taking the level corresponding to the minimum distance as the future quality level determination result includes:
[0089]
[0090] in, This represents the index of the final determined future quality level; b is the level number being traversed. It is the final predicted sequence of the r-th quality indicator; It is the value of the j-th grade center on the r-th indicator; M is the total number of quality indicators; The mixed weighting coefficient has an initial value of 0.4. For Manhattan distance components, 2 For the squared component of the Euclidean distance. Let be the standard deviation of the r-th indicator across all samples.
[0091] It is understood that this invention is based on a dual-mode hybrid distance metric function. After normalization by indicator weights and standard deviations, it performs distance calculation for graded early warning, measuring the similarity between the final predicted sequence and each cluster center. The quality level is determined by taking the level corresponding to the minimum distance value. When the membership degree in the deterioration stage approaches 0, the dynamic hybrid weight coefficient approaches 0, and the distance metric is mainly Euclidean distance, which is not sensitive to small deviations and avoids false alarms. When the membership degree in the deterioration stage approaches 1, the dynamic hybrid weight coefficient approaches 1, and the distance metric is mainly Manhattan distance, which is sensitive to any indicator deviation and ensures no missed reports. When the judgment level exceeds a preset threshold, an early warning is triggered to guide warehouse intervention.
[0092] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A collaborative prediction and risk assessment method for rapeseed storage quality indicators based on deep learning, characterized in that, The method includes: A standardized feature vector based on rapeseed storage quality indicators is constructed; the quality indicators include rapeseed moisture content, germination rate, and free fatty acid content; each quality indicator corresponds to multiple samples. Multiple initial cluster centers are selected based on the K-means++ rule for the initialization of standardized feature vectors; fractional exponents of different quality indices are calculated; the ratio of the local variance of multiple samples to the variance of cluster centers is calculated, and the ratio is mapped to generate a dynamic fuzzy index using the Sigmoid function; the membership degree of the standardized feature vector to each cluster center is calculated using the fractional exponent and the dynamic fuzzy index; the cluster centers are iteratively optimized based on the membership degree using a momentum update formula containing an explicit damping term; the iteration continues until the objective function converges, and the converged cluster centers are mapped to quality levels in order of quality superiority or inferiority, outputting a cluster center matrix carrying the quality level and the membership degree of the deterioration stage; A time series prediction model is constructed. The membership degree of the deterioration stage and the standardized feature vector are concatenated and input into the time series prediction model. Finally, the final prediction sequence is output after time delay cross-correlation correction. A dual-mode mixed distance metric function is constructed based on the cluster center matrix and the membership degree of the deterioration stage. Using the dual-mode mixed distance metric function, dynamic mixed weight coefficients are calculated based on the final predicted sequence. The mixed weighted distance from the final predicted sequence to each cluster center is calculated using the weight coefficients. The quality level of the cluster center corresponding to the minimum value of the mixed weighted distance is taken as the final quality level. When the final quality level reaches the preset risk level threshold, an early warning is triggered.
2. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 1, characterized in that, During the iterative optimization process, an inter-cluster exclusion regularization term is added to the objective function to forcibly increase the distance between the cluster centers. The objective function is composed of the intra-cluster weighted compactness term minus the inter-cluster exclusion regularization term. The objective function is: ; Where J is the overall clustering optimization objective value, and the iterative optimization aims to minimize the objective value; n refers to the total number of samples, i is the sample index; k is the total number of clusters, and j is the cluster center index. It is a temporary index for each cluster during the denominator normalization process. For clusters different from j, this is used to calculate inter-cluster penalties; As a weighting factor; The power of the exponent. It is the fractional distance between sample i and cluster center j, with a value ranging from (0,1]. It is the coefficient that balances the inter-cluster repulsion regularization term; the j-th and the j-th The cluster center vectors are respectively and , This explains the relationship between the j-th and the j-th Euclidean distance between cluster centers It is used to measure the j-th and the first. The parameter indicating the distance between cluster centers in the index space; A small constant that serves to prevent division by zero; For sample i in the th The values on the indicator Let be the value of the j-th cluster center on the qual index. For the first The standard deviation of each indicator in the entire sample Let be the fractional index of the qual-th indicator, and D be the number of indicators.
3. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 2, characterized in that, The method for calculating the membership degree of the standardized feature vector to each cluster center includes: ; ; Where i is the sample index and j is the cluster center index. It is a temporary index for each cluster during the denominator normalization process, k is the total number of clusters, qual is the quality index, and D represents the total number of indicators. Let be the actual measured value of the i-th sample on the qual indicator. and They are respectively the j-th and the j-th The value that each cluster center takes on the qual index. Let be the fractional exponent of the qual index. It is the standard deviation of the indicator across all samples; It is the first dynamic fuzzy index. It is the second dynamic fuzziness index, and γ is a learnable sensitivity coefficient used to control the variance ratio response rate. It is initially set to 1 and updated using gradient descent during training. and These are the local temporal variance of the sample and the discrete variance of the cluster centers on each quality index, respectively. The ratio of the two is mapped by a Sigmoid type to adaptively control the degree of softness or hardness of the membership degree. It is the natural exponential function, which ultimately yields... It is the fuzzy membership degree of the i-th sample belonging to the j-th quality level cluster. Let be the i-th standardized feature vector.
4. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 3, characterized in that, The momentum update formula, which includes an explicit damping term, is used to iteratively optimize the cluster centers based on the membership degree, including: Where m is the iteration round index. Let be the displacement vector of the center at the end of the m-th iteration. Let be the displacement vector of the actual movement of the center at the end of the (m-1)th iteration. The momentum decay rate is dynamically adjusted based on the degree of oscillation in the gradient direction, and its value range is [0,1). It is used to control the proportion of historical gradients retained. The learning rate is initialized to 0.01 and is adaptively adjusted based on the distance between the level centers, with a value range of (0, 0.1); n is the total number of samples, and i is the sample index. Let represent the fuzzy membership degree of sample i to the cluster corresponding to cluster center j. As a weighting factor, the weighting intro is used to emphasize the dominant role of high membership samples in center updates; Fractional distance of the kernel kernel for indicator perception cluster center vector The gradient; The fractional power of the absolute deviation. To prevent the division by zero, the small constant is set to 10. -8 , Let m+1 be the cluster center vector. is the original cluster center in the m-th round.
5. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 4, characterized in that, The output cluster center matrix and the membership degree of the deterioration stage include: The change in the overall clustering optimization target value during two consecutive iterations is monitored in real time. The iteration is terminated when the change is less than a preset convergence threshold. A cluster center matrix is constructed based on the final cluster centers after the iteration is terminated. The maximum membership value is extracted based on the membership calculation results after the iteration is terminated, and the maximum membership value is mapped to the membership degree representing the deterioration stage of the physical state of the sample.
6. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 5, characterized in that, The physical time-frequency co-series prediction model is composed of an adaptive block layer, an amplitude-frequency learnable discrete cosine transform layer, an inertial damping cross-attention fusion layer, and a wave-sensing exponential attention encoder cascaded together. The membership degree of the deterioration stage and the standardized feature vector are concatenated along the feature dimension to obtain a concatenated sequence. The concatenated sequence is then input into the adaptive segmentation layer, and the concatenated sequence is adaptively segmented based on the rate of change to output a segmented sequence with equal amplitude changes. The block sequence is then input into the amplitude-frequency learnable discrete cosine transform layer, and the frequency position and amplitude of the block sequence are dynamically modulated using environmental parameters to output time-frequency fusion features containing physical constraints. The time-frequency fusion features are input into the inertial damping cross-attention fusion layer. The membership degree of the deterioration stage is used to construct a routing gate to determine the time-frequency fusion weight. The time-frequency fusion features are then combined with first-order inertial damping and adaptive hysteresis dead zone to perform stable fusion and output the fusion features after inertial correction. The inertial-corrected fusion features are input into the fluctuation-aware exponential attention encoder. The distribution of attention weights is adjusted based on the local fluctuation intensity and the membership degree of the deterioration stage to perform fluctuation-aware attention decay and output the initial prediction sequence. The initial prediction sequence is corrected across indicators by utilizing the time-delay cross-correlation relationship between different quality indicators, and the final prediction sequence is output.
7. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 6, characterized in that, The process of outputting the fused features after inertial correction includes: The standardized feature vector is a time-domain feature vector; the standardized feature vector includes a high-frequency feature vector and a low-frequency feature vector; the gating value of the original route is constructed based on the variance ratio of the high-frequency feature vector and the time-domain feature vector and the membership degree of the degradation stage; ; in, This belongs to the original routing gate value. It is the Sigmoid activation function. As the first balancing coefficient that can be learned. As a second balance coefficient that can be learned. It is the variance of the high-frequency eigenvectors. It is the variance of the time-domain eigenvectors. For the deterioration stage, the membership degree is... As a bias term, it is initially set to 0; The original routing gate value is smoothed using an inertial damping coefficient; an intermediate smoothed gate value is obtained by weighting the gate value from the previous time step with the original routing gate value. ; in, This is the intermediate gate value. It is the inertial damping coefficient. It is the gate value from the previous moment; An adaptive hysteresis dead zone filter is applied to the intermediate smoothing gate value, and a dynamic threshold that adaptively decays with the number of storage days is set. The final gate value is then output based on the dynamic threshold. in, Represents the final gating value. This is the initial dead zone threshold, and dea represents the dead zone decay rate. It represents the number of steps over all time periods; The time-domain feature vector, high-frequency feature vector, and low-frequency feature vector are weighted and fused using the final gate value. After normalization, the fused feature after inertial correction is obtained. ; in, After inertial correction, For layer normalization operation, This is a function for calculating cross-attention in physical perception. For time-domain feature vectors, For low-frequency feature vectors, is a high-frequency feature vector, and t is the time step.
8. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 7, characterized in that, The process of outputting the final predicted sequence based on the fusion features after inertial correction includes: The ratio of the local fluctuation intensity to the reference variance of the fused feature after inertial correction is calculated. This ratio is normalized by the hyperbolic tangent activation function and then combined with the attenuation basis of the attention head and the cosine modulation term of the dynamic frequency position to generate the dynamic attenuation rate, specifically: ; in, It is the dynamic decay rate corresponding to position u at the h-th head. It is the hyperbolic tangent activation function. It is the local variance of the feature sequence at position u before time step u. That is, the reference variance. It is the only decaying base case for the h-th attention head. These are modulation intensity coefficients related to the frequency domain response. It is the dynamic frequency position of the e-th frequency component; Based on the dynamic decay rate and the membership degree of the deterioration stage, an attention weight is constructed that includes a spatial distance decay term and a historical inflection point offset term. The attention weight is normalized by Softmax and then encoded to encode the fused features, resulting in an initial prediction sequence. The attention weights, which include a spatial distance decay term and a historical inflection point offset term, are constructed as follows: ; in, This represents the attention weight of position v relative to position u in the h-th attention head, where u refers to the index of the current query position, v is the index of the position related to the historical key position, and Softmax is the standard normalized exponential function. It is the representation of the query vector at position u of the h-th head. The transpose of the key vector at position v of the h-th head, where d is the dimension of the query vector. It is the dynamic decay rate corresponding to position u of the h-th head. This indicates the absolute distance between the two time steps u and v, while b is a coefficient representing the modulation intensity during the deterioration phase. This corresponds to the inflection point of historical deterioration. As an indicator function related to causal masking; Let u be the membership degree of the vector at position u during the deterioration stage; Based on the initial prediction sequence, the cross-correlation coefficients between different quality indicators are calculated. All possible time lags are iterated over, and the time lag that maximizes the absolute value of the cross-correlation coefficient is selected as the optimal time lag. The corresponding correlation coefficients are then determined, specifically as follows: ; in, This indicates the time lag between indicators p and q. Cross-correlation coefficients at different times; This is the predicted value of indicator p at time t. For the indicator q in time The predicted value; It is the arithmetic mean of the predicted sequence of index p. It is the arithmetic mean of the predicted sequence of index q; The standard deviation of the predicted sequence for the p-index is... q represents the standard deviation of the predicted sequence; T represents the total length of the predicted sequence. The time lag is used; p and q are different quality indexes. Based on the optimal time delay, the correlation coefficient, and the correction strength coefficient, the final predicted sequence is obtained, specifically as follows: in, This represents the final predicted sequence of index q after channel correction at time t; To correct the strength coefficient; For symbolic functions, It is the cross-correlation coefficient between indicators p and q under the optimal time lag; The optimal lead time lag from indicator p to indicator q; It is the indicator p in time The predicted value, for The value of the previous time step.
9. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 8, characterized in that, Using the aforementioned dual-mode mixing distance metric function, the dynamic mixing weight coefficients are calculated based on the final predicted sequence, including: ; in, (.) is the Sigmoid activation function; The weighting coefficients for membership in the deterioration stage. Let be the membership degree of the i-th sample in the deterioration stage. The weighting coefficients for the relative dispersion of the final predicted sequence are initialized to 2 and take values in the range (1, 3). For the final predicted sequence Variance across various quality indicators The overall variance of all level centers across all indicators. This is a bias term.
10. The method for collaborative prediction and risk assessment of rapeseed storage quality indicators based on deep learning according to claim 9, characterized in that, The weighted distance from the final predicted sequence to each cluster center is calculated using the weighting coefficients. The level corresponding to the minimum distance is taken as the future quality level determination result. An early warning is triggered when the determination level exceeds a preset threshold. The process of taking the grade corresponding to the minimum distance as the future quality grade determination result includes: in, This represents the index of the final determined future quality level; b is the level number being traversed. It is the final predicted sequence of the r-th quality indicator; It is the value of the j-th grade center on the r-th quality indicator; M is the total number of quality indicators; For mixed weighting coefficients, For Manhattan distance components, 2 For the squared component of the Euclidean distance. Let be the standard deviation of the r-th indicator across all samples.