A soil moisture prediction method, device, medium and product
By constructing a Uformer deep learning network based on the LeWinTransformer module, the problem of insufficient accuracy of traditional soil moisture prediction methods in high resolution and small-scale changes is solved, and higher accuracy soil moisture prediction is achieved, especially in deep soil, where it shows higher reliability and stability.
Patent Information
- Application Number
- CN202510207916.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-02-25
AI Technical Summary
Traditional soil moisture prediction methods have low accuracy in terms of high spatial and temporal resolution, especially in the early stages of drought where they are difficult to capture small-scale dynamic changes, and the sparseness of observation stations increases the difficulty of prediction.
Soil moisture prediction is achieved by using a Uformer deep learning network built on the LeWinTransformer module. By acquiring time-series soil moisture data and training the model using the training set, soil moisture prediction for the period to be predicted can be realized.
It improves the accuracy of soil moisture prediction, especially showing higher reliability and stability in deep soils, and reduces the accumulation of errors in long-term predictions.
Smart Images

Figure CN120144903B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of humidity prediction, in particular to a soil humidity prediction method and device, medium and product. BACKGROUND
[0002] Soil humidity is an important part of surface water cycle and has a crucial influence on agricultural production, ecological environment and hydrological process. In drought weather disaster monitoring and early warning, accurate soil humidity prediction can effectively help decision-makers assess the severity of drought and develop response measures. However, soil humidity data has high spatial and temporal variability, and traditional numerical models have significant limitations in describing it, especially in terms of high spatial and temporal resolution, which is difficult to meet the needs of modern precision agriculture and environmental monitoring.
[0003] In current meteorological services, the prediction of soil humidity often relies on the soil module in meteorological models, but these models mainly focus on large-scale meteorological processes and fail to fully consider the dynamic changes of soil humidity at small scales. In particular, in the early stages of drought, the changes in soil humidity respond quickly to changes in the external environment, but these subtle changes are easily overlooked by traditional prediction methods. In addition, the spatial sparseness of observation stations further increases the difficulty of accurate prediction, especially in areas with complex terrain or lack of observation resources, which cannot fully consider the spatial and temporal characteristics, resulting in low prediction accuracy of soil humidity. SUMMARY
[0004] The purpose of the application is to provide a soil humidity prediction method, device, medium and product to solve the problem of low soil humidity prediction accuracy.
[0005] To achieve the above purpose, the application provides the following solutions.
[0006] In a first aspect, the application provides a soil humidity prediction method, comprising:
[0007] obtaining target soil humidity time series data; the target soil humidity time series data includes true values of soil humidity of each position of a to-be-predicted area at each historical time in a historical period;
[0008] inputting the target soil humidity time series data into a soil humidity prediction model to obtain predicted values of soil humidity of each position of the to-be-predicted area at each to-be-predicted time in a to-be-predicted period; the soil humidity prediction model is obtained by training a training set and a Uformer deep learning network, and the Uformer deep learning network is constructed based on a LeWinTransformer module.
[0009] Optionally, the training process of the soil humidity prediction model comprises:
[0010] obtaining the training set; the training set comprises a plurality of sets of training data, and each set of training data comprises true values of soil moisture of positions of sample areas at historical time points in two adjacent historical periods;
[0011] constructing the Uformer deep learning network based on the LeWin Transformer module;
[0012] training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model.
[0013] Optionally, the Uformer deep learning network comprises, in sequence, an input projection module, an encoder, a bottleneck layer, a decoder, and an output projection module, and the encoder and the decoder are connected in a skip manner.
[0014] Optionally, the encoder comprises a plurality of LeWin Transformer modules and a plurality of down-sampling modules, the bottleneck layer comprises one LeWin Transformer module, the decoder comprises a plurality of LeWin Transformer modules and a plurality of up-sampling modules, and the number of LeWin Transformer modules and down-sampling modules in the encoder and the number of LeWin Transformer modules and up-sampling modules in the decoder are equal.
[0015] Optionally, the target soil moisture time series data are input into the soil moisture prediction model to obtain predicted values of soil moisture of positions of a to-be-predicted area at to-be-predicted time points in a to-be-predicted period, comprising:
[0016] performing convolution operation on the target soil moisture time series data in the input projection module in the soil moisture prediction model to obtain initial features of the to-be-predicted area;
[0017] performing multiple windowed self-attention operations, local enhancement, and down-sampling processing on the initial features of the to-be-predicted area in the encoder in the soil moisture prediction model to obtain encoded features of the to-be-predicted area;
[0018] performing windowed self-attention operation and local enhancement processing on the encoded features of the to-be-predicted area in the bottleneck layer in the soil moisture prediction model to obtain features of the to-be-predicted area processed by the bottleneck layer;
[0019] performing multiple windowed self-attention operations, local enhancement, and up-sampling processing on the features of the to-be-predicted area processed by the bottleneck layer in the decoder in the soil moisture prediction model to obtain decoded features of the to-be-predicted area;
[0020] The decoded features of the to-be-predicted region are input into an output projection module in the soil moisture prediction model for convolution operation to obtain the prediction value of the soil moisture of each position of the to-be-predicted region at each to-be-predicted time in the to-be-predicted period.
[0021] Optionally, the Uformer deep learning network is trained by using the training set to obtain the soil moisture prediction model, including:
[0022] Based on the power spectral density and the mean square error, the real value of the soil moisture of each position of the sample region at the previous historical time in each group of training data in the training set is taken as input, and the real value of the soil moisture of each position of the sample region at the corresponding next historical time is taken as output, and the Uformer deep learning network is trained to obtain the soil moisture prediction model.
[0023] Optionally, after the Uformer deep learning network is trained by using the training set to obtain the soil moisture prediction model, the method further includes:
[0024] The performance of the soil moisture prediction model is evaluated by using the mean square error.
[0025] In a second aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the soil moisture prediction method of any one of the above aspects.
[0026] In a third aspect, the present application provides a computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the soil moisture prediction method of any one of the above aspects.
[0027] In a fourth aspect, the present application provides a computer program product, including a computer program, and the computer program is executed by a processor to implement the soil moisture prediction method of any one of the above aspects.
[0028] According to the embodiments of the present application, the following technical effects are disclosed:
[0029] The application discloses a soil humidity prediction method and device, a medium and a product. First, target soil humidity time series data is acquired; the target soil humidity time series data includes real values of soil humidity of each position of a to-be-predicted area at each historical moment in a historical period; then, the target soil humidity time series data is input into a soil humidity prediction model to obtain prediction values of soil humidity of each position of the to-be-predicted area at each to-be-predicted moment in a to-be-predicted period; the soil humidity prediction model is obtained by training a training set and a Uformer deep learning network, and the Uformer deep learning network is constructed based on a LeWinTransformer module. The soil humidity prediction model based on the LeWin Transformer module is used to predict soil humidity, and the prediction accuracy of soil humidity is improved. BRIEF DESCRIPTION OF DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0031] Figure 1 A soil humidity prediction method flowchart is provided for an embodiment of the present application.
[0032] Figure 2 A Uformer deep learning network structure diagram is provided.
[0033] Figure 3 A LeWin Transformer module structure diagram is provided.
[0034] Figure 4 A LEFF structure diagram is provided.
[0035] Figure 5 A mean square error curve diagram is provided.
[0036] Figure 6 A computer device structure diagram is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0038] The application aims to provide a soil humidity prediction method, device, medium and product, and aims to improve the prediction accuracy of soil humidity.
[0039] In order to make the above-mentioned purposes, features and advantages of the application more obvious and easy to understand, the application will be further described in detail below in combination with the drawings and specific embodiments.
[0040] In an exemplary embodiment, as shown in Figure 1 a soil humidity prediction method is provided, comprising:
[0041] Step 1: obtaining target soil humidity time series data; the target soil humidity time series data includes the true values of the soil humidity of each position of the target area at each historical time in the historical period.
[0042] Step 2: inputting the target soil humidity time series data into a soil humidity prediction model to obtain the predicted values of the soil humidity of each position of the target area at each predicted time in the predicted period.
[0043] The soil humidity prediction model is obtained by training the Uformer deep learning network using the training set.
[0044] As an optional implementation, in step 2, the training process of the soil humidity prediction model comprises:
[0045] Step 211: obtaining a training set; the training set includes multiple groups of training data, and the training data includes the true values of the soil humidity of each position of the sample area at each historical time in the adjacent two historical periods.
[0046] Step 212: constructing a Uformer deep learning network based on a LeWin Transformer module.
[0047] As an optional implementation, as shown in Figure 2 the Uformer deep learning network comprises an input projection module, an encoder, a bottleneck layer, a decoder and an output projection module connected in sequence, and the encoder and the decoder are connected in a skip manner.
[0048] As an optional implementation, the encoder comprises a plurality of LeWin Transformer modules and a plurality of down-sampling modules, the bottleneck layer comprises one LeWin Transformer module, the decoder comprises a plurality of LeWin Transformer modules and a plurality of up-sampling modules, and the number of the LeWin Transformer modules and the down-sampling modules in the encoder and the number of the LeWin Transformer modules and the up-sampling modules in the decoder are equal.
[0049] Specifically, as shown in Figure 3 The LeWin Transformer module comprises two layer normalization layers (LN), a windowed self-attention mechanism module (W-MSA) and a locally-enhanced feed-backward (LeFF) network.
[0050] As shown in Figure 4 The LeFF comprises two 1x1 convolution (Conv) layers, a flatten layer, a 3x3 depth-wise convolution layer and a Reshape function.
[0051] Step 213: training the Uformer deep learning network by using the training set to obtain a soil moisture prediction model.
[0052] As an optional implementation, step 213 comprises:
[0053] Step 2131: training the Uformer deep learning network by taking the real values of the soil moisture at each position of the sample area at the previous historical time in each group of training data in the training set as input and taking the real values of the soil moisture at each position of the sample area at the corresponding next historical time as output, to obtain a soil moisture prediction model.
[0054] Specifically, the training process at any current training time in step 2131 comprises:
[0055] (1) inputting the real values of the soil moisture at each position of the sample area at the previous historical time in each group of training data in the training set into the Uformer deep learning network at the current training time to obtain the predicted values of the soil moisture at each position of the sample area at the corresponding next historical time at the current training time.
[0056] (2) using the mean square error calculation formula, based on the predicted value of the soil moisture of each position of the sample area at the next historical time under the current training number in each group of training data and the true value of the soil moisture of each position of the sample area at the next historical time corresponding to the predicted value, the mean square error under the current training number is calculated; the mean square error calculation formula is:
[0057]
[0058] Wherein, MSE is the mean square error; N is the total number of training data in the training set; P pred,i is the predicted value of the soil moisture of each position of the sample area at the next historical time in the i th group of training data; P true,i is the true value of the soil moisture of each position of the sample area at the next historical time in the i th group of training data.
[0059] (3) using the KL divergence calculation formula, based on the predicted value of the soil moisture of each position of the sample area at the next historical time under the current training number in each group of training data and the true value of the soil moisture of each position of the sample area at the next historical time corresponding to the predicted value, the KL divergence under the current training number is calculated; the KL divergence calculation formula includes:
[0060]
[0061]
[0062] Wherein, KL is the KL divergence; PSD pred,i is the normalized power spectral density corresponding to the predicted value of the soil moisture of each position of the sample area at the next historical time in the i th group of training data; PSD t ' rue,i is the normalized power spectral density corresponding to the true value of the soil moisture of each position of the sample area at the next historical time in the i th group of training data; PSD pred,i is the original power spectral density corresponding to the predicted value of the soil moisture of each position of the sample area at the next historical time in the i th group of training data; PSD pred,j is the original power spectral density corresponding to the predicted value of the soil moisture of each position of the sample area at the next historical time in the j th group of training data; PSD true,i is the original power spectral density corresponding to the true value of the soil moisture of each position of the sample area at the next historical time in the i th group of training data; PSD true,j is the original power spectral density corresponding to the true value of the soil moisture of each position of the sample area at the next historical time in the j th group of training data; M pred,i is the amplitude spectrum corresponding to the predicted value of the soil moisture of each position of the sample area at the next historical time in the i th group of training data; Mtrue,i is a magnitude spectrum corresponding to the true value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; FFT is a Fourier transform result of the predicted value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; FFT is a Fourier transform result of the true value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; |·| is an absolute value symbol; F(·) is a Fourier transform. pred,i is a magnitude spectrum corresponding to the true value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; FFT is a Fourier transform result of the predicted value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; FFT is a Fourier transform result of the true value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; |·| is an absolute value symbol; F(·) is a Fourier transform. true,i is a magnitude spectrum corresponding to the true value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; FFT is a Fourier transform result of the predicted value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; FFT is a Fourier transform result of the true value of the soil moisture of each position of the sample area at the later historical moment in the i-th group of training data; |·| is an absolute value symbol; F(·) is a Fourier transform.
[0063] (4) calculating the total loss at the current training number based on the mean square error and the KL divergence at the current training number by using a total loss calculation formula; the total loss calculation formula is:
[0064] LOSS=MSE+KL.
[0065] wherein, LOSS is the total loss.
[0066] (5) calculating the difference between the total loss at the current training number and the total loss at the last training number to obtain the difference at the current training number.
[0067] (6) judging whether the stopping condition is met; the stopping condition is that the difference at the current training number is less than a preset difference or a preset training number is reached.
[0068] (7) if yes, determining the Uformer deep learning network at the current training number as the soil moisture prediction model.
[0069] (8) if no, adjusting the parameters of the Uformer deep learning network at the current training number, and returning to “inputting the true value of the soil moisture of each position of the sample area at the earlier historical moment in each group of training data in the training set into the Uformer deep learning network at the current training number to obtain the predicted value of the soil moisture of each position of the sample area at the later historical moment corresponding to the current training number”, until the stopping condition is met, to obtain the soil moisture prediction model.
[0070] As an optional implementation, after step 213, it further includes:
[0071] using the mean square error to evaluate the performance of the soil moisture prediction model.
[0072] As an optional implementation, step 2 includes:
[0073] Step 221: inputting the target soil moisture time series data into the input projection module in the soil moisture prediction model for convolution operation to obtain the initial features of the region to be predicted.
[0074] Step 222: input the initial features of the to-be-predicted region into the encoder in the soil moisture prediction model for multiple windowed self-attention operations, local enhancement, and down-sampling processing to obtain encoded features of the to-be-predicted region.
[0075] Specifically, at each stage of the encoder, the initial features pass through a set of LeWin Transformer modules and cooperate with the down-sampling layer to gradually reduce the spatial resolution and increase the channel number, forming multi-scale humidity features, i.e., encoded features. The LeWin Transformer module uses W-MSA to capture long-range dependencies and reduces computational complexity through non-overlapping windows, making the processing of large-scale soil moisture data more efficient.
[0076] Specifically, the formula for the windowed self-attention operation and local enhancement of the gth LeWin Transformer module (referred to as LeWin module) in the encoder on the input features is:
[0077] X' g = WMSA(LN(X g-1 ))+X g-1 .
[0078] X g = LEFF(LN(X' g ))+X' g .
[0079] where X' g is the intermediate feature of the gth LeWin Transformer module; WMSA(·) is the windowed self-attention operation of W-MSA; LN(·) is the layer normalization operation of the layer normalization layer; X g-1 is the feature output by the (g-1)th LeWin Transformer module; X g is the feature output by the gth LeWin Transformer module; and LEFF(·) is the local enhancement by LeFF.
[0080] Step 223: input the encoded features of the to-be-predicted region into the bottleneck layer in the soil moisture prediction model for windowed self-attention operation and local enhancement processing to obtain the features of the to-be-predicted region after bottleneck layer processing.
[0081] Specifically, the bottleneck layer is located between the encoder and the decoder, responsible for compressing and globally aggregating features, thereby extracting longer-range humidity change information. Through the bottleneck layer, the model can learn more extensive humidity distribution and dynamics, thereby providing the decoder with richer feature input.
[0082] Step 224: input the processed features of the bottleneck layer of the to-be-predicted region into the decoder in the soil moisture prediction model for multiple windowing self-attention operations, local enhancement and up-sampling processing to obtain decoding features of the to-be-predicted region.
[0083] Specifically, the up-sampling layer gradually restores the spatial resolution of the feature map through inverse convolution operation (transpose convolution), and at each stage, the feature fusion is performed with the corresponding layer of the encoder through the jump connection, so as to ensure the consistency of local details and global semantics.
[0084] Step 225: input the decoding features of the to-be-predicted region into the output projection module in the soil moisture prediction model for convolution operation to obtain the prediction value of the soil moisture of each position of the to-be-predicted region at each to-be-predicted time in the to-be-predicted period.
[0085] Further, in order to verify the method of the present application, the mean square error (MSE) of soil moisture prediction at three different depths of 0-10 cm, 10 cm-40 cm and 40 cm-100 cm is also evaluated, and the evaluation period is from the first day to the seventh day in the future. Table 1 details the mean square error of soil moisture prediction at different depths. The mean square error curve corresponding to Table 1 is shown in Figure 5 .
[0086] Table 1 Mean square error table
[0087]
[0088]
[0089] Based on Table 1 and Figure 5 The following conclusions can be drawn:
[0090] 1) 0-10 cm surface soil moisture prediction.
[0091] In the surface soil, the MSE increases significantly day by day, from 0.0259 on the first day to 0.1519 on the seventh day. This shows that as the prediction time increases, the error accumulates and the prediction accuracy gradually decreases. The surface soil is more susceptible to external factors such as precipitation, temperature and wind speed, making it more difficult to predict.
[0092] This error growth trend indicates that the soil moisture prediction model is more disturbed in the prediction of surface soil moisture, especially in long-term prediction, it may be difficult to fully capture the short-term dramatic changes of the surface soil.
[0093] 2) 10 cm-40 cm middle layer soil moisture prediction.
[0094] The prediction error of the middle layer soil increased from 0.0087 on the first day to 0.0648 on the seventh day, with a significant increase, but the overall error was relatively small compared to the surface layer. As the prediction days increased, the MSE value showed a stable growth trend, but there was no sharp change as in the surface layer.
[0095] This indicates that the humidity of the middle layer soil is relatively less affected by the surface layer, with a more stable humidity change rule, and the soil moisture prediction model is relatively more accurate in capturing the humidity change of this layer.
[0096] 3) Prediction of soil humidity at a depth of 40-100 cm.
[0097] The prediction error of the deep layer soil was the smallest, increasing from 0.0034 on the first day to 0.0503 on the seventh day. This trend shows that the humidity change of the deep layer soil is the most stable, and the soil humidity prediction model has a slow error growth when predicting the deep layer soil humidity, with relatively stable prediction performance.
[0098] Since the deep layer soil humidity is less affected by external environmental changes, the soil humidity prediction model is easier to learn and fit the humidity change of the deep layer, which makes the prediction result of the deep layer soil more reliable and stable.
[0099] Overall error trend: Overall, the prediction error increases over time, which is a common phenomenon in time series prediction models, as long-term prediction leads to the accumulation of errors.
[0100] 4) Differences between surface and deep layers.
[0101] The error of the surface layer soil humidity increased most significantly, especially during the fifth to seventh days, with a larger increase in error. The humidity of the surface layer soil is affected by multiple external factors such as precipitation and evaporation, with strong volatility, increasing the difficulty of prediction.
[0102] The deep layer soil humidity prediction performed most stably, with a slow error growth, indicating that the deep layer soil humidity change is small, and the soil humidity prediction model can better grasp the characteristics of the deep layer humidity change.
[0103] In an exemplary embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor executing the computer program to implement the soil humidity prediction method.
[0104] In an exemplary embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which is executed by a processor to implement the soil humidity prediction method.
[0105] In an exemplary embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the soil moisture prediction method.
[0106] In an exemplary embodiment, a computer device is provided, which can be a server or a terminal, and an internal structure diagram thereof can be as shown in Figure 6 The computer device comprises a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through network connection. The computer program is executed by the processor to implement a soil moisture prediction method.
[0107] Those skilled in the art can understand that Figure 6 The structure shown in the above
[0108] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0109] The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0110] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0111] The principles and implementation modes of the present application are described by applying specific examples herein. The above description of the embodiments is only used to help understand the method and its core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range can be changed. In conclusion, the content of the present application should not be understood as a limitation.
Claims
1. A soil moisture prediction method characterized by, The soil moisture prediction method comprises: obtaining target soil moisture time series data; the target soil moisture time series data comprises real values of soil moisture of each position of a to-be-predicted region at each historical time in a historical period; inputting the target soil moisture time series data into a soil moisture prediction model to obtain predicted values of soil moisture of each position of the to-be-predicted region at each to-be-predicted time in a to-be-predicted period; the soil moisture prediction model is obtained by training a training set and a Uformer deep learning network, and the Uformer deep learning network is constructed based on a LeWinTransformer module; the training process of the soil moisture prediction model comprises: obtaining the training set; the training set comprises multiple groups of training data, and the training data comprises real values of soil moisture of each position of a sample region at each historical time in adjacent two historical periods; constructing the Uformer deep learning network based on the LeWin Transformer module; training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model; the Uformer deep learning network comprises an input projection module, an encoder, a bottleneck layer, a decoder and an output projection module connected in sequence, and the encoder and the decoder are connected in jump mode; training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: wherein MSE is the mean square error; N is the total number of training data sets in the training set; P pred,i is the predicted value of the soil moisture at each position of the sample region at the later historical time in the i-th training data set; P true,i is the true value of the soil moisture at each position of the sample region at the later historical time in the i-th training data set. training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain the soil moisture prediction model comprises: training the Uformer deep learning network by using the training set to obtain wherein KL is the KL divergence; PSD pred,i is the normalized power spectral density corresponding to the predicted value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; PSD true,i is the normalized power spectral density corresponding to the true value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; PSD pred,i is the original power spectral density corresponding to the predicted value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; PSD pred,j is the original power spectral density corresponding to the predicted value of the soil moisture of each position of the sample area at the later historical time in the j-th set of training data; PSD true,i is the original power spectral density corresponding to the true value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; PSD true,j is the original power spectral density corresponding to the true value of the soil moisture of each position of the sample area at the later historical time in the j-th set of training data; M pred,i is the amplitude spectrum corresponding to the predicted value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; M true,i is the amplitude spectrum corresponding to the true value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; FFT pred,i is the Fourier transform result of the predicted value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; FFT true,i is the Fourier transform result of the true value of the soil moisture of each position of the sample area at the later historical time in the i-th set of training data; |·| is the absolute value symbol; F(·) is the Fourier transform; The total loss at the current training number is calculated based on the mean square error and the KL divergence at the current training number by using a total loss calculation formula, and the total loss calculation formula is: LOSS = MSE + KL; where LOSS is the total loss. A difference value at the current training number is obtained by calculating a difference between the total loss at the current training number and the total loss at the previous training number. It is determined whether a stop condition is met; the stop condition is that the difference value at the current training number is less than a preset difference value or a preset training number is reached. If yes, the Uformer deep learning network at the current training number is determined as the soil moisture prediction model. If no, the parameters of the Uformer deep learning network at the current training number are adjusted, and the soil moisture prediction model is obtained by returning to the step of inputting the real value of the soil moisture at each position of the sample area at the previous historical time in each group of training data in the training set into the Uformer deep learning network at the current training number until the stop condition is met.
2. The soil moisture prediction method according to claim 1, characterized by, The encoder includes a plurality of LeWinTransformer modules and a plurality of down-sampling modules, the bottleneck layer includes one LeWin Transformer module, the decoder includes a plurality of LeWin Transformer modules and a plurality of up-sampling modules, and the number of LeWinTransformer modules and down-sampling modules in the encoder and the number of LeWin Transformer modules and up-sampling modules in the decoder are equal.
3. The soil moisture prediction method according to claim 2, characterized in that, The target soil moisture time series data is input into the soil moisture prediction model to obtain the predicted value of the soil moisture at each position of the predicted area at each predicted time in the predicted period, including: The target soil moisture time series data is input into the input projection module of the soil moisture prediction model to perform convolution operation to obtain the initial feature of the predicted area; The initial feature of the predicted area is input into the encoder of the soil moisture prediction model to perform multiple window self-attention operations, local enhancement and down-sampling processing to obtain the encoding feature of the predicted area; The encoding feature of the predicted area is input into the bottleneck layer of the soil moisture prediction model to perform window self-attention operation and local enhancement processing to obtain the bottleneck layer processed feature of the predicted area; The encoding feature of the predicted area is input into the bottleneck layer of the soil moisture prediction model to perform window self-attention operation and local enhancement processing to obtain the bottleneck layer processed feature of the predicted area; The encoding feature of the predicted area is input into the bottleneck layer of the soil moisture prediction model to perform window self-attention operation and local enhancement processing to obtain the bottleneck layer processed feature of the predicted area; 4. The soil moisture prediction method according to claim 1, characterized by, The encoding feature of the predicted area is input into the output projection module of the soil moisture prediction model to perform convolution operation to obtain the predicted value of the soil moisture at each position of the predicted area at each predicted time in the predicted period. After the Uformer deep learning network is trained by using the training set to obtain the soil moisture prediction model, the performance of the soil moisture prediction model is evaluated by using the mean square error.
5. A computer apparatus comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that the processor executes the computer program to implement the soil moisture prediction method of any one of claims 1-4.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the soil moisture prediction method of any one of claims 1-4.
7. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the soil moisture prediction method of any one of claims 1-4.
Citation Information
Patent Citations
Soil space temperature and humidity prediction method, device, equipment, medium and program product
CN118132964A