Training method of soil moisture prediction model, and soil moisture prediction method and device
By constructing a graph neural network and using multi-view fusion, combined with long-term dependency modeling and root activity simulation, a soil moisture prediction model was trained, which solved the problem of low accuracy in soil moisture prediction in greenhouses and achieved accurate characterization and efficient prediction of the internal environment of greenhouses.
Patent Information
- Application Number
- CN202510701389.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-10-17
AI Technical Summary
Existing technologies are unable to accurately depict the complex spatial distribution pattern of soil moisture in greenhouses, and have difficulty expressing the heterogeneity and spatial structure of the internal environment, resulting in low accuracy in soil moisture prediction.
A graph neural network is constructed, and the characteristics of multi-source heterogeneous data of samples and monitoring points in the greenhouse are utilized. Through graph convolution operations and multi-view fusion, combined with long-term dependency modeling and root activity simulation, the soil moisture prediction model is trained, and the prediction distribution is generated through a Bayesian neural network.
It improves the accuracy of greenhouse soil moisture prediction, accurately characterizes the heterogeneity of the internal environment and the spatial variability of soil moisture, and provides precise irrigation decision support.
Smart Images

Figure CN120808968A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of deep learning, in particular to a soil moisture prediction model training method, a soil moisture prediction method and device. BACKGROUND
[0002] In the greenhouse production system, water management is a decisive factor affecting crop growth and yield formation; due to the special spatial structure and microclimate environment of the greenhouse, the factors such as light, temperature and air flow inside the greenhouse show significant non-uniform distribution in space, which directly leads to the complex spatio-temporal heterogeneity of soil moisture recession law, and accurate prediction of the spatial distribution and dynamic change of soil moisture in the greenhouse is of great significance to realize intelligent irrigation.
[0003] In related technologies, the greenhouse soil moisture prediction method includes point measurement method, empirical formula method, physical model method and traditional machine learning method; the point measurement method monitors the soil moisture state by setting discrete measurement points in the greenhouse, but due to the limited number of measurement points, it cannot depict the complex water spatial distribution pattern in the greenhouse, resulting in insufficient representativeness of the monitoring; the empirical formula method is based on historical data and simplified assumptions to establish a mathematical relationship, which has low calculation accuracy and poor adaptability when the environmental conditions change or the crop varieties are replaced, and cannot reflect the dynamic change characteristics of the microenvironment inside the greenhouse; the physical model method uses Richards equation and other hydrology principles to establish partial differential equations, which has high calculation complexity and requires a large number of difficult-to-obtain soil hydraulic parameters, and faces the problems of parameter calibration difficulty and low calculation efficiency; the traditional machine learning method learns the water change law from historical data, but generally uses the homogenization assumption to regard the greenhouse as a homogeneous space, which is difficult to express the heterogeneity and spatial structure of the internal environment, and has low prediction accuracy for the spatial difference of the greenhouse soil moisture, resulting in low prediction accuracy of the greenhouse soil moisture. SUMMARY
[0004] The present application provides a soil moisture prediction model training method, a soil moisture prediction method and device to solve the defects that the existing greenhouse soil moisture prediction method cannot depict the complex water spatial distribution pattern in the greenhouse, is difficult to express the heterogeneity and spatial structure of the internal environment, and results in low prediction accuracy of the greenhouse soil moisture. The method improves the prediction accuracy of the greenhouse soil moisture.
[0005] The present application provides a soil moisture prediction model training method, comprising: In the greenhouse east-west ridge planting scene, the features composed of sample multi-source heterogeneous data and each monitoring point in the greenhouse are taken as graph node vectors, and the position correlation and water migration prediction between each graph node are taken as edge vectors to construct a graph neural network; wherein the sample multi-source heterogeneous data includes at least two of soil moisture sensing data, meteorological data and image monitoring data. The migration information of the soil moisture sensing data is reconstructed in three dimensions to obtain soil moisture movement characteristics, and the edge vector is updated according to the soil moisture movement characteristics; the soil moisture of different views is subjected to graph convolution operation to obtain a plurality of view features, the plurality of view features are sequentially fused and position coded, and the graph node vector is updated according to the coded view features to obtain an updated graph neural network; The target network is iteratively trained according to the sample multi-source heterogeneous data to obtain a soil moisture prediction model; wherein the target network comprises at least one of the updated graph neural network, a long-term dependency modeling unit and a root activity simulation unit; the long-term dependency modeling unit is used to predict the time evolution law of soil moisture; the long-term dependency modeling unit is used to predict the difference in soil moisture absorption capacity of crops at different growth stages and different positions.
[0006] According to the training method of the soil moisture prediction model provided by the application, the target network comprises the updated graph neural network; The target network is iteratively trained according to the sample multi-source heterogeneous data to obtain a soil moisture prediction model, comprising: A physical guidance loss function is determined according to the double physical constraints, and a joint loss function is determined in combination with a data-driven loss function; wherein one of the double physical constraints is used to describe the unsaturated soil moisture movement, and the other is used to describe the process of soil moisture returning to the atmosphere through evaporation and plant transpiration; The sample multi-source heterogeneous data is used as a training sample, the joint loss function is used as the loss function of the updated graph neural network, and the soil moisture prediction model is obtained under the condition that the maximum number of network iterations is met.
[0007] According to the training method of the soil moisture prediction model provided by the application, the target network comprises the long-term dependency modeling unit; The long-term dependency modeling unit is trained by the following steps: The time sequence information of the soil moisture is respectively subjected to time position coding and seasonal coding, and a time sequence graph sequence is obtained according to the time position coding result, the seasonal coding result and the updated graph node vector; The time sequence graph sequence is encoded based on a multi-head self-attention mechanism to obtain a time sequence graph sequence encoding representation; The time sequence graph sequence encoding representation is fused with event features to obtain fused features; wherein the event features comprise at least one of irrigation events, rainfall events and temperature anomaly events; The sample soil moisture data is used as a training sample, and the fusion feature is used as an input feature to iteratively train the Transformer network to obtain the long-term dependency modeling unit.
[0008] According to a soil moisture prediction model training method provided by the present invention, the target network includes the root activity simulation unit, and the root activity simulation unit supports integration with the updated graph neural network; The root activity simulation unit is trained by the following steps: Modeling the changes in root depth and horizontal extension radius of the target crop over time to obtain a root morphological development model; modeling the changes in root spatial density of the target crop over time to obtain a root density distribution model; modeling the changes in root water absorption rate of the target crop under different growth stages and environmental conditions to obtain a root water absorption model; The root activity simulation unit is constructed based on the root morphology development model, the root density distribution model and the root water absorption model.
[0009] According to a soil moisture prediction model training method provided by the present invention, after obtaining the soil moisture prediction model, the method further includes: Establishing a parameter prior distribution according to the model parameters of the soil moisture prediction model based on a Bayesian neural network; Generating a variational posterior distribution of the model parameters based on the parameter prior distribution and observation data by a variational inference method; performing Monte Carlo sampling on a plurality of soil moisture prediction results output by the soil moisture prediction model based on the variational posterior distribution to obtain a soil moisture prediction distribution; Constructing a deep integrated uncertainty decomposition module based on the predicted probability distribution, and calculating the uncertainty components through the variance of each model; A risk-aware decision model is constructed based on the predicted probability distribution and the uncertainty component, and a target irrigation decision plan is generated by minimizing the expected risk function of the risk-aware decision model.
[0010] The present invention also provides a soil moisture prediction method, comprising: Obtain the spatiotemporal graph features corresponding to the measured multi-source heterogeneous data in the east-west ridge planting scenario of the greenhouse; The spatiotemporal graph features are processed based on a soil moisture prediction model to obtain a target soil moisture prediction result; wherein, the soil moisture prediction model is trained using the soil moisture prediction model training method.
[0011] The present invention also provides a training device for a soil moisture prediction model, comprising: a network construction module, configured to construct a graph neural network in a greenhouse east-west ridge planting scene, with sample multi-source heterogeneous data and features of each monitoring point in the greenhouse as graph node vectors, and with position correlation and water migration prediction between the graph nodes as edge vectors; wherein the sample multi-source heterogeneous data comprises at least two of soil moisture sensing data, meteorological data, and image monitoring data; a network updating module, configured to perform three-dimensional reconstruction on migration information of the soil moisture sensing data to obtain soil moisture movement characteristics, and update the edge vectors according to the soil moisture movement characteristics; perform graph convolution operation on different views of the soil moisture to obtain a plurality of view features, sequentially perform fusion and position coding on the plurality of view features, and update the graph node vectors according to the coded view features to obtain an updated graph neural network; a training module, configured to iteratively train a target network according to the sample multi-source heterogeneous data to obtain a soil moisture prediction model; wherein the target network comprises at least one of the updated graph neural network, a long-term dependency modeling unit, and a root activity simulation unit; the long-term dependency modeling unit is configured to predict a soil moisture time evolution law; and the long-term dependency modeling unit is configured to predict differences in soil moisture absorption capacity of crops at different growth stages and different positions.
[0012] The application further provides a soil moisture prediction device, comprising: a feature extraction module, configured to obtain spatio-temporal graph features corresponding to measured multi-source heterogeneous data in a greenhouse east-west ridge planting scene; a prediction module, configured to process the spatio-temporal graph features based on a soil moisture prediction model to obtain a target soil moisture prediction result; wherein the soil moisture prediction model is obtained by training the soil moisture prediction model according to the soil moisture prediction model training method.
[0013] The application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the soil moisture prediction model training method or the soil moisture prediction method according to any one of the above when executing the computer program.
[0014] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the soil moisture prediction model training method or the soil moisture prediction method according to any one of the above.
[0015] The present invention provides a training method for a soil moisture prediction model, a soil moisture prediction method, and a device. In a greenhouse east-west ridge planting scenario, a graph neural network is constructed using the features composed of sample multi-source heterogeneous data and each monitoring point in the greenhouse as a graph node vector, and the position association between each graph node and the moisture migration prediction amount as an edge vector. The migration information of the soil moisture sensor data is three-dimensionally reconstructed to obtain soil moisture movement characteristics and update the edge vectors accordingly. Graph convolution operations are then performed on different views of the soil moisture to obtain multiple view features, which are fused and position-encoded in sequence. The graph node vectors are updated according to the encoded view features to obtain an updated graph neural network. Finally, the target network is iteratively trained according to the sample multi-source heterogeneous data to obtain a soil moisture prediction model. The model can accurately characterize the heterogeneity of the internal environment of the greenhouse and the spatial differences in soil moisture, thereby improving the accuracy of greenhouse soil moisture prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 This is one of the flow charts of the training method of the soil moisture prediction model provided by the present invention.
[0018] Figure 2 This is the second flow chart of the training method of the soil moisture prediction model provided by the present invention.
[0019] Figure 3 It is a flow chart of the soil moisture prediction method provided by the present invention.
[0020] Figure 4 It is a structural schematic diagram of the training device of the soil moisture prediction model provided by the present invention.
[0021] Figure 5 It is a structural schematic diagram of the soil moisture prediction device provided by the present invention.
[0022] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0023] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0024] The following combination Figures 1-5 The present invention describes a soil moisture prediction model training method, a soil moisture prediction method and a soil moisture prediction device.
[0025] Figure 1 This is one of the flow charts of the training method of the soil moisture prediction model provided by the present invention, such as Figure 1 As shown, the method includes the following steps: Step 110: In the greenhouse east-west ridge planting scenario, a graph neural network is constructed using the features of the sample multi-source heterogeneous data and each monitoring point in the greenhouse as graph node vectors, and the position association between each graph node and the moisture migration prediction amount as edge vectors; wherein the sample multi-source heterogeneous data includes at least two of soil moisture sensor data, meteorological data, and image monitoring data.
[0026] In this step, a variety of different types of sensors are usually deployed in the greenhouse environment, including soil moisture sensors, weather stations, image monitoring equipment, etc., which provide a rich heterogeneous data source. Specifically, a differentiable spatiotemporal interpolation strategy is used to solve the sparse arrangement of sensors and achieve continuous representation of the moisture status of the entire greenhouse.
[0027] In this embodiment, the following problems exist in the fusion of multi-source heterogeneous sensor data: (1) Data from different sensors have different sampling frequencies, spatial coverage, and accuracy; (2) Sensors are usually sparsely arranged, making it difficult to directly obtain continuous observations of the entire greenhouse; (3) Different types of data need to be unified into a common representation space. This embodiment designs the following fusion method: First, define the sensor network in the greenhouse; assume that Soil moisture sensors , each sensor The corresponding spatial position coordinates (x, y, z) are expressed as: Position , at the moment The measured soil moisture value is In addition, a weather station is deployed in the greenhouse to provide environmental parameters such as temperature , relative humidity , light intensity etc., as well as image monitoring equipment, providing image data of crop growth status The following will introduce the data processing methods of each type in detail: (1) For soil moisture sensor data, a spatio-temporal interpolation method is used to infer the continuous distribution of the whole greenhouse from sparse observation points. Specifically, a differentiable interpolation strategy based on physics is used in combination with Kriging interpolation and partial differential equation constraints to obtain soil moisture distribution data at different times and different locations in the greenhouse : ; wherein is the weight of the position and time of the sensor , is the correction term, m denotes the number of sensors, M denotes the total number of sensors.
[0028] The weight is calculated by considering the spatial distance and environmental similarity: ; wherein is the kernel function, defined as: ; wherein and are the length scale parameters of the spatial and environmental kernels, is the environmental feature vector of the position at time .
[0029] wherein the correction term is obtained by solving the constrained partial differential equation, which is based on the Richards equation and boundary conditions; specifically, satisfies the following equation: ; wherein is the source term, which can reflect the influence of environmental factors on soil moisture; is the Laplacian operator, representing spatial diffusion; is expressed by: ; wherein , , and , are weight coefficients, are the average values of the corresponding variables, T(p, t) is the root density; I is the actual temperature, p , t) is actual irrigation / precipitation amount; ET ( p , t ) is actual evapotranspiration amount, is root density.
[0030] In this embodiment, the partial differential equation corresponding to the following boundary conditions is discretized and solved by finite difference method to obtain the above-mentioned soil volumetric water content , thereby completing the continuous interpolation of soil moisture: Surface boundary: wherein is the surface flux, is the hydraulic conductivity; Bottom boundary: wherein is the depth of the calculation domain; Side boundary: wherein is the side boundary, is the normal vector.
[0031] The above-mentioned partial differential equation is discretized and solved by finite difference method to obtain the correction term , thereby completing the continuous interpolation of soil moisture.
[0032] (2) For the meteorological station data, first, a microclimate model in the greenhouse is constructed, and the temperature spatial distribution , humidity spatial distribution and light spatial distribution are described by the following formulas: ; ; ; wherein, and are the temperature and humidity deviations of the position relative to the meteorological station, is the light distribution function; the above-mentioned function is determined by physical model and empirical formula, for example, is calculated by the following formulas: and : ; ; ; wherein, is the horizontal coordinate of the center of the greenhouse, is the reference height, , , , 、 、 、 and are model parameters.
[0033] (3) For image monitoring data, a deep learning method is used to extract crop growth status features. First, a pre-trained convolutional neural network (CNN) is used to extract the crop growth status features from the input image. Extract image features , specifically expressed by the following formula: ; Then, the image features are mapped to the crop physiological state space through feature transformation, which is specifically expressed by the following formula: ; in, Includes leaf area index , plant height , biomass and other physiological parameters.
[0034] Finally, the multi-source heterogeneous data are fused into the node features of the graph neural network; specifically, for the moment Node Located in , the fused features Expressed as: ; ; In this embodiment, in order to deal with the missing and noise problems of different sensor data, an adaptive data quality assessment mechanism is introduced; for each data source, a quality indicator is defined Representation data Reliability; this quality indicator is calculated based on multiple factors, including sensor accuracy, data volatility, and consistency with historical data.
[0035] Specifically, multi-source heterogeneous data is integrated into the node features of the graph neural network, and then the weights of each data source are dynamically adjusted according to the quality index to obtain the final fusion features. It can be expressed by the following formula: ; in, Is the data source Features provided, is the corresponding transformation matrix, It’s data quality.
[0036] The embodiment realizes the integration of various types of sensing data in the greenhouse by the above multi-source heterogeneous sensing data fusion method, especially solves the problem of sparse arrangement of sensors through the differentiable spatio-temporal interpolation strategy, realizes the continuous representation of the whole greenhouse water state, fully utilizes the complementarity of various types of sensing data, and improves the perception ability of the spatial and temporal distribution of soil moisture in the greenhouse.
[0037] In this embodiment, the greenhouse environment has obvious spatial heterogeneity, and environmental factors such as light, temperature and air flow present non-uniform characteristics in spatial distribution, resulting in complex spatio-temporal variation patterns of soil moisture recession law. In order to accurately depict the spatial difference.
[0038] In view of the above problems, the embodiment models the monitoring points distributed in the greenhouse as graph network nodes by constructing a hierarchical spatio-temporal graph of the east-west ridge of the greenhouse, and introduces various physical characteristics as node features. The physical correlation and water migration possibility between positions are expressed through edges, and a graph neural network is constructed in turn, so as to form a graph structure capable of fully expressing the complex water dynamic characteristics in the greenhouse.
[0039] Specifically, for any monitoring point in the greenhouse , which is represented as a node in the graph , wherein is the node set of the graph , and is the edge set; each node carries a feature vector , wherein is the feature dimension; the node feature vector is a fused representation of multiple physical properties: ; wherein, denotes a feature connection operation, and each feature component is defined as follows: represents a position feature, which is encoded by using a spherical harmonic function: ; wherein, and are the zenith angle and azimuth angle of the point in the greenhouse, is a spherical harmonic function with order , and order , which is defined as: ; wherein, is a Legendre polynomial, which preserves the relative relationship of the position and can better capture the spherical characteristics of the position in the greenhouse than a simple Cartesian coordinate encoding.Indicates soil characteristics, including soil texture, bulk density, organic matter content, etc. It is expressed by the following formula: ; in, 、 and respectively represent points Content of clay, silt and sand in the soil at Indicates soil bulk density (g / cm³), Indicates the organic matter content (%), represents the saturated hydraulic conductivity (cm / day), and represent the saturated water content and residual water content respectively (cm³ / cm³).
[0040] Represents the characteristics of environmental factors, mainly including light intensity gradient and air flow characteristics: ; in, Indicates a point Light intensity at (W / m²), 、 and represent the light intensity in 、 and directional gradients (W / m³), 、 and represent the air velocity in 、 and direction components (m / s).
[0041] Represents the temperature distribution characteristics: ; in, Indicates a point Temperature at (°C), 、 and represent the temperature in 、 and directional gradient (°C / m).
[0042] In this embodiment, for the edge set of the graph ,adopts an edge connection strategy based on physical meaning, that is, an edge connection is established between two nodes if and only if the two nodes meet specific physical association conditions.
[0043] Specifically, for any two nodes and , an edge is established between them when they meet any of the following conditions : (1) Spatial proximity: when the Euclidean distance between two points does not exceed a threshold i.e. where is usually set to 30 cm; (2) Hydraulic connectivity: when there is a significant hydraulic gradient between two points, and the soil medium allows water conduction, i.e. and where denotes the water potential (kPa) at point denotes the average hydraulic conductivity (cm / day) between two points, and are the thresholds of hydraulic gradient and hydraulic conductivity, respectively, which are usually set to kPa and cm / day.
[0044] In this embodiment, the edge vector is defined as: ; where denotes the Euclidean distance (cm) between two points, denotes the elevation difference (cm) between two points, denotes the average soil water content (cm³ / cm³) between two points, denotes the equivalent hydraulic conductivity (cm / day) between two points, denotes the water potential difference (kPa), denotes the angle (rad) between the edge direction and the gravity direction.
[0045] In this embodiment, to characterize the temporal evolution characteristics of soil moisture in the greenhouse, the graph structure is expanded to a time graph sequence where denotes the graph structure at time ; for each time , the node features are dynamically updated over time: ; where denotes the soil moisture state features at point at time : ; where denotes the volumetric water content (cm³ / cm³) at point at time , denotes the corresponding soil water potential (kPa), denotes the time backtracking window length, denotes a time step (h).
[0046] In this embodiment, by using the above-mentioned greenhouse east-west ridge hierarchical spatio-temporal graph representation construction method, the spatial distribution of soil moisture in the greenhouse and the dynamic evolution characteristics thereof are comprehensively described, which provides a solid data representation basis for subsequent soil moisture prediction based on a graph neural network; and fully considering the spatial heterogeneity of the greenhouse environment and the physical law of soil moisture migration, the subsequent model learning and prediction tasks can be supported.
[0047] In step 120, the migration information of the soil moisture sensing data is reconstructed in three dimensions to obtain soil moisture movement characteristics, and an edge vector is updated according to the soil moisture movement characteristics; a graph convolution operation is performed on different views of the soil moisture to obtain a plurality of view features, the plurality of view features are sequentially fused and position encoded, and a graph node vector is updated according to the encoded view features to obtain an updated graph neural network.
[0048] It should be noted that the greenhouse east-west ridge presents obvious differentiation characteristics due to the influence of factors such as illumination and temperature distribution, which will directly affect the distribution and dynamic change of soil moisture; in order to fully capture the differentiation, a multi-view graph convolution module for east-west ridge differentiation is developed in this embodiment, a soil moisture migration graph network is constructed from a horizontal cross-section and a vertical cross-section, and a complex three-dimensional water movement feature is captured through view fusion to solve the limitations of traditional single-view modeling.
[0049] In this step, the migration information of the soil moisture sensing data can be reconstructed in three dimensions by using a multi-view graph convolution module; the core idea of the multi-view graph convolution module is to decompose the soil moisture movement in a three-dimensional space into two-dimensional movements in different plane views, and then reconstruct the complete three-dimensional dynamic characteristics through a specific view fusion mechanism.
[0050] Specifically, for the spatial structure characteristics of the greenhouse east-west ridge, three main views can be designed: a horizontal cross-section view (a vertical cross-section along the east-west direction), a vertical cross-section view (a vertical cross-section along the south-north direction), and a plane view (a horizontal cross-section); the specific operation is as follows: (1) Define a view projection function , which is used to project the original three-dimensional graph to a two-dimensional graph of a specific view ; for each view , the projected graph has the same node set as the original graph, but the edge set is redefined according to the view characteristics: ; ; ; wherein, represents a node corresponding spatial coordinates, , and are projection tolerance parameters, usually set to 5 cm.
[0051] (2) For each view graph , a specific graph convolutional network is designed for feature extraction. The graph convolutional operation on the view is defined as: ; wherein, is the node feature matrix of the view at the layer, is the adjacency matrix of the view plus a self-loop, is the degree matrix of , is a learnable weight matrix, is an activation function.
[0052] In this embodiment, in order to enhance the expression ability of the model to the east-west ridge difference, a direction-aware graph convolutional operation is introduced on the horizontal view: ; wherein, and are the adjacency matrices of the east and west directions respectively, and are the corresponding degree matrices, and are direction-specific weight matrices.
[0053] Similarly, a south-north direction-aware graph convolutional operation is introduced on the vertical view: ; On the plan view, considering the influence of the greenhouse roof shape on the light distribution, a radiation field-aware graph convolutional operation can be introduced, represented as follows: ; wherein, is the adjacency matrix corresponding to the radiation field , and is the total number of radiation fields.
[0054] In this embodiment, through the above view-specific graph convolutional operations, each view learns to view-specific node representation respectively.
[0055] In this embodiment, a weighted fusion strategy based on self-attention is used to integrate the features of each view into a unified node representation, which is specifically expressed as follows: ; in, Is a view The attention weight of is calculated by the self-attention mechanism as follows: ; in, is the query transformation matrix, is the bias vector, is the query vector.
[0056] In this embodiment, in order to further enhance the model's ability to perceive the difference between the east and west ridges, the east and west ridge position codes are calculated using the following formula: ; in, is the frequency coefficient, is a node The coordinate in the east-west direction.
[0057] Combine the position encoding with the fused node representation to obtain the updated graph node vector: ; in, is the weight coefficient of position encoding.
[0058] In this embodiment, the above-mentioned multi-view graph convolution module for the east-west ridge difference is used to capture the complex three-dimensional water movement characteristics in the greenhouse, especially the accurate expression of the east-west ridge difference. Through the decomposition and fusion of multiple views, the complex water movement pattern in the three-dimensional space is decomposed into a manageable pattern on a two-dimensional plane, and then fused through the self-attention mechanism, thereby improving the model's ability to express the spatial heterogeneity of soil moisture in the greenhouse.
[0059] Step 130: Iteratively train the target network based on the sample multi-source heterogeneous data to obtain a soil moisture prediction model; wherein the target network includes at least one of the updated graph neural network, the long-term dependency modeling unit, and the root activity simulation unit; the long-term dependency modeling unit is used to predict the temporal evolution of soil moisture; and the long-term dependency modeling unit is used to predict the differences in soil moisture absorption capacity of crops at different growth stages and locations.
[0060] In this step, the target network can include one or more of the updated graph neural network, the long-term dependency modeling unit and the root activity simulation unit obtained in steps 110-120, and dynamically predict the soil moisture in the greenhouse from multiple dimensions such as space, time and physiological characteristics of the soil moisture distribution.
[0061] In this embodiment, the target network can include the updated graph neural network, and the updated graph neural network can be optimized by using multiple physical constraints reflecting the characteristics of water movement and evaporation, thereby improving the expression capability of the soil moisture prediction model for the spatial heterogeneity of the soil moisture in the greenhouse.
[0062] In this embodiment, the target network can further include the long-term dependency modeling unit, which is used to capture the time evolution law of the soil moisture in the greenhouse while considering the influence of discrete interventions such as irrigation events and weather changes, thereby improving the depiction precision of the time-dependent characteristics of the dynamic performance of the soil moisture prediction model for the soil moisture in the greenhouse, and further improving the accuracy of the soil moisture prediction result.
[0063] In this embodiment, the target network can further include the root activity simulation unit, which is used to dynamically represent the difference in the soil moisture absorption capacity of crops at different growth stages and different positions, thereby improving the biological rationality of the model and further improving the accuracy of the soil moisture prediction result.
[0064] The training method of the soil moisture prediction model provided in the embodiments of the present application can be used to construct a graph neural network by taking the features composed of sample multi-source heterogeneous data and each monitoring point in the greenhouse as a graph node vector and taking the position correlation and water migration prediction quantity between each graph node as an edge vector, perform three-dimensional reconstruction on the migration information of the soil moisture sensing data, obtain the soil moisture movement characteristics and update the edge vector, perform graph convolution operation on different views of the soil moisture, obtain multiple view features and sequentially perform fusion and position coding, update the graph node vector according to the coded view features, obtain the updated graph neural network, and finally iteratively train the target network according to the sample multi-source heterogeneous data to obtain the soil moisture prediction model, which can accurately represent the heterogeneity of the internal environment of the greenhouse and the spatial difference of the soil moisture, and improve the prediction accuracy of the soil moisture in the greenhouse.
[0065] In some embodiments, the target network includes the updated graph neural network, and the iterative training of the target network according to the sample multi-source heterogeneous data to obtain the soil moisture prediction model includes: The physical-guided loss function is determined according to the dual physical constraints, and the joint loss function is determined in combination with the data-driven loss function. Among them, one constraint in the dual physical constraints is used to describe the movement of unsaturated soil moisture, and the other constraint is used to describe the process of soil moisture returning to the atmosphere through evaporation and plant transpiration. The multi-source heterogeneous data of the samples are used as training samples, and the joint loss function is used as the loss function of the updated graph neural network. Under the condition of meeting the maximum number of network iterations, a soil moisture prediction model is obtained.
[0066] In this embodiment, based on the updated graph neural network for obtaining the spatiotemporal graph representation of the greenhouse, the water transport equation and the evapotranspiration model are integrated as explicit constraints through a graph neural network architecture with dual physical constraints to ensure that the prediction results conform to physical laws. At the same time, an adaptive attention mechanism is introduced to dynamically adjust the parameter weights according to the environmental characteristics of different locations to improve the model's ability to express the spatial heterogeneity of soil moisture in the greenhouse.
[0067] This embodiment combines the data-driven learning capabilities of graph neural networks with physics-based water migration theory. By guiding graph neural network training through physical information, the network can not only learn complex nonlinear relationships from data, but also follow the basic physical laws of soil water movement.
[0068] Specifically, physical information-guided graph neural network training is achieved through the following steps: (1) Define the graph convolution operation based on the message passing mechanism. Image , No. The node feature update formula of the layer is: ; in, Indicates time node In the The hidden state of the layer, Representation node The neighbor set of Indicates time Slave nodes To Node The Aggregate function is responsible for aggregating information from neighboring nodes, and the Update function is responsible for updating the hidden state of the current node.
[0069] (2) For the Aggregate function, the attention mechanism with edge features is adopted, which is specifically expressed as: ; in, is a learnable transformation matrix, is the adaptive attention coefficient, which is calculated by the following formula: ; where, and are learnable projection matrices, is a learnable attention vector, and LeakyReLU is an activation function.
[0070] (3) For the Update function, a gated update mechanism is adopted: ; where, denotes element-wise multiplication, is the update gate, is the candidate hidden state: ; ; where, is the Sigmoid activation function, and are learnable weight matrices.
[0071] (4) In order to introduce physical constraints into the model, a double physical constraint corresponding loss function is designed, that is, the first constraint is based on Richards equation, which is used to describe the partial differential equation of unsaturated soil water movement, and the equation is expressed as follows: ; where, is the volumetric water content, is the unsaturated hydraulic conductivity, is the soil water potential, is the elevation.
[0072] In the discretized form, we can get: ; where, is the contact area (cm²) between node and node , is the control volume (cm³) represented by node .
[0073] Based on this, the Richards physical constraint loss is defined as: ; where, and are the volumetric water content and soil water potential predicted by the model, respectively.
[0074] The second constraint is based on the Penman-Monteith evapotranspiration model, which describes the process of soil water returning to the atmosphere through evaporation and plant transpiration, and is expressed as: ; where, is the evapotranspiration rate (mm / day), is the slope of the saturation vapor pressure curve (kPa / °C), is the net radiation (MJ / m² / day), is the soil heat flux (MJ / m² / day), is the air density (kg / m³), is the air pressure-specific heat capacity (MJ / kg / °C), is the saturated water vapor pressure (kPa), is the actual water vapor pressure (kPa), is the aerodynamic resistance (s / m), is the surface resistance (s / m), is the psychrometric constant (kPa / °C).
[0075] (5) For each node , the local evapotranspiration rate can be calculated according to its location and environmental conditions ; Specifically, based on the principle of soil water mass conservation, the evapotranspiration physical constraint loss is defined as: ; where, is the root layer depth (cm) at point .
[0076] (6) By integrating the above two physical constraints, the physical guidance loss function is defined as: ; where, and are hyperparameters that weigh the importance of the two physical constraints.
[0077] At the same time, in order to ensure the accuracy of the model prediction, the data-driven loss function is defined as: ; Finally, the total loss function of the model is: ; where, is the hyperparameter that controls the importance of the physical constraint.
[0078] In this embodiment, the sample multi-source heterogeneous data is taken as the training sample, the corresponding spatio-temporal feature map is obtained according to the sample multi-source heterogeneous data, and the updated graph neural network is taken as the loss function of the joint loss function. Under the condition of meeting the maximum network iteration number, the soil moisture prediction model is obtained.
[0079] The training method of the soil moisture prediction model provided in the embodiment of the application guides the training process of the updated graph neural network through the physical guidance loss function determined by the double physical constraints, realizes the organic combination of data-driven learning and physical law constraints, ensures that the model prediction result not only conforms to the observation data but also meets the physical law of soil moisture movement, is suitable for the differentiated prediction task of soil moisture in the greenhouse environment, and can capture spatial heterogeneity and dynamic evolution characteristics.
[0080] In some embodiments, the target network includes a long-term dependency modeling unit; the long-term dependency modeling unit is trained by the following steps: The time sequence information of the soil moisture is respectively time position encoded and seasonally encoded, and a time sequence graph sequence is obtained according to the time position encoding result, the seasonal encoding result and the updated graph node vector; the time sequence graph sequence is encoded based on a multi-head self-attention mechanism to obtain a time sequence graph sequence encoding representation; the time sequence graph sequence encoding representation is fused with event features to obtain fused features; wherein the event features include at least one of an irrigation event, a rainfall event and a temperature anomaly event; the sample soil moisture data is taken as a training sample, and the fused features are taken as input features to iteratively train the Transformer network to obtain the long-term dependency modeling unit.
[0081] It should be noted that the greenhouse soil moisture dynamics is not only affected by spatial heterogeneity, but also shows obvious time-dependent characteristics, including seasonal changes, crop growth period evolution and the influence of discrete irrigation events. In order to capture the above-mentioned time-dependent characteristics, a long-term dependency modeling unit based on Transformer is constructed to realize accurate modeling of the time evolution law of greenhouse soil moisture.
[0082] In the embodiment, the Transformer architecture is applied to the modeling of the time sequence graph sequence to capture the long-term time dependency of the greenhouse soil moisture; the specific process is as follows: (1) For each time , the node representation is obtained through the aforementioned multi-view graph convolution module; in order to capture the time dependency, a sequence with a time window of is constructed; in order to encode the time information, time position encoding is introduced, as shown below: ; wherein, is a relative time index, is a frequency coefficient.
[0083] Meanwhile, in order to encode seasonal information, a periodic time encoding is introduced as follows: ; where, is the time of day corresponding to the day of the year, is the time of day corresponding to the year.
[0084] (2) Combine the time position encoding and seasonal encoding with the node representation to obtain a time series graph sequence by the following formula: : ; (3) Apply a multi-head self-attention mechanism to process the time series; the specific operation is as follows: (3.1) Define the query (Query), key (Key) and value (Value) transformations: ; where, is a learnable transformation matrix.
[0085] (3.2) Calculate the self-attention weight: ; where, is a mask matrix used to realize causal attention and ensure that time can only pay attention to the information of time : ; (3.3) Based on the attention weight, calculate the weighted value matrix: ; For the multi-head attention mechanism, the above process is executed times in parallel to obtain outputs , and then the h outputs are spliced and linearly transformed to obtain the final output: ; where, is a learnable output transformation matrix.
[0086] (4) Apply a feedforward neural network to process the output of the multi-head attention: ; where, , , and are learnable parameters.
[0087] To stabilize training, residual connections and layer normalization are added after multi-head attention and feed-forward network respectively: ; ; The above process constitutes a Transformer encoder layer; by stacking such encoder layers, a deep Transformer network is formed, and finally an encoded representation of the time series sequence is obtained.
[0088] (5) To handle discrete intervention events (such as irrigation events, weather changes, etc.), an event-aware mechanism is introduced; this embodiment defines an event feature matrix where each element represents the feature of event type on node at time . Event types include irrigation events, rainfall events, temperature anomaly events, etc.
[0089] where the event features are fused with the output of the Transformer encoder through a gating mechanism: ; ; where , , and are learnable parameters, is a Sigmoid activation function, represents element-wise multiplication.
[0090] In this embodiment, the sample soil moisture data is used as the training sample, and the multi-head Transformer network is iteratively trained with the fused features as the input features to obtain the corresponding long-term dependency modeling unit; and through the prediction head of the long-term dependency modeling unit, the final representation is mapped to the soil moisture prediction at future time: ; where MLP is a multi-layer perception composed of multiple fully connected layers and nonlinear activation functions.
[0091] In this embodiment, to improve the model's adaptability to different time scales, a multi-scale prediction head is designed for short-term (1-6 hours), medium-term (1-3 days), and long-term (1-2 weeks) prediction: ; ; ; The training method of the soil moisture prediction model provided by the embodiment of the application realizes accurate modeling of the time evolution law of greenhouse soil moisture, especially the capture of the influence of seasonal changes, growth period characteristics and discrete intervention events, in combination with the aforementioned spatial modeling module, constitutes a complete spatiotemporal modeling framework, and provides a solid foundation for differentiated dynamic prediction of greenhouse soil moisture.
[0092] In some embodiments, the target network comprises a root activity simulation unit that supports integration with the updated graph neural network; the root activity simulation unit is trained by the following steps: The change amount of the root depth and the horizontal extension radius of the target crop at different times is modeled to obtain a root morphology development model; the change amount of the root spatial density of the target crop at different times is modeled to obtain a root density distribution model; the change amount of the water absorption rate of the root of the target crop at different growth stages and environmental conditions is modeled to obtain a root water absorption model; and the root activity simulation unit is constructed based on the root morphology development model, the root density distribution model and the root water absorption model.
[0093] It should be noted that different crops (such as tomatoes, cucumbers, etc.) in the greenhouse exhibit significant physiological differences at different growth stages, which directly affect the root's ability to absorb soil moisture and distribution characteristics. In order to accurately depict the differentiated characteristics, the embodiment designs a root activity simulation module based on crop physiological characteristics, dynamically representing the differences in the ability of crops at different growth stages and different locations to absorb soil moisture, and improving the biological rationality of the model.
[0094] In this embodiment, the root activity simulation module is based on crop physiology principles to construct mathematical models that can represent root growth and development, spatial distribution and water absorption characteristics, and seamlessly integrate them with the aforementioned updated graph neural network; the specific design steps of the root activity simulation module are as follows: (1) Design a root morphology development model to describe the morphological changes of the root during growth. For a crop (such as tomato or cucumber), the root depth and the horizontal extension radius at the growth day are modeled as: ; ; wherein, and Maximum root depth (cm) and maximum horizontal extension radius (cm) of the crop, respectively, and is the growth rate coefficient (1 / day).
[0095] (2) Design a root density distribution model to describe the spatial distribution characteristics of roots. A three-dimensional Gaussian distribution function is used to describe the root density: ; where, is the spatial coordinate (cm) relative to the plant position, is the maximum root density (g / cm³), is the standard deviation in the horizontal direction (cm), is the standard deviation in the vertical direction (cm), is the vertical position of the root density center (cm).
[0096] The above parameters are related to the number of days of growth : ; ; ; ; where, , , , , and are crop-specific parameters.
[0097] (3) Design a root water uptake model to describe the water uptake characteristics of roots. According to the Feddes model, the water uptake rate of unit volume of roots can be expressed as: ; where, is the soil water potential (kPa), is the water stress response function, is the maximum water uptake rate (cm³ / g / day).
[0098] The water stress response function is defined as: ; where, , , and are crop-specific water potential thresholds (kPa). For tomatoes, typical values are: kPa, kPa, kPa, kPa; for cucumber, typical values are: kPa, kPa, kPa, kPa.
[0099] Maximum water uptake rate is related to the transpiration demand of the crop: ; where, is the potential transpiration rate (mm / day), is the total root mass (g): ; Potential transpiration rate is related to the crop growth stage and environmental conditions: ; where, is the crop coefficient, is the reference crop evapotranspiration (mm / day), is the extinction coefficient, is the leaf area index.
[0100] Leaf area index is modeled as: ; where, is the maximum leaf area index, is the total growth period (day), is the shape parameter.
[0101] Integrating the above root system model with the graph neural network model, first, the root density and water uptake rate at the location of each node are calculated, and then the above root characteristics are taken as part of the node features: ; ; where, is the original node feature, is the root characteristic feature.
[0102] In the model training process, a root water uptake constraint loss function is introduced: ; wherein the loss function ensures that the soil moisture change predicted by the model is consistent with the root water uptake model.
[0103] The training method of the soil moisture prediction model provided in the embodiments of the present application realizes accurate characterization of the differences in root activity of different crops and different growth stages through the root activity simulation module based on crop physiological characteristics, especially dynamic simulation of the spatial distribution of roots and water absorption characteristics, and in combination with the aforementioned spatio-temporal graph neural network model, improves the prediction ability and biological rationality of the model for the differentiated dynamics of soil moisture in the greenhouse.
[0104] In some embodiments, after obtaining the soil moisture prediction model, the training method of the soil moisture prediction model further comprises: establishing a parameter prior distribution based on the Bayesian neural network according to the model parameters of the soil moisture prediction model; generating a variational posterior distribution of the model parameters according to the parameter prior distribution and the observation data through a variational inference method; performing Monte Carlo sampling on the plurality of soil moisture prediction results output by the soil moisture prediction model based on the variational posterior distribution, to obtain a soil moisture prediction distribution; constructing a deep ensemble uncertainty decomposition module based on the prediction probability distribution, and calculating uncertainty components through the variance of each model; constructing a risk-aware decision model based on the prediction probability distribution and the uncertainty components, and generating a target irrigation decision scheme by minimizing the expected risk function of the risk-aware decision model.
[0105] It should be noted that in the greenhouse environment, due to factors such as measurement error, model simplification and environmental complexity, soil moisture prediction inevitably has uncertainty. In order to quantify the uncertainty and provide a scientific basis for risk-aware decision making, the present embodiment designs a probability prediction framework for uncertainty awareness, and quantifies the uncertainty of soil moisture prediction by combining a variational inference method, to avoid insufficient or excessive irrigation caused by prediction errors.
[0106] In this embodiment, the probability prediction framework for uncertainty awareness is based on the Bayesian neural network theory, which regards the model parameters as random variables, describes the uncertainty of the parameters through the posterior distribution, and further derives the probability distribution of the prediction results; the risk-aware decision model specifically obtains as follows: (1) First, define the prior distribution of the model parameters. Assume that the model parameters are subject to a normal distribution: ; wherein is the prior variance.
[0107] (2) For the given observation data , wherein is the graph structure at time , is the corresponding soil moisture observation, the posterior distribution of the model parameters is ; where, is the likelihood function, is the marginal likelihood.
[0108] In this embodiment, since the posterior distribution cannot be directly calculated, the variational inference method is used to approximate the posterior distribution, and the variational distribution is introduced and parameterized as a diagonal Gaussian distribution, which is specifically represented by the following formula: ; where, and are variational parameters.
[0109] Since the goal of variational inference is to minimize the KL divergence between the variational distribution and the true posterior distribution , it is equivalent to maximizing the evidence lower bound (ELBO), which is represented by the following formula: ; where the first term is the expected log-likelihood, and the second term is the KL divergence between the prior distribution and the variational distribution.
[0110] In actual calculation, the expected log-likelihood is approximated by Monte Carlo sampling: ; where, is the parameter sampled from the variational distribution.
[0111] In this embodiment, in order to be able to optimize the variational parameters by gradient descent, the reparameterization trick is used, which is specifically represented by the following formula: ; where, represents element-wise multiplication.
[0112] The analytical solution of the KL divergence term is calculated by the following formula: ; (3) For a new input image , the soil moisture prediction distribution is calculated by the following formula: ; (4) Approximate by Monte Carlo sampling: ; where, is the parameter sampled from the variational distribution.
[0113] (4) Assume that the output follows a normal distribution: ; where, is the predicted output of the graph neural network with parameters for input , is the observation noise variance.
[0114] The mean and variance of the predicted soil moisture distribution are then given by: ; ; where the first term represents the irreducible error (e.g. measurement noise), and the second and third terms constitute the model uncertainty, reflecting the uncertainty in the parameter estimates.
[0115] (5) To distinguish between epistemic uncertainty (uncertainty due to limited model expressiveness) and aleatoric uncertainty (uncertainty due to inherent randomness in the data), the present embodiment employs a deep ensemble approach. Multiple models with different initializations and data samplings are trained, and the ensemble prediction is then computed, specifically by: ; Epistemic uncertainty can be estimated by the variance across models: ; Aleatoric uncertainty can be estimated by the average of the within-model variances: ; The total uncertainty is then: ; (6) Based on the predicted distribution and uncertainty estimates, a risk-aware decision support system is designed. For irrigation decision making, a risk function is defined as: ; where, is the irrigation amount (mm), is the soil moisture content (cm³ / cm³), is the field capacity, is the maximum allowable depletion, and are the cost coefficients for over-irrigation and under-irrigation, respectively.
[0116] (7) The optimal irrigation decision is to minimize the expected risk: ; The optimal irrigation decision considering the prediction uncertainty is obtained by solving the above optimization problem by numerical method.
[0117] In some embodiments, various risk indicators can be calculated based on the above soil moisture prediction distribution, such as the probability of exceeding a threshold value calculated by the following formula: ; The above risk indicators provide intuitive decision support information for greenhouse managers.
[0118] The training method of the soil moisture prediction model provided by the embodiments of the present application realizes accurate quantification of soil moisture prediction uncertainty through the construction of an uncertainty-aware probabilistic prediction framework, provides a scientific basis for risk-aware irrigation decision-making, avoids irrigation deficiency or excess caused by prediction errors, and improves greenhouse water resource utilization efficiency and crop yield stability.
[0119] Figure 2 is a flowchart of the training method of the soil moisture prediction model provided by the present application, and in the embodiment shown in Figure 2 The training method of the soil moisture prediction model comprises the following steps: S1 innovatively fuses multi-source heterogeneous sensing data, and solves the problem of sparse arrangement of sensors through a differentiable spatio-temporal interpolation strategy; S2 construct a hierarchical spatio-temporal graph for greenhouse east-west ridge planting, map the monitoring points at different positions in the greenhouse to graph network nodes, and express the physical association and water migration possibility through edge relationship.
[0120] S3 design a graph neural network architecture with double physical constraints, which fuses the water migration equation and the evapotranspiration model as explicit constraint conditions, and simultaneously introduces an adaptive attention mechanism; S4 develop a multi-view graph convolution module for east-west ridge differences, construct a soil moisture migration graph network from the horizontal and vertical profiles, and capture complex three-dimensional water movement characteristics through view fusion; S5 construct a long-term dependency modeling unit based on Transformer, capture the time evolution law of greenhouse soil moisture, and consider the influence of discrete interventions such as irrigation events and weather changes; S6 introduce crop physiological knowledge and design a root activity simulation module based on different crop physiological characteristics, which dynamically represents the difference in soil moisture absorption of crops at different growth stages and positions; S7 design an uncertainty-aware probabilistic prediction framework, which quantifies the prediction uncertainty through variational inference method, and provides a scientific basis for precise irrigation decision-making.
[0121] The soil moisture prediction method provided by the present application is described below. The soil moisture prediction method described below can be mutually referred to the training method of the soil moisture prediction model described above.
[0122] Figure 3 is a flowchart of the soil moisture prediction method provided by the present application, as shown in Figure 3 The soil moisture prediction method comprises the following steps: Step 310, acquiring the spatio-temporal graph features corresponding to the measured multi-source heterogeneous data in the greenhouse east-west ridge planting scene.
[0123] In this step, the measured multi-source heterogeneous data can be obtained from a public database or collected in real time by a plurality of sensors arranged in the greenhouse.
[0124] In this step, the spatio-temporal graph features can be obtained by fusing the measured multi-source heterogeneous data to the graph neural network nodes.
[0125] Step 320, processing the spatio-temporal graph features based on the soil moisture prediction model to obtain the target soil moisture prediction result; wherein the soil moisture prediction model is trained by the training method of the soil moisture prediction model.
[0126] In this step, the soil moisture prediction model is trained by the following steps: (1) In the greenhouse east-west ridge planting scene, the features composed of sample multi-source heterogeneous data and monitoring points in the greenhouse are used as graph node vectors, and the position correlation and water migration prediction between the graph nodes are used as edge vectors to construct a graph neural network; wherein the sample multi-source heterogeneous data includes at least two of soil moisture sensor data, meteorological data, and image monitoring data; (2) The migration information of the soil moisture sensor data is reconstructed in three dimensions to obtain the soil moisture motion characteristics, and the edge vectors are updated according to the soil moisture motion characteristics; the soil moisture is subjected to graph convolution operation to obtain a plurality of view features, and the plurality of view features are sequentially fused and position encoded, and the graph node vectors are updated according to the encoded view features to obtain an updated graph neural network; (3) The target network is iteratively trained according to the sample multi-source heterogeneous data to obtain the soil moisture prediction model; wherein the target network comprises at least one of the updated graph neural network, the long-term dependency modeling unit and the root activity simulation unit; the long-term dependency modeling unit is used to predict the time evolution law of soil moisture; the long-term dependency modeling unit is used to predict the difference in soil moisture absorption capacity of crops at different growth stages and different positions.
[0127] It should be noted that the training steps (1)-(3) of the soil moisture prediction model correspond to the embodiments of steps 110-130 one by one, and this embodiment will not be repeated.
[0128] In this embodiment, the spatio-temporal graph features corresponding to the measured multi-source heterogeneous data are input into the soil moisture prediction model trained in the above steps, and the corresponding target soil moisture prediction result is output.
[0129] The soil moisture prediction method provided by the embodiment of the present application improves the accuracy of differentiated soil moisture prediction in sunlight greenhouse by using the soil moisture prediction model trained by the soil moisture prediction model training method in the greenhouse east-west ridge planting scene to predict the spatio-temporal graph features corresponding to the measured multi-source heterogeneous data.
[0130] The soil moisture prediction model training device provided by the present application is described below, and the soil moisture prediction model training device described below can be mutually corresponding to the soil moisture prediction model training method described above.
[0131] Figure 4 The structure diagram of the soil moisture prediction model training device provided by the present application is shown in FIG. 4, which comprises a network construction module 410, a network updating module 420 and a training module 430. Figure 4 The soil moisture prediction model training device comprises a network construction module 410, a network updating module 420 and a training module 430.
[0132] The network construction module 410 is configured to construct a graph neural network in the greenhouse east-west ridge planting scene, using the feature composed of the sample multi-source heterogeneous data and each monitoring point in the greenhouse as the graph node vector, and using the position correlation and water migration prediction between each graph node as the edge vector; wherein the sample multi-source heterogeneous data comprises at least two of soil moisture sensing data, meteorological data and image monitoring data. The network updating module 420 is configured to reconstruct the migration information of the soil moisture sensing data in three dimensions to obtain the soil moisture motion feature, and update the edge vector according to the soil moisture motion feature; perform graph convolution operation on different views of soil moisture to obtain a plurality of view features, sequentially fuse and position encode the plurality of view features, and update the graph node vector according to the encoded view features to obtain an updated graph neural network. The training module 430 is configured to iteratively train the target network according to the sample multi-source heterogeneous data to obtain a soil moisture prediction model; wherein the target network comprises at least one of the updated graph neural network, the long-term dependency modeling unit and the root activity simulation unit; the long-term dependency modeling unit is configured to predict the time evolution law of soil moisture; and the long-term dependency modeling unit is configured to predict the difference in soil moisture absorption capacity of crops at different growth stages and different positions.
[0133] The training device of the soil moisture prediction model provided by the embodiment of the present application can accurately represent the heterogeneity of the internal environment of the greenhouse and the spatial difference of the soil moisture, and improve the prediction accuracy of the soil moisture in the greenhouse.
[0134] The soil moisture prediction device provided by the present application is described below, and the soil moisture prediction device described below can be correspondingly referred to the soil moisture prediction method described above.
[0135] Figure 5 The soil moisture prediction device provided by the present application is described below, and the soil moisture prediction device described below can be correspondingly referred to the soil moisture prediction method described above. Figure 5 As shown in the structure diagram of the soil moisture prediction device provided by the present application, the soil moisture prediction device comprises a feature extraction module 510 and a prediction module 520.
[0136] The feature extraction module 510 is used to obtain the spatio-temporal graph feature corresponding to the measured multi-source heterogeneous data under the greenhouse east-west ridge planting scene. The prediction module 520 is used to process the spatio-temporal graph feature based on the soil moisture prediction model to obtain the target soil moisture prediction result, wherein the soil moisture prediction model is obtained by the training method of the soil moisture prediction model.
[0137] The soil moisture prediction device provided by the embodiment of the present application can improve the prediction accuracy of the differentiated soil moisture in the sunlight greenhouse by using the soil moisture prediction model trained by the training method of the soil moisture prediction model to predict the spatio-temporal graph feature corresponding to the measured multi-source heterogeneous data.
[0138] Figure 6 An example of the physical structure of an electronic device is shown in the structure diagram of the electronic device, as shown in Figure 6As shown, the electronic device can include a processor 610, a communications interface 620, a memory 630, and a communications bus 640, wherein the processor 610, the communications interface 620, and the memory 630 communicate with each other through the communications bus 640. The processor 610 can invoke a logical instruction in the memory 630 to execute a training method of a soil moisture prediction model, which includes: under a greenhouse east-west ridge planting scene, taking a feature composed of sample multi-source heterogeneous data and each monitoring point in the greenhouse as a graph node vector, and taking a position correlation and a water migration prediction between each graph node as an edge vector to construct a graph neural network; wherein the sample multi-source heterogeneous data includes at least two of soil moisture sensing data, meteorological data, and image monitoring data; performing three-dimensional reconstruction on migration information of the soil moisture sensing data to obtain a soil moisture movement feature, and updating the edge vector according to the soil moisture movement feature; performing graph convolution operation on different views of the soil moisture to obtain a plurality of view features, sequentially performing fusion and position coding on the plurality of view features, and updating the graph node vector according to the coded view features to obtain an updated graph neural network; iteratively training a target network according to the sample multi-source heterogeneous data to obtain the soil moisture prediction model; wherein the target network includes at least one of the updated graph neural network, a long-term dependency modeling unit, and a root activity simulation unit; the long-term dependency modeling unit is used to predict a time evolution law of the soil moisture; and the long-term dependency modeling unit is used to predict differences in soil moisture absorption capacity of crops at different growth stages and different positions.
[0139] Or execute a soil moisture prediction method, which includes: obtaining a spatio-temporal graph feature corresponding to measured multi-source heterogeneous data under a greenhouse east-west ridge planting scene; processing the spatio-temporal graph feature based on a soil moisture prediction model to obtain a target soil moisture prediction result; wherein the soil moisture prediction model is obtained by training the soil moisture prediction model through the training method of the soil moisture prediction model.
[0140] Moreover, the logic instructions in the memory 630 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the part of the prior art that contributes essentially or the part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0141] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor, so that the computer can execute the training method of the soil moisture prediction model provided by the above-mentioned method, the method comprises: in the greenhouse east-west ridge planting scene, taking the features composed of sample multi-source heterogeneous data and each monitoring point in the greenhouse as the graph node vector, and taking the position correlation and the water migration prediction between each graph node as the edge vector to construct a graph neural network; wherein the sample multi-source heterogeneous data comprises at least two of soil moisture sensing data, meteorological data and image monitoring data; the migration information of the soil moisture sensing data is three-dimensionally reconstructed to obtain the soil moisture movement characteristics, and the edge vector is updated according to the soil moisture movement characteristics; the graph convolution operation is performed on different views of the soil moisture to obtain a plurality of view characteristics, the plurality of view characteristics are sequentially fused and position coded, and the graph node vector is updated according to the coded view characteristics to obtain an updated graph neural network; the target network is iteratively trained according to the sample multi-source heterogeneous data to obtain a soil moisture prediction model; wherein the target network comprises at least one of the updated graph neural network, a long-term dependency modeling unit and a root activity simulation unit; the long-term dependency modeling unit is used to predict the time evolution law of soil moisture; the long-term dependency modeling unit is used to predict the difference in soil moisture absorption capacity of crops at different growth stages and different positions.
[0142] Or execute the soil moisture prediction method, the method comprises: obtaining the spatio-temporal graph features corresponding to the measured multi-source heterogeneous data in the greenhouse east-west ridge planting scene; processing the spatio-temporal graph features based on the soil moisture prediction model to obtain a target soil moisture prediction result; wherein the soil moisture prediction model is trained by the training method of the soil moisture prediction model.
[0143] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0144] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0145] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to part of the technical features; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A soil moisture prediction model training method, characterized in that: include: In a greenhouse east-west ridge planting scenario, a graph neural network is constructed using the features of sample multi-source heterogeneous data and each monitoring point in the greenhouse as graph node vectors, and the position associations between each graph node and the moisture migration prediction amount as edge vectors. The sample multi-source heterogeneous data includes at least two items of soil moisture sensor data, meteorological data, and image monitoring data. Performing three-dimensional reconstruction on the migration information of the soil moisture sensor data to obtain soil moisture motion features, and updating the edge vector based on the soil moisture motion features; performing a graph convolution operation on different views of the soil moisture to obtain multiple view features, sequentially fusing and position encoding the multiple view features, and updating the graph node vector based on the encoded view features to obtain an updated graph neural network; The target network is iteratively trained based on the multi-source heterogeneous data of the samples to obtain a soil moisture prediction model; wherein, the target network includes at least one of the updated graph neural network, the long-term dependency modeling unit and the root activity simulation unit; the long-term dependency modeling unit is used to predict the temporal evolution law of soil moisture; the long-term dependency modeling unit is used to predict the differences in the soil moisture absorption capacity of crops at different growth stages and locations.
2. The soil moisture prediction model training method according to claim 1, characterized in that: The target network includes the updated graph neural network; The iterative training of the target network according to the sample multi-source heterogeneous data to obtain the soil moisture prediction model includes: A physical-guided loss function is determined based on dual physical constraints, and a joint loss function is determined by combining the data-driven loss function; wherein one of the dual physical constraints is used to describe the movement of unsaturated soil moisture, and the other constraint is used to describe the process of soil moisture returning to the atmosphere through evaporation and plant transpiration; The sample multi-source heterogeneous data is used as a training sample, and the joint loss function is used as the loss function of the updated graph neural network. The soil moisture prediction model is obtained while satisfying the maximum number of network iterations.
3. The soil moisture prediction model training method according to claim 1, characterized in that: The target network includes the long-term dependency modeling unit; The long-term dependency modeling unit is trained by the following steps: Performing time position coding and seasonal coding on the time series information of the soil moisture, respectively, and obtaining a time series graph sequence according to the time position coding result, the seasonal coding result and the updated graph node vector; Encoding the time sequence graph sequence based on a multi-head self-attention mechanism to obtain an encoded representation of the time sequence graph sequence; fusing the time series graph sequence encoding representation with event features to obtain fused features; wherein the event features include at least one of an irrigation event, a rainfall event, and an abnormal temperature event; The sample soil moisture data is used as a training sample, and the fusion feature is used as an input feature to iteratively train the Transformer network to obtain the long-term dependency modeling unit.
4. The soil moisture prediction model training method according to claim 1, characterized in that: The target network includes the root activity simulation unit, and the root activity simulation unit supports integration with the updated graph neural network; The root activity simulation unit is trained by the following steps: Modeling the changes in root depth and horizontal extension radius of the target crop over time to obtain a root morphological development model; modeling the changes in root spatial density of the target crop over time to obtain a root density distribution model; modeling the changes in root water absorption rate of the target crop under different growth stages and environmental conditions to obtain a root water absorption model; The root activity simulation unit is constructed based on the root morphology development model, the root density distribution model and the root water absorption model.
5. The soil moisture prediction model training method according to claim 1, characterized in that: After obtaining the soil moisture prediction model, the method further includes: Establishing a parameter prior distribution according to the model parameters of the soil moisture prediction model based on a Bayesian neural network; Generating a variational posterior distribution of the model parameters based on the parameter prior distribution and observation data by a variational inference method; performing Monte Carlo sampling on a plurality of soil moisture prediction results output by the soil moisture prediction model based on the variational posterior distribution to obtain a soil moisture prediction distribution; Constructing a deep integrated uncertainty decomposition module based on the predicted probability distribution, and calculating the uncertainty components through the variance of each model; A risk-aware decision model is constructed based on the predicted probability distribution and the uncertainty component, and a target irrigation decision plan is generated by minimizing the expected risk function of the risk-aware decision model.
6. A soil moisture prediction method, characterized in that: include: Obtain the spatiotemporal graph features corresponding to the measured multi-source heterogeneous data in the east-west ridge planting scenario of the greenhouse; The spatiotemporal graph features are processed based on a soil moisture prediction model to obtain a target soil moisture prediction result; wherein the soil moisture prediction model is trained by the soil moisture prediction model training method according to any one of claims 1 to 5.
7. A training device for a soil moisture prediction model, characterized in that: include: A network construction module is configured to construct a graph neural network in a greenhouse east-west ridge planting scenario using features composed of sample multi-source heterogeneous data and each monitoring point in the greenhouse as graph node vectors, and using positional associations between graph nodes and moisture migration predictions as edge vectors; wherein the sample multi-source heterogeneous data includes at least two items of soil moisture sensor data, meteorological data, and image monitoring data; a network update module, configured to perform three-dimensional reconstruction on the migration information of the soil moisture sensor data to obtain soil moisture motion features, and update the edge vector based on the soil moisture motion features; perform graph convolution operations on different views of the soil moisture to obtain multiple view features, sequentially fuse and position-encode the multiple view features, and update the graph node vector based on the encoded view features to obtain an updated graph neural network; A training module is used to iteratively train the target network based on the multi-source heterogeneous data of the samples to obtain a soil moisture prediction model; wherein the target network includes at least one of the updated graph neural network, the long-term dependency modeling unit and the root activity simulation unit; the long-term dependency modeling unit is used to predict the temporal evolution law of soil moisture; the long-term dependency modeling unit is used to predict the differences in the soil moisture absorption capacity of crops at different growth stages and locations.
8. A soil moisture prediction device, characterized in that: include: The feature extraction module is used to obtain the spatiotemporal graph features corresponding to the measured multi-source heterogeneous data in the greenhouse east-west ridge planting scene; A prediction module is used to process the spatiotemporal graph features based on a soil moisture prediction model to obtain a target soil moisture prediction result; wherein, the soil moisture prediction model is trained by the soil moisture prediction model training method according to any one of claims 1 to 5.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the training method of the soil moisture prediction model according to any one of claims 1 to 5 or the soil moisture prediction method according to claim 6 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the training method of the soil moisture prediction model according to any one of claims 1 to 5 or the soil moisture prediction method according to claim 6 is implemented.
Citation Information
Cited By
Farmland intelligent irrigation and drainage decision-making method and equipment based on multi-source perception and reinforcement learning
CN121386434A