Method and system for predicting canola oligo stress grade based on machine learning
By constructing a cumulative effect function of photosynthetically active radiation and a temporal knowledge graph, combined with a dual-tower comparative prediction network and a physical constraint loss function, the problem of modeling the spatiotemporal evolution law and causal relationship in the prediction of low-light stress level was solved, and cross-regional prediction with high accuracy and interpretability was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies lack systematic modeling of the spatiotemporal evolution of light-deprived stress, making it difficult to integrate multi-source heterogeneous information. Data-driven models lack physical mechanism constraints, making it difficult to achieve cross-regional knowledge transfer and accurate prediction in small-sample scenarios.
By constructing a cumulative effect function of photosynthetically active radiation to generate physical adversarial negative samples, and combining a temporal knowledge graph and a dual-tower contrastive prediction network, a physical constraint loss function and a contrastive learning method are used to explicitly model the spatiotemporal evolution and causal relationship of low-light stress, thereby improving the physical consistency and interpretability of the model.
It significantly improves the accuracy and interpretability of predicting the level of low light stress, especially in small sample scenarios, and realizes cross-regional knowledge transfer and model credibility, meeting the reliability requirements of agricultural decision-making.
Smart Images

Figure CN122286536A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of agricultural meteorological disaster early warning technology, and in particular to a method and system for predicting the level of insufficient sunlight stress in rapeseed based on machine learning. Background Technology
[0002] Rapeseed is an important oilseed crop. During its growth period, it often encounters prolonged periods of overcast and rainy weather with insufficient sunlight, leading to insufficient accumulation of photosynthetic products, hindered flowering and pollination, and the proliferation of diseases, resulting in severe yield reduction. Accurately predicting the level of light stress in rapeseed is of great significance for guiding agricultural production, disaster prevention and mitigation, and agricultural insurance loss assessment.
[0003] Currently, the following techniques are mainly used to predict the stress level of rapeseed under low light conditions: (1) Threshold method: Based on single or composite indicators such as the number of consecutive days without sunshine and the percentage of sunshine anomaly, a fixed threshold is set to classify the stress level. This method is simple and easy to implement, but it ignores the sensitivity differences of different growth stages and different regions, and cannot make dynamic predictions using multi-source meteorological forecast information.
[0004] (2) Statistical regression method: Establish a linear or generalized linear regression model between meteorological factors and yield reduction rate or stress level. However, this method is difficult to capture the nonlinear relationship between meteorological factors and crop response, and it is highly dependent on historical disaster data.
[0005] (3) Traditional machine learning methods: using support vector machines, random forests and other methods to classify stress levels. These methods usually only use the statistical characteristics of cross sections, ignoring the temporal cumulative effect and spatial propagation law of low light stress, and have poor interpretability, making it difficult to gain the trust of the agricultural sector.
[0006] (4) Deep learning methods: Prediction is made using temporal neural networks such as LSTM and GRU. Although it can learn temporal dependencies, the pure data-driven method has the following problems: First, the prediction accuracy is low for small sample events such as severe stress; second, it lacks constraints on agronomic mechanisms, which may produce prediction results that violate physical laws; and third, it is difficult to achieve cross-regional knowledge transfer.
[0007] In summary, existing technologies suffer from the following shortcomings: a lack of systematic modeling of the spatiotemporal evolution of low-light stress, making it difficult to integrate multi-source heterogeneous information; data-driven models lack physical mechanism constraints and exhibit poor generalization ability in small-sample scenarios; and insufficient model interpretability, making it difficult to meet the reliability requirements of agricultural decision-making. Therefore, this paper proposes a machine learning-based method and system for predicting the level of low-light stress in rapeseed. Summary of the Invention
[0008] The main objective of this invention is to provide a method and system for predicting the stress level of rapeseed under low light conditions based on machine learning, which can effectively solve the problems in the background art.
[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows: In a first aspect, the present invention provides a machine learning-based method for predicting the stress level of rapeseed under low light conditions, comprising the following steps: Step S1: Obtain meteorological time-series data, agronomic static characteristic data, and historical low-light stress level labels for the target area to construct a training sample set; among which, Meteorological time-series data include daily sunshine hours, precipitation, average temperature, relative humidity, and photosynthetically active radiation; Static agronomic characteristics include growth period, variety shade tolerance level, soil texture, and geographical location; Historical stress level labels are based on the number of consecutive days without sunshine and the percentage of sunshine anomaly, and are divided into four levels according to industry standards: no stress, mild stress, moderate stress, and severe stress.
[0010] S2: Based on the agricultural meteorological mechanism, a cumulative effect function of photosynthetically active radiation is constructed. By solving the constrained optimization problem, physical adversarial negative samples are generated to form a physical-guided comparison sample pair. Specifically, methods for producing physically guided comparison sample pairs include: Construct the cumulative effect function of photosynthetically active radiation, defined as: ,in, For meteorological time series data, The photosynthetically active radiation at time t This is a function indicating the flowering period. , The sensitivity coefficient for the reproductive period. The length of the historical time window; For meteorological time series data samples Under the constraint of keeping the mean of meteorological statistics constant, adversarial examples are generated by redistributing the radiation field. , making and Maximize the difference; The adversarial sample is used as the physical adversarial negative sample of the original sample to form a contrast sample pair.
[0011] By guiding the generation of negative samples through physical mechanisms, the model is forced to learn the true physiological stress characteristic of the cumulative effect of photosynthetically active radiation, rather than statistical spurious correlations, thereby improving the model's compliance with physical laws.
[0012] S3: Construct a temporal knowledge graph. The nodes of the graph include meteorological event nodes, reproductive period nodes, stress level nodes, and geographical nodes. Temporal edges represent the causal relationships and spatiotemporal evolution relationships between nodes. A temporal graph convolutional network is used to embed and encode the graph nodes to obtain the graph embedding vector of each sample. Specifically: the construction of temporal knowledge graphs and the temporal graph convolutional network encoding methods include: Define a time series knowledge graph ,in For a set of nodes, It is a temporal edge set, containing causal relationship edges and spatiotemporal propagation edges; A relation-aware graph convolutional network is used to encode the graph nodes. The hidden state update formula at time t is defined as follows: ,in, For a set of relations, To pass through relationships With nodes The set of connected neighbor nodes, The normalization constant is , The weight matrix is a learnable matrix. For activation functions; For the target sample, the hidden states of its associated nodes are aggregated using an attention pooling mechanism to obtain the graph embedding vector: Attention weights , For learnable query vectors, For vector transpose, For the sample The set of associated nodes, This is the set of corresponding time steps.
[0013] By explicitly modeling the spatiotemporal evolution and causal relationships of light scarcity stress using temporal knowledge graphs, the model can learn the migration patterns of similar historical scenarios, thereby improving its ability to model long-range dependencies and spatial propagation.
[0014] S4: Construct a dual-tower comparative prediction network, including a meteorological time-series coding tower and an agronomic feature coding tower, to extract meteorological feature vectors and agronomic feature vectors that fuse agronomic static features and graph embedding vectors, respectively; Specifically: The meteorological time-series coding tower uses a bidirectional long short-term memory network to process historical meteorological time-series data. Encoding is performed to obtain meteorological feature vectors; represented as: , For network forward output, For network backward output, For vector concatenation, For vector weights, For network bias; The agronomic feature coding tower uses a multilayer perceptron network to encode agronomic static features. With graph embedding vectors The concatenation and encoding process yields an agronomic feature vector, represented as: ; The feature vectors output by the two towers have the same dimension, which is the preset latent space dimension.
[0015] S5: By comparing the loss function, the distance between the meteorological feature vector and the agronomic feature vector of the same sample in the latent space is narrowed, while the agronomic feature vectors of different samples are pushed further apart. Specifically: The contrast loss function adopts the improved InfoNCE loss function, which is defined as follows: ,in For training batches, , These are meteorological feature vectors and agronomic feature vectors, respectively. For temperature parameters; The similarity function uses cosine similarity. By using contrastive learning to achieve semantic alignment between meteorological models and agronomic responses, the model learns meteorological feature representations that are highly correlated with agronomic responses, thereby improving prediction accuracy.
[0016] S6: Construct a physical constraint loss function to penalize prediction results that violate the physical laws of rapeseed under low light stress; Specifically, methods for constructing physical constraint loss functions include: Define the physical consistency function: , For the predicted stress level, For meteorological time series data, It is a static characteristic of agronomy. To determine the degree of violation of the k-th physics rule, Let k be the weight of the k-th physical rule. The total number of physical rules; The physical rules include at least one of the following: a monotonic constraint rule between the number of consecutive days without sunshine during the flowering period and the stress level; a negative correlation constraint rule between the cumulative amount of photosynthetically active radiation and the stress level; and a coupling constraint rule between low light and waterlogging damage. The physical constraint loss function is: , This represents the number of samples.
[0017] This step incorporates agronomic mechanisms into model training as soft constraints, penalizing predictions that violate physical laws and improving the model's physical consistency and reliability.
[0018] S7: After fusing meteorological feature vectors and agronomic feature vectors, the input is given to the classifier. The comparative loss function and the physical constraint loss function are combined for joint optimization training to obtain the rapeseed low light stress level prediction model. Specifically: The total loss function for joint optimization training is defined as: , The cross-entropy classification loss is defined as: , For the one-hot encoding of the true label of the i-th sample at the c-th stress level, This represents the corresponding predicted probability.
[0019] Joint optimization training employs a phased training strategy: In the first stage, only the meteorological time-series coding tower is used for mask reconstruction self-supervised pre-training, and the pre-training loss function is: , The set of time steps for a random mask. For decoder networks; In the second stage, the parameters of the meteorological time series coding tower are fixed, and the agronomic feature coding tower and contrast loss function are optimized. The third phase involves end-to-end joint optimization of all network parameters. S8: Input the meteorological forecast data and agronomic characteristics of the area to be predicted into the prediction model, and output the prediction results of the low light stress level.
[0020] Preferably, while outputting the prediction result of the low light stress level, interpretability information is also output through an attention weight mechanism, including a decision path subgraph extracted from the time-series knowledge graph, and the contribution ranking of each meteorological factor and agronomic factor to the prediction result. The method for extracting the decision path subgraph is as follows: select the node v with an attention weight greater than a preset threshold and the time step t, and construct a subgraph containing the node and its associated edges as the basis path for model decision-making. The contribution ranking is based on the Shapley value or gradient integral method to calculate the marginal contribution of each input feature to the prediction result.
[0021] Preferably, it also includes a model transfer learning step: when applied to a target area without historical stress labels, the meteorological time-series coding tower parameters pre-trained in the source area are transferred to the target area, and fine-tuning is performed using only the agronomic static features and graph embedding vectors of the target area.
[0022] Preferably, the method further includes an uncertainty estimation step: using the Monte Carlo dropout method to perform multiple random forward propagations on the prediction model to obtain the probability distribution of the prediction level and calculate the prediction entropy value. When the entropy value is greater than a preset threshold, a low confidence warning signal is output.
[0023] Secondly, the present invention provides a machine learning-based system for predicting the level of low-light stress in rapeseed, comprising the steps of the above method, characterized in that it includes: Data acquisition module: used to acquire meteorological time-series data, agronomic static characteristics and historical stress level labels of the target area, and to build a training sample set; Physics-guided sample generation module: used to construct the cumulative effect function of photosynthetically active radiation, generate physics-adversarial negative samples through constraint optimization, and form a contrast sample pair; Temporal knowledge graph construction module: used to construct a temporal knowledge graph. The nodes of the temporal knowledge graph include meteorological event nodes, reproductive period nodes, stress level nodes, and geographical nodes. Temporal edges represent causal relationships and spatiotemporal evolution. A temporal graph convolutional network is used to embed and encode the graph nodes to obtain graph embedding vectors. Dual-tower contrast prediction network module: used to construct a dual-tower contrast prediction network, wherein the dual towers include a meteorological time-series coding tower and an agronomic feature coding tower. The meteorological time-series coding tower is used to extract meteorological feature vectors, and the agronomic feature coding tower is used to fuse agronomic static features with the graph embedding vector to obtain agronomic feature vectors. The contrastive learning module is used to bring the meteorological feature vector and the agronomic feature vector of the same sample closer together by using a contrastive loss function, while pushing the agronomic feature vector of different samples further apart. Physical constraint module: used to construct physical constraint loss function, and to penalize prediction results that violate the physical laws of rapeseed under low light stress; Model training module: used to fuse the meteorological feature vector and the agronomic feature vector and input them into the classifier, and to perform optimization training by combining the contrast loss function and the physical constraint loss function to obtain the rapeseed low light stress level prediction model; Prediction output module: This module is used to input meteorological forecast data and agronomic characteristics of the area to be predicted into the prediction model and output the prediction results of the low light stress level.
[0024] The present invention has the following beneficial effects: Compared with existing technologies, this solution integrates agronomic mechanisms into deep learning models in both explicit and implicit ways through physical-guided comparison sample generation and physical constraint loss functions. This retains the data-driven fitting ability while ensuring that the prediction results conform to physical laws, thus solving the problem that pure data-driven models may produce predictions that violate common sense.
[0025] Compared with existing technologies, this solution explicitly models the spatiotemporal evolution and causal relationships of light scarcity stress using a temporal knowledge graph, and combines it with a graph neural network for knowledge propagation. This enables the model to learn the migration patterns of similar historical scenarios, thereby improving its ability to model long-range spatiotemporal dependencies.
[0026] Compared with existing technologies, this solution fully utilizes unlabeled meteorological data to learn general meteorological models through self-supervised pre-training of comparative learning, and combines causal transfer in knowledge graphs to effectively alleviate the problem of scarce labeled data for small-sample events such as severe stress, and significantly improve the prediction accuracy in small-sample scenarios.
[0027] Compared with existing technologies, this solution, through attention weighting mechanism and knowledge graph subgraph extraction, can trace the decision path of the model and output the ranking of the contribution of each factor to the prediction results, thus meeting the requirements of agricultural decision-making for model credibility.
[0028] Compared with existing technologies, this solution achieves the separation of meteorological model learning and agronomic response learning through the decoupling design of meteorological-agronomic dual-tower and the expansion of geographical nodes in the knowledge graph. This facilitates the transfer of pre-trained models to unlabeled target areas and has good regional generalization ability. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the overall process of the method of the present invention.
[0030] Figure 2 This is a diagram of the dual-tower comparison prediction network architecture of the present invention.
[0031] Figure 3 This is a schematic diagram of the first stage of the phased training strategy of the present invention.
[0032] Figure 4 This is a schematic diagram of the second stage of the phased training strategy of the present invention.
[0033] Figure 5 This is a schematic diagram of the third stage of the phased training strategy of the present invention. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0035] Example 1: This embodiment uses the rapeseed producing area of Jianghan Plain in Hubei Province as the application area and uses the method of the present invention to predict the degree of low light stress in rapeseed.
[0036] Step 1, Data Preparation Daily meteorological data for the region from 2010 to 2023 were collected, including sunshine duration, precipitation, daily average temperature, relative humidity, and photosynthetically active radiation. Agronomic data included rapeseed sowing date, variety shade tolerance level (categorized as shade-tolerant, moderate, and sensitive), and soil texture type. Historical low-sunlight stress levels were labeled according to industry standards based on the number of consecutive days without sunshine: 3-4 consecutive days for mild stress, 5-7 days for moderate stress, and ≥8 days for severe stress.
[0037] The data was divided into a training set (2010-2018), a validation set (2019-2020), and a test set (2021-2023). The time window T was set to 10 days, that is, the level of low light stress in the next 5 days was predicted using meteorological data from the past 10 days.
[0038] Step 2, Physically Guided Comparison Sample Generation A cumulative effect function of photosynthetically active radiation was constructed, with the sensitivity coefficient α set to 1.2 during the flowering period and β set to 0.5 during the seedling and silique stages. For each training sample, an adversarial sample for radiation redistribution was generated using an optimization algorithm. This method kept the sunshine duration statistics unchanged but reduced the intensity of photosynthetically active radiation, making the physiological stress equivalent to the effect of 3-5 consecutive days of low light. The original sample and the adversarial sample formed a contrast sample pair.
[0039] Step 3, Construction of Time-Series Knowledge Graph Construct a knowledge graph containing the following nodes: Meteorological event milestones: 3 consecutive days without sunshine, 5 consecutive days without sunshine, 7 consecutive days without sunshine, etc. Key developmental stages: seedling stage, budding stage, flowering stage, and pod-setting stage. Stress level markers: Mild, Moderate, Severe Geographical nodes: Jianghan Plain, Eastern Hubei, Northern Hubei, and other sub-regions Temporal edge definition: causal relationship edge (e.g., "flowering period" + "5 consecutive days without sunshine" → "moderate stress"), spatiotemporal propagation edge (e.g., moderate stress spreads from the Jianghan Plain to eastern Hubei, with a time lag of 3 days).
[0040] A 3-layer relation-aware graph convolutional network is used for encoding, with the hidden layer dimension set to 64 and the output graph embedding vector dimension set to 128.
[0041] Step 4, Dual-Tower Network Training The meteorological time-series coding tower uses a 2-layer BiLSTM with a hidden layer dimension of 128, and outputs a meteorological feature vector with a dimension of 128. The agronomic feature coding tower uses a 3-layer MLP, with the input being a concatenation of agronomic static features (growth period coding, variety shade tolerance level, and soil texture coding) and graph embedding vectors, and outputting an agronomic feature vector with a dimension of 128.
[0042] The comparison loss temperature parameter τ is set to 0.07, the physical constraint loss weights λ1 and λ2 are set to 0.5 and 0.1 respectively.
[0043] The Adam optimizer was used with an initial learning rate of 1e-4 and weight decay of 1e-5. Training was conducted in stages: the first stage was mask reconstruction pre-training for 20 epochs; the second stage was contrastive learning fine-tuning for 30 epochs; and the third stage was end-to-end joint training for 50 epochs.
[0044] Step 5, Evaluation of Prediction Results Evaluation was performed on the test set using metrics such as accuracy, macro-average F1 score, and confusion matrix. The results compared to the baseline method are as follows: Experimental results show that the method of the present invention is significantly superior to the prior art in terms of overall accuracy and prediction ability of severe stress.
[0045] Step 6, Interpretable Output Taking a moderate stress prediction as an example, the model outputs a decision path subgraph: Flowering stage → 7 consecutive days of no sunlight event → Moderate stress stage The attention weights were 0.32, 0.48, and 0.20, respectively.
[0046] The contribution of features is ranked as follows: consecutive days without sunshine (38% contribution), cumulative photosynthetically active radiation (25% contribution), growth period (flowering period, 18% contribution), precipitation (12% contribution), and others (7%). This output visually demonstrates the basis of the model's decision-making process, making it easier for agricultural technicians to understand and adopt.
[0047] Step 7, Transfer Learning Validation The pre-trained model from Hubei Province was transferred to Hunan Province, fine-tuned using only the static agronomic features of Hunan Province, and adapted using 10% of the labeled samples. After the transfer, the model achieved an accuracy of 81.3% on the Hunan Province test set, which is significantly better than directly using the Hubei model (72.6%) and training with only a small amount of data from Hunan (65.4%), verifying the cross-regional generalization ability of the method of this invention.
[0048] Example 2 This embodiment adds an uncertainty estimation function based on embodiment 1.
[0049] During the model inference phase, a dropout layer (dropout rate 0.2) is enabled, and 50 random forward propagations are performed to obtain the probability distribution of the prediction level. The prediction entropy value H is calculated, and a prediction is considered low-confidence when H > 0.5.
[0050] In one actual prediction, the model predicted a probability distribution of mild stress as [0.45, 0.40, 0.12, 0.03], with an entropy value H = 0.48, slightly below the threshold, prompting a high-confidence warning. In another prediction, the probability distribution was [0.35, 0.33, 0.22, 0.10], with an entropy value H = 0.62, exceeding the threshold. The system then output a low-confidence warning signal, suggesting further manual assessment.
[0051] This function provides a reliable basis for risk quantification in agricultural insurance loss assessment, avoiding erroneous payouts due to model uncertainty.
[0052] Industrial applicability The method of this invention can be deployed in scenarios such as agricultural meteorological service platforms, smart agricultural management systems, and agricultural insurance loss assessment systems. Specific applications include: As the core algorithm module of the agricultural meteorological disaster early warning system, it connects to meteorological forecast data and outputs a heat map of rapeseed under low sunlight stress risk on a daily basis.
[0053] As a backend service for smart agriculture apps, it provides growers with location-based personalized alerts and agricultural advice.
[0054] As a loss assessment tool for agricultural insurance companies, it traces the disaster process, quantifies yield reduction losses, and achieves automated loss assessment.
[0055] The method of this invention has broad application prospects in the main rapeseed producing areas of the Yangtze River Basin.
[0056] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of this invention is defined by the appended claims and their equivalents.
Claims
1. A machine learning-based method for predicting the stress level of rapeseed under low light conditions, characterized in that, Includes the following steps: S1: Obtain meteorological time-series data, agronomic static characteristic data, and historical low-sunlight stress level labels for the target area to construct a training sample set; S2: Based on the agricultural meteorological mechanism, a cumulative effect function of photosynthetically active radiation is constructed. By solving the constrained optimization problem, physical adversarial negative samples are generated to form a physical-guided comparison sample pair. S3: Construct a temporal knowledge graph. The nodes of the graph include meteorological event nodes, reproductive period nodes, stress level nodes, and geographical nodes. Temporal edges represent the causal relationships and spatiotemporal evolution relationships between nodes. A temporal graph convolutional network is used to embed and encode the graph nodes to obtain the graph embedding vector of each sample. S4: Construct a dual-tower comparative prediction network, including a meteorological time-series coding tower and an agronomic feature coding tower, to extract meteorological feature vectors and agronomic feature vectors that fuse agronomic static features and graph embedding vectors, respectively; S5: By comparing the loss function, the distance between the meteorological feature vector and the agronomic feature vector of the same sample in the latent space is narrowed, while the agronomic feature vectors of different samples are pushed further apart. S6: Construct a physical constraint loss function to penalize prediction results that violate the physical laws of rapeseed under low light stress; S7: After fusing meteorological feature vectors and agronomic feature vectors, the input is given to the classifier. The comparative loss function and the physical constraint loss function are combined for joint optimization training to obtain the rapeseed low light stress level prediction model. S8: Input the meteorological forecast data and agronomic characteristics of the area to be predicted into the prediction model, and output the prediction results of the low light stress level.
2. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 1, characterized in that, The method for producing the physically guided comparison sample pairs includes: Construct the cumulative effect function of photosynthetically active radiation, defined as: ,in, For meteorological time series data, The photosynthetically active radiation at time t This is a function indicating the flowering period. , The sensitivity coefficient for the reproductive period. The length of the historical time window; For meteorological time series data samples Under the constraint of keeping the mean of meteorological statistics constant, adversarial examples are generated by redistributing the radiation field. , making and Maximize the difference; The adversarial sample is used as the physical adversarial negative sample of the original sample to form a contrast sample pair.
3. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 1, characterized in that, The construction of the temporal knowledge graph and the temporal graph convolutional network encoding method specifically include: Define a time series knowledge graph ,in For a set of nodes, It is a temporal edge set, containing causal relationship edges and spatiotemporal propagation edges; A relation-aware graph convolutional network is used to encode the graph nodes. The hidden state update formula at time t is defined as follows: ,in, For a set of relations, To pass through relationships With nodes The set of connected neighbor nodes, The normalization constant is , The weight matrix is a learnable matrix. For activation functions; For the target sample, the hidden states of its associated nodes are aggregated using an attention pooling mechanism to obtain the graph embedding vector: Attention weights , For learnable query vectors, For vector transpose, For the sample The set of associated nodes, This is the set of corresponding time steps.
4. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 1, characterized in that, The meteorological time-series coding tower uses a bidirectional long short-term memory network to process historical meteorological time-series data. Encode the data to obtain meteorological feature vectors. The agronomic feature coding tower uses a multilayer perceptron network to encode agronomic static features. With graph embedding vectors The concatenation of these elements is encoded to obtain the agronomic feature vector; The feature vectors output by the two towers have the same dimension, which is the preset latent space dimension.
5. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 1, characterized in that, The contrast loss function adopts the improved InfoNCE loss function, which is specifically defined as: ,in For training batches, , These are meteorological feature vectors and agronomic feature vectors, respectively. For temperature parameters; The similarity function uses cosine similarity.
6. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 1, characterized in that, The method for constructing the physical constraint loss function includes: Define the physical consistency function: , For the predicted stress level, For meteorological time series data, It is a static characteristic of agronomy. To determine the degree of violation of the k-th physics rule, Let k be the weight of the k-th physical rule. This represents the total number of physical rules.
7. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 6, characterized in that, The physical rules include at least one of the following: a monotonic constraint rule between the number of consecutive days without sunshine during the flowering period and the stress level; a negative correlation constraint rule between the cumulative amount of photosynthetically active radiation and the stress level; and a coupling constraint rule between low light and waterlogging damage. The physical constraint loss function is: , This represents the number of samples.
8. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 1, characterized in that, The total loss function for joint optimization training is defined as: , The cross-entropy classification loss is defined as: , For the one-hot encoding of the true label of the i-th sample at the c-th stress level, This represents the corresponding predicted probability.
9. The method for predicting the stress level of rapeseed under low light conditions based on machine learning according to claim 8, characterized in that, The joint optimization training adopts a phased training strategy: In the first stage, only the meteorological time-series coding tower is used for mask reconstruction self-supervised pre-training, and the pre-training loss function is: , The set of time steps for a random mask. For decoder networks; In the second stage, the parameters of the meteorological time series coding tower are fixed, and the agronomic feature coding tower and contrast loss function are optimized. The third stage involves end-to-end joint optimization of all network parameters.
10. A machine learning-based system for predicting the level of low light stress in rapeseed, used to implement the steps of the method as described in any one of claims 1-9, characterized in that, include: Data acquisition module: used to acquire meteorological time-series data, agronomic static characteristics and historical stress level labels of the target area, and to build a training sample set; Physics-guided sample generation module: used to construct the cumulative effect function of photosynthetically active radiation, generate physics-adversarial negative samples through constraint optimization, and form a contrast sample pair; Temporal knowledge graph construction module: used to construct a temporal knowledge graph. The nodes of the temporal knowledge graph include meteorological event nodes, reproductive period nodes, stress level nodes, and geographical nodes. Temporal edges represent causal relationships and spatiotemporal evolution. A temporal graph convolutional network is used to embed and encode the graph nodes to obtain graph embedding vectors. Dual-tower contrast prediction network module: used to construct a dual-tower contrast prediction network, wherein the dual towers include a meteorological time-series coding tower and an agronomic feature coding tower. The meteorological time-series coding tower is used to extract meteorological feature vectors, and the agronomic feature coding tower is used to fuse agronomic static features with the graph embedding vector to obtain agronomic feature vectors. The contrastive learning module is used to bring the meteorological feature vector and the agronomic feature vector of the same sample closer together by using a contrastive loss function, while pushing the agronomic feature vector of different samples further apart. Physical constraint module: used to construct physical constraint loss function, and to penalize prediction results that violate the physical laws of rapeseed under low light stress; Model training module: used to fuse the meteorological feature vector and the agronomic feature vector and input them into the classifier, and to perform optimization training by combining the contrast loss function and the physical constraint loss function to obtain the rapeseed low light stress level prediction model; Prediction output module: This module is used to input meteorological forecast data and agronomic characteristics of the area to be predicted into the prediction model and output the prediction results of the low light stress level.